{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/fxlmqVk0JRNvpLzQkccw/GMChSG6c39k6dXZJlUgv/FAQ.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerIntrinsicWidth 600\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicHeight 400\n */export default function FAQContainer(props){const{richText,questionFont,answerFont,containerSpacing,qaSpacing,padding,border,borderRadius,shadow,appearance:{backgroundColor,hoverBackgroundColor,activeBackgroundColor,questionColor,answerColor},icon:{type:iconType,size,color},transition}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[faqs,setFaqs]=React.useState([]);const[openIndex,setOpenIndex]=React.useState(null);const[hoveredIndex,setHoveredIndex]=React.useState(null);React.useEffect(()=>{const extractQA=element=>{const qaList=[];let currentQA={};const processContent=element=>{if(element.props&&element.props.children){React.Children.forEach(element.props.children,child=>{if(child.type&&child.type.match(/h[1-6]/)){if(currentQA.question){qaList.push({...currentQA});}currentQA={question:child.props.children,answer:\"\"};}else if(child.type===\"p\"&&currentQA.question){currentQA.answer=child.props.children;}if(child.props&&child.props.children){processContent(child);}});}};processContent(element);if(currentQA.question){qaList.push(currentQA);}return qaList;};if(richText&&richText.props&&Array.isArray(richText.props.children)){const faqList=extractQA(richText);setFaqs(faqList);}},[richText]);const toggleFAQ=index=>{if(!isCanvas){setOpenIndex(openIndex===index?null:index);}};const isItemOpen=index=>{if(isCanvas)return false;return openIndex===index;};const getBackgroundColor=index=>{if(isItemOpen(index))return activeBackgroundColor;if(hoveredIndex===index)return hoverBackgroundColor;return backgroundColor;};const renderIcon=isOpen=>{if(iconType===\"plus\"){return /*#__PURE__*/_jsx(\"div\",{style:{fontSize:`${size}px`,lineHeight:1,color:color,width:`${size}px`,height:`${size}px`,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:isOpen?\"\u2212\":\"+\"});}else{return /*#__PURE__*/_jsx(\"svg\",{width:size,height:size,viewBox:\"0 0 24 24\",fill:\"none\",stroke:color,strokeWidth:\"2\",style:{transform:isOpen?\"rotate(180deg)\":\"rotate(0)\",transition:\"transform 0.3s ease\"},children:/*#__PURE__*/_jsx(\"path\",{d:\"M6 9l6 6 6-6\"})});}};return /*#__PURE__*/_jsx(motion.div,{role:\"region\",\"aria-label\":\"Frequently Asked Questions\",style:{width:\"100%\",display:\"flex\",flexDirection:\"column\",gap:containerSpacing},children:/*#__PURE__*/_jsx(AnimatePresence,{initial:false,children:faqs.map((faq,index)=>/*#__PURE__*/_jsxs(motion.section,{layout:true,initial:false,style:{padding,...border,borderRadius,boxShadow:shadow,cursor:isCanvas?\"default\":\"pointer\",backgroundColor:getBackgroundColor(index),overflow:\"hidden\"},onClick:()=>toggleFAQ(index),onMouseEnter:()=>setHoveredIndex(index),onMouseLeave:()=>setHoveredIndex(null),children:[/*#__PURE__*/_jsxs(motion.div,{layout:true,style:{display:\"flex\",justifyContent:\"space-between\",alignItems:\"center\",color:questionColor,...questionFont},children:[/*#__PURE__*/_jsx(\"span\",{children:faq.question}),renderIcon(isItemOpen(index))]}),/*#__PURE__*/_jsx(AnimatePresence,{initial:false,children:isItemOpen(index)&&/*#__PURE__*/_jsx(motion.div,{initial:{height:0,marginTop:0,opacity:0},animate:{height:\"auto\",marginTop:qaSpacing,opacity:1},exit:{height:0,marginTop:0,opacity:0,transition:{opacity:{duration:.15}}},transition:transition,style:{color:answerColor,...answerFont},children:faq.answer})})]},index))})});}FAQContainer.defaultProps={richText:null,containerSpacing:10,qaSpacing:15,padding:\"20px\",border:{borderWidth:1,borderStyle:\"solid\",borderColor:\"#EEEEEE\"},borderRadius:\"8px\",shadow:\"none\",appearance:{backgroundColor:\"#FFFFFF\",hoverBackgroundColor:\"#F5F5F5\",activeBackgroundColor:\"#F8F8F8\",questionColor:\"#000000\",answerColor:\"#666666\"},icon:{type:\"chevron\",size:24,color:\"#000000\"},transition:{type:\"spring\",stiffness:500,damping:30}};addPropertyControls(FAQContainer,{richText:{type:ControlType.RichText,title:\"FAQ Content\"},questionFont:{type:ControlType.Font,controls:\"extended\",title:\"Question Font\"},answerFont:{type:ControlType.Font,controls:\"extended\",title:\"Answer Font\"},containerSpacing:{type:ControlType.Number,title:\"Container Spacing\",min:0,max:100},qaSpacing:{type:ControlType.Number,title:\"Q&A Spacing\",min:0,max:100},padding:{type:ControlType.Padding,title:\"Padding\"},border:{type:ControlType.Border,title:\"Border\"},borderRadius:{type:ControlType.BorderRadius,title:\"Border Radius\"},shadow:{type:ControlType.BoxShadow,title:\"Shadow\"},appearance:{type:ControlType.Object,title:\"Appearance\",controls:{backgroundColor:{type:ControlType.Color,title:\"Background\"},hoverBackgroundColor:{type:ControlType.Color,title:\"Hover Background\"},activeBackgroundColor:{type:ControlType.Color,title:\"Active Background\"},questionColor:{type:ControlType.Color,title:\"Question Color\"},answerColor:{type:ControlType.Color,title:\"Answer Color\"}}},icon:{type:ControlType.Object,title:\"Icon\",controls:{type:{type:ControlType.Enum,title:\"Type\",options:[\"plus\",\"chevron\"]},size:{type:ControlType.Number,title:\"Size\",min:12,max:48,step:2},color:{type:ControlType.Color,title:\"Color\"}}},transition:{type:ControlType.Transition,title:\"Animation\",description:\"v1.0\\n[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQContainer\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"*\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"400\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQ.map"],
  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KAAK,SAAS,WAAW,MAAM,aAAa,EAAE,iBAAiB,CAAC,KAAKA,EAAY,OAAO,MAAM,oBAAoB,IAAI,EAAE,IAAI,GAAG,EAAE,UAAU,CAAC,KAAKA,EAAY,OAAO,MAAM,cAAc,IAAI,EAAE,IAAI,GAAG,EAAE,QAAQ,CAAC,KAAKA,EAAY,QAAQ,MAAM,SAAS,EAAE,OAAO,CAAC,KAAKA,EAAY,OAAO,MAAM,QAAQ,EAAE,aAAa,CAAC,KAAKA,EAAY,aAAa,MAAM,eAAe,EAAE,OAAO,CAAC,KAAKA,EAAY,UAAU,MAAM,QAAQ,EAAE,WAAW,CAAC,KAAKA,EAAY,OAAO,MAAM,aAAa,SAAS,CAAC,gBAAgB,CAAC,KAAKA,EAAY,MAAM,MAAM,YAAY,EAAE,qBAAqB,CAAC,KAAKA,EAAY,MAAM,MAAM,kBAAkB,EAAE,sBAAsB,CAAC,KAAKA,EAAY,MAAM,MAAM,mBAAmB,EAAE,cAAc,CAAC,KAAKA,EAAY,MAAM,MAAM,gBAAgB,EAAE,YAAY,CAAC,KAAKA,EAAY,MAAM,MAAM,cAAc,CAAC,CAAC,EAAE,KAAK,CAAC,KAAKA,EAAY,OAAO,MAAM,OAAO,SAAS,CAAC,KAAK,CAAC,KAAKA,EAAY,KAAK,MAAM,OAAO,QAAQ,CAAC,OAAO,SAAS,CAAC,EAAE,KAAK,CAAC,KAAKA,EAAY,OAAO,MAAM,OAAO,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC,EAAE,MAAM,CAAC,KAAKA,EAAY,MAAM,MAAM,OAAO,CAAC,CAAC,EAAE,WAAW,CAAC,KAAKA,EAAY,WAAW,MAAM,YAAY,YAAY;AAAA,2CAAkD,CAAC,CAAC",
  "names": ["FAQContainer", "props", "richText", "questionFont", "answerFont", "containerSpacing", "qaSpacing", "padding", "border", "borderRadius", "shadow", "backgroundColor", "hoverBackgroundColor", "activeBackgroundColor", "questionColor", "answerColor", "iconType", "size", "color", "transition", "isCanvas", "RenderTarget", "faqs", "setFaqs", "ye", "openIndex", "setOpenIndex", "hoveredIndex", "setHoveredIndex", "ue", "extractQA", "element", "qaList", "currentQA", "processContent", "j", "child", "faqList", "toggleFAQ", "index", "isItemOpen", "getBackgroundColor", "renderIcon", "isOpen", "p", "motion", "AnimatePresence", "faq", "u", "addPropertyControls", "ControlType"]
}
