{"version":3,"file":"HowItWorks3.kf2KhRPH.mjs","names":["useState","useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/aNR95zzRIDT7Fh2LBZSw/LcyyW2o791t59rfdvOC7/HowItWorks3.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useRef,useEffect,cloneElement,isValidElement}from\"react\";const colorGreySalt100=\"#F3F4F6\";const colorGreySalt200=\"#D1D5DC\";// hiw-desktop / hiw-mobile toggle visibility via media query.\n// IMPORTANT: never put `display` in an inline style on elements that carry\n// these classes — inline styles beat class rules and would break the toggle.\n// All display values live here in CSS only.\nconst CSS=`\n  .hiw-wrap              { padding: 120px 0; border-width: 0 1px; }\n  .hiw-title             { font-size: 32px; }\n  .hiw-desktop-block     { display: block; }\n  .hiw-desktop-flex      { display: flex; gap: 4px; margin-bottom: 40px; flex-wrap: wrap; }\n  .hiw-mobile-block      { display: none; }\n\n  @media (max-width: 810px) {\n    .hiw-wrap            { padding: 64px 0; border-width: 0; }\n    .hiw-title           { font-size: 24px; }\n    .hiw-desktop-block   { display: none; }\n    .hiw-desktop-flex    { display: none; }\n    .hiw-mobile-block    { display: block; }\n  }\n`;function withFluidSize(element){if(!/*#__PURE__*/isValidElement(element))return element;return /*#__PURE__*/cloneElement(element,{style:{...element.props.style,width:\"100%\",height:\"auto\"}});}export default function HowItWorks({title,tabLabels,slots,accentColor,style}){const[activeIndex,setActiveIndex]=useState(0);const[openIndex,setOpenIndex]=useState(0);const containerRef=useRef(null);const[containerWidth,setContainerWidth]=useState(0);useEffect(()=>{if(!containerRef.current)return;const ro=new ResizeObserver(entries=>{setContainerWidth(entries[0].contentRect.width);});ro.observe(containerRef.current);return()=>ro.disconnect();},[]);const count=Math.max(slots?.length??0,tabLabels?.length??0);const items=Array.from({length:count},(_,i)=>({buttonLabel:tabLabels?.[i]??`Step ${i+1}`,content:slots?.[i]}));// ── Desktop scroll math ──────────────────────────────────────────\nconst cardWidth=535;const maxScroll=Math.max(0,items.length*cardWidth-containerWidth);const stepSize=items.length>1?maxScroll/(items.length-1):0;const offset=activeIndex*stepSize;// ── Desktop height equalisation ──────────────────────────────────\nconst cardRefs=useRef([]);const[stripHeight,setStripHeight]=useState(undefined);useEffect(()=>{const recalc=()=>{const heights=cardRefs.current.filter(el=>el!==null).map(el=>el.scrollHeight);if(heights.length>0)setStripHeight(Math.max(...heights));};const observers=[];cardRefs.current.forEach(el=>{if(!el)return;const ro=new ResizeObserver(recalc);ro.observe(el);observers.push(ro);});recalc();return()=>observers.forEach(ro=>ro.disconnect());},[items.length]);// ── Shared card content ──────────────────────────────────────────\nconst cardContent=(item,i,fluid)=>{const slot=item.content??/*#__PURE__*/_jsxs(\"div\",{style:{flex:1,padding:32,background:\"white\",color:\"#9CA3AF\",fontSize:14,fontFamily:\"Geist, sans-serif\",display:\"flex\",flexDirection:\"column\",alignItems:\"flex-start\",gap:8},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontSize:20},children:\"🖼\"}),/*#__PURE__*/_jsx(\"strong\",{style:{color:\"#6B7280\"},children:item.buttonLabel}),/*#__PURE__*/_jsx(\"span\",{style:{lineHeight:1.6},children:demoDescriptions[i]??\"Connect a Frame in the panel →\"})]});return fluid?withFluidSize(slot):slot;};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:CSS}),/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{fontFamily:\"sans-serif\",width:\"100%\",...style},children:/*#__PURE__*/_jsxs(\"div\",{className:\"hiw-wrap\",style:{maxWidth:\"1280px\",margin:\"0 auto\",borderColor:colorGreySalt200,borderStyle:\"solid\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{padding:\"0 16px\"},children:[/*#__PURE__*/_jsx(\"h2\",{className:\"hiw-title\",style:{fontWeight:700,fontFamily:'\"ModeratExtended-Bold Regular\", \"ModeratExtended-Bold Regular Placeholder\", sans-serif',margin:\"0 0 24px\"},children:title}),/*#__PURE__*/_jsx(\"div\",{className:\"hiw-desktop-flex\",children:items.map((item,i)=>/*#__PURE__*/_jsx(\"button\",{onClick:()=>setActiveIndex(i),style:{padding:\"8px 20px\",borderRadius:4,border:\"none\",cursor:\"pointer\",fontSize:16,fontWeight:500,fontFamily:\"Geist\",lineHeight:\"24px\",background:activeIndex===i?accentColor:\"transparent\",color:activeIndex===i?\"#fff\":\"#333\",transition:\"all 0.15s ease\"},children:item.buttonLabel},i))})]}),/*#__PURE__*/_jsx(\"div\",{className:\"hiw-desktop-block\",style:{borderColor:colorGreySalt200,borderStyle:\"solid\",borderWidth:\"1px 0\",overflow:\"hidden\",height:stripHeight},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"stretch\",gap:1,backgroundColor:colorGreySalt200,transform:`translateX(-${offset}px)`,transition:\"transform 0.4s cubic-bezier(0.4, 0, 0.2, 1)\"},children:items.map((item,i)=>/*#__PURE__*/_jsx(\"div\",{ref:el=>{cardRefs.current[i]=el;},style:{minWidth:`${cardWidth}px`,width:`${cardWidth}px`,flexShrink:0,alignSelf:\"stretch\",display:\"flex\",boxSizing:\"border-box\"},children:cardContent(item,i,false)},i))})}),/*#__PURE__*/_jsx(\"div\",{className:\"hiw-mobile-block\",style:{borderColor:colorGreySalt200,borderStyle:\"solid\",borderWidth:\"1px\",margin:\"0 16px\"},children:items.map((item,i)=>{const isOpen=openIndex===i;return /*#__PURE__*/_jsxs(\"div\",{style:{borderBottom:i<items.length-1?`1px solid ${colorGreySalt200}`:\"none\"},children:[/*#__PURE__*/_jsxs(\"button\",{onClick:()=>setOpenIndex(isOpen?-1:i),style:{width:\"100%\",display:\"flex\",alignItems:\"center\",gap:12,padding:\"16px\",background:\"white\",border:\"none\",cursor:\"pointer\",textAlign:\"left\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{flexShrink:0,width:24,height:24,borderRadius:\"2px\",background:isOpen?accentColor:colorGreySalt100,color:isOpen?\"#fff\":\"#6B7280\",fontSize:12,fontWeight:700,fontFamily:\"Geist, sans-serif\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"all 0.2s ease\"},children:i+1}),/*#__PURE__*/_jsx(\"span\",{style:{flex:1,fontSize:15,fontWeight:isOpen?600:400,fontFamily:\"Geist, sans-serif\",color:isOpen?\"#111\":\"#555\",transition:\"color 0.2s ease, font-weight 0.1s\"},children:item.buttonLabel}),/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 16 16\",fill:\"none\",style:{flexShrink:0,transform:isOpen?\"rotate(180deg)\":\"rotate(0deg)\",transition:\"transform 0.25s ease\",color:\"#111\"},children:/*#__PURE__*/_jsx(\"path\",{d:\"M4 6L8 10L12 6\",stroke:\"currentColor\",strokeWidth:\"1.5\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})]}),/*#__PURE__*/_jsx(\"div\",{style:{maxHeight:isOpen?\"800px\":\"0px\",overflow:\"hidden\",transition:isOpen?\"max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1)\":\"max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1)\"},children:/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",boxSizing:\"border-box\",borderTop:`1px solid ${colorGreySalt200}`},children:cardContent(item,i,true)})})]},i);})})]})})]});}HowItWorks.defaultProps={title:\"How it works\",accentColor:\"#0057FF\",tabLabels:[\"Create an invoice\",\"Receive payments\",\"Send an invoice\",\"Analyze Invoice\"],slots:[]};const demoDescriptions=[\"Add a product and customer details, set tax rates manually or automatically, and save everything to your dashboard.\",\"Accept payments in 25+ languages and 135+ currencies, with 100+ local payment methods shown dynamically based on your customer's location.\",\"Send a branded email via Stripe with a link to pay online or download the invoice as a PDF — on any device.\",\"Get an instant breakdown of any invoice: line items, tax, discounts, and payment status — all in one view.\"];addPropertyControls(HowItWorks,{title:{type:ControlType.String,title:\"Title\",defaultValue:\"How it works\"},accentColor:{type:ControlType.Color,title:\"Accent Color\",defaultValue:\"#0057FF\"},tabLabels:{type:ControlType.Array,title:\"Tab Labels\",control:{type:ControlType.String,defaultValue:\"Step\"}},slots:{type:ControlType.Array,title:\"Card Frames\",control:{type:ControlType.ComponentInstance}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HowItWorks\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HowItWorks3.map"],"mappings":"gNAkBE,SAAS,EAAc,EAAQ,CAAyD,OAAvC,EAAe,EAAQ,CAAoC,EAAa,EAAQ,CAAC,MAAM,CAAC,GAAG,EAAQ,MAAM,MAAM,MAAM,OAAO,OAAO,OAAO,CAAC,CAAC,CAA7G,EAA+G,SAAwB,EAAW,CAAC,QAAM,YAAU,QAAM,cAAY,SAAO,CAAC,GAAK,CAAC,EAAY,GAAgBA,EAAS,EAAE,CAAM,CAAC,EAAU,GAAcA,EAAS,EAAE,CAAO,EAAaC,EAAO,KAAK,CAAM,CAAC,EAAe,GAAmBD,EAAS,EAAE,CAAC,MAAc,CAAC,GAAG,CAAC,EAAa,QAAQ,OAAO,IAAM,EAAG,IAAI,eAAe,GAAS,CAAC,EAAkB,EAAQ,GAAG,YAAY,MAAM,EAAG,CAAkC,OAAjC,EAAG,QAAQ,EAAa,QAAQ,KAAW,EAAG,YAAY,EAAG,EAAE,CAAC,CAAC,IAAM,EAAM,KAAK,IAAI,GAAO,QAAQ,EAAE,GAAW,QAAQ,EAAE,CAAO,EAAM,MAAM,KAAK,CAAC,OAAO,EAAM,EAAE,EAAE,KAAK,CAAC,YAAY,IAAY,IAAI,QAAQ,EAAE,IAAI,QAAQ,IAAQ,GAAG,EAAE,CACpxB,EAAU,KAAK,IAAI,EAAE,EAAM,OAAO,IAAU,EAAe,CAAkE,EAAO,GAAzD,EAAM,OAAO,EAAE,GAAW,EAAM,OAAO,GAAG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