{"version":3,"file":"GetStartedForm.DF3BR9cX.mjs","names":[],"sources":["https:/framerusercontent.com/modules/TVBfnewMrO99AsqkexAX/mGs6XLYPUY7BYfRghLAh/GetStartedForm.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Message Launcher with reliable typewriter placeholders\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function GetStartedForm(props){const{placeholders,background,textColor,inputBorderColor,font,inputBorderRadius,buttonColor,buttonSize,glyphColor,glyphSize,paddingTop,paddingRight,paddingBottom,paddingLeft,style}=props;const[value,setValue]=useState(\"\");const[index,setIndex]=useState(0);const[displayed,setDisplayed]=useState(\"\");useEffect(()=>{if(!placeholders.length)return;let charIndex=0;const current=placeholders[index]||\"\";const typeSpeed=100// ms per char\n;const pause=2e3// ms pause after full text\n;let timer;function typeStep(){setDisplayed(current.substring(0,charIndex+1));charIndex++;if(charIndex<current.length){timer=setTimeout(typeStep,typeSpeed);}else{timer=setTimeout(()=>{setIndex(i=>(i+1)%placeholders.length);},pause);}}typeStep();return()=>clearTimeout(timer);},[index,placeholders]);function handleSubmit(e){if(e)e.preventDefault();if(!value.trim())return;const msg=encodeURIComponent(value.trim());const url=`https://app.town.com/ask?q=${msg}`;if(typeof window!==\"undefined\"){window.open(url,\"_blank\");}}const extraRight=buttonSize+8;// allow Enter key on the div \"button\" for accessibility\nfunction handleKeyDownOnFakeButton(e){if(e.key===\"Enter\"||e.key===\" \"){e.preventDefault();handleSubmit();}}return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",position:\"relative\",background,borderRadius:inputBorderRadius},children:/*#__PURE__*/_jsxs(\"form\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",padding:0,position:\"relative\"},onSubmit:handleSubmit,children:[!value&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",pointerEvents:\"none\",display:\"flex\",alignItems:\"center\",padding:`${paddingTop}px ${paddingRight+extraRight}px ${paddingBottom}px ${paddingLeft}px`,...font,color:textColor,whiteSpace:\"nowrap\",overflow:\"hidden\"},children:displayed}),/*#__PURE__*/_jsx(\"input\",{type:\"text\",className:\"get-started-input\",value:value,onChange:e=>startTransition(()=>setValue(e.target.value)),placeholder:\"\",style:{width:\"100%\",padding:`${paddingTop}px ${paddingRight+extraRight}px ${paddingBottom}px ${paddingLeft}px`,border:`1px solid ${inputBorderColor}`,borderRadius:inputBorderRadius,...font,color:textColor,background:\"#fff\",outline:\"none\"},\"aria-label\":\"Message\"}),/*#__PURE__*/_jsx(\"div\",{role:\"button\",tabIndex:0,onClick:()=>handleSubmit(),onKeyDown:handleKeyDownOnFakeButton,style:{position:\"absolute\",top:\"50%\",right:paddingRight+4,transform:\"translateY(-50%)\",width:buttonSize,height:buttonSize,border:\"none\",borderRadius:\"50%\",background:buttonColor,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:0,paddingLeft:5},\"aria-label\":\"Submit Message\",children:/*#__PURE__*/_jsx(\"svg\",{width:buttonSize*glyphSize,height:buttonSize*glyphSize,viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",\"aria-hidden\":\"true\",focusable:\"false\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M9 6l6 6-6 6\",stroke:glyphColor,strokeWidth:1,strokeLinecap:\"round\",strokeLinejoin:\"round\"})})})]})});}addPropertyControls(GetStartedForm,{placeholders:{type:ControlType.Array,title:\"Placeholders\",propertyControl:{type:ControlType.String,title:\"Text\"},defaultValue:[\"Type your message...\",\"Say hello!\",\"Enter your query...\",\"What's on your mind?\"]},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},inputBorderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#EEEEEE\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},inputBorderRadius:{type:ControlType.Number,title:\"Input Radius\",defaultValue:8,min:0,max:200},paddingTop:{type:ControlType.Number,title:\"Padding Top\",defaultValue:10,min:0,max:100},paddingRight:{type:ControlType.Number,title:\"Padding Right\",defaultValue:14,min:0,max:100},paddingBottom:{type:ControlType.Number,title:\"Padding Bottom\",defaultValue:10,min:0,max:100},paddingLeft:{type:ControlType.Number,title:\"Padding Left\",defaultValue:14,min:0,max:100},buttonSize:{type:ControlType.Number,title:\"Button Size\",defaultValue:69,min:24,max:200},buttonColor:{type:ControlType.Color,title:\"Button Color\",defaultValue:\"#111111\"},glyphColor:{type:ControlType.Color,title:\"Glyph Color\",defaultValue:\"#FFFFFF\"},glyphSize:{type:ControlType.Number,title:\"Glyph Size\",defaultValue:.5,min:.1,max:2,step:.1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GetStartedForm\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GetStartedForm.map"],"mappings":"gUAKG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,eAAa,aAAW,YAAU,mBAAiB,OAAK,oBAAkB,cAAY,aAAW,aAAW,YAAU,aAAW,eAAa,gBAAc,cAAY,QAAM,CAAC,EAAW,CAAC,EAAM,EAAS,CAAC,EAAS,GAAG,CAAM,CAAC,EAAM,EAAS,CAAC,EAAS,EAAE,CAAM,CAAC,EAAU,EAAa,CAAC,EAAS,GAAG,CAAC,EAAU,IAAI,CAAC,IAAI,EAAa,OAAO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