{"version":3,"file":"TwoLineClampEllipsis.BD1SLnw4.mjs","names":["__esmMin","init_npm_react_18_3_1","z","K","c","J","init_jsx_runtime","withTwoLineEllipsis","newStyle","props","Component","flattenChildrenToText","node","elementType","childText","findFirstParagraph","child","found","withThreeLineArticleClamp","flattenedText","firstParagraph","paragraphStyle","excerptChild","rootStyle","init_TwoLineClampEllipsis"],"sources":["https:/framerusercontent.com/modules/n9F7rKfRttu0N6w3K3Tv/yfJHMRxkb5e43H3Qx4va/TwoLineClampEllipsis.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{cloneElement,forwardRef,isValidElement}from\"react\";export function withTwoLineEllipsis(Component){return props=>{const newStyle={...props.style,display:\"-webkit-box\",WebkitBoxOrient:\"vertical\",overflow:\"hidden\",WebkitLineClamp:2,textOverflow:\"ellipsis\"};return /*#__PURE__*/_jsx(Component,{...props,style:newStyle});};}function flattenChildrenToText(node){if(node===null||node===undefined||typeof node===\"boolean\")return\"\";if(typeof node===\"string\"||typeof node===\"number\")return String(node);if(Array.isArray(node))return node.map(flattenChildrenToText).join(\" \");if(/*#__PURE__*/isValidElement(node)){const elementType=node.type;if(elementType===\"br\")return\" \";const childText=flattenChildrenToText(node.props?.children);if(elementType===\"p\"||elementType===\"div\"||elementType===\"section\"||elementType===\"article\"||elementType===\"li\"||elementType===\"ul\"||elementType===\"ol\"||elementType===\"blockquote\"||elementType===\"h1\"||elementType===\"h2\"||elementType===\"h3\"||elementType===\"h4\"||elementType===\"h5\"||elementType===\"h6\"){return` ${childText} `;}return childText;}return\"\";}function findFirstParagraph(node){if(node===null||node===undefined||typeof node===\"boolean\")return null;if(Array.isArray(node)){for(const child of node){const found=findFirstParagraph(child);if(found)return found;}return null;}if(/*#__PURE__*/isValidElement(node)){if(node.type===\"p\")return node;return findFirstParagraph(node.props?.children);}return null;}export function withThreeLineArticleClamp(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const flattenedText=flattenChildrenToText(props.children).replace(/\\u00A0/g,\" \").replace(/\\s+/g,\" \").trim();const firstParagraph=findFirstParagraph(props.children);const paragraphStyle={...firstParagraph?.props?.style??{},display:\"-webkit-box\",WebkitBoxOrient:\"vertical\",overflow:\"hidden\",WebkitLineClamp:3,textOverflow:\"ellipsis\"};const excerptChild=firstParagraph?/*#__PURE__*/cloneElement(firstParagraph,{...firstParagraph.props,style:paragraphStyle,children:flattenedText}):flattenedText;const rootStyle={...props.style,height:\"auto\",minHeight:0};return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:rootStyle,children:excerptChild});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withTwoLineEllipsis\":{\"type\":\"reactHoc\",\"name\":\"withTwoLineEllipsis\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withThreeLineArticleClamp\":{\"type\":\"reactHoc\",\"name\":\"withThreeLineArticleClamp\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TwoLineClampEllipsis.map"],"mappings":"A,gIAAqG,SAAgBO,EAAoB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAMC,EAAS,CAAC,GAAGC,EAAM,MAAM,QAAQ,cAAc,gBAAgB,WAAW,SAAS,SAAS,gBAAgB,EAAE,aAAa,UAAU,EAAE,MAAoB,gBAAKC,EAAU,CAAC,GAAGD,EAAM,MAAMD,CAAQ,CAAC,CAAE,CAAE,CAAC,SAASG,EAAsB,EAAK,CAAC,GAAGC,GAAO,MAAwB,OAAOA,GAAO,UAAU,MAAM,GAAG,GAAG,OAAOA,GAAO,UAAU,OAAOA,GAAO,SAAS,OAAO,OAAOA,CAAI,EAAE,GAAG,MAAM,QAAQA,CAAI,EAAE,OAAOA,EAAK,IAAID,CAAqB,CAAC,CAAC,KAAK,GAAG,EAAE,GAAgB,gBAAeC,CAAI,EAAE,CAAC,IAAMC,EAAYD,EAAK,KAAK,GAAGC,IAAc,KAAK,MAAM,IAAI,IAAMC,EAAUH,EAAsBC,EAA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