{"version":3,"file":"WhatsAppChatButton.Dmc-aD80.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/sctJakTPhnUZTwStB4C0/E0ajxRxFT377zzfKP62D/WhatsAppChatButton.js"],"sourcesContent":["// WhatsApp button with popup, matching attached image\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * WhatsApp Button with Popup\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 300\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function WhatsAppChatButton(props){const{label,background,iconColor,popupBackground,popupTextColor,font,closeColor,useCustomIcon,customIcon={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"WhatsApp Icon\"},phoneNumber,iconSize,customMessage,position,showBubble,includePageUrl,openInNewTab,labelAlign,style}=props;const[open,setOpen]=useState(true);// WhatsApp SVG\nconst whatsappSVG=/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 16 16\",fill:iconColor,\"aria-label\":\"WhatsApp\",style:{display:\"block\"},children:/*#__PURE__*/_jsx(\"path\",{d:\"M13.601 2.326A7.85 7.85 0 0 0 7.994 0C3.627 0 .068 3.558.064 7.926c0 1.399.366 2.76 1.057 3.965L0 16l4.204-1.102a7.9 7.9 0 0 0 3.79.965h.004c4.368 0 7.926-3.558 7.93-7.93A7.9 7.9 0 0 0 13.6 2.326zM7.994 14.521a6.6 6.6 0 0 1-3.356-.92l-.24-.144-2.494.654.666-2.433-.156-.251a6.56 6.56 0 0 1-1.007-3.505c0-3.626 2.957-6.584 6.591-6.584a6.56 6.56 0 0 1 4.66 1.931 6.56 6.56 0 0 1 1.928 4.66c-.004 3.639-2.961 6.592-6.592 6.592m3.615-4.934c-.197-.099-1.17-.578-1.353-.646-.182-.065-.315-.099-.445.099-.133.197-.513.646-.627.775-.114.133-.232.148-.43.05-.197-.1-.836-.308-1.592-.985-.59-.525-.985-1.175-1.103-1.372-.114-.198-.011-.304.088-.403.087-.088.197-.232.296-.346.1-.114.133-.198.198-.33.065-.134.034-.248-.015-.347-.05-.099-.445-1.076-.612-1.47-.16-.389-.323-.335-.445-.34-.114-.007-.247-.007-.38-.007a.73.73 0 0 0-.529.247c-.182.198-.691.677-.691 1.654s.71 1.916.81 2.049c.098.133 1.394 2.132 3.383 2.992.47.205.84.326 1.129.418.475.152.904.129 1.246.08.38-.058 1.171-.48 1.338-.943.164-.464.164-.86.114-.943-.049-.084-.182-.133-.38-.232\"})});// Close (X) SVG\nconst closeSVG=/*#__PURE__*/_jsxs(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",\"aria-label\":\"Close\",style:{display:\"block\"},children:[/*#__PURE__*/_jsx(\"circle\",{cx:\"12\",cy:\"12\",r:\"12\",fill:closeColor}),/*#__PURE__*/_jsx(\"path\",{d:\"M8 8l8 8M16 8l-8 8\",stroke:\"#fff\",strokeWidth:\"1.5\",strokeLinecap:\"round\"})]});return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:position===\"left\"?\"flex-start\":position===\"right\"?\"flex-end\":\"center\",justifyContent:\"center\"},children:[open&&showBubble&&/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:\"12px\",marginBottom:\"20px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{background:popupBackground,color:popupTextColor,borderRadius:20,padding:\"12px 16px\",fontSize:font.fontSize,fontWeight:font.variant===\"Bold\"?700:font.variant===\"Semibold\"?600:400,letterSpacing:font.letterSpacing,lineHeight:font.lineHeight,wordWrap:\"break-word\",overflowWrap:\"break-word\",maxWidth:\"200px\",textAlign:labelAlign,...font},children:/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:font.fontFamily,fontSize:font.fontSize},children:label})}),/*#__PURE__*/_jsx(\"button\",{\"aria-label\":\"Close\",style:{background:\"none\",border:\"none\",padding:0,cursor:\"pointer\",width:24,height:24,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",flexShrink:0},onClick:()=>startTransition(()=>setOpen(false)),children:closeSVG})]}),/*#__PURE__*/_jsx(\"button\",{\"aria-label\":\"Chat on WhatsApp\",style:{width:60,height:60,borderRadius:\"50%\",background:background,border:\"none\",boxShadow:\"0 4px 16px rgba(0,0,0,0.12)\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",transition:\"box-shadow 0.2s\",overflow:\"hidden\"},onClick:()=>{let message=customMessage||\"\";// Add current page URL if option is enabled\nif(includePageUrl&&typeof window!==\"undefined\"){const currentUrl=window.location.href;message=message?`${message} ${currentUrl}`:currentUrl;}if(phoneNumber){const cleanNumber=phoneNumber.replace(/\\D/g,\"\");const encodedMessage=message?encodeURIComponent(message):\"\";const url=encodedMessage?`https://wa.me/${cleanNumber}?text=${encodedMessage}`:`https://wa.me/${cleanNumber}`;if(openInNewTab){window.open(url,\"_blank\",\"noopener,noreferrer\");}else{window.location.href=url;}}else{// If no phone number, open WhatsApp web with just the message\nconst encodedMessage=message?encodeURIComponent(message):\"\";const url=encodedMessage?`https://web.whatsapp.com/send?text=${encodedMessage}`:\"https://web.whatsapp.com\";if(openInNewTab){window.open(url,\"_blank\",\"noopener,noreferrer\");}else{window.location.href=url;}}},children:useCustomIcon?/*#__PURE__*/_jsx(\"img\",{src:customIcon.src,alt:customIcon.alt,style:{width:`${iconSize}px`,height:`${iconSize}px`,objectFit:\"cover\",borderRadius:\"50%\"}}):whatsappSVG})]});}addPropertyControls(WhatsAppChatButton,{showBubble:{type:ControlType.Boolean,title:\"Show Bubble\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},position:{type:ControlType.Enum,title:\"Position\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",displaySegmentedControl:true},labelAlign:{type:ControlType.Enum,title:\"Label Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"left\",displaySegmentedControl:true},phoneNumber:{type:ControlType.String,title:\"Phone Number\",defaultValue:\"+917011369538\",placeholder:\"+1234567890\"},customMessage:{type:ControlType.String,title:\"Custom Message\",defaultValue:\"Hello! I am interested in\",placeholder:\"Hello! I'm interested in...\",displayTextArea:true},includePageUrl:{type:ControlType.Boolean,title:\"Include Page URL\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},openInNewTab:{type:ControlType.Boolean,title:\"Open in New Tab\",defaultValue:true,enabledTitle:\"New Tab\",disabledTitle:\"Same Tab\"},iconSize:{type:ControlType.Number,title:\"Icon Size\",defaultValue:30,min:16,max:48,step:2,unit:\"px\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Need our help?\"},background:{type:ControlType.Color,title:\"Button BG\",defaultValue:\"#25D366\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#FFFFFF\"},popupBackground:{type:ControlType.Color,title:\"Popup BG\",defaultValue:\"#F0F0F0\"},popupTextColor:{type:ControlType.Color,title:\"Popup Text\",defaultValue:\"#111111\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Regular\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},closeColor:{type:ControlType.Color,title:\"Close BG\",defaultValue:\"#111111\"},useCustomIcon:{type:ControlType.Boolean,title:\"Icon Type\",defaultValue:false,enabledTitle:\"Custom\",disabledTitle:\"Default\"},customIcon:{type:ControlType.ResponsiveImage,title:\"Custom Icon\",hidden:({useCustomIcon})=>!useCustomIcon}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WhatsAppChatButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"400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