{"version":3,"file":"NavOverrides.b_n9r_F4.mjs","names":["useState","useSyncExternalStore","useRef"],"sources":["https:/framerusercontent.com/modules/tzprT7G4613rMP1QBn8I/qBFTM8SDwdc9ub2PRD1B/NavOverrides.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,useSyncExternalStore}from\"react\";/**\n * Closes a nav dropdown as soon as a link inside it is clicked.\n *\n * The panel keeps its canvas design and its Framer-generated links, so\n * navigation still works everywhere including the editor preview. This only\n * hides the panel after the click.\n *\n * Framer unmounts the panel whenever the menu closes, so this state resets on\n * its own the next time the menu is opened.\n */export function withCloseOnSelect(Component){return function WithCloseOnSelect(props){const[closed,setClosed]=useState(false);if(closed)return null;return /*#__PURE__*/_jsx(\"div\",{style:{display:\"contents\"},onClickCapture:event=>{const target=event.target;if(target&&typeof target.closest===\"function\"&&target.closest(\"a\")){// Defer, so the link's own navigation is dispatched\n// before this element is removed from the tree.\nsetTimeout(()=>setClosed(true),0);}},children:/*#__PURE__*/_jsx(Component,{...props})});};}/* ------------------------------------------------------------------ *//* Mobile drawer                                                       *//*                                                                     *//* The drawer's original opener (a FixedOverlayNode in the layout      *//* template) was deleted and cannot be recreated through the API, so   *//* these two overrides own the open/closed state instead. They share   *//* this module's scope, which is how the burger reaches the drawer.    *//* ------------------------------------------------------------------ */let drawerOpen=false;const subscribers=new Set;function setDrawerOpen(next){if(drawerOpen===next)return;drawerOpen=next;subscribers.forEach(notify=>notify());}function useDrawerOpen(){return useSyncExternalStore(notify=>{subscribers.add(notify);return()=>{subscribers.delete(notify);};},()=>drawerOpen,()=>false// server render: always closed\n);}/** Apply to the Drawer Panel. Renders it only while the drawer is open. */export function withDrawer(Component){return function WithDrawer(props){const isOpen=useDrawerOpen();if(!isOpen)return null;return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"contents\"},// The panel's resting state is translated off-canvas; the\n// deleted overlay used to animate it in. Cancel that while open.\n\"data-emg-drawer-open\":\"true\",onClickCapture:event=>{const target=event.target;if(!target||typeof target.closest!==\"function\")return;// A link: let navigation dispatch, then close.\nif(target.closest(\"a\")){setTimeout(()=>setDrawerOpen(false),0);return;}// The X.\nif(target.closest('[data-framer-name=\"Close Button\"]')){setDrawerOpen(false);}},children:[/*#__PURE__*/_jsx(\"style\",{children:DRAWER_CSS}),/*#__PURE__*/_jsx(Component,{...props})]});};}const DRAWER_CSS=`\n[data-emg-drawer-open=\"true\"] [data-framer-name=\"Drawer Panel\"],\n[data-emg-drawer-open=\"true\"][data-framer-name=\"Drawer Panel\"] {\n  transform: none !important;\n}\n`;/** Apply to the Menu Button (burger). Opens the drawer. */export function withDrawerToggle(Component){return function WithDrawerToggle(props){return /*#__PURE__*/_jsx(\"div\",{style:{display:\"contents\"},onClickCapture:()=>setDrawerOpen(true),children:/*#__PURE__*/_jsx(Component,{...props})});};}/* ------------------------------------------------------------------ *//* Platform stage deep links                                           *//*                                                                     *//* The home page's stage rows (01 PLAN … 05 ANALYSE) link to           *//* /platform#plan … /platform#analyse. The tab strip's active tab is   *//* held in a canvas variable, which nothing outside the canvas can     *//* set, so this override selects the tab the way a visitor would: by   *//* dispatching a real pointer sequence at the matching tab button.     *//*                                                                     *//* A plain .click() is ignored — Framer's tap handling listens for     *//* pointerdown/pointerup, so all three events are needed.              *//* ------------------------------------------------------------------ */const STAGE_TABS={plan:1,execute:2,track:3,manage:4,analyse:5,analyze:5};function tapTab(root,index){if(!root||typeof PointerEvent===\"undefined\")return null;const el=root.querySelector('[data-framer-name=\"Tab '+index+'\"]');if(!el)return null;const rect=el.getBoundingClientRect();const base={bubbles:true,cancelable:true,composed:true,clientX:rect.left+rect.width/2,clientY:rect.top+rect.height/2,pointerId:1,pointerType:\"mouse\",isPrimary:true,button:0};el.dispatchEvent(new PointerEvent(\"pointerdown\",{...base,buttons:1}));el.dispatchEvent(new PointerEvent(\"pointerup\",{...base,buttons:0}));el.dispatchEvent(new MouseEvent(\"click\",{bubbles:true,cancelable:true,composed:true,clientX:base.clientX,clientY:base.clientY}));return el;}/**\n * Parks the stage section just below the top of the viewport and keeps it\n * there for ~1.2s.\n *\n * Framer's own scroll target fires at an unpredictable moment relative to this\n * override — a single one-shot scroll races it and can lose. Re-checking a few\n * times converges no matter which of the two runs last. Any real input from\n * the visitor stops it immediately, so this never fights a person scrolling.\n */function settleScroll(el,isCancelled){const section=el.closest(\"section\")||el;const TARGET=8;let steps=0;let aborted=false;const abort=()=>{aborted=true;};const listen=on=>{const fn=on?window.addEventListener:window.removeEventListener;fn(\"wheel\",abort);fn(\"touchstart\",abort);fn(\"keydown\",abort);};listen(true);const step=()=>{if(isCancelled()||aborted){listen(false);return;}const top=section.getBoundingClientRect().top;if(top<-24||top>120){window.scrollTo({top:window.scrollY+top-TARGET});}if(++steps<6){setTimeout(step,200);}else{listen(false);}};step();}/** Apply to the Tab Group on /platform. */export function withStageDeepLink(Component){return function WithStageDeepLink(props){const ref=useRef(null);useEffect(()=>{if(typeof window===\"undefined\")return;let cancelled=false;let lastHash=\"\";const run=()=>{const key=window.location.hash.replace(\"#\",\"\").toLowerCase();const index=STAGE_TABS[key];if(!index)return;// The tab strip hydrates a beat after this effect runs.\nlet attempts=0;const tick=()=>{if(cancelled)return;const el=tapTab(ref.current,index);if(el){settleScroll(el,()=>cancelled);return;}if(attempts++<20)setTimeout(tick,100);};tick();};run();lastHash=window.location.hash;// Framer navigates with history.pushState, which does not fire\n// `hashchange`, so same-page stage links need a poll as well.\nwindow.addEventListener(\"hashchange\",run);const poll=setInterval(()=>{if(window.location.hash===lastHash)return;lastHash=window.location.hash;run();},200);return()=>{cancelled=true;clearInterval(poll);window.removeEventListener(\"hashchange\",run);};},[]);// display: contents keeps the canvas layout untouched.\nreturn /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{display:\"contents\"},children:/*#__PURE__*/_jsx(Component,{...props})});};}/* ------------------------------------------------------------------ *//* Horizontal scroll hint                                              *//*                                                                     *//* The showcase tab strip scrolls, but Framer sets `scrollbar-width:   *//* none`, so on a phone eight of the ten tabs are hidden with nothing  *//* to suggest it moves. A mask fades the right edge of the visible     *//* area — it needs no extra DOM, and unlike an absolutely positioned   *//* overlay it does not scroll away with the content.                   *//*                                                                     *//* Only below the tablet breakpoint; the full strip fits on desktop.   *//* ------------------------------------------------------------------ */const SCROLL_HINT_CSS=`\n@media (max-width: 809.98px) {\n  [data-emg-scroll-hint=\"true\"] [data-framer-name=\"Showcase Tab Strip\"],\n  [data-emg-scroll-hint=\"true\"][data-framer-name=\"Showcase Tab Strip\"] {\n    -webkit-mask-image: linear-gradient(to right, #000 0, #000 86%, transparent 100%);\n    mask-image: linear-gradient(to right, #000 0, #000 86%, transparent 100%);\n  }\n}\n`;/** Apply to the Showcase Tab Strip on the home page. */export function withScrollHint(Component){return function WithScrollHint(props){return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"contents\"},\"data-emg-scroll-hint\":\"true\",children:[/*#__PURE__*/_jsx(\"style\",{children:SCROLL_HINT_CSS}),/*#__PURE__*/_jsx(Component,{...props})]});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withCloseOnSelect\":{\"type\":\"reactHoc\",\"name\":\"withCloseOnSelect\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDrawer\":{\"type\":\"reactHoc\",\"name\":\"withDrawer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withStageDeepLink\":{\"type\":\"reactHoc\",\"name\":\"withStageDeepLink\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withScrollHint\":{\"type\":\"reactHoc\",\"name\":\"withScrollHint\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDrawerToggle\":{\"type\":\"reactHoc\",\"name\":\"withDrawerToggle\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NavOverrides.map"],"mappings":"4JASG,SAAgB,EAAkB,EAAU,CAAC,OAAO,SAA2B,EAAM,CAAC,GAAK,CAAC,EAAO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