import{C as e}from"./src-BOCweS1p.js";import{I as t,P as n,lt as r}from"./vscode-api-DjORcpSo.js";import{o as i}from"./statsig-BP9zNYqZ.js";import{n as a}from"./experimental-features-queries-DhyNRplU.js";import{a as o}from"./setting-storage-CwKZnsvR.js";import{t as s}from"./use-platform-D2c1wBYs.js";import{t as c}from"./browser-sidebar-availability-BiPWLG3p.js";var l=r();function u(e){let t=(0,l.c)(10),{hostId:r,featureName:i,defaultEnabled:o}=e,s=o===void 0?!0:o,{data:c,isLoading:u}=n(a,r),d;t[0]===c?d=t[1]:(d=c===void 0?[]:c,t[0]=c,t[1]=d);let f=d,p;if(t[2]!==i||t[3]!==f){let e;t[5]===i?e=t[6]:(e=e=>e.name===i,t[5]=i,t[6]=e),p=f.find(e),t[2]=i,t[3]=f,t[4]=p}else p=t[4];let m=p?.enabled??s,h;return t[7]!==u||t[8]!==m?(h={enabled:m,isLoading:u},t[7]=u,t[8]=m,t[9]=h):h=t[9],h}function d(e){return e===`macOS`||e===`windows`}function f(e){let t=(0,l.c)(14),{enabled:n,hostId:r}=e,a=n===void 0?!0:n,{isLoading:o,platform:c}=s(),f=i(`1506311413`),m;t[0]===r?m=t[1]:(m={featureName:`computer_use`,hostId:r},t[0]=r,t[1]=m);let h=u(m),g;t[2]!==h.enabled||t[3]!==h.isLoading||t[4]!==a||t[5]!==f||t[6]!==o||t[7]!==c?(g=p({enabled:a,isComputerUseFeatureEnabled:h.enabled,isComputerUseFeatureLoading:h.isLoading,isComputerUseGateEnabled:f,isHostCompatiblePlatform:d(c),isPlatformLoading:o,windowType:`electron`}),t[2]=h.enabled,t[3]=h.isLoading,t[4]=a,t[5]=f,t[6]=o,t[7]=c,t[8]=g):g=t[8];let _=g,v=_===`available`,y=_===`loading`&&h.isLoading,b=_===`loading`,x;return t[9]!==_||t[10]!==v||t[11]!==y||t[12]!==b?(x={available:v,isFetching:y,isLoading:b,reason:_},t[9]=_,t[10]=v,t[11]=y,t[12]=b,t[13]=x):x=t[13],x}function p({enabled:e,isComputerUseFeatureEnabled:t,isComputerUseFeatureLoading:n,isComputerUseGateEnabled:r,isHostCompatiblePlatform:i,isPlatformLoading:a,windowType:o}){return e?o===`electron`?r?a?`loading`:i?n?`loading`:t?`available`:`config-requirement-disabled`:`unsupported-platform`:`statsig-disabled`:`window-type-disabled`:`disabled`}function m(e){let t=(0,l.c)(5),{hostId:n,windowType:r}=e,a=r===void 0?`electron`:r,o=i(`410065390`),s;t[0]===n?s=t[1]:(s={featureName:`browser_use_external`,hostId:n},t[0]=n,t[1]=s);let c=u(s),d=a===`chrome-extension`||o&&c.enabled&&!c.isLoading,f=a===`chrome-extension`?!1:c.isLoading,p;return t[2]!==d||t[3]!==f?(p={allowed:d,available:d,isLoading:f},t[2]=d,t[3]=f,t[4]=p):p=t[4],p}function h(n){let r=(0,l.c)(13),{hostId:a}=n,s=t(c),d=i(`410262010`),f;r[0]===a?f=r[1]:(f={featureName:`browser_use`,hostId:a},r[0]=a,r[1]=f);let p=u(f),m=o(e.runCodexInWsl),h=p.enabled&&!p.isLoading,_=p.isLoading,v=m===!0,y;r[2]!==d||r[3]!==s||r[4]!==h||r[5]!==_||r[6]!==v?(y=g({isBrowserAgentGateEnabled:d,isBrowserSidebarEnabled:s,isBrowserUseEnabled:h,isLoading:_,runCodexInWsl:v,windowType:`electron`}),r[2]=d,r[3]=s,r[4]=h,r[5]=_,r[6]=v,r[7]=y):y=r[7];let b=y,x=b===`available`,S=b===`available`,C=b===`loading`,w;return r[8]!==b||r[9]!==x||r[10]!==S||r[11]!==C?(w={allowed:x,available:S,isLoading:C,reason:b},r[8]=b,r[9]=x,r[10]=S,r[11]=C,r[12]=w):w=r[12],w}function g({isBrowserAgentGateEnabled:e,isBrowserSidebarEnabled:t,isBrowserUseEnabled:n,isLoading:r,runCodexInWsl:i,windowType:a}){return a===`chrome-extension`?`window-type-disabled`:r?`loading`:t?e?n?i?`wsl-disabled`:`available`:`config-requirement-disabled`:`statsig-disabled`:`browser-pane-disabled`}var _=`plugins`;function v(e){let t=(0,l.c)(4),{hostId:r}=e,{data:i}=n(a,r),o;t[0]===i?o=t[1]:(o=i===void 0?[]:i,t[0]=i,t[1]=o);let s=o,c;return t[2]===s?c=t[3]:(c=s.find(y),t[2]=s,t[3]=c),c?.enabled??!0}function y(e){return e.name===_}export{u as a,f as i,h as n,m as r,v as t};
//# sourceMappingURL=use-is-plugins-enabled-CJvW81OO.js.map