{"version":3,"file":"MarkedText.BbysRE_4.mjs","names":["p","x","React.Fragment","__esmMin","x","p","c","init_jsx_runtime","init_npm_react_18_3_1","addPropertyControls","init_framer_DKtAEkcX","ControlType","escapeRe","s","MarkedText","p$1","props","raw","phrases","parts","re","t","ph","markStyle","x$1","i","init_MarkedText"],"sources":["https:/framerusercontent.com/modules/aJUJBXSR2owKdqxOPJsU/czRXEkI5v1WjMhFWyw3x/MarkedText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";function escapeRe(s){return s.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\");}/**\n * Text with one or more phrases marked by a soft highlighter stroke. Type the exact words to mark in Highlight; separate several with |.\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function MarkedText(props){const p=props;const raw=p.text||\"\";const phrases=(p.highlight||\"\").split(\"|\").map(s=>s.trim()).filter(s=>s.length>1);let parts=[{t:raw,m:false}];if(phrases.length){const re=new RegExp(\"(\"+phrases.map(escapeRe).join(\"|\")+\")\",\"gi\");parts=raw.split(re).filter(t=>t!==\"\").map(t=>({t,m:phrases.some(ph=>ph.toLowerCase()===t.toLowerCase())}));}const markStyle={color:\"inherit\",backgroundColor:\"transparent\",backgroundImage:\"linear-gradient(100deg, transparent 0%, \"+p.marker+\" 4%, \"+p.marker+\" 96%, transparent 100%)\",backgroundSize:\"100% 58%\",backgroundPosition:\"0 78%\",backgroundRepeat:\"no-repeat\",borderRadius:6,padding:\"0 3px\",margin:\"0 -1px\",boxDecorationBreak:\"clone\",WebkitBoxDecorationBreak:\"clone\"};return /*#__PURE__*/_jsxs(\"p\",{style:{margin:0,fontFamily:'\"'+(p.font||\"Nunito Sans\")+'\", system-ui, sans-serif',fontSize:p.size,lineHeight:p.lineHeight,fontWeight:p.weight,fontStyle:p.italic?\"italic\":\"normal\",color:p.color,textWrap:\"pretty\",...p.style},children:[p.quotes?\"“\":null,parts.map((x,i)=>x.m?/*#__PURE__*/_jsx(\"mark\",{style:markStyle,children:x.t},i):/*#__PURE__*/_jsx(React.Fragment,{children:x.t},i)),p.quotes?\"”\":null]});}MarkedText.defaultProps={text:\"I was worried the days would be packed. They weren’t. I read two books and slept nine hours a night.\",highlight:\"slept nine hours a night\",quotes:true,font:\"Nunito Sans\",size:18,lineHeight:1.45,weight:500,italic:false,color:\"#2E2346\",marker:\"rgba(186, 160, 245, 0.55)\"};addPropertyControls(MarkedText,{text:{type:ControlType.String,title:\"Text\",displayTextArea:true,defaultValue:\"I read two books and slept nine hours a night.\",description:\"Connect to a CMS text field, e.g. the guest quote.\"},highlight:{type:ControlType.String,title:\"Highlight\",defaultValue:\"slept nine hours a night\",description:\"Exact words from the text to mark. Separate several with |. Leave empty for none.\"},quotes:{type:ControlType.Boolean,title:\"Quote marks\",defaultValue:true,description:\"Wrap the text in curly quotes.\"},font:{type:ControlType.String,title:\"Font\",defaultValue:\"Nunito Sans\",description:\"Exact family name of a font used on your site.\"},size:{type:ControlType.Number,title:\"Size\",defaultValue:18,min:10,max:48,step:1,unit:\"px\",description:\"Font size.\"},lineHeight:{type:ControlType.Number,title:\"Line height\",defaultValue:1.45,min:1,max:2,step:.05,description:\"Line height as a multiple of the size.\"},weight:{type:ControlType.Number,title:\"Weight\",defaultValue:500,min:200,max:900,step:100,description:\"Font weight.\"},italic:{type:ControlType.Boolean,title:\"Italic\",defaultValue:false,description:\"Use the italic style.\"},color:{type:ControlType.Color,title:\"Text colour\",defaultValue:\"#2E2346\",description:\"Colour of the words.\"},marker:{type:ControlType.Color,title:\"Marker\",defaultValue:\"rgba(186, 160, 245, 0.55)\",description:\"Colour of the highlighter stroke behind the marked words. Keep it soft and a little transparent.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MarkedText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"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