{"version":3,"file":"FormLP.DW029nAs.mjs","names":["useState","useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/61sEjkGNRUo0f66I3jFg/UdBYWGJCB8S8BWYOfjcR/FormLP.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const WaveformIcon=()=>/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 28 28\",width:\"32\",height:\"32\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M 6.727 12.334 L 6.727 14.784 M 10.402 9.884 L 10.402 17.234 M 14.077 7.434 L 14.077 19.684 M 17.752 11.109 L 17.752 17.234 M 21.427 12.334 L 21.427 14.784\",fill:\"transparent\",strokeWidth:\"2.2\",stroke:\"rgb(22,19,17)\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})});const LoadingWaveform=()=>/*#__PURE__*/_jsxs(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 28 28\",width:\"32\",height:\"32\",children:[/*#__PURE__*/_jsx(\"style\",{children:`\n      @keyframes w1 { 0%,100%{transform:scaleY(1)} 50%{transform:scaleY(0.3)} }\n      @keyframes w2 { 0%,100%{transform:scaleY(0.6)} 50%{transform:scaleY(1)} }\n      @keyframes w3 { 0%,100%{transform:scaleY(1)} 50%{transform:scaleY(0.2)} }\n      @keyframes w4 { 0%,100%{transform:scaleY(0.5)} 50%{transform:scaleY(1)} }\n      @keyframes w5 { 0%,100%{transform:scaleY(1)} 50%{transform:scaleY(0.4)} }\n      .wb { transform-origin: center; }\n    `}),[{x:6.727,h:2.45,d:\"0s\",k:\"w1\"},{x:10.402,h:7.35,d:\"0.1s\",k:\"w2\"},{x:14.077,h:12.25,d:\"0.2s\",k:\"w3\"},{x:17.752,h:6.125,d:\"0.1s\",k:\"w4\"},{x:21.427,h:2.45,d:\"0s\",k:\"w5\"}].map(({x,h,d,k})=>/*#__PURE__*/_jsx(\"line\",{className:\"wb\",x1:x,y1:14-h/2,x2:x,y2:14+h/2,stroke:\"rgb(22,19,17)\",strokeWidth:\"2\",strokeLinecap:\"round\",style:{animation:k+\" 0.7s ease-in-out infinite \"+d}},x))]});function formatPhone(raw){const digits=raw.replace(/\\D/g,\"\").slice(0,10);if(digits.length<=3)return digits;if(digits.length<=6)return\"(\"+digits.slice(0,3)+\") \"+digits.slice(3);return\"(\"+digits.slice(0,3)+\") \"+digits.slice(3,6)+\"-\"+digits.slice(6);}export default function PhoneForm({trackingId}){const[phone,setPhone]=useState(\"\");const[loading,setLoading]=useState(false);const[submitted,setSubmitted]=useState(false);const[error,setError]=useState(\"\");const[callId,setCallId]=useState(null);const rowRef=useRef(null);const[lockedWidth,setLockedWidth]=useState(null);const handleChange=e=>{const digits=e.target.value.replace(/\\D/g,\"\").slice(0,10);setPhone(formatPhone(digits));};const getPostHogIds=()=>{try{const ph=window.posthog;if(!ph?.__loaded)return{};return{ph_distinct_id:ph.get_distinct_id?.()||undefined,ph_session_id:ph.get_session_id?.()||undefined};}catch{return{};}};const handleSubmit=async()=>{const digits=phone.replace(/\\D/g,\"\");if(digits.length<10||loading||submitted)return;const pageContext={qsr:{role:\"prep cook role\",company:\"fast food restaurant\"},delivery:{role:\"driver role\",company:\"logistic company\"},retail:{role:\"store associate role\",company:\"retail store\"},staffing:{role:\"recruiter role\",company:\"staffing agency\"}};const pathname=typeof window!==\"undefined\"?window.location.pathname:\"\";const segments=[\"qsr\",\"delivery\",\"retail\",\"staffing\"];const matchedPage=segments.find(s=>pathname.toLowerCase().includes(s));const matchedContext=matchedPage?pageContext[matchedPage]:null;setLoading(true);setError(\"\");try{console.log(\"[PhoneForm] page:\",matchedPage??\"none\",\"| context:\",matchedContext);const res=await fetch(\"https://fountaininc.app.n8n.cloud/webhook/13efb258-7b90-4057-b37f-e70ae698703a\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({phone:\"+1 \"+phone,...trackingId&&{trackingId},...matchedContext?{role:matchedContext.role,company:matchedContext.company}:{},...getPostHogIds()})});const data=await res.json();if(data?.id)setCallId(data.id);if(rowRef.current)setLockedWidth(rowRef.current.offsetWidth);setSubmitted(true);}catch{setError(\"Something went wrong. Please try again.\");}finally{setLoading(false);}};const isReady=phone.replace(/\\D/g,\"\").length===10;const resultsUrl=\"https://agent.fountain.com/results/call/\"+callId;return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n        @import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;700;800&display=swap');\n        .pf-root { font-family: 'DM Sans', sans-serif; display: block; width: 100%; max-width: 100%; box-sizing: border-box; }\n        .pf-row { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 100%; box-sizing: border-box; }\n        .pf-input-wrap { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; height: 52px; border-radius: 200px; border: 1.5px solid rgba(0,0,0,0.11); background: rgba(255,255,255,0.95); box-shadow: 0 2px 8px rgba(0,0,0,0.055); transition: border-color 0.18s, box-shadow 0.18s; overflow: hidden; box-sizing: border-box; }\n        .pf-input-wrap:focus-within { border-color: rgba(255,196,60,0.75); box-shadow: 0 0 0 3.5px rgba(255,224,149,0.28), 0 2px 8px rgba(0,0,0,0.055); }\n        .pf-prefix { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 18px; flex-shrink: 0; border-right: 1.5px solid rgba(0,0,0,0.08); height: 28px; user-select: none; }\n        .pf-flag { font-size: 18px; line-height: 1; }\n        .pf-plus1 { font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 800; color: rgb(22,19,17); letter-spacing: -0.3px; }\n        .pf-input { flex: 1; min-width: 0; height: 100%; padding: 0 18px 0 14px; border: none; background: transparent; font-family: 'DM Sans', sans-serif; font-size: 17px; font-weight: 800; color: rgb(22,19,17); outline: none; letter-spacing: 0.2px; width: 100%; }\n        .pf-input::placeholder { font-weight: 700; color: rgba(22,19,17,0.3); }\n        @media (max-width: 480px) {\n          .pf-input { font-size: 14px; letter-spacing: 0; }\n          .pf-input::placeholder { font-size: 13px; }\n          .pf-plus1 { font-size: 13px; }\n          .pf-flag { font-size: 14px; }\n          .pf-prefix { padding: 0 8px 0 12px; gap: 4px; }\n          .pf-input-wrap { height: 46px; }\n          .pf-btn { width: 46px !important; height: 46px !important; }\n          .pf-success-pill { height: 46px !important; }\n          .pf-success-msg { font-size: 13px; }\n        }\n        .pf-success-pill { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 22px; border-radius: 200px; border: 1.5px solid rgba(0,0,0,0.11); background: rgba(255,255,255,0.95); box-shadow: 0 2px 8px rgba(0,0,0,0.055); white-space: nowrap; overflow: hidden; box-sizing: border-box; flex: 1; min-width: 0; }\n        .pf-success-msg { font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 700; color: rgba(22,19,17,0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }\n        .pf-btn-wrap { position: relative; flex-shrink: 0; }\n        .pf-btn { position: relative; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 200px; background: rgb(255,237,180); box-shadow: rgba(0,0,0,0.25) 0px 4px 12px 0px; border: none; cursor: pointer; transition: transform 0.14s, box-shadow 0.14s; flex-shrink: 0; }\n        .pf-btn:hover:not(:disabled) { transform: translateY(-1.5px) scale(1.05); box-shadow: rgba(0,0,0,0.28) 0px 6px 18px 0px; }\n        .pf-btn:active:not(:disabled) { transform: scale(0.97); box-shadow: rgba(0,0,0,0.16) 0px 2px 6px 0px; }\n        .pf-btn:disabled { cursor: not-allowed; opacity: 0.5; }\n        .pf-tooltip { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(5px); background: rgb(22,19,17); color: #fff; font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 200px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.15s, transform 0.15s; }\n        .pf-btn-wrap:hover .pf-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }\n        .pf-msg { margin-top: 9px; padding-left: 18px; font-family: 'DM Sans', sans-serif; font-size: 13px; }\n        .pf-msg.success { color: rgba(22,19,17,0.45); }\n        .pf-msg.error { color: #c0392b; }\n        .pf-results-link { color: rgb(22,19,17); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }\n        .pf-results-link:hover { opacity: 0.6; }\n      `}),/*#__PURE__*/_jsxs(\"div\",{className:\"pf-root\",children:[submitted?/*#__PURE__*/_jsxs(\"div\",{children:[/*#__PURE__*/_jsx(\"div\",{className:\"pf-row\",children:/*#__PURE__*/_jsxs(\"div\",{className:\"pf-success-pill\",style:lockedWidth?{width:lockedWidth,flex:\"none\"}:{},children:[/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 24 24\",width:\"18\",height:\"18\",fill:\"none\",stroke:\"rgba(22,19,17,0.55)\",strokeWidth:\"2.5\",strokeLinecap:\"round\",strokeLinejoin:\"round\",style:{flexShrink:0},children:/*#__PURE__*/_jsx(\"polyline\",{points:\"20 6 9 17 4 12\"})}),/*#__PURE__*/_jsx(\"span\",{className:\"pf-success-msg\",children:\"Anna is calling you.\"})]})}),callId&&/*#__PURE__*/_jsx(\"p\",{className:\"pf-msg success\",children:/*#__PURE__*/_jsx(\"a\",{className:\"pf-results-link\",href:resultsUrl,target:\"_blank\",rel:\"noopener noreferrer\",children:\"Get your results here\"})})]}):/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"div\",{className:\"pf-row\",ref:rowRef,children:[/*#__PURE__*/_jsxs(\"div\",{className:\"pf-input-wrap\",children:[/*#__PURE__*/_jsxs(\"div\",{className:\"pf-prefix\",children:[/*#__PURE__*/_jsx(\"span\",{className:\"pf-flag\",children:\"🇺🇸\"}),/*#__PURE__*/_jsx(\"span\",{className:\"pf-plus1\",children:\"+1\"})]}),/*#__PURE__*/_jsx(\"input\",{className:\"pf-input\",type:\"tel\",placeholder:\"(555) 000-0000\",value:phone,onChange:handleChange,onKeyDown:e=>e.key===\"Enter\"&&handleSubmit(),disabled:loading})]}),/*#__PURE__*/_jsxs(\"div\",{className:\"pf-btn-wrap\",children:[/*#__PURE__*/_jsx(\"span\",{className:\"pf-tooltip\",children:\"Talk to me\"}),/*#__PURE__*/_jsx(\"button\",{className:\"pf-btn\",onClick:handleSubmit,disabled:loading||!isReady,\"aria-label\":\"Talk to me\",children:loading?/*#__PURE__*/_jsx(LoadingWaveform,{}):/*#__PURE__*/_jsx(WaveformIcon,{})})]})]}),error&&/*#__PURE__*/_jsx(\"p\",{className:\"pf-msg error\",children:error})]}),/*#__PURE__*/_jsxs(\"p\",{style:{marginTop:10,paddingLeft:18,fontFamily:\"'DM Sans', sans-serif\",fontSize:13,fontWeight:500,color:\"rgba(255,255,255,0.6)\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontWeight:700,color:\"rgba(255,255,255,0.9)\"},children:\"Get called by Anna.\"}),\" \",\"Try it now.\"]})]})]});}addPropertyControls(PhoneForm,{trackingId:{type:ControlType.String,title:\"Tracking ID\",placeholder:\"optional\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PhoneForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormLP.map"],"mappings":"6MAOkY,SAAS,EAAY,EAAI,CAAC,IAAM,EAAO,EAAI,QAAQ,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,EAAyG,OAApG,EAAO,QAAQ,EAAS,EAAU,EAAO,QAAQ,EAAQ,IAAI,EAAO,MAAM,EAAE,CAAC,EAAE,KAAK,EAAO,MAAM,CAAC,EAAQ,IAAI,EAAO,MAAM,EAAE,CAAC,EAAE,KAAK,EAAO,MAAM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