{"version":3,"file":"Navigation.6XK610hH.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/MnjZUP24m4UFEVAo4MPz/F8apgu93f354JdSN1vAk/goToMarket.js","https:/framerusercontent.com/modules/WsLN4XQfJdeqkYSXsIEd/I4Jw94Bv3kmUdtcm3fhI/Navigation.js"],"sourcesContent":["// !!!\n// THIS FILE IS FOR MANAGING GOOLGE TAG MANAGER.\n// IT IS CALLED goToMarket.tsx BECAUSE GTM.tsx WILL BE BLOCKED BY AD BLOCKERS.\n// !!!\nexport const goToMarket={enableCookies(){if(!window.dataLayer)return;window.dataLayer.push({event:\"cookieConsentAllow\",cookieConsent:\"allow\"});},trackEvent(data,cb){if(!data.category||!data.action||!window.dataLayer){return;}window.dataLayer.push({event:\"eventTracking\",trackingEventCategory:data.category,trackingEventAction:data.action,trackingEventLabel:data.label||\"\",trackingEventValue:data.value||\"\",nonInteraction:data.nonInteraction||false,eventCallback:cb});}};\nexport const __FramerMetadata__ = {\"exports\":{\"goToMarket\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"EventCategory\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./goToMarket.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,forwardRef,useRef,startTransition}from\"react\";import{goToMarket}from\"https://framerusercontent.com/modules/MnjZUP24m4UFEVAo4MPz/F8apgu93f354JdSN1vAk/goToMarket.js\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{log}from\"https://framerusercontent.com/modules/kSMCNeBYpO4VGJ0nrZPP/hw3SGPll9XzW7k0KD4Qq/log.js\";export function OpenType(Component){return /*#__PURE__*/forwardRef((props,ref)=>{return /*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{...props.style,fontFeatureSettings:`\"salt\", \"kern\", \"cv05\", \"cv11\", \"ccmp\"`}});});}// Auth Buttons\nconst useStore=createStore({userHasInitialized:false,user:null});function isUser(data){return data?.name!==undefined;}export function withUser(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[{user},setStore]=useStore();useEffect(()=>{const fetchUser=async()=>{log(\"Fetching user\");const data=await fetch(\"https://api.framer.com/site/users/me\",{credentials:\"include\"});const user=await data.json();if(isUser(user)){goToMarket.trackEvent({category:\"HasFramerUser\",action:\"true\"});startTransition(()=>setStore({user,userHasInitialized:true}));}else{goToMarket.trackEvent({category:\"HasFramerUser\",action:\"false\"});startTransition(()=>setStore({userHasInitialized:true}));}};if(typeof window===\"undefined\"||![\"www.framer.com\",\"framer.com\"].includes(window.location.hostname)){console.log(\"Skipping the login state because we're not on framer.com\");return;}fetchUser().catch(console.error);},[]);let authenticatedProps={};if(isUser(user)){authenticatedProps={label:\"Open Framer\",avatarImage:user.avatar,avatar:!!user.avatar,link:\"https://framer.com/projects\",variant:!!user.avatar?\"Nav\":props.variant};}const componentProps={...props,...authenticatedProps};return /*#__PURE__*/_jsx(Component,{...props,...componentProps,ref:ref});});}const useOutsideClick=callback=>{const ref=useRef(null);const[{isOpen}]=useBrandMenuStore();useEffect(()=>{const handleClick=event=>{if(ref.current&&!ref.current.contains(event.target)){callback();}};document.addEventListener(\"click\",handleClick,true);return()=>{document.removeEventListener(\"click\",handleClick,true);};},[ref,isOpen]);return ref;};export function hideWhenAuthenticated(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[{user,userHasInitialized}]=useStore();const isAuthenticated=userHasInitialized&&isUser(user);return!isAuthenticated&&/*#__PURE__*/_jsx(Component,{...props,ref:ref});});}const useBrandMenuStore=createStore({isOpen:false});export function withRightClickTrigger(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[{isOpen},setStore]=useBrandMenuStore();const handleClick=e=>{e.preventDefault();if(e.type===\"contextmenu\"){startTransition(()=>setStore({isOpen:!isOpen}));}};return /*#__PURE__*/_jsx(Component,{...props,ref:ref,onClick:handleClick,onContextMenu:handleClick});});}export function withBrandMenuOpenState(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[{isOpen},setStore]=useBrandMenuStore();const initialized=false;useEffect(()=>{if(!initialized){startTransition(()=>setStore({isOpen:false}));}},[]);const handleClickOutside=()=>{if(isOpen){startTransition(()=>setStore({isOpen:false}));}};const wrapperRef=useOutsideClick(handleClickOutside);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",width:280,top:40,left:0,pointerEvents:isOpen?\"all\":\"none\",zIndex:props.style?.zIndex},ref:wrapperRef,children:/*#__PURE__*/_jsx(Component,{...props,ref:ref,style:{...props.style,opacity:isOpen?1:0,transform:isOpen?\"scale(0.95)\":\"scale(1)\",transition:\"ease 0.2s\",position:\"relative\"}})});});}export function withCloseOnClick(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[{isOpen},setStore]=useBrandMenuStore();const handleClick=_e=>{startTransition(()=>setStore({isOpen:false}));};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,ref:ref});});}export function withCloseBrandMenuOnHover(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[{isOpen},setStore]=useBrandMenuStore();const handleMouseEnter=_e=>{startTransition(()=>setStore({isOpen:false}));};return /*#__PURE__*/_jsx(Component,{...props,onHoverStart:handleMouseEnter,ref:ref});});}export function withCopyLogo(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const[{isOpen},setStore]=useBrandMenuStore();const handleClick=_e=>{startTransition(()=>setStore({isOpen:false}));if(typeof navigator!==\"undefined\"&&navigator.clipboard){void navigator.clipboard.writeText('<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"140\" height=\"140\"><path d=\"M 44.65 33.992 L 95.35 33.992 L 95.35 59.341 L 70 59.341 Z M 44.65 59.341 L 70 59.341 L 95.35 84.691 L 44.65 84.691 Z M 44.65 84.691 L 70 84.691 L 70 110.041 Z\" fill=\"rgb(0, 0, 0)\"></path></svg>');}};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,ref:ref});});}\nexport const __FramerMetadata__ = {\"exports\":{\"OpenType\":{\"type\":\"reactHoc\",\"name\":\"OpenType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCloseBrandMenuOnHover\":{\"type\":\"reactHoc\",\"name\":\"withCloseBrandMenuOnHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCloseOnClick\":{\"type\":\"reactHoc\",\"name\":\"withCloseOnClick\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCopyLogo\":{\"type\":\"reactHoc\",\"name\":\"withCopyLogo\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUser\":{\"type\":\"reactHoc\",\"name\":\"withUser\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"hideWhenAuthenticated\":{\"type\":\"reactHoc\",\"name\":\"hideWhenAuthenticated\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRightClickTrigger\":{\"type\":\"reactHoc\",\"name\":\"withRightClickTrigger\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBrandMenuOpenState\":{\"type\":\"reactHoc\",\"name\":\"withBrandMenuOpenState\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"kOCA6Y,SAAgB,EAAS,EAAU,CAAC,OAAoB,GAAY,EAAM,IAA2B,EAAK,EAAU,CAAC,GAAG,EAAU,MAAI,MAAM,CAAC,GAAG,EAAM,MAAM,oBAAoB,yCAAyC,CAAC,CAAC,CAAG,CAC8wC,SAAgB,EAAsB,EAAU,CAAC,OAAoB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,CAAC,UAAQ,GAAU,GAAmB,CAAO,EAAY,GAAG,CAAC,EAAE,gBAAgB,CAAI,EAAE,OAAO,eAAe,MAAoB,EAAS,CAAC,OAAO,CAAC,EAAO,CAAC,CAAC,EAAI,OAAoB,EAAK,EAAU,CAAC,GAAG,EAAU,MAAI,QAAQ,EAAY,cAAc,EAAY,CAAC,EAAG,CAAE,SAAgB,EAAuB,EAAU,CAAC,O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