(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,56225,e=>{"use strict";var t=e.i(43476),l=e.i(71645),s=e.i(30033);let a=({isOpen:e,onClose:a,currentBMI:n,targetWeight:r=163.2,bmiPopupData:i,ctaLink:o})=>{let d=(0,l.useRef)(null),c=(0,l.useRef)(null),[u,m]=(0,l.useState)(!1),[x,h]=(0,l.useState)(!1);(0,l.useEffect)(()=>{e?(m(!0),h(!0),setTimeout(()=>h(!1),50)):u&&(h(!0),setTimeout(()=>{m(!1),h(!1)},300))},[e]),(0,l.useEffect)(()=>{e&&d.current&&u&&!x&&(d.current.currentTime=0,d.current.play().catch(console.error))},[e,u,x]),(0,l.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]);let p=()=>{x||a()};return((0,l.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e&&p()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,x]),u)?(0,t.jsx)("div",{className:`fixed inset-0 z-50 flex items-center justify-center p-4 transition-all duration-300 ${e&&!x?"opacity-100":"opacity-0"}`,style:{backgroundColor:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(10px)"},onClick:e=>{c.current&&!c.current.contains(e.target)&&p()},children:(0,t.jsxs)("div",{ref:c,className:`relative bg-white rounded-xl shadow-2xl w-full max-w-lg p-6 pt-12 transform transition-all duration-300 ${e&&!x?"scale-100 translate-y-0":"scale-95 -translate-y-4"}`,style:{height:"auto",minHeight:"fit-content",overflow:"hidden"},onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{onClick:p,className:"absolute top-4 right-4 bg-gray-200 hover:bg-gray-400 p-1 rounded-full transition-colors duration-200","aria-label":"Close",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor",className:"w-6 h-6",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),(0,t.jsx)("div",{className:"text-center mb-4",children:(0,t.jsx)("h3",{className:"text-base font-semibold text-[#B686C1]",children:i.modal_title||"With GLP-1 medication, you can lose up to 20% of your body weight in 6-12 months"})}),(0,t.jsx)("div",{className:"mb-4 flex justify-center",children:(0,t.jsxs)("video",{ref:d,className:"w-full rounded-lg",muted:!0,playsInline:!0,onEnded:()=>{d.current&&(d.current.currentTime=d.current.duration)},children:[(0,t.jsx)("source",{src:"/videos/bmigraph.mp4",type:"video/mp4"}),"Your browser does not support the video tag."]})}),(0,t.jsx)("div",{className:"mb-3",children:(0,t.jsx)("div",{className:"rounded-xl p-3 text-center text-white font-medium",style:{background:"linear-gradient(135deg, #A75EB3 0%, #BE87C4 100%)"},children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{children:i.target_label||"Your new target weight:"}),(0,t.jsxs)("span",{className:"font-semibold bg-white px-2 py-1 rounded-lg text-custom-black",children:[r," lbs"]})]})})}),(0,t.jsx)("div",{className:"text-center mb-4",children:(0,t.jsxs)("p",{className:"text-custom-black font-medium",children:["Your current BMI is: ",(0,t.jsx)("span",{className:"font-bold",children:n})]})}),(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)(s.default,{href:o||"#",text:i.popup_cta_text||"Get Started",bgColor:"bg-gray-900",textColor:"text-white",className:"text-white px-6 py-2 rounded-full font-medium hover:bg-gray-700 transition-colors duration-200"})})]})}):null};e.s(["default",0,({className:e="",bmiCmsData:s,ctaLink:n})=>{let[r,i]=(0,l.useState)(""),[o,d]=(0,l.useState)(""),[c,u]=(0,l.useState)(""),[m,x]=(0,l.useState)(null),[h,p]=(0,l.useState)(null),[g,b]=(0,l.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:`bg-[#7BB4CC] rounded-3xl p-5 md:p-8 text-white flex-1 lg:basis-1/2 min-h-100 h-fit ${e}`,children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("h2",{className:"text-2xl md:text-3xl font-semibold md:mb-2",children:s.left_content?.title||"Check your BMI"}),(0,t.jsx)("p",{className:"text-white/90 font-semibold text-lg md:text-2xl",children:s.left_content?.subtitle||"Enter your height and weight below"})]}),(0,t.jsx)("div",{className:"mb-8",children:(0,t.jsx)("div",{className:"text-4xl md:text-6xl font-bold mb-2",children:m?m.toFixed(1):"0"})})]}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-6",children:[(0,t.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Height"}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsx)("input",{type:"number",value:r,onChange:e=>i(e.target.value),onInput:e=>{let t=e.target;t.value=t.value.replace(/[^0-9]/g,"")},className:"w-full px-3 py-2 md:px-4 md:py-3 rounded-lg text-gray-900 font-medium bg-white/90 outline-0"}),(0,t.jsx)("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-900 text-sm",children:"ft"})]}),(0,t.jsxs)("div",{className:"relative flex-1",children:[(0,t.jsx)("input",{type:"number",value:o,onChange:e=>d(e.target.value),onInput:e=>{let t=e.target;t.value=t.value.replace(/[^0-9]/g,"")},className:"w-full px-3 py-2 md:px-4 md:py-3 rounded-lg text-gray-900 font-medium bg-white/90 outline-0"}),(0,t.jsx)("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-900 text-sm",children:"in"})]})]})]}),(0,t.jsxs)("div",{className:"mb-8",children:[(0,t.jsx)("label",{className:"block text-sm font-medium mb-2",children:"Weight"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("input",{type:"number",value:c,onChange:e=>u(e.target.value),onInput:e=>{let t=e.target;t.value=t.value.replace(/[^0-9]/g,"")},className:"w-full px-3 py-2 md:px-4 md:py-3 rounded-lg text-gray-900 font-medium bg-white/90 outline-0"}),(0,t.jsx)("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-900 text-sm",children:"lbs"})]})]})]}),(0,t.jsx)("button",{onClick:()=>{let e=parseFloat(r)||0,t=parseFloat(o)||0,l=parseFloat(c)||0;if(e>0&&l>0){let s,a=12*e+t,n=l/(a*a)*703;x(Math.round(10*n)/10),p(((s=.8*n)<25&&(s=25),Math.round(a*a*s/703*10)/10)),b(!0)}},className:"w-fit bg-white text-custom-black font-medium py-2 px-4 md:py-3 md:px-5 rounded-3xl place-self-center cursor-pointer hover:bg-white/60 transition-all duration-100",children:s.left_content?.button_text||"Calculate BMI"})]})]}),(0,t.jsx)(a,{bmiPopupData:s.popup_modal,isOpen:g,onClose:()=>b(!1),currentBMI:m||0,targetWeight:h||163.2,ctaLink:n})]})}],56225)},71927,e=>{e.n(e.i(56225))}]);