import"./chunk-42U43NKG.mjs";import"./chunk-42U43NKG.mjs";import{a as A,b as Z,c as ke,g as _,h as Fe,i as De}from"./chunk-ANA65GPS.mjs";import{a as X}from"./chunk-PANIQEGT.mjs";import{a as O}from"./chunk-VZ62KGAD.mjs";import{a as Se,b as Me,c as Ce}from"./chunk-74WTN4O2.mjs";import{a as Ne,b as Te,c as Ie}from"./chunk-YLIYCQRZ.mjs";import{b as G,n as B}from"./chunk-24GRGD76.mjs";import"./chunk-42U43NKG.mjs";import{Ba as ve,Ca as T,Da as Y,F as u,I as H,K as J,N as he,P as ge,Q as s,Y as ue,Z as F,_ as D,aa as be,d as N,f as pe,ia as xe,ja as we,pa as ye,v as de,wa as c,xa as l}from"./chunk-YXURU7NW.mjs";import{A as fe,B as e,C as a,d as t,j as le,q as C,r as me,s as ce,v as V,w as R,x as W}from"./chunk-MJ2EDGOT.mjs";import"./chunk-HZL4YIMB.mjs";import{c as z}from"./chunk-A3IIQ6X3.mjs";var ee;(function(r){r.Normal="Off",r.Auto="On",r.Loop="Loop"})(ee||(ee={}));var re;(function(r){r.High="High Quality",r.Medium="Medium Quality",r.Low="Low Quality",r.Off="Off"})(re||(re={}));function I({url:r,play:n,shouldMute:m,thumbnail:o,isRed:f,onClick:p,onMouseEnter:d,onMouseLeave:g,onMouseDown:x,onMouseUp:w,title:S,...h}){let b=_(),i=n!=="Off",Q=b||o!=="Off"&&!i,[K,ae]=V(()=>!0,!1),[M,P]=V(()=>!0,!Q),[q,v]=W(!1),k=Fe(h),He=k!=="0px 0px 0px 0px"&&k!=="0px";if(r==="")return e(Ke,{});let ne=Ee(r);if(ne===void 0)return e(qe,{message:"Invalid Youtube URL."});let[ie,oe,se]=ne,y=oe.searchParams;if(se)for(let[_e,Be]of se)y.set(_e,Be);y.set("iv_load_policy","3"),y.set("rel","0"),y.set("modestbranding","1"),y.set("playsinline","1"),M?(i||Q&&M)&&y.set("autoplay","1"):y.set("autoplay","0"),i&&m&&y.set("mute","1"),n==="Loop"&&(y.set("loop","1"),y.set("playlist",ie)),f||y.set("color","white");let Ze={title:S||"Youtube Video",allow:"presentation; fullscreen; accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",src:oe.href,frameBorder:"0",onClick:p,onMouseEnter:d,onMouseLeave:g,onMouseDown:x,onMouseUp:w};return a("article",{onPointerEnter:()=>v(!0),onPointerLeave:()=>v(!1),onPointerOver:ae,onKeyDown:P,onClick:P,style:{...Ye,borderRadius:k,transform:He&&(M||b)?"translateZ(0.000001px)":"unset",cursor:"pointer",overflow:"hidden"},role:"presentation",children:[K&&e("link",{rel:"preconnect",href:"https://www.youtube.com"}),K&&e("link",{rel:"preconnect",href:"https://www.google.com"}),Q&&a(fe,{children:[e("link",{rel:"preconnect",href:"https://i.ytimg.com"}),e("img",{decoding:"async",src:je(ie,o),style:{...$,objectFit:"cover"}})]}),b?null:e("iframe",{loading:M?void 0:"lazy",style:M?$:{...$,display:"none"},...Ze}),M?null:e(Ve,{onClick:P,isHovered:q,isRed:f})]})}I.displayName="YouTube";H(I,{url:{type:u.String,title:"Video"},play:{type:u.Enum,title:"Autoplay",options:Object.values(ee)},shouldMute:{title:"Mute",type:u.Boolean,enabledTitle:"Yes",disabledTitle:"No",hidden(r){return r.play==="Off"}},thumbnail:{title:"Thumbnail",description:"Showing a thumbnail improves performance.",type:u.Enum,options:Object.values(re),hidden(r){return r.play!=="Off"}},isRed:{title:"Color",type:u.Boolean,enabledTitle:"Red",disabledTitle:"White"},...De,...ke});var Ue={url:"https://youtu.be/smPos0mJvh8",play:"Off",shouldMute:!0,thumbnail:"Medium Quality",isRed:!0};I.defaultProps=Ue;function Ee(r){let n;try{n=new URL(r)}catch{let o=U(r);return[r,o,null]}let m=n.searchParams;if(n.hostname==="youtube.com"||n.hostname==="www.youtube.com"||n.hostname==="youtube-nocookie.com"||n.hostname==="www.youtube-nocookie.com"){let o=n.pathname.slice(1).split("/"),f=o[0];if(f==="watch"){let p=n.searchParams.get("v"),d=U(p);return[p,d,m]}if(f==="embed")return[o[1],n,m];if(f==="shorts"||f==="live"){let p=o[1],d=U(p);return[p,d,m]}}if(n.hostname==="youtu.be"){let o=n.pathname.slice(1),f=U(o);return[o,f,m]}}function U(r){return new URL(`https://www.youtube.com/embed/${r}`)}function je(r,n){let m="https://i.ytimg.com/vi_webp/",o="webp";switch(n){case"Low Quality":return`${m}${r}/hqdefault.${o}`;case"Medium Quality":return`${m}${r}/sddefault.${o}`;case"High Quality":return`${m}${r}/maxresdefault.${o}`;default:return`${m}${r}/0.${o}`}}function Ke(){return e("div",{style:{...Z,overflow:"hidden"},children:e("div",{style:Re,children:"To embed a Youtube video, add the URL to the properties\xA0panel."})})}function qe({message:r}){return e("div",{className:"framerInternalUI-errorPlaceholder",style:{...A,overflow:"hidden"},children:a("div",{style:Re,children:["Error: ",r]})})}function Ve({onClick:r,isHovered:n,isRed:m}){return e("button",{onClick:r,"aria-label":"Play",style:Je,children:a("svg",{height:"100%",version:"1.1",viewBox:"0 0 68 48",width:"100%",children:[e("path",{d:"M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z",fill:n?m?"#f00":"#000":"#212121",fillOpacity:n&&m?1:.8,style:{transition:"fill .1s cubic-bezier(0.4, 0, 1, 1), fill-opacity .1s cubic-bezier(0.4, 0, 1, 1)"}}),e("path",{d:"M 45,24 27,14 27,34",fill:"#fff"})]})})}var Je={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:68,height:48,padding:0,border:"none",background:"transparent",cursor:"pointer"},Ye={position:"relative",width:"100%",height:"100%"},Re={textAlign:"center",minWidth:140},$={position:"absolute",top:0,left:0,height:"100%",width:"100%"};function L({type:r,url:n,html:m,zoom:o,radius:f,border:p,style:d={}}){return r==="url"&&n?e(Xe,{url:n,zoom:o,radius:f,border:p,style:d}):r==="html"&&m?e(er,{html:m,style:d}):e(Oe,{style:d})}H(L,{type:{type:u.Enum,defaultValue:"url",displaySegmentedControl:!0,options:["url","html"],optionTitles:["URL","HTML"]},url:{title:"URL",type:u.String,description:"Some websites don\u2019t support embedding.",hidden(r){return r.type!=="url"}},html:{title:"HTML",type:u.String,displayTextArea:!0,hidden(r){return r.type!=="html"}},border:{title:"Border",type:u.Border,optional:!0,hidden(r){return r.type!=="url"}},radius:{type:u.BorderRadius,title:"Radius",hidden(r){return r.type!=="url"}},zoom:{title:"Zoom",defaultValue:1,type:u.Number,hidden(r){return r.type!=="url"},min:.1,max:1,step:.1,displayStepper:!0}});function Oe({style:r}){return e("div",{style:{minHeight:Le(r),...Z,overflow:"hidden",...r},children:e("div",{style:te,children:"To embed a website or widget, add it to the properties\xA0panel."})})}function Xe({url:r,zoom:n,radius:m,border:o,style:f}){let p=!f.height;/[a-z]+:\/\//.test(r)||(r="https://"+r);let d=_(),[g,x]=W(d?void 0:!1);if(C(()=>{if(!d)return;let w=!0;x(void 0);async function S(){let h=await fetch("https://api.framer.com/functions/check-iframe-url?url="+encodeURIComponent(r));if(h.status==200){let{isBlocked:b}=await h.json();w&&x(b)}else{let b=await h.text();console.error(b);let i=new Error("This site can\u2019t be reached.");x(i)}}return S().catch(h=>{console.error(h),x(h)}),()=>{w=!1}},[r]),d&&p)return e(E,{message:"URL embeds do not support auto height.",style:f});if(!r.startsWith("https://"))return e(E,{message:"Unsupported protocol.",style:f});if(g===void 0)return e(nr,{});if(g instanceof Error)return e(E,{message:g.message,style:f});if(g===!0){let w=`Can\u2019t embed ${r} due to its content security policy.`;return e(E,{message:w,style:f})}return e("iframe",{src:r,style:{...We,...f,...o,zoom:n,borderRadius:m,transformOrigin:"top center"},loading:"lazy",fetchPriority:d?"low":"auto",referrerPolicy:"no-referrer",sandbox:$e(d)})}var We={width:"100%",height:"100%",border:"none"};function $e(r){let n=["allow-same-origin","allow-scripts"];return r||n.push("allow-downloads","allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-storage-access-by-user-activation","allow-top-navigation-by-user-activation"),n.join(" ")}function er({html:r,...n}){if(r.includes("<\/script>")){let o=r.includes(""),f=r.includes("");return o||f?e(tr,{html:r,...n}):e(rr,{html:r,...n})}return e(ar,{html:r,...n})}function rr({html:r,style:n}){let m=R(),[o,f]=W(0);C(()=>{let x=m.current?.contentWindow;function w(S){if(S.source!==x)return;let h=S.data;if(typeof h!="object"||h===null)return;let b=h.embedHeight;typeof b=="number"&&f(b)}return z.addEventListener("message",w),x?.postMessage("getEmbedHeight","*"),()=>{z.removeEventListener("message",w)}},[]);let p=`
${r}