{"version":3,"file":"FAQ.CHTAUxNW.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/WJd9jrll5x4IGZ6LHaX3/mudRELe9qEAbQN7IWeZi/FAQ.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";// Mitsu FAQ accordion. Questions render as <h3>, answers as <p>, so the\n// visible text mirrors the FAQPage JSON-LD added per page in Site Settings > Code.\n// Colours and type match the site: cream #EDDFD3 on #3D3D3D, Noto Sans.\n//\n// Answers can carry inline links. Each link is a phrase that already exists in the\n// answer text plus a destination; the phrase is wrapped in an <a> at render time.\n// The answer string itself is never changed, so the visible text still matches the\n// schema word for word.\nfunction linkify(answer,links,accent){if(!answer||!links||!links.length)return answer;const spans=[];for(const link of links){const text=link&&link.text;const href=link&&link.href;if(!text||!href)continue;const start=answer.indexOf(text);if(start===-1)continue;spans.push({start,end:start+text.length,text,href});}if(!spans.length)return answer;spans.sort((a,b)=>a.start-b.start);const out=[];let pos=0;let key=0;for(const span of spans){if(span.start<pos)continue;// overlapping phrase, skip\nif(span.start>pos)out.push(answer.slice(pos,span.start));const external=/^https?:\\/\\//i.test(span.href)&&!/mitsurestaurant\\.com/i.test(span.href);out.push(/*#__PURE__*/_jsx(\"a\",{href:span.href,...external?{target:\"_blank\",rel:\"noopener noreferrer\"}:{},style:{color:\"inherit\",textDecoration:\"underline\",textDecorationColor:accent,textUnderlineOffset:\"0.18em\",textDecorationThickness:\"1px\"},children:span.text},`l${key++}`));pos=span.end;}if(pos<answer.length)out.push(answer.slice(pos));return out;}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 672\n */export default function FAQ(props){const{items=[],textColor,lineColor,accent,fontFamily,questionSize,answerSize,openFirst,style}=props;const[open,setOpen]=useState(openFirst?0:-1);return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",fontFamily:`\"${fontFamily}\", sans-serif`,color:textColor},children:items.map((it,i)=>{const isOpen=open===i;const id=`mitsu-faq-${i}`;return /*#__PURE__*/_jsxs(\"div\",{style:{borderTop:`1px solid ${lineColor}`,borderBottom:i===items.length-1?`1px solid ${lineColor}`:\"none\"},children:[/*#__PURE__*/_jsx(\"h3\",{style:{margin:0,fontSize:questionSize,fontWeight:500,lineHeight:1.35,letterSpacing:\"-0.01em\"},children:/*#__PURE__*/_jsxs(\"button\",{type:\"button\",\"aria-expanded\":isOpen,\"aria-controls\":`${id}-panel`,id:`${id}-button`,onClick:()=>setOpen(isOpen?-1:i),style:{all:\"unset\",boxSizing:\"border-box\",display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",gap:24,width:\"100%\",padding:\"20px 0\",cursor:\"pointer\",textAlign:\"left\",color:\"inherit\",font:\"inherit\"},children:[/*#__PURE__*/_jsx(\"span\",{children:it.question}),/*#__PURE__*/_jsx(motion.svg,{width:\"18\",height:\"18\",viewBox:\"0 0 18 18\",\"aria-hidden\":\"true\",style:{flex:\"0 0 18px\"},animate:{rotate:isOpen?45:0},transition:{duration:.25,ease:[.22,1,.36,1]},children:/*#__PURE__*/_jsx(\"path\",{d:\"M9 2v14M2 9h14\",stroke:accent,strokeWidth:\"1.75\",strokeLinecap:\"round\"})})]})}),/*#__PURE__*/_jsx(AnimatePresence,{initial:false,children:isOpen&&/*#__PURE__*/_jsx(motion.div,{id:`${id}-panel`,role:\"region\",\"aria-labelledby\":`${id}-button`,initial:{height:0,opacity:0},animate:{height:\"auto\",opacity:1},exit:{height:0,opacity:0},transition:{duration:.3,ease:[.22,1,.36,1]},style:{overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"p\",{style:{margin:\"0 0 22px\",paddingRight:42,fontSize:answerSize,lineHeight:1.6,letterSpacing:\"-0.02em\",opacity:.92},children:linkify(it.answer,it.links,accent)})})})]},i);})});}FAQ.defaultProps={items:[{question:\"Where is Mitsu?\",answer:\"10-50 Willow Street, London EC2A 4BH.\",links:[]}],textColor:\"#EDDFD3\",lineColor:\"rgba(237, 223, 211, 0.22)\",accent:\"#CC1517\",fontFamily:\"Noto Sans\",questionSize:18,answerSize:16,openFirst:false};addPropertyControls(FAQ,{items:{type:ControlType.Array,title:\"Questions\",control:{type:ControlType.Object,controls:{question:{type:ControlType.String,title:\"Question\"},answer:{type:ControlType.String,title:\"Answer\",displayTextArea:true},links:{type:ControlType.Array,title:\"Links\",control:{type:ControlType.Object,controls:{text:{type:ControlType.String,title:\"Phrase\"},href:{type:ControlType.String,title:\"URL\"}}}}}}},openFirst:{type:ControlType.Boolean,title:\"Open first\",defaultValue:false},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#EDDFD3\"},lineColor:{type:ControlType.Color,title:\"Lines\",defaultValue:\"rgba(237, 223, 211, 0.22)\"},accent:{type:ControlType.Color,title:\"Icon\",defaultValue:\"#CC1517\"},fontFamily:{type:ControlType.String,title:\"Font\",defaultValue:\"Noto Sans\"},questionSize:{type:ControlType.Number,title:\"Q size\",defaultValue:18,min:14,max:28,step:1},answerSize:{type:ControlType.Number,title:\"A size\",defaultValue:16,min:13,max:20,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQ\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"672\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQ.map"],"mappings":"yOAQA,SAAS,EAAQ,EAAO,EAAM,EAAO,CAAC,GAAG,CAAC,GAAQ,CAAC,GAAO,CAAC,EAAM,OAAO,OAAO,EAAO,IAAM,EAAM,CAAC,EAAE,IAAI,IAAM,KAAQ,EAAM,CAAC,IAAM,EAAK,GAAM,EAAK,KAAW,EAAK,GAAM,EAAK,KAAK,GAAG,CAAC,GAAM,CAAC,EAAK,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