{"version":3,"file":"State_Tracking.Bials4Rf.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":"mKAEA,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,EAAa,EAC9I,EAAM,SAAS,EAAM,SAAS,EAAI,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,EAAY,CAAC,EACvG,SAAgB,EAAiB,EAAU,CAAC,MAAO,IAAO,CAAC,IAAM,MAAgB,CACjF,QAAQ,IAAI,2BAA2B,EAAa,CACjD,EAAM,SAAS,EAAM,SAAS,EAAI,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAM,QAAQ,EAAY,CAAC,EACvG,SAAgB,EAAoB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAM,GAAUA,EAAS,GAAc,GAAG,CAE9G,OAF+G,MAAc,CAC1H,IAAc,QAAQ,IAAI,yBAAyB,EAAa,CAAC,EAAS,EAAa,GAAI,EAAE,CAAC,CAC7E,EAAK,EAAU,CAAC,GAAG,EAAY,QAAM,aAAa,EAAM,SAAS,GAAG,CACrF,EAAM,UAAU,EAAM,SAAS,EAAE,EAAI,CAAC,EACzC,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAY,GAAgBC,EAAe,GAAc,mBAAmB,CACrF,OADsF,MAAc,CAC3J,EAAe,GAAc,mBAAmB,EAAG,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,KAAK,EAAY,CAAC,qBAb3E,IAAsC,CAC7E,EAAa"}