{"version":3,"file":"FormSource.BEpGNNa3.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/ZkwMx64J91pICeuS1BLw/DwiDG49mkNNUriERJtTD/FormSource.js"],"sourcesContent":["// Form Source: adds where a submission came from (website, form and page) to the form it sits in.\n// Why code: Framer form submissions don't record the site or page they were sent from, and native inputs\n// can't be hidden or read the page address. Put one inside each form; nothing shows on the published page.\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function FormSource(props){const{siteName,formName,addDomain,sendPage,websiteField,formField,pageField}=props;const isStatic=useIsStaticRenderer();// The address is only known in the browser, so it's read after the page loads\nconst[where,setWhere]=useState({host:\"\",page:\"\"});useEffect(()=>{if(typeof window===\"undefined\")return;setWhere({host:window.location.hostname,page:window.location.pathname});},[]);const website=addDomain&&where.host?siteName?`${siteName} (${where.host})`:where.host:siteName;if(isStatic){return /*#__PURE__*/_jsx(\"span\",{style:{display:\"inline-block\",padding:\"2px 6px\",borderRadius:4,background:\"rgba(22,26,38,.06)\",color:\"#555A66\",font:\"11px/1.4 sans-serif\",whiteSpace:\"nowrap\"},children:`Source: ${[siteName,formName].filter(Boolean).join(\" \\xb7 \")}`});}return /*#__PURE__*/_jsxs(_Fragment,{children:[website?/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:websiteField,value:website,readOnly:true}):null,formName?/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:formField,value:formName,readOnly:true}):null,sendPage&&where.page?/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:pageField,value:where.page,readOnly:true}):null]});}FormSource.defaultProps={siteName:\"Ines Calder\",formName:\"Contact form\",addDomain:true,sendPage:true,websiteField:\"site\",formField:\"form\",pageField:\"page\"};addPropertyControls(FormSource,{siteName:{type:ControlType.String,title:\"Website\",description:\"Your site's name, sent with every submission\"},addDomain:{type:ControlType.Boolean,title:\"Add Domain\",enabledTitle:\"Yes\",disabledTitle:\"No\",description:\"Adds the address it was sent from, e.g. (inescalder.co.uk)\"},formName:{type:ControlType.String,title:\"Form\",description:\"Which form this is, e.g. Newsletter (footer)\"},sendPage:{type:ControlType.Boolean,title:\"Send Page\",enabledTitle:\"Yes\",disabledTitle:\"No\",description:\"Adds the page path, e.g. /journal/the-two-week-holiday-test\"},websiteField:{type:ControlType.String,title:\"Website Field\",description:'Not \"website\": Framer adds a hidden spam trap with that name'},formField:{type:ControlType.String,title:\"Form Field\"},pageField:{type:ControlType.String,title:\"Page Field\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FormSource\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FormSource.map"],"mappings":"2MAMG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,WAAS,WAAS,YAAU,WAAS,eAAa,YAAU,aAAW,EAAY,EAAS,EAAoB,EAC9J,CAAC,EAAM,GAAUA,EAAS,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC,EAAE,MAAc,CAAW,IAAS,QAAmB,EAAS,CAAC,KAAK,EAAO,SAAS,SAAS,KAAK,EAAO,SAAS,QAAQ,CAAC,CAAE,EAAE,CAAC,CAAC,EAAE,IAAM,EAAQ,GAAW,EAAM,KAAK,EAAS,GAAG,EAAS,IAAI,EAAM,KAAK,GAAG,EAAM,KAAK,EAAkS,OAAtR,EAA8B,EAAK,OAAO,CAAC,MAAM,CAAC,QAAQ,eAAe,QAAQ,UAAU,aAAa,EAAE,WAAW,qBAAqB,MAAM,UAAU,KAAK,sBAAsB,WAAW,QAAQ,EAAE,SAAS,WAAW,CAAC,EAAS,CAAQ,CAAC,CA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