{"version":3,"file":"TwoLineClampEllipsis.CNKDrsbN.mjs","names":[],"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":"gIAAqG,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,EAAS,CAAC,GAAG,EAAM,MAAM,QAAQ,cAAc,gBAAgB,WAAW,SAAS,SAAS,gBAAgB,EAAE,aAAa,UAAU,EAAE,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,CAAQ,CAAC,CAAE,CAAE,CAAC,SAAS,EAAsB,EAAK,CAAC,GAAG,GAAO,MAAwB,OAAO,GAAO,UAAU,MAAM,GAAG,GAAG,OAAO,GAAO,UAAU,OAAO,GAAO,SAAS,OAAO,OAAO,CAAI,EAAE,GAAG,MAAM,QAAQ,CAAI,EAAE,OAAO,EAAK,IAAI,CAAqB,CAAC,CAAC,KAAK,GAAG,EAAE,GAAgB,EAAe,CAAI,EAAE,CAAC,IAAM,EAAY,EAAK,KAAK,GAAG,IAAc,KAAK,MAAM,IAAI,IAAM,EAAU,EAAsB,EAAK,OAAO,QAAQ,EAAuU,OAAlU,IAAc,KAAK,IAAc,OAAO,IAAc,WAAW,IAAc,WAAW,IAAc,MAAM,IAAc,MAAM,IAAc,MAAM,IAAc,cAAc,IAAc,MAAM,IAAc,MAAM,IAAc,MAAM,IAAc,MAAM,IAAc,MAAM,IAAc,KAAY,IAAI,EAAU,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