{"version":3,"file":"RotatingPromoBar.BSFN8oLJ.mjs","names":["React.useRef","React.useState","React.useMemo","React.useCallback","__esmMin","init_ssg_sandbox_shims","te","ne","window","_e","de","init_jsx_runtime","pe","J","c","p","init_npm_react_18_3_1","ce","useInView","motion","useReducedMotion","AnimatePresence","init_framer_motion_DhsWWWsN","init_framer_DDfsYcI0","useIsStaticRenderer","ControlType","addPropertyControls","RotatingPromoBar","props","isStatic","reduceMotion","rootRef","isInView","activeIndex","setActiveIndex","isCollapsed","setIsCollapsed","messages","messageOne","messageTwo","durationMs","intervalSeconds","getAccentParts","match","message","start","end","onScroll","nextCollapsed","prev","timer","currentMessage","textParts","hasLink","link","textNode","textColor","baseOpacity","accentColor","glowColor","backgroundStart","backgroundEnd","withPromoAwareNav","isPromoPassed","setIsPromoPassed","nextPromoPassed","Component","init_RotatingPromoBar"],"sources":["https:/framerusercontent.com/modules/PSk9fsYaYTmy4xqj1veZ/381Y8tr68EU0rCcIDDyo/RotatingPromoBar.js"],"sourcesContent":["// User request: Create a new self-contained Framer code component named Rotating Promo Bar for the Summit AI homepage. It should be a slim announcement strip that alternates between two editable messages on a configurable interval, supports link click-through, soft message swap animation with reduced-motion support, truncates overflow, and exposes controls for messageOne, messageTwo, link, intervalSeconds, backgroundStart, backgroundEnd, glowColor, textColor, accentColor, baseOpacity, fontSize, and height.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{AnimatePresence,motion,useInView,useReducedMotion}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function RotatingPromoBar(props){const{messageOne,messageTwo,link,intervalSeconds,backgroundStart,backgroundEnd,glowColor,textColor,accentColor,baseOpacity,fontSize,height}=props;const isStatic=useIsStaticRenderer();const reduceMotion=useReducedMotion();const rootRef=React.useRef(null);const isInView=useInView(rootRef,{margin:\"0px\",amount:.2});const[activeIndex,setActiveIndex]=React.useState(0);const[isCollapsed,setIsCollapsed]=React.useState(false);const messages=React.useMemo(()=>[messageOne,messageTwo],[messageOne,messageTwo]);const durationMs=React.useMemo(()=>Math.max(1,intervalSeconds)*1e3,[intervalSeconds]);// Extracts text wrapped in **markdown bold** tags\nconst getAccentParts=React.useCallback(message=>{const match=message.match(/\\*\\*(.*?)\\*\\*/);if(!match||match.index===undefined){return{before:message,accent:\"\",after:\"\"};}const start=match.index;const end=start+match[0].length;return{before:message.slice(0,start),accent:match[1],after:message.slice(end)};},[]);React.useEffect(()=>{if(typeof window===\"undefined\")return;const onScroll=()=>{const nextCollapsed=window.scrollY>20;React.startTransition(()=>{setIsCollapsed(prev=>prev===nextCollapsed?prev:nextCollapsed);});};onScroll();window.addEventListener(\"scroll\",onScroll,{passive:true});return()=>window.removeEventListener(\"scroll\",onScroll);},[]);React.useEffect(()=>{if(isStatic||!isInView)return;const timer=window.setInterval(()=>{React.startTransition(()=>{setActiveIndex(prev=>(prev+1)%messages.length);});},durationMs);return()=>{window.clearInterval(timer);};},[durationMs,isInView,isStatic,messages.length]);const currentMessage=messages[activeIndex]??\"\";const textParts=getAccentParts(currentMessage);const hasLink=typeof link===\"string\"&&link.trim().length>0;const textNode=/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",minWidth:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\",whiteSpace:\"nowrap\",textOverflow:\"ellipsis\",zIndex:1},children:/*#__PURE__*/_jsx(\"div\",{style:{overflow:\"hidden\",textOverflow:\"ellipsis\",whiteSpace:\"nowrap\",fontFamily:\"Inter, sans-serif\"},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",initial:false,children:/*#__PURE__*/_jsxs(motion.span,{initial:reduceMotion||isStatic?{opacity:1,y:0}:{opacity:0,y:5},animate:reduceMotion||isStatic?{opacity:1,y:0}:{opacity:1,y:0},exit:reduceMotion||isStatic?{opacity:1,y:0}:{opacity:0,y:-5},transition:{duration:reduceMotion||isStatic?0:.35,ease:\"easeOut\"},style:{display:\"inline-block\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,opacity:baseOpacity,fontWeight:400},children:textParts.before}),textParts.accent?/*#__PURE__*/_jsx(\"span\",{style:{color:accentColor,opacity:1,fontWeight:600},children:textParts.accent}):null,/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,opacity:baseOpacity,fontWeight:400},children:textParts.after})]},currentMessage)})})});return /*#__PURE__*/_jsx(motion.div,{ref:rootRef,initial:false,animate:reduceMotion||isStatic?{opacity:isCollapsed?0:1,y:isCollapsed?-8:0}:{opacity:isCollapsed?0:1,y:isCollapsed?-16:0},transition:{duration:reduceMotion||isStatic?0:.28,ease:\"easeOut\"},style:{position:\"relative\",width:\"100%\",height,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:\"0 16px\",boxSizing:\"border-box\",// This layers a radial glow in the center over the linear gradient\nbackground:`radial-gradient(circle at 50% 50%, ${glowColor} 0%, transparent 60%), linear-gradient(90deg, ${backgroundStart} 0%, ${backgroundEnd} 100%)`,fontSize,lineHeight:1.2,overflow:\"hidden\",pointerEvents:isCollapsed?\"none\":\"auto\"},children:hasLink?/*#__PURE__*/_jsx(\"a\",{href:link,\"aria-label\":`Announcement: ${currentMessage.replace(/\\*\\*/g,\"\")}`,style:{color:\"inherit\",textDecoration:\"none\",width:\"100%\",minWidth:0,display:\"flex\",justifyContent:\"center\"},children:textNode}):textNode});}export function withPromoAwareNav(Component){return /*#__PURE__*/React.forwardRef((props,ref)=>{const reduceMotion=useReducedMotion();const[isPromoPassed,setIsPromoPassed]=React.useState(false);React.useEffect(()=>{if(typeof window===\"undefined\")return;const onScroll=()=>{const nextPromoPassed=window.scrollY>20;React.startTransition(()=>{setIsPromoPassed(prev=>prev===nextPromoPassed?prev:nextPromoPassed);});};onScroll();window.addEventListener(\"scroll\",onScroll,{passive:true});return()=>window.removeEventListener(\"scroll\",onScroll);},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,style:{...props.style},animate:{...props.animate??{},y:isPromoPassed?-42:0},transition:reduceMotion?{...props.transition??{},duration:0}:{...props.transition??{},y:{duration:.28,ease:\"easeOut\"}}});});}addPropertyControls(RotatingPromoBar,{messageOne:{type:ControlType.String,title:\"Message One\",defaultValue:\"Try Summit **free for 7 days**. No credit card required. →\"},messageTwo:{type:ControlType.String,title:\"Message Two\",defaultValue:\"**Never miss another booking.** Start your 7-day free trial. →\"},link:{type:ControlType.Link,title:\"Link\",defaultValue:\"/#schedule\"},intervalSeconds:{type:ControlType.Number,title:\"Interval\",defaultValue:5,min:1,max:20,step:1,unit:\"s\"},backgroundStart:{type:ControlType.Color,title:\"BG Start\",defaultValue:\"#000000\"},backgroundEnd:{type:ControlType.Color,title:\"BG End\",defaultValue:\"#111827\"},glowColor:{type:ControlType.Color,title:\"Center Glow\",defaultValue:\"rgba(255, 255, 255, 0.1)\"},textColor:{type:ControlType.Color,title:\"Base Text\",defaultValue:\"#FFFFFF\"},baseOpacity:{type:ControlType.Number,title:\"Base Opacity\",defaultValue:.8,min:.1,max:1,step:.05},accentColor:{type:ControlType.Color,title:\"Highlight Text\",defaultValue:\"#FFFFFF\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:13,min:10,max:22,step:1,unit:\"px\"},height:{type:ControlType.Number,title:\"Height\",defaultValue:40,min:24,max:80,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"withPromoAwareNav\":{\"type\":\"reactHoc\",\"name\":\"withPromoAwareNav\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"RotatingPromoBar\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RotatingPromoBar.map"],"mappings":"A,uTAIG,SAAw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