{"version":3,"file":"PhoneInput.DphjP_LI.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/FxQvIfPxHJq2ZfikrmdH/f11K43nexdppagUHQItp/PhoneInput.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useState}from\"react\";const countries=[{code:\"+55\",flag:\"🇧🇷\",name:\"Brazil\"},{code:\"+49\",flag:\"🇩🇪\",name:\"Germany\"},{code:\"+33\",flag:\"🇫🇷\",name:\"France\"},{code:\"+34\",flag:\"🇪🇸\",name:\"Spain\"},{code:\"+39\",flag:\"🇮🇹\",name:\"Italy\"},{code:\"+31\",flag:\"🇳🇱\",name:\"Netherlands\"},{code:\"+351\",flag:\"🇵🇹\",name:\"Portugal\"},{code:\"+44\",flag:\"🇬🇧\",name:\"United Kingdom\"},{code:\"+1\",flag:\"🇺🇸\",name:\"United States\"}];export default function PhoneInput(props){const{font,background,borderRadius,borderColor,textColor,placeholderColor,dropdownBackground,hoverColor,dividerColor,style,placeholder,label,isRequired,labelColor,requiredColor,labelFont,labelSpacing}=props;const[isOpen,setIsOpen]=useState(false);const[selectedCountry,setSelectedCountry]=useState(countries[0]);const[phoneNumber,setPhoneNumber]=useState(\"\");const formatPhoneNumber=value=>{const numbers=value.replace(/\\D/g,\"\");if(numbers.length<=11){return numbers.replace(/(\\d{2})(\\d{5})(\\d{4})/,\"($1) $2-$3\");}return numbers;};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",...style},children:[/*#__PURE__*/_jsxs(\"label\",{style:{display:\"block\",marginBottom:labelSpacing,color:labelColor,...labelFont},children:[label,isRequired&&/*#__PURE__*/_jsx(\"span\",{style:{color:requiredColor,marginLeft:\"4px\"},children:\"*\"})]}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:\"flex\",alignItems:\"center\",backgroundColor:background,borderRadius:borderRadius,padding:\"8px 12px\",border:`1px solid ${borderColor}`},children:[/*#__PURE__*/_jsxs(motion.div,{style:{display:\"flex\",alignItems:\"center\",gap:\"4px\",cursor:\"pointer\",padding:\"4px 8px\",borderRight:`1px solid ${dividerColor}`},whileHover:{opacity:.8},onClick:()=>setIsOpen(!isOpen),children:[/*#__PURE__*/_jsx(\"span\",{children:selectedCountry.flag}),/*#__PURE__*/_jsx(\"span\",{style:{color:textColor},children:selectedCountry.code})]}),/*#__PURE__*/_jsx(\"input\",{type:\"tel\",name:\"Whatsapp\",value:phoneNumber,onChange:event=>setPhoneNumber(formatPhoneNumber(event.target.value)),placeholder:placeholder,style:{flex:1,background:\"none\",border:\"none\",color:textColor,padding:\"4px 8px\",outline:\"none\",...font,\"::placeholder\":{color:placeholderColor}}})]}),isOpen&&/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},style:{position:\"absolute\",top:\"100%\",left:0,width:\"100%\",backgroundColor:dropdownBackground,borderRadius:borderRadius,marginTop:\"4px\",boxShadow:\"0 2px 8px rgba(0,0,0,0.2)\",zIndex:1e3,maxHeight:\"200px\",overflowY:\"auto\",border:`1px solid ${borderColor}`},children:countries.map(country=>/*#__PURE__*/_jsxs(motion.div,{style:{padding:\"8px 12px\",display:\"flex\",alignItems:\"center\",gap:\"8px\",cursor:\"pointer\",color:textColor,...font},whileHover:{backgroundColor:hoverColor},onClick:()=>{setSelectedCountry(country);setIsOpen(false);},children:[/*#__PURE__*/_jsx(\"span\",{children:country.flag}),/*#__PURE__*/_jsx(\"span\",{children:country.code}),/*#__PURE__*/_jsx(\"span\",{children:country.name})]},country.code))})]});}PhoneInput.defaultProps={background:\"#1E1E1E\",borderRadius:4,borderColor:\"rgba(255,255,255,0.1)\",textColor:\"#FFFFFF\",placeholderColor:\"rgba(255,255,255,0.5)\",dropdownBackground:\"#1E1E1E\",hoverColor:\"rgba(255,255,255,0.1)\",dividerColor:\"rgba(255,255,255,0.1)\",placeholder:\"(12) 12345-1234\",font:{fontSize:16,fontFamily:\"Inter\",fontWeight:400},label:\"WhatsApp de contato\",isRequired:true,labelColor:\"#FFFFFF\",requiredColor:\"#FF0000\",labelFont:{fontSize:14,fontFamily:\"Inter\",fontWeight:400,lineHeight:1.5},labelSpacing:8};addPropertyControls(PhoneInput,{font:{type:ControlType.Object,title:\"Input Font\",controls:{fontSize:{type:ControlType.Number,title:\"Size\",min:8,max:96,unit:\"px\"},fontFamily:{type:ControlType.String,title:\"Family\",defaultValue:\"Inter\"},fontWeight:{type:ControlType.Enum,title:\"Weight\",options:[100,200,300,400,500,600,700,800,900],defaultValue:400}}},background:{type:ControlType.Color,title:\"Background\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",min:0,max:100,unit:\"px\"},borderColor:{type:ControlType.Color,title:\"Border Color\"},textColor:{type:ControlType.Color,title:\"Text Color\"},placeholderColor:{type:ControlType.Color,title:\"Placeholder Color\"},dropdownBackground:{type:ControlType.Color,title:\"Dropdown Background\"},hoverColor:{type:ControlType.Color,title:\"Hover Color\"},dividerColor:{type:ControlType.Color,title:\"Divider Color\"},placeholder:{type:ControlType.String,title:\"Placeholder\"},label:{type:ControlType.String,title:\"Label Text\",defaultValue:\"WhatsApp de contato\"},isRequired:{type:ControlType.Boolean,title:\"Required\",defaultValue:true},labelColor:{type:ControlType.Color,title:\"Label Color\"},requiredColor:{type:ControlType.Color,title:\"Required Asterisk Color\"},labelFont:{type:ControlType.Object,title:\"Label Font\",controls:{fontSize:{type:ControlType.Number,title:\"Size\",min:8,max:96,unit:\"px\"},fontFamily:{type:ControlType.String,title:\"Family\",defaultValue:\"Inter\"},fontWeight:{type:ControlType.Enum,title:\"Weight\",options:[100,200,300,400,500,600,700,800,900],defaultValue:400},lineHeight:{type:ControlType.Number,title:\"Line Height\",min:.5,max:3,step:.1,defaultValue:1.5}}},labelSpacing:{type:ControlType.Number,title:\"Label Spacing\",min:0,max:100,unit:\"px\",defaultValue:8}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"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