import{d8 as L,cA as O,bu as z,a9 as s,v as W,cz as j,U as H,_ as q,M as F}from"./Bj-lS1rC.js";import{d as D,c as G,o as c,y as d,g as x,A as i}from"./Bqy-xoU4.js";import{_ as Q}from"./C9A-nse7.js";import{_ as V}from"./LXdA0GGF.js";const _=e=>e.charAt(0)==="#"?e.slice(1):e,X=e=>(e!=null&&e.primaryColor&&(e.primaryColor=_(e.primaryColor)),e!=null&&e.textColor&&(e.textColor=_(e.textColor)),e!=null&&e.backgroundColor&&(e.backgroundColor=_(e.backgroundColor)),e),K=e=>L(e,"YYYY-MM-DD").value,J=/^a\d{1,2}$/,Z=e=>{const a=Object.keys(e).filter(n=>n.match(J));return a.length?a.map(n=>`${n}=${encodeURIComponent(e[n])}`):[]},ee=({url:e,prefill:a={},pageSettings:n={},utm:l={}})=>{const t=X(n),{backgroundColor:o,hideEventTypeDetails:r,hideLandingPageDetails:C,primaryColor:g,textColor:f,hideGdprBanner:M}=t,{customAnswers:h,date:u,email:y,firstName:p,guests:$,lastName:k,smsReminderNumber:U,location:S,name:v}=a,{utmCampaign:I,utmContent:b,utmMedium:R,utmSource:A,utmTerm:E,salesforce_uuid:T}=l,m=e.indexOf("?"),B=m>-1,P=e.slice(m+1),w=B?e.slice(0,m):e,N=[B?P:null,o?`background_color=${o}`:null,r?"hide_event_type_details=1":null,C?"hide_landing_page_details=1":null,g?`primary_color=${g}`:null,f?`text_color=${f}`:null,M?"hide_gdpr_banner=1":null,v?`name=${encodeURIComponent(v)}`:null,S?`location=${encodeURIComponent(S)}`:null,p?`first_name=${encodeURIComponent(p)}`:null,k?`last_name=${encodeURIComponent(k)}`:null,U?`phone_number=${encodeURIComponent(U)}`:null,$?`guests=${$.map(encodeURIComponent).join(",")}`:null,y?`email=${encodeURIComponent(y)}`:null,u&&u instanceof Date?`date=${K(u)}`:null,I?`utm_campaign=${encodeURIComponent(I)}`:null,b?`utm_content=${encodeURIComponent(b)}`:null,R?`utm_medium=${encodeURIComponent(R)}`:null,A?`utm_source=${encodeURIComponent(A)}`:null,E?`utm_term=${encodeURIComponent(E)}`:null,T?`salesforce_uuid=${encodeURIComponent(T)}`:null,"embed_type=Inline","embed_domain=1"].concat(h?Z(h):[]).filter(Y=>Y!==null).join("&");return`${w}?${N}`},ne={class:"calendly-inline-widget h-[630px]"},te=["title","src"],oe=D({__name:"Calendly",props:{url:{},prefill:{},utm:{},pageSettings:{},iframeTitle:{}},emits:["load"],setup(e,{emit:a}){const n=e,l=a,t=()=>{l("load")},o=G(()=>ee({url:n.url,pageSettings:n.pageSettings,prefill:n.prefill,utm:n.utm}));return(r,C)=>(c(),d("div",ne,[r.url?(c(),d("iframe",{key:0,width:"100%",height:"100%",frameBorder:"0",title:n.iframeTitle||"",onLoad:t,src:o.value},null,40,te)):x("",!0)]))}}),ae={class:"h-[630px]"},le=["title","src"],ie=D({__name:"UniBuddy",props:{url:{},title:{}},emits:["load"],setup(e,{emit:a}){const n=e,l=a,t=()=>{l("load")};return(o,r)=>(c(),d("div",ae,[o.url?(c(),d("iframe",{key:0,id:"unibuddy-iframe",width:"100%",height:"100%",frameBorder:"0",title:n.title||"",onLoad:t,"data-ub-cookie-consent":"necessary",src:n.url},null,40,le)):x("",!0)]))}}),{pushChatOpenEvent:re}=O(),me=()=>{const{openModal:e}=W(),a=z(),n=(t,o)=>{j(H.SYNTEA)?(a.openChat(),re(void 0,o)):e({headline:t.label,content:i(q),modalMode:F.HEADLESS})};return{handleButtonEvent:(t,o)=>{switch(t.type){case s.CALLBACK:e({headline:t.label,content:i("div",[i(V,{blok:{headline:t.headline,description:t.description,container:{noXPadding:!0,noYPadding:!0}}}),i(Q,{blok:{form:t.value,noXPadding:!0,prefill:{position:o},plugins:["callbackTracking"]}})]),skipWysiwyg:!0});break;case s.CHAT:n(t,o);break;case s.UNI_BUDDY:e({headline:"",content:i(ie,{url:t.value,title:t.label}),skipWysiwyg:!0,modalPadding:!1});break;case s.VIDEO_CHAT:e({headline:"",content:i(oe,{url:t.value}),skipWysiwyg:!0,modalPadding:!1});break}}}};export{ie as _,oe as a,me as u};