@buoy-gg/shared-ui 7.0.78 → 7.0.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/lib/commonjs/JsModal.js +1 -1
  2. package/lib/commonjs/bugCase/capture.js +1 -1
  3. package/lib/commonjs/bugCase/format.js +1 -1
  4. package/lib/commonjs/bugCase/index.js +1 -1
  5. package/lib/commonjs/bugCase/lock.js +1 -1
  6. package/lib/commonjs/bugCase/recorder.js +1 -1
  7. package/lib/commonjs/bugCase/scrub.js +1 -1
  8. package/lib/commonjs/bugCase/steps.js +1 -1
  9. package/lib/commonjs/bugCase/validate.js +1 -0
  10. package/lib/commonjs/dataViewer/LiveExplorer.js +1 -1
  11. package/lib/commonjs/dataViewer/VirtualizedDataExplorer.js +1 -1
  12. package/lib/commonjs/dataViewer/flattenTree.js +1 -0
  13. package/lib/commonjs/dataViewer/liveEntries.js +1 -0
  14. package/lib/commonjs/icons/index.js +1 -1
  15. package/lib/commonjs/index.js +1 -1
  16. package/lib/commonjs/license/BuoyUpgradeSheet.js +1 -1
  17. package/lib/commonjs/license/index.js +1 -1
  18. package/lib/commonjs/sync/keyedArrays.js +1 -1
  19. package/lib/commonjs/sync/valuePath.js +1 -1
  20. package/lib/commonjs/ui/components/DynamicFilterView.js +1 -1
  21. package/lib/commonjs/ui/components/EntityFilterView.js +1 -1
  22. package/lib/commonjs/ui/components/WindowControls.js +1 -1
  23. package/lib/commonjs/ui/floating/FloatingTool.js +1 -1
  24. package/lib/commonjs/ui/listPresets.js +1 -1
  25. package/lib/commonjs/utils/index.js +1 -1
  26. package/lib/commonjs/utils/loadOptionalModule.js +1 -1
  27. package/lib/commonjs/utils/loadToolModule.js +1 -1
  28. package/lib/commonjs/utils/minimalSuperJSON.js +1 -1
  29. package/lib/commonjs/utils/persistentStorage.js +1 -1
  30. package/lib/commonjs/utils/reloadPlatform.js +1 -1
  31. package/lib/commonjs/utils/snapshotProviderKit.js +1 -1
  32. package/lib/module/JsModal.js +1 -1
  33. package/lib/module/bugCase/capture.js +1 -1
  34. package/lib/module/bugCase/format.js +2 -2
  35. package/lib/module/bugCase/index.js +1 -1
  36. package/lib/module/bugCase/lock.js +1 -1
  37. package/lib/module/bugCase/recorder.js +1 -1
  38. package/lib/module/bugCase/scrub.js +1 -1
  39. package/lib/module/bugCase/steps.js +1 -1
  40. package/lib/module/bugCase/validate.js +1 -0
  41. package/lib/module/dataViewer/LiveExplorer.js +1 -1
  42. package/lib/module/dataViewer/VirtualizedDataExplorer.js +1 -1
  43. package/lib/module/dataViewer/flattenTree.js +1 -0
  44. package/lib/module/dataViewer/liveEntries.js +1 -0
  45. package/lib/module/icons/index.js +1 -1
  46. package/lib/module/index.js +1 -1
  47. package/lib/module/license/BuoyUpgradeSheet.js +1 -1
  48. package/lib/module/license/index.js +1 -1
  49. package/lib/module/sync/keyedArrays.js +1 -1
  50. package/lib/module/sync/valuePath.js +1 -1
  51. package/lib/module/ui/components/DynamicFilterView.js +1 -1
  52. package/lib/module/ui/components/EntityFilterView.js +1 -1
  53. package/lib/module/ui/components/WindowControls.js +1 -1
  54. package/lib/module/ui/floating/FloatingTool.js +1 -1
  55. package/lib/module/ui/listPresets.js +1 -1
  56. package/lib/module/utils/index.js +1 -1
  57. package/lib/module/utils/loadOptionalModule.js +1 -1
  58. package/lib/module/utils/loadToolModule.js +1 -1
  59. package/lib/module/utils/minimalSuperJSON.js +1 -1
  60. package/lib/module/utils/persistentStorage.js +1 -1
  61. package/lib/module/utils/reloadPlatform.js +1 -1
  62. package/lib/module/utils/snapshotProviderKit.js +1 -1
  63. package/lib/typescript/commonjs/JsModal.d.ts +3 -4
  64. package/lib/typescript/commonjs/JsModal.web.d.ts +2 -0
  65. package/lib/typescript/commonjs/bugCase/index.d.ts +1 -0
  66. package/lib/typescript/commonjs/bugCase/recorder.d.ts +1 -0
  67. package/lib/typescript/commonjs/bugCase/steps.d.ts +6 -0
  68. package/lib/typescript/commonjs/bugCase/validate.d.ts +14 -0
  69. package/lib/typescript/commonjs/dataViewer/flattenTree.d.ts +35 -0
  70. package/lib/typescript/commonjs/dataViewer/liveEntries.d.ts +19 -0
  71. package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
  72. package/lib/typescript/commonjs/icons/index.d.ts +1 -0
  73. package/lib/typescript/commonjs/index.d.ts +2 -2
  74. package/lib/typescript/commonjs/license/BuoyUpgradeSheet.d.ts +8 -0
  75. package/lib/typescript/commonjs/license/index.d.ts +1 -1
  76. package/lib/typescript/commonjs/sync/keyedArrays.d.ts +6 -1
  77. package/lib/typescript/commonjs/ui/floating/FloatingTool.d.ts +6 -1
  78. package/lib/typescript/commonjs/ui/listPresets.d.ts +2 -2
  79. package/lib/typescript/commonjs/utils/index.d.ts +1 -1
  80. package/lib/typescript/commonjs/utils/minimalSuperJSON.d.ts +4 -2
  81. package/lib/typescript/commonjs/utils/persistentStorage.d.ts +6 -0
  82. package/lib/typescript/module/JsModal.d.ts +3 -4
  83. package/lib/typescript/module/JsModal.web.d.ts +2 -0
  84. package/lib/typescript/module/bugCase/index.d.ts +1 -0
  85. package/lib/typescript/module/bugCase/recorder.d.ts +1 -0
  86. package/lib/typescript/module/bugCase/steps.d.ts +6 -0
  87. package/lib/typescript/module/bugCase/validate.d.ts +14 -0
  88. package/lib/typescript/module/dataViewer/flattenTree.d.ts +35 -0
  89. package/lib/typescript/module/dataViewer/liveEntries.d.ts +19 -0
  90. package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
  91. package/lib/typescript/module/icons/index.d.ts +1 -0
  92. package/lib/typescript/module/index.d.ts +2 -2
  93. package/lib/typescript/module/license/BuoyUpgradeSheet.d.ts +8 -0
  94. package/lib/typescript/module/license/index.d.ts +1 -1
  95. package/lib/typescript/module/sync/keyedArrays.d.ts +6 -1
  96. package/lib/typescript/module/ui/floating/FloatingTool.d.ts +6 -1
  97. package/lib/typescript/module/ui/listPresets.d.ts +2 -2
  98. package/lib/typescript/module/utils/index.d.ts +1 -1
  99. package/lib/typescript/module/utils/minimalSuperJSON.d.ts +4 -2
  100. package/lib/typescript/module/utils/persistentStorage.d.ts +6 -0
  101. package/lib/web/chunks/chunk-36A4T5PL.mjs +1 -0
  102. package/lib/web/chunks/{chunk-XUYN4NOF.mjs → chunk-5UII72AQ.mjs} +1 -1
  103. package/lib/web/chunks/chunk-A3N3WVKC.mjs +1 -0
  104. package/lib/web/chunks/chunk-AVRGPBZK.mjs +6 -0
  105. package/lib/web/chunks/{chunk-GTRVOJUH.mjs → chunk-JTNYUDJZ.mjs} +1 -1
  106. package/lib/web/chunks/{chunk-BMITMQVB.mjs → chunk-LADTE6U4.mjs} +3 -3
  107. package/lib/web/chunks/chunk-N5Z7Z2GY.mjs +1 -0
  108. package/lib/web/chunks/chunk-SAWSKX4E.mjs +6 -0
  109. package/lib/web/chunks/{chunk-OVTASJUJ.mjs → chunk-SUG6TLF5.mjs} +1 -1
  110. package/lib/web/chunks/{chunk-OQB3GW44.mjs → chunk-UVVRCZX5.mjs} +1 -1
  111. package/lib/web/chunks/chunk-Y7FM4WZ7.mjs +6 -0
  112. package/lib/web/chunks/chunk-ZRZQZF2T.mjs +15 -0
  113. package/lib/web/chunks/persistentStorage.web-IBLIV62L.mjs +1 -0
  114. package/lib/web/dataViewer.mjs +2 -2
  115. package/lib/web/history.mjs +1 -1
  116. package/lib/web/index.mjs +6 -6
  117. package/lib/web/ui.mjs +1 -1
  118. package/lib/web/utils.mjs +1 -1
  119. package/package.json +5 -5
  120. package/lib/web/chunks/chunk-DJD42EPL.mjs +0 -1
  121. package/lib/web/chunks/chunk-GN75GBYZ.mjs +0 -1
  122. package/lib/web/chunks/chunk-HE5ONCAL.mjs +0 -6
@@ -1 +1 @@
1
- "use strict";const g=2e3;function $(e){return(e.text||e.label||e.testID||e.name||"something").trim()}export function safeTouch(e){const s=e.kind==="text"||e.target.control==="text";if(!s)return e;const r=typeof e.value==="string"?e.value.length:0;const{value:u,...i}=e.target;return{...e,target:i,value:r}}function x(e){const s=`"${$(e.target)}"`;switch(e.kind){case"longPress":return`Long-pressed ${s}`;case"text":{const r=typeof e.value==="number"?e.value:0;return r===0?`Cleared ${s}`:`Typed ${r} character${r===1?"":"s"} into ${s}`}case"toggle":return`Turned ${e.value?"on":"off"} ${s}`;case"slider":return`Set ${s} to ${String(e.value)}`;default:return`Tapped ${s}`}}export function bugCaseSteps(e,s=[]){const r=e.map((t,o)=>({touch:safeTouch(t),i:o})).sort((t,o)=>(t.touch.seq??t.i)-(o.touch.seq??o.i));const u=[...s].sort((t,o)=>t.t-o.t);const i=[];let a=0;for(const{touch:t}of r){while(a<u.length&&u[a].t<=t.t)i.push({t:u[a].t,route:u[a++]});i.push({t:t.t,touch:t})}while(a<u.length)i.push({t:u[a].t,route:u[a++]});const c=[];let n=null;let d=null;const p=()=>{if(n&&n.count>1){const t=n.last-n.first;n.step.text=n.count===2?`${n.base} 2 times (${t} ms apart)`:`${n.base} ${n.count} times in ${(t/1e3).toFixed(1)} s`}n=null};for(const t of i){if("route"in t&&t.route){if(t.route.pathname===d)continue;d=t.route.pathname;p();c.push({t:t.t,text:`Went to ${t.route.pathname}`});continue}if(!("touch"in t)||!t.touch)continue;const o=x(t.touch);const f=t.touch.kind==="press"||t.touch.kind==="longPress";if(n&&f&&n.base===o&&t.t-n.last<g){n.count++;n.last=t.t;continue}const l=c[c.length-1];if(!f&&l&&t.touch.kind==="text"&&l.text.endsWith(`"${$(t.touch.target)}"`)&&/^(Typed|Cleared) /.test(l.text)){l.text=o;l.t=t.t;continue}p();const h={t:t.t,text:o};c.push(h);if(f)n={step:h,base:o,count:1,first:t.t,last:t.t}}p();return c}export function formatBugCaseSteps(e){return e.map((s,r)=>`${r+1}. ${s.text}`).join("\n")}
1
+ "use strict";const g=2e3;export function isDevChromeTouch(e){return/^LogBox/.test(e.target?.name??"")}function $(e){return(e.text||e.label||e.testID||e.name||"something").trim()}export function safeTouch(e){const s=e.kind==="text"||e.target.control==="text";if(!s)return e;const r=typeof e.value==="string"?e.value.length:typeof e.value==="number"&&Number.isFinite(e.value)&&e.value>=0?Math.floor(e.value):0;const{value:u,...i}=e.target;return{...e,target:i,value:r}}function m(e){const s=`"${$(e.target)}"`;switch(e.kind){case"longPress":return`Long-pressed ${s}`;case"text":{const r=typeof e.value==="number"?e.value:0;return r===0?`Cleared ${s}`:`Typed ${r} character${r===1?"":"s"} into ${s}`}case"toggle":return`Turned ${e.value?"on":"off"} ${s}`;case"slider":return`Set ${s} to ${String(e.value)}`;default:return`Tapped ${s}`}}export function bugCaseSteps(e,s=[]){const r=e.filter(t=>!isDevChromeTouch(t)).map((t,o)=>({touch:safeTouch(t),i:o})).sort((t,o)=>(t.touch.seq??t.i)-(o.touch.seq??o.i));const u=[...s].sort((t,o)=>t.t-o.t);const i=[];let a=0;for(const{touch:t}of r){while(a<u.length&&u[a].t<=t.t)i.push({t:u[a].t,route:u[a++]});i.push({t:t.t,touch:t})}while(a<u.length)i.push({t:u[a].t,route:u[a++]});const l=[];let n=null;let d=null;const f=()=>{if(n&&n.count>1){const t=n.last-n.first;n.step.text=n.count===2?`${n.base} 2 times (${t} ms apart)`:`${n.base} ${n.count} times in ${(t/1e3).toFixed(1)} s`}n=null};for(const t of i){if("route"in t&&t.route){if(t.route.pathname===d)continue;d=t.route.pathname;f();l.push({t:t.t,text:`Went to ${t.route.pathname}`});continue}if(!("touch"in t)||!t.touch)continue;const o=m(t.touch);const p=t.touch.kind==="press"||t.touch.kind==="longPress";if(n&&p&&n.base===o&&t.t-n.last<g){n.count++;n.last=t.t;continue}const c=l[l.length-1];if(!p&&c&&t.touch.kind==="text"&&c.text.endsWith(`"${$(t.touch.target)}"`)&&/^(Typed|Cleared) /.test(c.text)){c.text=o;c.t=t.t;continue}f();const h={t:t.t,text:o};l.push(h);if(p)n={step:h,base:o,count:1,first:t.t,last:t.t}}f();return l}export function formatBugCaseSteps(e){return e.map((s,r)=>`${r+1}. ${s.text}`).join("\n")}
@@ -0,0 +1 @@
1
+ "use strict";import{BUG_CASE_VERSION as y}from"./types.js";const h=2e4;const j=new Set(["press","longPress","text","toggle","slider"]);const b=5e3;const n=t=>!!t&&typeof t==="object"&&!Array.isArray(t);const s=(t,r=h)=>typeof t==="string"?t.slice(0,r):void 0;const o=t=>typeof t==="number"&&Number.isFinite(t)?t:void 0;const a=(t,r)=>Array.isArray(t)?t.slice(0,b).map(r).filter(l=>l!==null):[];const v=t=>{if(!n(t))return void 0;const r={};for(const[l,i]of Object.entries(t).slice(0,200))if(typeof i==="string")r[l.slice(0,200)]=i.slice(0,8e3);return r};export class BugCaseShapeError extends Error{constructor(r){super(`This case's ${r} is broken, so it can't be shown or loaded.`);this.name="BugCaseShapeError"}}export function validateBugCase(t){if(!n(t)||t.v!==y)throw new BugCaseShapeError("version");const r=s(t.createdAt,40);if(!r)throw new BugCaseShapeError("date");if(!n(t.app))throw new BugCaseShapeError("app facts");const l=t.app;const i=n(l.window)?l.window:null;const k=n(t.route)&&typeof t.route.pathname==="string"?{pathname:t.route.pathname.slice(0,2e3),href:s(t.route.href,2e3)??t.route.pathname.slice(0,2e3)}:null;const x=n(t.clock)?{active:t.clock.active===true,virtualIso:s(t.clock.virtualIso,40),offsetMs:o(t.clock.offsetMs),rate:o(t.clock.rate)}:null;const u=n(t.state)?t.state:{json:{}};const d=n(u.meta)&&n(u.meta.values)?Object.fromEntries(Object.entries(u.meta.values).slice(0,b).filter(([e])=>e!=="__proto__").filter(([,e])=>typeof e==="string"||Array.isArray(e)&&e.length<=4&&e.every(p=>typeof p==="string"||typeof p==="number"))):null;const m=d&&Object.keys(d).length?{values:d}:void 0;const c=n(t.scrub)?t.scrub:{};return{v:y,createdAt:r,note:s(t.note),app:{platform:s(l.platform,20)??"",os:s(l.os,40)??"",appearance:s(l.appearance,20),locale:s(l.locale,40),timeZone:s(l.timeZone,60),window:i&&o(i.width)!==void 0&&o(i.height)!==void 0?{width:o(i.width),height:o(i.height),scale:o(i.scale),fontScale:o(i.fontScale)}:void 0},route:k,clock:x,overrides:a(t.overrides,e=>s(e,500)??null),state:{json:n(u.json)||Array.isArray(u.json)?u.json:{},...m?{meta:m}:{}},steps:a(t.steps,e=>n(e)&&typeof e.text==="string"?{...o(e.t)!==void 0?{t:o(e.t)}:{},text:e.text.slice(0,500)}:null),touches:a(t.touches,e=>{if(!n(e)||!n(e.target)||typeof e.target.name!=="string")return null;const p=j.has(e.kind)?e.kind:"press";const g=f=>typeof f==="number"||typeof f==="boolean"?f:void 0;return{seq:o(e.seq),t:o(e.t)??0,kind:p,target:{name:e.target.name.slice(0,200),testID:s(e.target.testID,200),label:s(e.target.label,500),text:s(e.target.text,2e3),control:s(e.target.control,40),value:g(e.target.value)},value:g(e.value)}}),screen:a(t.screen,e=>n(e)&&typeof e.name==="string"?{name:e.name.slice(0,200),role:s(e.role,60),testID:s(e.testID,200),label:s(e.label,500),text:s(e.text,2e3),control:s(e.control,40),value:typeof e.value==="number"||typeof e.value==="boolean"?e.value:void 0}:null),network:a(t.network,e=>n(e)&&typeof e.method==="string"&&typeof e.url==="string"?{t:o(e.t)??0,method:e.method.slice(0,16),url:e.url.slice(0,8e3),status:o(e.status),durationMs:o(e.durationMs),error:s(e.error,2e3),requestHeaders:v(e.requestHeaders),responseHeaders:v(e.responseHeaders),requestData:e.requestData,responseData:e.responseData,bodyOmitted:e.bodyOmitted===true?true:void 0}:null),console:a(t.console,e=>n(e)&&typeof e.text==="string"?{t:o(e.t)??0,level:s(e.level,20)??"log",text:e.text.slice(0,h)}:null),missing:a(t.missing,e=>n(e)&&typeof e.part==="string"?{part:e.part.slice(0,200),reason:s(e.reason,2e3)??""}:null),scrub:{removed:o(c.removed)??0,byKind:n(c.byKind)?Object.fromEntries(Object.entries(c.byKind).filter(([,e])=>typeof e==="number")):{},items:a(c.items,e=>n(e)&&typeof e.path==="string"?{path:e.path.slice(0,500),kind:s(e.kind,20),rule:s(e.rule,20)}:null)}}}
@@ -1 +1 @@
1
- "use strict";import{useState as z,useMemo as P,useCallback as S,useRef as T,useEffect as J,memo as j}from"react";import{Text as y,TouchableOpacity as I,View as u,StyleSheet as ce}from"react-native";import{displayValue as de}from"../utils/displayValue.js";import{night as e}from"../ui/night/nightTheme.js";import{CopyButton as se}from"../ui/components/CopyButton.js";import{ChevronRight as ge,ChevronDown as ue,Trash as ee}from"../icons/index.js";import{CyberpunkInput as he}from"./CyberpunkInput.js";import{updateNestedDataByPath as pe,deleteNestedDataByPath as fe}from"./nestedPath.js";import{monoFont as b}from"../ui/fonts.js";import{jsx as l,jsxs as h,Fragment as $}from"react/jsx-runtime";const O=100;const W={top:8,bottom:8,left:8,right:8};const te=12;const be=["DATA","STATE","VALUE","QUERY","QUERYKEY","TYPES","STATS","OPTIONS","OBSERVERS"];const me=r=>r.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");function ye(r){return r.length===0?"buoy-live-explorer-root":`buoy-live-explorer-${r.map(me).filter(Boolean).join("-")}`}const xe=(r,n=O)=>{if(n<1||r.length===0)return[];const t=[];for(let i=0;i<r.length;i+=n){t.push(r.slice(i,i+n))}return t};const U=j(({expanded:r,isFocused:n=false,isMain:t=false})=>{return l(u,{style:[o.expanderIcon,t&&o.expanderIconMain,r?o.expanded:o.collapsed],children:r?l(ue,{size:t?14:te,color:n?e.color.accent:t?e.color.text:e.color.textSecondary,strokeWidth:2.5}):l(ge,{size:t?14:te,color:n?e.color.accent:t?e.color.text:e.color.textSecondary,strokeWidth:2.5})})});U.displayName="Expander";const oe=j(({value:r,isFocused:n=false})=>{return l(se,{value:r,isFocused:n,buttonStyle:n?{...o.buttonStyle,...o.buttonStyleFocused}:o.buttonStyle})});oe.displayName="CopyButton";const Y=j(({dataPath:r,writer:n,testID:t,isFocused:i=false})=>{const s=S(()=>{n?.remove?.(r)},[n,r]);if(!n?.remove)return null;return l(I,{"sentry-label":"ignore devtools explorer delete button",testID:`${t}-delete`,accessibilityRole:"button",onPress:s,style:[o.deleteButton,i&&o.deleteButtonFocused],accessibilityLabel:"Delete item",hitSlop:W,activeOpacity:.7,children:l(ee,{size:14,strokeWidth:2,color:i?e.color.danger:e.color.danger+"CC"})})});Y.displayName="DeleteItemButton";const re=j(({dataPath:r,writer:n,testID:t,isFocused:i=false})=>{const s=S(()=>{n?.update(r,[])},[n,r]);if(!n)return null;return l(I,{"sentry-label":"ignore devtools explorer clear button",testID:`${t}-clear`,style:[o.clearButton,i&&o.clearButtonFocused],accessibilityRole:"button",accessibilityLabel:"Remove all items","aria-label":"Remove all items",onPress:s,hitSlop:W,activeOpacity:.7,children:l(y,{style:[o.clearButtonText,{color:i?e.color.warning:e.color.warning+"CC"}],children:"[]"})})});re.displayName="ClearArrayButton";function Ce({dataPath:r,writer:n,testID:t,value:i,removable:s}){const H=S(()=>{if(!n)return;const R=typeof i==="boolean"?i:false;n.update(r,!R)},[n,r,i]);const M=S(()=>{n?.remove?.(r)},[n,r]);if(!n)return null;const D=i?o.toggleBadgeTrue:o.toggleBadgeFalse;const B=i?o.toggleTextTrue:o.toggleTextFalse;return h(u,{style:o.toggleRow,children:[l(I,{"sentry-label":"ignore devtools explorer toggle button",testID:`${t}-toggle`,accessibilityRole:"button",accessibilityLabel:`${r[r.length-1]??"value"}, ${i?"true":"false"}`,style:o.modernToggleButton,onPress:H,hitSlop:W,activeOpacity:.8,children:l(u,{style:[o.toggleBadge,D],children:l(y,{style:[o.toggleBadgeText,B],children:i?"TRUE":"FALSE"})})}),s&&n.remove?l(I,{"sentry-label":"ignore devtools explorer delete button in toggle",testID:`${t}-delete`,accessibilityRole:"button",onPress:M,style:o.deleteButtonInToggle,accessibilityLabel:"Delete item",hitSlop:W,activeOpacity:.7,children:l(ee,{size:14,strokeWidth:2,color:e.color.danger+"CC"})}):null]})}export function LiveExplorer({editable:r,label:n,value:t,defaultExpanded:i,writer:s,dataPath:H,itemsDeletable:M,dataVersion:D=0,testIDForPath:B=ye,debounceMs:R=0}){const[w,Z]=z(false);const[G,A]=z("");J(()=>{if(t!==null&&t!==void 0&&(typeof t==="string"||typeof t==="number")){const c=t.toString();A(c)}},[t,n,D]);const k=P(()=>{return be.includes(n.toUpperCase())},[n]);const[_,ne]=z((i||[]).includes(n));const le=()=>ne(c=>!c);const[K,ae]=z([]);const x=P(()=>{if(t===null||t===void 0||typeof t!=="object"){return[]}if(Array.isArray(t)){const a=t.length>1e3?t.slice(0,1e3):t;return a.map((d,f)=>({label:f.toString(),value:d}))}if(t instanceof Map){const a=Array.from(t.entries()).slice(0,1e3);return a.map(([d,f])=>({label:d.toString(),value:f}))}if(t instanceof Set){const a=Array.from(t).slice(0,1e3);return a.map((d,f)=>({label:f.toString(),value:d}))}const c=Object.entries(t).slice(0,1e3);return c.map(([a,d])=>({label:a,value:d}))},[t]);const g=P(()=>{if(Array.isArray(t))return"array";if(t===null||typeof t!=="object")return typeof t;if(t instanceof Map||t instanceof Set)return"Iterable";return"object"},[t]);const E=P(()=>{return xe(x,O)},[x]);const p=H??[];const C=B(p);const v=r===true&&M===true&&s?.remove!=null&&(s.canRemove?.(p)??true);const L=T(s);const N=T(p);const Q=T(g);L.current=s;N.current=p;Q.current=g;const V=T(null);const m=T(null);const F=S(()=>{if(m.current){clearTimeout(m.current);m.current=null}const c=V.current;V.current=null;if(c)L.current?.update(c.path,c.value)},[]);J(()=>()=>F(),[F]);const X=T(R);X.current=R;const ie=S((c,a)=>{A(a);if(!L.current)return;if(c&&isNaN(Number(a)))return;const d=Q.current==="number"?Number(a):a;const f=X.current;if(f>0){V.current={path:N.current,value:d};if(m.current)clearTimeout(m.current);m.current=setTimeout(F,f)}else{L.current.update(N.current,d)}},[F,A]);const q=S(c=>{const a=Number(G)||0;const d=a+c;A(String(d));V.current=null;if(m.current){clearTimeout(m.current);m.current=null}L.current?.update(N.current,d)},[G]);return l(u,{style:o.minWidthWrapper,children:h(u,{style:o.fullWidthMarginRight,children:[E.length>0&&h($,{children:[h(u,{style:[o.flexRowItemsCenterGap,k&&o.flexRowItemsCenterGapMain],children:[h(I,{"sentry-label":"ignore devtools explorer expander button",style:o.expanderButton,testID:C,accessibilityRole:"button",accessibilityLabel:`${n}, ${x.length} ${x.length===1?"item":"items"}`,accessibilityState:{expanded:_},onPress:le,hitSlop:W,activeOpacity:.6,children:[l(U,{expanded:_,isFocused:w,isMain:k}),l(y,{style:[o.labelText,w&&o.labelTextFocused,k&&o.labelTextMain],children:n}),l(y,{style:o.textGray500,children:`${String(g).toLowerCase()==="iterable"?"(Iterable) ":""}${x.length} ${x.length>1?`items`:`item`}`})]}),r&&h(u,{style:o.flexRowGapItemsCenter,children:[l(oe,{value:t,isFocused:w}),v&&l(Y,{writer:s,dataPath:p,testID:C,isFocused:w}),g==="array"&&s!==void 0&&l(re,{writer:s,dataPath:p,testID:C,isFocused:w})]})]}),_&&h($,{children:[E.length===1&&l(u,{style:[o.singleEntryContainer,k&&o.singleEntryContainerMain],children:x.map((c,a)=>l(LiveExplorer,{defaultExpanded:i,label:c.label,value:c.value,editable:r,dataPath:[...p,c.label],writer:s,itemsDeletable:g==="array"||g==="Iterable"||g==="object",dataVersion:D,testIDForPath:B,debounceMs:R},c.label+a))}),E.length>1&&l(u,{style:o.multiEntryContainer,children:E.map((c,a)=>l(u,{children:h(u,{style:o.relativeOutlineNone,children:[h(I,{"sentry-label":"ignore devtools explorer page toggle",onPress:()=>ae(d=>d.includes(a)?d.filter(f=>f!==a):[...d,a]),style:o.pageExpanderButton,hitSlop:W,children:[l(U,{expanded:K.includes(a)}),h(y,{style:o.pageRangeText,children:["[",a*O,"...",a*O+O-1,"]"]})]}),K.includes(a)&&l(u,{style:o.entriesContainer,children:c.map(d=>l(LiveExplorer,{defaultExpanded:i,label:d.label,value:d.value,editable:r,dataPath:[...p,d.label],writer:s,dataVersion:D,testIDForPath:B,debounceMs:R},d.label))})]})},a))})]})]}),E.length===0&&h(u,{style:o.flexRowGapFullWidth,children:[r&&s!==void 0&&(g==="string"||g==="number"||g==="boolean")?h($,{children:[r&&s&&(g==="string"||g==="number")&&l(u,{style:o.nebulaInputWrapper,children:l(he,{label:n,testID:`${C}-input`,accessibilityLabel:`${n}, editable value`,style:[g==="number"?o.textNumber:o.textString],keyboardType:g==="number"?"numeric":"default",value:G,onChangeText:c=>ie(g==="number",c),onFocus:()=>Z(true),onBlur:()=>{F();Z(false)},showNumberControls:g==="number",onIncrement:()=>q(1),onDecrement:()=>q(-1),showDeleteButton:v,onDelete:()=>{s?.remove?.(p)}})}),g==="boolean"&&h(u,{style:o.booleanRowContainer,children:[l(y,{style:o.booleanLabel,children:n}),l(u,{style:o.booleanToggleWrapper,children:l(Ce,{writer:s,dataPath:p,testID:C,value:t,removable:v})})]})]}):h($,{children:[l(y,{style:o.text344054,children:n}),l(y,{testID:`${C}-value`,style:o.displayValueText,children:de(t)})]}),r&&v&&g!=="string"&&g!=="number"&&g!=="boolean"&&l(Y,{writer:s,dataPath:p,testID:C,isFocused:w})]})]})})}export function makeRootWriter(r){return{update:(n,t)=>{r.setRoot(pe(r.getRoot(),n,t))},remove:n=>{r.setRoot(fe(r.getRoot(),n))},canRemove:r.canRemove}}const o=ce.create({buttonStyle:{backgroundColor:e.color.surface+"E6",borderWidth:1,borderColor:e.color.textSecondary+"33",borderRadius:6,flexDirection:"row",alignItems:"center",justifyContent:"center",width:28,height:28,position:"relative",shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2},buttonStyleFocused:{borderColor:e.color.accent+"CC",backgroundColor:e.color.accent+"26",shadowColor:e.color.accent,shadowOpacity:.3,shadowRadius:4},deleteButton:{backgroundColor:e.color.danger+"1A",borderColor:e.color.danger+"4D",borderWidth:1,borderRadius:6,padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,position:"relative",shadowColor:e.color.danger,shadowOffset:{width:0,height:0},shadowOpacity:.15,shadowRadius:3},deleteButtonFocused:{borderColor:e.color.danger+"CC",backgroundColor:e.color.danger+"33",shadowOpacity:.3,shadowRadius:5},deleteButtonInToggle:{backgroundColor:e.color.danger+"1A",borderColor:e.color.danger+"4D",borderWidth:1,borderRadius:6,padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,shadowColor:e.color.danger,shadowOffset:{width:0,height:0},shadowOpacity:.15,shadowRadius:3},clearButton:{backgroundColor:e.color.warning+"1A",borderWidth:1,borderColor:e.color.warning+"4D",borderRadius:6,flexDirection:"row",padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,position:"relative",zIndex:10,shadowColor:e.color.warning,shadowOffset:{width:0,height:0},shadowOpacity:.15,shadowRadius:3},clearButtonFocused:{borderColor:e.color.warning+"CC",backgroundColor:e.color.warning+"33",shadowOpacity:.3,shadowRadius:5},clearButtonText:{fontSize:12,fontWeight:"700",fontFamily:b},expanderIcon:{width:18,height:18,alignItems:"center",justifyContent:"center",marginRight:1,backgroundColor:e.color.textSecondary+"14",borderRadius:3},expanderIconMain:{backgroundColor:e.color.textSecondary+"1A",width:20,height:20,borderRadius:4,borderWidth:.5,borderColor:e.color.textSecondary+"33"},expanded:{transform:[{rotate:"0deg"}]},collapsed:{transform:[{rotate:"0deg"}]},minWidthWrapper:{minWidth:180,fontSize:11,flexDirection:"row",flexWrap:"wrap",width:"100%",marginVertical:.5},fullWidthMarginRight:{position:"relative",width:"100%",marginRight:1},flexRowItemsCenterGap:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:3,paddingHorizontal:6,marginVertical:1,borderRadius:4,backgroundColor:e.color.surface+"66",borderWidth:.5,borderColor:e.color.textSecondary+"1A"},flexRowItemsCenterGapMain:{backgroundColor:e.color.surface+"E6",borderLeftWidth:2.5,borderLeftColor:e.color.textSecondary+"80",borderColor:e.color.textSecondary+"26",paddingVertical:5,paddingHorizontal:8,marginBottom:3,borderWidth:1,shadowColor:"#000",shadowOffset:{width:0,height:0},shadowOpacity:.08,shadowRadius:3},expanderButton:{flexDirection:"row",alignItems:"center",backgroundColor:"transparent",paddingVertical:1,paddingHorizontal:2,gap:6,borderWidth:0,minHeight:24,flex:1},labelText:{color:e.color.textSecondary,fontSize:10,fontWeight:"600",marginRight:4,fontFamily:b,letterSpacing:.4},labelTextFocused:{color:e.color.text},labelTextMain:{color:e.color.text,fontSize:11,fontWeight:"700",letterSpacing:.6},textGray500:{color:e.color.textTertiary,fontSize:10,fontWeight:"400",fontFamily:b,opacity:.7},pageRangeText:{color:e.color.textSecondary,fontSize:10,fontWeight:"600",fontFamily:b},flexRowGapItemsCenter:{flexDirection:"row",alignItems:"center",gap:4,paddingLeft:2},singleEntryContainer:{marginLeft:2,marginTop:2,paddingLeft:8,borderLeftWidth:1.5,borderLeftColor:e.color.textSecondary+"40"},singleEntryContainerMain:{borderLeftColor:e.color.textSecondary+"4D",marginLeft:4,paddingLeft:10},multiEntryContainer:{marginLeft:2,marginTop:2,paddingLeft:8,borderLeftWidth:1.5,borderLeftColor:e.color.textSecondary+"40"},relativeOutlineNone:{position:"relative"},pageExpanderButton:{flexDirection:"row",alignItems:"center",backgroundColor:e.color.surface+"66",paddingVertical:3,paddingHorizontal:6,gap:6,borderRadius:4,borderWidth:.5,borderColor:e.color.textSecondary+"1A",marginBottom:2,minHeight:24},entriesContainer:{marginLeft:2,paddingLeft:8,marginTop:2,borderLeftWidth:1.5,borderLeftColor:e.color.textSecondary+"40"},textNumber:{color:e.color.text,fontWeight:"600",fontFamily:b},textString:{color:e.color.text,fontFamily:b},flexRowGapFullWidth:{flexDirection:"row",width:"100%",alignItems:"center",marginVertical:1,gap:6,paddingHorizontal:4,paddingVertical:2,borderRadius:3},text344054:{color:e.color.textSecondary,fontWeight:"600",fontSize:9,minWidth:50,fontFamily:b,letterSpacing:.4,opacity:.8},nebulaInputWrapper:{flex:1,width:"100%",position:"relative"},displayValueText:{flex:1,color:e.color.text,fontWeight:"400",fontFamily:b,fontSize:12,paddingVertical:6,paddingHorizontal:10,borderRadius:6,borderWidth:1,borderColor:e.color.textTertiary+"66",minHeight:34},toggleRow:{flexDirection:"row",alignItems:"center",gap:6},modernToggleButton:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:6,borderWidth:1,borderColor:e.color.textTertiary+"99",paddingHorizontal:8,paddingVertical:6,marginVertical:2,minHeight:34,gap:8},toggleBadge:{marginLeft:6,paddingHorizontal:6,paddingVertical:3,borderRadius:4,borderWidth:1},toggleBadgeText:{fontSize:9,fontWeight:"700",textTransform:"uppercase",letterSpacing:.8,fontFamily:b},toggleBadgeTrue:{backgroundColor:e.color.accent+"1A",borderColor:e.color.accent+"4D"},toggleBadgeFalse:{backgroundColor:e.color.textTertiary+"1A",borderColor:e.color.textTertiary+"4D"},toggleTextTrue:{color:e.color.accent,fontWeight:"600"},toggleTextFalse:{color:e.color.textSecondary,fontWeight:"500"},booleanRowContainer:{flexDirection:"row",alignItems:"center",width:"100%",gap:8,paddingVertical:2},booleanLabel:{color:e.color.textSecondary,fontSize:10,fontWeight:"600",fontFamily:b,letterSpacing:.4,minWidth:60,flexShrink:0},booleanToggleWrapper:{flex:1}});
1
+ "use strict";import{useState as V,useMemo as z,useCallback as C,useRef as w,useEffect as J,memo as P}from"react";import{Text as y,TouchableOpacity as T,View as g,StyleSheet as ce}from"react-native";import{displayValue as de}from"../utils/displayValue.js";import{night as e}from"../ui/night/nightTheme.js";import{CopyButton as se}from"../ui/components/CopyButton.js";import{ChevronRight as ge,ChevronDown as ue,Trash as ee}from"../icons/index.js";import{CyberpunkInput as he}from"./CyberpunkInput.js";import{updateNestedDataByPath as pe,deleteNestedDataByPath as fe}from"./nestedPath.js";import{monoFont as f}from"../ui/fonts.js";import{getLiveSubEntries as be,livePageRange as me,LIVE_PAGE_SIZE as ye}from"./liveEntries.js";import{jsx as l,jsxs as h,Fragment as $}from"react/jsx-runtime";const _=ye;const I={top:8,bottom:8,left:8,right:8};const te=12;const xe=["DATA","STATE","VALUE","QUERY","QUERYKEY","TYPES","STATS","OPTIONS","OBSERVERS"];const Ce=o=>o.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");function Se(o){return o.length===0?"buoy-live-explorer-root":`buoy-live-explorer-${o.map(Ce).filter(Boolean).join("-")}`}const Re=(o,r=_)=>{if(r<1||o.length===0)return[];const n=[];for(let a=0;a<o.length;a+=r){n.push(o.slice(a,a+r))}return n};const U=P(({expanded:o,isFocused:r=false,isMain:n=false})=>{return l(g,{style:[t.expanderIcon,n&&t.expanderIconMain,o?t.expanded:t.collapsed],children:o?l(ue,{size:n?14:te,color:r?e.color.accent:n?e.color.text:e.color.textSecondary,strokeWidth:2.5}):l(ge,{size:n?14:te,color:r?e.color.accent:n?e.color.text:e.color.textSecondary,strokeWidth:2.5})})});U.displayName="Expander";const oe=P(({value:o,isFocused:r=false})=>{return l(se,{value:o,isFocused:r,buttonStyle:r?{...t.buttonStyle,...t.buttonStyleFocused}:t.buttonStyle})});oe.displayName="CopyButton";const Y=P(({dataPath:o,writer:r,testID:n,isFocused:a=false})=>{const i=C(()=>{r?.remove?.(o)},[r,o]);if(!r?.remove)return null;return l(T,{"sentry-label":"ignore devtools explorer delete button",testID:`${n}-delete`,accessibilityRole:"button",onPress:i,style:[t.deleteButton,a&&t.deleteButtonFocused],accessibilityLabel:"Delete item",hitSlop:I,activeOpacity:.7,children:l(ee,{size:14,strokeWidth:2,color:a?e.color.danger:e.color.danger+"CC"})})});Y.displayName="DeleteItemButton";const re=P(({dataPath:o,writer:r,testID:n,isFocused:a=false})=>{const i=C(()=>{r?.update(o,[])},[r,o]);if(!r)return null;return l(T,{"sentry-label":"ignore devtools explorer clear button",testID:`${n}-clear`,style:[t.clearButton,a&&t.clearButtonFocused],accessibilityRole:"button",accessibilityLabel:"Remove all items","aria-label":"Remove all items",onPress:i,hitSlop:I,activeOpacity:.7,children:l(y,{style:[t.clearButtonText,{color:a?e.color.warning:e.color.warning+"CC"}],children:"[]"})})});re.displayName="ClearArrayButton";function we({dataPath:o,writer:r,testID:n,value:a,removable:i}){const j=C(()=>{if(!r)return;const S=typeof a==="boolean"?a:false;r.update(o,!S)},[r,o,a]);const H=C(()=>{r?.remove?.(o)},[r,o]);if(!r)return null;const W=a?t.toggleBadgeTrue:t.toggleBadgeFalse;const D=a?t.toggleTextTrue:t.toggleTextFalse;return h(g,{style:t.toggleRow,children:[l(T,{"sentry-label":"ignore devtools explorer toggle button",testID:`${n}-toggle`,accessibilityRole:"button",accessibilityLabel:`${o[o.length-1]??"value"}, ${a?"true":"false"}`,style:t.modernToggleButton,onPress:j,hitSlop:I,activeOpacity:.8,children:l(g,{style:[t.toggleBadge,W],children:l(y,{style:[t.toggleBadgeText,D],children:a?"TRUE":"FALSE"})})}),i&&r.remove?l(T,{"sentry-label":"ignore devtools explorer delete button in toggle",testID:`${n}-delete`,accessibilityRole:"button",onPress:H,style:t.deleteButtonInToggle,accessibilityLabel:"Delete item",hitSlop:I,activeOpacity:.7,children:l(ee,{size:14,strokeWidth:2,color:e.color.danger+"CC"})}):null]})}export function LiveExplorer({editable:o,label:r,value:n,defaultExpanded:a,writer:i,dataPath:j,itemsDeletable:H,dataVersion:W=0,testIDForPath:D=Se,debounceMs:S=0}){const[R,Z]=V(false);const[M,F]=V("");J(()=>{if(n!==null&&n!==void 0&&(typeof n==="string"||typeof n==="number")){const d=n.toString();F(d)}},[n,r,W]);const v=z(()=>{return xe.includes(r.toUpperCase())},[r]);const[G,ne]=V((a||[]).includes(r));const le=()=>ne(d=>!d);const[K,ae]=V([]);const m=z(()=>be(n),[n]);const c=z(()=>{if(Array.isArray(n))return"array";if(n===null||typeof n!=="object")return typeof n;if(n instanceof Map||n instanceof Set)return"Iterable";return"object"},[n]);const B=z(()=>{return Re(m,_)},[m]);const p=j??[];const x=D(p);const O=o===true&&H===true&&i?.remove!=null&&(i.canRemove?.(p)??true);const E=w(i);const k=w(p);const Q=w(c);E.current=i;k.current=p;Q.current=c;const A=w(null);const b=w(null);const L=C(()=>{if(b.current){clearTimeout(b.current);b.current=null}const d=A.current;A.current=null;if(d)E.current?.update(d.path,d.value)},[]);J(()=>()=>L(),[L]);const X=w(S);X.current=S;const ie=C((d,s)=>{F(s);if(!E.current)return;if(d&&isNaN(Number(s)))return;const u=Q.current==="number"?Number(s):s;const N=X.current;if(N>0){A.current={path:k.current,value:u};if(b.current)clearTimeout(b.current);b.current=setTimeout(L,N)}else{E.current.update(k.current,u)}},[L,F]);const q=C(d=>{const s=Number(M)||0;const u=s+d;F(String(u));A.current=null;if(b.current){clearTimeout(b.current);b.current=null}E.current?.update(k.current,u)},[M]);return l(g,{style:t.minWidthWrapper,children:h(g,{style:t.fullWidthMarginRight,children:[B.length>0&&h($,{children:[h(g,{style:[t.flexRowItemsCenterGap,v&&t.flexRowItemsCenterGapMain],children:[h(T,{"sentry-label":"ignore devtools explorer expander button",style:t.expanderButton,testID:x,accessibilityRole:"button",accessibilityLabel:`${r}, ${m.length} ${m.length===1?"item":"items"}`,accessibilityState:{expanded:G},onPress:le,hitSlop:I,activeOpacity:.6,children:[l(U,{expanded:G,isFocused:R,isMain:v}),l(y,{style:[t.labelText,R&&t.labelTextFocused,v&&t.labelTextMain],children:r}),l(y,{style:t.textGray500,children:`${String(c).toLowerCase()==="iterable"?"(Iterable) ":""}${m.length} ${m.length>1?`items`:`item`}`})]}),o&&h(g,{style:t.flexRowGapItemsCenter,children:[l(oe,{value:n,isFocused:R}),O&&l(Y,{writer:i,dataPath:p,testID:x,isFocused:R}),c==="array"&&i!==void 0&&l(re,{writer:i,dataPath:p,testID:x,isFocused:R})]})]}),G&&h($,{children:[B.length===1&&l(g,{style:[t.singleEntryContainer,v&&t.singleEntryContainerMain],children:m.map((d,s)=>l(LiveExplorer,{defaultExpanded:a,label:d.label,value:d.value,editable:o,dataPath:[...p,d.label],writer:i,itemsDeletable:c==="array"||c==="Iterable"||c==="object",dataVersion:W,testIDForPath:D,debounceMs:S},d.label+s))}),B.length>1&&l(g,{style:t.multiEntryContainer,children:B.map((d,s)=>l(g,{children:h(g,{style:t.relativeOutlineNone,children:[h(T,{"sentry-label":"ignore devtools explorer page toggle",onPress:()=>ae(u=>u.includes(s)?u.filter(N=>N!==s):[...u,s]),style:t.pageExpanderButton,hitSlop:I,children:[l(U,{expanded:K.includes(s)}),l(y,{style:t.pageRangeText,children:me(s,m.length,_)})]}),K.includes(s)&&l(g,{style:t.entriesContainer,children:d.map(u=>l(LiveExplorer,{defaultExpanded:a,label:u.label,value:u.value,editable:o,dataPath:[...p,u.label],writer:i,dataVersion:W,testIDForPath:D,debounceMs:S},u.label))})]})},s))})]})]}),B.length===0&&h(g,{style:t.flexRowGapFullWidth,children:[o&&i!==void 0&&(c==="string"||c==="number"||c==="boolean")?h($,{children:[o&&i&&(c==="string"||c==="number")&&l(g,{style:t.nebulaInputWrapper,children:l(he,{label:r,testID:`${x}-input`,accessibilityLabel:`${r}, editable value`,style:[c==="number"?t.textNumber:t.textString],keyboardType:c==="number"?"numeric":"default",value:M,onChangeText:d=>ie(c==="number",d),onFocus:()=>Z(true),onBlur:()=>{L();Z(false)},showNumberControls:c==="number",onIncrement:()=>q(1),onDecrement:()=>q(-1),showDeleteButton:O,onDelete:()=>{i?.remove?.(p)}})}),c==="boolean"&&h(g,{style:t.booleanRowContainer,children:[l(y,{style:t.booleanLabel,children:r}),l(g,{style:t.booleanToggleWrapper,children:l(we,{writer:i,dataPath:p,testID:x,value:n,removable:O})})]})]}):h($,{children:[l(y,{style:t.text344054,children:r}),l(y,{testID:`${x}-value`,style:t.displayValueText,children:de(n)})]}),o&&O&&c!=="string"&&c!=="number"&&c!=="boolean"&&l(Y,{writer:i,dataPath:p,testID:x,isFocused:R})]})]})})}export function makeRootWriter(o){return{update:(r,n)=>{o.setRoot(pe(o.getRoot(),r,n))},remove:r=>{o.setRoot(fe(o.getRoot(),r))},canRemove:o.canRemove}}const t=ce.create({buttonStyle:{backgroundColor:e.color.surface+"E6",borderWidth:1,borderColor:e.color.textSecondary+"33",borderRadius:6,flexDirection:"row",alignItems:"center",justifyContent:"center",width:28,height:28,position:"relative",shadowColor:"#000",shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2},buttonStyleFocused:{borderColor:e.color.accent+"CC",backgroundColor:e.color.accent+"26",shadowColor:e.color.accent,shadowOpacity:.3,shadowRadius:4},deleteButton:{backgroundColor:e.color.danger+"1A",borderColor:e.color.danger+"4D",borderWidth:1,borderRadius:6,padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,position:"relative",shadowColor:e.color.danger,shadowOffset:{width:0,height:0},shadowOpacity:.15,shadowRadius:3},deleteButtonFocused:{borderColor:e.color.danger+"CC",backgroundColor:e.color.danger+"33",shadowOpacity:.3,shadowRadius:5},deleteButtonInToggle:{backgroundColor:e.color.danger+"1A",borderColor:e.color.danger+"4D",borderWidth:1,borderRadius:6,padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,shadowColor:e.color.danger,shadowOffset:{width:0,height:0},shadowOpacity:.15,shadowRadius:3},clearButton:{backgroundColor:e.color.warning+"1A",borderWidth:1,borderColor:e.color.warning+"4D",borderRadius:6,flexDirection:"row",padding:0,alignItems:"center",justifyContent:"center",width:28,height:28,position:"relative",zIndex:10,shadowColor:e.color.warning,shadowOffset:{width:0,height:0},shadowOpacity:.15,shadowRadius:3},clearButtonFocused:{borderColor:e.color.warning+"CC",backgroundColor:e.color.warning+"33",shadowOpacity:.3,shadowRadius:5},clearButtonText:{fontSize:12,fontWeight:"700",fontFamily:f},expanderIcon:{width:18,height:18,alignItems:"center",justifyContent:"center",marginRight:1,backgroundColor:e.color.textSecondary+"14",borderRadius:3},expanderIconMain:{backgroundColor:e.color.textSecondary+"1A",width:20,height:20,borderRadius:4,borderWidth:.5,borderColor:e.color.textSecondary+"33"},expanded:{transform:[{rotate:"0deg"}]},collapsed:{transform:[{rotate:"0deg"}]},minWidthWrapper:{minWidth:180,fontSize:11,flexDirection:"row",flexWrap:"wrap",width:"100%",marginVertical:.5},fullWidthMarginRight:{position:"relative",width:"100%",marginRight:1},flexRowItemsCenterGap:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:3,paddingHorizontal:6,marginVertical:1,borderRadius:4,backgroundColor:e.color.surface+"66",borderWidth:.5,borderColor:e.color.textSecondary+"1A"},flexRowItemsCenterGapMain:{backgroundColor:e.color.surface+"E6",borderLeftWidth:2.5,borderLeftColor:e.color.textSecondary+"80",borderColor:e.color.textSecondary+"26",paddingVertical:5,paddingHorizontal:8,marginBottom:3,borderWidth:1,shadowColor:"#000",shadowOffset:{width:0,height:0},shadowOpacity:.08,shadowRadius:3},expanderButton:{flexDirection:"row",alignItems:"center",backgroundColor:"transparent",paddingVertical:1,paddingHorizontal:2,gap:6,borderWidth:0,minHeight:24,flex:1},labelText:{color:e.color.textSecondary,fontSize:10,fontWeight:"600",marginRight:4,fontFamily:f,letterSpacing:.4},labelTextFocused:{color:e.color.text},labelTextMain:{color:e.color.text,fontSize:11,fontWeight:"700",letterSpacing:.6},textGray500:{color:e.color.textTertiary,fontSize:10,fontWeight:"400",fontFamily:f,opacity:.7},pageRangeText:{color:e.color.textSecondary,fontSize:10,fontWeight:"600",fontFamily:f},flexRowGapItemsCenter:{flexDirection:"row",alignItems:"center",gap:4,paddingLeft:2},singleEntryContainer:{marginLeft:2,marginTop:2,paddingLeft:8,borderLeftWidth:1.5,borderLeftColor:e.color.textSecondary+"40"},singleEntryContainerMain:{borderLeftColor:e.color.textSecondary+"4D",marginLeft:4,paddingLeft:10},multiEntryContainer:{marginLeft:2,marginTop:2,paddingLeft:8,borderLeftWidth:1.5,borderLeftColor:e.color.textSecondary+"40"},relativeOutlineNone:{position:"relative"},pageExpanderButton:{flexDirection:"row",alignItems:"center",backgroundColor:e.color.surface+"66",paddingVertical:3,paddingHorizontal:6,gap:6,borderRadius:4,borderWidth:.5,borderColor:e.color.textSecondary+"1A",marginBottom:2,minHeight:24},entriesContainer:{marginLeft:2,paddingLeft:8,marginTop:2,borderLeftWidth:1.5,borderLeftColor:e.color.textSecondary+"40"},textNumber:{color:e.color.text,fontWeight:"600",fontFamily:f},textString:{color:e.color.text,fontFamily:f},flexRowGapFullWidth:{flexDirection:"row",width:"100%",alignItems:"center",marginVertical:1,gap:6,paddingHorizontal:4,paddingVertical:2,borderRadius:3},text344054:{color:e.color.textSecondary,fontWeight:"600",fontSize:9,minWidth:50,fontFamily:f,letterSpacing:.4,opacity:.8},nebulaInputWrapper:{flex:1,width:"100%",position:"relative"},displayValueText:{flex:1,color:e.color.text,fontWeight:"400",fontFamily:f,fontSize:12,paddingVertical:6,paddingHorizontal:10,borderRadius:6,borderWidth:1,borderColor:e.color.textTertiary+"66",minHeight:34},toggleRow:{flexDirection:"row",alignItems:"center",gap:6},modernToggleButton:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",borderRadius:6,borderWidth:1,borderColor:e.color.textTertiary+"99",paddingHorizontal:8,paddingVertical:6,marginVertical:2,minHeight:34,gap:8},toggleBadge:{marginLeft:6,paddingHorizontal:6,paddingVertical:3,borderRadius:4,borderWidth:1},toggleBadgeText:{fontSize:9,fontWeight:"700",textTransform:"uppercase",letterSpacing:.8,fontFamily:f},toggleBadgeTrue:{backgroundColor:e.color.accent+"1A",borderColor:e.color.accent+"4D"},toggleBadgeFalse:{backgroundColor:e.color.textTertiary+"1A",borderColor:e.color.textTertiary+"4D"},toggleTextTrue:{color:e.color.accent,fontWeight:"600"},toggleTextFalse:{color:e.color.textSecondary,fontWeight:"500"},booleanRowContainer:{flexDirection:"row",alignItems:"center",width:"100%",gap:8,paddingVertical:2},booleanLabel:{color:e.color.textSecondary,fontSize:10,fontWeight:"600",fontFamily:f,letterSpacing:.4,minWidth:60,flexShrink:0},booleanToggleWrapper:{flex:1}});
@@ -1 +1 @@
1
- "use strict";import{useState as B,useMemo as re,useCallback as U,useRef as _,useEffect as te,memo as oe}from"react";import{Text as j,TouchableOpacity as ie,View as u,StyleSheet as ue,FlatList as pe}from"react-native";import{displayValue as Me}from"../utils/displayValue.js";import{gameUIColors as a}from"../ui/gameUI/index.js";import{night as ye}from"../ui/night/nightTheme.js";import{CopyButton as De}from"../ui/components/CopyButton.js";import{ChevronRight as Re}from"../icons/index.js";import{IndentGuidesOverlay as he}from"./IndentGuidesOverlay.js";import{monoFont as se}from"../ui/fonts.js";import{jsx as i,jsxs as T,Fragment as ke}from"react/jsx-runtime";const ge={top:10,bottom:10,left:10,right:10};const z=24;const Pe=24;const ee=50;const ne=15;const je=500;const Ze=30;const Le=300;const ae=16;const me=Array.from({length:ne+1},(e,l)=>ue.create({container:{marginLeft:l*ae}}).container);const Ae=new Map([["string",a.dataTypes.string],["number",a.dataTypes.number],["bigint",a.optional],["boolean",a.dataTypes.boolean],["null",a.dataTypes.null],["undefined",a.dataTypes.undefined],["function",a.dataTypes.function],["symbol",a.critical],["date",a.critical],["error",a.error],["array",a.dataTypes.array],["object",a.dataTypes.object],["map",a.info],["set",a.success],["circular",a.warning]]);const o=ue.create({container:{backgroundColor:ye.color.bg,borderRadius:8,borderWidth:1,borderColor:ye.color.border},header:{flexDirection:"column",paddingHorizontal:16,paddingVertical:12},headerRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:6},title:{color:a.primary,fontSize:14,fontWeight:"500"},description:{color:a.secondary,fontSize:12,marginTop:2},typeLegend:{flexDirection:"row",flexWrap:"wrap",gap:6,marginTop:8,paddingTop:8,borderTopWidth:1,borderTopColor:a.primary+"14"},typeBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:6,paddingVertical:2,borderRadius:4,borderWidth:1},typeColor:{width:8,height:8,borderRadius:4,marginRight:4},typeName:{fontSize:10,fontWeight:"500",color:a.secondary},itemContainer:{minHeight:z,backgroundColor:"transparent",position:"relative",flexDirection:"row",alignItems:"flex-start"},itemTouchable:{flex:1,flexDirection:"row",alignItems:"flex-start",paddingLeft:0,paddingRight:16,paddingVertical:2,minHeight:24},itemTouchablePressed:{backgroundColor:a.primary+"0A"},itemSelected:{backgroundColor:a.primary+"14"},expanderContainer:{width:16,alignItems:"center",justifyContent:"center",marginTop:4},expanderIcon:{width:12,height:12},labelContainer:{flex:1,flexDirection:"row",alignItems:"flex-start",paddingLeft:2},labelContainerVertical:{flex:1,flexDirection:"column",paddingLeft:2,paddingVertical:2},labelContainerVerticalRow:{flexDirection:"row",alignItems:"center",marginBottom:2},labelText:{color:a.primary,fontSize:12,fontWeight:"500",fontFamily:se,marginRight:8,flexShrink:1},labelTextTruncated:{color:a.primary,fontSize:12,fontWeight:"500",fontFamily:se,flexShrink:1},valueText:{fontSize:12,fontFamily:se,flex:1,color:a.primaryLight},loadingContainer:{padding:16,alignItems:"center"},loadingText:{color:a.secondary,fontSize:12},noDataContainer:{padding:16,alignItems:"center"},noDataText:{color:a.secondary,fontSize:12},listContent:{paddingBottom:8},headerTouchable:{flex:1,flexDirection:"row",alignItems:"center"},expanderMargin:{marginLeft:8}});function le(e){return{path:e.path.slice(1),value:e.value,label:e.key}}function ce(e,l,d=0){if(d>=l)return d;let h=d+1;if(Array.isArray(e)){for(const w of e){if(h>=l)return h;h=ce(w,l,h)}}else if(e!==null&&typeof e==="object"){for(const w of Object.values(e)){if(h>=l)return h;h=ce(w,l,h)}}return h}const _e=e=>{if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";if(e instanceof Date)return"date";if(e instanceof Error)return"error";if(e instanceof Map)return"map";if(e instanceof Set)return"set";if(e instanceof RegExp)return"regexp";if(typeof e==="function")return"function";if(typeof e==="symbol")return"symbol";if(typeof e==="bigint")return"bigint";if(typeof e==="object")return"object";return typeof e};const Ve=(e,l)=>{if(e===null)return 0;switch(l){case"array":return Array.isArray(e)?e.length:0;case"object":return typeof e==="object"&&!(e instanceof Date)&&!(e instanceof Error)&&!(e instanceof RegExp)&&!(e instanceof Map)&&!(e instanceof Set)?Object.keys(e).length:0;case"map":return e instanceof Map?e.size:0;case"set":return e instanceof Set?e.size:0;default:return 0}};const He=(e,l)=>{if(e===null)return"null";if(e===void 0)return"undefined";switch(l){case"string":return`"${String(e)}"`;case"boolean":return e===true?"true":"false";case"function":return typeof e==="function"?e.toString().slice(0,50)+"...":"undefined";case"symbol":return typeof e==="symbol"?String(e):"undefined";case"date":return e instanceof Date?e.toISOString():"undefined";case"regexp":return e instanceof RegExp?e.toString():"undefined";case"bigint":return typeof e==="bigint"?e.toString()+"n":"undefined";case"error":return e instanceof Error?`${e.name}: ${e.message}`:"undefined";default:return Me(e)}};const be=e=>{return Ae.get(e)||a.dataTypes.array};const xe=({expanded:e,onPress:l})=>{return i(ie,{"sentry-label":"ignore devtools data explorer expander",style:o.expanderContainer,onPress:l,hitSlop:ge,children:i(u,{style:o.expanderIcon,children:i(Re,{size:12,color:a.secondary,strokeWidth:2,style:{transform:[{rotate:e?"90deg":"0deg"}]}})})})};xe.displayName="Expander";const Te=oe(xe);const Se=({visibleTypes:e})=>{const l=Array.from(new Set(e)).slice(0,8);return i(u,{style:o.typeLegend,children:l.map(d=>{const h=be(d);return T(u,{style:[o.typeBadge,{backgroundColor:`${h}10`,borderColor:`${h}30`}],children:[i(u,{style:[o.typeColor,{backgroundColor:h}]}),i(j,{style:o.typeName,children:d})]},d)})})};Se.displayName="TypeLegend";const ze=oe(Se);const Oe=(e,l=10,d=false)=>{const[h,w]=B([]);const V=_(new Map);const Q=U(()=>{const t=new Set(["root"]);if(d&&e&&typeof e==="object"){if(Array.isArray(e)){e.forEach((m,s)=>{t.add(`root.${s}`)})}else{Object.keys(e).forEach(m=>{t.add(`root.${m}`)})}}return t},[d,e]);const[L,O]=B(()=>Q());const[$,A]=B(false);const I=_(new WeakSet);const k=_(false);const N=_(0);const W=_(0);const c=_(void 0);const C=U((t,m,s,g="root",n=0,M,x=[],S=0,P=1,E=[])=>{if(n>Math.min(l,ne))return[];const p=[...x,g];const f=p.join(".");const b=_e(t);const F=["object","array","map","set"].includes(b)&&t!==null;const J=F?Ve(t,b):0;const H=Math.min(J,je);if(t&&typeof t==="object"){if(s.has(t)){return[{id:f,key:g,value:"[Circular Reference]",valueType:"circular",depth:n,isExpandable:false,isExpanded:false,parentId:M,hasChildren:false,childCount:0,path:p,type:"circular",isLastChild:S===P-1,parentHasMoreSiblings:[...E],siblingIndex:S,totalSiblings:P}]}s.add(t)}const r={id:f,key:g,value:t,valueType:b,depth:n,isExpandable:F,isExpanded:m.has(f),parentId:M,hasChildren:H>0,childCount:H,path:p,type:F?"expandable":b,isLastChild:S===P-1,parentHasMoreSiblings:[...E],siblingIndex:S,totalSiblings:P};const y=[r];if(F&&m.has(f)&&n<Math.min(l,ne)){try{let D=[];switch(b){case"array":D=Array.isArray(t)?t.map((R,G)=>[G.toString(),R]):[];break;case"object":D=typeof t==="object"&&t!==null&&!(t instanceof Date)&&!(t instanceof Error)&&!(t instanceof RegExp)&&!(t instanceof Map)&&!(t instanceof Set)?Object.entries(t):[];break;case"map":D=t instanceof Map?Array.from(t.entries()).map(([R,G])=>[String(R),G]):[];break;case"set":D=t instanceof Set?Array.from(t.values()).map((R,G)=>[G.toString(),R]):[];break}const v=D.slice(0,H);const Ce=v.length;const de=[...E];if(n>0){de[n-1]=!r.isLastChild}for(let R=0;R<v.length;R+=ee){const G=v.slice(R,R+ee);let fe=R;for(const[we,Ie]of G){y.push(...C(Ie,m,s,we,n+1,f,p,fe,Ce,de));fe++}if(R>0&&R%(ee*2)===0){break}}}catch(D){console.error("[Buoy]",D)}}return y},[l]);te(()=>{if(c.current&&(c.current.type==="expand"||c.current.type==="collapse")){if($){A(false);k.current=false}c.current=void 0;return}if(k.current){return}let t;const m=++N.current;const s=()=>N.current===m;k.current=true;A(true);const g=async()=>{t=setTimeout(()=>{if(k.current&&s()){A(false);k.current=false}},5e3);await new Promise(n=>setTimeout(()=>n(),10));if(!s()){return}try{I.current=new WeakSet;W.current=Date.now();const n=C(e,L,I.current,"root",0,void 0,[],0,1,[]);const M=new Map;n.forEach((x,S)=>{M.set(x.id,{item:x,index:S})});V.current=M;if(t)clearTimeout(t);if(s()){w(n);A(false);k.current=false}}catch(n){console.error("[Buoy]",n);if(t)clearTimeout(t);if(s()){w([]);V.current=new Map;A(false);k.current=false}}};g();return()=>{k.current=false;if(t)clearTimeout(t)}},[e,L,C,l]);const Y=U((t,m)=>{A(false);k.current=false;w(s=>{const g=V.current.get(t);if(!g){return s}const{item:n,index:M}=g;if(m&&n.isExpandable&&n.hasChildren){const x=[...s];const S=new WeakSet;if(n.value&&typeof n.value==="object"){S.add(n.value)}const P=[];try{let f=[];const b=n.valueType;switch(b){case"array":f=Array.isArray(n.value)?n.value.map((r,y)=>[y.toString(),r]):[];break;case"object":f=typeof n.value==="object"&&n.value!==null&&!(n.value instanceof Date)&&!(n.value instanceof Error)&&!(n.value instanceof RegExp)&&!(n.value instanceof Map)&&!(n.value instanceof Set)?Object.entries(n.value):[];break;case"map":f=n.value instanceof Map?Array.from(n.value.entries()).map(([r,y])=>[String(r),y]):[];break;case"set":f=n.value instanceof Set?Array.from(n.value.values()).map((r,y)=>[y.toString(),r]):[];break}const F=f.length;const J=n.parentHasMoreSiblings||[];const H=[...J];if(n.depth>0){H[n.depth-1]=!n.isLastChild}f.forEach(([r,y],D)=>{const v=C(y,new Set,S,r,n.depth+1,t,n.path,D,F,H);P.push(...v)})}catch(f){console.error("[Buoy]",f)}const E=P;if(E.length>0){}x[M]={...n,isExpanded:true};x.splice(M+1,0,...E);const p=new Map;x.forEach((f,b)=>{p.set(f.id,{item:f,index:b})});V.current=p;return x}else if(!m){const x=new Set;const S=(p,f)=>{s.forEach(b=>{if(b.parentId===p||b.id.startsWith(p+".")&&b.depth>f){x.add(b.id);if(b.hasChildren){S(b.id,b.depth)}}})};S(t,n.depth);const P=s.map(p=>{if(p.id===t){return{...p,isExpanded:false}}return p}).filter(p=>!x.has(p.id));const E=new Map;P.forEach((p,f)=>{E.set(p.id,{item:p,index:f})});V.current=E;return P}return s})},[C]);const X=U(t=>{O(m=>{const s=new Set(m);const g=!s.has(t);if(g){s.add(t)}else{s.delete(t)}c.current={type:g?"expand":"collapse",itemId:t};Y(t,g);return s})},[Y]);const K=ce(e,ee,0)<ee;const q=re(()=>{if(!K)return null;return C(e,L,new WeakSet,"root",0,void 0,[],0,1,[])},[K,e,L,C]);const Z=U(t=>{if(t.length===0)return;O(m=>{if(t.every(g=>m.has(g)))return m;const s=new Set(m);for(const g of t)s.add(g);return s})},[]);return{flatData:q??h,isProcessing:q?false:$,toggleExpanded:X,revealPath:Z}};const Ee=({item:e,onToggleExpanded:l,index:d,onSelect:h,isSelected:w,selectable:V,onRequestInlineEdit:Q,isInlineEditing:L,inlineEditor:O,testIDPrefix:$})=>{const[A,I]=B(false);const[k,N]=B(false);const W=V===true;const c=_(0);const C=e.path.slice(1);const Y=me[Math.min(e.depth,ne)]||me[0];const X=be(e.valueType);const K=false;const q=()=>{if(W){const s=Date.now();const g=s-c.current<Le;c.current=s;if(g&&!e.isExpandable&&Q){Q(e);return}h(e);return}if(e.isExpandable){l(e.id)}h(e)};const Z=()=>{if(e.isExpandable){l(e.id)}h(e)};const t=()=>{};const m=e.key;return T(u,{style:[o.itemContainer,Y],children:[T(ie,{"sentry-label":"ignore devtools data explorer item",testID:`${$}-${e.id}`,accessibilityLabel:`${e.key}: ${e.valueType}`,style:[o.itemTouchable,A&&o.itemTouchablePressed,W&&w&&o.itemSelected,K&&{minHeight:Pe,paddingVertical:2}],onPress:q,onPressIn:()=>I(true),onPressOut:()=>I(false),activeOpacity:e.isExpandable||W?.7:1,disabled:!e.isExpandable&&!W,children:[e.isExpandable?i(Te,{expanded:e.isExpanded,onPress:Z}):i(u,{style:o.expanderContainer}),T(u,{style:o.labelContainer,children:[T(j,{style:o.labelText,numberOfLines:1,children:[e.key,":"]}),L&&O?O:e.isExpandable?T(j,{style:[o.valueText,{color:a.secondary}],numberOfLines:1,children:[e.valueType," (",e.childCount," ",e.childCount===1?"item":"items",")"]}):i(j,{style:[o.valueText,{color:X}],numberOfLines:1,children:He(e.value,e.valueType)})]})]}),e.value!==void 0?i(De,{value:e.value,size:14,buttonStyle:{marginLeft:8,marginRight:8}}):null]})};Ee.displayName="VirtualizedItem";const Ne=oe(Ee);export const VirtualizedDataExplorer=({title:e,description:l,data:d,maxDepth:h=10,rawMode:w=false,initialExpanded:V=false,disableCopy:Q=false,onSelectionChange:L,onRequestInlineEdit:O,inlineEditPath:$,renderInlineEditor:A,selectPath:I,testIDPrefix:k="buoy-tree-row"})=>{const[N,W]=B(w);const{flatData:c,isProcessing:C,toggleExpanded:Y,revealPath:X}=Oe(d,h,V);const K=_(null);const[q,Z]=B({start:0,end:Math.min(c.length-1,Math.max(0,Math.ceil(400/z)-1))});const t=_({itemVisiblePercentThreshold:1});const m=_(({viewableItems:r})=>{const y=r.map(D=>D.index).filter(D=>typeof D==="number");if(y.length){Z({start:Math.min(...y),end:Math.max(...y)})}}).current;te(()=>{Z({start:0,end:Math.min(c.length-1,Math.max(0,Math.ceil(400/z)-1))})},[c.length]);const s=re(()=>{const r=new Set;for(const y of c){r.add(y.valueType);if(r.size>=8)break}return Array.from(r)},[c]);const g=()=>{W(!N)};const[n,M]=B(null);const x=re(()=>n==null?void 0:c.find(r=>r.id===n),[c,n]);const S=x?.depth;te(()=>{if(!L)return;L(x?le(x):null)},[x,L]);const P=U(r=>{M(y=>y===r.id?null:r.id)},[]);const E=I===void 0?void 0:I===null?"\0null":I.join(".");const p=_(E);te(()=>{if(E===p.current)return;p.current=E;if(E===void 0)return;if(I==null){M(null);return}const r=["root"];for(const y of I.slice(0,-1)){r.push(`${r[r.length-1]}.${y}`)}X(r);M(["root",...I].join("."))},[E,I,X]);const f=U(r=>{M(r.id);O?.(le(r))},[O]);const b=({item:r,index:y})=>i(Ne,{item:r,index:y,onToggleExpanded:Y,onSelect:P,isSelected:x?.id===r.id,selectable:L!=null,onRequestInlineEdit:f,isInlineEditing:$!=null&&$.join(".")===r.path.slice(1).join("."),inlineEditor:A?A(le(r)):null,testIDPrefix:k});const F=z;const J=r=>r.id;const H=d!==null&&d!==void 0&&(typeof d==="string"?d.length>0:typeof d==="number"||typeof d==="boolean"?true:Array.isArray(d)?d.length>0:typeof d==="object"?Object.keys(d).length>0:false);if(w){if(!H){return i(u,{style:{flex:1,justifyContent:"center",alignItems:"center",padding:20},children:i(j,{style:o.noDataText,children:"No data available"})})}return i(u,{style:{minHeight:C?40:c.length*z},children:C?i(u,{style:{flex:1,justifyContent:"center",alignItems:"center"},children:T(j,{style:o.loadingText,children:["Processing data... (raw mode, isProcessing=",String(C),")"]})}):T(u,{style:{position:"relative",height:c.length*z},children:[i(he,{items:c,visibleRange:{start:0,end:Math.max(0,c.length-1)},itemHeight:z,indentWidth:ae,activeDepth:S}),i(pe,{keyboardShouldPersistTaps:"handled",ref:K,"sentry-label":"ignore devtools data explorer list",data:c,renderItem:b,keyExtractor:J,showsVerticalScrollIndicator:true,contentContainerStyle:o.listContent,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})]})})}if(!H){return T(u,{style:o.container,children:[i(u,{style:o.header,children:i(u,{style:o.headerRow,children:T(u,{style:{flex:1},children:[i(j,{style:o.title,children:e}),l&&i(j,{style:o.description,children:l})]})})}),i(u,{style:o.noDataContainer,children:i(j,{style:o.noDataText,children:"No data available"})})]})}return T(u,{style:o.container,children:[T(u,{style:o.header,children:[i(u,{style:o.headerRow,children:T(ie,{"sentry-label":"ignore devtools data explorer header toggle",onPress:g,hitSlop:ge,style:o.headerTouchable,children:[T(u,{style:{flex:1},children:[i(j,{style:o.title,children:e}),l&&i(j,{style:o.description,children:l})]}),i(u,{style:o.expanderMargin,children:i(Te,{expanded:N,onPress:g})})]})}),N&&s.length>0&&!w&&i(ze,{visibleTypes:s})]}),N&&i(ke,{children:C?i(u,{style:o.loadingContainer,children:T(j,{style:o.loadingText,children:["Processing data... (isProcessing=",String(C),")"]})}):T(u,{style:{height:c.length*z,position:"relative"},children:[i(he,{items:c,visibleRange:q,itemHeight:z,indentWidth:ae,activeDepth:S}),i(pe,{keyboardShouldPersistTaps:"handled",ref:K,"sentry-label":"ignore devtools data explorer collapsed list",data:c,renderItem:b,keyExtractor:J,showsVerticalScrollIndicator:true,contentContainerStyle:o.listContent,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false,onViewableItemsChanged:m,viewabilityConfig:t.current})]})})]})};
1
+ "use strict";import{useState as O,useMemo as Z,useCallback as A,useRef as k,useEffect as X,memo as J}from"react";import{Text as P,TouchableOpacity as Q,View as f,StyleSheet as ie,FlatList as se}from"react-native";import{displayValue as be}from"../utils/displayValue.js";import{gameUIColors as o}from"../ui/gameUI/index.js";import{night as ae}from"../ui/night/nightTheme.js";import{CopyButton as xe}from"../ui/components/CopyButton.js";import{ChevronRight as Te}from"../icons/index.js";import{IndentGuidesOverlay as le}from"./IndentGuidesOverlay.js";import{monoFont as ee}from"../ui/fonts.js";import{flattenTree as Se,getChildEntries as we,MAX_DEPTH_LIMIT as ce}from"./flattenTree.js";import{jsx as n,jsxs as m,Fragment as Ce}from"react/jsx-runtime";const de={top:10,bottom:10,left:10,right:10};const j=24;const Ee=24;const fe=50;const $e=30;const Ie=300;const te=16;const ue=Array.from({length:ce+1},(e,l)=>ie.create({container:{marginLeft:l*te}}).container);const De=new Map([["string",o.dataTypes.string],["number",o.dataTypes.number],["bigint",o.optional],["boolean",o.dataTypes.boolean],["null",o.dataTypes.null],["undefined",o.dataTypes.undefined],["function",o.dataTypes.function],["symbol",o.critical],["date",o.critical],["error",o.error],["array",o.dataTypes.array],["object",o.dataTypes.object],["map",o.info],["set",o.success],["circular",o.warning]]);const t=ie.create({container:{backgroundColor:ae.color.bg,borderRadius:8,borderWidth:1,borderColor:ae.color.border},header:{flexDirection:"column",paddingHorizontal:16,paddingVertical:12},headerRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:6},title:{color:o.primary,fontSize:14,fontWeight:"500"},description:{color:o.secondary,fontSize:12,marginTop:2},typeLegend:{flexDirection:"row",flexWrap:"wrap",gap:6,marginTop:8,paddingTop:8,borderTopWidth:1,borderTopColor:o.primary+"14"},typeBadge:{flexDirection:"row",alignItems:"center",paddingHorizontal:6,paddingVertical:2,borderRadius:4,borderWidth:1},typeColor:{width:8,height:8,borderRadius:4,marginRight:4},typeName:{fontSize:10,fontWeight:"500",color:o.secondary},itemContainer:{minHeight:j,backgroundColor:"transparent",position:"relative",flexDirection:"row",alignItems:"flex-start"},itemTouchable:{flex:1,flexDirection:"row",alignItems:"flex-start",paddingLeft:0,paddingRight:16,paddingVertical:2,minHeight:24},itemTouchablePressed:{backgroundColor:o.primary+"0A"},itemSelected:{backgroundColor:o.primary+"14"},expanderContainer:{width:16,alignItems:"center",justifyContent:"center",marginTop:4},expanderIcon:{width:12,height:12},labelContainer:{flex:1,flexDirection:"row",alignItems:"flex-start",paddingLeft:2},labelContainerVertical:{flex:1,flexDirection:"column",paddingLeft:2,paddingVertical:2},labelContainerVerticalRow:{flexDirection:"row",alignItems:"center",marginBottom:2},labelText:{color:o.primary,fontSize:12,fontWeight:"500",fontFamily:ee,marginRight:8,flexShrink:1},labelTextTruncated:{color:o.primary,fontSize:12,fontWeight:"500",fontFamily:ee,flexShrink:1},valueText:{fontSize:12,fontFamily:ee,flex:1,color:o.primaryLight},loadingContainer:{padding:16,alignItems:"center"},loadingText:{color:o.secondary,fontSize:12},noDataContainer:{padding:16,alignItems:"center"},noDataText:{color:o.secondary,fontSize:12},listContent:{paddingBottom:8},headerTouchable:{flex:1,flexDirection:"row",alignItems:"center"},expanderMargin:{marginLeft:8}});function ne(e){return{path:e.path.slice(1),value:e.value,label:e.key}}function re(e,l,d=0){if(d>=l)return d;let u=d+1;if(Array.isArray(e)){for(const x of e){if(u>=l)return u;u=re(x,l,u)}}else if(e!==null&&typeof e==="object"){for(const x of Object.values(e)){if(u>=l)return u;u=re(x,l,u)}}return u}const Re=(e,l)=>{if(e===null)return"null";if(e===void 0)return"undefined";switch(l){case"string":return`"${String(e)}"`;case"boolean":return e===true?"true":"false";case"function":return typeof e==="function"?e.toString().slice(0,50)+"...":"undefined";case"symbol":return typeof e==="symbol"?String(e):"undefined";case"date":return e instanceof Date?e.toISOString():"undefined";case"regexp":return e instanceof RegExp?e.toString():"undefined";case"bigint":return typeof e==="bigint"?e.toString()+"n":"undefined";case"error":return e instanceof Error?`${e.name}: ${e.message}`:"undefined";default:return be(e)}};const pe=e=>{return De.get(e)||o.dataTypes.array};const he=({expanded:e,onPress:l})=>{return n(Q,{"sentry-label":"ignore devtools data explorer expander",style:t.expanderContainer,onPress:l,hitSlop:de,children:n(f,{style:t.expanderIcon,children:n(Te,{size:12,color:o.secondary,strokeWidth:2,style:{transform:[{rotate:e?"90deg":"0deg"}]}})})})};he.displayName="Expander";const ye=J(he);const ge=({visibleTypes:e})=>{const l=Array.from(new Set(e)).slice(0,8);return n(f,{style:t.typeLegend,children:l.map(d=>{const u=pe(d);return m(f,{style:[t.typeBadge,{backgroundColor:`${u}10`,borderColor:`${u}30`}],children:[n(f,{style:[t.typeColor,{backgroundColor:u}]}),n(P,{style:t.typeName,children:d})]},d)})})};ge.displayName="TypeLegend";const Pe=J(ge);const Me=(e,l=10,d=false)=>{const[u,x]=O([]);const _=k(new Map);const G=A(()=>{const r=new Set(["root"]);if(d&&e&&typeof e==="object"){if(Array.isArray(e)){e.forEach((h,i)=>{r.add(`root.${i}`)})}else{Object.keys(e).forEach(h=>{r.add(`root.${h}`)})}}return r},[d,e]);const[M,V]=O(()=>G());const[N,L]=O(false);const T=k(new WeakSet);const I=k(false);const v=k(0);const z=k(0);const c=k(void 0);const S=A((r,h,i,p="root",s=0,D,y=[],R=0,H=1,w=[])=>Se(r,h,i,l,p,s,D,y,R,H,w),[l]);X(()=>{if(c.current&&(c.current.type==="expand"||c.current.type==="collapse")){if(N){L(false);I.current=false}c.current=void 0;return}if(I.current){return}let r;const h=++v.current;const i=()=>v.current===h;I.current=true;L(true);const p=async()=>{r=setTimeout(()=>{if(I.current&&i()){L(false);I.current=false}},5e3);await new Promise(s=>setTimeout(()=>s(),10));if(!i()){return}try{T.current=new WeakSet;z.current=Date.now();const s=S(e,M,T.current,"root",0,void 0,[],0,1,[]);const D=new Map;s.forEach((y,R)=>{D.set(y.id,{item:y,index:R})});_.current=D;if(r)clearTimeout(r);if(i()){x(s);L(false);I.current=false}}catch(s){console.error("[Buoy]",s);if(r)clearTimeout(r);if(i()){x([]);_.current=new Map;L(false);I.current=false}}};p();return()=>{I.current=false;if(r)clearTimeout(r)}},[e,M,S,l]);const $=A((r,h)=>{L(false);I.current=false;x(i=>{const p=_.current.get(r);if(!p){return i}const{item:s,index:D}=p;if(h&&s.isExpandable&&s.hasChildren){const y=[...i];const R=new WeakSet;if(s.value&&typeof s.value==="object"){R.add(s.value)}const H=[];try{const C=we(s.value,s.valueType);const b=C.length;const oe=s.parentHasMoreSiblings||[];const U=[...oe];if(s.depth>0){U[s.depth-1]=!s.isLastChild}C.forEach(([q,a],E)=>{const Y=S(a,new Set,R,q,s.depth+1,r,s.path,E,b,U);H.push(...Y)})}catch(C){console.error("[Buoy]",C)}const w=H;if(w.length>0){}y[D]={...s,isExpanded:true};y.splice(D+1,0,...w);const g=new Map;y.forEach((C,b)=>{g.set(C.id,{item:C,index:b})});_.current=g;return y}else if(!h){const y=new Set;const R=(g,C)=>{i.forEach(b=>{if(b.parentId===g||b.id.startsWith(g+".")&&b.depth>C){y.add(b.id);if(b.hasChildren){R(b.id,b.depth)}}})};R(r,s.depth);const H=i.map(g=>{if(g.id===r){return{...g,isExpanded:false}}return g}).filter(g=>!y.has(g.id));const w=new Map;H.forEach((g,C)=>{w.set(g.id,{item:g,index:C})});_.current=w;return H}return i})},[S]);const B=A(r=>{V(h=>{const i=new Set(h);const p=!i.has(r);if(p){i.add(r)}else{i.delete(r)}c.current={type:p?"expand":"collapse",itemId:r};$(r,p);return i})},[$]);const W=re(e,fe,0)<fe;const F=Z(()=>{if(!W)return null;return S(e,M,new WeakSet,"root",0,void 0,[],0,1,[])},[W,e,M,S]);const K=A(r=>{if(r.length===0)return;V(h=>{if(r.every(p=>h.has(p)))return h;const i=new Set(h);for(const p of r)i.add(p);return i})},[]);return{flatData:F??u,isProcessing:F?false:N,toggleExpanded:B,revealPath:K}};const me=({item:e,onToggleExpanded:l,index:d,onSelect:u,isSelected:x,selectable:_,onRequestInlineEdit:G,isInlineEditing:M,inlineEditor:V,testIDPrefix:N})=>{const[L,T]=O(false);const[I,v]=O(false);const z=_===true;const c=k(0);const S=e.path.slice(1);const $=ue[Math.min(e.depth,ce)]||ue[0];const B=pe(e.valueType);const W=false;const F=()=>{if(z){const i=Date.now();const p=i-c.current<Ie;c.current=i;if(p&&!e.isExpandable&&G){G(e);return}u(e);return}if(e.isExpandable){l(e.id)}u(e)};const K=()=>{if(e.isExpandable){l(e.id)}u(e)};const r=()=>{};const h=e.key;return m(f,{style:[t.itemContainer,$],children:[m(Q,{"sentry-label":"ignore devtools data explorer item",testID:`${N}-${e.id}`,accessibilityLabel:`${e.key}: ${e.valueType}`,style:[t.itemTouchable,L&&t.itemTouchablePressed,z&&x&&t.itemSelected,W&&{minHeight:Ee,paddingVertical:2}],onPress:F,onPressIn:()=>T(true),onPressOut:()=>T(false),activeOpacity:e.isExpandable||z?.7:1,disabled:!e.isExpandable&&!z,children:[e.isExpandable?n(ye,{expanded:e.isExpanded,onPress:K}):n(f,{style:t.expanderContainer}),m(f,{style:t.labelContainer,children:[m(P,{style:t.labelText,numberOfLines:1,children:[e.key,":"]}),M&&V?V:e.isExpandable?m(P,{style:[t.valueText,{color:o.secondary}],numberOfLines:1,children:[e.valueType," (",e.childCount," ",e.childCount===1?"item":"items",")"]}):n(P,{style:[t.valueText,{color:B}],numberOfLines:1,children:Re(e.value,e.valueType)})]})]}),e.value!==void 0?n(xe,{value:e.value,size:14,buttonStyle:{marginLeft:8,marginRight:8}}):null]})};me.displayName="VirtualizedItem";const Le=J(me);export const VirtualizedDataExplorer=({title:e,description:l,data:d,maxDepth:u=10,rawMode:x=false,initialExpanded:_=false,disableCopy:G=false,onSelectionChange:M,onRequestInlineEdit:V,inlineEditPath:N,renderInlineEditor:L,selectPath:T,testIDPrefix:I="buoy-tree-row"})=>{const[v,z]=O(x);const{flatData:c,isProcessing:S,toggleExpanded:$,revealPath:B}=Me(d,u,_);const W=k(null);const[F,K]=O({start:0,end:Math.min(c.length-1,Math.max(0,Math.ceil(400/j)-1))});const r=k({itemVisiblePercentThreshold:1});const h=k(({viewableItems:a})=>{const E=a.map(Y=>Y.index).filter(Y=>typeof Y==="number");if(E.length){K({start:Math.min(...E),end:Math.max(...E)})}}).current;X(()=>{K({start:0,end:Math.min(c.length-1,Math.max(0,Math.ceil(400/j)-1))})},[c.length]);const i=Z(()=>{const a=new Set;for(const E of c){a.add(E.valueType);if(a.size>=8)break}return Array.from(a)},[c]);const p=()=>{z(!v)};const[s,D]=O(null);const y=Z(()=>s==null?void 0:c.find(a=>a.id===s),[c,s]);const R=y?.depth;X(()=>{if(!M)return;M(y?ne(y):null)},[y,M]);const H=A(a=>{D(E=>E===a.id?null:a.id)},[]);const w=T===void 0?void 0:T===null?"\0null":T.join(".");const g=k(w);X(()=>{if(w===g.current)return;g.current=w;if(w===void 0)return;if(T==null){D(null);return}const a=["root"];for(const E of T.slice(0,-1)){a.push(`${a[a.length-1]}.${E}`)}B(a);D(["root",...T].join("."))},[w,T,B]);const C=A(a=>{D(a.id);V?.(ne(a))},[V]);const b=({item:a,index:E})=>n(Le,{item:a,index:E,onToggleExpanded:$,onSelect:H,isSelected:y?.id===a.id,selectable:M!=null,onRequestInlineEdit:C,isInlineEditing:N!=null&&N.join(".")===a.path.slice(1).join("."),inlineEditor:L?L(ne(a)):null,testIDPrefix:I});const oe=j;const U=a=>a.id;const q=d!==null&&d!==void 0&&(typeof d==="string"?d.length>0:typeof d==="number"||typeof d==="boolean"?true:Array.isArray(d)?d.length>0:typeof d==="object"?Object.keys(d).length>0:false);if(x){if(!q){return n(f,{style:{flex:1,justifyContent:"center",alignItems:"center",padding:20},children:n(P,{style:t.noDataText,children:"No data available"})})}return n(f,{style:{minHeight:S?40:c.length*j},children:S?n(f,{style:{flex:1,justifyContent:"center",alignItems:"center"},children:m(P,{style:t.loadingText,children:["Processing data... (raw mode, isProcessing=",String(S),")"]})}):m(f,{style:{position:"relative",height:c.length*j},children:[n(le,{items:c,visibleRange:{start:0,end:Math.max(0,c.length-1)},itemHeight:j,indentWidth:te,activeDepth:R}),n(se,{keyboardShouldPersistTaps:"handled",ref:W,"sentry-label":"ignore devtools data explorer list",data:c,renderItem:b,keyExtractor:U,showsVerticalScrollIndicator:true,contentContainerStyle:t.listContent,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false})]})})}if(!q){return m(f,{style:t.container,children:[n(f,{style:t.header,children:n(f,{style:t.headerRow,children:m(f,{style:{flex:1},children:[n(P,{style:t.title,children:e}),l&&n(P,{style:t.description,children:l})]})})}),n(f,{style:t.noDataContainer,children:n(P,{style:t.noDataText,children:"No data available"})})]})}return m(f,{style:t.container,children:[m(f,{style:t.header,children:[n(f,{style:t.headerRow,children:m(Q,{"sentry-label":"ignore devtools data explorer header toggle",onPress:p,hitSlop:de,style:t.headerTouchable,children:[m(f,{style:{flex:1},children:[n(P,{style:t.title,children:e}),l&&n(P,{style:t.description,children:l})]}),n(f,{style:t.expanderMargin,children:n(ye,{expanded:v,onPress:p})})]})}),v&&i.length>0&&!x&&n(Pe,{visibleTypes:i})]}),v&&n(Ce,{children:S?n(f,{style:t.loadingContainer,children:m(P,{style:t.loadingText,children:["Processing data... (isProcessing=",String(S),")"]})}):m(f,{style:{height:c.length*j,position:"relative"},children:[n(le,{items:c,visibleRange:F,itemHeight:j,indentWidth:te,activeDepth:R}),n(se,{keyboardShouldPersistTaps:"handled",ref:W,"sentry-label":"ignore devtools data explorer collapsed list",data:c,renderItem:b,keyExtractor:U,showsVerticalScrollIndicator:true,contentContainerStyle:t.listContent,initialNumToRender:15,maxToRenderPerBatch:10,windowSize:10,scrollEnabled:false,onViewableItemsChanged:h,viewabilityConfig:r.current})]})})]})};
@@ -0,0 +1 @@
1
+ "use strict";export const MAX_DEPTH_LIMIT=15;const C=t=>typeof t==="object"&&t!==null&&!(t instanceof Date)&&!(t instanceof Error)&&!(t instanceof RegExp)&&!(t instanceof Map)&&!(t instanceof Set);export const getValueType=t=>{if(t===null)return"null";if(t===void 0)return"undefined";if(Array.isArray(t))return"array";if(t instanceof Date)return"date";if(t instanceof Error)return"error";if(t instanceof Map)return"map";if(t instanceof Set)return"set";if(t instanceof RegExp)return"regexp";if(typeof t==="function")return"function";if(typeof t==="symbol")return"symbol";if(typeof t==="bigint")return"bigint";if(typeof t==="object")return"object";return typeof t};export const getValueCount=(t,e)=>{if(t===null)return 0;switch(e){case"array":return Array.isArray(t)?t.length:0;case"object":return C(t)?Object.keys(t).length:0;case"map":return t instanceof Map?t.size:0;case"set":return t instanceof Set?t.size:0;default:return 0}};export const getChildEntries=(t,e)=>{switch(e){case"array":return Array.isArray(t)?t.map((r,n)=>[n.toString(),r]):[];case"object":return C(t)?Object.entries(t):[];case"map":return t instanceof Map?Array.from(t.entries()).map(([r,n])=>[String(r),n]):[];case"set":return t instanceof Set?Array.from(t.values()).map((r,n)=>[n.toString(),r]):[];default:return[]}};export function flattenTree(t,e,r,n,h="root",s=0,d,g=[],c=0,f=1,u=[]){if(s>Math.min(n,MAX_DEPTH_LIMIT))return[];const a=[...g,h];const o=a.join(".");const i=getValueType(t);const p=["object","array","map","set"].includes(i)&&t!==null;const m=p?getValueCount(t,i):0;if(t&&typeof t==="object"){if(r.has(t)){return[{id:o,key:h,value:"[Circular Reference]",valueType:"circular",depth:s,isExpandable:false,isExpanded:false,parentId:d,hasChildren:false,childCount:0,path:a,type:"circular",isLastChild:c===f-1,parentHasMoreSiblings:[...u],siblingIndex:c,totalSiblings:f}]}r.add(t)}const b={id:o,key:h,value:t,valueType:i,depth:s,isExpandable:p,isExpanded:e.has(o),parentId:d,hasChildren:m>0,childCount:m,path:a,type:p?"expandable":i,isLastChild:c===f-1,parentHasMoreSiblings:[...u],siblingIndex:c,totalSiblings:f};const j=[b];if(p&&e.has(o)&&s<Math.min(n,MAX_DEPTH_LIMIT)){try{const y=getChildEntries(t,i);const A=y.length;const E=[...u];if(s>0){E[s-1]=!b.isLastChild}y.forEach(([M,x],T)=>{const L=flattenTree(x,e,r,n,M,s+1,o,a,T,A,E);for(const P of L)j.push(P)})}catch(y){console.error("[Buoy]",y)}}return j}
@@ -0,0 +1 @@
1
+ "use strict";export const LIVE_PAGE_SIZE=100;export function getLiveSubEntries(t){if(t===null||t===void 0||typeof t!=="object"){return[]}if(Array.isArray(t)){return t.map((n,r)=>({label:r.toString(),value:n}))}if(t instanceof Map){return Array.from(t.entries()).map(([n,r])=>({label:String(n),value:r}))}if(t instanceof Set){return Array.from(t).map((n,r)=>({label:r.toString(),value:n}))}return Object.entries(t).map(([n,r])=>({label:n,value:r}))}export function livePageRange(t,n,r=LIVE_PAGE_SIZE){const e=t*r;const i=Math.min(n,e+r)-1;return`[${e}...${i}]`}
@@ -1 +1 @@
1
- "use strict";export*from"./primitives/index.js";export{NetworkIcon,NETWORK_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{EnvIcon,ENV_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ConsoleIcon,CONSOLE_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{TimeMachineIcon,TIME_MACHINE_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ImagesIcon,IMAGES_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{AssetsIcon,ASSETS_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ImpersonateIcon,IMPERSONATE_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ImageOverlayIcon,IMAGE_OVERLAY_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ZustandIcon,ZUSTAND_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{JotaiIcon,JOTAI_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{EnvLaptopIcon,LaptopIcon}from"./EnvLaptopIcon.js";export{ReactQueryIcon}from"./ReactQueryIcon.js";export{SentryBugIcon}from"./SentryBugIcon.js";export{StorageStackIcon}from"./StorageStackIcon.js";export{WifiCircuitIcon}from"./WifiCircuitIcon.js";export{RouteMapIcon,RouteIcon,NavigationIcon}from"./RouteMapIcon.js";export{StackPulseIcon,RenderPulseIcon,HighlightUpdatesIcon}from"./StackPulseIcon.js";export{RenderCountIcon}from"./RenderCountIcon.js";export{BenchmarkIcon as BenchmarkLegacyIcon}from"./BenchmarkIcon.js";export{IconBackground}from"./IconBackground.js";export*from"./lucide-icons.js";export{ActivityGlyph as Activity,AlertCircleGlyph as AlertCircle,AlertTriangleGlyph as AlertTriangle,BookmarkGlyph as Bookmark,BoxGlyph as Box,BugGlyph as Bug,CheckCircleGlyph as CheckCircle,CheckGlyph as Check,ChevronDownGlyph as ChevronDown,ChevronLeftGlyph as ChevronLeft,ChevronRightGlyph as ChevronRight,ChevronUpGlyph as ChevronUp,ClockGlyph as Clock,CopyGlyph as Copy,DatabaseGlyph as Database,DockBottomGlyph as DockBottom,DownloadGlyph as Download,Edit3Glyph as Edit3,EyeOffGlyph as EyeOff,EyeGlyph as Eye,FileJsonGlyph as FileJson,FileTextGlyph as FileText,FilmGlyph as Film,FilterGlyph as Filter,FlaskConicalGlyph as FlaskConical,FloatWindowGlyph as FloatWindow,GitBranchGlyph as GitBranch,GlobeGlyph as Globe,HashGlyph as Hash,HomeGlyph as Home,ImageGlyph as Image,InfoGlyph as Info,KeyGlyph as Key,LayersGlyph as Layers,LinkGlyph as Link,LockGlyph as Lock,MinusGlyph as Minus,MusicGlyph as Music,NavigationGlyph as Navigation,PaletteGlyph as Palette,PauseGlyph as Pause,PlayGlyph as Play,PlusGlyph as Plus,PowerGlyph as Power,RefreshCwGlyph as RefreshCw,SearchGlyph as Search,ServerGlyph as Server,SettingsGlyph as Settings,SettingsSolidIcon as SettingsSolid,ShieldGlyph as Shield,Trash2Glyph as Trash2,Trash2Glyph as Trash,UnlockGlyph as Unlock,UploadGlyph as Upload,UserGlyph as User,WifiGlyph as Wifi,XCircleGlyph as XCircle,XGlyph as X,ZapGlyph as Zap}from"@buoy-gg/floating-tools-core";export{SentryIcon,EventsIcon,RoutesIcon,RoutePinIcon,RoutePathIcon,RouteDotIcon,RouteTwoPinsIcon,CameraIcon,HighlightIcon,ReduxIcon,StorageIcon,AskBuoyIcon,HighlighterIcon,QueryIcon,ScenariosIcon}from"@buoy-gg/floating-tools-core";export{WifiIcon as WifiBifIcon,BenchmarkIcon,BENCHMARK_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{NotificationsIcon,NOTIFICATIONS_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ClockToolIcon,CLOCK_TOOL_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{PermissionsIcon,PERMISSIONS_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{LifecycleToolIcon,LIFECYCLE_TOOL_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{LocationToolIcon,LOCATION_TOOL_ICON_COLOR}from"@buoy-gg/floating-tools-core";
1
+ "use strict";export*from"./primitives/index.js";export{NetworkIcon,NETWORK_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{EnvIcon,ENV_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ConsoleIcon,CONSOLE_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{TimeMachineIcon,TIME_MACHINE_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ImagesIcon,IMAGES_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{AssetsIcon,ASSETS_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ImpersonateIcon,IMPERSONATE_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ImageOverlayIcon,IMAGE_OVERLAY_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ZustandIcon,ZUSTAND_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{JotaiIcon,JOTAI_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{EnvLaptopIcon,LaptopIcon}from"./EnvLaptopIcon.js";export{ReactQueryIcon}from"./ReactQueryIcon.js";export{SentryBugIcon}from"./SentryBugIcon.js";export{StorageStackIcon}from"./StorageStackIcon.js";export{WifiCircuitIcon}from"./WifiCircuitIcon.js";export{RouteMapIcon,RouteIcon,NavigationIcon}from"./RouteMapIcon.js";export{StackPulseIcon,RenderPulseIcon,HighlightUpdatesIcon}from"./StackPulseIcon.js";export{RenderCountIcon}from"./RenderCountIcon.js";export{BenchmarkIcon as BenchmarkLegacyIcon}from"./BenchmarkIcon.js";export{IconBackground}from"./IconBackground.js";export*from"./lucide-icons.js";export{ActivityGlyph as Activity,AlertCircleGlyph as AlertCircle,AlertTriangleGlyph as AlertTriangle,BookmarkGlyph as Bookmark,BoxGlyph as Box,BugGlyph as Bug,CheckCircleGlyph as CheckCircle,CheckGlyph as Check,ChevronDownGlyph as ChevronDown,ChevronLeftGlyph as ChevronLeft,ChevronRightGlyph as ChevronRight,ChevronUpGlyph as ChevronUp,ClockGlyph as Clock,CopyGlyph as Copy,DatabaseGlyph as Database,DockBottomGlyph as DockBottom,DownloadGlyph as Download,Edit3Glyph as Edit3,EyeOffGlyph as EyeOff,EyeGlyph as Eye,FileJsonGlyph as FileJson,FileTextGlyph as FileText,FilmGlyph as Film,FilterGlyph as Filter,FlaskConicalGlyph as FlaskConical,FloatWindowGlyph as FloatWindow,GitBranchGlyph as GitBranch,GlobeGlyph as Globe,HashGlyph as Hash,HomeGlyph as Home,ImageGlyph as Image,InfoGlyph as Info,KeyGlyph as Key,LayersGlyph as Layers,LinkGlyph as Link,LockGlyph as Lock,MinusGlyph as Minus,MusicGlyph as Music,NavigationGlyph as Navigation,PaletteGlyph as Palette,PauseGlyph as Pause,PlayGlyph as Play,PlusGlyph as Plus,PowerGlyph as Power,RefreshCwGlyph as RefreshCw,SearchGlyph as Search,ServerGlyph as Server,SettingsGlyph as Settings,SettingsSolidIcon as SettingsSolid,ShieldGlyph as Shield,Trash2Glyph as Trash2,Trash2Glyph as Trash,UnlockGlyph as Unlock,UploadGlyph as Upload,UserGlyph as User,WifiGlyph as Wifi,XCircleGlyph as XCircle,XGlyph as X,ZapGlyph as Zap}from"@buoy-gg/floating-tools-core";export{SentryIcon,EventsIcon,RoutesIcon,RoutePinIcon,RoutePathIcon,RouteDotIcon,RouteTwoPinsIcon,CameraIcon,HighlightIcon,ReduxIcon,StorageIcon,AskBuoyIcon,HighlighterIcon,QueryIcon,ScenariosIcon}from"@buoy-gg/floating-tools-core";export{WifiIcon as WifiBifIcon,BenchmarkIcon,BENCHMARK_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{NotificationsIcon,NOTIFICATIONS_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{ClockToolIcon,CLOCK_TOOL_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{PermissionsIcon,PERMISSIONS_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{LifecycleToolIcon,LIFECYCLE_TOOL_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{LocationToolIcon,LOCATION_TOOL_ICON_COLOR}from"@buoy-gg/floating-tools-core";export{OtaInspectorIcon,OTA_INSPECTOR_ICON_COLOR}from"@buoy-gg/floating-tools-core";
@@ -1 +1 @@
1
- "use strict";export*from"./ui/index.js";export*from"./stores/index.js";export*from"./bugCase/index.js";export*from"./sync/keyedArrays.js";export*from"./sync/valueShape.js";export*from"./sync/valuePath.js";export*from"./sync/typedEdit.js";export*from"./sync/wireBudget.js";export*from"./sync/wireForm.js";export*from"./sync/toolSyncAdapter.js";export{startSettingsSync,SettingsSync,PERSONAL_SETTING_KEYS,TEAM_SETTING_KEYS,onSettingsApplied,syncSettingsNow}from"./sync/settingsSync.js";export*from"./tools/defineTool.js";export*from"./sync/toolActionRegistry.js";export*from"./sync/toolUiBridge.js";export*from"./sync/toolScreenHeader.js";export{absoluteFill,displayValue,parseDisplayValue,getSafeAreaInsets,persistentStorage,isUsingPersistentStorage,getStorageBackendType,safeStringify,getValueType,isPrimitive,isJsonSerializable,isValidJson,getConstructorName,isEmpty,getValueSize,parseValue,formatValue,getTypeColor,truncateText,flattenObject,formatPath,loadOptionalModule,getCachedOptionalModule,setRenderCaptureProvider,getRenderCaptureProvider,registerStateSnapshotProvider,getStateSnapshotProviders,getStateSnapshotProvider,subscribeToStateSnapshotProviders,superJsonSerialize,superJsonDeserialize,realNow,getRealAppState,subscribeRealAppState,BUOY_SYNTHETIC_MARK,countBuoyListener,reloadApp,scheduleReloadApp,resolveReloadStrategy,REMOTE_RELOAD_DELAY_MS,getDevServerOrigin,Subscribable,subscriberCountNotifier,subscribeToSubscriberCountChanges,notifySubscriberCountChange,useSafeRouter,useSafePathname,useSafeSegments,useSafeGlobalSearchParams,getSafeRouter,getSafeCurrentPathname,getSafeCurrentRoute,isExpoRouterAvailable}from"./utils/index.js";export*from"./utils/toolModules.js";export{subscribeStorageWrites}from"./utils/storageWrites.js";export{registerBrowserRouter,browserRouter,subscribeBrowserNavigation}from"./utils/browserNavigation.js";export{PREVIEW_ITEM_RENDER_BYTE_LIMIT,createRestoreScope,emptyRestoreResult,failedRestore,skippedRestore,classifyPreviewItem,wontApply,unionKeys}from"./utils/snapshotProviderKit.js";export{entityColor,formatValuePreview,shallowDiffSummary}from"./utils/stateTools.js";export*from"./utils/formatting/index.js";export*from"./utils/time/index.js";export{isPlainObject as isPlainObjectUtil}from"./utils/typeHelpers.js";export*from"./icons/index.js";export*from"./clipboard/index.js";export*from"./logger/index.js";export*from"./settings/index.js";export*from"./storage/index.js";export{useSafeAreaInsets,useFilterManager,usePersistedState,resetPersistedStateCache,useChangeLog,useSubscribedValue,useEventStoreEvents,useDeviceInfo,getDeviceInfo,logDeviceInfo}from"./hooks/index.js";export{JsModal}from"./JsModal";export{night,NIGHT_LABEL_TRACKING}from"./ui/night/nightTheme.js";export{QrCodeView}from"./ui/qr/QrCodeView.js";export{NightSectionLabel,NightFootnote,NightCard,NightSeparator,NightRows,NightSwitch,NightChip,NightButton,NightSegmented,NightBadge}from"./ui/night/primitives.js";export{gameUIColors,buoyColors}from"./ui/gameUI/constants/gameUIColors.js";export{refreshGameUIColors}from"./ui/gameUI/constants/gameUIColors.js";export{macOSColors}from"./ui/gameUI/constants/macOSDesignSystemColors.js";export{dialColors}from"./ui/gameUI/constants/gameUIColors.js";export{EnvironmentIndicator}from"./env/EnvironmentIndicator";export{EnvironmentSelector}from"./env/EnvironmentSelector.js";export{EnvironmentSelectorInline}from"./env/EnvironmentSelectorInline";export{normalizeEnvironment}from"./types/types.js";export{HintsProvider,useHintsDisabled,useHintsContext}from"./context/index.js";export*from"./history/index.js";export{FeatureGate,UpgradePrompt,useFeatureGate,ProFeatureBanner,UpgradeModal,BuoyUpgradeSheet,BuoySignInCard,BuoyNeedsPlanCard,useSignInState,ProBadge,ProUpgradeModal,FreeAccountPrompt,LOGIN_COMMAND,getUseIsPro,getUseLicense,getUseTier,signOutOfBuoy,TIER_LIMITS,useLimit,resolveEffectiveTier}from"./license/index.js";export{getAccountAccess,hasAccountAccess,assertAccountAccess,subscribeAccountAccess,getUseAccountAccess,retryAccountAccess,isProNow,getTeamCredential}from"./license/licenseModule.js";export{setBuoyAppId,getBuoyAppId}from"./utils/appIdentity.js";export{guardToolAdapter}from"./sync/toolActionRegistry.js";export{AccountSetup}from"./license/AccountSetup";export{AccountSetupButton}from"./license/AccountSetupContent.js";
1
+ "use strict";export*from"./ui/index.js";export*from"./stores/index.js";export*from"./bugCase/index.js";export*from"./sync/keyedArrays.js";export*from"./sync/valueShape.js";export*from"./sync/valuePath.js";export*from"./sync/typedEdit.js";export*from"./sync/wireBudget.js";export*from"./sync/wireForm.js";export*from"./sync/toolSyncAdapter.js";export{startSettingsSync,SettingsSync,PERSONAL_SETTING_KEYS,TEAM_SETTING_KEYS,onSettingsApplied,syncSettingsNow}from"./sync/settingsSync.js";export*from"./tools/defineTool.js";export*from"./sync/toolActionRegistry.js";export*from"./sync/toolUiBridge.js";export*from"./sync/toolScreenHeader.js";export{absoluteFill,displayValue,parseDisplayValue,getSafeAreaInsets,persistentStorage,setItemChecked,isUsingPersistentStorage,getStorageBackendType,safeStringify,getValueType,isPrimitive,isJsonSerializable,isValidJson,getConstructorName,isEmpty,getValueSize,parseValue,formatValue,getTypeColor,truncateText,flattenObject,formatPath,loadOptionalModule,getCachedOptionalModule,setRenderCaptureProvider,getRenderCaptureProvider,registerStateSnapshotProvider,getStateSnapshotProviders,getStateSnapshotProvider,subscribeToStateSnapshotProviders,superJsonSerialize,superJsonDeserialize,realNow,getRealAppState,subscribeRealAppState,BUOY_SYNTHETIC_MARK,countBuoyListener,reloadApp,scheduleReloadApp,resolveReloadStrategy,REMOTE_RELOAD_DELAY_MS,getDevServerOrigin,Subscribable,subscriberCountNotifier,subscribeToSubscriberCountChanges,notifySubscriberCountChange,useSafeRouter,useSafePathname,useSafeSegments,useSafeGlobalSearchParams,getSafeRouter,getSafeCurrentPathname,getSafeCurrentRoute,isExpoRouterAvailable}from"./utils/index.js";export*from"./utils/toolModules.js";export{subscribeStorageWrites}from"./utils/storageWrites.js";export{registerBrowserRouter,browserRouter,subscribeBrowserNavigation}from"./utils/browserNavigation.js";export{PREVIEW_ITEM_RENDER_BYTE_LIMIT,createRestoreScope,emptyRestoreResult,failedRestore,skippedRestore,classifyPreviewItem,wontApply,unionKeys}from"./utils/snapshotProviderKit.js";export{entityColor,formatValuePreview,shallowDiffSummary}from"./utils/stateTools.js";export*from"./utils/formatting/index.js";export*from"./utils/time/index.js";export{isPlainObject as isPlainObjectUtil}from"./utils/typeHelpers.js";export*from"./icons/index.js";export*from"./clipboard/index.js";export*from"./logger/index.js";export*from"./settings/index.js";export*from"./storage/index.js";export{useSafeAreaInsets,useFilterManager,usePersistedState,resetPersistedStateCache,useChangeLog,useSubscribedValue,useEventStoreEvents,useDeviceInfo,getDeviceInfo,logDeviceInfo}from"./hooks/index.js";export{JsModal}from"./JsModal";export{night,NIGHT_LABEL_TRACKING}from"./ui/night/nightTheme.js";export{QrCodeView}from"./ui/qr/QrCodeView.js";export{NightSectionLabel,NightFootnote,NightCard,NightSeparator,NightRows,NightSwitch,NightChip,NightButton,NightSegmented,NightBadge}from"./ui/night/primitives.js";export{gameUIColors,buoyColors}from"./ui/gameUI/constants/gameUIColors.js";export{refreshGameUIColors}from"./ui/gameUI/constants/gameUIColors.js";export{macOSColors}from"./ui/gameUI/constants/macOSDesignSystemColors.js";export{dialColors}from"./ui/gameUI/constants/gameUIColors.js";export{EnvironmentIndicator}from"./env/EnvironmentIndicator";export{EnvironmentSelector}from"./env/EnvironmentSelector.js";export{EnvironmentSelectorInline}from"./env/EnvironmentSelectorInline";export{normalizeEnvironment}from"./types/types.js";export{HintsProvider,useHintsDisabled,useHintsContext}from"./context/index.js";export*from"./history/index.js";export{FeatureGate,UpgradePrompt,useFeatureGate,ProFeatureBanner,UpgradeModal,BuoyUpgradeSheet,BuoySignInCard,BuoyNeedsPlanCard,BuoyGetProCard,useSignInState,ProBadge,ProUpgradeModal,FreeAccountPrompt,LOGIN_COMMAND,getUseIsPro,getUseLicense,getUseTier,signOutOfBuoy,TIER_LIMITS,useLimit,resolveEffectiveTier}from"./license/index.js";export{getAccountAccess,hasAccountAccess,assertAccountAccess,subscribeAccountAccess,getUseAccountAccess,retryAccountAccess,isProNow,getTeamCredential}from"./license/licenseModule.js";export{setBuoyAppId,getBuoyAppId}from"./utils/appIdentity.js";export{guardToolAdapter}from"./sync/toolActionRegistry.js";export{AccountSetup}from"./license/AccountSetup";export{AccountSetupButton}from"./license/AccountSetupContent.js";
@@ -1 +1 @@
1
- "use strict";import{useCallback as P,useEffect as S,useRef as x,useState as m}from"react";import{ActivityIndicator as k,Modal as j,Pressable as g,StyleSheet as T,Text as r,View as a}from"react-native";import{monoFont as B}from"../ui/fonts.js";import{night as o}from"../ui/night/nightTheme.js";import{QrCodeView as D}from"../ui/qr/QrCodeView.js";import{getSignInSession as I,isProNow as v,retryAccountAccess as A}from"./licenseModule.js";import{PRICING_URL as R,isWeb as H,openPricing as F}from"./openPricing.js";import{jsx as t,jsxs as l,Fragment as z}from"react/jsx-runtime";const W=n=>n.replace(/^https?:\/\//,"");export function useSignInState(){const[n,i]=m(()=>I()?.getStatus().state??"signed_out");S(()=>{const d=I();if(!d)return;const s=()=>i(d.getStatus().state);s();return d.subscribe(s)},[]);return n}function w({onClose:n}){return l(a,{style:e.header,children:[l(a,{style:e.brand,children:[t(a,{style:e.brandDot}),t(r,{style:e.wordmark,children:"BUOY"})]}),t(g,{accessibilityRole:"button",accessibilityLabel:"Close sign-in",onPress:n,style:e.close,testID:"buoy-signin-close",children:t(r,{style:e.closeText,children:"\u2715"})})]})}export function BuoySignInCard({onClose:n,onNotConfigured:i,footer:d}){const[s,c]=m({kind:"starting"});const y=x(null);const b=x(n);const u=x(i);b.current=n;u.current=i;const C=P(()=>{y.current?.abort();const f=I();if(!f?.signInWithCode){if(u.current)return u.current();c({kind:"error",message:"This version of @buoy-gg/license can't sign in with a code. Update it."});return}const p=new AbortController;y.current=p;c({kind:"starting"});f.signInWithCode(h=>c({kind:"waiting",prompt:h}),{signal:p.signal}).then(()=>{if(!p.signal.aborted)b.current()}).catch(h=>{if(p.signal.aborted)return;if(h?.code==="not_configured"&&u.current){u.current();return}c({kind:"error",message:h instanceof Error?h.message:"Sign-in did not work. Try again."})})},[]);S(()=>{C();return()=>y.current?.abort()},[C]);return l(a,{style:e.card,testID:"buoy-code-signin",children:[t(w,{onClose:n}),t(r,{style:e.title,children:"Sign in to Buoy"}),s.kind==="starting"?t(a,{style:e.center,children:t(k,{color:o.color.accent})}):null,s.kind==="waiting"?l(z,{children:[t(r,{style:e.body,children:"Scan this with your phone's camera."}),t(a,{style:e.qr,testID:"buoy-signin-qr",children:t(D,{value:s.prompt.verificationUriComplete,size:196})}),l(r,{style:e.body,children:["Or go to"," ",t(r,{style:e.strong,children:W(s.prompt.verificationUri)})," ","and type:"]}),t(r,{style:e.code,selectable:true,testID:"buoy-signin-code",children:s.prompt.userCode}),l(a,{style:e.waiting,children:[t(k,{size:"small",color:o.color.textSecondary}),t(r,{style:e.muted,children:"Waiting for you to allow it\u2026"})]})]}):null,s.kind==="error"?l(z,{children:[t(r,{style:e.body,testID:"buoy-signin-error",children:s.message}),t(g,{accessibilityRole:"button",onPress:C,style:({pressed:f})=>[e.primary,f&&e.primaryPressed],testID:"buoy-signin-retry",children:t(r,{style:e.primaryText,children:"Get a new code"})})]}):null,d]})}export function BuoyNeedsPlanCard({onClose:n}){return l(a,{style:e.card,testID:"buoy-signin-needs-plan",children:[t(w,{onClose:n}),t(r,{style:e.title,children:"You're signed in"}),t(r,{style:e.body,children:"Buoy in this build needs a Pro or Business plan."}),t(g,{accessibilityRole:"button",onPress:()=>void I()?.signOut(),style:({pressed:i})=>[e.primary,i&&e.primaryPressed],testID:"buoy-signout",children:t(r,{style:e.primaryText,children:"Sign out"})})]})}function U({onClose:n}){const[i,d]=m(false);const[s,c]=m(null);const y=x(true);S(()=>()=>{y.current=false},[]);const b=P(async()=>{d(true);c(null);try{await A()}catch{}if(!y.current)return;d(false);if(v())n();else c("Still on Free. If you just paid, wait a minute and try again.")},[n]);return l(a,{style:e.card,testID:"buoy-get-pro",children:[t(w,{onClose:n}),t(r,{style:e.title,children:"Get Buoy Pro"}),t(r,{style:e.body,children:"This needs Pro. Scan to see the plans."}),t(a,{style:e.qr,testID:"buoy-get-pro-qr",children:t(D,{value:R,size:196})}),l(r,{style:e.body,children:["Or go to ",t(r,{style:e.strong,children:W(R)})]}),t(g,{accessibilityRole:"link",onPress:()=>F(),style:({pressed:u})=>[e.primary,u&&e.primaryPressed],testID:"buoy-get-pro-open",children:t(r,{style:e.primaryText,children:"Open buoy.gg"})}),t(g,{accessibilityRole:"button",accessibilityState:{disabled:i,busy:i},disabled:i,onPress:b,style:({pressed:u})=>[e.secondary,u&&e.secondaryPressed],testID:"buoy-get-pro-check",children:i?t(k,{size:"small",color:o.color.textSecondary}):t(r,{style:e.secondaryText,children:"I have Pro. Check again."})}),s?t(r,{accessibilityRole:"alert",style:e.note,children:s}):null]})}export function BuoyUpgradeSheet({visible:n,onClose:i}){const d=useSignInState();const[s,c]=m(false);S(()=>{if(!n)c(false)},[n]);if(!n)return null;const y=s||H||d==="active";return t(j,{visible:true,transparent:true,animationType:"fade",onRequestClose:i,children:l(a,{style:e.overlay,accessibilityViewIsModal:true,children:[t(g,{style:T.absoluteFill,onPress:i,accessible:false}),y?t(U,{onClose:i}):t(BuoySignInCard,{onClose:i,onNotConfigured:()=>c(true),footer:t(g,{accessibilityRole:"button",onPress:()=>c(true),style:e.footerLink,testID:"buoy-signin-see-plans",children:l(r,{style:e.muted,children:["No Pro plan yet? ",t(r,{style:e.link,children:"See plans"})]})})})]})})}const e=T.create({overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20},card:{width:"100%",maxWidth:368,backgroundColor:"#111315",borderColor:"#303437",borderWidth:1,borderRadius:20,paddingHorizontal:24,paddingTop:18,paddingBottom:24},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:16},brand:{flexDirection:"row",alignItems:"center",gap:8},brandDot:{width:6,height:6,borderRadius:3,backgroundColor:o.color.accent},wordmark:{color:o.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.4,lineHeight:16},close:{width:28,height:28,borderRadius:8,alignItems:"center",justifyContent:"center"},closeText:{color:o.color.textSecondary,fontSize:14},title:{color:o.color.text,fontSize:20,fontWeight:"700",marginBottom:8},body:{color:o.color.textSecondary,fontSize:14,lineHeight:20,marginTop:8},strong:{color:o.color.text,fontWeight:"600"},muted:{color:o.color.textSecondary,fontSize:13},link:{color:o.color.accent,fontWeight:"600"},note:{color:o.color.textSecondary,fontSize:13,lineHeight:18,marginTop:12,textAlign:"center"},center:{paddingVertical:32,alignItems:"center"},qr:{alignSelf:"center",marginTop:16,marginBottom:8,borderRadius:12,overflow:"hidden"},code:{color:o.color.text,fontFamily:B,fontSize:30,fontWeight:"700",letterSpacing:4,textAlign:"center",marginTop:12},waiting:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,marginTop:16},footerLink:{alignItems:"center",marginTop:20,minHeight:32,justifyContent:"center"},primary:{marginTop:20,minHeight:44,borderRadius:12,backgroundColor:o.color.accent,alignItems:"center",justifyContent:"center"},primaryPressed:{backgroundColor:o.color.accentPressed},primaryText:{color:o.color.onAccent,fontSize:15,fontWeight:"600"},secondary:{marginTop:10,minHeight:44,borderRadius:12,borderWidth:1,borderColor:"#303437",alignItems:"center",justifyContent:"center"},secondaryPressed:{backgroundColor:"#1A1D1F"},secondaryText:{color:o.color.text,fontSize:15,fontWeight:"600"}});
1
+ "use strict";import{useCallback as P,useEffect as S,useRef as x,useState as m}from"react";import{ActivityIndicator as k,Modal as B,Pressable as g,StyleSheet as T,Text as r,View as a}from"react-native";import{monoFont as j}from"../ui/fonts.js";import{night as o}from"../ui/night/nightTheme.js";import{QrCodeView as D}from"../ui/qr/QrCodeView.js";import{getSignInSession as I,isProNow as v,retryAccountAccess as A}from"./licenseModule.js";import{PRICING_URL as R,isWeb as H,openPricing as F}from"./openPricing.js";import{jsx as t,jsxs as l,Fragment as z}from"react/jsx-runtime";const W=n=>n.replace(/^https?:\/\//,"");export function useSignInState(){const[n,i]=m(()=>I()?.getStatus().state??"signed_out");S(()=>{const d=I();if(!d)return;const s=()=>i(d.getStatus().state);s();return d.subscribe(s)},[]);return n}function w({onClose:n}){return l(a,{style:e.header,children:[l(a,{style:e.brand,children:[t(a,{style:e.brandDot}),t(r,{style:e.wordmark,children:"BUOY"})]}),t(g,{accessibilityRole:"button",accessibilityLabel:"Close sign-in",onPress:n,style:e.close,testID:"buoy-signin-close",children:t(r,{style:e.closeText,children:"\u2715"})})]})}export function BuoySignInCard({onClose:n,onNotConfigured:i,footer:d}){const[s,c]=m({kind:"starting"});const y=x(null);const b=x(n);const u=x(i);b.current=n;u.current=i;const C=P(()=>{y.current?.abort();const f=I();if(!f?.signInWithCode){if(u.current)return u.current();c({kind:"error",message:"This version of @buoy-gg/license can't sign in with a code. Update it."});return}const p=new AbortController;y.current=p;c({kind:"starting"});f.signInWithCode(h=>c({kind:"waiting",prompt:h}),{signal:p.signal}).then(()=>{if(!p.signal.aborted)b.current()}).catch(h=>{if(p.signal.aborted)return;if(h?.code==="not_configured"&&u.current){u.current();return}c({kind:"error",message:h instanceof Error?h.message:"Sign-in did not work. Try again."})})},[]);S(()=>{C();return()=>y.current?.abort()},[C]);return l(a,{style:e.card,testID:"buoy-code-signin",children:[t(w,{onClose:n}),t(r,{style:e.title,children:"Sign in to Buoy"}),s.kind==="starting"?t(a,{style:e.center,children:t(k,{color:o.color.accent})}):null,s.kind==="waiting"?l(z,{children:[t(r,{style:e.body,children:"Scan this with your phone's camera."}),t(a,{style:e.qr,testID:"buoy-signin-qr",children:t(D,{value:s.prompt.verificationUriComplete,size:196})}),l(r,{style:e.body,children:["Or go to"," ",t(r,{style:e.strong,children:W(s.prompt.verificationUri)})," ","and type:"]}),t(r,{style:e.code,selectable:true,testID:"buoy-signin-code",children:s.prompt.userCode}),l(a,{style:e.waiting,children:[t(k,{size:"small",color:o.color.textSecondary}),t(r,{style:e.muted,children:"Waiting for you to allow it\u2026"})]})]}):null,s.kind==="error"?l(z,{children:[t(r,{style:e.body,testID:"buoy-signin-error",children:s.message}),t(g,{accessibilityRole:"button",onPress:C,style:({pressed:f})=>[e.primary,f&&e.primaryPressed],testID:"buoy-signin-retry",children:t(r,{style:e.primaryText,children:"Get a new code"})})]}):null,d]})}export function BuoyNeedsPlanCard({onClose:n}){return l(a,{style:e.card,testID:"buoy-signin-needs-plan",children:[t(w,{onClose:n}),t(r,{style:e.title,children:"You're signed in"}),t(r,{style:e.body,children:"Buoy in this build needs a Pro or Business plan."}),t(g,{accessibilityRole:"button",onPress:()=>void I()?.signOut(),style:({pressed:i})=>[e.primary,i&&e.primaryPressed],testID:"buoy-signout",children:t(r,{style:e.primaryText,children:"Sign out"})})]})}export function BuoyGetProCard({onClose:n}){const[i,d]=m(false);const[s,c]=m(null);const y=x(true);S(()=>()=>{y.current=false},[]);const b=P(async()=>{d(true);c(null);try{await A()}catch{}if(!y.current)return;d(false);if(v())n();else c("Still on Free. If you just paid, wait a minute and try again.")},[n]);return l(a,{style:e.card,testID:"buoy-get-pro",children:[t(w,{onClose:n}),t(r,{style:e.title,children:"Get Buoy Pro"}),t(r,{style:e.body,children:"This needs Pro. Scan to see the plans."}),t(a,{style:e.qr,testID:"buoy-get-pro-qr",children:t(D,{value:R,size:196})}),l(r,{style:e.body,children:["Or go to ",t(r,{style:e.strong,children:W(R)})]}),t(g,{accessibilityRole:"link",onPress:()=>F(),style:({pressed:u})=>[e.primary,u&&e.primaryPressed],testID:"buoy-get-pro-open",children:t(r,{style:e.primaryText,children:"Open buoy.gg"})}),t(g,{accessibilityRole:"button",accessibilityState:{disabled:i,busy:i},disabled:i,onPress:b,style:({pressed:u})=>[e.secondary,u&&e.secondaryPressed],testID:"buoy-get-pro-check",children:i?t(k,{size:"small",color:o.color.textSecondary}):t(r,{style:e.secondaryText,children:"I have Pro. Check again."})}),s?t(r,{accessibilityRole:"alert",style:e.note,children:s}):null]})}export function BuoyUpgradeSheet({visible:n,onClose:i}){const d=useSignInState();const[s,c]=m(false);S(()=>{if(!n)c(false)},[n]);if(!n)return null;const y=s||H||d==="active";return t(B,{visible:true,transparent:true,animationType:"fade",onRequestClose:i,children:l(a,{style:e.overlay,accessibilityViewIsModal:true,children:[t(g,{style:T.absoluteFill,onPress:i,accessible:false}),y?t(BuoyGetProCard,{onClose:i}):t(BuoySignInCard,{onClose:i,onNotConfigured:()=>c(true),footer:t(g,{accessibilityRole:"button",onPress:()=>c(true),style:e.footerLink,testID:"buoy-signin-see-plans",children:l(r,{style:e.muted,children:["No Pro plan yet? ",t(r,{style:e.link,children:"See plans"})]})})})]})})}const e=T.create({overlay:{flex:1,backgroundColor:"rgba(0, 0, 0, 0.65)",alignItems:"center",justifyContent:"center",padding:20},card:{width:"100%",maxWidth:368,backgroundColor:"#111315",borderColor:"#303437",borderWidth:1,borderRadius:20,paddingHorizontal:24,paddingTop:18,paddingBottom:24},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:16},brand:{flexDirection:"row",alignItems:"center",gap:8},brandDot:{width:6,height:6,borderRadius:3,backgroundColor:o.color.accent},wordmark:{color:o.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.4,lineHeight:16},close:{width:28,height:28,borderRadius:8,alignItems:"center",justifyContent:"center"},closeText:{color:o.color.textSecondary,fontSize:14},title:{color:o.color.text,fontSize:20,fontWeight:"700",marginBottom:8},body:{color:o.color.textSecondary,fontSize:14,lineHeight:20,marginTop:8},strong:{color:o.color.text,fontWeight:"600"},muted:{color:o.color.textSecondary,fontSize:13},link:{color:o.color.accent,fontWeight:"600"},note:{color:o.color.textSecondary,fontSize:13,lineHeight:18,marginTop:12,textAlign:"center"},center:{paddingVertical:32,alignItems:"center"},qr:{alignSelf:"center",marginTop:16,marginBottom:8,borderRadius:12,overflow:"hidden"},code:{color:o.color.text,fontFamily:j,fontSize:30,fontWeight:"700",letterSpacing:4,textAlign:"center",marginTop:12},waiting:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:8,marginTop:16},footerLink:{alignItems:"center",marginTop:20,minHeight:32,justifyContent:"center"},primary:{marginTop:20,minHeight:44,borderRadius:12,backgroundColor:o.color.accent,alignItems:"center",justifyContent:"center"},primaryPressed:{backgroundColor:o.color.accentPressed},primaryText:{color:o.color.onAccent,fontSize:15,fontWeight:"600"},secondary:{marginTop:10,minHeight:44,borderRadius:12,borderWidth:1,borderColor:"#303437",alignItems:"center",justifyContent:"center"},secondaryPressed:{backgroundColor:"#1A1D1F"},secondaryText:{color:o.color.text,fontSize:15,fontWeight:"600"}});
@@ -1 +1 @@
1
- "use strict";export{FeatureGate,UpgradePrompt,useFeatureGate,ProFeatureBanner,UpgradeModal,ProBadge,ProUpgradeModal}from"./FeatureGate.js";export{BuoyUpgradeSheet,BuoySignInCard,BuoyNeedsPlanCard,useSignInState}from"./BuoyUpgradeSheet.js";export{FreeAccountPrompt,LOGIN_COMMAND}from"./FreeAccountPrompt.js";export{getUseIsPro,getUseLicense,getUseTier,signOutOfBuoy}from"./licenseModule.js";export{TIER_LIMITS,useLimit,resolveEffectiveTier}from"./tierLimits.js";
1
+ "use strict";export{FeatureGate,UpgradePrompt,useFeatureGate,ProFeatureBanner,UpgradeModal,ProBadge,ProUpgradeModal}from"./FeatureGate.js";export{BuoyUpgradeSheet,BuoySignInCard,BuoyNeedsPlanCard,BuoyGetProCard,useSignInState}from"./BuoyUpgradeSheet.js";export{FreeAccountPrompt,LOGIN_COMMAND}from"./FreeAccountPrompt.js";export{getUseIsPro,getUseLicense,getUseTier,signOutOfBuoy}from"./licenseModule.js";export{TIER_LIMITS,useLimit,resolveEffectiveTier}from"./tierLimits.js";
@@ -1 +1 @@
1
- "use strict";const d=e=>typeof e==="object"&&e!==null&&!Array.isArray(e);const m=["id","lineId","key","uuid","_id","slug","name"];export function identityField(e){if(!e.length||!e.every(d))return void 0;const i=e[0];for(const t of m){if(!(t in i))continue;const r=e.map(o=>o[t]);const n=r.every(o=>typeof o==="string"||typeof o==="number");if(!n)continue;if(new Set(r.map(String)).size!==r.length)continue;return t}return void 0}function $(e,i,t,r){const n=r[i];if(typeof n==="string"||typeof n==="number"){if(String(n)!==t){return{ok:false,error:`The new item is addressed as \`${t}\` but carries \`${i}\`: ${JSON.stringify(n)}. Use the same value for both \u2014 address it by the id it carries.`}}return{ok:true,value:n}}const o=e.every(s=>typeof s[i]==="number");if(o&&t.trim()!==""&&String(Number(t))===t){return{ok:true,value:Number(t)}}return{ok:true,value:t}}export function expandKeyedArrays(e,i,t="",r=[]){if(Array.isArray(e)&&d(i)){const n=identityField(e);if(!n){return{patch:i,notes:r}}const o=new Map(e.map(f=>[String(f[n]),f]));const s=e.slice();let y=0;let c=0;let b=0;for(const[f,a]of Object.entries(i)){const l=s.findIndex(u=>String(u[n])===f);if(a===null){if(l===-1)return{patch:i,notes:r};s.splice(l,1);y++}else if(l===-1){if(!d(a))return{patch:i,notes:r};const u=$(e,n,f,a);if(!u.ok){return{patch:i,notes:r,error:u.error}}s.push({...a,[n]:u.value});b++}else{const u=expandKeyedArrays(o.get(f),a,`${t}[${f}]`,r);if(u.error)return{patch:i,notes:r,error:u.error};const g=s[l];s[l]=d(g)&&d(u.patch)?{...g,...u.patch}:u.patch;c++}}r.push(`${t||"(root)"}: addressed by \`${n}\` \u2014 ${c} changed, ${b} added, ${y} removed, ${s.length} item(s) remain`);return{patch:s,notes:r}}if(d(e)&&d(i)){const n={};for(const[o,s]of Object.entries(i)){const y=t?`${t}.${o}`:o;if(!(o in e)){n[o]=s;continue}const c=expandKeyedArrays(e[o],s,y,r);if(c.error)return{patch:i,notes:r,error:c.error};n[o]=c.patch}return{patch:n,notes:r}}return{patch:i,notes:r}}
1
+ "use strict";const c=e=>typeof e==="object"&&e!==null&&!Array.isArray(e);const $=["id","lineId","key","uuid","_id","slug","name"];export function identityField(e,r=[]){if(!e.length||!e.every(c))return void 0;const i=e[0];const t=[...$,...Object.keys(i).filter(o=>/(Id|_id|ID)$/.test(o))];const s=t.filter((o,d)=>{if(t.indexOf(o)!==d||!(o in i))return false;const f=e.map(a=>a[o]);if(!f.every(a=>typeof a==="string"||typeof a==="number"))return false;return new Set(f.map(String)).size===f.length});const n=o=>e.some(d=>r.includes(String(d[o])));return s.find(n)??s[0]}function p(e,r,i,t){const s=t[r];if(typeof s==="string"||typeof s==="number"){if(String(s)!==i){return{ok:false,error:`The new item is addressed as \`${i}\` but carries \`${r}\`: ${JSON.stringify(s)}. Use the same value for both \u2014 address it by the id it carries.`}}return{ok:true,value:s}}const n=e.every(o=>typeof o[r]==="number");if(n&&i.trim()!==""&&String(Number(i))===i){return{ok:true,value:Number(i)}}return{ok:true,value:i}}export function expandKeyedArrays(e,r,i="",t=[]){if(Array.isArray(e)&&c(r)){const s=Object.keys(r);const n=identityField(e,s);if(!n){if(!s.length)return{patch:r,notes:t};const l=i||"(root)";return{patch:r,notes:t,error:`\`${l}\` is a list whose items have no unique id field, so the key \`${s[0]}\` can't name a row. Address the row by its position instead, with a path like \`${i}[0].field\`.`}}const o=new Map(e.map(l=>[String(l[n]),l]));const d=e.slice();let f=0;let a=0;let g=0;for(const[l,y]of Object.entries(r)){const b=d.findIndex(u=>String(u[n])===l);if(y===null){if(b===-1)return{patch:r,notes:t};d.splice(b,1);f++}else if(b===-1){if(!c(y))return{patch:r,notes:t};const u=p(e,n,l,y);if(!u.ok){return{patch:r,notes:t,error:u.error}}d.push({...y,[n]:u.value});g++}else{const u=expandKeyedArrays(o.get(l),y,`${i}[${l}]`,t);if(u.error)return{patch:r,notes:t,error:u.error};const m=d[b];d[b]=c(m)&&c(u.patch)?{...m,...u.patch}:u.patch;a++}}t.push(`${i||"(root)"}: addressed by \`${n}\` \u2014 ${a} changed, ${g} added, ${f} removed, ${d.length} item(s) remain`);return{patch:d,notes:t}}if(c(e)&&c(r)){const s={};for(const[n,o]of Object.entries(r)){const d=i?`${i}.${n}`:n;if(!(n in e)){s[n]=o;continue}const f=expandKeyedArrays(e[n],o,d,t);if(f.error)return{patch:r,notes:t,error:f.error};s[n]=f.patch}return{patch:s,notes:t}}return{patch:r,notes:t}}
@@ -1 +1 @@
1
- "use strict";import{identityField as A}from"./keyedArrays.js";const u=r=>typeof r==="object"&&r!==null&&!Array.isArray(r);function w(r,o,n=2e3){const e=[{node:r,path:""}];let d=0;while(e.length&&d<n){const{node:i,path:t}=e.shift();d++;if(Array.isArray(i)){i.slice(0,20).forEach((s,l)=>e.push({node:s,path:`${t}[${l}]`}))}else if(u(i)){for(const[s,l]of Object.entries(i)){const f=t?`${t}.${s}`:s;if(s===o)return f;if(u(l)||Array.isArray(l))e.push({node:l,path:f})}}}return void 0}function m(r,o,n,e,d){const i=w(r,d??n);const t=e.slice(0,12).join(", ")||"(no fields)";return i?`No field "${n}" at "${o}" \u2014 did you mean path "${i}"? "${o}" has: ${t}.`:`No field "${n}" at "${o}". It has: ${t}.`}function x(r,o){let n=r;for(const e of o.split(".")){if(!u(n))return void 0;n=n[e]}return n}export function parsePath(r){if(!r.trim())return void 0;const o=[];let n=0;while(n<r.length){if(r[n]==="."){n++;continue}if(r[n]==="["){const i=r.indexOf("]",n);if(i===-1)return void 0;const t=r.slice(n+1,i);if(/^\d+$/.test(t))o.push({kind:"index",index:Number(t)});else{const s=t.indexOf("=");if(s<=0)return void 0;o.push({kind:"match",field:t.slice(0,s).trim(),value:t.slice(s+1).trim()})}n=i+1;continue}let e=n;while(e<r.length&&r[e]!=="."&&r[e]!=="[")e++;const d=r.slice(n,e);if(!d)return void 0;o.push({kind:"key",key:d});n=e}return o.length?o:void 0}export function readPath(r,o){const n=parsePath(o);if(!n)return{ok:false,error:`Could not read the path "${o}". Use dotted keys with optional [0] or [field=value], like "item.name" or "lines[lineId=seed-1].qty".`};let e=r;const d=[];for(const i of n){if(e===null||e===void 0){return{ok:false,error:`"${d.join(".")||"(root)"}" is ${e===null?"null":"not set"}, so there is nothing at "${o}".`}}if(i.kind==="key"){if(!u(e))return{ok:false,error:`"${d.join(".")||"(root)"}" is not an object, so it has no field "${i.key}".`};if(!(i.key in e)){const t=n[n.length-1];return{ok:false,error:m(r,d.join(".")||"(root)",i.key,Object.keys(e),t?.kind==="key"?t.key:void 0)}}e=e[i.key];d.push(i.key)}else if(i.kind==="index"){if(!Array.isArray(e))return{ok:false,error:`"${d.join(".")||"(root)"}" is not a list, so [${i.index}] means nothing.`};e=e[i.index];d.push(`[${i.index}]`)}else{if(!Array.isArray(e))return{ok:false,error:`"${d.join(".")||"(root)"}" is not a list, so [${i.field}=${i.value}] means nothing.`};const t=e.find(s=>u(s)&&String(x(s,i.field))===i.value);if(t===void 0)return{ok:false,error:`No item with ${i.field}="${i.value}" in "${d.join(".")||"(root)"}".`};e=t;d.push(`[${i.field}=${i.value}]`)}}return{ok:true,value:e}}export function patchFromPath(r,o,n){const e=parsePath(o);if(!e)return{ok:false,error:`Could not read the path "${o}". Use dotted keys with optional [0] or [field=value], like "item.name" or "lines[lineId=seed-1].qty".`};if(e[0]?.kind!=="key")return{ok:false,error:`A path must start with a field name, not a list index \u2014 "${o}" does not say which list.`};const d=(t,s)=>{if(s>=e.length)return{ok:true,patch:n};const l=e[s];if(l.kind==="key"){if(u(t)&&!(l.key in t)&&s+1<e.length){const g=e[e.length-1];return{ok:false,error:m(r,k(e,s),l.key,Object.keys(t),g?.kind==="key"?g.key:void 0)}}const a=u(t)?t[l.key]:void 0;const $=d(a,s+1);return $.ok?{ok:true,patch:{[l.key]:$.patch}}:$}if(!Array.isArray(t)){return{ok:false,error:`"${k(e,s)}" is not a list, so "${o}" cannot be resolved. Read it first \u2014 \`shape\` on the read says what each field holds.`}}const f=l.kind==="index"?l.index:t.findIndex(a=>u(a)&&String(x(a,l.field))===l.value);const c=f>=0?t[f]:void 0;const j=l.kind==="index"?f<0||f>=t.length:f<0;if(j){return{ok:false,error:l.kind==="index"?`"${k(e,s)}" has ${t.length} item(s), so there is nothing at [${l.index}].`:`No item with ${l.field}="${l.value}" in "${k(e,s)}".`}}if(!u(c)){if(s<e.length-1){return{ok:false,error:`"${k(e,s)}[${l.kind==="index"?l.index:`${l.field}=${l.value}`}]" holds ${c===null?"null":typeof c}, not an object, so "${o}" cannot go any deeper. Set the item itself.`}}const a=t.slice();a[f]=n;return{ok:true,patch:a}}const h=d(c,s+1);if(!h.ok)return h;const y=A(t);if(y)return{ok:true,patch:{[String(c[y])]:h.patch}};const p=t.slice();p[f]=u(h.patch)?{...c,...h.patch}:h.patch;return{ok:true,patch:p}};const i=d(r,0);if(!i.ok)return i;return{ok:true,patch:i.patch}}function k(r,o){return r.slice(0,o).map(n=>n.kind==="key"?n.key:n.kind==="index"?`[${n.index}]`:`[${n.field}=${n.value}]`).join(".").replace(/\.\[/g,"[")||"(root)"}
1
+ "use strict";import{identityField as b}from"./keyedArrays.js";const c=r=>typeof r==="object"&&r!==null&&!Array.isArray(r);function w(r,s,n=2e3){const e=[{node:r,path:""}];let f=0;while(e.length&&f<n){const{node:i,path:d}=e.shift();f++;if(Array.isArray(i)){i.slice(0,20).forEach((t,l)=>e.push({node:t,path:`${d}[${l}]`}))}else if(c(i)){for(const[t,l]of Object.entries(i)){const o=d?`${d}.${t}`:t;if(t===s)return o;if(c(l)||Array.isArray(l))e.push({node:l,path:o})}}}return void 0}function A(r,s,n,e,f){const i=w(r,f??n);const d=e.slice(0,12).join(", ")||"(no fields)";return i?`No field "${n}" at "${s}" \u2014 did you mean path "${i}"? "${s}" has: ${d}.`:`No field "${n}" at "${s}". It has: ${d}.`}function p(r,s){let n=r;for(const e of s.split(".")){if(!c(n))return void 0;n=n[e]}return n}export function parsePath(r){if(!r.trim())return void 0;const s=[];let n=0;while(n<r.length){if(r[n]==="."){n++;continue}if(r[n]==="["){const i=r.indexOf("]",n);if(i===-1)return void 0;const d=r.slice(n+1,i);if(/^\d+$/.test(d))s.push({kind:"index",index:Number(d)});else{const t=d.indexOf("=");if(t<=0)return void 0;s.push({kind:"match",field:d.slice(0,t).trim(),value:d.slice(t+1).trim()})}n=i+1;continue}let e=n;while(e<r.length&&r[e]!=="."&&r[e]!=="[")e++;const f=r.slice(n,e);if(!f)return void 0;s.push({kind:"key",key:f});n=e}return s.length?s:void 0}export function readPath(r,s){const n=parsePath(s);if(!n)return{ok:false,error:`Could not read the path "${s}". Use dotted keys with optional [0] or [field=value], like "item.name" or "lines[lineId=seed-1].qty".`};let e=r;const f=[];for(const i of n){if(e===null||e===void 0){return{ok:false,error:`"${f.join(".")||"(root)"}" is ${e===null?"null":"not set"}, so there is nothing at "${s}".`}}if(i.kind==="key"){if(!c(e))return{ok:false,error:`"${f.join(".")||"(root)"}" is not an object, so it has no field "${i.key}".`};if(!(i.key in e)){const d=n[n.length-1];return{ok:false,error:A(r,f.join(".")||"(root)",i.key,Object.keys(e),d?.kind==="key"?d.key:void 0)}}e=e[i.key];f.push(i.key)}else if(i.kind==="index"){if(!Array.isArray(e))return{ok:false,error:`"${f.join(".")||"(root)"}" is not a list, so [${i.index}] means nothing.`};e=e[i.index];f.push(`[${i.index}]`)}else{if(!Array.isArray(e))return{ok:false,error:`"${f.join(".")||"(root)"}" is not a list, so [${i.field}=${i.value}] means nothing.`};const d=e.find(t=>c(t)&&String(p(t,i.field))===i.value);if(d===void 0)return{ok:false,error:`No item with ${i.field}="${i.value}" in "${f.join(".")||"(root)"}".`};e=d;f.push(`[${i.field}=${i.value}]`)}}return{ok:true,value:e}}export function patchFromPath(r,s,n){const e=parsePath(s);if(!e)return{ok:false,error:`Could not read the path "${s}". Use dotted keys with optional [0] or [field=value], like "item.name" or "lines[lineId=seed-1].qty".`};if(e[0]?.kind!=="key"&&!Array.isArray(r))return{ok:false,error:`A path must start with a field name, not a list index \u2014 "${s}" does not say which list.`};const f=(t,l)=>{if(l>=e.length)return{ok:true,patch:n};const o=e[l];if(o.kind==="key"){if(c(t)&&!(o.key in t)&&l+1<e.length){const j=e[e.length-1];return{ok:false,error:A(r,y(e,l),o.key,Object.keys(t),j?.kind==="key"?j.key:void 0)}}const h=c(t)?t[o.key]:void 0;const g=f(h,l+1);return g.ok?{ok:true,patch:{[o.key]:g.patch}}:g}if(!Array.isArray(t)){return{ok:false,error:`"${y(e,l)}" is not a list, so "${s}" cannot be resolved. Read it first \u2014 \`shape\` on the read says what each field holds.`}}const u=o.kind==="index"?o.index:t.findIndex(h=>c(h)&&String(p(h,o.field))===o.value);const a=u>=0?t[u]:void 0;const $=o.kind==="index"?u<0||u>=t.length:u<0;if($){return{ok:false,error:o.kind==="index"?`"${y(e,l)}" has ${t.length} item(s), so there is nothing at [${o.index}].`:`No item with ${o.field}="${o.value}" in "${y(e,l)}".`}}if(!c(a)){if(l<e.length-1){return{ok:false,error:`"${y(e,l)}[${o.kind==="index"?o.index:`${o.field}=${o.value}`}]" holds ${a===null?"null":typeof a}, not an object, so "${s}" cannot go any deeper. Set the item itself.`}}const h=t.slice();h[u]=n;return{ok:true,patch:h}}const k=f(a,l+1);if(!k.ok)return k;const x=b(t);if(x)return{ok:true,patch:{[String(a[x])]:k.patch}};const m=t.slice();m[u]=i(a,l+1);return{ok:true,patch:m}};const i=(t,l)=>{if(l>=e.length)return n;const o=e[l];if(o.kind==="key"){const k=c(t)?t:{};return{...k,[o.key]:i(k[o.key],l+1)}}const u=t;const a=o.kind==="index"?o.index:u.findIndex(k=>c(k)&&String(p(k,o.field))===o.value);const $=u.slice();$[a]=i(u[a],l+1);return $};const d=f(r,0);if(!d.ok)return d;return{ok:true,patch:d.patch}}function y(r,s){return r.slice(0,s).map(n=>n.kind==="key"?n.key:n.kind==="index"?`[${n.index}]`:`[${n.field}=${n.value}]`).join(".").replace(/\.\[/g,"[")||"(root)"}
@@ -1 +1 @@
1
- "use strict";import{View as c,Text as a,TouchableOpacity as F,StyleSheet as U,ScrollView as w}from"react-native";import{useEffect as X,useState as Y}from"react";import{Filter as A,Plus as v,Copy as J,Eye as Q,Info as ee}from"../../icons/index.js";import{SectionHeader as d}from"./SectionHeader.js";import{FilterList as H,AddFilterInput as W,AddFilterButton as E}from"./FilterComponents.js";import{useFilterManager as R}from"../../hooks/useFilterManager.js";import{buoyColors as i}from"../gameUI/constants/gameUIColors.js";import{night as o}from"../night/nightTheme.js";import{monoFont as f}from"../fonts.js";import{jsx as e,jsxs as n,Fragment as D}from"react/jsx-runtime";export function DynamicFilterView({sections:k=[],filterSummarySection:m,addFilterSection:T,includeOnlySection:s,availableItemsSection:x,howItWorksSection:g,previewSection:b,onFilterChange:L,onPatternToggle:V,onPatternAdd:z,activePatterns:h=new Set,renderPatternMeta:P,tabs:y,activeTab:j,onTabChange:B}){const u=R(h);const p=R(s?.patterns||new Set);const[K,M]=Y(y?.[0]?.id||"");const C=j||K;X(()=>{if(h.size!==u.filters.size||!Array.from(h).every(t=>u.filters.has(t))){}},[h,u.filters]);const N=()=>{if(u.newFilter.trim()&&z){z(u.newFilter.trim());u.addFilter(u.newFilter)}};const O=()=>{if(p.newFilter.trim()&&s?.onPatternAdd){s.onPatternAdd(p.newFilter.trim());p.addFilter(p.newFilter)}};const I=x?.items?.filter(t=>{return!Array.from(h).some(l=>t.includes(l))})||[];const $=()=>{if(!y||y.length===0)return null;return e(c,{style:r.tabContainer,children:y.map(t=>n(F,{onPress:()=>{if(B)B(t.id);else M(t.id)},style:[r.tabButton,C===t.id?r.tabButtonActive:r.tabButtonInactive],children:[t.icon&&e(t.icon,{size:14,color:C===t.id?i.primary:o.color.textTertiary}),e(a,{style:[r.tabButtonText,C===t.id?r.tabButtonTextActive:r.tabButtonTextInactive],children:t.label}),t.count!==void 0&&t.count>0&&e(c,{style:r.tabBadge,children:e(a,{style:r.tabBadgeText,children:t.count})})]},t.id))})};const Z=t=>{if(t.type==="custom"&&t.renderCustom){return t.renderCustom()}if(t.type==="patterns"){return null}if(!t.data||t.data.length===0)return null;return n(c,{style:r.section,children:[n(d,{children:[t.icon&&e(d.Icon,{icon:t.icon,color:t.color||i.primary,size:12}),e(d.Title,{children:t.title})]}),t.description&&e(a,{style:r.sectionDescription,children:t.description}),e(c,{style:r.filterGrid,children:t.data.map(l=>{const S=l.count!==void 0;const q=S&&l.count===0;const G=t.type!=="method"||l.icon;return n(F,{testID:`buoy-filter-option-${l.id}`,accessibilityRole:"button",accessibilityLabel:String(l.label??l.id),style:[r.filterCard,l.isActive&&r.activeFilterCard],onPress:()=>L?.(l.id,l.value),children:[l.icon?e(l.icon,{size:24,color:l.color,style:r.filterIcon}):t.type==="method"?e(c,{style:[r.methodBadgeCompact,{backgroundColor:`${l.color}20`}],children:e(a,{style:[r.methodTextCompact,{color:l.color}],numberOfLines:1,adjustsFontSizeToFit:true,minimumFontScale:.8,children:l.label})}):null,S&&e(a,{style:[q?r.filterCountZero:r.filterCountActive],children:l.count}),G&&e(a,{style:r.filterLabelCompact,children:l.label}),l.description&&e(a,{style:r.filterDescriptionBottom,children:l.description})]},l.id)})})]},t.id)};const _=()=>{if(y&&C){const t=y.find(l=>l.id===C);if(t?.content){return t.content()}}return n(D,{children:[m?.enabled&&(m.includePatterns?.size||m.excludePatterns?.size)?n(c,{style:r.filterSummarySection,children:[n(c,{style:r.filterSummaryHeader,children:[e(ee,{size:14,color:i.warning}),e(a,{style:r.filterSummaryTitle,children:"Filters Active"})]}),n(a,{style:r.filterSummaryText,children:["Showing ",m.filteredCount," of ",m.totalCount," queries",m.includePatterns?.size?n(a,{style:r.filterSummaryInclude,children:[" ","\u2022 Including: ",Array.from(m.includePatterns).join(", ")]}):null,m.excludePatterns?.size?n(a,{style:r.filterSummaryExclude,children:[" ","\u2022 Excluding: ",Array.from(m.excludePatterns).join(", ")]}):null]})]}):null,k.map(Z),s?.enabled&&n(c,{style:r.includeOnlySection,children:[n(d,{children:[e(d.Icon,{icon:s.icon||Q,color:i.success,size:12}),e(d.Title,{children:s.title||"INCLUDE ONLY FILTERS"}),s.patterns.size>0&&e(d.Badge,{count:s.patterns.size,color:i.success})]}),s.description&&e(a,{style:r.includeOnlyDescription,children:s.description}),e(c,{style:r.includeOnlyInputWrapper,children:!p.showAddInput?e(E,{onPress:()=>p.setShowAddInput(true),color:i.success,label:"Add include pattern",testID:"buoy-filter-include-add-open"}):e(W,{value:p.newFilter,onChange:p.setNewFilter,onSubmit:O,onCancel:()=>{p.setShowAddInput(false);p.setNewFilter("")},placeholder:s.placeholder||"Enter pattern to include...",color:i.success,testID:"buoy-filter-include-input"})}),s.patterns.size>0&&e(w,{keyboardShouldPersistTaps:"handled",testID:"buoy-filter-include-scroll",style:r.includeOnlyFiltersContent,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,children:e(H,{filters:s.patterns,onRemoveFilter:s.onPatternToggle,color:i.success,renderItemMeta:s.renderPatternMeta})})]}),T?.enabled&&n(c,{style:r.excludeFiltersSection,children:[n(d,{children:[e(d.Icon,{icon:A,color:i.primary,size:12}),e(d.Title,{children:T.title||"EXCLUDE FILTERS"}),h.size>0&&e(d.Badge,{count:h.size,color:i.primary})]}),e(a,{style:r.excludeFiltersDescription,children:"Hide queries matching these patterns from the list."}),e(c,{style:r.excludeFiltersInputWrapper,children:!u.showAddInput?e(E,{onPress:()=>u.setShowAddInput(true),color:i.primary,label:"Add exclude pattern"}):n(D,{children:[T.renderExtra?.(),e(W,{value:u.newFilter,onChange:u.setNewFilter,onSubmit:N,onCancel:()=>{u.setShowAddInput(false);u.setNewFilter("")},placeholder:T.placeholder||"Enter pattern to exclude...",color:i.primary})]})}),h.size>0&&e(w,{keyboardShouldPersistTaps:"handled",testID:"buoy-filter-active-scroll",style:r.excludeFiltersContent,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,children:e(H,{filters:h,onRemoveFilter:V,color:i.primary,renderItemMeta:P})})]}),x?.enabled&&n(c,{style:r.availableKeysSection,children:[n(d,{children:[e(d.Icon,{icon:x.icon||v,color:i.primary,size:12}),e(d.Title,{children:x.title||"AVAILABLE ITEMS"}),e(d.Badge,{count:I.length,color:i.primary})]}),e(w,{style:r.availableKeysScroll,horizontal:false,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,scrollEnabled:true,children:I.length>0?I.map(t=>n(F,{onPress:()=>{if(z){z(t);u.addFilter(t)}},style:r.availableKeyItem,"sentry-label":"ignore-touchable-opacity",testID:`buoy-filter-available-${t}`,accessibilityRole:"button",accessibilityLabel:`Add filter ${t}`,children:[e(a,{style:r.availableKeyText,numberOfLines:1,children:t}),e(v,{size:12,color:i.primary})]},t)):e(a,{style:r.emptyStateText,children:x.emptyMessage||"No items available"})})]}),g?.enabled&&n(c,{style:r.howItWorksSection,children:[n(d,{children:[e(d.Icon,{icon:g.icon||A,color:o.color.textSecondary,size:12}),e(d.Title,{children:g.title||"HOW FILTERS WORK"})]}),e(a,{style:r.howItWorksText,children:g.description||"Filters help you focus on relevant data by hiding unwanted items."}),g.examples&&g.examples.length>0&&n(c,{style:r.examplesContainer,children:[e(a,{style:r.examplesTitle,children:"EXAMPLES:"}),g.examples.map((t,l)=>e(a,{style:r.exampleItem,children:t},l))]})]}),b?.enabled&&n(c,{style:r.previewSection,children:[n(d,{children:[e(d.Icon,{icon:b.icon||J,color:i.primary,size:12}),e(d.Title,{children:b.title||"PREVIEW"}),b.headerActions&&e(d.Actions,{children:b.headerActions()})]}),e(c,{style:r.previewContent,children:b.content()})]})]})};return n(c,{style:r.container,children:[$(),e(w,{keyboardShouldPersistTaps:"handled",testID:"buoy-filter-scroll",style:r.content,contentContainerStyle:r.scrollContent,showsVerticalScrollIndicator:false,"sentry-label":"ignore-scrollview",children:_()})]})}const r=U.create({container:{flex:1,backgroundColor:"transparent"},content:{flex:1},scrollContent:{paddingTop:16,paddingHorizontal:16,paddingBottom:24},tabContainer:{flexDirection:"row",paddingHorizontal:16,paddingVertical:12,gap:8,backgroundColor:o.color.surface,borderBottomWidth:1,borderBottomColor:o.color.border},tabButton:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6,paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1},tabButtonActive:{backgroundColor:i.primary+"20",borderColor:i.primary,borderWidth:2},tabButtonInactive:{backgroundColor:o.color.surfaceElevated,borderColor:o.color.border},tabButtonText:{fontSize:11,fontWeight:"600",letterSpacing:.5},tabButtonTextActive:{color:i.primary},tabButtonTextInactive:{color:o.color.textTertiary},tabBadge:{backgroundColor:i.primary+"40",paddingHorizontal:6,paddingVertical:1,borderRadius:8,minWidth:18,alignItems:"center"},tabBadgeText:{fontSize:9,color:i.primary,fontWeight:"700"},section:{marginBottom:8},filterInputWrapper:{marginBottom:4},filterGrid:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:8},filterCard:{backgroundColor:o.color.surface,borderRadius:12,paddingHorizontal:8,paddingVertical:10,flexDirection:"column",alignItems:"center",justifyContent:"center",borderWidth:1,borderColor:o.color.border,width:72,minHeight:68},activeFilterCard:{backgroundColor:i.primary+"33",borderColor:i.primary,borderWidth:2,shadowColor:i.primary,shadowOffset:{width:0,height:0},shadowOpacity:.3,shadowRadius:8,elevation:4},filterIcon:{marginBottom:0},filterCountActive:{fontSize:14,fontWeight:"700",color:o.color.text,fontFamily:f,marginTop:3,marginBottom:1,textShadowColor:"rgba(0, 0, 0, 0.2)",textShadowOffset:{width:0,height:.5},textShadowRadius:1},filterCountZero:{fontSize:11,fontWeight:"500",color:o.color.textTertiary,fontFamily:f,marginTop:3,marginBottom:1},filterLabelCompact:{fontSize:10,color:o.color.text,fontWeight:"600",textAlign:"center",textTransform:"capitalize",textShadowColor:"rgba(0, 0, 0, 0.3)",textShadowOffset:{width:0,height:.5},textShadowRadius:1},filterDescriptionBottom:{fontSize:8,color:o.color.textTertiary,textAlign:"center",marginTop:2,lineHeight:11},sectionDescription:{fontSize:10,color:o.color.textSecondary,marginTop:4,marginBottom:4,lineHeight:14},methodBadgeCompact:{paddingHorizontal:8,paddingVertical:4,borderRadius:5,minWidth:48,maxWidth:60,alignItems:"center",justifyContent:"center"},methodTextCompact:{fontSize:13,fontWeight:"700",letterSpacing:.3,fontFamily:f},activeFiltersSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},activeFiltersContent:{paddingHorizontal:16,paddingTop:8,paddingBottom:16,maxHeight:200},includeOnlySection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},includeOnlyDescription:{fontSize:10,color:o.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:14},includeOnlyInputWrapper:{paddingHorizontal:16,paddingTop:8,paddingBottom:8},includeOnlyFiltersContent:{paddingHorizontal:16,paddingBottom:16,maxHeight:150},excludeFiltersSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},excludeFiltersDescription:{fontSize:10,color:o.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:14},excludeFiltersInputWrapper:{paddingHorizontal:16,paddingTop:8,paddingBottom:8},excludeFiltersContent:{paddingHorizontal:16,paddingBottom:16,maxHeight:150},filterSummarySection:{backgroundColor:i.warning+"15",borderRadius:8,borderWidth:1,borderColor:i.warning+"40",padding:12,marginBottom:12},filterSummaryHeader:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:6},filterSummaryTitle:{fontSize:12,fontWeight:"600",color:i.warning},filterSummaryText:{fontSize:11,color:o.color.text,lineHeight:16},filterSummaryInclude:{color:i.success,fontWeight:"500"},filterSummaryExclude:{color:i.primary,fontWeight:"500"},emptyStateText:{fontSize:11,color:o.color.textTertiary,fontStyle:"italic",textAlign:"center",paddingVertical:12},availableKeysSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},availableKeysScroll:{maxHeight:150,paddingHorizontal:16,paddingTop:8,paddingBottom:16},availableKeyItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:10,paddingHorizontal:12,backgroundColor:o.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:o.color.border,marginBottom:8},availableKeyText:{flex:1,fontSize:11,color:o.color.text,fontFamily:f,marginRight:8},howItWorksSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},howItWorksText:{fontSize:11,color:o.color.textSecondary,lineHeight:16,marginBottom:12,marginTop:8,paddingHorizontal:16,fontFamily:f},examplesContainer:{paddingTop:8,paddingHorizontal:16,paddingBottom:16,borderTopWidth:1,borderTopColor:o.color.border},examplesTitle:{fontSize:10,fontWeight:"600",color:o.color.textTertiary,fontFamily:f,letterSpacing:.5,marginBottom:6},exampleItem:{fontSize:10,color:o.color.textTertiary,fontFamily:f,lineHeight:16},previewSection:{backgroundColor:o.color.surfaceElevated,borderRadius:16,borderWidth:1,borderColor:o.color.fillTertiary,marginTop:16,overflow:"hidden"},previewContent:{paddingHorizontal:16,paddingTop:12,paddingBottom:16,backgroundColor:o.color.bg,marginHorizontal:12,marginBottom:12,borderRadius:8,borderWidth:1,borderColor:o.color.border}});
1
+ "use strict";import{View as c,Text as a,TouchableOpacity as A,StyleSheet as ce,ScrollView as F,Keyboard as W,Platform as se}from"react-native";import{useEffect as H,useRef as S,useState as ue}from"react";import{Filter as N,Plus as O,Copy as me,Eye as pe,Info as he}from"../../icons/index.js";import{SectionHeader as d}from"./SectionHeader.js";import{FilterList as _,AddFilterInput as $,AddFilterButton as Y}from"./FilterComponents.js";import{useFilterManager as Z}from"../../hooks/useFilterManager.js";import{buoyColors as i}from"../gameUI/constants/gameUIColors.js";import{night as o}from"../night/nightTheme.js";import{monoFont as f}from"../fonts.js";import{jsx as e,jsxs as n,Fragment as q}from"react/jsx-runtime";export function DynamicFilterView({sections:G=[],filterSummarySection:p,addFilterSection:C,includeOnlySection:s,availableItemsSection:x,howItWorksSection:g,previewSection:b,onFilterChange:U,onPatternToggle:X,onPatternAdd:w,activePatterns:h=new Set,renderPatternMeta:J,tabs:y,activeTab:Q,onTabChange:R}){const u=Z(h);const m=Z(s?.patterns||new Set);const[ee,re]=ue(y?.[0]?.id||"");const T=Q||ee;const E=S(null);const D=S(0);const k=S(null);const L=S(null);const V=m.showAddInput;const P=u.showAddInput;const j=r=>{if(!r||se.OS!=="ios")return()=>{};let l;const z=()=>{const K=W.metrics()?.screenY;if(K==null)return;r.measureInWindow((ge,de,fe,ae)=>{const M=de+ae-(K-16);if(M<=0)return;E.current?.scrollTo({y:D.current+M,animated:true})})};const I=()=>{clearTimeout(l);l=setTimeout(z,300)};if(W.isVisible())I();const v=W.addListener("keyboardDidShow",I);return()=>{clearTimeout(l);v.remove()}};H(()=>V?j(k.current):void 0,[V]);H(()=>P?j(L.current):void 0,[P]);H(()=>{if(h.size!==u.filters.size||!Array.from(h).every(r=>u.filters.has(r))){}},[h,u.filters]);const te=()=>{if(u.newFilter.trim()&&w){w(u.newFilter.trim());u.addFilter(u.newFilter)}};const oe=()=>{if(m.newFilter.trim()&&s?.onPatternAdd){s.onPatternAdd(m.newFilter.trim());m.addFilter(m.newFilter)}};const B=x?.items?.filter(r=>{return!Array.from(h).some(l=>r.includes(l))})||[];const le=()=>{if(!y||y.length===0)return null;return e(c,{style:t.tabContainer,children:y.map(r=>n(A,{onPress:()=>{if(R)R(r.id);else re(r.id)},style:[t.tabButton,T===r.id?t.tabButtonActive:t.tabButtonInactive],children:[r.icon&&e(r.icon,{size:14,color:T===r.id?i.primary:o.color.textTertiary}),e(a,{style:[t.tabButtonText,T===r.id?t.tabButtonTextActive:t.tabButtonTextInactive],children:r.label}),r.count!==void 0&&r.count>0&&e(c,{style:t.tabBadge,children:e(a,{style:t.tabBadgeText,children:r.count})})]},r.id))})};const ie=r=>{if(r.type==="custom"&&r.renderCustom){return r.renderCustom()}if(r.type==="patterns"){return null}if(!r.data||r.data.length===0)return null;return n(c,{style:t.section,children:[n(d,{children:[r.icon&&e(d.Icon,{icon:r.icon,color:r.color||i.primary,size:12}),e(d.Title,{children:r.title})]}),r.description&&e(a,{style:t.sectionDescription,children:r.description}),e(c,{style:t.filterGrid,children:r.data.map(l=>{const z=l.count!==void 0;const I=z&&l.count===0;const v=r.type!=="method"||l.icon;return n(A,{testID:`buoy-filter-option-${l.id}`,accessibilityRole:"button",accessibilityLabel:String(l.label??l.id),style:[t.filterCard,l.isActive&&t.activeFilterCard],onPress:()=>U?.(l.id,l.value),children:[l.icon?e(l.icon,{size:24,color:l.color,style:t.filterIcon}):r.type==="method"?e(c,{style:[t.methodBadgeCompact,{backgroundColor:`${l.color}20`}],children:e(a,{style:[t.methodTextCompact,{color:l.color}],numberOfLines:1,adjustsFontSizeToFit:true,minimumFontScale:.8,children:l.label})}):null,z&&e(a,{style:[I?t.filterCountZero:t.filterCountActive],children:l.count}),v&&e(a,{style:t.filterLabelCompact,children:l.label}),l.description&&e(a,{style:t.filterDescriptionBottom,children:l.description})]},l.id)})})]},r.id)};const ne=()=>{if(y&&T){const r=y.find(l=>l.id===T);if(r?.content){return r.content()}}return n(q,{children:[p?.enabled&&(p.includePatterns?.size||p.excludePatterns?.size)?n(c,{style:t.filterSummarySection,children:[n(c,{style:t.filterSummaryHeader,children:[e(he,{size:14,color:i.warning}),e(a,{style:t.filterSummaryTitle,children:"Filters Active"})]}),n(a,{style:t.filterSummaryText,children:["Showing ",p.filteredCount," of ",p.totalCount," queries",p.includePatterns?.size?n(a,{style:t.filterSummaryInclude,children:[" ","\u2022 Including: ",Array.from(p.includePatterns).join(", ")]}):null,p.excludePatterns?.size?n(a,{style:t.filterSummaryExclude,children:[" ","\u2022 Excluding: ",Array.from(p.excludePatterns).join(", ")]}):null]})]}):null,G.map(ie),s?.enabled&&n(c,{style:t.includeOnlySection,children:[n(d,{children:[e(d.Icon,{icon:s.icon||pe,color:i.success,size:12}),e(d.Title,{children:s.title||"INCLUDE ONLY FILTERS"}),s.patterns.size>0&&e(d.Badge,{count:s.patterns.size,color:i.success})]}),s.description&&e(a,{style:t.includeOnlyDescription,children:s.description}),e(c,{ref:k,style:t.includeOnlyInputWrapper,children:!m.showAddInput?e(Y,{onPress:()=>m.setShowAddInput(true),color:i.success,label:"Add include pattern",testID:"buoy-filter-include-add-open"}):e($,{value:m.newFilter,onChange:m.setNewFilter,onSubmit:oe,onCancel:()=>{m.setShowAddInput(false);m.setNewFilter("")},placeholder:s.placeholder||"Enter pattern to include...",color:i.success,testID:"buoy-filter-include-input"})}),s.patterns.size>0&&e(F,{keyboardShouldPersistTaps:"handled",testID:"buoy-filter-include-scroll",style:t.includeOnlyFiltersContent,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,children:e(_,{filters:s.patterns,onRemoveFilter:s.onPatternToggle,color:i.success,renderItemMeta:s.renderPatternMeta})})]}),C?.enabled&&n(c,{style:t.excludeFiltersSection,children:[n(d,{children:[e(d.Icon,{icon:N,color:i.primary,size:12}),e(d.Title,{children:C.title||"EXCLUDE FILTERS"}),h.size>0&&e(d.Badge,{count:h.size,color:i.primary})]}),e(a,{style:t.excludeFiltersDescription,children:"Hide queries matching these patterns from the list."}),e(c,{ref:L,style:t.excludeFiltersInputWrapper,children:!u.showAddInput?e(Y,{onPress:()=>u.setShowAddInput(true),color:i.primary,label:"Add exclude pattern"}):n(q,{children:[C.renderExtra?.(),e($,{value:u.newFilter,onChange:u.setNewFilter,onSubmit:te,onCancel:()=>{u.setShowAddInput(false);u.setNewFilter("")},placeholder:C.placeholder||"Enter pattern to exclude...",color:i.primary})]})}),h.size>0&&e(F,{keyboardShouldPersistTaps:"handled",testID:"buoy-filter-active-scroll",style:t.excludeFiltersContent,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,children:e(_,{filters:h,onRemoveFilter:X,color:i.primary,renderItemMeta:J})})]}),x?.enabled&&n(c,{style:t.availableKeysSection,children:[n(d,{children:[e(d.Icon,{icon:x.icon||O,color:i.primary,size:12}),e(d.Title,{children:x.title||"AVAILABLE ITEMS"}),e(d.Badge,{count:B.length,color:i.primary})]}),e(F,{keyboardShouldPersistTaps:"handled",style:t.availableKeysScroll,horizontal:false,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,scrollEnabled:true,children:B.length>0?B.map(r=>n(A,{onPress:()=>{if(w){w(r);u.addFilter(r)}},style:t.availableKeyItem,"sentry-label":"ignore-touchable-opacity",testID:`buoy-filter-available-${r}`,accessibilityRole:"button",accessibilityLabel:`Add filter ${r}`,children:[e(a,{style:t.availableKeyText,numberOfLines:1,children:r}),e(O,{size:12,color:i.primary})]},r)):e(a,{style:t.emptyStateText,children:x.emptyMessage||"No items available"})})]}),g?.enabled&&n(c,{style:t.howItWorksSection,children:[n(d,{children:[e(d.Icon,{icon:g.icon||N,color:o.color.textSecondary,size:12}),e(d.Title,{children:g.title||"HOW FILTERS WORK"})]}),e(a,{style:t.howItWorksText,children:g.description||"Filters help you focus on relevant data by hiding unwanted items."}),g.examples&&g.examples.length>0&&n(c,{style:t.examplesContainer,children:[e(a,{style:t.examplesTitle,children:"EXAMPLES:"}),g.examples.map((r,l)=>e(a,{style:t.exampleItem,children:r},l))]})]}),b?.enabled&&n(c,{style:t.previewSection,children:[n(d,{children:[e(d.Icon,{icon:b.icon||me,color:i.primary,size:12}),e(d.Title,{children:b.title||"PREVIEW"}),b.headerActions&&e(d.Actions,{children:b.headerActions()})]}),e(c,{style:t.previewContent,children:b.content()})]})]})};return n(c,{style:t.container,children:[le(),e(F,{ref:E,onScroll:r=>{D.current=r.nativeEvent.contentOffset.y},scrollEventThrottle:32,keyboardShouldPersistTaps:"handled",testID:"buoy-filter-scroll",style:t.content,contentContainerStyle:t.scrollContent,showsVerticalScrollIndicator:false,"sentry-label":"ignore-scrollview",children:ne()})]})}const t=ce.create({container:{flex:1,backgroundColor:"transparent"},content:{flex:1},scrollContent:{paddingTop:16,paddingHorizontal:16,paddingBottom:24},tabContainer:{flexDirection:"row",paddingHorizontal:16,paddingVertical:12,gap:8,backgroundColor:o.color.surface,borderBottomWidth:1,borderBottomColor:o.color.border},tabButton:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6,paddingVertical:10,paddingHorizontal:16,borderRadius:8,borderWidth:1},tabButtonActive:{backgroundColor:i.primary+"20",borderColor:i.primary,borderWidth:2},tabButtonInactive:{backgroundColor:o.color.surfaceElevated,borderColor:o.color.border},tabButtonText:{fontSize:11,fontWeight:"600",letterSpacing:.5},tabButtonTextActive:{color:i.primary},tabButtonTextInactive:{color:o.color.textTertiary},tabBadge:{backgroundColor:i.primary+"40",paddingHorizontal:6,paddingVertical:1,borderRadius:8,minWidth:18,alignItems:"center"},tabBadgeText:{fontSize:9,color:i.primary,fontWeight:"700"},section:{marginBottom:8},filterInputWrapper:{marginBottom:4},filterGrid:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:8},filterCard:{backgroundColor:o.color.surface,borderRadius:12,paddingHorizontal:8,paddingVertical:10,flexDirection:"column",alignItems:"center",justifyContent:"center",borderWidth:1,borderColor:o.color.border,width:72,minHeight:68},activeFilterCard:{backgroundColor:i.primary+"33",borderColor:i.primary,borderWidth:2,shadowColor:i.primary,shadowOffset:{width:0,height:0},shadowOpacity:.3,shadowRadius:8,elevation:4},filterIcon:{marginBottom:0},filterCountActive:{fontSize:14,fontWeight:"700",color:o.color.text,fontFamily:f,marginTop:3,marginBottom:1,textShadowColor:"rgba(0, 0, 0, 0.2)",textShadowOffset:{width:0,height:.5},textShadowRadius:1},filterCountZero:{fontSize:11,fontWeight:"500",color:o.color.textTertiary,fontFamily:f,marginTop:3,marginBottom:1},filterLabelCompact:{fontSize:10,color:o.color.text,fontWeight:"600",textAlign:"center",textTransform:"capitalize",textShadowColor:"rgba(0, 0, 0, 0.3)",textShadowOffset:{width:0,height:.5},textShadowRadius:1},filterDescriptionBottom:{fontSize:8,color:o.color.textTertiary,textAlign:"center",marginTop:2,lineHeight:11},sectionDescription:{fontSize:10,color:o.color.textSecondary,marginTop:4,marginBottom:4,lineHeight:14},methodBadgeCompact:{paddingHorizontal:8,paddingVertical:4,borderRadius:5,minWidth:48,maxWidth:60,alignItems:"center",justifyContent:"center"},methodTextCompact:{fontSize:13,fontWeight:"700",letterSpacing:.3,fontFamily:f},activeFiltersSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},activeFiltersContent:{paddingHorizontal:16,paddingTop:8,paddingBottom:16,maxHeight:200},includeOnlySection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},includeOnlyDescription:{fontSize:10,color:o.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:14},includeOnlyInputWrapper:{paddingHorizontal:16,paddingTop:8,paddingBottom:8},includeOnlyFiltersContent:{paddingHorizontal:16,paddingBottom:16,maxHeight:150},excludeFiltersSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},excludeFiltersDescription:{fontSize:10,color:o.color.textSecondary,paddingHorizontal:16,paddingTop:8,lineHeight:14},excludeFiltersInputWrapper:{paddingHorizontal:16,paddingTop:8,paddingBottom:8},excludeFiltersContent:{paddingHorizontal:16,paddingBottom:16,maxHeight:150},filterSummarySection:{backgroundColor:i.warning+"15",borderRadius:8,borderWidth:1,borderColor:i.warning+"40",padding:12,marginBottom:12},filterSummaryHeader:{flexDirection:"row",alignItems:"center",gap:6,marginBottom:6},filterSummaryTitle:{fontSize:12,fontWeight:"600",color:i.warning},filterSummaryText:{fontSize:11,color:o.color.text,lineHeight:16},filterSummaryInclude:{color:i.success,fontWeight:"500"},filterSummaryExclude:{color:i.primary,fontWeight:"500"},emptyStateText:{fontSize:11,color:o.color.textTertiary,fontStyle:"italic",textAlign:"center",paddingVertical:12},availableKeysSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},availableKeysScroll:{maxHeight:150,paddingHorizontal:16,paddingTop:8,paddingBottom:16},availableKeyItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:10,paddingHorizontal:12,backgroundColor:o.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:o.color.border,marginBottom:8},availableKeyText:{flex:1,fontSize:11,color:o.color.text,fontFamily:f,marginRight:8},howItWorksSection:{backgroundColor:o.color.surface,borderRadius:16,borderWidth:1,borderColor:o.color.border,marginTop:16,overflow:"hidden"},howItWorksText:{fontSize:11,color:o.color.textSecondary,lineHeight:16,marginBottom:12,marginTop:8,paddingHorizontal:16,fontFamily:f},examplesContainer:{paddingTop:8,paddingHorizontal:16,paddingBottom:16,borderTopWidth:1,borderTopColor:o.color.border},examplesTitle:{fontSize:10,fontWeight:"600",color:o.color.textTertiary,fontFamily:f,letterSpacing:.5,marginBottom:6},exampleItem:{fontSize:10,color:o.color.textTertiary,fontFamily:f,lineHeight:16},previewSection:{backgroundColor:o.color.surfaceElevated,borderRadius:16,borderWidth:1,borderColor:o.color.fillTertiary,marginTop:16,overflow:"hidden"},previewContent:{paddingHorizontal:16,paddingTop:12,paddingBottom:16,backgroundColor:o.color.bg,marginHorizontal:12,marginBottom:12,borderRadius:8,borderWidth:1,borderColor:o.color.border}});
@@ -1 +1 @@
1
- "use strict";import{useState as w}from"react";import{ScrollView as z,StyleSheet as W,Text as p,TouchableOpacity as L,View as s}from"react-native";import{Filter as I,X as k}from"../../icons/index.js";import{night as t}from"../night/nightTheme.js";import{SectionHeader as n}from"./SectionHeader.js";import{AddFilterButton as B,AddFilterInput as V}from"./FilterComponents.js";import{monoFont as h}from"../fonts.js";import{jsxs as l,jsx as r}from"react/jsx-runtime";function A(d,a){return Array.from(a).some(m=>d.name.toLowerCase().includes(m.toLowerCase()))}function v(d,a){const m=a.find(u=>u.name.toLowerCase()===d.toLowerCase());return m?m.color:null}export function EntityFilterView({entities:d,ignoredPatterns:a,onTogglePattern:m,onAddPattern:u,entityNoun:T,entitySingular:y,entityKey:f,testIDPrefix:c,slug:S,howItWorks:H,examples:R,addPlaceholder:E,emptyMessage:x}){const[$,b]=w(false);const[C,g]=w("");const F=()=>{const e=C.trim();if(e){u(e);g("");b(false)}};return l(z,{keyboardShouldPersistTaps:"handled",style:o.container,contentContainerStyle:o.scrollContent,showsVerticalScrollIndicator:false,nestedScrollEnabled:true,testID:`${c}-filters-scroll`,children:[d.length===0&&x?l(s,{style:o.section,children:[r(n,{children:l(n.Title,{children:["REGISTERED ",T]})}),r(p,{style:o.emptyText,testID:`${c}-filters-${f}s-empty`,children:x})]}):null,d.length>0&&l(s,{style:o.section,children:[l(n,{children:[l(n.Title,{children:["REGISTERED ",T]}),r(n.Badge,{count:d.length,color:t.color.accent,testID:`${c}-filters-${f}-count`})]}),r(z,{keyboardShouldPersistTaps:"handled",style:o.entityList,contentContainerStyle:o.entityListContent,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,testID:`${c}-filters-${f}-list`,children:d.map(e=>{const i=A(e,a);return l(L,{style:[o.entityRow,i&&o.entityRowHidden],onPress:()=>u(e.name),disabled:i,testID:`${c}-filters-${f}-${S(e.name)}`,accessibilityRole:"button",accessibilityLabel:`Hide ${e.name}`,accessibilityState:{disabled:i},children:[r(s,{style:[o.dot,{backgroundColor:i?t.color.textTertiary:e.color}]}),r(p,{style:[o.entityText,i?o.entityTextHidden:{color:e.color}],numberOfLines:1,children:e.name}),i?r(p,{style:o.hiddenLabel,children:"hidden"}):r(p,{style:[o.addLabel,{color:e.color+"99"}],children:"+ hide"})]},e.name)})})]}),l(s,{style:o.section,children:[l(n,{children:[r(n.Icon,{icon:I,color:t.color.accent,size:12}),l(n.Title,{children:[y.toUpperCase()," NAME FILTERS"]}),a.size>0&&r(n.Badge,{count:a.size,color:t.color.accent,testID:`${c}-filters-count`})]}),r(s,{style:o.addInputWrapper,children:!$?r(B,{onPress:()=>b(true),color:t.color.accent,label:`Add ${y} name pattern`,testID:`${c}-filters-add-open`}):r(V,{value:C,onChange:g,onSubmit:F,onCancel:()=>{b(false);g("")},placeholder:E??`Enter ${y} name pattern to hide...`,color:t.color.accent,testID:`${c}-filters-add-input`})}),a.size>0&&r(s,{style:o.patternList,children:Array.from(a).map(e=>{const i=v(e,d);return l(L,{style:o.patternRow,onPress:()=>m(e),activeOpacity:.8,testID:`${c}-filters-chip-${S(e)}`,accessibilityRole:"button",accessibilityLabel:`Remove filter ${e}`,children:[i?r(s,{style:[o.dot,{backgroundColor:i}]}):null,r(p,{style:[o.patternText,i?{color:i}:null],numberOfLines:1,children:e}),r(k,{size:12,color:t.color.accent+"80"})]},e)})})]}),l(s,{style:o.section,children:[l(n,{children:[r(n.Icon,{icon:I,color:t.color.textSecondary,size:12}),r(n.Title,{children:"HOW EVENT FILTERS WORK"})]}),r(p,{style:o.howItWorksText,children:H}),l(s,{style:o.examplesContainer,children:[r(p,{style:o.examplesTitle,children:"EXAMPLES:"}),R.map(e=>r(p,{style:o.exampleItem,children:e},e))]})]})]})}const o=W.create({container:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingTop:16,paddingHorizontal:16,paddingBottom:24,gap:16},section:{backgroundColor:t.color.surface,borderRadius:16,borderWidth:1,borderColor:t.color.border,overflow:"hidden"},entityList:{maxHeight:180},entityListContent:{paddingHorizontal:16,paddingTop:8,paddingBottom:16,gap:10},entityRow:{flexDirection:"row",alignItems:"center",gap:10,paddingVertical:10,paddingHorizontal:12,backgroundColor:t.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:t.color.border},entityRowHidden:{opacity:.45},dot:{width:7,height:7,borderRadius:3.5},entityText:{flex:1,fontSize:12,fontWeight:"600",fontFamily:h},entityTextHidden:{color:t.color.textTertiary,textDecorationLine:"line-through"},hiddenLabel:{fontSize:10,fontWeight:"500",color:t.color.textTertiary,fontFamily:h},addLabel:{fontSize:10,fontWeight:"600",fontFamily:h},addInputWrapper:{paddingHorizontal:16,paddingTop:8,paddingBottom:8},patternList:{paddingHorizontal:16,paddingBottom:16,gap:8},patternRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:10,paddingHorizontal:12,backgroundColor:t.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:t.color.border,gap:8},patternText:{flex:1,fontSize:12,fontFamily:h,color:t.color.text},emptyText:{fontSize:11,color:t.color.textTertiary,paddingHorizontal:16,paddingTop:8,paddingBottom:16,fontFamily:h},howItWorksText:{fontSize:11,color:t.color.textSecondary,lineHeight:16,marginTop:8,paddingHorizontal:16,fontFamily:h},examplesContainer:{paddingTop:8,paddingHorizontal:16,paddingBottom:16,borderTopWidth:1,borderTopColor:t.color.border,marginTop:12},examplesTitle:{fontSize:10,fontWeight:"600",color:t.color.textTertiary,fontFamily:h,letterSpacing:.5,marginBottom:6},exampleItem:{fontSize:10,color:t.color.textTertiary,fontFamily:h,lineHeight:16}});
1
+ "use strict";import{useState as w}from"react";import{ScrollView as z,StyleSheet as W,Text as p,TouchableOpacity as L,View as s}from"react-native";import{Filter as I,X as k}from"../../icons/index.js";import{night as t}from"../night/nightTheme.js";import{SectionHeader as n}from"./SectionHeader.js";import{AddFilterButton as B,AddFilterInput as V}from"./FilterComponents.js";import{monoFont as h}from"../fonts.js";import{jsxs as l,jsx as r}from"react/jsx-runtime";function A(d,a){return Array.from(a).some(m=>d.name.toLowerCase().includes(m.toLowerCase()))}function v(d,a){const m=a.find(u=>u.name.toLowerCase()===d.toLowerCase());return m?m.color:null}export function EntityFilterView({entities:d,ignoredPatterns:a,onTogglePattern:m,onAddPattern:u,entityNoun:T,entitySingular:y,entityKey:f,testIDPrefix:c,slug:S,howItWorks:H,examples:R,addPlaceholder:E,emptyMessage:x}){const[$,b]=w(false);const[C,g]=w("");const F=()=>{const e=C.trim();if(e){u(e);g("");b(false)}};return l(z,{style:o.container,contentContainerStyle:o.scrollContent,showsVerticalScrollIndicator:false,nestedScrollEnabled:true,keyboardShouldPersistTaps:"handled",testID:`${c}-filters-scroll`,children:[d.length===0&&x?l(s,{style:o.section,children:[r(n,{children:l(n.Title,{children:["REGISTERED ",T]})}),r(p,{style:o.emptyText,testID:`${c}-filters-${f}s-empty`,children:x})]}):null,d.length>0&&l(s,{style:o.section,children:[l(n,{children:[l(n.Title,{children:["REGISTERED ",T]}),r(n.Badge,{count:d.length,color:t.color.accent,testID:`${c}-filters-${f}-count`})]}),r(z,{keyboardShouldPersistTaps:"handled",style:o.entityList,contentContainerStyle:o.entityListContent,showsVerticalScrollIndicator:true,nestedScrollEnabled:true,testID:`${c}-filters-${f}-list`,children:d.map(e=>{const i=A(e,a);return l(L,{style:[o.entityRow,i&&o.entityRowHidden],onPress:()=>u(e.name),disabled:i,testID:`${c}-filters-${f}-${S(e.name)}`,accessibilityRole:"button",accessibilityLabel:`Hide ${e.name}`,accessibilityState:{disabled:i},children:[r(s,{style:[o.dot,{backgroundColor:i?t.color.textTertiary:e.color}]}),r(p,{style:[o.entityText,i?o.entityTextHidden:{color:e.color}],numberOfLines:1,children:e.name}),i?r(p,{style:o.hiddenLabel,children:"hidden"}):r(p,{style:[o.addLabel,{color:e.color+"99"}],children:"+ hide"})]},e.name)})})]}),l(s,{style:o.section,children:[l(n,{children:[r(n.Icon,{icon:I,color:t.color.accent,size:12}),l(n.Title,{children:[y.toUpperCase()," NAME FILTERS"]}),a.size>0&&r(n.Badge,{count:a.size,color:t.color.accent,testID:`${c}-filters-count`})]}),r(s,{style:o.addInputWrapper,children:!$?r(B,{onPress:()=>b(true),color:t.color.accent,label:`Add ${y} name pattern`,testID:`${c}-filters-add-open`}):r(V,{value:C,onChange:g,onSubmit:F,onCancel:()=>{b(false);g("")},placeholder:E??`Enter ${y} name pattern to hide...`,color:t.color.accent,testID:`${c}-filters-add-input`})}),a.size>0&&r(s,{style:o.patternList,children:Array.from(a).map(e=>{const i=v(e,d);return l(L,{style:o.patternRow,onPress:()=>m(e),activeOpacity:.8,testID:`${c}-filters-chip-${S(e)}`,accessibilityRole:"button",accessibilityLabel:`Remove filter ${e}`,children:[i?r(s,{style:[o.dot,{backgroundColor:i}]}):null,r(p,{style:[o.patternText,i?{color:i}:null],numberOfLines:1,children:e}),r(k,{size:12,color:t.color.accent+"80"})]},e)})})]}),l(s,{style:o.section,children:[l(n,{children:[r(n.Icon,{icon:I,color:t.color.textSecondary,size:12}),r(n.Title,{children:"HOW EVENT FILTERS WORK"})]}),r(p,{style:o.howItWorksText,children:H}),l(s,{style:o.examplesContainer,children:[r(p,{style:o.examplesTitle,children:"EXAMPLES:"}),R.map(e=>r(p,{style:o.exampleItem,children:e},e))]})]})]})}const o=W.create({container:{flex:1,backgroundColor:"transparent"},scrollContent:{paddingTop:16,paddingHorizontal:16,paddingBottom:24,gap:16},section:{backgroundColor:t.color.surface,borderRadius:16,borderWidth:1,borderColor:t.color.border,overflow:"hidden"},entityList:{maxHeight:180},entityListContent:{paddingHorizontal:16,paddingTop:8,paddingBottom:16,gap:10},entityRow:{flexDirection:"row",alignItems:"center",gap:10,paddingVertical:10,paddingHorizontal:12,backgroundColor:t.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:t.color.border},entityRowHidden:{opacity:.45},dot:{width:7,height:7,borderRadius:3.5},entityText:{flex:1,fontSize:12,fontWeight:"600",fontFamily:h},entityTextHidden:{color:t.color.textTertiary,textDecorationLine:"line-through"},hiddenLabel:{fontSize:10,fontWeight:"500",color:t.color.textTertiary,fontFamily:h},addLabel:{fontSize:10,fontWeight:"600",fontFamily:h},addInputWrapper:{paddingHorizontal:16,paddingTop:8,paddingBottom:8},patternList:{paddingHorizontal:16,paddingBottom:16,gap:8},patternRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:10,paddingHorizontal:12,backgroundColor:t.color.surfaceElevated,borderRadius:8,borderWidth:1,borderColor:t.color.border,gap:8},patternText:{flex:1,fontSize:12,fontFamily:h,color:t.color.text},emptyText:{fontSize:11,color:t.color.textTertiary,paddingHorizontal:16,paddingTop:8,paddingBottom:16,fontFamily:h},howItWorksText:{fontSize:11,color:t.color.textSecondary,lineHeight:16,marginTop:8,paddingHorizontal:16,fontFamily:h},examplesContainer:{paddingTop:8,paddingHorizontal:16,paddingBottom:16,borderTopWidth:1,borderTopColor:t.color.border,marginTop:12},examplesTitle:{fontSize:10,fontWeight:"600",color:t.color.textTertiary,fontFamily:h,letterSpacing:.5,marginBottom:6},exampleItem:{fontSize:10,color:t.color.textTertiary,fontFamily:h,lineHeight:16}});
@@ -1 +1 @@
1
- "use strict";import{useState as F,useRef as W,useCallback as C,useEffect as j}from"react";import{View as d,TouchableOpacity as s,StyleSheet as V,Animated as f,Platform as U}from"react-native";import{X as A,Minus as I,DockBottom as P,FloatWindow as R}from"../../icons/index.js";import{buoyColors as N}from"../gameUI/constants/gameUIColors.js";import{night as e}from"../night/nightTheme.js";import{expandableWindowControlsSupported as X,isExpandableWindowControlsEnabled as Z}from"./windowControlsSetting.js";import{jsx as t,jsxs as w,Fragment as G}from"react/jsx-runtime";export{setExpandableWindowControls}from"./windowControlsSetting.js";const u={close:"#FF5F57",minimize:"#FEBC2E",toggleMode:"#28C840"};const B=12;const H=8;const g=8;const x=36;const q=12;const z=16;const p=8;const J=3e3;export function WindowControls({onClose:b,onMinimize:i,onToggleMode:r,mode:l,variant:D="night",defaultExpanded:h}){const n=l==="floating"?P:R;const E=l==="floating"?"Dock to bottom sheet":"Make floating window";if(!Z()||!X(U.OS==="web")){return w(d,{style:o.container,children:[i&&t(s,{onPress:i,style:[o.dot,o.minimizeDot],activeOpacity:.8,accessibilityLabel:"Minimize modal",accessibilityRole:"button",children:t(I,{size:g,color:"#7A5A00",strokeWidth:1.5})}),r&&t(s,{onPress:r,style:[o.dot,o.expandDot],activeOpacity:.8,accessibilityLabel:E,accessibilityRole:"button",children:t(n,{size:g,color:"#004A1A",strokeWidth:1.5})}),t(s,{onPress:b,style:[o.dot,o.closeDot],activeOpacity:.8,accessibilityLabel:"Close modal",testID:"tool-window-close",accessibilityRole:"button",children:t(A,{size:g,color:"#4A0000",strokeWidth:1.5})})]})}return t(K,{onClose:b,onMinimize:i,onToggleMode:r,mode:l,variant:D,defaultExpanded:h})}function K({onClose:b,onMinimize:i,onToggleMode:r,mode:l,variant:D="night",defaultExpanded:h=false}){const n=D==="night";const[E,O]=F(h);const a=W(new f.Value(h?1:0)).current;const m=W(null);const S=l==="floating"?P:R;const T=l==="floating"?"Dock to bottom sheet":"Make floating window";const c=C(()=>{if(m.current){clearTimeout(m.current);m.current=null}},[]);const y=C(()=>{c();f.spring(a,{toValue:0,tension:200,friction:20,useNativeDriver:false}).start(()=>{O(false)})},[a,c]);const _=C(()=>{O(true);f.spring(a,{toValue:1,tension:180,friction:18,useNativeDriver:false}).start();c();m.current=setTimeout(y,J)},[a,y,c]);j(()=>{return c},[c]);const k=C(M=>{y();M()},[y]);const v=a.interpolate({inputRange:[0,1],outputRange:[.3,1]});const L=a.interpolate({inputRange:[0,.5,1],outputRange:[0,.8,1]});return w(G,{children:[t(s,{onPress:_,activeOpacity:.7,accessibilityLabel:"Open window controls",testID:"tool-window-controls",accessibilityRole:"button",style:o.trigger,hitSlop:{top:8,bottom:8,left:8,right:8},children:w(d,{style:o.container,children:[i&&t(d,{style:[o.dot,o.minimizeDot],children:t(I,{size:g,color:"#7A5A00",strokeWidth:1.5})}),r&&t(d,{style:[o.dot,o.expandDot],children:t(S,{size:g,color:"#004A1A",strokeWidth:1.5})}),t(d,{style:[o.dot,o.closeDot],children:t(A,{size:g,color:"#4A0000",strokeWidth:1.5})})]})}),E&&t(f.View,{style:[o.expandedPanelInline,{transform:[{scale:v}],opacity:L}],children:w(d,{style:[o.expandedContainer,n&&o.nightExpandedContainer],children:[i&&t(s,{onPress:()=>k(i),style:[o.expandedButton,n?o.nightMinimizeButton:o.minimizeButtonExpanded],activeOpacity:.7,accessibilityLabel:"Minimize modal",testID:"tool-window-minimize",accessibilityRole:"button",children:t(I,{size:z,color:n?e.color.warning:"#7A5A00",strokeWidth:2})}),r&&t(s,{onPress:()=>k(r),style:[o.expandedButton,n?o.nightToggleButton:o.expandButtonExpanded],activeOpacity:.7,accessibilityLabel:T,testID:"tool-window-mode",accessibilityRole:"button",children:t(S,{size:z,color:n?e.color.accent:"#004A1A",strokeWidth:2})}),t(s,{onPress:()=>k(b),style:[o.expandedButton,n?o.nightCloseButton:o.closeButtonExpanded],activeOpacity:.7,accessibilityLabel:"Close modal",testID:"tool-window-close",accessibilityRole:"button",children:t(A,{size:z,color:n?e.color.danger:"#4A0000",strokeWidth:2})})]})})]})}const o=V.create({trigger:{padding:2},container:{flexDirection:"row",alignItems:"center",gap:H},dot:{width:B,height:B,borderRadius:B/2,alignItems:"center",justifyContent:"center"},closeDot:{backgroundColor:u.close},minimizeDot:{backgroundColor:u.minimize},expandDot:{backgroundColor:u.toggleMode},expandedPanelInline:{position:"absolute",top:-p,right:-p,zIndex:9999},expandedContainer:{flexDirection:"row",alignItems:"center",gap:q,backgroundColor:N.card,borderRadius:(x+p*2)/2,paddingHorizontal:p,paddingVertical:p,borderWidth:1,borderColor:N.border,shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.4,shadowRadius:12,elevation:30},expandedButton:{width:x,height:x,borderRadius:x/2,alignItems:"center",justifyContent:"center"},closeButtonExpanded:{backgroundColor:u.close},minimizeButtonExpanded:{backgroundColor:u.minimize},expandButtonExpanded:{backgroundColor:u.toggleMode},nightExpandedContainer:{backgroundColor:e.color.surface,borderColor:e.color.border},nightMinimizeButton:{backgroundColor:e.color.warningSoft,borderWidth:1,borderColor:e.color.warning+"59"},nightToggleButton:{backgroundColor:e.color.accentSoft,borderWidth:1,borderColor:e.color.accentBorderStrong},nightCloseButton:{backgroundColor:e.color.dangerSoft,borderWidth:1,borderColor:e.color.danger+"59"}});
1
+ "use strict";import{useState as F,useRef as W,useCallback as C,useEffect as j}from"react";import{View as d,TouchableOpacity as s,StyleSheet as V,Animated as f,Platform as U,Keyboard as X}from"react-native";import{X as A,Minus as I,DockBottom as P,FloatWindow as R}from"../../icons/index.js";import{buoyColors as N}from"../gameUI/constants/gameUIColors.js";import{night as e}from"../night/nightTheme.js";import{expandableWindowControlsSupported as Z,isExpandableWindowControlsEnabled as G}from"./windowControlsSetting.js";import{jsx as t,jsxs as w,Fragment as H}from"react/jsx-runtime";export{setExpandableWindowControls}from"./windowControlsSetting.js";const u={close:"#FF5F57",minimize:"#FEBC2E",toggleMode:"#28C840"};const B=12;const K=8;const g=8;const x=36;const q=12;const z=16;const b=8;const J=3e3;export function WindowControls({onClose:p,onMinimize:i,onToggleMode:r,mode:l,variant:D="night",defaultExpanded:h}){const n=l==="floating"?P:R;const E=l==="floating"?"Dock to bottom sheet":"Make floating window";if(!G()||!Z(U.OS==="web")){return w(d,{style:o.container,children:[i&&t(s,{onPress:i,style:[o.dot,o.minimizeDot],activeOpacity:.8,accessibilityLabel:"Minimize modal",accessibilityRole:"button",children:t(I,{size:g,color:"#7A5A00",strokeWidth:1.5})}),r&&t(s,{onPress:r,style:[o.dot,o.expandDot],activeOpacity:.8,accessibilityLabel:E,accessibilityRole:"button",children:t(n,{size:g,color:"#004A1A",strokeWidth:1.5})}),t(s,{onPress:p,style:[o.dot,o.closeDot],activeOpacity:.8,accessibilityLabel:"Close modal",testID:"tool-window-close",accessibilityRole:"button",children:t(A,{size:g,color:"#4A0000",strokeWidth:1.5})})]})}return t(Q,{onClose:p,onMinimize:i,onToggleMode:r,mode:l,variant:D,defaultExpanded:h})}function Q({onClose:p,onMinimize:i,onToggleMode:r,mode:l,variant:D="night",defaultExpanded:h=false}){const n=D==="night";const[E,O]=F(h);const a=W(new f.Value(h?1:0)).current;const m=W(null);const S=l==="floating"?P:R;const T=l==="floating"?"Dock to bottom sheet":"Make floating window";const c=C(()=>{if(m.current){clearTimeout(m.current);m.current=null}},[]);const y=C(()=>{c();f.spring(a,{toValue:0,tension:200,friction:20,useNativeDriver:false}).start(()=>{O(false)})},[a,c]);const _=C(()=>{X.dismiss();O(true);f.spring(a,{toValue:1,tension:180,friction:18,useNativeDriver:false}).start();c();m.current=setTimeout(y,J)},[a,y,c]);j(()=>{return c},[c]);const k=C(M=>{y();M()},[y]);const v=a.interpolate({inputRange:[0,1],outputRange:[.3,1]});const L=a.interpolate({inputRange:[0,.5,1],outputRange:[0,.8,1]});return w(H,{children:[t(s,{onPress:_,activeOpacity:.7,accessibilityLabel:"Open window controls",testID:"tool-window-controls",accessibilityRole:"button",style:o.trigger,hitSlop:{top:8,bottom:8,left:8,right:8},children:w(d,{style:o.container,children:[i&&t(d,{style:[o.dot,o.minimizeDot],children:t(I,{size:g,color:"#7A5A00",strokeWidth:1.5})}),r&&t(d,{style:[o.dot,o.expandDot],children:t(S,{size:g,color:"#004A1A",strokeWidth:1.5})}),t(d,{style:[o.dot,o.closeDot],children:t(A,{size:g,color:"#4A0000",strokeWidth:1.5})})]})}),E&&t(f.View,{style:[o.expandedPanelInline,{transform:[{scale:v}],opacity:L}],children:w(d,{style:[o.expandedContainer,n&&o.nightExpandedContainer],children:[i&&t(s,{onPress:()=>k(i),style:[o.expandedButton,n?o.nightMinimizeButton:o.minimizeButtonExpanded],activeOpacity:.7,accessibilityLabel:"Minimize modal",testID:"tool-window-minimize",accessibilityRole:"button",children:t(I,{size:z,color:n?e.color.warning:"#7A5A00",strokeWidth:2})}),r&&t(s,{onPress:()=>k(r),style:[o.expandedButton,n?o.nightToggleButton:o.expandButtonExpanded],activeOpacity:.7,accessibilityLabel:T,testID:"tool-window-mode",accessibilityRole:"button",children:t(S,{size:z,color:n?e.color.accent:"#004A1A",strokeWidth:2})}),t(s,{onPress:()=>k(p),style:[o.expandedButton,n?o.nightCloseButton:o.closeButtonExpanded],activeOpacity:.7,accessibilityLabel:"Close modal",testID:"tool-window-close",accessibilityRole:"button",children:t(A,{size:z,color:n?e.color.danger:"#4A0000",strokeWidth:2})})]})})]})}const o=V.create({trigger:{padding:2},container:{flexDirection:"row",alignItems:"center",gap:K},dot:{width:B,height:B,borderRadius:B/2,alignItems:"center",justifyContent:"center"},closeDot:{backgroundColor:u.close},minimizeDot:{backgroundColor:u.minimize},expandDot:{backgroundColor:u.toggleMode},expandedPanelInline:{position:"absolute",top:-b,right:-b,zIndex:9999},expandedContainer:{flexDirection:"row",alignItems:"center",gap:q,backgroundColor:N.card,borderRadius:(x+b*2)/2,paddingHorizontal:b,paddingVertical:b,borderWidth:1,borderColor:N.border,shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.4,shadowRadius:12,elevation:30},expandedButton:{width:x,height:x,borderRadius:x/2,alignItems:"center",justifyContent:"center"},closeButtonExpanded:{backgroundColor:u.close},minimizeButtonExpanded:{backgroundColor:u.minimize},expandButtonExpanded:{backgroundColor:u.toggleMode},nightExpandedContainer:{backgroundColor:e.color.surface,borderColor:e.color.border},nightMinimizeButton:{backgroundColor:e.color.warningSoft,borderWidth:1,borderColor:e.color.warning+"59"},nightToggleButton:{backgroundColor:e.color.accentSoft,borderWidth:1,borderColor:e.color.accentBorderStrong},nightCloseButton:{backgroundColor:e.color.dangerSoft,borderWidth:1,borderColor:e.color.danger+"59"}});
@@ -1 +1 @@
1
- "use strict";import{useEffect as T,useMemo as mt,useRef as L,useState as F,useContext as Ot,createContext as At,useCallback as X,Children as gt}from"react";import{Animated as N,Dimensions as ct,useWindowDimensions as Et,View as Y,Text as yt,TouchableOpacity as Xt}from"react-native";import{night as W}from"../night/nightTheme.js";import{DraggableHeader as xt}from"../components/DraggableHeader.js";import{EnvironmentSelectorInline as Nt}from"../../env/EnvironmentSelectorInline";import{GripVerticalIcon as Yt}from"../components/GripVerticalIcon.js";import{buoyColors as V}from"../gameUI/constants/gameUIColors.js";import{getSafeAreaInsets as bt,persistentStorage as ot}from"../../utils/index.js";import{useSafeAreaInsets as Wt}from"../../hooks/index.js";import{calculateTargetPosition as zt}from"./onboardingConstants";import{getUserStatusConfig as Ht,filterValidChildren as Ut,floatingToolsColors as pt}from"@buoy-gg/floating-tools-core";import{jsx as R,jsxs as k}from"react/jsx-runtime";const it={BUBBLE_POSITION_X:"@react_buoy_bubble_position_x",BUBBLE_POSITION_Y:"@react_buoy_bubble_position_y"};const $=32;const y=20;const Ft=150;const C=u=>u.__getValue();function $t({animatedPosition:u,bubbleWidth:_=100,bubbleHeight:g=32,enabled:a=true,visibleHandleWidth:v=32,listenersSuspended:z=false,defaultPlacement:H="top",onPositionLoaded:Q,storageKey:p}){const[U,I]=F(false);const D=L(void 0);const x=L(true);T(()=>{x.current=true;return()=>{x.current=false;if(D.current){clearTimeout(D.current);D.current=void 0}}},[]);const O=X(async(c,m)=>{if(!a)return;if(!x.current)return;const{width:t}=ct.get("window");if(t<=0||c<0||m<0)return;try{await Promise.all([ot.setItem(p?`${p}:x`:it.BUBBLE_POSITION_X,c.toString()),ot.setItem(p?`${p}:y`:it.BUBBLE_POSITION_Y,m.toString())])}catch(o){}},[a,p]);const j=X((c,m)=>{if(!x.current)return;if(D.current)clearTimeout(D.current);D.current=setTimeout(()=>{if(x.current){O(c,m)}},500)},[O]);const G=X(async()=>{if(!a)return null;try{const[c,m]=await Promise.all([ot.getItem(p?`${p}:x`:it.BUBBLE_POSITION_X),ot.getItem(p?`${p}:y`:it.BUBBLE_POSITION_Y)]);if(c!==null&&m!==null){const t=parseFloat(c);const o=parseFloat(m);if(!Number.isNaN(t)&&!Number.isNaN(o)){return{x:t,y:o}}}}catch(c){}return null},[a,p]);const P=X(c=>{const{width:m,height:t}=ct.get("window");const o=bt();if(m<=0||t<=0){return{...c,isValid:false}}const A=o.left;const e=m-v;const E=o.top+y;const l=t-g-o.bottom;const d={x:Math.max(A,Math.min(c.x,e)),y:Math.max(E,Math.min(c.y,l)),isValid:true};return d},[v,g]);T(()=>{if(!a||U)return;let c=false;const m=async()=>{const t=await G();if(c||!x.current)return;const{width:o,height:A}=ct.get("window");const e=bt();if(o<=0||A<=0){setTimeout(()=>{if(x.current&&!c){m()}},100);return}let E;let l=false;if(t){const d=P(t);if(!d.isValid){setTimeout(()=>{if(x.current&&!c){m()}},100);return}const Z=Math.abs(t.x-d.x)>5||Math.abs(t.y-d.y)>5;if(Z){await O(d.x,d.y)}E={x:d.x,y:d.y};l=d.x>=o-v-5}else{const d=H==="bottom"?Math.max(e.top+y,A-g-e.bottom-y):Math.max(e.top+y,Math.min(100,A-g-e.bottom));E={x:o-_-y,y:d}}if(c||!x.current)return;u.setValue(E);I(true);Q?.(E,l)};m();return()=>{c=true}},[a,U,u,G,P,O,_,g,v,Q]);T(()=>{if(!a||!U||z)return;const c=u.addListener(m=>{j(m.x,m.y)});return()=>{u.removeListener(c);if(D.current){clearTimeout(D.current);D.current=void 0}}},[a,U,z,u,j]);return{savePosition:O,isInitialized:U}}export function Divider(){const u={width:1,height:12,backgroundColor:V.textMuted+"66",flexShrink:0};return R(Y,{style:u})}const jt={success:"#20C997",warning:"#FFA94D",error:"#EF4444",muted:V.textMuted,secondary:V.textSecondary,info:"#20C997",primary:"#20C997",optional:V.textSecondary};function kt(u){return Ht(u,jt)}const wt=At({isDragging:false});export function UserStatus({userRole:u,onPress:_}){const{isDragging:g}=Ot(wt);const a=kt(u);const v={flexDirection:"row",alignItems:"center",paddingVertical:6,paddingHorizontal:8,flexShrink:0};const z={width:6,height:6,borderRadius:3,backgroundColor:a.dotColor,marginRight:4};const H={fontSize:10,fontWeight:"500",color:a.textColor,letterSpacing:.3};if(!_){return k(Y,{style:v,accessibilityLabel:`User status: ${a.label}`,children:[R(Y,{style:z}),R(yt,{style:H,children:a.label})]})}return k(Xt,{accessibilityRole:"button",accessibilityLabel:"Open Dev Tools Menu",testID:"open-dev-tools-button",onPress:_,hitSlop:{top:10,bottom:10,left:0,right:10},disabled:g,activeOpacity:.85,style:v,children:[R(Y,{style:z}),R(yt,{style:H,children:a.label})]})}function Gt(u){const _=Ut(u);const g=[];_.forEach((a,v)=>{g.push(a);if(v<_.length-1)g.push(R(Divider,{},`divider-${v}`))});return g}export function FloatingTool({id:u,suspendPointerEvents:_=false,revealToken:g,variant:a="bubble",dragFromSurface:v=false,accessibilityLabel:z="Move dev tools bubble",minimizedStack:H,hasMinimizedStack:Q=false,accessory:p,handleAdornment:U,enablePositionPersistence:I=true,defaultPlacement:D="top",pushToSide:x=false,centerOnboarding:O=false,children:j,environment:G,availableEnvironments:P,onEnvironmentSwitch:c,showEnvironmentSelector:m=false}){const t=L(new N.ValueXY).current;const[o,A]=F(false);const[e,E]=F({width:100,height:32});const[l,d]=F(false);const[Z,St]=F(0);const[vt,It]=F(false);const f=L(null);const K=L(false);const q=L(false);const ut=L(x);const J=L(null);const[tt,Dt]=F(false);const h=Wt();const{width:i,height:S}=Et();const Mt=X((n,r)=>{if(r){d(true)}},[]);const{savePosition:w,isInitialized:B}=$t({animatedPosition:t,bubbleWidth:e.width,bubbleHeight:e.height,enabled:I,visibleHandleWidth:$,listenersSuspended:o,defaultPlacement:D,onPositionLoaded:Mt,storageKey:u?`@buoy/floating-tool/${u}`:void 0});T(()=>{if(I&&!B)return;if(!ut.current&&x){q.current=false}ut.current=x;if(x&&!l&&!o&&!q.current){const n=C(t.x);const r=C(t.y);f.current={x:n,y:r};const s=i-$;K.current=true;d(true);N.timing(t,{toValue:{x:s,y:r},duration:200,useNativeDriver:false}).start(()=>{w(s,r)})}else if(!x&&l&&K.current){if(f.current){const{x:n,y:r}=f.current;K.current=false;q.current=false;d(false);N.timing(t,{toValue:{x:n,y:r},duration:200,useNativeDriver:false}).start(()=>{w(n,r)})}}},[I,B,x,l,o,i,t,w]);T(()=>{if(!B||tt)return;const n=setTimeout(()=>{J.current=e.width;Dt(true);if(!l&&!o){const r=C(t.x);const s=i-e.width-y;if(r>s){const b=Math.max(h.left,s);const M=C(t.y);t.setValue({x:b,y:M});w(b,M)}}},Ft);return()=>clearTimeout(n)},[B,tt,e.width]);T(()=>{if(!B)return;if(!tt)return;if(J.current===null)return;if(o){J.current=e.width;return}const n=J.current;const r=e.width;const s=r-n;if(Math.abs(s)<2){return}J.current=r;if(l){if(f.current){const Vt=f.current.x-s;f.current.x=Math.max(h.left,Math.min(Vt,i-r-y))}return}const b=C(t.x);const M=C(t.y);const et=b-s;const rt=Math.max(h.left,Math.min(et,i-$));if(Math.abs(rt-b)>1){N.timing(t,{toValue:{x:rt,y:M},duration:150,useNativeDriver:false}).start(()=>{w(rt,M);if(f.current){f.current.x=rt}})}},[e.width,B,tt,o,l,t,i,h.left,w]);T(()=>{if(!I){if(O){const n=zt();const r=(i-e.width)/2;const s=S-e.height-n;t.setValue({x:r,y:s})}else{const n=D==="bottom"?Math.max(h.top+y,S-e.height-h.bottom-y):Math.max(h.top+y,Math.min(100,S-e.height-h.bottom));t.setValue({x:i-e.width-y,y:n})}}},[I,O,t,e.width,e.height,h.top,h.bottom,i,S]);const nt=X(()=>{const n=C(t.x);const r=C(t.y);const s=n>i-e.width/2;if(l||s){let b;let M;if(f.current&&f.current.x<i-e.width/2){b=f.current.x;M=f.current.y}else{b=i-e.width-y;M=r}K.current=false;q.current=true;d(false);N.timing(t,{toValue:{x:b,y:M},duration:200,useNativeDriver:false}).start(()=>{w(b,M)})}else{f.current={x:n,y:r};q.current=false;const b=i-$;d(true);N.timing(t,{toValue:{x:b,y:r},duration:200,useNativeDriver:false}).start(()=>{w(b,r)})}},[t,l,e.width,w,i]);const lt=X(()=>{A(true)},[]);const dt=X(n=>{let{x:r,y:s}=n;const b=r+e.width/2;const M=b>i;if(M){const et=i-$;d(true);if(f.current){f.current.y=s}else{f.current={x:i-e.width-y,y:s}}N.timing(t,{toValue:{x:et,y:s},duration:200,useNativeDriver:false}).start(()=>{w(et,s)})}else{if(l&&r<i-$-10){d(false)}if(r<i-e.width/2){f.current={x:r,y:s}}w(r,s)}A(false)},[t,e.width,l,w,i]);const st=L({width:i,height:S});T(()=>{if(I&&!B)return;if(st.current.width===i&&st.current.height===S)return;st.current={width:i,height:S};const n=s=>({x:Math.max(h.left,Math.min(s.x,i-e.width-y)),y:Math.max(h.top+y,Math.min(s.y,S-e.height-h.bottom))});const r=n({x:C(t.x),y:C(t.y)});if(l)r.x=i-$;if(f.current)f.current=n(f.current);t.stopAnimation();t.setValue(r);void w(r.x,r.y)},[i,S,B,I,e,h,l,t,w]);const ft=Boolean(p);T(()=>{if(!ft)return;const n=({y:s})=>It(s+e.height+Z>S-h.bottom);n({y:C(t.y)});const r=t.addListener(n);return()=>t.removeListener(r)},[t,e.height,Z,S,h.bottom,ft]);const Rt=mt(()=>({position:"absolute",zIndex:1001,transform:t.getTranslateTransform()}),[t]);const ht=L(void 0);T(()=>{if(I&&!B)return;if(ht.current===g)return;ht.current=g;if(g!==void 0&&g>0&&l)nt()},[g,B,I,l,nt]);const at=Q;const Bt={flexDirection:"row",alignItems:"center",backgroundColor:V.card,borderTopLeftRadius:at?0:6,borderTopRightRadius:6,borderBottomLeftRadius:6,borderBottomRightRadius:6,borderLeftWidth:o?2:1,borderRightWidth:o?2:1,borderBottomWidth:o?2:1,borderTopWidth:o?2:at?0:1,borderColor:o?pt.dragActive:V.textMuted+"66",overflow:"visible",elevation:8,shadowColor:o?pt.dragActive+"99":"#000",shadowOffset:{width:0,height:o?6:4},shadowOpacity:o?.6:.3,shadowRadius:o?12:8,...a==="strip"?{borderRadius:W.radius.card,borderTopLeftRadius:W.radius.card,borderTopRightRadius:W.radius.card,borderBottomLeftRadius:W.radius.card,borderBottomRightRadius:W.radius.card,minHeight:48,backgroundColor:W.color.surface,borderColor:o?W.color.accentBorderStrong:W.color.separator,shadowOpacity:.24,shadowRadius:16}:{}};const Ct={paddingHorizontal:6,paddingVertical:6,backgroundColor:V.textMuted+"1A",alignItems:"center",justifyContent:"center",width:32,...a==="strip"?{minHeight:48}:{},borderRightWidth:1,borderRightColor:V.textMuted+"66",borderTopLeftRadius:at?0:void 0,...a==="strip"?{backgroundColor:"transparent",borderRightWidth:0}:{}};const _t={flexDirection:"row",alignItems:"center",gap:6,paddingRight:8};const Tt=mt(()=>a==="strip"?gt.toArray(j):Gt(gt.toArray(j)),[j,a]);const Lt=32;if(I&&!B){return null}return R(N.View,{pointerEvents:_?"none":"box-none",testID:u??"buoy-floating-tool",style:Rt,children:k(Y,{style:{overflow:"visible"},children:[H&&R(Y,{style:{position:"absolute",bottom:"100%",left:0,width:Lt,overflow:"visible",zIndex:1001},children:H}),k(xt,{position:t,enabled:v,claimOnMove:false,onDragStart:lt,onDragEnd:dt,containerBounds:{width:i,height:S},elementSize:e,minPosition:{x:h.left,y:h.top+y},maxOverflowX:e.width,hitSlop:{top:10,bottom:10,left:10,right:10},style:Bt,onLayout:n=>{const{width:r,height:s}=n.nativeEvent.layout;E({width:r,height:s})},children:[k(xt,{position:t,testID:u?`${u}-grip`:"buoy-floating-grip",accessibilityLabel:z,onDragStart:lt,onDragEnd:dt,onTap:nt,containerBounds:{width:i,height:S},elementSize:e,minPosition:{x:h.left,y:h.top+y},style:Ct,enabled:true,maxOverflowX:e.width,children:[R(Yt,{size:a==="strip"?20:12,color:V.textSecondary+"CC"}),U]}),R(wt.Provider,{value:{isDragging:o},children:k(Y,{style:_t,children:[m&&G&&P&&c&&R(Nt,{currentEnvironment:G,availableEnvironments:P,onSelect:c}),Tt]})})]}),!l&&p&&R(Y,{onLayout:n=>St(n.nativeEvent.layout.height),style:{position:"absolute",...vt?{bottom:"100%"}:{top:"100%"},left:0,width:"100%",zIndex:1002},children:p})]})})}export function getBubbleAnchorPosition(){return null}
1
+ "use strict";import{useEffect as _,useMemo as pt,useRef as V,useState as N,useContext as Xt,createContext as Yt,useCallback as W,Children as bt}from"react";import{Animated as z,Dimensions as dt,useWindowDimensions as Nt,View as H,Text as wt,TouchableOpacity as Wt}from"react-native";import{night as U}from"../night/nightTheme.js";import{DraggableHeader as St}from"../components/DraggableHeader.js";import{EnvironmentSelectorInline as zt}from"../../env/EnvironmentSelectorInline";import{GripVerticalIcon as Ht}from"../components/GripVerticalIcon.js";import{buoyColors as A}from"../gameUI/constants/gameUIColors.js";import{getSafeAreaInsets as vt,persistentStorage as it}from"../../utils/index.js";import{useSafeAreaInsets as Ut}from"../../hooks/index.js";import{calculateTargetPosition as Ft}from"./onboardingConstants";import{getUserStatusConfig as $t,filterValidChildren as jt,floatingToolsColors as It}from"@buoy-gg/floating-tools-core";import{jsx as R,jsxs as J}from"react/jsx-runtime";const st={BUBBLE_POSITION_X:"@react_buoy_bubble_position_x",BUBBLE_POSITION_Y:"@react_buoy_bubble_position_y"};const G=32;const d=20;const kt=150;const S=f=>f.__getValue();function Gt({animatedPosition:f,bubbleWidth:T=100,bubbleHeight:x=32,enabled:u=true,visibleHandleWidth:M=32,listenersSuspended:F=false,skipAutoSaveRef:E,defaultPlacement:at="top",bottomClearance:Q=0,onPositionLoaded:nt,storageKey:h}){const[B,$]=N(false);const y=V(void 0);const D=V(true);_(()=>{D.current=true;return()=>{D.current=false;if(y.current){clearTimeout(y.current);y.current=void 0}}},[]);const C=W(async(l,t)=>{if(!u)return;if(!D.current)return;const{width:o}=dt.get("window");if(o<=0||l<0||t<0)return;try{await Promise.all([it.setItem(h?`${h}:x`:st.BUBBLE_POSITION_X,l.toString()),it.setItem(h?`${h}:y`:st.BUBBLE_POSITION_Y,t.toString())])}catch(v){}},[u,h]);const Z=W((l,t)=>{if(!D.current)return;if(y.current)clearTimeout(y.current);y.current=setTimeout(()=>{if(D.current){C(l,t)}},500)},[C]);const K=W(async()=>{if(!u)return null;try{const[l,t]=await Promise.all([it.getItem(h?`${h}:x`:st.BUBBLE_POSITION_X),it.getItem(h?`${h}:y`:st.BUBBLE_POSITION_Y)]);if(l!==null&&t!==null){const o=parseFloat(l);const v=parseFloat(t);if(!Number.isNaN(o)&&!Number.isNaN(v)){return{x:o,y:v}}}}catch(l){}return null},[u,h]);const tt=W(l=>{const{width:t,height:o}=dt.get("window");const v=vt();if(t<=0||o<=0){return{...l,isValid:false}}const e=v.left;const X=t-M;const L=v.top+d;const P=o-x-v.bottom;const n={x:Math.max(e,Math.min(l.x,X)),y:Math.max(L,Math.min(l.y,P)),isValid:true};return n},[M,x]);_(()=>{if(!u||B)return;let l=false;const t=async()=>{const o=await K();if(l||!D.current)return;const{width:v,height:e}=dt.get("window");const X=vt();if(v<=0||e<=0){setTimeout(()=>{if(D.current&&!l){t()}},100);return}let L;let P=false;if(o){const n=tt(o);if(!n.isValid){setTimeout(()=>{if(D.current&&!l){t()}},100);return}const O=Math.abs(o.x-n.x)>5||Math.abs(o.y-n.y)>5;if(O){await C(n.x,n.y)}L={x:n.x,y:n.y};P=n.x>=v-M-5}else{const n=at==="bottom"?Math.max(X.top+d,e-x-X.bottom-d-Q):Math.max(X.top+d,Math.min(100,e-x-X.bottom));L={x:v-T-d,y:n}}if(l||!D.current)return;f.setValue(L);$(true);nt?.(L,P)};t();return()=>{l=true}},[u,B,f,K,tt,C,T,x,M,nt]);_(()=>{if(!u||!B||F)return;const l=f.addListener(t=>{if(E?.current)return;Z(t.x,t.y)});return()=>{f.removeListener(l);if(y.current){clearTimeout(y.current);y.current=void 0}}},[u,B,F,E,f,Z]);return{savePosition:C,isInitialized:B}}export function Divider(){const f={width:1,height:12,backgroundColor:A.textMuted+"66",flexShrink:0};return R(H,{style:f})}const Pt={success:"#20C997",warning:"#FFA94D",error:"#EF4444",muted:A.textMuted,secondary:A.textSecondary,info:"#20C997",primary:"#20C997",optional:A.textSecondary};function qt(f){return $t(f,Pt)}const Mt=Yt({isDragging:false});export function UserStatus({userRole:f,onPress:T}){const{isDragging:x}=Xt(Mt);const u=qt(f);const M={flexDirection:"row",alignItems:"center",paddingVertical:6,paddingHorizontal:8,flexShrink:0};const F={width:6,height:6,borderRadius:3,backgroundColor:u.dotColor,marginRight:4};const E={fontSize:10,fontWeight:"500",color:u.textColor,letterSpacing:.3};if(!T){return J(H,{style:M,accessibilityLabel:`User status: ${u.label}`,children:[R(H,{style:F}),R(wt,{style:E,children:u.label})]})}return J(Wt,{accessibilityRole:"button",accessibilityLabel:"Open Dev Tools Menu",testID:"open-dev-tools-button",onPress:T,hitSlop:{top:10,bottom:10,left:0,right:10},disabled:x,activeOpacity:.85,style:M,children:[R(H,{style:F}),R(wt,{style:E,children:u.label})]})}function Jt(f){const T=jt(f);const x=[];T.forEach((u,M)=>{x.push(u);if(M<T.length-1)x.push(R(Divider,{},`divider-${M}`))});return x}export function FloatingTool({id:f,suspendPointerEvents:T=false,revealToken:x,variant:u="bubble",dragFromSurface:M=false,accessibilityLabel:F="Move dev tools bubble",minimizedStack:E,hasMinimizedStack:at=false,accessory:Q,handleAdornment:nt,enablePositionPersistence:h=true,defaultPlacement:B="top",bottomClearance:$=0,pushToSide:y=false,centerOnboarding:D=false,children:C,environment:Z,availableEnvironments:K,onEnvironmentSwitch:tt,showEnvironmentSelector:l=false}){const t=V(new z.ValueXY).current;const[o,v]=N(false);const[e,X]=N({width:100,height:32});const[L,P]=N(false);const[n,O]=N(false);const[ft,Dt]=N(0);const[Rt,Bt]=N(false);const g=V(null);const Y=V(false);const et=V(false);const ht=V(y);const rt=V(null);const[q,_t]=N(false);const c=Ut();const{width:a,height:p}=Nt();const Tt=W((i,r)=>{if(r){O(true)}},[]);const{savePosition:b,isInitialized:I}=Gt({animatedPosition:t,bubbleWidth:e.width,bubbleHeight:e.height,enabled:h,visibleHandleWidth:G,listenersSuspended:o,skipAutoSaveRef:Y,defaultPlacement:B,bottomClearance:$,onPositionLoaded:Tt,storageKey:f?`@buoy/floating-tool/${f}`:void 0});_(()=>{if(h&&!I)return;if(!ht.current&&y){et.current=false}ht.current=y;if(y&&!n&&!o&&!et.current){const i=S(t.x);const r=S(t.y);g.current={x:i,y:r};const s=a-G;Y.current=true;O(true);z.timing(t,{toValue:{x:s,y:r},duration:200,useNativeDriver:false}).start()}else if(!y&&n&&Y.current){if(g.current){const{x:i,y:r}=g.current;Y.current=false;et.current=false;O(false);z.timing(t,{toValue:{x:i,y:r},duration:200,useNativeDriver:false}).start(()=>{b(i,r)})}}},[h,I,y,n,o,a,t,b]);_(()=>{if(!I||q)return;const i=setTimeout(()=>{rt.current=e.width;_t(true);if(!n&&!o){const r=S(t.x);const s=a-e.width-d;if(r>s){const m=Math.max(c.left,s);const w=S(t.y);t.setValue({x:m,y:w});b(m,w)}}},kt);return()=>clearTimeout(i)},[I,q,e.width]);_(()=>{if(!I||!q||n||o)return;const i=S(t.y);const r=p-e.height-c.bottom-d-(B==="bottom"?$:0);if(i<=r)return;const s=S(t.x);const m=Math.max(c.top+d,r);t.setValue({x:s,y:m});b(s,m)},[I,q,n,o,e.height,p,c.top,c.bottom,$,B]);_(()=>{if(!I)return;if(!q)return;if(rt.current===null)return;if(o){rt.current=e.width;return}const i=rt.current;const r=e.width;const s=r-i;if(Math.abs(s)<2){return}rt.current=r;if(n){if(g.current){const ot=g.current.x-s;g.current.x=Math.max(c.left,Math.min(ot,a-r-d))}return}const m=S(t.x);const w=S(t.y);const j=m-s;const k=Math.max(c.left,Math.min(j,a-G));if(Math.abs(k-m)>1){z.timing(t,{toValue:{x:k,y:w},duration:150,useNativeDriver:false}).start(()=>{b(k,w);if(g.current){g.current.x=k}})}},[e.width,I,q,o,n,t,a,c.left,b]);_(()=>{if(!h){if(D){const i=Ft();const r=(a-e.width)/2;const s=p-e.height-i;t.setValue({x:r,y:s})}else{const i=B==="bottom"?Math.max(c.top+d,p-e.height-c.bottom-d-$):Math.max(c.top+d,Math.min(100,p-e.height-c.bottom));t.setValue({x:a-e.width-d,y:i})}}},[h,D,t,e.width,e.height,c.top,c.bottom,a,p]);const ct=W(()=>{const i=S(t.x);const r=S(t.y);const s=i>a-e.width/2;if(n||s){let m;let w;if(g.current&&g.current.x<a-e.width/2){m=g.current.x;w=g.current.y}else{m=a-e.width-d;w=r}Y.current=false;et.current=true;O(false);z.timing(t,{toValue:{x:m,y:w},duration:200,useNativeDriver:false}).start(()=>{b(m,w)})}else{g.current={x:i,y:r};et.current=false;const m=a-G;O(true);z.timing(t,{toValue:{x:m,y:r},duration:200,useNativeDriver:false}).start(()=>{b(m,r)})}},[t,n,e.width,b,a]);const mt=W(()=>{v(true)},[]);const gt=W(i=>{let{x:r,y:s}=i;const m=r+e.width/2;const w=m>a;if(w){const j=a-G;O(true);if(g.current){g.current.y=s}else{g.current={x:a-e.width-d,y:s}}z.timing(t,{toValue:{x:j,y:s},duration:200,useNativeDriver:false}).start(()=>{b(j,s)})}else{if(n&&r<a-G-10){O(false);Y.current=false}if(r<a-e.width/2){g.current={x:r,y:s}}b(r,s)}v(false)},[t,e.width,n,b,a]);const ut=V({width:a,height:p});_(()=>{if(h&&!I)return;if(ut.current.width===a&&ut.current.height===p)return;ut.current={width:a,height:p};const i=s=>({x:Math.max(c.left,Math.min(s.x,a-e.width-d)),y:Math.max(c.top+d,Math.min(s.y,p-e.height-c.bottom))});const r=i({x:S(t.x),y:S(t.y)});if(n)r.x=a-G;if(g.current)g.current=i(g.current);t.stopAnimation();t.setValue(r);if(Y.current)return;void b(r.x,r.y)},[a,p,I,h,e,c,n,t,b]);const xt=Boolean(Q);_(()=>{if(!xt)return;const i=({y:s})=>Bt(s+e.height+ft>p-c.bottom);i({y:S(t.y)});const r=t.addListener(i);return()=>t.removeListener(r)},[t,e.height,ft,p,c.bottom,xt]);const Lt=pt(()=>({position:"absolute",zIndex:1001,opacity:L?1:0,transform:t.getTranslateTransform()}),[t,L]);const yt=V(void 0);_(()=>{if(h&&!I)return;if(yt.current===x)return;yt.current=x;if(x!==void 0&&x>0&&n)ct()},[x,I,h,n,ct]);const lt=at;const Vt={flexDirection:"row",alignItems:"center",backgroundColor:A.card,borderTopLeftRadius:lt?0:6,borderTopRightRadius:6,borderBottomLeftRadius:6,borderBottomRightRadius:6,borderLeftWidth:o?2:1,borderRightWidth:o?2:1,borderBottomWidth:o?2:1,borderTopWidth:o?2:lt?0:1,borderColor:o?It.dragActive:A.textMuted+"66",overflow:"visible",elevation:8,shadowColor:o?It.dragActive+"99":"#000",shadowOffset:{width:0,height:o?6:4},shadowOpacity:o?.6:.3,shadowRadius:o?12:8,...u==="strip"?{borderRadius:U.radius.card,borderTopLeftRadius:U.radius.card,borderTopRightRadius:U.radius.card,borderBottomLeftRadius:U.radius.card,borderBottomRightRadius:U.radius.card,minHeight:48,backgroundColor:U.color.surface,borderColor:o?U.color.accentBorderStrong:U.color.separator,shadowOpacity:.24,shadowRadius:16}:{}};const Ct={paddingHorizontal:6,paddingVertical:6,backgroundColor:A.textMuted+"1A",alignItems:"center",justifyContent:"center",width:32,...u==="strip"?{minHeight:48}:{},borderRightWidth:1,borderRightColor:A.textMuted+"66",borderTopLeftRadius:lt?0:void 0,...u==="strip"?{backgroundColor:"transparent",borderRightWidth:0}:{}};const Ot={flexDirection:"row",alignItems:"center",gap:6,paddingRight:8};const At=pt(()=>u==="strip"?bt.toArray(C):Jt(bt.toArray(C)),[C,u]);const Et=32;if(h&&!I){return null}return R(z.View,{pointerEvents:T?"none":"box-none",testID:f??"buoy-floating-tool",style:Lt,children:J(H,{style:{overflow:"visible"},children:[E&&R(H,{style:{position:"absolute",bottom:"100%",left:0,width:Et,overflow:"visible",zIndex:1001},children:E}),J(St,{position:t,enabled:M,claimOnMove:false,onDragStart:mt,onDragEnd:gt,containerBounds:{width:a,height:p},elementSize:e,minPosition:{x:c.left,y:c.top+d},maxOverflowX:e.width,hitSlop:{top:10,bottom:10,left:10,right:10},style:Vt,onLayout:i=>{const{width:r,height:s}=i.nativeEvent.layout;X({width:r,height:s});if(L)return;P(true);if(n||o||Y.current)return;const m=S(t.x);const w=S(t.y);const j=a-r-d;const k=p-s-c.bottom-d-(B==="bottom"?$:0);if(m<=j&&w<=k)return;const ot={x:Math.max(c.left,Math.min(m,j)),y:Math.max(c.top+d,Math.min(w,k))};t.setValue(ot);b(ot.x,ot.y)},children:[J(St,{position:t,testID:f?`${f}-grip`:"buoy-floating-grip",accessibilityLabel:F,onDragStart:mt,onDragEnd:gt,onTap:ct,containerBounds:{width:a,height:p},elementSize:e,minPosition:{x:c.left,y:c.top+d},style:Ct,enabled:true,maxOverflowX:e.width,children:[R(Ht,{size:u==="strip"?20:12,color:A.textSecondary+"CC"}),nt]}),R(Mt.Provider,{value:{isDragging:o},children:J(H,{style:Ot,children:[l&&Z&&K&&tt&&R(zt,{currentEnvironment:Z,availableEnvironments:K,onSelect:tt}),At]})})]}),!n&&Q&&R(H,{onLayout:i=>Dt(i.nativeEvent.layout.height),style:{position:"absolute",...Rt?{bottom:"100%"}:{top:"100%"},left:0,width:"100%",zIndex:1002},children:Q})]})})}export function getBubbleAnchorPosition(){return null}
@@ -1 +1 @@
1
- "use strict";export const CLIP_OFFSCREEN_CELLS=!(typeof process!=="undefined"&&process.env?.EXPO_PUBLIC_E2E);export const EVENT_LIST_PRESET={initialNumToRender:12,maxToRenderPerBatch:8,windowSize:5,updateCellsBatchingPeriod:50,removeClippedSubviews:CLIP_OFFSCREEN_CELLS};export const LOG_LIST_PRESET={initialNumToRender:30,maxToRenderPerBatch:30,windowSize:21,removeClippedSubviews:CLIP_OFFSCREEN_CELLS};
1
+ "use strict";import{Platform as o}from"react-native";export const CLIP_OFFSCREEN_CELLS=!(typeof process!=="undefined"&&process.env?.EXPO_PUBLIC_E2E);const e={keyboardShouldPersistTaps:"handled",keyboardDismissMode:o.OS==="web"?"none":"on-drag"};export const EVENT_LIST_PRESET={initialNumToRender:12,maxToRenderPerBatch:8,windowSize:5,updateCellsBatchingPeriod:50,removeClippedSubviews:CLIP_OFFSCREEN_CELLS,...e};export const LOG_LIST_PRESET={initialNumToRender:30,maxToRenderPerBatch:30,windowSize:21,removeClippedSubviews:CLIP_OFFSCREEN_CELLS,...e};
@@ -1 +1 @@
1
- "use strict";export{absoluteFill}from"./absoluteFill.js";export{displayValue,parseDisplayValue}from"./displayValue.js";export{getSafeAreaInsets}from"./getSafeAreaInsets";export{persistentStorage,isUsingPersistentStorage,getStorageBackendType}from"./persistentStorage";export{safeStringify}from"./safeStringify.js";export{getValueType,isPrimitive,isJsonSerializable,isValidJson,getConstructorName,isEmpty,getValueSize}from"./typeHelpers.js";export{parseValue,formatValue,getTypeColor,truncateText,flattenObject,formatPath}from"./valueFormatting.js";export{loadOptionalModule,getCachedOptionalModule}from"./loadOptionalModule.js";export{setRenderCaptureProvider,getRenderCaptureProvider}from"./renderCaptureRegistry.js";export{registerStateSnapshotProvider,getStateSnapshotProviders,getStateSnapshotProvider,subscribeToStateSnapshotProviders}from"./stateSnapshotRegistry.js";export{serialize as superJsonSerialize,deserialize as superJsonDeserialize,dropAnnotations as superJsonDropAnnotations}from"./minimalSuperJSON.js";export{reloadApp,scheduleReloadApp,resolveReloadStrategy,REMOTE_RELOAD_DELAY_MS}from"./reloadApp.js";export{getDevServerOrigin}from"./devServer";export{realNow}from"./realNow.js";export{getRealAppState,subscribeRealAppState,BUOY_SYNTHETIC_MARK,countBuoyListener}from"./realAppState.js";export{Subscribable}from"./subscribable.js";export{subscriberCountNotifier,subscribeToSubscriberCountChanges,notifySubscriberCountChange}from"./subscriberCountNotifier.js";export{useSafeRouter,useSafePathname,useSafeSegments,useSafeGlobalSearchParams,getSafeRouter,getSafeCurrentPathname,getSafeCurrentRoute,isExpoRouterAvailable}from"./safeExpoRouter";export{getBrowserStorage,subscribeToBrowserStorage}from"./browserAsyncStorage.js";export{browserRouter,getBrowserHref,getBrowserRouteURL,registerBrowserRouter,subscribeBrowserNavigation}from"./browserNavigation.js";export{isDOMElement,getDOMControlProps,getDOMFiber,getDOMNodeHandle,getDOMPublicInstance,resolveDOMEventEmitter}from"./domRuntime.js";export{registerToolModules,getRegisteredToolModule,getToolModuleVersion}from"./toolModules.js";export{loadToolModule}from"./loadToolModule";
1
+ "use strict";export{absoluteFill}from"./absoluteFill.js";export{displayValue,parseDisplayValue}from"./displayValue.js";export{getSafeAreaInsets}from"./getSafeAreaInsets";export{persistentStorage,setItemChecked,isUsingPersistentStorage,getStorageBackendType}from"./persistentStorage";export{safeStringify}from"./safeStringify.js";export{getValueType,isPrimitive,isJsonSerializable,isValidJson,getConstructorName,isEmpty,getValueSize}from"./typeHelpers.js";export{parseValue,formatValue,getTypeColor,truncateText,flattenObject,formatPath}from"./valueFormatting.js";export{loadOptionalModule,getCachedOptionalModule}from"./loadOptionalModule.js";export{setRenderCaptureProvider,getRenderCaptureProvider}from"./renderCaptureRegistry.js";export{registerStateSnapshotProvider,getStateSnapshotProviders,getStateSnapshotProvider,subscribeToStateSnapshotProviders}from"./stateSnapshotRegistry.js";export{serialize as superJsonSerialize,deserialize as superJsonDeserialize,dropAnnotations as superJsonDropAnnotations}from"./minimalSuperJSON.js";export{reloadApp,scheduleReloadApp,resolveReloadStrategy,REMOTE_RELOAD_DELAY_MS}from"./reloadApp.js";export{getDevServerOrigin}from"./devServer";export{realNow}from"./realNow.js";export{getRealAppState,subscribeRealAppState,BUOY_SYNTHETIC_MARK,countBuoyListener}from"./realAppState.js";export{Subscribable}from"./subscribable.js";export{subscriberCountNotifier,subscribeToSubscriberCountChanges,notifySubscriberCountChange}from"./subscriberCountNotifier.js";export{useSafeRouter,useSafePathname,useSafeSegments,useSafeGlobalSearchParams,getSafeRouter,getSafeCurrentPathname,getSafeCurrentRoute,isExpoRouterAvailable}from"./safeExpoRouter";export{getBrowserStorage,subscribeToBrowserStorage}from"./browserAsyncStorage.js";export{browserRouter,getBrowserHref,getBrowserRouteURL,registerBrowserRouter,subscribeBrowserNavigation}from"./browserNavigation.js";export{isDOMElement,getDOMControlProps,getDOMFiber,getDOMNodeHandle,getDOMPublicInstance,resolveDOMEventEmitter}from"./domRuntime.js";export{registerToolModules,getRegisteredToolModule,getToolModuleVersion}from"./toolModules.js";export{loadToolModule}from"./loadToolModule";