{"version":3,"file":"ScrollToTopButton.DInkey2Z.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/aysTkS6qiumxlaQZ5hT5/eo96exbjwpTPlXYOaswH/ScrollToTopButton.js"],"sourcesContent":["// Un boton personalizable con icono de arrow phosphor. Que sirva para que al clickearlo vuelva para arriba al hero de la pagina.\nimport{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ScrollToTopButton(props){const{showAfterScroll=300,position=\"bottom-right\",backgroundColor=\"#000000\",iconColor=\"#FFFFFF\",size=56,borderRadius=28,showShadow=true,animationDuration=.3,enterEasing=\"easeOut\",exitEasing=\"easeIn\",enterAnimation=\"slideUp\",exitAnimation=\"slideDown\"}=props;const[isVisible,setIsVisible]=useState(false);const isStatic=useIsStaticRenderer();useEffect(()=>{if(isStatic||typeof window===\"undefined\")return;const handleScroll=()=>{const scrollTop=window.pageYOffset||document.documentElement.scrollTop;startTransition(()=>{setIsVisible(scrollTop>showAfterScroll);});};window.addEventListener(\"scroll\",handleScroll);handleScroll()// Check initial scroll position\n;return()=>window.removeEventListener(\"scroll\",handleScroll);},[showAfterScroll,isStatic]);const scrollToTop=()=>{if(typeof window===\"undefined\")return;// Haptic feedback for supported devices\nif(navigator.vibrate){navigator.vibrate(50);}window.scrollTo({top:0,behavior:\"smooth\"});};const getPositionStyles=()=>{const baseStyles={position:\"fixed\",bottom:\"24px\",zIndex:1e3};switch(position){case\"bottom-left\":return{...baseStyles,left:\"24px\"};case\"bottom-center\":return{...baseStyles,left:\"50%\",transform:\"translateX(-50%)\"};default:return{...baseStyles,right:\"24px\"};}};const getEasingFunction=easing=>{const easingMap={linear:[0,0,1,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1],circIn:[.6,.04,.98,.335],circOut:[.075,.82,.165,1],circInOut:[.785,.135,.15,.86],backIn:[.6,-.28,.735,.045],backOut:[.175,.885,.32,1.275],backInOut:[.68,-.55,.265,1.55]};return easingMap[easing]||easingMap.easeOut;};const getAnimationVariants=()=>{const enterVariants={fade:{opacity:0},slideUp:{opacity:0,y:20},scale:{opacity:0,scale:.8},bounce:{opacity:0,scale:.3,y:20}};const exitVariants={fade:{opacity:0},slideDown:{opacity:0,y:20},scale:{opacity:0,scale:.8},bounce:{opacity:0,scale:.3,y:20}};return{initial:enterVariants[enterAnimation],animate:{opacity:1,y:0,scale:1},exit:exitVariants[exitAnimation]};};if(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{...getPositionStyles(),width:`${size}px`,height:`${size}px`,backgroundColor,borderRadius:`${borderRadius}px`,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:showShadow?\"0 4px 12px rgba(0, 0, 0, 0.15)\":\"none\",cursor:\"pointer\"},children:/*#__PURE__*/_jsx(\"svg\",{width:size*.4,height:size*.4,viewBox:\"0 0 256 256\",fill:iconColor,children:/*#__PURE__*/_jsx(\"path\",{d:\"M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z\"})})});}const variants=getAnimationVariants();return /*#__PURE__*/_jsx(_Fragment,{children:isVisible&&/*#__PURE__*/_jsx(motion.button,{initial:variants.initial,animate:variants.animate,exit:variants.exit,transition:{duration:animationDuration,ease:isVisible?getEasingFunction(enterEasing):getEasingFunction(exitEasing)},onClick:scrollToTop,style:{...getPositionStyles(),width:`${size}px`,height:`${size}px`,backgroundColor,border:\"none\",borderRadius:`${borderRadius}px`,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:showShadow?\"0 4px 12px rgba(0, 0, 0, 0.15)\":\"none\",cursor:\"pointer\",outline:\"none\"},whileHover:{scale:1.05},whileTap:{scale:.95},\"aria-label\":\"Volver arriba\",children:/*#__PURE__*/_jsx(\"svg\",{width:size*.4,height:size*.4,viewBox:\"0 0 256 256\",fill:iconColor,children:/*#__PURE__*/_jsx(\"path\",{d:\"M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z\"})})})});}addPropertyControls(ScrollToTopButton,{showAfterScroll:{type:ControlType.Number,title:\"Mostrar despu\\xe9s de scroll\",defaultValue:300,min:0,max:1e3,step:50,unit:\"px\"},position:{type:ControlType.Enum,title:\"Posici\\xf3n\",options:[\"bottom-right\",\"bottom-left\",\"bottom-center\"],optionTitles:[\"Abajo derecha\",\"Abajo izquierda\",\"Abajo centro\"],defaultValue:\"bottom-right\",displaySegmentedControl:true},backgroundColor:{type:ControlType.Color,title:\"Color de fondo\",defaultValue:\"#000000\"},iconColor:{type:ControlType.Color,title:\"Color del icono\",defaultValue:\"#FFFFFF\"},size:{type:ControlType.Number,title:\"Tama\\xf1o\",defaultValue:56,min:40,max:80,step:4,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Radio del borde\",defaultValue:28,min:0,max:40,step:2,unit:\"px\"},showShadow:{type:ControlType.Boolean,title:\"Mostrar sombra\",defaultValue:true,enabledTitle:\"S\\xed\",disabledTitle:\"No\"},animationDuration:{type:ControlType.Number,title:\"Duraci\\xf3n de animaci\\xf3n\",defaultValue:.3,min:.1,max:1,step:.1,unit:\"s\"},enterEasing:{type:ControlType.Enum,title:\"Easing de entrada\",options:[\"linear\",\"easeIn\",\"easeOut\",\"easeInOut\",\"circIn\",\"circOut\",\"circInOut\",\"backIn\",\"backOut\",\"backInOut\"],optionTitles:[\"Linear\",\"Ease In\",\"Ease Out\",\"Ease In Out\",\"Circ In\",\"Circ Out\",\"Circ In Out\",\"Back In\",\"Back Out\",\"Back In Out\"],defaultValue:\"easeOut\"},exitEasing:{type:ControlType.Enum,title:\"Easing de salida\",options:[\"linear\",\"easeIn\",\"easeOut\",\"easeInOut\",\"circIn\",\"circOut\",\"circInOut\",\"backIn\",\"backOut\",\"backInOut\"],optionTitles:[\"Linear\",\"Ease In\",\"Ease Out\",\"Ease In Out\",\"Circ In\",\"Circ Out\",\"Circ In Out\",\"Back In\",\"Back Out\",\"Back In Out\"],defaultValue:\"easeIn\"},enterAnimation:{type:ControlType.Enum,title:\"Animaci\\xf3n de entrada\",options:[\"fade\",\"slideUp\",\"scale\",\"bounce\"],optionTitles:[\"Desvanecer\",\"Deslizar arriba\",\"Escalar\",\"Rebotar\"],defaultValue:\"slideUp\",displaySegmentedControl:true},exitAnimation:{type:ControlType.Enum,title:\"Animaci\\xf3n de salida\",options:[\"fade\",\"slideDown\",\"scale\",\"bounce\"],optionTitles:[\"Desvanecer\",\"Deslizar abajo\",\"Escalar\",\"Rebotar\"],defaultValue:\"slideDown\",displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollToTopButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollToTopButton.map"],"mappings":"8QAIG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,kBAAgB,IAAI,WAAS,eAAe,kBAAgB,UAAU,YAAU,UAAU,OAAK,GAAG,eAAa,GAAG,aAAW,GAAK,oBAAkB,GAAG,cAAY,UAAU,aAAW,SAAS,iBAAe,UAAU,gBAAc,aAAa,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAS,GAAqB,CAAC,MAAc,CAAC,GAAG,GAAiB,IAAS,OAAY,OAAO,IAAM,MAAiB,CAAC,IAAM,EAAU,EAAO,aAAa,SAAS,gBAAgB,UAAU,MAAoB,CAAC,EAAa,EAAU,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