{"version":3,"file":"VideoFacade.DMy8snO2.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","_e","init_jsx_runtime","c","p","addPropertyControls","ControlType","init_framer_D6uXRwWs","PlayGlyph","toVideoId","v","value","m","YT_ID_PATTERN","DarkFacade","props","thumb","setThumb","fallBack","playing","videoId","caption","PHOSPHOR_PLAY_FILL","VideoFacade","setPlaying","hasVideo","NAVY","CYAN","init_VideoFacade"],"sources":["https:/framerusercontent.com/modules/iiAeTtiO5FxPaEhSX8Dg/i57s6fAELUBLhr4lmRBR/VideoFacade.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const NAVY=\"#1B2E4B\";const CYAN=\"#0077A8\";function PlayGlyph(){return /*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 24 24\",width:26,height:26,fill:\"#FFFFFF\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M8 5v14l11-7z\"})});}// Accepts a bare video ID or any common YouTube URL form (watch?v=, youtu.be/, embed/, shorts/, live/).\nconst YT_ID_PATTERN=new RegExp(\"(?:youtu[.]be/|[?&]v=|/embed/|/shorts/|/live/)([A-Za-z0-9_-]{11})\");function toVideoId(value){const v=typeof value===\"string\"?value.trim():\"\";if(!v)return\"\";const m=v.match(YT_ID_PATTERN);if(m)return m[1];return v.includes(\"/\")?\"\":v;}// Dark theme (IM Dark pages): the YouTube frame (maxresdefault, falling back to hqdefault) under a\n// 40% IM BG overlay, an IM Border, and an 84px IM Primary play button with a white Phosphor \"Play\"\n// (Fill) glyph. No iframe loads until the click.\nconst PHOSPHOR_PLAY_FILL=\"M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z\";function DarkFacade(props){const{videoId,caption,playing}=props;const[thumb,setThumb]=useState(\"maxresdefault\");// YouTube returns a 120x90 placeholder (or a 404) when a maxres frame does not exist.\nconst fallBack=()=>setThumb(\"hqdefault\");return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",aspectRatio:\"16 / 9\",borderRadius:12,overflow:\"hidden\",background:\"var(--token-LfBJGjk8P, #12161D)\",border:\"1px solid var(--token-gzHpB3lTW, rgba(208, 212, 227, 0.14))\",boxSizing:\"border-box\"},children:playing&&videoId?/*#__PURE__*/_jsx(\"iframe\",{src:\"https://www.youtube-nocookie.com/embed/\"+videoId+\"?autoplay=1&rel=0\",title:caption||\"Video\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",border:\"none\"},allow:\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\",allowFullScreen:true}):/*#__PURE__*/_jsxs(\"button\",{type:\"button\",onClick:props.onPlay,disabled:!videoId,\"aria-label\":props.playLabel||(caption?\"Play video: \"+caption:\"Play video\"),style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",border:\"none\",padding:0,margin:0,background:\"transparent\",cursor:videoId?\"pointer\":\"default\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:[videoId?/*#__PURE__*/_jsx(\"img\",{src:\"https://i.ytimg.com/vi/\"+videoId+\"/\"+thumb+\".jpg\",alt:\"\",\"aria-hidden\":\"true\",decoding:\"async\",onError:thumb===\"maxresdefault\"?fallBack:undefined,onLoad:e=>{if(thumb===\"maxresdefault\"&&e.currentTarget.naturalWidth<=120)fallBack();},style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\"}}):null,/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",inset:0,background:\"rgba(10, 12, 16, 0.4)\"}}),/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",width:84,height:84,borderRadius:\"50%\",background:\"var(--token-a5I2qP_eM, #D32737)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#FFFFFF\"},children:/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 256 256\",width:32,height:32,\"aria-hidden\":\"true\",focusable:\"false\",style:{display:\"block\",marginLeft:4},children:/*#__PURE__*/_jsx(\"path\",{d:PHOSPHOR_PLAY_FILL,style:{fill:\"currentColor\"}})})}),caption&&props.showCaption!==false?/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":\"true\",style:{position:\"absolute\",left:20,bottom:16,right:20,textAlign:\"left\",fontFamily:\"Inter, Arial, sans-serif\",fontSize:14,lineHeight:1.4,color:\"var(--token-FqaQGrXfN, #E6EEF8)\",textShadow:\"0 1px 3px rgba(10, 12, 16, 0.9)\"},children:caption}):null]})});}/**\n * Video Facade\n *\n * Click-to-play video facade. Shows a thumbnail with a play button until\n * tapped, then swaps in a youtube-nocookie.com iframe so the page doesn't\n * pay YouTube's load cost until a visitor actually wants the video.\n * Renders a clearly-labeled placeholder when no video ID is set yet.\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 450\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function VideoFacade(props){const{caption}=props;const videoId=toVideoId(props.videoUrl)||toVideoId(props.videoId);const[playing,setPlaying]=useState(false);const hasVideo=Boolean(videoId&&videoId.trim().length>0);if(props.theme===\"dark\"){return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",...props.style},children:/*#__PURE__*/_jsx(DarkFacade,{videoId:hasVideo?videoId:\"\",caption:caption,playLabel:props.playLabel,showCaption:props.showCaption,playing:playing,onPlay:()=>setPlaying(true)})});}return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",...props.style},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",aspectRatio:\"16 / 9\",borderRadius:12,overflow:\"hidden\",background:NAVY},children:playing&&hasVideo?/*#__PURE__*/_jsx(\"iframe\",{src:`https://www.youtube-nocookie.com/embed/${videoId}?autoplay=1`,title:caption||\"Video\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",border:\"none\"},allow:\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\",allowFullScreen:true}):hasVideo?/*#__PURE__*/_jsx(\"button\",{onClick:()=>setPlaying(true),\"aria-label\":caption?`Play video: ${caption}`:\"Play video\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",border:\"none\",padding:0,cursor:\"pointer\",backgroundImage:`url(https://i.ytimg.com/vi/${videoId}/hqdefault.jpg)`,backgroundSize:\"cover\",backgroundPosition:\"center\"},children:/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",inset:0,background:\"rgba(27,46,75,0.35)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(\"span\",{style:{width:64,height:64,minWidth:64,borderRadius:\"50%\",background:CYAN,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:\"0 4px 16px rgba(0,0,0,0.3)\"},children:/*#__PURE__*/_jsx(PlayGlyph,{})})})}):/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",inset:0,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:10,border:\"1px dashed rgba(255,255,255,0.3)\",boxSizing:\"border-box\",padding:24},children:[/*#__PURE__*/_jsx(\"span\",{style:{width:56,height:56,borderRadius:\"50%\",background:\"rgba(255,255,255,0.12)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsx(PlayGlyph,{})}),/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:\"Inter, -apple-system, sans-serif\",fontSize:13,fontWeight:500,color:\"rgba(255,255,255,0.55)\",textAlign:\"center\"},children:\"Video pending — set the YouTube video ID in the component properties\"})]})})});}addPropertyControls(VideoFacade,{theme:{type:ControlType.Enum,title:\"Theme\",options:[\"light\",\"dark\"],optionTitles:[\"Light\",\"Dark\"],defaultValue:\"light\"},showCaption:{type:ControlType.Boolean,title:\"Show Caption\",defaultValue:true,hidden:p=>p.theme!==\"dark\"},playLabel:{type:ControlType.String,title:\"Play Label\",defaultValue:\"\",hidden:p=>p.theme!==\"dark\"},videoUrl:{type:ControlType.Link,title:\"YouTube URL\"},videoId:{type:ControlType.String,title:\"YouTube Video ID\",defaultValue:\"\",placeholder:\"e.g. dQw4w9WgXcQ\"},caption:{type:ControlType.String,title:\"Caption\",defaultValue:\"Watch an alert route, escalate, and land as a phone call.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VideoFacade\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"800\",\"framerIntrinsicHeight\":\"450\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VideoFacade.map"],"mappings":"A,iLAAmL,SAASU,GAAW,CAAC,MAAoB,gBAAK,MAAM,CAAC,QAAQ,YAAY,MAAM,GAAG,OAAO,GAAG,KAAK,UAAU,cAAc,OAAO,SAAsB,gBAAK,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAE,CACxQ,SAASC,EAAU,EAAM,CAAC,IAAMC,EAAE,OAAOC,GAAQ,SAASA,EAAM,KAAK,EAAE,GAAG,GAAG,CAACD,EAAE,MAAM,GAAG,IAAME,EAAEF,EAAE,MAAMG,CAAa,EAAmB,OAAdD,EAASA,EAAE,GAAUF,EAAE,SAAS,GAAG,EAAE,GAAGA,CAAE,CAG/C,SAASI,EAAW,EAAM,CAAC,GAAK,CAAC,UAAQ,UAAQ,WAASC,EAAW,CAACC,EAAMC,GAAUnB,EAAS,eAAe,EAClUoB,MAAaD,EAAS,WAAW,EAA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