{"version":3,"file":"State_Tracking.iBL7Prex.mjs","names":["useState","React.useState"],"sources":["https:/framerusercontent.com/modules/k0w6DBqepgENkDzb1Y8b/K8Ej1N5A3NrDjnGIf5UT/State_Tracking.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import*as React from\"react\";// Shared state to persist across pages\nlet selectedSite=null;// 1. Apply to each site card/image in your gallery\nexport function withSiteClick(Component){return props=>{const handleClick=()=>{// Extract site number from Title variable or text\nconst siteText=props.title||props.Title||props.text||props.children;if(siteText){selectedSite=siteText;console.log(\"Site selected:\",selectedSite);}// Continue with normal navigation\nif(props.onClick){props.onClick();}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick});};}// 2. Apply to \"RESERVE NOW\" button on the detail page\nexport function withReserveClick(Component){return props=>{const handleClick=()=>{// The site is already stored from the gallery click\nconsole.log(\"Proceeding to form with:\",selectedSite);// Continue with normal navigation\nif(props.onClick){props.onClick();}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick});};}// 3. Apply to a hidden text field or input on your form\nexport function withHiddenSiteField(Component){return props=>{const[value,setValue]=useState(selectedSite||\"\");useEffect(()=>{// Auto-populate when form loads\nif(selectedSite){console.log(\"Form loaded with site:\",selectedSite);setValue(selectedSite);}},[]);// Force the value and also set defaultValue\nreturn /*#__PURE__*/_jsx(Component,{...props,value:value,defaultValue:value,onChange:e=>{// Prevent user from changing it if it's hidden\nif(props.onChange){props.onChange(e);}}});};}// 4. Apply to a visible text element to show the site (optional)\nexport function withSiteDisplay(Component){return props=>{const[displayText,setDisplayText]=React.useState(selectedSite||\"No site selected\");useEffect(()=>{// Update the display whenever the component mounts\nsetDisplayText(selectedSite||\"No site selected\");},[]);return /*#__PURE__*/_jsx(Component,{...props,text:displayText});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withSiteClick\":{\"type\":\"reactHoc\",\"name\":\"withSiteClick\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHiddenSiteField\":{\"type\":\"reactHoc\",\"name\":\"withHiddenSiteField\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withReserveClick\":{\"type\":\"reactHoc\",\"name\":\"withReserveClick\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSiteDisplay\":{\"type\":\"reactHoc\",\"name\":\"withSiteDisplay\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./State_Tracking.map"],"mappings":"yHAEA,SAAgB,EAAc,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,MAAgB,CAC9E,IAAM,EAAS,EAAM,OAAO,EAAM,OAAO,EAAM,MAAM,EAAM,SAAY,IAAU,EAAa,EAAS,QAAQ,IAAI,iBAAiB,CAAY,GAC7I,EAAM,SAAS,EAAM,QAAQ,CAAG,EAAE,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,CAAW,CAAC,CAAE,CAAE,CAC1G,SAAgB,EAAiB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,MAAgB,CACjF,QAAQ,IAAI,2BAA2B,CAAY,EAChD,EAAM,SAAS,EAAM,QAAQ,CAAG,EAAE,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,CAAW,CAAC,CAAE,CAAE,CAC1G,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAM,GAAUA,EAAS,GAAc,EAAE,EAE7G,OAF+G,MAAc,CAC1H,IAAc,QAAQ,IAAI,yBAAyB,CAAY,EAAE,EAAS,CAAY,EAAG,EAAE,CAAC,CAAC,EAC5E,EAAK,EAAU,CAAC,GAAG,EAAY,QAAM,aAAa,EAAM,SAAS,GAAG,CACrF,EAAM,UAAU,EAAM,SAAS,CAAC,CAAG,CAAC,CAAC,CAAE,CAAE,CAC5C,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAY,GAAgBC,EAAe,GAAc,kBAAkB,EACpF,OADsF,MAAc,CAC3J,EAAe,GAAc,kBAAkB,CAAE,EAAE,CAAC,CAAC,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAM,KAAK,CAAW,CAAC,CAAE,CAAE,mBAb/E,IAAsC,EAC5E,EAAa"}