import{n as s,R as g,aF as b,bc as k,y as C,j as n,ba as v,bd as L,z as y,D as w,aE as S}from"./index.B7J6suR-.js";const T=s("div",{target:"e1xmaixs0"})({display:"flex",flexDirection:"column"}),h=s("a",{target:"e1xmaixs1"})(({disabled:a,isCurrentPage:o,fluidWidth:t,theme:e})=>({textDecoration:"none",width:typeof t=="number"?`${t}px`:"fit-content",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:e.spacing.sm,borderRadius:e.radii.default,paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,marginTop:e.spacing.threeXS,marginBottom:e.spacing.threeXS,lineHeight:e.lineHeights.menuItem,backgroundColor:o?e.colors.darkenedBgMix15:"transparent","&:hover":{backgroundColor:o?e.colors.darkenedBgMix25:e.colors.darkenedBgMix15},"&:active,&:visited,&:hover":{textDecoration:"none"},"&:focus":{outline:"none"},"&:focus-visible":{backgroundColor:e.colors.darkenedBgMix15},"@media print":{paddingLeft:e.spacing.none},...a?{borderColor:e.colors.borderColor,backgroundColor:e.colors.transparent,color:e.colors.fadedText40,cursor:"not-allowed","&:hover":{color:e.colors.fadedText40,backgroundColor:e.colors.transparent}}:{}})),D=s("span",{target:"e1xmaixs2"})(({disabled:a,theme:o})=>({color:o.colors.bodyText,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",display:"table-cell",...a?{borderColor:o.colors.borderColor,backgroundColor:o.colors.transparent,color:o.colors.fadedText40,cursor:"not-allowed"}:{}}));function P(a,o){return a===null&&o?!0:a===null&&!o?!1:a===!0}function H(a){const{onPageChange:o,currentPageScriptHash:t}=g.useContext(b),e=g.useContext(k),{colors:u}=C(),{disabled:l,element:r,width:i}=a,p={width:i},f=P(r.useContainerWidth,e),c=t===r.pageScriptHash,x=d=>{r.external?l&&d.preventDefault():(d.preventDefault(),l||o(r.pageScriptHash))};return n("div",{className:"stPageLink","data-testid":"stPageLink",style:p,children:n(v,{help:r.help,placement:L.TOP_RIGHT,children:n(T,{children:y(h,{"data-testid":"stPageLink-NavLink",disabled:l,isCurrentPage:c,fluidWidth:f?i:!1,href:r.page,target:r.external?"_blank":"",rel:"noreferrer",onClick:x,children:[r.icon&&n(w,{size:"lg",color:u.bodyText,iconValue:r.icon}),n(D,{disabled:l,children:n(S,{source:r.label,allowHTML:!1,isLabel:!0,boldLabel:c,largerLabel:!0,disableLinks:!0})})]})})})})}export{H as default};
