{"version":3,"file":"StreamVideo.BSeJ92RO.mjs","names":["useState","useMemo","useCallback","__esmMin","init_npm_react_18_3_1","te","pe","init_jsx_runtime","ne","c","p","_e","init_framer_BisrWwwE","addPropertyControls","ControlType","init_VideoBits","VB_CSS","PlayPill","HoverPreview","imageSrc","value","StreamVideo","props","playing","setPlaying","hover","setHover","customPoster","poster","id","videoId","urls","base","customerCode","streamPoster","posterTime","posterUrl","play","sizing","shape","box","radius","style","title","GLOW","emptyLabel","init_StreamVideo"],"sources":["https:/framerusercontent.com/modules/Y7tWksaQ44X3FCyUxOAZ/8E1Zeee9ynf5Fro5i7w8/StreamVideo.js"],"sourcesContent":["// Arthur's request: event videos on the /events page that people click, watch, then click the next one.\n// Click-to-play Cloudflare Stream video: shows the poster with a play button (never autoplays),\n// and swaps in the Stream player with sound when clicked. Leave Video ID empty to show a \"coming soon\" frame,\n// which sits on Arthur's own glow image (17 Oct 2026: no drawn gradients).\n// \"Shape\" keeps the frame at 16:9 or 9:16 at any width (set the layer height to Fit), or fills a fixed height.\n// 23 Oct 2026: the purple play circle is now the small corner pill from VideoBits (play triangle and\n// length), and hovering plays a muted preview. Also used for the contact page video.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useMemo,useCallback,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{PlayPill,HoverPreview,VB_CSS}from\"https://framerusercontent.com/modules/us8fHL1CzcsbLHpTfdex/NJE3HHX5caLvDa3mtJEa/VideoBits.js\";const GLOW=\"https://framerusercontent.com/images/1JkuAgGJiPw8nU2mMUyhskcg.jpg\";function imageSrc(value){if(!value)return\"\";if(typeof value===\"string\")return value;return value.src||\"\";}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function StreamVideo(props){const{videoId,title,shape,customerCode,posterTime,poster,radius,emptyLabel,style}=props;const[playing,setPlaying]=useState(false);const[hover,setHover]=useState(false);const customPoster=imageSrc(poster);const id=(videoId||\"\").trim();const urls=useMemo(()=>{if(!id)return null;const base=`https://customer-${customerCode}.cloudflarestream.com/${id}`;const streamPoster=`${base}/thumbnails/thumbnail.jpg?time=${posterTime}s&height=1080`;const posterUrl=customPoster||streamPoster;const player=`${base}/iframe?autoplay=true&preload=auto&primaryColor=%237949fc&poster=${encodeURIComponent(posterUrl)}`;return{poster:posterUrl,player};},[id,customerCode,posterTime,customPoster]);const play=useCallback(()=>{startTransition(()=>setPlaying(true));},[]);const sizing=shape===\"16:9\"?{width:\"100%\",height:\"auto\",aspectRatio:\"16 / 9\"}:shape===\"9:16\"?{width:\"100%\",height:\"auto\",aspectRatio:\"9 / 16\"}:{width:\"100%\",height:\"100%\"};const box={position:\"relative\",overflow:\"hidden\",borderRadius:radius,background:\"#0c0b10\",...style,...sizing};if(!urls){return /*#__PURE__*/_jsxs(\"div\",{style:{...box,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:16,background:`url(${GLOW}) center bottom / cover no-repeat, #0c0b10`},children:[customPoster?/*#__PURE__*/_jsx(\"img\",{src:customPoster,alt:\"\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\"}}):null,/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{position:\"relative\",width:58,height:58,borderRadius:\"50%\",border:\"1.5px solid rgba(255,255,255,0.35)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"svg\",{width:\"18\",height:\"20\",viewBox:\"0 0 20 22\",style:{marginLeft:4},children:/*#__PURE__*/_jsx(\"path\",{d:\"M2 2l16 9-16 9z\",fill:\"rgba(255,255,255,0.6)\"})})}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",color:\"rgba(255,255,255,0.72)\",fontFamily:\"Figtree, sans-serif\",fontSize:15,textAlign:\"center\",padding:\"0 16px\"},children:emptyLabel})]});}return /*#__PURE__*/_jsxs(\"div\",{style:box,children:[/*#__PURE__*/_jsx(\"style\",{children:VB_CSS}),playing?/*#__PURE__*/_jsx(\"iframe\",{src:urls.player,title:title||\"Video\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",border:0},allow:\"accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture; fullscreen\",allowFullScreen:true}):/*#__PURE__*/_jsxs(\"button\",{type:\"button\",className:\"vb-host\",\"aria-label\":title?`Play: ${title}`:\"Play video\",onClick:play,onMouseEnter:()=>setHover(true),onMouseLeave:()=>setHover(false),onFocus:()=>setHover(true),onBlur:()=>setHover(false),style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",padding:0,border:0,cursor:\"pointer\",background:\"transparent\"},children:[/*#__PURE__*/_jsx(\"img\",{src:urls.poster,alt:\"\",loading:\"lazy\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",transform:hover?\"scale(1.03)\":\"scale(1)\",transition:\"transform 0.5s ease\"}}),/*#__PURE__*/_jsx(HoverPreview,{id:id,start:posterTime||0}),/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:0,zIndex:2,background:\"linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.28) 100%)\"}}),/*#__PURE__*/_jsx(PlayPill,{id:id})]})]});}StreamVideo.defaultProps={videoId:\"\",title:\"\",shape:\"fill\",customerCode:\"but5jhvwjvglsn3q\",posterTime:8,radius:14,emptyLabel:\"Film coming soon\"};addPropertyControls(StreamVideo,{videoId:{type:ControlType.String,title:\"Video ID\",defaultValue:\"\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"\"},shape:{type:ControlType.Enum,title:\"Shape\",options:[\"16:9\",\"9:16\",\"fill\"],optionTitles:[\"16:9\",\"9:16\",\"Fill frame\"],defaultValue:\"fill\"},posterTime:{type:ControlType.Number,title:\"Poster (s)\",defaultValue:8,min:0,step:1,displayStepper:true},poster:{type:ControlType.ResponsiveImage,title:\"Poster image\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:14,min:0,max:40},emptyLabel:{type:ControlType.String,title:\"Empty text\",defaultValue:\"Film coming soon\"},customerCode:{type:ControlType.String,title:\"Stream code\",defaultValue:\"but5jhvwjvglsn3q\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StreamVideo\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"A,wQAOmY,SAASmB,EAAS,EAAM,CAA4D,OAAvDC,EAAkB,OAAOA,GAAQ,SAAgBA,EAAaA,EAAM,KAAK,GAA7D,EAAgE,CAGze,SAAwBC,EAAY,EAAM,CAAC,GAAK,CAAC,UAAQ,QAAM,QAAM,eAAa,aAAW,SAAO,SAAO,aAAW,SAAOC,EAAW,CAACC,EAAQC,GAAYxB,EAAS,EAAK,EAAO,CAACyB,EAAMC,GAAU1B,EAAS,EAAK,EAAQ2B,EAAaR,EAASS,CAAM,EAAQC,GAAIC,GAAS,GAAA,CAAI,KAAK,EAAQC,EAAK9B,MAAY,CAAC,GAAG,CAAC4B,EAAG,OAAO,KAAK,IAAMG,EAAK,oBAAoBC,EAAa,wBAAwBJ,IAAWK,EAAa,GAAGF,EAAK,iCAAiCG,EAAW,eAAqBC,EAAUT,GAAcO,EAAqI,MAAM,CAAC,OAAOE,EAAU,OAAA,GAAhIJ,EAAK,mEAAmE,mBAAmBI,CAAS,GAAkC,CAAE,EAAE,CAACP,EAAGI,EAAaE,EAAWR,CAAY,CAAC,EAAQU,EAAKnC,MAAgB,CAACG,MAAoBmB,EAAW,EAAI,CAAC,CAAE,EAAE,CAAC,CAAC,EAAQc,EAAOC,IAAQ,OAAO,CAAC,MAAM,OAAO,OAAO,OAAO,YAAY,QAAQ,EAAEA,IAAQ,OAAO,CAAC,MAAM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