{"version":3,"file":"ToggleCardVideoAudio.v_o948Kk.mjs","names":["React.forwardRef","useState","useCallback"],"sources":["https:/framerusercontent.com/modules/HAXb8usAsbryfPorbMS4/szDG4SSfU1UCFng50IhF/nyoPQewhK.js","https:/framerusercontent.com/modules/oP2maMVzZ2mwTXjuRCYd/hnqtC6by3MjkwsWBXYGJ/ToggleCardVideoAudio.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 0 0.736 L 0 17.259 C 0.005 17.527 0.153 17.772 0.388 17.902 C 0.623 18.031 0.91 18.025 1.139 17.886 L 14.647 9.625 C 14.866 9.492 15 9.254 15 8.997 C 15 8.741 14.866 8.503 14.647 8.37 L 1.139 0.109 C 0.91 -0.03 0.623 -0.036 0.388 0.093 C 0.153 0.222 0.005 0.468 0 0.736 Z\" fill-opacity=\"var(--1m6trwb, 0)\" fill=\"var(--21h8s6, rgb(0, 0, 0))\" height=\"17.99464343330372px\" id=\"aA4uwAbk9\" transform=\"translate(6.75 3.003)\" width=\"15.000071766041629px\"/><path d=\"M 0 0.736 L 0 17.259 C 0.005 17.527 0.153 17.772 0.388 17.902 C 0.623 18.031 0.91 18.025 1.139 17.886 L 14.647 9.625 C 14.866 9.492 15 9.254 15 8.997 C 15 8.741 14.866 8.503 14.647 8.37 L 1.139 0.109 C 0.91 -0.03 0.623 -0.036 0.388 0.093 C 0.153 0.222 0.005 0.468 0 0.736 Z\" fill=\"transparent\" height=\"17.99464343330372px\" id=\"dfZTdlcyH\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--pgex8v, 1.5)\" stroke=\"var(--21h8s6, rgb(0, 0, 0))\" transform=\"translate(6.75 3.003)\" width=\"15.000071766041629px\"/></svg>';const getProps=({alpha,color,height,id,width,width1,...props})=>{return{...props,ezTt3ayMo:color??props.ezTt3ayMo??\"rgb(0, 0, 0)\",lschgej4H:width1??props.lschgej4H??1.5,qxTvv_EBh:alpha??props.qxTvv_EBh};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,ezTt3ayMo,lschgej4H,qxTvv_EBh,...restProps}=getProps(props);const href=useSVGTemplate(\"3492944464\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-Lyd6D\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m6trwb\":qxTvv_EBh,\"--21h8s6\":ezTt3ayMo,\"--pgex8v\":lschgej4H,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-Lyd6D { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"ezTt3ayMo\":\"color\",\"lschgej4H\":\"width1\",\"qxTvv_EBh\":\"alpha\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Play\",\"color\":{\"type\":\"variable\",\"value\":\"21h8s6\"},\"set\":{\"localId\":\"vectorSet/NGVKdicsm\",\"id\":\"NGVKdicsm\",\"moduleId\":\"omX0gWFPqDwhaiWwf6ab\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-Lyd6D\");Icon.displayName=\"Play\";export default Icon;addPropertyControls(Icon,{ezTt3ayMo:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},lschgej4H:{defaultValue:1.5,displayStepper:true,hidden:false,max:6,min:0,step:.5,title:\"Width\",type:ControlType.Number},qxTvv_EBh:{defaultValue:0,displayStepper:true,hidden:false,max:1,min:0,step:.1,title:\"Alpha\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerVector\":\"{\\\"name\\\":\\\"Play\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"21h8s6\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/NGVKdicsm\\\",\\\"id\\\":\\\"NGVKdicsm\\\",\\\"moduleId\\\":\\\"omX0gWFPqDwhaiWwf6ab\\\"}}\",\"framerVariables\":\"{\\\"ezTt3ayMo\\\":\\\"color\\\",\\\"lschgej4H\\\":\\\"width1\\\",\\\"qxTvv_EBh\\\":\\\"alpha\\\"}\",\"framerDisableUnlink\":\"true\",\"framerImmutableVariables\":\"true\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"24\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"24\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,startTransition,useCallback,useState}from\"react\";import{useIsStaticRenderer}from\"framer\";// Create a Framer code override export named ToggleCardVideoAudio that toggles the closest card video/audio playback on click or keyboard activation while preserving styling and existing handlers.\nfunction findClosestVideo(trigger){if(typeof window===\"undefined\"||!trigger)return null;let node=trigger;while(node){const video=node.querySelector(\"video\");if(video instanceof HTMLVideoElement)return video;node=node.parentElement;}return null;}export function ToggleCardVideoAudio(Component){return /*#__PURE__*/forwardRef(function ToggleCardVideoAudioOverride(props,ref){const isStaticRenderer=useIsStaticRenderer();const[isPressed,setIsPressed]=useState(false);const toggleFromElement=useCallback(element=>{if(isStaticRenderer)return;if(typeof window===\"undefined\")return;const video=findClosestVideo(element);if(!video)return;if(video.paused){video.muted=false;video.volume=.25;const playPromise=video.play();if(playPromise&&typeof playPromise.catch===\"function\"){playPromise.catch(()=>{});}startTransition(()=>setIsPressed(true));return;}video.pause();startTransition(()=>setIsPressed(false));},[isStaticRenderer]);const handleClick=useCallback(event=>{props.onClick?.(event);if(event?.defaultPrevented)return;toggleFromElement(event?.currentTarget);},[props,toggleFromElement]);const handleKeyDown=useCallback(event=>{props.onKeyDown?.(event);if(event?.defaultPrevented)return;const key=event?.key;if(key===\"Enter\"||key===\" \"){event.preventDefault?.();toggleFromElement(event?.currentTarget);}},[props,toggleFromElement]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,role:props.role??\"button\",tabIndex:props.tabIndex??0,onClick:handleClick,onKeyDown:handleKeyDown,\"aria-pressed\":isPressed,\"aria-label\":isPressed?\"Pause video\":\"Play video\",style:{...props.style}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"ToggleCardVideoAudio\":{\"type\":\"reactHoc\",\"name\":\"ToggleCardVideoAudio\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ToggleCardVideoAudio.map"],"mappings":"+SAC0C,IAAqF,IAA4B,EAAqC,EAAK,0BAAgC,EAAkB,EAAW,SAAS,EAAM,EAAI,CAAC,OAAoB,EAAK,MAAM,CAAC,GAAG,EAAU,MAAI,SAAS,EAAM,QAAQ,CAAC,CAAE,CAAC,EAAQ,EAAU,EAAO,OAAO,CAAI,EAAQ,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,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