{"version":3,"file":"ScrollLink.B3R-RwNW.mjs","names":[],"sources":["https:/framerusercontent.com/modules/fIZ8kqDKYsUQvEozc4MS/0Oh9qYb9c9S0ljhPvt3n/ScrollLink.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 Disclosure(props){const{content,symbols,mainFont,symbolFont,mainColor,symbolColor,from,to,prefix,highlightColor,symbolPosition,tag}=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 highlighted text in square brackets\nconst renderContent=()=>{if(!content)return null;// Process the content to handle both quotes and square brackets\nconst processedContent=content;const elements=[];// Track the current placeholder index to assign the correct symbol\nlet placeholderIndex=0;// 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 highlighted sections and regular text sections\nconst highlightRegex=/\\[([^\\]]*)\\]|([^\\[]+)/g;let highlightMatch;const highlightParts=[];while((highlightMatch=highlightRegex.exec(processedContent))!==null){if(highlightMatch[1]!==undefined){// This is highlighted text (inside brackets)\nhighlightParts.push({text:highlightMatch[1],isHighlighted:true});}else if(highlightMatch[2]!==undefined){// This is regular text (outside brackets)\nhighlightParts.push({text:highlightMatch[2],isHighlighted:false});}}// Now process each part for quotes\nhighlightParts.forEach((part,partIndex)=>{const 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:part.isHighlighted?highlightColor: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:part.isHighlighted?highlightColor: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:part.isHighlighted?highlightColor:mainColor},children:part.text.substring(lastQuoteIndex)},`text-${partIndex}-${lastQuoteIndex}`));}});return elements;};// Create the component with the selected HTML tag\nconst TagName=tag||\"p\";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(TagName,{style:{display:\"inline\",whiteSpace:\"pre-wrap\",textAlign:mainFont?.textAlign||\"inherit\",margin:0,fontFamily:mainFont?.fontFamily,fontSize:mainFont?.fontSize,fontWeight:mainFont?.fontWeight||\"normal\",lineHeight:mainFont?.lineHeight,letterSpacing:mainFont?.letterSpacing},children:renderContent()})]});}addPropertyControls(Disclosure,{content:{type:ControlType.String,defaultValue:'This is sample text with \"disclosure\" placeholder and [highlighted] text.',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\"},tag:{type:ControlType.Enum,title:\"HTML Tag\",options:[\"p\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],defaultValue:\"p\"},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\"},highlightColor:{type:ControlType.Color,title:\"Highlight Color\"},symbolPosition:{type:ControlType.Number,title:\"Symbol Position\",defaultValue:-5,description:\"Developed by [Wealthisteps](https://wealthisteps.com/)\",step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Disclosure\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollLink.map"],"mappings":"wOAMG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,UAAQ,UAAQ,WAAS,aAAW,YAAU,cAAY,OAAK,KAAG,SAAO,iBAAe,iBAAe,MAAI,CAAC,EACzJ,MAAgB,CAAC,eAAe,QAAQ,mBAAmB,GAAM,IAAM,EAAO,SAAS,eAAe,GAAO,GAAQ,EAAO,eAAe,CAAC,SAAS,SAAS,CAAI,EAElK,MAAkB,CAAC,GAAG,CAAC,EAAQ,OAAO,KAC5C,IAAM,EAAiB,EAAc,EAAS,EAAE,CAC5C,EAAiB,EAClB,GAAQ,EAAS,KAAkB,EAAK,OAAO,CAAC,MAAM,CAAC,WAAW,GAAU,WAAW,SAAS,GAAU,SAAS,WAAW,GAAU,WAAW,cAAc,GAAU,cAAc,MAAM,EAAU,WAAW,MAAM,QAAQ,SAAS,CAAC,SAAS,EAAO,CAAC,WAChQ,IAAM,EAAe,yBAA6B,EAAqB,EAAe,EAAE,CAAC,MAAO,EAAe,EAAe,KAAK,MAAqB,MAAS,EAAe,KAAK,IAAA,GAC3G,EAAe,KAAK,IAAA,IAC9F,EAAe,KAAK,CAAC,KAAK,EAAe,GAAG,cAAc,GAAM,EADhE,EAAe,KAAK,CAAC,KAAK,EAAe,GAAG,cAAc,GAAK,EAWmS,OATlW,EAAe,SAAS,EAAK,IAAY,CAAC,IAAM,EAAW,qBAAyB,EAAe,EAAe,EAAE,MAAO,EAAW,EAAW,KAAK,EAAK,SAAS,MAAK,CACzK,GAAG,EAAW,MAAM,EAAe,CAAC,IAAM,EAAW,EAAK,KAAK,UAAU,EAAe,EAAW,OAAO,EAAS,KAAkB,EAA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