{"version":3,"file":"WistiaNoPlayFormOverlay.P4cXO2mt.mjs","names":["p","useState","useMemo","useRef"],"sources":["https:/framerusercontent.com/modules/wjyMzguEPQrpxIeESHMP/geGi10YIWaEVk3mutunC/WistiaNoPlayFormOverlay.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useMemo,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/* helper — map Framer BoxShadow (single), Shadows (array), or string to CSS box-shadow */function shadowsToBoxShadow(input){if(!input)return undefined;if(typeof input===\"string\")return input;const toCss=s=>{if(!s)return\"\";const x=s.x??0;const y=s.y??0;const blur=s.blur??0;const spread=s.spread??0;const color=s.color??\"rgba(0,0,0,0.2)\";const inset=s.inset?\" inset\":\"\";return`${x}px ${y}px ${blur}px ${spread}px ${color}${inset}`;};if(Array.isArray(input))return input.map(toCss).filter(Boolean).join(\", \");if(typeof input===\"object\")return toCss(input);return undefined;}/* ▼ helper — equilateral triangle with outward rounded corners (quadratic curves) */function buildRoundedTriangle(rUnits){const MAX_R=25;const r=Math.max(0,Math.min(MAX_R,rUnits));const size=35// triangle side length in SVG units\n;const triangleWidth=size*1.5// width of an equilateral triangle that points right\n;const leftOffset=(100-triangleWidth)/1.5;const A=[leftOffset,50-size*.866]// top-left\n;const B=[leftOffset+triangleWidth,50]// tip (right)\n;const C=[leftOffset,50+size*.866]// bottom-left\n;const move=(p,q,d)=>{const vx=q[0]-p[0];const vy=q[1]-p[1];const len=Math.hypot(vx,vy);return[p[0]+vx*d/len,p[1]+vy*d/len];};const A1=move(A,B,r);const A2=move(A,C,r);const B1=move(B,C,r);const B2=move(B,A,r);const C1=move(C,A,r);const C2=move(C,B,r);const fmt=pt=>pt.map(v=>v.toFixed(2)).join(\",\");return`M ${fmt(A1)} Q ${fmt(A)} ${fmt(A2)} L ${fmt(C1)} Q ${fmt(C)} ${fmt(C2)} L ${fmt(B1)} Q ${fmt(B)} ${fmt(B2)} Z`;}/** Ensure Aurora player.js is present (Wistia’s current web component) */function ensureWistiaPlayerScript(){return new Promise(resolve=>{// already loaded?\nif(typeof window!==\"undefined\"&&window.Wistia&&customElements.get(\"wistia-player\")){resolve();return;}// if player.js tag exists, wait for custom element\nconst existing=document.querySelector('script[src*=\"fast.wistia.com/player.js\"]');const ready=()=>{if(customElements.get(\"wistia-player\"))resolve();};if(existing){if(existing.dataset._wistia_ready){ready();}else{existing.addEventListener(\"load\",ready,{once:true});existing.dataset._wistia_ready=\"1\";}return;}// inject\nconst s=document.createElement(\"script\");s.src=\"https://fast.wistia.com/player.js\";s.async=true;s.addEventListener(\"load\",ready,{once:true});document.head.appendChild(s);});}/** Parse 10-char media ID or accept full URL */function parseMedia(urlOrId){const m=urlOrId?.match?.(/([a-z0-9]{10})/i);const id=m?m[1]:\"\";const url=urlOrId?.startsWith(\"http\")?urlOrId:id?`https://home.wistia.com/medias/${id}`:\"\";return{id,url};}export default function WistiaLeadCapture({urlOrId=\"\",layout=\"auto\",sizeMode=\"cover\",loop=true,playerRounded=8,// Overlay button\nplayBtnSize=80,playBtnBg=\"#ffffffd9\",playBtnRadius=8,playBtnBorder=0,playBtnBorderColor=\"#000000\",playBtnShadows=undefined,playIconColor=\"#000000\",iconCornerRadius=4,iconScale=45,onTap=()=>{}}){const[aspectW,setAspectW]=useState(16);const[aspectH,setAspectH]=useState(9);const[ready,setReady]=useState(false);const{id:mediaId,url:mediaUrl}=useMemo(()=>parseMedia(urlOrId),[urlOrId]);const hostRef=useRef(null);const playerRef=useRef(null)// keep a handle to the <wistia-player>\n;// 1) Load Aurora player.js once\nuseEffect(()=>{let mounted=true;ensureWistiaPlayerScript().then(()=>mounted&&setReady(true));return()=>{mounted=false;};},[]);// 2) Use oEmbed for aspect ratio (supported, stable)\nuseEffect(()=>{if(!mediaUrl)return;const oembed=`https://fast.wistia.com/oembed?url=${encodeURIComponent(mediaUrl)}`;fetch(oembed).then(r=>r.json()).then(d=>{if(d?.width&&d?.height){setAspectW(d.width);setAspectH(d.height);}}).catch(()=>{});},[mediaUrl]);// 3) Render the <wistia-player> when ready\nuseEffect(()=>{if(!ready||!hostRef.current||!mediaId)return;// Clear any previous mount\nhostRef.current.innerHTML=\"\";// Create the web component\nconst el=document.createElement(\"wistia-player\");el.setAttribute(\"media-id\",mediaId);el.setAttribute(\"autoplay\",\"false\");el.setAttribute(\"silent-autoplay\",\"false\");// Hide every interactive control\nel.setAttribute(\"big-play-button\",\"false\");el.setAttribute(\"controls-visible-on-load\",\"false\");el.setAttribute(\"play-bar-control\",\"false\");el.setAttribute(\"play-pause-control\",\"false\");el.setAttribute(\"settings-control\",\"false\");el.setAttribute(\"volume-control\",\"false\");el.setAttribute(\"fullscreen-control\",\"false\");el.setAttribute(\"preload\",\"metadata\");// Visuals\nif(playerRounded)el.setAttribute(\"rounded-player\",String(playerRounded));// Mount\nhostRef.current.appendChild(el);el.autoplay=false;el.silentAutoplay=false;playerRef.current=el;},[ready,mediaId,loop,playerRounded]);// Layout styles\nconst rootBase={position:\"relative\",overflow:\"hidden\",borderRadius:playerRounded,background:\"#f3f3f3\"};const rootStyle=layout===\"fill\"?{...rootBase,width:\"100%\",height:\"100%\"}:{...rootBase,width:\"100%\",aspectRatio:`${Math.max(1,Math.round(aspectW))} / ${Math.max(1,Math.round(aspectH))}`};const playerWrap=layout===\"fill\"?{position:\"absolute\",inset:0}:{position:\"relative\",width:\"100%\",height:\"100%\"};// IMPORTANT: block user interaction with the player entirely\nconst playerSurface={position:\"absolute\",inset:0,pointerEvents:\"auto\",width:\"100%\",height:\"100%\",objectFit:sizeMode===\"contain\"?\"contain\":\"cover\",zIndex:1,background:\"transparent\",touchAction:\"none\"};// Custom play button (centered)\nconst renderedIconPx=playBtnSize*Math.max(10,Math.min(90,iconScale))/100;const rUnits=iconCornerRadius/Math.max(1,renderedIconPx)*100// px → SVG units\n;const iconPath=buildRoundedTriangle(rUnits);return /*#__PURE__*/_jsxs(\"div\",{style:rootStyle,children:[/*#__PURE__*/_jsx(\"div\",{ref:hostRef,style:playerWrap}),\"+\",\" \",/*#__PURE__*/_jsx(\"div\",{style:playerSurface,onPointerDown:e=>{e.preventDefault();e.stopPropagation();},onClick:e=>{e.preventDefault();e.stopPropagation();// belt & suspenders: if the player did start, pause it\ntry{playerRef.current?.pause?.();}catch{}onTap();}}),/*#__PURE__*/_jsx(\"button\",{onClick:onTap,style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",width:playBtnSize,height:playBtnSize,background:playBtnBg,borderRadius:playBtnRadius,border:`${playBtnBorder}px solid ${playBtnBorderColor}`,boxShadow:shadowsToBoxShadow(playBtnShadows),display:\"grid\",placeItems:\"center\",cursor:\"pointer\",zIndex:2,padding:0},children:/*#__PURE__*/_jsx(\"svg\",{width:renderedIconPx,height:renderedIconPx,viewBox:\"0 0 100 100\",\"aria-hidden\":\"true\",fill:playIconColor,children:/*#__PURE__*/_jsx(\"path\",{d:iconPath})})})]});}/* ─── Inspector controls ───────────────────────────────────────────────────── */addPropertyControls(WistiaLeadCapture,{urlOrId:{type:ControlType.String,title:\"Wistia URL / ID\",placeholder:\"https://... or 10-char ID\"},layout:{type:ControlType.Enum,title:\"Layout\",options:[\"auto\",\"fill\"],optionTitles:[\"Auto (intrinsic)\",\"Fill parent\"],defaultValue:\"auto\"},sizeMode:{type:ControlType.Enum,title:\"Sizing\",options:[\"cover\",\"contain\"],optionTitles:[\"Cover\",\"Contain\"],defaultValue:\"cover\"},loop:{type:ControlType.Boolean,title:\"Loop preview\",defaultValue:true},playerRounded:{type:ControlType.Number,title:\"Player radius\",defaultValue:8,min:0,max:24,unit:\"px\"},playBtnSize:{type:ControlType.Number,title:\"Button size\",defaultValue:80,min:32,unit:\"px\"},playBtnRadius:{type:ControlType.Number,title:\"Button radius\",defaultValue:8,min:0,unit:\"px\"},playBtnBg:{type:ControlType.Color,title:\"Button BG\",defaultValue:\"#ffffffd9\"},playBtnBorder:{type:ControlType.Number,title:\"Border width\",defaultValue:0,min:0,unit:\"px\"},playBtnBorderColor:{type:ControlType.Color,title:\"Border colour\",defaultValue:\"#000000\"},playBtnShadows:{type:ControlType.BoxShadow,title:\"Button shadow\",defaultValue:[{x:0,y:8,blur:24,spread:0,color:\"rgba(0,0,0,0.18)\"}]},playIconColor:{type:ControlType.Color,title:\"Icon colour\",defaultValue:\"#000000\"},iconScale:{type:ControlType.Number,title:\"Triangle size %\",defaultValue:45,min:10,max:90,unit:\"%\"},iconCornerRadius:{type:ControlType.Number,title:\"Triangle radius\",defaultValue:4,min:0,max:30,unit:\"px\"},onTap:{type:ControlType.EventHandler,title:\"On tap\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WistiaLeadCapture\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WistiaNoPlayFormOverlay.map"],"mappings":"yUAA4P,SAAS,EAAmB,EAAM,CAAC,GAAG,CAAC,EAAM,OAAiB,GAAG,OAAO,GAAQ,SAAS,OAAO,EAAM,IAAM,EAAM,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAM,EAAE,EAAE,GAAG,EAAQ,EAAE,EAAE,GAAG,EAAQ,EAAK,EAAE,MAAM,EAAQ,EAAO,EAAE,QAAQ,EAAQ,EAAM,EAAE,OAAO,kBAAwB,EAAM,EAAE,MAAM,SAAS,GAAG,MAAM,GAAG,EAAE,KAAK,EAAE,KAAK,EAAK,KAAK,EAAO,KAAK,IAAQ,KAAU,GAAG,MAAM,QAAQ,EAAM,CAAC,OAAO,EAAM,IAAI,EAAM,CAAC,OAAO,QAAQ,CAAC,KAAK,KAAK,CAAC,GAAG,OAAO,GAAQ,SAAS,OAAO,EAAM,EAAM,CAAwG,SAAS,EAAqB,EAAO,CAAgB,IAAM,EAAE,KAAK,IAAI,EAAE,KAAK,IAA3B,GAAqC,EAAO,CAAC,CAC54B,EAAc,GAAK,IACn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