@buoy-gg/impersonate 7.0.41 → 7.0.43
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 +12 -80
- package/lib/commonjs/impersonate/components/DataNukeSettings.js +8 -675
- package/lib/commonjs/impersonate/components/ImpersonateBanner.js +1 -221
- package/lib/commonjs/impersonate/components/ImpersonateHistoryList.js +1 -181
- package/lib/commonjs/impersonate/components/ImpersonateModal.js +1 -319
- package/lib/commonjs/impersonate/components/ImpersonateOverlay.js +1 -26
- package/lib/commonjs/impersonate/components/ImpersonateStatusBar.js +1 -130
- package/lib/commonjs/impersonate/components/UserAvatar.js +1 -146
- package/lib/commonjs/impersonate/components/UserCard.js +1 -201
- package/lib/commonjs/impersonate/components/UserSearchView.js +1 -227
- package/lib/commonjs/impersonate/hooks/asyncStoragePeer.js +1 -17
- package/lib/commonjs/impersonate/hooks/asyncStoragePeer.web.js +1 -11
- package/lib/commonjs/impersonate/hooks/useAutoClearAsyncStorage.js +1 -134
- package/lib/commonjs/impersonate/hooks/useAutoClearReactQuery.js +1 -155
- package/lib/commonjs/impersonate/hooks/useAutoClearReactQuery.web.js +1 -20
- package/lib/commonjs/impersonate/hooks/useAutoClearRedux.js +1 -188
- package/lib/commonjs/impersonate/hooks/useAutoClearRedux.web.js +1 -27
- package/lib/commonjs/impersonate/hooks/useImpersonate.js +1 -215
- package/lib/commonjs/impersonate/hooks/useImpersonateHistory.js +1 -56
- package/lib/commonjs/impersonate/types/index.js +1 -16
- package/lib/commonjs/impersonate/types/types.js +1 -1
- package/lib/commonjs/impersonate/utils/impersonateListener.js +1 -350
- package/lib/commonjs/impersonate/utils/impersonateStore.js +1 -689
- package/lib/commonjs/index.js +1 -150
- package/lib/commonjs/preset.js +1 -232
- package/lib/commonjs/sync/impersonateSyncAdapter.js +1 -170
- package/lib/module/impersonate/components/DataNukeSettings.js +8 -670
- package/lib/module/impersonate/components/ImpersonateBanner.js +1 -215
- package/lib/module/impersonate/components/ImpersonateHistoryList.js +1 -176
- package/lib/module/impersonate/components/ImpersonateModal.js +1 -314
- package/lib/module/impersonate/components/ImpersonateOverlay.js +1 -21
- package/lib/module/impersonate/components/ImpersonateStatusBar.js +1 -125
- package/lib/module/impersonate/components/UserAvatar.js +1 -140
- package/lib/module/impersonate/components/UserCard.js +1 -196
- package/lib/module/impersonate/components/UserSearchView.js +1 -222
- package/lib/module/impersonate/hooks/asyncStoragePeer.js +1 -13
- package/lib/module/impersonate/hooks/asyncStoragePeer.web.js +1 -6
- package/lib/module/impersonate/hooks/useAutoClearAsyncStorage.js +1 -130
- package/lib/module/impersonate/hooks/useAutoClearReactQuery.js +1 -151
- package/lib/module/impersonate/hooks/useAutoClearReactQuery.web.js +1 -16
- package/lib/module/impersonate/hooks/useAutoClearRedux.js +1 -183
- package/lib/module/impersonate/hooks/useAutoClearRedux.web.js +1 -22
- package/lib/module/impersonate/hooks/useImpersonate.js +1 -212
- package/lib/module/impersonate/hooks/useImpersonateHistory.js +1 -52
- package/lib/module/impersonate/types/index.js +1 -3
- package/lib/module/impersonate/types/types.js +1 -1
- package/lib/module/impersonate/utils/impersonateListener.js +1 -341
- package/lib/module/impersonate/utils/impersonateStore.js +1 -686
- package/lib/module/index.js +1 -117
- package/lib/module/preset.js +1 -216
- package/lib/module/sync/impersonateSyncAdapter.js +1 -162
- package/lib/web/index.mjs +7 -8
- package/package.json +3 -6
- package/lib/typescript/impersonate/components/DataNukeSettings.d.ts.map +0 -1
- package/lib/typescript/impersonate/components/ImpersonateBanner.d.ts.map +0 -1
- package/lib/typescript/impersonate/components/ImpersonateHistoryList.d.ts.map +0 -1
- package/lib/typescript/impersonate/components/ImpersonateModal.d.ts.map +0 -1
- package/lib/typescript/impersonate/components/ImpersonateOverlay.d.ts.map +0 -1
- package/lib/typescript/impersonate/components/ImpersonateStatusBar.d.ts.map +0 -1
- package/lib/typescript/impersonate/components/UserAvatar.d.ts.map +0 -1
- package/lib/typescript/impersonate/components/UserCard.d.ts.map +0 -1
- package/lib/typescript/impersonate/components/UserSearchView.d.ts.map +0 -1
- package/lib/typescript/impersonate/hooks/asyncStoragePeer.d.ts.map +0 -1
- package/lib/typescript/impersonate/hooks/asyncStoragePeer.web.d.ts.map +0 -1
- package/lib/typescript/impersonate/hooks/useAutoClearAsyncStorage.d.ts.map +0 -1
- package/lib/typescript/impersonate/hooks/useAutoClearReactQuery.d.ts.map +0 -1
- package/lib/typescript/impersonate/hooks/useAutoClearReactQuery.web.d.ts.map +0 -1
- package/lib/typescript/impersonate/hooks/useAutoClearRedux.d.ts.map +0 -1
- package/lib/typescript/impersonate/hooks/useAutoClearRedux.web.d.ts.map +0 -1
- package/lib/typescript/impersonate/hooks/useImpersonate.d.ts.map +0 -1
- package/lib/typescript/impersonate/hooks/useImpersonateHistory.d.ts.map +0 -1
- package/lib/typescript/impersonate/types/index.d.ts.map +0 -1
- package/lib/typescript/impersonate/types/types.d.ts.map +0 -1
- package/lib/typescript/impersonate/utils/impersonateListener.d.ts.map +0 -1
- package/lib/typescript/impersonate/utils/impersonateStore.d.ts.map +0 -1
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/sync/impersonateSyncAdapter.d.ts.map +0 -1
package/lib/web/index.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var yt=Object.defineProperty;var mo=Object.getOwnPropertyDescriptor;var ho=Object.getOwnPropertyNames;var yo=Object.prototype.hasOwnProperty;var fo=(t,e)=>{for(var o in e)yt(t,o,{get:e[o],enumerable:!0})},ht=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ho(e))!yo.call(t,r)&&r!==o&&yt(t,r,{get:()=>e[r],enumerable:!(n=mo(e,r))||n.enumerable});return t},I=(t,e,o)=>(ht(t,e,"default"),o&&ht(o,e,"default"));typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import So from"@buoy-gg/shared-ui/web/asyncStorage";function ve(){return So}import{useState as Ze,useCallback as he,useRef as Nt,useEffect as Lt}from"react";var f={};fo(f,{AccessibilityInfo:()=>Uo,ActivityIndicator:()=>De,Alert:()=>Ao,Animated:()=>Bo,AppRegistry:()=>No,AppState:()=>Lo,Appearance:()=>Do,BackHandler:()=>Eo,Button:()=>ko,CheckBox:()=>Go,Clipboard:()=>Vo,DeviceEventEmitter:()=>gr,Dimensions:()=>zo,Easing:()=>Oo,FlatList:()=>ae,I18nManager:()=>Wo,Image:()=>Zo,ImageBackground:()=>er,InteractionManager:()=>Fo,Keyboard:()=>Mo,KeyboardAvoidingView:()=>tr,LayoutAnimation:()=>Ko,Linking:()=>_o,LogBox:()=>pr,Modal:()=>Co,NativeEventEmitter:()=>Xo,NativeModules:()=>Po,PanResponder:()=>qo,Picker:()=>or,PixelRatio:()=>Qo,Platform:()=>jo,Pressable:()=>Io,ProgressBar:()=>rr,RefreshControl:()=>nr,SafeAreaView:()=>sr,ScrollView:()=>Be,SectionList:()=>ar,Share:()=>$o,StatusBar:()=>ir,StyleSheet:()=>H,Switch:()=>To,Text:()=>u,TextInput:()=>Ue,Touchable:()=>cr,TouchableHighlight:()=>xo,TouchableNativeFeedback:()=>lr,TouchableOpacity:()=>C,TouchableWithoutFeedback:()=>wo,UIManager:()=>Jo,Vibration:()=>Yo,View:()=>s,VirtualizedList:()=>dr,YellowBox:()=>ur,findNodeHandle:()=>Ro,unstable_createElement:()=>Ho,useColorScheme:()=>mr,useLocaleContext:()=>hr,useWindowDimensions:()=>yr});I(f,Xn);import*as Xn from"react-native-web";import{unstable_createElement as Ho,NativeModules as Po,AccessibilityInfo as Uo,Animated as Bo,Appearance as Do,AppRegistry as No,AppState as Lo,BackHandler as Eo,Clipboard as Vo,Dimensions as zo,Easing as Oo,I18nManager as Wo,Keyboard as Mo,InteractionManager as Fo,LayoutAnimation as Ko,Linking as _o,NativeEventEmitter as Xo,PanResponder as qo,PixelRatio as Qo,Platform as jo,Share as $o,StyleSheet as H,UIManager as Jo,Vibration as Yo,CheckBox as Go,FlatList as ae,Image as Zo,ImageBackground as er,KeyboardAvoidingView as tr,Picker as or,ProgressBar as rr,RefreshControl as nr,SafeAreaView as sr,SectionList as ar,StatusBar as ir,Touchable as cr,TouchableNativeFeedback as lr,VirtualizedList as dr,YellowBox as ur,LogBox as pr,DeviceEventEmitter as gr,useColorScheme as mr,useLocaleContext as hr,useWindowDimensions as yr}from"react-native-web";import*as S from"react-native-web";import{createElement as bo,forwardRef as vo}from"react";function z(t){let e=vo((n,r)=>{let{accessibilityState:g,accessibilityValue:c,...m}=n;for(let a of["busy","checked","disabled","expanded","selected"])g?.[a]!==void 0&&m[`aria-${a}`]===void 0&&(m[`aria-${a}`]=g[a]);for(let[a,h]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))c?.[a]!==void 0&&m[`aria-${h}`]===void 0&&(m[`aria-${h}`]=c[a]);return bo(t,{...m,ref:r})}),o=t.State;return o&&Object.assign(e,{State:o}),e.displayName=t.displayName??t.name??"NativeWebView",e}var s=z(S.View),u=z(S.Text),Ue=z(S.TextInput),C=z(S.TouchableOpacity),xo=z(S.TouchableHighlight),wo=z(S.TouchableWithoutFeedback),Io=z(S.Pressable),Be=z(S.ScrollView),Co=z(S.Modal),To=z(S.Switch),De=z(S.ActivityIndicator),ko=z(S.Button),Ro=S.findNodeHandle,Ao={alert(t,e,o,n){if(typeof document>"u")return;let r=document.createElement("dialog");r.dataset.buoyRoot="",r.setAttribute("aria-label",t),r.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 g=document.createElement("h2");if(g.textContent=t,g.style.cssText="font-size:18px;margin:0 0 12px",r.appendChild(g),e){let h=document.createElement("p");h.textContent=e,h.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",r.appendChild(h)}let c=document.createElement("div");c.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let m=o?.length?o:[{text:"OK"}],a=()=>{r.close?.(),r.remove()};for(let h of m){let y=document.createElement("button");y.type="button",y.textContent=h.text??"OK",y.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${h.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,y.onclick=()=>{a(),h.onPress?.()},c.appendChild(y)}r.addEventListener("cancel",h=>{h.preventDefault(),n?.cancelable!==!1&&(a(),n?.onDismiss?.())}),r.appendChild(c),document.body.appendChild(r),r.showModal?r.showModal():r.setAttribute("open","")}};import{JsModal as ln,TabSelector as dn,ModalHeader as ye,buoyColors as un,night as Vt,Search as pn,TickProvider as Et,windowDragProps as gn}from"@buoy-gg/shared-ui/web";import{useState as xe,useEffect as xt,useCallback as W,useSyncExternalStore as Tr}from"react";import{assertAccountAccess as St,getAccountAccess as xr,hasAccountAccess as wr,subscribeAccountAccess as Ir}from"@buoy-gg/shared-ui/web";var ft=[/\/symbolicate$/,/\/logs$/,/\/debugger-proxy/,/\/reload$/,/\/launch-js-devtools/,/localhost:8081/,/100\.64\.\d+\.\d+:8081/,/10\.0\.\d+\.\d+:8081/,/\.hot-update\./,/__metro/];function Ne(t,e){for(let o of Object.keys(e))o.startsWith("__buoy")&&(t[o]=e[o])}var Le=class{constructor(){this.isListeningFlag=!1;this.patchedFetch=null;this.patchedXHROpen=null;this.patchedXHRSend=null;this.reportHeader=e=>this.shouldInjectHeader(e)?{[this.config.headerKey]:this.config.userId}:null;this.originalFetch=globalThis.fetch.bind(globalThis),this.originalXHROpen=XMLHttpRequest.prototype.open,this.originalXHRSend=XMLHttpRequest.prototype.send,this.config={headerKey:"x-impersonate-user-id",userId:null,ignorePatterns:[...ft]}}setConfig(e){this.config={...this.config,...e},e.ignorePatterns&&(this.config.ignorePatterns=[...ft,...e.ignorePatterns])}getConfig(){return{...this.config}}shouldInjectHeader(e){return!this.config.userId||this.config.gate&&!this.config.gate()?!1:!this.config.ignorePatterns.some(o=>o.test(e))}extractUrl(e){return typeof e=="string"?e:e instanceof URL?e.href:e.url}startListening(){if(this.isListeningFlag)return;let e=globalThis.fetch,o=XMLHttpRequest.prototype.open,n=XMLHttpRequest.prototype.send;this.originalFetch=e.bind(globalThis),this.originalXHROpen=o,this.originalXHRSend=n;let r=this,g=async function(y,v){let T=r.extractUrl(y);if(r.shouldInjectHeader(T)){let D=v?.headers??(typeof y=="object"&&"headers"in y?y.headers:void 0),N=new Headers(D);return N.set(r.config.headerKey,r.config.userId),r.originalFetch(y,{...v,headers:N})}return r.originalFetch(y,v)};Ne(g,e),this.patchedFetch=g,globalThis.fetch=this.patchedFetch;let c=function(y,v,T=!0,D,N){let O=this;O._impersonateUrl=typeof v=="string"?v:v.href;let Z=typeof v=="string"?v:v.toString();return r.originalXHROpen.call(this,y,Z,T,D,N)},m=function(y){let v=this;return v._impersonateUrl&&r.shouldInjectHeader(v._impersonateUrl)&&this.setRequestHeader(r.config.headerKey,r.config.userId),r.originalXHRSend.call(this,y)};Ne(c,o),Ne(m,n),this.patchedXHROpen=c,this.patchedXHRSend=m,XMLHttpRequest.prototype.open=this.patchedXHROpen,XMLHttpRequest.prototype.send=this.patchedXHRSend;let a=globalThis,h=a.__buoyHeaderInjectors??(a.__buoyHeaderInjectors=[]);h.includes(this.reportHeader)||h.push(this.reportHeader),this.isListeningFlag=!0}stopListening(){if(!this.isListeningFlag)return;this.patchedFetch&&globalThis.fetch===this.patchedFetch&&(globalThis.fetch=this.originalFetch),this.patchedXHROpen&&XMLHttpRequest.prototype.open===this.patchedXHROpen&&(XMLHttpRequest.prototype.open=this.originalXHROpen),this.patchedXHRSend&&XMLHttpRequest.prototype.send===this.patchedXHRSend&&(XMLHttpRequest.prototype.send=this.originalXHRSend),this.patchedFetch=null,this.patchedXHROpen=null,this.patchedXHRSend=null;let e=globalThis.__buoyHeaderInjectors,o=e?.indexOf(this.reportHeader)??-1;e&&o>=0&&e.splice(o,1),this.isListeningFlag=!1}get isListening(){return this.isListeningFlag}get isImpersonating(){return this.config.userId!==null&&(this.config.gate?.()??!0)}},ie=null;function L(){return ie||(ie=new Le),ie}function fr(){L().startListening()}function Sr(){L().stopListening()}function Ee(t){L().setConfig(t)}function br(){return ie?.isImpersonating??!1}function vr(){return ie?.getConfig().userId??null}var ce="@buoy/impersonate/state",Cr=10,vt={reactQuery:!0,redux:!0,asyncStorage:!1,mmkv:!1},re={isActive:!1,isPaused:!1,currentUser:null,headerKey:"x-impersonate-user-id",ignorePatterns:[],dataNukeSettings:vt,showBanner:!0,history:[]},Ve=!1,bt={getItem:t=>{try{return typeof localStorage<"u"?localStorage.getItem(t):null}catch{return null}},setItem:(t,e)=>{try{typeof localStorage<"u"&&localStorage.setItem(t,e)}catch{}},removeItem:t=>{try{typeof localStorage<"u"&&localStorage.removeItem(t)}catch{}}},ze=class{constructor(){this.state={...re};this.listeners=new Set;this.nukeCallbacks={};this.isInitialized=!1;this.asyncStorageRef=null;this.storageReadyPromise=null;this.resolveStorageReady=null;this.developerDefaults=null;this.getSnapshot=()=>this.state;this.subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));this.remoteHandler=null;this.loadFromStorage(),Promise.resolve().then(()=>{let e=!1,o=()=>{let n=xr().status;n==="admitted"?e=!0:n==="locked"&&e&&(e=!1,this.disposeAccountSession())};Ir(o),o()}),typeof localStorage<"u"?this.storageReadyPromise=Promise.resolve():this.storageReadyPromise=new Promise(e=>{this.resolveStorageReady=e})}loadFromStorage(){try{let e=bt.getItem(ce),o=this.getEffectiveDefaults();if(e){let n=JSON.parse(e);this.state={...re,headerKey:n.headerKey??o.headerKey,ignorePatterns:n.ignorePatterns??re.ignorePatterns,dataNukeSettings:{...o.dataNukeSettings,...n.dataNukeSettings},showBanner:n.showBanner??o.showBanner,history:n.history??[],isActive:n.isActive??!1,isPaused:n.isPaused??!1,currentUser:n.currentUser??null},this.state.isActive&&this.state.currentUser&&this.syncWithListener()}else this.state={...re,headerKey:o.headerKey,dataNukeSettings:o.dataNukeSettings,showBanner:o.showBanner};this.isInitialized=!0}catch{this.isInitialized=!0}}setAsyncStorage(e){this.asyncStorageRef=e,this.resolveStorageReady&&(this.resolveStorageReady(),this.resolveStorageReady=null)}setDeveloperDefaults(e){this.developerDefaults=e;let o=this.getEffectiveDefaults();this.isInitialized||(this.state={...this.state,headerKey:o.headerKey,dataNukeSettings:o.dataNukeSettings,showBanner:o.showBanner})}getEffectiveDefaults(){return{headerKey:this.developerDefaults?.headerKey??re.headerKey,dataNukeSettings:{...vt,...this.developerDefaults?.dataNukeSettings},showBanner:this.developerDefaults?.showBanner??re.showBanner}}getDeveloperDefaults(){return this.developerDefaults}async initializeAsync(e){if(e){this.asyncStorageRef=e;try{let o=await e.getItem(ce);if(console.log(`[impersonate] initializeAsync read STORAGE_KEY=${ce} stored=${o?o.slice(0,200):"null"}`),o){let n=JSON.parse(o);this.state={...this.state,headerKey:n.headerKey??this.state.headerKey,ignorePatterns:n.ignorePatterns??this.state.ignorePatterns,dataNukeSettings:{...this.state.dataNukeSettings,...n.dataNukeSettings},showBanner:n.showBanner??this.state.showBanner,history:n.history??this.state.history,isActive:n.isActive??this.state.isActive,isPaused:n.isPaused??this.state.isPaused,currentUser:n.currentUser??this.state.currentUser},this.state.isActive&&this.state.currentUser&&this.syncWithListener(),this.notify()}}catch{}}}registerNukeCallbacks(e){this.nukeCallbacks={...this.nukeCallbacks,...e}}getState(){return{...this.state}}setRemoteHandler(e){this.remoteHandler=e}replaceState(e){this.state=e,this.notify()}async startImpersonation(e){if(St(),this.remoteHandler){this.remoteHandler("startImpersonation",{user:e});return}let n=[{user:e,lastUsedAt:new Date().toISOString()},...this.state.history.filter(r=>r.user.id!==e.id)].slice(0,Cr);this.state={...this.state,isActive:!0,currentUser:e,history:n},this.syncWithListener(),this.notify(),await this.executeDataNuke(),await this.persist()}async stopImpersonation(){if(this.remoteHandler){this.remoteHandler("stopImpersonation");return}console.log(`[impersonate] stopImpersonation: isActive ${this.state.isActive} -> false, listeners=${this.listeners.size}`),this.state={...this.state,isActive:!1,isPaused:!1,currentUser:null},this.syncWithListener(),this.notify(),await this.executeDataNuke(),await this.persist()}async pauseImpersonation(){if(this.remoteHandler){this.remoteHandler("pauseImpersonation");return}!this.state.isActive||this.state.isPaused||(this.state={...this.state,isPaused:!0},this.syncWithListener(),await this.persist(),this.notify())}async resumeImpersonation(){if(St(),this.remoteHandler){this.remoteHandler("resumeImpersonation");return}!this.state.isActive||!this.state.isPaused||(this.state={...this.state,isPaused:!1},this.syncWithListener(),await this.persist(),this.notify())}async quickSwitch(e){return this.startImpersonation(e)}async updateSettings(e){if(this.remoteHandler){this.remoteHandler("updateSettings",{settings:e});return}this.state={...this.state,headerKey:e.headerKey??this.state.headerKey,ignorePatterns:e.ignorePatterns??this.state.ignorePatterns,showBanner:e.showBanner??this.state.showBanner,dataNukeSettings:e.dataNukeSettings?{...this.state.dataNukeSettings,...e.dataNukeSettings}:this.state.dataNukeSettings},(e.headerKey||e.ignorePatterns)&&this.syncWithListener(),await this.persist(),this.notify()}async removeFromHistory(e){if(this.remoteHandler){this.remoteHandler("removeFromHistory",{userId:e});return}this.state={...this.state,history:this.state.history.filter(o=>o.user.id!==e)},await this.persist(),this.notify()}async clearHistory(){if(this.remoteHandler){this.remoteHandler("clearHistory");return}this.state={...this.state,history:[]},await this.persist(),this.notify()}async executeDataNuke(){if(!Ve){Ve=!0;try{let{dataNukeSettings:e}=this.state,o=[];e.reactQuery&&this.nukeCallbacks.reactQuery&&o.push(Promise.resolve(this.nukeCallbacks.reactQuery())),e.redux&&this.nukeCallbacks.redux&&o.push(Promise.resolve(this.nukeCallbacks.redux())),e.asyncStorage&&this.nukeCallbacks.asyncStorage&&o.push(Promise.resolve(this.nukeCallbacks.asyncStorage())),e.mmkv&&this.nukeCallbacks.mmkv&&o.push(Promise.resolve(this.nukeCallbacks.mmkv())),await Promise.allSettled(o)}finally{setTimeout(()=>{Ve=!1},100)}}}disposeAccountSession(){this.remoteHandler||!this.state.isActive||(this.state={...this.state,isActive:!1,isPaused:!1,currentUser:null},this.syncWithListener(),this.notify(),this.persist())}syncWithListener(){let e=this.state.isActive&&!this.state.isPaused;Ee({headerKey:this.state.headerKey,userId:e?this.state.currentUser?.id??null:null,ignorePatterns:this.state.ignorePatterns.map(o=>new RegExp(o)),gate:wr}),L().isListening||L().startListening()}async persist(){this.storageReadyPromise&&await this.storageReadyPromise;let e={headerKey:this.state.headerKey,ignorePatterns:this.state.ignorePatterns,dataNukeSettings:this.state.dataNukeSettings,showBanner:this.state.showBanner,history:this.state.history,isActive:this.state.isActive,isPaused:this.state.isPaused,currentUser:this.state.currentUser},o=JSON.stringify(e);try{this.asyncStorageRef?(await this.asyncStorageRef.setItem(ce,o),console.log(`[impersonate] persist -> AsyncStorage isActive=${e.isActive} userId=${e.currentUser?.id??"null"}`)):(bt.setItem(ce,o),console.log(`[impersonate] persist -> localStorage isActive=${e.isActive} userId=${e.currentUser?.id??"null"}`))}catch(n){console.warn("[impersonate] persist failed",n)}}notify(){this.listeners.forEach(e=>{try{e(this.state)}catch{}})}},l=new ze;function Oe(t={}){let[e,o]=xe(""),[n,r]=xe([]),[g,c]=xe(!1),[m,a]=xe(null),h=Tr(l.subscribe,l.getSnapshot,l.getSnapshot);xt(()=>{l.registerNukeCallbacks({reactQuery:t.onClearReactQuery,redux:t.onClearRedux,asyncStorage:t.onClearAsyncStorage,mmkv:t.onClearMMKV})},[t.onClearReactQuery,t.onClearRedux,t.onClearAsyncStorage,t.onClearMMKV]),xt(()=>{let b=!0;return(async()=>{try{let te=await import("@buoy-gg/shared-ui/web/asyncStorage").then(J=>J.default),oe={getItem:J=>te.getItem(J),setItem:(J,He)=>te.setItem(J,He)};l.setAsyncStorage(oe),b&&await l.initializeAsync(oe)}catch{}})(),L().isListening||L().startListening(),()=>{b=!1}},[]);let y=W(async b=>{if(o(b),a(null),!b.trim()){r([]);return}if(!t.onSearchUsers){a("Search not configured"),r([]);return}c(!0);try{let w=await t.onSearchUsers(b);r(w)}catch(w){a(w instanceof Error?w.message:"Search failed"),r([])}finally{c(!1)}},[t.onSearchUsers]),v=W(()=>{o(""),r([]),a(null)},[]),T=W(async b=>{await l.startImpersonation(b)},[]),D=W(async()=>{await l.stopImpersonation()},[]),N=W(async b=>{await l.quickSwitch(b)},[]),O=W(async b=>{await l.updateSettings({headerKey:b})},[]),Z=W(async b=>{await l.updateSettings({ignorePatterns:b})},[]),Q=W(async b=>{await l.updateSettings({dataNukeSettings:b})},[]),ee=W(async b=>{await l.updateSettings({showBanner:b})},[]),F=W(async b=>{await l.removeFromHistory(b)},[]),se=W(async()=>{await l.clearHistory()},[]);return{isActive:h.isActive,currentUser:h.currentUser,headerKey:h.headerKey,ignorePatterns:h.ignorePatterns,dataNukeSettings:h.dataNukeSettings,showBanner:h.showBanner,history:h.history,searchQuery:e,searchResults:n,isSearching:g,searchError:m,searchUsers:y,clearSearch:v,startImpersonation:T,stopImpersonation:D,quickSwitch:N,updateHeaderKey:O,updateIgnorePatterns:Z,updateDataNukeSettings:Q,updateShowBanner:ee,removeFromHistory:F,clearHistory:se}}import{useCallback as kr}from"react";import{dispatchToolAction as wt,getToolAdapters as Rr}from"@buoy-gg/shared-ui/web";function It(){let t=!!Rr().query,e=kr(async()=>{await wt("query","clearQueryCache"),await wt("query","clearMutationCache")},[]);return{isAvailable:t,error:t?null:"Connect React Query to Buoy or provide onClearReactQuery.",clearCache:t?e:null}}import{useCallback as Ar}from"react";import{dispatchToolAction as Hr,getToolAdapters as Pr}from"@buoy-gg/shared-ui/web";var Ur="@@RESET";function Ct({resetActionType:t=Ur}={}){let e=!!Pr().redux,o=Ar(async()=>{await Hr("redux","dispatch",{action:{type:t}})},[t]);return{isAvailable:e,error:e?null:"Connect Redux to Buoy or provide onClearRedux.",resetStore:e?o:null}}import{useCallback as Br,useMemo as Dr,useState as Tt,useEffect as Nr}from"react";var We=!1;function kt(){let[t,e]=Tt(null),[o,n]=Tt(null);Nr(()=>{let c=ve();c?(e(c),n(null)):n("@react-native-async-storage/async-storage is not installed")},[]);let r=Br(async()=>{if(!We){We=!0;try{if(t){let m=(await t.getAllKeys()).filter(a=>!a.startsWith("@buoy/")&&!a.startsWith("@buoy-"));m.length>0&&await t.multiRemove([...m])}}finally{setTimeout(()=>{We=!1},100)}}},[t]);return Dr(()=>!t||o?{isAvailable:!1,error:o||"@react-native-async-storage/async-storage is not available",clearStorage:null}:{isAvailable:!0,error:null,clearStorage:r},[t,o,r])}import{useCallback as Xr}from"react";import{SectionHeader as Ke,EmptyState as qr,night as U,Search as Qr,AlertTriangle as Ht,Users as jr}from"@buoy-gg/shared-ui/web";import{buoyColors as Fe,night as V,Play as Mr,X as Fr,PowerToggleButton as Kr,monoFont as _r}from"@buoy-gg/shared-ui/web";import{useMemo as Rt}from"react";import{buoyColors as Lr,night as Er}from"@buoy-gg/shared-ui/web";import{jsx as Me,jsxs as Wr}from"react/jsx-runtime";var At=["#6366F1","#8B5CF6","#EC4899","#F43F5E","#F97316","#EAB308","#22C55E","#14B8A6","#06B6D4","#3B82F6"],Vr={small:{container:24,font:10,indicator:8},medium:{container:36,font:14,indicator:10},large:{container:44,font:16,indicator:12}};function zr(t){if(!t)return"?";if(t.includes("@"))return t.charAt(0).toUpperCase();let e=t.trim().split(/\s+/);return e.length===1?e[0].charAt(0).toUpperCase():(e[0].charAt(0)+e[e.length-1].charAt(0)).toUpperCase()}function Or(t){let e=0;for(let o=0;o<t.length;o++)e=t.charCodeAt(o)+((e<<5)-e);return At[Math.abs(e)%At.length]}function ne({userId:t,name:e,size:o="medium",showActiveIndicator:n=!1,backgroundColor:r}){let g=Vr[o],c=Rt(()=>r??Or(t),[t,r]),m=Rt(()=>zr(e),[e]);return Wr(s,{style:we.wrapper,children:[Me(s,{style:[we.container,{width:g.container,height:g.container,borderRadius:g.container/2,backgroundColor:c}],children:Me(u,{style:[we.initials,{fontSize:g.font}],children:m})}),n&&Me(s,{style:[we.indicator,{width:g.indicator,height:g.indicator,borderRadius:g.indicator/2,right:-1,bottom:-1}]})]})}var we=H.create({wrapper:{position:"relative"},container:{alignItems:"center",justifyContent:"center"},initials:{color:"#FFFFFF",fontWeight:"600",letterSpacing:.5},indicator:{position:"absolute",backgroundColor:Lr.success,borderWidth:2,borderColor:Er.color.surface}});import{jsx as E,jsxs as le}from"react/jsx-runtime";function Ie({user:t,isActive:e=!1,onPress:o,onStop:n,onRemove:r,showRemoveButton:g=!1,lastUsedTime:c,variant:m="default"}){let a=t.displayName||t.email||t.id,h=t.email&&t.displayName,y=typeof t.metadata?.role=="string"?t.metadata.role:null;return le(C,{testID:`buoy-impersonate-user-${t.id}`,style:[P.container,e&&P.activeContainer,m==="compact"&&P.compactContainer],onPress:o,disabled:e,activeOpacity:.7,children:[E(s,{style:P.avatarSection,children:E(ne,{userId:t.id,name:a,size:m==="compact"?"small":"medium",showActiveIndicator:e})}),le(s,{style:P.content,children:[le(s,{style:P.nameRow,children:[E(u,{style:[P.name,e&&P.activeName],numberOfLines:1,children:a}),y?E(s,{style:P.roleBadge,children:E(u,{style:P.roleBadgeText,children:y.toUpperCase()})}):null]}),h&&E(u,{style:P.email,numberOfLines:1,children:t.email}),E(s,{style:P.metadataRow,children:le(u,{style:P.userId,children:["ID: ",t.id]})})]}),le(s,{style:P.actions,children:[e?E(Kr,{isEnabled:!0,onToggle:n||(()=>{}),accessibilityLabel:"Stop impersonation"}):E(C,{style:P.actionButton,onPress:o,activeOpacity:.7,children:E(Mr,{size:14,color:V.color.onAccent})}),g&&r&&!e&&E(C,{style:P.removeButton,onPress:r,activeOpacity:.7,children:E(Fr,{size:12,color:V.color.textTertiary})})]}),c?E(u,{style:P.lastUsed,children:c}):null]})}var P=H.create({container:{flexDirection:"row",alignItems:"center",backgroundColor:V.color.surface,borderRadius:10,borderWidth:1,borderColor:V.color.border,padding:12,gap:12},activeContainer:{backgroundColor:Fe.success+"10",borderColor:Fe.success+"40"},compactContainer:{padding:10,gap:10},avatarSection:{flexShrink:0},content:{flex:1,minWidth:0},nameRow:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},name:{fontSize:15,fontWeight:"600",color:V.color.text,flexShrink:1},activeName:{color:Fe.success},roleBadge:{backgroundColor:V.color.surfaceElevated,paddingHorizontal:6,paddingVertical:2,borderRadius:4},roleBadgeText:{fontSize:9,fontWeight:"700",color:V.color.textTertiary,letterSpacing:.5},email:{fontSize:13,color:V.color.textSecondary,marginBottom:4},metadataRow:{flexDirection:"row",alignItems:"center",gap:4},userId:{fontSize:11,color:V.color.textTertiary,fontFamily:_r},lastUsed:{position:"absolute",bottom:8,right:10,fontSize:10,color:V.color.textTertiary},actions:{flexDirection:"row",alignItems:"center",gap:8,flexShrink:0},actionButton:{width:36,height:36,borderRadius:8,backgroundColor:V.color.accent,alignItems:"center",justifyContent:"center"},removeButton:{width:28,height:28,borderRadius:6,backgroundColor:V.color.surfaceElevated,borderWidth:1,borderColor:V.color.border,alignItems:"center",justifyContent:"center"}});import{jsx as A,jsxs as K}from"react/jsx-runtime";function _e({currentUser:t,searchQuery:e,searchResults:o,isSearching:n,searchError:r,onSelectUser:g,onStopImpersonation:c,searchAvailable:m=!0}){let a=Xr(({item:h})=>{let y=t?.id===h.id;return A(Ie,{user:h,isActive:y,onPress:()=>!y&&g(h),onStop:y?c:void 0})},[t,g,c]);return K(s,{style:R.container,children:[!m&&A(s,{style:R.section,children:K(s,{style:R.warningCard,children:[A(Ht,{size:18,color:U.color.warning}),K(s,{style:R.warningContent,children:[A(u,{style:R.warningTitle,children:"Search Not Available"}),A(u,{style:R.warningText,children:"Configure the onSearchUsers callback to enable user search."})]})]})}),n&&K(s,{style:R.loadingContainer,children:[A(De,{size:"small",color:U.color.accent}),A(u,{style:R.loadingText,children:"Searching users..."})]}),r?A(s,{style:R.section,children:K(s,{style:R.errorCard,children:[A(Ht,{size:16,color:U.color.danger}),A(u,{style:R.errorText,children:r})]})}):null,o.length>0&&K(s,{style:R.resultsSection,children:[K(Ke,{children:[A(Ke.Title,{children:"Results"}),A(Ke.Badge,{count:o.length})]}),A(ae,{data:o,keyExtractor:h=>h.id,renderItem:a,ItemSeparatorComponent:()=>A(s,{style:R.separator}),contentContainerStyle:R.listContent,showsVerticalScrollIndicator:!1})]}),!!e&&!n&&o.length===0&&!r&&K(s,{style:R.emptyStateContainer,children:[A(s,{style:R.emptyStateIcon,children:A(jr,{size:28,color:U.color.textTertiary})}),A(u,{style:R.emptyStateTitle,children:"No users found"}),K(u,{style:R.emptyStateDescription,children:['No results for "',e,'"']}),A(u,{style:R.emptyStateHint,children:"Try a different search term"})]}),!e&&o.length===0&&!n&&m&&A(qr,{title:"Search for users",description:"Tap the search icon in the header to find users by email, name, or ID",icon:Qr,variant:"minimal"})]})}var R=H.create({container:{flex:1},section:{padding:16,paddingBottom:8},loadingContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:10,paddingVertical:20},loadingText:{fontSize:13,color:U.color.textSecondary},resultsSection:{flex:1,paddingHorizontal:16},listContent:{paddingBottom:16},separator:{height:8},warningCard:{flexDirection:"row",alignItems:"flex-start",gap:12,backgroundColor:U.color.warningSoft,borderRadius:10,borderWidth:1,borderColor:U.color.warning+"25",padding:14},warningContent:{flex:1},warningTitle:{fontSize:14,fontWeight:"600",color:U.color.warning,marginBottom:4},warningText:{fontSize:13,color:U.color.textSecondary,lineHeight:18},errorCard:{flexDirection:"row",alignItems:"center",gap:10,backgroundColor:U.color.dangerSoft,borderRadius:10,borderWidth:1,borderColor:U.color.danger+"25",padding:12},errorText:{flex:1,fontSize:13,color:U.color.danger},emptyStateContainer:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:32,paddingVertical:48},emptyStateIcon:{width:56,height:56,borderRadius:28,backgroundColor:U.color.surfaceElevated,alignItems:"center",justifyContent:"center",marginBottom:16},emptyStateTitle:{fontSize:16,fontWeight:"600",color:U.color.text,marginBottom:6},emptyStateDescription:{fontSize:14,color:U.color.textSecondary,textAlign:"center",marginBottom:8},emptyStateHint:{fontSize:12,color:U.color.textTertiary}});import{useCallback as $r}from"react";import{night as j,Trash2 as Jr,useRelativeTime as Yr,ToolEmptyState as Gr}from"@buoy-gg/shared-ui/web";import{jsx as M,jsxs as Pt}from"react/jsx-runtime";function Zr({item:t,isActive:e,onSelect:o,onStop:n,onRemove:r,showRemoveButton:g}){let c=Yr(new Date(t.lastUsedAt));return M(Ie,{user:t.user,isActive:e,onPress:()=>!e&&o(t.user),onStop:e?n:void 0,onRemove:r,showRemoveButton:g,lastUsedTime:c})}function Xe({history:t,currentUserId:e,onSelectUser:o,onStopImpersonation:n,onRemoveFromHistory:r,onClearHistory:g}){let c=$r(({item:m})=>{let a=e===m.user.id;return M(Zr,{item:m,isActive:a,onSelect:o,onStop:n,onRemove:r?()=>r(m.user.id):void 0,showRemoveButton:!!r})},[e,o,n,r]);return t.length===0?M(Gr,{testID:"buoy-impersonate-history-empty",otto:"disguise",title:"No History",message:"Users you impersonate will appear here for quick access"}):Pt(s,{style:_.container,children:[Pt(s,{style:_.headerRow,children:[M(u,{style:_.headerTitle,children:"Recent"}),M(s,{style:_.headerBadge,children:M(u,{style:_.headerBadgeText,children:t.length})}),M(s,{style:_.headerSpacer}),g&&M(C,{style:_.clearButton,onPress:g,activeOpacity:.7,children:M(Jr,{size:12,color:j.color.textTertiary})})]}),M(ae,{data:t,keyExtractor:m=>m.user.id,renderItem:c,ItemSeparatorComponent:()=>M(s,{style:_.separator}),contentContainerStyle:_.listContent,showsVerticalScrollIndicator:!1})]})}var _=H.create({container:{flex:1,paddingHorizontal:16},headerRow:{flexDirection:"row",alignItems:"center",paddingVertical:10,gap:8},headerTitle:{fontSize:12,fontWeight:"600",color:j.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},headerBadge:{backgroundColor:j.color.surfaceElevated,paddingHorizontal:6,paddingVertical:2,borderRadius:4},headerBadgeText:{fontSize:10,fontWeight:"600",color:j.color.textTertiary},headerSpacer:{flex:1},clearButton:{width:24,height:24,alignItems:"center",justifyContent:"center",backgroundColor:j.color.surfaceElevated,borderRadius:4},listContent:{paddingBottom:20},separator:{height:8},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:32,paddingVertical:48},emptyIcon:{width:56,height:56,borderRadius:28,backgroundColor:j.color.surfaceElevated,alignItems:"center",justifyContent:"center",marginBottom:16},emptyTitle:{fontSize:16,fontWeight:"600",color:j.color.text,marginBottom:6},emptyDescription:{fontSize:14,color:j.color.textSecondary,textAlign:"center"}});import{useState as Ce,useEffect as qe,useMemo as Qe}from"react";import{CollapsibleSection as de,buoyColors as me,night as p,Settings as en,AlertTriangle as Ut,Info as tn,Zap as on,RefreshCw as rn,Check as Je,X as Dt,Copy as Bt,Eye as nn,copyToClipboard as sn,ToggleRow as an,monoFont as je}from"@buoy-gg/shared-ui/web";import{DataViewer as cn}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as Ye,jsx as d,jsxs as x}from"react/jsx-runtime";var ue="x-impersonate-user-id",$e=!0,pe={reactQuery:!0,redux:!0,asyncStorage:!1,mmkv:!1};function ge({label:t,description:e,value:o,onChange:n,recommended:r,dangerous:g,detected:c}){let m=x(Ye,{children:[c!==void 0&&x(s,{style:[i.detectedBadge,c?i.detectedBadgeActive:i.detectedBadgeInactive],children:[c?d(Je,{size:10,color:me.success}):d(Dt,{size:10,color:p.color.textTertiary}),d(u,{style:[i.detectedText,c?i.detectedTextActive:i.detectedTextInactive],children:c?"Detected":"Not Detected"})]}),r&&c!==!1&&x(s,{style:i.recommendedBadge,children:[d(on,{size:10,color:p.color.accent}),d(u,{style:i.recommendedText,children:"Recommended"})]})]});return d(an,{variant:"plain",label:t,description:e,value:o,onValueChange:n,tone:g?"warning":"accent",emphasizeLabel:g,accessory:m})}function Ge({headerKey:t,settings:e,showBanner:o,onSave:n,onShowBannerChange:r,detectionStatus:g}){let[c,m]=Ce(t),[a,h]=Ce(e),[y,v]=Ce(o),[T,D]=Ce(!1);qe(()=>{m(t)},[t]),qe(()=>{h(e)},[e]),qe(()=>{v(o)},[o]);let N=Qe(()=>c!==t||a.reactQuery!==e.reactQuery||a.redux!==e.redux||a.asyncStorage!==e.asyncStorage||a.mmkv!==e.mmkv,[c,a,t,e]),O=Qe(()=>c===ue&&y===$e&&a.reactQuery===pe.reactQuery&&a.redux===pe.redux&&a.asyncStorage===pe.asyncStorage&&a.mmkv===pe.mmkv,[c,y,a]),Z=()=>{n(c.trim()||ue,a,y)},Q=()=>{m(t),h(e),v(o)},ee=()=>{m(ue),h(pe),v($e),r($e)},F=(w,te)=>{h(oe=>({...oe,[w]:te}))},se=Qe(()=>({defaults:{headerKey:c,showBanner:y,dataNukeSettings:{reactQuery:a.reactQuery,redux:a.redux,asyncStorage:a.asyncStorage,mmkv:a.mmkv}}}),[c,y,a]),b=async()=>{let w=`defaults: {
|
|
3
|
-
headerKey: '${c}',
|
|
1
|
+
"use client";var Ge=Object.defineProperty;var nr=Object.getOwnPropertyDescriptor;var ir=Object.getOwnPropertyNames;var sr=Object.prototype.hasOwnProperty;var lr=(e,t)=>{for(var r in t)Ge(e,r,{get:t[r],enumerable:true})},et=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ir(t))!sr.call(e,o)&&o!==r&&Ge(e,o,{get:()=>t[o],enumerable:!(a=nr(t,o))||a.enumerable});return e},cr=(e,t,r)=>(et(e,t,"default"),r&&et(r,t,"default"));typeof window<"u"&&typeof globalThis.global>"u"&&(globalThis.global=globalThis);import dr from"@buoy-gg/shared-ui/web/asyncStorage";function tt(){return dr}import{useState as xe,useCallback as ee,useRef as rt,useEffect as ot}from"react";var at={};lr(at,{AccessibilityInfo:()=>pr,ActivityIndicator:()=>st,Alert:()=>co,Animated:()=>mr,AppRegistry:()=>fr,AppState:()=>Sr,Appearance:()=>yr,BackHandler:()=>br,Button:()=>so,CheckBox:()=>Nr,Clipboard:()=>vr,DeviceEventEmitter:()=>Jr,Dimensions:()=>xr,Easing:()=>Cr,FlatList:()=>Ce,I18nManager:()=>wr,Image:()=>Lr,ImageBackground:()=>Er,InteractionManager:()=>kr,Keyboard:()=>Ir,KeyboardAvoidingView:()=>Or,LayoutAnimation:()=>Tr,Linking:()=>Br,LogBox:()=>_r,Modal:()=>no,NativeEventEmitter:()=>Rr,NativeModules:()=>gr,PanResponder:()=>Ar,Picker:()=>Wr,PixelRatio:()=>Hr,Platform:()=>Pr,Pressable:()=>ao,ProgressBar:()=>Fr,RefreshControl:()=>jr,SafeAreaView:()=>Mr,ScrollView:()=>it,SectionList:()=>Kr,Share:()=>zr,StatusBar:()=>Vr,StyleSheet:()=>F,Switch:()=>io,Text:()=>p,TextInput:()=>nt,Touchable:()=>Xr,TouchableHighlight:()=>ro,TouchableNativeFeedback:()=>Qr,TouchableOpacity:()=>T,TouchableWithoutFeedback:()=>oo,UIManager:()=>Dr,Vibration:()=>Ur,View:()=>i,VirtualizedList:()=>$r,YellowBox:()=>qr,findNodeHandle:()=>lo,unstable_createElement:()=>hr,useColorScheme:()=>Zr,useLocaleContext:()=>Yr,useWindowDimensions:()=>Gr});cr(at,ur);import*as ur from"react-native-web";import{unstable_createElement as hr,NativeModules as gr,AccessibilityInfo as pr,Animated as mr,Appearance as yr,AppRegistry as fr,AppState as Sr,BackHandler as br,Clipboard as vr,Dimensions as xr,Easing as Cr,I18nManager as wr,Keyboard as Ir,InteractionManager as kr,LayoutAnimation as Tr,Linking as Br,NativeEventEmitter as Rr,PanResponder as Ar,PixelRatio as Hr,Platform as Pr,Share as zr,StyleSheet as F,UIManager as Dr,Vibration as Ur,CheckBox as Nr,FlatList as Ce,Image as Lr,ImageBackground as Er,KeyboardAvoidingView as Or,Picker as Wr,ProgressBar as Fr,RefreshControl as jr,SafeAreaView as Mr,SectionList as Kr,StatusBar as Vr,Touchable as Xr,TouchableNativeFeedback as Qr,VirtualizedList as $r,YellowBox as qr,LogBox as _r,DeviceEventEmitter as Jr,useColorScheme as Zr,useLocaleContext as Yr,useWindowDimensions as Gr}from"react-native-web";import*as R from"react-native-web";import{createElement as eo,forwardRef as to}from"react";function z(e){let t=to((a,o)=>{let{accessibilityState:c,accessibilityValue:l,...m}=a;for(let n of["busy","checked","disabled","expanded","selected"])c?.[n]!==void 0&&m[`aria-${n}`]===void 0&&(m[`aria-${n}`]=c[n]);for(let[n,d]of Object.entries({min:"valuemin",max:"valuemax",now:"valuenow",text:"valuetext"}))l?.[n]!==void 0&&m[`aria-${d}`]===void 0&&(m[`aria-${d}`]=l[n]);return eo(e,{...m,ref:o})}),r=e.State;return r&&Object.assign(t,{State:r}),t.displayName=e.displayName??e.name??"NativeWebView",t}var i=z(R.View),p=z(R.Text),nt=z(R.TextInput),T=z(R.TouchableOpacity),ro=z(R.TouchableHighlight),oo=z(R.TouchableWithoutFeedback),ao=z(R.Pressable),it=z(R.ScrollView),no=z(R.Modal),io=z(R.Switch),st=z(R.ActivityIndicator),so=z(R.Button),lo=R.findNodeHandle,co={alert(e,t,r,a){if(typeof document>"u")return;let o=document.createElement("dialog");o.dataset.buoyRoot="",o.setAttribute("aria-label",e),o.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 c=document.createElement("h2");if(c.textContent=e,c.style.cssText="font-size:18px;margin:0 0 12px",o.appendChild(c),t){let d=document.createElement("p");d.textContent=t,d.style.cssText="line-height:1.5;white-space:pre-wrap;margin:0 0 20px",o.appendChild(d)}let l=document.createElement("div");l.style.cssText="display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px";let m=r?.length?r:[{text:"OK"}],n=()=>{o.close?.(),o.remove()};for(let d of m){let y=document.createElement("button");y.type="button",y.textContent=d.text??"OK",y.style.cssText=`padding:9px 14px;border:1px solid #64748b;border-radius:7px;color:white;background:${d.style==="destructive"?"#a52b38":"#283a4d"};cursor:pointer;font:inherit`,y.onclick=()=>{n(),d.onPress?.()},l.appendChild(y)}o.addEventListener("cancel",d=>{d.preventDefault(),a?.cancelable!==false&&(n(),a?.onDismiss?.())}),o.appendChild(l),document.body.appendChild(o),o.showModal?o.showModal():o.setAttribute("open","")}};import{JsModal as uo,TabSelector as ho,ModalHeader as te,buoyColors as go,night as lt,Search as po,TickProvider as ct,windowDragProps as mo}from"@buoy-gg/shared-ui/web";import{useState as ge,useEffect as dt,useCallback as U,useSyncExternalStore as yo}from"react";import{assertAccountAccess as ut,getAccountAccess as fo,hasAccountAccess as So,subscribeAccountAccess as bo}from"@buoy-gg/shared-ui/web";var ht=[/\/symbolicate$/,/\/logs$/,/\/debugger-proxy/,/\/reload$/,/\/launch-js-devtools/,/localhost:8081/,/100\.64\.\d+\.\d+:8081/,/10\.0\.\d+\.\d+:8081/,/\.hot-update\./,/__metro/];function we(e,t){for(let r of Object.keys(t))r.startsWith("__buoy")&&(e[r]=t[r])}var vo=class{constructor(){this.isListeningFlag=false;this.patchedFetch=null;this.patchedXHROpen=null;this.patchedXHRSend=null;this.reportHeader=e=>this.shouldInjectHeader(e)?{[this.config.headerKey]:this.config.userId}:null;this.originalFetch=globalThis.fetch.bind(globalThis),this.originalXHROpen=XMLHttpRequest.prototype.open,this.originalXHRSend=XMLHttpRequest.prototype.send,this.config={headerKey:"x-impersonate-user-id",userId:null,ignorePatterns:[...ht]}}setConfig(e){this.config={...this.config,...e},e.ignorePatterns&&(this.config.ignorePatterns=[...ht,...e.ignorePatterns])}getConfig(){return{...this.config}}shouldInjectHeader(e){return!this.config.userId||this.config.gate&&!this.config.gate()?false:!this.config.ignorePatterns.some(t=>t.test(e))}extractUrl(e){return typeof e=="string"?e:e instanceof URL?e.href:e.url}startListening(){if(this.isListeningFlag)return;let e=globalThis.fetch,t=XMLHttpRequest.prototype.open,r=XMLHttpRequest.prototype.send;this.originalFetch=e.bind(globalThis),this.originalXHROpen=t,this.originalXHRSend=r;let a=this,o=async function(d,y){let C=a.extractUrl(d);if(a.shouldInjectHeader(C)){let w=y?.headers??(typeof d=="object"&&"headers"in d?d.headers:void 0),P=new Headers(w);return P.set(a.config.headerKey,a.config.userId),a.originalFetch(d,{...y,headers:P})}return a.originalFetch(d,y)};we(o,e),this.patchedFetch=o,globalThis.fetch=this.patchedFetch;let c=function(d,y,C=true,w,P){let L=this;L._impersonateUrl=typeof y=="string"?y:y.href;let D=typeof y=="string"?y:y.toString();return a.originalXHROpen.call(this,d,D,C,w,P)},l=function(d){let y=this;return y._impersonateUrl&&a.shouldInjectHeader(y._impersonateUrl)&&this.setRequestHeader(a.config.headerKey,a.config.userId),a.originalXHRSend.call(this,d)};we(c,t),we(l,r),this.patchedXHROpen=c,this.patchedXHRSend=l,XMLHttpRequest.prototype.open=this.patchedXHROpen,XMLHttpRequest.prototype.send=this.patchedXHRSend;let m=globalThis,n=m.__buoyHeaderInjectors??(m.__buoyHeaderInjectors=[]);n.includes(this.reportHeader)||n.push(this.reportHeader),this.isListeningFlag=true}stopListening(){if(!this.isListeningFlag)return;this.patchedFetch&&globalThis.fetch===this.patchedFetch&&(globalThis.fetch=this.originalFetch),this.patchedXHROpen&&XMLHttpRequest.prototype.open===this.patchedXHROpen&&(XMLHttpRequest.prototype.open=this.originalXHROpen),this.patchedXHRSend&&XMLHttpRequest.prototype.send===this.patchedXHRSend&&(XMLHttpRequest.prototype.send=this.originalXHRSend),this.patchedFetch=null,this.patchedXHROpen=null,this.patchedXHRSend=null;let e=globalThis.__buoyHeaderInjectors,t=e?.indexOf(this.reportHeader)??-1;e&&t>=0&&e.splice(t,1),this.isListeningFlag=false}get isListening(){return this.isListeningFlag}get isImpersonating(){return this.config.userId!==null&&(this.config.gate?.()??true)}},re=null;function E(){return re||(re=new vo),re}function xo(){E().startListening()}function Co(){E().stopListening()}function gt(e){E().setConfig(e)}function wo(){return re?.isImpersonating??false}function Io(){return re?.getConfig().userId??null}var oe="@buoy/impersonate/state",ko=10,pt={reactQuery:true,redux:true,asyncStorage:false,mmkv:false},Y={isActive:false,isPaused:false,currentUser:null,headerKey:"x-impersonate-user-id",ignorePatterns:[],dataNukeSettings:pt,showBanner:true,history:[]},Ie=false,mt={getItem:e=>{try{return typeof localStorage<"u"?localStorage.getItem(e):null}catch{return null}},setItem:(e,t)=>{try{typeof localStorage<"u"&&localStorage.setItem(e,t)}catch{}},removeItem:e=>{try{typeof localStorage<"u"&&localStorage.removeItem(e)}catch{}}},To=class{constructor(){this.state={...Y};this.listeners=new Set;this.nukeCallbacks={};this.isInitialized=false;this.asyncStorageRef=null;this.storageReadyPromise=null;this.resolveStorageReady=null;this.developerDefaults=null;this.getSnapshot=()=>this.state;this.subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));this.remoteHandler=null;this.loadFromStorage(),Promise.resolve().then(()=>{let e=false,t=()=>{let r=fo().status;r==="admitted"?e=true:r==="locked"&&e&&(e=false,this.disposeAccountSession())};bo(t),t()}),typeof localStorage<"u"?this.storageReadyPromise=Promise.resolve():this.storageReadyPromise=new Promise(e=>{this.resolveStorageReady=e})}loadFromStorage(){try{let e=mt.getItem(oe),t=this.getEffectiveDefaults();if(e){let r=JSON.parse(e);this.state={...Y,headerKey:r.headerKey??t.headerKey,ignorePatterns:r.ignorePatterns??Y.ignorePatterns,dataNukeSettings:{...t.dataNukeSettings,...r.dataNukeSettings},showBanner:r.showBanner??t.showBanner,history:r.history??[],isActive:r.isActive??false,isPaused:r.isPaused??false,currentUser:r.currentUser??null},this.state.isActive&&this.state.currentUser&&this.syncWithListener()}else this.state={...Y,headerKey:t.headerKey,dataNukeSettings:t.dataNukeSettings,showBanner:t.showBanner};this.isInitialized=true}catch{this.isInitialized=true}}setAsyncStorage(e){this.asyncStorageRef=e,this.resolveStorageReady&&(this.resolveStorageReady(),this.resolveStorageReady=null)}setDeveloperDefaults(e){this.developerDefaults=e;let t=this.getEffectiveDefaults();this.isInitialized||(this.state={...this.state,headerKey:t.headerKey,dataNukeSettings:t.dataNukeSettings,showBanner:t.showBanner})}getEffectiveDefaults(){return{headerKey:this.developerDefaults?.headerKey??Y.headerKey,dataNukeSettings:{...pt,...this.developerDefaults?.dataNukeSettings},showBanner:this.developerDefaults?.showBanner??Y.showBanner}}getDeveloperDefaults(){return this.developerDefaults}async initializeAsync(e){if(e){this.asyncStorageRef=e;try{let t=await e.getItem(oe);if(console.log(`[impersonate] initializeAsync read STORAGE_KEY=${oe} stored=${t?t.slice(0,200):"null"}`),t){let r=JSON.parse(t);this.state={...this.state,headerKey:r.headerKey??this.state.headerKey,ignorePatterns:r.ignorePatterns??this.state.ignorePatterns,dataNukeSettings:{...this.state.dataNukeSettings,...r.dataNukeSettings},showBanner:r.showBanner??this.state.showBanner,history:r.history??this.state.history,isActive:r.isActive??this.state.isActive,isPaused:r.isPaused??this.state.isPaused,currentUser:r.currentUser??this.state.currentUser},this.state.isActive&&this.state.currentUser&&this.syncWithListener(),this.notify()}}catch{}}}registerNukeCallbacks(e){this.nukeCallbacks={...this.nukeCallbacks,...e}}getState(){return{...this.state}}setRemoteHandler(e){this.remoteHandler=e}replaceState(e){this.state=e,this.notify()}async startImpersonation(e){if(ut(),this.remoteHandler){this.remoteHandler("startImpersonation",{user:e});return}let t=[{user:e,lastUsedAt:new Date().toISOString()},...this.state.history.filter(r=>r.user.id!==e.id)].slice(0,ko);this.state={...this.state,isActive:true,currentUser:e,history:t},this.syncWithListener(),this.notify(),await this.executeDataNuke(),await this.persist()}async stopImpersonation(){if(this.remoteHandler){this.remoteHandler("stopImpersonation");return}console.log(`[impersonate] stopImpersonation: isActive ${this.state.isActive} -> false, listeners=${this.listeners.size}`),this.state={...this.state,isActive:false,isPaused:false,currentUser:null},this.syncWithListener(),this.notify(),await this.executeDataNuke(),await this.persist()}async pauseImpersonation(){if(this.remoteHandler){this.remoteHandler("pauseImpersonation");return}!this.state.isActive||this.state.isPaused||(this.state={...this.state,isPaused:true},this.syncWithListener(),await this.persist(),this.notify())}async resumeImpersonation(){if(ut(),this.remoteHandler){this.remoteHandler("resumeImpersonation");return}!this.state.isActive||!this.state.isPaused||(this.state={...this.state,isPaused:false},this.syncWithListener(),await this.persist(),this.notify())}async quickSwitch(e){return this.startImpersonation(e)}async updateSettings(e){if(this.remoteHandler){this.remoteHandler("updateSettings",{settings:e});return}this.state={...this.state,headerKey:e.headerKey??this.state.headerKey,ignorePatterns:e.ignorePatterns??this.state.ignorePatterns,showBanner:e.showBanner??this.state.showBanner,dataNukeSettings:e.dataNukeSettings?{...this.state.dataNukeSettings,...e.dataNukeSettings}:this.state.dataNukeSettings},(e.headerKey||e.ignorePatterns)&&this.syncWithListener(),await this.persist(),this.notify()}async removeFromHistory(e){if(this.remoteHandler){this.remoteHandler("removeFromHistory",{userId:e});return}this.state={...this.state,history:this.state.history.filter(t=>t.user.id!==e)},await this.persist(),this.notify()}async clearHistory(){if(this.remoteHandler){this.remoteHandler("clearHistory");return}this.state={...this.state,history:[]},await this.persist(),this.notify()}async executeDataNuke(){if(!Ie){Ie=true;try{let{dataNukeSettings:e}=this.state,t=[];e.reactQuery&&this.nukeCallbacks.reactQuery&&t.push(Promise.resolve(this.nukeCallbacks.reactQuery())),e.redux&&this.nukeCallbacks.redux&&t.push(Promise.resolve(this.nukeCallbacks.redux())),e.asyncStorage&&this.nukeCallbacks.asyncStorage&&t.push(Promise.resolve(this.nukeCallbacks.asyncStorage())),e.mmkv&&this.nukeCallbacks.mmkv&&t.push(Promise.resolve(this.nukeCallbacks.mmkv())),await Promise.allSettled(t)}finally{setTimeout(()=>{Ie=false},100)}}}disposeAccountSession(){this.remoteHandler||!this.state.isActive||(this.state={...this.state,isActive:false,isPaused:false,currentUser:null},this.syncWithListener(),this.notify(),this.persist())}syncWithListener(){let e=this.state.isActive&&!this.state.isPaused;gt({headerKey:this.state.headerKey,userId:e?this.state.currentUser?.id??null:null,ignorePatterns:this.state.ignorePatterns.map(t=>new RegExp(t)),gate:So}),E().isListening||E().startListening()}async persist(){this.storageReadyPromise&&await this.storageReadyPromise;let e={headerKey:this.state.headerKey,ignorePatterns:this.state.ignorePatterns,dataNukeSettings:this.state.dataNukeSettings,showBanner:this.state.showBanner,history:this.state.history,isActive:this.state.isActive,isPaused:this.state.isPaused,currentUser:this.state.currentUser},t=JSON.stringify(e);try{this.asyncStorageRef?(await this.asyncStorageRef.setItem(oe,t),console.log(`[impersonate] persist -> AsyncStorage isActive=${e.isActive} userId=${e.currentUser?.id??"null"}`)):(mt.setItem(oe,t),console.log(`[impersonate] persist -> localStorage isActive=${e.isActive} userId=${e.currentUser?.id??"null"}`))}catch(r){console.warn("[impersonate] persist failed",r)}}notify(){this.listeners.forEach(e=>{try{e(this.state)}catch{}})}},h=new To;function yt(e={}){let[t,r]=ge(""),[a,o]=ge([]),[c,l]=ge(false),[m,n]=ge(null),d=yo(h.subscribe,h.getSnapshot,h.getSnapshot);dt(()=>{h.registerNukeCallbacks({reactQuery:e.onClearReactQuery,redux:e.onClearRedux,asyncStorage:e.onClearAsyncStorage,mmkv:e.onClearMMKV})},[e.onClearReactQuery,e.onClearRedux,e.onClearAsyncStorage,e.onClearMMKV]),dt(()=>{let f=true;return(async()=>{try{let S=await import("@buoy-gg/shared-ui/web/asyncStorage").then(W=>W.default),Z={getItem:W=>S.getItem(W),setItem:(W,be)=>S.setItem(W,be)};h.setAsyncStorage(Z),f&&await h.initializeAsync(Z)}catch{}})(),E().isListening||E().startListening(),()=>{f=false}},[]);let y=U(async f=>{if(r(f),n(null),!f.trim()){o([]);return}if(!e.onSearchUsers){n("Search not configured"),o([]);return}l(true);try{let S=await e.onSearchUsers(f);o(S)}catch(S){n(S instanceof Error?S.message:"Search failed"),o([])}finally{l(false)}},[e.onSearchUsers]),C=U(()=>{r(""),o([]),n(null)},[]),w=U(async f=>{await h.startImpersonation(f)},[]),P=U(async()=>{await h.stopImpersonation()},[]),L=U(async f=>{await h.quickSwitch(f)},[]),D=U(async f=>{await h.updateSettings({headerKey:f})},[]),he=U(async f=>{await h.updateSettings({ignorePatterns:f})},[]),X=U(async f=>{await h.updateSettings({dataNukeSettings:f})},[]),J=U(async f=>{await h.updateSettings({showBanner:f})},[]),O=U(async f=>{await h.removeFromHistory(f)},[]),G=U(async()=>{await h.clearHistory()},[]);return{isActive:d.isActive,currentUser:d.currentUser,headerKey:d.headerKey,ignorePatterns:d.ignorePatterns,dataNukeSettings:d.dataNukeSettings,showBanner:d.showBanner,history:d.history,searchQuery:t,searchResults:a,isSearching:c,searchError:m,searchUsers:y,clearSearch:C,startImpersonation:w,stopImpersonation:P,quickSwitch:L,updateHeaderKey:D,updateIgnorePatterns:he,updateDataNukeSettings:X,updateShowBanner:J,removeFromHistory:O,clearHistory:G}}import{useCallback as Bo}from"react";import{dispatchToolAction as ft,getToolAdapters as Ro}from"@buoy-gg/shared-ui/web";function Ao(){let e=!!Ro().query,t=Bo(async()=>{await ft("query","clearQueryCache"),await ft("query","clearMutationCache")},[]);return{isAvailable:e,error:e?null:"Connect React Query to Buoy or provide onClearReactQuery.",clearCache:e?t:null}}import{useCallback as Ho}from"react";import{dispatchToolAction as Po,getToolAdapters as zo}from"@buoy-gg/shared-ui/web";var Do="@@RESET";function Uo({resetActionType:e=Do}={}){let t=!!zo().redux,r=Ho(async()=>{await Po("redux","dispatch",{action:{type:e}})},[e]);return{isAvailable:t,error:t?null:"Connect Redux to Buoy or provide onClearRedux.",resetStore:t?r:null}}import{useCallback as No,useMemo as Lo,useState as St,useEffect as Eo}from"react";var ke=false;function Oo(){let[e,t]=St(null),[r,a]=St(null);Eo(()=>{let c=tt();c?(t(c),a(null)):a("@react-native-async-storage/async-storage is not installed")},[]);let o=No(async()=>{if(!ke){ke=true;try{if(e){let c=(await e.getAllKeys()).filter(l=>!l.startsWith("@buoy/")&&!l.startsWith("@buoy-"));c.length>0&&await e.multiRemove([...c])}}finally{setTimeout(()=>{ke=false},100)}}},[e]);return Lo(()=>!e||r?{isAvailable:false,error:r||"@react-native-async-storage/async-storage is not available",clearStorage:null}:{isAvailable:true,error:null,clearStorage:o},[e,r,o])}import{useCallback as Wo}from"react";import{SectionHeader as Te,EmptyState as Fo,night as k,Search as jo,AlertTriangle as bt,Users as Mo}from"@buoy-gg/shared-ui/web";import{buoyColors as Be,night as A,Play as Ko,X as Vo,PowerToggleButton as Xo,monoFont as Qo}from"@buoy-gg/shared-ui/web";import{useMemo as vt}from"react";import{buoyColors as $o,night as qo}from"@buoy-gg/shared-ui/web";import{jsx as Re,jsxs as _o}from"react/jsx-runtime";var xt=["#6366F1","#8B5CF6","#EC4899","#F43F5E","#F97316","#EAB308","#22C55E","#14B8A6","#06B6D4","#3B82F6"],Jo={small:{container:24,font:10,indicator:8},medium:{container:36,font:14,indicator:10},large:{container:44,font:16,indicator:12}};function Zo(e){if(!e)return"?";if(e.includes("@"))return e.charAt(0).toUpperCase();let t=e.trim().split(/\s+/);return t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase()}function Yo(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);return xt[Math.abs(t)%xt.length]}function Ae({userId:e,name:t,size:r="medium",showActiveIndicator:a=false,backgroundColor:o}){let c=Jo[r],l=vt(()=>o??Yo(e),[e,o]),m=vt(()=>Zo(t),[t]);return _o(i,{style:pe.wrapper,children:[Re(i,{style:[pe.container,{width:c.container,height:c.container,borderRadius:c.container/2,backgroundColor:l}],children:Re(p,{style:[pe.initials,{fontSize:c.font}],children:m})}),a&&Re(i,{style:[pe.indicator,{width:c.indicator,height:c.indicator,borderRadius:c.indicator/2,right:-1,bottom:-1}]})]})}var pe=F.create({wrapper:{position:"relative"},container:{alignItems:"center",justifyContent:"center"},initials:{color:"#FFFFFF",fontWeight:"600",letterSpacing:.5},indicator:{position:"absolute",backgroundColor:$o.success,borderWidth:2,borderColor:qo.color.surface}});import{jsx as H,jsxs as ae}from"react/jsx-runtime";function Ct({user:e,isActive:t=false,onPress:r,onStop:a,onRemove:o,showRemoveButton:c=false,lastUsedTime:l,variant:m="default"}){let n=e.displayName||e.email||e.id,d=e.email&&e.displayName,y=typeof e.metadata?.role=="string"?e.metadata.role:null;return ae(T,{testID:`buoy-impersonate-user-${e.id}`,style:[I.container,t&&I.activeContainer,m==="compact"&&I.compactContainer],onPress:r,disabled:t,activeOpacity:.7,children:[H(i,{style:I.avatarSection,children:H(Ae,{userId:e.id,name:n,size:m==="compact"?"small":"medium",showActiveIndicator:t})}),ae(i,{style:I.content,children:[ae(i,{style:I.nameRow,children:[H(p,{style:[I.name,t&&I.activeName],numberOfLines:1,children:n}),y?H(i,{style:I.roleBadge,children:H(p,{style:I.roleBadgeText,children:y.toUpperCase()})}):null]}),d&&H(p,{style:I.email,numberOfLines:1,children:e.email}),H(i,{style:I.metadataRow,children:ae(p,{style:I.userId,children:["ID: ",e.id]})})]}),ae(i,{style:I.actions,children:[t?H(Xo,{isEnabled:true,onToggle:a||(()=>{}),accessibilityLabel:"Stop impersonation"}):H(T,{style:I.actionButton,onPress:r,activeOpacity:.7,children:H(Ko,{size:14,color:A.color.onAccent})}),c&&o&&!t&&H(T,{style:I.removeButton,onPress:o,activeOpacity:.7,children:H(Vo,{size:12,color:A.color.textTertiary})})]}),l?H(p,{style:I.lastUsed,children:l}):null]})}var I=F.create({container:{flexDirection:"row",alignItems:"center",backgroundColor:A.color.surface,borderRadius:10,borderWidth:1,borderColor:A.color.border,padding:12,gap:12},activeContainer:{backgroundColor:Be.success+"10",borderColor:Be.success+"40"},compactContainer:{padding:10,gap:10},avatarSection:{flexShrink:0},content:{flex:1,minWidth:0},nameRow:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:2},name:{fontSize:15,fontWeight:"600",color:A.color.text,flexShrink:1},activeName:{color:Be.success},roleBadge:{backgroundColor:A.color.surfaceElevated,paddingHorizontal:6,paddingVertical:2,borderRadius:4},roleBadgeText:{fontSize:9,fontWeight:"700",color:A.color.textTertiary,letterSpacing:.5},email:{fontSize:13,color:A.color.textSecondary,marginBottom:4},metadataRow:{flexDirection:"row",alignItems:"center",gap:4},userId:{fontSize:11,color:A.color.textTertiary,fontFamily:Qo},lastUsed:{position:"absolute",bottom:8,right:10,fontSize:10,color:A.color.textTertiary},actions:{flexDirection:"row",alignItems:"center",gap:8,flexShrink:0},actionButton:{width:36,height:36,borderRadius:8,backgroundColor:A.color.accent,alignItems:"center",justifyContent:"center"},removeButton:{width:28,height:28,borderRadius:6,backgroundColor:A.color.surfaceElevated,borderWidth:1,borderColor:A.color.border,alignItems:"center",justifyContent:"center"}});import{jsx as v,jsxs as j}from"react/jsx-runtime";function wt({currentUser:e,searchQuery:t,searchResults:r,isSearching:a,searchError:o,onSelectUser:c,onStopImpersonation:l,searchAvailable:m=true}){let n=Wo(({item:d})=>{let y=e?.id===d.id;return v(Ct,{user:d,isActive:y,onPress:()=>!y&&c(d),onStop:y?l:void 0})},[e,c,l]);return j(i,{style:x.container,children:[!m&&v(i,{style:x.section,children:j(i,{style:x.warningCard,children:[v(bt,{size:18,color:k.color.warning}),j(i,{style:x.warningContent,children:[v(p,{style:x.warningTitle,children:"Search Not Available"}),v(p,{style:x.warningText,children:"Configure the onSearchUsers callback to enable user search."})]})]})}),a&&j(i,{style:x.loadingContainer,children:[v(st,{size:"small",color:k.color.accent}),v(p,{style:x.loadingText,children:"Searching users..."})]}),o?v(i,{style:x.section,children:j(i,{style:x.errorCard,children:[v(bt,{size:16,color:k.color.danger}),v(p,{style:x.errorText,children:o})]})}):null,r.length>0&&j(i,{style:x.resultsSection,children:[j(Te,{children:[v(Te.Title,{children:"Results"}),v(Te.Badge,{count:r.length})]}),v(Ce,{data:r,keyExtractor:d=>d.id,renderItem:n,ItemSeparatorComponent:()=>v(i,{style:x.separator}),contentContainerStyle:x.listContent,showsVerticalScrollIndicator:false})]}),!!t&&!a&&r.length===0&&!o&&j(i,{style:x.emptyStateContainer,children:[v(i,{style:x.emptyStateIcon,children:v(Mo,{size:28,color:k.color.textTertiary})}),v(p,{style:x.emptyStateTitle,children:"No users found"}),j(p,{style:x.emptyStateDescription,children:['No results for "',t,'"']}),v(p,{style:x.emptyStateHint,children:"Try a different search term"})]}),!t&&r.length===0&&!a&&m&&v(Fo,{title:"Search for users",description:"Tap the search icon in the header to find users by email, name, or ID",icon:jo,variant:"minimal"})]})}var x=F.create({container:{flex:1},section:{padding:16,paddingBottom:8},loadingContainer:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:10,paddingVertical:20},loadingText:{fontSize:13,color:k.color.textSecondary},resultsSection:{flex:1,paddingHorizontal:16},listContent:{paddingBottom:16},separator:{height:8},warningCard:{flexDirection:"row",alignItems:"flex-start",gap:12,backgroundColor:k.color.warningSoft,borderRadius:10,borderWidth:1,borderColor:k.color.warning+"25",padding:14},warningContent:{flex:1},warningTitle:{fontSize:14,fontWeight:"600",color:k.color.warning,marginBottom:4},warningText:{fontSize:13,color:k.color.textSecondary,lineHeight:18},errorCard:{flexDirection:"row",alignItems:"center",gap:10,backgroundColor:k.color.dangerSoft,borderRadius:10,borderWidth:1,borderColor:k.color.danger+"25",padding:12},errorText:{flex:1,fontSize:13,color:k.color.danger},emptyStateContainer:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:32,paddingVertical:48},emptyStateIcon:{width:56,height:56,borderRadius:28,backgroundColor:k.color.surfaceElevated,alignItems:"center",justifyContent:"center",marginBottom:16},emptyStateTitle:{fontSize:16,fontWeight:"600",color:k.color.text,marginBottom:6},emptyStateDescription:{fontSize:14,color:k.color.textSecondary,textAlign:"center",marginBottom:8},emptyStateHint:{fontSize:12,color:k.color.textTertiary}});import{useCallback as Go}from"react";import{night as Q,Trash2 as ea,useRelativeTime as ta,ToolEmptyState as ra}from"@buoy-gg/shared-ui/web";import{jsx as N,jsxs as It}from"react/jsx-runtime";function oa({item:e,isActive:t,onSelect:r,onStop:a,onRemove:o,showRemoveButton:c}){let l=ta(new Date(e.lastUsedAt));return N(Ct,{user:e.user,isActive:t,onPress:()=>!t&&r(e.user),onStop:t?a:void 0,onRemove:o,showRemoveButton:c,lastUsedTime:l})}function kt({history:e,currentUserId:t,onSelectUser:r,onStopImpersonation:a,onRemoveFromHistory:o,onClearHistory:c}){let l=Go(({item:m})=>{let n=t===m.user.id;return N(oa,{item:m,isActive:n,onSelect:r,onStop:a,onRemove:o?()=>o(m.user.id):void 0,showRemoveButton:!!o})},[t,r,a,o]);return e.length===0?N(ra,{testID:"buoy-impersonate-history-empty",otto:"disguise",title:"No History",message:"Users you impersonate will appear here for quick access"}):It(i,{style:M.container,children:[It(i,{style:M.headerRow,children:[N(p,{style:M.headerTitle,children:"Recent"}),N(i,{style:M.headerBadge,children:N(p,{style:M.headerBadgeText,children:e.length})}),N(i,{style:M.headerSpacer}),c&&N(T,{style:M.clearButton,onPress:c,activeOpacity:.7,children:N(ea,{size:12,color:Q.color.textTertiary})})]}),N(Ce,{data:e,keyExtractor:m=>m.user.id,renderItem:l,ItemSeparatorComponent:()=>N(i,{style:M.separator}),contentContainerStyle:M.listContent,showsVerticalScrollIndicator:false})]})}var M=F.create({container:{flex:1,paddingHorizontal:16},headerRow:{flexDirection:"row",alignItems:"center",paddingVertical:10,gap:8},headerTitle:{fontSize:12,fontWeight:"600",color:Q.color.textTertiary,textTransform:"uppercase",letterSpacing:.5},headerBadge:{backgroundColor:Q.color.surfaceElevated,paddingHorizontal:6,paddingVertical:2,borderRadius:4},headerBadgeText:{fontSize:10,fontWeight:"600",color:Q.color.textTertiary},headerSpacer:{flex:1},clearButton:{width:24,height:24,alignItems:"center",justifyContent:"center",backgroundColor:Q.color.surfaceElevated,borderRadius:4},listContent:{paddingBottom:20},separator:{height:8},emptyContainer:{flex:1,alignItems:"center",justifyContent:"center",paddingHorizontal:32,paddingVertical:48},emptyIcon:{width:56,height:56,borderRadius:28,backgroundColor:Q.color.surfaceElevated,alignItems:"center",justifyContent:"center",marginBottom:16},emptyTitle:{fontSize:16,fontWeight:"600",color:Q.color.text,marginBottom:6},emptyDescription:{fontSize:14,color:Q.color.textSecondary,textAlign:"center"}});import{useState as me,useEffect as He,useMemo as Pe}from"react";import{CollapsibleSection as ne,buoyColors as ie,night as g,Settings as aa,AlertTriangle as Tt,Info as na,Zap as ia,RefreshCw as sa,Check as ze,X as Bt,Copy as Rt,Eye as la,copyToClipboard as ca,ToggleRow as da,monoFont as De}from"@buoy-gg/shared-ui/web";import{DataViewer as ua}from"@buoy-gg/shared-ui/web/dataViewer";import{Fragment as Ue,jsx as u,jsxs as b}from"react/jsx-runtime";var se="x-impersonate-user-id",Ne=true,le={reactQuery:true,redux:true,asyncStorage:false,mmkv:false};function ce({label:e,description:t,value:r,onChange:a,recommended:o,dangerous:c,detected:l}){let m=b(Ue,{children:[l!==void 0&&b(i,{style:[s.detectedBadge,l?s.detectedBadgeActive:s.detectedBadgeInactive],children:[l?u(ze,{size:10,color:ie.success}):u(Bt,{size:10,color:g.color.textTertiary}),u(p,{style:[s.detectedText,l?s.detectedTextActive:s.detectedTextInactive],children:l?"Detected":"Not Detected"})]}),o&&l!==false&&b(i,{style:s.recommendedBadge,children:[u(ia,{size:10,color:g.color.accent}),u(p,{style:s.recommendedText,children:"Recommended"})]})]});return u(da,{variant:"plain",label:e,description:t,value:r,onValueChange:a,tone:c?"warning":"accent",emphasizeLabel:c,accessory:m})}function At({headerKey:e,settings:t,showBanner:r,onSave:a,onShowBannerChange:o,detectionStatus:c}){let[l,m]=me(e),[n,d]=me(t),[y,C]=me(r),[w,P]=me(false);He(()=>{m(e)},[e]),He(()=>{d(t)},[t]),He(()=>{C(r)},[r]);let L=Pe(()=>l!==e||n.reactQuery!==t.reactQuery||n.redux!==t.redux||n.asyncStorage!==t.asyncStorage||n.mmkv!==t.mmkv,[l,n,e,t]),D=Pe(()=>l===se&&y===Ne&&n.reactQuery===le.reactQuery&&n.redux===le.redux&&n.asyncStorage===le.asyncStorage&&n.mmkv===le.mmkv,[l,y,n]),he=()=>{a(l.trim()||se,n,y)},X=()=>{m(e),d(t),C(r)},J=()=>{m(se),d(le),C(Ne),o(Ne)},O=(S,Z)=>{d(W=>({...W,[S]:Z}))},G=Pe(()=>({defaults:{headerKey:l,showBanner:y,dataNukeSettings:{reactQuery:n.reactQuery,redux:n.redux,asyncStorage:n.asyncStorage,mmkv:n.mmkv}}}),[l,y,n]),f=async()=>{let S=`defaults: {
|
|
2
|
+
headerKey: '${l}',
|
|
4
3
|
showBanner: ${y},
|
|
5
4
|
dataNukeSettings: {
|
|
6
|
-
reactQuery: ${
|
|
7
|
-
redux: ${
|
|
8
|
-
asyncStorage: ${
|
|
9
|
-
mmkv: ${
|
|
5
|
+
reactQuery: ${n.reactQuery},
|
|
6
|
+
redux: ${n.redux},
|
|
7
|
+
asyncStorage: ${n.asyncStorage},
|
|
8
|
+
mmkv: ${n.mmkv},
|
|
10
9
|
},
|
|
11
|
-
},`;try{await sn(w),D(!0),setTimeout(()=>D(!1),2e3)}catch{}};return x(Be,{style:i.container,contentContainerStyle:i.contentContainer,children:[N&&d(s,{style:i.actionBar,children:x(s,{style:i.actionBarContent,children:[d(u,{style:i.unsavedText,children:"Unsaved changes"}),x(s,{style:i.actionButtons,children:[x(C,{style:i.discardButton,onPress:Q,children:[d(Dt,{size:14,color:p.color.textSecondary}),d(u,{style:i.discardButtonText,children:"Discard"})]}),x(C,{style:i.saveButton,onPress:Z,children:[d(Je,{size:14,color:p.color.onAccent}),d(u,{style:i.saveButtonText,children:"Save"})]})]})]})}),d(de,{title:"Header Configuration",icon:en,defaultOpen:!0,variant:"bordered",children:x(s,{style:i.sectionContent,children:[d(u,{style:i.inputLabel,children:"Header Key"}),d(Ue,{style:i.input,value:c,onChangeText:m,placeholder:"x-impersonate-user-id",placeholderTextColor:p.color.placeholder,autoCapitalize:"none",autoCorrect:!1}),x(s,{style:i.inputFooter,children:[d(u,{style:i.helperText,children:"The HTTP header key used for impersonation. Value will be the user ID."}),c!==ue&&d(C,{onPress:()=>m(ue),style:i.resetLink,children:d(u,{style:i.resetLinkText,children:"Reset to default"})})]})]})}),d(de,{title:"Display",icon:nn,defaultOpen:!0,variant:"bordered",children:d(s,{style:i.sectionContent,children:d(s,{style:i.togglesCard,children:d(ge,{label:"Floating Banner",description:"Show a floating banner when impersonation is active",value:y,onChange:w=>{v(w),r(w)},recommended:!0})})})}),d(de,{title:"Data Clearing",icon:Ut,defaultOpen:!0,variant:"bordered",children:x(s,{style:i.sectionContent,children:[d(u,{style:i.sectionDescription,children:"Choose what data to clear when impersonation starts or stops. This ensures you see fresh data for the impersonated user."}),x(s,{style:i.togglesCard,children:[d(ge,{label:"React Query",description:"Clear query cache and cancel pending queries",value:a.reactQuery,onChange:w=>F("reactQuery",w),recommended:!0,detected:g?.reactQuery}),d(s,{style:i.divider}),d(ge,{label:"Redux",description:"Reset Redux store to initial state",value:a.redux,onChange:w=>F("redux",w),recommended:!0,detected:g?.redux})]}),x(s,{style:i.advancedSection,children:[d(u,{style:i.advancedLabel,children:"Storage Options"}),x(s,{style:[i.togglesCard,i.dangerousCard],children:[d(ge,{label:"AsyncStorage",description:"Clear app data (preserves @buoy/* keys)",value:a.asyncStorage,onChange:w=>F("asyncStorage",w),dangerous:!0,detected:g?.asyncStorage}),d(s,{style:i.divider}),d(ge,{label:"MMKV",description:"Clear MMKV storage (preserves @buoy/* keys)",value:a.mmkv,onChange:w=>F("mmkv",w),dangerous:!0,detected:g?.mmkv})]})]}),(a.asyncStorage||a.mmkv)&&x(s,{style:i.warningCard,children:[d(Ut,{size:16,color:p.color.warning}),x(s,{style:i.warningContent,children:[d(u,{style:i.warningTitle,children:"Storage Clearing Enabled"}),d(u,{style:i.warningText,children:"This will remove app data like settings and cached content. Auth tokens managed by @buoy/* are preserved."})]})]})]})}),!O&&x(C,{style:i.restoreButton,onPress:ee,children:[d(rn,{size:14,color:p.color.textSecondary}),d(u,{style:i.restoreButtonText,children:"Restore Defaults"})]}),d(de,{title:"How It Works",icon:tn,defaultOpen:!1,variant:"bordered",children:x(s,{style:i.sectionContent,children:[d(u,{style:i.infoText,children:"When impersonation is enabled, the configured header is automatically added to all outgoing fetch and XMLHttpRequest calls."}),d(u,{style:[i.infoText,i.infoTextSpaced],children:"Your backend should check for this header and return data for the specified user ID instead of the authenticated user."}),x(s,{style:i.codeBlock,children:[d(u,{style:i.codeComment,children:"// Example request header"}),x(u,{style:i.codeText,children:[c||"x-impersonate-user-id",": ",d(u,{style:i.codeValue,children:"user_123"})]})]})]})}),d(de,{title:"Export Configuration",icon:Bt,defaultOpen:!1,variant:"bordered",children:x(s,{style:i.sectionContent,children:[d(u,{style:i.infoText,children:"Copy current settings to use in createImpersonateTool()."}),d(s,{style:i.dataViewerContainer,children:d(cn,{title:"",data:se,showTypeFilter:!0,rawMode:!0,initialExpanded:!0})}),d(C,{style:i.copyButton,onPress:b,children:T?x(Ye,{children:[d(Je,{size:14,color:me.success}),d(u,{style:[i.copyButtonText,i.copySuccessText],children:"Copied!"})]}):x(Ye,{children:[d(Bt,{size:14,color:p.color.accent}),d(u,{style:i.copyButtonText,children:"Copy Config"})]})})]})})]})}var i=H.create({container:{flex:1},contentContainer:{padding:16,gap:12,paddingBottom:32},actionBar:{backgroundColor:p.color.accentSoft,borderRadius:10,borderWidth:1,borderColor:p.color.accentBorder,padding:12},actionBarContent:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},unsavedText:{fontSize:13,fontWeight:"500",color:p.color.accent},actionButtons:{flexDirection:"row",gap:8},saveButton:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:p.color.accent,paddingHorizontal:14,paddingVertical:8,borderRadius:6},saveButtonText:{fontSize:13,fontWeight:"600",color:p.color.onAccent},discardButton:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:p.color.surfaceElevated,paddingHorizontal:14,paddingVertical:8,borderRadius:6,borderWidth:1,borderColor:p.color.border},discardButtonText:{fontSize:13,fontWeight:"500",color:p.color.textSecondary},restoreButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,paddingVertical:12,borderRadius:8,borderWidth:1,borderColor:p.color.border,borderStyle:"dashed"},restoreButtonText:{fontSize:13,color:p.color.textSecondary},sectionContent:{paddingTop:8},sectionDescription:{fontSize:13,color:p.color.textSecondary,lineHeight:18,marginBottom:14},togglesCard:{backgroundColor:p.color.surface,borderRadius:10,borderWidth:1,borderColor:p.color.border,padding:4},dangerousCard:{borderColor:p.color.warning+"30"},advancedSection:{marginTop:16},advancedLabel:{fontSize:11,fontWeight:"600",color:p.color.textTertiary,textTransform:"uppercase",letterSpacing:.5,marginBottom:8,marginLeft:2},inputLabel:{fontSize:12,fontWeight:"600",color:p.color.textSecondary,marginBottom:8},input:{height:42,backgroundColor:p.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:p.color.border,paddingHorizontal:14,fontSize:14,color:p.color.text,fontFamily:je},inputFooter:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",marginTop:8,gap:12},helperText:{flex:1,fontSize:12,color:p.color.textTertiary,lineHeight:16},resetLink:{paddingVertical:2},resetLinkText:{fontSize:12,color:p.color.accent,fontWeight:"500"},recommendedBadge:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:p.color.accentSoft,paddingHorizontal:8,paddingVertical:3,borderRadius:4},recommendedText:{fontSize:10,fontWeight:"600",color:p.color.accent},detectedBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4},detectedBadgeActive:{backgroundColor:me.success+"15"},detectedBadgeInactive:{backgroundColor:p.color.textTertiary+"15"},detectedText:{fontSize:10,fontWeight:"600"},detectedTextActive:{color:me.success},detectedTextInactive:{color:p.color.textTertiary},divider:{height:1,backgroundColor:p.color.separator,marginHorizontal:12},warningCard:{marginTop:14,flexDirection:"row",alignItems:"flex-start",gap:12,backgroundColor:p.color.warningSoft,borderRadius:10,borderWidth:1,borderColor:p.color.warning+"25",padding:14},warningContent:{flex:1},warningTitle:{fontSize:13,fontWeight:"600",color:p.color.warning,marginBottom:4},warningText:{fontSize:12,color:p.color.textSecondary,lineHeight:17},infoText:{fontSize:13,color:p.color.textSecondary,lineHeight:19},infoTextSpaced:{marginTop:10},codeBlock:{marginTop:14,backgroundColor:p.color.bg,borderRadius:8,padding:14},codeComment:{fontSize:12,color:p.color.textTertiary,fontFamily:je,marginBottom:6},codeText:{fontSize:13,color:p.color.text,fontFamily:je},codeValue:{color:p.color.accent},dataViewerContainer:{marginTop:12,borderRadius:8,overflow:"hidden",borderWidth:1,borderColor:p.color.border},copyButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,marginTop:14,backgroundColor:p.color.accentSoft,paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1,borderColor:p.color.accentBorder},copyButtonText:{fontSize:13,fontWeight:"600",color:p.color.accent},copySuccessText:{color:me.success}});import{jsx as B,jsxs as et}from"react/jsx-runtime";var mn=ln,hn=[{key:"search",label:"Search"},{key:"history",label:"History"},{key:"settings",label:"Settings"}],yn=[{key:"search",label:"Search"},{key:"history",label:"History"}];function ke({visible:t,onClose:e,onBack:o,onMinimize:n,onSearchUsers:r,onClearReactQuery:g,onClearRedux:c,onClearAsyncStorage:m,onClearMMKV:a,showSettingsTab:h=!0,inline:y=!1}){let v=h?hn:yn,[T,D]=Ze("search"),[N,O]=Ze(!1),Z=Nt(!1),[Q,ee]=Ze(""),F=Nt(null),{clearCache:se,isAvailable:b}=It(),{resetStore:w,isAvailable:te}=Ct(),{clearStorage:oe,isAvailable:J}=kt(),He=g??se??void 0,Qt=c??w??void 0,jt=m??oe??void 0,$t={reactQuery:!!g||b,redux:!!c||te,asyncStorage:!!m||J,mmkv:!!a},{isActive:Jt,currentUser:at,headerKey:Yt,dataNukeSettings:Gt,showBanner:Zt,searchQuery:eo,searchResults:to,isSearching:oo,searchError:ro,searchUsers:it,startImpersonation:ct,stopImpersonation:lt,updateHeaderKey:dt,updateDataNukeSettings:ut,updateShowBanner:Pe,history:no,removeFromHistory:so,clearHistory:ao}=Oe({onSearchUsers:r,onClearReactQuery:He,onClearRedux:Qt,onClearAsyncStorage:jt,onClearMMKV:a});Lt(()=>{N&&F.current&&setTimeout(()=>{F.current?.focus()},100)},[N]),Lt(()=>{!h&&T==="settings"&&D("search")},[h,T]);let io=he(Y=>{ee(Y)},[]),co=he(()=>{Q.trim()&&it(Q.trim()),O(!1)},[Q,it]),pt=he(async Y=>{await ct(Y)},[ct]),lo=he(async(Y,po,go)=>{await dt(Y),await ut(po),await Pe(go)},[dt,ut,Pe]),uo=he(Y=>{D(Y),O(!1)},[]),gt=()=>et(ye,{children:[o&&B(ye.Navigation,{onBack:o}),B(ye.Content,{title:"",children:N?B(ye.Search,{value:Q,onChangeText:io,onCancel:()=>{ee(""),O(!1)},onDismiss:()=>O(!1),dismissOnBlur:!0,placeholder:"Search by email, name, or ID...",iconSize:14,testID:"buoy-impersonate-search-input",inputProps:{onSubmitEditing:co}}):B(dn,{tabs:v,activeTab:T,onTabChange:uo})}),B(ye.Actions,{children:T==="search"&&!N&&B(C,{testID:"buoy-impersonate-search-toggle",onPress:()=>O(!0),style:Te.headerActionButton,children:B(pn,{size:14,color:Vt.color.textSecondary})})})]});if(!t)return null;let mt=et(s,{style:Te.container,children:[T==="search"&&B(_e,{currentUser:at,isActive:Jt,searchQuery:eo,searchResults:to,isSearching:oo,searchError:ro,onSelectUser:pt,onStopImpersonation:lt,searchAvailable:!!r}),T==="history"&&B(Xe,{history:no,currentUserId:at?.id??null,onSelectUser:pt,onStopImpersonation:lt,onRemoveFromHistory:so,onClearHistory:ao}),T==="settings"&&B(Ge,{headerKey:Yt,settings:Gt,showBanner:Zt,onSave:lo,onShowBannerChange:Pe,detectionStatus:$t})]});return y?B(Et,{children:et(s,{style:Te.inlineRoot,children:[B(s,{style:Te.inlineHeader,...gn,children:gt()}),mt]})}):B(Et,{children:B(mn,{visible:t,onClose:e,onMinimize:n,header:{showToggleButton:!0,customContent:gt()},enablePersistence:!0,initialMode:"bottomSheet",disableScrollWrapper:!0,children:mt})})}function fn(t){return B(ke,{...t,inline:!0,visible:!0,onClose:()=>{}})}var Te=H.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:un.border,backgroundColor:"transparent"},container:{flex:1},headerActionButton:{width:28,height:28,borderRadius:6,backgroundColor:Vt.color.buttonSurface,justifyContent:"center",alignItems:"center"}});import{useSyncExternalStore as zt}from"react";import{buoyColors as Re,X as Sn,PowerToggleButton as bn}from"@buoy-gg/shared-ui/web";import{jsx as $,jsxs as tt}from"react/jsx-runtime";function fe({onPress:t,onStopPress:e,position:o="top",offset:n=50}){let r=zt(l.subscribe,l.getSnapshot,l.getSnapshot);if(!r.isActive||!r.currentUser||!r.showBanner)return null;let g=async()=>{console.log("[impersonate] banner pause/resume pressed"),r.isPaused?await l.resumeImpersonation():await l.pauseImpersonation()},c=r.currentUser.displayName||r.currentUser.email||r.currentUser.id,m=o==="top"?{top:n}:{bottom:n},a=async()=>{console.log("[impersonate] banner STOP pressed"),await l.stopImpersonation()};return $(s,{style:[X.container,m],children:tt(s,{style:X.banner,children:[tt(C,{style:X.userSection,onPress:t,activeOpacity:.7,children:[$(ne,{userId:r.currentUser.id,name:c,size:"small",showActiveIndicator:!1}),$(u,{style:[X.userName,r.isPaused&&X.userNamePaused],numberOfLines:1,children:c})]}),$(bn,{isEnabled:!r.isPaused,onToggle:g,size:"small",accessibilityLabel:"Toggle impersonation"}),$(C,{style:X.closeButton,onPress:a,activeOpacity:.7,children:$(Sn,{size:12,color:"rgba(255, 255, 255, 0.5)"})})]})})}function vn({onPress:t}){let e=zt(l.subscribe,l.getSnapshot,l.getSnapshot);return!e.isActive||!e.currentUser?null:tt(C,{style:X.minimalBanner,onPress:t,activeOpacity:.8,children:[$(s,{style:X.minimalDot}),$(u,{style:X.minimalText,children:"IMP"})]})}var X=H.create({container:{position:"absolute",left:0,right:0,alignItems:"center",zIndex:9999,pointerEvents:"box-none"},banner:{flexDirection:"row",alignItems:"center",backgroundColor:"rgba(20, 20, 20, 0.94)",borderWidth:1,borderColor:Re.success+"40",borderRadius:22,paddingVertical:7,paddingLeft:7,paddingRight:10,gap:10,marginTop:3,shadowColor:"#000",shadowOffset:{width:0,height:6},shadowOpacity:.3,shadowRadius:14,elevation:10},userSection:{flexDirection:"row",alignItems:"center",gap:10},userName:{fontSize:14,fontWeight:"600",color:"#fff",maxWidth:180},userNamePaused:{opacity:.6},closeButton:{width:22,height:22,borderRadius:11,backgroundColor:"rgba(128, 128, 128, 0.16)",alignItems:"center",justifyContent:"center",marginLeft:-4},minimalBanner:{position:"absolute",top:60,right:16,flexDirection:"row",alignItems:"center",backgroundColor:"rgba(26, 26, 26, 0.92)",borderWidth:1,borderColor:Re.success+"35",borderRadius:12,paddingVertical:5,paddingHorizontal:10,gap:5,zIndex:9999,shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.2,shadowRadius:6,elevation:4},minimalDot:{width:6,height:6,borderRadius:3,backgroundColor:Re.success},minimalText:{fontSize:10,fontWeight:"700",color:Re.success,letterSpacing:.5}});import{isOverWireBudget as xn}from"@buoy-gg/shared-ui/web";var rt=null;function Wt(t){rt=t}var ot=2*1024,wn=16*1024,Ot=Object.freeze({__buoyOmitted:"user-metadata",note:"User metadata stays on the device."});function In(t){if(!t)return t;if(t.startsWith("data:")){let e=t.indexOf(",");return`${e>=0?t.slice(0,Math.min(e+1,64)):"data:"}[${t.length} chars]`}return t.length<=ot?t:`${t.slice(0,ot)}\u2026 [${t.length-ot} more]`}function Cn(t){if(!t)return t;let e=typeof t.role=="string"?t.role:void 0;return xn(t,wn)?e?{role:e,...Ot}:{...Ot}:t}function nt(t){return{...t,avatarUrl:In(t.avatarUrl),metadata:Cn(t.metadata)}}function Mt(t){return{...t,currentUser:t.currentUser?nt(t.currentUser):null,history:t.history.map(e=>({...e,user:nt(e.user)}))}}var Ft=new Set;function Tn(t){for(let e of t)e&&typeof e=="object"&&e.id&&Ft.add(String(e.id))}function kn(t){if(!t||typeof t!="object"||!t.id)return!1;if(Ft.has(String(t.id)))return!0;let e=l.getState();return e.currentUser?.id===t.id?!0:e.history.some(o=>o.user.id===t.id)}function Kt(t){return{searchUsers:async e=>{let o=String(e?.query??""),n=await t(o);return Array.isArray(n)&&Tn(n),Array.isArray(n)?n.map(nt):n},startImpersonation:async e=>{let o=e?.user;if(!kn(o))throw new Error("That user isn't in this app's directory. Call searchUsers and impersonate one of its results \u2014 a user object that didn't come from search impersonates nobody.");return await l.startImpersonation(o),{ok:!0,userId:o.id}},stopImpersonation:()=>l.stopImpersonation(),pauseImpersonation:()=>l.pauseImpersonation(),resumeImpersonation:()=>l.resumeImpersonation(),updateSettings:e=>{let o=e??{},n=o.settings??(["headerKey","ignorePatterns","showBanner","dataNukeSettings"].some(r=>r in o)?o:void 0);if(!n)throw new Error("updateSettings needs { settings: { headerKey?, ignorePatterns?, showBanner?, dataNukeSettings? } }.");return l.updateSettings(n)},removeFromHistory:e=>l.removeFromHistory(e.userId),clearHistory:()=>l.clearHistory()}}function Rn({onSearchUsers:t}){return{version:1,getSnapshot:()=>Mt(l.getState()),subscribe:e=>l.subscribe(e),actions:Kt(t)}}var An={dispose:()=>l.disposeAccountSession(),version:1,getSnapshot:()=>Mt(l.getState()),subscribe:t=>l.subscribe(t),actions:Kt(t=>{if(!rt)throw new Error("No onSearchUsers configured \u2014 pass it to createImpersonateTool()");return rt(t)})};import{ImpersonateIcon as qt,IMPERSONATE_ICON_COLOR as Pn}from"@buoy-gg/shared-ui/web";import{jsx as Xt}from"react/jsx-runtime";var _t=!1;async function Hn(){if(!(typeof window>"u"||_t)){_t=!0,console.log("[impersonate] bootstrap: start"),L().isListening||L().startListening();try{let t=ve();if(!t||typeof t.getItem!="function"){console.warn("[impersonate] bootstrap: AsyncStorage shape unexpected",Object.keys(t??{}));return}let e={getItem:o=>t.getItem(o),setItem:(o,n)=>t.setItem(o,n)};l.setAsyncStorage(e),console.log("[impersonate] bootstrap: AsyncStorage adapter installed"),await l.initializeAsync(e),console.log("[impersonate] bootstrap: initializeAsync done")}catch(t){console.warn("[impersonate] bootstrap: failed",t)}}}function Un(t){let{id:e="impersonate",name:o="IMPERSONATE",description:n="User impersonation for admin testing",defaults:r,showSettingsTab:g=!0,onSearchUsers:c,onClearReactQuery:m,onClearRedux:a,onClearAsyncStorage:h,onClearMMKV:y}=t;return r&&l.setDeveloperDefaults(r),Wt(c??null),Hn(),{id:e,name:o,description:n,slot:"both",icon:({size:T,slot:D})=>Xt(qt,{size:D==="dial"?T*1.5:T,color:Pn}),component:T=>Xt(ke,{...T,onSearchUsers:c,onClearReactQuery:m,onClearRedux:a,onClearAsyncStorage:h,onClearMMKV:y,showSettingsTab:g}),props:{enableSharedModalDimensions:!1},Banner:fe}}import{jsx as Dn}from"react/jsx-runtime";function Bn(){return Dn(fe,{position:"top",offset:50})}import{buoyColors as Se,night as be,X as Nn}from"@buoy-gg/shared-ui/web";import{jsx as G,jsxs as Ae}from"react/jsx-runtime";function Ln({user:t,onStopImpersonation:e}){let o=t.displayName||t.email||t.id;return Ae(s,{style:q.container,children:[Ae(s,{style:q.userSection,children:[G(ne,{userId:t.id,name:o,size:"small",showActiveIndicator:!1}),G(s,{style:q.userInfo,children:G(u,{style:q.userName,numberOfLines:1,children:o})})]}),Ae(s,{style:q.statusPill,children:[G(s,{style:q.pulseDot}),G(u,{style:q.statusText,children:"Active"})]}),Ae(C,{style:q.stopButton,onPress:e,activeOpacity:.7,children:[G(Nn,{size:12,color:be.color.danger}),G(u,{style:q.stopButtonText,children:"Stop"})]})]})}var q=H.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:10,paddingHorizontal:16,backgroundColor:Se.success+"10",borderBottomWidth:1,borderBottomColor:Se.success+"25",gap:12},userSection:{flexDirection:"row",alignItems:"center",flex:1,gap:10,minWidth:0},userInfo:{flex:1,minWidth:0},userName:{fontSize:14,fontWeight:"600",color:be.color.text},statusPill:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:Se.success+"20",paddingHorizontal:10,paddingVertical:5,borderRadius:12},pulseDot:{width:6,height:6,borderRadius:3,backgroundColor:Se.success},statusText:{fontSize:11,fontWeight:"600",color:Se.success,textTransform:"uppercase",letterSpacing:.5},stopButton:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:12,paddingVertical:6,backgroundColor:be.color.dangerSoft,borderRadius:6,borderWidth:1,borderColor:be.color.danger+"30"},stopButtonText:{fontSize:12,fontWeight:"600",color:be.color.danger}});import{useCallback as st,useSyncExternalStore as En}from"react";function Vn(){let t=En(l.subscribe,l.getSnapshot,l.getSnapshot),e=st(async r=>{await l.quickSwitch(r)},[]),o=st(async r=>{await l.removeFromHistory(r)},[]),n=st(async()=>{await l.clearHistory()},[]);return{history:t.history,currentUserId:t.currentUser?.id??null,quickSwitch:e,removeFromHistory:o,clearHistory:n}}export{Ge as DataNukeSettingsComponent,fe as ImpersonateBanner,vn as ImpersonateBannerMinimal,Xe as ImpersonateHistoryList,qt as ImpersonateIcon,ke as ImpersonateModal,Bn as ImpersonateOverlay,Ln as ImpersonateStatusBar,fn as ImpersonateToolView,_e as UserSearchView,Rn as createImpersonateSyncAdapter,Un as createImpersonateTool,vr as getImpersonatedUserId,L as impersonateListener,l as impersonateStore,An as impersonateSyncAdapter,br as isImpersonating,Ee as setImpersonateConfig,fr as startImpersonateListener,Sr as stopImpersonateListener,Oe as useImpersonate,Vn as useImpersonateHistory};
|
|
10
|
+
},`;try{await ca(S),P(true),setTimeout(()=>P(false),2e3)}catch{}};return b(it,{style:s.container,contentContainerStyle:s.contentContainer,children:[L&&u(i,{style:s.actionBar,children:b(i,{style:s.actionBarContent,children:[u(p,{style:s.unsavedText,children:"Unsaved changes"}),b(i,{style:s.actionButtons,children:[b(T,{style:s.discardButton,onPress:X,children:[u(Bt,{size:14,color:g.color.textSecondary}),u(p,{style:s.discardButtonText,children:"Discard"})]}),b(T,{style:s.saveButton,onPress:he,children:[u(ze,{size:14,color:g.color.onAccent}),u(p,{style:s.saveButtonText,children:"Save"})]})]})]})}),u(ne,{title:"Header Configuration",icon:aa,defaultOpen:true,variant:"bordered",children:b(i,{style:s.sectionContent,children:[u(p,{style:s.inputLabel,children:"Header Key"}),u(nt,{style:s.input,value:l,onChangeText:m,placeholder:"x-impersonate-user-id",placeholderTextColor:g.color.placeholder,autoCapitalize:"none",autoCorrect:false}),b(i,{style:s.inputFooter,children:[u(p,{style:s.helperText,children:"The HTTP header key used for impersonation. Value will be the user ID."}),l!==se&&u(T,{onPress:()=>m(se),style:s.resetLink,children:u(p,{style:s.resetLinkText,children:"Reset to default"})})]})]})}),u(ne,{title:"Display",icon:la,defaultOpen:true,variant:"bordered",children:u(i,{style:s.sectionContent,children:u(i,{style:s.togglesCard,children:u(ce,{label:"Floating Banner",description:"Show a floating banner when impersonation is active",value:y,onChange:S=>{C(S),o(S)},recommended:true})})})}),u(ne,{title:"Data Clearing",icon:Tt,defaultOpen:true,variant:"bordered",children:b(i,{style:s.sectionContent,children:[u(p,{style:s.sectionDescription,children:"Choose what data to clear when impersonation starts or stops. This ensures you see fresh data for the impersonated user."}),b(i,{style:s.togglesCard,children:[u(ce,{label:"React Query",description:"Clear query cache and cancel pending queries",value:n.reactQuery,onChange:S=>O("reactQuery",S),recommended:true,detected:c?.reactQuery}),u(i,{style:s.divider}),u(ce,{label:"Redux",description:"Reset Redux store to initial state",value:n.redux,onChange:S=>O("redux",S),recommended:true,detected:c?.redux})]}),b(i,{style:s.advancedSection,children:[u(p,{style:s.advancedLabel,children:"Storage Options"}),b(i,{style:[s.togglesCard,s.dangerousCard],children:[u(ce,{label:"AsyncStorage",description:"Clear app data (preserves @buoy/* keys)",value:n.asyncStorage,onChange:S=>O("asyncStorage",S),dangerous:true,detected:c?.asyncStorage}),u(i,{style:s.divider}),u(ce,{label:"MMKV",description:"Clear MMKV storage (preserves @buoy/* keys)",value:n.mmkv,onChange:S=>O("mmkv",S),dangerous:true,detected:c?.mmkv})]})]}),(n.asyncStorage||n.mmkv)&&b(i,{style:s.warningCard,children:[u(Tt,{size:16,color:g.color.warning}),b(i,{style:s.warningContent,children:[u(p,{style:s.warningTitle,children:"Storage Clearing Enabled"}),u(p,{style:s.warningText,children:"This will remove app data like settings and cached content. Auth tokens managed by @buoy/* are preserved."})]})]})]})}),!D&&b(T,{style:s.restoreButton,onPress:J,children:[u(sa,{size:14,color:g.color.textSecondary}),u(p,{style:s.restoreButtonText,children:"Restore Defaults"})]}),u(ne,{title:"How It Works",icon:na,defaultOpen:false,variant:"bordered",children:b(i,{style:s.sectionContent,children:[u(p,{style:s.infoText,children:"When impersonation is enabled, the configured header is automatically added to all outgoing fetch and XMLHttpRequest calls."}),u(p,{style:[s.infoText,s.infoTextSpaced],children:"Your backend should check for this header and return data for the specified user ID instead of the authenticated user."}),b(i,{style:s.codeBlock,children:[u(p,{style:s.codeComment,children:"// Example request header"}),b(p,{style:s.codeText,children:[l||"x-impersonate-user-id",": ",u(p,{style:s.codeValue,children:"user_123"})]})]})]})}),u(ne,{title:"Export Configuration",icon:Rt,defaultOpen:false,variant:"bordered",children:b(i,{style:s.sectionContent,children:[u(p,{style:s.infoText,children:"Copy current settings to use in createImpersonateTool()."}),u(i,{style:s.dataViewerContainer,children:u(ua,{title:"",data:G,showTypeFilter:true,rawMode:true,initialExpanded:true})}),u(T,{style:s.copyButton,onPress:f,children:w?b(Ue,{children:[u(ze,{size:14,color:ie.success}),u(p,{style:[s.copyButtonText,s.copySuccessText],children:"Copied!"})]}):b(Ue,{children:[u(Rt,{size:14,color:g.color.accent}),u(p,{style:s.copyButtonText,children:"Copy Config"})]})})]})})]})}var s=F.create({container:{flex:1},contentContainer:{padding:16,gap:12,paddingBottom:32},actionBar:{backgroundColor:g.color.accentSoft,borderRadius:10,borderWidth:1,borderColor:g.color.accentBorder,padding:12},actionBarContent:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},unsavedText:{fontSize:13,fontWeight:"500",color:g.color.accent},actionButtons:{flexDirection:"row",gap:8},saveButton:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:g.color.accent,paddingHorizontal:14,paddingVertical:8,borderRadius:6},saveButtonText:{fontSize:13,fontWeight:"600",color:g.color.onAccent},discardButton:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:g.color.surfaceElevated,paddingHorizontal:14,paddingVertical:8,borderRadius:6,borderWidth:1,borderColor:g.color.border},discardButtonText:{fontSize:13,fontWeight:"500",color:g.color.textSecondary},restoreButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,paddingVertical:12,borderRadius:8,borderWidth:1,borderColor:g.color.border,borderStyle:"dashed"},restoreButtonText:{fontSize:13,color:g.color.textSecondary},sectionContent:{paddingTop:8},sectionDescription:{fontSize:13,color:g.color.textSecondary,lineHeight:18,marginBottom:14},togglesCard:{backgroundColor:g.color.surface,borderRadius:10,borderWidth:1,borderColor:g.color.border,padding:4},dangerousCard:{borderColor:g.color.warning+"30"},advancedSection:{marginTop:16},advancedLabel:{fontSize:11,fontWeight:"600",color:g.color.textTertiary,textTransform:"uppercase",letterSpacing:.5,marginBottom:8,marginLeft:2},inputLabel:{fontSize:12,fontWeight:"600",color:g.color.textSecondary,marginBottom:8},input:{height:42,backgroundColor:g.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:g.color.border,paddingHorizontal:14,fontSize:14,color:g.color.text,fontFamily:De},inputFooter:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",marginTop:8,gap:12},helperText:{flex:1,fontSize:12,color:g.color.textTertiary,lineHeight:16},resetLink:{paddingVertical:2},resetLinkText:{fontSize:12,color:g.color.accent,fontWeight:"500"},recommendedBadge:{flexDirection:"row",alignItems:"center",gap:4,backgroundColor:g.color.accentSoft,paddingHorizontal:8,paddingVertical:3,borderRadius:4},recommendedText:{fontSize:10,fontWeight:"600",color:g.color.accent},detectedBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4},detectedBadgeActive:{backgroundColor:ie.success+"15"},detectedBadgeInactive:{backgroundColor:g.color.textTertiary+"15"},detectedText:{fontSize:10,fontWeight:"600"},detectedTextActive:{color:ie.success},detectedTextInactive:{color:g.color.textTertiary},divider:{height:1,backgroundColor:g.color.separator,marginHorizontal:12},warningCard:{marginTop:14,flexDirection:"row",alignItems:"flex-start",gap:12,backgroundColor:g.color.warningSoft,borderRadius:10,borderWidth:1,borderColor:g.color.warning+"25",padding:14},warningContent:{flex:1},warningTitle:{fontSize:13,fontWeight:"600",color:g.color.warning,marginBottom:4},warningText:{fontSize:12,color:g.color.textSecondary,lineHeight:17},infoText:{fontSize:13,color:g.color.textSecondary,lineHeight:19},infoTextSpaced:{marginTop:10},codeBlock:{marginTop:14,backgroundColor:g.color.bg,borderRadius:8,padding:14},codeComment:{fontSize:12,color:g.color.textTertiary,fontFamily:De,marginBottom:6},codeText:{fontSize:13,color:g.color.text,fontFamily:De},codeValue:{color:g.color.accent},dataViewerContainer:{marginTop:12,borderRadius:8,overflow:"hidden",borderWidth:1,borderColor:g.color.border},copyButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,marginTop:14,backgroundColor:g.color.accentSoft,paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1,borderColor:g.color.accentBorder},copyButtonText:{fontSize:13,fontWeight:"600",color:g.color.accent},copySuccessText:{color:ie.success}});import{jsx as B,jsxs as Le}from"react/jsx-runtime";var ha=uo,ga=[{key:"search",label:"Search"},{key:"history",label:"History"},{key:"settings",label:"Settings"}],pa=[{key:"search",label:"Search"},{key:"history",label:"History"}];function Ee({visible:e,onClose:t,onBack:r,onMinimize:a,onSearchUsers:o,onClearReactQuery:c,onClearRedux:l,onClearAsyncStorage:m,onClearMMKV:n,showSettingsTab:d=true,inline:y=false}){let C=d?ga:pa,[w,P]=xe("search"),[L,D]=xe(false),he=rt(false),[X,J]=xe(""),O=rt(null),{clearCache:G,isAvailable:f}=Ao(),{resetStore:S,isAvailable:Z}=Uo(),{clearStorage:W,isAvailable:be}=Oo(),Ot=c??G??void 0,Wt=l??S??void 0,Ft=m??W??void 0,jt={reactQuery:!!c||f,redux:!!l||Z,asyncStorage:!!m||be,mmkv:!!n},{isActive:Mt,currentUser:Ve,headerKey:Kt,dataNukeSettings:Vt,showBanner:Xt,searchQuery:Qt,searchResults:$t,isSearching:qt,searchError:_t,searchUsers:Xe,startImpersonation:Qe,stopImpersonation:$e,updateHeaderKey:qe,updateDataNukeSettings:_e,updateShowBanner:ve,history:Jt,removeFromHistory:Zt,clearHistory:Yt}=yt({onSearchUsers:o,onClearReactQuery:Ot,onClearRedux:Wt,onClearAsyncStorage:Ft,onClearMMKV:n});ot(()=>{L&&O.current&&setTimeout(()=>{O.current?.focus()},100)},[L]),ot(()=>{!d&&w==="settings"&&P("search")},[d,w]);let Gt=ee(q=>{J(q)},[]),er=ee(()=>{X.trim()&&Xe(X.trim()),D(false)},[X,Xe]),Je=ee(async q=>{await Qe(q)},[Qe]),tr=ee(async(q,or,ar)=>{await qe(q),await _e(or),await ve(ar)},[qe,_e,ve]),rr=ee(q=>{P(q),D(false)},[]),Ze=()=>Le(te,{children:[r&&B(te.Navigation,{onBack:r}),B(te.Content,{title:"",children:L?B(te.Search,{value:X,onChangeText:Gt,onCancel:()=>{J(""),D(false)},onDismiss:()=>D(false),dismissOnBlur:true,placeholder:"Search by email, name, or ID...",iconSize:14,testID:"buoy-impersonate-search-input",inputProps:{onSubmitEditing:er}}):B(ho,{tabs:C,activeTab:w,onTabChange:rr})}),B(te.Actions,{children:w==="search"&&!L&&B(T,{testID:"buoy-impersonate-search-toggle",onPress:()=>D(true),style:ye.headerActionButton,children:B(po,{size:14,color:lt.color.textSecondary})})})]});if(!e)return null;let Ye=Le(i,{style:ye.container,children:[w==="search"&&B(wt,{currentUser:Ve,isActive:Mt,searchQuery:Qt,searchResults:$t,isSearching:qt,searchError:_t,onSelectUser:Je,onStopImpersonation:$e,searchAvailable:!!o}),w==="history"&&B(kt,{history:Jt,currentUserId:Ve?.id??null,onSelectUser:Je,onStopImpersonation:$e,onRemoveFromHistory:Zt,onClearHistory:Yt}),w==="settings"&&B(At,{headerKey:Kt,settings:Vt,showBanner:Xt,onSave:tr,onShowBannerChange:ve,detectionStatus:jt})]});return y?B(ct,{children:Le(i,{style:ye.inlineRoot,children:[B(i,{style:ye.inlineHeader,...mo,children:Ze()}),Ye]})}):B(ct,{children:B(ha,{visible:e,onClose:t,onMinimize:a,header:{showToggleButton:true,customContent:Ze()},enablePersistence:true,initialMode:"bottomSheet",disableScrollWrapper:true,children:Ye})})}function ma(e){return B(Ee,{...e,inline:true,visible:true,onClose:()=>{}})}var ye=F.create({inlineRoot:{flex:1,minHeight:0,backgroundColor:"transparent"},inlineHeader:{paddingHorizontal:12,paddingVertical:8,borderBottomWidth:1,borderBottomColor:go.border,backgroundColor:"transparent"},container:{flex:1},headerActionButton:{width:28,height:28,borderRadius:6,backgroundColor:lt.color.buttonSurface,justifyContent:"center",alignItems:"center"}});import{useSyncExternalStore as Ht}from"react";import{buoyColors as fe,X as ya,PowerToggleButton as fa}from"@buoy-gg/shared-ui/web";import{jsx as $,jsxs as Oe}from"react/jsx-runtime";function We({onPress:e,onStopPress:t,position:r="top",offset:a=50}){let o=Ht(h.subscribe,h.getSnapshot,h.getSnapshot);if(!o.isActive||!o.currentUser||!o.showBanner)return null;let c=async()=>{console.log("[impersonate] banner pause/resume pressed"),o.isPaused?await h.resumeImpersonation():await h.pauseImpersonation()},l=o.currentUser.displayName||o.currentUser.email||o.currentUser.id,m=r==="top"?{top:a}:{bottom:a},n=async()=>{console.log("[impersonate] banner STOP pressed"),await h.stopImpersonation()};return $(i,{style:[K.container,m],children:Oe(i,{style:K.banner,children:[Oe(T,{style:K.userSection,onPress:e,activeOpacity:.7,children:[$(Ae,{userId:o.currentUser.id,name:l,size:"small",showActiveIndicator:false}),$(p,{style:[K.userName,o.isPaused&&K.userNamePaused],numberOfLines:1,children:l})]}),$(fa,{isEnabled:!o.isPaused,onToggle:c,size:"small",accessibilityLabel:"Toggle impersonation"}),$(T,{style:K.closeButton,onPress:n,activeOpacity:.7,children:$(ya,{size:12,color:"rgba(255, 255, 255, 0.5)"})})]})})}function Sa({onPress:e}){let t=Ht(h.subscribe,h.getSnapshot,h.getSnapshot);return!t.isActive||!t.currentUser?null:Oe(T,{style:K.minimalBanner,onPress:e,activeOpacity:.8,children:[$(i,{style:K.minimalDot}),$(p,{style:K.minimalText,children:"IMP"})]})}var K=F.create({container:{position:"absolute",left:0,right:0,alignItems:"center",zIndex:9999,pointerEvents:"box-none"},banner:{flexDirection:"row",alignItems:"center",backgroundColor:"rgba(20, 20, 20, 0.94)",borderWidth:1,borderColor:fe.success+"40",borderRadius:22,paddingVertical:7,paddingLeft:7,paddingRight:10,gap:10,marginTop:3,shadowColor:"#000",shadowOffset:{width:0,height:6},shadowOpacity:.3,shadowRadius:14,elevation:10},userSection:{flexDirection:"row",alignItems:"center",gap:10},userName:{fontSize:14,fontWeight:"600",color:"#fff",maxWidth:180},userNamePaused:{opacity:.6},closeButton:{width:22,height:22,borderRadius:11,backgroundColor:"rgba(128, 128, 128, 0.16)",alignItems:"center",justifyContent:"center",marginLeft:-4},minimalBanner:{position:"absolute",top:60,right:16,flexDirection:"row",alignItems:"center",backgroundColor:"rgba(26, 26, 26, 0.92)",borderWidth:1,borderColor:fe.success+"35",borderRadius:12,paddingVertical:5,paddingHorizontal:10,gap:5,zIndex:9999,shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.2,shadowRadius:6,elevation:4},minimalDot:{width:6,height:6,borderRadius:3,backgroundColor:fe.success},minimalText:{fontSize:10,fontWeight:"700",color:fe.success,letterSpacing:.5}});import{isOverWireBudget as ba}from"@buoy-gg/shared-ui/web";var Fe=null;function va(e){Fe=e}var je=2*1024,xa=16*1024,Pt=Object.freeze({__buoyOmitted:"user-metadata",note:"User metadata stays on the device."});function Ca(e){if(!e)return e;if(e.startsWith("data:")){let t=e.indexOf(",");return`${t>=0?e.slice(0,Math.min(t+1,64)):"data:"}[${e.length} chars]`}return e.length<=je?e:`${e.slice(0,je)}\u2026 [${e.length-je} more]`}function wa(e){if(!e)return e;let t=typeof e.role=="string"?e.role:void 0;return ba(e,xa)?t?{role:t,...Pt}:{...Pt}:e}function Me(e){return{...e,avatarUrl:Ca(e.avatarUrl),metadata:wa(e.metadata)}}function zt(e){return{...e,currentUser:e.currentUser?Me(e.currentUser):null,history:e.history.map(t=>({...t,user:Me(t.user)}))}}var Dt=new Set;function Ia(e){for(let t of e)t&&typeof t=="object"&&t.id&&Dt.add(String(t.id))}function ka(e){if(!e||typeof e!="object"||!e.id)return false;if(Dt.has(String(e.id)))return true;let t=h.getState();return t.currentUser?.id===e.id?true:t.history.some(r=>r.user.id===e.id)}function Ut(e){return{searchUsers:async t=>{let r=String(t?.query??""),a=await e(r);return Array.isArray(a)&&Ia(a),Array.isArray(a)?a.map(Me):a},startImpersonation:async t=>{let r=t?.user;if(!ka(r))throw new Error("That user isn't in this app's directory. Call searchUsers and impersonate one of its results \u2014 a user object that didn't come from search impersonates nobody.");return await h.startImpersonation(r),{ok:true,userId:r.id}},stopImpersonation:()=>h.stopImpersonation(),pauseImpersonation:()=>h.pauseImpersonation(),resumeImpersonation:()=>h.resumeImpersonation(),updateSettings:t=>{let r=t??{},a=r.settings??(["headerKey","ignorePatterns","showBanner","dataNukeSettings"].some(o=>o in r)?r:void 0);if(!a)throw new Error("updateSettings needs { settings: { headerKey?, ignorePatterns?, showBanner?, dataNukeSettings? } }.");return h.updateSettings(a)},removeFromHistory:t=>h.removeFromHistory(t.userId),clearHistory:()=>h.clearHistory()}}function Ta({onSearchUsers:e}){return{version:1,getSnapshot:()=>zt(h.getState()),subscribe:t=>h.subscribe(t),actions:Ut(e)}}var Ba={dispose:()=>h.disposeAccountSession(),version:1,getSnapshot:()=>zt(h.getState()),subscribe:e=>h.subscribe(e),actions:Ut(e=>{if(!Fe)throw new Error("No onSearchUsers configured \u2014 pass it to createImpersonateTool()");return Fe(e)})};import{ImpersonateIcon as Nt,IMPERSONATE_ICON_COLOR as Ra}from"@buoy-gg/shared-ui/web";import{jsx as Lt}from"react/jsx-runtime";var Et=false;async function Aa(){if(!(typeof window>"u"||Et)){Et=true,console.log("[impersonate] bootstrap: start"),E().isListening||E().startListening();try{let e=tt();if(!e||typeof e.getItem!="function"){console.warn("[impersonate] bootstrap: AsyncStorage shape unexpected",Object.keys(e??{}));return}let t={getItem:r=>e.getItem(r),setItem:(r,a)=>e.setItem(r,a)};h.setAsyncStorage(t),console.log("[impersonate] bootstrap: AsyncStorage adapter installed"),await h.initializeAsync(t),console.log("[impersonate] bootstrap: initializeAsync done")}catch(e){console.warn("[impersonate] bootstrap: failed",e)}}}function Ha(e){let{id:t="impersonate",name:r="IMPERSONATE",description:a="User impersonation for admin testing",defaults:o,showSettingsTab:c=true,onSearchUsers:l,onClearReactQuery:m,onClearRedux:n,onClearAsyncStorage:d,onClearMMKV:y}=e;return o&&h.setDeveloperDefaults(o),va(l??null),Aa(),{id:t,name:r,description:a,slot:"both",icon:({size:C,slot:w})=>Lt(Nt,{size:w==="dial"?C*1.5:C,color:Ra}),component:C=>Lt(Ee,{...C,onSearchUsers:l,onClearReactQuery:m,onClearRedux:n,onClearAsyncStorage:d,onClearMMKV:y,showSettingsTab:c}),props:{enableSharedModalDimensions:false},Banner:We}}import{jsx as Pa}from"react/jsx-runtime";function za(){return Pa(We,{position:"top",offset:50})}import{buoyColors as de,night as ue,X as Da}from"@buoy-gg/shared-ui/web";import{jsx as _,jsxs as Se}from"react/jsx-runtime";function Ua({user:e,onStopImpersonation:t}){let r=e.displayName||e.email||e.id;return Se(i,{style:V.container,children:[Se(i,{style:V.userSection,children:[_(Ae,{userId:e.id,name:r,size:"small",showActiveIndicator:false}),_(i,{style:V.userInfo,children:_(p,{style:V.userName,numberOfLines:1,children:r})})]}),Se(i,{style:V.statusPill,children:[_(i,{style:V.pulseDot}),_(p,{style:V.statusText,children:"Active"})]}),Se(T,{style:V.stopButton,onPress:t,activeOpacity:.7,children:[_(Da,{size:12,color:ue.color.danger}),_(p,{style:V.stopButtonText,children:"Stop"})]})]})}var V=F.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:10,paddingHorizontal:16,backgroundColor:de.success+"10",borderBottomWidth:1,borderBottomColor:de.success+"25",gap:12},userSection:{flexDirection:"row",alignItems:"center",flex:1,gap:10,minWidth:0},userInfo:{flex:1,minWidth:0},userName:{fontSize:14,fontWeight:"600",color:ue.color.text},statusPill:{flexDirection:"row",alignItems:"center",gap:6,backgroundColor:de.success+"20",paddingHorizontal:10,paddingVertical:5,borderRadius:12},pulseDot:{width:6,height:6,borderRadius:3,backgroundColor:de.success},statusText:{fontSize:11,fontWeight:"600",color:de.success,textTransform:"uppercase",letterSpacing:.5},stopButton:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:12,paddingVertical:6,backgroundColor:ue.color.dangerSoft,borderRadius:6,borderWidth:1,borderColor:ue.color.danger+"30"},stopButtonText:{fontSize:12,fontWeight:"600",color:ue.color.danger}});import{useCallback as Ke,useSyncExternalStore as Na}from"react";function La(){let e=Na(h.subscribe,h.getSnapshot,h.getSnapshot),t=Ke(async o=>{await h.quickSwitch(o)},[]),r=Ke(async o=>{await h.removeFromHistory(o)},[]),a=Ke(async()=>{await h.clearHistory()},[]);return{history:e.history,currentUserId:e.currentUser?.id??null,quickSwitch:t,removeFromHistory:r,clearHistory:a}}export{At as DataNukeSettingsComponent,We as ImpersonateBanner,Sa as ImpersonateBannerMinimal,kt as ImpersonateHistoryList,Nt as ImpersonateIcon,Ee as ImpersonateModal,za as ImpersonateOverlay,Ua as ImpersonateStatusBar,ma as ImpersonateToolView,wt as UserSearchView,Ta as createImpersonateSyncAdapter,Ha as createImpersonateTool,Io as getImpersonatedUserId,E as impersonateListener,h as impersonateStore,Ba as impersonateSyncAdapter,wo as isImpersonating,gt as setImpersonateConfig,xo as startImpersonateListener,Co as stopImpersonateListener,yt as useImpersonate,La as useImpersonateHistory};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/impersonate",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.43",
|
|
4
4
|
"description": "Configure impersonation headers for supported app requests. Your backend must authenticate and authorize user changes.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -34,13 +34,10 @@
|
|
|
34
34
|
],
|
|
35
35
|
"sideEffects": false,
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@buoy-gg/shared-ui": "^7.0.
|
|
37
|
+
"@buoy-gg/shared-ui": "^7.0.43"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"react": "*"
|
|
41
|
-
"react-native": "*",
|
|
42
|
-
"react-native-web": "^0.21.0",
|
|
43
|
-
"react-dom": ">=18"
|
|
40
|
+
"react": "*"
|
|
44
41
|
},
|
|
45
42
|
"devDependencies": {
|
|
46
43
|
"@types/react": "^19.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DataNukeSettings.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/components/DataNukeSettings.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAuC,MAAM,OAAO,CAAC;AA4B5D,OAAO,KAAK,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAWzE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,8CAA8C;IAC9C,KAAK,EAAE,OAAO,CAAC;IACf,qDAAqD;IACrD,YAAY,EAAE,OAAO,CAAC;IACtB,6CAA6C;IAC7C,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,yBAAyB;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,0CAA0C;IAC1C,UAAU,EAAE,OAAO,CAAC;IACpB,kCAAkC;IAClC,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IACzF,2EAA2E;IAC3E,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,4CAA4C;IAC5C,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAgED,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,QAAQ,EACR,UAAU,EACV,MAAM,EACN,kBAAkB,EAClB,eAAe,GAChB,EAAE,qBAAqB,qBAkVvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImpersonateBanner.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/components/ImpersonateBanner.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA+B,MAAM,OAAO,CAAC;AAUpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEvD,MAAM,WAAW,mBAAoB,SAAQ,sBAAsB;IACjE,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAC5B,2BAA2B;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,WAAW,EACX,QAAgB,EAChB,MAAW,GACZ,EAAE,mBAAmB,4BAgFrB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,GACR,EAAE,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,4BAqBzC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImpersonateHistoryList.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/components/ImpersonateHistoryList.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAsB,MAAM,OAAO,CAAC;AAgB3C,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAgCnD,MAAM,WAAW,2BAA2B;IAC1C,0CAA0C;IAC1C,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,iEAAiE;IACjE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,uDAAuD;IACvD,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,wDAAwD;IACxD,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,2CAA2C;IAC3C,mBAAmB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,kCAAkC;IAClC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,EACP,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,GACf,EAAE,2BAA2B,qBA+D7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImpersonateModal.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/components/ImpersonateModal.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AAmBxE,OAAO,KAAK,EAAE,qBAAqB,EAA0B,MAAM,UAAU,CAAC;AAgC9E,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,eAAsB,EACtB,MAAc,GACf,EAAE,qBAAqB,4BA6OvB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,qBAGrE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImpersonateOverlay.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/components/ImpersonateOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,wBAAgB,kBAAkB,sBAEjC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImpersonateStatusBar.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/components/ImpersonateStatusBar.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,UAAU,yBAAyB;IACjC,IAAI,EAAE,IAAI,CAAC;IACX,mBAAmB,EAAE,MAAM,IAAI,CAAC;CACjC;AAED,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EACJ,mBAAmB,GACpB,EAAE,yBAAyB,qBAqC3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserAvatar.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/components/UserAvatar.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,QAAA,MAAM,aAAa,UAWlB,CAAC;AAEF,KAAK,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAQ/C,MAAM,WAAW,eAAe;IAC9B,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,gCAAgC;IAChC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,iBAAS,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAczC;AAED;;GAEG;AACH,iBAAS,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAM9C;AAED,wBAAgB,UAAU,CAAC,EACzB,MAAM,EACN,IAAI,EACJ,IAAe,EACf,mBAA2B,EAC3B,eAAe,GAChB,EAAE,eAAe,qBAgDjB;AAwBD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserCard.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/components/UserCard.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,WAAW,aAAa;IAC5B,gBAAgB;IAChB,IAAI,EAAE,IAAI,CAAC;IACX,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,yBAAyB;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sBAAsB;IACtB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,QAAgB,EAChB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,gBAAwB,EACxB,YAAY,EACZ,OAAmB,GACpB,EAAE,aAAa,qBA4Ff"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserSearchView.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/components/UserSearchView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAsB,MAAM,OAAO,CAAC;AAiB3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,WAAW,mBAAmB;IAClC,8DAA8D;IAC9D,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,sCAAsC;IACtC,QAAQ,EAAE,OAAO,CAAC;IAClB,2BAA2B;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,aAAa,EAAE,IAAI,EAAE,CAAC;IACtB,oCAAoC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,uDAAuD;IACvD,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACnC,mCAAmC;IACnC,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,sDAAsD;IACtD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,cAAc,CAAC,EAC7B,WAAW,EACX,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,eAAsB,GACvB,EAAE,mBAAmB,qBAiGrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncStoragePeer.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/hooks/asyncStoragePeer.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,IAAI;IAAE,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAAC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,UAAU,IAAI,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,GAAG,IAAI,CAUnO"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncStoragePeer.web.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/hooks/asyncStoragePeer.web.ts"],"names":[],"mappings":"AACA,wBAAgB,eAAe,2EAA2B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoClearAsyncStorage.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/hooks/useAutoClearAsyncStorage.ts"],"names":[],"mappings":"AA4BA,MAAM,WAAW,8BAA8B;IAC7C,wCAAwC;IACxC,WAAW,EAAE,OAAO,CAAC;IACrB,qCAAqC;IACrC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,4DAA4D;IAC5D,YAAY,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;CAC5C;AAMD;;GAEG;AAOH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,IAAI,8BAA8B,CA+DzE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI;IAC7C,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAcA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoClearReactQuery.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/hooks/useAutoClearReactQuery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAiBH,MAAM,WAAW,4BAA4B;IAC3C,qDAAqD;IACrD,WAAW,EAAE,OAAO,CAAC;IACrB,qCAAqC;IACrC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,kDAAkD;IAClD,UAAU,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;CACjC;AAyBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,IAAI,4BAA4B,CAgErE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI;IAC3C,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CA6BA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoClearReactQuery.web.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/hooks/useAutoClearReactQuery.web.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAC7E,wBAAgB,sBAAsB,IAAI,4BAA4B,CAOrE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoClearRedux.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/hooks/useAutoClearRedux.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAgBH,8DAA8D;AAC9D,eAAO,MAAM,uBAAuB,YAAY,CAAC;AAEjD,MAAM,WAAW,wBAAwB;IACvC,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,+CAA+C;IAC/C,WAAW,EAAE,OAAO,CAAC;IACrB,qCAAqC;IACrC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,uDAAuD;IACvD,UAAU,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;CACjC;AAyBD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,GAAE,wBAA6B,GACrC,uBAAuB,CAiEzB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CA6BA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAutoClearRedux.web.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/hooks/useAutoClearRedux.web.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC7F,eAAO,MAAM,uBAAuB,YAAY,CAAC;AACjD,wBAAgB,iBAAiB,CAAC,EAAE,eAAyC,EAAE,GAAE,wBAA6B,GAAG,uBAAuB,CAIvI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useImpersonate.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/hooks/useImpersonate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAIrE,MAAM,WAAW,qBAAqB;IACpC,sDAAsD;IACtD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACnD,0CAA0C;IAC1C,iBAAiB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,qCAAqC;IACrC,mBAAmB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,6BAA6B;IAC7B,WAAW,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,oBAAoB;IAEnC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,YAAY,EAAE,CAAC;IAGxB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,IAAI,EAAE,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,WAAW,EAAE,MAAM,IAAI,CAAC;IAGxB,kBAAkB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAG3C,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,sBAAsB,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAGnD,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,cAAc,CAC5B,OAAO,GAAE,qBAA0B,GAClC,oBAAoB,CA+LtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useImpersonateHistory.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/hooks/useImpersonateHistory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGnD,MAAM,WAAW,2BAA2B;IAC1C,0CAA0C;IAC1C,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,iEAAiE;IACjE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,0CAA0C;IAC1C,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,iCAAiC;IACjC,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,wBAAwB;IACxB,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,qBAAqB,IAAI,2BAA2B,CA0BnE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/types/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impersonateListener.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/utils/impersonateListener.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAqE1D,cAAM,mBAAmB;IACvB,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,eAAe,CAAS;IAGhC,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,eAAe,CAAuC;IAC9D,OAAO,CAAC,eAAe,CAAuC;IAE9D;;;OAGG;IACH,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,cAAc,CAAqD;IAC3E,OAAO,CAAC,cAAc,CAAqD;;IAe3E;;;;;OAKG;IACH,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,IAAI;IAY5D;;OAEG;IACH,SAAS,IAAI,yBAAyB;IAItC;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;OAEG;IACH,OAAO,CAAC,UAAU;IAWlB;;;;;OAKG;IACH,cAAc,IAAI,IAAI;IA4GtB,OAAO,CAAC,YAAY,CACqE;IAEzF;;;;;;OAMG;IACH,aAAa,IAAI,IAAI;IAmCrB;;OAEG;IACH,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED;;OAEG;IACH,IAAI,eAAe,IAAI,OAAO,CAE7B;CACF;AAQD;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,mBAAmB,CAKzD;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,OAAO,CAAC,yBAAyB,CAAC,GACzC,IAAI,CAEN;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,GAAG,IAAI,CAErD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impersonateStore.d.ts","sourceRoot":"","sources":["../../../../src/impersonate/utils/impersonateStore.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAMH,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAMlE,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AAQvC,OAAO,EACL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,4CAA4C,CAAC;AACpD;;;;GAIG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,gBAAgB,IAAI,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAC1G,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AAMrF,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,YAAY,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,YAAY,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAM7F,YAAY,EACV,IAAI,EACJ,gBAAgB,IAAI,oBAAoB,EACxC,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,qBAAqB,CAAC;AAM7B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,GACtB,MAAM,yCAAyC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../src/preset.tsx"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAI/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAwEjE;;;;;;;GAOG;AACH,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE7E,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,CAAC;AAWnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB;;;;;2BAkCxC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;uBAGnC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;QAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;KAAE;;;;;EAmB3H"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"impersonateSyncAdapter.d.ts","sourceRoot":"","sources":["../../../src/sync/impersonateSyncAdapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAErE,KAAK,kBAAkB,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;AAO7D,8EAA8E;AAC9E,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,kBAAkB,GAAG,IAAI,GACjC,IAAI,CAEN;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,QAAW,CAAC;AAClD,eAAO,MAAM,8BAA8B,QAAY,CAAC;AAQxD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAUrE;AAgGD,UAAU,mCAAmC;IAC3C;;;OAGG;IACH,aAAa,EAAE,kBAAkB,CAAC;CACnC;AAED;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,EAC3C,aAAa,GACd,EAAE,mCAAmC;;uBAGjB,kBAAkB;0BACb,MAAM,IAAI;;8BA/DJ,OAAO;sCAQC,OAAO;;;;;;;kCAajB,OAAO;qCAYJ,OAAO;;;EAiCvC;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;uBAGhB,kBAAkB;0BACb,MAAM,IAAI;;8BA9EF,OAAO;sCAQC,OAAO;;;;;;;kCAajB,OAAO;qCAYJ,OAAO;;;CAsDvC,CAAC"}
|