import{n as N,o as $,u as v,R as e,M as F,p as O,L as C,b as B,r as _,F as M,B as x,c as P,a as R,m as j,q as A,i as T,S as V}from"./index-BZu1nCCi.js";import{A as q}from"./AllAlert-B0bHW0sX.js";import{M as U}from"./Metadata-wnpQSZ9h.js";import{d as G,M as J,e as K,g as Q,h as X,i as Y,V as Z,a as ee,j as te,k as z,S as re,b as oe}from"./BlockContainer-De7fb_Yp.js";import{B as ne}from"./BannerGroup-Pap8n--D.js";import{N as ae}from"./Navigation-XMsB4ogx.js";import"./Helmet-CczeUPFm.js";import"./index.esm-fjVsHvrh.js";import"./index-FIv7feoD.js";var H=i=>N.jsx($.div,{className:"chakra-stack__divider",...i,__css:{...i.__css,borderWidth:0,alignSelf:"stretch",borderColor:"inherit",width:"auto",height:"auto"}});H.displayName="StackDivider";function se({data:i,selectedEntry:r,index:l}){var a;const{menu_items:t}=i,p=v();return e.createElement(F,null,e.createElement(O,{variant:"unstyled",fontSize:"20px",fontWeight:"700",lineHeight:"normal",color:r===l?p.colors.White:p.colors.Grey130,_groupHover:{color:p.colors.White},cursor:"default"},e.createElement(C,{as:B,to:{pathname:(a=t==null?void 0:t.link)==null?void 0:a.href,state:r}},"General Info"),e.createElement(G,{px:"9px"})),e.createElement(J,{p:"0"},t==null?void 0:t.map((o,g)=>{var d,n;return e.createElement(K,{as:B,to:{pathname:(d=o==null?void 0:o.link)==null?void 0:d.href,state:r},textDecoration:"none",cursor:"default",key:g},(n=o==null?void 0:o.link)==null?void 0:n.title)})))}function ce(i){const{data:r}=i,l=r==null?void 0:r.nav_links,[t,p]=_.useState(0),a=()=>{const o=v(),g=l==null?void 0:l.findIndex(n=>{var c;return((c=n==null?void 0:n.link)==null?void 0:c.title.trim().toLowerCase())==="general info"}),d=n=>{p(n)};return e.createElement(M,{pt:"32px",justifyContent:"center",alignItems:"flex-start"},e.createElement(M,{alignItems:"flex-start",gap:"43px",flexShrink:"0",borderBottom:`1px solid ${o.colors.Grey10}`},l==null?void 0:l.map((n,c)=>{var f,E;return e.createElement(x,{role:"group",key:c,px:4,py:2,bg:t===c?o.colors.Grey130:"transparent",borderBottom:t===c?`4px solid ${o.colors.PrimaryGreen}`:"none",borderTopRadius:"md",onClick:()=>d(c),_hover:{bg:o.colors.Grey100,borderBottom:t!==c?`4px solid ${o.colors.Grey100}`:`4px solid ${o.colors.PrimaryGreen}`},mr:2},g===c?e.createElement(se,{data:r,selectedEntry:t,index:c}):e.createElement(C,{as:B,to:{pathname:(f=n==null?void 0:n.link)==null?void 0:f.href,state:t},fontSize:"20px",fontWeight:"700",lineHeight:"normal",color:t===c?o.colors.White:o.colors.Grey130,_hover:{textDecoration:"none",color:t!==c?o.colors.White:o.colors.Grey130},_groupHover:{color:o.colors.White},cursor:"default"},(E=n==null?void 0:n.link)==null?void 0:E.title))})))};return e.createElement(e.Fragment,null,e.createElement(a,null))}function D(i){var s;const{data:r}=i,l=(s=r==null?void 0:r.nav_links[0].link)==null?void 0:s.title.toUpperCase(),t=r==null?void 0:r.nav_links,p=r==null?void 0:r.menu_items,a=v(),[o,g]=_.useState(!1),[d,n]=_.useState(!1),c=()=>{g(!0)},f=()=>{g(!1)},E=t==null?void 0:t.findIndex(h=>{var b;return((b=h==null?void 0:h.link)==null?void 0:b.title.trim().toLowerCase())==="general info"}),w=()=>{const[h,b]=_.useState(0),y=m=>{b(m),m!=E?f():c()},S=m=>{b(m),n(!d),f()};return e.createElement(M,{direction:"column",alignItems:"center",bg:a.colors.White,width:"100vw"},t==null?void 0:t.map((m,u)=>{var k,I;return e.createElement(x,{key:u,px:4,py:2,bg:h===u?a.colors.Grey130:"transparent",borderBottom:h===u?`4px solid ${a.colors.PrimaryGreen}`:"none",width:"100vw",onClick:()=>y(u),mb:2},E===u?e.createElement(e.Fragment,null,e.createElement(x,{fontSize:"20px",fontWeight:"700",lineHeight:"normal",color:a.colors.Grey130,onClick:()=>S(u)},"General Information",e.createElement(G,{px:"9px"})),d&&e.createElement(Z,{divider:e.createElement(H,{borderColor:"white"}),align:"stretch",spacing:0},e.createElement(x,{height:"10px"}),p.map((W,L)=>e.createElement(C,{fontSize:"20px",fontWeight:"700",color:a.colors.White,bg:a.colors.Green130,pl:"50px",py:"15px",key:L,href:W.link.href},W.link.title)))):e.createElement(C,{href:(k=m==null?void 0:m.link)==null?void 0:k.href,fontSize:"20px",fontWeight:"700",lineHeight:"normal",color:h===u?a.colors.White:a.colors.Grey130,cursor:"default"},(I=m==null?void 0:m.link)==null?void 0:I.title))}))};return e.createElement(e.Fragment,null,e.createElement(M,{as:P,rightIcon:e.createElement(G,{fasize:"fa-xs",m:"4px"}),width:"100vw",bg:a.colors.White,justifyContent:"space-between",onClick:c},l),e.createElement(Q,{isOpen:o,onClose:f,size:"full"},e.createElement(X,{bgColor:a.colors.White}),e.createElement(Y,{bg:"transparent",boxShadow:"none",width:"100vw",height:"100vh",padding:"0"},e.createElement(w,null))))}function le(i){const[r,l]=ee();switch(_.useEffect(()=>{l()},[]),window.addEventListener("resize",l),r){case"lg":return e.createElement(ce,i);case"md":return e.createElement(D,i);case"sm":return e.createElement(D,i)}}function be(i){var S,m;const{ct:r}=i,[l,t]=_.useState(),p=window.location.pathname,a=R();_.useEffect(()=>{const u=a.pathname.split("/");if(u.length>1)switch(u[1]){case"certify":t("certification_overview");break;case"train":t("training_overview");break;case"enterprise-services":t("enterprise_overview");break;case"c":t("corporate_landing_page");break;case"l":t("marketing_landing_page");break;case"lang":t("foreign_landing_page");break;default:t(`${u[1]}_overview`)}},[a]);const{isLoading:o,data:g,isError:d,failureReason:n}=j(r,p,"en-us","sub_nav"),{data:c,isLoading:f,isError:E,failureReason:w}=A(l);if(o||f)return e.createElement(T,null);if(d)throw new Error("Error loading subpage article: ",(n==null?void 0:n.message)||"unknown reason");if(E)throw new Error("Error loading subpage banner: ",(w==null?void 0:w.message)||"unknown reason");const s=g[0],h=c[0];function b(){const u=document.getElementById(a.hash.replace("#",""));if(u)return u.scrollIntoView({behavior:"smooth"}),y.disconnect()}const y=new MutationObserver(()=>{b()});return e.createElement("main",{className:"main"},e.createElement(V,null),e.createElement("div",null,e.createElement(U,{data:s.seo,override:s}),e.createElement(q,null),s.hero_banner&&e.createElement(te,{data:s.hero_banner}),s.inherit_section_header_set_by_overview_page?(h==null?void 0:h.section_header_for_subpages[0])&&e.createElement(z,{data:h.section_header_for_subpages[0]}):((S=s.interior_section_header)==null?void 0:S.length)>0&&e.createElement(z,{data:s.interior_section_header[0]}),s.banner_group&&e.createElement(ne,{refData:s.banner_group[0]}),((m=s.section_hero_banner)==null?void 0:m.length)>0&&e.createElement(re,{data:s.section_hero_banner[0]}),s.sub_nav&&e.createElement(le,{data:s.sub_nav[0]}),s.show_breadcrumb&&e.createElement(ae,null),s.page_content&&e.createElement(oe,{data:s.page_content})),a.hash&&y.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["id"]}))}export{be as default};