@buoy-gg/shared-ui 7.0.74 → 7.0.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/utils/domRuntime.js +1 -1
- package/lib/module/utils/domRuntime.js +1 -1
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/web/chunks/chunk-G2SCTDOW.mjs +1 -0
- package/lib/web/chunks/chunk-GMM6TGFO.mjs +1 -1
- package/lib/web/index.mjs +1 -1
- package/lib/web/utils.mjs +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getDOMControlProps=getDOMControlProps;exports.getDOMFiber=getDOMFiber;exports.getDOMNodeHandle=getDOMNodeHandle;exports.getDOMPublicInstance=getDOMPublicInstance;exports.isDOMElement=isDOMElement;exports.resolveDOMEventEmitter=resolveDOMEventEmitter;const handles=new WeakMap;let nextHandle=1;function isDOMElement(
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.getDOMControlProps=getDOMControlProps;exports.getDOMFiber=getDOMFiber;exports.getDOMNodeHandle=getDOMNodeHandle;exports.getDOMPublicInstance=getDOMPublicInstance;exports.isDOMElement=isDOMElement;exports.resolveDOMEventEmitter=resolveDOMEventEmitter;const handles=new WeakMap;let nextHandle=1;function isDOMElement(t){return!!t&&typeof t==="object"&&t.nodeType===1&&typeof t.getBoundingClientRect==="function"}function getDOMNodeHandle(t){if(!isDOMElement(t))return null;let n=handles.get(t);if(n===void 0){n=nextHandle++;handles.set(t,n)}return n}function getDOMFiber(t){if(!isDOMElement(t))return null;const n=Object.keys(t).find(e=>e.startsWith("__reactFiber$"));return n?t[n]:null}function getDOMControlProps(t,n){if(!isDOMElement(t)||!n)return n;const e=t;const o=t.tagName.toLowerCase();const r=o==="input"&&(e.type==="checkbox"||e.type==="radio");const c=o==="input"&&e.type==="range";const u=o==="textarea"||o==="select"||o==="input"&&!r&&!c&&!["button","submit","reset","file","hidden"].includes(e.type);const l=t.getAttribute("contenteditable");const a=!u&&!r&&!c&&(t.isContentEditable===true||l!==null&&l!=="false");const m=s=>{const i=t;i.focus();const d=i.ownerDocument.getSelection?.();if(d){const f=i.ownerDocument.createRange();f.selectNodeContents(i);d.removeAllRanges();d.addRange(f)}let b=false;try{b=typeof i.ownerDocument.execCommand==="function"&&i.ownerDocument.execCommand("insertText",false,s)}catch{b=false}if(!b){i.textContent=s;i.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:s}))}};const g=s=>{if(r){if(e.checked!==Boolean(s))e.click();return}const i=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"value")?.set;if(i)i.call(e,String(s));else e.value=String(s);e.dispatchEvent(new Event("input",{bubbles:true}));e.dispatchEvent(new Event("change",{bubbles:true}))};return{...n,__buoyDevToolsRoot:n.__buoyDevToolsRoot||n["data-buoy-root"]!==void 0,testID:n.testID??n["data-testid"],nativeID:n.nativeID??n.id,accessibilityLabel:n.accessibilityLabel??n["aria-label"],accessibilityRole:n.accessibilityRole??n.role??(o==="button"?"button":o==="a"?"link":r?e.type:u||a?"textbox":c?"slider":void 0),onPress:n.onPress??(typeof n.onClick==="function"||o==="button"||o==="a"?()=>e.click():void 0),...r||c?{onValueChange:g,value:r?e.checked:Number(e.value),...c?{minimumValue:Number(e.min||0),maximumValue:Number(e.max||100)}:{}}:{},...u?{onChangeText:g,value:e.value}:{},...a?{onChangeText:s=>m(String(s)),value:t.innerText??t.textContent??""}:{}}}function getDOMPublicInstance(t){if(!isDOMElement(t))return null;return{__nativeTag:getDOMNodeHandle(t),measure(n){const e=t.getBoundingClientRect();n(e.x,e.y,e.width,e.height,e.x,e.y)},measureInWindow(n){const e=t.getBoundingClientRect();n(e.x,e.y,e.width,e.height)},requestTVFocus(){t.focus()},focus(){t.focus()}}}const eventNames={topFocus:"focus",topBlur:"blur",topTouchStart:"pointerdown",topTouchMove:"pointermove",topTouchEnd:"pointerup",topTouchCancel:"pointercancel",topChange:"input",topValueChange:"input",topSlidingComplete:"change"};function resolveDOMEventEmitter(){if(typeof document==="undefined")return{emitter:null,reason:"DOM events are unavailable during server rendering."};return{reason:null,emitter:{addListener(t,n){const e=eventNames[t];if(!e)throw new Error(`Unsupported DOM event: ${t}`);const o=r=>{const c=r.composedPath()[0]??r.target;if(!isDOMElement(c))return;const u=c;const l=r;const a={target:getDOMNodeHandle(c),pageX:l.clientX,pageY:l.clientY};if(e==="input"||e==="change"){if(u.type==="checkbox"||u.type==="radio")a.value=u.checked;else if(u.type==="range")a.value=Number(u.value);else a.text=u.value??c.textContent??""}n({eventName:t,nativeEvent:a})};document.addEventListener(e,o,true);return{remove:()=>document.removeEventListener(e,o,true)}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const m=new WeakMap;let h=1;export function isDOMElement(t){return!!t&&typeof t==="object"&&t.nodeType===1&&typeof t.getBoundingClientRect==="function"}export function getDOMNodeHandle(t){if(!isDOMElement(t))return null;let n=m.get(t);if(n===void 0){n=h++;m.set(t,n)}return n}export function getDOMFiber(t){if(!isDOMElement(t))return null;const n=Object.keys(t).find(e=>e.startsWith("__reactFiber$"));return n?t[n]:null}export function getDOMControlProps(t,n){if(!isDOMElement(t)||!n)return n;const e=t;const o=t.tagName.toLowerCase();const c=o==="input"&&(e.type==="checkbox"||e.type==="radio");const r=o==="input"&&e.type==="range";const u=o==="textarea"||o==="select"||o==="input"&&!c&&!r&&!["button","submit","reset","file","hidden"].includes(e.type);const l=t.getAttribute("contenteditable");const s=!u&&!c&&!r&&(t.isContentEditable===true||l!==null&&l!=="false");const p=a=>{const i=t;i.focus();const d=i.ownerDocument.getSelection?.();if(d){const g=i.ownerDocument.createRange();g.selectNodeContents(i);d.removeAllRanges();d.addRange(g)}let b=false;try{b=typeof i.ownerDocument.execCommand==="function"&&i.ownerDocument.execCommand("insertText",false,a)}catch{b=false}if(!b){i.textContent=a;i.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:a}))}};const f=a=>{if(c){if(e.checked!==Boolean(a))e.click();return}const i=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),"value")?.set;if(i)i.call(e,String(a));else e.value=String(a);e.dispatchEvent(new Event("input",{bubbles:true}));e.dispatchEvent(new Event("change",{bubbles:true}))};return{...n,__buoyDevToolsRoot:n.__buoyDevToolsRoot||n["data-buoy-root"]!==void 0,testID:n.testID??n["data-testid"],nativeID:n.nativeID??n.id,accessibilityLabel:n.accessibilityLabel??n["aria-label"],accessibilityRole:n.accessibilityRole??n.role??(o==="button"?"button":o==="a"?"link":c?e.type:u||s?"textbox":r?"slider":void 0),onPress:n.onPress??(typeof n.onClick==="function"||o==="button"||o==="a"?()=>e.click():void 0),...c||r?{onValueChange:f,value:c?e.checked:Number(e.value),...r?{minimumValue:Number(e.min||0),maximumValue:Number(e.max||100)}:{}}:{},...u?{onChangeText:f,value:e.value}:{},...s?{onChangeText:a=>p(String(a)),value:t.innerText??t.textContent??""}:{}}}export function getDOMPublicInstance(t){if(!isDOMElement(t))return null;return{__nativeTag:getDOMNodeHandle(t),measure(n){const e=t.getBoundingClientRect();n(e.x,e.y,e.width,e.height,e.x,e.y)},measureInWindow(n){const e=t.getBoundingClientRect();n(e.x,e.y,e.width,e.height)},requestTVFocus(){t.focus()},focus(){t.focus()}}}const y={topFocus:"focus",topBlur:"blur",topTouchStart:"pointerdown",topTouchMove:"pointermove",topTouchEnd:"pointerup",topTouchCancel:"pointercancel",topChange:"input",topValueChange:"input",topSlidingComplete:"change"};export function resolveDOMEventEmitter(){if(typeof document==="undefined")return{emitter:null,reason:"DOM events are unavailable during server rendering."};return{reason:null,emitter:{addListener(t,n){const e=y[t];if(!e)throw new Error(`Unsupported DOM event: ${t}`);const o=c=>{const r=c.composedPath()[0]??c.target;if(!isDOMElement(r))return;const u=r;const l=c;const s={target:getDOMNodeHandle(r),pageX:l.clientX,pageY:l.clientY};if(e==="input"||e==="change"){if(u.type==="checkbox"||u.type==="radio")s.value=u.checked;else if(u.type==="range")s.value=Number(u.value);else s.text=u.value??r.textContent??""}n({eventName:t,nativeEvent:s})};document.addEventListener(e,o,true);return{remove:()=>document.removeEventListener(e,o,true)}}}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{d}from"./chunk-AHVO74UQ.mjs";import{a as r,b as ke}from"./chunk-T6T3FEMU.mjs";var De=r(e=>{if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";let t=typeof e;return t==="object"?e instanceof Date?"date":e instanceof RegExp?"regexp":e instanceof Map?"map":e instanceof Set?"set":e instanceof Error?"error":"object":t},"getValueType"),Ae=r(e=>{let t=typeof e;return e==null||t==="string"||t==="number"||t==="boolean"||t==="bigint"||t==="symbol"},"isPrimitive"),Ne=r(e=>{try{return JSON.stringify(e),true}catch{return false}},"isJsonSerializable"),Le=r(e=>{try{return JSON.parse(e),true}catch{return false}},"isValidJson"),_e=r(e=>{if(e===null)return"null";if(e===void 0)return"undefined";try{return e.constructor?.name||typeof e}catch{return typeof e}},"getConstructorName"),Be=r(e=>e==null?true:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:false,"isEmpty"),Ve=r(e=>{if(Array.isArray(e)){let t=e.length;return t===0?"empty array":t===1?"1 item":`${t} items`}if(e&&typeof e=="object"){let t=Object.keys(e).length;return t===0?"empty object":t===1?"1 key":`${t} keys`}if(typeof e=="string"){let t=e.length;return t===0?"empty string":t===1?"1 character":`${t} characters`}return""},"getValueSize"),Fe=r(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.constructor===Object,"isPlainObject");var We=r(e=>{if(e==null)return e;if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},"parseValue"),Ue=r(e=>e===null?"null":e===void 0?"undefined":typeof e=="string"?`"${e}"`:typeof e=="boolean"?e?"true":"false":typeof e=="number"?String(e):typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:typeof e=="object"?Array.isArray(e)?`[Array: ${e.length} items]`:`{Object: ${Object.keys(e).length} keys}`:String(e),"formatValue"),Ie=r(e=>{if(e===null)return d.dataTypes.null;if(e===void 0)return d.dataTypes.undefined;switch(typeof e){case"string":return d.dataTypes.string;case"number":return d.dataTypes.number;case"boolean":return d.dataTypes.boolean;case"function":return d.dataTypes.function;case"object":return Array.isArray(e)?d.dataTypes.array:d.dataTypes.object;default:return d.primary}},"getTypeColor"),qe=r((e,t)=>e.length<=t?e:e.slice(0,t-3)+"...","truncateText"),k=r((e,t="")=>{let n={};return e==null?n:typeof e!="object"?(n[t||"root"]=e,n):(Array.isArray(e)?e.forEach((a,o)=>{let i=t?`${t}[${o}]`:`[${o}]`;typeof a=="object"&&a!==null?Object.assign(n,k(a,i)):n[i]=a}):Object.keys(e).forEach(a=>{let o=t?`${t}.${a}`:a,i=e[a];typeof i=="object"&&i!==null?Object.assign(n,k(i,o)):n[o]=i}),n)},"flattenObject"),ze=r(e=>e.length===0?"root":e.map((t,n)=>typeof t=="number"?`[${t}]`:n===0?t:`.${t}`).join(""),"formatPath");var Je={log:r(()=>{},"log"),warn:r(()=>{},"warn"),error:r((...e)=>{console.error("[Buoy]","[optional-module]",...e)},"error")},g=new Map,T=new Map,G=new Set;async function H(e,t={}){if(g.has(e))return g.get(e);let n={...Je,...t.logger??{}};T.has(e)||T.set(e,(async()=>{try{let o=await Y(e,t),i=o?.default??o;return g.set(e,i),n.log("Loaded optional module",e),i}catch(o){return n.log("Optional module unavailable",e,o),g.set(e,null),null}})());let a=await T.get(e);return T.delete(e),!a&&t.warnOnceKey&&!G.has(t.warnOnceKey)&&(G.add(t.warnOnceKey),n.warn(t.warningMessage??`Module '${e}' not found.`)),a}r(H,"loadOptionalModule");var K=(()=>{try{return new Function("moduleName","return import(moduleName);")}catch{return null}})(),X=(()=>{try{return new Function("return typeof require === 'function' ? require : undefined;")()}catch{return}})();async function Y(e,t){if(t.loader)return await Promise.resolve(t.loader());if(K)return K(e);if(X)return X(e);throw new Error(`No dynamic loader available for optional module '${e}'.`)}r(Y,"loadModuleWithFallback");function Q(e){return g.has(e)?g.get(e):null}r(Q,"getCachedOptionalModule");var Z="__buoyRenderCaptureProvider";function D(){return globalThis}r(D,"providerHost");function ee(e){D()[Z]=e}r(ee,"setRenderCaptureProvider");function te(){return D()[Z]??null}r(te,"getRenderCaptureProvider");var m=new Map,A=new Set;function N(){A.forEach(e=>{try{e()}catch{}})}r(N,"notify");function ne(e){return m.set(e.id,e),N(),()=>{m.get(e.id)===e&&(m.delete(e.id),N())}}r(ne,"registerStateSnapshotProvider");function re(){return Array.from(m.values())}r(re,"getStateSnapshotProviders");function ae(e){return m.get(e)??null}r(ae,"getStateSnapshotProvider");function oe(e){return A.add(e),()=>{A.delete(e)}}r(oe,"subscribeToStateSnapshotProviders");function x(){return null}r(x,"loadDevSettings");function O(){return null}r(O,"loadExpoUpdates");function C(){return typeof window>"u"?null:()=>window.location.reload()}r(C,"loadBrowserReload");function R(e="auto"){return e==="browser"?C()?"browser":null:e==="auto"&&C()?"browser":e==="dev-settings"?x()?"dev-settings":null:e==="expo-updates"?O()?"expo-updates":null:ke&&x()?"dev-settings":O()?"expo-updates":null}r(R,"resolveReloadStrategy");function L(e){return e==="browser"?"[buoy] Browser reload requires a browser window.":e==="dev-settings"?"[buoy] DevSettings.reload() unavailable \u2014 strategy 'dev-settings' requires React Native dev mode.":e==="expo-updates"?"[buoy] expo-updates not installed \u2014 strategy 'expo-updates' requires the host app to add the dependency.":"[buoy] No reload mechanism available. Run in __DEV__ or install expo-updates."}r(L,"unavailableMessage");async function _(e="auto",t="buoy reload"){let n=R(e);if(!n)throw new Error(L(e));return n==="browser"?C()():n==="dev-settings"?x().reload(t):await O().reloadAsync(),await new Promise(()=>{})}r(_,"reloadApp");var ie=250;function se(e){let t=e?.strategy??"auto",n=R(t);if(!n)throw new Error(L(t));let a=Math.max(0,e?.delayMs??ie),o=e?.reason??"buoy remote reload";return setTimeout(()=>{_(n,o).catch(()=>{})},a),{strategy:n,delayMs:a}}r(se,"scheduleReloadApp");function ue(){return null}r(ue,"getDevServerOrigin");function le(){let e=globalThis.__buoyRealNow;return typeof e=="function"?e():Date.now()}r(le,"realNow");var ce=class tt{constructor(){this.listeners=new Set;this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}getListenerCount(){return this.listeners.size}notify(...t){this.listeners.forEach(n=>{n(...t)})}onSubscribe(){}onUnsubscribe(){}};r(ce,"Subscribable");var Ge=ce;var pe=class nt{constructor(){this.listeners=new Set}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(t){this.listeners.forEach(n=>{try{n(t)}catch{}})}};r(pe,"SubscriberCountNotifier");var He=pe,B=new He,Ke=r(e=>B.subscribe(e),"subscribeToSubscriberCountChanges"),Xe=r(e=>B.notify(e),"notifySubscriberCountChange");import{useSyncExternalStore as de}from"react";var c,S=new Set,V,he;function fe(e){return c=e,()=>{c===e&&(c=void 0)}}r(fe,"registerBrowserRouter");function f(){return typeof location>"u"?"/":location.href}r(f,"getBrowserHref");function F(e=f()){let t=new URL(e,"http://localhost"),n=t.hash.startsWith("#/")?new URL(t.hash.slice(1),t.origin):t;return n.pathname||(n.pathname="/"),n}r(F,"getBrowserRouteURL");var w;function W(e){if(!S.size&&typeof window<"u"){let t=window.history,n=r(o=>{for(let i of[...S])try{i({href:f(),kind:o})}catch{}},"emit");if(w)w.active=true;else{let o=t.pushState,i=t.replaceState,s={push:o,replace:i,active:true},h=r(function(...v){let b=Reflect.apply(o,this,v);return s.active&&n("push"),b},"wrappedPush"),l=r(function(...v){let b=Reflect.apply(i,this,v);return s.active&&n("replace"),b},"wrappedReplace");t.pushState=h,t.replaceState=l,w=s,he=r(()=>{t.pushState!==h||t.replaceState!==l||(t.pushState=o,t.replaceState=i,w=void 0)},"unwrap")}let a=r(()=>n("pop"),"pop");window.addEventListener("popstate",a),window.addEventListener("hashchange",a),V=r(()=>{w&&(w.active=false),he?.(),window.removeEventListener("popstate",a),window.removeEventListener("hashchange",a),V=void 0},"detach")}return S.add(e),()=>{S.delete(e),S.size||V?.()}}r(W,"subscribeBrowserNavigation");function U(e){let t=typeof e=="string"?e:e.pathname,n=new URL(t,f());if(n.origin!==window.location.origin)throw new Error("Tool navigation must stay on the current origin.");if(typeof e!="string")for(let[a,o]of Object.entries(e.params??{}))n.searchParams.set(a,String(o));return`${n.pathname}${n.search}${n.hash}`}r(U,"pathFor");var E={push(e){let t=U(e);if(c)return c.push(t);window.history.pushState(null,"",window.location.hash.startsWith("#/")?`#${t}`:t),window.dispatchEvent(new PopStateEvent("popstate",{state:window.history.state}))},replace(e){let t=U(e);if(c)return c.replace(t);window.history.replaceState(window.history.state,"",window.location.hash.startsWith("#/")?`#${t}`:t),window.dispatchEvent(new PopStateEvent("popstate",{state:window.history.state}))},back(){c?c.back():window.history.back()},canGoBack(){return c?.canGoBack?.()??(typeof window<"u"&&window.history.length>1)},navigate(e){E.push(e)},setParams(e){E.replace({pathname:f(),params:e})},dismiss(e=1){window.history.go(-e)},dismissAll(){throw new Error("Use the captured browser history to select a destination.")}};var ye=r(e=>W(e),"subscribe"),j=F;function be(){return E}r(be,"useSafeRouter");function I(){return de(ye,f,()=>"/"),j().pathname}r(I,"useSafePathname");function ge(){return I().split("/").filter(Boolean)}r(ge,"useSafeSegments");function we(){return de(ye,f,()=>"/"),Object.fromEntries(j().searchParams)}r(we,"useSafeGlobalSearchParams");function ve(){return typeof window>"u"?null:E}r(ve,"getSafeRouter");function me(){return j().pathname}r(me,"getSafeCurrentPathname");function Se(){let e=j();return{pathname:e.pathname,href:`${e.pathname}${e.search}${e.hash}`,segments:e.pathname.split("/").filter(Boolean)}}r(Se,"getSafeCurrentRoute");function Ee(){return false}r(Ee,"isExpoRouterAvailable");var Te=new WeakMap,Ye=1;function y(e){return!!e&&typeof e=="object"&&e.nodeType===1&&typeof e.getBoundingClientRect=="function"}r(y,"isDOMElement");function $(e){if(!y(e))return null;let t=Te.get(e);return t===void 0&&(t=Ye++,Te.set(e,t)),t}r($,"getDOMNodeHandle");function xe(e){if(!y(e))return null;let t=Object.keys(e).find(n=>n.startsWith("__reactFiber$"));return t?e[t]:null}r(xe,"getDOMFiber");function Oe(e,t){if(!y(e)||!t)return t;let n=e,a=e.tagName.toLowerCase(),o=a==="input"&&(n.type==="checkbox"||n.type==="radio"),i=a==="input"&&n.type==="range",s=a==="textarea"||a==="select"||a==="input"&&!o&&!i&&!["button","submit","reset","file","hidden"].includes(n.type),h=e.getAttribute("contenteditable"),l=!s&&!o&&!i&&(e.isContentEditable===true||h!==null&&h!=="false"),v=r(p=>{let u=e;u.focus();let M=u.ownerDocument.getSelection?.();if(M){let J=u.ownerDocument.createRange();J.selectNodeContents(u),M.removeAllRanges(),M.addRange(J)}let P=false;try{P=typeof u.ownerDocument.execCommand=="function"&&u.ownerDocument.execCommand("insertText",false,p)}catch{P=false}P||(u.textContent=p,u.dispatchEvent(new InputEvent("input",{bubbles:true,inputType:"insertText",data:p})))},"setEditable"),b=r(p=>{if(o){n.checked!==!!p&&n.click();return}let u=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),"value")?.set;u?u.call(n,String(p)):n.value=String(p),n.dispatchEvent(new Event("input",{bubbles:true})),n.dispatchEvent(new Event("change",{bubbles:true}))},"setValue");return{...t,__buoyDevToolsRoot:t.__buoyDevToolsRoot||t["data-buoy-root"]!==void 0,testID:t.testID??t["data-testid"],nativeID:t.nativeID??t.id,accessibilityLabel:t.accessibilityLabel??t["aria-label"],accessibilityRole:t.accessibilityRole??t.role??(a==="button"?"button":a==="a"?"link":o?n.type:s||l?"textbox":i?"slider":void 0),onPress:t.onPress??(typeof t.onClick=="function"||a==="button"||a==="a"?()=>n.click():void 0),...o||i?{onValueChange:b,value:o?n.checked:Number(n.value),...i?{minimumValue:Number(n.min||0),maximumValue:Number(n.max||100)}:{}}:{},...s?{onChangeText:b,value:n.value}:{},...l?{onChangeText:r(p=>v(String(p)),"onChangeText"),value:e.innerText??e.textContent??""}:{}}}r(Oe,"getDOMControlProps");function Ce(e){return y(e)?{__nativeTag:$(e),measure(t){let n=e.getBoundingClientRect();t(n.x,n.y,n.width,n.height,n.x,n.y)},measureInWindow(t){let n=e.getBoundingClientRect();t(n.x,n.y,n.width,n.height)},requestTVFocus(){e.focus()},focus(){e.focus()}}:null}r(Ce,"getDOMPublicInstance");var Qe={topFocus:"focus",topBlur:"blur",topTouchStart:"pointerdown",topTouchMove:"pointermove",topTouchEnd:"pointerup",topTouchCancel:"pointercancel",topChange:"input",topValueChange:"input",topSlidingComplete:"change"};function Re(){return typeof document>"u"?{emitter:null,reason:"DOM events are unavailable during server rendering."}:{reason:null,emitter:{addListener(e,t){let n=Qe[e];if(!n)throw new Error(`Unsupported DOM event: ${e}`);let a=r(o=>{let i=o.composedPath()[0]??o.target;if(!y(i))return;let s=i,h=o,l={target:$(i),pageX:h.clientX,pageY:h.clientY};(n==="input"||n==="change")&&(s.type==="checkbox"||s.type==="radio"?l.value=s.checked:s.type==="range"?l.value=Number(s.value):l.text=s.value??i.textContent??""),t({eventName:e,nativeEvent:l})},"callback");return document.addEventListener(n,a,true),{remove:r(()=>document.removeEventListener(n,a,true),"remove")}}}}}r(Re,"resolveDOMEventEmitter");var q=new Map,je=0;function $e(e){for(let[t,n]of Object.entries(e)){let a=t.startsWith("@buoy-gg/")?t.replace(/\/web$/,""):`@buoy-gg/${t}`;q.get(a)!==n&&(q.set(a,n),je++)}}r($e,"registerToolModules");function z(e){return q.get(e)??null}r(z,"getRegisteredToolModule");function Me(){return je}r(Me,"getToolModuleVersion");function Pe(e){let t=z(e);if(!t)throw new Error(`Register ${e} with createWebTools before opening tools that use it.`);return t}r(Pe,"loadToolModule");export{Ge as a,B as b,Ke as c,Xe as d,De as e,Ae as f,Ne as g,Le as h,_e as i,Be as j,Ve as k,Fe as l,le as m,We as n,Ue as o,Ie as p,qe as q,k as r,ze as s,H as t,Q as u,ee as v,te as w,ne as x,re as y,ae as z,oe as A,R as B,_ as C,ie as D,se as E,ue as F,fe as G,f as H,F as I,W as J,E as K,be as L,I as M,ge as N,we as O,ve as P,me as Q,Se as R,Ee as S,y as T,$ as U,xe as V,Oe as W,Ce as X,Re as Y,$e as Z,z as _,Me as $,Pe as aa};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{d as c}from"./chunk-AHVO74UQ.mjs";import{a as n,b as $e}from"./chunk-T6T3FEMU.mjs";var xe=n(e=>{if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";let t=typeof e;return t==="object"?e instanceof Date?"date":e instanceof RegExp?"regexp":e instanceof Map?"map":e instanceof Set?"set":e instanceof Error?"error":"object":t},"getValueType"),Ce=n(e=>{let t=typeof e;return e==null||t==="string"||t==="number"||t==="boolean"||t==="bigint"||t==="symbol"},"isPrimitive"),Me=n(e=>{try{return JSON.stringify(e),true}catch{return false}},"isJsonSerializable"),Pe=n(e=>{try{return JSON.parse(e),true}catch{return false}},"isValidJson"),ke=n(e=>{if(e===null)return"null";if(e===void 0)return"undefined";try{return e.constructor?.name||typeof e}catch{return typeof e}},"getConstructorName"),Ae=n(e=>e==null?true:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:false,"isEmpty"),De=n(e=>{if(Array.isArray(e)){let t=e.length;return t===0?"empty array":t===1?"1 item":`${t} items`}if(e&&typeof e=="object"){let t=Object.keys(e).length;return t===0?"empty object":t===1?"1 key":`${t} keys`}if(typeof e=="string"){let t=e.length;return t===0?"empty string":t===1?"1 character":`${t} characters`}return""},"getValueSize"),Ne=n(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.constructor===Object,"isPlainObject");var Le=n(e=>{if(e==null)return e;if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},"parseValue"),_e=n(e=>e===null?"null":e===void 0?"undefined":typeof e=="string"?`"${e}"`:typeof e=="boolean"?e?"true":"false":typeof e=="number"?String(e):typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:typeof e=="object"?Array.isArray(e)?`[Array: ${e.length} items]`:`{Object: ${Object.keys(e).length} keys}`:String(e),"formatValue"),Be=n(e=>{if(e===null)return c.dataTypes.null;if(e===void 0)return c.dataTypes.undefined;switch(typeof e){case"string":return c.dataTypes.string;case"number":return c.dataTypes.number;case"boolean":return c.dataTypes.boolean;case"function":return c.dataTypes.function;case"object":return Array.isArray(e)?c.dataTypes.array:c.dataTypes.object;default:return c.primary}},"getTypeColor"),Ve=n((e,t)=>e.length<=t?e:e.slice(0,t-3)+"...","truncateText"),x=n((e,t="")=>{let r={};return e==null?r:typeof e!="object"?(r[t||"root"]=e,r):(Array.isArray(e)?e.forEach((a,o)=>{let s=t?`${t}[${o}]`:`[${o}]`;typeof a=="object"&&a!==null?Object.assign(r,x(a,s)):r[s]=a}):Object.keys(e).forEach(a=>{let o=t?`${t}.${a}`:a,s=e[a];typeof s=="object"&&s!==null?Object.assign(r,x(s,o)):r[o]=s}),r)},"flattenObject"),Fe=n(e=>e.length===0?"root":e.map((t,r)=>typeof t=="number"?`[${t}]`:r===0?t:`.${t}`).join(""),"formatPath");var Ue={log:n(()=>{},"log"),warn:n(()=>{},"warn"),error:n((...e)=>{console.error("[Buoy]","[optional-module]",...e)},"error")},y=new Map,m=new Map,W=new Set;async function z(e,t={}){if(y.has(e))return y.get(e);let r={...Ue,...t.logger??{}};m.has(e)||m.set(e,(async()=>{try{let o=await J(e,t),s=o?.default??o;return y.set(e,s),r.log("Loaded optional module",e),s}catch(o){return r.log("Optional module unavailable",e,o),y.set(e,null),null}})());let a=await m.get(e);return m.delete(e),!a&&t.warnOnceKey&&!W.has(t.warnOnceKey)&&(W.add(t.warnOnceKey),r.warn(t.warningMessage??`Module '${e}' not found.`)),a}n(z,"loadOptionalModule");var I=(()=>{try{return new Function("moduleName","return import(moduleName);")}catch{return null}})(),q=(()=>{try{return new Function("return typeof require === 'function' ? require : undefined;")()}catch{return}})();async function J(e,t){if(t.loader)return await Promise.resolve(t.loader());if(I)return I(e);if(q)return q(e);throw new Error(`No dynamic loader available for optional module '${e}'.`)}n(J,"loadModuleWithFallback");function H(e){return y.has(e)?y.get(e):null}n(H,"getCachedOptionalModule");var K="__buoyRenderCaptureProvider";function C(){return globalThis}n(C,"providerHost");function G(e){C()[K]=e}n(G,"setRenderCaptureProvider");function X(){return C()[K]??null}n(X,"getRenderCaptureProvider");var g=new Map,M=new Set;function P(){M.forEach(e=>{try{e()}catch{}})}n(P,"notify");function Y(e){return g.set(e.id,e),P(),()=>{g.get(e.id)===e&&(g.delete(e.id),P())}}n(Y,"registerStateSnapshotProvider");function Q(){return Array.from(g.values())}n(Q,"getStateSnapshotProviders");function Z(e){return g.get(e)??null}n(Z,"getStateSnapshotProvider");function ee(e){return M.add(e),()=>{M.delete(e)}}n(ee,"subscribeToStateSnapshotProviders");function S(){return null}n(S,"loadDevSettings");function E(){return null}n(E,"loadExpoUpdates");function O(){return typeof window>"u"?null:()=>window.location.reload()}n(O,"loadBrowserReload");function R(e="auto"){return e==="browser"?O()?"browser":null:e==="auto"&&O()?"browser":e==="dev-settings"?S()?"dev-settings":null:e==="expo-updates"?E()?"expo-updates":null:$e&&S()?"dev-settings":E()?"expo-updates":null}n(R,"resolveReloadStrategy");function k(e){return e==="browser"?"[buoy] Browser reload requires a browser window.":e==="dev-settings"?"[buoy] DevSettings.reload() unavailable \u2014 strategy 'dev-settings' requires React Native dev mode.":e==="expo-updates"?"[buoy] expo-updates not installed \u2014 strategy 'expo-updates' requires the host app to add the dependency.":"[buoy] No reload mechanism available. Run in __DEV__ or install expo-updates."}n(k,"unavailableMessage");async function A(e="auto",t="buoy reload"){let r=R(e);if(!r)throw new Error(k(e));return r==="browser"?O()():r==="dev-settings"?S().reload(t):await E().reloadAsync(),await new Promise(()=>{})}n(A,"reloadApp");var te=250;function re(e){let t=e?.strategy??"auto",r=R(t);if(!r)throw new Error(k(t));let a=Math.max(0,e?.delayMs??te),o=e?.reason??"buoy remote reload";return setTimeout(()=>{A(r,o).catch(()=>{})},a),{strategy:r,delayMs:a}}n(re,"scheduleReloadApp");function ne(){return null}n(ne,"getDevServerOrigin");function ae(){let e=globalThis.__buoyRealNow;return typeof e=="function"?e():Date.now()}n(ae,"realNow");var oe=class Xe{constructor(){this.listeners=new Set;this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}getListenerCount(){return this.listeners.size}notify(...t){this.listeners.forEach(r=>{r(...t)})}onSubscribe(){}onUnsubscribe(){}};n(oe,"Subscribable");var We=oe;var se=class Ye{constructor(){this.listeners=new Set}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(t){this.listeners.forEach(r=>{try{r(t)}catch{}})}};n(se,"SubscriberCountNotifier");var ze=se,D=new ze,Ie=n(e=>D.subscribe(e),"subscribeToSubscriberCountChanges"),qe=n(e=>D.notify(e),"notifySubscriberCountChange");import{useSyncExternalStore as ie}from"react";var l,w=new Set,N,ue;function le(e){return l=e,()=>{l===e&&(l=void 0)}}n(le,"registerBrowserRouter");function d(){return typeof location>"u"?"/":location.href}n(d,"getBrowserHref");function L(e=d()){let t=new URL(e,"http://localhost"),r=t.hash.startsWith("#/")?new URL(t.hash.slice(1),t.origin):t;return r.pathname||(r.pathname="/"),r}n(L,"getBrowserRouteURL");var b;function _(e){if(!w.size&&typeof window<"u"){let t=window.history,r=n(o=>{for(let s of[...w])try{s({href:d(),kind:o})}catch{}},"emit");if(b)b.active=true;else{let o=t.pushState,s=t.replaceState,i={push:o,replace:s,active:true},p=n(function(...h){let $=Reflect.apply(o,this,h);return i.active&&r("push"),$},"wrappedPush"),u=n(function(...h){let $=Reflect.apply(s,this,h);return i.active&&r("replace"),$},"wrappedReplace");t.pushState=p,t.replaceState=u,b=i,ue=n(()=>{t.pushState!==p||t.replaceState!==u||(t.pushState=o,t.replaceState=s,b=void 0)},"unwrap")}let a=n(()=>r("pop"),"pop");window.addEventListener("popstate",a),window.addEventListener("hashchange",a),N=n(()=>{b&&(b.active=false),ue?.(),window.removeEventListener("popstate",a),window.removeEventListener("hashchange",a),N=void 0},"detach")}return w.add(e),()=>{w.delete(e),w.size||N?.()}}n(_,"subscribeBrowserNavigation");function B(e){let t=typeof e=="string"?e:e.pathname,r=new URL(t,d());if(r.origin!==window.location.origin)throw new Error("Tool navigation must stay on the current origin.");if(typeof e!="string")for(let[a,o]of Object.entries(e.params??{}))r.searchParams.set(a,String(o));return`${r.pathname}${r.search}${r.hash}`}n(B,"pathFor");var v={push(e){let t=B(e);if(l)return l.push(t);window.history.pushState(null,"",window.location.hash.startsWith("#/")?`#${t}`:t),window.dispatchEvent(new PopStateEvent("popstate",{state:window.history.state}))},replace(e){let t=B(e);if(l)return l.replace(t);window.history.replaceState(window.history.state,"",window.location.hash.startsWith("#/")?`#${t}`:t),window.dispatchEvent(new PopStateEvent("popstate",{state:window.history.state}))},back(){l?l.back():window.history.back()},canGoBack(){return l?.canGoBack?.()??(typeof window<"u"&&window.history.length>1)},navigate(e){v.push(e)},setParams(e){v.replace({pathname:d(),params:e})},dismiss(e=1){window.history.go(-e)},dismissAll(){throw new Error("Use the captured browser history to select a destination.")}};var ce=n(e=>_(e),"subscribe"),T=L;function pe(){return v}n(pe,"useSafeRouter");function V(){return ie(ce,d,()=>"/"),T().pathname}n(V,"useSafePathname");function de(){return V().split("/").filter(Boolean)}n(de,"useSafeSegments");function fe(){return ie(ce,d,()=>"/"),Object.fromEntries(T().searchParams)}n(fe,"useSafeGlobalSearchParams");function he(){return typeof window>"u"?null:v}n(he,"getSafeRouter");function ye(){return T().pathname}n(ye,"getSafeCurrentPathname");function be(){let e=T();return{pathname:e.pathname,href:`${e.pathname}${e.search}${e.hash}`,segments:e.pathname.split("/").filter(Boolean)}}n(be,"getSafeCurrentRoute");function ge(){return false}n(ge,"isExpoRouterAvailable");var we=new WeakMap,Je=1;function f(e){return!!e&&typeof e=="object"&&e.nodeType===1&&typeof e.getBoundingClientRect=="function"}n(f,"isDOMElement");function j(e){if(!f(e))return null;let t=we.get(e);return t===void 0&&(t=Je++,we.set(e,t)),t}n(j,"getDOMNodeHandle");function ve(e){if(!f(e))return null;let t=Object.keys(e).find(r=>r.startsWith("__reactFiber$"));return t?e[t]:null}n(ve,"getDOMFiber");function me(e,t){if(!f(e)||!t)return t;let r=e,a=e.tagName.toLowerCase(),o=a==="input"&&(r.type==="checkbox"||r.type==="radio"),s=a==="input"&&r.type==="range",i=a==="textarea"||a==="select"||a==="input"&&!o&&!s&&!["button","submit","reset","file","hidden"].includes(r.type),p=n(u=>{if(o){r.checked!==!!u&&r.click();return}let h=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),"value")?.set;h?h.call(r,String(u)):r.value=String(u),r.dispatchEvent(new Event("input",{bubbles:true})),r.dispatchEvent(new Event("change",{bubbles:true}))},"setValue");return{...t,__buoyDevToolsRoot:t.__buoyDevToolsRoot||t["data-buoy-root"]!==void 0,testID:t.testID??t["data-testid"],nativeID:t.nativeID??t.id,accessibilityLabel:t.accessibilityLabel??t["aria-label"],accessibilityRole:t.accessibilityRole??t.role??(a==="button"?"button":a==="a"?"link":o?r.type:i?"textbox":s?"slider":void 0),onPress:t.onPress??(typeof t.onClick=="function"||a==="button"||a==="a"?()=>r.click():void 0),...o||s?{onValueChange:p,value:o?r.checked:Number(r.value),...s?{minimumValue:Number(r.min||0),maximumValue:Number(r.max||100)}:{}}:{},...i?{onChangeText:p,value:r.value}:{}}}n(me,"getDOMControlProps");function Se(e){return f(e)?{__nativeTag:j(e),measure(t){let r=e.getBoundingClientRect();t(r.x,r.y,r.width,r.height,r.x,r.y)},measureInWindow(t){let r=e.getBoundingClientRect();t(r.x,r.y,r.width,r.height)},requestTVFocus(){e.focus()},focus(){e.focus()}}:null}n(Se,"getDOMPublicInstance");var He={topFocus:"focus",topBlur:"blur",topTouchStart:"pointerdown",topTouchMove:"pointermove",topTouchEnd:"pointerup",topTouchCancel:"pointercancel",topChange:"input",topValueChange:"input",topSlidingComplete:"change"};function Ee(){return typeof document>"u"?{emitter:null,reason:"DOM events are unavailable during server rendering."}:{reason:null,emitter:{addListener(e,t){let r=He[e];if(!r)throw new Error(`Unsupported DOM event: ${e}`);let a=n(o=>{let s=o.composedPath()[0]??o.target;if(!f(s))return;let i=s,p=o,u={target:j(s),pageX:p.clientX,pageY:p.clientY};(r==="input"||r==="change")&&(i.type==="checkbox"||i.type==="radio"?u.value=i.checked:i.type==="range"?u.value=Number(i.value):u.text=i.value??s.textContent??""),t({eventName:e,nativeEvent:u})},"callback");return document.addEventListener(r,a,true),{remove:n(()=>document.removeEventListener(r,a,true),"remove")}}}}}n(Ee,"resolveDOMEventEmitter");var F=new Map,Oe=0;function Re(e){for(let[t,r]of Object.entries(e)){let a=t.startsWith("@buoy-gg/")?t.replace(/\/web$/,""):`@buoy-gg/${t}`;F.get(a)!==r&&(F.set(a,r),Oe++)}}n(Re,"registerToolModules");function U(e){return F.get(e)??null}n(U,"getRegisteredToolModule");function Te(){return Oe}n(Te,"getToolModuleVersion");function je(e){let t=U(e);if(!t)throw new Error(`Register ${e} with createWebTools before opening tools that use it.`);return t}n(je,"loadToolModule");export{We as a,D as b,Ie as c,qe as d,xe as e,Ce as f,Me as g,Pe as h,ke as i,Ae as j,De as k,Ne as l,ae as m,Le as n,_e as o,Be as p,Ve as q,x as r,Fe as s,z as t,H as u,G as v,X as w,Y as x,Q as y,Z as z,ee as A,R as B,A as C,te as D,re as E,ne as F,le as G,d as H,L as I,_ as J,v as K,pe as L,V as M,de as N,fe as O,he as P,ye as Q,be as R,ge as S,f as T,j as U,ve as V,me as W,Se as X,Ee as Y,Re as Z,U as _,Te as $,je as aa};
|
|
1
|
+
"use client";import{d as c}from"./chunk-AHVO74UQ.mjs";import{a as n,b as $e}from"./chunk-T6T3FEMU.mjs";var xe=n(e=>{if(e===null)return"null";if(e===void 0)return"undefined";if(Array.isArray(e))return"array";let t=typeof e;return t==="object"?e instanceof Date?"date":e instanceof RegExp?"regexp":e instanceof Map?"map":e instanceof Set?"set":e instanceof Error?"error":"object":t},"getValueType"),Me=n(e=>{let t=typeof e;return e==null||t==="string"||t==="number"||t==="boolean"||t==="bigint"||t==="symbol"},"isPrimitive"),Pe=n(e=>{try{return JSON.stringify(e),true}catch{return false}},"isJsonSerializable"),Ce=n(e=>{try{return JSON.parse(e),true}catch{return false}},"isValidJson"),ke=n(e=>{if(e===null)return"null";if(e===void 0)return"undefined";try{return e.constructor?.name||typeof e}catch{return typeof e}},"getConstructorName"),Ae=n(e=>e==null?true:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:false,"isEmpty"),De=n(e=>{if(Array.isArray(e)){let t=e.length;return t===0?"empty array":t===1?"1 item":`${t} items`}if(e&&typeof e=="object"){let t=Object.keys(e).length;return t===0?"empty object":t===1?"1 key":`${t} keys`}if(typeof e=="string"){let t=e.length;return t===0?"empty string":t===1?"1 character":`${t} characters`}return""},"getValueSize"),Ne=n(e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&e.constructor===Object,"isPlainObject");var Le=n(e=>{if(e==null)return e;if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},"parseValue"),_e=n(e=>e===null?"null":e===void 0?"undefined":typeof e=="string"?`"${e}"`:typeof e=="boolean"?e?"true":"false":typeof e=="number"?String(e):typeof e=="function"?`[Function: ${e.name||"anonymous"}]`:typeof e=="object"?Array.isArray(e)?`[Array: ${e.length} items]`:`{Object: ${Object.keys(e).length} keys}`:String(e),"formatValue"),Be=n(e=>{if(e===null)return c.dataTypes.null;if(e===void 0)return c.dataTypes.undefined;switch(typeof e){case"string":return c.dataTypes.string;case"number":return c.dataTypes.number;case"boolean":return c.dataTypes.boolean;case"function":return c.dataTypes.function;case"object":return Array.isArray(e)?c.dataTypes.array:c.dataTypes.object;default:return c.primary}},"getTypeColor"),Ve=n((e,t)=>e.length<=t?e:e.slice(0,t-3)+"...","truncateText"),x=n((e,t="")=>{let r={};return e==null?r:typeof e!="object"?(r[t||"root"]=e,r):(Array.isArray(e)?e.forEach((a,o)=>{let s=t?`${t}[${o}]`:`[${o}]`;typeof a=="object"&&a!==null?Object.assign(r,x(a,s)):r[s]=a}):Object.keys(e).forEach(a=>{let o=t?`${t}.${a}`:a,s=e[a];typeof s=="object"&&s!==null?Object.assign(r,x(s,o)):r[o]=s}),r)},"flattenObject"),Fe=n(e=>e.length===0?"root":e.map((t,r)=>typeof t=="number"?`[${t}]`:r===0?t:`.${t}`).join(""),"formatPath");var Ue={log:n(()=>{},"log"),warn:n(()=>{},"warn"),error:n((...e)=>{console.error("[Buoy]","[optional-module]",...e)},"error")},y=new Map,m=new Map,W=new Set;async function q(e,t={}){if(y.has(e))return y.get(e);let r={...Ue,...t.logger??{}};m.has(e)||m.set(e,(async()=>{try{let o=await J(e,t),s=o?.default??o;return y.set(e,s),r.log("Loaded optional module",e),s}catch(o){return r.log("Optional module unavailable",e,o),y.set(e,null),null}})());let a=await m.get(e);return m.delete(e),!a&&t.warnOnceKey&&!W.has(t.warnOnceKey)&&(W.add(t.warnOnceKey),r.warn(t.warningMessage??`Module '${e}' not found.`)),a}n(q,"loadOptionalModule");var z=(()=>{try{return new Function("moduleName","return import(moduleName);")}catch{return null}})(),I=(()=>{try{return new Function("return typeof require === 'function' ? require : undefined;")()}catch{return}})();async function J(e,t){if(t.loader)return await Promise.resolve(t.loader());if(z)return z(e);if(I)return I(e);throw new Error(`No dynamic loader available for optional module '${e}'.`)}n(J,"loadModuleWithFallback");function H(e){return y.has(e)?y.get(e):null}n(H,"getCachedOptionalModule");var G="__buoyRenderCaptureProvider";function M(){return globalThis}n(M,"providerHost");function K(e){M()[G]=e}n(K,"setRenderCaptureProvider");function X(){return M()[G]??null}n(X,"getRenderCaptureProvider");var g=new Map,P=new Set;function C(){P.forEach(e=>{try{e()}catch{}})}n(C,"notify");function Y(e){return g.set(e.id,e),C(),()=>{g.get(e.id)===e&&(g.delete(e.id),C())}}n(Y,"registerStateSnapshotProvider");function Q(){return Array.from(g.values())}n(Q,"getStateSnapshotProviders");function Z(e){return g.get(e)??null}n(Z,"getStateSnapshotProvider");function ee(e){return P.add(e),()=>{P.delete(e)}}n(ee,"subscribeToStateSnapshotProviders");function S(){return null}n(S,"loadDevSettings");function E(){return null}n(E,"loadExpoUpdates");function O(){return typeof window>"u"?null:()=>window.location.reload()}n(O,"loadBrowserReload");function R(e="auto"){return e==="browser"?O()?"browser":null:e==="auto"&&O()?"browser":e==="dev-settings"?S()?"dev-settings":null:e==="expo-updates"?E()?"expo-updates":null:$e&&S()?"dev-settings":E()?"expo-updates":null}n(R,"resolveReloadStrategy");function k(e){return e==="browser"?"[buoy] Browser reload requires a browser window.":e==="dev-settings"?"[buoy] DevSettings.reload() unavailable \u2014 strategy 'dev-settings' requires React Native dev mode.":e==="expo-updates"?"[buoy] expo-updates not installed \u2014 strategy 'expo-updates' requires the host app to add the dependency.":"[buoy] No reload mechanism available. Run in __DEV__ or install expo-updates."}n(k,"unavailableMessage");async function A(e="auto",t="buoy reload"){let r=R(e);if(!r)throw new Error(k(e));return r==="browser"?O()():r==="dev-settings"?S().reload(t):await E().reloadAsync(),await new Promise(()=>{})}n(A,"reloadApp");var te=250;function re(e){let t=e?.strategy??"auto",r=R(t);if(!r)throw new Error(k(t));let a=Math.max(0,e?.delayMs??te),o=e?.reason??"buoy remote reload";return setTimeout(()=>{A(r,o).catch(()=>{})},a),{strategy:r,delayMs:a}}n(re,"scheduleReloadApp");function ne(){return null}n(ne,"getDevServerOrigin");function ae(){let e=globalThis.__buoyRealNow;return typeof e=="function"?e():Date.now()}n(ae,"realNow");var oe=class Xe{constructor(){this.listeners=new Set;this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}getListenerCount(){return this.listeners.size}notify(...t){this.listeners.forEach(r=>{r(...t)})}onSubscribe(){}onUnsubscribe(){}};n(oe,"Subscribable");var We=oe;var se=class Ye{constructor(){this.listeners=new Set}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(t){this.listeners.forEach(r=>{try{r(t)}catch{}})}};n(se,"SubscriberCountNotifier");var qe=se,D=new qe,ze=n(e=>D.subscribe(e),"subscribeToSubscriberCountChanges"),Ie=n(e=>D.notify(e),"notifySubscriberCountChange");import{useSyncExternalStore as ie}from"react";var l,w=new Set,N,ue;function le(e){return l=e,()=>{l===e&&(l=void 0)}}n(le,"registerBrowserRouter");function d(){return typeof location>"u"?"/":location.href}n(d,"getBrowserHref");function L(e=d()){let t=new URL(e,"http://localhost"),r=t.hash.startsWith("#/")?new URL(t.hash.slice(1),t.origin):t;return r.pathname||(r.pathname="/"),r}n(L,"getBrowserRouteURL");var b;function _(e){if(!w.size&&typeof window<"u"){let t=window.history,r=n(o=>{for(let s of[...w])try{s({href:d(),kind:o})}catch{}},"emit");if(b)b.active=true;else{let o=t.pushState,s=t.replaceState,i={push:o,replace:s,active:true},p=n(function(...h){let $=Reflect.apply(o,this,h);return i.active&&r("push"),$},"wrappedPush"),u=n(function(...h){let $=Reflect.apply(s,this,h);return i.active&&r("replace"),$},"wrappedReplace");t.pushState=p,t.replaceState=u,b=i,ue=n(()=>{t.pushState!==p||t.replaceState!==u||(t.pushState=o,t.replaceState=s,b=void 0)},"unwrap")}let a=n(()=>r("pop"),"pop");window.addEventListener("popstate",a),window.addEventListener("hashchange",a),N=n(()=>{b&&(b.active=false),ue?.(),window.removeEventListener("popstate",a),window.removeEventListener("hashchange",a),N=void 0},"detach")}return w.add(e),()=>{w.delete(e),w.size||N?.()}}n(_,"subscribeBrowserNavigation");function B(e){let t=typeof e=="string"?e:e.pathname,r=new URL(t,d());if(r.origin!==window.location.origin)throw new Error("Tool navigation must stay on the current origin.");if(typeof e!="string")for(let[a,o]of Object.entries(e.params??{}))r.searchParams.set(a,String(o));return`${r.pathname}${r.search}${r.hash}`}n(B,"pathFor");var v={push(e){let t=B(e);if(l)return l.push(t);window.history.pushState(null,"",window.location.hash.startsWith("#/")?`#${t}`:t),window.dispatchEvent(new PopStateEvent("popstate",{state:window.history.state}))},replace(e){let t=B(e);if(l)return l.replace(t);window.history.replaceState(window.history.state,"",window.location.hash.startsWith("#/")?`#${t}`:t),window.dispatchEvent(new PopStateEvent("popstate",{state:window.history.state}))},back(){l?l.back():window.history.back()},canGoBack(){return l?.canGoBack?.()??(typeof window<"u"&&window.history.length>1)},navigate(e){v.push(e)},setParams(e){v.replace({pathname:d(),params:e})},dismiss(e=1){window.history.go(-e)},dismissAll(){throw new Error("Use the captured browser history to select a destination.")}};var ce=n(e=>_(e),"subscribe"),T=L;function pe(){return v}n(pe,"useSafeRouter");function V(){return ie(ce,d,()=>"/"),T().pathname}n(V,"useSafePathname");function de(){return V().split("/").filter(Boolean)}n(de,"useSafeSegments");function fe(){return ie(ce,d,()=>"/"),Object.fromEntries(T().searchParams)}n(fe,"useSafeGlobalSearchParams");function he(){return typeof window>"u"?null:v}n(he,"getSafeRouter");function ye(){return T().pathname}n(ye,"getSafeCurrentPathname");function be(){let e=T();return{pathname:e.pathname,href:`${e.pathname}${e.search}${e.hash}`,segments:e.pathname.split("/").filter(Boolean)}}n(be,"getSafeCurrentRoute");function ge(){return false}n(ge,"isExpoRouterAvailable");var we=new WeakMap,Je=1;function f(e){return!!e&&typeof e=="object"&&e.nodeType===1&&typeof e.getBoundingClientRect=="function"}n(f,"isDOMElement");function j(e){if(!f(e))return null;let t=we.get(e);return t===void 0&&(t=Je++,we.set(e,t)),t}n(j,"getDOMNodeHandle");function ve(e){if(!f(e))return null;let t=Object.keys(e).find(r=>r.startsWith("__reactFiber$"));return t?e[t]:null}n(ve,"getDOMFiber");function me(e,t){if(!f(e)||!t)return t;let r=e,a=e.tagName.toLowerCase(),o=a==="input"&&(r.type==="checkbox"||r.type==="radio"),s=a==="input"&&r.type==="range",i=a==="textarea"||a==="select"||a==="input"&&!o&&!s&&!["button","submit","reset","file","hidden"].includes(r.type),p=n(u=>{if(o){r.checked!==!!u&&r.click();return}let h=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),"value")?.set;h?h.call(r,String(u)):r.value=String(u),r.dispatchEvent(new Event("input",{bubbles:true})),r.dispatchEvent(new Event("change",{bubbles:true}))},"setValue");return{...t,__buoyDevToolsRoot:t.__buoyDevToolsRoot||t["data-buoy-root"]!==void 0,testID:t.testID??t["data-testid"],nativeID:t.nativeID??t.id,accessibilityLabel:t.accessibilityLabel??t["aria-label"],accessibilityRole:t.accessibilityRole??t.role??(a==="button"?"button":a==="a"?"link":o?r.type:i?"textbox":s?"slider":void 0),onPress:t.onPress??(typeof t.onClick=="function"||a==="button"||a==="a"?()=>r.click():void 0),...o||s?{onValueChange:p,value:o?r.checked:Number(r.value),...s?{minimumValue:Number(r.min||0),maximumValue:Number(r.max||100)}:{}}:{},...i?{onChangeText:p,value:r.value}:{}}}n(me,"getDOMControlProps");function Se(e){return f(e)?{__nativeTag:j(e),measure(t){let r=e.getBoundingClientRect();t(r.x,r.y,r.width,r.height,r.x,r.y)},measureInWindow(t){let r=e.getBoundingClientRect();t(r.x,r.y,r.width,r.height)},requestTVFocus(){e.focus()},focus(){e.focus()}}:null}n(Se,"getDOMPublicInstance");var He={topFocus:"focus",topBlur:"blur",topTouchStart:"pointerdown",topTouchMove:"pointermove",topTouchEnd:"pointerup",topTouchCancel:"pointercancel",topChange:"input",topValueChange:"input",topSlidingComplete:"change"};function Ee(){return typeof document>"u"?{emitter:null,reason:"DOM events are unavailable during server rendering."}:{reason:null,emitter:{addListener(e,t){let r=He[e];if(!r)throw new Error(`Unsupported DOM event: ${e}`);let a=n(o=>{let s=o.composedPath()[0]??o.target;if(!f(s))return;let i=s,p=o,u={target:j(s),pageX:p.clientX,pageY:p.clientY};(r==="input"||r==="change")&&(i.type==="checkbox"||i.type==="radio"?u.value=i.checked:i.type==="range"?u.value=Number(i.value):u.text=i.value??s.textContent??""),t({eventName:e,nativeEvent:u})},"callback");return document.addEventListener(r,a,true),{remove:n(()=>document.removeEventListener(r,a,true),"remove")}}}}}n(Ee,"resolveDOMEventEmitter");var F=new Map,Oe=0;function Re(e){for(let[t,r]of Object.entries(e)){let a=t.startsWith("@buoy-gg/")?t.replace(/\/web$/,""):`@buoy-gg/${t}`;F.get(a)!==r&&(F.set(a,r),Oe++)}}n(Re,"registerToolModules");function U(e){return F.get(e)??null}n(U,"getRegisteredToolModule");function Te(){return Oe}n(Te,"getToolModuleVersion");function je(e){let t=U(e);if(!t)throw new Error(`Register ${e} with createWebTools before opening tools that use it.`);return t}n(je,"loadToolModule");export{We as a,D as b,ze as c,Ie as d,xe as e,Me as f,Pe as g,Ce as h,ke as i,Ae as j,De as k,Ne as l,ae as m,Le as n,_e as o,Be as p,Ve as q,x as r,Fe as s,q as t,H as u,K as v,X as w,Y as x,Q as y,Z as z,ee as A,R as B,A as C,te as D,re as E,ne as F,le as G,d as H,L as I,_ as J,v as K,pe as L,V as M,de as N,fe as O,he as P,ye as Q,be as R,ge as S,f as T,j as U,ve as V,me as W,Se as X,Ee as Y,Re as Z,U as _,Te as $,je as aa};
|
package/lib/web/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";import{a as Ko,b as qo,c as Jo,d as Xo,e as Qo,f as Zo,g as en,h as tn,i as an}from"./chunks/chunk-3HELV44Y.mjs";import{a as sn,b as rn,c as on,d as nn,e as ln,f as cn,g as un,h as dn}from"./chunks/chunk-G27JNYZ3.mjs";import{$ as hn,A as gn,B as pn,C as fn,D as bn,E as yn,F as mn,G as Sn,J as vn,K as Cn,L as Tn,M as wn,N as xn,O as kn,P as In,Q as _n,R as An,S as On,Z as En,_ as Pn,a as Ja,b as Rn,c as Ln,d as ze,e as $n,f as Bn,g as Xa,h as Mn,i as Nn,j as Dn,k as zn,l as Fn,m as Ft,n as Wn,o as jn,p as Hn,q as Un,r as Gn,s as Vn,t as Yn,u as Kn,v as qn,w as Jn,x as Xn,y as Qn,z as Zn}from"./chunks/chunk-GMM6TGFO.mjs";import"./chunks/chunk-VAR5UK6J.mjs";import{a as ei,d as ti,f as Wt}from"./chunks/chunk-NOSWH3E2.mjs";import{$ as ai,$a as si,$b as ri,A as oi,Aa as ni,Ab as ii,Ac as li,B as ci,Ba as ui,Bb as di,Bc as hi,C as gi,Ca as pi,Cb as Qa,Cc as fi,D as bi,Da as yi,Db as mi,Dc as Za,E as Si,Ea as vi,Eb as Ci,Ec as Ti,F as wi,Fa as xi,Fb as ki,Fc as Ii,G as _i,Ga as Ai,Gb as Oi,Gc as Ei,H as Pi,Ha as Ri,Hb as Li,I as $i,Ia as Bi,Ib as Mi,J as es,Ja as Ni,Jb as Di,K as zi,Ka as Fi,Kb as Wi,L as ji,La as Hi,Lb as Ui,M as Gi,Ma as Vi,Mb as Yi,N as Ki,Na as qi,Nb as Ji,O as Xi,Oa as Qi,Ob as Zi,P as el,Pa as tl,Pb as al,Q as sl,Qa as rl,Qb as ol,R as nl,Ra as il,Rb as ll,S as cl,Sa as ul,Sb as dl,T as hl,Ta as gl,Tb as pl,U as fl,Ua as bl,Ub as yl,V as ml,Va as Sl,Vb as vl,W as Cl,Wa as Tl,Wb as wl,X as xl,Xa as kl,Xb as Il,Y as _l,Ya as Al,Yb as Ol,Z as El,Za as Pl,Zb as Rl,_ as Ll,_a as $l,_b as Bl,a as Ml,aa as Nl,ab as Dl,ac as zl,b as Fl,ba as Wl,bb as jl,bc as Hl,c as Ul,ca as Gl,cb as Vl,cc as Yl,d as Kl,da as ql,db as Jl,dc as Xl,e as Ql,ea as Zl,eb as ec,ec as tc,f as ac,fa as sc,fb as rc,fc as oc,g as nc,ga as ic,gb as lc,gc as cc,h as uc,ha as dc,hb as hc,hc as gc,i as ts,ia as pc,ib as fc,ic as bc,j as yc,ja as mc,jb as Sc,jc as vc,k as Cc,ka as Tc,kb as wc,kc as xc,l as kc,la as Ic,lb as _c,lc as Ac,m as Oc,ma as Ec,mb as Pc,mc as Rc,n as Lc,na as $c,nb as Bc,nc as Mc,o as Nc,oa as Dc,ob as zc,oc as Fc,p as le,pa as Wc,pb as jc,pc as Hc,q as K,qa as Uc,qb as Gc,qc as Vc,r as xe,ra as Yc,rb as Kc,rc as qc,s as Fe,sa as Jc,sb as Xc,sc as Qc,t as as,ta as Zc,tb as eu,tc as tu,u as au,ua as su,ub as ru,uc as ou,v as nu,va as iu,vb as lu,vc as cu,w as uu,wa as du,wb as hu,wc as gu,x as pu,xa as fu,xb as bu,xc as yu,y as mu,ya as Su,yb as vu,yc as jt,z as Cu,za as Tu,zb as ss,zc as wu}from"./chunks/chunk-UQRRKDKX.mjs";import{a as xu}from"./chunks/chunk-HIAN3HBD.mjs";import{a as ku,b as Iu,c as _u,d as Au,e as Ou,f as Eu,g as Pu,h as Ru,i as Lu,j as $u,k as Bu,l as Mu,m as Nu,n as Du,o as zu,p as Fu}from"./chunks/chunk-4YLP5MMN.mjs";import{a as d,b as rs}from"./chunks/chunk-GF5C5DVX.mjs";import{a as Wu,b as ju}from"./chunks/chunk-7CBB7NEY.mjs";import{a as Hu,b as Uu,c as Gu,d as Vu,e as Yu,f as Ku,g as qu,h as Ju,i as Xu,j as Qu,k as Zu,l as ed}from"./chunks/chunk-4HIK66DZ.mjs";import{$ as td,$a as ad,$b as os,$c as sd,Aa as rd,Ab as od,Ac as nd,B as id,Ba as ld,Bb as cd,Bc as ud,C as dd,Ca as hd,Cb as gd,Cc as pd,D as fd,Da as bd,Db as yd,Dc as md,E as Sd,Ea as vd,Eb as Cd,Ec as Td,Fa as wd,Fb as xd,Fc as kd,Ga as Id,Gb as _d,Gc as Ht,H as Ad,Ha as Od,Hb as Ed,Hc as Pd,Ia as Rd,Ib as Ld,Ic as $d,J as Bd,Ja as Md,Jb as Nd,Jc as Dd,Ka as zd,Kb as Fd,Kc as Wd,La as jd,Lb as Hd,Lc as Ud,Ma as Gd,Mb as Vd,Mc as Yd,N as Kd,Na as qd,Nb as Jd,Nc as Xd,O as Qd,Oa as Zd,Ob as eh,Oc as th,P as ah,Pa as sh,Pb as rh,Pc as oh,Q as nh,Qa as ih,Qb as lh,Qc as ch,R as uh,Ra as dh,Rb as hh,Rc as gh,S as ph,Sa as fh,Sb as bh,Sc as yh,T as mh,Ta as Sh,Tb as vh,Tc as Ch,U as Th,Ua as wh,Ub as ns,Uc as xh,V as kh,Va as Ih,Vb as _h,Vc as Ah,W as Oh,Wa as Eh,Wb as Ph,Wc as Rh,X as Lh,Xa as $h,Xb as Bh,Xc as Mh,Y as Nh,Ya as Dh,Yb as zh,Yc as Fh,Z as Wh,Za as jh,Zb as Hh,Zc as Uh,_ as Gh,_a as Vh,_b as Yh,_c as Kh,a as qh,aa as Jh,ab as Xh,ac as Qh,ad as Zh,b as eg,ba as tg,bb as ag,bc as sg,bd as rg,c as og,ca as ng,cb as ig,cc as lg,cd as cg,d as ug,da as dg,db as hg,dc as is,dd as gg,e as pg,ea as fg,eb as bg,ec as yg,ed as mg,f as Sg,fa as vg,fb as Cg,fc as Tg,fd as wg,g as xg,ga as kg,gb as Ig,gc as _g,gd as Ag,h as Og,ha as Eg,hb as Pg,hc as Rg,hd as Lg,i as $g,ia as Bg,ib as Mg,ic as Ng,id as Dg,j as zg,ja as Fg,jb as Wg,jc as jg,jd as Hg,k as Ug,ka as Gg,kb as Vg,kc as Yg,kd as Kg,l as qg,la as Jg,lb as Xg,lc as Qg,ld as Zg,m as ep,ma as tp,mb as ap,mc as sp,md as rp,n as op,na as np,nb as ip,nc as lp,nd as cp,o as up,oa as dp,ob as hp,oc as gp,od as pp,p as fp,pa as bp,pb as yp,pc as mp,pd as Sp,q as vp,qa as Cp,qb as Tp,qc as wp,qd as xp,r as kp,ra as Ip,rb as _p,rc as Ap,rd as Op,s as Ep,sa as Pp,sb as Rp,sc as Lp,sd as $p,t as Bp,ta as Mp,tb as Np,tc as Dp,u as zp,ua as Fp,ub as Wp,uc as jp,va as Hp,vb as Up,vc as Gp,wa as Vp,wb as Yp,wc as Kp,xa as qp,xb as Jp,xc as Xp,ya as Qp,yb as Zp,yc as ef,za as tf,zb as af,zc as sf}from"./chunks/chunk-CJTGUGMQ.mjs";import{a as st,d as w,e as rf,f as Y,g as of}from"./chunks/chunk-AHVO74UQ.mjs";import{a as nf,b as lf,c as cf,d as uf,e as df}from"./chunks/chunk-RMLVR5LI.mjs";import{a as Se,b as rt,c as ls,d as j,e as hf,f as gf}from"./chunks/chunk-2STKTXD3.mjs";import{H as pf,J as We,a as k,b as F,d as ot,g as ff,h as bf,j as yf,r as Ut}from"./chunks/chunk-5G6RSRP4.mjs";import{a as Gt,c as mf}from"./chunks/chunk-SBYYOE2T.mjs";import{a as n}from"./chunks/chunk-T6T3FEMU.mjs";var cs=class Mb extends Ja{constructor(t){super();this.events=[];this.arrayListeners=new Set;this.captureSuppressed=false;this.clearListeners=new Set;this.maxEvents=t.maxEvents??500,this.storeName=t.storeName,Promise.resolve().then(()=>{let a=n(()=>{le().status==="locked"?(this.stopCapturing(),this.events=[],this.notifyArrayListeners()):this.getTotalSubscriberCount()>0&&!this.captureSuppressed&&!this.isCapturing()&&this.startCapturing()},"reconcile");Fe(a),a()})}onSubscribe(){this.getTotalSubscriberCount()===1&&!this.captureSuppressed&&le().status!=="locked"&&this.startCapturing(),ze(this.storeName)}onUnsubscribe(){this.getTotalSubscriberCount()===0&&this.stopCapturing(),ze(this.storeName)}getTotalSubscriberCount(){return this.listeners.size+this.arrayListeners.size}subscribeToEvents(t){let a=this.getTotalSubscriberCount()===0;return this.arrayListeners.add(t),a&&!this.captureSuppressed&&le().status!=="locked"&&this.startCapturing(),ze(this.storeName),t(this.getEvents()),()=>{this.arrayListeners.delete(t),this.getTotalSubscriberCount()===0&&this.stopCapturing(),ze(this.storeName)}}onEvent(t){return this.subscribe(t)}addEvent(t){le().status!=="locked"&&(this.events=[t,...this.events].slice(0,this.maxEvents),K()&&this.notify(t),this.notifyArrayListeners())}notifyArrayListeners(){let t=this.getEvents();this.arrayListeners.forEach(a=>{try{a(t)}catch{}})}getEvents(){return K()?this.events:[]}getEventCount(){return K()?this.events.length:0}clearEvents(){this.events=[],this.notifyArrayListeners(),this.clearListeners.forEach(t=>{try{t()}catch{}})}onClear(t){return this.clearListeners.add(t),()=>{this.clearListeners.delete(t)}}disableCapture(){this.captureSuppressed=true,this.isCapturing()&&this.stopCapturing()}replaceEvents(t){this.events=this.dedupeById(t).slice(0,this.maxEvents),this.notifyArrayListeners()}dedupeById(t){let a=new Set,s=[];for(let r of t){let o=r?.id;if(o==null){s.push(r);continue}a.has(o)||(a.add(o),s.push(r))}return s}setMaxEvents(t){this.maxEvents=t,this.events.length>t&&(this.events=this.events.slice(0,t),this.notifyArrayListeners())}getSubscriberCounts(){return{eventCallbacks:this.listeners.size,arrayListeners:this.arrayListeners.size,total:this.getTotalSubscriberCount()}}};n(cs,"BaseEventStore");var Sf=cs;import{useEffect as vf,useMemo as Cf,useState as Tf}from"react";var wf=[{value:"buoy.gg/api/license",mode:"contains"},{value:"api.keygen.sh",mode:"contains"}];function Vt(e,t){let a=e.toLowerCase(),s=t.value.toLowerCase();if(t.mode==="contains")return a.includes(s);try{let r=new URL(e);return s.startsWith("/")?r.pathname.toLowerCase()===s:s.startsWith("http://")||s.startsWith("https://")?`${r.origin}${r.pathname}`.toLowerCase()===s:r.host.toLowerCase()===s}catch{return a===s}}n(Vt,"urlMatchesIgnoredPattern");function us(e,t){return!e||t.length===0?false:t.some(a=>Vt(e,a))}n(us,"isUrlIgnored");var ds=wf;function Yt(e){if(!Array.isArray(e))return[];let t=[];for(let a of e)if(typeof a=="string"&&a.trim())t.push({value:a,mode:"contains"});else if(a&&typeof a=="object"&&typeof a.value=="string"){let s=a;t.push({value:s.value,mode:s.mode==="exact"?"exact":"contains"})}return t}n(Yt,"migratePatterns");function Kt(e){let t=[...e];for(let a of ds)t.some(s=>s.value===a.value)||t.push({...a});return t}n(Kt,"ensureDefaults");var hs=class Db{constructor(){this.patterns=Kt(ds.map(t=>({...t})));this.teamPatterns=[];this.merged=this.patterns;this.listeners=new Set;this.loaded=false;this.loadPromise=null;this.dirty=false}getPatterns(){return this.merged}isTeamOnly(t){return!this.patterns.some(a=>a.value===t)&&this.teamPatterns.some(a=>a.value===t)}setTeamPatterns(t){this.teamPatterns=Yt(t),this.remerge(),this.emit()}reload(){return this.loaded=false,this.loadPromise=null,this.dirty=false,this.ensureLoaded()}remerge(){let t=this.teamPatterns.filter(a=>!this.patterns.some(s=>s.value===a.value));this.merged=t.length>0?[...this.patterns,...t]:this.patterns}subscribe(t){return this.listeners.add(t),this.ensureLoaded(),()=>{this.listeners.delete(t)}}emit(){this.listeners.forEach(t=>t())}ensureLoaded(){return this.loaded?Promise.resolve():this.loadPromise?this.loadPromise:(this.loadPromise=(async()=>{try{let t=await j.getItem(Se.network.ignoredDomains());if(t&&!this.dirty){let a=Kt(Yt(JSON.parse(t)));this.patterns=a,this.remerge()}}catch{}finally{this.loaded=true,this.emit()}})(),this.loadPromise)}persist(){j.setItem(Se.network.ignoredDomains(),JSON.stringify(this.patterns)).catch(()=>{})}commit(t){this.dirty=true,this.patterns=t,this.remerge(),this.emit(),this.persist()}add(t){let a=t.value.trim();a&&(this.patterns.some(s=>s.value===a)||this.commit([...this.patterns,{value:a,mode:t.mode}]))}remove(t){this.patterns.some(a=>a.value===t)&&this.commit(this.patterns.filter(a=>a.value!==t))}toggle(t){let a=t.trim();a&&this.commit(this.patterns.some(s=>s.value===a)?this.patterns.filter(s=>s.value!==a):[...this.patterns,{value:a,mode:"contains"}])}toggleMode(t){this.patterns.some(a=>a.value===t)&&this.commit(this.patterns.map(a=>a.value===t?{...a,mode:a.mode==="contains"?"exact":"contains"}:a))}};n(hs,"IgnoredPatternsStore");var xf=hs,X=new xf,kf=n(e=>X.add(e),"addPattern"),If=n(e=>X.remove(e),"removePattern"),_f=n(e=>X.toggle(e),"togglePattern"),Af=n(e=>X.toggleMode(e),"togglePatternMode"),Of=n(e=>X.isTeamOnly(e),"isTeamOnlyPattern");function gs(){let[e,t]=Tf(()=>X.getPatterns());vf(()=>X.subscribe(()=>{t(X.getPatterns())}),[]);let a=Cf(()=>new Set(e.map(s=>s.value)),[e]);return{patterns:e,values:a,add:kf,remove:If,toggle:_f,toggleMode:Af,isTeamOnly:Of}}n(gs,"useIgnoredPatterns");import{useSyncExternalStore as Ef}from"react";var nt={},qt=new Map,Jt=new Set,je=[];function ps(e){if(!e)return je;try{let t=JSON.parse(e);if(!Array.isArray(t))return je;let a=t.map(s=>typeof s=="string"?s:s&&typeof s.value=="string"?s.value:"").map(s=>s.trim()).filter(Boolean);return a.length?[...new Set(a)]:je}catch{return je}}n(ps,"parseList");var it={set(e){Object.keys({...nt,...e}).some(t=>nt[t]!==e[t])&&(nt=e,qt.clear(),Jt.forEach(t=>t()))},getList(e){let t=qt.get(e);return t||(t=ps(nt[e]),qt.set(e,t)),t},subscribe(e){return Jt.add(e),()=>Jt.delete(e)}};function fs(e){return Ef(it.subscribe,()=>it.getList(e),()=>je)}n(fs,"useTeamList");function bs(e){typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):setTimeout(e,0)}n(bs,"scheduleFrame");function ys(e){let t=e.id,a=e.order??"append",s=e.coalesce??"sync",r=e.flushMinIntervalMs??150,o=e.max,i=[],l=false,c=e.firstId??1,u=0,y=false,S=[],f=false;function m(){f||(f=true,Fe(()=>{le().status==="locked"&&(i=[]),V()}))}n(m,"observe");let C=new Set,A=new Set;function W(){for(let v of C)try{v()}catch{}}n(W,"fire");function V(){if(s==="sync"){W();return}y||(y=true,bs(()=>{y=false,W()}))}n(V,"emit");function M(v){return v.length<=o?v:a==="append"?v.slice(v.length-o):v.slice(0,o)}return n(M,"trim"),{id:t,subscribe(v){return m(),C.add(v),()=>{C.delete(v)}},getSnapshot(){return m(),K()?i:S},size(){return K()?i.length:0},add(v){m(),!(l||le().status==="locked")&&(a==="append"?i=i.length>=o?[...i.slice(i.length-o+1),v]:[...i,v]:i=i.length>=o?[v,...i.slice(0,o-1)]:[v,...i],V())},set(v){m(),K()&&(i=M(v),V())},update(v){m(),le().status!=="locked"&&(i=M(v(i)),V())},clear(){for(let v of A)try{v()}catch{}i.length!==0&&(i=[],V())},onClear(v){return A.add(v),()=>{A.delete(v)}},notify(){V()},flushSync(v=false){let se=Date.now();if(!(!v&&se-u<r)){u=se;try{let $=globalThis.__buoyFlushToolSync;if(!$)return;for(let Ye of $)Ye(t)}catch{}}},setPaused(v){l=v},isPaused(){return l},setMax(v){o=v;let se=M(i);se!==i&&(i=se,V())},getMax(){return o},allocId(){return c++},bumpIdAbove(v){v+1>c&&(c=v+1)},listenerCount(){return C.size}}}n(ys,"createToolStore");var ms=class Fb{constructor(t={}){this.items=[];this.itemListeners=new Set;this.clearListeners=new Set;this.idCounter=0;this.enabled=true;this.captureSuppressed=false;this.max=t.max??200}canRecord(){return this.enabled&&!this.captureSuppressed}nextId(){return`${Date.now()}-${++this.idCounter}`}push(t){this.items=[t,...this.items].slice(0,this.max)}record(t){this.push(t),this.notifyListeners()}setItems(t){this.items=t.slice(0,this.max),this.notifyListeners()}getAll(){return[...this.items]}getById(t){return this.items.find(a=>a.id===t)}get size(){return this.items.length}clear(){this.items=[],this.notifyListeners(),this.clearListeners.forEach(t=>{try{t()}catch{}})}onClear(t){return this.clearListeners.add(t),()=>{this.clearListeners.delete(t)}}disableCapture(){this.captureSuppressed=true}isCaptureSuppressed(){return this.captureSuppressed}replaceAll(t){return this.enabled?(this.setItems(t),true):false}hydrateById(t,a){let s=this.items.findIndex(r=>r.id===t);s!==-1&&(this.items=[...this.items.slice(0,s),{...this.items[s],...a},...this.items.slice(s+1)],this.notifyListeners())}setEnabled(t){this.enabled=t}getEnabled(){return this.enabled}setMax(t){this.max=t,this.items.length>t&&(this.items=this.items.slice(0,t),this.notifyListeners())}getMax(){return this.max}subscribe(t){return this.itemListeners.add(t),()=>{this.itemListeners.delete(t)}}notifyListeners(){let t=this.getAll();this.itemListeners.forEach(a=>a(t))}get listenerCount(){return this.itemListeners.size}};n(ms,"ChangeLog");var Pf=ms;var ve=n(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),Rf=["id","lineId","key","uuid","_id","slug","name"];function lt(e){if(!e.length||!e.every(ve))return;let t=e[0];for(let a of Rf){if(!(a in t))continue;let s=e.map(r=>r[a]);if(s.every(r=>typeof r=="string"||typeof r=="number")&&new Set(s.map(String)).size===s.length)return a}}n(lt,"identityField");function Ss(e,t,a,s){let r=s[t];return typeof r=="string"||typeof r=="number"?String(r)!==a?{ok:false,error:`The new item is addressed as \`${a}\` but carries \`${t}\`: ${JSON.stringify(r)}. Use the same value for both \u2014 address it by the id it carries.`}:{ok:true,value:r}:e.every(o=>typeof o[t]=="number")&&a.trim()!==""&&String(Number(a))===a?{ok:true,value:Number(a)}:{ok:true,value:a}}n(Ss,"identityForAdd");function ct(e,t,a="",s=[]){if(Array.isArray(e)&&ve(t)){let r=lt(e);if(!r)return{patch:t,notes:s};let o=new Map(e.map(y=>[String(y[r]),y])),i=e.slice(),l=0,c=0,u=0;for(let[y,S]of Object.entries(t)){let f=i.findIndex(m=>String(m[r])===y);if(S===null){if(f===-1)return{patch:t,notes:s};i.splice(f,1),l++}else if(f===-1){if(!ve(S))return{patch:t,notes:s};let m=Ss(e,r,y,S);if(!m.ok)return{patch:t,notes:s,error:m.error};i.push({...S,[r]:m.value}),u++}else{let m=ct(o.get(y),S,`${a}[${y}]`,s);if(m.error)return{patch:t,notes:s,error:m.error};let C=i[f];i[f]=ve(C)&&ve(m.patch)?{...C,...m.patch}:m.patch,c++}}return s.push(`${a||"(root)"}: addressed by \`${r}\` \u2014 ${c} changed, ${u} added, ${l} removed, ${i.length} item(s) remain`),{patch:i,notes:s}}if(ve(e)&&ve(t)){let r={};for(let[o,i]of Object.entries(t)){let l=a?`${a}.${o}`:o;if(!(o in e)){r[o]=i;continue}let c=ct(e[o],i,l,s);if(c.error)return{patch:t,notes:s,error:c.error};r[o]=c.patch}return{patch:r,notes:s}}return{patch:t,notes:s}}n(ct,"expandKeyedArrays");var ut=n(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),Xt=3,Lf=24,vs=40,dt=600;function ke(e,t=0){if(e===null)return"null";if(Array.isArray(e)){if(!e.length)return"unknown[]";if(t>=Xt)return"\u2026[]";let s=ke(e[0],t+1);return s.includes(" ")||s.endsWith("]")?`(${s})[]`:`${s}[]`}if(ut(e)){if(t>=Xt)return"{\u2026}";let s=Object.keys(e),r=s.slice(0,Lf),o=r.map(l=>`${l}: ${ke(e[l],t+1)}`).join(", "),i=s.length>r.length?`, +${s.length-r.length} more`:"";return`{${o}${i}}`}let a=typeof e;return a==="undefined"?"undefined":a==="function"?"function":a}n(ke,"shapeOf");function Ce(e,t="",a=[],s=0,r={visited:0}){if(s>Xt||a.length>=vs||r.visited>=dt)return a;if(Array.isArray(e)){let o=e[0];if(a.push({path:t||"(root)",length:e.length,...e.length?{item:ke(o)}:{}}),e.length&&ut(o))for(let[i,l]of Object.entries(o)){if(++r.visited>=dt)break;Ce(l,t?`${t}[].${i}`:`[].${i}`,a,s+1,r)}return a}if(ut(e))for(let[o,i]of Object.entries(e)){if(++r.visited>=dt)break;Ce(i,t?`${t}.${o}`:o,a,s+1,r)}return a}n(Ce,"listShapes");function Cs(e){let t={visited:0};return Ce(e,"",[],0,t).length>=vs||t.visited>=dt}n(Cs,"shapesWereTruncated");function Ts(e){return Ce(e).filter(t=>t.item===void 0).map(t=>t.path)}n(Ts,"unshapedLists");function ws(e){if(e===void 0)return;let t=Ce(e),a=ke(e);if(!(!t.length&&!ut(e)&&!Array.isArray(e)))return t.length?{shape:a,lists:t}:{shape:a}}n(ws,"shapeSummary");var te=n(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject");function xs(e,t,a=2e3){let s=[{node:e,path:""}],r=0;for(;s.length&&r<a;){let{node:o,path:i}=s.shift();if(r++,Array.isArray(o))o.slice(0,20).forEach((l,c)=>s.push({node:l,path:`${i}[${c}]`}));else if(te(o))for(let[l,c]of Object.entries(o)){let u=i?`${i}.${l}`:l;if(l===t)return u;(te(c)||Array.isArray(c))&&s.push({node:c,path:u})}}}n(xs,"findFieldPath");function Qt(e,t,a,s,r){let o=xs(e,r??a),i=s.slice(0,12).join(", ")||"(no fields)";return o?`No field "${a}" at "${t}" \u2014 did you mean path "${o}"? "${t}" has: ${i}.`:`No field "${a}" at "${t}". It has: ${i}.`}n(Qt,"missingFieldError");function Zt(e,t){let a=e;for(let s of t.split(".")){if(!te(a))return;a=a[s]}return a}n(Zt,"fieldOf");function ht(e){if(!e.trim())return;let t=[],a=0;for(;a<e.length;){if(e[a]==="."){a++;continue}if(e[a]==="["){let o=e.indexOf("]",a);if(o===-1)return;let i=e.slice(a+1,o);if(/^\d+$/.test(i))t.push({kind:"index",index:Number(i)});else{let l=i.indexOf("=");if(l<=0)return;t.push({kind:"match",field:i.slice(0,l).trim(),value:i.slice(l+1).trim()})}a=o+1;continue}let s=a;for(;s<e.length&&e[s]!=="."&&e[s]!=="[";)s++;let r=e.slice(a,s);if(!r)return;t.push({kind:"key",key:r}),a=s}return t.length?t:void 0}n(ht,"parsePath");function ks(e,t){let a=ht(t);if(!a)return{ok:false,error:`Could not read the path "${t}". Use dotted keys with optional [0] or [field=value], like "item.name" or "lines[lineId=seed-1].qty".`};let s=e,r=[];for(let o of a){if(s==null)return{ok:false,error:`"${r.join(".")||"(root)"}" is ${s===null?"null":"not set"}, so there is nothing at "${t}".`};if(o.kind==="key"){if(!te(s))return{ok:false,error:`"${r.join(".")||"(root)"}" is not an object, so it has no field "${o.key}".`};if(!(o.key in s)){let i=a[a.length-1];return{ok:false,error:Qt(e,r.join(".")||"(root)",o.key,Object.keys(s),i?.kind==="key"?i.key:void 0)}}s=s[o.key],r.push(o.key)}else if(o.kind==="index"){if(!Array.isArray(s))return{ok:false,error:`"${r.join(".")||"(root)"}" is not a list, so [${o.index}] means nothing.`};s=s[o.index],r.push(`[${o.index}]`)}else{if(!Array.isArray(s))return{ok:false,error:`"${r.join(".")||"(root)"}" is not a list, so [${o.field}=${o.value}] means nothing.`};let i=s.find(l=>te(l)&&String(Zt(l,o.field))===o.value);if(i===void 0)return{ok:false,error:`No item with ${o.field}="${o.value}" in "${r.join(".")||"(root)"}".`};s=i,r.push(`[${o.field}=${o.value}]`)}}return{ok:true,value:s}}n(ks,"readPath");function Is(e,t,a){let s=ht(t);if(!s)return{ok:false,error:`Could not read the path "${t}". Use dotted keys with optional [0] or [field=value], like "item.name" or "lines[lineId=seed-1].qty".`};if(s[0]?.kind!=="key")return{ok:false,error:`A path must start with a field name, not a list index \u2014 "${t}" does not say which list.`};let r=n((i,l)=>{if(l>=s.length)return{ok:true,patch:a};let c=s[l];if(c.kind==="key"){if(te(i)&&!(c.key in i)&&l+1<s.length){let W=s[s.length-1];return{ok:false,error:Qt(e,Ie(s,l),c.key,Object.keys(i),W?.kind==="key"?W.key:void 0)}}let C=te(i)?i[c.key]:void 0,A=r(C,l+1);return A.ok?{ok:true,patch:{[c.key]:A.patch}}:A}if(!Array.isArray(i))return{ok:false,error:`"${Ie(s,l)}" is not a list, so "${t}" cannot be resolved. Read it first \u2014 \`shape\` on the read says what each field holds.`};let u=c.kind==="index"?c.index:i.findIndex(C=>te(C)&&String(Zt(C,c.field))===c.value),y=u>=0?i[u]:void 0;if(c.kind==="index"?u<0||u>=i.length:u<0)return{ok:false,error:c.kind==="index"?`"${Ie(s,l)}" has ${i.length} item(s), so there is nothing at [${c.index}].`:`No item with ${c.field}="${c.value}" in "${Ie(s,l)}".`};if(!te(y)){if(l<s.length-1)return{ok:false,error:`"${Ie(s,l)}[${c.kind==="index"?c.index:`${c.field}=${c.value}`}]" holds ${y===null?"null":typeof y}, not an object, so "${t}" cannot go any deeper. Set the item itself.`};let C=i.slice();return C[u]=a,{ok:true,patch:C}}let S=r(y,l+1);if(!S.ok)return S;let f=lt(i);if(f)return{ok:true,patch:{[String(y[f])]:S.patch}};let m=i.slice();return m[u]=te(S.patch)?{...y,...S.patch}:S.patch,{ok:true,patch:m}},"build"),o=r(e,0);return o.ok?{ok:true,patch:o.patch}:o}n(Is,"patchFromPath");function Ie(e,t){return e.slice(0,t).map(a=>a.kind==="key"?a.key:a.kind==="index"?`[${a.index}]`:`[${a.field}=${a.value}]`).join(".").replace(/\.\[/g,"[")||"(root)"}n(Ie,"pathUpTo");var ce=n(e=>!!e&&typeof e=="object"&&!Array.isArray(e),"isPlainObject");function _e(e){return Array.isArray(e)?"array":e===null?"null":typeof e=="object"?"object":typeof e}n(_e,"shapeKind");var _s=["string","number","boolean"];function ea(e,t,a=2e3){let s=[{node:e,path:""}],r=0;for(;s.length&&r<a;){let{node:o,path:i}=s.shift();if(r++,Array.isArray(o))o.slice(0,20).forEach((l,c)=>s.push({node:l,path:`${i}[${c}]`}));else if(ce(o))for(let[l,c]of Object.entries(o)){let u=i?`${i}.${l}`:l;if(l===t&&i)return u;(ce(c)||Array.isArray(c))&&s.push({node:c,path:u})}}}n(ea,"findKeyPath");function gt(e,t,a={},s=e,r="",o=[]){let i=a.noun??"data",l=r||"(root)";if(Array.isArray(t)){if(!Array.isArray(e))return o.push({path:l,kind:"type-change",detail:`${_e(e)} \u2192 array`}),o;let f=e.length?e[0]:void 0;return f!==void 0&&(ce(f)||Array.isArray(f))&&t.forEach((m,C)=>{let A=`${r}[${C}]`;if(ce(f)&&ce(m))for(let W of Object.keys(f))W in m||o.push({path:`${A}.${W}`,kind:"missing-key",detail:`list items need \`${W}\` \u2014 the items already in the list have it`});gt(f,m,a,s,A,o)}),o}if(ce(t)){if(!ce(e))return o.push({path:l,kind:"type-change",detail:`${_e(e)} \u2192 object`}),o;for(let[f,m]of Object.entries(t)){let C=r?`${r}.${f}`:f;if(f in e)gt(e[f],m,a,s,C,o);else{let A=ea(s,f);o.push({path:C,kind:"add-key",detail:A?`no such field here \u2014 did you mean \`${A}\`?`:`no field named \`${f}\` exists in this ${i}`,...A?{movedTo:A}:{}})}}return o}let c=_e(e),u=_e(t),y=c==="null"&&_s.includes(u),S=u==="null"&&_s.includes(c);return c!==u&&!y&&!S&&o.push({path:l,kind:"type-change",detail:`${c} \u2192 ${u}`}),o}n(gt,"typedEditViolations");function As(e,t){if(!t.length||!t.every(s=>s.kind==="add-key"&&s.movedTo))return;let a={};for(let s of t){let r=Os(e,s.path);if(r===void 0||s.movedTo.includes("["))return;let o=a,i=s.movedTo.split(".");i.slice(0,-1).forEach(l=>{o[l]??(o[l]={}),o=o[l]}),o[i[i.length-1]]=r}return a}n(As,"suggestedPatch");function Os(e,t){let a=e;for(let s of t.split(".")){if(!ce(a))return;a=a[s]}return a}n(Os,"getAtDotted");function Es(e,t,a){let s=e.slice(0,6).map(o=>`\`${o.path}\`: ${o.detail}`).join("; "),r=e.length>6?`; +${e.length-6} more`:"";return`Refused: this isn't a same-type edit of existing fields (the rule the React Query devtools enforces). ${s}${r}. You can only change the VALUE of a field that already exists, to the same type \u2014 you can't add fields, change a field's type, or null a list/object the screen renders. Clearing a scalar to null is fine. Send just the field(s) you're changing, nested to match the current shape of this ${t}. Use force:true only to deliberately break that.`+(a?` This is the same edit at the right depth \u2014 send it as the patch: ${JSON.stringify(a)}`:"")}n(Es,"refusalText");function He(e,t){let a=0,s=false,r=false,o=[e],i=new Set;for(;o.length>0;){if(a>t)return{bytes:a,sawRepeat:s,sawBigInt:r};let l=o.pop();if(l==null)a+=4;else if(typeof l=="string")a+=l.length+2;else if(typeof l=="number")a+=8;else if(typeof l=="boolean")a+=5;else if(typeof l=="object"){if(i.has(l)){s=true;continue}if(i.add(l),Array.isArray(l)){a+=2+l.length;for(let c=0;c<l.length;c++)o.push(l[c])}else{a+=2;for(let c in l)a+=c.length+4,o.push(l[c])}}else typeof l=="bigint"&&(r=true),a+=4}return{bytes:a,sawRepeat:s,sawBigInt:r}}n(He,"approxJsonSize");function pt(e,t){let a=He(e,t);return a.bytes>t?true:!a.sawRepeat&&!a.sawBigInt?false:!Xa(e)}n(pt,"isOverWireBudget");var Ps=16*1024,ft=8*1024*1024;function Rs(e,t){return Object.freeze({[`__buoy${e}OnDevice`]:true,note:t})}n(Rs,"onDeviceMarker");function Ls(e,t){return typeof e=="object"&&e!==null&&e[`__buoy${t}OnDevice`]===true}n(Ls,"isOnDeviceMarker");function ta(e=ft){return{__buoyTruncated:true,note:`Exceeds the ${e/1048576}MB detail limit \u2014 inspect it on-device.`}}n(ta,"truncatedNote");function $s(e,t,a=Ps){return e===void 0?e:pt(e,a)?t:e}n($s,"toWire");function aa(e,t=ft){return pt(e,t)?ta(t):e}n(aa,"capDetail");function Bs(e){let t=new WeakMap;return a=>{let s=t.get(a);if(s!==void 0)return s;let r=e(a);return t.set(a,r),r}}n(Bs,"memoByIdentity");function Ms(e,t){let a=[],s=t.baseBytes??16;for(let r=e.length-1;r>=0;r--){let o=t.toWire(e[r]);if(s+o.bytes>t.budget&&a.length>0)break;a.push(o.value),s+=o.bytes}return a.reverse(),a}n(Ms,"newestFitting");function Ns(e,t,a){let s=He(e,t);if(s.bytes<=t)return{value:e,bytes:s.bytes};let r=a();return{value:r,bytes:He(r,t).bytes}}n(Ns,"sizeOrStub");function sa(e){return e??{}}n(sa,"readParams");function Ds(e,t,a=ft){let s=n(r=>aa(r,a),"cap");return r=>{let{id:o}=sa(r);if(!o)return{found:false,reason:"missing id"};let i=e(o);return i?{found:true,id:o,...t(i,s)}:{found:false,reason:"unknown id"}}}n(Ds,"detailByIdAction");function ra(e){return e.length===1?e[0]:t=>{let a=e.map(s=>s(t));return()=>{for(let s of a)s()}}}n(ra,"mergeChangeSources");function zs(e){let t=Array.isArray(e.subscribe)?ra(e.subscribe):e.subscribe;return{version:e.version,getSnapshot:e.getSnapshot,subscribe:t,...e.actions?{actions:e.actions}:{}}}n(zs,"createSyncAdapter");var bt=new Set(["@react_buoy_settings_theme","@react_buoy_settings_preferences","@react_buoy_settings_global","@react_buoy_dev_tools_settings","@react_buoy_settings_tooltip_shown","@react_buoy_modal_hint_acknowledged","@react_buoy_clipboard_hint_acknowledged","@react_buoy_network_filters","@react_buoy_network_preferences","@react_buoy_network_copy_options","@react_buoy_storage_filters","@react_buoy_storage_event_filters","@react_buoy_storage_key_filters","@react_buoy_storage_pinned_keys","@react_buoy_storage_preferences","@react_buoy_storage_diff_viewer_mode","@react_buoy_rq_filters","@react_buoy_rq_preferences","@react_buoy_route_events_event_filters","@react_buoy_route_events_detail_view","@react_buoy_route_events_diff_viewer_mode","@react_buoy_sentry_filters","@react_buoy_sentry_preferences","@react_buoy_highlight_updates_filters","@react_buoy_highlight_updates_settings","@react_buoy_highlight_updates_copy_settings","@react_buoy_events_enabled_sources","@react_buoy_events_copy_settings","@react_buoy_time_machine_diff_viewer_mode","@react_buoy_ask_buoy_model","@react_buoy_network_ignored_domains","@react_buoy_network_ignored_urls","@react_buoy_rq_ignored_patterns","@react_buoy_rq_included_patterns"]),Fs=new Set(["@react_buoy_network_ignored_domains","@react_buoy_network_ignored_urls","@react_buoy_rq_ignored_patterns","@react_buoy_rq_included_patterns"]),Ws="@react_buoy_settings_sync_meta",js="@react_buoy_network_ignored_domains",Hs=2e3,ue=3e4,oa=15*6e4,$f=15e3,na=new Set;function Us(e){return na.add(e),()=>na.delete(e)}n(Us,"onSettingsApplied");function Gs(e){e.includes(js)&&X.reload(),na.forEach(t=>{try{t(e)}catch{}})}n(Gs,"applyPulledSettings");function Vs(){return{storage:j,credential:uu,fetch:n((e,t)=>fetch(e,t),"fetch"),subscribeWrites:ls,setTimer:n((e,t)=>setTimeout(e,t),"setTimer"),clearTimer:n(e=>clearTimeout(e),"clearTimer"),onTeam:n(e=>{X.setTeamPatterns(Ys(e[js])),it.set(e)},"onTeam"),onApplied:Gs}}n(Vs,"defaultDeps");function Ys(e){if(!e)return[];try{return JSON.parse(e)}catch{return[]}}n(Ys,"parseList");var Ks=class Wb{constructor(t={}){this.started=false;this.pending=new Map;this.applying=new Set;this.pushTimer=null;this.pullTimer=null;this.unsubscribe=null;this.refusedToken=null;this.deps={...Vs(),...t}}start(){this.started||(this.started=true,this.unsubscribe=this.deps.subscribeWrites((t,a)=>this.onWrite(t,a)),this.pull())}stop(){this.started=false,this.unsubscribe?.(),this.unsubscribe=null,this.pushTimer!==null&&this.deps.clearTimer(this.pushTimer),this.pullTimer!==null&&this.deps.clearTimer(this.pullTimer),this.pushTimer=this.pullTimer=null}credential(){let t=this.deps.credential();return t&&t.token!==this.refusedToken?t:null}call(t,a,s){return new Promise((r,o)=>{let i=this.deps.setTimer(()=>o(new Error("timeout")),$f);this.deps.fetch(`${a.origin.replace(/\/$/,"")}${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({access_token:a.token,...s})}).then(l=>{this.deps.clearTimer(i),r(l)},l=>{this.deps.clearTimer(i),o(l)})})}schedulePull(t){this.started&&(this.pullTimer!==null&&this.deps.clearTimer(this.pullTimer),this.pullTimer=this.deps.setTimer(()=>{this.pullTimer=null,this.pull()},t))}async readMeta(){try{let t=await this.deps.storage.getItem(Ws),a=t?JSON.parse(t):{};return a&&typeof a=="object"?a:{}}catch{return{}}}async writeMeta(t){await this.deps.storage.setItem(Ws,JSON.stringify(t)).catch(()=>{})}async pull(){let t=this.credential();if(!t)return this.schedulePull(ue);let a,s;try{let c=await this.call("/api/settings/pull",t,{});a=c.status,s=await c.json().catch(()=>null)}catch{return this.schedulePull(ue)}if(a===401||a===403)return this.refusedToken=t.token,this.schedulePull(ue);if(a===404)return this.schedulePull(oa);if(a!==200||!s)return this.schedulePull(ue);let r=s.personal??{},o=await this.readMeta(),i=[];for(let[c,u]of Object.entries(r))if(!(!bt.has(c)||this.pending.has(c))&&!(typeof u?.value!="string"||!(u.updatedAt>(o[c]??0)))){this.applying.add(c);try{await this.deps.storage.setItem(c,u.value)}finally{this.applying.delete(c)}o[c]=u.updatedAt,i.push(c)}for(let c of bt){if(c in r||c in o||this.pending.has(c))continue;let u=await this.deps.storage.getItem(c).catch(()=>null);u!==null&&this.pending.set(c,u)}await this.writeMeta(o),i.length>0&&this.deps.onApplied(i);let l={};for(let[c,u]of Object.entries(s.team??{}))Fs.has(c)&&typeof u?.value=="string"&&(l[c]=u.value);this.deps.onTeam(l),this.pending.size>0&&this.schedulePush(0),this.schedulePull(oa)}onWrite(t,a){!this.started||this.applying.has(t)||!bt.has(t)||(this.pending.set(t,a),this.schedulePush(Hs))}schedulePush(t){this.pushTimer!==null&&this.deps.clearTimer(this.pushTimer),this.pushTimer=this.deps.setTimer(()=>{this.pushTimer=null,this.push()},t)}async push(){if(this.pending.size===0)return;let t=this.credential();if(!t)return this.schedulePush(ue);let a=new Map(this.pending),s,r;try{let i=await this.call("/api/settings/push",t,{changes:Object.fromEntries(a)});s=i.status,r=await i.json().catch(()=>null)}catch{return this.schedulePush(ue)}if(s===401||s===403)return this.refusedToken=t.token,this.schedulePush(ue);if(s===404)return this.schedulePush(oa);if(s!==200||!r||typeof r.updatedAt!="number")return this.schedulePush(ue);let o=await this.readMeta();for(let[i,l]of a)this.pending.get(i)===l&&this.pending.delete(i),o[i]=r.updatedAt;await this.writeMeta(o),this.pending.size>0&&this.schedulePush(Hs)}};n(Ks,"SettingsSync");var qs=Ks,Ue=null;function Js(e={}){Ue??(Ue=new qs(e)),Ue.start()}n(Js,"startSettingsSync");function Xs(){Ue&&Ue.pull()}n(Xs,"syncSettingsNow");function Qs(e){return e}n(Qs,"defineToolPreset");function Zs(e,t,a){return s=>{let r=s??{},o=e.props===void 0&&!t?void 0:{...e.props??{},...t?t(r):{}};return{...e,id:r.id||e.id,name:r.name||e.name,description:r.description||e.description,...o!==void 0?{props:o}:{},...a?a(r,e):{}}}}n(Zs,"createToolFactory");var ia="__buoyToolActionRegistry";function yt(){let e=globalThis;return e[ia]||(e[ia]=new Set),e[ia]}n(yt,"sources");function er(e){let t=yt();t.add(e);let a=false,s=n(()=>{if(a)return;a=true;let o=e(),i=n(async(l,c,u)=>{if(!(l==="network"&&c==="deleteOverrideRule"||l==="impersonate"&&c==="stopImpersonation"))throw new Error("Unsupported account-lock cleanup operation");if(l==="impersonate")return o[l]?.dispose?.(i);let y=o[l]?.actions?.[c];if(!y)throw new Error(`Cleanup unavailable for ${l}`);return y(u)},"cleanup");for(let l of Object.values(o))try{Promise.resolve(l.dispose?.(i)).catch(c=>console.warn("[Buoy] Tool cleanup failed",c))}catch(c){console.warn("[Buoy] Tool cleanup failed",c)}},"dispose"),r=Fe(()=>{K()?a=false:s()});return()=>{r(),t.delete(e),Promise.resolve().then(()=>{t.size===0&&s()})}}n(er,"registerToolAdapters");function Te(){if(!K())return{};let e={};for(let t of yt())try{Object.assign(e,t())}catch{}return Object.fromEntries(Object.entries(e).map(([t,a])=>[t,la(a)]))}n(Te,"getToolAdapters");function tr(){return Object.keys(Te())}n(tr,"listToolIds");function ar(){let e={};for(let[t,a]of Object.entries(Te()))e[t]=Object.keys(a.actions??{});return e}n(ar,"listToolActions");function sr(){return Object.entries(Te()).filter(([,e])=>typeof e.getSnapshot=="function").map(([e])=>e)}n(sr,"listSnapshotToolIds");async function rr(e){xe();let t=Te()[e];if(!t)throw new Error(`Unknown tool "${e}"`);if(typeof t.getSnapshot!="function")throw new Error(`Tool "${e}" has no snapshot to read`);return await t.getSnapshot()}n(rr,"readToolSnapshot");function mt(){return K()&&yt().size>0}n(mt,"isToolRegistryReady");async function or(e,t,a){xe();let s=Te()[e],r=s?.actions?.[t];if(!r)throw new Error(s?`Unknown action "${t}" on tool "${e}"`:`Unknown tool "${e}"`);return await r(a)}n(or,"dispatchToolAction");async function nr(e=2e3){if(mt())return true;let t=Ft()+e;for(;Ft()<t;)if(await new Promise(a=>setTimeout(a,50)),mt())return true;return false}n(nr,"waitForToolRegistry");function la(e){let t=n(a=>(...s)=>{xe();let r=false,o=Fe(()=>{K()||(r=true)}),i=n(()=>{if(r)throw new Error("Buoy account access ended while the operation was pending.");xe()},"check");try{let l=a.apply(e,s);return l&&typeof l.then=="function"?Promise.resolve(l).then(c=>(i(),c)).finally(o):(i(),o(),l)}catch(l){throw o(),l}},"guard");return{...e,...e.getSnapshot?{getSnapshot:t(e.getSnapshot)}:{},...e.actions?{actions:Object.fromEntries(Object.entries(e.actions).map(([a,s])=>[a,t(s)]))}:{},...e.subscribe?{subscribe:n(a=>(xe(),e.subscribe(()=>{K()&&a()})),"subscribe")}:{}}}n(la,"guardToolAdapter");var ca="__buoyToolUiBridge";function St(){let e=globalThis;return e[ca]||(e[ca]=new Set),e[ca]}n(St,"openers");function ir(e){let t=St();return t.add(e),()=>{t.delete(e)}}n(ir,"registerToolOpener");function lr(e){for(let t of St())try{if(t(e))return true}catch{}return false}n(lr,"openBuoyTool");function cr(){return St().size>0}n(cr,"canOpenBuoyTools");var ua="__buoyToolAttention";function vt(){let e=globalThis;return e[ua]||(e[ua]={byTool:new Map,listeners:new Set}),e[ua]}n(vt,"attention");function ur(e,t){let a=vt(),s=a.byTool.get(e)??null;if(!(s===t||s&&t&&s.kind===t.kind&&s.label===t.label)){t?a.byTool.set(e,t):a.byTool.delete(e);for(let r of a.listeners)try{r()}catch{}}}n(ur,"setToolAttention");function dr(e){return vt().byTool.get(e)??null}n(dr,"getToolAttention");function hr(e){let t=vt();return t.listeners.add(e),()=>{t.listeners.delete(e)}}n(hr,"subscribeToolAttention");import{createContext as Bf,useContext as Mf,useEffect as Nf}from"react";var gr=Bf(null);function pr(e,t){let a=Mf(gr);return Nf(()=>{if(a)return a(e),()=>a(null)},[a,...t]),a!==null}n(pr,"useToolScreenHeader");var fr=256*1024;function br(e){let t=new Set(e?.excludeKeys??[]),a=e?.includeKeys?new Set(e.includeKeys):null,s=0,r=n(o=>!t.has(o)&&(!a||a.has(o)),"touch");return{touch:r,allows(o){return r(o)?true:(s+=1,false)},countExcluded(o){s+=o},get excludedHits(){return s},excludedWarning(o){return s>0?`${s} ${o} excluded by you`:null}}}n(br,"createRestoreScope");function yr(){return{ok:true,applied:0,skipped:[],warnings:[]}}n(yr,"emptyRestoreResult");function mr(e){return{ok:false,applied:0,skipped:[],warnings:[e]}}n(mr,"failedRestore");function Sr(e,t){return{ok:false,applied:0,skipped:[{id:e,reason:t}],warnings:[]}}n(Sr,"skippedRestore");function vr(e,t={}){let{key:a,label:s,oldValue:r,newValue:o,inOld:i,inNew:l}=e;if(!l)return{key:a,label:s,verdict:"removed",oldValue:r};if(!i)return{key:a,label:s,verdict:"added",newValue:o};if((t.equal??ei)(r,o))return{key:a,label:s,verdict:"unchanged"};let c=t.tooLarge??(u=>ti(u,fr));return c(r)||c(o)?{key:a,label:s,verdict:"too-large",reason:t.tooLargeReason??"value too large to render a diff \u2014 restore still applies it"}:{key:a,label:s,verdict:"changed",oldValue:r,newValue:o}}n(vr,"classifyPreviewItem");function Cr(e,t){return e.verdict==="unchanged"?e:{...e,verdict:"wont-apply",reason:t}}n(Cr,"wontApply");function Tr(e,t){let a=n(s=>s===void 0?[]:s instanceof Map?Array.from(s.keys()):Object.keys(s),"keysOf");return new Set([...a(e),...a(t)])}n(Tr,"unionKeys");function wr(e,t={}){let a=e.toLowerCase();if(t[a])return t[a];for(let[m,C]of Object.entries(t))if(a.includes(m))return C;let s=e.split("").reduce((m,C)=>m+C.charCodeAt(0),0)*137%360,r=.7,o=.6,i=(1-Math.abs(2*o-1))*r,l=i*(1-Math.abs(s/60%2-1)),c=o-i/2,u=0,y=0,S=0;s<60?(u=i,y=l):s<120?(u=l,y=i):s<180?(y=i,S=l):s<240?(y=l,S=i):s<300?(u=l,S=i):(u=i,S=l);let f=n(m=>Math.round((m+c)*255).toString(16).padStart(2,"0"),"toHex");return`#${f(u)}${f(y)}${f(S)}`}n(wr,"entityColor");function xr(e,t={}){let a=t.maxLength??40;if(e===void 0)return t.undefinedLabel??"undefined";if(e===null)return"null";try{if(typeof e=="function")return t.functionLabel??"(fn)";if(typeof e=="string")return e.length>a?`"${e.slice(0,a-3)}..."`:`"${e}"`;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){if(e.length===0)return"[]";let s=JSON.stringify(e);return s.length>a?`[${e.length} items]`:s}if(typeof e=="object"){let s=Object.keys(e);if(s.length===0)return"{}";let r=JSON.stringify(e);return r.length<=a?r:`{ ${s.length} keys }`}return String(e).slice(0,a)}catch{return"[complex]"}}n(xr,"formatValuePreview");function kr(e,t){if(e===t)return{summary:"no change",changedKeys:[],changedCount:0};if(typeof e!="object"||typeof t!="object"||e===null||t===null)return{summary:"changed",changedKeys:[],changedCount:0};let a=e,s=t,r=Object.keys(a),o=Object.keys(s),i=o.filter(f=>!r.includes(f)),l=r.filter(f=>!o.includes(f)),c=[];for(let f of r)o.includes(f)&&a[f]!==s[f]&&c.push(f);let u=[...i,...l,...c],y=[];if(i.length>0&&y.push(`+${i.length}`),l.length>0&&y.push(`-${l.length}`),c.length>0&&y.push(`~${c.length}`),y.length===0)return{summary:"nested change",changedKeys:[],changedCount:0};let S=u.length;return{summary:`${y.join(" ")} ${S===1?"key":"keys"}`,changedKeys:u,changedCount:S}}n(kr,"shallowDiffSummary");function da(e){if(e==null)return"N/A";if(e===0)return"0 B";let t=1024,a=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(e)/Math.log(t));return`${(e/Math.pow(t,s)).toFixed(1)} ${a[s]}`}n(da,"formatBytes");function Ir(e){if(e==null)return"N/A";if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;if(e<36e5){let s=Math.floor(e/6e4),r=Math.floor(e%6e4/1e3);return r>0?`${s}m ${r}s`:`${s}m`}let t=Math.floor(e/36e5),a=Math.floor(e%36e5/6e4);return a>0?`${t}h ${a}m`:`${t}h`}n(Ir,"formatDuration");function _r(e){return e.toLocaleString()}n(_r,"formatNumber");var Ar=5e4;function Or(e,t=Ar){try{let a=JSON.stringify(e);return a.length>t?`[omitted: ${da(a.length)} \u2014 too large to copy]`:e}catch{return"[omitted: could not serialize]"}}n(Or,"truncatePayload");function Er(e,t=50,a=20,s=20){if(e.length<=t)return e;let r=e.slice(0,a),o=e.slice(-s);return`${r}...${o}`}n(Er,"truncateMiddle");function Pr(e){if(e>=100&&e<200)return{text:String(e),color:w.info,meaning:"Informational"};if(e>=200&&e<300){let t={200:"OK",201:"Created",202:"Accepted",204:"No Content",206:"Partial Content"};return{text:String(e),color:w.success,meaning:t[e]||"Success"}}if(e>=300&&e<400){let t={301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect"};return{text:String(e),color:w.warning,meaning:t[e]||"Redirect"}}if(e>=400&&e<500){let t={400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",408:"Request Timeout",409:"Conflict",410:"Gone",422:"Unprocessable Entity",429:"Too Many Requests"};return{text:String(e),color:w.error,meaning:t[e]||"Client Error"}}if(e>=500){let t={500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"};return{text:String(e),color:w.error,meaning:t[e]||"Server Error"}}return{text:String(e),color:w.muted,meaning:"Unknown"}}n(Pr,"formatHttpStatus");function Rr(e){return{GET:w.success,POST:w.info,PUT:w.warning,DELETE:w.error,PATCH:w.network,HEAD:w.muted,OPTIONS:w.secondary,CONNECT:w.critical,TRACE:w.env}[e.toUpperCase()]||w.muted}n(Rr,"getMethodColor");function Lr(e){try{let t=new URL(e);return{protocol:t.protocol.replace(":",""),host:t.hostname,port:t.port||void 0,pathname:t.pathname,search:t.search||void 0,hash:t.hash||void 0}}catch{return null}}n(Lr,"parseUrl");var Ge=[];function ha(e){Ge.unshift(e),Ge=Ge.slice(0,500)}n(ha,"add");function $r(){return Ge}n($r,"getEntries");function Br(){Ge=[]}n(Br,"clearEntries");var ga=(e=>(e.Debug="debug",e.Info="info",e.Log="log",e.Warn="warn",e.Error="error",e))(ga||{}),pa=(e=>(e.Auth="Auth",e.Custom="Custom",e.Debug="Debug",e.Error="Error",e.Generic="Generic",e.HTTPRequest="HTTP Request",e.Navigation="Navigation",e.Replay="Replay",e.State="State",e.System="System",e.Touch="Touch",e.UserAction="User Action",e))(pa||{});var Df=n(()=>`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,"generateId"),Mr=class Hb{constructor(){this.captureTransaction=n(t=>(this.logSentryEvent("transaction",t),t),"captureTransaction");this.captureSpan=n(t=>(this.logSentryEvent("span",t),t),"captureSpan");this.captureEvent=n(t=>(this.logSentryEvent("event",t),t),"captureEvent");this.captureLog=n(t=>(this.logSentryEvent("console",{message:t.message||"Log entry",level:t.level,category:"console",timestamp:t.timestamp,...t.attributes}),t),"captureLog");this.captureBreadcrumb=n(t=>{let a="unknown";try{let r=globalThis.getCurrentPathname;r&&(a=r())}catch{}let s=t.category;if(t.message?.toLowerCase().includes("ignore"))return null;if(t.message?.includes("Touch event within element:")&&(t.message=t.message.replace("Touch event within element:","")),s==="navigation"&&t.data?.from&&t.data?.to&&(t.message=`From ${t.data.from} To ${t.data.to}`),s==="touch"&&t.data?.path){t.message&&(t.message=t.message.trim());let r={...t.data,category:s,message:t.message,route:a,timestamp:new Date().toISOString(),path:t.message?[{label:t.message}]:t.data?.path};t.data=r}return this.logSentryEvent("breadcrumb",t),t},"captureBreadcrumb")}logSentryEvent(t,a){let s="Generic",r=a.category;if(r)switch(r){case"touch":s="Touch";break;case"xhr":case"fetch":case"http":s="HTTP Request";break;case"navigation":s="Navigation";break;case"auth":s="Auth";break;case"console":s="System";break;case"debug":s="Debug";break;default:r.startsWith("ui.")?s="User Action":r.startsWith("replay.")?s="Replay":r.includes("redux")||r.includes("state")?s="State":s="Custom"}let o={id:Df(),timestamp:Date.now(),level:this.getSentryLevel(a),message:this.getSentryMessage(a),metadata:this.getSentryMetadata(a),type:s};ha(o)}getSentryLevel(t){switch(t.level){case"fatal":case"error":return"error";case"warning":return"warn";case"info":return"info";case"debug":return"debug";default:return"log"}}getSentryMessage(t){let a=t.message;return typeof a=="string"?a:`${t.type||"Unknown"} Event`}getSentryMetadata(t){let{message:a,level:s,type:r,...o}=t;return o}};n(Mr,"SentryLogger");var Nr=Mr,zf=new Nr;import{useState as fa,useEffect as Dr}from"react";import{jsx as P,jsxs as Ae}from"react/jsx-runtime";var Ct=Se.bubble.settings(),zr=Se.bubble.userPreferences(),ba={showEnvironment:true,showQueryButton:true,showWifiToggle:true,showEnvButton:false,showSentryButton:false,showStorageButton:false};function Fr({onPress:e}){let[t,a]=fa(ba);Dr(()=>{s()},[]);let s=n(async()=>{try{let r=await j.getItem(Ct);r&&a(JSON.parse(r))}catch(r){console.error("[Buoy]","Failed to load bubble settings:",r)}},"loadSettings");return P(Za,{id:"bubble-settings",title:"SETTINGS",subtitle:`${n(()=>Object.values(t).filter(Boolean).length,"getVisibleCount")()}/6 visible`,icon:Ht,iconColor:"#10B981",iconBackgroundColor:"rgba(16, 185, 129, 0.1)",onPress:e||(()=>{}),index:5})}n(Fr,"BubbleSettingsSection");function Wr({onSettingsChange:e}){let[t,a]=fa(ba),[s,r]=fa(true);Dr(()=>{o()},[]);let o=n(async()=>{try{let u=await j.getItem(Ct);u&&a(JSON.parse(u))}catch(u){console.error("[Buoy]","Failed to load bubble settings:",u)}finally{r(false)}},"loadSettings"),i=n(async u=>{try{await j.setItem(Ct,JSON.stringify(u)),a(u),e?.(u)}catch(y){console.error("[Buoy]","Failed to save bubble settings:",y)}},"saveSettings"),l=n(async u=>{let y={...t,[u]:!t[u]};try{let S=await j.getItem(zr),f=S?JSON.parse(S):{},m=u.replace("show","hasSet"),C={...f,[m]:true};await j.setItem(zr,JSON.stringify(C))}catch(S){console.error("[Buoy]","Failed to save user preference marker:",S)}i(y)},"handleToggle");if(s)return P(k,{style:_.detailContainer,children:P(F,{style:_.loadingText,children:"Loading settings..."})});let c=[{key:"showEnvironment",label:"Environment Indicator",description:"Shows current environment (dev, staging, prod)",icon:P(k,{style:[_.indicator,{backgroundColor:"#10B981"}]})},{key:"showQueryButton",label:"React Query Button",description:"Opens React Query dev tools",icon:P(k,{style:[_.indicator,{backgroundColor:"#F59E0B"}]})},{key:"showWifiToggle",label:"WiFi",description:"Toggle WiFi for testing offline scenarios",icon:P(k,{style:[_.indicator,{backgroundColor:"#8B5CF6"}]})},{key:"showEnvButton",label:"Environment Variables",description:"View and check environment variables",icon:P(Ht,{size:16,color:"#10B981"})},{key:"showSentryButton",label:"Sentry Events",description:"View captured Sentry events and errors",icon:P(k,{style:[_.indicator,{backgroundColor:"#a855f7"}]})},{key:"showStorageButton",label:"Storage Browser",description:"Browse and inspect AsyncStorage data",icon:P(os,{size:16,color:"#3B82F6"})}];return P(k,{style:_.detailContainer,children:Ae(bf,{showsVerticalScrollIndicator:false,contentContainerStyle:_.scrollContent,"sentry-label":"ignore bubble settings scroll",children:[Ae(k,{style:_.header,children:[P(F,{style:_.headerTitle,children:"Developer Tools Settings"}),P(F,{style:_.headerDescription,children:"Configure bubble button visibility"})]}),P(k,{style:_.sectionDivider,children:P(F,{style:_.sectionTitle,children:"Bubble Button Visibility"})}),P(k,{style:_.settingsList,children:c.map(u=>Ae(k,{style:_.settingItem,children:[P(k,{style:_.settingIconContainer,children:u.icon}),Ae(k,{style:_.settingContent,children:[P(F,{style:_.settingLabel,children:u.label}),P(F,{style:_.settingDescription,children:u.description})]}),P(yf,{"sentry-label":"ignore bubble settings section",value:t[u.key],onValueChange:()=>l(u.key),trackColor:{false:"#4B5563",true:"#10B981"},thumbColor:t[u.key]?"#fff":Y.textSecondary})]},u.key))}),Ae(k,{style:_.footer,children:[Ae(k,{style:_.noteContainer,children:[P(is,{size:16,color:Y.textSecondary}),P(F,{style:_.noteText,children:"User status indicator is always visible and cannot be disabled"})]}),P(F,{style:_.restartNote,children:"Changes are saved automatically and will persist across app restarts"})]})]})})}n(Wr,"BubbleSettingsDetail");async function jr(){try{let e=await j.getItem(Ct);if(e)return JSON.parse(e)}catch(e){console.error("[Buoy]","Failed to load bubble settings:",e)}return ba}n(jr,"getBubbleVisibilitySettings");var _=We.create({scrollContent:{flexGrow:1},sectionCard:{backgroundColor:Y.input,borderRadius:8,padding:16,flexDirection:"row",alignItems:"center",marginBottom:12},iconContainer:{width:36,height:36,borderRadius:8,backgroundColor:"rgba(16, 185, 129, 0.1)",justifyContent:"center",alignItems:"center",marginRight:12},textContainer:{flex:1},title:{color:Y.text,fontSize:14,fontWeight:"600",marginBottom:2},subtitle:{color:Y.textSecondary,fontSize:12},chevron:{color:st.text.icon,fontSize:20},detailContainer:{flex:1,backgroundColor:Y.card},loadingText:{color:Y.textSecondary,fontSize:14,textAlign:"center",marginTop:20},header:{padding:16,borderBottomWidth:1,borderBottomColor:"rgba(128, 128, 128, 0.2)"},headerTitle:{color:Y.text,fontSize:16,fontWeight:"600",marginBottom:4},headerDescription:{color:Y.textSecondary,fontSize:12},settingsList:{padding:16},settingItem:{flexDirection:"row",alignItems:"center",paddingVertical:12,borderBottomWidth:1,borderBottomColor:"rgba(128, 128, 128, 0.1)"},settingIconContainer:{width:32,height:32,justifyContent:"center",alignItems:"center",marginRight:12},settingContent:{flex:1,marginRight:12},settingLabel:{color:Y.text,fontSize:14,fontWeight:"500",marginBottom:2},settingDescription:{color:st.text.icon,fontSize:11},indicator:{width:8,height:8,borderRadius:4},footer:{padding:16,borderTopWidth:1,borderTopColor:"rgba(128, 128, 128, 0.2)"},noteContainer:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:8},noteText:{color:Y.textSecondary,fontSize:12,flex:1},restartNote:{color:st.text.icon,fontSize:11,fontStyle:"italic"},sectionDivider:{paddingHorizontal:16,paddingVertical:8,marginTop:8,borderTopWidth:1,borderTopColor:"rgba(128, 128, 128, 0.12)"},sectionTitle:{color:Y.textSecondary,fontSize:12,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase"}});function ya(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}n(ya,"isPlainObject");function Hr(e,t,a={}){let s=a.storage??j,r=a.parse??(c=>JSON.parse(c)),o=a.serialize??(c=>JSON.stringify(c));function i(c){let u=ya(t)&&ya(c)?{...t,...c}:c;return a.sanitize?a.sanitize(u,c):u}n(i,"resolve");async function l(){try{let c=await s.getItem(e);return c==null||c===""?null:i(r(c))}catch{return null}}return n(l,"loadOrNull"),{key:e,defaults:t,loadOrNull:l,async load(){return await l()??t},async save(c){try{await s.setItem(e,o(c))}catch{}},async clear(){try{await s.removeItem(e)}catch{}}}}n(Hr,"definePersistedSetting");import{callCapacitorNative as Ur,hasCapacitorPlugin as Ff,isCapacitorNative as Wf}from"@buoy-gg/license/web";function Gr(){return!Wf()||!Ff("Preferences")?null:{async getAllKeys(){let{keys:e}=await Ur("Preferences","keys");return Array.isArray(e)?e:[]},async multiRemove(e){await Promise.all(e.map(t=>Ur("Preferences","remove",{key:t})))}}}n(Gr,"getCapacitorAppStorage");import{callCapacitorNative as jf,hasCapacitorPlugin as Hf,isCapacitorNative as Uf}from"@buoy-gg/license/web";function Vr(e){if(e.instanceId&&rt(e.instanceId))return null;let t=e.data;if(!t)return e;if(typeof t.key=="string"&&rt(t.key))return null;let a={...t},s=false,r=false,o=false;for(let i of["keys","pairs","prevPairs"])Array.isArray(t[i])&&(r||(r=t[i].length>0),a[i]=t[i].filter(l=>!rt(i==="keys"?l:l[0])),o||(o=a[i].length>0),s||(s=a[i].length!==t[i].length));return r&&!o?null:s?{...e,data:a}:e}n(Vr,"appStorageEvent");function ma(e){try{let t=new URL(e,typeof location>"u"?"http://localhost":location.href),a=t.hostname.toLowerCase();if(["api.buoy.gg","ai.buoy.gg","gateway.buoy.gg"].includes(a)||a==="keygen.sh"||a.endsWith(".keygen.sh")||["buoy.gg","www.buoy.gg"].includes(a)&&/^\/api\/(license|settings|auth|session|install|t)(?:\/|$)/.test(t.pathname)||t.pathname==="/buoy-assets.json")return true;let s=globalThis.__BUOY_INTERNAL_HOSTS__;return s instanceof Set&&[...s].some(r=>typeof r=="string"&&r.toLowerCase()===t.host.toLowerCase())}catch{return false}}n(ma,"isBuoyRequest");function Yr(e,t){return fetch(e,{...t,__buoyInternal:true})}n(Yr,"buoyFetch");function Kr(e){return typeof e[0]=="string"&&/^\[(?:buoy(?:[^\]]*)?|@buoy-gg\/[^\]]+|RnBetterDevTools|React ?Buoy|RN-BUOY DEBUG|js-top|perf-monitor|impersonate|RenderCause|HighlightUpdates|RenderTracker|ProfilerInterceptor|HighlightPerf|DebugBorders|optional-module|route-events|RouteObserver)\]/i.test(e[0])}n(Kr,"isBuoyLog");function qr(e){if(!e)return false;if(ma(e))return true;let t=e;try{t=decodeURIComponent(t)}catch{}return t=t.replace(/\\/g,"/"),/(?:^|\/)node_modules\/@buoy-gg\/[^/]+(?:\/|$)/.test(t)||/(?:^|\/)buoy-packages\/packages\/[^/]+(?:\/|$)/.test(t)||/(?:^|\/)packages\/floating-tools-core\/(?:src|lib\/(?:module|commonjs))\/icons\/assets(?:\/|$)/.test(t)}n(qr,"isBuoyAssetPath");function Jr(e){let t=e;for(;t;){if(t.closest("[data-buoy-root], [data-buoy-portal-host]"))return true;let a=t.getRootNode?.();t=a&&"host"in a?a.host:null}return false}n(Jr,"isBuoyElement");import{useEffect as Gf,useId as Vf,useRef as Xr,useState as Yf}from"react";import{jsx as Oe,jsxs as Kf}from"react/jsx-runtime";function Sa(){let[e,t]=Yf(false),a=Xr(null),s=Xr(null),r=Vf(),o=n((i=true)=>{t(false),i&&a.current?.querySelector('[data-account-launcher] [role="button"]')?.focus({preventScroll:true})},"close");return Gf(()=>{if(!e)return;s.current?.focus({preventScroll:true});let i=n(c=>{c.target instanceof Node&&!a.current?.contains(c.target)&&t(false)},"onPointerDown"),l=n(c=>{c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),t(false),a.current?.querySelector('[data-account-launcher] [role="button"]')?.focus({preventScroll:true}))},"onKeyDown");return document.addEventListener("pointerdown",i),document.addEventListener("keydown",l),()=>{document.removeEventListener("pointerdown",i),document.removeEventListener("keydown",l)}},[e]),typeof document>"u"?null:Oe(mf,{children:Kf("div",{ref:a,"data-buoy-account":"",style:{position:"fixed",right:"max(16px, env(safe-area-inset-right))",bottom:"max(20px, env(safe-area-inset-bottom))",zIndex:99999,colorScheme:"dark",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},children:[Oe("style",{children:`
|
|
1
|
+
"use client";import{a as Ko,b as qo,c as Jo,d as Xo,e as Qo,f as Zo,g as en,h as tn,i as an}from"./chunks/chunk-3HELV44Y.mjs";import{a as sn,b as rn,c as on,d as nn,e as ln,f as cn,g as un,h as dn}from"./chunks/chunk-G27JNYZ3.mjs";import{$ as hn,A as gn,B as pn,C as fn,D as bn,E as yn,F as mn,G as Sn,J as vn,K as Cn,L as Tn,M as wn,N as xn,O as kn,P as In,Q as _n,R as An,S as On,Z as En,_ as Pn,a as Ja,b as Rn,c as Ln,d as ze,e as $n,f as Bn,g as Xa,h as Mn,i as Nn,j as Dn,k as zn,l as Fn,m as Ft,n as Wn,o as jn,p as Hn,q as Un,r as Gn,s as Vn,t as Yn,u as Kn,v as qn,w as Jn,x as Xn,y as Qn,z as Zn}from"./chunks/chunk-G2SCTDOW.mjs";import"./chunks/chunk-VAR5UK6J.mjs";import{a as ei,d as ti,f as Wt}from"./chunks/chunk-NOSWH3E2.mjs";import{$ as ai,$a as si,$b as ri,A as oi,Aa as ni,Ab as ii,Ac as li,B as ci,Ba as ui,Bb as di,Bc as hi,C as gi,Ca as pi,Cb as Qa,Cc as fi,D as bi,Da as yi,Db as mi,Dc as Za,E as Si,Ea as vi,Eb as Ci,Ec as Ti,F as wi,Fa as xi,Fb as ki,Fc as Ii,G as _i,Ga as Ai,Gb as Oi,Gc as Ei,H as Pi,Ha as Ri,Hb as Li,I as $i,Ia as Bi,Ib as Mi,J as es,Ja as Ni,Jb as Di,K as zi,Ka as Fi,Kb as Wi,L as ji,La as Hi,Lb as Ui,M as Gi,Ma as Vi,Mb as Yi,N as Ki,Na as qi,Nb as Ji,O as Xi,Oa as Qi,Ob as Zi,P as el,Pa as tl,Pb as al,Q as sl,Qa as rl,Qb as ol,R as nl,Ra as il,Rb as ll,S as cl,Sa as ul,Sb as dl,T as hl,Ta as gl,Tb as pl,U as fl,Ua as bl,Ub as yl,V as ml,Va as Sl,Vb as vl,W as Cl,Wa as Tl,Wb as wl,X as xl,Xa as kl,Xb as Il,Y as _l,Ya as Al,Yb as Ol,Z as El,Za as Pl,Zb as Rl,_ as Ll,_a as $l,_b as Bl,a as Ml,aa as Nl,ab as Dl,ac as zl,b as Fl,ba as Wl,bb as jl,bc as Hl,c as Ul,ca as Gl,cb as Vl,cc as Yl,d as Kl,da as ql,db as Jl,dc as Xl,e as Ql,ea as Zl,eb as ec,ec as tc,f as ac,fa as sc,fb as rc,fc as oc,g as nc,ga as ic,gb as lc,gc as cc,h as uc,ha as dc,hb as hc,hc as gc,i as ts,ia as pc,ib as fc,ic as bc,j as yc,ja as mc,jb as Sc,jc as vc,k as Cc,ka as Tc,kb as wc,kc as xc,l as kc,la as Ic,lb as _c,lc as Ac,m as Oc,ma as Ec,mb as Pc,mc as Rc,n as Lc,na as $c,nb as Bc,nc as Mc,o as Nc,oa as Dc,ob as zc,oc as Fc,p as le,pa as Wc,pb as jc,pc as Hc,q as K,qa as Uc,qb as Gc,qc as Vc,r as xe,ra as Yc,rb as Kc,rc as qc,s as Fe,sa as Jc,sb as Xc,sc as Qc,t as as,ta as Zc,tb as eu,tc as tu,u as au,ua as su,ub as ru,uc as ou,v as nu,va as iu,vb as lu,vc as cu,w as uu,wa as du,wb as hu,wc as gu,x as pu,xa as fu,xb as bu,xc as yu,y as mu,ya as Su,yb as vu,yc as jt,z as Cu,za as Tu,zb as ss,zc as wu}from"./chunks/chunk-UQRRKDKX.mjs";import{a as xu}from"./chunks/chunk-HIAN3HBD.mjs";import{a as ku,b as Iu,c as _u,d as Au,e as Ou,f as Eu,g as Pu,h as Ru,i as Lu,j as $u,k as Bu,l as Mu,m as Nu,n as Du,o as zu,p as Fu}from"./chunks/chunk-4YLP5MMN.mjs";import{a as d,b as rs}from"./chunks/chunk-GF5C5DVX.mjs";import{a as Wu,b as ju}from"./chunks/chunk-7CBB7NEY.mjs";import{a as Hu,b as Uu,c as Gu,d as Vu,e as Yu,f as Ku,g as qu,h as Ju,i as Xu,j as Qu,k as Zu,l as ed}from"./chunks/chunk-4HIK66DZ.mjs";import{$ as td,$a as ad,$b as os,$c as sd,Aa as rd,Ab as od,Ac as nd,B as id,Ba as ld,Bb as cd,Bc as ud,C as dd,Ca as hd,Cb as gd,Cc as pd,D as fd,Da as bd,Db as yd,Dc as md,E as Sd,Ea as vd,Eb as Cd,Ec as Td,Fa as wd,Fb as xd,Fc as kd,Ga as Id,Gb as _d,Gc as Ht,H as Ad,Ha as Od,Hb as Ed,Hc as Pd,Ia as Rd,Ib as Ld,Ic as $d,J as Bd,Ja as Md,Jb as Nd,Jc as Dd,Ka as zd,Kb as Fd,Kc as Wd,La as jd,Lb as Hd,Lc as Ud,Ma as Gd,Mb as Vd,Mc as Yd,N as Kd,Na as qd,Nb as Jd,Nc as Xd,O as Qd,Oa as Zd,Ob as eh,Oc as th,P as ah,Pa as sh,Pb as rh,Pc as oh,Q as nh,Qa as ih,Qb as lh,Qc as ch,R as uh,Ra as dh,Rb as hh,Rc as gh,S as ph,Sa as fh,Sb as bh,Sc as yh,T as mh,Ta as Sh,Tb as vh,Tc as Ch,U as Th,Ua as wh,Ub as ns,Uc as xh,V as kh,Va as Ih,Vb as _h,Vc as Ah,W as Oh,Wa as Eh,Wb as Ph,Wc as Rh,X as Lh,Xa as $h,Xb as Bh,Xc as Mh,Y as Nh,Ya as Dh,Yb as zh,Yc as Fh,Z as Wh,Za as jh,Zb as Hh,Zc as Uh,_ as Gh,_a as Vh,_b as Yh,_c as Kh,a as qh,aa as Jh,ab as Xh,ac as Qh,ad as Zh,b as eg,ba as tg,bb as ag,bc as sg,bd as rg,c as og,ca as ng,cb as ig,cc as lg,cd as cg,d as ug,da as dg,db as hg,dc as is,dd as gg,e as pg,ea as fg,eb as bg,ec as yg,ed as mg,f as Sg,fa as vg,fb as Cg,fc as Tg,fd as wg,g as xg,ga as kg,gb as Ig,gc as _g,gd as Ag,h as Og,ha as Eg,hb as Pg,hc as Rg,hd as Lg,i as $g,ia as Bg,ib as Mg,ic as Ng,id as Dg,j as zg,ja as Fg,jb as Wg,jc as jg,jd as Hg,k as Ug,ka as Gg,kb as Vg,kc as Yg,kd as Kg,l as qg,la as Jg,lb as Xg,lc as Qg,ld as Zg,m as ep,ma as tp,mb as ap,mc as sp,md as rp,n as op,na as np,nb as ip,nc as lp,nd as cp,o as up,oa as dp,ob as hp,oc as gp,od as pp,p as fp,pa as bp,pb as yp,pc as mp,pd as Sp,q as vp,qa as Cp,qb as Tp,qc as wp,qd as xp,r as kp,ra as Ip,rb as _p,rc as Ap,rd as Op,s as Ep,sa as Pp,sb as Rp,sc as Lp,sd as $p,t as Bp,ta as Mp,tb as Np,tc as Dp,u as zp,ua as Fp,ub as Wp,uc as jp,va as Hp,vb as Up,vc as Gp,wa as Vp,wb as Yp,wc as Kp,xa as qp,xb as Jp,xc as Xp,ya as Qp,yb as Zp,yc as ef,za as tf,zb as af,zc as sf}from"./chunks/chunk-CJTGUGMQ.mjs";import{a as st,d as w,e as rf,f as Y,g as of}from"./chunks/chunk-AHVO74UQ.mjs";import{a as nf,b as lf,c as cf,d as uf,e as df}from"./chunks/chunk-RMLVR5LI.mjs";import{a as Se,b as rt,c as ls,d as j,e as hf,f as gf}from"./chunks/chunk-2STKTXD3.mjs";import{H as pf,J as We,a as k,b as F,d as ot,g as ff,h as bf,j as yf,r as Ut}from"./chunks/chunk-5G6RSRP4.mjs";import{a as Gt,c as mf}from"./chunks/chunk-SBYYOE2T.mjs";import{a as n}from"./chunks/chunk-T6T3FEMU.mjs";var cs=class Mb extends Ja{constructor(t){super();this.events=[];this.arrayListeners=new Set;this.captureSuppressed=false;this.clearListeners=new Set;this.maxEvents=t.maxEvents??500,this.storeName=t.storeName,Promise.resolve().then(()=>{let a=n(()=>{le().status==="locked"?(this.stopCapturing(),this.events=[],this.notifyArrayListeners()):this.getTotalSubscriberCount()>0&&!this.captureSuppressed&&!this.isCapturing()&&this.startCapturing()},"reconcile");Fe(a),a()})}onSubscribe(){this.getTotalSubscriberCount()===1&&!this.captureSuppressed&&le().status!=="locked"&&this.startCapturing(),ze(this.storeName)}onUnsubscribe(){this.getTotalSubscriberCount()===0&&this.stopCapturing(),ze(this.storeName)}getTotalSubscriberCount(){return this.listeners.size+this.arrayListeners.size}subscribeToEvents(t){let a=this.getTotalSubscriberCount()===0;return this.arrayListeners.add(t),a&&!this.captureSuppressed&&le().status!=="locked"&&this.startCapturing(),ze(this.storeName),t(this.getEvents()),()=>{this.arrayListeners.delete(t),this.getTotalSubscriberCount()===0&&this.stopCapturing(),ze(this.storeName)}}onEvent(t){return this.subscribe(t)}addEvent(t){le().status!=="locked"&&(this.events=[t,...this.events].slice(0,this.maxEvents),K()&&this.notify(t),this.notifyArrayListeners())}notifyArrayListeners(){let t=this.getEvents();this.arrayListeners.forEach(a=>{try{a(t)}catch{}})}getEvents(){return K()?this.events:[]}getEventCount(){return K()?this.events.length:0}clearEvents(){this.events=[],this.notifyArrayListeners(),this.clearListeners.forEach(t=>{try{t()}catch{}})}onClear(t){return this.clearListeners.add(t),()=>{this.clearListeners.delete(t)}}disableCapture(){this.captureSuppressed=true,this.isCapturing()&&this.stopCapturing()}replaceEvents(t){this.events=this.dedupeById(t).slice(0,this.maxEvents),this.notifyArrayListeners()}dedupeById(t){let a=new Set,s=[];for(let r of t){let o=r?.id;if(o==null){s.push(r);continue}a.has(o)||(a.add(o),s.push(r))}return s}setMaxEvents(t){this.maxEvents=t,this.events.length>t&&(this.events=this.events.slice(0,t),this.notifyArrayListeners())}getSubscriberCounts(){return{eventCallbacks:this.listeners.size,arrayListeners:this.arrayListeners.size,total:this.getTotalSubscriberCount()}}};n(cs,"BaseEventStore");var Sf=cs;import{useEffect as vf,useMemo as Cf,useState as Tf}from"react";var wf=[{value:"buoy.gg/api/license",mode:"contains"},{value:"api.keygen.sh",mode:"contains"}];function Vt(e,t){let a=e.toLowerCase(),s=t.value.toLowerCase();if(t.mode==="contains")return a.includes(s);try{let r=new URL(e);return s.startsWith("/")?r.pathname.toLowerCase()===s:s.startsWith("http://")||s.startsWith("https://")?`${r.origin}${r.pathname}`.toLowerCase()===s:r.host.toLowerCase()===s}catch{return a===s}}n(Vt,"urlMatchesIgnoredPattern");function us(e,t){return!e||t.length===0?false:t.some(a=>Vt(e,a))}n(us,"isUrlIgnored");var ds=wf;function Yt(e){if(!Array.isArray(e))return[];let t=[];for(let a of e)if(typeof a=="string"&&a.trim())t.push({value:a,mode:"contains"});else if(a&&typeof a=="object"&&typeof a.value=="string"){let s=a;t.push({value:s.value,mode:s.mode==="exact"?"exact":"contains"})}return t}n(Yt,"migratePatterns");function Kt(e){let t=[...e];for(let a of ds)t.some(s=>s.value===a.value)||t.push({...a});return t}n(Kt,"ensureDefaults");var hs=class Db{constructor(){this.patterns=Kt(ds.map(t=>({...t})));this.teamPatterns=[];this.merged=this.patterns;this.listeners=new Set;this.loaded=false;this.loadPromise=null;this.dirty=false}getPatterns(){return this.merged}isTeamOnly(t){return!this.patterns.some(a=>a.value===t)&&this.teamPatterns.some(a=>a.value===t)}setTeamPatterns(t){this.teamPatterns=Yt(t),this.remerge(),this.emit()}reload(){return this.loaded=false,this.loadPromise=null,this.dirty=false,this.ensureLoaded()}remerge(){let t=this.teamPatterns.filter(a=>!this.patterns.some(s=>s.value===a.value));this.merged=t.length>0?[...this.patterns,...t]:this.patterns}subscribe(t){return this.listeners.add(t),this.ensureLoaded(),()=>{this.listeners.delete(t)}}emit(){this.listeners.forEach(t=>t())}ensureLoaded(){return this.loaded?Promise.resolve():this.loadPromise?this.loadPromise:(this.loadPromise=(async()=>{try{let t=await j.getItem(Se.network.ignoredDomains());if(t&&!this.dirty){let a=Kt(Yt(JSON.parse(t)));this.patterns=a,this.remerge()}}catch{}finally{this.loaded=true,this.emit()}})(),this.loadPromise)}persist(){j.setItem(Se.network.ignoredDomains(),JSON.stringify(this.patterns)).catch(()=>{})}commit(t){this.dirty=true,this.patterns=t,this.remerge(),this.emit(),this.persist()}add(t){let a=t.value.trim();a&&(this.patterns.some(s=>s.value===a)||this.commit([...this.patterns,{value:a,mode:t.mode}]))}remove(t){this.patterns.some(a=>a.value===t)&&this.commit(this.patterns.filter(a=>a.value!==t))}toggle(t){let a=t.trim();a&&this.commit(this.patterns.some(s=>s.value===a)?this.patterns.filter(s=>s.value!==a):[...this.patterns,{value:a,mode:"contains"}])}toggleMode(t){this.patterns.some(a=>a.value===t)&&this.commit(this.patterns.map(a=>a.value===t?{...a,mode:a.mode==="contains"?"exact":"contains"}:a))}};n(hs,"IgnoredPatternsStore");var xf=hs,X=new xf,kf=n(e=>X.add(e),"addPattern"),If=n(e=>X.remove(e),"removePattern"),_f=n(e=>X.toggle(e),"togglePattern"),Af=n(e=>X.toggleMode(e),"togglePatternMode"),Of=n(e=>X.isTeamOnly(e),"isTeamOnlyPattern");function gs(){let[e,t]=Tf(()=>X.getPatterns());vf(()=>X.subscribe(()=>{t(X.getPatterns())}),[]);let a=Cf(()=>new Set(e.map(s=>s.value)),[e]);return{patterns:e,values:a,add:kf,remove:If,toggle:_f,toggleMode:Af,isTeamOnly:Of}}n(gs,"useIgnoredPatterns");import{useSyncExternalStore as Ef}from"react";var nt={},qt=new Map,Jt=new Set,je=[];function ps(e){if(!e)return je;try{let t=JSON.parse(e);if(!Array.isArray(t))return je;let a=t.map(s=>typeof s=="string"?s:s&&typeof s.value=="string"?s.value:"").map(s=>s.trim()).filter(Boolean);return a.length?[...new Set(a)]:je}catch{return je}}n(ps,"parseList");var it={set(e){Object.keys({...nt,...e}).some(t=>nt[t]!==e[t])&&(nt=e,qt.clear(),Jt.forEach(t=>t()))},getList(e){let t=qt.get(e);return t||(t=ps(nt[e]),qt.set(e,t)),t},subscribe(e){return Jt.add(e),()=>Jt.delete(e)}};function fs(e){return Ef(it.subscribe,()=>it.getList(e),()=>je)}n(fs,"useTeamList");function bs(e){typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):setTimeout(e,0)}n(bs,"scheduleFrame");function ys(e){let t=e.id,a=e.order??"append",s=e.coalesce??"sync",r=e.flushMinIntervalMs??150,o=e.max,i=[],l=false,c=e.firstId??1,u=0,y=false,S=[],f=false;function m(){f||(f=true,Fe(()=>{le().status==="locked"&&(i=[]),V()}))}n(m,"observe");let C=new Set,A=new Set;function W(){for(let v of C)try{v()}catch{}}n(W,"fire");function V(){if(s==="sync"){W();return}y||(y=true,bs(()=>{y=false,W()}))}n(V,"emit");function M(v){return v.length<=o?v:a==="append"?v.slice(v.length-o):v.slice(0,o)}return n(M,"trim"),{id:t,subscribe(v){return m(),C.add(v),()=>{C.delete(v)}},getSnapshot(){return m(),K()?i:S},size(){return K()?i.length:0},add(v){m(),!(l||le().status==="locked")&&(a==="append"?i=i.length>=o?[...i.slice(i.length-o+1),v]:[...i,v]:i=i.length>=o?[v,...i.slice(0,o-1)]:[v,...i],V())},set(v){m(),K()&&(i=M(v),V())},update(v){m(),le().status!=="locked"&&(i=M(v(i)),V())},clear(){for(let v of A)try{v()}catch{}i.length!==0&&(i=[],V())},onClear(v){return A.add(v),()=>{A.delete(v)}},notify(){V()},flushSync(v=false){let se=Date.now();if(!(!v&&se-u<r)){u=se;try{let $=globalThis.__buoyFlushToolSync;if(!$)return;for(let Ye of $)Ye(t)}catch{}}},setPaused(v){l=v},isPaused(){return l},setMax(v){o=v;let se=M(i);se!==i&&(i=se,V())},getMax(){return o},allocId(){return c++},bumpIdAbove(v){v+1>c&&(c=v+1)},listenerCount(){return C.size}}}n(ys,"createToolStore");var ms=class Fb{constructor(t={}){this.items=[];this.itemListeners=new Set;this.clearListeners=new Set;this.idCounter=0;this.enabled=true;this.captureSuppressed=false;this.max=t.max??200}canRecord(){return this.enabled&&!this.captureSuppressed}nextId(){return`${Date.now()}-${++this.idCounter}`}push(t){this.items=[t,...this.items].slice(0,this.max)}record(t){this.push(t),this.notifyListeners()}setItems(t){this.items=t.slice(0,this.max),this.notifyListeners()}getAll(){return[...this.items]}getById(t){return this.items.find(a=>a.id===t)}get size(){return this.items.length}clear(){this.items=[],this.notifyListeners(),this.clearListeners.forEach(t=>{try{t()}catch{}})}onClear(t){return this.clearListeners.add(t),()=>{this.clearListeners.delete(t)}}disableCapture(){this.captureSuppressed=true}isCaptureSuppressed(){return this.captureSuppressed}replaceAll(t){return this.enabled?(this.setItems(t),true):false}hydrateById(t,a){let s=this.items.findIndex(r=>r.id===t);s!==-1&&(this.items=[...this.items.slice(0,s),{...this.items[s],...a},...this.items.slice(s+1)],this.notifyListeners())}setEnabled(t){this.enabled=t}getEnabled(){return this.enabled}setMax(t){this.max=t,this.items.length>t&&(this.items=this.items.slice(0,t),this.notifyListeners())}getMax(){return this.max}subscribe(t){return this.itemListeners.add(t),()=>{this.itemListeners.delete(t)}}notifyListeners(){let t=this.getAll();this.itemListeners.forEach(a=>a(t))}get listenerCount(){return this.itemListeners.size}};n(ms,"ChangeLog");var Pf=ms;var ve=n(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),Rf=["id","lineId","key","uuid","_id","slug","name"];function lt(e){if(!e.length||!e.every(ve))return;let t=e[0];for(let a of Rf){if(!(a in t))continue;let s=e.map(r=>r[a]);if(s.every(r=>typeof r=="string"||typeof r=="number")&&new Set(s.map(String)).size===s.length)return a}}n(lt,"identityField");function Ss(e,t,a,s){let r=s[t];return typeof r=="string"||typeof r=="number"?String(r)!==a?{ok:false,error:`The new item is addressed as \`${a}\` but carries \`${t}\`: ${JSON.stringify(r)}. Use the same value for both \u2014 address it by the id it carries.`}:{ok:true,value:r}:e.every(o=>typeof o[t]=="number")&&a.trim()!==""&&String(Number(a))===a?{ok:true,value:Number(a)}:{ok:true,value:a}}n(Ss,"identityForAdd");function ct(e,t,a="",s=[]){if(Array.isArray(e)&&ve(t)){let r=lt(e);if(!r)return{patch:t,notes:s};let o=new Map(e.map(y=>[String(y[r]),y])),i=e.slice(),l=0,c=0,u=0;for(let[y,S]of Object.entries(t)){let f=i.findIndex(m=>String(m[r])===y);if(S===null){if(f===-1)return{patch:t,notes:s};i.splice(f,1),l++}else if(f===-1){if(!ve(S))return{patch:t,notes:s};let m=Ss(e,r,y,S);if(!m.ok)return{patch:t,notes:s,error:m.error};i.push({...S,[r]:m.value}),u++}else{let m=ct(o.get(y),S,`${a}[${y}]`,s);if(m.error)return{patch:t,notes:s,error:m.error};let C=i[f];i[f]=ve(C)&&ve(m.patch)?{...C,...m.patch}:m.patch,c++}}return s.push(`${a||"(root)"}: addressed by \`${r}\` \u2014 ${c} changed, ${u} added, ${l} removed, ${i.length} item(s) remain`),{patch:i,notes:s}}if(ve(e)&&ve(t)){let r={};for(let[o,i]of Object.entries(t)){let l=a?`${a}.${o}`:o;if(!(o in e)){r[o]=i;continue}let c=ct(e[o],i,l,s);if(c.error)return{patch:t,notes:s,error:c.error};r[o]=c.patch}return{patch:r,notes:s}}return{patch:t,notes:s}}n(ct,"expandKeyedArrays");var ut=n(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),Xt=3,Lf=24,vs=40,dt=600;function ke(e,t=0){if(e===null)return"null";if(Array.isArray(e)){if(!e.length)return"unknown[]";if(t>=Xt)return"\u2026[]";let s=ke(e[0],t+1);return s.includes(" ")||s.endsWith("]")?`(${s})[]`:`${s}[]`}if(ut(e)){if(t>=Xt)return"{\u2026}";let s=Object.keys(e),r=s.slice(0,Lf),o=r.map(l=>`${l}: ${ke(e[l],t+1)}`).join(", "),i=s.length>r.length?`, +${s.length-r.length} more`:"";return`{${o}${i}}`}let a=typeof e;return a==="undefined"?"undefined":a==="function"?"function":a}n(ke,"shapeOf");function Ce(e,t="",a=[],s=0,r={visited:0}){if(s>Xt||a.length>=vs||r.visited>=dt)return a;if(Array.isArray(e)){let o=e[0];if(a.push({path:t||"(root)",length:e.length,...e.length?{item:ke(o)}:{}}),e.length&&ut(o))for(let[i,l]of Object.entries(o)){if(++r.visited>=dt)break;Ce(l,t?`${t}[].${i}`:`[].${i}`,a,s+1,r)}return a}if(ut(e))for(let[o,i]of Object.entries(e)){if(++r.visited>=dt)break;Ce(i,t?`${t}.${o}`:o,a,s+1,r)}return a}n(Ce,"listShapes");function Cs(e){let t={visited:0};return Ce(e,"",[],0,t).length>=vs||t.visited>=dt}n(Cs,"shapesWereTruncated");function Ts(e){return Ce(e).filter(t=>t.item===void 0).map(t=>t.path)}n(Ts,"unshapedLists");function ws(e){if(e===void 0)return;let t=Ce(e),a=ke(e);if(!(!t.length&&!ut(e)&&!Array.isArray(e)))return t.length?{shape:a,lists:t}:{shape:a}}n(ws,"shapeSummary");var te=n(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject");function xs(e,t,a=2e3){let s=[{node:e,path:""}],r=0;for(;s.length&&r<a;){let{node:o,path:i}=s.shift();if(r++,Array.isArray(o))o.slice(0,20).forEach((l,c)=>s.push({node:l,path:`${i}[${c}]`}));else if(te(o))for(let[l,c]of Object.entries(o)){let u=i?`${i}.${l}`:l;if(l===t)return u;(te(c)||Array.isArray(c))&&s.push({node:c,path:u})}}}n(xs,"findFieldPath");function Qt(e,t,a,s,r){let o=xs(e,r??a),i=s.slice(0,12).join(", ")||"(no fields)";return o?`No field "${a}" at "${t}" \u2014 did you mean path "${o}"? "${t}" has: ${i}.`:`No field "${a}" at "${t}". It has: ${i}.`}n(Qt,"missingFieldError");function Zt(e,t){let a=e;for(let s of t.split(".")){if(!te(a))return;a=a[s]}return a}n(Zt,"fieldOf");function ht(e){if(!e.trim())return;let t=[],a=0;for(;a<e.length;){if(e[a]==="."){a++;continue}if(e[a]==="["){let o=e.indexOf("]",a);if(o===-1)return;let i=e.slice(a+1,o);if(/^\d+$/.test(i))t.push({kind:"index",index:Number(i)});else{let l=i.indexOf("=");if(l<=0)return;t.push({kind:"match",field:i.slice(0,l).trim(),value:i.slice(l+1).trim()})}a=o+1;continue}let s=a;for(;s<e.length&&e[s]!=="."&&e[s]!=="[";)s++;let r=e.slice(a,s);if(!r)return;t.push({kind:"key",key:r}),a=s}return t.length?t:void 0}n(ht,"parsePath");function ks(e,t){let a=ht(t);if(!a)return{ok:false,error:`Could not read the path "${t}". Use dotted keys with optional [0] or [field=value], like "item.name" or "lines[lineId=seed-1].qty".`};let s=e,r=[];for(let o of a){if(s==null)return{ok:false,error:`"${r.join(".")||"(root)"}" is ${s===null?"null":"not set"}, so there is nothing at "${t}".`};if(o.kind==="key"){if(!te(s))return{ok:false,error:`"${r.join(".")||"(root)"}" is not an object, so it has no field "${o.key}".`};if(!(o.key in s)){let i=a[a.length-1];return{ok:false,error:Qt(e,r.join(".")||"(root)",o.key,Object.keys(s),i?.kind==="key"?i.key:void 0)}}s=s[o.key],r.push(o.key)}else if(o.kind==="index"){if(!Array.isArray(s))return{ok:false,error:`"${r.join(".")||"(root)"}" is not a list, so [${o.index}] means nothing.`};s=s[o.index],r.push(`[${o.index}]`)}else{if(!Array.isArray(s))return{ok:false,error:`"${r.join(".")||"(root)"}" is not a list, so [${o.field}=${o.value}] means nothing.`};let i=s.find(l=>te(l)&&String(Zt(l,o.field))===o.value);if(i===void 0)return{ok:false,error:`No item with ${o.field}="${o.value}" in "${r.join(".")||"(root)"}".`};s=i,r.push(`[${o.field}=${o.value}]`)}}return{ok:true,value:s}}n(ks,"readPath");function Is(e,t,a){let s=ht(t);if(!s)return{ok:false,error:`Could not read the path "${t}". Use dotted keys with optional [0] or [field=value], like "item.name" or "lines[lineId=seed-1].qty".`};if(s[0]?.kind!=="key")return{ok:false,error:`A path must start with a field name, not a list index \u2014 "${t}" does not say which list.`};let r=n((i,l)=>{if(l>=s.length)return{ok:true,patch:a};let c=s[l];if(c.kind==="key"){if(te(i)&&!(c.key in i)&&l+1<s.length){let W=s[s.length-1];return{ok:false,error:Qt(e,Ie(s,l),c.key,Object.keys(i),W?.kind==="key"?W.key:void 0)}}let C=te(i)?i[c.key]:void 0,A=r(C,l+1);return A.ok?{ok:true,patch:{[c.key]:A.patch}}:A}if(!Array.isArray(i))return{ok:false,error:`"${Ie(s,l)}" is not a list, so "${t}" cannot be resolved. Read it first \u2014 \`shape\` on the read says what each field holds.`};let u=c.kind==="index"?c.index:i.findIndex(C=>te(C)&&String(Zt(C,c.field))===c.value),y=u>=0?i[u]:void 0;if(c.kind==="index"?u<0||u>=i.length:u<0)return{ok:false,error:c.kind==="index"?`"${Ie(s,l)}" has ${i.length} item(s), so there is nothing at [${c.index}].`:`No item with ${c.field}="${c.value}" in "${Ie(s,l)}".`};if(!te(y)){if(l<s.length-1)return{ok:false,error:`"${Ie(s,l)}[${c.kind==="index"?c.index:`${c.field}=${c.value}`}]" holds ${y===null?"null":typeof y}, not an object, so "${t}" cannot go any deeper. Set the item itself.`};let C=i.slice();return C[u]=a,{ok:true,patch:C}}let S=r(y,l+1);if(!S.ok)return S;let f=lt(i);if(f)return{ok:true,patch:{[String(y[f])]:S.patch}};let m=i.slice();return m[u]=te(S.patch)?{...y,...S.patch}:S.patch,{ok:true,patch:m}},"build"),o=r(e,0);return o.ok?{ok:true,patch:o.patch}:o}n(Is,"patchFromPath");function Ie(e,t){return e.slice(0,t).map(a=>a.kind==="key"?a.key:a.kind==="index"?`[${a.index}]`:`[${a.field}=${a.value}]`).join(".").replace(/\.\[/g,"[")||"(root)"}n(Ie,"pathUpTo");var ce=n(e=>!!e&&typeof e=="object"&&!Array.isArray(e),"isPlainObject");function _e(e){return Array.isArray(e)?"array":e===null?"null":typeof e=="object"?"object":typeof e}n(_e,"shapeKind");var _s=["string","number","boolean"];function ea(e,t,a=2e3){let s=[{node:e,path:""}],r=0;for(;s.length&&r<a;){let{node:o,path:i}=s.shift();if(r++,Array.isArray(o))o.slice(0,20).forEach((l,c)=>s.push({node:l,path:`${i}[${c}]`}));else if(ce(o))for(let[l,c]of Object.entries(o)){let u=i?`${i}.${l}`:l;if(l===t&&i)return u;(ce(c)||Array.isArray(c))&&s.push({node:c,path:u})}}}n(ea,"findKeyPath");function gt(e,t,a={},s=e,r="",o=[]){let i=a.noun??"data",l=r||"(root)";if(Array.isArray(t)){if(!Array.isArray(e))return o.push({path:l,kind:"type-change",detail:`${_e(e)} \u2192 array`}),o;let f=e.length?e[0]:void 0;return f!==void 0&&(ce(f)||Array.isArray(f))&&t.forEach((m,C)=>{let A=`${r}[${C}]`;if(ce(f)&&ce(m))for(let W of Object.keys(f))W in m||o.push({path:`${A}.${W}`,kind:"missing-key",detail:`list items need \`${W}\` \u2014 the items already in the list have it`});gt(f,m,a,s,A,o)}),o}if(ce(t)){if(!ce(e))return o.push({path:l,kind:"type-change",detail:`${_e(e)} \u2192 object`}),o;for(let[f,m]of Object.entries(t)){let C=r?`${r}.${f}`:f;if(f in e)gt(e[f],m,a,s,C,o);else{let A=ea(s,f);o.push({path:C,kind:"add-key",detail:A?`no such field here \u2014 did you mean \`${A}\`?`:`no field named \`${f}\` exists in this ${i}`,...A?{movedTo:A}:{}})}}return o}let c=_e(e),u=_e(t),y=c==="null"&&_s.includes(u),S=u==="null"&&_s.includes(c);return c!==u&&!y&&!S&&o.push({path:l,kind:"type-change",detail:`${c} \u2192 ${u}`}),o}n(gt,"typedEditViolations");function As(e,t){if(!t.length||!t.every(s=>s.kind==="add-key"&&s.movedTo))return;let a={};for(let s of t){let r=Os(e,s.path);if(r===void 0||s.movedTo.includes("["))return;let o=a,i=s.movedTo.split(".");i.slice(0,-1).forEach(l=>{o[l]??(o[l]={}),o=o[l]}),o[i[i.length-1]]=r}return a}n(As,"suggestedPatch");function Os(e,t){let a=e;for(let s of t.split(".")){if(!ce(a))return;a=a[s]}return a}n(Os,"getAtDotted");function Es(e,t,a){let s=e.slice(0,6).map(o=>`\`${o.path}\`: ${o.detail}`).join("; "),r=e.length>6?`; +${e.length-6} more`:"";return`Refused: this isn't a same-type edit of existing fields (the rule the React Query devtools enforces). ${s}${r}. You can only change the VALUE of a field that already exists, to the same type \u2014 you can't add fields, change a field's type, or null a list/object the screen renders. Clearing a scalar to null is fine. Send just the field(s) you're changing, nested to match the current shape of this ${t}. Use force:true only to deliberately break that.`+(a?` This is the same edit at the right depth \u2014 send it as the patch: ${JSON.stringify(a)}`:"")}n(Es,"refusalText");function He(e,t){let a=0,s=false,r=false,o=[e],i=new Set;for(;o.length>0;){if(a>t)return{bytes:a,sawRepeat:s,sawBigInt:r};let l=o.pop();if(l==null)a+=4;else if(typeof l=="string")a+=l.length+2;else if(typeof l=="number")a+=8;else if(typeof l=="boolean")a+=5;else if(typeof l=="object"){if(i.has(l)){s=true;continue}if(i.add(l),Array.isArray(l)){a+=2+l.length;for(let c=0;c<l.length;c++)o.push(l[c])}else{a+=2;for(let c in l)a+=c.length+4,o.push(l[c])}}else typeof l=="bigint"&&(r=true),a+=4}return{bytes:a,sawRepeat:s,sawBigInt:r}}n(He,"approxJsonSize");function pt(e,t){let a=He(e,t);return a.bytes>t?true:!a.sawRepeat&&!a.sawBigInt?false:!Xa(e)}n(pt,"isOverWireBudget");var Ps=16*1024,ft=8*1024*1024;function Rs(e,t){return Object.freeze({[`__buoy${e}OnDevice`]:true,note:t})}n(Rs,"onDeviceMarker");function Ls(e,t){return typeof e=="object"&&e!==null&&e[`__buoy${t}OnDevice`]===true}n(Ls,"isOnDeviceMarker");function ta(e=ft){return{__buoyTruncated:true,note:`Exceeds the ${e/1048576}MB detail limit \u2014 inspect it on-device.`}}n(ta,"truncatedNote");function $s(e,t,a=Ps){return e===void 0?e:pt(e,a)?t:e}n($s,"toWire");function aa(e,t=ft){return pt(e,t)?ta(t):e}n(aa,"capDetail");function Bs(e){let t=new WeakMap;return a=>{let s=t.get(a);if(s!==void 0)return s;let r=e(a);return t.set(a,r),r}}n(Bs,"memoByIdentity");function Ms(e,t){let a=[],s=t.baseBytes??16;for(let r=e.length-1;r>=0;r--){let o=t.toWire(e[r]);if(s+o.bytes>t.budget&&a.length>0)break;a.push(o.value),s+=o.bytes}return a.reverse(),a}n(Ms,"newestFitting");function Ns(e,t,a){let s=He(e,t);if(s.bytes<=t)return{value:e,bytes:s.bytes};let r=a();return{value:r,bytes:He(r,t).bytes}}n(Ns,"sizeOrStub");function sa(e){return e??{}}n(sa,"readParams");function Ds(e,t,a=ft){let s=n(r=>aa(r,a),"cap");return r=>{let{id:o}=sa(r);if(!o)return{found:false,reason:"missing id"};let i=e(o);return i?{found:true,id:o,...t(i,s)}:{found:false,reason:"unknown id"}}}n(Ds,"detailByIdAction");function ra(e){return e.length===1?e[0]:t=>{let a=e.map(s=>s(t));return()=>{for(let s of a)s()}}}n(ra,"mergeChangeSources");function zs(e){let t=Array.isArray(e.subscribe)?ra(e.subscribe):e.subscribe;return{version:e.version,getSnapshot:e.getSnapshot,subscribe:t,...e.actions?{actions:e.actions}:{}}}n(zs,"createSyncAdapter");var bt=new Set(["@react_buoy_settings_theme","@react_buoy_settings_preferences","@react_buoy_settings_global","@react_buoy_dev_tools_settings","@react_buoy_settings_tooltip_shown","@react_buoy_modal_hint_acknowledged","@react_buoy_clipboard_hint_acknowledged","@react_buoy_network_filters","@react_buoy_network_preferences","@react_buoy_network_copy_options","@react_buoy_storage_filters","@react_buoy_storage_event_filters","@react_buoy_storage_key_filters","@react_buoy_storage_pinned_keys","@react_buoy_storage_preferences","@react_buoy_storage_diff_viewer_mode","@react_buoy_rq_filters","@react_buoy_rq_preferences","@react_buoy_route_events_event_filters","@react_buoy_route_events_detail_view","@react_buoy_route_events_diff_viewer_mode","@react_buoy_sentry_filters","@react_buoy_sentry_preferences","@react_buoy_highlight_updates_filters","@react_buoy_highlight_updates_settings","@react_buoy_highlight_updates_copy_settings","@react_buoy_events_enabled_sources","@react_buoy_events_copy_settings","@react_buoy_time_machine_diff_viewer_mode","@react_buoy_ask_buoy_model","@react_buoy_network_ignored_domains","@react_buoy_network_ignored_urls","@react_buoy_rq_ignored_patterns","@react_buoy_rq_included_patterns"]),Fs=new Set(["@react_buoy_network_ignored_domains","@react_buoy_network_ignored_urls","@react_buoy_rq_ignored_patterns","@react_buoy_rq_included_patterns"]),Ws="@react_buoy_settings_sync_meta",js="@react_buoy_network_ignored_domains",Hs=2e3,ue=3e4,oa=15*6e4,$f=15e3,na=new Set;function Us(e){return na.add(e),()=>na.delete(e)}n(Us,"onSettingsApplied");function Gs(e){e.includes(js)&&X.reload(),na.forEach(t=>{try{t(e)}catch{}})}n(Gs,"applyPulledSettings");function Vs(){return{storage:j,credential:uu,fetch:n((e,t)=>fetch(e,t),"fetch"),subscribeWrites:ls,setTimer:n((e,t)=>setTimeout(e,t),"setTimer"),clearTimer:n(e=>clearTimeout(e),"clearTimer"),onTeam:n(e=>{X.setTeamPatterns(Ys(e[js])),it.set(e)},"onTeam"),onApplied:Gs}}n(Vs,"defaultDeps");function Ys(e){if(!e)return[];try{return JSON.parse(e)}catch{return[]}}n(Ys,"parseList");var Ks=class Wb{constructor(t={}){this.started=false;this.pending=new Map;this.applying=new Set;this.pushTimer=null;this.pullTimer=null;this.unsubscribe=null;this.refusedToken=null;this.deps={...Vs(),...t}}start(){this.started||(this.started=true,this.unsubscribe=this.deps.subscribeWrites((t,a)=>this.onWrite(t,a)),this.pull())}stop(){this.started=false,this.unsubscribe?.(),this.unsubscribe=null,this.pushTimer!==null&&this.deps.clearTimer(this.pushTimer),this.pullTimer!==null&&this.deps.clearTimer(this.pullTimer),this.pushTimer=this.pullTimer=null}credential(){let t=this.deps.credential();return t&&t.token!==this.refusedToken?t:null}call(t,a,s){return new Promise((r,o)=>{let i=this.deps.setTimer(()=>o(new Error("timeout")),$f);this.deps.fetch(`${a.origin.replace(/\/$/,"")}${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({access_token:a.token,...s})}).then(l=>{this.deps.clearTimer(i),r(l)},l=>{this.deps.clearTimer(i),o(l)})})}schedulePull(t){this.started&&(this.pullTimer!==null&&this.deps.clearTimer(this.pullTimer),this.pullTimer=this.deps.setTimer(()=>{this.pullTimer=null,this.pull()},t))}async readMeta(){try{let t=await this.deps.storage.getItem(Ws),a=t?JSON.parse(t):{};return a&&typeof a=="object"?a:{}}catch{return{}}}async writeMeta(t){await this.deps.storage.setItem(Ws,JSON.stringify(t)).catch(()=>{})}async pull(){let t=this.credential();if(!t)return this.schedulePull(ue);let a,s;try{let c=await this.call("/api/settings/pull",t,{});a=c.status,s=await c.json().catch(()=>null)}catch{return this.schedulePull(ue)}if(a===401||a===403)return this.refusedToken=t.token,this.schedulePull(ue);if(a===404)return this.schedulePull(oa);if(a!==200||!s)return this.schedulePull(ue);let r=s.personal??{},o=await this.readMeta(),i=[];for(let[c,u]of Object.entries(r))if(!(!bt.has(c)||this.pending.has(c))&&!(typeof u?.value!="string"||!(u.updatedAt>(o[c]??0)))){this.applying.add(c);try{await this.deps.storage.setItem(c,u.value)}finally{this.applying.delete(c)}o[c]=u.updatedAt,i.push(c)}for(let c of bt){if(c in r||c in o||this.pending.has(c))continue;let u=await this.deps.storage.getItem(c).catch(()=>null);u!==null&&this.pending.set(c,u)}await this.writeMeta(o),i.length>0&&this.deps.onApplied(i);let l={};for(let[c,u]of Object.entries(s.team??{}))Fs.has(c)&&typeof u?.value=="string"&&(l[c]=u.value);this.deps.onTeam(l),this.pending.size>0&&this.schedulePush(0),this.schedulePull(oa)}onWrite(t,a){!this.started||this.applying.has(t)||!bt.has(t)||(this.pending.set(t,a),this.schedulePush(Hs))}schedulePush(t){this.pushTimer!==null&&this.deps.clearTimer(this.pushTimer),this.pushTimer=this.deps.setTimer(()=>{this.pushTimer=null,this.push()},t)}async push(){if(this.pending.size===0)return;let t=this.credential();if(!t)return this.schedulePush(ue);let a=new Map(this.pending),s,r;try{let i=await this.call("/api/settings/push",t,{changes:Object.fromEntries(a)});s=i.status,r=await i.json().catch(()=>null)}catch{return this.schedulePush(ue)}if(s===401||s===403)return this.refusedToken=t.token,this.schedulePush(ue);if(s===404)return this.schedulePush(oa);if(s!==200||!r||typeof r.updatedAt!="number")return this.schedulePush(ue);let o=await this.readMeta();for(let[i,l]of a)this.pending.get(i)===l&&this.pending.delete(i),o[i]=r.updatedAt;await this.writeMeta(o),this.pending.size>0&&this.schedulePush(Hs)}};n(Ks,"SettingsSync");var qs=Ks,Ue=null;function Js(e={}){Ue??(Ue=new qs(e)),Ue.start()}n(Js,"startSettingsSync");function Xs(){Ue&&Ue.pull()}n(Xs,"syncSettingsNow");function Qs(e){return e}n(Qs,"defineToolPreset");function Zs(e,t,a){return s=>{let r=s??{},o=e.props===void 0&&!t?void 0:{...e.props??{},...t?t(r):{}};return{...e,id:r.id||e.id,name:r.name||e.name,description:r.description||e.description,...o!==void 0?{props:o}:{},...a?a(r,e):{}}}}n(Zs,"createToolFactory");var ia="__buoyToolActionRegistry";function yt(){let e=globalThis;return e[ia]||(e[ia]=new Set),e[ia]}n(yt,"sources");function er(e){let t=yt();t.add(e);let a=false,s=n(()=>{if(a)return;a=true;let o=e(),i=n(async(l,c,u)=>{if(!(l==="network"&&c==="deleteOverrideRule"||l==="impersonate"&&c==="stopImpersonation"))throw new Error("Unsupported account-lock cleanup operation");if(l==="impersonate")return o[l]?.dispose?.(i);let y=o[l]?.actions?.[c];if(!y)throw new Error(`Cleanup unavailable for ${l}`);return y(u)},"cleanup");for(let l of Object.values(o))try{Promise.resolve(l.dispose?.(i)).catch(c=>console.warn("[Buoy] Tool cleanup failed",c))}catch(c){console.warn("[Buoy] Tool cleanup failed",c)}},"dispose"),r=Fe(()=>{K()?a=false:s()});return()=>{r(),t.delete(e),Promise.resolve().then(()=>{t.size===0&&s()})}}n(er,"registerToolAdapters");function Te(){if(!K())return{};let e={};for(let t of yt())try{Object.assign(e,t())}catch{}return Object.fromEntries(Object.entries(e).map(([t,a])=>[t,la(a)]))}n(Te,"getToolAdapters");function tr(){return Object.keys(Te())}n(tr,"listToolIds");function ar(){let e={};for(let[t,a]of Object.entries(Te()))e[t]=Object.keys(a.actions??{});return e}n(ar,"listToolActions");function sr(){return Object.entries(Te()).filter(([,e])=>typeof e.getSnapshot=="function").map(([e])=>e)}n(sr,"listSnapshotToolIds");async function rr(e){xe();let t=Te()[e];if(!t)throw new Error(`Unknown tool "${e}"`);if(typeof t.getSnapshot!="function")throw new Error(`Tool "${e}" has no snapshot to read`);return await t.getSnapshot()}n(rr,"readToolSnapshot");function mt(){return K()&&yt().size>0}n(mt,"isToolRegistryReady");async function or(e,t,a){xe();let s=Te()[e],r=s?.actions?.[t];if(!r)throw new Error(s?`Unknown action "${t}" on tool "${e}"`:`Unknown tool "${e}"`);return await r(a)}n(or,"dispatchToolAction");async function nr(e=2e3){if(mt())return true;let t=Ft()+e;for(;Ft()<t;)if(await new Promise(a=>setTimeout(a,50)),mt())return true;return false}n(nr,"waitForToolRegistry");function la(e){let t=n(a=>(...s)=>{xe();let r=false,o=Fe(()=>{K()||(r=true)}),i=n(()=>{if(r)throw new Error("Buoy account access ended while the operation was pending.");xe()},"check");try{let l=a.apply(e,s);return l&&typeof l.then=="function"?Promise.resolve(l).then(c=>(i(),c)).finally(o):(i(),o(),l)}catch(l){throw o(),l}},"guard");return{...e,...e.getSnapshot?{getSnapshot:t(e.getSnapshot)}:{},...e.actions?{actions:Object.fromEntries(Object.entries(e.actions).map(([a,s])=>[a,t(s)]))}:{},...e.subscribe?{subscribe:n(a=>(xe(),e.subscribe(()=>{K()&&a()})),"subscribe")}:{}}}n(la,"guardToolAdapter");var ca="__buoyToolUiBridge";function St(){let e=globalThis;return e[ca]||(e[ca]=new Set),e[ca]}n(St,"openers");function ir(e){let t=St();return t.add(e),()=>{t.delete(e)}}n(ir,"registerToolOpener");function lr(e){for(let t of St())try{if(t(e))return true}catch{}return false}n(lr,"openBuoyTool");function cr(){return St().size>0}n(cr,"canOpenBuoyTools");var ua="__buoyToolAttention";function vt(){let e=globalThis;return e[ua]||(e[ua]={byTool:new Map,listeners:new Set}),e[ua]}n(vt,"attention");function ur(e,t){let a=vt(),s=a.byTool.get(e)??null;if(!(s===t||s&&t&&s.kind===t.kind&&s.label===t.label)){t?a.byTool.set(e,t):a.byTool.delete(e);for(let r of a.listeners)try{r()}catch{}}}n(ur,"setToolAttention");function dr(e){return vt().byTool.get(e)??null}n(dr,"getToolAttention");function hr(e){let t=vt();return t.listeners.add(e),()=>{t.listeners.delete(e)}}n(hr,"subscribeToolAttention");import{createContext as Bf,useContext as Mf,useEffect as Nf}from"react";var gr=Bf(null);function pr(e,t){let a=Mf(gr);return Nf(()=>{if(a)return a(e),()=>a(null)},[a,...t]),a!==null}n(pr,"useToolScreenHeader");var fr=256*1024;function br(e){let t=new Set(e?.excludeKeys??[]),a=e?.includeKeys?new Set(e.includeKeys):null,s=0,r=n(o=>!t.has(o)&&(!a||a.has(o)),"touch");return{touch:r,allows(o){return r(o)?true:(s+=1,false)},countExcluded(o){s+=o},get excludedHits(){return s},excludedWarning(o){return s>0?`${s} ${o} excluded by you`:null}}}n(br,"createRestoreScope");function yr(){return{ok:true,applied:0,skipped:[],warnings:[]}}n(yr,"emptyRestoreResult");function mr(e){return{ok:false,applied:0,skipped:[],warnings:[e]}}n(mr,"failedRestore");function Sr(e,t){return{ok:false,applied:0,skipped:[{id:e,reason:t}],warnings:[]}}n(Sr,"skippedRestore");function vr(e,t={}){let{key:a,label:s,oldValue:r,newValue:o,inOld:i,inNew:l}=e;if(!l)return{key:a,label:s,verdict:"removed",oldValue:r};if(!i)return{key:a,label:s,verdict:"added",newValue:o};if((t.equal??ei)(r,o))return{key:a,label:s,verdict:"unchanged"};let c=t.tooLarge??(u=>ti(u,fr));return c(r)||c(o)?{key:a,label:s,verdict:"too-large",reason:t.tooLargeReason??"value too large to render a diff \u2014 restore still applies it"}:{key:a,label:s,verdict:"changed",oldValue:r,newValue:o}}n(vr,"classifyPreviewItem");function Cr(e,t){return e.verdict==="unchanged"?e:{...e,verdict:"wont-apply",reason:t}}n(Cr,"wontApply");function Tr(e,t){let a=n(s=>s===void 0?[]:s instanceof Map?Array.from(s.keys()):Object.keys(s),"keysOf");return new Set([...a(e),...a(t)])}n(Tr,"unionKeys");function wr(e,t={}){let a=e.toLowerCase();if(t[a])return t[a];for(let[m,C]of Object.entries(t))if(a.includes(m))return C;let s=e.split("").reduce((m,C)=>m+C.charCodeAt(0),0)*137%360,r=.7,o=.6,i=(1-Math.abs(2*o-1))*r,l=i*(1-Math.abs(s/60%2-1)),c=o-i/2,u=0,y=0,S=0;s<60?(u=i,y=l):s<120?(u=l,y=i):s<180?(y=i,S=l):s<240?(y=l,S=i):s<300?(u=l,S=i):(u=i,S=l);let f=n(m=>Math.round((m+c)*255).toString(16).padStart(2,"0"),"toHex");return`#${f(u)}${f(y)}${f(S)}`}n(wr,"entityColor");function xr(e,t={}){let a=t.maxLength??40;if(e===void 0)return t.undefinedLabel??"undefined";if(e===null)return"null";try{if(typeof e=="function")return t.functionLabel??"(fn)";if(typeof e=="string")return e.length>a?`"${e.slice(0,a-3)}..."`:`"${e}"`;if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e)){if(e.length===0)return"[]";let s=JSON.stringify(e);return s.length>a?`[${e.length} items]`:s}if(typeof e=="object"){let s=Object.keys(e);if(s.length===0)return"{}";let r=JSON.stringify(e);return r.length<=a?r:`{ ${s.length} keys }`}return String(e).slice(0,a)}catch{return"[complex]"}}n(xr,"formatValuePreview");function kr(e,t){if(e===t)return{summary:"no change",changedKeys:[],changedCount:0};if(typeof e!="object"||typeof t!="object"||e===null||t===null)return{summary:"changed",changedKeys:[],changedCount:0};let a=e,s=t,r=Object.keys(a),o=Object.keys(s),i=o.filter(f=>!r.includes(f)),l=r.filter(f=>!o.includes(f)),c=[];for(let f of r)o.includes(f)&&a[f]!==s[f]&&c.push(f);let u=[...i,...l,...c],y=[];if(i.length>0&&y.push(`+${i.length}`),l.length>0&&y.push(`-${l.length}`),c.length>0&&y.push(`~${c.length}`),y.length===0)return{summary:"nested change",changedKeys:[],changedCount:0};let S=u.length;return{summary:`${y.join(" ")} ${S===1?"key":"keys"}`,changedKeys:u,changedCount:S}}n(kr,"shallowDiffSummary");function da(e){if(e==null)return"N/A";if(e===0)return"0 B";let t=1024,a=["B","KB","MB","GB","TB"],s=Math.floor(Math.log(e)/Math.log(t));return`${(e/Math.pow(t,s)).toFixed(1)} ${a[s]}`}n(da,"formatBytes");function Ir(e){if(e==null)return"N/A";if(e<1e3)return`${e}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;if(e<36e5){let s=Math.floor(e/6e4),r=Math.floor(e%6e4/1e3);return r>0?`${s}m ${r}s`:`${s}m`}let t=Math.floor(e/36e5),a=Math.floor(e%36e5/6e4);return a>0?`${t}h ${a}m`:`${t}h`}n(Ir,"formatDuration");function _r(e){return e.toLocaleString()}n(_r,"formatNumber");var Ar=5e4;function Or(e,t=Ar){try{let a=JSON.stringify(e);return a.length>t?`[omitted: ${da(a.length)} \u2014 too large to copy]`:e}catch{return"[omitted: could not serialize]"}}n(Or,"truncatePayload");function Er(e,t=50,a=20,s=20){if(e.length<=t)return e;let r=e.slice(0,a),o=e.slice(-s);return`${r}...${o}`}n(Er,"truncateMiddle");function Pr(e){if(e>=100&&e<200)return{text:String(e),color:w.info,meaning:"Informational"};if(e>=200&&e<300){let t={200:"OK",201:"Created",202:"Accepted",204:"No Content",206:"Partial Content"};return{text:String(e),color:w.success,meaning:t[e]||"Success"}}if(e>=300&&e<400){let t={301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect"};return{text:String(e),color:w.warning,meaning:t[e]||"Redirect"}}if(e>=400&&e<500){let t={400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",408:"Request Timeout",409:"Conflict",410:"Gone",422:"Unprocessable Entity",429:"Too Many Requests"};return{text:String(e),color:w.error,meaning:t[e]||"Client Error"}}if(e>=500){let t={500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported"};return{text:String(e),color:w.error,meaning:t[e]||"Server Error"}}return{text:String(e),color:w.muted,meaning:"Unknown"}}n(Pr,"formatHttpStatus");function Rr(e){return{GET:w.success,POST:w.info,PUT:w.warning,DELETE:w.error,PATCH:w.network,HEAD:w.muted,OPTIONS:w.secondary,CONNECT:w.critical,TRACE:w.env}[e.toUpperCase()]||w.muted}n(Rr,"getMethodColor");function Lr(e){try{let t=new URL(e);return{protocol:t.protocol.replace(":",""),host:t.hostname,port:t.port||void 0,pathname:t.pathname,search:t.search||void 0,hash:t.hash||void 0}}catch{return null}}n(Lr,"parseUrl");var Ge=[];function ha(e){Ge.unshift(e),Ge=Ge.slice(0,500)}n(ha,"add");function $r(){return Ge}n($r,"getEntries");function Br(){Ge=[]}n(Br,"clearEntries");var ga=(e=>(e.Debug="debug",e.Info="info",e.Log="log",e.Warn="warn",e.Error="error",e))(ga||{}),pa=(e=>(e.Auth="Auth",e.Custom="Custom",e.Debug="Debug",e.Error="Error",e.Generic="Generic",e.HTTPRequest="HTTP Request",e.Navigation="Navigation",e.Replay="Replay",e.State="State",e.System="System",e.Touch="Touch",e.UserAction="User Action",e))(pa||{});var Df=n(()=>`${Date.now()}-${Math.random().toString(36).substr(2,9)}`,"generateId"),Mr=class Hb{constructor(){this.captureTransaction=n(t=>(this.logSentryEvent("transaction",t),t),"captureTransaction");this.captureSpan=n(t=>(this.logSentryEvent("span",t),t),"captureSpan");this.captureEvent=n(t=>(this.logSentryEvent("event",t),t),"captureEvent");this.captureLog=n(t=>(this.logSentryEvent("console",{message:t.message||"Log entry",level:t.level,category:"console",timestamp:t.timestamp,...t.attributes}),t),"captureLog");this.captureBreadcrumb=n(t=>{let a="unknown";try{let r=globalThis.getCurrentPathname;r&&(a=r())}catch{}let s=t.category;if(t.message?.toLowerCase().includes("ignore"))return null;if(t.message?.includes("Touch event within element:")&&(t.message=t.message.replace("Touch event within element:","")),s==="navigation"&&t.data?.from&&t.data?.to&&(t.message=`From ${t.data.from} To ${t.data.to}`),s==="touch"&&t.data?.path){t.message&&(t.message=t.message.trim());let r={...t.data,category:s,message:t.message,route:a,timestamp:new Date().toISOString(),path:t.message?[{label:t.message}]:t.data?.path};t.data=r}return this.logSentryEvent("breadcrumb",t),t},"captureBreadcrumb")}logSentryEvent(t,a){let s="Generic",r=a.category;if(r)switch(r){case"touch":s="Touch";break;case"xhr":case"fetch":case"http":s="HTTP Request";break;case"navigation":s="Navigation";break;case"auth":s="Auth";break;case"console":s="System";break;case"debug":s="Debug";break;default:r.startsWith("ui.")?s="User Action":r.startsWith("replay.")?s="Replay":r.includes("redux")||r.includes("state")?s="State":s="Custom"}let o={id:Df(),timestamp:Date.now(),level:this.getSentryLevel(a),message:this.getSentryMessage(a),metadata:this.getSentryMetadata(a),type:s};ha(o)}getSentryLevel(t){switch(t.level){case"fatal":case"error":return"error";case"warning":return"warn";case"info":return"info";case"debug":return"debug";default:return"log"}}getSentryMessage(t){let a=t.message;return typeof a=="string"?a:`${t.type||"Unknown"} Event`}getSentryMetadata(t){let{message:a,level:s,type:r,...o}=t;return o}};n(Mr,"SentryLogger");var Nr=Mr,zf=new Nr;import{useState as fa,useEffect as Dr}from"react";import{jsx as P,jsxs as Ae}from"react/jsx-runtime";var Ct=Se.bubble.settings(),zr=Se.bubble.userPreferences(),ba={showEnvironment:true,showQueryButton:true,showWifiToggle:true,showEnvButton:false,showSentryButton:false,showStorageButton:false};function Fr({onPress:e}){let[t,a]=fa(ba);Dr(()=>{s()},[]);let s=n(async()=>{try{let r=await j.getItem(Ct);r&&a(JSON.parse(r))}catch(r){console.error("[Buoy]","Failed to load bubble settings:",r)}},"loadSettings");return P(Za,{id:"bubble-settings",title:"SETTINGS",subtitle:`${n(()=>Object.values(t).filter(Boolean).length,"getVisibleCount")()}/6 visible`,icon:Ht,iconColor:"#10B981",iconBackgroundColor:"rgba(16, 185, 129, 0.1)",onPress:e||(()=>{}),index:5})}n(Fr,"BubbleSettingsSection");function Wr({onSettingsChange:e}){let[t,a]=fa(ba),[s,r]=fa(true);Dr(()=>{o()},[]);let o=n(async()=>{try{let u=await j.getItem(Ct);u&&a(JSON.parse(u))}catch(u){console.error("[Buoy]","Failed to load bubble settings:",u)}finally{r(false)}},"loadSettings"),i=n(async u=>{try{await j.setItem(Ct,JSON.stringify(u)),a(u),e?.(u)}catch(y){console.error("[Buoy]","Failed to save bubble settings:",y)}},"saveSettings"),l=n(async u=>{let y={...t,[u]:!t[u]};try{let S=await j.getItem(zr),f=S?JSON.parse(S):{},m=u.replace("show","hasSet"),C={...f,[m]:true};await j.setItem(zr,JSON.stringify(C))}catch(S){console.error("[Buoy]","Failed to save user preference marker:",S)}i(y)},"handleToggle");if(s)return P(k,{style:_.detailContainer,children:P(F,{style:_.loadingText,children:"Loading settings..."})});let c=[{key:"showEnvironment",label:"Environment Indicator",description:"Shows current environment (dev, staging, prod)",icon:P(k,{style:[_.indicator,{backgroundColor:"#10B981"}]})},{key:"showQueryButton",label:"React Query Button",description:"Opens React Query dev tools",icon:P(k,{style:[_.indicator,{backgroundColor:"#F59E0B"}]})},{key:"showWifiToggle",label:"WiFi",description:"Toggle WiFi for testing offline scenarios",icon:P(k,{style:[_.indicator,{backgroundColor:"#8B5CF6"}]})},{key:"showEnvButton",label:"Environment Variables",description:"View and check environment variables",icon:P(Ht,{size:16,color:"#10B981"})},{key:"showSentryButton",label:"Sentry Events",description:"View captured Sentry events and errors",icon:P(k,{style:[_.indicator,{backgroundColor:"#a855f7"}]})},{key:"showStorageButton",label:"Storage Browser",description:"Browse and inspect AsyncStorage data",icon:P(os,{size:16,color:"#3B82F6"})}];return P(k,{style:_.detailContainer,children:Ae(bf,{showsVerticalScrollIndicator:false,contentContainerStyle:_.scrollContent,"sentry-label":"ignore bubble settings scroll",children:[Ae(k,{style:_.header,children:[P(F,{style:_.headerTitle,children:"Developer Tools Settings"}),P(F,{style:_.headerDescription,children:"Configure bubble button visibility"})]}),P(k,{style:_.sectionDivider,children:P(F,{style:_.sectionTitle,children:"Bubble Button Visibility"})}),P(k,{style:_.settingsList,children:c.map(u=>Ae(k,{style:_.settingItem,children:[P(k,{style:_.settingIconContainer,children:u.icon}),Ae(k,{style:_.settingContent,children:[P(F,{style:_.settingLabel,children:u.label}),P(F,{style:_.settingDescription,children:u.description})]}),P(yf,{"sentry-label":"ignore bubble settings section",value:t[u.key],onValueChange:()=>l(u.key),trackColor:{false:"#4B5563",true:"#10B981"},thumbColor:t[u.key]?"#fff":Y.textSecondary})]},u.key))}),Ae(k,{style:_.footer,children:[Ae(k,{style:_.noteContainer,children:[P(is,{size:16,color:Y.textSecondary}),P(F,{style:_.noteText,children:"User status indicator is always visible and cannot be disabled"})]}),P(F,{style:_.restartNote,children:"Changes are saved automatically and will persist across app restarts"})]})]})})}n(Wr,"BubbleSettingsDetail");async function jr(){try{let e=await j.getItem(Ct);if(e)return JSON.parse(e)}catch(e){console.error("[Buoy]","Failed to load bubble settings:",e)}return ba}n(jr,"getBubbleVisibilitySettings");var _=We.create({scrollContent:{flexGrow:1},sectionCard:{backgroundColor:Y.input,borderRadius:8,padding:16,flexDirection:"row",alignItems:"center",marginBottom:12},iconContainer:{width:36,height:36,borderRadius:8,backgroundColor:"rgba(16, 185, 129, 0.1)",justifyContent:"center",alignItems:"center",marginRight:12},textContainer:{flex:1},title:{color:Y.text,fontSize:14,fontWeight:"600",marginBottom:2},subtitle:{color:Y.textSecondary,fontSize:12},chevron:{color:st.text.icon,fontSize:20},detailContainer:{flex:1,backgroundColor:Y.card},loadingText:{color:Y.textSecondary,fontSize:14,textAlign:"center",marginTop:20},header:{padding:16,borderBottomWidth:1,borderBottomColor:"rgba(128, 128, 128, 0.2)"},headerTitle:{color:Y.text,fontSize:16,fontWeight:"600",marginBottom:4},headerDescription:{color:Y.textSecondary,fontSize:12},settingsList:{padding:16},settingItem:{flexDirection:"row",alignItems:"center",paddingVertical:12,borderBottomWidth:1,borderBottomColor:"rgba(128, 128, 128, 0.1)"},settingIconContainer:{width:32,height:32,justifyContent:"center",alignItems:"center",marginRight:12},settingContent:{flex:1,marginRight:12},settingLabel:{color:Y.text,fontSize:14,fontWeight:"500",marginBottom:2},settingDescription:{color:st.text.icon,fontSize:11},indicator:{width:8,height:8,borderRadius:4},footer:{padding:16,borderTopWidth:1,borderTopColor:"rgba(128, 128, 128, 0.2)"},noteContainer:{flexDirection:"row",alignItems:"center",gap:8,marginBottom:8},noteText:{color:Y.textSecondary,fontSize:12,flex:1},restartNote:{color:st.text.icon,fontSize:11,fontStyle:"italic"},sectionDivider:{paddingHorizontal:16,paddingVertical:8,marginTop:8,borderTopWidth:1,borderTopColor:"rgba(128, 128, 128, 0.12)"},sectionTitle:{color:Y.textSecondary,fontSize:12,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase"}});function ya(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}n(ya,"isPlainObject");function Hr(e,t,a={}){let s=a.storage??j,r=a.parse??(c=>JSON.parse(c)),o=a.serialize??(c=>JSON.stringify(c));function i(c){let u=ya(t)&&ya(c)?{...t,...c}:c;return a.sanitize?a.sanitize(u,c):u}n(i,"resolve");async function l(){try{let c=await s.getItem(e);return c==null||c===""?null:i(r(c))}catch{return null}}return n(l,"loadOrNull"),{key:e,defaults:t,loadOrNull:l,async load(){return await l()??t},async save(c){try{await s.setItem(e,o(c))}catch{}},async clear(){try{await s.removeItem(e)}catch{}}}}n(Hr,"definePersistedSetting");import{callCapacitorNative as Ur,hasCapacitorPlugin as Ff,isCapacitorNative as Wf}from"@buoy-gg/license/web";function Gr(){return!Wf()||!Ff("Preferences")?null:{async getAllKeys(){let{keys:e}=await Ur("Preferences","keys");return Array.isArray(e)?e:[]},async multiRemove(e){await Promise.all(e.map(t=>Ur("Preferences","remove",{key:t})))}}}n(Gr,"getCapacitorAppStorage");import{callCapacitorNative as jf,hasCapacitorPlugin as Hf,isCapacitorNative as Uf}from"@buoy-gg/license/web";function Vr(e){if(e.instanceId&&rt(e.instanceId))return null;let t=e.data;if(!t)return e;if(typeof t.key=="string"&&rt(t.key))return null;let a={...t},s=false,r=false,o=false;for(let i of["keys","pairs","prevPairs"])Array.isArray(t[i])&&(r||(r=t[i].length>0),a[i]=t[i].filter(l=>!rt(i==="keys"?l:l[0])),o||(o=a[i].length>0),s||(s=a[i].length!==t[i].length));return r&&!o?null:s?{...e,data:a}:e}n(Vr,"appStorageEvent");function ma(e){try{let t=new URL(e,typeof location>"u"?"http://localhost":location.href),a=t.hostname.toLowerCase();if(["api.buoy.gg","ai.buoy.gg","gateway.buoy.gg"].includes(a)||a==="keygen.sh"||a.endsWith(".keygen.sh")||["buoy.gg","www.buoy.gg"].includes(a)&&/^\/api\/(license|settings|auth|session|install|t)(?:\/|$)/.test(t.pathname)||t.pathname==="/buoy-assets.json")return true;let s=globalThis.__BUOY_INTERNAL_HOSTS__;return s instanceof Set&&[...s].some(r=>typeof r=="string"&&r.toLowerCase()===t.host.toLowerCase())}catch{return false}}n(ma,"isBuoyRequest");function Yr(e,t){return fetch(e,{...t,__buoyInternal:true})}n(Yr,"buoyFetch");function Kr(e){return typeof e[0]=="string"&&/^\[(?:buoy(?:[^\]]*)?|@buoy-gg\/[^\]]+|RnBetterDevTools|React ?Buoy|RN-BUOY DEBUG|js-top|perf-monitor|impersonate|RenderCause|HighlightUpdates|RenderTracker|ProfilerInterceptor|HighlightPerf|DebugBorders|optional-module|route-events|RouteObserver)\]/i.test(e[0])}n(Kr,"isBuoyLog");function qr(e){if(!e)return false;if(ma(e))return true;let t=e;try{t=decodeURIComponent(t)}catch{}return t=t.replace(/\\/g,"/"),/(?:^|\/)node_modules\/@buoy-gg\/[^/]+(?:\/|$)/.test(t)||/(?:^|\/)buoy-packages\/packages\/[^/]+(?:\/|$)/.test(t)||/(?:^|\/)packages\/floating-tools-core\/(?:src|lib\/(?:module|commonjs))\/icons\/assets(?:\/|$)/.test(t)}n(qr,"isBuoyAssetPath");function Jr(e){let t=e;for(;t;){if(t.closest("[data-buoy-root], [data-buoy-portal-host]"))return true;let a=t.getRootNode?.();t=a&&"host"in a?a.host:null}return false}n(Jr,"isBuoyElement");import{useEffect as Gf,useId as Vf,useRef as Xr,useState as Yf}from"react";import{jsx as Oe,jsxs as Kf}from"react/jsx-runtime";function Sa(){let[e,t]=Yf(false),a=Xr(null),s=Xr(null),r=Vf(),o=n((i=true)=>{t(false),i&&a.current?.querySelector('[data-account-launcher] [role="button"]')?.focus({preventScroll:true})},"close");return Gf(()=>{if(!e)return;s.current?.focus({preventScroll:true});let i=n(c=>{c.target instanceof Node&&!a.current?.contains(c.target)&&t(false)},"onPointerDown"),l=n(c=>{c.key==="Escape"&&(c.preventDefault(),c.stopPropagation(),t(false),a.current?.querySelector('[data-account-launcher] [role="button"]')?.focus({preventScroll:true}))},"onKeyDown");return document.addEventListener("pointerdown",i),document.addEventListener("keydown",l),()=>{document.removeEventListener("pointerdown",i),document.removeEventListener("keydown",l)}},[e]),typeof document>"u"?null:Oe(mf,{children:Kf("div",{ref:a,"data-buoy-account":"",style:{position:"fixed",right:"max(16px, env(safe-area-inset-right))",bottom:"max(20px, env(safe-area-inset-bottom))",zIndex:99999,colorScheme:"dark",fontFamily:"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"},children:[Oe("style",{children:`
|
|
2
2
|
[data-buoy-account] { font-size: 14px; line-height: 1.5; text-align: left; }
|
|
3
3
|
[data-buoy-account] [role="button"], [data-buoy-account] [role="link"] { cursor: pointer; }
|
|
4
4
|
[data-buoy-account] [role="button"]:focus-visible, [data-buoy-account] [role="link"]:focus-visible { outline: 2px solid ${d.color.accent}; outline-offset: 3px; }
|
package/lib/web/utils.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{$ as a,A as s,B as e,C as r,D as t,E as o,F as i,G as l,H as u,I as n,J as g,K as p,L as S,M as d,N as b,O as m,P as c,Q as f,R,S as M,T as v,U as C,V as P,W as T,X as h,Y as O,Z as D,_ as y,a as E,aa as A,b as B,c as w,d as V,e as N,f as _,g as z,h as J,i as L,j as x,k as H,m as I,n as U,o as Y,p as j,q as k,r as F,s as G,t as K,u as q,v as Q,w as W,x as X,y as Z,z as $}from"./chunks/chunk-
|
|
1
|
+
"use client";import{$ as a,A as s,B as e,C as r,D as t,E as o,F as i,G as l,H as u,I as n,J as g,K as p,L as S,M as d,N as b,O as m,P as c,Q as f,R,S as M,T as v,U as C,V as P,W as T,X as h,Y as O,Z as D,_ as y,a as E,aa as A,b as B,c as w,d as V,e as N,f as _,g as z,h as J,i as L,j as x,k as H,m as I,n as U,o as Y,p as j,q as k,r as F,s as G,t as K,u as q,v as Q,w as W,x as X,y as Z,z as $}from"./chunks/chunk-G2SCTDOW.mjs";import{a as aa,b as sa}from"./chunks/chunk-VAR5UK6J.mjs";import{a as ea,b as ra,c as ta,d as oa,e as ia,g as la}from"./chunks/chunk-4HIK66DZ.mjs";import"./chunks/chunk-CJTGUGMQ.mjs";import"./chunks/chunk-AHVO74UQ.mjs";import{a as ua,b as na,c as ga,d as pa,e as Sa}from"./chunks/chunk-RMLVR5LI.mjs";import{d as da,e as ba,f as ma}from"./chunks/chunk-2STKTXD3.mjs";import"./chunks/chunk-5G6RSRP4.mjs";import"./chunks/chunk-SBYYOE2T.mjs";import"./chunks/chunk-T6T3FEMU.mjs";export{na as BUOY_SYNTHETIC_MARK,t as REMOTE_RELOAD_DELAY_MS,E as Subscribable,la as absoluteFill,p as browserRouter,ga as countBuoyListener,oa as displayValue,F as flattenObject,G as formatPath,Y as formatValue,u as getBrowserHref,n as getBrowserRouteURL,aa as getBrowserStorage,q as getCachedOptionalModule,L as getConstructorName,T as getDOMControlProps,P as getDOMFiber,C as getDOMNodeHandle,h as getDOMPublicInstance,i as getDevServerOrigin,pa as getRealAppState,y as getRegisteredToolModule,W as getRenderCaptureProvider,ua as getSafeAreaInsets,f as getSafeCurrentPathname,R as getSafeCurrentRoute,c as getSafeRouter,$ as getStateSnapshotProvider,Z as getStateSnapshotProviders,ma as getStorageBackendType,a as getToolModuleVersion,j as getTypeColor,H as getValueSize,N as getValueType,v as isDOMElement,x as isEmpty,M as isExpoRouterAvailable,z as isJsonSerializable,_ as isPrimitive,ba as isUsingPersistentStorage,J as isValidJson,K as loadOptionalModule,A as loadToolModule,V as notifySubscriberCountChange,ia as parseDisplayValue,U as parseValue,da as persistentStorage,I as realNow,l as registerBrowserRouter,X as registerStateSnapshotProvider,D as registerToolModules,r as reloadApp,O as resolveDOMEventEmitter,e as resolveReloadStrategy,ea as safeStringify,o as scheduleReloadApp,Q as setRenderCaptureProvider,g as subscribeBrowserNavigation,Sa as subscribeRealAppState,sa as subscribeToBrowserStorage,s as subscribeToStateSnapshotProviders,w as subscribeToSubscriberCountChanges,B as subscriberCountNotifier,ta as superJsonDeserialize,ra as superJsonSerialize,k as truncateText,m as useSafeGlobalSearchParams,d as useSafePathname,S as useSafeRouter,b as useSafeSegments};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/shared-ui",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.75",
|
|
4
4
|
"description": "Shared UI components, hooks, and utilities",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -225,11 +225,11 @@
|
|
|
225
225
|
],
|
|
226
226
|
"sideEffects": false,
|
|
227
227
|
"dependencies": {
|
|
228
|
-
"@buoy-gg/floating-tools-
|
|
229
|
-
"@buoy-gg/floating-tools-
|
|
228
|
+
"@buoy-gg/floating-tools-react": "^7.0.75",
|
|
229
|
+
"@buoy-gg/floating-tools-core": "^7.0.75"
|
|
230
230
|
},
|
|
231
231
|
"peerDependencies": {
|
|
232
|
-
"@buoy-gg/license": "7.0.
|
|
232
|
+
"@buoy-gg/license": "7.0.75",
|
|
233
233
|
"react": "*"
|
|
234
234
|
},
|
|
235
235
|
"peerDependenciesMeta": {
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
"expo-clipboard": "~7.1.5",
|
|
263
263
|
"react-native-safe-area-context": "^5.6.2",
|
|
264
264
|
"typescript": "~5.8.3",
|
|
265
|
-
"@buoy-gg/license": "^7.0.
|
|
265
|
+
"@buoy-gg/license": "^7.0.75"
|
|
266
266
|
},
|
|
267
267
|
"react-native-builder-bob": {
|
|
268
268
|
"source": "src",
|