{"version":3,"file":"GSRC_HearTheCall.BLYYvaXL.mjs","names":["React.useRef","React.useState","React.useCallback"],"sources":["https:/framerusercontent.com/modules/2iJrgbfBIbuE8rzSwhZJ/2z70SiT7pC48bwqiAIzQ/GSRC_HearTheCall.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";// \"Hear the call\": an opt-in button in the hero that plays ~14 s of real GSRC commentary over the\n// silent showreel. Never autoplays. Click again (or Esc, or scroll past the hero) to stop.\n// Default clip: IMSA Vintage Series R4 Indianapolis (2026 S4), the last-lap fuel drag race to the line,\n// from GSRC's own replay (youtube.com/watch?v=9NO6ilV0uSY at 1:26:21).\n// The audio file only loads when the visitor presses play (preload=\"none\").\n// 2026-10-18: `look` = \"link\" (default, the small text link in the /v2 hero) or \"player\" (a bordered panel with a red\n// play square and the caption always shown, for /hire-sim-racing-commentators where the clip is the section's subject).\n// The hero version stops once the page scrolls past the first screen; the player stops when it leaves the viewport.\nconst CLIP=\"https://framerusercontent.com/assets/ekyzzqB8k6kHQ7e3jrHePGQJ0.mp3\";/**\r\n * @framerSupportedLayoutWidth any\r\n * @framerSupportedLayoutHeight auto\r\n */export default function HearTheCall(props){const{src,label,playingLabel,caption,look,style}=props;const player=look===\"player\";const audio=React.useRef(null);const wrap=React.useRef(null);const[playing,setPlaying]=React.useState(false);const[progress,setProgress]=React.useState(0);const[reduce,setReduce]=React.useState(false);React.useEffect(()=>setReduce(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches),[]);const stop=React.useCallback(()=>{const a=audio.current;if(!a)return;a.pause();a.currentTime=0;setPlaying(false);setProgress(0);},[]);React.useEffect(()=>{if(!playing)return;const onKey=e=>e.key===\"Escape\"&&stop();window.addEventListener(\"keydown\",onKey);if(player){const el=wrap.current;const io=el&&typeof IntersectionObserver!==\"undefined\"?new IntersectionObserver(([e])=>!e.isIntersecting&&stop()):null;if(io&&el)io.observe(el);return()=>{io?.disconnect();window.removeEventListener(\"keydown\",onKey);};}const onScroll=()=>window.scrollY>window.innerHeight*.9&&stop();window.addEventListener(\"scroll\",onScroll,{passive:true});return()=>{window.removeEventListener(\"scroll\",onScroll);window.removeEventListener(\"keydown\",onKey);};},[playing,stop,player]);const toggle=()=>{const a=audio.current;if(!a)return;if(playing)return stop();a.volume=.9;a.play().then(()=>setPlaying(true)).catch(()=>setPlaying(false));};const mono={fontFamily:\"Poppins, 'Poppins Placeholder', sans-serif\",fontWeight:600,letterSpacing:\".12em\",textTransform:\"uppercase\",fontSize:11};const bars=[.5,.9,.65,1,.75,.55];const css=`@keyframes gsrc-eq{0%,100%{transform:scaleY(.35)}50%{transform:scaleY(1)}}\r\n/* 2026-10-17: a small text link next to the buttons, not a third button. 44px tall for touch. */\r\n.gsrc-htc{display:inline-flex;align-items:center;gap:10px;min-height:44px;padding:0 4px;border:0;border-radius:0;background:none;color:#B3B3B3;cursor:pointer;transition:color .2s}\r\n.gsrc-htc:hover{color:#F5F5F5}\r\n.gsrc-htc[aria-pressed=true]{color:#F5F5F5}\r\n.gsrc-htc:focus-visible{outline:2px solid #F5F5F5;outline-offset:3px}\r\n.gsrc-htp{display:flex;align-items:center;gap:16px;width:100%;max-width:560px;padding:14px 18px 14px 14px;border:1px solid #262626;border-radius:0;background:#141414;color:#F5F5F5;cursor:pointer;text-align:left;transition:background .2s,border-color .2s}\r\n.gsrc-htp:hover{background:#1C1C1C;border-color:#3A3A3A}\r\n.gsrc-htp:focus-visible{outline:2px solid #F5F5F5;outline-offset:3px}\r\n.gsrc-htp-key{flex:none;display:flex;align-items:center;justify-content:center;width:52px;height:52px;background:#FF2727;color:#101010}\r\n.gsrc-htp:hover .gsrc-htp-key{background:#D91E1E;color:#F5F5F5}`;if(player)return /*#__PURE__*/_jsxs(\"div\",{ref:wrap,style:{...style,display:\"flex\",width:\"100%\"},children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:String(css).replace(/<\\//g,\"<\\\\/\")}}),/*#__PURE__*/_jsx(\"audio\",{ref:audio,src:src||CLIP,preload:\"none\",onTimeUpdate:e=>{const a=e.currentTarget;if(a.duration)setProgress(a.currentTime/a.duration);},onEnded:stop}),/*#__PURE__*/_jsxs(\"button\",{type:\"button\",className:\"gsrc-htp\",\"aria-pressed\":playing,onClick:toggle,\"aria-label\":playing?\"Stop the commentary clip\":\"Play a 14-second clip of GSRC commentary (sound on)\",children:[/*#__PURE__*/_jsx(\"span\",{className:\"gsrc-htp-key\",\"aria-hidden\":\"true\",children:playing?/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 16 16\",children:/*#__PURE__*/_jsx(\"rect\",{x:\"3\",y:\"3\",width:\"10\",height:\"10\",fill:\"currentColor\"})}):/*#__PURE__*/_jsx(\"svg\",{width:\"18\",height:\"18\",viewBox:\"0 0 18 18\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M5 2.5v13l11-6.5z\",fill:\"currentColor\"})})}),/*#__PURE__*/_jsxs(\"span\",{style:{display:\"flex\",flexDirection:\"column\",gap:6,flex:1,minWidth:0},children:[/*#__PURE__*/_jsxs(\"span\",{style:{display:\"flex\",alignItems:\"center\",gap:10},children:[/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{display:\"inline-flex\",alignItems:\"flex-end\",gap:2,height:14,color:playing?\"#FF2727\":\"#8A8A8A\"},children:bars.map((b,i)=>/*#__PURE__*/_jsx(\"span\",{style:{width:2,height:14*b,background:\"currentColor\",transformOrigin:\"bottom\",animation:playing&&!reduce?`gsrc-eq ${.55+i*.09}s ease-in-out ${i*.05}s infinite`:\"none\",transform:playing?undefined:\"scaleY(.45)\"}},i))}),/*#__PURE__*/_jsx(\"span\",{style:{...mono,fontSize:13,color:\"#F5F5F5\"},children:playing?playingLabel:label})]}),caption&&/*#__PURE__*/_jsx(\"span\",{style:{...mono,fontWeight:500,fontSize:11,color:\"#B3B3B3\",letterSpacing:\".08em\"},children:caption}),/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{display:\"block\",width:\"100%\",height:2,background:\"#262626\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"span\",{style:{display:\"block\",height:\"100%\",width:`${progress*100}%`,background:\"#FF2727\"}})})]})]})]});return /*#__PURE__*/_jsxs(\"div\",{style:{...style,display:\"inline-flex\",flexDirection:\"column\",gap:8,alignItems:\"flex-start\"},children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:String(css).replace(/<\\//g,\"<\\\\/\")}}),/*#__PURE__*/_jsx(\"audio\",{ref:audio,src:src||CLIP,preload:\"none\",onTimeUpdate:e=>{const a=e.currentTarget;if(a.duration)setProgress(a.currentTime/a.duration);},onEnded:stop}),/*#__PURE__*/_jsxs(\"button\",{type:\"button\",className:\"gsrc-htc\",\"aria-pressed\":playing,onClick:toggle,\"aria-label\":playing?\"Stop the commentary clip\":\"Play a 14-second clip of GSRC commentary (sound on)\",children:[/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{display:\"inline-flex\",alignItems:\"flex-end\",gap:2,height:14},children:bars.map((b,i)=>/*#__PURE__*/_jsx(\"span\",{style:{width:2,height:14*b,borderRadius:1,background:\"currentColor\",transformOrigin:\"bottom\",animation:playing&&!reduce?`gsrc-eq ${.55+i*.09}s ease-in-out ${i*.05}s infinite`:\"none\",transform:playing?undefined:\"scaleY(.45)\"}},i))}),/*#__PURE__*/_jsx(\"span\",{style:mono,children:playing?playingLabel:label}),playing&&/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{width:44,height:2,background:\"rgba(245,245,245,.25)\",borderRadius:2,overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"span\",{style:{display:\"block\",height:\"100%\",width:`${progress*100}%`,background:\"#F5F5F5\"}})})]}),playing&&caption&&/*#__PURE__*/_jsx(\"span\",{style:{...mono,fontSize:10,color:\"#B3B3B3\",letterSpacing:\".08em\"},children:caption})]});}HearTheCall.defaultProps={src:\"\",label:\"Hear the call\",playingLabel:\"Stop\",caption:\"IMSA Vintage Series \\xb7 R4 Indianapolis \\xb7 live on GSRC\",look:\"link\"};addPropertyControls(HearTheCall,{src:{type:ControlType.File,title:\"Clip\",allowedFileTypes:[\"mp3\",\"m4a\",\"aac\",\"wav\"]},label:{type:ControlType.String,title:\"Label\"},playingLabel:{type:ControlType.String,title:\"Playing label\"},caption:{type:ControlType.String,title:\"Caption\",description:\"Link: shown while the clip plays. Player: always shown.\"},look:{type:ControlType.Enum,title:\"Look\",options:[\"link\",\"player\"],optionTitles:[\"Link\",\"Player\"],displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HearTheCall\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GSRC_HearTheCall.map"],"mappings":"oNAWG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,MAAI,QAAM,eAAa,UAAQ,OAAK,SAAO,EAAY,EAAO,IAAO,SAAe,EAAMA,EAAa,IAAI,EAAQ,EAAKA,EAAa,IAAI,EAAO,CAAC,EAAQ,GAAYC,EAAe,EAAK,EAAO,CAAC,EAAS,GAAaA,EAAe,CAAC,EAAO,CAAC,EAAO,GAAWA,EAAe,EAAK,EAAE,MAAoB,EAAU,EAAO,WAAW,kCAAkC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,IAAM,EAAKC,MAAsB,CAAC,IAAM,EAAE,EAAM,QAAY,IAAS,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,EAAW,EAAK,EAAE,EAAY,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAoB,CAAC,GAAG,CAAC,EAAQ,OAAO,IAAM,EAAM,GAAG,EAAE,MAAM,UAAU,EAAK,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