{"version":3,"file":"Reel.DC-ZCQFT.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/S3zP1AaIwyzsOlR8kVsj/pg582n9wBMa3IXHaZL4b/Reel.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";// A YouTube or Vimeo link in, the URL of its player out; anything else is a video file.\nfunction embedUrl(url){const yt=url.match(/(?:youtube\\.com\\/(?:watch\\?v=|embed\\/|shorts\\/)|youtu\\.be\\/)([\\w-]{11})/);if(yt)return`https://www.youtube-nocookie.com/embed/${yt[1]}?autoplay=1&rel=0&modestbranding=1`;const vm=url.match(/vimeo\\.com\\/(?:video\\/)?(\\d+)(?:\\/(\\w+))?/);if(vm)return`https://player.vimeo.com/video/${vm[1]}?autoplay=1&dnt=1${vm[2]?`&h=${vm[2]}`:\"\"}`;return undefined;}const CSS=`\n.os-reel { position: fixed; inset: 0; z-index: 2147483000; background: #000; color: #ede7dc; display: flex; flex-direction: column; animation: os-reel-in 0.5s cubic-bezier(0.16, 1, 0.3, 1); }\n@keyframes os-reel-in { from { opacity: 0; } }\n.os-reel-bar { height: 76px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 clamp(16px, 3.2px + 3.4vw, 48px); }\n.os-reel-bar p, .os-reel-bar button { font: 500 12px/1.4 \"Red Hat Mono\", ui-monospace, monospace; letter-spacing: 0.08em; text-transform: uppercase; color: #ede7dc; margin: 0; }\n.os-reel-bar button { background: none; border: 0; cursor: pointer; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0; transition: color 0.2s; }\n.os-reel-bar button:hover { color: #ff7438; }\n.os-reel-stage { position: relative; flex: 1; min-height: 0; }\n.os-reel-stage video, .os-reel-stage iframe { width: 100%; height: 100%; border: 0; object-fit: contain; display: block; background: #000; }\n.os-reel-foot { height: 76px; flex: none; }\n.os-reel-btn { display: inline-flex; align-items: center; justify-content: center; gap: 13.6px; min-height: 48px; padding: 0 20px; border: 0; cursor: pointer;\n  font: 500 13px/1 \"Red Hat Mono\", ui-monospace, monospace; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; transition: background-color 0.3s, color 0.3s, box-shadow 0.3s; }\n.os-reel-btn[data-kind=\"primary\"] { background: #ede7dc; color: #0a0b0b; }\n.os-reel-btn[data-kind=\"primary\"]:hover { background: #ff7438; color: #0a0b0b; }\n.os-reel-btn[data-kind=\"ghost\"] { background: transparent; color: #ede7dc; box-shadow: inset 0 0 0 1px rgba(237, 231, 220, 0.26); }\n.os-reel-btn[data-kind=\"ghost\"]:hover { box-shadow: inset 0 0 0 1px #ede7dc; }\n`;function Player({open,onClose}){const closeRef=useRef(null);useEffect(()=>{if(!open)return;const html=document.documentElement;const prev=html.style.overflow;html.style.overflow=\"hidden\";closeRef.current?.focus();const key=e=>e.key===\"Escape\"&&onClose();document.addEventListener(\"keydown\",key);return()=>{html.style.overflow=prev;document.removeEventListener(\"keydown\",key);open.from?.focus?.({preventScroll:true});};},[open]);if(!open)return null;const embed=embedUrl(open.src);return /*#__PURE__*/createPortal(/*#__PURE__*/_jsxs(\"div\",{className:\"os-reel\",role:\"dialog\",\"aria-modal\":\"true\",\"aria-label\":open.title,children:[/*#__PURE__*/_jsxs(\"div\",{className:\"os-reel-bar\",children:[/*#__PURE__*/_jsx(\"p\",{children:open.title}),/*#__PURE__*/_jsxs(\"button\",{ref:closeRef,type:\"button\",onClick:onClose,children:[\"Close\",/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.75\",strokeLinecap:\"round\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M18 6 6 18M6 6l12 12\"})})]})]}),/*#__PURE__*/_jsx(\"div\",{className:\"os-reel-stage\",children:embed?/*#__PURE__*/_jsx(\"iframe\",{src:embed,title:open.title,allow:\"autoplay; fullscreen; picture-in-picture\",allowFullScreen:true}):/*#__PURE__*/_jsx(\"video\",{src:open.src,controls:true,playsInline:true,autoPlay:true})}),/*#__PURE__*/_jsx(\"div\",{className:\"os-reel-foot\"})]}),document.body);}/**\n * The full-screen player. As a Listener (1px, in the layout template) it plays its film when any layer\n * named \"Play Reel\" is clicked. As a Button it shows a play button for its own film, and nothing\n * when the film is empty.\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Reel(props){const{mode=\"listener\",src=\"\",file,title=\"Showreel\",label=\"Watch the film\",kind=\"primary\",style}=props;const film=file||src;const[open,setOpen]=useState(null);const canvas=RenderTarget.current()===RenderTarget.canvas;useEffect(()=>{if(mode!==\"listener\"||canvas)return;const click=e=>{const t=e.target.closest('[data-framer-name=\"Play Reel\"]');if(!t||!film)return;e.preventDefault();e.stopPropagation();document.dispatchEvent(new CustomEvent(\"reel:open\"));setOpen({src:film,title,from:t});};document.addEventListener(\"click\",click,true);return()=>document.removeEventListener(\"click\",click,true);},[mode,film,title]);const close=()=>{setOpen(null);document.dispatchEvent(new CustomEvent(\"reel:close\"));};if(mode===\"listener\")return /*#__PURE__*/_jsxs(\"div\",{style:{...style,width:1,height:1},children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:CSS}}),!canvas&&/*#__PURE__*/_jsx(Player,{open:open,onClose:close})]});if(!film&&!canvas)return null;return /*#__PURE__*/_jsxs(\"div\",{style:style,children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:CSS}}),/*#__PURE__*/_jsxs(\"button\",{type:\"button\",className:\"os-reel-btn\",\"data-kind\":kind,onClick:e=>setOpen({src:film,title,from:e.currentTarget}),children:[/*#__PURE__*/_jsx(\"svg\",{width:\"16\",height:\"16\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.6\",strokeLinejoin:\"round\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M7 4.5v15l12-7.5-12-7.5Z\"})}),label]}),!canvas&&/*#__PURE__*/_jsx(Player,{open:open,onClose:close})]});}addPropertyControls(Reel,{mode:{type:ControlType.Enum,title:\"Mode\",options:[\"listener\",\"button\"],optionTitles:[\"Listener\",\"Button\"],defaultValue:\"listener\"},file:{type:ControlType.File,title:\"File\",allowedFileTypes:[\"mp4\",\"webm\",\"mov\"]},src:{type:ControlType.Link,title:\"Link\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Showreel\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Watch the film\",hidden:p=>p.mode!==\"button\"},kind:{type:ControlType.Enum,title:\"Style\",options:[\"primary\",\"ghost\"],optionTitles:[\"Primary\",\"Ghost\"],defaultValue:\"primary\",hidden:p=>p.mode!==\"button\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Reel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Reel.map"],"mappings":"oNACA,SAAS,EAAS,EAAI,CAAC,IAAM,EAAG,EAAI,MAAM,yEAAyE,EAAE,GAAG,EAAG,MAAM,0CAA0C,EAAG,GAAG,oCAAoC,IAAM,EAAG,EAAI,MAAM,2CAA2C,EAAE,GAAG,EAAG,MAAM,kCAAkC,EAAG,GAAG,mBAAmB,EAAG,GAAG,MAAM,EAAG,KAAK,IAAsB,CAgBpY,SAAS,EAAO,CAAC,OAAK,WAAS,CAAC,IAAM,EAASA,EAAO,IAAI,EAAkX,GAAhX,MAAc,CAAC,GAAG,CAAC,EAAK,OAAO,IAAM,EAAK,SAAS,gBAAsB,EAAK,EAAK,MAAM,SAAS,EAAK,MAAM,SAAS,SAAS,EAAS,SAAS,MAAM,EAAE,IAAM,EAAI,GAAG,EAAE,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