{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/TnNVYCAkt62aPJw5NceC/QA66EkdQb9LSurKEMyK9/Typewriter.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import React,{useState,useEffect}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function TypewriterComponent(props){const{openingText,closingText,textAlignment}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const Element=props.tag;const[responsiveStyles,setResponsiveStyles]=useState({fontSize:props.font.fontSize,lineHeight:props.font.lineHeight,textAlign:textAlignment});// Update styles based on window width\nuseEffect(()=>{const updateStyles=()=>{const width=window.innerWidth;if(width<600){setResponsiveStyles({fontSize:20,lineHeight:1.2,textAlign:textAlignment});}else if(width>=600&&width<1024){setResponsiveStyles({fontSize:28,lineHeight:1.2,textAlign:textAlignment});}else{setResponsiveStyles({fontSize:30,lineHeight:1.2,textAlign:textAlignment});}};updateStyles();window.addEventListener(\"resize\",updateStyles);return()=>window.removeEventListener(\"resize\",updateStyles);},[textAlignment]);// State to control the expansion of each span\nconst[expandedStates,setExpandedStates]=useState(Array(5).fill(false));const toggleText=index=>{const newExpandedStates=Array(5).fill(false);newExpandedStates[index]=!expandedStates[index];setExpandedStates(newExpandedStates);};return /*#__PURE__*/_jsxs(Element,{style:{color:props.fontColor,margin:0,...props.font,...responsiveStyles,...props.style},children:[openingText,\" \",Array.from({length:5}).map((_,i)=>/*#__PURE__*/_jsxs(React.Fragment,{children:[/*#__PURE__*/_jsx(motion.span,{style:{backgroundColor:props[`backgroundColor${i+1}`],padding:\"0 4px\",borderRadius:\"4px\",color:props.fontColor,cursor:\"pointer\"},onClick:()=>toggleText(i),whileHover:!expandedStates[i]?{filter:\"brightness(93%)\"}:{},children:isCanvas?props[`collapsedText${i+1}`]:expandedStates[i]?props[`expandedText${i+1}`]:props[`collapsedText${i+1}`]},`span-${i}`),\"\",/*#__PURE__*/_jsx(\"span\",{children:props[`betweenText${i+1}`]},`between-text-${i}`),\" \"]},`fragment-${i}`)),closingText]});}TypewriterComponent.displayName=\"Typewriter\";// Property controls\naddPropertyControls(TypewriterComponent,{openingText:{type:ControlType.String,defaultValue:\"Welcome to\",placeholder:\"Opening text...\"},closingText:{type:ControlType.String,defaultValue:\"Explore our innovative solutions.\",placeholder:\"Closing text...\"},textAlignment:{type:ControlType.Enum,defaultValue:\"left\",options:[\"left\",\"center\"],optionTitles:[\"Left Aligned\",\"Center\"],displaySegmentedControl:true},...[1,2,3,4,5].reduce((acc,i)=>({...acc,[`collapsedText${i}`]:{type:ControlType.String,defaultValue:`Click me ${i}`,placeholder:`Collapsed text ${i}...`},[`expandedText${i}`]:{type:ControlType.String,defaultValue:`This is the expanded content of span ${i}.`,placeholder:`Expanded text ${i}...`},[`backgroundColor${i}`]:{type:ControlType.Color,defaultValue:\"rgba(255, 255, 0, 0.2)\"},[`betweenText${i}`]:{type:ControlType.String,defaultValue:\"\",placeholder:`Text between spans ${i}...`}}),{}),font:{type:ControlType.Font,controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:14,lineHeight:1.4}},fontColor:{type:ControlType.Color,defaultValue:\"#000\"},tag:{type:ControlType.Enum,defaultValue:\"p\",options:[\"p\",\"span\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TypewriterComponent\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Typewriter.map"],
  "mappings": "8MAGkB,SAARA,EAAqCC,EAAM,CAAC,GAAK,CAAC,YAAAC,EAAY,YAAAC,EAAY,cAAAC,CAAa,EAAEH,EAA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CAAC,EAAE,EAAE,CAAC,KAAKK,EAAY,OAAO,aAAa,GAAG,YAAY,sBAAsBL,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,KAAKK,EAAY,KAAK,SAAS,WAAW,gBAAgB,aAAa,aAAa,CAAC,SAAS,GAAG,WAAW,GAAG,CAAC,EAAE,UAAU,CAAC,KAAKA,EAAY,MAAM,aAAa,MAAM,EAAE,IAAI,CAAC,KAAKA,EAAY,KAAK,aAAa,IAAI,QAAQ,CAAC,IAAI,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC",
  "names": ["TypewriterComponent", "props", "openingText", "closingText", "textAlignment", "isCanvas", "RenderTarget", "Element", "responsiveStyles", "setResponsiveStyles", "ye", "ue", "updateStyles", "width", "window", "expandedStates", "setExpandedStates", "toggleText", "index", "newExpandedStates", "u", "_", "i", "e", "p", "motion", "addPropertyControls", "ControlType", "acc"]
}
