{"version":3,"file":"DRMRotatingGradientWord.B4TqdfJr.mjs","names":["p","useRef","useState"],"sources":["https:/framerusercontent.com/modules/n2NchSYB3Yd1Ml8Dt13E/mHKTKpDVgM8CJ83Oedfw/DRMRotatingGradientWord.js"],"sourcesContent":["/**\n * DRMRotatingGradientWord.tsx\n * Fingerprint: DRM-ROTW-001 · v1.0.0 · Raizen for Dr Ramneek Mahajan\n *\n * What: a line where ONE gradient word fades through a configurable phrase list\n * (prefix + rotating gradient word + optional suffix). Ported (Scenario C) from\n * SageX SGX-ROTW (.flipword cycler), re-themed to DRM tokens and Framer-wrapped.\n *\n * Nothing is rigid — every choice is a property control:\n *   content : prefix · phrases[] · suffix (empty suffix = word-last, zero \"dance\")\n *   layout  : alignment (left / center / right)\n *   type    : fontFamily · fontSize · fontWeight · lineHeight · letterSpacing\n *   colour  : colorScheme (light / dark / custom, default custom) · gradient stops · angle · text\n *   motion  : cycleTrigger (in-view / continuous) · interval · fadeMs\n *\n * Build rules (raizen-framer-coded-component-build-rules §2-5), applied not optional:\n *   - SSR-safe: first render shows phrases[0] statically; cycling starts in\n *     useEffect (no window / matchMedia / IntersectionObserver at render time).\n *     useIsStaticRenderer() halts motion on the Framer canvas.\n *   - Animation is opacity-only, gated by (active && !static && !reduced-motion).\n *   - Descender + side gutter baked into the word span (inline-block + padding) so\n *     background-clip:text never clips g / y / descenders. [HARD — Ram caught the\n *     clip 2026-06-29; this is the permanent fix, not a default.]\n *   - aria-live=\"polite\" on the rotating word. Every prop has a default.\n *   - All visible colour routes through getColor() (colorScheme-aware).\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";const COMPONENT_META={id:\"DRM-ROTW-001\",name:\"DRMRotatingGradientWord\",author:\"Raizen\",company:\"Raizen\",hash:\"1f4a2e6b8a0c0001\",version:\"1.0.0\",project:\"dr-ramneek\",created:\"2026-06-29\",contentType:\"ui-component\",topic:\"rotating-gradient-word\",role:\"text-emphasis\"};const FINGERPRINT_PROPS={\"data-component-id\":COMPONENT_META.id,\"data-component-name\":COMPONENT_META.name,\"data-component-author\":COMPONENT_META.author,\"data-component-company\":COMPONENT_META.company,\"data-component-hash\":COMPONENT_META.hash,\"data-component-version\":COMPONENT_META.version,\"data-component-project\":COMPONENT_META.project,\"data-component-created\":COMPONENT_META.created,\"data-content-type\":COMPONENT_META.contentType,\"data-topic\":COMPONENT_META.topic,\"data-component-role\":COMPONENT_META.role};// DRM tokens (handoff-v5.2/tokens.css): plum primary #4A2E4D, slate-periwinkle\n// secondary #4A6B8A, text #1A1A1A light / #E0E5E8 dark. Edit here — never inline.\nconst TOKENS_LIGHT={textPrimary:\"#1A1A1A\",gradientStart:\"#4A2E4D\",gradientEnd:\"#4A6B8A\"};const TOKENS_DARK={textPrimary:\"#E0E5E8\",gradientStart:\"#B49AC9\",gradientEnd:\"#9FB6CF\"};function getColor(value,scheme,key){if(scheme===\"custom\")return value;return scheme===\"dark\"?TOKENS_DARK[key]:TOKENS_LIGHT[key];}const DEFAULTS={prefix:\"Covered for his \",phrases:[\"robotic-assisted surgery\",\"surgical technique\",\"teaching\",\"insurance advocacy\"],suffix:\"\",alignment:\"left\",fontFamily:\"Inter, sans-serif\",fontSize:40,fontWeight:600,lineHeight:1.4,letterSpacing:0,colorScheme:\"custom\",textColor:TOKENS_LIGHT.textPrimary,gradientStart:TOKENS_LIGHT.gradientStart,gradientEnd:TOKENS_LIGHT.gradientEnd,gradientAngle:135,cycleTrigger:\"in-view\",interval:2500,fadeMs:260};/**\n * @framerIntrinsicWidth 480\n * @framerIntrinsicHeight 64\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function DRMRotatingGradientWord(props){const p={...DEFAULTS,...props};const phrases=p.phrases&&p.phrases.length?p.phrases:DEFAULTS.phrases;const isStatic=useIsStaticRenderer();const rootRef=useRef(null);const[index,setIndex]=useState(0);const[faded,setFaded]=useState(false);const[active,setActive]=useState(false);// Decide whether motion may run. Client-only; SSR + canvas stay on phrase 0.\nuseEffect(()=>{if(isStatic)return;const reduce=typeof window!==\"undefined\"&&!!window.matchMedia&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;if(reduce)return;if(p.cycleTrigger===\"continuous\"){setActive(true);return;}const el=rootRef.current;if(!el||typeof IntersectionObserver===\"undefined\"){setActive(true);return;}const io=new IntersectionObserver(entries=>{entries.forEach(e=>{if(e.isIntersecting)setActive(true);});},{threshold:.35});io.observe(el);return()=>io.disconnect();},[isStatic,p.cycleTrigger]);// The fade-and-swap cycle.\nuseEffect(()=>{if(!active||isStatic||phrases.length<2)return;let swap;const tick=setInterval(()=>{setFaded(true);swap=setTimeout(()=>{setIndex(i=>(i+1)%phrases.length);setFaded(false);},Math.min(p.fadeMs,p.interval/2));},p.interval);return()=>{clearInterval(tick);clearTimeout(swap);};},[active,isStatic,phrases.length,p.interval,p.fadeMs]);const textColor=getColor(p.textColor,p.colorScheme,\"textPrimary\");const gStart=getColor(p.gradientStart,p.colorScheme,\"gradientStart\");const gEnd=getColor(p.gradientEnd,p.colorScheme,\"gradientEnd\");const word=phrases[index]??phrases[0];return /*#__PURE__*/_jsxs(\"div\",{ref:rootRef,...FINGERPRINT_PROPS,style:{fontFamily:p.fontFamily,fontSize:p.fontSize,fontWeight:p.fontWeight,lineHeight:p.lineHeight,letterSpacing:p.letterSpacing,textAlign:p.alignment,color:textColor,width:\"100%\",...p.style},children:[p.prefix,/*#__PURE__*/_jsx(\"span\",{\"aria-live\":\"polite\",style:{display:\"inline-block\",padding:\"0.05em 0.12em 0.2em\",backgroundImage:`linear-gradient(${p.gradientAngle}deg, ${gStart}, ${gEnd})`,WebkitBackgroundClip:\"text\",backgroundClip:\"text\",WebkitTextFillColor:\"transparent\",color:\"transparent\",opacity:faded?0:1,transition:`opacity ${p.fadeMs}ms ease`},children:word}),p.suffix]});}addPropertyControls(DRMRotatingGradientWord,{prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:DEFAULTS.prefix},phrases:{type:ControlType.Array,title:\"Phrases\",control:{type:ControlType.String},defaultValue:DEFAULTS.phrases},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:DEFAULTS.suffix,description:\"Leave empty to end on the word (no shift as it changes).\"},alignment:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:DEFAULTS.alignment,displaySegmentedControl:true},fontFamily:{type:ControlType.String,title:\"Font\",defaultValue:DEFAULTS.fontFamily},fontSize:{type:ControlType.Number,title:\"Size\",min:10,max:160,step:1,displayStepper:true,defaultValue:DEFAULTS.fontSize},fontWeight:{type:ControlType.Number,title:\"Weight\",min:100,max:900,step:100,displayStepper:true,defaultValue:DEFAULTS.fontWeight},lineHeight:{type:ControlType.Number,title:\"Line height\",min:1,max:2,step:.05,defaultValue:DEFAULTS.lineHeight},letterSpacing:{type:ControlType.Number,title:\"Tracking\",min:-4,max:8,step:.1,defaultValue:DEFAULTS.letterSpacing},colorScheme:{type:ControlType.Enum,title:\"Scheme\",options:[\"light\",\"dark\",\"custom\"],optionTitles:[\"Light\",\"Dark\",\"Custom\"],defaultValue:DEFAULTS.colorScheme},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:DEFAULTS.textColor,hidden:props=>props.colorScheme!==\"custom\"},gradientStart:{type:ControlType.Color,title:\"Gradient 1\",defaultValue:DEFAULTS.gradientStart,hidden:props=>props.colorScheme!==\"custom\"},gradientEnd:{type:ControlType.Color,title:\"Gradient 2\",defaultValue:DEFAULTS.gradientEnd,hidden:props=>props.colorScheme!==\"custom\"},gradientAngle:{type:ControlType.Number,title:\"Angle\",min:0,max:360,step:5,defaultValue:DEFAULTS.gradientAngle},cycleTrigger:{type:ControlType.Enum,title:\"Start\",options:[\"in-view\",\"continuous\"],optionTitles:[\"On scroll into view\",\"Continuous\"],defaultValue:DEFAULTS.cycleTrigger},interval:{type:ControlType.Number,title:\"Hold (ms)\",min:800,max:8e3,step:100,displayStepper:true,defaultValue:DEFAULTS.interval},fadeMs:{type:ControlType.Number,title:\"Fade (ms)\",min:0,max:1200,step:20,displayStepper:true,defaultValue:DEFAULTS.fadeMs}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DRMRotatingGradientWord\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"64\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"480\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DRMRotatingGradientWord.map"],"mappings":"qNA2BiL,SAAS,EAAS,EAAM,EAAO,EAAI,CAAmC,OAA/B,IAAS,SAAgB,EAAa,IAAS,OAAO,EAAY,GAAK,EAAa,EAAK,CAK9S,SAAwB,EAAwB,EAAM,CAAC,IAAMA,EAAE,CAAC,GAAG,EAAS,GAAG,CAAK,EAAQ,EAAQA,EAAE,SAASA,EAAE,QAAQ,OAAOA,EAAE,QAAQ,EAAS,QAAc,EAAS,EAAoB,EAAQ,EAAQC,EAAO,IAAI,EAAO,CAAC,EAAM,GAAUC,EAAS,CAAC,EAAO,CAAC,EAAM,GAAUA,EAAS,EAAK,EAAO,CAAC,EAAO,GAAWA,EAAS,EAAK,EAC5U,MAAc,CAAiJ,GAA7I,GAAoC,IAAS,QAAe,EAAO,YAAY,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAkB,OAAO,GAAGF,EAAE,eAAe,aAAa,CAAC,EAAU,EAAI,EAAE,MAAO,CAAC,IAAM,EAAG,EAAQ,QAAQ,GAAG,CAAC,GAAI,OAAO,qBAAuB,IAAY,CAAC,EAAU,EAAI,EAAE,MAAO,CAAC,IAAM,EAAG,IAAI,qBAAqB,GAAS,CAAC,EAAQ,QAAQ,GAAG,CAAI,EAAE,gBAAe,EAAU,EAAI,C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