1import{h as s,c as i,j as e}from"./styledComponents-n4UW4kpA.js";import{g as b,m as v,c as _,F as g,P as r}from"./index-Dbx1gyta.js";import{a}from"./react-C3MRYTMn.js";import{I as w}from"./Icon-CkZJfHnP.js";import{T as C}from"./Text-DGc87esK.js";import{j}from"./buttons.styles-ClYbUcfj.js";import{b as I}from"./brandTextCheck-BtVFi4-W.js";import"./redux-DEt5ekS8.js";import"./urlHelpers-szXc1bAB.js";import"./polished.esm-CYsXSD1d.js";import"./index-g6qz2-ej.js";const $=s.div.withConfig({displayName:"TruncatedTextstyles__StyledTruncatedText",componentId:"sc-u9qdl8-0"})(["",""],({theme:t})=>i` 2 background: ${t.colours.background.a}; 3 `),k=s.div.withConfig({displayName:"TruncatedTextstyles__Wrapper",componentId:"sc-u9qdl8-1"})(["",";",""],b,({theme:t})=>i` 4 padding-top: ${t.spacing.outer.small}; 5 padding-bottom: ${t.spacing.outer.large}; 6 7 button { 8 margin-bottom: 0; 9 } 10 `),q=s.div.withConfig({displayName:"TruncatedTextstyles__Col",componentId:"sc-u9qdl8-2"})(["",""],({theme:t})=>i` 11 ${v(t.breakpoints.b)} { 12 ${_(10,12,0)} 13 padding: 0; 14 } 15 `),N=s.div.withConfig({displayName:"TruncatedTextstyles__TruncatedTextCollapse",componentId:"sc-u9qdl8-3"})(["",";"],({theme:t,visible:n,height:c,textOver:d,backgroundOpacityColour:o="a"})=>i` 16 position: relative; 17 transition: height 0.5s ease-in-out; 18 height: ${d?"160px":"auto"}; 19 overflow: hidden; 20 21 ${c>160?i` 22 &::after { 23 content: ''; 24 position: absolute; 25 left: 0; 26 right: 0; 27 height: 60px; 28 bottom: 0; 29 background: linear-gradient( 30 to bottom, 31 ${g(t.colours.background[o],.1)}, 32 ${g(t.colours.background[o],.9)} 33 ); 34 35 /* Prevent the overlay blocking user interaction with content underneath */ 36 pointer-events: none; 37 } 38 `:""} 39 40 ul, 41 ol { 42 padding: 0 0 0 40px; 43 } 44 45 ${n?i` 46 height: auto; 47 48 &::after { 49 transition: opacity 0.5s ease-in-out; 50 opacity: 0; 51 } 52 `:""} 53 `),E=s.button.withConfig({displayName:"TruncatedTextstyles__MoreLessButton",componentId:"sc-u9qdl8-4"})(["",";margin-top:15px;padding:5px;"],j),L=s.h2.withConfig({displayName:"TruncatedTextstyles__Title",componentId:"sc-u9qdl8-5"})([""]);s.div.withConfig({displayName:"TruncatedTextstyles__Content",componentId:"sc-u9qdl8-6"})([""]);const B=({title:t,text:n,moreText:c,lessText:d})=>
53{const[o,h]=a.useState(!1),[l,x]=a.useState(75),u=a.useRef(null),p=()=>{const{current:m}=u;m&&x(m.offsetHeight)};a.useEffect(()=>(p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}),[]);const T=o?"chevron-up-small":"chevron-down-small",f=c||"More",y=d||"Less";return e.jsx($,{children:n&&e.jsx(k,{children:e.jsxs(q,{children:[t&&e.jsx(L,{dangerouslySetInnerHTML:{__html:I(t)}}),e.jsx(N,{visible:o,height:l,textOver:n.length>=600||l>160,children:n&&e.jsx(C,{ref:u,children:n})}),(n.length>=600||l>160)&&e.jsxs(E,{onClick:()=>h(!o),children:[o?y:f,e.jsx(w,{icon:T,marginRight:"0",height:"12px",width:"12px"})]})]})})})};B.propTypes={title:r.string,text:r.string,moreText:r.string,lessText:r.string};export{B as default}; 54//# sourceMappingURL=TruncatedText-DzPx8Kzh.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.