{"version":3,"file":"CustomBookingWidget.D1QfFKBG.mjs","names":["w","useRef","useMemo","useCallback"],"sources":["https:/framerusercontent.com/modules/iKzp3hiQcqjOAKvCSh1j/5F5IO6eGduWUyBXQEv4O/CustomBookingWidget.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useCallback,useEffect,useMemo,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Request: Update the existing CustomBookingWidget so Calendly form fields use a dark background with legible text, subdued placeholders, and visible focus state while preserving behavior, URL handling, responsive sizing, and exposed controls.\nconst SCRIPT_SRC=\"https://assets.calendly.com/assets/external/widget.js\";const DEFAULT_URL=\"https://calendly.com/d/5kp-r7d-qxx?hide_gdpr_banner=1&background_color=111820&text_color=ffffff&primary_color=6d51e9\";function loadCalendlyScript(onReady){const w=window;if(w.Calendly){onReady();return()=>{};}const existing=document.querySelector(`script[src=\"${SCRIPT_SRC}\"]`);if(existing){existing.addEventListener(\"load\",onReady);return()=>existing.removeEventListener(\"load\",onReady);}const script=document.createElement(\"script\");script.src=SCRIPT_SRC;script.async=true;script.addEventListener(\"load\",onReady);document.body.appendChild(script);return()=>script.removeEventListener(\"load\",onReady);}function withDarkCalendlyParams(rawUrl){try{const parsed=new URL(rawUrl);parsed.searchParams.set(\"hide_gdpr_banner\",\"1\");parsed.searchParams.set(\"background_color\",\"111820\");parsed.searchParams.set(\"text_color\",\"ffffff\");parsed.searchParams.set(\"primary_color\",\"6d51e9\");return parsed.toString();}catch{return rawUrl;}}function applyDarkFieldStyles(root){const elements=root.querySelectorAll(\"input, textarea, select, [contenteditable='true']\");elements.forEach(element=>{element.style.backgroundColor=\"#1B2430\";element.style.color=\"#FFFFFF\";element.style.borderColor=\"rgba(255, 255, 255, 0.2)\";element.style.caretColor=\"#FFFFFF\";});}/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function CustomBookingWidget(props){const{calendlyURL=DEFAULT_URL,height=700}=props;const ref=useRef(null);const themedUrl=useMemo(()=>withDarkCalendlyParams(calendlyURL),[calendlyURL]);const observerRef=useRef(null);const initializeWidget=useCallback(()=>{if(typeof window===\"undefined\")return;const w=window;if(!w.Calendly||!ref.current)return;ref.current.innerHTML=\"\";w.Calendly.initInlineWidget({url:themedUrl,parentElement:ref.current,pageSettings:{backgroundColor:\"111820\",textColor:\"ffffff\",primaryColor:\"6d51e9\",hideGdprBanner:true}});applyDarkFieldStyles(ref.current);if(observerRef.current)observerRef.current.disconnect();observerRef.current=new MutationObserver(()=>{if(!ref.current)return;applyDarkFieldStyles(ref.current);});observerRef.current.observe(ref.current,{childList:true,subtree:true});},[themedUrl]);useEffect(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\"){return()=>{};}const cleanup=loadCalendlyScript(initializeWidget);return()=>{cleanup();if(observerRef.current){observerRef.current.disconnect();observerRef.current=null;}};},[initializeWidget]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,className:\"custom-booking-widget\",style:{position:\"relative\",minWidth:320,width:\"100%\",height},children:/*#__PURE__*/_jsx(\"style\",{children:`\n                .custom-booking-widget input,\n                .custom-booking-widget textarea,\n                .custom-booking-widget select,\n                .custom-booking-widget [contenteditable=\"true\"] {\n                    background: #1B2430 !important;\n                    color: #FFFFFF !important;\n                    border-color: rgba(255, 255, 255, 0.2) !important;\n                    caret-color: #FFFFFF !important;\n                }\n                .custom-booking-widget input::placeholder,\n                .custom-booking-widget textarea::placeholder {\n                    color: rgba(255, 255, 255, 0.55) !important;\n                }\n                .custom-booking-widget input:focus,\n                .custom-booking-widget textarea:focus,\n                .custom-booking-widget select:focus,\n                .custom-booking-widget [contenteditable=\"true\"]:focus {\n                    outline: 2px solid #6d51e9 !important;\n                    outline-offset: 1px !important;\n                    box-shadow: 0 0 0 3px rgba(109, 81, 233, 0.25) !important;\n                }\n            `})});}addPropertyControls(CustomBookingWidget,{calendlyURL:{type:ControlType.String,title:\"Calendly URL\",defaultValue:DEFAULT_URL},height:{type:ControlType.Number,title:\"Height\",defaultValue:700,min:400,max:1400,step:10,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomBookingWidget\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomBookingWidget.map"],"mappings":"8MACkN,SAAS,EAAmB,EAAQ,CAAgB,GAAGA,EAAE,SAAoB,OAAV,EAAQ,MAAY,CAAC,EAAG,IAAM,EAAS,SAAS,cAAc,eAAe,EAAW,GAAG,EAAE,GAAG,EAAoD,OAA1C,EAAS,iBAAiB,OAAO,CAAO,MAAY,EAAS,oBAAoB,OAAO,CAAO,EAAG,IAAM,EAAO,SAAS,cAAc,QAAQ,EAAoH,MAAlH,GAAO,IAAI,EAAW,EAAO,MAAM,GAAK,EAAO,iBAAiB,OAAO,CAAO,EAAE,SAAS,KAAK,YAAY,CAAM,MAAY,EAAO,oBAAoB,OAAO,CAAO,CAAE,CAAC,SAAS,EAAuB,EAAO,CAAC,GAAG,CAAC,IAAM,EAAO,IAAI,IAAI,CAAM,EAAwM,OAAtM,EAAO,aAAa,IAAI,mBAAmB,GAAG,EAAE,EAAO,aAAa,IAAI,mBAAmB,QAAQ,EAAE,EAAO,aAAa,IAAI,aAAa,QAAQ,EAAE,EAAO,aAAa,IAAI,gBAAgB,QAAQ,EAAS,EAAO,SAAS,CAAE,MAAM,CAAC,OAAO,CAAO,CAAC,CAAC,SAAS,EAAqB,EAAK,CAA2F,EAAtE,iBAAiB,mDAA4D,CAAC,CAAC,QAAQ,GAAS,CAAC,EAAQ,MAAM,gBAAgB,UAAU,EAAQ,MAAM,MAAM,UAAU,EAAQ,MAAM,YAAY,2BAA2B,EAAQ,MAAM,WAAW,SAAU,CAAC,CAAE,CAG7yC,SAAwB,EAAoB,EAAM,CAAC,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