{"version":3,"file":"LiteVideo.CQhQv3LE.mjs","names":["p","useState","useRef","_Fragment","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","l","_e","p","c","init_jsx_runtime","ce","de","init_framer_Cb9Z_4vX","addPropertyControls","useIsStaticRenderer","ControlType","videoId","s","input","u","v","m","sidewaysScroller","node","el","overflowX","LiteVideo","p$1","props","isStatic","playing","setPlaying","frameRef","boxRef","selfRef","id","box","root","observer","entry","entries","self","PLAY_EVENT","STATE_EVENT","onPlay","detail","event","name","src","FOCUS_CSS","init_LiteVideo"],"sources":["https:/framerusercontent.com/modules/jXLwzV4PKR4VbINGrxtX/DdCwKoxJqVdMmR1EXnqU/LiteVideo.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";// Accepts watch, youtu.be, shorts and embed URLs, or a bare id.\nfunction videoId(input){const s=(input||\"\").trim();if(!s)return\"\";if(/^[\\w-]{11}$/.test(s))return s;try{const u=new URL(s);if(u.hostname.includes(\"youtu.be\"))return u.pathname.slice(1).split(\"/\")[0];const v=u.searchParams.get(\"v\");if(v)return v;const m=u.pathname.match(/\\/(embed|shorts|v)\\/([\\w-]{11})/);if(m)return m[2];}catch{// fall through\n}return\"\";}// Keyboard focus ring for the play button, drawn on the disc because the box clips\n// anything outside the button. Colours are the site's Black and Ground tokens. The\n// transparent outline only shows in forced colours, where box-shadow is removed.\nconst FOCUS_CSS=`\n.jr-litevideo-play:focus-visible { outline: none; }\n.jr-litevideo-play:focus-visible .jr-litevideo-disc {\n    box-shadow: 0 0 0 3px var(--token-defa5673-66e2-43d3-8b9b-6e1dc311aa53, #000000),\n        0 0 0 7px var(--token-08c77452-4a69-47a4-92f3-43f109bc2c3c, #EFDBB2),\n        0 8px 24px rgba(0, 0, 0, 0.25) !important;\n    outline: 3px solid transparent;\n    outline-offset: 4px;\n}\n`;// Sent on window when a video starts; detail.id names the instance that started.\nconst PLAY_EVENT=\"jr-litevideo-play\";// Sent on window when a video starts and when it stops (back to its poster or gone):\n// detail.id names the instance, detail.playing is true or false.\nconst STATE_EVENT=\"jr-litevideo-state\";// The nearest ancestor that scrolls sideways (a carousel track), or null.\nfunction sidewaysScroller(el){let node=el.parentElement;while(node&&node!==document.body){const overflowX=getComputedStyle(node).overflowX;if(overflowX===\"auto\"||overflowX===\"scroll\")return node;node=node.parentElement;}return null;}export default function LiteVideo(props){const p={...LiteVideo.defaultProps,...props};const isStatic=useIsStaticRenderer();const[playing,setPlaying]=useState(false);const frameRef=useRef(null);const boxRef=useRef(null);const selfRef=useRef(\"\");if(!selfRef.current)selfRef.current=`lv-${Math.random().toString(36).slice(2,10)}`;const id=videoId(p.videoUrl);// Once the player exists, hand it focus so keyboard users land on it.\nuseEffect(()=>{if(playing&&frameRef.current)frameRef.current.focus();},[playing]);// A changed video resets to the poster.\nuseEffect(()=>{setPlaying(false);},[id]);// In a carousel, back to the poster once the slide is mostly out of view.\nuseEffect(()=>{if(!playing||typeof IntersectionObserver===\"undefined\")return;const box=boxRef.current;if(!box)return;const root=sidewaysScroller(box);if(!root)return;const observer=new IntersectionObserver(entries=>{for(const entry of entries){if(entry.intersectionRatio<.5)setPlaying(false);}},{root,threshold:[0,.5,1]});observer.observe(box);return()=>observer.disconnect();},[playing]);// One at a time: tell the others this one started, and go back to the poster\n// when another one starts. A link with no usable id plays nothing, so it sends\n// nothing. Start and stop are also announced for the carousel's autoplay.\nuseEffect(()=>{if(!playing||!id||typeof window===\"undefined\")return;const self=selfRef.current;window.dispatchEvent(new CustomEvent(PLAY_EVENT,{detail:{id:self}}));window.dispatchEvent(new CustomEvent(STATE_EVENT,{detail:{id:self,playing:true}}));const onPlay=event=>{const detail=event.detail;if(detail&&detail.id!==self)setPlaying(false);};window.addEventListener(PLAY_EVENT,onPlay);return()=>{window.removeEventListener(PLAY_EVENT,onPlay);window.dispatchEvent(new CustomEvent(STATE_EVENT,{detail:{id:self,playing:false}}));};},[playing]);const name=p.title||\"video\";const src=id?`https://www.youtube-nocookie.com/embed/${id}?autoplay=1&rel=0&modestbranding=1&playsinline=1`:\"\";return /*#__PURE__*/_jsxs(\"figure\",{style:{margin:0,width:\"100%\",display:\"flex\",flexDirection:\"column\",gap:16},children:[/*#__PURE__*/_jsx(\"style\",{children:FOCUS_CSS}),/*#__PURE__*/_jsx(\"div\",{ref:boxRef,style:{position:\"relative\",width:\"100%\",aspectRatio:\"16 / 9\",overflow:\"hidden\",borderRadius:p.radius,background:\"#000\"},children:playing&&!isStatic&&src?/*#__PURE__*/_jsx(\"iframe\",{ref:frameRef,title:name,src:src,allow:\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; fullscreen\",allowFullScreen:true,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",border:0}}):/*#__PURE__*/_jsxs(_Fragment,{children:[p.poster?// loading and decoding come before src: when React creates the\n// img in the browser (the homepage carousel's slides are drawn\n// there, not taken from the server markup) it sets attributes in\n// this order, and Chrome starts the fetch the moment src is set\n// unless it already reads lazy (Wave 2, 2026-09-30).\n/*#__PURE__*/_jsx(\"img\",{loading:p.loadEarly?\"eager\":\"lazy\",decoding:\"async\",src:p.poster,alt:\"\",draggable:false,style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\"}}):null,/*#__PURE__*/_jsx(\"button\",{type:\"button\",className:\"jr-litevideo-play\",\"aria-label\":`${p.playLabel} ${name}`.trim(),onClick:()=>setPlaying(true),style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",margin:0,padding:0,border:0,background:\"transparent\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",className:\"jr-litevideo-disc\",style:{width:84,height:84,borderRadius:999,background:p.buttonFill,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:\"0 8px 24px rgba(0,0,0,0.25)\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"30\",height:\"34\",viewBox:\"0 0 30 34\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M3 2 L28 17 L3 32 Z\",fill:p.buttonInk})})})})]})}),p.showText?/*#__PURE__*/_jsxs(\"figcaption\",{style:{display:\"flex\",flexDirection:\"column\",gap:6},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:p.titleFont,fontSize:p.titleSize,lineHeight:1.15,color:p.titleColor},children:p.title}),p.line?/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:p.lineFont,fontSize:p.lineSize,lineHeight:1.45,color:p.lineColor},children:p.line}):null]}):null]});}LiteVideo.defaultProps={videoUrl:\"\",poster:\"\",title:\"\",line:\"\",playLabel:\"Play\",buttonFill:\"#F2623B\",buttonInk:\"#000000\",titleColor:\"#EFDBB2\",lineColor:\"#EFDBB2\",titleFont:\"'Free Lunch Regular', 'Cooper Black', serif\",titleSize:32,lineFont:\"Lora, Georgia, serif\",lineSize:20,radius:0,showText:true,loadEarly:false};addPropertyControls(LiteVideo,{videoUrl:{type:ControlType.String,title:\"Video URL\",defaultValue:\"\",description:\"A YouTube watch or youtu.be link, or the video id.\"},poster:{type:ControlType.Image,title:\"Poster\",description:\"Upload the still to Framer; nothing loads from YouTube until play.\"},loadEarly:{type:ControlType.Boolean,title:\"Load Early\",defaultValue:false,description:\"On only for the first big image on a page. Off, the poster loads as it nears the screen.\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"\"},line:{type:ControlType.String,title:\"Line\",defaultValue:\"\",description:\"One factual line under the title.\"},showText:{type:ControlType.Boolean,title:\"Show Text\",defaultValue:true},playLabel:{type:ControlType.String,title:\"Play Label\",defaultValue:\"Play\",description:\"Read to screen readers before the title.\"},buttonFill:{type:ControlType.Color,title:\"Button Fill\",defaultValue:\"#F2623B\"},buttonInk:{type:ControlType.Color,title:\"Button Ink\",defaultValue:\"#000000\"},titleColor:{type:ControlType.Color,title:\"Title Color\",defaultValue:\"#EFDBB2\"},lineColor:{type:ControlType.Color,title:\"Line Color\",defaultValue:\"#EFDBB2\"},titleFont:{type:ControlType.String,title:\"Title Font\",defaultValue:\"'Free Lunch Regular', 'Cooper Black', serif\"},titleSize:{type:ControlType.Number,title:\"Title Size\",min:12,max:96,defaultValue:32,unit:\"px\"},lineFont:{type:ControlType.String,title:\"Line Font\",defaultValue:\"Lora, Georgia, serif\"},lineSize:{type:ControlType.Number,title:\"Line Size\",min:12,max:40,defaultValue:20,unit:\"px\"},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:40,defaultValue:0,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LiteVideo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LiteVideo.map"],"mappings":"A,4NACA,SAASmB,EAAQ,EAAM,CAAC,IAAMC,GAAGC,GAAO,GAAA,CAAI,KAAK,EAAE,GAAG,CAACD,EAAE,MAAM,GAAG,GAAG,cAAc,KAAKA,CAAC,EAAE,OAAOA,EAAE,GAAG,CAAC,IAAME,EAAE,IAAI,IAAIF,CAAC,EAAE,GAAGE,EAAE,SAAS,SAAS,UAAU,EAAE,OAAOA,EAAE,SAAS,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAMC,EAAED,EAAE,aAAa,IAAI,GAAG,EAAE,GAAGC,EAAE,OAAOA,EAAE,IAAMC,EAAEF,EAAE,SAAS,MAAM,iCAAiC,EAAE,GAAGE,EAAE,OAAOA,EAAE,EAAG,MAAM,CACxU,CAAC,MAAM,EAAG,CAgBV,SAASC,EAAiB,EAAG,CAAC,IAAIC,EAAKC,EAAG,cAAc,KAAMD,GAAMA,IAAO,SAAS,MAAK,CAAC,IAAME,EAAU,iBAAiBF,CAAI,CAAC,CAAC,UAAU,GAA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