{"version":3,"file":"article.DbAL4Z2Q.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/9eCJbTOpT6dnKS9jwef6/nAsnSsYmknJDxOw3YTpk/article.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Article(props){const{buttonText,placeHolder,url}=props;const[topic,setTopic]=useState(\"\");useEffect(()=>{const style=document.createElement(\"style\");style.innerHTML=`\n            form {\n                width: 100% !important;\n                max-width: 700px !important;\n                margin: auto;\n                background: #ffffff;\n                border: 1px solid #D2DCE7;\n                box-shadow: 3px 3px 20px 0px rgba(46, 66, 255, 0.15);\n                padding: 3px;\n                display: flex;\n                border-radius: 10px;\n                flex-direction: row;\n                gap: 15px;\n            }\n\n            @media (max-width: 600px) {\n                form {\n                    width: 480px !important;\n                }\n            }\n\n            @media (max-width: 480px) {\n                form {\n                    flex-direction: column !important;\n                    width: 100% !important;\n                }\n\n                button {\n                    width: 100% !important;\n                }\n            }\n        `;document.head.appendChild(style);return()=>{document.head.removeChild(style);};},[]);const handleSubmit=event=>{event.preventDefault();if(topic.trim()){// Replace placeholder in URL with encoded topic\nconst finalUrl=url.replace(\"${encodeURIComponent(topic)}\",encodeURIComponent(topic));window.open(finalUrl,\"_blank\");}else{alert(\"Please enter a valid topic.\");}};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"form\",{onSubmit:handleSubmit,children:[/*#__PURE__*/_jsx(\"input\",{type:\"text\",value:topic,onChange:e=>setTopic(e.target.value),placeholder:placeHolder,style:inputStyle,required:true}),/*#__PURE__*/_jsx(\"button\",{type:\"submit\",style:buttonStyle,children:buttonText})]}),/*#__PURE__*/_jsx(\"style\",{children:`\n                input::placeholder {\n                    color: #B9C2CC;\n                }\n                input:focus {\n                    outline: none;\n                    background: #ffffff;\n                }\n            `})]});}const inputStyle={fontFamily:\"Inter, sans-serif\",fontSize:\"18px\",fontWeight:\"400\",lineHeight:\"24px\",letterSpacing:\"-0.03em\",textAlign:\"left\",color:\"#000000\",border:\"0px solid #e7edf4\",borderRadius:\"4px\",flexGrow:1,background:\"#ffffff\",padding:\"10px 15px\"};const buttonStyle={background:\"linear-gradient(110.37deg, #963FFF -9.83%, #2E42FF 91.64%)\",padding:\"13px 20px\",fontFamily:\"Inter, sans-serif\",fontSize:\"16px\",fontWeight:\"600\",lineHeight:\"23px\",letterSpacing:\"-0.03em\",textAlign:\"center\",color:\"#ffffff\",border:\"none\",borderRadius:\"4px\",cursor:\"pointer\"};// Add property controls for Framer\naddPropertyControls(Article,{buttonText:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Generate Article\"},url:{type:ControlType.String,title:\"URL\",defaultValue:\"https://app.gravitywrite.com/blog-writer?title=${encodeURIComponent(topic)}\"},placeHolder:{type:ControlType.String,title:\"Placeholder\",defaultValue:\"Enter Your Blog Title\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Article\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./article.map"],"mappings":"8MAMG,SAAwB,EAAQ,EAAM,CAAC,GAAK,CAAC,aAAW,cAAY,OAAK,EAAW,CAAC,EAAM,GAAUA,EAAS,GAAG,CAgC8C,OAhC7C,MAAc,CAAC,IAAM,EAAM,SAAS,cAAc,QAAQ,CA+BpI,MA/BqI,GAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA+BtL,SAAS,KAAK,YAAY,EAAM,KAAW,CAAC,SAAS,KAAK,YAAY,EAAM,GA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