"use strict";(self.webpackChunkhws_plugin_oauth2_oauthlink=self.webpackChunkhws_plugin_oauth2_oauthlink||[]).push([[717],{717:(n,i,l)=>{l.r(i),l.d(i,{default:()=>v});var t=l(4848),e=l(2943),o=l(6782),u=l.n(o);const d=[{id:"clients",title:"Clients",type:"item",url:"/plugin/oauth-link/Clients",icon:"widgets",translate:"CLIENTS"},{id:"scopes",title:"Scopes",type:"item",url:"/plugin/oauth-link/Scopes",icon:"widgets",translate:"SCOPES"}],s=(0,o.createContext)({}),a=function(n){const{children:i}=n,l=n=>{var i,l,t;return null!==(t=null===(l=null===(i=null===window||void 0===window?void 0:window.HWS)||void 0===i?void 0:i.I18n)||void 0===l?void 0:l.t(n))&&void 0!==t?t:n};(0,o.useEffect)(()=>{var n;const i=null===(n=null===window||void 0===window?void 0:window.HWS)||void 0===n?void 0:n.Navigation;i&&d&&(i.removeAll(),d.forEach,d.forEach(n=>{i.prepend(Object.assign(Object.assign({},n),{translate:l(n.translate)}))}))},[]);const e=(0,o.useMemo)(()=>({}),[]);return(0,t.jsx)(s.Provider,Object.assign({value:e},{children:i}))},r=u().lazy(()=>l.e(596).then(l.t.bind(l,8596,23))),v=function(){const n=(0,e.useNavigate)(),i=(0,e.useLocation)(),[l,u]=(0,o.useState)(null);return(0,o.useEffect)(()=>{var n,i,l;const t=(null!==(l=null===(i=null===(n=null===window||void 0===window?void 0:window.HWS)||void 0===n?void 0:n.Home)||void 0===i?void 0:i.getComponents())&&void 0!==l?l:[]).find(n=>{var i;return"oauth-link"===(null===(i=null==n?void 0:n.Info)||void 0===i?void 0:i.Slug)});u(!0===(null==t?void 0:t.Allowed))},[]),(0,o.useEffect)(()=>{if("/plugin/oauth-link"===i.pathname){const i=d[d.length-1];(null==i?void 0:i.url)&&n(i.url,{replace:!0})}},[i.pathname,n]),!1===l?(0,t.jsx)(r,{}):(0,t.jsx)(a,{children:(0,t.jsx)(e.Outlet,{})})}}}]);