{"version":3,"file":"Examples.B5NaPEwg.mjs","names":["useRef","useCallback"],"sources":["https:/framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js","https:/framer.com/m/framer/utils.js@^0.9.0","https:/framerusercontent.com/modules/jdgmuZ0J8ou0PCumLiHp/vW05iGhZ5i8Y0BPb8V5j/Examples.js"],"sourcesContent":["export const centerContent = {\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nexport const autoSizingText = {\n    width: \"max-content\",\n    wordBreak: \"break-word\",\n    overflowWrap: \"break-word\",\n    overflow: \"hidden\",\n    whiteSpace: \"pre-wrap\",\n    flexShrink: 0\n};\nexport const defaultContainerStyles = {\n    ...centerContent,\n    overflow: \"hidden\"\n};\nexport const containerStyles = defaultContainerStyles;\nexport const randomColor = ()=>\"#\" + Math.floor(Math.random() * 16777215).toString(16)\n;\n\nexport const __FramerMetadata__ = {\"exports\":{\"centerContent\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"autoSizingText\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultContainerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"randomColor\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./Utils.map","/*\n * Utils (framer/utils@0.9.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/28rXvpPsrum7FH6cMELS/1jCAazZw1EGHjrG5Nu5D/Utils.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useCallback,useEffect,useRef}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";// Learn more: https://www.framer.com/developers/overrides/\nconst useStore=createStore({background:\"#0099FF\"});export function withRotate(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,animate:{rotate:90},transition:{duration:2}});};}export function withHover(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,whileHover:{scale:1.05}});};}export function withRandomColor(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});};}export function withValidatedThankYouSubmit(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const inFlightRef=useRef(false);const handlePress=useCallback(async(event,originalHandler)=>{const target=event?.currentTarget;const form=target?.closest(\"form\");if(form){const isValid=typeof form.checkValidity===\"function\"?form.checkValidity():true;if(!isValid){event.preventDefault?.();event.stopPropagation?.();form.reportValidity?.();return;}event.preventDefault?.();if(inFlightRef.current)return;inFlightRef.current=true;try{const action=form.getAttribute(\"action\")||\"\";const method=(form.getAttribute(\"method\")||\"POST\").toUpperCase()||\"POST\";const formData=new FormData(form);if(target instanceof HTMLButtonElement||target instanceof HTMLInputElement){const fieldName=target.getAttribute(\"name\");if(fieldName&&!formData.has(fieldName)){formData.append(fieldName,target.getAttribute(\"value\")??\"\");}}const fetchOptions={method,credentials:\"same-origin\"};if(method===\"GET\"){const query=new URLSearchParams(formData).toString();const separator=action.includes(\"?\")?\"&\":\"?\";const response=await fetch(`${action}${query?`${separator}${query}`:\"\"}`,fetchOptions);if(!response.ok)return;}else{fetchOptions.body=formData;const response=await fetch(action,fetchOptions);if(!response.ok)return;}}catch(_error){return;}finally{inFlightRef.current=false;}}originalHandler?.(event);},[]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:event=>handlePress(event,props.onClick),onTap:event=>handlePress(event,props.onTap)});});}export function withPersistentThankYouForm(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const scheduledResetTimeoutsRef=useRef([]);const findClosestScrollableAncestor=useCallback(start=>{if(typeof window===\"undefined\"||!start)return null;let node=start.parentElement;while(node){const computedStyle=window.getComputedStyle(node);const overflowY=computedStyle.overflowY;const canScrollY=(overflowY===\"auto\"||overflowY===\"scroll\"||overflowY===\"overlay\")&&node.scrollHeight>node.clientHeight;if(canScrollY)return node;node=node.parentElement;}return null;},[]);const clearScheduledScrollResets=useCallback(()=>{if(typeof window===\"undefined\")return;for(const timeoutId of scheduledResetTimeoutsRef.current){window.clearTimeout(timeoutId);}scheduledResetTimeoutsRef.current=[];},[]);const resetAllRelevantScrollPositions=useCallback(initialScrollContainer=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const scrollTargets=new Set;scrollTargets.add(window);if(document.documentElement)scrollTargets.add(document.documentElement);if(document.body)scrollTargets.add(document.body);if(initialScrollContainer)scrollTargets.add(initialScrollContainer);const allElements=document.querySelectorAll(\"*\");for(const element of allElements){if(element.scrollTop<=0)continue;const computedStyle=window.getComputedStyle(element);const overflowY=computedStyle.overflowY;const canScrollY=(overflowY===\"auto\"||overflowY===\"scroll\"||overflowY===\"overlay\")&&element.scrollHeight>element.clientHeight;if(canScrollY){scrollTargets.add(element);}}for(const target of scrollTargets){try{target.scrollTo?.({top:0,behavior:\"auto\"});}catch(_error){// Ignore and continue so one failure does not block other targets.\n}if(target instanceof HTMLElement){target.scrollTop=0;}}},[]);useEffect(()=>{return()=>{clearScheduledScrollResets();};},[clearScheduledScrollResets]);const handleSubmit=useCallback(event=>{// Preserve Framer/native form transport by never cancelling submit here.\n// We only pass the event through so existing submit handlers can run.\nconst submitTarget=event?.target;const currentTarget=event?.currentTarget;const formCandidate=(submitTarget?.closest?.(\"form\"))||(currentTarget?.closest?.(\"form\"))||(currentTarget instanceof HTMLFormElement?currentTarget:null);const isLikelyValid=!formCandidate||typeof formCandidate.checkValidity!==\"function\"||formCandidate.checkValidity();if(isLikelyValid){const anchorElement=formCandidate??currentTarget??submitTarget;const initialScrollContainer=findClosestScrollableAncestor(anchorElement)??findClosestScrollableAncestor((event?.target)??null);if(typeof window!==\"undefined\"){clearScheduledScrollResets();resetAllRelevantScrollPositions(initialScrollContainer);const retryDelays=[100,300,700,1200];for(const delay of retryDelays){const timeoutId=window.setTimeout(()=>{resetAllRelevantScrollPositions(initialScrollContainer);},delay);scheduledResetTimeoutsRef.current.push(timeoutId);}}}return props.onSubmit?.(event);},[clearScheduledScrollResets,findClosestScrollableAncestor,props.onSubmit,resetAllRelevantScrollPositions]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onSubmit:handleSubmit});});}export function withCompactMobileHeaderLogo(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const rootRef=useRef(null);const previousStyleRef=useRef({element:null,transform:\"\",transformOrigin:\"\"});const setRefs=useCallback(node=>{rootRef.current=node;if(typeof ref===\"function\"){ref(node);}else if(ref&&\"current\"in ref){ref.current=node;}},[ref]);useEffect(()=>{if(typeof window===\"undefined\")return;if(!rootRef.current)return;const restorePrevious=()=>{const previous=previousStyleRef.current;if(!previous.element)return;previous.element.style.transform=previous.transform;previous.element.style.transformOrigin=previous.transformOrigin;previousStyleRef.current={element:null,transform:\"\",transformOrigin:\"\"};};const selectors=['[data-framer-name*=\"mobile\" i] nav','[class*=\"mobile\" i] nav',\"nav[aria-label*='mobile' i]\",\"header nav\",\"nav\"];const applyScale=()=>{if(!rootRef.current)return;const mobileNav=selectors.map(selector=>rootRef.current?.querySelector(selector)).find(Boolean)??null;if(!mobileNav)return;const logoTarget=mobileNav.querySelector('a, [role=\"link\"], [data-framer-name*=\"logo\" i], [class*=\"logo\" i]');if(!logoTarget)return;if(previousStyleRef.current.element!==logoTarget){restorePrevious();previousStyleRef.current={element:logoTarget,transform:logoTarget.style.transform,transformOrigin:logoTarget.style.transformOrigin};}const baseTransform=previousStyleRef.current.transform;const nextTransform=baseTransform&&baseTransform.trim().length>0?`${baseTransform} scale(0.84)`:\"scale(0.84)\";logoTarget.style.transform=nextTransform;logoTarget.style.transformOrigin=\"left center\";};applyScale();const observer=new MutationObserver(()=>{applyScale();});observer.observe(rootRef.current,{childList:true,subtree:true,attributes:true});return()=>{observer.disconnect();restorePrevious();};},[]);return /*#__PURE__*/_jsx(Component,{ref:setRefs,...props});});}export function withScrollToTopOnMount(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const timeoutIdsRef=useRef([]);const clearScheduledPasses=useCallback(()=>{if(typeof window===\"undefined\")return;for(const timeoutId of timeoutIdsRef.current){window.clearTimeout(timeoutId);}timeoutIdsRef.current=[];},[]);const resetAllScrollableTargetsToTop=useCallback(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const scrollTargets=new Set;scrollTargets.add(window);if(document.documentElement)scrollTargets.add(document.documentElement);if(document.body)scrollTargets.add(document.body);const allElements=document.querySelectorAll(\"*\");for(const element of allElements){if(element.scrollTop<=0)continue;const computedStyle=window.getComputedStyle(element);const overflowY=computedStyle.overflowY;const canScrollY=(overflowY===\"auto\"||overflowY===\"scroll\"||overflowY===\"overlay\")&&element.scrollHeight>element.clientHeight;if(canScrollY){scrollTargets.add(element);}}for(const target of scrollTargets){try{target.scrollTo?.({top:0,behavior:\"auto\"});}catch(_error){// Ignore individual failures and continue resetting other targets.\n}if(target instanceof HTMLElement){target.scrollTop=0;}}},[]);useEffect(()=>{if(typeof window===\"undefined\")return;clearScheduledPasses();resetAllScrollableTargetsToTop();const retryDelays=[50,150,400,900,1600];for(const delay of retryDelays){const timeoutId=window.setTimeout(()=>{resetAllScrollableTargetsToTop();},delay);timeoutIdsRef.current.push(timeoutId);}return()=>{clearScheduledPasses();};},[clearScheduledPasses,resetAllScrollableTargetsToTop]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props});});}export function withScrollToTopAfterClick(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const timeoutIdsRef=useRef([]);const clearScheduledScrollResets=useCallback(()=>{if(typeof window===\"undefined\")return;for(const timeoutId of timeoutIdsRef.current){window.clearTimeout(timeoutId);}timeoutIdsRef.current=[];},[]);const resetAllScrollableTargetsToTop=useCallback(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const scrollTargets=new Set;scrollTargets.add(window);if(document.documentElement)scrollTargets.add(document.documentElement);if(document.body)scrollTargets.add(document.body);const allElements=document.querySelectorAll(\"*\");for(const element of allElements){if(element.scrollTop<=0)continue;const computedStyle=window.getComputedStyle(element);const overflowY=computedStyle.overflowY;const canScrollY=(overflowY===\"auto\"||overflowY===\"scroll\"||overflowY===\"overlay\")&&element.scrollHeight>element.clientHeight;if(canScrollY){scrollTargets.add(element);}}for(const target of scrollTargets){try{target.scrollTo?.({top:0,behavior:\"auto\"});}catch(_error){// Ignore individual failures and continue resetting other targets.\n}if(target instanceof HTMLElement){target.scrollTop=0;}}},[]);useEffect(()=>{return()=>{clearScheduledScrollResets();};},[clearScheduledScrollResets]);const handleClick=useCallback(event=>{props.onClick?.(event);if(typeof window===\"undefined\")return;clearScheduledScrollResets();const retryDelays=[100,350,800,1500,2500];for(const delay of retryDelays){const timeoutId=window.setTimeout(()=>{resetAllScrollableTargetsToTop();},delay);timeoutIdsRef.current.push(timeoutId);}},[clearScheduledScrollResets,props,resetAllScrollableTargetsToTop]);return /*#__PURE__*/_jsx(Component,{ref:ref,...props,onClick:handleClick});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withValidatedThankYouSubmit\":{\"type\":\"reactHoc\",\"name\":\"withValidatedThankYouSubmit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCompactMobileHeaderLogo\":{\"type\":\"reactHoc\",\"name\":\"withCompactMobileHeaderLogo\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollToTopAfterClick\":{\"type\":\"reactHoc\",\"name\":\"withScrollToTopAfterClick\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withPersistentThankYouForm\":{\"type\":\"reactHoc\",\"name\":\"withPersistentThankYouForm\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollToTopOnMount\":{\"type\":\"reactHoc\",\"name\":\"withScrollToTopOnMount\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Examples.map"],"mappings":"6NAAa,EAAgB,CACzB,QAAS,OACT,eAAgB,SAChB,WAAY,QAChB,EAWI,CADA,GAAG,CACO,sBEdwhE,SAAgB,EAA2B,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,IAAM,EAA0BA,EAAO,CAAC,CAAC,EAAQ,EAA8BC,EAAY,GAAO,CAAC,GAAU,IAAS,QAAa,CAAC,EAAM,OAAO,KAAK,IAAI,EAAK,EAAM,cAAc,KAAM,GAAK,CAAmD,IAAM,EAApC,EAAO,iBAAiB,CAAkC,CAAC,CAAC,UAAkI,IAAtG,IAAY,QAAQ,IAAY,UAAU,IAAY,YAAY,EAAK,aAAa,EAAK,aAA2B,OAAO,EAAK,EAAK,EAAK,aAAc,CAAC,OAAO,IAAK,EAAE,CAAC,CAAC,EAAQ,EAA2BA,MAAgB,CAAI,GAAO,IAAS,OAAmB,KAAI,IAAM,KAAa,EAA0B,QAAS,EAAO,aAAa,CAAS,EAAG,EAA0B,QAAQ,CAAC,CAAtC,CAAwC,EAAE,CAAC,CAAC,EAAQ,EAAgCA,EAAY,GAAwB,CAAC,GAAU,IAAS,QAAa,OAAO,SAAW,IAAY,OAAO,IAAM,EAAc,IAAI,IAAI,EAAc,IAAI,CAAM,EAAK,SAAS,iBAAgB,EAAc,IAAI,SAAS,eAAe,EAAK,SAAS,MAAK,EAAc,IAAI,SAAS,IAAI,EAAK,GAAuB,EAAc,IAAI,CAAsB,EAAE,IAAM,EAAY,SAAS,iBAAiB,GAAG,EAAE,IAAI,IAAM,KAAW,EAAY,CAAC,GAAG,EAAQ,WAAW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