{"version":3,"file":"TextWithDisclosure.BdlM2PIw.mjs","names":[],"sources":["https:/framerusercontent.com/modules/WylfEYWOY0XEYWwdb2nt/bSlh4COe3FcXGa5PLrsk/TextWithDisclosure.js"],"sourcesContent":["/**\n * For any website & code related support, contact Sam from wealthisteps.com at wealthistep@gmail.com\n * Linkedin - https://www.linkedin.com/in/samagramishra/\n * */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function TextDisclosure(props){const{content,symbols,mainFont,symbolFont,mainColor,symbolColor,from,to,prefix,underlineLinks,symbolPosition,// New link URL properties\nlink1,link2,link3,link4,link5}=props;// Keep the original ScrollLink functionality\nconst handleClick=()=>{sessionStorage.setItem(\"scroll-return-to\",from);const target=document.getElementById(to);if(target){target.scrollIntoView({behavior:\"smooth\"});}};// Replace the placeholder (inverted commas) with the disclosure symbol\n// and handle links in square brackets\nconst renderContent=()=>{if(!content)return null;// Process the content to handle both quotes and square brackets\nlet processedContent=content;let elements=[];// Track the current placeholder index to assign the correct symbol\nlet placeholderIndex=0;// Track the current link index to assign the correct URL\nlet linkIndex=0;// Store link URLs in an array for easier access\nconst linkUrls=[link1,link2,link3,link4,link5].filter(link=>link&&link.trim()!==\"\");// Add prefix if provided\nif(prefix){elements.push(/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:mainFont?.fontFamily,fontSize:mainFont?.fontSize,lineHeight:mainFont?.lineHeight,letterSpacing:mainFont?.letterSpacing,color:mainColor,whiteSpace:\"pre\",display:\"inline\"},children:prefix},\"prefix\"));}// First, find all link sections (in square brackets) and regular text sections\nconst linkRegex=/\\[([^\\]]*)\\]|([^\\[]+)/g;let linkMatch;let linkParts=[];while((linkMatch=linkRegex.exec(processedContent))!==null){if(linkMatch[1]!==undefined){// This is link text (inside brackets)\nlinkParts.push({text:linkMatch[1],isLink:true});}else if(linkMatch[2]!==undefined){// This is regular text (outside brackets)\nlinkParts.push({text:linkMatch[2],isLink:false});}}// Now process each part for quotes and links\nlinkParts.forEach((part,partIndex)=>{if(part.isLink){// This is a link - create an anchor tag\nconst href=linkUrls[linkIndex]||\"#\"// Use # as default if no URL provided\n;// Increment link index for next link, but only if we have a valid URL\nif(linkUrls[linkIndex]){linkIndex=(linkIndex+1)%linkUrls.length// Cycle through available URLs\n;}elements.push(/*#__PURE__*/_jsx(\"a\",{href:href,target:\"_blank\",rel:\"noopener noreferrer\",style:{fontFamily:mainFont?.fontFamily,fontSize:mainFont?.fontSize,lineHeight:mainFont?.lineHeight,letterSpacing:mainFont?.letterSpacing,color:mainColor,textDecoration:props.underlineLinks?\"underline\":\"none\",cursor:\"pointer\"},children:part.text},`link-${partIndex}`));}else{// This is regular text - process it for quotes\nconst quoteRegex=/\"([^\"]*)\"|([^\"]+)/g;let quoteMatch;let lastQuoteIndex=0;while((quoteMatch=quoteRegex.exec(part.text))!==null){// Add text before the quote if any\nif(quoteMatch.index>lastQuoteIndex){const beforeText=part.text.substring(lastQuoteIndex,quoteMatch.index);elements.push(/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:mainFont?.fontFamily,fontSize:mainFont?.fontSize,lineHeight:mainFont?.lineHeight,letterSpacing:mainFont?.letterSpacing,color:mainColor},children:beforeText},`text-${partIndex}-${lastQuoteIndex}`));}if(quoteMatch[1]!==undefined){// This is quoted text - add the symbol as superscript with onClick handler\n// Determine which symbol to use based on the placeholder index\nlet currentSymbol=\"*\"// Default symbol if none provided\n;// If symbols array exists and has items, use it\nif(symbols&&symbols.length>0){// Use modulo to cycle through available symbols if there are more placeholders than symbols\nconst symbolIndex=placeholderIndex%symbols.length;currentSymbol=symbols[symbolIndex];placeholderIndex++// Increment placeholder counter\n;}elements.push(/*#__PURE__*/_jsx(\"sup\",{style:{fontFamily:symbolFont?.fontFamily,fontSize:symbolFont?.fontSize,color:symbolColor,position:\"relative\",top:symbolPosition?`${symbolPosition}px`:\"-0.5em\",verticalAlign:\"top\",cursor:\"pointer\",display:\"inline-block\",lineHeight:\"0\",marginRight:\"1px\"},onClick:handleClick,children:currentSymbol},`symbol-${partIndex}-${quoteMatch.index}`));}else if(quoteMatch[2]!==undefined){// This is regular text between quotes\nelements.push(/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:mainFont?.fontFamily,fontSize:mainFont?.fontSize,lineHeight:mainFont?.lineHeight,letterSpacing:mainFont?.letterSpacing,color:mainColor},children:quoteMatch[2]},`text-${partIndex}-${quoteMatch.index}`));}lastQuoteIndex=quoteRegex.lastIndex;}// Add any remaining text after the last quote\nif(lastQuoteIndex<part.text.length){elements.push(/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:mainFont?.fontFamily,fontSize:mainFont?.fontSize,lineHeight:mainFont?.lineHeight,letterSpacing:mainFont?.letterSpacing,color:mainColor},children:part.text.substring(lastQuoteIndex)},`text-${partIndex}-${lastQuoteIndex}`));}}});return elements;};return /*#__PURE__*/_jsxs(\"div\",{id:from,style:{display:\"inline-block\",width:\"100%\",textAlign:mainFont?.textAlign||\"center\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .btn-style {\n                    width: auto;\n                    height: auto;\n                }\n                `}),/*#__PURE__*/_jsx(\"div\",{style:{display:\"inline\",whiteSpace:\"pre-wrap\",textAlign:mainFont?.textAlign||\"inherit\"},children:renderContent()})]});}addPropertyControls(TextDisclosure,{content:{type:ControlType.String,defaultValue:'This is sample text with \"disclosure\" placeholder and [link text] that will become a clickable link.',displayTextArea:true},from:{type:ControlType.String},to:{type:ControlType.String},offset:{type:ControlType.Number,title:\"Offset (px)\",defaultValue:0},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\"},symbols:{type:ControlType.Array,propertyControl:{type:ControlType.String},defaultValue:[\"*\"],title:\"Symbols\",description:\"Symbols to use for placeholders in sequence\"},mainFont:{type:ControlType.Font,controls:\"extended\",title:\"Main Text Font\"},symbolFont:{type:ControlType.Font,controls:\"extended\",title:\"Symbol Font\"},mainColor:{type:ControlType.Color,title:\"Main Text Color\"},symbolColor:{type:ControlType.Color,title:\"Symbol Color\"},underlineLinks:{type:ControlType.Boolean,title:\"Underline Links\",defaultValue:true,description:\"Toggle link underline on or off\"},symbolPosition:{type:ControlType.Number,title:\"Symbol Position\",defaultValue:-5,step:1},// Add 5 text fields for link URLs\nlink1:{type:ControlType.String,title:\"Link 1 URL\",defaultValue:\"\",description:\"URL for the first link\"},link2:{type:ControlType.String,title:\"Link 2 URL\",defaultValue:\"\",description:\"URL for the second link\"},link3:{type:ControlType.String,title:\"Link 3 URL\",defaultValue:\"\",description:\"URL for the third link\"},link4:{type:ControlType.String,title:\"Link 4 URL\",defaultValue:\"\",description:\"URL for the fourth link\"},link5:{type:ControlType.String,title:\"Link 5 URL\",defaultValue:\"\",description:\"URL for the fifth link\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextDisclosure\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextWithDisclosure.map"],"mappings":"wOAMG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,UAAQ,UAAQ,WAAS,aAAW,YAAU,cAAY,OAAK,KAAG,SAAO,iBAAe,iBAC/I,QAAM,QAAM,QAAM,QAAM,SAAO,EACzB,MAAgB,CAAC,eAAe,QAAQ,mBAAmB,EAAK,CAAC,IAAM,EAAO,SAAS,eAAe,EAAG,CAAI,GAAQ,EAAO,eAAe,CAAC,SAAS,SAAS,CAAC,EAyB8K,OAAoB,EAAM,MAAM,CAAC,GAAG,EAAK,MAAM,CAAC,QAAQ,eAAe,MAAM,OAAO,UAAU,GAAU,WAAW,SAAS,CAAC,SAAS,CAAc,EAAK,QAAQ,CAAC,SAAS;;;;;kBAK5e,CAAC,CAAc,E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