{"version":3,"file":"WithFormData.CBXF075m.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/fXZ6xJuvPwcMmUJeA36J/qlEf8EtXMQb5uJyZ4oSy/CallConfirmationLogic.js","https:/framerusercontent.com/modules/rzNhxdap98ObtF0bLGNn/u7mVAR19iMg11JEqdEzq/SlackOptionButton.js","https:/framerusercontent.com/modules/2VdMNCt8IDV49sqRP3OV/1p62BSesFpPP2MacRC1Y/WithFormData.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{RenderTarget}from\"framer\";// ============================================================\n// Call Confirmation Logic — drop this (invisible) component on the\n// confirmation page. It shows ONE of two sections based on whether\n// the user opted into Slack on the booking form.\n//\n// IMPORTANT: it only runs on the LIVE / published site. On the Framer\n// canvas it does nothing, so BOTH sections stay visible and editable\n// in the editor.\n//\n// Section names in Framer (data-framer-name):\n//   \"with-slack\"    -> opted IN  (\"we invited you to Slack\")\n//   \"without-slack\" -> opted OUT (\"second chance / add me\")\n//\n// Slack state: ?slack=on/off in the URL first, else the form's\n// sessionStorage (oneleet_form.slack).\n// ============================================================\nexport default function CallConfirmationLogic(){useEffect(()=>{// Skip on the canvas so both sections remain editable in the editor.\nif(RenderTarget.current()===RenderTarget.canvas)return;const slackParam=new URLSearchParams(window.location.search).get(\"slack\");let optedIn=null;if(slackParam===\"on\")optedIn=true;else if(slackParam===\"off\")optedIn=false;else{try{const saved=JSON.parse(sessionStorage.getItem(\"oneleet_form\")||\"{}\");if(typeof saved.slack===\"boolean\")optedIn=saved.slack;}catch{}}if(optedIn===null)optedIn=true// default: show opted-in\n;const hide=name=>{const el=document.querySelector(`[data-framer-name=\"${name}\"]`);if(el)el.style.display=\"none\";};// ОНОВЛЕНА ЛОГІКА\nif(optedIn){// Якщо користувач вибрав Slack — ховаємо блок \"без слаку\"\nhide(\"without-slack\");}else{// Якщо користувач НЕ вибрав Slack — ховаємо ОБИДВА блоки\nhide(\"with-slack\");hide(\"without-slack\");}},[]);// tiny, static, invisible body so Framer lets you place it on canvas.\nreturn /*#__PURE__*/_jsx(\"div\",{style:{width:1,height:1,opacity:0}});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CallConfirmationLogic\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CallConfirmationLogic.map","import{jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";const ACCENT=\"#E64228\";export default function SlackOptInButton(props){const{label=\"Yes, add me to Slack\"}=props;const handleClick=()=>{if(typeof window===\"undefined\")return;const url=new URL(window.location.href);url.searchParams.set(\"slack\",\"on\");window.location.href=url.toString();};return /*#__PURE__*/_jsxs(\"button\",{onClick:handleClick,style:{width:\"100%\",border:\"none\",borderRadius:999,padding:\"16px 24px\",background:ACCENT,color:\"#fff\",fontFamily:\"Inter, sans-serif\",fontWeight:550,fontSize:16,cursor:\"pointer\",transition:\"background 0.2s ease\"},children:[\"\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\",label,\"\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\\xa0\"]});}SlackOptInButton.defaultProps={label:\"Yes, add me to Slack\"};addPropertyControls(SlackOptInButton,{label:{type:ControlType.String,title:\"Label\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SlackOptInButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SlackOptionButton.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";// дефолти, якщо значення з форми немає\nconst DEFAULTS={company_name:\"your company\",contact_email:\"your email\"};export function withFormData(Component){return props=>{const ref=useRef(null);useEffect(()=>{let values={};try{const raw=sessionStorage.getItem(\"oneleet_form\");values=raw?JSON.parse(raw):{};}catch{}const root=ref.current;if(!root)return;const walker=document.createTreeWalker(root,NodeFilter.SHOW_TEXT);const nodes=[];let n=walker.nextNode();while(n){nodes.push(n);n=walker.nextNode();}nodes.forEach(node=>{const text=node.nodeValue||\"\";if(text.includes(\"{{\")){node.nodeValue=text.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g,(_,k)=>values[k]||DEFAULTS[k]||`{{${k}}}`);}});},[]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{display:\"contents\"},children:/*#__PURE__*/_jsx(Component,{...props})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withFormData\":{\"type\":\"reactHoc\",\"name\":\"withFormData\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithFormData.map"],"mappings":"8MAgBA,SAAwB,GAAuB,CAM/C,OANgD,MAAc,CAC9D,GAAG,EAAa,QAAQ,IAAI,EAAa,OAAO,OAAO,IAAM,EAAW,IAAI,gBAAgB,EAAO,SAAS,MAAM,CAAC,CAAC,IAAI,OAAO,EAAM,EAAQ,KAAK,GAAG,IAAa,KAAK,EAAQ,QAAU,GAAG,IAAa,MAAM,EAAQ,QAAW,GAAG,CAAC,IAAM,EAAM,KAAK,MAAM,eAAe,QAAQ,cAAc,GAAG,IAAI,EAAK,OAAO,EAAM,OAAQ,YAAU,EAAQ,EAAM,MAAM,MAAM,CAAC,CAAK,IAAU,OAAK,EAAQ,IACnY,IAAM,EAAK,GAAM,CAAC,IAAM,EAAG,SAAS,cAAc,sBAAsB,EAAK,GAAG,EAAK,IAAG,EAAG,MAAM,QAAQ,OAAO,EAC9G,GAEH,EAAK,YAAY,EADjB,EAAK,eAAe,CACsB,EAAE,CAAC,CAAC,EAC1B,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAE,qBAtB3B,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