{"version":3,"file":"Selectiontool.C8IfS2RJ.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/3XGjJUqC8XIw2CGyknZf/Mqo0GDjWu8Rb7g2X960h/Selectiontool.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";function normalizePath(path){if(!path)return\"\";const clean=path.split(\"?\")[0].split(\"#\")[0];if(clean!==\"/\"&&clean.endsWith(\"/\"))return clean.slice(0,-1);return clean;}function isActive(link,currentPath){if(!link)return false;try{const url=new URL(link,window.location.origin);return normalizePath(url.pathname)===currentPath;}catch{return normalizePath(link)===currentPath;}}function Button({href,active,isGridPage,children,grow}){return /*#__PURE__*/_jsx(motion.a,{href:href||\"#\",whileTap:{scale:.96},whileHover:{textDecoration:\"underline\"},style:{flexGrow:grow,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",minWidth:0,height:\"100%\",// ✅ wenn grid page → alles weiß\ncolor:isGridPage?\"#fff\":\"#000\",textDecoration:active?\"underline\":\"none\",userSelect:\"none\",WebkitTapHighlightColor:\"transparent\",touchAction:\"manipulation\",fontFamily:'\"Geist\", Arial, sans-serif',fontSize:14,fontWeight:400,lineHeight:1,letterSpacing:\"-0.02em\",textTransform:\"uppercase\"},children:children});}export default function ToggleMini(props){const{gridLabel,listLabel,gridLink,listLink}=props;const[path,setPath]=React.useState(\"\");const[isDesktopOrTablet,setIsDesktopOrTablet]=React.useState(true);React.useEffect(()=>{const updatePath=()=>{if(typeof window!==\"undefined\"){setPath(normalizePath(window.location.pathname));}};const updateViewport=()=>{if(typeof window!==\"undefined\"){setIsDesktopOrTablet(window.innerWidth>768);}};updatePath();updateViewport();window.addEventListener(\"popstate\",updatePath);window.addEventListener(\"hashchange\",updatePath);window.addEventListener(\"resize\",updateViewport);return()=>{window.removeEventListener(\"popstate\",updatePath);window.removeEventListener(\"hashchange\",updatePath);window.removeEventListener(\"resize\",updateViewport);};},[]);if(!isDesktopOrTablet)return null;const gridActive=isActive(gridLink,path);const listActive=isActive(listLink,path);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",right:15,bottom:20,zIndex:999999,display:\"inline-block\",pointerEvents:\"auto\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{width:96,height:28,display:\"flex\",gap:12},children:[/*#__PURE__*/_jsx(Button,{href:listLink,active:listActive,isGridPage:gridActive,grow:1,children:listLabel}),/*#__PURE__*/_jsx(Button,{href:gridLink,active:gridActive,isGridPage:gridActive,grow:1,children:gridLabel})]})});}ToggleMini.defaultProps={gridLabel:\"GRID\",listLabel:\"LIST\",gridLink:\"/grid\",listLink:\"/list\"};addPropertyControls(ToggleMini,{gridLabel:{type:ControlType.String,title:\"Grid Text\"},gridLink:{type:ControlType.Link,title:\"Grid Page\"},listLabel:{type:ControlType.String,title:\"List Text\"},listLink:{type:ControlType.Link,title:\"List Page\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ToggleMini\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Selectiontool.map"],"mappings":"uPAA2K,SAAS,EAAc,EAAK,CAAC,GAAG,CAAC,EAAK,MAAM,GAAG,IAAM,EAAM,EAAK,MAAM,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,GAAgE,OAA1D,IAAQ,KAAK,EAAM,SAAS,IAAI,CAAQ,EAAM,MAAM,EAAE,GAAG,CAAQ,EAAO,SAAS,EAAS,EAAK,EAAY,CAAC,GAAG,CAAC,EAAK,MAAO,GAAM,GAAG,CAAgD,OAAO,EAA5C,IAAI,IAAI,EAAK,EAAO,SAAS,OAAO,CAA0B,SAAS,GAAG,OAAkB,CAAC,OAAO,EAAc,EAAK,GAAG,GAAc,SAAS,EAAO,CAAC,OAAK,SAAO,aAAW,WAAS,QAAM,CAAC,OAAoB,E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