{"version":3,"file":"CaseEmbed.DHkML1ms.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/CVtlfsHV6zC4nJnOWQg3/95GMy4a5tapHFnTaj7m9/CaseEmbed.js"],"sourcesContent":["// Case study embed: a YouTube or Vimeo player filling its frame, for the 3D motion\n// case studies migrated from the old Cargo site. Paste a normal YouTube or Vimeo\n// link into Video Link; it is converted to the provider's embed URL.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";function toEmbedUrl(url){if(!url)return\"\";const youtube=url.match(/(?:youtu\\.be\\/|youtube\\.com\\/(?:watch\\?v=|embed\\/|shorts\\/))([\\w-]{11})/);if(youtube)return`https://www.youtube.com/embed/${youtube[1]}?rel=0&modestbranding=1&playsinline=1`;const vimeo=url.match(/vimeo\\.com\\/(?:video\\/)?(\\d+)/);if(vimeo)return`https://player.vimeo.com/video/${vimeo[1]}?title=0&byline=0&portrait=0`;return url;}/**\n * @framerIntrinsicWidth 960\n * @framerIntrinsicHeight 540\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function CaseEmbed(props){const{url,title,style}=props;const src=useMemo(()=>toEmbedUrl(url),[url]);return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:src?/*#__PURE__*/_jsx(\"iframe\",{src:src,title:title||\"Video\",allow:\"autoplay; fullscreen; picture-in-picture; encrypted-media\",allowFullScreen:true,loading:\"lazy\",style:{position:\"absolute\",inset:0,width:\"100%\",height:\"100%\",border:0}}):null});}addPropertyControls(CaseEmbed,{url:{type:ControlType.String,title:\"Video Link\",defaultValue:\"\"},title:{type:ControlType.String,title:\"Title\",defaultValue:\"Video\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CaseEmbed\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicWidth\":\"960\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"540\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CaseEmbed.map"],"mappings":"0KAG0H,SAAS,EAAW,EAAI,CAAC,GAAG,CAAC,EAAI,MAAM,GAAG,IAAM,EAAQ,EAAI,MAAM,yEAAyE,EAAE,GAAG,EAAQ,MAAM,iCAAiC,EAAQ,GAAG,uCAAuC,IAAM,EAAM,EAAI,MAAM,+BAA+B,EAA0F,OAArF,EAAY,kCAAkC,EAAM,GAAG,8BAAqC,CAAI,CAMlgB,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,MAAI,QAAM,SAAO,EAAY,EAAIA,MAAY,EAAW,CAAG,EAAE,CAAC,CAAG,CAAC,EAAE,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,SAAS,QAAQ,EAAE,SAAS,EAAiB,EAAK,SAAS,CAAK,MAAI,MAAM,GAAO,QAAQ,MAAM,4DAA4D,gBAAgB,GAAK,QAAQ,OAAO,MAAM,CAAC,SAAS,WAAW,MAAM,EAAE,MAAM,OAAO,OAAO,OAAO,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAE,iBAN3b,IAA2B,IAAoD,EAM6W,EAAoB,EAAU,CAAC,IAAI,CAAC,KAAK,EAAY,OAAO,MAAM,aAAa,aAAa,EAAE,EAAE,MAAM,CAAC,KAAK,EAAY,OAAO,MAAM,QAAQ,aAAa,OAAO,CAAC,CAAC"}