{"version":3,"file":"Multilang.B3tlIG1x.mjs","names":["useMemo","useState"],"sources":["https:/framerusercontent.com/modules/WSJAerg0kljDR6QCFG44/ZaeEGHXNBTTJBogXCKP6/Multilang.js"],"sourcesContent":["// RotatingWelcome.tsx — Framer code component\n//\n// Cycles a hero word through several languages with a smooth Framer Motion\n// transition. Built so it can never push the rest of the section around:\n//\n//  • A hidden sizer stacks every word in a 1×1 grid, so the component\n//    reserves the width of the LONGEST word and the height of the tallest\n//    line — permanently. The visible words are absolutely positioned on\n//    top, so nothing below or beside it ever reflows. (There's an \"Auto\"\n//    width mode too, if you'd rather it hug each word.)\n//  • Words cross-fade — the outgoing and incoming word overlap — so there\n//    is never an empty frame where the line collapses.\n//  • Offsets are in `em`, so the motion scales with the font size instead\n//    of being locked to pixels.\n//  • Arabic is detected and rendered RTL automatically.\n//  • Honours prefers-reduced-motion (falls back to a plain cross-fade).\n//  • Static on the Framer canvas; animates in preview and on the live site.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useMemo,useState}from\"react\";import{AnimatePresence,motion}from\"framer-motion\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const ARABIC=/[\\u0600-\\u06FF]/;const EASE=[.22,1,.36,1];/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 420\n * @framerIntrinsicHeight 120\n */export default function RotatingWelcome(props){const{words=[],hold,transition,animation,widthMode,align,font,color,pauseOnHover,style}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const list=useMemo(()=>words.map(w=>w?.text??\"\").filter(t=>t.length>0),[words]);const[index,setIndex]=useState(0);const[paused,setPaused]=useState(false);const[reduced,setReduced]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const mq=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const update=()=>setReduced(mq.matches);update();mq.addEventListener?.(\"change\",update);return()=>mq.removeEventListener?.(\"change\",update);},[]);// Advance the word\nuseEffect(()=>{if(isCanvas||paused||list.length<2)return;const t=setTimeout(()=>setIndex(i=>(i+1)%list.length),Math.max(.2,hold)*1e3);return()=>clearTimeout(t);},[index,hold,paused,isCanvas,list.length]);// Keep the index valid if the word list is edited\nuseEffect(()=>{if(index>=list.length)setIndex(0);},[list.length,index]);if(list.length===0){return /*#__PURE__*/_jsx(\"span\",{style:{...style,...font,color,opacity:.4},children:\"Add words\"});}const current=list[Math.min(index,list.length-1)];const dur=reduced?.2:transition;const rtl=ARABIC.test(current);const justify=align===\"left\"?\"flex-start\":align===\"right\"?\"flex-end\":\"center\";// —— Motion per style, all in em so it tracks the type size ——\nconst variants={fade:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},slide:{initial:{opacity:0,y:\"0.42em\"},animate:{opacity:1,y:\"0em\"},exit:{opacity:0,y:\"-0.42em\"}},blur:{initial:{opacity:0,y:\"0.18em\",filter:\"blur(0.12em)\"},animate:{opacity:1,y:\"0em\",filter:\"blur(0em)\"},exit:{opacity:0,y:\"-0.18em\",filter:\"blur(0.12em)\"}}};const v=variants[animation===\"characters\"?\"slide\":animation];const wordLayer=/*#__PURE__*/_jsx(motion.span,{initial:reduced?{opacity:0}:v.initial,animate:reduced?{opacity:1}:v.animate,exit:reduced?{opacity:0}:v.exit,transition:{duration:dur,ease:EASE},dir:rtl?\"rtl\":\"ltr\",style:{position:\"absolute\",inset:0,display:\"flex\",alignItems:\"flex-start\",justifyContent:justify,whiteSpace:\"pre\",willChange:\"transform, opacity, filter\"},children:animation===\"characters\"&&!reduced?Array.from(current).map((ch,i)=>/*#__PURE__*/_jsx(motion.span,{initial:{opacity:0,y:\"0.5em\"},animate:{opacity:1,y:\"0em\"},exit:{opacity:0,y:\"-0.35em\"},transition:{duration:dur,ease:EASE,delay:i*(dur*.12)},style:{display:\"inline-block\"},children:ch===\" \"?\"\\xa0\":ch},`${index}-${i}`)):current},index);return /*#__PURE__*/_jsxs(\"span\",{style:{...style,...font,color,position:\"relative\",display:\"inline-block\",whiteSpace:\"pre\"},onMouseEnter:()=>pauseOnHover&&setPaused(true),onMouseLeave:()=>pauseOnHover&&setPaused(false),children:[widthMode===\"widest\"?/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":true,style:{display:\"grid\",visibility:\"hidden\",pointerEvents:\"none\"},children:list.map((t,i)=>/*#__PURE__*/_jsx(\"span\",{style:{gridArea:\"1 / 1\"},children:t},i))}):/*#__PURE__*/_jsx(motion.span,{\"aria-hidden\":true,layout:true,transition:{duration:dur,ease:EASE},style:{display:\"block\",visibility:\"hidden\",pointerEvents:\"none\"},children:current}),/*#__PURE__*/_jsx(AnimatePresence,{initial:false,children:wordLayer}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",width:1,height:1,overflow:\"hidden\",clip:\"rect(0 0 0 0)\",whiteSpace:\"nowrap\"},children:list[0]})]});}addPropertyControls(RotatingWelcome,{words:{type:ControlType.Array,title:\"Words\",control:{type:ControlType.Object,controls:{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Welcome\"}}},defaultValue:[{text:\"Welcome\"},{text:\"Ẹ k\\xe1\\xe0bọ̀\"},{text:\"Bienvenue\"},{text:\"Bienvenido\"},{text:\"Willkommen\"},{text:\"欢迎\"},{text:\"مرحبا\"}]},hold:{type:ControlType.Number,title:\"Hold\",defaultValue:2,min:.3,max:12,step:.1,unit:\"s\",description:\"How long each word stays before it changes\"},transition:{type:ControlType.Number,title:\"Transition\",defaultValue:.6,min:.1,max:2,step:.05,unit:\"s\"},animation:{type:ControlType.Enum,title:\"Style\",options:[\"fade\",\"slide\",\"blur\",\"characters\"],optionTitles:[\"Fade\",\"Slide\",\"Blur\",\"Per letter\"],defaultValue:\"blur\"},widthMode:{type:ControlType.Enum,title:\"Width\",options:[\"widest\",\"auto\"],optionTitles:[\"Reserve\",\"Hug\"],displaySegmentedControl:true,defaultValue:\"widest\",description:\"Reserve = locked to the longest word, nothing else moves\"},align:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],displaySegmentedControl:true,defaultValue:\"left\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:96,fontWeight:400,lineHeight:\"1.1em\",letterSpacing:\"-0.02em\"}},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#2B2B2B\"},pauseOnHover:{type:ControlType.Boolean,title:\"Pause on hover\",defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RotatingWelcome\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerIntrinsicHeight\":\"120\",\"framerIntrinsicWidth\":\"420\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Multilang.map"],"mappings":"4QAsBG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,EAAE,OAAK,aAAW,YAAU,YAAU,QAAM,OAAK,QAAM,eAAa,SAAO,EAAY,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAa,EAAKA,MAAY,EAAM,IAAI,GAAG,GAAG,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,CAAK,CAAC,EAAO,CAAC,EAAM,GAAUC,EAAS,CAAC,EAAO,CAAC,EAAO,GAAWA,EAAS,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAS,EAAK,EAEtU,GAFwU,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAG,EAAO,WAAW,kCAAkC,EAAQ,MAAW,EAAW,EAAG,OAAO,EAAkD,OAAhD,EAAO,EAAE,EAAG,mBAAmB,SAAS,CAAM,MAAY,EAAG,sBAAsB,SAAS,CAAM,CAAE,EAAE,CAAC,CAAC,EACppB,MAAc,CAAC,GAAG,GAAU,GAAQ,EAAK,OAAO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