{"version":3,"file":"ExpandableVideo.C0Wi1Imz.mjs","names":["React.useRef","React.useState"],"sources":["https:/framerusercontent.com/modules/PmfvpLOiovStJCAHPo2b/b7vel5mFFs9BS7uN5Gtc/ExpandableVideo.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ExpandableVideo({url=\"\",file=\"\",source=\"URL\",loop=true,muted=true,radius=8,style}){const src=source===\"Upload\"?file:url;const inline=React.useRef(null),enlarged=React.useRef(null),dialog=React.useRef(null),trigger=React.useRef(null);const wasPlaying=React.useRef(false);const[ratio,setRatio]=React.useState(16/9);React.useEffect(()=>{const video=inline.current;if(video&&!window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)video.play().catch(()=>{});},[src]);const motion=React.useRef(null);const closing=React.useRef(false);React.useEffect(()=>()=>{motion.current?.cancel();},[]);function reduced(){return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;}function origin(){const d=dialog.current,saved=d.style.transform;d.style.transform=\"none\";const a=inline.current.getBoundingClientRect(),b=d.getBoundingClientRect();d.style.transform=saved;return\"translate(\"+(a.left-b.left)+\"px,\"+(a.top-b.top)+\"px) scale(\"+a.width/b.width+\",\"+a.height/b.height+\")\";}function open(){const video=inline.current,large=enlarged.current,d=dialog.current;if(!video||!large||!d||d.open)return;closing.current=false;wasPlaying.current=!video.paused;video.pause();d.classList.remove(\"is-closing\");d.showModal();large.currentTime=video.currentTime;large.play().catch(()=>{});if(reduced())return;const start=origin();video.style.visibility=\"hidden\";d.style.transform=\"none\";motion.current=d.animate([{transform:start},{transform:\"translate(0px,0px) scale(1,1)\"}],{duration:420,easing:\"cubic-bezier(0.22,1,0.36,1)\"});}function close(){const d=dialog.current;if(!d?.open||closing.current)return;closing.current=true;if(reduced()){d.close();return;}const current=getComputedStyle(d).transform;motion.current?.cancel();const target=origin();d.classList.add(\"is-closing\");d.style.transform=\"none\";const animation=d.animate([{transform:current},{transform:target}],{duration:300,easing:\"cubic-bezier(0.4,0,0.2,1)\",fill:\"forwards\"});motion.current=animation;animation.finished.then(()=>{d.close();}).catch(()=>{});}function closed(){motion.current?.cancel();if(dialog.current)dialog.current.style.transform=\"none\";closing.current=false;const video=inline.current,large=enlarged.current;if(video&&large){video.style.visibility=\"\";video.currentTime=large.currentTime;large.pause();if(wasPlaying.current)video.play().catch(()=>{});}trigger.current?.focus();}// Lucide Maximize2 icon (ISC license, Lucide contributors).\nconst expand=/*#__PURE__*/_jsxs(\"svg\",{width:\"14\",height:\"14\",viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M15 3h6v6\"}),/*#__PURE__*/_jsx(\"path\",{d:\"m21 3-7 7\"}),/*#__PURE__*/_jsx(\"path\",{d:\"m3 21 7-7\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M9 21H3v-6\"})]});return /*#__PURE__*/_jsxs(\"div\",{className:\"expandable-video\",style:{...style,position:\"relative\",width:\"100%\",aspectRatio:ratio,borderRadius:radius,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"style\",{children:\"@media(hover:hover) and (pointer:fine){.expandable-video .expand-video-trigger{opacity:0;transition:opacity 150ms ease,transform 150ms ease}.expandable-video:hover .expand-video-trigger,.expandable-video:focus-within .expand-video-trigger{opacity:1}}@media(prefers-reduced-motion:reduce){.expandable-video .expand-video-trigger{transition:none}.expand-video-trigger:hover{transform:none}}\"}),/*#__PURE__*/_jsx(\"style\",{children:\".expand-video-dialog{border:0;padding:0;background:transparent;max-width:94vw;max-height:94vh;overflow:visible;transform-origin:top left}.expand-video-dialog::backdrop{background:color-mix(in srgb,var(--token-e16847f2-b192-48e1-a890-7bbcce11cc6e, #fff) 80%,transparent);animation:video-backdrop-in 420ms cubic-bezier(.22,1,.36,1) both}.expand-video-dialog.is-closing::backdrop{animation:video-backdrop-out 300ms ease both}@keyframes video-backdrop-in{from{opacity:0}to{opacity:1}}@keyframes video-backdrop-out{from{opacity:1}to{opacity:0}}@media(prefers-reduced-motion:reduce){.expand-video-dialog::backdrop,.expand-video-dialog.is-closing::backdrop{animation:none}}.expand-video-control{display:flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:#fff;color:#111;cursor:pointer;width:36px;height:36px}.expand-video-trigger:hover{transform:scale(1.08)}.expand-video-control:focus-visible{outline:2px solid white;outline-offset:3px}\"}),/*#__PURE__*/_jsx(\"video\",{ref:inline,src:src,muted:muted,loop:loop,playsInline:true,preload:\"metadata\",onLoadedMetadata:e=>{const v=e.currentTarget;if(v.videoWidth&&v.videoHeight)setRatio(v.videoWidth/v.videoHeight);},style:{display:\"block\",width:\"100%\",height:\"100%\",objectFit:\"contain\"}}),/*#__PURE__*/_jsx(\"button\",{ref:trigger,className:\"expand-video-control expand-video-trigger\",type:\"button\",\"aria-label\":\"Enlarge video\",onClick:open,style:{position:\"absolute\",right:12,bottom:12},children:expand}),/*#__PURE__*/_jsx(\"dialog\",{ref:dialog,className:\"expand-video-dialog\",\"aria-label\":\"Enlarged video\",style:{width:\"min(90vw, 1200px, calc(85vh * \"+ratio+\"))\",aspectRatio:ratio},onCancel:e=>{e.preventDefault();close();},onClose:closed,onClick:close,children:/*#__PURE__*/_jsx(\"video\",{ref:enlarged,src:src,muted:muted,loop:loop,playsInline:true,preload:\"metadata\",style:{display:\"block\",width:\"100%\",height:\"100%\",maxHeight:\"85vh\",objectFit:\"contain\",borderRadius:radius}})})]});}addPropertyControls(ExpandableVideo,{source:{type:ControlType.Enum,options:[\"URL\",\"Upload\"],defaultValue:\"URL\"},url:{type:ControlType.String,defaultValue:\"\",hidden:p=>p.source===\"Upload\"},file:{type:ControlType.File,allowedFileTypes:[\"mp4\",\"webm\"],hidden:p=>p.source!==\"Upload\"},loop:{type:ControlType.Boolean,defaultValue:true},muted:{type:ControlType.Boolean,defaultValue:true},radius:{type:ControlType.Number,defaultValue:8,min:0,max:40}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ExpandableVideo\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ExpandableVideo.map"],"mappings":"6MAGG,SAAwB,EAAgB,CAAC,MAAI,GAAG,OAAK,GAAG,SAAO,MAAM,OAAK,GAAK,QAAM,GAAK,SAAO,EAAE,SAAO,CAAC,IAAM,EAAI,IAAS,SAAS,EAAK,EAAU,EAAOA,EAAa,IAAI,EAAE,EAASA,EAAa,IAAI,EAAE,EAAOA,EAAa,IAAI,EAAE,EAAQA,EAAa,IAAI,EAAQ,EAAWA,EAAa,EAAK,EAAO,CAAC,EAAM,GAAUC,EAAe,GAAG,CAAC,EAAE,MAAoB,CAAC,IAAM,EAAM,EAAO,QAAW,GAAO,CAAC,EAAO,WAAW,kCAAkC,CAAC,CAAC,SAAQ,EAAM,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,CAAE,EAAE,CAAC,CAAG,CAAC,EAAE,IAAM,EAAOD,EAAa,IAAI,EAAQ,EAAQA,EAAa,EAAK,EAAE,UAAwB,CAAC,EAAO,SAAS,OAAO,CAAE,EAAE,CAAC,CAAC,EAAE,SAAS,GAAS,CAAC,OAAO,EAAO,WAAW,kCAAkC,CAAC,CAAC,OAAQ,CAAC,SAAS,GAAQ,CAAC,IAAM,EAAE,EAAO,QAAQ,EAAM,EAAE,MAAM,UAAU,EAAE,MAAM,UAAU,OAAO,IAAM,EAAE,EAAO,QAAQ,sBAAsB,EAAE,EAAE,EAAE,sBAAsB,EAA0B,MAAxB,GAAE,MAAM,UAAU,EAAY,cAAc,EAAE,KAA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