{"version":3,"file":"WhatsAppFloating.D9UReDcJ.mjs","names":["React.useId","React.useState"],"sources":["https:/framerusercontent.com/modules/K27LtTwYoyoOfupdMaCp/XV2RTPE9RlAMAibhmbp0/WhatsAppFloating.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{motion,useMotionValue,useSpring}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * SERVICAN BOUNCE QUANTUM ULTRA-LIGHT\n * - Regla de Oro: Peso cero, Lag cero.\n * - Versión Original Restaurada.\n *\n * FIX: El botón desaparecía al hacer scroll porque dragConstraints usaba\n * un div ref cuya posición dependía del canvas de Framer (que se mueve al scrollear).\n * Solución: constraints calculados desde window — independientes del scroll,\n * independientes del canvas, siempre anclados al viewport real.\n */export default function ServicanBounceQuantumLight(props){const{phoneNumber,message,size,bottomOffset,sideOffset,position,backgroundColor,iconColor,zIndex,pulseEffect}=props;const cleanNumber=phoneNumber.replace(/\\D/g,\"\");const whatsappUrl=`https://wa.me/${cleanNumber}?text=${encodeURIComponent(message)}`;const animId=React.useId().replace(/:/g,\"\");const x=useMotionValue(0);const y=useMotionValue(0);const springX=useSpring(x,{stiffness:400,damping:30});const springY=useSpring(y,{stiffness:400,damping:30});// Constraints calculados desde window — nunca dependen del canvas ni del scroll\nconst[constraints,setConstraints]=React.useState({top:0,left:0,right:0,bottom:0});React.useEffect(()=>{const margin=20;const update=()=>{setConstraints({top:-(window.innerHeight-size-bottomOffset-margin),left:-(window.innerWidth-size-sideOffset-margin),right:sideOffset+margin,bottom:bottomOffset+margin});};update();window.addEventListener(\"resize\",update);return()=>window.removeEventListener(\"resize\",update);},[size,bottomOffset,sideOffset]);return /*#__PURE__*/_jsxs(\"div\",{style:{contents:\"true\"},children:[/*#__PURE__*/_jsx(\"style\",{dangerouslySetInnerHTML:{__html:`\n                @keyframes pulse-light-${animId} {\n                    0% { transform: scale(1); opacity: 0.7; }\n                    100% { transform: scale(1.7); opacity: 0; }\n                }\n                .q-layer-${animId} {\n                    position: absolute;\n                    inset: 0;\n                    background-color: ${backgroundColor};\n                    border-radius: 50%;\n                    animation: pulse-light-${animId} 2s infinite cubic-bezier(0.4, 0, 0.6, 1);\n                    pointer-events: none;\n                    z-index: -1;\n                    will-change: transform, opacity;\n                }\n                .float-box-${animId} {\n                    position: fixed !important;\n                    bottom: ${bottomOffset}px;\n                    ${position}: ${sideOffset}px;\n                    width: ${size}px;\n                    height: ${size}px;\n                    z-index: ${zIndex};\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                    touch-action: none;\n                }\n            `}}),/*#__PURE__*/_jsxs(motion.div,{className:`float-box-${animId}`,drag:true,dragConstraints:constraints,dragElastic:.2,dragMomentum:true,whileDrag:{scale:1.1,cursor:\"grabbing\"},style:{x:springX,y:springY,willChange:\"transform\"},children:[pulseEffect&&/*#__PURE__*/_jsx(\"div\",{className:`q-layer-${animId}`}),/*#__PURE__*/_jsx(\"a\",{href:whatsappUrl,target:\"_blank\",rel:\"noopener\",style:{width:\"100%\",height:\"100%\",backgroundColor:backgroundColor,borderRadius:\"50%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:\"0 15px 30px rgba(0,0,0,0.25)\",cursor:\"grab\",textDecoration:\"none\",WebkitBackfaceVisibility:\"hidden\",flexShrink:0,aspectRatio:\"1/1\"},children:/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 448 512\",style:{width:\"54%\",height:\"54%\",fill:iconColor},children:/*#__PURE__*/_jsx(\"path\",{d:\"M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.1 0-65.6-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-5.5-2.8-23.2-8.5-44.2-27.1-16.4-14.6-27.4-32.7-30.6-38.2-3.2-5.6-.3-8.6 2.5-11.3 2.5-2.5 5.5-6.5 8.3-9.7 2.8-3.3 3.7-5.6 5.5-9.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 13.2 5.8 23.5 9.2 31.5 11.8 13.3 4.2 25.4 3.6 35 2.2 10.7-1.5 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z\"})})})]})]});}addPropertyControls(ServicanBounceQuantumLight,{phoneNumber:{type:ControlType.String,title:\"Tel\\xe9fono\",defaultValue:\"573000000000\"},message:{type:ControlType.String,title:\"Mensaje\",defaultValue:\"Hola Servic\\xe1n!\"},size:{type:ControlType.Number,title:\"Tama\\xf1o\",defaultValue:62},bottomOffset:{type:ControlType.Number,title:\"Abajo\",defaultValue:35},sideOffset:{type:ControlType.Number,title:\"Lado\",defaultValue:35},position:{type:ControlType.Enum,title:\"Lado\",options:[\"left\",\"right\"],defaultValue:\"right\"},backgroundColor:{type:ControlType.Color,title:\"Fondo\",defaultValue:\"#25D366\"},iconColor:{type:ControlType.Color,title:\"Icono\",defaultValue:\"#FFFFFF\"},zIndex:{type:ControlType.Number,title:\"Z Index\",defaultValue:999999},pulseEffect:{type:ControlType.Boolean,title:\"Pulso\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ServicanBounceQuantumLight\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WhatsAppFloating.map"],"mappings":"yQASG,SAAwB,EAA2B,EAAM,CAAC,GAAK,CAAC,cAAY,UAAQ,OAAK,eAAa,aAAW,WAAS,kBAAgB,YAAU,SAAO,eAAa,EAA4D,EAAY,iBAAhD,EAAY,QAAQ,MAAM,GAAG,CAAgD,QAAQ,mBAAmB,EAAQ,GAAS,EAAOA,GAAa,CAAC,QAAQ,KAAK,GAAG,CAAO,EAAE,EAAe,EAAE,CAAO,EAAE,EAAe,EAAE,CAAO,EAAQ,EAAU,EAAE,CAAC,UAAU,IAAI,QAAQ,GAAG,CAAC,CAAO,EAAQ,EAAU,EAAE,CAAC,UAAU,IAAI,QAAQ,GAAG,CAAC,CAC5f,CAAC,EAAY,GAAgBC,EAAe,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAA6W,OAA5W,MAAoB,CAAC,IAAsB,MAAW,CAAC,EAAe,CAAC,IAAI,EAAE,EAAO,YAAY,EAAK,EAAa,IAAQ,KAAK,EAAE,EAAO,WAAW,EAAK,EAAW,IAAQ,MAAM,EAAW,GAAO,OAAO,EAAa,GAAO,CAAC,EAAqD,OAAlD,GAAQ,CAAC,EAAO,iBAAiB,SAAS,EAAO,KAAW,EAAO,oBAAoB,SAAS,EAAO,EAAG,CAAC,EAAK,EAAa,EAAW,CAAC,CAAqB,EAAM,MAAM,CAAC,MAAM,CAAC,SAAS,OAAO,CAAC,SAAS,CAAc,EAAK,QAAQ,CAAC,wBAAwB,CAAC,OAAO;yCACnhB,EAAO;;;;2BAIrB,EAAO;;;wCAGM,EAAgB;;6CAEX,EAAO;;;;;6BAKvB,EAAO;;8BAEN,EAAa;sBACrB,E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