@buoy-gg/shared-ui 7.0.85 → 7.0.86

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 (40) hide show
  1. package/lib/commonjs/JsModal.js +1 -1
  2. package/lib/commonjs/JsModal.web.js +1 -1
  3. package/lib/commonjs/index.js +1 -1
  4. package/lib/commonjs/license/AccountSetupContent.js +1 -1
  5. package/lib/commonjs/license/index.js +1 -1
  6. package/lib/commonjs/license/licenseModule.js +1 -1
  7. package/lib/commonjs/license/releaseSimulation.js +1 -0
  8. package/lib/commonjs/license/tierLimits.js +1 -1
  9. package/lib/commonjs/ui/floating/FloatingTool.js +1 -1
  10. package/lib/commonjs/ui/floating/FloatingTool.web.js +1 -1
  11. package/lib/module/JsModal.js +1 -1
  12. package/lib/module/JsModal.web.js +1 -1
  13. package/lib/module/index.js +1 -1
  14. package/lib/module/license/AccountSetupContent.js +1 -1
  15. package/lib/module/license/index.js +1 -1
  16. package/lib/module/license/licenseModule.js +1 -1
  17. package/lib/module/license/releaseSimulation.js +1 -0
  18. package/lib/module/license/tierLimits.js +1 -1
  19. package/lib/module/ui/floating/FloatingTool.js +1 -1
  20. package/lib/module/ui/floating/FloatingTool.web.js +1 -1
  21. package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
  22. package/lib/typescript/commonjs/index.d.ts +3 -2
  23. package/lib/typescript/commonjs/license/index.d.ts +1 -1
  24. package/lib/typescript/commonjs/license/licenseModule.d.ts +10 -2
  25. package/lib/typescript/commonjs/license/releaseSimulation.d.ts +27 -0
  26. package/lib/typescript/commonjs/utils/stateSnapshotRegistry.d.ts +5 -0
  27. package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
  28. package/lib/typescript/module/index.d.ts +3 -2
  29. package/lib/typescript/module/license/index.d.ts +1 -1
  30. package/lib/typescript/module/license/licenseModule.d.ts +10 -2
  31. package/lib/typescript/module/license/releaseSimulation.d.ts +27 -0
  32. package/lib/typescript/module/utils/stateSnapshotRegistry.d.ts +5 -0
  33. package/lib/web/chunks/{chunk-4YIFUO7B.mjs → chunk-MGKPQCZU.mjs} +4 -4
  34. package/lib/web/chunks/chunk-TWVTG6LD.mjs +1 -0
  35. package/lib/web/dataViewer.mjs +1 -1
  36. package/lib/web/floating.mjs +1 -1
  37. package/lib/web/index.mjs +11 -11
  38. package/lib/web/ui.mjs +1 -1
  39. package/package.json +5 -5
  40. package/lib/web/chunks/chunk-4YLP5MMN.mjs +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.JsModal=void 0;var _licenseModule=require("./license/licenseModule.js");var _AccountSetup=require("./license/AccountSetup");var _react=require("react");var _reactNative=require("react-native");var _absoluteFill=require("./utils/absoluteFill.js");var _useSafeAreaInsets=require("./hooks/useSafeAreaInsets");var _index=require("./ui/gameUI/index.js");var _index2=require("./ui/components/index.js");var _ToolBackground=require("./ui/backgrounds/ToolBackground.js");var _nightTheme=require("./ui/night/nightTheme.js");var _persistentStorage=require("./utils/persistentStorage");var _modalStorage=require("./utils/modalStorage.js");var _devToolsStorageKeys=require("./storage/devToolsStorageKeys.js");var _index3=require("./context/index.js");var _jsxRuntime=require("react/jsx-runtime");const INSTANT_MODAL_ENTRANCE=true;const SCREEN=_reactNative.Dimensions.get("window");const MIN_HEIGHT=100;const DEFAULT_HEIGHT=400;const FLOATING_WIDTH=SCREEN.width;const FLOATING_HEIGHT=500;const FLOATING_MIN_WIDTH=SCREEN.width*.25;const FLOATING_MIN_HEIGHT=80;const WINDOW_CONTROLS_BAND=20;const KEYBOARD_FIELD_GAP=16;function useKeyboardLift(n,r){const x=(0,_react.useRef)(null);const b=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const c=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;(0,_react.useEffect)(()=>{if(!n||_reactNative.Platform.OS!=="ios")return;let D=0;const h=(l,f,y)=>{const H=(A,d)=>_reactNative.Animated.timing(A,{toValue:d,duration:y.duration||250,easing:_reactNative.Easing.bezier(.17,.59,.4,.77),useNativeDriver:false});_reactNative.Animated.parallel([H(b,l),H(c,f)]).start()};const i=l=>{const f=x.current;const y=++D;if(!f)return;const H=_reactNative.TextInput.State.currentlyFocusedInput();const A=d=>new Promise(C=>{if(!d?.measureInWindow)return C(null);d.measureInWindow((g,W,z,a)=>C({y:W,h:a}))});Promise.all([A(f),A(H)]).then(([d,C])=>{if(y!==D||!d)return;const g=_reactNative.Dimensions.get("window").height;const W=l.endCoordinates.screenY;const z=g-d.h;const a=g-W;const Z=Math.max(0,z-r-8);const $=Math.max(0,Math.min(a,Z));if(!C)return h($,Math.max(0,a-$),l);if(C.y<d.y||C.y>=d.y+d.h)return h(0,0,l);const ee=z+(C.y-d.y)+C.h;const T=ee+KEYBOARD_FIELD_GAP-W;const ce=Math.max(0,Math.min(T,$));h(ce,Math.max(0,a-ce),l)})};const V=l=>{D++;h(0,0,l)};const _=[_reactNative.Keyboard.addListener("keyboardWillChangeFrame",i),_reactNative.Keyboard.addListener("keyboardWillShow",i),_reactNative.Keyboard.addListener("keyboardWillHide",V)];return()=>{D++;_.forEach(l=>l.remove());b.stopAnimation();c.stopAnimation();b.setValue(0);c.setValue(0)}},[n,r,b,c]);const B=(0,_react.useRef)(_reactNative.Animated.multiply(b,-1)).current;return{sheetRef:x,lift:b,raise:B,pad:c}}const DragIndicator=(0,_react.memo)(function n({isResizing:r,mode:x,hasCustomContent:b=false,variant:c="default"}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.dragIndicatorContainer,b&&styles.dragIndicatorContainerCustom],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.dragIndicator,x==="floating"&&styles.floatingDragIndicator,r&&styles.dragIndicatorActive,c==="night"&&styles.nightDragIndicator]}),r&&x==="bottomSheet"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.resizeGripContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.resizeGripLine}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.resizeGripLine}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.resizeGripLine})]})]})});const CornerHandle=(0,_react.memo)(function n({position:r,isActive:x}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.cornerHandle],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.handler,x&&styles.handlerActive]})})});const ModalHeader=(0,_react.memo)(function n({header:r,onClose:x,onToggleMode:b,onMinimize:c,isResizing:B,mode:D,panHandlers:h,variant:i="default"}){const V=(0,_react.useRef)(0);const _=(0,_react.useRef)(0);const l=(0,_react.useRef)(null);const f=(0,_react.useCallback)(()=>{const d=Date.now();const C=d-V.current;if(C>500){_.current=0}_.current++;V.current=d;if(l.current){clearTimeout(l.current)}l.current=setTimeout(()=>{if(_.current===2){b()}else if(_.current>=3){if(c){c()}}_.current=0},300)},[b,c]);(0,_react.useEffect)(()=>{return()=>{if(l.current){clearTimeout(l.current)}}},[]);const y=h?h:{};const H=!!h;if(r?.customContent){const d=(0,_react.isValidElement)(r.customContent)&&typeof r.customContent.type==="function"&&r.customContent.type.name==="CyberpunkModalHeader";if(d){return(0,_react.cloneElement)(r.customContent,{onToggleMode:b,onClose:x,mode:D,panHandlers:y,showToggleButton:r?.showToggleButton!==false,hideCloseButton:r?.hideCloseButton})}let C=r.customContent;if((0,_react.isValidElement)(r.customContent)&&c){C=(0,_react.cloneElement)(r.customContent,{onMinimize:c})}const g=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerInner,children:[(0,_jsxRuntime.jsx)(DragIndicator,{isResizing:B,mode:D,hasCustomContent:true,variant:i}),C]});return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.header,i==="night"&&styles.nightHeader],...y,children:H?(0,_jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback,{onPress:f,children:g}):g})}const A=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerInner,children:[(0,_jsxRuntime.jsx)(DragIndicator,{isResizing:B,mode:D,variant:i}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerContent,children:[r?.title&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerTitle,children:r.title}),r?.subtitle&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerSubtitle,children:r.subtitle})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.headerHintText,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hintText,children:"Double tap: Toggle \u2022 Triple tap: Close"})})]});return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.header,D==="floating"&&styles.floatingModeHeader,i==="night"&&styles.nightHeader],...y,children:H?(0,_jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback,{onPress:f,children:A}):A})});const JsModalComponent=({visible:n,onClose:r,children:x,header:b,styles:c={},minHeight:B=MIN_HEIGHT,maxHeight:D,initialHeight:h=DEFAULT_HEIGHT,animatedHeight:i,benchMotion:V,initialMode:_="bottomSheet",onModeChange:l,persistenceKey:f,enablePersistence:y=true,initialFloatingPosition:H,footer:A,footerHeight:d=0,onBack:C,onMinimize:g,minimizeRequest:W=0,minimizeTargetPosition:z,initialModalState:a,zIndex:Z,disableScrollWrapper:$=false,background:ee=true,variant:T="night",avoidKeyboard:ce=true})=>{const k=(0,_useSafeAreaInsets.useSafeAreaInsets)();const pe=(0,_react.useRef)(false);(0,_react.useEffect)(()=>{if(n)pe.current=true;else if(pe.current)_reactNative.Keyboard.dismiss()},[n]);(0,_react.useEffect)(()=>()=>{if(pe.current)_reactNative.Keyboard.dismiss()},[]);const[Ve,Te]=(0,_react.useState)(!y);const[s,we]=(0,_react.useState)(_);const be=useKeyboardLift(ce&&n&&s==="bottomSheet",k.top);const[te,E]=(0,_react.useState)(false);const[he,oe]=(0,_react.useState)(false);const[_e,ye]=(0,_react.useState)(h);const[N,re]=(0,_react.useState)({width:FLOATING_WIDTH,height:FLOATING_HEIGHT,top:(SCREEN.height-FLOATING_HEIGHT)/2,left:0});const[fe]=(0,_react.useState)({width:SCREEN.width,height:SCREEN.height});const[We,ge]=(0,_react.useState)(false);const[Ne,Se]=(0,_react.useState)(false);const Oe=(0,_index3.useHintsDisabled)();const p=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const S=(0,_react.useRef)(new _reactNative.Animated.Value(SCREEN.height)).current;const Ae=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const L=(0,_react.useRef)(new _reactNative.Animated.Value(h)).current;const M=(0,_react.useRef)(h);(0,_react.useEffect)(()=>{if(!y||!f||!Ve)return;const e=setTimeout(()=>{_modalStorage.ModalStorage.save(f,{mode:s,panelHeight:M.current,dimensions:N,isVisible:n})},500);return()=>clearTimeout(e)},[s,_e,N,n,f,y,Ve]);const Ie=(0,_react.useRef)(false);(0,_react.useEffect)(()=>{if(i&&!Ie.current){Ie.current=true;M.current=h;i.setValue(h)}},[i,h]);(0,_react.useEffect)(()=>{R.current=N},[N]);const m=(0,_react.useRef)(new _reactNative.Animated.ValueXY({x:H?.x??0,y:H?.y??(SCREEN.height-FLOATING_HEIGHT)/2})).current;const U=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const Y=(0,_react.useRef)(new _reactNative.Animated.Value(FLOATING_WIDTH)).current;const K=(0,_react.useRef)(new _reactNative.Animated.Value(FLOATING_HEIGHT)).current;const R=(0,_react.useRef)(N);const je=(0,_react.useRef)(N);const Fe=(0,_react.useRef)(0);const Pe=(0,_react.useRef)(0);const Ge=(0,_react.useRef)(0);const qe=(0,_react.useRef)(0);(0,_react.useEffect)(()=>{let e=true;const o=async()=>{try{const t=_devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();const O=await _persistentStorage.persistentStorage.getItem(t);if(e){ge(O!=="true");Se(true)}}catch(t){if(e){ge(true);Se(true)}}};o();return()=>{e=false}},[]);const ze=(0,_react.useCallback)(async()=>{try{const e=_devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();await _persistentStorage.persistentStorage.setItem(e,"true");ge(false)}catch(e){ge(false)}},[]);const De=(0,_react.useRef)(l);De.current=l;(0,_react.useEffect)(()=>{if(!y||!f){Te(true);return}let e=true;const o=async()=>{const t=await _modalStorage.ModalStorage.load(f);if(e&&t){if(t.mode){we(t.mode);De.current?.(t.mode)}if(t.panelHeight){ye(t.panelHeight);M.current=t.panelHeight;L.setValue(t.panelHeight);i?.setValue(t.panelHeight)}if(t.dimensions){re(t.dimensions);m.setValue({x:t.dimensions.left,y:t.dimensions.top});Y.setValue(t.dimensions.width);K.setValue(t.dimensions.height)}}if(e)Te(true)};o();return()=>{e=false}},[f,y,L,K,Y,m]);(0,_react.useEffect)(()=>{return()=>{p.stopAnimation();S.stopAnimation();U.stopAnimation();Ae.stopAnimation();L.stopAnimation();m.stopAnimation();Y.stopAnimation();K.stopAnimation();p.setValue(0);S.setValue(SCREEN.height);U.setValue(0);Ae.setValue(0);L.setValue(h);M.current=h}},[]);const ke=p.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"});const Ce=D||SCREEN.height-k.top;const J=(0,_react.useCallback)(()=>{oe(false);E(false);const e=s==="bottomSheet"?"floating":"bottomSheet";we(e);l?.(e)},[s,l]);(0,_react.useEffect)(()=>{oe(false);E(false)},[s]);const P=(0,_react.useCallback)(()=>{if(!g)return;const e={mode:s,panelHeight:M.current,floatingPosition:{x:R.current.left,y:R.current.top},floatingDimensions:{width:R.current.width,height:R.current.height}};if(y&&f)void _modalStorage.ModalStorage.saveMinimized(f,e);const o=z?.x??SCREEN.width-50;const t=z?.y??SCREEN.height-150;if(s==="bottomSheet"){_reactNative.Animated.parallel([_reactNative.Animated.timing(p,{toValue:0,duration:300,useNativeDriver:true}),_reactNative.Animated.timing(S,{toValue:SCREEN.height,duration:300,useNativeDriver:true})]).start(()=>{g(e)})}else{_reactNative.Animated.parallel([_reactNative.Animated.timing(U,{toValue:0,duration:300,useNativeDriver:true}),_reactNative.Animated.timing(p,{toValue:0,duration:300,useNativeDriver:true}),_reactNative.Animated.timing(m,{toValue:{x:o,y:t},duration:300,useNativeDriver:true})]).start(()=>{g(e)})}},[s,g,z,y,f,p,S,U,m]);const ve=(0,_react.useRef)(W);(0,_react.useEffect)(()=>{if(ve.current===W)return;ve.current=W;P()},[W,P]);(0,_react.useEffect)(()=>{if(!a)return;if(a.mode){we(a.mode);l?.(a.mode)}if(a.panelHeight){ye(a.panelHeight);M.current=a.panelHeight;L.setValue(a.panelHeight)}if(a.floatingDimensions&&a.floatingPosition){const e={width:a.floatingDimensions.width,height:a.floatingDimensions.height,top:a.floatingPosition.y,left:a.floatingPosition.x};re(e);m.setValue({x:a.floatingPosition.x,y:a.floatingPosition.y});Y.setValue(a.floatingDimensions.width);K.setValue(a.floatingDimensions.height)}},[a]);const He=e=>{if(e){if(s==="bottomSheet"){S.setValue(0)}else{U.setValue(1);m.setValue({x:R.current.left,y:R.current.top})}p.setValue(1)}else{if(s==="bottomSheet"){S.setValue(SCREEN.height)}p.setValue(0)}};const Ee=(0,_react.useRef)(null);if(INSTANT_MODAL_ENTRANCE&&Ee.current!==n){Ee.current=n;He(n)}(0,_react.useEffect)(()=>{let e=null;let o=null;if(INSTANT_MODAL_ENTRANCE){He(n);return}if(n){S.setValue(SCREEN.height);p.setValue(0);if(s==="bottomSheet"){e=_reactNative.Animated.parallel([_reactNative.Animated.spring(S,{toValue:0,tension:180,friction:22,useNativeDriver:true}),_reactNative.Animated.timing(p,{toValue:1,duration:200,useNativeDriver:true})]);e.start()}else{U.setValue(1);m.setValue({x:R.current.left,y:R.current.top});e=_reactNative.Animated.timing(p,{toValue:1,duration:200,useNativeDriver:true});e.start()}}else{if(s==="bottomSheet"){o=_reactNative.Animated.parallel([_reactNative.Animated.spring(S,{toValue:SCREEN.height,tension:180,friction:22,useNativeDriver:true}),_reactNative.Animated.timing(p,{toValue:0,duration:200,useNativeDriver:true})]);o.start()}else{o=_reactNative.Animated.timing(p,{toValue:0,duration:200,useNativeDriver:true});o.start()}}return()=>{if(e){e.stop()}if(o){o.stop()}}},[n,s,p,S,U,m,i]);const Le=(0,_react.useRef)(0);(0,_react.useEffect)(()=>{if(!__DEV__||!V||!n)return void 0;let e=null;let o=null;let t=true;const O=Date.now();let I=false;const G=F=>{I=F;if(V==="resize"||V==="float-resize"){E(F)}else if(V==="float-drag"){oe(F)}};if(V==="mode-cycle"){o=setInterval(()=>J(),2200)}else{const F=B;const me=Ce;const le=()=>{if(!t)return;const ne=(Date.now()-O)/1e3;const u=ne%2.5;if(u<2&&!I)G(true);else if(u>=2&&I)G(false);if(I){const j=(Math.sin(ne*2.2)+1)/2;if(V==="resize"){const w=F+j*(me-F);L.setValue(w);M.current=w;if(i){i.setValue(w)}}else if(V==="float-drag"){const w=(Math.sin(ne*1.7)+1)/2;m.setValue({x:10+j*Math.max(SCREEN.width-FLOATING_WIDTH-20,0),y:70+w*260})}else if(V==="float-resize"){const w=FLOATING_WIDTH+j*Math.max(SCREEN.width-FLOATING_WIDTH-40,0);const v=FLOATING_HEIGHT+j*240;Y.setValue(w);K.setValue(v);R.current={...R.current,width:w,height:v}}}e=requestAnimationFrame(le)};e=requestAnimationFrame(le)}return()=>{t=false;if(e!=null)cancelAnimationFrame(e);if(o!=null)clearInterval(o);E(false);oe(false)}},[V,n]);const Ue=(0,_react.useMemo)(()=>_reactNative.PanResponder.create({onStartShouldSetPanResponder:()=>s==="bottomSheet",onMoveShouldSetPanResponder:(e,o)=>s==="bottomSheet"&&Math.abs(o.dy)>3,onPanResponderTerminationRequest:()=>false,onPanResponderGrant:e=>{E(true);Le.current=e.nativeEvent.locationY||0;L.stopAnimation(o=>{M.current=o});i?.stopAnimation();S.stopAnimation()},onPanResponderMove:e=>{const o=e.nativeEvent.pageY-Le.current;let t=SCREEN.height-o;t=Math.max(B,Math.min(t,Ce));L.setValue(t);M.current=t;if(i){i.setValue(t)}},onPanResponderRelease:(e,o)=>{E(false);const t=M.current;const O=o.vy>.8&&o.dy>50||o.dy>150&&t<=B;if(O){_reactNative.Animated.parallel([_reactNative.Animated.timing(p,{toValue:0,duration:200,useNativeDriver:true}),_reactNative.Animated.spring(S,{toValue:SCREEN.height,tension:180,friction:22,useNativeDriver:true})]).start(()=>r());return}ye(t);if(i)i.setValue(t)},onPanResponderTerminate:()=>{E(false)}}),[s,B,Ce,L,i,S,p,r]);const se=(0,_react.useCallback)(e=>{let o=false;return _reactNative.PanResponder.create({onStartShouldSetPanResponder:()=>s==="floating",onMoveShouldSetPanResponder:()=>s==="floating",onPanResponderGrant:()=>{o=false;const t=R.current;m.stopAnimation(({x:O,y:I})=>{m.setValue({x:O,y:I})});E(true);je.current={...t};Ge.current=t.height;qe.current=t.width;Fe.current=t.left;Pe.current=t.top},onPanResponderMove:(t,O)=>{const{dx:I,dy:G}=O;if(Math.abs(I)<.5&&Math.abs(G)<.5)return;o=true;const F=Math.max(0,k.left||0);const me=fe.width-Math.max(0,k.right||0);const le=Math.max(0,k.top||0);const ne=fe.height-Math.max(0,k.bottom||0);const u=je.current;const j=u.left+u.width;const w=u.top+u.height;let v=u.left;let q=u.top;let de=j;let ue=w;switch(e){case"topLeft":{const X=Math.max(F,Math.min(u.left+I,j-FLOATING_MIN_WIDTH));const Q=Math.max(le,Math.min(u.top+G,w-FLOATING_MIN_HEIGHT));v=X;q=Q;de=j;ue=w;break}case"topRight":{const X=Math.min(me,Math.max(j+I,u.left+FLOATING_MIN_WIDTH));const Q=Math.max(le,Math.min(u.top+G,w-FLOATING_MIN_HEIGHT));v=u.left;q=Q;de=X;ue=w;break}case"bottomLeft":{const X=Math.max(F,Math.min(u.left+I,j-FLOATING_MIN_WIDTH));const Q=Math.min(ne,Math.max(w+G,u.top+FLOATING_MIN_HEIGHT));v=X;q=u.top;de=j;ue=Q;break}case"bottomRight":{const X=Math.min(me,Math.max(j+I,u.left+FLOATING_MIN_WIDTH));const Q=Math.min(ne,Math.max(w+G,u.top+FLOATING_MIN_HEIGHT));v=u.left;q=u.top;de=X;ue=Q;break}}const Re=Math.max(FLOATING_MIN_WIDTH,de-v);const xe=Math.max(FLOATING_MIN_HEIGHT,ue-q);re({width:Re,height:xe,left:v,top:q});Y.setValue(Re);K.setValue(xe);m.setValue({x:v,y:q});R.current={width:Re,height:xe,left:v,top:q}},onPanResponderRelease:()=>{E(false);o=false;re(R.current)},onPanResponderTerminate:()=>{E(false);o=false}})},[s,fe,k.left,k.right,k.top,k.bottom,m,Y,K,r,C]);const Me=(0,_react.useMemo)(()=>{return{topLeft:se("topLeft"),topRight:se("topRight"),bottomLeft:se("bottomLeft"),bottomRight:se("bottomRight")}},[se]);const Ye=(0,_react.useCallback)(()=>{oe(true)},[]);const Ke=(0,_react.useCallback)(e=>{oe(false);const o=R.current;const t={...o,left:e.x,top:e.y};re(t)},[]);const Be=(0,_react.useRef)(0);const ae=(0,_react.useRef)(0);const ie=(0,_react.useRef)(null);const Je=(0,_react.useCallback)(()=>{const e=Date.now();const o=e-Be.current;if(o>500){ae.current=0}ae.current++;Be.current=e;if(ie.current){clearTimeout(ie.current)}ie.current=setTimeout(()=>{if(ae.current===2){J()}else if(ae.current>=3){if(g){P()}}ae.current=0},300)},[J,g,P]);(0,_react.useEffect)(()=>{return()=>{if(ie.current){clearTimeout(ie.current)}}},[]);if(s==="floating"){return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{nativeID:"jsmodal-root",pointerEvents:n?"auto":"none",accessibilityElementsHidden:!n,importantForAccessibility:n?"auto":"no-hide-descendants",style:[styles.floatingModal,{width:N.width,height:N.height,opacity:ke,transform:[{translateX:m.x},{translateY:m.y}],...Z!==void 0&&{zIndex:Z}},T==="night"&&styles.nightFloatingModal,(he||te)&&styles.floatingModalDragging,c.container,!n&&styles.parkedOffscreen],children:[ee&&T==="night"?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.nightBackdropFloating,pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{})}):null,(0,_jsxRuntime.jsx)(_index2.DraggableHeader,{position:m,onDragStart:Ye,onDragEnd:Ke,onTap:Je,containerBounds:fe,elementSize:N,minPosition:{x:0,y:k.top},style:styles.floatingHeader,enabled:s==="floating"&&!te,children:(0,_jsxRuntime.jsx)(ModalHeader,{header:b,onClose:r,onToggleMode:J,onMinimize:g?P:void 0,isResizing:he||te,mode:s,variant:T})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.windowControlsContainer,children:(0,_jsxRuntime.jsx)(_index2.WindowControls,{onClose:r,onMinimize:g?P:void 0,onToggleMode:J,mode:s,variant:T})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.content,T==="night"&&styles.nightContent,c.content],children:[ee&&T!=="night"?(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{}):null,$?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,paddingBottom:d},children:x}):(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:{flex:1},contentContainerStyle:{flexGrow:1,paddingBottom:d},showsVerticalScrollIndicator:true,nestedScrollEnabled:true,keyboardShouldPersistTaps:"handled",children:x}),A?(0,_jsxRuntime.jsx)(_reactNative.View,{style:footerStyles.footerContainer,children:A}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{...Me.bottomLeft.panHandlers,style:[styles.cornerHandleWrapper,{bottom:4,left:4}],hitSlop:{top:2,left:2,right:2,bottom:2},children:(0,_jsxRuntime.jsx)(CornerHandle,{position:"bottomLeft",isActive:he||te})}),(0,_jsxRuntime.jsx)(_reactNative.View,{...Me.bottomRight.panHandlers,style:[styles.cornerHandleWrapper,{bottom:4,right:4}],hitSlop:{top:2,left:2,right:2,bottom:2},children:(0,_jsxRuntime.jsx)(CornerHandle,{position:"bottomRight",isActive:he||te})})]})}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[n?styles.fullScreenContainer:styles.parkedFullScreen,n&&Z!==void 0&&{zIndex:Z}],pointerEvents:n?"box-none":"none",accessibilityElementsHidden:!n,importantForAccessibility:n?"auto":"no-hide-descendants",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{nativeID:"jsmodal-root",style:[styles.bottomSheetWrapper,{opacity:ke,transform:[{translateY:S}]}],children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:{transform:[{translateY:be.raise}]},children:(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{ref:be.sheetRef,style:[styles.bottomSheet,T==="night"&&styles.nightBottomSheet,c.container,{height:i||L}],children:[ee&&T==="night"?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.nightBackdropSheet,pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{})}):null,(0,_jsxRuntime.jsx)(ModalHeader,{header:b,onClose:r,onToggleMode:J,onMinimize:g?P:void 0,isResizing:te,mode:s,panHandlers:Ue.panHandlers,variant:T}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.windowControlsContainer,children:(0,_jsxRuntime.jsx)(_index2.WindowControls,{onClose:r,onMinimize:g?P:void 0,onToggleMode:J,mode:s,variant:T})}),Ne&&We&&s==="bottomSheet"&&!Oe&&(0,_jsxRuntime.jsx)(_index2.ModalHintBanner,{onAcknowledge:ze}),(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[styles.content,T==="night"&&styles.nightContent,c.content,{paddingBottom:be.pad}],children:[ee&&T!=="night"?(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{}):null,$?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,paddingBottom:d},children:x}):(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:{flex:1},contentContainerStyle:{flexGrow:1,paddingBottom:d},showsVerticalScrollIndicator:true,nestedScrollEnabled:true,keyboardShouldPersistTaps:"handled",children:x}),A?(0,_jsxRuntime.jsx)(_reactNative.View,{style:footerStyles.footerContainer,children:A}):null]})]})})})})};const styles=_reactNative.StyleSheet.create({fullScreenContainer:{..._absoluteFill.absoluteFill,zIndex:1e3},bottomSheetWrapper:{position:"absolute",bottom:0,left:0,right:0},bottomSheet:{backgroundColor:_index.buoyColors.card,borderTopLeftRadius:6,borderTopRightRadius:6,borderWidth:1,borderColor:_index.buoyColors.border,shadowColor:_index.buoyColors.primary,shadowOffset:{width:0,height:-4},shadowOpacity:.2,shadowRadius:12,elevation:20},parkedOffscreen:{left:-9999,top:-9999,opacity:0},parkedFullScreen:{position:"absolute",left:-9999,top:-9999,width:SCREEN.width,height:SCREEN.height,opacity:0},floatingModal:{position:"absolute",backgroundColor:_index.buoyColors.card,borderRadius:6,borderWidth:1,borderColor:_index.buoyColors.border,shadowColor:_index.buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.3,shadowRadius:20,elevation:24,zIndex:1e3,width:FLOATING_WIDTH,height:FLOATING_HEIGHT},floatingModalDragging:{borderColor:_index.buoyColors.primary,borderWidth:2,shadowColor:_index.buoyColors.primary+"99",shadowOpacity:.8,shadowRadius:12},header:{borderTopLeftRadius:6,borderTopRightRadius:6,backgroundColor:_index.buoyColors.card,minHeight:56,borderWidth:1,borderColor:_index.buoyColors.border,borderBottomWidth:1,borderBottomColor:_index.buoyColors.border},nightBottomSheet:{backgroundColor:_nightTheme.night.color.bg,borderTopLeftRadius:_nightTheme.night.radius.sheet,borderTopRightRadius:_nightTheme.night.radius.sheet,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_nightTheme.night.color.accent+"55",shadowColor:_nightTheme.night.color.accent,shadowOffset:{width:0,height:-4},shadowOpacity:.22,shadowRadius:10},nightFloatingModal:{backgroundColor:_nightTheme.night.color.bg,borderRadius:_nightTheme.night.radius.sheet,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_nightTheme.night.color.accent+"55",shadowColor:_nightTheme.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.22,shadowRadius:14},nightHeader:{backgroundColor:"transparent",borderWidth:0,borderBottomWidth:0,borderTopLeftRadius:_nightTheme.night.radius.sheet,borderTopRightRadius:_nightTheme.night.radius.sheet},nightContent:{backgroundColor:"transparent"},nightBackdropSheet:{..._absoluteFill.absoluteFill,borderTopLeftRadius:_nightTheme.night.radius.sheet,borderTopRightRadius:_nightTheme.night.radius.sheet,overflow:"hidden"},nightBackdropFloating:{..._absoluteFill.absoluteFill,borderRadius:_nightTheme.night.radius.sheet,overflow:"hidden"},nightDragIndicator:{width:36,height:5,borderRadius:2.5,backgroundColor:_nightTheme.night.color.placeholder,shadowOpacity:0,elevation:0},floatingHeader:{borderTopLeftRadius:6,borderTopRightRadius:6},windowControlsContainer:{position:"absolute",top:4,right:4,zIndex:10},floatingModeHeader:{borderTopLeftRadius:6,borderTopRightRadius:6},headerInner:{flex:1,justifyContent:"center"},dragIndicatorContainer:{alignItems:"center",paddingVertical:8,backgroundColor:"transparent"},dragIndicatorContainerCustom:{minHeight:WINDOW_CONTROLS_BAND,justifyContent:"center",paddingVertical:0,backgroundColor:"transparent"},dragIndicator:{width:40,height:3,backgroundColor:_index.buoyColors.primary,borderRadius:2,shadowColor:_index.buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.6,shadowRadius:4},floatingDragIndicator:{width:50,height:5,backgroundColor:_index.buoyColors.textMuted},dragIndicatorActive:{backgroundColor:_index.buoyColors.primary,width:40},resizeGripContainer:{position:"absolute",flexDirection:"row",gap:2,marginTop:12},resizeGripLine:{width:12,height:1,backgroundColor:_index.gameUIColors.success,opacity:.6},headerContent:{paddingHorizontal:16,alignItems:"center"},headerControls:{position:"absolute",top:8,right:16,flexDirection:"row",alignItems:"center"},headerTitle:{fontSize:16,fontWeight:"600",color:_index.gameUIColors.primary},headerSubtitle:{fontSize:12,color:_index.gameUIColors.secondary,paddingTop:4},headerHintText:{position:"absolute",top:0,left:0,right:0,bottom:0,justifyContent:"center",alignItems:"center"},hintText:{fontSize:10,color:_index.gameUIColors.muted,fontStyle:"italic"},controlButton:{width:28,height:28,borderRadius:6,justifyContent:"center",alignItems:"center",marginLeft:8},toggleButton:{backgroundColor:_index.gameUIColors.info+"1A",borderWidth:1,borderColor:_index.gameUIColors.info+"33"},closeButton:{width:28,height:28,borderRadius:6,justifyContent:"center",alignItems:"center",backgroundColor:_index.gameUIColors.error+"1A",borderWidth:1,borderColor:_index.gameUIColors.error+"33",marginLeft:8},iconLine:{position:"absolute",top:7.25,left:2,width:12,height:1.5,backgroundColor:_index.gameUIColors.error},content:{flex:1,backgroundColor:_index.buoyColors.base,borderBottomLeftRadius:16,borderBottomRightRadius:16,overflow:"hidden"},cornerHandle:{position:"absolute",zIndex:1},cornerHandleWrapper:{position:"absolute",width:30,height:30,zIndex:1e3},handler:{width:20,height:20,backgroundColor:"transparent",borderRadius:10,borderWidth:0,borderColor:"transparent"},handlerActive:{backgroundColor:_index.gameUIColors.success+"1A",borderColor:_index.gameUIColors.success,borderWidth:2,shadowColor:_index.gameUIColors.success+"99",shadowOffset:{width:0,height:0},shadowOpacity:1,shadowRadius:8}});const footerStyles=_reactNative.StyleSheet.create({footerContainer:{position:"absolute",left:0,right:0,bottom:0,backgroundColor:_index.buoyColors.base,borderBottomLeftRadius:16,borderBottomRightRadius:16}});const JsModal=exports.JsModal=(0,_react.memo)(n=>{const r=(0,_licenseModule.getUseAccountAccess)()();if(r.status!=="admitted")return n.visible?(0,_jsxRuntime.jsx)(_AccountSetup.AccountSetup,{}):null;return(0,_jsxRuntime.jsx)(JsModalComponent,{...n})});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.JsModal=void 0;var _licenseModule=require("./license/licenseModule.js");var _AccountSetup=require("./license/AccountSetup");var _react=require("react");var _reactNative=require("react-native");var _absoluteFill=require("./utils/absoluteFill.js");var _useSafeAreaInsets=require("./hooks/useSafeAreaInsets");var _index=require("./ui/gameUI/index.js");var _index2=require("./ui/components/index.js");var _ToolBackground=require("./ui/backgrounds/ToolBackground.js");var _nightTheme=require("./ui/night/nightTheme.js");var _persistentStorage=require("./utils/persistentStorage");var _modalStorage=require("./utils/modalStorage.js");var _devToolsStorageKeys=require("./storage/devToolsStorageKeys.js");var _index3=require("./context/index.js");var _jsxRuntime=require("react/jsx-runtime");const INSTANT_MODAL_ENTRANCE=true;const SCREEN=_reactNative.Dimensions.get("window");const MIN_HEIGHT=100;const DEFAULT_HEIGHT=400;const FLOATING_WIDTH=SCREEN.width;const FLOATING_HEIGHT=500;const FLOATING_MIN_WIDTH=SCREEN.width*.25;const FLOATING_MIN_HEIGHT=80;const WINDOW_CONTROLS_BAND=20;const KEYBOARD_FIELD_GAP=16;function useKeyboardLift(n,r){const p=(0,_react.useRef)(null);const y=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const c=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;(0,_react.useEffect)(()=>{if(!n||_reactNative.Platform.OS!=="ios")return;let k=0;const h=(l,f,C)=>{const H=(A,d)=>_reactNative.Animated.timing(A,{toValue:d,duration:C.duration||250,easing:_reactNative.Easing.bezier(.17,.59,.4,.77),useNativeDriver:false});_reactNative.Animated.parallel([H(y,l),H(c,f)]).start()};const i=l=>{const f=p.current;const C=++k;if(!f)return;const H=_reactNative.TextInput.State.currentlyFocusedInput();const A=d=>new Promise(R=>{if(!d?.measureInWindow)return R(null);d.measureInWindow((g,W,z,a)=>R({y:W,h:a}))});Promise.all([A(f),A(H)]).then(([d,R])=>{if(C!==k||!d)return;const g=_reactNative.Dimensions.get("window").height;const W=l.endCoordinates.screenY;const z=g-d.h;const a=g-W;const Z=Math.max(0,z-r-8);const $=Math.max(0,Math.min(a,Z));if(!R)return h($,Math.max(0,a-$),l);if(R.y<d.y||R.y>=d.y+d.h)return h(0,0,l);const ee=z+(R.y-d.y)+R.h;const T=ee+KEYBOARD_FIELD_GAP-W;const ce=Math.max(0,Math.min(T,$));h(ce,Math.max(0,a-ce),l)})};const V=l=>{k++;h(0,0,l)};const _=[_reactNative.Keyboard.addListener("keyboardWillChangeFrame",i),_reactNative.Keyboard.addListener("keyboardWillShow",i),_reactNative.Keyboard.addListener("keyboardWillHide",V)];return()=>{k++;_.forEach(l=>l.remove());y.stopAnimation();c.stopAnimation();y.setValue(0);c.setValue(0)}},[n,r,y,c]);const B=(0,_react.useRef)(_reactNative.Animated.multiply(y,-1)).current;return{sheetRef:p,lift:y,raise:B,pad:c}}const DragIndicator=(0,_react.memo)(function n({isResizing:r,mode:p,hasCustomContent:y=false,variant:c="default"}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.dragIndicatorContainer,y&&styles.dragIndicatorContainerCustom],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.dragIndicator,p==="floating"&&styles.floatingDragIndicator,r&&styles.dragIndicatorActive,c==="night"&&styles.nightDragIndicator]}),r&&p==="bottomSheet"&&(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.resizeGripContainer,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.resizeGripLine}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.resizeGripLine}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.resizeGripLine})]})]})});const CornerHandle=(0,_react.memo)(function n({position:r,isActive:p}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.cornerHandle],children:(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.handler,p&&styles.handlerActive]})})});const ModalHeader=(0,_react.memo)(function n({header:r,onClose:p,onToggleMode:y,onMinimize:c,isResizing:B,mode:k,panHandlers:h,variant:i="default"}){const V=(0,_react.useRef)(0);const _=(0,_react.useRef)(0);const l=(0,_react.useRef)(null);const f=(0,_react.useCallback)(()=>{const d=Date.now();const R=d-V.current;if(R>500){_.current=0}_.current++;V.current=d;if(l.current){clearTimeout(l.current)}l.current=setTimeout(()=>{if(_.current===2){y()}else if(_.current>=3){if(c){c()}}_.current=0},300)},[y,c]);(0,_react.useEffect)(()=>{return()=>{if(l.current){clearTimeout(l.current)}}},[]);const C=h?h:{};const H=!!h;if(r?.customContent){const d=(0,_react.isValidElement)(r.customContent)&&typeof r.customContent.type==="function"&&r.customContent.type.name==="CyberpunkModalHeader";if(d){return(0,_react.cloneElement)(r.customContent,{onToggleMode:y,onClose:p,mode:k,panHandlers:C,showToggleButton:r?.showToggleButton!==false,hideCloseButton:r?.hideCloseButton})}let R=r.customContent;if((0,_react.isValidElement)(r.customContent)&&c){R=(0,_react.cloneElement)(r.customContent,{onMinimize:c})}const g=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerInner,children:[(0,_jsxRuntime.jsx)(DragIndicator,{isResizing:B,mode:k,hasCustomContent:true,variant:i}),R]});return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.header,i==="night"&&styles.nightHeader],...C,children:H?(0,_jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback,{onPress:f,children:g}):g})}const A=(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerInner,children:[(0,_jsxRuntime.jsx)(DragIndicator,{isResizing:B,mode:k,variant:i}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.headerContent,children:[r?.title&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerTitle,children:r.title}),r?.subtitle&&(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerSubtitle,children:r.subtitle})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.headerHintText,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hintText,children:"Double tap: Toggle \u2022 Triple tap: Close"})})]});return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[styles.header,k==="floating"&&styles.floatingModeHeader,i==="night"&&styles.nightHeader],...C,children:H?(0,_jsxRuntime.jsx)(_reactNative.TouchableWithoutFeedback,{onPress:f,children:A}):A})});const JsModalComponent=({visible:n,onClose:r,children:p,header:y,styles:c={},minHeight:B=MIN_HEIGHT,maxHeight:k,initialHeight:h=DEFAULT_HEIGHT,animatedHeight:i,benchMotion:V,initialMode:_="bottomSheet",onModeChange:l,persistenceKey:f,enablePersistence:C=true,initialFloatingPosition:H,footer:A,footerHeight:d=0,onBack:R,onMinimize:g,minimizeRequest:W=0,minimizeTargetPosition:z,initialModalState:a,zIndex:Z,disableScrollWrapper:$=false,background:ee=true,variant:T="night",avoidKeyboard:ce=true})=>{const D=(0,_useSafeAreaInsets.useSafeAreaInsets)();const pe=(0,_react.useRef)(false);(0,_react.useEffect)(()=>{if(n)pe.current=true;else if(pe.current)_reactNative.Keyboard.dismiss()},[n]);(0,_react.useEffect)(()=>()=>{if(pe.current)_reactNative.Keyboard.dismiss()},[]);const[Ve,Te]=(0,_react.useState)(!C);const[s,we]=(0,_react.useState)(_);const be=useKeyboardLift(ce&&n&&s==="bottomSheet",D.top);const[te,E]=(0,_react.useState)(false);const[he,oe]=(0,_react.useState)(false);const[_e,ye]=(0,_react.useState)(h);const[N,re]=(0,_react.useState)({width:FLOATING_WIDTH,height:FLOATING_HEIGHT,top:(SCREEN.height-FLOATING_HEIGHT)/2,left:0});const[fe]=(0,_react.useState)({width:SCREEN.width,height:SCREEN.height});const[We,ge]=(0,_react.useState)(false);const[Ne,Se]=(0,_react.useState)(false);const Oe=(0,_index3.useHintsDisabled)();const w=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const S=(0,_react.useRef)(new _reactNative.Animated.Value(SCREEN.height)).current;const Ae=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const L=(0,_react.useRef)(new _reactNative.Animated.Value(h)).current;const M=(0,_react.useRef)(h);(0,_react.useEffect)(()=>{if(!C||!f||!Ve)return;const e=setTimeout(()=>{_modalStorage.ModalStorage.save(f,{mode:s,panelHeight:M.current,dimensions:N,isVisible:n})},500);return()=>clearTimeout(e)},[s,_e,N,n,f,C,Ve]);const Ie=(0,_react.useRef)(false);(0,_react.useEffect)(()=>{if(i&&!Ie.current){Ie.current=true;M.current=h;i.setValue(h)}},[i,h]);(0,_react.useEffect)(()=>{x.current=N},[N]);const m=(0,_react.useRef)(new _reactNative.Animated.ValueXY({x:H?.x??0,y:H?.y??(SCREEN.height-FLOATING_HEIGHT)/2})).current;const U=(0,_react.useRef)(new _reactNative.Animated.Value(0)).current;const Y=(0,_react.useRef)(new _reactNative.Animated.Value(FLOATING_WIDTH)).current;const K=(0,_react.useRef)(new _reactNative.Animated.Value(FLOATING_HEIGHT)).current;const x=(0,_react.useRef)(N);const je=(0,_react.useRef)(N);const Fe=(0,_react.useRef)(0);const Pe=(0,_react.useRef)(0);const Ge=(0,_react.useRef)(0);const qe=(0,_react.useRef)(0);(0,_react.useEffect)(()=>{let e=true;const o=async()=>{try{const t=_devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();const O=await _persistentStorage.persistentStorage.getItem(t);if(e){ge(O!=="true");Se(true)}}catch(t){if(e){ge(true);Se(true)}}};o();return()=>{e=false}},[]);const ze=(0,_react.useCallback)(async()=>{try{const e=_devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();await _persistentStorage.persistentStorage.setItem(e,"true");ge(false)}catch(e){ge(false)}},[]);const ke=(0,_react.useRef)(l);ke.current=l;(0,_react.useEffect)(()=>{if(!C||!f){Te(true);return}let e=true;const o=async()=>{const t=await _modalStorage.ModalStorage.load(f);if(e&&t){if(t.mode){we(t.mode);ke.current?.(t.mode)}if(t.panelHeight){ye(t.panelHeight);M.current=t.panelHeight;L.setValue(t.panelHeight);i?.setValue(t.panelHeight)}if(t.dimensions){re(t.dimensions);m.setValue({x:t.dimensions.left,y:t.dimensions.top});Y.setValue(t.dimensions.width);K.setValue(t.dimensions.height)}}if(e)Te(true)};o();return()=>{e=false}},[f,C,L,K,Y,m]);(0,_react.useEffect)(()=>{return()=>{w.stopAnimation();S.stopAnimation();U.stopAnimation();Ae.stopAnimation();L.stopAnimation();m.stopAnimation();Y.stopAnimation();K.stopAnimation();w.setValue(0);S.setValue(SCREEN.height);U.setValue(0);Ae.setValue(0);L.setValue(h);M.current=h}},[]);const De=w.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"});const Ce=k||SCREEN.height-D.top;const J=(0,_react.useCallback)(()=>{oe(false);E(false);const e=s==="bottomSheet"?"floating":"bottomSheet";we(e);l?.(e)},[s,l]);(0,_react.useEffect)(()=>{oe(false);E(false)},[s]);const P=(0,_react.useCallback)(()=>{if(!g)return;const e={mode:s,panelHeight:M.current,floatingPosition:{x:x.current.left,y:x.current.top},floatingDimensions:{width:x.current.width,height:x.current.height}};if(C&&f)void _modalStorage.ModalStorage.saveMinimized(f,e);const o=z?.x??SCREEN.width-50;const t=z?.y??SCREEN.height-150;if(s==="bottomSheet"){_reactNative.Animated.parallel([_reactNative.Animated.timing(w,{toValue:0,duration:300,useNativeDriver:true}),_reactNative.Animated.timing(S,{toValue:SCREEN.height,duration:300,useNativeDriver:true})]).start(()=>{g(e)})}else{_reactNative.Animated.parallel([_reactNative.Animated.timing(U,{toValue:0,duration:300,useNativeDriver:true}),_reactNative.Animated.timing(w,{toValue:0,duration:300,useNativeDriver:true}),_reactNative.Animated.timing(m,{toValue:{x:o,y:t},duration:300,useNativeDriver:true})]).start(()=>{g(e)})}},[s,g,z,C,f,w,S,U,m]);const ve=(0,_react.useRef)(W);(0,_react.useEffect)(()=>{if(ve.current===W)return;ve.current=W;P()},[W,P]);(0,_react.useEffect)(()=>{if(!a)return;if(a.mode){we(a.mode);l?.(a.mode)}if(a.panelHeight){ye(a.panelHeight);M.current=a.panelHeight;L.setValue(a.panelHeight)}if(a.floatingDimensions&&a.floatingPosition){const e={width:a.floatingDimensions.width,height:a.floatingDimensions.height,top:a.floatingPosition.y,left:a.floatingPosition.x};re(e);m.setValue({x:a.floatingPosition.x,y:a.floatingPosition.y});Y.setValue(a.floatingDimensions.width);K.setValue(a.floatingDimensions.height)}},[a]);const He=e=>{if(e){if(s==="bottomSheet"){S.setValue(0)}else{U.setValue(1);m.setValue({x:x.current.left,y:x.current.top})}w.setValue(1)}else{if(s==="bottomSheet"){S.setValue(SCREEN.height)}w.setValue(0)}};const Ee=(0,_react.useRef)(null);if(INSTANT_MODAL_ENTRANCE&&Ee.current!==n){Ee.current=n;He(n)}(0,_react.useEffect)(()=>{let e=null;let o=null;if(INSTANT_MODAL_ENTRANCE){He(n);return}if(n){S.setValue(SCREEN.height);w.setValue(0);if(s==="bottomSheet"){e=_reactNative.Animated.parallel([_reactNative.Animated.spring(S,{toValue:0,tension:180,friction:22,useNativeDriver:true}),_reactNative.Animated.timing(w,{toValue:1,duration:200,useNativeDriver:true})]);e.start()}else{U.setValue(1);m.setValue({x:x.current.left,y:x.current.top});e=_reactNative.Animated.timing(w,{toValue:1,duration:200,useNativeDriver:true});e.start()}}else{if(s==="bottomSheet"){o=_reactNative.Animated.parallel([_reactNative.Animated.spring(S,{toValue:SCREEN.height,tension:180,friction:22,useNativeDriver:true}),_reactNative.Animated.timing(w,{toValue:0,duration:200,useNativeDriver:true})]);o.start()}else{o=_reactNative.Animated.timing(w,{toValue:0,duration:200,useNativeDriver:true});o.start()}}return()=>{if(e){e.stop()}if(o){o.stop()}}},[n,s,w,S,U,m,i]);const Le=(0,_react.useRef)(0);(0,_react.useEffect)(()=>{if(!__DEV__||!V||!n)return void 0;let e=null;let o=null;let t=true;const O=Date.now();let I=false;const G=F=>{I=F;if(V==="resize"||V==="float-resize"){E(F)}else if(V==="float-drag"){oe(F)}};if(V==="mode-cycle"){o=setInterval(()=>J(),2200)}else{const F=B;const me=Ce;const le=()=>{if(!t)return;const ne=(Date.now()-O)/1e3;const u=ne%2.5;if(u<2&&!I)G(true);else if(u>=2&&I)G(false);if(I){const j=(Math.sin(ne*2.2)+1)/2;if(V==="resize"){const b=F+j*(me-F);L.setValue(b);M.current=b;if(i){i.setValue(b)}}else if(V==="float-drag"){const b=(Math.sin(ne*1.7)+1)/2;m.setValue({x:10+j*Math.max(SCREEN.width-FLOATING_WIDTH-20,0),y:70+b*260})}else if(V==="float-resize"){const b=FLOATING_WIDTH+j*Math.max(SCREEN.width-FLOATING_WIDTH-40,0);const v=FLOATING_HEIGHT+j*240;Y.setValue(b);K.setValue(v);x.current={...x.current,width:b,height:v}}}e=requestAnimationFrame(le)};e=requestAnimationFrame(le)}return()=>{t=false;if(e!=null)cancelAnimationFrame(e);if(o!=null)clearInterval(o);E(false);oe(false)}},[V,n]);const Ue=(0,_react.useMemo)(()=>_reactNative.PanResponder.create({onStartShouldSetPanResponder:()=>s==="bottomSheet",onMoveShouldSetPanResponder:(e,o)=>s==="bottomSheet"&&Math.abs(o.dy)>3,onPanResponderTerminationRequest:()=>false,onPanResponderGrant:e=>{E(true);Le.current=e.nativeEvent.locationY||0;L.stopAnimation(o=>{M.current=o});i?.stopAnimation();S.stopAnimation()},onPanResponderMove:e=>{const o=e.nativeEvent.pageY-Le.current;let t=SCREEN.height-o;t=Math.max(B,Math.min(t,Ce));L.setValue(t);M.current=t;if(i){i.setValue(t)}},onPanResponderRelease:(e,o)=>{E(false);const t=M.current;const O=o.vy>.8&&o.dy>50||o.dy>150&&t<=B;if(O){_reactNative.Animated.parallel([_reactNative.Animated.timing(w,{toValue:0,duration:200,useNativeDriver:true}),_reactNative.Animated.spring(S,{toValue:SCREEN.height,tension:180,friction:22,useNativeDriver:true})]).start(()=>r());return}ye(t);if(i)i.setValue(t)},onPanResponderTerminate:()=>{E(false)}}),[s,B,Ce,L,i,S,w,r]);const se=(0,_react.useCallback)(e=>{let o=false;return _reactNative.PanResponder.create({onStartShouldSetPanResponder:()=>s==="floating",onMoveShouldSetPanResponder:()=>s==="floating",onPanResponderGrant:()=>{o=false;const t=x.current;m.stopAnimation(({x:O,y:I})=>{m.setValue({x:O,y:I})});E(true);je.current={...t};Ge.current=t.height;qe.current=t.width;Fe.current=t.left;Pe.current=t.top},onPanResponderMove:(t,O)=>{const{dx:I,dy:G}=O;if(Math.abs(I)<.5&&Math.abs(G)<.5)return;o=true;const F=Math.max(0,D.left||0);const me=fe.width-Math.max(0,D.right||0);const le=Math.max(0,D.top||0);const ne=fe.height-Math.max(0,D.bottom||0);const u=je.current;const j=u.left+u.width;const b=u.top+u.height;let v=u.left;let q=u.top;let de=j;let ue=b;switch(e){case"topLeft":{const X=Math.max(F,Math.min(u.left+I,j-FLOATING_MIN_WIDTH));const Q=Math.max(le,Math.min(u.top+G,b-FLOATING_MIN_HEIGHT));v=X;q=Q;de=j;ue=b;break}case"topRight":{const X=Math.min(me,Math.max(j+I,u.left+FLOATING_MIN_WIDTH));const Q=Math.max(le,Math.min(u.top+G,b-FLOATING_MIN_HEIGHT));v=u.left;q=Q;de=X;ue=b;break}case"bottomLeft":{const X=Math.max(F,Math.min(u.left+I,j-FLOATING_MIN_WIDTH));const Q=Math.min(ne,Math.max(b+G,u.top+FLOATING_MIN_HEIGHT));v=X;q=u.top;de=j;ue=Q;break}case"bottomRight":{const X=Math.min(me,Math.max(j+I,u.left+FLOATING_MIN_WIDTH));const Q=Math.min(ne,Math.max(b+G,u.top+FLOATING_MIN_HEIGHT));v=u.left;q=u.top;de=X;ue=Q;break}}const Re=Math.max(FLOATING_MIN_WIDTH,de-v);const xe=Math.max(FLOATING_MIN_HEIGHT,ue-q);re({width:Re,height:xe,left:v,top:q});Y.setValue(Re);K.setValue(xe);m.setValue({x:v,y:q});x.current={width:Re,height:xe,left:v,top:q}},onPanResponderRelease:()=>{E(false);o=false;re(x.current)},onPanResponderTerminate:()=>{E(false);o=false}})},[s,fe,D.left,D.right,D.top,D.bottom,m,Y,K,r,R]);const Me=(0,_react.useMemo)(()=>{return{topLeft:se("topLeft"),topRight:se("topRight"),bottomLeft:se("bottomLeft"),bottomRight:se("bottomRight")}},[se]);const Ye=(0,_react.useCallback)(()=>{oe(true)},[]);const Ke=(0,_react.useCallback)(e=>{oe(false);const o=x.current;const t={...o,left:e.x,top:e.y};re(t)},[]);const Be=(0,_react.useRef)(0);const ae=(0,_react.useRef)(0);const ie=(0,_react.useRef)(null);const Je=(0,_react.useCallback)(()=>{const e=Date.now();const o=e-Be.current;if(o>500){ae.current=0}ae.current++;Be.current=e;if(ie.current){clearTimeout(ie.current)}ie.current=setTimeout(()=>{if(ae.current===2){J()}else if(ae.current>=3){if(g){P()}}ae.current=0},300)},[J,g,P]);(0,_react.useEffect)(()=>{return()=>{if(ie.current){clearTimeout(ie.current)}}},[]);if(s==="floating"){return(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{nativeID:"jsmodal-root",pointerEvents:n?"auto":"none",accessibilityElementsHidden:!n,importantForAccessibility:n?"auto":"no-hide-descendants",style:[styles.floatingModal,{width:N.width,height:N.height,opacity:De,transform:[{translateX:m.x},{translateY:m.y}],...Z!==void 0&&{zIndex:Z}},T==="night"&&styles.nightFloatingModal,(he||te)&&styles.floatingModalDragging,c.container,!n&&styles.parkedOffscreen],children:[ee&&T==="night"?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.nightBackdropFloating,pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{})}):null,(0,_jsxRuntime.jsx)(_index2.DraggableHeader,{position:m,onDragStart:Ye,onDragEnd:Ke,onTap:Je,containerBounds:fe,elementSize:N,minPosition:{x:0,y:D.top},style:styles.floatingHeader,enabled:s==="floating"&&!te,children:(0,_jsxRuntime.jsx)(ModalHeader,{header:y,onClose:r,onToggleMode:J,onMinimize:g?P:void 0,isResizing:he||te,mode:s,variant:T})}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.windowControlsContainer,children:(0,_jsxRuntime.jsx)(_index2.WindowControls,{onClose:r,onMinimize:g?P:void 0,onToggleMode:J,mode:s,variant:T})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:[styles.content,T==="night"&&styles.nightContent,c.content],children:[ee&&T!=="night"?(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{}):null,$?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,paddingBottom:d},children:p}):(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:{flex:1},contentContainerStyle:{flexGrow:1,paddingBottom:d},showsVerticalScrollIndicator:true,nestedScrollEnabled:true,keyboardShouldPersistTaps:"handled",children:p}),A?(0,_jsxRuntime.jsx)(_reactNative.View,{style:footerStyles.footerContainer,children:A}):null]}),(0,_jsxRuntime.jsx)(_reactNative.View,{...Me.bottomLeft.panHandlers,style:[styles.cornerHandleWrapper,{bottom:4,left:4}],hitSlop:{top:2,left:2,right:2,bottom:2},children:(0,_jsxRuntime.jsx)(CornerHandle,{position:"bottomLeft",isActive:he||te})}),(0,_jsxRuntime.jsx)(_reactNative.View,{...Me.bottomRight.panHandlers,style:[styles.cornerHandleWrapper,{bottom:4,right:4}],hitSlop:{top:2,left:2,right:2,bottom:2},children:(0,_jsxRuntime.jsx)(CornerHandle,{position:"bottomRight",isActive:he||te})})]})}return(0,_jsxRuntime.jsx)(_reactNative.View,{style:[n?styles.fullScreenContainer:styles.parkedFullScreen,n&&Z!==void 0&&{zIndex:Z}],pointerEvents:n?"box-none":"none",accessibilityElementsHidden:!n,importantForAccessibility:n?"auto":"no-hide-descendants",children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{nativeID:"jsmodal-root",style:[styles.bottomSheetWrapper,{opacity:De,transform:[{translateY:S}]}],children:(0,_jsxRuntime.jsx)(_reactNative.Animated.View,{style:{transform:[{translateY:be.raise}]},children:(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{ref:be.sheetRef,style:[styles.bottomSheet,T==="night"&&styles.nightBottomSheet,c.container,{height:i||L}],children:[ee&&T==="night"?(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.nightBackdropSheet,pointerEvents:"none",children:(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{})}):null,(0,_jsxRuntime.jsx)(ModalHeader,{header:y,onClose:r,onToggleMode:J,onMinimize:g?P:void 0,isResizing:te,mode:s,panHandlers:Ue.panHandlers,variant:T}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.windowControlsContainer,children:(0,_jsxRuntime.jsx)(_index2.WindowControls,{onClose:r,onMinimize:g?P:void 0,onToggleMode:J,mode:s,variant:T})}),Ne&&We&&s==="bottomSheet"&&!Oe&&(0,_jsxRuntime.jsx)(_index2.ModalHintBanner,{onAcknowledge:ze}),(0,_jsxRuntime.jsxs)(_reactNative.Animated.View,{style:[styles.content,T==="night"&&styles.nightContent,c.content,{paddingBottom:be.pad}],children:[ee&&T!=="night"?(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{}):null,$?(0,_jsxRuntime.jsx)(_reactNative.View,{style:{flex:1,paddingBottom:d},children:p}):(0,_jsxRuntime.jsx)(_reactNative.ScrollView,{style:{flex:1},contentContainerStyle:{flexGrow:1,paddingBottom:d},showsVerticalScrollIndicator:true,nestedScrollEnabled:true,keyboardShouldPersistTaps:"handled",children:p}),A?(0,_jsxRuntime.jsx)(_reactNative.View,{style:footerStyles.footerContainer,children:A}):null]})]})})})})};const styles=_reactNative.StyleSheet.create({fullScreenContainer:{..._absoluteFill.absoluteFill,zIndex:1e3},bottomSheetWrapper:{position:"absolute",bottom:0,left:0,right:0},bottomSheet:{backgroundColor:_index.buoyColors.card,borderTopLeftRadius:6,borderTopRightRadius:6,borderWidth:1,borderColor:_index.buoyColors.border,shadowColor:_index.buoyColors.primary,shadowOffset:{width:0,height:-4},shadowOpacity:.2,shadowRadius:12,elevation:20},parkedOffscreen:{left:-9999,top:-9999,opacity:0},parkedFullScreen:{position:"absolute",left:-9999,top:-9999,width:SCREEN.width,height:SCREEN.height,opacity:0},floatingModal:{position:"absolute",backgroundColor:_index.buoyColors.card,borderRadius:6,borderWidth:1,borderColor:_index.buoyColors.border,shadowColor:_index.buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.3,shadowRadius:20,elevation:24,zIndex:1e3,width:FLOATING_WIDTH,height:FLOATING_HEIGHT},floatingModalDragging:{borderColor:_index.buoyColors.primary,borderWidth:2,shadowColor:_index.buoyColors.primary+"99",shadowOpacity:.8,shadowRadius:12},header:{borderTopLeftRadius:6,borderTopRightRadius:6,backgroundColor:_index.buoyColors.card,minHeight:56,borderWidth:1,borderColor:_index.buoyColors.border,borderBottomWidth:1,borderBottomColor:_index.buoyColors.border},nightBottomSheet:{backgroundColor:_nightTheme.night.color.bg,borderTopLeftRadius:_nightTheme.night.radius.sheet,borderTopRightRadius:_nightTheme.night.radius.sheet,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_nightTheme.night.color.accent+"55",shadowColor:_nightTheme.night.color.accent,shadowOffset:{width:0,height:-4},shadowOpacity:.22,shadowRadius:10},nightFloatingModal:{backgroundColor:_nightTheme.night.color.bg,borderRadius:_nightTheme.night.radius.sheet,borderWidth:_reactNative.StyleSheet.hairlineWidth,borderColor:_nightTheme.night.color.accent+"55",shadowColor:_nightTheme.night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.22,shadowRadius:14},nightHeader:{backgroundColor:"transparent",borderWidth:0,borderBottomWidth:0,borderTopLeftRadius:_nightTheme.night.radius.sheet,borderTopRightRadius:_nightTheme.night.radius.sheet},nightContent:{backgroundColor:"transparent"},nightBackdropSheet:{..._absoluteFill.absoluteFill,borderTopLeftRadius:_nightTheme.night.radius.sheet,borderTopRightRadius:_nightTheme.night.radius.sheet,overflow:"hidden"},nightBackdropFloating:{..._absoluteFill.absoluteFill,borderRadius:_nightTheme.night.radius.sheet,overflow:"hidden"},nightDragIndicator:{width:36,height:5,borderRadius:2.5,backgroundColor:_nightTheme.night.color.placeholder,shadowOpacity:0,elevation:0},floatingHeader:{borderTopLeftRadius:6,borderTopRightRadius:6},windowControlsContainer:{position:"absolute",top:4,right:4,zIndex:10},floatingModeHeader:{borderTopLeftRadius:6,borderTopRightRadius:6},headerInner:{flex:1,justifyContent:"center"},dragIndicatorContainer:{alignItems:"center",paddingVertical:8,backgroundColor:"transparent"},dragIndicatorContainerCustom:{minHeight:WINDOW_CONTROLS_BAND,justifyContent:"center",paddingVertical:0,backgroundColor:"transparent"},dragIndicator:{width:40,height:3,backgroundColor:_index.buoyColors.primary,borderRadius:2,shadowColor:_index.buoyColors.primary,shadowOffset:{width:0,height:0},shadowOpacity:.6,shadowRadius:4},floatingDragIndicator:{width:50,height:5,backgroundColor:_index.buoyColors.textMuted},dragIndicatorActive:{backgroundColor:_index.buoyColors.primary,width:40},resizeGripContainer:{position:"absolute",flexDirection:"row",gap:2,marginTop:12},resizeGripLine:{width:12,height:1,backgroundColor:_index.gameUIColors.success,opacity:.6},headerContent:{paddingHorizontal:16,alignItems:"center"},headerControls:{position:"absolute",top:8,right:16,flexDirection:"row",alignItems:"center"},headerTitle:{fontSize:16,fontWeight:"600",color:_index.gameUIColors.primary},headerSubtitle:{fontSize:12,color:_index.gameUIColors.secondary,paddingTop:4},headerHintText:{position:"absolute",top:0,left:0,right:0,bottom:0,justifyContent:"center",alignItems:"center"},hintText:{fontSize:10,color:_index.gameUIColors.muted,fontStyle:"italic"},controlButton:{width:28,height:28,borderRadius:6,justifyContent:"center",alignItems:"center",marginLeft:8},toggleButton:{backgroundColor:_index.gameUIColors.info+"1A",borderWidth:1,borderColor:_index.gameUIColors.info+"33"},closeButton:{width:28,height:28,borderRadius:6,justifyContent:"center",alignItems:"center",backgroundColor:_index.gameUIColors.error+"1A",borderWidth:1,borderColor:_index.gameUIColors.error+"33",marginLeft:8},iconLine:{position:"absolute",top:7.25,left:2,width:12,height:1.5,backgroundColor:_index.gameUIColors.error},content:{flex:1,backgroundColor:_index.buoyColors.base,borderBottomLeftRadius:16,borderBottomRightRadius:16,overflow:"hidden"},cornerHandle:{position:"absolute",zIndex:1},cornerHandleWrapper:{position:"absolute",width:30,height:30,zIndex:1e3},handler:{width:20,height:20,backgroundColor:"transparent",borderRadius:10,borderWidth:0,borderColor:"transparent"},handlerActive:{backgroundColor:_index.gameUIColors.success+"1A",borderColor:_index.gameUIColors.success,borderWidth:2,shadowColor:_index.gameUIColors.success+"99",shadowOffset:{width:0,height:0},shadowOpacity:1,shadowRadius:8}});const footerStyles=_reactNative.StyleSheet.create({footerContainer:{position:"absolute",left:0,right:0,bottom:0,backgroundColor:_index.buoyColors.base,borderBottomLeftRadius:16,borderBottomRightRadius:16}});const JsModal=exports.JsModal=(0,_react.memo)(n=>{const r=(0,_licenseModule.getUseAccountAccess)();const p=r();if(p.status!=="admitted")return n.visible?(0,_jsxRuntime.jsx)(_AccountSetup.AccountSetup,{}):null;return(0,_jsxRuntime.jsx)(JsModalComponent,{...n})});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.JsModal=void 0;var _fonts=require("./ui/fonts.js");var _licenseModule=require("./license/licenseModule.js");var _AccountSetup=require("./license/AccountSetup");var _react=require("react");var _persistentStorage=require("./utils/persistentStorage");var _modalStorage=require("./utils/modalStorage.js");var _devToolsStorageKeys=require("./storage/devToolsStorageKeys.js");var _index=require("./context/index.js");var _ToolBackground=require("./ui/backgrounds/ToolBackground.js");var _nightTheme=require("./ui/night/nightTheme.js");var _windowControlsSetting=require("./ui/components/windowControlsSetting.js");var _jsxRuntime=require("react/jsx-runtime");const buoy={base:"#121212",card:"#1A1A1A",border:"#333333",textMuted:"#888888",primary:"#20C997"};const gameUI={primary:"#F5F5F7",primaryLight:"#F5F5F7",secondary:"#A1A1A6",muted:"#8E8E93",success:"#34C759",info:"#00B8E6"};const MIN_HEIGHT=100;const DEFAULT_HEIGHT=400;const FLOATING_HEIGHT=500;const FLOATING_MIN_HEIGHT=80;const screenW=()=>typeof window!=="undefined"?window.innerWidth:0;const screenH=()=>typeof window!=="undefined"?window.innerHeight:0;const easeOutCubic=n=>1-Math.pow(1-n,3);const easeInOut=n=>n<.5?2*n*n:1-Math.pow(-2*n+2,2)/2;function runAnim(n,o,i,c){let h=0;let a=false;const p=performance.now();const C=B=>{if(a)return;const W=Math.min((B-p)/n,1);i(o(W));if(W<1){h=requestAnimationFrame(C)}else{c?.()}};h=requestAnimationFrame(C);return()=>{a=true;cancelAnimationFrame(h)}}function readSafeAreaInsets(){if(typeof document==="undefined"){return{top:0,left:0,right:0,bottom:0}}const n=document.createElement("div");n.style.cssText="position:fixed;top:env(safe-area-inset-top);left:env(safe-area-inset-left);right:env(safe-area-inset-right);bottom:env(safe-area-inset-bottom);visibility:hidden;pointer-events:none";document.body.appendChild(n);const o=n.getBoundingClientRect();document.body.removeChild(n);return{top:Math.max(0,o.top),left:Math.max(0,o.left),right:Math.max(0,window.innerWidth-o.right),bottom:Math.max(0,window.innerHeight-o.bottom)}}function clampRectToSafeArea(n,o,i=false){const c=Math.max(FLOATING_MIN_HEIGHT,window.innerWidth-o.left-o.right);const h=Math.max(FLOATING_MIN_HEIGHT,window.innerHeight-o.top-o.bottom);const a=Math.min(n.width,c);const p=Math.min(n.height,h);return{width:a,height:p,left:Math.max(o.left,Math.min(n.left,window.innerWidth-o.right-a)),top:Math.max(o.top,Math.min(n.top,window.innerHeight-o.bottom-(i?FLOATING_MIN_HEIGHT:p)))}}const XIcon=({size:n=24,color:o="currentColor",strokeWidth:i=2})=>(0,_jsxRuntime.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",children:[(0,_jsxRuntime.jsx)("line",{x1:18,y1:6,x2:6,y2:18,stroke:o,strokeWidth:i,strokeLinecap:"round"}),(0,_jsxRuntime.jsx)("line",{x1:6,y1:6,x2:18,y2:18,stroke:o,strokeWidth:i,strokeLinecap:"round"})]});const MinusIcon=({size:n=24,color:o="currentColor",strokeWidth:i=2})=>(0,_jsxRuntime.jsx)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",children:(0,_jsxRuntime.jsx)("line",{x1:5,y1:12,x2:19,y2:12,stroke:o,strokeWidth:i,strokeLinecap:"round"})});const DockBottomIcon=({size:n=24,color:o="currentColor",strokeWidth:i=2})=>(0,_jsxRuntime.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",children:[(0,_jsxRuntime.jsx)("rect",{x:3,y:3,width:18,height:18,rx:2,stroke:o,strokeWidth:i}),(0,_jsxRuntime.jsx)("rect",{x:3,y:14,width:18,height:7,fill:o})]});const FloatWindowIcon=({size:n=24,color:o="currentColor",strokeWidth:i=2})=>(0,_jsxRuntime.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",children:[(0,_jsxRuntime.jsx)("rect",{x:3,y:3,width:14,height:14,rx:2,stroke:o,strokeWidth:i}),(0,_jsxRuntime.jsx)("line",{x1:7,y1:17,x2:7,y2:21,stroke:o,strokeWidth:i}),(0,_jsxRuntime.jsx)("line",{x1:7,y1:21,x2:21,y2:21,stroke:o,strokeWidth:i}),(0,_jsxRuntime.jsx)("line",{x1:21,y1:21,x2:21,y2:7,stroke:o,strokeWidth:i}),(0,_jsxRuntime.jsx)("line",{x1:17,y1:7,x2:21,y2:7,stroke:o,strokeWidth:i})]});const WC_COLORS={close:"#FF5F57",minimize:"#FEBC2E",toggleMode:"#28C840"};const WC_BUTTON_SIZE=24;const WC_BUTTON_SPACING=2;const WC_ICON_SIZE=8;const wcDotStyle=n=>({width:WC_BUTTON_SIZE,height:WC_BUTTON_SIZE,borderRadius:WC_BUTTON_SIZE/2,display:"flex",alignItems:"center",justifyContent:"center",background:`radial-gradient(circle, ${n} 6px, transparent 6px)`,border:"none",padding:0,cursor:"pointer",flexShrink:0});function WindowControls(n){if((0,_windowControlsSetting.isExpandableWindowControlsEnabled)()&&(0,_windowControlsSetting.expandableWindowControlsSupported)(true)){return(0,_jsxRuntime.jsx)(ExpandableWindowControls,{...n})}return(0,_jsxRuntime.jsx)(PlainWindowControls,{...n})}function PlainWindowControls({onClose:n,onMinimize:o,onToggleMode:i,mode:c}){const h=c==="floating"?DockBottomIcon:FloatWindowIcon;const a=c==="floating"?"Dock to bottom sheet":"Make floating window";return(0,_jsxRuntime.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:WC_BUTTON_SPACING},children:[o&&(0,_jsxRuntime.jsx)("button",{type:"button",onClick:o,style:wcDotStyle(WC_COLORS.minimize),"aria-label":"Minimize modal",children:(0,_jsxRuntime.jsx)(MinusIcon,{size:WC_ICON_SIZE,color:"#7A5A00",strokeWidth:1.5})}),i&&(0,_jsxRuntime.jsx)("button",{type:"button",onClick:i,style:wcDotStyle(WC_COLORS.toggleMode),"aria-label":a,children:(0,_jsxRuntime.jsx)(h,{size:WC_ICON_SIZE,color:"#004A1A",strokeWidth:1.5})}),(0,_jsxRuntime.jsx)("button",{type:"button",onClick:n,style:wcDotStyle(WC_COLORS.close),"aria-label":"Close modal",children:(0,_jsxRuntime.jsx)(XIcon,{size:WC_ICON_SIZE,color:"#4A0000",strokeWidth:1.5})})]})}const WC_DOT_SIZE=12;const WC_DOT_SPACING=8;const WC_EXPANDED_BUTTON_SIZE=36;const WC_EXPANDED_BUTTON_SPACING=12;const WC_EXPANDED_ICON_SIZE=16;const WC_EXPANDED_PADDING=8;const WC_AUTO_DISMISS_MS=3e3;const WC_ANIMATION_MS=150;const wcCollapsedDot=n=>({width:WC_DOT_SIZE,height:WC_DOT_SIZE,borderRadius:WC_DOT_SIZE/2,backgroundColor:n,display:"flex",alignItems:"center",justifyContent:"center"});const wcExpandedButton=(n,o,i,c)=>({width:WC_EXPANDED_BUTTON_SIZE,height:WC_EXPANDED_BUTTON_SIZE,borderRadius:WC_EXPANDED_BUTTON_SIZE/2,display:"flex",alignItems:"center",justifyContent:"center",padding:0,cursor:"pointer",flexShrink:0,backgroundColor:n?i:o,border:n?`1px solid ${c}`:"none"});function ExpandableWindowControls({onClose:n,onMinimize:o,onToggleMode:i,mode:c,variant:h="night"}){const a=h==="night";const[p,C]=(0,_react.useState)(false);const[B,W]=(0,_react.useState)(false);const H=(0,_react.useRef)(null);const T=(0,_react.useRef)(null);const y=c==="floating"?DockBottomIcon:FloatWindowIcon;const k=c==="floating"?"Dock to bottom sheet":"Make floating window";const S=(0,_react.useCallback)(()=>{if(H.current)clearTimeout(H.current);if(T.current)clearTimeout(T.current);H.current=null;T.current=null},[]);const P=(0,_react.useCallback)(()=>{S();W(false);T.current=setTimeout(()=>C(false),WC_ANIMATION_MS)},[S]);const G=(0,_react.useCallback)(()=>{S();C(true);requestAnimationFrame(()=>requestAnimationFrame(()=>W(true)));H.current=setTimeout(P,WC_AUTO_DISMISS_MS)},[S,P]);(0,_react.useEffect)(()=>S,[S]);const U=b=>{P();b()};return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)("button",{type:"button",onClick:G,"aria-label":"Open window controls","data-testid":"tool-window-controls",style:{padding:10,margin:-8,border:"none",background:"transparent",cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",gap:WC_DOT_SPACING},children:[o&&(0,_jsxRuntime.jsx)("span",{style:wcCollapsedDot(WC_COLORS.minimize),children:(0,_jsxRuntime.jsx)(MinusIcon,{size:WC_ICON_SIZE,color:"#7A5A00",strokeWidth:1.5})}),i&&(0,_jsxRuntime.jsx)("span",{style:wcCollapsedDot(WC_COLORS.toggleMode),children:(0,_jsxRuntime.jsx)(y,{size:WC_ICON_SIZE,color:"#004A1A",strokeWidth:1.5})}),(0,_jsxRuntime.jsx)("span",{style:wcCollapsedDot(WC_COLORS.close),children:(0,_jsxRuntime.jsx)(XIcon,{size:WC_ICON_SIZE,color:"#4A0000",strokeWidth:1.5})})]}),p&&(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",top:-WC_EXPANDED_PADDING,right:-WC_EXPANDED_PADDING,zIndex:9999,transform:`scale(${B?1:.3})`,opacity:B?1:0,transition:`transform ${WC_ANIMATION_MS}ms ease-out, opacity ${WC_ANIMATION_MS}ms ease-out`},children:(0,_jsxRuntime.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:WC_EXPANDED_BUTTON_SPACING,padding:WC_EXPANDED_PADDING,borderRadius:(WC_EXPANDED_BUTTON_SIZE+WC_EXPANDED_PADDING*2)/2,backgroundColor:a?_nightTheme.night.color.surface:buoy.card,border:`1px solid ${a?_nightTheme.night.color.border:buoy.border}`,boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:[o&&(0,_jsxRuntime.jsx)("button",{type:"button",onClick:()=>U(o),"aria-label":"Minimize modal","data-testid":"tool-window-minimize",style:wcExpandedButton(a,WC_COLORS.minimize,_nightTheme.night.color.warningSoft,_nightTheme.night.color.warning+"59"),children:(0,_jsxRuntime.jsx)(MinusIcon,{size:WC_EXPANDED_ICON_SIZE,color:a?_nightTheme.night.color.warning:"#7A5A00",strokeWidth:2})}),i&&(0,_jsxRuntime.jsx)("button",{type:"button",onClick:()=>U(i),"aria-label":k,"data-testid":"tool-window-mode",style:wcExpandedButton(a,WC_COLORS.toggleMode,_nightTheme.night.color.accentSoft,_nightTheme.night.color.accentBorderStrong),children:(0,_jsxRuntime.jsx)(y,{size:WC_EXPANDED_ICON_SIZE,color:a?_nightTheme.night.color.accent:"#004A1A",strokeWidth:2})}),(0,_jsxRuntime.jsx)("button",{type:"button",onClick:()=>U(n),"aria-label":"Close modal","data-testid":"tool-window-close",style:wcExpandedButton(a,WC_COLORS.close,_nightTheme.night.color.dangerSoft,_nightTheme.night.color.danger+"59"),children:(0,_jsxRuntime.jsx)(XIcon,{size:WC_EXPANDED_ICON_SIZE,color:a?_nightTheme.night.color.danger:"#4A0000",strokeWidth:2})})]})})]})}const DragIndicator=(0,_react.memo)(function n({isResizing:o,mode:i,hasCustomContent:c=false,variant:h="default"}){const a=i==="floating";const p=h==="night";return(0,_jsxRuntime.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",position:"relative",justifyContent:c?"center":void 0,minHeight:c?32:void 0,paddingTop:c?0:8,paddingBottom:c?0:8,backgroundColor:"transparent"},children:[(0,_jsxRuntime.jsx)("div",{style:{width:p?36:o?40:a?50:40,height:p?5:a?5:3,backgroundColor:p?_nightTheme.night.color.placeholder:o?buoy.primary:a?buoy.textMuted:buoy.primary,borderRadius:p?2.5:2,boxShadow:p?"none":`0 0 4px ${buoy.primary}99`}}),o&&i==="bottomSheet"&&(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",display:"flex",flexDirection:"row",gap:2,marginTop:12},children:[0,1,2].map(C=>(0,_jsxRuntime.jsx)("div",{style:{width:12,height:1,backgroundColor:gameUI.success,opacity:.6}},C))})]})});const ModalHintBanner=(0,_react.memo)(function n({onAcknowledge:o}){return(0,_jsxRuntime.jsx)("div",{style:{backgroundColor:`${gameUI.info}15`,borderLeft:`3px solid ${gameUI.info}`,borderRadius:8,margin:"8px 12px 4px",overflow:"hidden",boxShadow:`0 0 8px ${gameUI.info}4D`,flexShrink:0},children:(0,_jsxRuntime.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",padding:12,gap:12},children:[(0,_jsxRuntime.jsxs)("div",{style:{width:32,height:32,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:[(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",width:20,height:20,borderRadius:10,border:`2px solid ${gameUI.info}`,opacity:.6,transform:"scale(0.8)",boxSizing:"border-box"}}),(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",width:20,height:20,borderRadius:10,border:`2px solid ${gameUI.info}`,boxSizing:"border-box"}})]}),(0,_jsxRuntime.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:2},children:[(0,_jsxRuntime.jsx)("span",{style:{fontSize:13,fontWeight:600,color:gameUI.info,letterSpacing:.3},children:"\u{1F4A1} Pro Tip"}),(0,_jsxRuntime.jsx)("span",{style:{fontSize:12,color:gameUI.primaryLight,lineHeight:"16px"},children:"Double-tap the header to transform this into a floating modal"})]}),(0,_jsxRuntime.jsx)("button",{type:"button",onClick:o,style:{backgroundColor:`${gameUI.info}30`,padding:"6px 12px",borderRadius:6,border:`1px solid ${gameUI.info}50`,fontSize:12,fontWeight:600,color:gameUI.info,cursor:"pointer",fontFamily:"inherit",flexShrink:0},children:"Got it!"})]})})});function ModalHeaderContent({header:n,isResizing:o,mode:i,onMinimize:c,variant:h="default"}){if(n?.customContent){let a=n.customContent;if((0,_react.isValidElement)(n.customContent)&&c){a=(0,_react.cloneElement)(n.customContent,{onMinimize:c})}return(0,_jsxRuntime.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minWidth:0},children:[(0,_jsxRuntime.jsx)(DragIndicator,{isResizing:o,mode:i,hasCustomContent:true,variant:h}),a]})}return(0,_jsxRuntime.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",position:"relative",minWidth:0},children:[(0,_jsxRuntime.jsx)(DragIndicator,{isResizing:o,mode:i,variant:h}),(0,_jsxRuntime.jsxs)("div",{style:{padding:"0 16px",display:"flex",flexDirection:"column",alignItems:"center"},children:[n?.title&&(0,_jsxRuntime.jsx)("span",{style:{fontSize:16,fontWeight:600,color:gameUI.primary},children:n.title}),n?.subtitle&&(0,_jsxRuntime.jsx)("span",{style:{fontSize:12,color:gameUI.secondary,paddingTop:4},children:n.subtitle})]}),(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:(0,_jsxRuntime.jsx)("span",{style:{fontSize:10,color:gameUI.muted,fontStyle:"italic"},children:"Double tap: Toggle \u2022 Triple tap: Close"})})]})}const JsModalComponent=({visible:n,onClose:o,children:i,header:c,styles:h={},minHeight:a=MIN_HEIGHT,maxHeight:p,initialHeight:C=DEFAULT_HEIGHT,animatedHeight:B,benchMotion:W,initialMode:H="bottomSheet",onModeChange:T,persistenceKey:y,enablePersistence:k=true,initialFloatingPosition:S,footer:P,footerHeight:G=0,onBack:U,onMinimize:b,minimizeRequest:Z=0,minimizeTargetPosition:it,initialModalState:g,zIndex:ht,disableScrollWrapper:At=false,background:gt=true,variant:J="night"})=>{const[w]=(0,_react.useState)(readSafeAreaInsets);const[pt,xt]=(0,_react.useState)(!k);const[f,st]=(0,_react.useState)(H);const V=(0,_react.useRef)(T);V.current=T;const[z,A]=(0,_react.useState)(false);const[at,Y]=(0,_react.useState)(false);const[It,lt]=(0,_react.useState)(C);const[R,F]=(0,_react.useState)(()=>clampRectToSafeArea({width:screenW(),height:FLOATING_HEIGHT,top:S?.y??(screenH()-FLOATING_HEIGHT)/2,left:S?.x??0},w));const[Mt,Q]=(0,_react.useState)(false);const[Et,mt]=(0,_react.useState)(false);const _t=(0,_index.useHintsDisabled)();const I=(0,_react.useRef)(C);const v=(0,_react.useRef)(R);const x=(0,_react.useRef)({x:R.left,y:R.top});const K=(0,_react.useRef)(null);const ct=(0,_react.useRef)(null);const D=(0,_react.useRef)(null);const M=(0,_react.useRef)([]);const j=(0,_react.useCallback)(()=>{M.current.forEach(t=>t());M.current=[]},[]);(0,_react.useEffect)(()=>{v.current=R},[R]);(0,_react.useEffect)(()=>j,[j]);const bt=p||screenH()-w.top;(0,_react.useEffect)(()=>{if(!k||!y){xt(true);return}let t=true;const e=async()=>{const r=await _modalStorage.ModalStorage.load(y);if(t&&r){if(r.mode){st(r.mode);V.current?.(r.mode)}if(r.panelHeight){lt(r.panelHeight);I.current=r.panelHeight}if(r.dimensions){const s=clampRectToSafeArea(r.dimensions,w,true);F(s);x.current={x:s.left,y:s.top}}}if(t)xt(true)};e();return()=>{t=false}},[y,k]);(0,_react.useEffect)(()=>{if(!k||!y||!pt)return;const t=setTimeout(()=>{_modalStorage.ModalStorage.save(y,{mode:f,panelHeight:I.current,dimensions:R,isVisible:n})},500);return()=>clearTimeout(t)},[f,It,R,n,y,k,pt]);(0,_react.useEffect)(()=>{let t=true;const e=async()=>{try{const r=_devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();const s=await _persistentStorage.persistentStorage.getItem(r);if(t){Q(s!=="true");mt(true)}}catch{if(t){Q(true);mt(true)}}};e();return()=>{t=false}},[]);const $t=(0,_react.useCallback)(async()=>{try{const t=_devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();await _persistentStorage.persistentStorage.setItem(t,"true");Q(false)}catch{Q(false)}},[]);const dt=(0,_react.useCallback)(()=>{Y(false);A(false);const t=f==="bottomSheet"?"floating":"bottomSheet";st(t);V.current?.(t)},[f]);(0,_react.useEffect)(()=>{Y(false);A(false)},[f]);const E=(0,_react.useCallback)(()=>{if(!b)return;const t={mode:f,panelHeight:I.current,floatingPosition:{x:v.current.left,y:v.current.top},floatingDimensions:{width:v.current.width,height:v.current.height}};if(k&&y)void _modalStorage.ModalStorage.saveMinimized(y,t);const e=it?.x??screenW()-50;const r=it?.y??screenH()-150;j();if(f==="bottomSheet"){const s=K.current;if(!s){b(t);return}const l=screenH();M.current.push(runAnim(300,easeInOut,u=>{s.style.opacity=String(1-u);s.style.transform=`translateY(${u*l}px)`},()=>b(t)))}else{const s=D.current;if(!s){b(t);return}const l={...x.current};M.current.push(runAnim(300,easeInOut,u=>{s.style.opacity=String(1-u);const O=l.x+(e-l.x)*u;const _=l.y+(r-l.y)*u;s.style.transform=`translate(${O}px, ${_}px)`},()=>b(t)))}},[f,b,it,j,k,y]);const yt=(0,_react.useRef)(Z);(0,_react.useEffect)(()=>{if(yt.current===Z)return;yt.current=Z;E()},[Z,E]);(0,_react.useEffect)(()=>{if(!g)return;if(g.mode){st(g.mode);V.current?.(g.mode)}if(g.panelHeight){lt(g.panelHeight);I.current=g.panelHeight}if(g.floatingDimensions&&g.floatingPosition){const t={width:g.floatingDimensions.width,height:g.floatingDimensions.height,top:g.floatingPosition.y,left:g.floatingPosition.x};F(t);x.current={x:g.floatingPosition.x,y:g.floatingPosition.y}}},[g]);(0,_react.useLayoutEffect)(()=>{if(!n)return;j();if(f==="bottomSheet"){const t=K.current;if(!t)return;const e=screenH();t.style.transform=`translateY(${e}px)`;t.style.opacity="0";M.current.push(runAnim(300,easeOutCubic,r=>{t.style.transform=`translateY(${(1-r)*e}px)`}),runAnim(200,easeInOut,r=>{t.style.opacity=String(r)}))}else{const t=D.current;if(!t)return;x.current={x:v.current.left,y:v.current.top};t.style.transform=`translate(${x.current.x}px, ${x.current.y}px)`;t.style.opacity="0";M.current.push(runAnim(200,easeInOut,e=>{t.style.opacity=String(e)}))}},[n,f,j]);const wt=(0,_react.useRef)(0);const L=(0,_react.useRef)(0);const N=(0,_react.useRef)(null);const tt=(0,_react.useCallback)(()=>{const t=Date.now();if(t-wt.current>500){L.current=0}L.current++;wt.current=t;if(N.current)clearTimeout(N.current);N.current=setTimeout(()=>{if(L.current===2){dt()}else if(L.current>=3){if(b)E()}L.current=0},300)},[dt,b,E]);(0,_react.useEffect)(()=>{return()=>{if(N.current)clearTimeout(N.current)}},[]);const et=(0,_react.useRef)({active:false,resizing:false,startY:0,headerOffsetY:0,samples:[]});const Wt=(0,_react.useCallback)(t=>{if(f!=="bottomSheet")return;if(t.button!==0||t.target.closest('button, a, input, textarea, select, [role="button"], [role="tab"], [role="switch"], [contenteditable="true"], [tabindex]'))return;const e=et.current;e.active=true;e.resizing=false;e.startY=t.clientY;const r=t.currentTarget.getBoundingClientRect();e.headerOffsetY=t.clientY-r.top;e.samples=[{t:performance.now(),y:t.clientY}];t.currentTarget.setPointerCapture(t.pointerId)},[f]);const Ht=(0,_react.useCallback)(t=>{const e=et.current;if(!e.active)return;const r=t.clientY-e.startY;if(!e.resizing&&Math.abs(r)>3){e.resizing=true;j();A(true)}if(!e.resizing)return;const s=t.clientY-e.headerOffsetY;let l=screenH()-s;l=Math.max(a,Math.min(l,bt));I.current=l;if(ct.current)ct.current.style.height=`${l}px`;const u=performance.now();e.samples.push({t:u,y:t.clientY});while(e.samples.length>2&&u-e.samples[0].t>100)e.samples.shift()},[a,bt,j]);const Pt=(0,_react.useCallback)(t=>{const e=et.current;if(!e.active)return;e.active=false;if(!e.resizing){tt();return}A(false);const r=I.current;const s=t.clientY-e.startY;const l=e.samples[0];const u=e.samples[e.samples.length-1];const O=u&&l&&u.t>l.t?(u.y-l.y)/(u.t-l.t):0;const _=O>.8&&s>50||s>150&&r<=a;if(_){const m=K.current;j();if(m){const X=screenH();M.current.push(runAnim(200,easeInOut,$=>{m.style.opacity=String(1-$)}),runAnim(300,easeOutCubic,$=>{m.style.transform=`translateY(${$*X}px)`},()=>o()))}else{o()}return}lt(r)},[a,o,tt,j]);const Bt=(0,_react.useCallback)(()=>{const t=et.current;if(!t.active)return;t.active=false;t.resizing=false;A(false)},[]);const nt=(0,_react.useRef)({active:false,dragging:false,startX:0,startY:0,startPos:{x:0,y:0}});const zt=(0,_react.useCallback)(t=>{if(f!=="floating"||z)return;if(t.button!==0||t.target.closest('button, a, input, textarea, select, [role="button"], [role="tab"], [role="switch"], [contenteditable="true"], [tabindex]'))return;const e=nt.current;e.active=true;e.dragging=false;e.startX=t.clientX;e.startY=t.clientY;e.startPos={...x.current};t.currentTarget.setPointerCapture(t.pointerId)},[f,z]);const Yt=(0,_react.useCallback)(t=>{const e=nt.current;if(!e.active)return;const r=t.clientX-e.startX;const s=t.clientY-e.startY;if(!e.dragging&&Math.abs(r)+Math.abs(s)>5){e.dragging=true;Y(true)}if(!e.dragging)return;const l=e.startPos.x+r;const u=e.startPos.y+s;x.current={x:l,y:u};if(D.current){D.current.style.transform=`translate(${l}px, ${u}px)`}},[]);const Ft=(0,_react.useCallback)(()=>{const t=nt.current;if(!t.active)return;t.active=false;if(!t.dragging){tt();return}Y(false);const e=v.current;const r=clampRectToSafeArea({...e,left:x.current.x,top:x.current.y},w);const s=r.left;const l=r.top;x.current={x:s,y:l};if(D.current){D.current.style.transform=`translate(${s}px, ${l}px)`}F(u=>({...u,left:s,top:l}))},[w,tt]);const Lt=(0,_react.useCallback)(()=>{const t=nt.current;if(!t.active)return;t.active=false;t.dragging=false;Y(false)},[]);const ut=(0,_react.useRef)({active:false,corner:"bottomRight",startX:0,startY:0,start:{width:0,height:0,top:0,left:0}});const Nt=(0,_react.useCallback)(t=>e=>{if(f!=="floating")return;e.stopPropagation();const r=ut.current;r.active=true;r.corner=t;r.startX=e.clientX;r.startY=e.clientY;r.start={...v.current};A(true);e.currentTarget.setPointerCapture(e.pointerId)},[f]);const Ot=(0,_react.useCallback)(t=>{const e=ut.current;if(!e.active)return;const r=t.clientX-e.startX;const s=t.clientY-e.startY;if(Math.abs(r)<.5&&Math.abs(s)<.5)return;const l=Math.max(0,w.left);const u=screenH()-Math.max(0,w.bottom);const O=screenW()-Math.max(0,w.right);const _=screenW()*.25;const m=e.start;const X=m.left+m.width;const $=m.top+m.height;let q=m.left;const rt=m.top;let Dt=X;let ft=$;if(e.corner==="bottomLeft"){q=Math.max(l,Math.min(m.left+r,X-_));ft=Math.min(u,Math.max($+s,m.top+FLOATING_MIN_HEIGHT))}else{Dt=Math.min(O,Math.max(X+r,m.left+_));ft=Math.min(u,Math.max($+s,m.top+FLOATING_MIN_HEIGHT))}const Xt=Math.max(_,Dt-q);const qt=Math.max(FLOATING_MIN_HEIGHT,ft-rt);const Tt={width:Xt,height:qt,left:q,top:rt};v.current=Tt;x.current={x:q,y:rt};F(Tt);if(D.current){D.current.style.transform=`translate(${q}px, ${rt}px)`}},[w.left,w.right,w.bottom]);const vt=(0,_react.useCallback)(()=>{const t=ut.current;if(!t.active)return;t.active=false;A(false);F(v.current)},[]);const ot=!n;const Ct=ot?{left:-9999,top:-9999,opacity:0,visibility:"hidden",pointerEvents:"none"}:{};const jt=c?.title||"Dev tool panel";const d=J==="night";const kt=gt&&d?(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":true,children:(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{})}):null;const St=(0,_jsxRuntime.jsxs)("div",{style:{flex:1,minHeight:0,position:"relative",display:"flex",flexDirection:"column",backgroundColor:d?"transparent":buoy.base,borderBottomLeftRadius:16,borderBottomRightRadius:16,overflow:"hidden",...h.content},children:[gt&&!d?(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{}):null,At?(0,_jsxRuntime.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",paddingBottom:G},children:i}):(0,_jsxRuntime.jsx)("div",{style:{flex:1,minHeight:0,overflowY:"auto",paddingBottom:G},children:i}),P?(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",left:0,right:0,bottom:0,backgroundColor:buoy.base,borderBottomLeftRadius:16,borderBottomRightRadius:16},children:P}):null]});const Rt=(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",top:4,right:4,zIndex:10},children:(0,_jsxRuntime.jsx)(WindowControls,{onClose:o,onMinimize:b?E:void 0,onToggleMode:dt,mode:f,variant:J})});if(f==="floating"){const t=at||z;return(0,_jsxRuntime.jsxs)("div",{ref:D,role:"dialog","aria-label":jt,"aria-hidden":ot||void 0,style:{fontFamily:_fonts.systemFont,position:"fixed",pointerEvents:"auto",left:0,top:0,width:R.width,height:R.height,transform:`translate(${x.current.x}px, ${x.current.y}px)`,display:"flex",flexDirection:"column",backgroundColor:d?_nightTheme.night.color.bg:buoy.card,borderRadius:d?_nightTheme.night.radius.sheet:6,border:d?`1px solid ${_nightTheme.night.color.accent}55`:t?`2px solid ${buoy.primary}`:`1px solid ${buoy.border}`,boxShadow:d?`0 0 14px ${_nightTheme.night.color.accent}38`:t?`0 0 12px ${buoy.primary}7A`:`0 0 20px ${buoy.primary}4D`,...d?{overflow:"hidden"}:null,boxSizing:"border-box",zIndex:ht??1e3,...h.container,...Ct},children:[kt,(0,_jsxRuntime.jsx)("div",{onPointerDown:zt,onPointerMove:Yt,onPointerUp:Ft,onPointerCancel:Lt,style:{borderTopLeftRadius:d?_nightTheme.night.radius.sheet:6,borderTopRightRadius:d?_nightTheme.night.radius.sheet:6,backgroundColor:d?"transparent":buoy.card,minHeight:56,border:d?"none":`1px solid ${buoy.border}`,boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"center",flexShrink:0,touchAction:"none",userSelect:"none",cursor:at?"grabbing":"grab",position:"relative"},children:(0,_jsxRuntime.jsx)(ModalHeaderContent,{header:c,isResizing:at||z,mode:f,onMinimize:b?E:void 0,variant:J})}),Rt,St,["bottomLeft","bottomRight"].map(e=>(0,_jsxRuntime.jsx)("div",{onPointerDown:Nt(e),onPointerMove:Ot,onPointerUp:vt,onPointerCancel:vt,style:{position:"absolute",width:30,height:30,bottom:4,...e==="bottomLeft"?{left:4}:{right:4},zIndex:1e3,touchAction:"none",cursor:e==="bottomLeft"?"nesw-resize":"nwse-resize"},children:(0,_jsxRuntime.jsx)("div",{style:{width:20,height:20,borderRadius:10,boxSizing:"border-box",backgroundColor:t?`${gameUI.success}1A`:"transparent",border:t?`2px solid ${gameUI.success}`:"none",boxShadow:t?`0 0 8px ${gameUI.success}99`:"none"}})},e))]},"floating")}return(0,_jsxRuntime.jsx)("div",{"aria-hidden":ot||void 0,style:{fontFamily:_fonts.systemFont,position:"fixed",inset:0,zIndex:ht??1e3,pointerEvents:"none",...ot?{...Ct,inset:"auto",width:"100vw",height:"100vh"}:null},children:(0,_jsxRuntime.jsx)("div",{ref:K,style:{position:"absolute",bottom:0,left:0,right:0,pointerEvents:"auto"},children:(0,_jsxRuntime.jsxs)("div",{ref:ct,role:"dialog","aria-label":jt,style:{height:I.current,display:"flex",flexDirection:"column",backgroundColor:d?_nightTheme.night.color.bg:buoy.card,borderTopLeftRadius:d?_nightTheme.night.radius.sheet:6,borderTopRightRadius:d?_nightTheme.night.radius.sheet:6,border:d?`1px solid ${_nightTheme.night.color.accent}55`:`1px solid ${buoy.border}`,boxShadow:d?`0 -4px 10px ${_nightTheme.night.color.accent}38`:`0 -4px 12px ${buoy.primary}33`,...d?{overflow:"hidden"}:null,boxSizing:"border-box",position:"relative",...h.container},children:[kt,(0,_jsxRuntime.jsx)("div",{onPointerDown:Wt,onPointerMove:Ht,onPointerUp:Pt,onPointerCancel:Bt,style:{borderTopLeftRadius:d?_nightTheme.night.radius.sheet:6,borderTopRightRadius:d?_nightTheme.night.radius.sheet:6,backgroundColor:d?"transparent":buoy.card,minHeight:56,border:d?"none":`1px solid ${buoy.border}`,boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"center",flexShrink:0,touchAction:"none",userSelect:"none",cursor:"ns-resize",position:"relative"},children:(0,_jsxRuntime.jsx)(ModalHeaderContent,{header:c,isResizing:z,mode:f,onMinimize:b?E:void 0,variant:J})}),Rt,Et&&Mt&&!_t&&(0,_jsxRuntime.jsx)(ModalHintBanner,{onAcknowledge:$t}),St]})})},"bottomSheet")};const JsModal=exports.JsModal=(0,_react.memo)(n=>{const o=(0,_licenseModule.getUseAccountAccess)()();if(o.status!=="admitted")return n.visible?(0,_jsxRuntime.jsx)(_AccountSetup.AccountSetup,{}):null;return(0,_jsxRuntime.jsx)(JsModalComponent,{...n})});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.JsModal=void 0;var _fonts=require("./ui/fonts.js");var _licenseModule=require("./license/licenseModule.js");var _AccountSetup=require("./license/AccountSetup");var _react=require("react");var _persistentStorage=require("./utils/persistentStorage");var _modalStorage=require("./utils/modalStorage.js");var _devToolsStorageKeys=require("./storage/devToolsStorageKeys.js");var _index=require("./context/index.js");var _ToolBackground=require("./ui/backgrounds/ToolBackground.js");var _nightTheme=require("./ui/night/nightTheme.js");var _windowControlsSetting=require("./ui/components/windowControlsSetting.js");var _jsxRuntime=require("react/jsx-runtime");const buoy={base:"#121212",card:"#1A1A1A",border:"#333333",textMuted:"#888888",primary:"#20C997"};const gameUI={primary:"#F5F5F7",primaryLight:"#F5F5F7",secondary:"#A1A1A6",muted:"#8E8E93",success:"#34C759",info:"#00B8E6"};const MIN_HEIGHT=100;const DEFAULT_HEIGHT=400;const FLOATING_HEIGHT=500;const FLOATING_MIN_HEIGHT=80;const screenW=()=>typeof window!=="undefined"?window.innerWidth:0;const screenH=()=>typeof window!=="undefined"?window.innerHeight:0;const easeOutCubic=n=>1-Math.pow(1-n,3);const easeInOut=n=>n<.5?2*n*n:1-Math.pow(-2*n+2,2)/2;function runAnim(n,o,i,c){let h=0;let a=false;const p=performance.now();const C=B=>{if(a)return;const W=Math.min((B-p)/n,1);i(o(W));if(W<1){h=requestAnimationFrame(C)}else{c?.()}};h=requestAnimationFrame(C);return()=>{a=true;cancelAnimationFrame(h)}}function readSafeAreaInsets(){if(typeof document==="undefined"){return{top:0,left:0,right:0,bottom:0}}const n=document.createElement("div");n.style.cssText="position:fixed;top:env(safe-area-inset-top);left:env(safe-area-inset-left);right:env(safe-area-inset-right);bottom:env(safe-area-inset-bottom);visibility:hidden;pointer-events:none";document.body.appendChild(n);const o=n.getBoundingClientRect();document.body.removeChild(n);return{top:Math.max(0,o.top),left:Math.max(0,o.left),right:Math.max(0,window.innerWidth-o.right),bottom:Math.max(0,window.innerHeight-o.bottom)}}function clampRectToSafeArea(n,o,i=false){const c=Math.max(FLOATING_MIN_HEIGHT,window.innerWidth-o.left-o.right);const h=Math.max(FLOATING_MIN_HEIGHT,window.innerHeight-o.top-o.bottom);const a=Math.min(n.width,c);const p=Math.min(n.height,h);return{width:a,height:p,left:Math.max(o.left,Math.min(n.left,window.innerWidth-o.right-a)),top:Math.max(o.top,Math.min(n.top,window.innerHeight-o.bottom-(i?FLOATING_MIN_HEIGHT:p)))}}const XIcon=({size:n=24,color:o="currentColor",strokeWidth:i=2})=>(0,_jsxRuntime.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",children:[(0,_jsxRuntime.jsx)("line",{x1:18,y1:6,x2:6,y2:18,stroke:o,strokeWidth:i,strokeLinecap:"round"}),(0,_jsxRuntime.jsx)("line",{x1:6,y1:6,x2:18,y2:18,stroke:o,strokeWidth:i,strokeLinecap:"round"})]});const MinusIcon=({size:n=24,color:o="currentColor",strokeWidth:i=2})=>(0,_jsxRuntime.jsx)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",children:(0,_jsxRuntime.jsx)("line",{x1:5,y1:12,x2:19,y2:12,stroke:o,strokeWidth:i,strokeLinecap:"round"})});const DockBottomIcon=({size:n=24,color:o="currentColor",strokeWidth:i=2})=>(0,_jsxRuntime.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",children:[(0,_jsxRuntime.jsx)("rect",{x:3,y:3,width:18,height:18,rx:2,stroke:o,strokeWidth:i}),(0,_jsxRuntime.jsx)("rect",{x:3,y:14,width:18,height:7,fill:o})]});const FloatWindowIcon=({size:n=24,color:o="currentColor",strokeWidth:i=2})=>(0,_jsxRuntime.jsxs)("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",children:[(0,_jsxRuntime.jsx)("rect",{x:3,y:3,width:14,height:14,rx:2,stroke:o,strokeWidth:i}),(0,_jsxRuntime.jsx)("line",{x1:7,y1:17,x2:7,y2:21,stroke:o,strokeWidth:i}),(0,_jsxRuntime.jsx)("line",{x1:7,y1:21,x2:21,y2:21,stroke:o,strokeWidth:i}),(0,_jsxRuntime.jsx)("line",{x1:21,y1:21,x2:21,y2:7,stroke:o,strokeWidth:i}),(0,_jsxRuntime.jsx)("line",{x1:17,y1:7,x2:21,y2:7,stroke:o,strokeWidth:i})]});const WC_COLORS={close:"#FF5F57",minimize:"#FEBC2E",toggleMode:"#28C840"};const WC_BUTTON_SIZE=24;const WC_BUTTON_SPACING=2;const WC_ICON_SIZE=8;const wcDotStyle=n=>({width:WC_BUTTON_SIZE,height:WC_BUTTON_SIZE,borderRadius:WC_BUTTON_SIZE/2,display:"flex",alignItems:"center",justifyContent:"center",background:`radial-gradient(circle, ${n} 6px, transparent 6px)`,border:"none",padding:0,cursor:"pointer",flexShrink:0});function WindowControls(n){if((0,_windowControlsSetting.isExpandableWindowControlsEnabled)()&&(0,_windowControlsSetting.expandableWindowControlsSupported)(true)){return(0,_jsxRuntime.jsx)(ExpandableWindowControls,{...n})}return(0,_jsxRuntime.jsx)(PlainWindowControls,{...n})}function PlainWindowControls({onClose:n,onMinimize:o,onToggleMode:i,mode:c}){const h=c==="floating"?DockBottomIcon:FloatWindowIcon;const a=c==="floating"?"Dock to bottom sheet":"Make floating window";return(0,_jsxRuntime.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:WC_BUTTON_SPACING},children:[o&&(0,_jsxRuntime.jsx)("button",{type:"button",onClick:o,style:wcDotStyle(WC_COLORS.minimize),"aria-label":"Minimize modal",children:(0,_jsxRuntime.jsx)(MinusIcon,{size:WC_ICON_SIZE,color:"#7A5A00",strokeWidth:1.5})}),i&&(0,_jsxRuntime.jsx)("button",{type:"button",onClick:i,style:wcDotStyle(WC_COLORS.toggleMode),"aria-label":a,children:(0,_jsxRuntime.jsx)(h,{size:WC_ICON_SIZE,color:"#004A1A",strokeWidth:1.5})}),(0,_jsxRuntime.jsx)("button",{type:"button",onClick:n,style:wcDotStyle(WC_COLORS.close),"aria-label":"Close modal",children:(0,_jsxRuntime.jsx)(XIcon,{size:WC_ICON_SIZE,color:"#4A0000",strokeWidth:1.5})})]})}const WC_DOT_SIZE=12;const WC_DOT_SPACING=8;const WC_EXPANDED_BUTTON_SIZE=36;const WC_EXPANDED_BUTTON_SPACING=12;const WC_EXPANDED_ICON_SIZE=16;const WC_EXPANDED_PADDING=8;const WC_AUTO_DISMISS_MS=3e3;const WC_ANIMATION_MS=150;const wcCollapsedDot=n=>({width:WC_DOT_SIZE,height:WC_DOT_SIZE,borderRadius:WC_DOT_SIZE/2,backgroundColor:n,display:"flex",alignItems:"center",justifyContent:"center"});const wcExpandedButton=(n,o,i,c)=>({width:WC_EXPANDED_BUTTON_SIZE,height:WC_EXPANDED_BUTTON_SIZE,borderRadius:WC_EXPANDED_BUTTON_SIZE/2,display:"flex",alignItems:"center",justifyContent:"center",padding:0,cursor:"pointer",flexShrink:0,backgroundColor:n?i:o,border:n?`1px solid ${c}`:"none"});function ExpandableWindowControls({onClose:n,onMinimize:o,onToggleMode:i,mode:c,variant:h="night"}){const a=h==="night";const[p,C]=(0,_react.useState)(false);const[B,W]=(0,_react.useState)(false);const H=(0,_react.useRef)(null);const A=(0,_react.useRef)(null);const y=c==="floating"?DockBottomIcon:FloatWindowIcon;const k=c==="floating"?"Dock to bottom sheet":"Make floating window";const S=(0,_react.useCallback)(()=>{if(H.current)clearTimeout(H.current);if(A.current)clearTimeout(A.current);H.current=null;A.current=null},[]);const P=(0,_react.useCallback)(()=>{S();W(false);A.current=setTimeout(()=>C(false),WC_ANIMATION_MS)},[S]);const G=(0,_react.useCallback)(()=>{S();C(true);requestAnimationFrame(()=>requestAnimationFrame(()=>W(true)));H.current=setTimeout(P,WC_AUTO_DISMISS_MS)},[S,P]);(0,_react.useEffect)(()=>S,[S]);const U=b=>{P();b()};return(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsxs)("button",{type:"button",onClick:G,"aria-label":"Open window controls","data-testid":"tool-window-controls",style:{padding:10,margin:-8,border:"none",background:"transparent",cursor:"pointer",display:"flex",flexDirection:"row",alignItems:"center",gap:WC_DOT_SPACING},children:[o&&(0,_jsxRuntime.jsx)("span",{style:wcCollapsedDot(WC_COLORS.minimize),children:(0,_jsxRuntime.jsx)(MinusIcon,{size:WC_ICON_SIZE,color:"#7A5A00",strokeWidth:1.5})}),i&&(0,_jsxRuntime.jsx)("span",{style:wcCollapsedDot(WC_COLORS.toggleMode),children:(0,_jsxRuntime.jsx)(y,{size:WC_ICON_SIZE,color:"#004A1A",strokeWidth:1.5})}),(0,_jsxRuntime.jsx)("span",{style:wcCollapsedDot(WC_COLORS.close),children:(0,_jsxRuntime.jsx)(XIcon,{size:WC_ICON_SIZE,color:"#4A0000",strokeWidth:1.5})})]}),p&&(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",top:-WC_EXPANDED_PADDING,right:-WC_EXPANDED_PADDING,zIndex:9999,transform:`scale(${B?1:.3})`,opacity:B?1:0,transition:`transform ${WC_ANIMATION_MS}ms ease-out, opacity ${WC_ANIMATION_MS}ms ease-out`},children:(0,_jsxRuntime.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:WC_EXPANDED_BUTTON_SPACING,padding:WC_EXPANDED_PADDING,borderRadius:(WC_EXPANDED_BUTTON_SIZE+WC_EXPANDED_PADDING*2)/2,backgroundColor:a?_nightTheme.night.color.surface:buoy.card,border:`1px solid ${a?_nightTheme.night.color.border:buoy.border}`,boxShadow:"0 4px 12px rgba(0,0,0,0.4)"},children:[o&&(0,_jsxRuntime.jsx)("button",{type:"button",onClick:()=>U(o),"aria-label":"Minimize modal","data-testid":"tool-window-minimize",style:wcExpandedButton(a,WC_COLORS.minimize,_nightTheme.night.color.warningSoft,_nightTheme.night.color.warning+"59"),children:(0,_jsxRuntime.jsx)(MinusIcon,{size:WC_EXPANDED_ICON_SIZE,color:a?_nightTheme.night.color.warning:"#7A5A00",strokeWidth:2})}),i&&(0,_jsxRuntime.jsx)("button",{type:"button",onClick:()=>U(i),"aria-label":k,"data-testid":"tool-window-mode",style:wcExpandedButton(a,WC_COLORS.toggleMode,_nightTheme.night.color.accentSoft,_nightTheme.night.color.accentBorderStrong),children:(0,_jsxRuntime.jsx)(y,{size:WC_EXPANDED_ICON_SIZE,color:a?_nightTheme.night.color.accent:"#004A1A",strokeWidth:2})}),(0,_jsxRuntime.jsx)("button",{type:"button",onClick:()=>U(n),"aria-label":"Close modal","data-testid":"tool-window-close",style:wcExpandedButton(a,WC_COLORS.close,_nightTheme.night.color.dangerSoft,_nightTheme.night.color.danger+"59"),children:(0,_jsxRuntime.jsx)(XIcon,{size:WC_EXPANDED_ICON_SIZE,color:a?_nightTheme.night.color.danger:"#4A0000",strokeWidth:2})})]})})]})}const DragIndicator=(0,_react.memo)(function n({isResizing:o,mode:i,hasCustomContent:c=false,variant:h="default"}){const a=i==="floating";const p=h==="night";return(0,_jsxRuntime.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",position:"relative",justifyContent:c?"center":void 0,minHeight:c?32:void 0,paddingTop:c?0:8,paddingBottom:c?0:8,backgroundColor:"transparent"},children:[(0,_jsxRuntime.jsx)("div",{style:{width:p?36:o?40:a?50:40,height:p?5:a?5:3,backgroundColor:p?_nightTheme.night.color.placeholder:o?buoy.primary:a?buoy.textMuted:buoy.primary,borderRadius:p?2.5:2,boxShadow:p?"none":`0 0 4px ${buoy.primary}99`}}),o&&i==="bottomSheet"&&(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",display:"flex",flexDirection:"row",gap:2,marginTop:12},children:[0,1,2].map(C=>(0,_jsxRuntime.jsx)("div",{style:{width:12,height:1,backgroundColor:gameUI.success,opacity:.6}},C))})]})});const ModalHintBanner=(0,_react.memo)(function n({onAcknowledge:o}){return(0,_jsxRuntime.jsx)("div",{style:{backgroundColor:`${gameUI.info}15`,borderLeft:`3px solid ${gameUI.info}`,borderRadius:8,margin:"8px 12px 4px",overflow:"hidden",boxShadow:`0 0 8px ${gameUI.info}4D`,flexShrink:0},children:(0,_jsxRuntime.jsxs)("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",padding:12,gap:12},children:[(0,_jsxRuntime.jsxs)("div",{style:{width:32,height:32,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:[(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",width:20,height:20,borderRadius:10,border:`2px solid ${gameUI.info}`,opacity:.6,transform:"scale(0.8)",boxSizing:"border-box"}}),(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",width:20,height:20,borderRadius:10,border:`2px solid ${gameUI.info}`,boxSizing:"border-box"}})]}),(0,_jsxRuntime.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:2},children:[(0,_jsxRuntime.jsx)("span",{style:{fontSize:13,fontWeight:600,color:gameUI.info,letterSpacing:.3},children:"\u{1F4A1} Pro Tip"}),(0,_jsxRuntime.jsx)("span",{style:{fontSize:12,color:gameUI.primaryLight,lineHeight:"16px"},children:"Double-tap the header to transform this into a floating modal"})]}),(0,_jsxRuntime.jsx)("button",{type:"button",onClick:o,style:{backgroundColor:`${gameUI.info}30`,padding:"6px 12px",borderRadius:6,border:`1px solid ${gameUI.info}50`,fontSize:12,fontWeight:600,color:gameUI.info,cursor:"pointer",fontFamily:"inherit",flexShrink:0},children:"Got it!"})]})})});function ModalHeaderContent({header:n,isResizing:o,mode:i,onMinimize:c,variant:h="default"}){if(n?.customContent){let a=n.customContent;if((0,_react.isValidElement)(n.customContent)&&c){a=(0,_react.cloneElement)(n.customContent,{onMinimize:c})}return(0,_jsxRuntime.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",minWidth:0},children:[(0,_jsxRuntime.jsx)(DragIndicator,{isResizing:o,mode:i,hasCustomContent:true,variant:h}),a]})}return(0,_jsxRuntime.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",position:"relative",minWidth:0},children:[(0,_jsxRuntime.jsx)(DragIndicator,{isResizing:o,mode:i,variant:h}),(0,_jsxRuntime.jsxs)("div",{style:{padding:"0 16px",display:"flex",flexDirection:"column",alignItems:"center"},children:[n?.title&&(0,_jsxRuntime.jsx)("span",{style:{fontSize:16,fontWeight:600,color:gameUI.primary},children:n.title}),n?.subtitle&&(0,_jsxRuntime.jsx)("span",{style:{fontSize:12,color:gameUI.secondary,paddingTop:4},children:n.subtitle})]}),(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:(0,_jsxRuntime.jsx)("span",{style:{fontSize:10,color:gameUI.muted,fontStyle:"italic"},children:"Double tap: Toggle \u2022 Triple tap: Close"})})]})}const JsModalComponent=({visible:n,onClose:o,children:i,header:c,styles:h={},minHeight:a=MIN_HEIGHT,maxHeight:p,initialHeight:C=DEFAULT_HEIGHT,animatedHeight:B,benchMotion:W,initialMode:H="bottomSheet",onModeChange:A,persistenceKey:y,enablePersistence:k=true,initialFloatingPosition:S,footer:P,footerHeight:G=0,onBack:U,onMinimize:b,minimizeRequest:Z=0,minimizeTargetPosition:it,initialModalState:g,zIndex:ht,disableScrollWrapper:Tt=false,background:gt=true,variant:J="night"})=>{const[w]=(0,_react.useState)(readSafeAreaInsets);const[pt,xt]=(0,_react.useState)(!k);const[f,st]=(0,_react.useState)(H);const V=(0,_react.useRef)(A);V.current=A;const[z,T]=(0,_react.useState)(false);const[at,Y]=(0,_react.useState)(false);const[It,lt]=(0,_react.useState)(C);const[R,F]=(0,_react.useState)(()=>clampRectToSafeArea({width:screenW(),height:FLOATING_HEIGHT,top:S?.y??(screenH()-FLOATING_HEIGHT)/2,left:S?.x??0},w));const[Mt,Q]=(0,_react.useState)(false);const[Et,mt]=(0,_react.useState)(false);const _t=(0,_index.useHintsDisabled)();const I=(0,_react.useRef)(C);const v=(0,_react.useRef)(R);const x=(0,_react.useRef)({x:R.left,y:R.top});const K=(0,_react.useRef)(null);const ct=(0,_react.useRef)(null);const D=(0,_react.useRef)(null);const M=(0,_react.useRef)([]);const j=(0,_react.useCallback)(()=>{M.current.forEach(t=>t());M.current=[]},[]);(0,_react.useEffect)(()=>{v.current=R},[R]);(0,_react.useEffect)(()=>j,[j]);const bt=p||screenH()-w.top;(0,_react.useEffect)(()=>{if(!k||!y){xt(true);return}let t=true;const e=async()=>{const r=await _modalStorage.ModalStorage.load(y);if(t&&r){if(r.mode){st(r.mode);V.current?.(r.mode)}if(r.panelHeight){lt(r.panelHeight);I.current=r.panelHeight}if(r.dimensions){const s=clampRectToSafeArea(r.dimensions,w,true);F(s);x.current={x:s.left,y:s.top}}}if(t)xt(true)};e();return()=>{t=false}},[y,k]);(0,_react.useEffect)(()=>{if(!k||!y||!pt)return;const t=setTimeout(()=>{_modalStorage.ModalStorage.save(y,{mode:f,panelHeight:I.current,dimensions:R,isVisible:n})},500);return()=>clearTimeout(t)},[f,It,R,n,y,k,pt]);(0,_react.useEffect)(()=>{let t=true;const e=async()=>{try{const r=_devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();const s=await _persistentStorage.persistentStorage.getItem(r);if(t){Q(s!=="true");mt(true)}}catch{if(t){Q(true);mt(true)}}};e();return()=>{t=false}},[]);const $t=(0,_react.useCallback)(async()=>{try{const t=_devToolsStorageKeys.devToolsStorageKeys.modal.hintAcknowledged();await _persistentStorage.persistentStorage.setItem(t,"true");Q(false)}catch{Q(false)}},[]);const dt=(0,_react.useCallback)(()=>{Y(false);T(false);const t=f==="bottomSheet"?"floating":"bottomSheet";st(t);V.current?.(t)},[f]);(0,_react.useEffect)(()=>{Y(false);T(false)},[f]);const E=(0,_react.useCallback)(()=>{if(!b)return;const t={mode:f,panelHeight:I.current,floatingPosition:{x:v.current.left,y:v.current.top},floatingDimensions:{width:v.current.width,height:v.current.height}};if(k&&y)void _modalStorage.ModalStorage.saveMinimized(y,t);const e=it?.x??screenW()-50;const r=it?.y??screenH()-150;j();if(f==="bottomSheet"){const s=K.current;if(!s){b(t);return}const l=screenH();M.current.push(runAnim(300,easeInOut,u=>{s.style.opacity=String(1-u);s.style.transform=`translateY(${u*l}px)`},()=>b(t)))}else{const s=D.current;if(!s){b(t);return}const l={...x.current};M.current.push(runAnim(300,easeInOut,u=>{s.style.opacity=String(1-u);const O=l.x+(e-l.x)*u;const _=l.y+(r-l.y)*u;s.style.transform=`translate(${O}px, ${_}px)`},()=>b(t)))}},[f,b,it,j,k,y]);const yt=(0,_react.useRef)(Z);(0,_react.useEffect)(()=>{if(yt.current===Z)return;yt.current=Z;E()},[Z,E]);(0,_react.useEffect)(()=>{if(!g)return;if(g.mode){st(g.mode);V.current?.(g.mode)}if(g.panelHeight){lt(g.panelHeight);I.current=g.panelHeight}if(g.floatingDimensions&&g.floatingPosition){const t={width:g.floatingDimensions.width,height:g.floatingDimensions.height,top:g.floatingPosition.y,left:g.floatingPosition.x};F(t);x.current={x:g.floatingPosition.x,y:g.floatingPosition.y}}},[g]);(0,_react.useLayoutEffect)(()=>{if(!n)return;j();if(f==="bottomSheet"){const t=K.current;if(!t)return;const e=screenH();t.style.transform=`translateY(${e}px)`;t.style.opacity="0";M.current.push(runAnim(300,easeOutCubic,r=>{t.style.transform=`translateY(${(1-r)*e}px)`}),runAnim(200,easeInOut,r=>{t.style.opacity=String(r)}))}else{const t=D.current;if(!t)return;x.current={x:v.current.left,y:v.current.top};t.style.transform=`translate(${x.current.x}px, ${x.current.y}px)`;t.style.opacity="0";M.current.push(runAnim(200,easeInOut,e=>{t.style.opacity=String(e)}))}},[n,f,j]);const wt=(0,_react.useRef)(0);const L=(0,_react.useRef)(0);const N=(0,_react.useRef)(null);const tt=(0,_react.useCallback)(()=>{const t=Date.now();if(t-wt.current>500){L.current=0}L.current++;wt.current=t;if(N.current)clearTimeout(N.current);N.current=setTimeout(()=>{if(L.current===2){dt()}else if(L.current>=3){if(b)E()}L.current=0},300)},[dt,b,E]);(0,_react.useEffect)(()=>{return()=>{if(N.current)clearTimeout(N.current)}},[]);const et=(0,_react.useRef)({active:false,resizing:false,startY:0,headerOffsetY:0,samples:[]});const Wt=(0,_react.useCallback)(t=>{if(f!=="bottomSheet")return;if(t.button!==0||t.target.closest('button, a, input, textarea, select, [role="button"], [role="tab"], [role="switch"], [contenteditable="true"], [tabindex]'))return;const e=et.current;e.active=true;e.resizing=false;e.startY=t.clientY;const r=t.currentTarget.getBoundingClientRect();e.headerOffsetY=t.clientY-r.top;e.samples=[{t:performance.now(),y:t.clientY}];t.currentTarget.setPointerCapture(t.pointerId)},[f]);const Ht=(0,_react.useCallback)(t=>{const e=et.current;if(!e.active)return;const r=t.clientY-e.startY;if(!e.resizing&&Math.abs(r)>3){e.resizing=true;j();T(true)}if(!e.resizing)return;const s=t.clientY-e.headerOffsetY;let l=screenH()-s;l=Math.max(a,Math.min(l,bt));I.current=l;if(ct.current)ct.current.style.height=`${l}px`;const u=performance.now();e.samples.push({t:u,y:t.clientY});while(e.samples.length>2&&u-e.samples[0].t>100)e.samples.shift()},[a,bt,j]);const Pt=(0,_react.useCallback)(t=>{const e=et.current;if(!e.active)return;e.active=false;if(!e.resizing){tt();return}T(false);const r=I.current;const s=t.clientY-e.startY;const l=e.samples[0];const u=e.samples[e.samples.length-1];const O=u&&l&&u.t>l.t?(u.y-l.y)/(u.t-l.t):0;const _=O>.8&&s>50||s>150&&r<=a;if(_){const m=K.current;j();if(m){const X=screenH();M.current.push(runAnim(200,easeInOut,$=>{m.style.opacity=String(1-$)}),runAnim(300,easeOutCubic,$=>{m.style.transform=`translateY(${$*X}px)`},()=>o()))}else{o()}return}lt(r)},[a,o,tt,j]);const Bt=(0,_react.useCallback)(()=>{const t=et.current;if(!t.active)return;t.active=false;t.resizing=false;T(false)},[]);const nt=(0,_react.useRef)({active:false,dragging:false,startX:0,startY:0,startPos:{x:0,y:0}});const zt=(0,_react.useCallback)(t=>{if(f!=="floating"||z)return;if(t.button!==0||t.target.closest('button, a, input, textarea, select, [role="button"], [role="tab"], [role="switch"], [contenteditable="true"], [tabindex]'))return;const e=nt.current;e.active=true;e.dragging=false;e.startX=t.clientX;e.startY=t.clientY;e.startPos={...x.current};t.currentTarget.setPointerCapture(t.pointerId)},[f,z]);const Yt=(0,_react.useCallback)(t=>{const e=nt.current;if(!e.active)return;const r=t.clientX-e.startX;const s=t.clientY-e.startY;if(!e.dragging&&Math.abs(r)+Math.abs(s)>5){e.dragging=true;Y(true)}if(!e.dragging)return;const l=e.startPos.x+r;const u=e.startPos.y+s;x.current={x:l,y:u};if(D.current){D.current.style.transform=`translate(${l}px, ${u}px)`}},[]);const Ft=(0,_react.useCallback)(()=>{const t=nt.current;if(!t.active)return;t.active=false;if(!t.dragging){tt();return}Y(false);const e=v.current;const r=clampRectToSafeArea({...e,left:x.current.x,top:x.current.y},w);const s=r.left;const l=r.top;x.current={x:s,y:l};if(D.current){D.current.style.transform=`translate(${s}px, ${l}px)`}F(u=>({...u,left:s,top:l}))},[w,tt]);const Lt=(0,_react.useCallback)(()=>{const t=nt.current;if(!t.active)return;t.active=false;t.dragging=false;Y(false)},[]);const ut=(0,_react.useRef)({active:false,corner:"bottomRight",startX:0,startY:0,start:{width:0,height:0,top:0,left:0}});const Nt=(0,_react.useCallback)(t=>e=>{if(f!=="floating")return;e.stopPropagation();const r=ut.current;r.active=true;r.corner=t;r.startX=e.clientX;r.startY=e.clientY;r.start={...v.current};T(true);e.currentTarget.setPointerCapture(e.pointerId)},[f]);const Ot=(0,_react.useCallback)(t=>{const e=ut.current;if(!e.active)return;const r=t.clientX-e.startX;const s=t.clientY-e.startY;if(Math.abs(r)<.5&&Math.abs(s)<.5)return;const l=Math.max(0,w.left);const u=screenH()-Math.max(0,w.bottom);const O=screenW()-Math.max(0,w.right);const _=screenW()*.25;const m=e.start;const X=m.left+m.width;const $=m.top+m.height;let q=m.left;const rt=m.top;let Dt=X;let ft=$;if(e.corner==="bottomLeft"){q=Math.max(l,Math.min(m.left+r,X-_));ft=Math.min(u,Math.max($+s,m.top+FLOATING_MIN_HEIGHT))}else{Dt=Math.min(O,Math.max(X+r,m.left+_));ft=Math.min(u,Math.max($+s,m.top+FLOATING_MIN_HEIGHT))}const Xt=Math.max(_,Dt-q);const qt=Math.max(FLOATING_MIN_HEIGHT,ft-rt);const At={width:Xt,height:qt,left:q,top:rt};v.current=At;x.current={x:q,y:rt};F(At);if(D.current){D.current.style.transform=`translate(${q}px, ${rt}px)`}},[w.left,w.right,w.bottom]);const vt=(0,_react.useCallback)(()=>{const t=ut.current;if(!t.active)return;t.active=false;T(false);F(v.current)},[]);const ot=!n;const Ct=ot?{left:-9999,top:-9999,opacity:0,visibility:"hidden",pointerEvents:"none"}:{};const jt=c?.title||"Dev tool panel";const d=J==="night";const kt=gt&&d?(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":true,children:(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{})}):null;const St=(0,_jsxRuntime.jsxs)("div",{style:{flex:1,minHeight:0,position:"relative",display:"flex",flexDirection:"column",backgroundColor:d?"transparent":buoy.base,borderBottomLeftRadius:16,borderBottomRightRadius:16,overflow:"hidden",...h.content},children:[gt&&!d?(0,_jsxRuntime.jsx)(_ToolBackground.ToolBackground,{}):null,Tt?(0,_jsxRuntime.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",paddingBottom:G},children:i}):(0,_jsxRuntime.jsx)("div",{style:{flex:1,minHeight:0,overflowY:"auto",paddingBottom:G},children:i}),P?(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",left:0,right:0,bottom:0,backgroundColor:buoy.base,borderBottomLeftRadius:16,borderBottomRightRadius:16},children:P}):null]});const Rt=(0,_jsxRuntime.jsx)("div",{style:{position:"absolute",top:4,right:4,zIndex:10},children:(0,_jsxRuntime.jsx)(WindowControls,{onClose:o,onMinimize:b?E:void 0,onToggleMode:dt,mode:f,variant:J})});if(f==="floating"){const t=at||z;return(0,_jsxRuntime.jsxs)("div",{ref:D,role:"dialog","aria-label":jt,"aria-hidden":ot||void 0,style:{fontFamily:_fonts.systemFont,position:"fixed",pointerEvents:"auto",left:0,top:0,width:R.width,height:R.height,transform:`translate(${x.current.x}px, ${x.current.y}px)`,display:"flex",flexDirection:"column",backgroundColor:d?_nightTheme.night.color.bg:buoy.card,borderRadius:d?_nightTheme.night.radius.sheet:6,border:d?`1px solid ${_nightTheme.night.color.accent}55`:t?`2px solid ${buoy.primary}`:`1px solid ${buoy.border}`,boxShadow:d?`0 0 14px ${_nightTheme.night.color.accent}38`:t?`0 0 12px ${buoy.primary}7A`:`0 0 20px ${buoy.primary}4D`,...d?{overflow:"hidden"}:null,boxSizing:"border-box",zIndex:ht??1e3,...h.container,...Ct},children:[kt,(0,_jsxRuntime.jsx)("div",{onPointerDown:zt,onPointerMove:Yt,onPointerUp:Ft,onPointerCancel:Lt,style:{borderTopLeftRadius:d?_nightTheme.night.radius.sheet:6,borderTopRightRadius:d?_nightTheme.night.radius.sheet:6,backgroundColor:d?"transparent":buoy.card,minHeight:56,border:d?"none":`1px solid ${buoy.border}`,boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"center",flexShrink:0,touchAction:"none",userSelect:"none",cursor:at?"grabbing":"grab",position:"relative"},children:(0,_jsxRuntime.jsx)(ModalHeaderContent,{header:c,isResizing:at||z,mode:f,onMinimize:b?E:void 0,variant:J})}),Rt,St,["bottomLeft","bottomRight"].map(e=>(0,_jsxRuntime.jsx)("div",{onPointerDown:Nt(e),onPointerMove:Ot,onPointerUp:vt,onPointerCancel:vt,style:{position:"absolute",width:30,height:30,bottom:4,...e==="bottomLeft"?{left:4}:{right:4},zIndex:1e3,touchAction:"none",cursor:e==="bottomLeft"?"nesw-resize":"nwse-resize"},children:(0,_jsxRuntime.jsx)("div",{style:{width:20,height:20,borderRadius:10,boxSizing:"border-box",backgroundColor:t?`${gameUI.success}1A`:"transparent",border:t?`2px solid ${gameUI.success}`:"none",boxShadow:t?`0 0 8px ${gameUI.success}99`:"none"}})},e))]},"floating")}return(0,_jsxRuntime.jsx)("div",{"aria-hidden":ot||void 0,style:{fontFamily:_fonts.systemFont,position:"fixed",inset:0,zIndex:ht??1e3,pointerEvents:"none",...ot?{...Ct,inset:"auto",width:"100vw",height:"100vh"}:null},children:(0,_jsxRuntime.jsx)("div",{ref:K,style:{position:"absolute",bottom:0,left:0,right:0,pointerEvents:"auto"},children:(0,_jsxRuntime.jsxs)("div",{ref:ct,role:"dialog","aria-label":jt,style:{height:I.current,display:"flex",flexDirection:"column",backgroundColor:d?_nightTheme.night.color.bg:buoy.card,borderTopLeftRadius:d?_nightTheme.night.radius.sheet:6,borderTopRightRadius:d?_nightTheme.night.radius.sheet:6,border:d?`1px solid ${_nightTheme.night.color.accent}55`:`1px solid ${buoy.border}`,boxShadow:d?`0 -4px 10px ${_nightTheme.night.color.accent}38`:`0 -4px 12px ${buoy.primary}33`,...d?{overflow:"hidden"}:null,boxSizing:"border-box",position:"relative",...h.container},children:[kt,(0,_jsxRuntime.jsx)("div",{onPointerDown:Wt,onPointerMove:Ht,onPointerUp:Pt,onPointerCancel:Bt,style:{borderTopLeftRadius:d?_nightTheme.night.radius.sheet:6,borderTopRightRadius:d?_nightTheme.night.radius.sheet:6,backgroundColor:d?"transparent":buoy.card,minHeight:56,border:d?"none":`1px solid ${buoy.border}`,boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"center",flexShrink:0,touchAction:"none",userSelect:"none",cursor:"ns-resize",position:"relative"},children:(0,_jsxRuntime.jsx)(ModalHeaderContent,{header:c,isResizing:z,mode:f,onMinimize:b?E:void 0,variant:J})}),Rt,Et&&Mt&&!_t&&(0,_jsxRuntime.jsx)(ModalHintBanner,{onAcknowledge:$t}),St]})})},"bottomSheet")};const JsModal=exports.JsModal=(0,_react.memo)(n=>{const o=(0,_licenseModule.getUseAccountAccess)();const i=o();if(i.status!=="admitted")return n.visible?(0,_jsxRuntime.jsx)(_AccountSetup.AccountSetup,{}):null;return(0,_jsxRuntime.jsx)(JsModalComponent,{...n})});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={startSettingsSync:true,SettingsSync:true,PERSONAL_SETTING_KEYS:true,TEAM_SETTING_KEYS:true,onSettingsApplied:true,syncSettingsNow:true,guardToolAdapter:true,absoluteFill:true,displayValue:true,parseDisplayValue:true,getSafeAreaInsets:true,persistentStorage:true,setItemChecked:true,getItemChecked:true,storageIsMemoryOnly:true,isUsingPersistentStorage:true,getStorageBackendType:true,safeStringify:true,getValueType:true,isPrimitive:true,isJsonSerializable:true,isValidJson:true,getConstructorName:true,isEmpty:true,getValueSize:true,parseValue:true,formatValue:true,getTypeColor:true,truncateText:true,flattenObject:true,formatPath:true,loadOptionalModule:true,getCachedOptionalModule:true,setRenderCaptureProvider:true,getRenderCaptureProvider:true,registerStateSnapshotProvider:true,getStateSnapshotProviders:true,getStateSnapshotProvider:true,subscribeToStateSnapshotProviders:true,superJsonSerialize:true,superJsonDeserialize:true,realNow:true,getRealAppState:true,subscribeRealAppState:true,BUOY_SYNTHETIC_MARK:true,countBuoyListener:true,reloadApp:true,scheduleReloadApp:true,resolveReloadStrategy:true,REMOTE_RELOAD_DELAY_MS:true,getDevServerOrigin:true,Subscribable:true,subscriberCountNotifier:true,subscribeToSubscriberCountChanges:true,notifySubscriberCountChange:true,useSafeRouter:true,useSafePathname:true,useSafeSegments:true,useSafeGlobalSearchParams:true,getSafeRouter:true,getSafeCurrentPathname:true,getSafeCurrentRoute:true,isExpoRouterAvailable:true,subscribeStorageWrites:true,FiberRootAnchor:true,getAnchoredFiberRoots:true,registerBrowserRouter:true,browserRouter:true,subscribeBrowserNavigation:true,PREVIEW_ITEM_RENDER_BYTE_LIMIT:true,createRestoreScope:true,emptyRestoreResult:true,failedRestore:true,skippedRestore:true,classifyPreviewItem:true,wontApply:true,unionKeys:true,entityColor:true,formatValuePreview:true,shallowDiffSummary:true,isPlainObjectUtil:true,useSafeAreaInsets:true,useFilterManager:true,usePersistedState:true,resetPersistedStateCache:true,useChangeLog:true,useSubscribedValue:true,useEventStoreEvents:true,useDeviceInfo:true,getDeviceInfo:true,logDeviceInfo:true,JsModal:true,night:true,NIGHT_LABEL_TRACKING:true,QrCodeView:true,NightSectionLabel:true,NightFootnote:true,NightCard:true,NightSeparator:true,NightRows:true,NightSwitch:true,NightChip:true,NightButton:true,NightSegmented:true,NightBadge:true,gameUIColors:true,buoyColors:true,refreshGameUIColors:true,dialColors:true,macOSColors:true,EnvironmentIndicator:true,EnvironmentSelector:true,EnvironmentSelectorInline:true,normalizeEnvironment:true,HintsProvider:true,useHintsDisabled:true,useHintsContext:true,FeatureGate:true,UpgradePrompt:true,useFeatureGate:true,ProFeatureBanner:true,UpgradeModal:true,BuoyUpgradeSheet:true,BuoySignInCard:true,BuoyNeedsPlanCard:true,BuoyGetProCard:true,useSignInState:true,ProBadge:true,ProUpgradeModal:true,FreeAccountPrompt:true,LOGIN_COMMAND:true,getUseIsPro:true,getUseLicense:true,getUseTier:true,signOutOfBuoy:true,TIER_LIMITS:true,useLimit:true,resolveEffectiveTier:true,getAccountAccess:true,hasAccountAccess:true,assertAccountAccess:true,subscribeAccountAccess:true,getUseAccountAccess:true,retryAccountAccess:true,isProNow:true,getTeamCredential:true,getSignInSession:true,setBuoyAppId:true,getBuoyAppId:true,AccountSetup:true,AccountSetupButton:true};Object.defineProperty(exports,"AccountSetup",{enumerable:true,get:function(){return _AccountSetup.AccountSetup}});Object.defineProperty(exports,"AccountSetupButton",{enumerable:true,get:function(){return _AccountSetupContent.AccountSetupButton}});Object.defineProperty(exports,"BUOY_SYNTHETIC_MARK",{enumerable:true,get:function(){return _index4.BUOY_SYNTHETIC_MARK}});Object.defineProperty(exports,"BuoyGetProCard",{enumerable:true,get:function(){return _index13.BuoyGetProCard}});Object.defineProperty(exports,"BuoyNeedsPlanCard",{enumerable:true,get:function(){return _index13.BuoyNeedsPlanCard}});Object.defineProperty(exports,"BuoySignInCard",{enumerable:true,get:function(){return _index13.BuoySignInCard}});Object.defineProperty(exports,"BuoyUpgradeSheet",{enumerable:true,get:function(){return _index13.BuoyUpgradeSheet}});Object.defineProperty(exports,"EnvironmentIndicator",{enumerable:true,get:function(){return _EnvironmentIndicator.EnvironmentIndicator}});Object.defineProperty(exports,"EnvironmentSelector",{enumerable:true,get:function(){return _EnvironmentSelector.EnvironmentSelector}});Object.defineProperty(exports,"EnvironmentSelectorInline",{enumerable:true,get:function(){return _EnvironmentSelectorInline.EnvironmentSelectorInline}});Object.defineProperty(exports,"FeatureGate",{enumerable:true,get:function(){return _index13.FeatureGate}});Object.defineProperty(exports,"FiberRootAnchor",{enumerable:true,get:function(){return _fiberRootAnchor.FiberRootAnchor}});Object.defineProperty(exports,"FreeAccountPrompt",{enumerable:true,get:function(){return _index13.FreeAccountPrompt}});Object.defineProperty(exports,"HintsProvider",{enumerable:true,get:function(){return _index11.HintsProvider}});Object.defineProperty(exports,"JsModal",{enumerable:true,get:function(){return _JsModal.JsModal}});Object.defineProperty(exports,"LOGIN_COMMAND",{enumerable:true,get:function(){return _index13.LOGIN_COMMAND}});Object.defineProperty(exports,"NIGHT_LABEL_TRACKING",{enumerable:true,get:function(){return _nightTheme.NIGHT_LABEL_TRACKING}});Object.defineProperty(exports,"NightBadge",{enumerable:true,get:function(){return _primitives.NightBadge}});Object.defineProperty(exports,"NightButton",{enumerable:true,get:function(){return _primitives.NightButton}});Object.defineProperty(exports,"NightCard",{enumerable:true,get:function(){return _primitives.NightCard}});Object.defineProperty(exports,"NightChip",{enumerable:true,get:function(){return _primitives.NightChip}});Object.defineProperty(exports,"NightFootnote",{enumerable:true,get:function(){return _primitives.NightFootnote}});Object.defineProperty(exports,"NightRows",{enumerable:true,get:function(){return _primitives.NightRows}});Object.defineProperty(exports,"NightSectionLabel",{enumerable:true,get:function(){return _primitives.NightSectionLabel}});Object.defineProperty(exports,"NightSegmented",{enumerable:true,get:function(){return _primitives.NightSegmented}});Object.defineProperty(exports,"NightSeparator",{enumerable:true,get:function(){return _primitives.NightSeparator}});Object.defineProperty(exports,"NightSwitch",{enumerable:true,get:function(){return _primitives.NightSwitch}});Object.defineProperty(exports,"PERSONAL_SETTING_KEYS",{enumerable:true,get:function(){return _settingsSync.PERSONAL_SETTING_KEYS}});Object.defineProperty(exports,"PREVIEW_ITEM_RENDER_BYTE_LIMIT",{enumerable:true,get:function(){return _snapshotProviderKit.PREVIEW_ITEM_RENDER_BYTE_LIMIT}});Object.defineProperty(exports,"ProBadge",{enumerable:true,get:function(){return _index13.ProBadge}});Object.defineProperty(exports,"ProFeatureBanner",{enumerable:true,get:function(){return _index13.ProFeatureBanner}});Object.defineProperty(exports,"ProUpgradeModal",{enumerable:true,get:function(){return _index13.ProUpgradeModal}});Object.defineProperty(exports,"QrCodeView",{enumerable:true,get:function(){return _QrCodeView.QrCodeView}});Object.defineProperty(exports,"REMOTE_RELOAD_DELAY_MS",{enumerable:true,get:function(){return _index4.REMOTE_RELOAD_DELAY_MS}});Object.defineProperty(exports,"SettingsSync",{enumerable:true,get:function(){return _settingsSync.SettingsSync}});Object.defineProperty(exports,"Subscribable",{enumerable:true,get:function(){return _index4.Subscribable}});Object.defineProperty(exports,"TEAM_SETTING_KEYS",{enumerable:true,get:function(){return _settingsSync.TEAM_SETTING_KEYS}});Object.defineProperty(exports,"TIER_LIMITS",{enumerable:true,get:function(){return _index13.TIER_LIMITS}});Object.defineProperty(exports,"UpgradeModal",{enumerable:true,get:function(){return _index13.UpgradeModal}});Object.defineProperty(exports,"UpgradePrompt",{enumerable:true,get:function(){return _index13.UpgradePrompt}});Object.defineProperty(exports,"absoluteFill",{enumerable:true,get:function(){return _index4.absoluteFill}});Object.defineProperty(exports,"assertAccountAccess",{enumerable:true,get:function(){return _licenseModule.assertAccountAccess}});Object.defineProperty(exports,"browserRouter",{enumerable:true,get:function(){return _browserNavigation.browserRouter}});Object.defineProperty(exports,"buoyColors",{enumerable:true,get:function(){return _gameUIColors.buoyColors}});Object.defineProperty(exports,"classifyPreviewItem",{enumerable:true,get:function(){return _snapshotProviderKit.classifyPreviewItem}});Object.defineProperty(exports,"countBuoyListener",{enumerable:true,get:function(){return _index4.countBuoyListener}});Object.defineProperty(exports,"createRestoreScope",{enumerable:true,get:function(){return _snapshotProviderKit.createRestoreScope}});Object.defineProperty(exports,"dialColors",{enumerable:true,get:function(){return _gameUIColors.dialColors}});Object.defineProperty(exports,"displayValue",{enumerable:true,get:function(){return _index4.displayValue}});Object.defineProperty(exports,"emptyRestoreResult",{enumerable:true,get:function(){return _snapshotProviderKit.emptyRestoreResult}});Object.defineProperty(exports,"entityColor",{enumerable:true,get:function(){return _stateTools.entityColor}});Object.defineProperty(exports,"failedRestore",{enumerable:true,get:function(){return _snapshotProviderKit.failedRestore}});Object.defineProperty(exports,"flattenObject",{enumerable:true,get:function(){return _index4.flattenObject}});Object.defineProperty(exports,"formatPath",{enumerable:true,get:function(){return _index4.formatPath}});Object.defineProperty(exports,"formatValue",{enumerable:true,get:function(){return _index4.formatValue}});Object.defineProperty(exports,"formatValuePreview",{enumerable:true,get:function(){return _stateTools.formatValuePreview}});Object.defineProperty(exports,"gameUIColors",{enumerable:true,get:function(){return _gameUIColors.gameUIColors}});Object.defineProperty(exports,"getAccountAccess",{enumerable:true,get:function(){return _licenseModule.getAccountAccess}});Object.defineProperty(exports,"getAnchoredFiberRoots",{enumerable:true,get:function(){return _fiberRootAnchor.getAnchoredFiberRoots}});Object.defineProperty(exports,"getBuoyAppId",{enumerable:true,get:function(){return _appIdentity.getBuoyAppId}});Object.defineProperty(exports,"getCachedOptionalModule",{enumerable:true,get:function(){return _index4.getCachedOptionalModule}});Object.defineProperty(exports,"getConstructorName",{enumerable:true,get:function(){return _index4.getConstructorName}});Object.defineProperty(exports,"getDevServerOrigin",{enumerable:true,get:function(){return _index4.getDevServerOrigin}});Object.defineProperty(exports,"getDeviceInfo",{enumerable:true,get:function(){return _index10.getDeviceInfo}});Object.defineProperty(exports,"getItemChecked",{enumerable:true,get:function(){return _index4.getItemChecked}});Object.defineProperty(exports,"getRealAppState",{enumerable:true,get:function(){return _index4.getRealAppState}});Object.defineProperty(exports,"getRenderCaptureProvider",{enumerable:true,get:function(){return _index4.getRenderCaptureProvider}});Object.defineProperty(exports,"getSafeAreaInsets",{enumerable:true,get:function(){return _index4.getSafeAreaInsets}});Object.defineProperty(exports,"getSafeCurrentPathname",{enumerable:true,get:function(){return _index4.getSafeCurrentPathname}});Object.defineProperty(exports,"getSafeCurrentRoute",{enumerable:true,get:function(){return _index4.getSafeCurrentRoute}});Object.defineProperty(exports,"getSafeRouter",{enumerable:true,get:function(){return _index4.getSafeRouter}});Object.defineProperty(exports,"getSignInSession",{enumerable:true,get:function(){return _licenseModule.getSignInSession}});Object.defineProperty(exports,"getStateSnapshotProvider",{enumerable:true,get:function(){return _index4.getStateSnapshotProvider}});Object.defineProperty(exports,"getStateSnapshotProviders",{enumerable:true,get:function(){return _index4.getStateSnapshotProviders}});Object.defineProperty(exports,"getStorageBackendType",{enumerable:true,get:function(){return _index4.getStorageBackendType}});Object.defineProperty(exports,"getTeamCredential",{enumerable:true,get:function(){return _licenseModule.getTeamCredential}});Object.defineProperty(exports,"getTypeColor",{enumerable:true,get:function(){return _index4.getTypeColor}});Object.defineProperty(exports,"getUseAccountAccess",{enumerable:true,get:function(){return _licenseModule.getUseAccountAccess}});Object.defineProperty(exports,"getUseIsPro",{enumerable:true,get:function(){return _index13.getUseIsPro}});Object.defineProperty(exports,"getUseLicense",{enumerable:true,get:function(){return _index13.getUseLicense}});Object.defineProperty(exports,"getUseTier",{enumerable:true,get:function(){return _index13.getUseTier}});Object.defineProperty(exports,"getValueSize",{enumerable:true,get:function(){return _index4.getValueSize}});Object.defineProperty(exports,"getValueType",{enumerable:true,get:function(){return _index4.getValueType}});Object.defineProperty(exports,"guardToolAdapter",{enumerable:true,get:function(){return _toolActionRegistry.guardToolAdapter}});Object.defineProperty(exports,"hasAccountAccess",{enumerable:true,get:function(){return _licenseModule.hasAccountAccess}});Object.defineProperty(exports,"isEmpty",{enumerable:true,get:function(){return _index4.isEmpty}});Object.defineProperty(exports,"isExpoRouterAvailable",{enumerable:true,get:function(){return _index4.isExpoRouterAvailable}});Object.defineProperty(exports,"isJsonSerializable",{enumerable:true,get:function(){return _index4.isJsonSerializable}});Object.defineProperty(exports,"isPlainObjectUtil",{enumerable:true,get:function(){return _typeHelpers.isPlainObject}});Object.defineProperty(exports,"isPrimitive",{enumerable:true,get:function(){return _index4.isPrimitive}});Object.defineProperty(exports,"isProNow",{enumerable:true,get:function(){return _licenseModule.isProNow}});Object.defineProperty(exports,"isUsingPersistentStorage",{enumerable:true,get:function(){return _index4.isUsingPersistentStorage}});Object.defineProperty(exports,"isValidJson",{enumerable:true,get:function(){return _index4.isValidJson}});Object.defineProperty(exports,"loadOptionalModule",{enumerable:true,get:function(){return _index4.loadOptionalModule}});Object.defineProperty(exports,"logDeviceInfo",{enumerable:true,get:function(){return _index10.logDeviceInfo}});Object.defineProperty(exports,"macOSColors",{enumerable:true,get:function(){return _macOSDesignSystemColors.macOSColors}});Object.defineProperty(exports,"night",{enumerable:true,get:function(){return _nightTheme.night}});Object.defineProperty(exports,"normalizeEnvironment",{enumerable:true,get:function(){return _types.normalizeEnvironment}});Object.defineProperty(exports,"notifySubscriberCountChange",{enumerable:true,get:function(){return _index4.notifySubscriberCountChange}});Object.defineProperty(exports,"onSettingsApplied",{enumerable:true,get:function(){return _settingsSync.onSettingsApplied}});Object.defineProperty(exports,"parseDisplayValue",{enumerable:true,get:function(){return _index4.parseDisplayValue}});Object.defineProperty(exports,"parseValue",{enumerable:true,get:function(){return _index4.parseValue}});Object.defineProperty(exports,"persistentStorage",{enumerable:true,get:function(){return _index4.persistentStorage}});Object.defineProperty(exports,"realNow",{enumerable:true,get:function(){return _index4.realNow}});Object.defineProperty(exports,"refreshGameUIColors",{enumerable:true,get:function(){return _gameUIColors.refreshGameUIColors}});Object.defineProperty(exports,"registerBrowserRouter",{enumerable:true,get:function(){return _browserNavigation.registerBrowserRouter}});Object.defineProperty(exports,"registerStateSnapshotProvider",{enumerable:true,get:function(){return _index4.registerStateSnapshotProvider}});Object.defineProperty(exports,"reloadApp",{enumerable:true,get:function(){return _index4.reloadApp}});Object.defineProperty(exports,"resetPersistedStateCache",{enumerable:true,get:function(){return _index10.resetPersistedStateCache}});Object.defineProperty(exports,"resolveEffectiveTier",{enumerable:true,get:function(){return _index13.resolveEffectiveTier}});Object.defineProperty(exports,"resolveReloadStrategy",{enumerable:true,get:function(){return _index4.resolveReloadStrategy}});Object.defineProperty(exports,"retryAccountAccess",{enumerable:true,get:function(){return _licenseModule.retryAccountAccess}});Object.defineProperty(exports,"safeStringify",{enumerable:true,get:function(){return _index4.safeStringify}});Object.defineProperty(exports,"scheduleReloadApp",{enumerable:true,get:function(){return _index4.scheduleReloadApp}});Object.defineProperty(exports,"setBuoyAppId",{enumerable:true,get:function(){return _appIdentity.setBuoyAppId}});Object.defineProperty(exports,"setItemChecked",{enumerable:true,get:function(){return _index4.setItemChecked}});Object.defineProperty(exports,"setRenderCaptureProvider",{enumerable:true,get:function(){return _index4.setRenderCaptureProvider}});Object.defineProperty(exports,"shallowDiffSummary",{enumerable:true,get:function(){return _stateTools.shallowDiffSummary}});Object.defineProperty(exports,"signOutOfBuoy",{enumerable:true,get:function(){return _index13.signOutOfBuoy}});Object.defineProperty(exports,"skippedRestore",{enumerable:true,get:function(){return _snapshotProviderKit.skippedRestore}});Object.defineProperty(exports,"startSettingsSync",{enumerable:true,get:function(){return _settingsSync.startSettingsSync}});Object.defineProperty(exports,"storageIsMemoryOnly",{enumerable:true,get:function(){return _index4.storageIsMemoryOnly}});Object.defineProperty(exports,"subscribeAccountAccess",{enumerable:true,get:function(){return _licenseModule.subscribeAccountAccess}});Object.defineProperty(exports,"subscribeBrowserNavigation",{enumerable:true,get:function(){return _browserNavigation.subscribeBrowserNavigation}});Object.defineProperty(exports,"subscribeRealAppState",{enumerable:true,get:function(){return _index4.subscribeRealAppState}});Object.defineProperty(exports,"subscribeStorageWrites",{enumerable:true,get:function(){return _storageWrites.subscribeStorageWrites}});Object.defineProperty(exports,"subscribeToStateSnapshotProviders",{enumerable:true,get:function(){return _index4.subscribeToStateSnapshotProviders}});Object.defineProperty(exports,"subscribeToSubscriberCountChanges",{enumerable:true,get:function(){return _index4.subscribeToSubscriberCountChanges}});Object.defineProperty(exports,"subscriberCountNotifier",{enumerable:true,get:function(){return _index4.subscriberCountNotifier}});Object.defineProperty(exports,"superJsonDeserialize",{enumerable:true,get:function(){return _index4.superJsonDeserialize}});Object.defineProperty(exports,"superJsonSerialize",{enumerable:true,get:function(){return _index4.superJsonSerialize}});Object.defineProperty(exports,"syncSettingsNow",{enumerable:true,get:function(){return _settingsSync.syncSettingsNow}});Object.defineProperty(exports,"truncateText",{enumerable:true,get:function(){return _index4.truncateText}});Object.defineProperty(exports,"unionKeys",{enumerable:true,get:function(){return _snapshotProviderKit.unionKeys}});Object.defineProperty(exports,"useChangeLog",{enumerable:true,get:function(){return _index10.useChangeLog}});Object.defineProperty(exports,"useDeviceInfo",{enumerable:true,get:function(){return _index10.useDeviceInfo}});Object.defineProperty(exports,"useEventStoreEvents",{enumerable:true,get:function(){return _index10.useEventStoreEvents}});Object.defineProperty(exports,"useFeatureGate",{enumerable:true,get:function(){return _index13.useFeatureGate}});Object.defineProperty(exports,"useFilterManager",{enumerable:true,get:function(){return _index10.useFilterManager}});Object.defineProperty(exports,"useHintsContext",{enumerable:true,get:function(){return _index11.useHintsContext}});Object.defineProperty(exports,"useHintsDisabled",{enumerable:true,get:function(){return _index11.useHintsDisabled}});Object.defineProperty(exports,"useLimit",{enumerable:true,get:function(){return _index13.useLimit}});Object.defineProperty(exports,"usePersistedState",{enumerable:true,get:function(){return _index10.usePersistedState}});Object.defineProperty(exports,"useSafeAreaInsets",{enumerable:true,get:function(){return _index10.useSafeAreaInsets}});Object.defineProperty(exports,"useSafeGlobalSearchParams",{enumerable:true,get:function(){return _index4.useSafeGlobalSearchParams}});Object.defineProperty(exports,"useSafePathname",{enumerable:true,get:function(){return _index4.useSafePathname}});Object.defineProperty(exports,"useSafeRouter",{enumerable:true,get:function(){return _index4.useSafeRouter}});Object.defineProperty(exports,"useSafeSegments",{enumerable:true,get:function(){return _index4.useSafeSegments}});Object.defineProperty(exports,"useSignInState",{enumerable:true,get:function(){return _index13.useSignInState}});Object.defineProperty(exports,"useSubscribedValue",{enumerable:true,get:function(){return _index10.useSubscribedValue}});Object.defineProperty(exports,"wontApply",{enumerable:true,get:function(){return _snapshotProviderKit.wontApply}});var _index=require("./ui/index.js");Object.keys(_index).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index[e]}})});var _index2=require("./stores/index.js");Object.keys(_index2).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index2[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index2[e]}})});var _index3=require("./bugCase/index.js");Object.keys(_index3).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index3[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index3[e]}})});var _keyedArrays=require("./sync/keyedArrays.js");Object.keys(_keyedArrays).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_keyedArrays[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _keyedArrays[e]}})});var _valueShape=require("./sync/valueShape.js");Object.keys(_valueShape).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_valueShape[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _valueShape[e]}})});var _valuePath=require("./sync/valuePath.js");Object.keys(_valuePath).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_valuePath[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _valuePath[e]}})});var _typedEdit=require("./sync/typedEdit.js");Object.keys(_typedEdit).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_typedEdit[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _typedEdit[e]}})});var _wireBudget=require("./sync/wireBudget.js");Object.keys(_wireBudget).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_wireBudget[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _wireBudget[e]}})});var _wireForm=require("./sync/wireForm.js");Object.keys(_wireForm).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_wireForm[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _wireForm[e]}})});var _toolSyncAdapter=require("./sync/toolSyncAdapter.js");Object.keys(_toolSyncAdapter).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_toolSyncAdapter[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _toolSyncAdapter[e]}})});var _settingsSync=require("./sync/settingsSync.js");var _defineTool=require("./tools/defineTool.js");Object.keys(_defineTool).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_defineTool[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _defineTool[e]}})});var _toolActionRegistry=require("./sync/toolActionRegistry.js");Object.keys(_toolActionRegistry).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_toolActionRegistry[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _toolActionRegistry[e]}})});var _toolUiBridge=require("./sync/toolUiBridge.js");Object.keys(_toolUiBridge).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_toolUiBridge[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _toolUiBridge[e]}})});var _toolScreenHeader=require("./sync/toolScreenHeader.js");Object.keys(_toolScreenHeader).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_toolScreenHeader[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _toolScreenHeader[e]}})});var _index4=require("./utils/index.js");var _toolModules=require("./utils/toolModules.js");Object.keys(_toolModules).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_toolModules[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _toolModules[e]}})});var _storageWrites=require("./utils/storageWrites.js");var _fiberRootAnchor=require("./utils/fiberRootAnchor.js");var _browserNavigation=require("./utils/browserNavigation.js");var _snapshotProviderKit=require("./utils/snapshotProviderKit.js");var _stateTools=require("./utils/stateTools.js");var _index5=require("./utils/formatting/index.js");Object.keys(_index5).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index5[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index5[e]}})});var _index6=require("./utils/time/index.js");Object.keys(_index6).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index6[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index6[e]}})});var _typeHelpers=require("./utils/typeHelpers.js");var _index7=require("./icons/index.js");Object.keys(_index7).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index7[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index7[e]}})});var _index8=require("./clipboard/index.js");Object.keys(_index8).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index8[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index8[e]}})});var _index9=require("./logger/index.js");Object.keys(_index9).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index9[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index9[e]}})});var _index0=require("./settings/index.js");Object.keys(_index0).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index0[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index0[e]}})});var _index1=require("./storage/index.js");Object.keys(_index1).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index1[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index1[e]}})});var _index10=require("./hooks/index.js");var _JsModal=require("./JsModal");var _nightTheme=require("./ui/night/nightTheme.js");var _QrCodeView=require("./ui/qr/QrCodeView.js");var _primitives=require("./ui/night/primitives.js");var _gameUIColors=require("./ui/gameUI/constants/gameUIColors.js");var _macOSDesignSystemColors=require("./ui/gameUI/constants/macOSDesignSystemColors.js");var _EnvironmentIndicator=require("./env/EnvironmentIndicator");var _EnvironmentSelector=require("./env/EnvironmentSelector.js");var _EnvironmentSelectorInline=require("./env/EnvironmentSelectorInline");var _types=require("./types/types.js");var _index11=require("./context/index.js");var _index12=require("./history/index.js");Object.keys(_index12).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index12[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index12[e]}})});var _index13=require("./license/index.js");var _licenseModule=require("./license/licenseModule.js");var _appIdentity=require("./utils/appIdentity.js");var _AccountSetup=require("./license/AccountSetup");var _AccountSetupContent=require("./license/AccountSetupContent.js");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={startSettingsSync:true,SettingsSync:true,PERSONAL_SETTING_KEYS:true,TEAM_SETTING_KEYS:true,onSettingsApplied:true,syncSettingsNow:true,guardToolAdapter:true,absoluteFill:true,displayValue:true,parseDisplayValue:true,getSafeAreaInsets:true,persistentStorage:true,setItemChecked:true,getItemChecked:true,storageIsMemoryOnly:true,isUsingPersistentStorage:true,getStorageBackendType:true,safeStringify:true,getValueType:true,isPrimitive:true,isJsonSerializable:true,isValidJson:true,getConstructorName:true,isEmpty:true,getValueSize:true,parseValue:true,formatValue:true,getTypeColor:true,truncateText:true,flattenObject:true,formatPath:true,loadOptionalModule:true,getCachedOptionalModule:true,setRenderCaptureProvider:true,getRenderCaptureProvider:true,registerStateSnapshotProvider:true,getStateSnapshotProviders:true,getStateSnapshotProvider:true,subscribeToStateSnapshotProviders:true,superJsonSerialize:true,superJsonDeserialize:true,realNow:true,getRealAppState:true,subscribeRealAppState:true,BUOY_SYNTHETIC_MARK:true,countBuoyListener:true,reloadApp:true,scheduleReloadApp:true,resolveReloadStrategy:true,REMOTE_RELOAD_DELAY_MS:true,getDevServerOrigin:true,Subscribable:true,subscriberCountNotifier:true,subscribeToSubscriberCountChanges:true,notifySubscriberCountChange:true,useSafeRouter:true,useSafePathname:true,useSafeSegments:true,useSafeGlobalSearchParams:true,getSafeRouter:true,getSafeCurrentPathname:true,getSafeCurrentRoute:true,isExpoRouterAvailable:true,subscribeStorageWrites:true,FiberRootAnchor:true,getAnchoredFiberRoots:true,registerBrowserRouter:true,browserRouter:true,subscribeBrowserNavigation:true,PREVIEW_ITEM_RENDER_BYTE_LIMIT:true,createRestoreScope:true,emptyRestoreResult:true,failedRestore:true,skippedRestore:true,classifyPreviewItem:true,wontApply:true,unionKeys:true,entityColor:true,formatValuePreview:true,shallowDiffSummary:true,isPlainObjectUtil:true,useSafeAreaInsets:true,useFilterManager:true,usePersistedState:true,resetPersistedStateCache:true,useChangeLog:true,useSubscribedValue:true,useEventStoreEvents:true,useDeviceInfo:true,getDeviceInfo:true,logDeviceInfo:true,JsModal:true,night:true,NIGHT_LABEL_TRACKING:true,QrCodeView:true,NightSectionLabel:true,NightFootnote:true,NightCard:true,NightSeparator:true,NightRows:true,NightSwitch:true,NightChip:true,NightButton:true,NightSegmented:true,NightBadge:true,gameUIColors:true,buoyColors:true,refreshGameUIColors:true,dialColors:true,macOSColors:true,EnvironmentIndicator:true,EnvironmentSelector:true,EnvironmentSelectorInline:true,normalizeEnvironment:true,HintsProvider:true,useHintsDisabled:true,useHintsContext:true,FeatureGate:true,UpgradePrompt:true,useFeatureGate:true,ProFeatureBanner:true,UpgradeModal:true,BuoyUpgradeSheet:true,BuoySignInCard:true,BuoyNeedsPlanCard:true,BuoyGetProCard:true,useSignInState:true,ProBadge:true,ProUpgradeModal:true,FreeAccountPrompt:true,LOGIN_COMMAND:true,getUseIsPro:true,getUseLicense:true,getUseTier:true,signOutOfBuoy:true,restoreSignedOutKey:true,TIER_LIMITS:true,useLimit:true,resolveEffectiveTier:true,getAccountAccess:true,hasAccountAccess:true,assertAccountAccess:true,isLicensedNow:true,subscribeAccountAccess:true,getUseAccountAccess:true,retryAccountAccess:true,isProNow:true,getTeamCredential:true,getSignInSession:true,bootBeforeActions:true,canSimulateInThisBuild:true,canSimulateNow:true,isReleaseBuild:true,isWebRelease:true,markSimulationSurface:true,SIMULATION_RELEASE_HELP:true,simulationSurfacePending:true,subscribeSimulationSurface:true,setBuoyAppId:true,getBuoyAppId:true,AccountSetup:true,AccountSetupButton:true};Object.defineProperty(exports,"AccountSetup",{enumerable:true,get:function(){return _AccountSetup.AccountSetup}});Object.defineProperty(exports,"AccountSetupButton",{enumerable:true,get:function(){return _AccountSetupContent.AccountSetupButton}});Object.defineProperty(exports,"BUOY_SYNTHETIC_MARK",{enumerable:true,get:function(){return _index4.BUOY_SYNTHETIC_MARK}});Object.defineProperty(exports,"BuoyGetProCard",{enumerable:true,get:function(){return _index13.BuoyGetProCard}});Object.defineProperty(exports,"BuoyNeedsPlanCard",{enumerable:true,get:function(){return _index13.BuoyNeedsPlanCard}});Object.defineProperty(exports,"BuoySignInCard",{enumerable:true,get:function(){return _index13.BuoySignInCard}});Object.defineProperty(exports,"BuoyUpgradeSheet",{enumerable:true,get:function(){return _index13.BuoyUpgradeSheet}});Object.defineProperty(exports,"EnvironmentIndicator",{enumerable:true,get:function(){return _EnvironmentIndicator.EnvironmentIndicator}});Object.defineProperty(exports,"EnvironmentSelector",{enumerable:true,get:function(){return _EnvironmentSelector.EnvironmentSelector}});Object.defineProperty(exports,"EnvironmentSelectorInline",{enumerable:true,get:function(){return _EnvironmentSelectorInline.EnvironmentSelectorInline}});Object.defineProperty(exports,"FeatureGate",{enumerable:true,get:function(){return _index13.FeatureGate}});Object.defineProperty(exports,"FiberRootAnchor",{enumerable:true,get:function(){return _fiberRootAnchor.FiberRootAnchor}});Object.defineProperty(exports,"FreeAccountPrompt",{enumerable:true,get:function(){return _index13.FreeAccountPrompt}});Object.defineProperty(exports,"HintsProvider",{enumerable:true,get:function(){return _index11.HintsProvider}});Object.defineProperty(exports,"JsModal",{enumerable:true,get:function(){return _JsModal.JsModal}});Object.defineProperty(exports,"LOGIN_COMMAND",{enumerable:true,get:function(){return _index13.LOGIN_COMMAND}});Object.defineProperty(exports,"NIGHT_LABEL_TRACKING",{enumerable:true,get:function(){return _nightTheme.NIGHT_LABEL_TRACKING}});Object.defineProperty(exports,"NightBadge",{enumerable:true,get:function(){return _primitives.NightBadge}});Object.defineProperty(exports,"NightButton",{enumerable:true,get:function(){return _primitives.NightButton}});Object.defineProperty(exports,"NightCard",{enumerable:true,get:function(){return _primitives.NightCard}});Object.defineProperty(exports,"NightChip",{enumerable:true,get:function(){return _primitives.NightChip}});Object.defineProperty(exports,"NightFootnote",{enumerable:true,get:function(){return _primitives.NightFootnote}});Object.defineProperty(exports,"NightRows",{enumerable:true,get:function(){return _primitives.NightRows}});Object.defineProperty(exports,"NightSectionLabel",{enumerable:true,get:function(){return _primitives.NightSectionLabel}});Object.defineProperty(exports,"NightSegmented",{enumerable:true,get:function(){return _primitives.NightSegmented}});Object.defineProperty(exports,"NightSeparator",{enumerable:true,get:function(){return _primitives.NightSeparator}});Object.defineProperty(exports,"NightSwitch",{enumerable:true,get:function(){return _primitives.NightSwitch}});Object.defineProperty(exports,"PERSONAL_SETTING_KEYS",{enumerable:true,get:function(){return _settingsSync.PERSONAL_SETTING_KEYS}});Object.defineProperty(exports,"PREVIEW_ITEM_RENDER_BYTE_LIMIT",{enumerable:true,get:function(){return _snapshotProviderKit.PREVIEW_ITEM_RENDER_BYTE_LIMIT}});Object.defineProperty(exports,"ProBadge",{enumerable:true,get:function(){return _index13.ProBadge}});Object.defineProperty(exports,"ProFeatureBanner",{enumerable:true,get:function(){return _index13.ProFeatureBanner}});Object.defineProperty(exports,"ProUpgradeModal",{enumerable:true,get:function(){return _index13.ProUpgradeModal}});Object.defineProperty(exports,"QrCodeView",{enumerable:true,get:function(){return _QrCodeView.QrCodeView}});Object.defineProperty(exports,"REMOTE_RELOAD_DELAY_MS",{enumerable:true,get:function(){return _index4.REMOTE_RELOAD_DELAY_MS}});Object.defineProperty(exports,"SIMULATION_RELEASE_HELP",{enumerable:true,get:function(){return _releaseSimulation.SIMULATION_RELEASE_HELP}});Object.defineProperty(exports,"SettingsSync",{enumerable:true,get:function(){return _settingsSync.SettingsSync}});Object.defineProperty(exports,"Subscribable",{enumerable:true,get:function(){return _index4.Subscribable}});Object.defineProperty(exports,"TEAM_SETTING_KEYS",{enumerable:true,get:function(){return _settingsSync.TEAM_SETTING_KEYS}});Object.defineProperty(exports,"TIER_LIMITS",{enumerable:true,get:function(){return _index13.TIER_LIMITS}});Object.defineProperty(exports,"UpgradeModal",{enumerable:true,get:function(){return _index13.UpgradeModal}});Object.defineProperty(exports,"UpgradePrompt",{enumerable:true,get:function(){return _index13.UpgradePrompt}});Object.defineProperty(exports,"absoluteFill",{enumerable:true,get:function(){return _index4.absoluteFill}});Object.defineProperty(exports,"assertAccountAccess",{enumerable:true,get:function(){return _licenseModule.assertAccountAccess}});Object.defineProperty(exports,"bootBeforeActions",{enumerable:true,get:function(){return _releaseSimulation.bootBeforeActions}});Object.defineProperty(exports,"browserRouter",{enumerable:true,get:function(){return _browserNavigation.browserRouter}});Object.defineProperty(exports,"buoyColors",{enumerable:true,get:function(){return _gameUIColors.buoyColors}});Object.defineProperty(exports,"canSimulateInThisBuild",{enumerable:true,get:function(){return _releaseSimulation.canSimulateInThisBuild}});Object.defineProperty(exports,"canSimulateNow",{enumerable:true,get:function(){return _releaseSimulation.canSimulateNow}});Object.defineProperty(exports,"classifyPreviewItem",{enumerable:true,get:function(){return _snapshotProviderKit.classifyPreviewItem}});Object.defineProperty(exports,"countBuoyListener",{enumerable:true,get:function(){return _index4.countBuoyListener}});Object.defineProperty(exports,"createRestoreScope",{enumerable:true,get:function(){return _snapshotProviderKit.createRestoreScope}});Object.defineProperty(exports,"dialColors",{enumerable:true,get:function(){return _gameUIColors.dialColors}});Object.defineProperty(exports,"displayValue",{enumerable:true,get:function(){return _index4.displayValue}});Object.defineProperty(exports,"emptyRestoreResult",{enumerable:true,get:function(){return _snapshotProviderKit.emptyRestoreResult}});Object.defineProperty(exports,"entityColor",{enumerable:true,get:function(){return _stateTools.entityColor}});Object.defineProperty(exports,"failedRestore",{enumerable:true,get:function(){return _snapshotProviderKit.failedRestore}});Object.defineProperty(exports,"flattenObject",{enumerable:true,get:function(){return _index4.flattenObject}});Object.defineProperty(exports,"formatPath",{enumerable:true,get:function(){return _index4.formatPath}});Object.defineProperty(exports,"formatValue",{enumerable:true,get:function(){return _index4.formatValue}});Object.defineProperty(exports,"formatValuePreview",{enumerable:true,get:function(){return _stateTools.formatValuePreview}});Object.defineProperty(exports,"gameUIColors",{enumerable:true,get:function(){return _gameUIColors.gameUIColors}});Object.defineProperty(exports,"getAccountAccess",{enumerable:true,get:function(){return _licenseModule.getAccountAccess}});Object.defineProperty(exports,"getAnchoredFiberRoots",{enumerable:true,get:function(){return _fiberRootAnchor.getAnchoredFiberRoots}});Object.defineProperty(exports,"getBuoyAppId",{enumerable:true,get:function(){return _appIdentity.getBuoyAppId}});Object.defineProperty(exports,"getCachedOptionalModule",{enumerable:true,get:function(){return _index4.getCachedOptionalModule}});Object.defineProperty(exports,"getConstructorName",{enumerable:true,get:function(){return _index4.getConstructorName}});Object.defineProperty(exports,"getDevServerOrigin",{enumerable:true,get:function(){return _index4.getDevServerOrigin}});Object.defineProperty(exports,"getDeviceInfo",{enumerable:true,get:function(){return _index10.getDeviceInfo}});Object.defineProperty(exports,"getItemChecked",{enumerable:true,get:function(){return _index4.getItemChecked}});Object.defineProperty(exports,"getRealAppState",{enumerable:true,get:function(){return _index4.getRealAppState}});Object.defineProperty(exports,"getRenderCaptureProvider",{enumerable:true,get:function(){return _index4.getRenderCaptureProvider}});Object.defineProperty(exports,"getSafeAreaInsets",{enumerable:true,get:function(){return _index4.getSafeAreaInsets}});Object.defineProperty(exports,"getSafeCurrentPathname",{enumerable:true,get:function(){return _index4.getSafeCurrentPathname}});Object.defineProperty(exports,"getSafeCurrentRoute",{enumerable:true,get:function(){return _index4.getSafeCurrentRoute}});Object.defineProperty(exports,"getSafeRouter",{enumerable:true,get:function(){return _index4.getSafeRouter}});Object.defineProperty(exports,"getSignInSession",{enumerable:true,get:function(){return _licenseModule.getSignInSession}});Object.defineProperty(exports,"getStateSnapshotProvider",{enumerable:true,get:function(){return _index4.getStateSnapshotProvider}});Object.defineProperty(exports,"getStateSnapshotProviders",{enumerable:true,get:function(){return _index4.getStateSnapshotProviders}});Object.defineProperty(exports,"getStorageBackendType",{enumerable:true,get:function(){return _index4.getStorageBackendType}});Object.defineProperty(exports,"getTeamCredential",{enumerable:true,get:function(){return _licenseModule.getTeamCredential}});Object.defineProperty(exports,"getTypeColor",{enumerable:true,get:function(){return _index4.getTypeColor}});Object.defineProperty(exports,"getUseAccountAccess",{enumerable:true,get:function(){return _licenseModule.getUseAccountAccess}});Object.defineProperty(exports,"getUseIsPro",{enumerable:true,get:function(){return _index13.getUseIsPro}});Object.defineProperty(exports,"getUseLicense",{enumerable:true,get:function(){return _index13.getUseLicense}});Object.defineProperty(exports,"getUseTier",{enumerable:true,get:function(){return _index13.getUseTier}});Object.defineProperty(exports,"getValueSize",{enumerable:true,get:function(){return _index4.getValueSize}});Object.defineProperty(exports,"getValueType",{enumerable:true,get:function(){return _index4.getValueType}});Object.defineProperty(exports,"guardToolAdapter",{enumerable:true,get:function(){return _toolActionRegistry.guardToolAdapter}});Object.defineProperty(exports,"hasAccountAccess",{enumerable:true,get:function(){return _licenseModule.hasAccountAccess}});Object.defineProperty(exports,"isEmpty",{enumerable:true,get:function(){return _index4.isEmpty}});Object.defineProperty(exports,"isExpoRouterAvailable",{enumerable:true,get:function(){return _index4.isExpoRouterAvailable}});Object.defineProperty(exports,"isJsonSerializable",{enumerable:true,get:function(){return _index4.isJsonSerializable}});Object.defineProperty(exports,"isLicensedNow",{enumerable:true,get:function(){return _licenseModule.isLicensedNow}});Object.defineProperty(exports,"isPlainObjectUtil",{enumerable:true,get:function(){return _typeHelpers.isPlainObject}});Object.defineProperty(exports,"isPrimitive",{enumerable:true,get:function(){return _index4.isPrimitive}});Object.defineProperty(exports,"isProNow",{enumerable:true,get:function(){return _licenseModule.isProNow}});Object.defineProperty(exports,"isReleaseBuild",{enumerable:true,get:function(){return _releaseSimulation.isReleaseBuild}});Object.defineProperty(exports,"isUsingPersistentStorage",{enumerable:true,get:function(){return _index4.isUsingPersistentStorage}});Object.defineProperty(exports,"isValidJson",{enumerable:true,get:function(){return _index4.isValidJson}});Object.defineProperty(exports,"isWebRelease",{enumerable:true,get:function(){return _releaseSimulation.isWebRelease}});Object.defineProperty(exports,"loadOptionalModule",{enumerable:true,get:function(){return _index4.loadOptionalModule}});Object.defineProperty(exports,"logDeviceInfo",{enumerable:true,get:function(){return _index10.logDeviceInfo}});Object.defineProperty(exports,"macOSColors",{enumerable:true,get:function(){return _macOSDesignSystemColors.macOSColors}});Object.defineProperty(exports,"markSimulationSurface",{enumerable:true,get:function(){return _releaseSimulation.markSimulationSurface}});Object.defineProperty(exports,"night",{enumerable:true,get:function(){return _nightTheme.night}});Object.defineProperty(exports,"normalizeEnvironment",{enumerable:true,get:function(){return _types.normalizeEnvironment}});Object.defineProperty(exports,"notifySubscriberCountChange",{enumerable:true,get:function(){return _index4.notifySubscriberCountChange}});Object.defineProperty(exports,"onSettingsApplied",{enumerable:true,get:function(){return _settingsSync.onSettingsApplied}});Object.defineProperty(exports,"parseDisplayValue",{enumerable:true,get:function(){return _index4.parseDisplayValue}});Object.defineProperty(exports,"parseValue",{enumerable:true,get:function(){return _index4.parseValue}});Object.defineProperty(exports,"persistentStorage",{enumerable:true,get:function(){return _index4.persistentStorage}});Object.defineProperty(exports,"realNow",{enumerable:true,get:function(){return _index4.realNow}});Object.defineProperty(exports,"refreshGameUIColors",{enumerable:true,get:function(){return _gameUIColors.refreshGameUIColors}});Object.defineProperty(exports,"registerBrowserRouter",{enumerable:true,get:function(){return _browserNavigation.registerBrowserRouter}});Object.defineProperty(exports,"registerStateSnapshotProvider",{enumerable:true,get:function(){return _index4.registerStateSnapshotProvider}});Object.defineProperty(exports,"reloadApp",{enumerable:true,get:function(){return _index4.reloadApp}});Object.defineProperty(exports,"resetPersistedStateCache",{enumerable:true,get:function(){return _index10.resetPersistedStateCache}});Object.defineProperty(exports,"resolveEffectiveTier",{enumerable:true,get:function(){return _index13.resolveEffectiveTier}});Object.defineProperty(exports,"resolveReloadStrategy",{enumerable:true,get:function(){return _index4.resolveReloadStrategy}});Object.defineProperty(exports,"restoreSignedOutKey",{enumerable:true,get:function(){return _index13.restoreSignedOutKey}});Object.defineProperty(exports,"retryAccountAccess",{enumerable:true,get:function(){return _licenseModule.retryAccountAccess}});Object.defineProperty(exports,"safeStringify",{enumerable:true,get:function(){return _index4.safeStringify}});Object.defineProperty(exports,"scheduleReloadApp",{enumerable:true,get:function(){return _index4.scheduleReloadApp}});Object.defineProperty(exports,"setBuoyAppId",{enumerable:true,get:function(){return _appIdentity.setBuoyAppId}});Object.defineProperty(exports,"setItemChecked",{enumerable:true,get:function(){return _index4.setItemChecked}});Object.defineProperty(exports,"setRenderCaptureProvider",{enumerable:true,get:function(){return _index4.setRenderCaptureProvider}});Object.defineProperty(exports,"shallowDiffSummary",{enumerable:true,get:function(){return _stateTools.shallowDiffSummary}});Object.defineProperty(exports,"signOutOfBuoy",{enumerable:true,get:function(){return _index13.signOutOfBuoy}});Object.defineProperty(exports,"simulationSurfacePending",{enumerable:true,get:function(){return _releaseSimulation.simulationSurfacePending}});Object.defineProperty(exports,"skippedRestore",{enumerable:true,get:function(){return _snapshotProviderKit.skippedRestore}});Object.defineProperty(exports,"startSettingsSync",{enumerable:true,get:function(){return _settingsSync.startSettingsSync}});Object.defineProperty(exports,"storageIsMemoryOnly",{enumerable:true,get:function(){return _index4.storageIsMemoryOnly}});Object.defineProperty(exports,"subscribeAccountAccess",{enumerable:true,get:function(){return _licenseModule.subscribeAccountAccess}});Object.defineProperty(exports,"subscribeBrowserNavigation",{enumerable:true,get:function(){return _browserNavigation.subscribeBrowserNavigation}});Object.defineProperty(exports,"subscribeRealAppState",{enumerable:true,get:function(){return _index4.subscribeRealAppState}});Object.defineProperty(exports,"subscribeSimulationSurface",{enumerable:true,get:function(){return _releaseSimulation.subscribeSimulationSurface}});Object.defineProperty(exports,"subscribeStorageWrites",{enumerable:true,get:function(){return _storageWrites.subscribeStorageWrites}});Object.defineProperty(exports,"subscribeToStateSnapshotProviders",{enumerable:true,get:function(){return _index4.subscribeToStateSnapshotProviders}});Object.defineProperty(exports,"subscribeToSubscriberCountChanges",{enumerable:true,get:function(){return _index4.subscribeToSubscriberCountChanges}});Object.defineProperty(exports,"subscriberCountNotifier",{enumerable:true,get:function(){return _index4.subscriberCountNotifier}});Object.defineProperty(exports,"superJsonDeserialize",{enumerable:true,get:function(){return _index4.superJsonDeserialize}});Object.defineProperty(exports,"superJsonSerialize",{enumerable:true,get:function(){return _index4.superJsonSerialize}});Object.defineProperty(exports,"syncSettingsNow",{enumerable:true,get:function(){return _settingsSync.syncSettingsNow}});Object.defineProperty(exports,"truncateText",{enumerable:true,get:function(){return _index4.truncateText}});Object.defineProperty(exports,"unionKeys",{enumerable:true,get:function(){return _snapshotProviderKit.unionKeys}});Object.defineProperty(exports,"useChangeLog",{enumerable:true,get:function(){return _index10.useChangeLog}});Object.defineProperty(exports,"useDeviceInfo",{enumerable:true,get:function(){return _index10.useDeviceInfo}});Object.defineProperty(exports,"useEventStoreEvents",{enumerable:true,get:function(){return _index10.useEventStoreEvents}});Object.defineProperty(exports,"useFeatureGate",{enumerable:true,get:function(){return _index13.useFeatureGate}});Object.defineProperty(exports,"useFilterManager",{enumerable:true,get:function(){return _index10.useFilterManager}});Object.defineProperty(exports,"useHintsContext",{enumerable:true,get:function(){return _index11.useHintsContext}});Object.defineProperty(exports,"useHintsDisabled",{enumerable:true,get:function(){return _index11.useHintsDisabled}});Object.defineProperty(exports,"useLimit",{enumerable:true,get:function(){return _index13.useLimit}});Object.defineProperty(exports,"usePersistedState",{enumerable:true,get:function(){return _index10.usePersistedState}});Object.defineProperty(exports,"useSafeAreaInsets",{enumerable:true,get:function(){return _index10.useSafeAreaInsets}});Object.defineProperty(exports,"useSafeGlobalSearchParams",{enumerable:true,get:function(){return _index4.useSafeGlobalSearchParams}});Object.defineProperty(exports,"useSafePathname",{enumerable:true,get:function(){return _index4.useSafePathname}});Object.defineProperty(exports,"useSafeRouter",{enumerable:true,get:function(){return _index4.useSafeRouter}});Object.defineProperty(exports,"useSafeSegments",{enumerable:true,get:function(){return _index4.useSafeSegments}});Object.defineProperty(exports,"useSignInState",{enumerable:true,get:function(){return _index13.useSignInState}});Object.defineProperty(exports,"useSubscribedValue",{enumerable:true,get:function(){return _index10.useSubscribedValue}});Object.defineProperty(exports,"wontApply",{enumerable:true,get:function(){return _snapshotProviderKit.wontApply}});var _index=require("./ui/index.js");Object.keys(_index).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index[e]}})});var _index2=require("./stores/index.js");Object.keys(_index2).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index2[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index2[e]}})});var _index3=require("./bugCase/index.js");Object.keys(_index3).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index3[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index3[e]}})});var _keyedArrays=require("./sync/keyedArrays.js");Object.keys(_keyedArrays).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_keyedArrays[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _keyedArrays[e]}})});var _valueShape=require("./sync/valueShape.js");Object.keys(_valueShape).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_valueShape[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _valueShape[e]}})});var _valuePath=require("./sync/valuePath.js");Object.keys(_valuePath).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_valuePath[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _valuePath[e]}})});var _typedEdit=require("./sync/typedEdit.js");Object.keys(_typedEdit).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_typedEdit[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _typedEdit[e]}})});var _wireBudget=require("./sync/wireBudget.js");Object.keys(_wireBudget).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_wireBudget[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _wireBudget[e]}})});var _wireForm=require("./sync/wireForm.js");Object.keys(_wireForm).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_wireForm[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _wireForm[e]}})});var _toolSyncAdapter=require("./sync/toolSyncAdapter.js");Object.keys(_toolSyncAdapter).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_toolSyncAdapter[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _toolSyncAdapter[e]}})});var _settingsSync=require("./sync/settingsSync.js");var _defineTool=require("./tools/defineTool.js");Object.keys(_defineTool).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_defineTool[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _defineTool[e]}})});var _toolActionRegistry=require("./sync/toolActionRegistry.js");Object.keys(_toolActionRegistry).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_toolActionRegistry[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _toolActionRegistry[e]}})});var _toolUiBridge=require("./sync/toolUiBridge.js");Object.keys(_toolUiBridge).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_toolUiBridge[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _toolUiBridge[e]}})});var _toolScreenHeader=require("./sync/toolScreenHeader.js");Object.keys(_toolScreenHeader).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_toolScreenHeader[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _toolScreenHeader[e]}})});var _index4=require("./utils/index.js");var _toolModules=require("./utils/toolModules.js");Object.keys(_toolModules).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_toolModules[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _toolModules[e]}})});var _storageWrites=require("./utils/storageWrites.js");var _fiberRootAnchor=require("./utils/fiberRootAnchor.js");var _browserNavigation=require("./utils/browserNavigation.js");var _snapshotProviderKit=require("./utils/snapshotProviderKit.js");var _stateTools=require("./utils/stateTools.js");var _index5=require("./utils/formatting/index.js");Object.keys(_index5).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index5[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index5[e]}})});var _index6=require("./utils/time/index.js");Object.keys(_index6).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index6[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index6[e]}})});var _typeHelpers=require("./utils/typeHelpers.js");var _index7=require("./icons/index.js");Object.keys(_index7).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index7[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index7[e]}})});var _index8=require("./clipboard/index.js");Object.keys(_index8).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index8[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index8[e]}})});var _index9=require("./logger/index.js");Object.keys(_index9).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index9[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index9[e]}})});var _index0=require("./settings/index.js");Object.keys(_index0).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index0[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index0[e]}})});var _index1=require("./storage/index.js");Object.keys(_index1).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index1[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index1[e]}})});var _index10=require("./hooks/index.js");var _JsModal=require("./JsModal");var _nightTheme=require("./ui/night/nightTheme.js");var _QrCodeView=require("./ui/qr/QrCodeView.js");var _primitives=require("./ui/night/primitives.js");var _gameUIColors=require("./ui/gameUI/constants/gameUIColors.js");var _macOSDesignSystemColors=require("./ui/gameUI/constants/macOSDesignSystemColors.js");var _EnvironmentIndicator=require("./env/EnvironmentIndicator");var _EnvironmentSelector=require("./env/EnvironmentSelector.js");var _EnvironmentSelectorInline=require("./env/EnvironmentSelectorInline");var _types=require("./types/types.js");var _index11=require("./context/index.js");var _index12=require("./history/index.js");Object.keys(_index12).forEach(function(e){if(e==="default"||e==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,e))return;if(e in exports&&exports[e]===_index12[e])return;Object.defineProperty(exports,e,{enumerable:true,get:function(){return _index12[e]}})});var _index13=require("./license/index.js");var _licenseModule=require("./license/licenseModule.js");var _releaseSimulation=require("./license/releaseSimulation.js");var _appIdentity=require("./utils/appIdentity.js");var _AccountSetup=require("./license/AccountSetup");var _AccountSetupContent=require("./license/AccountSetupContent.js");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.AccountSetupButton=AccountSetupButton;exports.AccountSetupCard=AccountSetupCard;exports.LOGIN_COMMAND=void 0;var _react=require("react");var _reactNative=require("react-native");var _lucideIcons=require("../icons/lucide-icons.js");var _index=require("../clipboard/index.js");var _fonts=require("../ui/fonts.js");var _nightTheme=require("../ui/night/nightTheme.js");var _licenseModule=require("./licenseModule.js");var _openPricing=require("./openPricing.js");var _jsxRuntime=require("react/jsx-runtime");const LOGIN_COMMAND=exports.LOGIN_COMMAND="npx --package=@buoy-gg/core buoy login";function AccountSetupButton({onPress:a,expanded:c=false,needsPlan:s=false}){const d=(0,_licenseModule.getUseAccountAccess)()();const l=d.status==="initializing";return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:s?"Plan needed for Buoy":"Sign in to Buoy",accessibilityState:{expanded:c},onPress:a,style:({pressed:t})=>[styles.launcher,c&&styles.launcherOpen,t&&styles.pressed],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.brandDot}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.launcherBrand,children:"BUOY"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.launcherDivider}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.launcherLabel,children:l?"Checking\u2026":s?"Plan needed":"Sign in"}),l?(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{size:14,color:_nightTheme.night.color.accent}):(0,_jsxRuntime.jsx)(_lucideIcons.ChevronRight,{size:14,color:_nightTheme.night.color.textSecondary})]})}function AccountSetupCard({onClose:a,titleId:c}){const s=(0,_licenseModule.getUseAccountAccess)()();const d=(0,_licenseModule.getUseLicense)();const l=d?.();const[t,h]=(0,_react.useState)(false);const[p,g]=(0,_react.useState)(false);const[x,n]=(0,_react.useState)(null);const r=(0,_react.useRef)(null);const i=(0,_react.useRef)(true);const u=(0,_react.useRef)(false);const o=p||s.status==="initializing";const y=l?.error||x;(0,_react.useEffect)(()=>{i.current=true;return()=>{i.current=false;if(r.current)clearTimeout(r.current)}},[]);const b=(0,_react.useCallback)(async()=>{const e=await(0,_index.copyToClipboard)(LOGIN_COMMAND);if(!i.current)return;if(!e){n("Select the command to copy it, then run it in your project terminal.");return}n(null);h(true);if(r.current)clearTimeout(r.current);r.current=setTimeout(()=>h(false),2e3)},[]);const f=(0,_react.useCallback)(async()=>{if(u.current)return;u.current=true;g(true);n(null);try{await(0,_licenseModule.retryAccountAccess)();if(i.current&&(0,_licenseModule.getAccountAccess)().status!=="admitted"){n("No account connected yet. Run the command, sign in, then reload your app.")}}catch{if(i.current)n("Couldn't verify your account. Check your connection and try again.")}finally{u.current=false;if(i.current)g(false)}},[]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.brand,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.brandDot}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.wordmark,children:"BUOY"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerLabel,children:"Developer tools"})]}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:"Close account setup",onPress:a,hitSlop:6,style:({pressed:e})=>[styles.close,e&&styles.pressed],children:(0,_jsxRuntime.jsx)(_lucideIcons.X,{size:16,color:_nightTheme.night.color.textSecondary})})]}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{nativeID:c,accessibilityRole:"header",style:styles.title,children:["Connect your","\n","Buoy account"]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.description,children:"Sign in with a Free or Pro account to open your developer tools."}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.terminal,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.terminalHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.terminalLabel,children:"RUN IN YOUR PROJECT"}),(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:t?"Login command copied":"Copy login command",onPress:b,style:({pressed:e})=>[styles.copy,e&&styles.pressed],children:[t?(0,_jsxRuntime.jsx)(_lucideIcons.Check,{size:13,color:_nightTheme.night.color.accent}):(0,_jsxRuntime.jsx)(_lucideIcons.Copy,{size:13,color:_nightTheme.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{accessibilityLiveRegion:"polite",style:[styles.copyText,t&&styles.accentText],children:t?"Copied":"Copy"})]})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.command,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{accessibilityElementsHidden:true,importantForAccessibility:"no",style:styles.prompt,children:"$"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{selectable:true,style:styles.commandText,children:LOGIN_COMMAND})]})]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hint,children:"Finish signing in, then reload your app."}),(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityState:{disabled:o,busy:o},disabled:o,onPress:f,style:({pressed:e})=>[styles.primary,e&&styles.primaryPressed,o&&styles.primaryBusy],children:[o?(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{size:15,color:_nightTheme.night.color.onAccent}):(0,_jsxRuntime.jsx)(_lucideIcons.RefreshCw,{size:15,color:_nightTheme.night.color.onAccent}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.primaryText,children:o?"Checking connection\u2026":"Check connection"})]}),y&&(0,_jsxRuntime.jsx)(_reactNative.Text,{accessibilityRole:"alert",accessibilityLiveRegion:"polite",style:styles.feedback,children:y}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.footer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.footerLabel,children:"Need a hand?"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.links,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"link",onPress:()=>(0,_openPricing.openPricing)("https://github.com/Buoy-gg/buoy/issues/new/choose"),style:styles.link,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.linkText,children:"GitHub"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"link",accessibilityLabel:"Email support@buoy.gg",onPress:()=>(0,_openPricing.openPricing)("mailto:support@buoy.gg"),style:styles.link,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.linkText,children:"Email"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"link",accessibilityLabel:"View Buoy plans",onPress:()=>(0,_openPricing.openPricing)(),style:styles.link,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.linkText,children:"Plans"})})]})]})]})}const styles=_reactNative.StyleSheet.create({launcher:{flexDirection:"row",alignItems:"center",gap:10,minHeight:44,paddingHorizontal:16,borderRadius:14,backgroundColor:"#111315",borderWidth:1,borderColor:"#303437",shadowColor:"#000",shadowOpacity:.28,shadowRadius:14,shadowOffset:{width:0,height:4},elevation:8},launcherOpen:{borderColor:_nightTheme.night.color.accentBorderStrong},launcherBrand:{color:_nightTheme.night.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.2,lineHeight:16},launcherDivider:{width:1,height:16,backgroundColor:"#35383C",marginHorizontal:2},launcherLabel:{color:_nightTheme.night.color.text,fontSize:12,fontWeight:"500",lineHeight:18},brandDot:{width:6,height:6,borderRadius:3,backgroundColor:_nightTheme.night.color.accent},card:{width:"100%",backgroundColor:"#111315",borderColor:"#303437",borderWidth:1,borderRadius:20,paddingHorizontal:24,paddingTop:18,paddingBottom:12},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:24},brand:{flexDirection:"row",alignItems:"center",gap:8},wordmark:{color:_nightTheme.night.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.4,lineHeight:16},headerLabel:{color:_nightTheme.night.color.textSecondary,fontSize:11,lineHeight:16,marginLeft:4},close:{width:28,height:28,borderRadius:8,backgroundColor:_nightTheme.night.color.fill,alignItems:"center",justifyContent:"center"},title:{color:_nightTheme.night.color.text,fontSize:25,fontWeight:"600",lineHeight:31,letterSpacing:-.6,marginBottom:10},description:{color:"#A4AAAF",fontSize:13,lineHeight:20,marginBottom:22},terminal:{backgroundColor:"#090B0D",borderWidth:1,borderColor:"#292C30",borderRadius:12},terminalHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:14,paddingRight:6,paddingTop:6},terminalLabel:{color:"#93999F",fontSize:9,fontWeight:"600",letterSpacing:.8,lineHeight:14},copy:{minWidth:68,minHeight:32,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:5,borderRadius:6},copyText:{color:_nightTheme.night.color.textSecondary,fontSize:11,fontWeight:"500",lineHeight:16},accentText:{color:_nightTheme.night.color.accent},command:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:16,paddingTop:6,paddingBottom:18},prompt:{color:_nightTheme.night.color.accent,fontSize:15,fontFamily:_fonts.monoFont,lineHeight:22},commandText:{color:_nightTheme.night.color.text,fontSize:15,fontFamily:_fonts.monoFont,lineHeight:22,flexShrink:1},hint:{color:_nightTheme.night.color.textSecondary,fontSize:12,lineHeight:18,marginTop:10,marginBottom:22},primary:{minHeight:42,borderRadius:10,backgroundColor:_nightTheme.night.color.accent,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:9,paddingHorizontal:12,paddingVertical:10},primaryPressed:{backgroundColor:_nightTheme.night.color.accentPressed},primaryBusy:{opacity:.75},primaryText:{color:_nightTheme.night.color.onAccent,fontSize:13,fontWeight:"600",lineHeight:20},feedback:{color:"#B5BBC0",fontSize:12,lineHeight:18,marginTop:12},footer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",borderTopWidth:1,borderTopColor:_nightTheme.night.color.separator,marginTop:20,paddingTop:8},footerLabel:{color:_nightTheme.night.color.textSecondary,fontSize:11,lineHeight:16},links:{flexDirection:"row",gap:2},link:{paddingHorizontal:7,paddingVertical:10,borderRadius:6},linkText:{color:"#B5BBC0",fontSize:11,fontWeight:"500",lineHeight:16},pressed:{opacity:.7}});
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.AccountSetupButton=AccountSetupButton;exports.AccountSetupCard=AccountSetupCard;exports.LOGIN_COMMAND=void 0;var _react=require("react");var _reactNative=require("react-native");var _lucideIcons=require("../icons/lucide-icons.js");var _index=require("../clipboard/index.js");var _fonts=require("../ui/fonts.js");var _nightTheme=require("../ui/night/nightTheme.js");var _licenseModule=require("./licenseModule.js");var _openPricing=require("./openPricing.js");var _jsxRuntime=require("react/jsx-runtime");const LOGIN_COMMAND=exports.LOGIN_COMMAND="npx --package=@buoy-gg/core buoy login";function AccountSetupButton({onPress:a,expanded:c=false,needsPlan:s=false}){const d=(0,_licenseModule.getUseAccountAccess)();const u=d();const l=u.status==="initializing";return(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:s?"Plan needed for Buoy":"Sign in to Buoy",accessibilityState:{expanded:c},onPress:a,style:({pressed:t})=>[styles.launcher,c&&styles.launcherOpen,t&&styles.pressed],children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.brandDot}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.launcherBrand,children:"BUOY"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.launcherDivider}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.launcherLabel,children:l?"Checking\u2026":s?"Plan needed":"Sign in"}),l?(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{size:14,color:_nightTheme.night.color.accent}):(0,_jsxRuntime.jsx)(_lucideIcons.ChevronRight,{size:14,color:_nightTheme.night.color.textSecondary})]})}function AccountSetupCard({onClose:a,titleId:c}){const s=(0,_licenseModule.getUseAccountAccess)();const d=s();const u=(0,_licenseModule.getUseLicense)();const l=u?.();const[t,g]=(0,_react.useState)(false);const[x,y]=(0,_react.useState)(false);const[b,n]=(0,_react.useState)(null);const r=(0,_react.useRef)(null);const i=(0,_react.useRef)(true);const h=(0,_react.useRef)(false);const o=x||d.status==="initializing";const p=l?.error||b;(0,_react.useEffect)(()=>{i.current=true;return()=>{i.current=false;if(r.current)clearTimeout(r.current)}},[]);const f=(0,_react.useCallback)(async()=>{const e=await(0,_index.copyToClipboard)(LOGIN_COMMAND);if(!i.current)return;if(!e){n("Select the command to copy it, then run it in your project terminal.");return}n(null);g(true);if(r.current)clearTimeout(r.current);r.current=setTimeout(()=>g(false),2e3)},[]);const m=(0,_react.useCallback)(async()=>{if(h.current)return;h.current=true;y(true);n(null);try{await(0,_licenseModule.retryAccountAccess)();if(i.current&&(0,_licenseModule.getAccountAccess)().status!=="admitted"){n("No account connected yet. Run the command, sign in, then reload your app.")}}catch{if(i.current)n("Couldn't verify your account. Check your connection and try again.")}finally{h.current=false;if(i.current)y(false)}},[]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.card,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.header,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.brand,children:[(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.brandDot}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.wordmark,children:"BUOY"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.headerLabel,children:"Developer tools"})]}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:"Close account setup",onPress:a,hitSlop:6,style:({pressed:e})=>[styles.close,e&&styles.pressed],children:(0,_jsxRuntime.jsx)(_lucideIcons.X,{size:16,color:_nightTheme.night.color.textSecondary})})]}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{nativeID:c,accessibilityRole:"header",style:styles.title,children:["Connect your","\n","Buoy account"]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.description,children:"Sign in with a Free or Pro account to open your developer tools."}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.terminal,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.terminalHeader,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.terminalLabel,children:"RUN IN YOUR PROJECT"}),(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityLabel:t?"Login command copied":"Copy login command",onPress:f,style:({pressed:e})=>[styles.copy,e&&styles.pressed],children:[t?(0,_jsxRuntime.jsx)(_lucideIcons.Check,{size:13,color:_nightTheme.night.color.accent}):(0,_jsxRuntime.jsx)(_lucideIcons.Copy,{size:13,color:_nightTheme.night.color.textSecondary}),(0,_jsxRuntime.jsx)(_reactNative.Text,{accessibilityLiveRegion:"polite",style:[styles.copyText,t&&styles.accentText],children:t?"Copied":"Copy"})]})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.command,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{accessibilityElementsHidden:true,importantForAccessibility:"no",style:styles.prompt,children:"$"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{selectable:true,style:styles.commandText,children:LOGIN_COMMAND})]})]}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.hint,children:"Finish signing in, then reload your app."}),(0,_jsxRuntime.jsxs)(_reactNative.Pressable,{accessibilityRole:"button",accessibilityState:{disabled:o,busy:o},disabled:o,onPress:m,style:({pressed:e})=>[styles.primary,e&&styles.primaryPressed,o&&styles.primaryBusy],children:[o?(0,_jsxRuntime.jsx)(_reactNative.ActivityIndicator,{size:15,color:_nightTheme.night.color.onAccent}):(0,_jsxRuntime.jsx)(_lucideIcons.RefreshCw,{size:15,color:_nightTheme.night.color.onAccent}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.primaryText,children:o?"Checking connection\u2026":"Check connection"})]}),p&&(0,_jsxRuntime.jsx)(_reactNative.Text,{accessibilityRole:"alert",accessibilityLiveRegion:"polite",style:styles.feedback,children:p}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.footer,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.footerLabel,children:"Need a hand?"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.links,children:[(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"link",onPress:()=>(0,_openPricing.openPricing)("https://github.com/Buoy-gg/buoy/issues/new/choose"),style:styles.link,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.linkText,children:"GitHub"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"link",accessibilityLabel:"Email support@buoy.gg",onPress:()=>(0,_openPricing.openPricing)("mailto:support@buoy.gg"),style:styles.link,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.linkText,children:"Email"})}),(0,_jsxRuntime.jsx)(_reactNative.Pressable,{accessibilityRole:"link",accessibilityLabel:"View Buoy plans",onPress:()=>(0,_openPricing.openPricing)(),style:styles.link,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.linkText,children:"Plans"})})]})]})]})}const styles=_reactNative.StyleSheet.create({launcher:{flexDirection:"row",alignItems:"center",gap:10,minHeight:44,paddingHorizontal:16,borderRadius:14,backgroundColor:"#111315",borderWidth:1,borderColor:"#303437",shadowColor:"#000",shadowOpacity:.28,shadowRadius:14,shadowOffset:{width:0,height:4},elevation:8},launcherOpen:{borderColor:_nightTheme.night.color.accentBorderStrong},launcherBrand:{color:_nightTheme.night.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.2,lineHeight:16},launcherDivider:{width:1,height:16,backgroundColor:"#35383C",marginHorizontal:2},launcherLabel:{color:_nightTheme.night.color.text,fontSize:12,fontWeight:"500",lineHeight:18},brandDot:{width:6,height:6,borderRadius:3,backgroundColor:_nightTheme.night.color.accent},card:{width:"100%",backgroundColor:"#111315",borderColor:"#303437",borderWidth:1,borderRadius:20,paddingHorizontal:24,paddingTop:18,paddingBottom:12},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:24},brand:{flexDirection:"row",alignItems:"center",gap:8},wordmark:{color:_nightTheme.night.color.text,fontSize:11,fontWeight:"800",letterSpacing:1.4,lineHeight:16},headerLabel:{color:_nightTheme.night.color.textSecondary,fontSize:11,lineHeight:16,marginLeft:4},close:{width:28,height:28,borderRadius:8,backgroundColor:_nightTheme.night.color.fill,alignItems:"center",justifyContent:"center"},title:{color:_nightTheme.night.color.text,fontSize:25,fontWeight:"600",lineHeight:31,letterSpacing:-.6,marginBottom:10},description:{color:"#A4AAAF",fontSize:13,lineHeight:20,marginBottom:22},terminal:{backgroundColor:"#090B0D",borderWidth:1,borderColor:"#292C30",borderRadius:12},terminalHeader:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:14,paddingRight:6,paddingTop:6},terminalLabel:{color:"#93999F",fontSize:9,fontWeight:"600",letterSpacing:.8,lineHeight:14},copy:{minWidth:68,minHeight:32,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:5,borderRadius:6},copyText:{color:_nightTheme.night.color.textSecondary,fontSize:11,fontWeight:"500",lineHeight:16},accentText:{color:_nightTheme.night.color.accent},command:{flexDirection:"row",alignItems:"center",gap:12,paddingHorizontal:16,paddingTop:6,paddingBottom:18},prompt:{color:_nightTheme.night.color.accent,fontSize:15,fontFamily:_fonts.monoFont,lineHeight:22},commandText:{color:_nightTheme.night.color.text,fontSize:15,fontFamily:_fonts.monoFont,lineHeight:22,flexShrink:1},hint:{color:_nightTheme.night.color.textSecondary,fontSize:12,lineHeight:18,marginTop:10,marginBottom:22},primary:{minHeight:42,borderRadius:10,backgroundColor:_nightTheme.night.color.accent,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:9,paddingHorizontal:12,paddingVertical:10},primaryPressed:{backgroundColor:_nightTheme.night.color.accentPressed},primaryBusy:{opacity:.75},primaryText:{color:_nightTheme.night.color.onAccent,fontSize:13,fontWeight:"600",lineHeight:20},feedback:{color:"#B5BBC0",fontSize:12,lineHeight:18,marginTop:12},footer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",borderTopWidth:1,borderTopColor:_nightTheme.night.color.separator,marginTop:20,paddingTop:8},footerLabel:{color:_nightTheme.night.color.textSecondary,fontSize:11,lineHeight:16},links:{flexDirection:"row",gap:2},link:{paddingHorizontal:7,paddingVertical:10,borderRadius:6},linkText:{color:"#B5BBC0",fontSize:11,fontWeight:"500",lineHeight:16},pressed:{opacity:.7}});
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"BuoyGetProCard",{enumerable:true,get:function(){return _BuoyUpgradeSheet.BuoyGetProCard}});Object.defineProperty(exports,"BuoyNeedsPlanCard",{enumerable:true,get:function(){return _BuoyUpgradeSheet.BuoyNeedsPlanCard}});Object.defineProperty(exports,"BuoySignInCard",{enumerable:true,get:function(){return _BuoyUpgradeSheet.BuoySignInCard}});Object.defineProperty(exports,"BuoyUpgradeSheet",{enumerable:true,get:function(){return _BuoyUpgradeSheet.BuoyUpgradeSheet}});Object.defineProperty(exports,"FeatureGate",{enumerable:true,get:function(){return _FeatureGate.FeatureGate}});Object.defineProperty(exports,"FreeAccountPrompt",{enumerable:true,get:function(){return _FreeAccountPrompt.FreeAccountPrompt}});Object.defineProperty(exports,"LOGIN_COMMAND",{enumerable:true,get:function(){return _FreeAccountPrompt.LOGIN_COMMAND}});Object.defineProperty(exports,"ProBadge",{enumerable:true,get:function(){return _FeatureGate.ProBadge}});Object.defineProperty(exports,"ProFeatureBanner",{enumerable:true,get:function(){return _FeatureGate.ProFeatureBanner}});Object.defineProperty(exports,"ProUpgradeModal",{enumerable:true,get:function(){return _FeatureGate.ProUpgradeModal}});Object.defineProperty(exports,"TIER_LIMITS",{enumerable:true,get:function(){return _tierLimits.TIER_LIMITS}});Object.defineProperty(exports,"UpgradeModal",{enumerable:true,get:function(){return _FeatureGate.UpgradeModal}});Object.defineProperty(exports,"UpgradePrompt",{enumerable:true,get:function(){return _FeatureGate.UpgradePrompt}});Object.defineProperty(exports,"getUseIsPro",{enumerable:true,get:function(){return _licenseModule.getUseIsPro}});Object.defineProperty(exports,"getUseLicense",{enumerable:true,get:function(){return _licenseModule.getUseLicense}});Object.defineProperty(exports,"getUseTier",{enumerable:true,get:function(){return _licenseModule.getUseTier}});Object.defineProperty(exports,"resolveEffectiveTier",{enumerable:true,get:function(){return _tierLimits.resolveEffectiveTier}});Object.defineProperty(exports,"signOutOfBuoy",{enumerable:true,get:function(){return _licenseModule.signOutOfBuoy}});Object.defineProperty(exports,"useFeatureGate",{enumerable:true,get:function(){return _FeatureGate.useFeatureGate}});Object.defineProperty(exports,"useLimit",{enumerable:true,get:function(){return _tierLimits.useLimit}});Object.defineProperty(exports,"useSignInState",{enumerable:true,get:function(){return _BuoyUpgradeSheet.useSignInState}});var _FeatureGate=require("./FeatureGate.js");var _BuoyUpgradeSheet=require("./BuoyUpgradeSheet.js");var _FreeAccountPrompt=require("./FreeAccountPrompt.js");var _licenseModule=require("./licenseModule.js");var _tierLimits=require("./tierLimits.js");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"BuoyGetProCard",{enumerable:true,get:function(){return _BuoyUpgradeSheet.BuoyGetProCard}});Object.defineProperty(exports,"BuoyNeedsPlanCard",{enumerable:true,get:function(){return _BuoyUpgradeSheet.BuoyNeedsPlanCard}});Object.defineProperty(exports,"BuoySignInCard",{enumerable:true,get:function(){return _BuoyUpgradeSheet.BuoySignInCard}});Object.defineProperty(exports,"BuoyUpgradeSheet",{enumerable:true,get:function(){return _BuoyUpgradeSheet.BuoyUpgradeSheet}});Object.defineProperty(exports,"FeatureGate",{enumerable:true,get:function(){return _FeatureGate.FeatureGate}});Object.defineProperty(exports,"FreeAccountPrompt",{enumerable:true,get:function(){return _FreeAccountPrompt.FreeAccountPrompt}});Object.defineProperty(exports,"LOGIN_COMMAND",{enumerable:true,get:function(){return _FreeAccountPrompt.LOGIN_COMMAND}});Object.defineProperty(exports,"ProBadge",{enumerable:true,get:function(){return _FeatureGate.ProBadge}});Object.defineProperty(exports,"ProFeatureBanner",{enumerable:true,get:function(){return _FeatureGate.ProFeatureBanner}});Object.defineProperty(exports,"ProUpgradeModal",{enumerable:true,get:function(){return _FeatureGate.ProUpgradeModal}});Object.defineProperty(exports,"TIER_LIMITS",{enumerable:true,get:function(){return _tierLimits.TIER_LIMITS}});Object.defineProperty(exports,"UpgradeModal",{enumerable:true,get:function(){return _FeatureGate.UpgradeModal}});Object.defineProperty(exports,"UpgradePrompt",{enumerable:true,get:function(){return _FeatureGate.UpgradePrompt}});Object.defineProperty(exports,"getUseIsPro",{enumerable:true,get:function(){return _licenseModule.getUseIsPro}});Object.defineProperty(exports,"getUseLicense",{enumerable:true,get:function(){return _licenseModule.getUseLicense}});Object.defineProperty(exports,"getUseTier",{enumerable:true,get:function(){return _licenseModule.getUseTier}});Object.defineProperty(exports,"resolveEffectiveTier",{enumerable:true,get:function(){return _tierLimits.resolveEffectiveTier}});Object.defineProperty(exports,"restoreSignedOutKey",{enumerable:true,get:function(){return _licenseModule.restoreSignedOutKey}});Object.defineProperty(exports,"signOutOfBuoy",{enumerable:true,get:function(){return _licenseModule.signOutOfBuoy}});Object.defineProperty(exports,"useFeatureGate",{enumerable:true,get:function(){return _FeatureGate.useFeatureGate}});Object.defineProperty(exports,"useLimit",{enumerable:true,get:function(){return _tierLimits.useLimit}});Object.defineProperty(exports,"useSignInState",{enumerable:true,get:function(){return _BuoyUpgradeSheet.useSignInState}});var _FeatureGate=require("./FeatureGate.js");var _BuoyUpgradeSheet=require("./BuoyUpgradeSheet.js");var _FreeAccountPrompt=require("./FreeAccountPrompt.js");var _licenseModule=require("./licenseModule.js");var _tierLimits=require("./tierLimits.js");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.assertAccountAccess=assertAccountAccess;exports.getAccountAccess=getAccountAccess;exports.getSignInSession=getSignInSession;exports.getSyncCredential=getSyncCredential;exports.getTeamCredential=getTeamCredential;exports.getUseAccountAccess=getUseAccountAccess;exports.getUseIsPro=getUseIsPro;exports.getUseLicense=getUseLicense;exports.getUseTier=getUseTier;exports.hasAccountAccess=hasAccountAccess;exports.isProNow=isProNow;exports.retryAccountAccess=retryAccountAccess;exports.signOutOfBuoy=signOutOfBuoy;exports.subscribeAccountAccess=subscribeAccountAccess;var licenseModule=_interopRequireWildcard(require("@buoy-gg/license"));var _accountRuntime=require("./accountRuntime");function _interopRequireWildcard(e,s){if("function"==typeof WeakMap)var i=new WeakMap,a=new WeakMap;return(_interopRequireWildcard=function(t,o){if(!o&&t&&t.__esModule)return t;var n,u,c={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return c;if(n=o?a:i){if(n.has(t))return n.get(t);n.set(t,c)}for(const r in t)"default"!==r&&{}.hasOwnProperty.call(t,r)&&((u=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,r))&&(u.get||u.set)?n(c,r,u):c[r]=t[r]);return c})(e,s)}let _useIsPro=null;let _useLicense=null;let _useTier=null;let _licenseLoadAttempted=false;function loadLicenseModuleCentral(){if(_licenseLoadAttempted)return;_licenseLoadAttempted=true;try{const e=licenseModule;if(e){_useIsPro=e.useIsPro??null;_useLicense=e.useLicense??null;_useTier=e.useTier??null}}catch{}}function getUseIsPro(){loadLicenseModuleCentral();return _useIsPro??(()=>false)}function getUseLicense(){loadLicenseModuleCentral();return _useLicense}function getUseTier(){loadLicenseModuleCentral();return _useTier??(()=>"free")}function isProNow(){try{return licenseModule.isPro?.()??false}catch{return false}}const LOCKED={status:"locked",reason:"account_required",validUntil:null};function accountManager(){if(!(0,_accountRuntime.canInitializeAccount)())return null;try{const e=licenseModule.LicenseManager;void e?.initialize?.();return e}catch{return null}}function getAccountAccess(){return accountManager()?.getAccountAccess?.()??LOCKED}function hasAccountAccess(){return getAccountAccess().status==="admitted"}function assertAccountAccess(){if(!hasAccountAccess())throw new Error("A verified Buoy account is required. Run npx --package=@buoy-gg/core buoy login, then reload your app.")}function subscribeAccountAccess(e){return accountManager()?.subscribe?.(e)??(()=>{})}function getUseAccountAccess(){try{return licenseModule.useAccountAccess??(()=>LOCKED)}catch{return()=>LOCKED}}async function retryAccountAccess(){const e=accountManager();const s=e?.getState?.().licenseKey;if(s)await e.setLicenseKey(s,{force:true});else await e?.initialize?.()}function getSignInSession(){try{return licenseModule.SessionManager}catch{return void 0}}async function signOutOfBuoy(){try{await licenseModule.SessionManager?.signOut()}catch{}}function getSyncCredential(){try{return licenseModule.getSyncCredential?.()??null}catch{return null}}function getTeamCredential(){try{return licenseModule.getTeamCredential?.()??null}catch{return null}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.assertAccountAccess=assertAccountAccess;exports.getAccountAccess=getAccountAccess;exports.getSignInSession=getSignInSession;exports.getSyncCredential=getSyncCredential;exports.getTeamCredential=getTeamCredential;exports.getUseAccountAccess=getUseAccountAccess;exports.getUseIsPro=getUseIsPro;exports.getUseLicense=getUseLicense;exports.getUseTier=getUseTier;exports.hasAccountAccess=hasAccountAccess;exports.isLicensedNow=isLicensedNow;exports.isProNow=isProNow;exports.restoreSignedOutKey=restoreSignedOutKey;exports.retryAccountAccess=retryAccountAccess;exports.signOutOfBuoy=signOutOfBuoy;exports.subscribeAccountAccess=subscribeAccountAccess;var licenseModule=_interopRequireWildcard(require("@buoy-gg/license"));var _accountRuntime=require("./accountRuntime");function _interopRequireWildcard(e,s){if("function"==typeof WeakMap)var o=new WeakMap,a=new WeakMap;return(_interopRequireWildcard=function(t,i){if(!i&&t&&t.__esModule)return t;var n,u,c={__proto__:null,default:t};if(null===t||"object"!=typeof t&&"function"!=typeof t)return c;if(n=i?a:o){if(n.has(t))return n.get(t);n.set(t,c)}for(const r in t)"default"!==r&&{}.hasOwnProperty.call(t,r)&&((u=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(t,r))&&(u.get||u.set)?n(c,r,u):c[r]=t[r]);return c})(e,s)}let _useIsPro=null;let _useLicense=null;let _useTier=null;let _licenseLoadAttempted=false;function loadLicenseModuleCentral(){if(_licenseLoadAttempted)return;_licenseLoadAttempted=true;try{const e=licenseModule;if(e){_useIsPro=e.useIsPro??null;_useLicense=e.useLicense??null;_useTier=e.useTier??null}}catch{}}function getUseIsPro(){loadLicenseModuleCentral();return _useIsPro??(()=>false)}function getUseLicense(){loadLicenseModuleCentral();return _useLicense}function getUseTier(){loadLicenseModuleCentral();return _useTier??(()=>"free")}function isProNow(){try{return licenseModule.isPro?.()??false}catch{return false}}const LOCKED={status:"locked",reason:"account_required",validUntil:null};function accountManager(){if(!(0,_accountRuntime.canInitializeAccount)())return null;try{const e=licenseModule.LicenseManager;void e?.initialize?.();return e}catch{return null}}function getAccountAccess(){return accountManager()?.getAccountAccess?.()??LOCKED}function hasAccountAccess(){return getAccountAccess().status==="admitted"}function isLicensedNow(){try{const e=accountManager();return e?.getState?.().isInitialized===true&&e.isPro?.()===true}catch{return false}}function assertAccountAccess(){if(!hasAccountAccess())throw new Error("A verified Buoy account is required. Run npx --package=@buoy-gg/core buoy login, then reload your app.")}function subscribeAccountAccess(e){return accountManager()?.subscribe?.(e)??(()=>{})}function getUseAccountAccess(){try{return licenseModule.useAccountAccess??(()=>LOCKED)}catch{return()=>LOCKED}}async function retryAccountAccess(){const e=accountManager();const s=e?.getState?.().licenseKey;if(s)await e.setLicenseKey(s,{force:true});else await e?.initialize?.()}function getSignInSession(){try{return licenseModule.SessionManager}catch{return void 0}}async function signOutOfBuoy(){try{const e=licenseModule.LicenseManager;if(e?.signOut)await e.signOut();else await licenseModule.SessionManager?.signOut()}catch{}}async function restoreSignedOutKey(){try{const e=licenseModule.LicenseManager;return await e?.restoreSignedOutKey?.()??false}catch{return false}}function getSyncCredential(){try{return licenseModule.getSyncCredential?.()??null}catch{return null}}function getTeamCredential(){try{return licenseModule.getTeamCredential?.()??null}catch{return null}}
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SURFACE_WAIT_MS=exports.SIMULATION_RELEASE_HELP=void 0;exports.bootBeforeActions=bootBeforeActions;exports.canSimulateInThisBuild=canSimulateInThisBuild;exports.canSimulateNow=canSimulateNow;exports.isReleaseBuild=isReleaseBuild;exports.isWebRelease=isWebRelease;exports.markSimulationSurface=markSimulationSurface;exports.simulationSurfacePending=simulationSurfacePending;exports.subscribeSimulationSurface=subscribeSimulationSurface;var _realNow=require("../utils/realNow.js");var _licenseModule=require("./licenseModule.js");const SURFACE_WAIT_MS=exports.SURFACE_WAIT_MS=15e3;const startedAt=(0,_realNow.realNow)();let mounted=0;let everMounted=false;const listeners=new Set;function isReleaseBuild(){return typeof __DEV__!=="undefined"&&!__DEV__}function isReactNative(){return typeof navigator!=="undefined"&&navigator.product==="ReactNative"}function isWebRelease(){return isReleaseBuild()&&!isReactNative()}function bootBeforeActions(e,t){if(!isReleaseBuild()||!isReactNative()||!e.actions)return;const n=e.actions;for(const r of Object.keys(n)){const o=n[r];n[r]=(...i)=>{t();return o(...i)}}}function markSimulationSurface(){mounted+=1;everMounted=true;listeners.forEach(t=>t());let e=false;return()=>{if(e)return;e=true;mounted-=1;listeners.forEach(t=>t())}}function subscribeSimulationSurface(e){listeners.add(e);return()=>{listeners.delete(e)}}function simulationSurfacePending(){if(!isReleaseBuild()||isWebRelease()||everMounted)return false;if((0,_realNow.realNow)()-startedAt>=SURFACE_WAIT_MS)return false;return(0,_licenseModule.getAccountAccess)().status==="initializing"||(0,_licenseModule.isLicensedNow)()}function canSimulateInThisBuild(){if(!isReleaseBuild())return true;return(0,_licenseModule.isLicensedNow)()&&mounted>0}function canSimulateNow(){return(0,_licenseModule.hasAccountAccess)()&&canSimulateInThisBuild()}const SIMULATION_RELEASE_HELP=exports.SIMULATION_RELEASE_HELP="A release build needs a paid Buoy plan and the Buoy menu on screen.";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.TIER_LIMITS=void 0;exports.resolveEffectiveTier=resolveEffectiveTier;exports.useLimit=useLimit;var _licenseModule=require("./licenseModule.js");const LIMITS={"network.requests":{free:25,pro:Infinity},"network.saved":{free:5,pro:50},"network.overrideRules":{free:1,pro:50},"storage.events":{free:25,pro:Infinity},"storage.keys":{free:25,pro:Infinity},"storage.mmkvInstances":{free:1,pro:Infinity},"redux.actions":{free:25,pro:Infinity},"zustand.changes":{free:25,pro:Infinity},"jotai.changes":{free:25,pro:Infinity},"events.entries":{free:25,pro:Infinity},"highlightUpdates.components":{free:25,pro:Infinity},"highlightUpdates.historyEvents":{free:3,pro:Infinity},"highlightUpdates.detailEvents":{free:5,pro:Infinity},"routeEvents.entries":{free:3,pro:Infinity},"timeMachine.snapshots":{free:1,pro:Infinity},"perfMonitor.automationCases":{free:3,pro:Infinity},"scenarios.saved":{free:3,pro:Infinity},"scenarios.active":{free:1,pro:3}};const TIER_LIMITS=exports.TIER_LIMITS=LIMITS;function resolveEffectiveTier(e,r){return r?"pro":e}function useLimit(e){const r=(0,_licenseModule.getUseIsPro)()();const t=(0,_licenseModule.getUseTier)()();return TIER_LIMITS[e][resolveEffectiveTier(t,r)]}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.TIER_LIMITS=void 0;exports.resolveEffectiveTier=resolveEffectiveTier;exports.useLimit=useLimit;var _licenseModule=require("./licenseModule.js");const LIMITS={"network.requests":{free:25,pro:Infinity},"network.saved":{free:5,pro:50},"network.overrideRules":{free:1,pro:50},"storage.events":{free:25,pro:Infinity},"storage.keys":{free:25,pro:Infinity},"storage.mmkvInstances":{free:1,pro:Infinity},"redux.actions":{free:25,pro:Infinity},"zustand.changes":{free:25,pro:Infinity},"jotai.changes":{free:25,pro:Infinity},"events.entries":{free:25,pro:Infinity},"highlightUpdates.components":{free:25,pro:Infinity},"highlightUpdates.historyEvents":{free:3,pro:Infinity},"highlightUpdates.detailEvents":{free:5,pro:Infinity},"routeEvents.entries":{free:3,pro:Infinity},"timeMachine.snapshots":{free:1,pro:Infinity},"perfMonitor.automationCases":{free:3,pro:Infinity},"scenarios.saved":{free:3,pro:Infinity},"scenarios.active":{free:1,pro:3}};const TIER_LIMITS=exports.TIER_LIMITS=LIMITS;function resolveEffectiveTier(e,r){return r?"pro":e}function useLimit(e){const r=(0,_licenseModule.getUseIsPro)();const t=r();const i=(0,_licenseModule.getUseTier)();const n=i();return TIER_LIMITS[e][resolveEffectiveTier(n,t)]}