{"version":3,"file":"EditableFAQ.Dmd3Es3Z.mjs","names":["useMemo","useState","useCallback"],"sources":["https:/framerusercontent.com/modules/0UmT6mV1BVWgWThQGxRB/S8QnigcazpKJMe4bTgZk/EditableFAQ.js"],"sourcesContent":["// Request: Inspect existing FAQ components and provide a drop-in FAQ wrapper replacement that supports a flat, page-editable question/answer list while matching the app-download FAQ visual contract (white stacked cards, slim gaps, dark question text, small plus icon, soft rounded corners, pale blue field) with accessible expand/collapse behavior.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{startTransition,useCallback,useEffect,useMemo,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function EditableFAQ(props){const{items,fAQItems,question1,answer1,question2,answer2,question3,answer3,question4,answer4,question5,answer5,firstOpen,allowSingleOpen,fieldBackground,cardSurface,cardBorder,questionColor,answerColor,iconColor,radius,gap,borderWidth,fieldPadding,questionFont,answerFont,style}=props;const resolvedItems=useMemo(()=>{const directItems=[{question:question1,answer:answer1},{question:question2,answer:answer2},{question:question3,answer:answer3},{question:question4,answer:answer4},{question:question5,answer:answer5}];const hasDirectPairs=directItems.some(item=>(item.question||\"\").trim().length>0||(item.answer||\"\").trim().length>0);if(hasDirectPairs)return directItems;if(Array.isArray(fAQItems))return fAQItems;if(Array.isArray(items))return items;return[];},[answer1,answer2,answer3,answer4,answer5,fAQItems,items,question1,question2,question3,question4,question5]);const safeItems=useMemo(()=>{return resolvedItems.map(item=>({question:typeof item?.question===\"string\"?item.question:\"\",answer:typeof item?.answer===\"string\"?item.answer:\"\"})).filter(item=>item.question.trim().length>0||item.answer.trim().length>0);},[resolvedItems]);const[openMap,setOpenMap]=useState({});useEffect(()=>{if(!firstOpen||safeItems.length===0){startTransition(()=>setOpenMap({}));return;}startTransition(()=>setOpenMap({0:true}));},[firstOpen,safeItems.length]);const onToggle=useCallback(index=>{startTransition(()=>{setOpenMap(prev=>{const isOpen=!!prev[index];if(allowSingleOpen){return isOpen?{}:{[index]:true};}const next={...prev};if(isOpen)delete next[index];else next[index]=true;return next;});});},[allowSingleOpen]);return /*#__PURE__*/_jsx(\"section\",{\"aria-label\":\"Frequently asked questions\",style:{position:\"relative\",width:\"100%\",height:\"auto\",boxSizing:\"border-box\",background:fieldBackground,borderRadius:radius,padding:fieldPadding,display:\"flex\",flexDirection:\"column\",gap,...style},children:safeItems.length===0?/*#__PURE__*/_jsx(\"div\",{style:{...answerFont,color:answerColor,background:cardSurface,border:`${borderWidth}px solid ${cardBorder}`,borderRadius:Math.max(0,radius-4),padding:\"14px\"},children:\"Add FAQ items from the component controls.\"}):safeItems.map((item,index)=>{const isOpen=!!openMap[index];const panelId=`faq-panel-${index}`;const buttonId=`faq-button-${index}`;return /*#__PURE__*/_jsxs(\"article\",{style:{background:cardSurface,border:`${borderWidth}px solid ${cardBorder}`,borderRadius:Math.max(0,radius-4),overflow:\"hidden\"},children:[/*#__PURE__*/_jsxs(\"button\",{id:buttonId,type:\"button\",\"aria-expanded\":isOpen,\"aria-controls\":panelId,onClick:()=>onToggle(index),style:{width:\"100%\",border:\"none\",background:\"transparent\",cursor:\"pointer\",textAlign:\"left\",display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",gap:10,padding:\"14px\",color:questionColor},children:[/*#__PURE__*/_jsx(\"span\",{style:{...questionFont,color:questionColor,minWidth:0},children:item.question}),/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{flex:\"0 0 auto\",color:iconColor,fontSize:16,lineHeight:\"16px\",transform:isOpen?\"rotate(45deg)\":\"rotate(0deg)\",transition:\"transform 180ms ease\"},children:\"+\"})]}),isOpen?/*#__PURE__*/_jsx(\"div\",{id:panelId,role:\"region\",\"aria-labelledby\":buttonId,style:{borderTop:`${borderWidth}px solid ${cardBorder}`,padding:\"12px 14px 14px 14px\"},children:/*#__PURE__*/_jsx(\"div\",{style:{...answerFont,color:answerColor,whiteSpace:\"pre-wrap\"},children:item.answer})}):null]},`${item.question}-${index}`);})});}addPropertyControls(EditableFAQ,{question1:{type:ControlType.String,title:\"Question 1\",defaultValue:\"\"},answer1:{type:ControlType.String,title:\"Answer 1\",defaultValue:\"\",displayTextArea:true},question2:{type:ControlType.String,title:\"Question 2\",defaultValue:\"\"},answer2:{type:ControlType.String,title:\"Answer 2\",defaultValue:\"\",displayTextArea:true},question3:{type:ControlType.String,title:\"Question 3\",defaultValue:\"\"},answer3:{type:ControlType.String,title:\"Answer 3\",defaultValue:\"\",displayTextArea:true},question4:{type:ControlType.String,title:\"Question 4\",defaultValue:\"\"},answer4:{type:ControlType.String,title:\"Answer 4\",defaultValue:\"\",displayTextArea:true},question5:{type:ControlType.String,title:\"Question 5\",defaultValue:\"\"},answer5:{type:ControlType.String,title:\"Answer 5\",defaultValue:\"\",displayTextArea:true},items:{type:ControlType.Array,title:\"FAQ Items\",control:{type:ControlType.Object,controls:{question:{type:ControlType.String,title:\"Question\",defaultValue:\"How does the app help me prepare for appointments?\"},answer:{type:ControlType.String,title:\"Answer\",defaultValue:\"It helps you capture key details, organize notes, and review summaries after your visit.\",displayTextArea:true}}},defaultValue:[{question:\"1. How does Ditto work in practice?\",answer:\"During an appointment, you ask whether you can record the conversation. Afterward, Ditto creates a clear summary you can revisit. You can also take photos of medical letters to get easy-to-understand explanations.\"},{question:\"2. When should I use Ditto?\",answer:\"Use Ditto before, during, and after appointments, especially when you want to remember details, understand medical language, or share information with people you trust.\"},{question:\"3. How do I share summaries with loved ones?\",answer:\"You can securely share your summaries via Ditto Loved Ones directly within Ditto. This uses end-to-end encryption. You can also use messaging apps. You decide what to share and with whom.\"},{question:\"4. What happens to my recordings and information?\",answer:\"Your data is stored securely and only on your device. You stay in control of your information.\"},{question:\"5. Is Ditto free to use?\",answer:\"Yes. Ditto is currently available for free to download and use.\"},{question:\"6. Can Ditto help if I don’t speak the language well?\",answer:\"Yes. Ditto translates medical documents and explanations into language you can understand, helping bridge communication gaps.\"}]},firstOpen:{type:ControlType.Boolean,title:\"Open First\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},allowSingleOpen:{type:ControlType.Boolean,title:\"Single Open\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},fieldBackground:{type:ControlType.Color,title:\"Field BG\",defaultValue:\"#EEF4FF\"},cardSurface:{type:ControlType.Color,title:\"Card BG\",defaultValue:\"#FFFFFF\"},cardBorder:{type:ControlType.Color,title:\"Border\",defaultValue:\"#EEEEEE\"},questionColor:{type:ControlType.Color,title:\"Question\",defaultValue:\"#000000\"},answerColor:{type:ControlType.Color,title:\"Answer\",defaultValue:\"#000000\"},iconColor:{type:ControlType.Color,title:\"Icon\",defaultValue:\"#000000\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:14,min:0,max:32,step:1},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:8,min:0,max:24,step:1},borderWidth:{type:ControlType.Number,title:\"Border W\",defaultValue:1,min:0,max:4,step:1},fieldPadding:{type:ControlType.Number,title:\"Field Pad\",defaultValue:12,min:0,max:32,step:1},questionFont:{type:ControlType.Font,title:\"Question Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},answerFont:{type:ControlType.Font,title:\"Answer Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EditableFAQ\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EditableFAQ.map"],"mappings":"6MAIG,SAAwB,EAAY,EAAM,CAAC,GA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