(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,818581,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"useMergedRef",{enumerable:!0,get:function(){return r}});let a=e.r(271645);function r(e,t){let n=(0,a.useRef)(null),r=(0,a.useRef)(null);return(0,a.useCallback)(a=>{if(null===a){let e=n.current;e&&(n.current=null,e());let t=r.current;t&&(r.current=null,t())}else e&&(n.current=o(e,a)),t&&(r.current=o(t,a))},[e,t])}function o(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},284508,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"errorOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},522016,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a={default:function(){return h},useLinkStatus:function(){return I}};for(var r in a)Object.defineProperty(n,r,{enumerable:!0,get:a[r]});let o=e.r(190809),s=e.r(843476),i=o._(e.r(271645)),l=e.r(195057),d=e.r(8372),u=e.r(818581),c=e.r(718967),_=e.r(405550);e.r(233525);let E=e.r(769688),m=e.r(914135),f=e.r(509396);function p(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}function h(t){var n;let a,r,o,[l,h]=(0,i.useOptimistic)(E.IDLE_LINK_STATUS),I=(0,i.useRef)(null),{href:S,as:b,children:T,prefetch:R=null,passHref:N,replace:g,shallow:A,scroll:v,onClick:C,onMouseEnter:w,onTouchStart:P,legacyBehavior:O=!1,onNavigate:y,ref:U,unstable_dynamicOnHover:D,...M}=t;a=T,O&&("string"==typeof a||"number"==typeof a)&&(a=(0,s.jsx)("a",{children:a}));let B=i.default.useContext(d.AppRouterContext),k=!1!==R,x=!1!==R?null===(n=R)||"auto"===n?f.FetchStrategy.PPR:f.FetchStrategy.Full:f.FetchStrategy.PPR,{href:F,as:V}=i.default.useMemo(()=>{let e=p(S);return{href:e,as:b?p(b):e}},[S,b]);if(O){if(a?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});r=i.default.Children.only(a)}let j=O?r&&"object"==typeof r&&r.ref:U,X=i.default.useCallback(e=>(null!==B&&(I.current=(0,E.mountLinkInstance)(e,F,B,x,k,h)),()=>{I.current&&((0,E.unmountLinkForCurrentNavigation)(I.current),I.current=null),(0,E.unmountPrefetchableInstance)(e)}),[k,F,B,x,h]),Y={ref:(0,u.useMergedRef)(X,j),onClick(t){O||"function"!=typeof C||C(t),O&&r.props&&"function"==typeof r.props.onClick&&r.props.onClick(t),!B||t.defaultPrevented||function(t,n,a,r,o,s,l){if("u">typeof window){let d,{nodeName:u}=t.currentTarget;if("A"===u.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(n)){o&&(t.preventDefault(),location.replace(n));return}if(t.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:c}=e.r(699781);i.default.startTransition(()=>{c(a||n,o?"replace":"push",s??!0,r.current)})}}(t,F,V,I,g,v,y)},onMouseEnter(e){O||"function"!=typeof w||w(e),O&&r.props&&"function"==typeof r.props.onMouseEnter&&r.props.onMouseEnter(e),B&&k&&(0,E.onNavigationIntent)(e.currentTarget,!0===D)},onTouchStart:function(e){O||"function"!=typeof P||P(e),O&&r.props&&"function"==typeof r.props.onTouchStart&&r.props.onTouchStart(e),B&&k&&(0,E.onNavigationIntent)(e.currentTarget,!0===D)}};return(0,c.isAbsoluteUrl)(V)?Y.href=V:O&&!N&&("a"!==r.type||"href"in r.props)||(Y.href=(0,_.addBasePath)(V)),o=O?i.default.cloneElement(r,Y):(0,s.jsx)("a",{...M,...Y,children:a}),(0,s.jsx)(L.Provider,{value:l,children:o})}e.r(284508);let L=(0,i.createContext)(E.IDLE_LINK_STATUS),I=()=>(0,i.useContext)(L);("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},857739,e=>{"use strict";var t=e.i(843476),n=e.i(210850),a=e.i(522016),r=e.i(271645),o=e.i(335590),s=e.i(562053),i=e.i(113919);let l=(0,n.cva)("group whitespace-nowrap inline-flex items-center text-sm font-medium relative rounded-[10px] transition cursor-pointer disabled:cursor-not-allowed gap-1",{variants:{variant:{button:"",icon:"flex justify-center",fab:"min-w-14 min-h-14 md:min-w-min md:min-h-min rounded-full justify-center md:rounded-[10px] radix-state-open:rotate-45 md:radix-state-open:rotate-0 radix-state-open:shadown-none radix-state-open:ring-0"},color:{primary:["bg-brand-default","text-brand","not-disabled:hover:bg-brand-emphasis","focus-visible:outline-none","focus-visible:ring-0","focus-visible:shadow-button-solid-brand-focused","border border-brand-default","disabled:opacity-30","shadow-button-solid-brand-default","not-disabled:active:shadow-button-solid-brand-active","not-disabled:hover:shadow-button-solid-brand-hover","transition-shadow","transition-transform","duration-100"],secondary:["bg-default","text-default","border","border-default","not-disabled:hover:bg-cal-muted","not-disabled:hover:text-emphasis","disabled:opacity-30","focus-visible:bg-subtle","focus-visible:outline-none","focus-visible:ring-0","focus-visible:shadow-outline-gray-focused","shadow-outline-gray-rested","not-disabled:hover:shadow-outline-gray-hover","not-disabled:active:shadow-outline-gray-active","transition-shadow","duration-200"],minimal:["text-subtle","border border-transparent","not-disabled:hover:bg-subtle","not-disabled:hover:text-emphasis","not-disabled:hover:border-subtle hover:border","disabled:opacity-30","focus-visible:bg-subtle","focus-visible:outline-none","focus-visible:ring-0","focus-visible:border-subtle","focus-visible:shadow-button-outline-gray-focused","not-disabled:active:shadow-outline-gray-active","transition-shadow","duration-200"],destructive:["border","border-default","text-error","dark:hover:text-red-400","hover:border-semantic-error","hover:bg-error","focus-visible:text-red-700","focus-visible:bg-error","focus-visible:outline-none","focus-visible:ring-0","focus-visible:shadow-button-outline-red-focused","disabled:bg-red-100","disabled:border-red-200","disabled:text-red-700","disabled:hover:border-red-200","disabled:opacity-30","shadow-outline-red-rested","not-disabled:hover:shadow-outline-red-hover","not-disabled:active:shadow-outline-red-active","transition-shadow","duration-200"]},size:{xs:"h-6 p-2 leading-none text-xs rounded-md",sm:"h-7 px-2 py-1.5 leading-none text-sm",base:"px-2.5 py-2 text-sm leading-none",lg:"px-3 py-2.5 "},loading:{true:"cursor-wait"}},compoundVariants:[{loading:!0,color:"primary",className:"opacity-30"},{loading:!0,color:"secondary",className:"bg-subtle text-emphasis/80"},{loading:!0,color:"minimal",className:"bg-subtle text-emphasis/30"},{loading:!0,color:"destructive",className:"text-red-700/30 dark:text-red-700/30 hover:text-red-700/30 border border-default text-emphasis"},{variant:"icon",size:"base",className:"min-h-[36px] min-w-[36px] p-2! hover:border-default"},{variant:"icon",size:"xs",className:"h-5 w-5 p-1! rounded-md"},{variant:"icon",size:"sm",className:"h-6 w-6 p-1! rounded-md"},{variant:"icon",size:"lg",className:"h-10 w-10 p-1!"},{variant:"fab",size:"base",className:"md:px-4 md:py-2.5"}],defaultVariants:{variant:"button",color:"primary",size:"base"}}),d=(0,r.forwardRef)(function(e,n){let{loading:r=!1,color:i="primary",size:d,variant:c="button",type:_="button",tooltipSide:E="top",tooltipOffset:m=4,tooltipClassName:f,StartIcon:p,CustomStartIcon:h,EndIcon:L,shallow:I,...S}=e,b=e.disabled||r||!1,T=void 0!==e.href,R=(0,o.default)(l({color:i,size:d,loading:r,variant:c}),e.className),N=b?e=>{e.preventDefault()}:e.onClick,g=(0,t.jsxs)(t.Fragment,{children:[h||p&&(0,t.jsx)(t.Fragment,{children:"fab"===c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.Icon,{name:p,className:"hidden h-4 w-4 shrink-0 stroke-[1.5px] md:inline-flex"}),(0,t.jsx)(s.Icon,{name:"plus","data-testid":"plus",className:"inline h-6 w-6 shrink-0 md:hidden"})]}):(0,t.jsx)(s.Icon,{"data-name":"start-icon",name:p,className:(0,o.default)("shrink-0",r?"invisible":"visible","button-icon group-[:not(div):active]:translate-y-[0.5px]","icon"===c&&"h-4 w-4","button"===c&&"h-4 w-4 stroke-[1.5px] ")})}),(0,t.jsx)("div",{className:(0,o.default)("contents",r?"invisible":"visible","fab"===c?"hidden md:contents":"","group-[:not(div):active]:translate-y-[0.5px]"),children:e.children}),r&&(0,t.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform",children:(0,t.jsxs)("svg",{className:(0,o.default)("mx-4 h-5 w-5 animate-spin","primary"===i?"text-inverted":"text-emphasis"),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,t.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,t.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),L&&(0,t.jsx)(t.Fragment,{children:"fab"===c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.Icon,{name:L,className:"hidden h-4 w-4 shrink-0 stroke-[1.5px] md:inline-flex"}),(0,t.jsx)(s.Icon,{name:"plus","data-testid":"plus",className:"inline h-6 w-6 shrink-0 md:hidden"})]}):(0,t.jsx)(s.Icon,{name:L,className:(0,o.default)("shrink-0",r?"invisible":"visible","group-[:not(div):active]:translate-y-[0.5px]","icon"===c&&"h-4 w-4","button"===c&&"h-4 w-4 stroke-[1.5px] ")})})]});return T?(0,t.jsx)(a.default,{...S,shallow:I&&I,className:R,onClick:N,children:g}):(0,t.jsx)(u,{"data-testid":"wrapper",tooltip:e.tooltip,tooltipSide:E,tooltipOffset:m,tooltipClassName:f,children:(0,t.jsx)("button",{...S,ref:n,disabled:b,type:_,className:R,onClick:N,children:g})})}),u=({children:e,tooltip:n,tooltipSide:a,tooltipOffset:r,tooltipClassName:o})=>n?(0,t.jsx)(i.Tooltip,{"data-testid":"tooltip",className:o,content:n,side:a,sideOffset:r,children:e}):(0,t.jsx)(t.Fragment,{children:e});d.displayName="Button",e.s(["Button",0,d,"buttonClasses",0,l])},618566,(e,t,n)=>{t.exports=e.r(976562)},24509,e=>{"use strict";let t;var n=e.i(247167);function a(e){return e?e.startsWith("http://")||e.startsWith("https://")?e:`https://${e}`:""}let r=n.default.env.NEXT_PUBLIC_VERCEL_URL?`https://${n.default.env.NEXT_PUBLIC_VERCEL_URL}`:"",o=n.default.env.RAILWAY_STATIC_URL?`https://${n.default.env.RAILWAY_STATIC_URL}`:"",s=n.default.env.HEROKU_APP_NAME?`https://${n.default.env.HEROKU_APP_NAME}.herokuapp.com`:"",i=n.default.env.RENDER_EXTERNAL_URL?`https://${n.default.env.RENDER_EXTERNAL_URL}`:"",l="production"===(n.default.env.CALCOM_ENV||"production");n.default.env.ORGANIZER_EMAIL_EXEMPT_DOMAINS;let d=a("https://schedule.cloudaismart.com")||r||o||s||i||"https://schedule.cloudaismart.com",u=a("https://schedule.cloudaismart.com")||"https://cal.com",c=n.default.env.NEXT_PUBLIC_APP_NAME||"Cal.com",_=n.default.env.NEXT_PUBLIC_SUPPORT_MAIL_ADDRESS||"help@cal.com",E=n.default.env.NEXT_PUBLIC_COMPANY_NAME||"Cal.com, Inc.",m=n.default.env.NEXT_PUBLIC_SENDER_ID||"Cal",f=n.default.env.NEXT_PUBLIC_SENDGRID_SENDER_NAME||"Cal.com";n.default.env.EMAIL_FROM_NAME;let p=new URL(d).hostname.endsWith(".vercel.app")?d:a("https://schedule.cloudaismart.com")||d,h=d&&(new URL(d).hostname.endsWith("cal.com")||new URL(d).hostname.endsWith("cal.dev")||new URL(d).hostname.endsWith("cal.qa")||new URL(d).hostname.endsWith("cal-staging.com")||new URL(d).hostname.endsWith("cal.eu")),L=new URL(d).hostname.endsWith(".cal.dev")||new URL(d).hostname.endsWith(".cal.qa")||new URL(d).hostname.endsWith(".cal-staging.com")?"https://console.cal.dev":"https://console.cal.com",I=new URL(d).hostname,S=![".cal.com",".cal.dev",".cal.eu",".cal.qa"].some(e=>I.endsWith(e)),b=n.default.env.NEXT_PUBLIC_EMBED_LIB_URL||`${d}/embed/embed.js`,T=n.default.env.NEXT_PUBLIC_HOSTED_CAL_FEATURES||!S,R=parseInt(n.default.env.NEXT_PUBLIC_QUERY_RESERVATION_INTERVAL_SECONDS??"",10)||30,N=parseInt(n.default.env.NEXT_PUBLIC_QUERY_RESERVATION_STALE_TIME_SECONDS??"",10)||20,g=parseInt(n.default.env.NEXT_PUBLIC_QUERY_AVAILABLE_SLOTS_INTERVAL_SECONDS??"",10)||300,A="1"===n.default.env.NEXT_PUBLIC_INVALIDATE_AVAILABLE_SLOTS_ON_BOOKING_FORM,v=parseInt(n.default.env.NEXT_PUBLIC_QUICK_AVAILABILITY_ROLLOUT??"",10)||0,C=!!(n.default.env.STRIPE_CLIENT_ID&&n.default.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY&&n.default.env.STRIPE_PRIVATE_KEY),w=!!(C&&T),P=!!n.default.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY&&T,O=n.default.env.NEXT_PUBLIC_MINUTES_TO_BOOK||"5",y="1"===n.default.env.NEXT_PUBLIC_ENABLE_PROFILE_SWITCHER,U=JSON.parse(`[${n.default.env.ALLOWED_HOSTNAMES||""}]`),D=JSON.parse(`[${n.default.env.RESERVED_SUBDOMAINS||""}]`);parseFloat(n.default.env.NEXT_PUBLIC_ORGANIZATIONS_SELF_SERVE_PRICE_NEW||"37"),n.default.env.E2E_TEST_MAILHOG_ENABLED,n.default.env.CALCOM_CREDENTIAL_SYNC_SECRET&&n.default.env.CALCOM_APP_CREDENTIAL_ENCRYPTION_KEY,n.default.env.CALCOM_CREDENTIAL_SYNC_SECRET,n.default.env.CALCOM_CREDENTIAL_SYNC_HEADER_NAME,n.default.env.CALCOM_CREDENTIAL_SYNC_ENDPOINT,n.default.env.CALCOM_SERVICE_ACCOUNT_ENCRYPTION_KEY,(h||n.default.env.NEXT_PUBLIC_IS_E2E&&C)&&n.default.env.NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE_MONTHLY;let M=!!globalThis.window?.Meticulous?.isRunningAsTest,B=parseInt(n.default.env.NEXT_PUBLIC_BOOKER_NUMBER_OF_DAYS_TO_LOAD??"0",10),k=n.default.env.NEXT_PUBLIC_CLOUDFLARE_SITEKEY,x=n.default.env.NEXT_PUBLIC_CLOUDFLARE_USE_TURNSTILE_IN_BOOKER,F="1"===n.default.env.NEXT_PUBLIC_ORG_SELF_SERVE_ENABLED;n.default.env.CALCOM_PRIVATE_API_ROUTE,n.default.env.LINGO_DOT_DEV_API_KEY;let V=l?`${d}/sparkles-red.svg`:"https://app.cal.com/sparkles-red.svg",j=l?`${d}/sparkles.svg`:"https://app.cal.com/sparkles.svg",X=l?`${d}/start-recording.svg`:"https://app.cal.com/start-recording.svg",Y=l?`${d}/stop-recording.svg`:"https://app.cal.com/stop-recording.svg";n.default.env.DIRECTORY_IDS_TO_LOG?.split(",");let K=!!(!S&&n.default.env.IFFY_API_KEY);n.default.env.CLOUDFLARE_URL_SCANNER_API_TOKEN&&n.default.env.CLOUDFLARE_ACCOUNT_ID;let H=!!n.default.env.NEXT_PUBLIC_DUB_PROGRAM_ID&&""!==n.default.env.NEXT_PUBLIC_DUB_PROGRAM_ID;n.default.env.CAL_VIDEO_MEETING_LINK_FOR_TESTING;let G=!!n.default.env.NEXT_PUBLIC_STRIPE_CREDITS_PRICE_ID||!!n.default.env.NEXT_PUBLIC_IS_E2E;parseInt(n.default.env.DATABASE_CHUNK_SIZE||"25",10);let W=n.default.env.NEXT_PUBLIC_CAL_AI_PHONE_NUMBER_MONTHLY_PRICE,$=Number.isFinite(t=W&&""!==W.trim()?Number(W):NaN)?t:5,z="true"===n.default.env.RETELL_AI_TEST_MODE,Q=(()=>{if(!n.default.env.RETELL_AI_TEST_EVENT_TYPE_MAP)return null;try{return JSON.parse(n.default.env.RETELL_AI_TEST_EVENT_TYPE_MAP)}catch(e){return console.warn("Failed to parse RETELL_AI_TEST_EVENT_TYPE_MAP",e),null}})();n.default.env._CAL_INTERNAL_PAST_BOOKING_RESCHEDULE_CHANGE_TEAM_IDS,n.default.env.STRIPE_ORG_TRIAL_DAYS&&parseInt(n.default.env.STRIPE_ORG_TRIAL_DAYS,10),n.default.env.IS_E2E,"true"===n.default.env.ENABLE_ASYNC_TASKER&&n.default.env.NEXT_PUBLIC_IS_E2E,e.s(["ALLOWED_HOSTNAMES",0,U,"API_NAME_LENGTH_MAX_LIMIT",0,80,"APP_NAME",0,c,"AVATAR_FALLBACK",0,"/avatar.svg","BOOKER_NUMBER_OF_DAYS_TO_LOAD",0,B,"CALCOM_VERSION",0,"6.1.13","CAL_AI_PHONE_NUMBER_MONTHLY_PRICE",0,$,"CAL_URL",0,p,"CLOUDFLARE_SITE_ID",0,k,"CLOUDFLARE_USE_TURNSTILE_IN_BOOKER",0,x,"COMPANY_NAME",0,E,"CONSOLE_URL",0,L,"DEFAULT_DARK_BRAND_COLOR",0,"#fafafa","DEFAULT_GROUP_ID",0,"default_group_id","DEFAULT_LIGHT_BRAND_COLOR",0,"#292929","DOCS_URL",0,"https://cal.com/docs","EMBED_LIB_URL",0,b,"ENABLE_PROFILE_SWITCHER",0,y,"FULL_NAME_LENGTH_MAX_LIMIT",0,50,"HOSTED_CAL_FEATURES",0,T,"IS_CALCOM",0,h,"IS_DUB_REFERRALS_ENABLED",0,H,"IS_PRODUCTION",0,l,"IS_SELF_HOSTED",0,S,"IS_SMS_CREDITS_ENABLED",0,G,"IS_TEAM_BILLING_ENABLED",0,w,"IS_TEAM_BILLING_ENABLED_CLIENT",0,P,"IS_VISUAL_REGRESSION_TESTING",0,M,"MAX_EVENT_DURATION_MINUTES",0,1440,"MAX_NB_INVITES",0,100,"MAX_SEATS_PER_TIME_SLOT",0,1e3,"MINUTES_TO_BOOK",0,O,"MIN_EVENT_DURATION_MINUTES",0,1,"ORG_MINIMUM_PUBLISHED_TEAMS_SELF_SERVE_HELPER_DIALOGUE",0,1,"ORG_SELF_SERVE_ENABLED",0,F,"POWERED_BY_URL",0,"https://go.cal.com/booking","PUBLIC_INVALIDATE_AVAILABLE_SLOTS_ON_BOOKING_FORM",0,A,"PUBLIC_QUERY_AVAILABLE_SLOTS_INTERVAL_SECONDS",0,g,"PUBLIC_QUERY_RESERVATION_INTERVAL_SECONDS",0,R,"PUBLIC_QUERY_RESERVATION_STALE_TIME_SECONDS",0,N,"PUBLIC_QUICK_AVAILABILITY_ROLLOUT",0,v,"RECORDING_DEFAULT_ICON",0,X,"RECORDING_IN_PROGRESS_ICON",0,Y,"RESERVED_SUBDOMAINS",0,D,"RETELL_AI_TEST_EVENT_TYPE_MAP",0,Q,"RETELL_AI_TEST_MODE",0,z,"ROADMAP",0,"https://cal.com/roadmap","ROLLING_WINDOW_PERIOD_MAX_DAYS_TO_CHECK",0,61,"SCANNING_WORKFLOW_STEPS",0,K,"SENDER_ID",0,m,"SENDER_NAME",0,f,"SINGLE_ORG_SLUG",0,"","SUPPORT_MAIL_ADDRESS",0,_,"TOP_BANNER_HEIGHT",0,40,"TRANSCRIPTION_STARTED_ICON",0,V,"TRANSCRIPTION_STOPPED_ICON",0,j,"URL_PROTOCOL_REGEX",0,/(^\w+:|^)\/\//,"WEBAPP_URL",0,d,"WEBSITE_PRIVACY_POLICY_URL",0,"https://cal.com/privacy","WEBSITE_TERMS_URL",0,"https://cal.com/terms","WEBSITE_URL",0,u])},313069,e=>{"use strict";var t=e.i(271645);let n=()=>{};e.s(["default",0,e=>{let a=(0,t.useCallback)(t=>{let n=window.matchMedia(e);return n.addEventListener("change",t),()=>n.removeEventListener("change",t)},[e]),r=(0,t.useCallback)(()=>window.matchMedia(e).matches,[e]);return(0,t.useSyncExternalStore)(a,r,n)??!1}])},478618,e=>{"use strict";var t=e.i(618566);e.s(["useCompatSearchParams",0,()=>{let e=(0,t.useSearchParams)()??new URLSearchParams,n=(0,t.useParams)()??{},a=new URLSearchParams(e.toString());return Object.getOwnPropertyNames(n).forEach(e=>{a.delete(e);let t=n[e],r="string"==typeof t?t.split("/"):t;r?.forEach(t=>{a.append(e,t)})}),new t.ReadonlyURLSearchParams(a)}])},168173,675994,e=>{"use strict";let t={"cal-radius":"radius","cal-radius-sm":"radius-sm","cal-radius-md":"radius-md","cal-radius-lg":"radius-lg","cal-radius-xl":"radius-xl","cal-radius-2xl":"radius-2xl","cal-radius-3xl":"radius-3xl","cal-radius-full":"radius-full","cal-radius-none":"radius-none","cal-spacing-px":"spacing"};function n(e){if(!e)return e;let n={};for(let[a,r]of Object.entries(e))for(let[e,o]of(n[a]={},Object.entries(r))){let r=t[e];if(!r){n[a][e]=o;continue}console.log("Mapped variable:",e,"to",r),n[a][r]=o}return n}function a({param:e,value:t,container:n}){let a=function(e){let t={};if(null===e)return t;for(let[n,a]of e)if(t.hasOwnProperty(n)){let e=t[n];Array.isArray(e)||(e=[e]),e.push(a),t[n]=e}else t[n]=a;return t}(n.entries());if(!n.has(e))return!1;let r=a[e],o=Array.isArray(t)?t:[t];return o.length===r.length&&o.every(e=>r.includes(e))}e.s(["mapOldToNewCssVars",()=>n],168173),e.s(["isParamValuePresentInUrlSearchParams",()=>a],675994)},111914,e=>{"use strict";function t(e,t){let n=new window.CustomEvent(e,{detail:t});window.dispatchEvent(n)}let n=null;!function(){if(window.isEmbed)return;let e=new URL(document.URL),t=e.searchParams.get("embed"),n=e.pathname.endsWith("/embed"),a="string"==typeof t?t:window.name.includes("cal-embed=")?window.name.replace(/cal-embed=(.*)/,"$1").trim():n?"":null;window.isEmbed=()=>"string"==typeof a,window.getEmbedTheme=()=>window.CalEmbed.embedStore.theme?window.CalEmbed.embedStore.theme:new URL(document.URL).searchParams.get("theme"),window.getEmbedNamespace=()=>a,window.CalEmbed=window.CalEmbed||{},window.CalEmbed.applyCssVars=e=>{let t=[];if(e)for(let[n,a]of Object.entries(e)){for(let[e,r]of(t.push(`.${n} {`),Object.entries(a)))t.push(`--${e}: ${r} !important;`);t.push("}")}let n=document.head.querySelector("#embed-css-vars");if(n){console.warn("Existing embed CSS Vars are being reset"),n.innerText=t.join("\n");return}let a=document.createElement("style");a.id="embed-css-vars",a.innerText=t.join("\n"),document.head.appendChild(a)}}(),n=new class{namespace;static parseAction(e){if(!e)return null;let[t,n,a]=e.split(":");return"CAL"!==t?null:{ns:n,type:a}}getFullActionName(e){return this.namespace?`CAL:${this.namespace}:${e}`:`CAL::${e}`}fire(e,n){let a=this.getFullActionName(e),r={type:e,namespace:this.namespace,fullType:a,data:n};t(a,r),t(this.getFullActionName("*"),r)}on(e,t){let n=this.getFullActionName(e);window.addEventListener(n,t)}off(e,t){let n=this.getFullActionName(e);window.removeEventListener(n,t)}constructor(e){e=e||"",this.namespace=e}}(window.getEmbedNamespace()),e.s(["sdkActionManager",()=>n],111914)},436864,867426,e=>{"use strict";e.s(["getEmbedBookerState",()=>V,"interfaceWithParent",()=>M,"methods",()=>D,"updateEmbedBookerState",()=>j,"useBrandColors",()=>C,"useEmbedNonStylesConfig",()=>A,"useEmbedStyles",()=>g,"useEmbedTheme",()=>R,"useEmbedType",()=>P,"useEmbedUiConfig",()=>N,"useIsBackgroundTransparent",()=>v,"useIsEmbed",()=>w],436864);var t,n=e.i(271645),a=e.i(168173),r=e.i(675994),o=e.i(247167),s=e.i(111914);function i(e){return setTimeout(e,50)}function l(){return"slotsDone"===window._embedBookerState}let d=()=>"true"===new URL(document.URL).searchParams.get("prerender");function u({embedStore:e}){return!!e.providedCorrectHeightToParent&&(!(window._embedBookerState&&new URL(document.URL).searchParams.get("cal.embed.pageType"))||l())}let c=async e=>{let t=new URL(document.URL),n=null,a=t.searchParams.get("cal.queuedFormResponseId");if(!a)return null;if("00000000-0000-0000-0000-000000000000"===a)return 0;let{form:r,...o}=e,s=await fetch("/api/routing-forms/queued-response",{method:"POST",body:JSON.stringify({queuedFormResponseId:a,params:o})});if(!s.ok)return null;let i=(await s.json()).data.formResponseId;return i&&(n=i),n};function _(...e){{let t=window?.getEmbedNamespace?.()??null,n=new URL(document.URL).searchParams,a=window.CalEmbed.__logQueue=window.CalEmbed.__logQueue||[];e.push({ns:t,url:document.URL}),e.unshift("CAL:"),a.push(e),(n.get("debug")||"true"===o.default.env.INTEGRATION_TEST_MODE)&&console.log("Child:",...e)}}var E=((t={})[t.NOT_INITIALIZED=0]="NOT_INITIALIZED",t[t.INITIALIZED=1]="INITIALIZED",t);let m={connectVersion:0,renderState:null,router:{ensureQueryParamsInUrl({toBeThereParams:e,toRemoveParams:t}){let n=!1,{hasChanged:a}=function a(){if(n)return{hasChanged:!1};let o=new URL(document.URL),s=!1;for(let[t,n]of Object.entries(e))(s=!(0,r.isParamValuePresentInUrlSearchParams)({param:t,value:n,container:o.searchParams}))&&function({key:e,value:t,url:n}){n.searchParams.delete(e),(Array.isArray(t)?t:[t]).forEach(t=>{n.searchParams.append(e,t)})}({key:t,value:n,url:o});return function({keys:e,url:t}){for(let n of e)t.searchParams.delete(n)}({keys:t,url:o}),(s=s||t.length>0)&&window.history.replaceState({},"",o.toString()),i(a),{hasChanged:s}}();return{stopEnsuringQueryParamsInUrl:()=>{n=!0},hasChanged:a}}},state:0,styles:{},nonStyles:{},namespace:null,embedType:void 0,reactStylesStateSetters:{},reactNonStylesStateSetters:{},providedCorrectHeightToParent:!1,windowLoadEventFired:!1,setTheme:void 0,theme:void 0,uiConfig:void 0,setUiConfig:[],viewId:null,pageData:{eventsState:{bookerViewed:{hasFired:!1},bookerReopened:{hasFired:!1},bookerReloaded:{hasFired:!1},bookerReady:{hasFired:!1}},reloadInitiated:!1}};function f(e){return m.pageData.eventsState[e].hasFired}function p(e,t){m.pageData.eventsState[e].hasFired=t}var h=e.i(478618);e.s(["useBookerEmbedEvents",()=>I,"useSlotsViewOnSmallScreen",()=>S],867426);var L=e.i(313069);let I=({eventId:e,eventSlug:t,schedule:n})=>{let a=m.viewId;!d()&&a&&((({eventId:e,eventSlug:t,slotsLoaded:n})=>{var a;let r=1===m.viewId,o=m.pageData.reloadInitiated?"bookerReloaded":r?"bookerViewed":"bookerReopened";f(o)||(p(a=o,!0),n?e&&t?s.sdkActionManager?.fire(a,{eventId:e,eventSlug:t,slotsLoaded:!0}):console.error("BookerViewed event not fired because slotsLoaded is true but eventId or eventSlug are falsy"):s.sdkActionManager?.fire(a,{eventId:null,eventSlug:null,slotsLoaded:!1}))})({eventId:e,eventSlug:t,slotsLoaded:n.isSuccess}),e&&t&&(({eventId:e,eventSlug:t,slotsLoaded:n})=>{n&&(f("bookerReady")||(s.sdkActionManager?.fire("bookerReady",{eventId:e,eventSlug:t}),p("bookerReady",!0)))})({eventId:e,eventSlug:t,slotsLoaded:n.isSuccess}))},S=()=>{let e=w(),t=(0,L.default)("(max-width: 768px)"),n=N();return!!e&&!!t&&(n.useSlotsViewOnSmallScreen??!1)},b=["__iframeReady","__dimensionChanged","__connectInitiated","linkPrerendered"];{window.CalEmbed=window?.CalEmbed||{},window.CalEmbed.embedStore=m;let e=navigator.userAgent.toLowerCase();e.includes("safari")&&!e.includes("chrome")&&_("Safari Detected: Using setTimeout instead of rAF")}let T=e=>e.styles?(m.reactStylesStateSetters[e.elementName]=e.setState,e.setState(m.styles||{}),()=>{delete m.reactStylesStateSetters[e.elementName]}):(m.reactNonStylesStateSetters[e.elementName]=e.setState,e.setState(m.nonStyles||{}),()=>{delete m.reactNonStylesStateSetters[e.elementName]}),R=()=>{var e;let t,a,r,o,i=(0,h.useCompatSearchParams)(),[l,d]=(0,n.useState)(m.theme||i?.get("theme"));return e=(0,n.useCallback)(()=>{s.sdkActionManager?.fire("__routeChanged",{})},[]),t=new URL(document.URL),a=t?.pathname??"",r=t?.searchParams??null,o=(0,n.useRef)(`${a}?${r}`),(0,n.useEffect)(()=>{let t=`${a}?${r}`;o.current!==t&&(o.current=t,e(t))},[a,r,e]),m.setTheme=d,l},N=()=>{let[e,t]=(0,n.useState)(m.uiConfig||{});return m.setUiConfig.push(t),(0,n.useEffect)(()=>()=>{let e=m.setUiConfig.findIndex(e=>e===t);m.setUiConfig.splice(e,1)}),e},g=e=>{let[,t]=(0,n.useState)({});return(0,n.useEffect)(()=>T({elementName:e,setState:t,styles:!0}),[]),(m.styles||{})[e]||{}},A=e=>{let[,t]=(0,n.useState)({});return(0,n.useEffect)(()=>T({elementName:e,setState:t,styles:!1}),[]),(m.nonStyles||{})[e]||{}},v=()=>{let e=!1;return"transparent"===g("body").background&&(e=!0),e},C=()=>A("branding")||{},w=e=>{let[t,a]=(0,n.useState)(e);return(0,n.useEffect)(()=>{let e=null!=function(){if(null!=m.namespace)return m.namespace;{let e=window?.getEmbedNamespace?.()??null;return m.namespace=e,e}}();parent===window||e||_("Looks like you have iframed cal.com but not using Embed Snippet. Directly using an iframe isn't recommended."),a(window?.isEmbed?.()||!1)},[]),t},P=()=>{let[e,t]=(0,n.useState)(null);return(0,n.useEffect)(()=>{t(m.embedType?m.embedType:m.embedType=new URL(document.URL).searchParams.get("embedType"))},[]),e};function O(){"u">typeof document&&document.body&&("visible"!==document.body.style.visibility&&(document.body.style.visibility="visible"),"1"!==document.body.style.opacity&&(document.body.style.opacity="1"),i(()=>{O()}))}async function y({newlyRecordedResponseId:e,toBeThereParams:t,toRemoveParams:n}){let{stopEnsuringQueryParamsInUrl:a}=m.router.ensureQueryParamsInUrl({toBeThereParams:{...t,"cal.routingFormResponseId":e.toString()},toRemoveParams:n});a()}async function U(){return new Promise(e=>{!function t(){"completed"!==m.renderState?i(t):e()}()})}let D={ui:function(e){let t;_("Method: ui called",e);let n=e.styles;n&&console.warn("Cal.com Embed: `styles` prop is deprecated. Use `cssVarsPerTheme` instead to achieve the same effect. Here is a list of CSS variables that are supported. https://github.com/calcom/cal.com/blob/main/packages/config/tailwind-preset.js#L19"),n?.body?.background&&(document.body.style.background=n.body.background),e.theme&&(m.theme=e.theme,m.setTheme&&m.setTheme(e.theme));let r=m.uiConfig?.cssVarsPerTheme,o=e.cssVarsPerTheme;if(r||o)for(let e of(t={},Array.from(new Set([...r?Object.keys(r):[],...o?Object.keys(o):[]]))))t[e]={...r?.[e],...o?.[e]};if((e={...m.uiConfig,...e,...t?{cssVarsPerTheme:t}:{}}).cssVarsPerTheme){let t=(0,a.mapOldToNewCssVars)(e.cssVarsPerTheme);window.CalEmbed.applyCssVars(t)}e.colorScheme&&x(e.colorScheme),m.setUiConfig&&(m.uiConfig=s=e,m.setUiConfig.forEach(e=>e(s)));var s,i=n||{};for(let[,e]of(m.styles=i,Object.entries(m.reactStylesStateSetters)))e(e=>({...e,...i}));var l=n||{};for(let[,e]of(m.nonStyles=l,Object.entries(m.reactStylesStateSetters)))e(e=>({...e,...l}))},parentKnowsIframeReady:e=>{_("Method: `parentKnowsIframeReady` called"),i(function e(){u({embedStore:m})?B()?k(window.CalComPageStatus):(O(),_("renderState is 'completed'"),m.renderState="completed",d()?s.sdkActionManager?.fire("linkPrerendered",{}):s.sdkActionManager?.fire("linkReady",{})):i(e)})},connect:async function({config:e,params:t}){s.sdkActionManager?.fire("__connectInitiated",{}),_("Method: connect, requested with params",{config:e,params:t});let{iframeAttrs:n,"cal.embed.noSlotsFetchOnConnect":a,...r}=e;m.providedCorrectHeightToParent=!1,"true"!==a&&(_("Method: connect, noSlotsFetchOnConnect is false. Requesting slots re-fetch"),m.connectVersion=m.connectVersion+1);let o=m.connectVersion,i={...t,...r,"cal.embed.connectVersion":o.toString()},l=["preload","prerender","cal.skipSlotsFetch"];await U(),_("Method: connect, renderState is completed. Connecting"),await F({toBeThereParams:i,toRemoveParams:l});let d=await c(t);"number"==typeof d&&await y({newlyRecordedResponseId:d,toBeThereParams:i,toRemoveParams:l})},__reloadInitiated:function(e){_("Method: __reloadInitiated called"),m.pageData.reloadInitiated=!0}},M=D;function B(){let e=window.CalComPageStatus;return!!(e&&"200"!=e)}function k(e){s.sdkActionManager?.fire("linkFailed",{code:e,msg:"Problem loading the link",data:{url:document.URL}})}function x(e){e&&(document.documentElement.style.colorScheme=e)}async function F({toBeThereParams:e,toRemoveParams:t}){let{hasChanged:n,stopEnsuringQueryParamsInUrl:a}=m.router.ensureQueryParamsInUrl({toBeThereParams:e,toRemoveParams:t}),r=0;return l()&&n&&(r=2),await new Promise(e=>{i(function t(){if(!u({embedStore:m})||r>0){r--,i(t);return}if(B()){k(window.CalComPageStatus),e();return}a(),s.sdkActionManager?.fire("__connectCompleted",{}),s.sdkActionManager?.fire("linkReady",{}),e()})}),{stopEnsuringQueryParamsInUrl:a}}function V({bookerState:e,slotsQuery:t}){return"loading"===e?"initializing":t.isLoading?"slotsLoading":t.isPending||t.isSuccess?"slotsDone":t.isError?"slotsLoadingError":"slotsPending"}function j({bookerState:e,slotsQuery:t}){window._embedBookerState=V({bookerState:e,slotsQuery:t})}!function(){_("Embed SDK loaded",{isEmbed:window?.isEmbed?.()||!1});let e=new URL(document.URL);m.theme=window?.getEmbedTheme?.();let t=e.searchParams.get("ui.autoscroll"),n=e.searchParams.get("useSlotsViewOnSmallScreen");if(m.uiConfig={colorScheme:e.searchParams.get("ui.color-scheme"),layout:e.searchParams.get("layout"),disableAutoScroll:"false"===t,useSlotsViewOnSmallScreen:(n??"false")==="true"},x(m.uiConfig.colorScheme),top===window){O(),"transparent"===document.body.style.background&&(document.body.style.background=""),_("Embed SDK Skipped as we are in top");return}let a="true"!==e.searchParams.get("cal.skipSlotsFetch");_(`Slots will ${a?"":"NOT "}be fetched`),window.addEventListener("message",e=>{let t=e.data;if(!t)return;let n=t.method;"CAL"===t.originator&&"string"==typeof n&&M[n]?.(t.arg)}),document.addEventListener("click",e=>{if(!e.target||!(e.target instanceof Node))return;let t=document.getElementsByClassName("main")[0]||document.getElementsByTagName("main")[0]||document.documentElement;e.target.contains(t)&&s.sdkActionManager?.fire("__closeIframe",{})}),s.sdkActionManager?.on("linkReady",()=>{!d()&&(_("Resetting page data"),m.pageData={eventsState:{bookerViewed:{hasFired:!1},bookerReopened:{hasFired:!1},bookerReloaded:{hasFired:!1},bookerReady:{hasFired:!1}},reloadInitiated:!1},m.viewId?m.viewId++:m.viewId=1)}),s.sdkActionManager?.on("*",e=>{if(d()&&!b.includes(e.detail.type))return;let t=e.detail;_(t),parent.postMessage({originator:"CAL",...t},"*")}),"true"!==e.searchParams.get("preload")&&window?.isEmbed?.()?function(){if(s.sdkActionManager?.fire("__iframeReady",{isPrerendering:d()}),m.renderState="inProgress",m.state!==E.NOT_INITIALIZED)return _("Embed Iframe already initialized");m.state=E.INITIALIZED,_("Initializing embed-iframe");let e=window.CalComPageStatus;B()?k(e):function({embedStore:e}){let t=null,n=null,a=!0,r=!1;i(function o(){if("complete"!==document.readyState)return void i(o);if(!r)return void setTimeout(()=>{r=!0,o()},100);e.windowLoadEventFired||s.sdkActionManager?.fire("__windowLoadComplete",{}),e.windowLoadEventFired=!0;let l=document.getElementsByClassName("main")[0]||document.getElementsByTagName("main")[0]||document.documentElement,d=document.documentElement.scrollHeight,u=document.documentElement.scrollWidth;if(!(l instanceof HTMLElement))throw Error("Main element should be an HTMLElement");let c=getComputedStyle(l),_=Math.ceil(parseFloat(c.height)+parseFloat(c.marginTop)+parseFloat(c.marginBottom)),E=Math.ceil(parseFloat(c.width)+parseFloat(c.marginLeft)+parseFloat(c.marginRight)),m=a?d:_,f=a?u:E;m&&f&&(t===m&&n===f&&e.providedCorrectHeightToParent||(t=m,n=f,s.sdkActionManager?.fire("__dimensionChanged",{iframeHeight:m,iframeWidth:f,isFirstTime:a})),a||(e.providedCorrectHeightToParent=!0),a=!1),i(o)})}({embedStore:m})}():_("Preloaded scenario - Skipping initialization and setup as only assets need to be loaded")}()}]);
//# sourceMappingURL=740f42b1d75ed902.js.map