import{r as h}from"./index-NdkWRN8K.js";import{aw as T,ax as p,ay as H,u as v}from"./OdysseyThemeProvider-Bh0Bu-2o.js";import{j as y}from"./jsx-runtime-CnH95YSl.js";/*!
 * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const _=128,L=108,O=142,f="#000000",x="#FFFFFF",U=({backgroundColor:n,backgroundContrastColor:g,odysseyDesignTokens:a})=>{const u=T(n)?p(n):p(a.HueNeutralWhite),{red:s,green:b,blue:m}=u,i=.2126*s+.7152*b+.0722*m,c=i>L&&i<O,r=i>_,l=g||(c?f:r?a.TypographyColorBody:x),e=p(l),o=p(x),t=p(c?f:a.TypographyColorBody),d=H({red:e==null?void 0:e.red,green:e==null?void 0:e.green,blue:e==null?void 0:e.blue}),C=H({red:o==null?void 0:o.red,green:o==null?void 0:o.green,blue:o==null?void 0:o.blue}),N=H({red:t==null?void 0:t.red,green:t==null?void 0:t.green,blue:t==null?void 0:t.blue}),S=(M,A)=>M?A?N:C:d;return{fontColor:l,focusRingColor:`rgba(${d}, .8)`,itemDisabledFontColor:`rgba(${d}, .4)`,itemHoverBackgroundColor:`rgba(${S(c,r)}, .1)`,itemSelectedBackgroundColor:`rgba(${S(c,r)}, .15)`}};/*!
 * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const W=()=>{const n=new Map;return{publish:u=>{Array.from(n.values()).forEach(s=>{s(u)})},subscribe:u=>{const s=Symbol();return n.set(s,u),()=>{n.delete(s)}}}};/*!
 * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const E=W(),k=()=>()=>{},B=h.createContext(void 0),P=()=>h.useContext(B),D=({appBackgroundColor:n,appBackgroundContrastMode:g="lowContrast",children:a,closeSideNavMenu:u,sideNavBackgroundColor:s,sideNavBackgroundContrastColor:b,subscribeToCloseRightSideMenu:m,subscribeToCloseSideNavMenu:i,topNavBackgroundColor:c})=>{const r=v(),l=s||r.HueNeutralWhite,e=l!==r.HueNeutralWhite?U({backgroundColor:s||l,backgroundContrastColor:b,odysseyDesignTokens:r}):void 0,t=g==="highContrast"?r.HueNeutralWhite:r.HueNeutral50,d=c||t,C=n||t,N=h.useMemo(()=>({appBackgroundColor:C,closeSideNavMenu:u??E.publish,sideNavBackgroundColor:s||r.HueNeutralWhite,sideNavContrastColors:e,subscribeToCloseSideNavMenu:i??E.subscribe,subscribeToCloseRightSideMenu:m??k,topNavBackgroundColor:d}),[C,r.HueNeutralWhite,u,s,e,m,i,d]);return y.jsx(B.Provider,{value:N,children:a})},V=h.memo(D);export{V as M,P as u};
