{"version":3,"file":"ApplyRedirect.CInyYMyf.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/GHBC1zBnyYtxgHtBNWDG/QszyI4x2c1uDnKdZ0RIE/ApplyRedirect.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function ApplyRedirect(props){const{packageName,type,text,background,fontFamily,fontWeight,fontSize,padding,boxShadow,textColor,primaryColor,maxWidth,scriptUrl,title,targetPage}=props;const[windowWidth,setWindowWidth]=useState(0);// Responsive resize handler\nuseEffect(()=>{const handleResize=()=>setWindowWidth(window.innerWidth);if(typeof window!==\"undefined\"){handleResize();window.addEventListener(\"resize\",handleResize);return()=>window.removeEventListener(\"resize\",handleResize);}},[]);const getServiceSlug=()=>{if(typeof window===\"undefined\")return\"\";return window.location.pathname.split(\"/\").pop()||\"\";};const handleClick=()=>{if(typeof window===\"undefined\")return;const service=getServiceSlug();const params=new URLSearchParams;// Always add service if available (tracks which page user came from)\nif(service)params.set(\"service\",service);// Only add package if packageName prop is set and non-empty\nif(packageName&&packageName.trim())params.set(\"package\",packageName.trim());const query=params.toString()?`?${params.toString()}`:\"\";if(targetPage){window.location.href=`${targetPage}${query}`;}};return /*#__PURE__*/_jsx(\"div\",{onClick:handleClick,style:{padding:padding,background,color:textColor,borderRadius:\"12px\",textAlign:\"center\",cursor:\"pointer\",fontFamily,fontWeight,fontSize:`${fontSize}px`,userSelect:\"none\",boxShadow:boxShadow,transition:\"all 0.2s ease\",width:\"100%\",maxWidth:maxWidth},children:text});}addPropertyControls(ApplyRedirect,{targetPage:{type:ControlType.Link,title:\"Target Page\"},type:{type:ControlType.Enum,title:\"Type\",options:[\"get-quote\",\"post-requirements\"],defaultValue:\"get-quote\"},packageName:{type:ControlType.String,title:\"Package Name\",defaultValue:\"\"},text:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Choose Plan\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#ffffff\"},background:{type:ControlType.Color,title:\"Background\",defaultValue:\"#8b5cf6\"},primaryColor:{type:ControlType.Color,title:\"Form Primary Color\",defaultValue:\"#8b5cf6\"},scriptUrl:{type:ControlType.String,title:\"Apps Script URL\",defaultValue:\"\",placeholder:\"Paste your deployed Apps Script URL\"},title:{type:ControlType.String,title:\"Title\",defaultValue:null,placeholder:\"Custom Title\"},fontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Inter, sans-serif\"},fontWeight:{type:ControlType.Enum,title:\"Font Weight\",options:[\"400\",\"500\",\"600\",\"700\",\"800\"],defaultValue:\"600\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:10,max:40,step:1},padding:{type:ControlType.String,title:\"Padding\",defaultValue:\"clamp(12px, 2.5vw, 16px) clamp(16px, 3vw, 20px)\",placeholder:\"e.g. 16px 24px or clamp(12px, 2vw, 20px)\",description:\"Use CSS padding format (top/bottom left/right). Supports px, %, rem, or clamp().\"},boxShadow:{type:ControlType.String,title:\"Box Shadow\",defaultValue:\"0 4px 12px rgba(0,0,0,0.15)\",placeholder:\"e.g. 0 4px 12px rgba(0,0,0,0.1) or none\",description:\"Use CSS box-shadow format: offset-x offset-y blur spread color. Enter 'none' to remove the shadow.\"},maxWidth:{type:ControlType.String,title:\"MaxWidth\",defaultValue:\"300px\",placeholder:\"e.g. 300px - Supports px, %, rem, or clamp().\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ApplyRedirect\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ApplyRedirect.map"],"mappings":"gMAAqI,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,cAAY,OAAK,OAAK,aAAW,aAAW,aAAW,WAAS,UAAQ,YAAU,YAAU,eAAa,WAAS,YAAU,QAAM,cAAY,EAAW,CAAC,EAAY,GAAgBA,EAAS,E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