@bodhiapp/bodhi-js-react-core 0.0.15 → 0.0.16

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.
@@ -1,4 +1,4 @@
1
- import { AuthState, LogLevel, UIClient } from '../../core/src/index.ts';
1
+ import { AuthState, LoginOptions, LogLevel, UIClient } from '../../core/src/index.ts';
2
2
  import { ReactNode } from 'react';
3
3
  import { ClientContextState } from './client-ctx';
4
4
  export type SetupState = 'ready' | 'loading' | 'loaded';
@@ -17,7 +17,7 @@ export interface BodhiContext {
17
17
  setupState: SetupState;
18
18
  auth: AuthState;
19
19
  isAuthLoading: boolean;
20
- login: () => Promise<AuthState | void>;
20
+ login: (options?: LoginOptions) => Promise<AuthState | void>;
21
21
  logout: () => Promise<void>;
22
22
  showSetup: () => Promise<void>;
23
23
  hideSetup: () => void;
@@ -8,7 +8,7 @@ export { BodhiBadge, type BodhiBadgeProps, type BodhiBadgeSize, type BodhiBadgeV
8
8
  export type { ClientContextState, ClientContextStatus } from './client-ctx';
9
9
  export { INITIAL_CLIENT_CONTEXT_STATE, INITIALIZING_CLIENT_CONTEXT_STATE } from './client-ctx';
10
10
  export { ClientCtxState, clientStateToContextState, isClientCtxInitialized, isClientCtxInitializing, isClientCtxNotInitialized, isClientCtxReady, isOverallReady, } from './client-ctx';
11
- export type { ApiResponseResult, ClientState } from '../../core/src/index.ts';
11
+ export type { ApiResponseResult, ClientState, LogLevel } from '../../core/src/index.ts';
12
12
  export { isApiResultError, isApiResultOperationError, isApiResultSuccess, isDirectState, isExtensionState, isWebUIClient, } from '../../core/src/index.ts';
13
13
  export { createApiError, createOperationError } from '../../core/src/index.ts';
14
14
  export type { AuthState, UIClient } from '../../core/src/index.ts';
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react/jsx-runtime"),s=require("@bodhiapp/bodhi-js-core"),r=require("react");function W(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const g in e)if(g!=="default"){const y=Object.getOwnPropertyDescriptor(e,g);Object.defineProperty(a,g,y.get?y:{enumerable:!0,get:()=>e[g]})}}return a.default=e,Object.freeze(a)}const i=W(r),q={serverInstall:!1},X={extension:{status:"not-installed",error:{message:"Loading...",code:"ext-not-installed"}},server:{status:"pending-extension-ready",error:{message:"Loading...",code:"server-pending-ext-ready"}},lna:{status:"prompt"},lnaServer:{status:"pending-lna-ready"},env:{browser:"unknown",os:"unknown"},browsers:[],os:[],userConfirmations:q,selectedConnection:null},A={MODAL_READY:"modal:ready",MODAL_REFRESH:"modal:refresh",MODAL_CLOSE:"modal:close",MODAL_COMPLETE:"modal:complete",MODAL_LNA_CONNECT:"modal:lna:connect",MODAL_LNA_SKIP:"modal:lna:skip",MODAL_CONFIRM_SERVER_INSTALL:"modal:confirm-server-install",MODAL_SELECT_CONNECTION:"modal:select-connection"};function Y({client:e,modalHtmlPath:a,hideSetup:g,onSetupReady:y,setupState:I,basePath:E="/",logLevel:m="warn"}){const M=I!=="ready",x=r.useMemo(()=>new s.Logger("SetupModalProcessor",m),[m]),o=r.useRef(null),f=r.useMemo(()=>new s.BodhiClientUserPrefsManager(s.createStoragePrefixWithBasePath(E,"bodhijs:")),[E]),b=r.useRef(null),S=r.useCallback(t=>t==="direct"?"lna":t==="extension"?"extension":null,[]),T=r.useCallback(t=>t.extension==="ready"?{status:"ready",version:"unknown",id:t.extensionId}:t.extension==="not-found"?{status:"not-installed",error:{message:"Extension not found",code:"ext-not-installed"}}:{status:"unreachable",error:{message:"Client not initialized",code:"ext-connection-failed"}},[]),L=r.useCallback(t=>{if(t.server.status==="pending-extension-ready")return{status:"pending-extension-ready",error:{message:"Extension not ready",code:"server-pending-ext-ready"}};const n=t.server;switch(n.status){case"ready":return{status:"ready",version:n.version||"unknown"};case"setup":return{status:"setup",version:n.version||"unknown",error:{message:n.error?.message||"Setup required",code:"server-in-setup-status"}};case"resource-admin":return{status:"resource-admin",version:n.version||"unknown",error:{message:n.error?.message||"Resource admin required",code:"server-in-admin-status"}};case"error":return{status:"error",error:{message:n.error?.message||"Unknown error",code:"server-unexpected-error"}};case"not-reachable":return{status:"unreachable",error:{message:n.error?.message||"Server not reachable",code:"server-conn-refused"}};default:return{status:"unreachable",error:{message:"Unknown server status",code:"server-unexpected-error"}}}},[]),v=r.useCallback(t=>{if(t.server.status==="not-connected")return{status:"pending-lna-ready"};const n=t.server;switch(n.status){case"ready":return{status:"ready",version:n.version||"unknown"};case"setup":return{status:"setup",version:n.version||"unknown"};case"resource-admin":return{status:"resource-admin",version:n.version||"unknown"};case"error":case"not-reachable":return{status:"error",error:{message:n.error?.message||"Connection error"}};default:return{status:"error",error:{message:"Unknown server status"}}}},[]),_=r.useCallback((t,n)=>{if(t.server.status!=="pending-extension-ready"){const c=t.server.status;if(c==="ready"||c==="setup"||c==="resource-admin")return!0}if(n.server.status!=="not-connected"){const c=n.server.status;if(c==="ready"||c==="setup"||c==="resource-admin")return!0}return!1},[]),O=r.useCallback((t,n,c)=>{if(n==="skipped")return{status:"skipped",serverUrl:c};if(t.server.status!=="not-connected"){const l=t.server;return l.status==="ready"||l.status==="setup"||l.status==="resource-admin"?{status:"granted",serverUrl:c}:{status:"unreachable",serverUrl:c,error:{message:l.error?.message||"Server unreachable",code:"lna-unreachable"}}}return n==="granted"?{status:"granted",serverUrl:c}:{status:"prompt",serverUrl:c}},[]),h=r.useCallback(async(t=!1)=>{const n=s.detectBrowser().type,c=s.detectOS().type;let l=await e.getExtensionState();(l.extension==="not-initialized"||t)&&(l=await e.testExtensionConnectivity());let C=await e.getDirectState();const w=f.getDirectStatus();w==="granted"&&(C.server.status==="not-connected"||t)&&(C=await e.testDirectConnectivity());const u=s.getServerUrl(C)||"http://localhost:1135",N=O(C,w,u);return e.getConnectionMode()===null&&(s.isDirectServerReady(C)?await e.setConnectionMode("direct"):s.isExtensionServerReady(l)&&await e.setConnectionMode("extension")),f.isServerInstallConfirmed()||_(l,C)&&f.setServerInstallConfirmed(!0),{extension:T(l),server:L(l),lna:N,lnaServer:v(C),env:{browser:n,os:c},browsers:s.BROWSER_CONFIGS,os:s.OS_CONFIGS,userConfirmations:{serverInstall:f.isServerInstallConfirmed()},selectedConnection:S(e.getConnectionMode())}},[e,f,T,L,v,S,O,_]),p=r.useCallback(()=>{if(!b.current)throw new Error("Cannot get state: currentStateRef is null");return{...b.current,userConfirmations:{serverInstall:f.isServerInstallConfirmed()},selectedConnection:S(e.getConnectionMode())}},[f,e,S]),R=r.useMemo(()=>({[A.MODAL_READY]:async()=>(x.info("MODAL_READY: returning current state or default"),b.current?{setupState:p()}:{setupState:X}),[A.MODAL_REFRESH]:async()=>{x.info("MODAL_REFRESH: refreshing state");const t=await h(!0);b.current=t;const n=p();return x.info(`MODAL_REFRESH: state refreshed
2
- `,JSON.stringify(n,null,2)),o.current?.updateState(p()),{setupState:n}},[A.MODAL_LNA_CONNECT]:async t=>{const n=t.payload.serverUrl;console.log("[SetupModalProcessor] LNA connect:",n);const c=await e.testDirectConnectivity(n);if(c.server.status!=="not-connected"){const C=c.server.status;if(C==="ready"||C==="setup"||C==="resource-admin"){f.setDirectStatus("granted"),e.getConnectionMode()===null&&await e.setConnectionMode("direct");const w=await h();return b.current=w,o.current?.updateState(p()),{success:!0}}}const l=await h();return b.current=l,o.current?.updateState(p()),{success:!1}},[A.MODAL_LNA_SKIP]:async()=>{f.setDirectStatus("skipped");const t=await h();return b.current=t,o.current?.updateState(p()),{success:!0}},[A.MODAL_CLOSE]:()=>{g()},[A.MODAL_COMPLETE]:()=>{g()},[A.MODAL_CONFIRM_SERVER_INSTALL]:t=>(f.setServerInstallConfirmed(t.payload.confirmed),o.current?.updateState(p()),{success:!0}),[A.MODAL_SELECT_CONNECTION]:async t=>{const c=t.payload.connection==="lna"?"direct":"extension";return await e.setConnectionMode(c),o.current?.updateState(p()),{success:!0}}}),[x,e,f,h,p,v,g]);return r.useEffect(()=>(o.current=new s.OnboardingModal({modalHtmlPath:a,handlers:R}),()=>{o.current?.destroy(),o.current=null}),[a,R]),r.useEffect(()=>{M&&o.current?(o.current.showLoading(),h(!0).then(t=>{b.current=t,o.current?.updateState(t),y?.()}).catch(t=>{console.error("[SetupModalProcessor] buildSetupState failed:",t)})):!M&&o.current&&o.current.destroy()},[M,h,y]),null}const j={status:"not-initialized",mode:null,extensionId:null,url:null,server:s.BACKEND_SERVER_NOT_CONNECTED,error:null},U={status:"initializing",mode:null,extensionId:null,url:null,server:s.BACKEND_SERVER_NOT_CONNECTED,error:null};function F(e){return e.status==="not-initialized"}function G(e){return e.status==="initializing"}function H(e){return e.status!=="not-initialized"&&e.status!=="initializing"}function P(e){return e.status==="ready"}function V(e){return P(e)&&e.server.status==="ready"}function K(e){return s.isExtensionState(e)?{status:e.extension==="not-initialized"?"initializing":e.extension==="not-found"?"extension-not-found":"ready",mode:"extension",extensionId:e.extensionId,url:null,server:e.server,error:e.server.error}:{status:e.url===null?"direct-not-connected":"ready",mode:"direct",extensionId:null,url:e.url,server:e.server,error:e.server.error}}const Z={isNotInitialized:F,isInitializing:G,isInitialized:H,isReady:P,isOverallReady:V},D=r.createContext(null);D.displayName="BodhiContext";function J({children:e,client:a,modalHtmlPath:g,handleCallback:y=!0,callbackPath:I,basePath:E="/",logLevel:m="warn"}){const M=E==="/"?"":E.replace(/\/$/,""),x=I??`${M}/callback`,o=r.useMemo(()=>new s.Logger("BodhiProvider",m),[m]),f=r.useRef(!1),b=r.useRef(!1),[S,T]=r.useState(j),[L,v]=r.useState(s.INITIAL_AUTH_STATE),[_,O]=r.useState(!1),[h,p]=r.useState("ready");r.useEffect(()=>{const d=u=>{switch(u.type){case"client-state":T(K(u.state));break;case"auth-state":v(u.state),O(!1);break}};return a.setStateCallback(d),()=>{a.setStateCallback(s.NOOP_STATE_CALLBACK)}},[a]);const R=r.useCallback(async()=>{p("loading")},[]),t=r.useCallback(()=>{p("ready")},[]),n=r.useCallback(()=>{p("loaded")},[]),c=r.useCallback(async d=>{T(U);try{await a.init(d||{})}catch(u){o.error("Init failed:",u)}},[a,o]);r.useEffect(()=>{if(b.current)return;b.current=!0,(async()=>{if(await c(),!y)return;const u=new URL(window.location.href);if(u.pathname!==x)return;const N=u.searchParams.get("code"),B=u.searchParams.get("state");!N||!B||f.current||(f.current=!0,s.isWebUIClient(a)&&(O(!0),a.handleOAuthCallback(N,B).then(()=>{window.history.replaceState({},"",E)}).catch(z=>{o.error("OAuth callback failed:",z),v({status:"error",user:null,accessToken:null,error:{message:z instanceof Error?z.message:"OAuth callback failed",code:"OAUTH_CALLBACK_FAILED"}}),O(!1),window.history.replaceState({},"",E)})))})()},[c,a,y,x,E]);const l=r.useCallback(async()=>{O(!0);try{await a.login()}catch(d){const u={status:"error",user:null,accessToken:null,error:{message:d instanceof Error?d.message:"Login failed",code:"LOGIN_FAILED"}};return v(u),O(!1),u}},[a]),C=r.useCallback(async()=>{try{await a.logout()}catch(d){v({status:"error",user:null,accessToken:null,error:{message:d instanceof Error?d.message:"Logout failed",code:"LOGOUT_FAILED"}})}},[a]),w=r.useMemo(()=>{const d=S.status==="ready",u=S.server.status==="ready";return{client:a,clientState:S,auth:L,isAuthLoading:_,login:l,logout:C,showSetup:R,hideSetup:t,setupState:h,isAuthenticated:L.status==="authenticated",canLogin:d&&!_,isReady:d,isServerReady:u,isOverallReady:d&&u,isInitializing:S.status==="initializing",isExtension:S.mode==="extension",isDirect:S.mode==="direct"}},[a,S,L,_,h,l,C,R,t]);return k.jsxs(D.Provider,{value:w,children:[k.jsx(Y,{client:a,modalHtmlPath:g,hideSetup:t,onSetupReady:n,setupState:h,basePath:E,logLevel:m}),e]})}function $(){const e=r.useContext(D);if(!e)throw new Error("useBodhi must be used within BodhiProvider");return e}const Q=e=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 479.995 479.995",width:"480px",height:"480px",...e},i.createElement("path",{fill:"#ffa4b8",d:"M239.998,374.56l-0.01-0.01c0-0.01,0.01-0.01,0.01-0.02c-4.64-8.78-65.7-144.8-212.22-85.2 c-14.36,5.85-19.78,23.45-11.19,36.36c11.11,16.69,22.86,30.01,34.91,40.53c-27.85,7.89-45.6,33.8-43.3,61.55 c0.96,11.6,13.29,18.52,23.71,13.35c33.99-16.84,60.03-2.51,80.35,2.14c56.68,12.99,113.71,4.53,125.52-46.29 c0.52-2.22,0.95-4.51,1.28-6.89c0.01-0.04,0.01-0.08,0.02-0.12c0.066-0.492,0.126-0.978,0.181-1.458 c0.455-3.631,0.712-7.438,0.739-11.452c-0.02-1.44-0.02-2.01,0-2.25v-0.09c0-0.02,0-0.04,0.01-0.05c0-0.02,0.01-0.03,0.02-0.06 c0-0.01,0.01-0.01,0.01-0.02C240.018,374.569,240.008,374.56,239.998,374.56z"}),i.createElement("path",{fill:"#ffa4b8",d:"M471.798,427.769c-0.96,11.6-13.29,18.52-23.71,13.35c-33.99-16.84-60.03-2.51-80.35,2.14 c-63.41,14.53-127.25,2.22-127.74-66.21c0.033-2.642-0.044-2.302,0.04-2.47c-0.02-0.01-0.03-0.02-0.04-0.02l0.01-0.01 c0-0.01-0.01-0.01-0.01-0.02c4.64-8.78,65.7-144.8,212.22-85.2c14.36,5.85,19.78,23.45,11.19,36.36 c-11.11,16.69-22.86,30.01-34.91,40.53C456.348,374.109,474.098,400.019,471.798,427.769z"}),i.createElement("path",{fill:"#befa91",d:"M428.498,366.219c27.85,7.89,45.6,33.8,43.3,61.55c-0.96,11.6-13.29,18.52-23.71,13.35 c-33.99-16.84-60.03-2.51-80.35,2.14c-63.41,14.53-127.928,2.222-127.74-66.21c0.007-2.683-0.02-2.351,0.04-2.47 C248.598,379.129,345.858,438.329,428.498,366.219z"}),i.createElement("path",{fill:"#befa91",d:"M51.498,366.219c82.76,72.22,180.18,12.74,188.5,8.34c0.01,0,0.02,0.01,0.04,0.02 c-0.058,0.116-0.047-0.169-0.04,2.47c0.188,68.432-64.33,80.74-127.74,66.21c-20.32-4.65-46.36-18.98-80.35-2.14 c-10.42,5.17-22.75-1.75-23.71-13.35C5.898,400.019,23.648,374.109,51.498,366.219z"}),i.createElement("path",{fill:"#ffbfcb",d:"M235.228,365.299c-32.29-36.09-89.98-73-179.74-36.49c-1.979,0.805-3.787,1.834-5.413,3.042 c-10.569,7.856-25.473,5.765-32.82-5.164c-0.223-0.331-0.445-0.664-0.667-0.997c-8.59-12.91-3.17-30.51,11.19-36.36 C155.168,237.509,217.948,333.56,235.228,365.299z"}),i.createElement("path",{fill:"#ffa4b8",d:"M239.998,374.549c-12.85-2.2-214.54-23.33-193.03-240.71c1.49-14.99,15.86-25.15,30.48-21.55 c108.49,26.72,149.07,91.39,162.55,149.92C252.768,317.699,241.178,367.679,239.998,374.549z"}),i.createElement("path",{fill:"#ffbfcb",d:"M193.698,174.638c11.866,12.406-3.013,31.792-18.056,23.52 c-21.875-12.028-50.044-10.573-70.207,3.701c-24.832,17.579-59.398-0.365-60.013-30.784c-0.237-11.724,0.248-24.123,1.545-37.237 c1.49-14.99,15.86-25.15,30.48-21.55C131.23,125.537,168.324,148.11,193.698,174.638z"}),i.createElement("path",{fill:"#ffa4b8",d:"M221.538,39.599c9.78-11.13,27.15-11.12,36.93,0.01c157.02,178.77-7.48,323.95-18.47,334.94 C229.988,364.549,63.948,218.989,221.538,39.599z"}),i.createElement("path",{fill:"#ffbfcb",d:"M261.523,43.131c9.452,11.033,8.166,27.623-2.74,37.221c-0.784,0.69-1.535,1.439-2.245,2.247 c-35.942,40.915-55.05,80.07-63.012,116.258c-5.176,23.523-39.936,19.717-39.551-4.366c0.741-46.282,18.411-98.941,67.563-154.892 c9.78-11.13,27.15-11.12,36.93,0.01C259.5,40.785,260.518,41.959,261.523,43.131z"}),i.createElement("path",{fill:"#ffa4b8",d:"M239.998,374.549c-1.18-6.87-12.77-56.85,0-112.34c13.48-58.53,54.06-123.2,162.55-149.92 c14.62-3.6,28.99,6.56,30.48,21.55C454.538,351.219,252.848,372.349,239.998,374.549z"}),i.createElement("path",{fill:"#ff8ca5",d:"M239.998,374.549c-3.115-0.536-17.362-2.183-36.835-7.483c-3.181-0.866-6.028-2.682-8.145-5.209 c-49.098-58.608-75.675-130.75-61.047-205.793c2.165-11.107,14.881-16.444,24.408-10.337c0.756,0.485,1.506,0.972,2.249,1.462 C126.798,274.139,232.088,366.649,239.998,374.549z"}),i.createElement("path",{fill:"#ff8ca5",d:"M281.608,365.729c-21.9,6.37-38.24,8.25-41.61,8.82c8.67-8.67,112.98-100.94,79.35-227.34v-0.01 c0.742-0.489,1.49-0.975,2.244-1.459c9.551-6.123,22.265-0.733,24.422,10.406C369.565,277.734,281.608,363.204,281.608,365.729z"}),i.createElement("path",{fill:"#ff8ca5",d:"M417.451,302.932c-32.211,44.193-80.706,72.823-134.571,87.345c-3.396,0.916-6.999,0.754-10.3-0.463 c-20.772-7.664-31.911-15.254-32.583-15.254c0.826-0.825,112.667-9.463,166.4-98.31C419.37,278.279,424.743,292.927,417.451,302.932 z"}),i.createElement("path",{fill:"#ff8ca5",d:"M62.565,302.932c32.211,44.193,80.705,72.823,134.571,87.345c3.396,0.916,6.999,0.754,10.3-0.463 c20.772-7.664,31.911-15.254,32.583-15.254c-0.828-0.828-112.665-9.458-166.4-98.31C60.646,278.279,55.273,292.927,62.565,302.932z"}),i.createElement("path",{fill:"#9ceb63",d:"M433.464,393.091c-52.749,39.415-118.979,42.09-182.861,13.657 c-4.441-1.977-7.606-6.011-8.633-10.763c-1.552-7.18-1.884-14.238-1.973-21.326c0.172-0.345,9.566,5.934,26.76,12.89 c36.31,14.71,102.75,30.15,161.74-21.33C440.977,369.752,443.403,385.664,433.464,393.091z"}),i.createElement("path",{fill:"#9ceb63",d:"M240.038,374.579c0,0.01-0.01,0.01-0.01,0.02s-0.01,0.03-0.01,0.05c0,0,0,0,0,0.01 c-0.01,0.03-0.01,0.06-0.02,0.1v0.04c-0.13,1.3,0.09,7.59-0.92,15.16c-0.01,0.04-0.01,0.08-0.02,0.12 c-0.26,1.91-0.59,3.91-1.03,5.92c-0.07,0.33-0.15,0.65-0.25,0.97c-1.23,4.33-4.28,7.95-8.41,9.79 c-63.06,28.05-129.47,26.21-182.79-13.63c-9.94-7.43-7.63-23.36,4.92-26.91c13.1,11.46,28.11,20.79,44.16,26.79 c19.78,7.48,34.99,8.98,53.83,8.68c34.33-0.55,60.1-11.03,90.51-27.13C240.008,374.56,240.018,374.569,240.038,374.579z"}),i.createElement("path",{d:"M443.143,363.426c9.579-9.648,18.604-20.804,26.926-33.305c11.399-17.132,4.201-40.447-14.837-48.202 c-12.321-5.012-24.515-8.844-36.391-11.454c17.945-34.197,27.974-78.94,22.188-137.413c-1.925-19.503-20.802-33.354-40.394-28.53 c-17.952,4.421-34.806,10.063-50.093,16.768c-4.046,1.775-5.888,6.494-4.113,10.54c1.774,4.046,6.493,5.887,10.54,4.113 c14.45-6.338,30.429-11.682,47.492-15.885c9.885-2.435,19.599,4.434,20.607,14.573c9.088,90.121-21.147,164.341-99.823,205.213 c-3.921,2.037-5.448,6.866-3.411,10.787c2.043,3.933,6.879,5.442,10.787,3.411c27.191-14.125,56.267-35.849,77.701-68.994 c12.564,2.375,25.617,6.296,38.878,11.69c9.68,3.943,13.334,15.824,7.549,24.518c-10.205,15.33-21.482,28.43-33.516,38.936 c-49.396,43.107-111.979,41.39-169.834,12.419c56.638-56.971,92.247-132.34,77.074-212.524 c-8.101-42.81-30.305-85.119-65.997-125.754c-12.964-14.759-36.003-14.748-48.946-0.016 c-28.645,32.607-48.657,66.371-59.602,100.512c-21.999-13.018-47.7-23.197-76.569-30.307c-19.338-4.763-38.383,8.699-40.354,28.53 C26.197,262.501,90.89,324.677,147.416,354.042c3.92,2.036,8.75,0.51,10.787-3.411c2.037-3.921,0.51-8.75-3.411-10.787 c-52.141-27.086-111.791-84.677-99.863-205.213c1.007-10.132,10.713-17.01,20.606-14.574c31.115,7.663,58.223,19.013,80.571,33.735 c4.863,3.204,10.891,0.586,12.257-4.539c9.392-35.245,29.306-70.362,59.188-104.378c6.581-7.492,18.316-7.487,24.904,0.014 c128.735,146.565,37.449,269.122-12.476,318.519c-30.274-29.828-76.759-87.727-78.002-162.831 c-0.073-4.417-3.698-7.933-8.131-7.867c-4.417,0.073-7.939,3.714-7.867,8.131c1.382,83.483,54.096,146.516,85.999,177.099 c-0.353,20.737-7.099,36.575-20.104,47.086c-20.129,16.267-55.786,20.072-97.831,10.438c-19.181-4.396-48.632-19.874-85.688-1.511 c-5.361,2.657-11.689-0.859-12.186-6.844c-1.888-22.74,12.042-43.926,33.548-51.893c13.4,11.096,27.797,19.551,43.11,25.275 c20.238,7.653,36.036,9.525,56.788,9.196c15.85-0.254,30.814-2.572,45.747-7.085c4.229-1.278,6.622-5.743,5.343-9.972 c-1.278-4.229-5.744-6.622-9.972-5.344c-13.494,4.078-27.027,6.173-41.373,6.403c-17.347,0.275-31.911-0.993-50.901-8.174 c-31.69-11.847-56.387-35.98-75.211-64.258c-5.791-8.704-2.122-20.58,7.548-24.52c4.092-1.667,6.058-6.335,4.391-10.427 c-1.667-4.092-6.334-6.058-10.427-4.391c-19.062,7.765-26.214,31.095-14.832,48.202c8.365,12.566,17.352,23.674,26.917,33.31 C12.89,375.664-2.037,401.187,0.226,428.434c1.427,17.192,19.743,27.533,35.235,19.857c30.84-15.283,54.311-1.971,75.01,2.771 c36.708,8.411,82.166,10.086,111.461-13.59c14.777-11.943,23.305-28.715,25.489-49.937 c61.607,30.736,128.694,32.482,182.835-12.326c21.516,7.959,35.456,29.153,33.567,51.902c-0.493,5.939-6.786,9.519-12.186,6.844 c-30.339-15.034-55.535-7.379-73.932-1.791c-31.306,9.51-74.736,14.144-102.884-2.498c-3.803-2.248-8.709-0.989-10.958,2.815 c-2.249,3.803-0.989,8.709,2.815,10.958c29.214,17.272,69.817,15.19,102.844,7.622c20.72-4.747,44.177-18.05,75.01-2.771 c15.523,7.691,33.811-2.693,35.235-19.856C482.032,401.183,467.102,375.655,443.143,363.426z"})),ee={sm:32,md:48,lg:64};function te({size:e="md",variant:a="light",className:g="",style:y={}}){const I=ee[e],E={display:"inline-block",cursor:"pointer",transition:"all 250ms ease",borderRadius:"50%",...a==="dark"&&{backgroundColor:"rgba(255, 255, 255, 0.05)",padding:"8px"},...y};return k.jsx("a",{href:"https://getbodhi.app",target:"_blank",rel:"noopener noreferrer",title:"Powered by Bodhi","aria-label":"Powered by Bodhi - Visit getbodhi.app",className:g,style:E,onMouseEnter:m=>{m.currentTarget.style.transform="scale(1.1)",m.currentTarget.style.boxShadow="0 0 20px rgba(255, 164, 184, 0.6)"},onMouseLeave:m=>{m.currentTarget.style.transform="scale(1)",m.currentTarget.style.boxShadow="none"},children:k.jsx(Q,{width:I,height:I,style:{display:"block"}})})}const re="production";Object.defineProperty(exports,"createApiError",{enumerable:!0,get:()=>s.createApiError});Object.defineProperty(exports,"createOperationError",{enumerable:!0,get:()=>s.createOperationError});Object.defineProperty(exports,"isApiResultError",{enumerable:!0,get:()=>s.isApiResultError});Object.defineProperty(exports,"isApiResultOperationError",{enumerable:!0,get:()=>s.isApiResultOperationError});Object.defineProperty(exports,"isApiResultSuccess",{enumerable:!0,get:()=>s.isApiResultSuccess});Object.defineProperty(exports,"isAuthError",{enumerable:!0,get:()=>s.isAuthError});Object.defineProperty(exports,"isAuthLoading",{enumerable:!0,get:()=>s.isAuthLoading});Object.defineProperty(exports,"isAuthenticated",{enumerable:!0,get:()=>s.isAuthenticated});Object.defineProperty(exports,"isClientReady",{enumerable:!0,get:()=>s.isClientReady});Object.defineProperty(exports,"isDirectState",{enumerable:!0,get:()=>s.isDirectState});Object.defineProperty(exports,"isExtensionState",{enumerable:!0,get:()=>s.isExtensionState});Object.defineProperty(exports,"isOperationError",{enumerable:!0,get:()=>s.isOperationError});Object.defineProperty(exports,"isWebUIClient",{enumerable:!0,get:()=>s.isWebUIClient});exports.BodhiBadge=te;exports.BodhiProvider=J;exports.BodhiReactContext=D;exports.ClientCtxState=Z;exports.INITIALIZING_CLIENT_CONTEXT_STATE=U;exports.INITIAL_CLIENT_CONTEXT_STATE=j;exports.REACT_CORE_BUILD_MODE=re;exports.clientStateToContextState=K;exports.isClientCtxInitialized=H;exports.isClientCtxInitializing=G;exports.isClientCtxNotInitialized=F;exports.isClientCtxReady=P;exports.isOverallReady=V;exports.useBodhi=$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react/jsx-runtime"),s=require("@bodhiapp/bodhi-js-core"),r=require("react");function W(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const g in e)if(g!=="default"){const y=Object.getOwnPropertyDescriptor(e,g);Object.defineProperty(a,g,y.get?y:{enumerable:!0,get:()=>e[g]})}}return a.default=e,Object.freeze(a)}const l=W(r),q={serverInstall:!1},X={extension:{status:"not-installed",error:{message:"Loading...",code:"ext-not-installed"}},server:{status:"pending-extension-ready",error:{message:"Loading...",code:"server-pending-ext-ready"}},lna:{status:"prompt"},lnaServer:{status:"pending-lna-ready"},env:{browser:"unknown",os:"unknown"},browsers:[],os:[],userConfirmations:q,selectedConnection:null},x={MODAL_READY:"modal:ready",MODAL_REFRESH:"modal:refresh",MODAL_CLOSE:"modal:close",MODAL_COMPLETE:"modal:complete",MODAL_LNA_CONNECT:"modal:lna:connect",MODAL_LNA_SKIP:"modal:lna:skip",MODAL_CONFIRM_SERVER_INSTALL:"modal:confirm-server-install",MODAL_SELECT_CONNECTION:"modal:select-connection"};function Y({client:e,modalHtmlPath:a,hideSetup:g,onSetupReady:y,setupState:L,basePath:E="/",logLevel:S="warn"}){const T=L!=="ready",I=r.useMemo(()=>new s.Logger("SetupModalProcessor",S),[S]),i=r.useRef(null),f=r.useMemo(()=>new s.BodhiClientUserPrefsManager(s.createStoragePrefixWithBasePath(E,"bodhijs:")),[E]),b=r.useRef(null),m=r.useCallback(t=>t==="direct"?"lna":t==="extension"?"extension":null,[]),R=r.useCallback(t=>t.extension==="ready"?{status:"ready",version:"unknown",id:t.extensionId}:t.extension==="not-found"?{status:"not-installed",error:{message:"Extension not found",code:"ext-not-installed"}}:{status:"unreachable",error:{message:"Client not initialized",code:"ext-connection-failed"}},[]),_=r.useCallback(t=>{if(t.server.status==="pending-extension-ready")return{status:"pending-extension-ready",error:{message:"Extension not ready",code:"server-pending-ext-ready"}};const n=t.server;switch(n.status){case"ready":return{status:"ready",version:n.version||"unknown"};case"setup":return{status:"setup",version:n.version||"unknown",error:{message:n.error?.message||"Setup required",code:"server-in-setup-status"}};case"resource-admin":return{status:"resource-admin",version:n.version||"unknown",error:{message:n.error?.message||"Resource admin required",code:"server-in-admin-status"}};case"error":return{status:"error",error:{message:n.error?.message||"Unknown error",code:"server-unexpected-error"}};case"not-reachable":return{status:"unreachable",error:{message:n.error?.message||"Server not reachable",code:"server-conn-refused"}};default:return{status:"unreachable",error:{message:"Unknown server status",code:"server-unexpected-error"}}}},[]),O=r.useCallback(t=>{if(t.server.status==="not-connected")return{status:"pending-lna-ready"};const n=t.server;switch(n.status){case"ready":return{status:"ready",version:n.version||"unknown"};case"setup":return{status:"setup",version:n.version||"unknown"};case"resource-admin":return{status:"resource-admin",version:n.version||"unknown"};case"error":case"not-reachable":return{status:"error",error:{message:n.error?.message||"Connection error"}};default:return{status:"error",error:{message:"Unknown server status"}}}},[]),w=r.useCallback((t,n)=>{if(t.server.status!=="pending-extension-ready"){const c=t.server.status;if(c==="ready"||c==="setup"||c==="resource-admin")return!0}if(n.server.status!=="not-connected"){const c=n.server.status;if(c==="ready"||c==="setup"||c==="resource-admin")return!0}return!1},[]),A=r.useCallback((t,n,c)=>{if(n==="skipped")return{status:"skipped",serverUrl:c};if(t.server.status!=="not-connected"){const d=t.server;return d.status==="ready"||d.status==="setup"||d.status==="resource-admin"?{status:"granted",serverUrl:c}:{status:"unreachable",serverUrl:c,error:{message:d.error?.message||"Server unreachable",code:"lna-unreachable"}}}return n==="granted"?{status:"granted",serverUrl:c}:{status:"prompt",serverUrl:c}},[]),h=r.useCallback(async(t=!1)=>{const n=s.detectBrowser().type,c=s.detectOS().type;let d=await e.getExtensionState();(d.extension==="not-initialized"||t)&&(d=await e.testExtensionConnectivity());let C=await e.getDirectState();const M=f.getDirectStatus();M==="granted"&&(C.server.status==="not-connected"||t)&&(C=await e.testDirectConnectivity());const o=s.getServerUrl(C)||"http://localhost:1135",v=A(C,M,o);return e.getConnectionMode()===null&&(s.isDirectServerReady(C)?await e.setConnectionMode("direct"):s.isExtensionServerReady(d)&&await e.setConnectionMode("extension")),f.isServerInstallConfirmed()||w(d,C)&&f.setServerInstallConfirmed(!0),{extension:R(d),server:_(d),lna:v,lnaServer:O(C),env:{browser:n,os:c},browsers:s.BROWSER_CONFIGS,os:s.OS_CONFIGS,userConfirmations:{serverInstall:f.isServerInstallConfirmed()},selectedConnection:m(e.getConnectionMode())}},[e,f,R,_,O,m,A,w]),p=r.useCallback(()=>{if(!b.current)throw new Error("Cannot get state: currentStateRef is null");return{...b.current,userConfirmations:{serverInstall:f.isServerInstallConfirmed()},selectedConnection:m(e.getConnectionMode())}},[f,e,m]),N=r.useMemo(()=>({[x.MODAL_READY]:async()=>(I.info("MODAL_READY: returning current state or default"),b.current?{setupState:p()}:{setupState:X}),[x.MODAL_REFRESH]:async()=>{I.info("MODAL_REFRESH: refreshing state");const t=await h(!0);b.current=t;const n=p();return I.info(`MODAL_REFRESH: state refreshed
2
+ `,JSON.stringify(n,null,2)),i.current?.updateState(p()),{setupState:n}},[x.MODAL_LNA_CONNECT]:async t=>{const n=t.payload.serverUrl;console.log("[SetupModalProcessor] LNA connect:",n);const c=await e.testDirectConnectivity(n);if(c.server.status!=="not-connected"){const C=c.server.status;if(C==="ready"||C==="setup"||C==="resource-admin"){f.setDirectStatus("granted"),e.getConnectionMode()===null&&await e.setConnectionMode("direct");const M=await h();return b.current=M,i.current?.updateState(p()),{success:!0}}}const d=await h();return b.current=d,i.current?.updateState(p()),{success:!1}},[x.MODAL_LNA_SKIP]:async()=>{f.setDirectStatus("skipped");const t=await h();return b.current=t,i.current?.updateState(p()),{success:!0}},[x.MODAL_CLOSE]:()=>{g()},[x.MODAL_COMPLETE]:()=>{g()},[x.MODAL_CONFIRM_SERVER_INSTALL]:t=>(f.setServerInstallConfirmed(t.payload.confirmed),i.current?.updateState(p()),{success:!0}),[x.MODAL_SELECT_CONNECTION]:async t=>{const c=t.payload.connection==="lna"?"direct":"extension";return await e.setConnectionMode(c),i.current?.updateState(p()),{success:!0}}}),[I,e,f,h,p,O,g]);return r.useEffect(()=>(i.current=new s.OnboardingModal({modalHtmlPath:a,handlers:N}),()=>{i.current?.destroy(),i.current=null}),[a,N]),r.useEffect(()=>{T&&i.current?(i.current.showLoading(),h(!0).then(t=>{b.current=t,i.current?.updateState(t),y?.()}).catch(t=>{console.error("[SetupModalProcessor] buildSetupState failed:",t)})):!T&&i.current&&i.current.destroy()},[T,h,y]),null}const j={status:"not-initialized",mode:null,extensionId:null,url:null,server:s.BACKEND_SERVER_NOT_CONNECTED,error:null},U={status:"initializing",mode:null,extensionId:null,url:null,server:s.BACKEND_SERVER_NOT_CONNECTED,error:null};function F(e){return e.status==="not-initialized"}function G(e){return e.status==="initializing"}function H(e){return e.status!=="not-initialized"&&e.status!=="initializing"}function P(e){return e.status==="ready"}function V(e){return P(e)&&e.server.status==="ready"}function K(e){return s.isExtensionState(e)?{status:e.extension==="not-initialized"?"initializing":e.extension==="not-found"?"extension-not-found":"ready",mode:"extension",extensionId:e.extensionId,url:null,server:e.server,error:e.server.error}:{status:e.url===null?"direct-not-connected":"ready",mode:"direct",extensionId:null,url:e.url,server:e.server,error:e.server.error}}const Z={isNotInitialized:F,isInitializing:G,isInitialized:H,isReady:P,isOverallReady:V},D=r.createContext(null);D.displayName="BodhiContext";function J({children:e,client:a,modalHtmlPath:g,handleCallback:y=!0,callbackPath:L,basePath:E="/",logLevel:S="warn"}){const T=E==="/"?"":E.replace(/\/$/,""),I=L??`${T}/callback`,i=r.useMemo(()=>new s.Logger("BodhiProvider",S),[S]),f=r.useRef(!1),b=r.useRef(!1),[m,R]=r.useState(j),[_,O]=r.useState(s.INITIAL_AUTH_STATE),[w,A]=r.useState(!1),[h,p]=r.useState("ready");r.useEffect(()=>{const u=o=>{switch(o.type){case"client-state":R(K(o.state));break;case"auth-state":O(o.state),A(!1);break}};return a.setStateCallback(u),()=>{a.setStateCallback(s.NOOP_STATE_CALLBACK)}},[a]);const N=r.useCallback(async()=>{p("loading")},[]),t=r.useCallback(()=>{p("ready")},[]),n=r.useCallback(()=>{p("loaded")},[]),c=r.useCallback(async u=>{R(U);try{await a.init(u||{})}catch(o){i.error("Init failed:",o)}},[a,i]);r.useEffect(()=>{if(b.current)return;b.current=!0,(async()=>{if(await c(),!y)return;const o=new URL(window.location.href);if(o.pathname!==I)return;const v=o.searchParams.get("code"),B=o.searchParams.get("state");!v||!B||f.current||(f.current=!0,s.isWebUIClient(a)&&(A(!0),a.handleOAuthCallback(v,B).then(()=>{window.history.replaceState({},"",E)}).catch(z=>{i.error("OAuth callback failed:",z),O({status:"error",user:null,accessToken:null,error:{message:z instanceof Error?z.message:"OAuth callback failed",code:"OAUTH_CALLBACK_FAILED"}}),A(!1),window.history.replaceState({},"",E)})))})()},[c,a,y,I,E]);const d=r.useCallback(async u=>{A(!0);try{const o=u?{...u.toolsetScopeIds&&{toolsetScopeIds:u.toolsetScopeIds},...u.version&&{version:u.version}}:void 0,v=o&&Object.keys(o).length>0?o:void 0;await a.login(v)}catch(o){const v={status:"error",user:null,accessToken:null,error:{message:o instanceof Error?o.message:"Login failed",code:"LOGIN_FAILED"}};return O(v),A(!1),v}},[a]),C=r.useCallback(async()=>{try{await a.logout()}catch(u){O({status:"error",user:null,accessToken:null,error:{message:u instanceof Error?u.message:"Logout failed",code:"LOGOUT_FAILED"}})}},[a]),M=r.useMemo(()=>{const u=m.status==="ready",o=m.server.status==="ready";return{client:a,clientState:m,auth:_,isAuthLoading:w,login:d,logout:C,showSetup:N,hideSetup:t,setupState:h,isAuthenticated:_.status==="authenticated",canLogin:u&&!w,isReady:u,isServerReady:o,isOverallReady:u&&o,isInitializing:m.status==="initializing",isExtension:m.mode==="extension",isDirect:m.mode==="direct"}},[a,m,_,w,h,d,C,N,t]);return k.jsxs(D.Provider,{value:M,children:[k.jsx(Y,{client:a,modalHtmlPath:g,hideSetup:t,onSetupReady:n,setupState:h,basePath:E,logLevel:S}),e]})}function $(){const e=r.useContext(D);if(!e)throw new Error("useBodhi must be used within BodhiProvider");return e}const Q=e=>l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 479.995 479.995",width:"480px",height:"480px",...e},l.createElement("path",{fill:"#ffa4b8",d:"M239.998,374.56l-0.01-0.01c0-0.01,0.01-0.01,0.01-0.02c-4.64-8.78-65.7-144.8-212.22-85.2 c-14.36,5.85-19.78,23.45-11.19,36.36c11.11,16.69,22.86,30.01,34.91,40.53c-27.85,7.89-45.6,33.8-43.3,61.55 c0.96,11.6,13.29,18.52,23.71,13.35c33.99-16.84,60.03-2.51,80.35,2.14c56.68,12.99,113.71,4.53,125.52-46.29 c0.52-2.22,0.95-4.51,1.28-6.89c0.01-0.04,0.01-0.08,0.02-0.12c0.066-0.492,0.126-0.978,0.181-1.458 c0.455-3.631,0.712-7.438,0.739-11.452c-0.02-1.44-0.02-2.01,0-2.25v-0.09c0-0.02,0-0.04,0.01-0.05c0-0.02,0.01-0.03,0.02-0.06 c0-0.01,0.01-0.01,0.01-0.02C240.018,374.569,240.008,374.56,239.998,374.56z"}),l.createElement("path",{fill:"#ffa4b8",d:"M471.798,427.769c-0.96,11.6-13.29,18.52-23.71,13.35c-33.99-16.84-60.03-2.51-80.35,2.14 c-63.41,14.53-127.25,2.22-127.74-66.21c0.033-2.642-0.044-2.302,0.04-2.47c-0.02-0.01-0.03-0.02-0.04-0.02l0.01-0.01 c0-0.01-0.01-0.01-0.01-0.02c4.64-8.78,65.7-144.8,212.22-85.2c14.36,5.85,19.78,23.45,11.19,36.36 c-11.11,16.69-22.86,30.01-34.91,40.53C456.348,374.109,474.098,400.019,471.798,427.769z"}),l.createElement("path",{fill:"#befa91",d:"M428.498,366.219c27.85,7.89,45.6,33.8,43.3,61.55c-0.96,11.6-13.29,18.52-23.71,13.35 c-33.99-16.84-60.03-2.51-80.35,2.14c-63.41,14.53-127.928,2.222-127.74-66.21c0.007-2.683-0.02-2.351,0.04-2.47 C248.598,379.129,345.858,438.329,428.498,366.219z"}),l.createElement("path",{fill:"#befa91",d:"M51.498,366.219c82.76,72.22,180.18,12.74,188.5,8.34c0.01,0,0.02,0.01,0.04,0.02 c-0.058,0.116-0.047-0.169-0.04,2.47c0.188,68.432-64.33,80.74-127.74,66.21c-20.32-4.65-46.36-18.98-80.35-2.14 c-10.42,5.17-22.75-1.75-23.71-13.35C5.898,400.019,23.648,374.109,51.498,366.219z"}),l.createElement("path",{fill:"#ffbfcb",d:"M235.228,365.299c-32.29-36.09-89.98-73-179.74-36.49c-1.979,0.805-3.787,1.834-5.413,3.042 c-10.569,7.856-25.473,5.765-32.82-5.164c-0.223-0.331-0.445-0.664-0.667-0.997c-8.59-12.91-3.17-30.51,11.19-36.36 C155.168,237.509,217.948,333.56,235.228,365.299z"}),l.createElement("path",{fill:"#ffa4b8",d:"M239.998,374.549c-12.85-2.2-214.54-23.33-193.03-240.71c1.49-14.99,15.86-25.15,30.48-21.55 c108.49,26.72,149.07,91.39,162.55,149.92C252.768,317.699,241.178,367.679,239.998,374.549z"}),l.createElement("path",{fill:"#ffbfcb",d:"M193.698,174.638c11.866,12.406-3.013,31.792-18.056,23.52 c-21.875-12.028-50.044-10.573-70.207,3.701c-24.832,17.579-59.398-0.365-60.013-30.784c-0.237-11.724,0.248-24.123,1.545-37.237 c1.49-14.99,15.86-25.15,30.48-21.55C131.23,125.537,168.324,148.11,193.698,174.638z"}),l.createElement("path",{fill:"#ffa4b8",d:"M221.538,39.599c9.78-11.13,27.15-11.12,36.93,0.01c157.02,178.77-7.48,323.95-18.47,334.94 C229.988,364.549,63.948,218.989,221.538,39.599z"}),l.createElement("path",{fill:"#ffbfcb",d:"M261.523,43.131c9.452,11.033,8.166,27.623-2.74,37.221c-0.784,0.69-1.535,1.439-2.245,2.247 c-35.942,40.915-55.05,80.07-63.012,116.258c-5.176,23.523-39.936,19.717-39.551-4.366c0.741-46.282,18.411-98.941,67.563-154.892 c9.78-11.13,27.15-11.12,36.93,0.01C259.5,40.785,260.518,41.959,261.523,43.131z"}),l.createElement("path",{fill:"#ffa4b8",d:"M239.998,374.549c-1.18-6.87-12.77-56.85,0-112.34c13.48-58.53,54.06-123.2,162.55-149.92 c14.62-3.6,28.99,6.56,30.48,21.55C454.538,351.219,252.848,372.349,239.998,374.549z"}),l.createElement("path",{fill:"#ff8ca5",d:"M239.998,374.549c-3.115-0.536-17.362-2.183-36.835-7.483c-3.181-0.866-6.028-2.682-8.145-5.209 c-49.098-58.608-75.675-130.75-61.047-205.793c2.165-11.107,14.881-16.444,24.408-10.337c0.756,0.485,1.506,0.972,2.249,1.462 C126.798,274.139,232.088,366.649,239.998,374.549z"}),l.createElement("path",{fill:"#ff8ca5",d:"M281.608,365.729c-21.9,6.37-38.24,8.25-41.61,8.82c8.67-8.67,112.98-100.94,79.35-227.34v-0.01 c0.742-0.489,1.49-0.975,2.244-1.459c9.551-6.123,22.265-0.733,24.422,10.406C369.565,277.734,281.608,363.204,281.608,365.729z"}),l.createElement("path",{fill:"#ff8ca5",d:"M417.451,302.932c-32.211,44.193-80.706,72.823-134.571,87.345c-3.396,0.916-6.999,0.754-10.3-0.463 c-20.772-7.664-31.911-15.254-32.583-15.254c0.826-0.825,112.667-9.463,166.4-98.31C419.37,278.279,424.743,292.927,417.451,302.932 z"}),l.createElement("path",{fill:"#ff8ca5",d:"M62.565,302.932c32.211,44.193,80.705,72.823,134.571,87.345c3.396,0.916,6.999,0.754,10.3-0.463 c20.772-7.664,31.911-15.254,32.583-15.254c-0.828-0.828-112.665-9.458-166.4-98.31C60.646,278.279,55.273,292.927,62.565,302.932z"}),l.createElement("path",{fill:"#9ceb63",d:"M433.464,393.091c-52.749,39.415-118.979,42.09-182.861,13.657 c-4.441-1.977-7.606-6.011-8.633-10.763c-1.552-7.18-1.884-14.238-1.973-21.326c0.172-0.345,9.566,5.934,26.76,12.89 c36.31,14.71,102.75,30.15,161.74-21.33C440.977,369.752,443.403,385.664,433.464,393.091z"}),l.createElement("path",{fill:"#9ceb63",d:"M240.038,374.579c0,0.01-0.01,0.01-0.01,0.02s-0.01,0.03-0.01,0.05c0,0,0,0,0,0.01 c-0.01,0.03-0.01,0.06-0.02,0.1v0.04c-0.13,1.3,0.09,7.59-0.92,15.16c-0.01,0.04-0.01,0.08-0.02,0.12 c-0.26,1.91-0.59,3.91-1.03,5.92c-0.07,0.33-0.15,0.65-0.25,0.97c-1.23,4.33-4.28,7.95-8.41,9.79 c-63.06,28.05-129.47,26.21-182.79-13.63c-9.94-7.43-7.63-23.36,4.92-26.91c13.1,11.46,28.11,20.79,44.16,26.79 c19.78,7.48,34.99,8.98,53.83,8.68c34.33-0.55,60.1-11.03,90.51-27.13C240.008,374.56,240.018,374.569,240.038,374.579z"}),l.createElement("path",{d:"M443.143,363.426c9.579-9.648,18.604-20.804,26.926-33.305c11.399-17.132,4.201-40.447-14.837-48.202 c-12.321-5.012-24.515-8.844-36.391-11.454c17.945-34.197,27.974-78.94,22.188-137.413c-1.925-19.503-20.802-33.354-40.394-28.53 c-17.952,4.421-34.806,10.063-50.093,16.768c-4.046,1.775-5.888,6.494-4.113,10.54c1.774,4.046,6.493,5.887,10.54,4.113 c14.45-6.338,30.429-11.682,47.492-15.885c9.885-2.435,19.599,4.434,20.607,14.573c9.088,90.121-21.147,164.341-99.823,205.213 c-3.921,2.037-5.448,6.866-3.411,10.787c2.043,3.933,6.879,5.442,10.787,3.411c27.191-14.125,56.267-35.849,77.701-68.994 c12.564,2.375,25.617,6.296,38.878,11.69c9.68,3.943,13.334,15.824,7.549,24.518c-10.205,15.33-21.482,28.43-33.516,38.936 c-49.396,43.107-111.979,41.39-169.834,12.419c56.638-56.971,92.247-132.34,77.074-212.524 c-8.101-42.81-30.305-85.119-65.997-125.754c-12.964-14.759-36.003-14.748-48.946-0.016 c-28.645,32.607-48.657,66.371-59.602,100.512c-21.999-13.018-47.7-23.197-76.569-30.307c-19.338-4.763-38.383,8.699-40.354,28.53 C26.197,262.501,90.89,324.677,147.416,354.042c3.92,2.036,8.75,0.51,10.787-3.411c2.037-3.921,0.51-8.75-3.411-10.787 c-52.141-27.086-111.791-84.677-99.863-205.213c1.007-10.132,10.713-17.01,20.606-14.574c31.115,7.663,58.223,19.013,80.571,33.735 c4.863,3.204,10.891,0.586,12.257-4.539c9.392-35.245,29.306-70.362,59.188-104.378c6.581-7.492,18.316-7.487,24.904,0.014 c128.735,146.565,37.449,269.122-12.476,318.519c-30.274-29.828-76.759-87.727-78.002-162.831 c-0.073-4.417-3.698-7.933-8.131-7.867c-4.417,0.073-7.939,3.714-7.867,8.131c1.382,83.483,54.096,146.516,85.999,177.099 c-0.353,20.737-7.099,36.575-20.104,47.086c-20.129,16.267-55.786,20.072-97.831,10.438c-19.181-4.396-48.632-19.874-85.688-1.511 c-5.361,2.657-11.689-0.859-12.186-6.844c-1.888-22.74,12.042-43.926,33.548-51.893c13.4,11.096,27.797,19.551,43.11,25.275 c20.238,7.653,36.036,9.525,56.788,9.196c15.85-0.254,30.814-2.572,45.747-7.085c4.229-1.278,6.622-5.743,5.343-9.972 c-1.278-4.229-5.744-6.622-9.972-5.344c-13.494,4.078-27.027,6.173-41.373,6.403c-17.347,0.275-31.911-0.993-50.901-8.174 c-31.69-11.847-56.387-35.98-75.211-64.258c-5.791-8.704-2.122-20.58,7.548-24.52c4.092-1.667,6.058-6.335,4.391-10.427 c-1.667-4.092-6.334-6.058-10.427-4.391c-19.062,7.765-26.214,31.095-14.832,48.202c8.365,12.566,17.352,23.674,26.917,33.31 C12.89,375.664-2.037,401.187,0.226,428.434c1.427,17.192,19.743,27.533,35.235,19.857c30.84-15.283,54.311-1.971,75.01,2.771 c36.708,8.411,82.166,10.086,111.461-13.59c14.777-11.943,23.305-28.715,25.489-49.937 c61.607,30.736,128.694,32.482,182.835-12.326c21.516,7.959,35.456,29.153,33.567,51.902c-0.493,5.939-6.786,9.519-12.186,6.844 c-30.339-15.034-55.535-7.379-73.932-1.791c-31.306,9.51-74.736,14.144-102.884-2.498c-3.803-2.248-8.709-0.989-10.958,2.815 c-2.249,3.803-0.989,8.709,2.815,10.958c29.214,17.272,69.817,15.19,102.844,7.622c20.72-4.747,44.177-18.05,75.01-2.771 c15.523,7.691,33.811-2.693,35.235-19.856C482.032,401.183,467.102,375.655,443.143,363.426z"})),ee={sm:32,md:48,lg:64};function te({size:e="md",variant:a="light",className:g="",style:y={}}){const L=ee[e],E={display:"inline-block",cursor:"pointer",transition:"all 250ms ease",borderRadius:"50%",...a==="dark"&&{backgroundColor:"rgba(255, 255, 255, 0.05)",padding:"8px"},...y};return k.jsx("a",{href:"https://getbodhi.app",target:"_blank",rel:"noopener noreferrer",title:"Powered by Bodhi","aria-label":"Powered by Bodhi - Visit getbodhi.app",className:g,style:E,onMouseEnter:S=>{S.currentTarget.style.transform="scale(1.1)",S.currentTarget.style.boxShadow="0 0 20px rgba(255, 164, 184, 0.6)"},onMouseLeave:S=>{S.currentTarget.style.transform="scale(1)",S.currentTarget.style.boxShadow="none"},children:k.jsx(Q,{width:L,height:L,style:{display:"block"}})})}const re="production";Object.defineProperty(exports,"createApiError",{enumerable:!0,get:()=>s.createApiError});Object.defineProperty(exports,"createOperationError",{enumerable:!0,get:()=>s.createOperationError});Object.defineProperty(exports,"isApiResultError",{enumerable:!0,get:()=>s.isApiResultError});Object.defineProperty(exports,"isApiResultOperationError",{enumerable:!0,get:()=>s.isApiResultOperationError});Object.defineProperty(exports,"isApiResultSuccess",{enumerable:!0,get:()=>s.isApiResultSuccess});Object.defineProperty(exports,"isAuthError",{enumerable:!0,get:()=>s.isAuthError});Object.defineProperty(exports,"isAuthLoading",{enumerable:!0,get:()=>s.isAuthLoading});Object.defineProperty(exports,"isAuthenticated",{enumerable:!0,get:()=>s.isAuthenticated});Object.defineProperty(exports,"isClientReady",{enumerable:!0,get:()=>s.isClientReady});Object.defineProperty(exports,"isDirectState",{enumerable:!0,get:()=>s.isDirectState});Object.defineProperty(exports,"isExtensionState",{enumerable:!0,get:()=>s.isExtensionState});Object.defineProperty(exports,"isOperationError",{enumerable:!0,get:()=>s.isOperationError});Object.defineProperty(exports,"isWebUIClient",{enumerable:!0,get:()=>s.isWebUIClient});exports.BodhiBadge=te;exports.BodhiProvider=J;exports.BodhiReactContext=D;exports.ClientCtxState=Z;exports.INITIALIZING_CLIENT_CONTEXT_STATE=U;exports.INITIAL_CLIENT_CONTEXT_STATE=j;exports.REACT_CORE_BUILD_MODE=re;exports.clientStateToContextState=K;exports.isClientCtxInitialized=H;exports.isClientCtxInitializing=G;exports.isClientCtxNotInitialized=F;exports.isClientCtxReady=P;exports.isOverallReady=V;exports.useBodhi=$;
@@ -1,8 +1,8 @@
1
1
  import { jsxs as K, jsx as P } from "react/jsx-runtime";
2
2
  import { Logger as H, BodhiClientUserPrefsManager as W, createStoragePrefixWithBasePath as j, detectBrowser as Y, detectOS as q, getServerUrl as X, isDirectServerReady as Z, isExtensionServerReady as $, OS_CONFIGS as J, BROWSER_CONFIGS as Q, OnboardingModal as ee, BACKEND_SERVER_NOT_CONNECTED as G, isExtensionState as te, INITIAL_AUTH_STATE as re, NOOP_STATE_CALLBACK as ne, isWebUIClient as se } from "@bodhiapp/bodhi-js-core";
3
- import { createApiError as _e, createOperationError as Ie, isApiResultError as Te, isApiResultOperationError as Re, isApiResultSuccess as De, isAuthError as Ne, isAuthLoading as ke, isAuthenticated as ze, isClientReady as Be, isDirectState as Pe, isExtensionState as Ue, isOperationError as Fe, isWebUIClient as He } from "@bodhiapp/bodhi-js-core";
4
- import * as c from "react";
5
- import { useMemo as R, useRef as k, useCallback as f, useEffect as z, createContext as ae, useState as N, useContext as ce } from "react";
3
+ import { createApiError as Ie, createOperationError as _e, isApiResultError as Te, isApiResultOperationError as Re, isApiResultSuccess as De, isAuthError as Ne, isAuthLoading as ke, isAuthenticated as ze, isClientReady as Be, isDirectState as Pe, isExtensionState as Ue, isOperationError as Fe, isWebUIClient as He } from "@bodhiapp/bodhi-js-core";
4
+ import * as i from "react";
5
+ import { useMemo as D, useRef as k, useCallback as f, useEffect as z, createContext as ae, useState as N, useContext as ce } from "react";
6
6
  const oe = {
7
7
  serverInstall: !1
8
8
  }, ie = {
@@ -15,7 +15,7 @@ const oe = {
15
15
  os: [],
16
16
  userConfirmations: oe,
17
17
  selectedConnection: null
18
- }, y = {
18
+ }, A = {
19
19
  // Modal lifecycle
20
20
  MODAL_READY: "modal:ready",
21
21
  MODAL_REFRESH: "modal:refresh",
@@ -32,19 +32,19 @@ const oe = {
32
32
  function ue({
33
33
  client: e,
34
34
  modalHtmlPath: s,
35
- hideSetup: A,
36
- onSetupReady: w,
37
- setupState: L,
38
- basePath: C = "/",
35
+ hideSetup: w,
36
+ onSetupReady: x,
37
+ setupState: O,
38
+ basePath: g = "/",
39
39
  logLevel: m = "warn"
40
40
  }) {
41
- const _ = L !== "ready", x = R(() => new H("SetupModalProcessor", m), [m]), a = k(null), l = R(
42
- () => new W(j(C, "bodhijs:")),
43
- [C]
44
- ), g = k(null), S = f(
41
+ const _ = O !== "ready", L = D(() => new H("SetupModalProcessor", m), [m]), c = k(null), l = D(
42
+ () => new W(j(g, "bodhijs:")),
43
+ [g]
44
+ ), C = k(null), S = f(
45
45
  (t) => t === "direct" ? "lna" : t === "extension" ? "extension" : null,
46
46
  []
47
- ), I = f((t) => t.extension === "ready" ? {
47
+ ), T = f((t) => t.extension === "ready" ? {
48
48
  status: "ready",
49
49
  version: "unknown",
50
50
  // TODO: have ExtensionState also get extension version
@@ -108,7 +108,7 @@ function ue({
108
108
  }
109
109
  };
110
110
  }
111
- }, []), h = f((t) => {
111
+ }, []), v = f((t) => {
112
112
  if (t.server.status === "not-connected")
113
113
  return { status: "pending-lna-ready" };
114
114
  const r = t.server;
@@ -131,7 +131,7 @@ function ue({
131
131
  error: { message: "Unknown server status" }
132
132
  };
133
133
  }
134
- }, []), O = f(
134
+ }, []), b = f(
135
135
  (t, r) => {
136
136
  if (t.server.status !== "pending-extension-ready") {
137
137
  const n = t.server.status;
@@ -146,17 +146,17 @@ function ue({
146
146
  return !1;
147
147
  },
148
148
  []
149
- ), v = f(
149
+ ), y = f(
150
150
  (t, r, n) => {
151
151
  if (r === "skipped")
152
152
  return { status: "skipped", serverUrl: n };
153
153
  if (t.server.status !== "not-connected") {
154
- const i = t.server;
155
- return i.status === "ready" || i.status === "setup" || i.status === "resource-admin" ? { status: "granted", serverUrl: n } : {
154
+ const u = t.server;
155
+ return u.status === "ready" || u.status === "setup" || u.status === "resource-admin" ? { status: "granted", serverUrl: n } : {
156
156
  status: "unreachable",
157
157
  serverUrl: n,
158
158
  error: {
159
- message: i.error?.message || "Server unreachable",
159
+ message: u.error?.message || "Server unreachable",
160
160
  code: "lna-unreachable"
161
161
  }
162
162
  };
@@ -167,17 +167,17 @@ function ue({
167
167
  ), E = f(
168
168
  async (t = !1) => {
169
169
  const r = Y().type, n = q().type;
170
- let i = await e.getExtensionState();
171
- (i.extension === "not-initialized" || t) && (i = await e.testExtensionConnectivity());
170
+ let u = await e.getExtensionState();
171
+ (u.extension === "not-initialized" || t) && (u = await e.testExtensionConnectivity());
172
172
  let d = await e.getDirectState();
173
- const b = l.getDirectStatus();
174
- b === "granted" && (d.server.status === "not-connected" || t) && (d = await e.testDirectConnectivity());
175
- const o = X(d) || "http://localhost:1135", D = v(d, b, o);
176
- return e.getConnectionMode() === null && (Z(d) ? await e.setConnectionMode("direct") : $(i) && await e.setConnectionMode("extension")), l.isServerInstallConfirmed() || O(i, d) && l.setServerInstallConfirmed(!0), {
177
- extension: I(i),
178
- server: M(i),
179
- lna: D,
180
- lnaServer: h(d),
173
+ const I = l.getDirectStatus();
174
+ I === "granted" && (d.server.status === "not-connected" || t) && (d = await e.testDirectConnectivity());
175
+ const a = X(d) || "http://localhost:1135", h = y(d, I, a);
176
+ return e.getConnectionMode() === null && (Z(d) ? await e.setConnectionMode("direct") : $(u) && await e.setConnectionMode("extension")), l.isServerInstallConfirmed() || b(u, d) && l.setServerInstallConfirmed(!0), {
177
+ extension: T(u),
178
+ server: M(u),
179
+ lna: h,
180
+ lnaServer: v(d),
181
181
  env: { browser: r, os: n },
182
182
  browsers: Q,
183
183
  os: J,
@@ -188,18 +188,18 @@ function ue({
188
188
  [
189
189
  e,
190
190
  l,
191
- I,
191
+ T,
192
192
  M,
193
- h,
194
- S,
195
193
  v,
196
- O
194
+ S,
195
+ y,
196
+ b
197
197
  ]
198
198
  ), p = f(() => {
199
- if (!g.current)
199
+ if (!C.current)
200
200
  throw new Error("Cannot get state: currentStateRef is null");
201
201
  return {
202
- ...g.current,
202
+ ...C.current,
203
203
  // Override userConfirmations from storage (in case updated outside buildSetupState)
204
204
  userConfirmations: {
205
205
  serverInstall: l.isServerInstallConfirmed()
@@ -207,18 +207,18 @@ function ue({
207
207
  // Override selectedConnection from client (in case changed via handler)
208
208
  selectedConnection: S(e.getConnectionMode())
209
209
  };
210
- }, [l, e, S]), T = R(
210
+ }, [l, e, S]), R = D(
211
211
  () => ({
212
- [y.MODAL_READY]: async () => (x.info("MODAL_READY: returning current state or default"), g.current ? { setupState: p() } : { setupState: ie }),
213
- [y.MODAL_REFRESH]: async () => {
214
- x.info("MODAL_REFRESH: refreshing state");
212
+ [A.MODAL_READY]: async () => (L.info("MODAL_READY: returning current state or default"), C.current ? { setupState: p() } : { setupState: ie }),
213
+ [A.MODAL_REFRESH]: async () => {
214
+ L.info("MODAL_REFRESH: refreshing state");
215
215
  const t = await E(!0);
216
- g.current = t;
216
+ C.current = t;
217
217
  const r = p();
218
- return x.info(`MODAL_REFRESH: state refreshed
219
- `, JSON.stringify(r, null, 2)), a.current?.updateState(p()), { setupState: r };
218
+ return L.info(`MODAL_REFRESH: state refreshed
219
+ `, JSON.stringify(r, null, 2)), c.current?.updateState(p()), { setupState: r };
220
220
  },
221
- [y.MODAL_LNA_CONNECT]: async (t) => {
221
+ [A.MODAL_LNA_CONNECT]: async (t) => {
222
222
  const r = t.payload.serverUrl;
223
223
  console.log("[SetupModalProcessor] LNA connect:", r);
224
224
  const n = await e.testDirectConnectivity(r);
@@ -226,41 +226,41 @@ function ue({
226
226
  const d = n.server.status;
227
227
  if (d === "ready" || d === "setup" || d === "resource-admin") {
228
228
  l.setDirectStatus("granted"), e.getConnectionMode() === null && await e.setConnectionMode("direct");
229
- const b = await E();
230
- return g.current = b, a.current?.updateState(p()), { success: !0 };
229
+ const I = await E();
230
+ return C.current = I, c.current?.updateState(p()), { success: !0 };
231
231
  }
232
232
  }
233
- const i = await E();
234
- return g.current = i, a.current?.updateState(p()), { success: !1 };
233
+ const u = await E();
234
+ return C.current = u, c.current?.updateState(p()), { success: !1 };
235
235
  },
236
- [y.MODAL_LNA_SKIP]: async () => {
236
+ [A.MODAL_LNA_SKIP]: async () => {
237
237
  l.setDirectStatus("skipped");
238
238
  const t = await E();
239
- return g.current = t, a.current?.updateState(p()), { success: !0 };
239
+ return C.current = t, c.current?.updateState(p()), { success: !0 };
240
240
  },
241
- [y.MODAL_CLOSE]: () => {
242
- A();
241
+ [A.MODAL_CLOSE]: () => {
242
+ w();
243
243
  },
244
- [y.MODAL_COMPLETE]: () => {
245
- A();
244
+ [A.MODAL_COMPLETE]: () => {
245
+ w();
246
246
  },
247
- [y.MODAL_CONFIRM_SERVER_INSTALL]: (t) => (l.setServerInstallConfirmed(t.payload.confirmed), a.current?.updateState(p()), { success: !0 }),
248
- [y.MODAL_SELECT_CONNECTION]: async (t) => {
247
+ [A.MODAL_CONFIRM_SERVER_INSTALL]: (t) => (l.setServerInstallConfirmed(t.payload.confirmed), c.current?.updateState(p()), { success: !0 }),
248
+ [A.MODAL_SELECT_CONNECTION]: async (t) => {
249
249
  const n = t.payload.connection === "lna" ? "direct" : "extension";
250
- return await e.setConnectionMode(n), a.current?.updateState(p()), { success: !0 };
250
+ return await e.setConnectionMode(n), c.current?.updateState(p()), { success: !0 };
251
251
  }
252
252
  }),
253
- [x, e, l, E, p, h, A]
253
+ [L, e, l, E, p, v, w]
254
254
  );
255
- return z(() => (a.current = new ee({ modalHtmlPath: s, handlers: T }), () => {
256
- a.current?.destroy(), a.current = null;
257
- }), [s, T]), z(() => {
258
- _ && a.current ? (a.current.showLoading(), E(!0).then((t) => {
259
- g.current = t, a.current?.updateState(t), w?.();
255
+ return z(() => (c.current = new ee({ modalHtmlPath: s, handlers: R }), () => {
256
+ c.current?.destroy(), c.current = null;
257
+ }), [s, R]), z(() => {
258
+ _ && c.current ? (c.current.showLoading(), E(!0).then((t) => {
259
+ C.current = t, c.current?.updateState(t), x?.();
260
260
  }).catch((t) => {
261
261
  console.error("[SetupModalProcessor] buildSetupState failed:", t);
262
- })) : !_ && a.current && a.current.destroy();
263
- }, [_, E, w]), null;
262
+ })) : !_ && c.current && c.current.destroy();
263
+ }, [_, E, x]), null;
264
264
  }
265
265
  const le = {
266
266
  status: "not-initialized",
@@ -292,7 +292,7 @@ function V(e) {
292
292
  function Se(e) {
293
293
  return V(e) && e.server.status === "ready";
294
294
  }
295
- function Ce(e) {
295
+ function ge(e) {
296
296
  return te(e) ? {
297
297
  status: e.extension === "not-initialized" ? "initializing" : e.extension === "not-found" ? "extension-not-found" : "ready",
298
298
  mode: "extension",
@@ -320,56 +320,56 @@ U.displayName = "BodhiContext";
320
320
  function we({
321
321
  children: e,
322
322
  client: s,
323
- modalHtmlPath: A,
324
- handleCallback: w = !0,
325
- callbackPath: L,
326
- basePath: C = "/",
323
+ modalHtmlPath: w,
324
+ handleCallback: x = !0,
325
+ callbackPath: O,
326
+ basePath: g = "/",
327
327
  logLevel: m = "warn"
328
328
  }) {
329
- const _ = C === "/" ? "" : C.replace(/\/$/, ""), x = L ?? `${_}/callback`, a = R(() => new H("BodhiProvider", m), [m]), l = k(!1), g = k(!1), [S, I] = N(le), [M, h] = N(re), [O, v] = N(!1), [E, p] = N("ready");
329
+ const _ = g === "/" ? "" : g.replace(/\/$/, ""), L = O ?? `${_}/callback`, c = D(() => new H("BodhiProvider", m), [m]), l = k(!1), C = k(!1), [S, T] = N(le), [M, v] = N(re), [b, y] = N(!1), [E, p] = N("ready");
330
330
  z(() => {
331
- const u = (o) => {
332
- switch (o.type) {
331
+ const o = (a) => {
332
+ switch (a.type) {
333
333
  case "client-state":
334
- I(Ce(o.state));
334
+ T(ge(a.state));
335
335
  break;
336
336
  case "auth-state":
337
- h(o.state), v(!1);
337
+ v(a.state), y(!1);
338
338
  break;
339
339
  }
340
340
  };
341
- return s.setStateCallback(u), () => {
341
+ return s.setStateCallback(o), () => {
342
342
  s.setStateCallback(ne);
343
343
  };
344
344
  }, [s]);
345
- const T = f(async () => {
345
+ const R = f(async () => {
346
346
  p("loading");
347
347
  }, []), t = f(() => {
348
348
  p("ready");
349
349
  }, []), r = f(() => {
350
350
  p("loaded");
351
351
  }, []), n = f(
352
- async (u) => {
353
- I(de);
352
+ async (o) => {
353
+ T(de);
354
354
  try {
355
- await s.init(u || {});
356
- } catch (o) {
357
- a.error("Init failed:", o);
355
+ await s.init(o || {});
356
+ } catch (a) {
357
+ c.error("Init failed:", a);
358
358
  }
359
359
  },
360
- [s, a]
360
+ [s, c]
361
361
  );
362
362
  z(() => {
363
- if (g.current) return;
364
- g.current = !0, (async () => {
365
- if (await n(), !w) return;
366
- const o = new URL(window.location.href);
367
- if (o.pathname !== x) return;
368
- const D = o.searchParams.get("code"), F = o.searchParams.get("state");
369
- !D || !F || l.current || (l.current = !0, se(s) && (v(!0), s.handleOAuthCallback(D, F).then(() => {
370
- window.history.replaceState({}, "", C);
363
+ if (C.current) return;
364
+ C.current = !0, (async () => {
365
+ if (await n(), !x) return;
366
+ const a = new URL(window.location.href);
367
+ if (a.pathname !== L) return;
368
+ const h = a.searchParams.get("code"), F = a.searchParams.get("state");
369
+ !h || !F || l.current || (l.current = !0, se(s) && (y(!0), s.handleOAuthCallback(h, F).then(() => {
370
+ window.history.replaceState({}, "", g);
371
371
  }).catch((B) => {
372
- a.error("OAuth callback failed:", B), h({
372
+ c.error("OAuth callback failed:", B), v({
373
373
  status: "error",
374
374
  user: null,
375
375
  accessToken: null,
@@ -377,74 +377,81 @@ function we({
377
377
  message: B instanceof Error ? B.message : "OAuth callback failed",
378
378
  code: "OAUTH_CALLBACK_FAILED"
379
379
  }
380
- }), v(!1), window.history.replaceState({}, "", C);
380
+ }), y(!1), window.history.replaceState({}, "", g);
381
381
  })));
382
382
  })();
383
- }, [n, s, w, x, C]);
384
- const i = f(async () => {
385
- v(!0);
386
- try {
387
- await s.login();
388
- } catch (u) {
389
- const o = {
390
- status: "error",
391
- user: null,
392
- accessToken: null,
393
- error: {
394
- message: u instanceof Error ? u.message : "Login failed",
395
- code: "LOGIN_FAILED"
396
- }
397
- };
398
- return h(o), v(!1), o;
399
- }
400
- }, [s]), d = f(async () => {
383
+ }, [n, s, x, L, g]);
384
+ const u = f(
385
+ async (o) => {
386
+ y(!0);
387
+ try {
388
+ const a = o ? {
389
+ ...o.toolsetScopeIds && { toolsetScopeIds: o.toolsetScopeIds },
390
+ ...o.version && { version: o.version }
391
+ } : void 0, h = a && Object.keys(a).length > 0 ? a : void 0;
392
+ await s.login(h);
393
+ } catch (a) {
394
+ const h = {
395
+ status: "error",
396
+ user: null,
397
+ accessToken: null,
398
+ error: {
399
+ message: a instanceof Error ? a.message : "Login failed",
400
+ code: "LOGIN_FAILED"
401
+ }
402
+ };
403
+ return v(h), y(!1), h;
404
+ }
405
+ },
406
+ [s]
407
+ ), d = f(async () => {
401
408
  try {
402
409
  await s.logout();
403
- } catch (u) {
404
- h({
410
+ } catch (o) {
411
+ v({
405
412
  status: "error",
406
413
  user: null,
407
414
  accessToken: null,
408
415
  error: {
409
- message: u instanceof Error ? u.message : "Logout failed",
416
+ message: o instanceof Error ? o.message : "Logout failed",
410
417
  code: "LOGOUT_FAILED"
411
418
  }
412
419
  });
413
420
  }
414
- }, [s]), b = R(() => {
415
- const u = S.status === "ready", o = S.server.status === "ready";
421
+ }, [s]), I = D(() => {
422
+ const o = S.status === "ready", a = S.server.status === "ready";
416
423
  return {
417
424
  client: s,
418
425
  clientState: S,
419
426
  auth: M,
420
- isAuthLoading: O,
421
- login: i,
427
+ isAuthLoading: b,
428
+ login: u,
422
429
  logout: d,
423
- showSetup: T,
430
+ showSetup: R,
424
431
  hideSetup: t,
425
432
  setupState: E,
426
433
  // Computed auth properties
427
434
  isAuthenticated: M.status === "authenticated",
428
- canLogin: u && !O,
435
+ canLogin: o && !b,
429
436
  // Computed connection properties
430
- isReady: u,
431
- isServerReady: o,
432
- isOverallReady: u && o,
437
+ isReady: o,
438
+ isServerReady: a,
439
+ isOverallReady: o && a,
433
440
  isInitializing: S.status === "initializing",
434
441
  isExtension: S.mode === "extension",
435
442
  isDirect: S.mode === "direct"
436
443
  };
437
- }, [s, S, M, O, E, i, d, T, t]);
438
- return /* @__PURE__ */ K(U.Provider, { value: b, children: [
444
+ }, [s, S, M, b, E, u, d, R, t]);
445
+ return /* @__PURE__ */ K(U.Provider, { value: I, children: [
439
446
  /* @__PURE__ */ P(
440
447
  ue,
441
448
  {
442
449
  client: s,
443
- modalHtmlPath: A,
450
+ modalHtmlPath: w,
444
451
  hideSetup: t,
445
452
  onSetupReady: r,
446
453
  setupState: E,
447
- basePath: C,
454
+ basePath: g,
448
455
  logLevel: m
449
456
  }
450
457
  ),
@@ -456,7 +463,7 @@ function xe() {
456
463
  if (!e) throw new Error("useBodhi must be used within BodhiProvider");
457
464
  return e;
458
465
  }
459
- const ge = (e) => /* @__PURE__ */ c.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 479.995 479.995", width: "480px", height: "480px", ...e }, /* @__PURE__ */ c.createElement("path", { fill: "#ffa4b8", d: "M239.998,374.56l-0.01-0.01c0-0.01,0.01-0.01,0.01-0.02c-4.64-8.78-65.7-144.8-212.22-85.2 c-14.36,5.85-19.78,23.45-11.19,36.36c11.11,16.69,22.86,30.01,34.91,40.53c-27.85,7.89-45.6,33.8-43.3,61.55 c0.96,11.6,13.29,18.52,23.71,13.35c33.99-16.84,60.03-2.51,80.35,2.14c56.68,12.99,113.71,4.53,125.52-46.29 c0.52-2.22,0.95-4.51,1.28-6.89c0.01-0.04,0.01-0.08,0.02-0.12c0.066-0.492,0.126-0.978,0.181-1.458 c0.455-3.631,0.712-7.438,0.739-11.452c-0.02-1.44-0.02-2.01,0-2.25v-0.09c0-0.02,0-0.04,0.01-0.05c0-0.02,0.01-0.03,0.02-0.06 c0-0.01,0.01-0.01,0.01-0.02C240.018,374.569,240.008,374.56,239.998,374.56z" }), /* @__PURE__ */ c.createElement("path", { fill: "#ffa4b8", d: "M471.798,427.769c-0.96,11.6-13.29,18.52-23.71,13.35c-33.99-16.84-60.03-2.51-80.35,2.14 c-63.41,14.53-127.25,2.22-127.74-66.21c0.033-2.642-0.044-2.302,0.04-2.47c-0.02-0.01-0.03-0.02-0.04-0.02l0.01-0.01 c0-0.01-0.01-0.01-0.01-0.02c4.64-8.78,65.7-144.8,212.22-85.2c14.36,5.85,19.78,23.45,11.19,36.36 c-11.11,16.69-22.86,30.01-34.91,40.53C456.348,374.109,474.098,400.019,471.798,427.769z" }), /* @__PURE__ */ c.createElement("path", { fill: "#befa91", d: "M428.498,366.219c27.85,7.89,45.6,33.8,43.3,61.55c-0.96,11.6-13.29,18.52-23.71,13.35 c-33.99-16.84-60.03-2.51-80.35,2.14c-63.41,14.53-127.928,2.222-127.74-66.21c0.007-2.683-0.02-2.351,0.04-2.47 C248.598,379.129,345.858,438.329,428.498,366.219z" }), /* @__PURE__ */ c.createElement("path", { fill: "#befa91", d: "M51.498,366.219c82.76,72.22,180.18,12.74,188.5,8.34c0.01,0,0.02,0.01,0.04,0.02 c-0.058,0.116-0.047-0.169-0.04,2.47c0.188,68.432-64.33,80.74-127.74,66.21c-20.32-4.65-46.36-18.98-80.35-2.14 c-10.42,5.17-22.75-1.75-23.71-13.35C5.898,400.019,23.648,374.109,51.498,366.219z" }), /* @__PURE__ */ c.createElement("path", { fill: "#ffbfcb", d: "M235.228,365.299c-32.29-36.09-89.98-73-179.74-36.49c-1.979,0.805-3.787,1.834-5.413,3.042 c-10.569,7.856-25.473,5.765-32.82-5.164c-0.223-0.331-0.445-0.664-0.667-0.997c-8.59-12.91-3.17-30.51,11.19-36.36 C155.168,237.509,217.948,333.56,235.228,365.299z" }), /* @__PURE__ */ c.createElement("path", { fill: "#ffa4b8", d: "M239.998,374.549c-12.85-2.2-214.54-23.33-193.03-240.71c1.49-14.99,15.86-25.15,30.48-21.55 c108.49,26.72,149.07,91.39,162.55,149.92C252.768,317.699,241.178,367.679,239.998,374.549z" }), /* @__PURE__ */ c.createElement("path", { fill: "#ffbfcb", d: "M193.698,174.638c11.866,12.406-3.013,31.792-18.056,23.52 c-21.875-12.028-50.044-10.573-70.207,3.701c-24.832,17.579-59.398-0.365-60.013-30.784c-0.237-11.724,0.248-24.123,1.545-37.237 c1.49-14.99,15.86-25.15,30.48-21.55C131.23,125.537,168.324,148.11,193.698,174.638z" }), /* @__PURE__ */ c.createElement("path", { fill: "#ffa4b8", d: "M221.538,39.599c9.78-11.13,27.15-11.12,36.93,0.01c157.02,178.77-7.48,323.95-18.47,334.94 C229.988,364.549,63.948,218.989,221.538,39.599z" }), /* @__PURE__ */ c.createElement("path", { fill: "#ffbfcb", d: "M261.523,43.131c9.452,11.033,8.166,27.623-2.74,37.221c-0.784,0.69-1.535,1.439-2.245,2.247 c-35.942,40.915-55.05,80.07-63.012,116.258c-5.176,23.523-39.936,19.717-39.551-4.366c0.741-46.282,18.411-98.941,67.563-154.892 c9.78-11.13,27.15-11.12,36.93,0.01C259.5,40.785,260.518,41.959,261.523,43.131z" }), /* @__PURE__ */ c.createElement("path", { fill: "#ffa4b8", d: "M239.998,374.549c-1.18-6.87-12.77-56.85,0-112.34c13.48-58.53,54.06-123.2,162.55-149.92 c14.62-3.6,28.99,6.56,30.48,21.55C454.538,351.219,252.848,372.349,239.998,374.549z" }), /* @__PURE__ */ c.createElement("path", { fill: "#ff8ca5", d: "M239.998,374.549c-3.115-0.536-17.362-2.183-36.835-7.483c-3.181-0.866-6.028-2.682-8.145-5.209 c-49.098-58.608-75.675-130.75-61.047-205.793c2.165-11.107,14.881-16.444,24.408-10.337c0.756,0.485,1.506,0.972,2.249,1.462 C126.798,274.139,232.088,366.649,239.998,374.549z" }), /* @__PURE__ */ c.createElement("path", { fill: "#ff8ca5", d: "M281.608,365.729c-21.9,6.37-38.24,8.25-41.61,8.82c8.67-8.67,112.98-100.94,79.35-227.34v-0.01 c0.742-0.489,1.49-0.975,2.244-1.459c9.551-6.123,22.265-0.733,24.422,10.406C369.565,277.734,281.608,363.204,281.608,365.729z" }), /* @__PURE__ */ c.createElement("path", { fill: "#ff8ca5", d: "M417.451,302.932c-32.211,44.193-80.706,72.823-134.571,87.345c-3.396,0.916-6.999,0.754-10.3-0.463 c-20.772-7.664-31.911-15.254-32.583-15.254c0.826-0.825,112.667-9.463,166.4-98.31C419.37,278.279,424.743,292.927,417.451,302.932 z" }), /* @__PURE__ */ c.createElement("path", { fill: "#ff8ca5", d: "M62.565,302.932c32.211,44.193,80.705,72.823,134.571,87.345c3.396,0.916,6.999,0.754,10.3-0.463 c20.772-7.664,31.911-15.254,32.583-15.254c-0.828-0.828-112.665-9.458-166.4-98.31C60.646,278.279,55.273,292.927,62.565,302.932z" }), /* @__PURE__ */ c.createElement("path", { fill: "#9ceb63", d: "M433.464,393.091c-52.749,39.415-118.979,42.09-182.861,13.657 c-4.441-1.977-7.606-6.011-8.633-10.763c-1.552-7.18-1.884-14.238-1.973-21.326c0.172-0.345,9.566,5.934,26.76,12.89 c36.31,14.71,102.75,30.15,161.74-21.33C440.977,369.752,443.403,385.664,433.464,393.091z" }), /* @__PURE__ */ c.createElement("path", { fill: "#9ceb63", d: "M240.038,374.579c0,0.01-0.01,0.01-0.01,0.02s-0.01,0.03-0.01,0.05c0,0,0,0,0,0.01 c-0.01,0.03-0.01,0.06-0.02,0.1v0.04c-0.13,1.3,0.09,7.59-0.92,15.16c-0.01,0.04-0.01,0.08-0.02,0.12 c-0.26,1.91-0.59,3.91-1.03,5.92c-0.07,0.33-0.15,0.65-0.25,0.97c-1.23,4.33-4.28,7.95-8.41,9.79 c-63.06,28.05-129.47,26.21-182.79-13.63c-9.94-7.43-7.63-23.36,4.92-26.91c13.1,11.46,28.11,20.79,44.16,26.79 c19.78,7.48,34.99,8.98,53.83,8.68c34.33-0.55,60.1-11.03,90.51-27.13C240.008,374.56,240.018,374.569,240.038,374.579z" }), /* @__PURE__ */ c.createElement("path", { d: "M443.143,363.426c9.579-9.648,18.604-20.804,26.926-33.305c11.399-17.132,4.201-40.447-14.837-48.202 c-12.321-5.012-24.515-8.844-36.391-11.454c17.945-34.197,27.974-78.94,22.188-137.413c-1.925-19.503-20.802-33.354-40.394-28.53 c-17.952,4.421-34.806,10.063-50.093,16.768c-4.046,1.775-5.888,6.494-4.113,10.54c1.774,4.046,6.493,5.887,10.54,4.113 c14.45-6.338,30.429-11.682,47.492-15.885c9.885-2.435,19.599,4.434,20.607,14.573c9.088,90.121-21.147,164.341-99.823,205.213 c-3.921,2.037-5.448,6.866-3.411,10.787c2.043,3.933,6.879,5.442,10.787,3.411c27.191-14.125,56.267-35.849,77.701-68.994 c12.564,2.375,25.617,6.296,38.878,11.69c9.68,3.943,13.334,15.824,7.549,24.518c-10.205,15.33-21.482,28.43-33.516,38.936 c-49.396,43.107-111.979,41.39-169.834,12.419c56.638-56.971,92.247-132.34,77.074-212.524 c-8.101-42.81-30.305-85.119-65.997-125.754c-12.964-14.759-36.003-14.748-48.946-0.016 c-28.645,32.607-48.657,66.371-59.602,100.512c-21.999-13.018-47.7-23.197-76.569-30.307c-19.338-4.763-38.383,8.699-40.354,28.53 C26.197,262.501,90.89,324.677,147.416,354.042c3.92,2.036,8.75,0.51,10.787-3.411c2.037-3.921,0.51-8.75-3.411-10.787 c-52.141-27.086-111.791-84.677-99.863-205.213c1.007-10.132,10.713-17.01,20.606-14.574c31.115,7.663,58.223,19.013,80.571,33.735 c4.863,3.204,10.891,0.586,12.257-4.539c9.392-35.245,29.306-70.362,59.188-104.378c6.581-7.492,18.316-7.487,24.904,0.014 c128.735,146.565,37.449,269.122-12.476,318.519c-30.274-29.828-76.759-87.727-78.002-162.831 c-0.073-4.417-3.698-7.933-8.131-7.867c-4.417,0.073-7.939,3.714-7.867,8.131c1.382,83.483,54.096,146.516,85.999,177.099 c-0.353,20.737-7.099,36.575-20.104,47.086c-20.129,16.267-55.786,20.072-97.831,10.438c-19.181-4.396-48.632-19.874-85.688-1.511 c-5.361,2.657-11.689-0.859-12.186-6.844c-1.888-22.74,12.042-43.926,33.548-51.893c13.4,11.096,27.797,19.551,43.11,25.275 c20.238,7.653,36.036,9.525,56.788,9.196c15.85-0.254,30.814-2.572,45.747-7.085c4.229-1.278,6.622-5.743,5.343-9.972 c-1.278-4.229-5.744-6.622-9.972-5.344c-13.494,4.078-27.027,6.173-41.373,6.403c-17.347,0.275-31.911-0.993-50.901-8.174 c-31.69-11.847-56.387-35.98-75.211-64.258c-5.791-8.704-2.122-20.58,7.548-24.52c4.092-1.667,6.058-6.335,4.391-10.427 c-1.667-4.092-6.334-6.058-10.427-4.391c-19.062,7.765-26.214,31.095-14.832,48.202c8.365,12.566,17.352,23.674,26.917,33.31 C12.89,375.664-2.037,401.187,0.226,428.434c1.427,17.192,19.743,27.533,35.235,19.857c30.84-15.283,54.311-1.971,75.01,2.771 c36.708,8.411,82.166,10.086,111.461-13.59c14.777-11.943,23.305-28.715,25.489-49.937 c61.607,30.736,128.694,32.482,182.835-12.326c21.516,7.959,35.456,29.153,33.567,51.902c-0.493,5.939-6.786,9.519-12.186,6.844 c-30.339-15.034-55.535-7.379-73.932-1.791c-31.306,9.51-74.736,14.144-102.884-2.498c-3.803-2.248-8.709-0.989-10.958,2.815 c-2.249,3.803-0.989,8.709,2.815,10.958c29.214,17.272,69.817,15.19,102.844,7.622c20.72-4.747,44.177-18.05,75.01-2.771 c15.523,7.691,33.811-2.693,35.235-19.856C482.032,401.183,467.102,375.655,443.143,363.426z" })), Ee = {
466
+ const Ce = (e) => /* @__PURE__ */ i.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 479.995 479.995", width: "480px", height: "480px", ...e }, /* @__PURE__ */ i.createElement("path", { fill: "#ffa4b8", d: "M239.998,374.56l-0.01-0.01c0-0.01,0.01-0.01,0.01-0.02c-4.64-8.78-65.7-144.8-212.22-85.2 c-14.36,5.85-19.78,23.45-11.19,36.36c11.11,16.69,22.86,30.01,34.91,40.53c-27.85,7.89-45.6,33.8-43.3,61.55 c0.96,11.6,13.29,18.52,23.71,13.35c33.99-16.84,60.03-2.51,80.35,2.14c56.68,12.99,113.71,4.53,125.52-46.29 c0.52-2.22,0.95-4.51,1.28-6.89c0.01-0.04,0.01-0.08,0.02-0.12c0.066-0.492,0.126-0.978,0.181-1.458 c0.455-3.631,0.712-7.438,0.739-11.452c-0.02-1.44-0.02-2.01,0-2.25v-0.09c0-0.02,0-0.04,0.01-0.05c0-0.02,0.01-0.03,0.02-0.06 c0-0.01,0.01-0.01,0.01-0.02C240.018,374.569,240.008,374.56,239.998,374.56z" }), /* @__PURE__ */ i.createElement("path", { fill: "#ffa4b8", d: "M471.798,427.769c-0.96,11.6-13.29,18.52-23.71,13.35c-33.99-16.84-60.03-2.51-80.35,2.14 c-63.41,14.53-127.25,2.22-127.74-66.21c0.033-2.642-0.044-2.302,0.04-2.47c-0.02-0.01-0.03-0.02-0.04-0.02l0.01-0.01 c0-0.01-0.01-0.01-0.01-0.02c4.64-8.78,65.7-144.8,212.22-85.2c14.36,5.85,19.78,23.45,11.19,36.36 c-11.11,16.69-22.86,30.01-34.91,40.53C456.348,374.109,474.098,400.019,471.798,427.769z" }), /* @__PURE__ */ i.createElement("path", { fill: "#befa91", d: "M428.498,366.219c27.85,7.89,45.6,33.8,43.3,61.55c-0.96,11.6-13.29,18.52-23.71,13.35 c-33.99-16.84-60.03-2.51-80.35,2.14c-63.41,14.53-127.928,2.222-127.74-66.21c0.007-2.683-0.02-2.351,0.04-2.47 C248.598,379.129,345.858,438.329,428.498,366.219z" }), /* @__PURE__ */ i.createElement("path", { fill: "#befa91", d: "M51.498,366.219c82.76,72.22,180.18,12.74,188.5,8.34c0.01,0,0.02,0.01,0.04,0.02 c-0.058,0.116-0.047-0.169-0.04,2.47c0.188,68.432-64.33,80.74-127.74,66.21c-20.32-4.65-46.36-18.98-80.35-2.14 c-10.42,5.17-22.75-1.75-23.71-13.35C5.898,400.019,23.648,374.109,51.498,366.219z" }), /* @__PURE__ */ i.createElement("path", { fill: "#ffbfcb", d: "M235.228,365.299c-32.29-36.09-89.98-73-179.74-36.49c-1.979,0.805-3.787,1.834-5.413,3.042 c-10.569,7.856-25.473,5.765-32.82-5.164c-0.223-0.331-0.445-0.664-0.667-0.997c-8.59-12.91-3.17-30.51,11.19-36.36 C155.168,237.509,217.948,333.56,235.228,365.299z" }), /* @__PURE__ */ i.createElement("path", { fill: "#ffa4b8", d: "M239.998,374.549c-12.85-2.2-214.54-23.33-193.03-240.71c1.49-14.99,15.86-25.15,30.48-21.55 c108.49,26.72,149.07,91.39,162.55,149.92C252.768,317.699,241.178,367.679,239.998,374.549z" }), /* @__PURE__ */ i.createElement("path", { fill: "#ffbfcb", d: "M193.698,174.638c11.866,12.406-3.013,31.792-18.056,23.52 c-21.875-12.028-50.044-10.573-70.207,3.701c-24.832,17.579-59.398-0.365-60.013-30.784c-0.237-11.724,0.248-24.123,1.545-37.237 c1.49-14.99,15.86-25.15,30.48-21.55C131.23,125.537,168.324,148.11,193.698,174.638z" }), /* @__PURE__ */ i.createElement("path", { fill: "#ffa4b8", d: "M221.538,39.599c9.78-11.13,27.15-11.12,36.93,0.01c157.02,178.77-7.48,323.95-18.47,334.94 C229.988,364.549,63.948,218.989,221.538,39.599z" }), /* @__PURE__ */ i.createElement("path", { fill: "#ffbfcb", d: "M261.523,43.131c9.452,11.033,8.166,27.623-2.74,37.221c-0.784,0.69-1.535,1.439-2.245,2.247 c-35.942,40.915-55.05,80.07-63.012,116.258c-5.176,23.523-39.936,19.717-39.551-4.366c0.741-46.282,18.411-98.941,67.563-154.892 c9.78-11.13,27.15-11.12,36.93,0.01C259.5,40.785,260.518,41.959,261.523,43.131z" }), /* @__PURE__ */ i.createElement("path", { fill: "#ffa4b8", d: "M239.998,374.549c-1.18-6.87-12.77-56.85,0-112.34c13.48-58.53,54.06-123.2,162.55-149.92 c14.62-3.6,28.99,6.56,30.48,21.55C454.538,351.219,252.848,372.349,239.998,374.549z" }), /* @__PURE__ */ i.createElement("path", { fill: "#ff8ca5", d: "M239.998,374.549c-3.115-0.536-17.362-2.183-36.835-7.483c-3.181-0.866-6.028-2.682-8.145-5.209 c-49.098-58.608-75.675-130.75-61.047-205.793c2.165-11.107,14.881-16.444,24.408-10.337c0.756,0.485,1.506,0.972,2.249,1.462 C126.798,274.139,232.088,366.649,239.998,374.549z" }), /* @__PURE__ */ i.createElement("path", { fill: "#ff8ca5", d: "M281.608,365.729c-21.9,6.37-38.24,8.25-41.61,8.82c8.67-8.67,112.98-100.94,79.35-227.34v-0.01 c0.742-0.489,1.49-0.975,2.244-1.459c9.551-6.123,22.265-0.733,24.422,10.406C369.565,277.734,281.608,363.204,281.608,365.729z" }), /* @__PURE__ */ i.createElement("path", { fill: "#ff8ca5", d: "M417.451,302.932c-32.211,44.193-80.706,72.823-134.571,87.345c-3.396,0.916-6.999,0.754-10.3-0.463 c-20.772-7.664-31.911-15.254-32.583-15.254c0.826-0.825,112.667-9.463,166.4-98.31C419.37,278.279,424.743,292.927,417.451,302.932 z" }), /* @__PURE__ */ i.createElement("path", { fill: "#ff8ca5", d: "M62.565,302.932c32.211,44.193,80.705,72.823,134.571,87.345c3.396,0.916,6.999,0.754,10.3-0.463 c20.772-7.664,31.911-15.254,32.583-15.254c-0.828-0.828-112.665-9.458-166.4-98.31C60.646,278.279,55.273,292.927,62.565,302.932z" }), /* @__PURE__ */ i.createElement("path", { fill: "#9ceb63", d: "M433.464,393.091c-52.749,39.415-118.979,42.09-182.861,13.657 c-4.441-1.977-7.606-6.011-8.633-10.763c-1.552-7.18-1.884-14.238-1.973-21.326c0.172-0.345,9.566,5.934,26.76,12.89 c36.31,14.71,102.75,30.15,161.74-21.33C440.977,369.752,443.403,385.664,433.464,393.091z" }), /* @__PURE__ */ i.createElement("path", { fill: "#9ceb63", d: "M240.038,374.579c0,0.01-0.01,0.01-0.01,0.02s-0.01,0.03-0.01,0.05c0,0,0,0,0,0.01 c-0.01,0.03-0.01,0.06-0.02,0.1v0.04c-0.13,1.3,0.09,7.59-0.92,15.16c-0.01,0.04-0.01,0.08-0.02,0.12 c-0.26,1.91-0.59,3.91-1.03,5.92c-0.07,0.33-0.15,0.65-0.25,0.97c-1.23,4.33-4.28,7.95-8.41,9.79 c-63.06,28.05-129.47,26.21-182.79-13.63c-9.94-7.43-7.63-23.36,4.92-26.91c13.1,11.46,28.11,20.79,44.16,26.79 c19.78,7.48,34.99,8.98,53.83,8.68c34.33-0.55,60.1-11.03,90.51-27.13C240.008,374.56,240.018,374.569,240.038,374.579z" }), /* @__PURE__ */ i.createElement("path", { d: "M443.143,363.426c9.579-9.648,18.604-20.804,26.926-33.305c11.399-17.132,4.201-40.447-14.837-48.202 c-12.321-5.012-24.515-8.844-36.391-11.454c17.945-34.197,27.974-78.94,22.188-137.413c-1.925-19.503-20.802-33.354-40.394-28.53 c-17.952,4.421-34.806,10.063-50.093,16.768c-4.046,1.775-5.888,6.494-4.113,10.54c1.774,4.046,6.493,5.887,10.54,4.113 c14.45-6.338,30.429-11.682,47.492-15.885c9.885-2.435,19.599,4.434,20.607,14.573c9.088,90.121-21.147,164.341-99.823,205.213 c-3.921,2.037-5.448,6.866-3.411,10.787c2.043,3.933,6.879,5.442,10.787,3.411c27.191-14.125,56.267-35.849,77.701-68.994 c12.564,2.375,25.617,6.296,38.878,11.69c9.68,3.943,13.334,15.824,7.549,24.518c-10.205,15.33-21.482,28.43-33.516,38.936 c-49.396,43.107-111.979,41.39-169.834,12.419c56.638-56.971,92.247-132.34,77.074-212.524 c-8.101-42.81-30.305-85.119-65.997-125.754c-12.964-14.759-36.003-14.748-48.946-0.016 c-28.645,32.607-48.657,66.371-59.602,100.512c-21.999-13.018-47.7-23.197-76.569-30.307c-19.338-4.763-38.383,8.699-40.354,28.53 C26.197,262.501,90.89,324.677,147.416,354.042c3.92,2.036,8.75,0.51,10.787-3.411c2.037-3.921,0.51-8.75-3.411-10.787 c-52.141-27.086-111.791-84.677-99.863-205.213c1.007-10.132,10.713-17.01,20.606-14.574c31.115,7.663,58.223,19.013,80.571,33.735 c4.863,3.204,10.891,0.586,12.257-4.539c9.392-35.245,29.306-70.362,59.188-104.378c6.581-7.492,18.316-7.487,24.904,0.014 c128.735,146.565,37.449,269.122-12.476,318.519c-30.274-29.828-76.759-87.727-78.002-162.831 c-0.073-4.417-3.698-7.933-8.131-7.867c-4.417,0.073-7.939,3.714-7.867,8.131c1.382,83.483,54.096,146.516,85.999,177.099 c-0.353,20.737-7.099,36.575-20.104,47.086c-20.129,16.267-55.786,20.072-97.831,10.438c-19.181-4.396-48.632-19.874-85.688-1.511 c-5.361,2.657-11.689-0.859-12.186-6.844c-1.888-22.74,12.042-43.926,33.548-51.893c13.4,11.096,27.797,19.551,43.11,25.275 c20.238,7.653,36.036,9.525,56.788,9.196c15.85-0.254,30.814-2.572,45.747-7.085c4.229-1.278,6.622-5.743,5.343-9.972 c-1.278-4.229-5.744-6.622-9.972-5.344c-13.494,4.078-27.027,6.173-41.373,6.403c-17.347,0.275-31.911-0.993-50.901-8.174 c-31.69-11.847-56.387-35.98-75.211-64.258c-5.791-8.704-2.122-20.58,7.548-24.52c4.092-1.667,6.058-6.335,4.391-10.427 c-1.667-4.092-6.334-6.058-10.427-4.391c-19.062,7.765-26.214,31.095-14.832,48.202c8.365,12.566,17.352,23.674,26.917,33.31 C12.89,375.664-2.037,401.187,0.226,428.434c1.427,17.192,19.743,27.533,35.235,19.857c30.84-15.283,54.311-1.971,75.01,2.771 c36.708,8.411,82.166,10.086,111.461-13.59c14.777-11.943,23.305-28.715,25.489-49.937 c61.607,30.736,128.694,32.482,182.835-12.326c21.516,7.959,35.456,29.153,33.567,51.902c-0.493,5.939-6.786,9.519-12.186,6.844 c-30.339-15.034-55.535-7.379-73.932-1.791c-31.306,9.51-74.736,14.144-102.884-2.498c-3.803-2.248-8.709-0.989-10.958,2.815 c-2.249,3.803-0.989,8.709,2.815,10.958c29.214,17.272,69.817,15.19,102.844,7.622c20.72-4.747,44.177-18.05,75.01-2.771 c15.523,7.691,33.811-2.693,35.235-19.856C482.032,401.183,467.102,375.655,443.143,363.426z" })), Ee = {
460
467
  sm: 32,
461
468
  md: 48,
462
469
  lg: 64
@@ -464,10 +471,10 @@ const ge = (e) => /* @__PURE__ */ c.createElement("svg", { xmlns: "http://www.w3
464
471
  function Le({
465
472
  size: e = "md",
466
473
  variant: s = "light",
467
- className: A = "",
468
- style: w = {}
474
+ className: w = "",
475
+ style: x = {}
469
476
  }) {
470
- const L = Ee[e], C = {
477
+ const O = Ee[e], g = {
471
478
  display: "inline-block",
472
479
  cursor: "pointer",
473
480
  transition: "all 250ms ease",
@@ -476,7 +483,7 @@ function Le({
476
483
  backgroundColor: "rgba(255, 255, 255, 0.05)",
477
484
  padding: "8px"
478
485
  },
479
- ...w
486
+ ...x
480
487
  };
481
488
  return /* @__PURE__ */ P(
482
489
  "a",
@@ -486,19 +493,19 @@ function Le({
486
493
  rel: "noopener noreferrer",
487
494
  title: "Powered by Bodhi",
488
495
  "aria-label": "Powered by Bodhi - Visit getbodhi.app",
489
- className: A,
490
- style: C,
496
+ className: w,
497
+ style: g,
491
498
  onMouseEnter: (m) => {
492
499
  m.currentTarget.style.transform = "scale(1.1)", m.currentTarget.style.boxShadow = "0 0 20px rgba(255, 164, 184, 0.6)";
493
500
  },
494
501
  onMouseLeave: (m) => {
495
502
  m.currentTarget.style.transform = "scale(1)", m.currentTarget.style.boxShadow = "none";
496
503
  },
497
- children: /* @__PURE__ */ P(ge, { width: L, height: L, style: { display: "block" } })
504
+ children: /* @__PURE__ */ P(Ce, { width: O, height: O, style: { display: "block" } })
498
505
  }
499
506
  );
500
507
  }
501
- const Me = "production";
508
+ const Oe = "production";
502
509
  export {
503
510
  Le as BodhiBadge,
504
511
  we as BodhiProvider,
@@ -506,10 +513,10 @@ export {
506
513
  Ae as ClientCtxState,
507
514
  de as INITIALIZING_CLIENT_CONTEXT_STATE,
508
515
  le as INITIAL_CLIENT_CONTEXT_STATE,
509
- Me as REACT_CORE_BUILD_MODE,
510
- Ce as clientStateToContextState,
511
- _e as createApiError,
512
- Ie as createOperationError,
516
+ Oe as REACT_CORE_BUILD_MODE,
517
+ ge as clientStateToContextState,
518
+ Ie as createApiError,
519
+ _e as createOperationError,
513
520
  Te as isApiResultError,
514
521
  Re as isApiResultOperationError,
515
522
  De as isApiResultSuccess,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bodhiapp/bodhi-js-react-core",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "Core React bindings for Bodhi Browser SDK (dependency injection)",
5
5
  "type": "module",
6
6
  "main": "dist/bodhi-react-core.cjs.js",
@@ -42,8 +42,8 @@
42
42
  "typecheck": "tsc --noEmit"
43
43
  },
44
44
  "dependencies": {
45
- "@bodhiapp/bodhi-js-core": "0.0.15",
46
- "@bodhiapp/ts-client": "0.1.9"
45
+ "@bodhiapp/bodhi-js-core": "0.0.16",
46
+ "@bodhiapp/ts-client": "0.1.14"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "react": "^18.3.0 || ^19.0.0"