{"version":3,"file":"Carticon.FSOr2heA.mjs","names":["useState","p"],"sources":["https:/framerusercontent.com/modules/mXUcbRuHOK3Yzr73f4F6/2H4cUFm1ResVZpXQLPdW/Carticon.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export default function CartIcon(){const[count,setCount]=useState(0);useEffect(()=>{const updateCount=()=>{const cart=JSON.parse(localStorage.getItem(\"cart\")||\"[]\");const total=cart.reduce((sum,p)=>sum+p.quantity,0);setCount(total);};updateCount();window.addEventListener(\"storage\",updateCount);return()=>window.removeEventListener(\"storage\",updateCount);},[]);return /*#__PURE__*/_jsxs(\"a\",{href:\"/cart\",style:{position:\"sticky\",top:16,right:16,marginLeft:\"auto\",width:48,height:48,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",zIndex:1e3,color:\"#fff\"},children:[/*#__PURE__*/_jsx(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",viewBox:\"0 0 24 24\",width:\"28\",height:\"28\",children:/*#__PURE__*/_jsx(\"path\",{strokeLinecap:\"round\",strokeLinejoin:\"round\",d:\"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13l-1.6 8H19m-12 0a1 1 0 100 2 1 1 0 000-2zm10 0a1 1 0 100 2 1 1 0 000-2z\"})}),count>0&&/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",top:-6,right:-6,background:\"#ff4d4d\",color:\"#fff\",fontSize:12,fontWeight:\"bold\",borderRadius:\"50%\",width:18,height:18,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:count})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CartIcon\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Carticon.map"],"mappings":"8IAA+F,SAAwB,GAAU,CAAC,GAAK,CAAC,EAAM,GAAUA,EAAS,EAAE,CAAqS,OAApS,MAAc,CAAC,IAAM,MAAgB,CAA8G,EAAlG,KAAK,MAAM,aAAa,QAAQ,OAAO,EAAE,KAAK,CAAkB,QAAQ,EAAI,IAAI,EAAIC,EAAE,SAAS,EAAE,CAAgB,EAAgE,OAA7D,GAAa,CAAC,EAAO,iBAAiB,UAAU,EAAY,KAAW,EAAO,oBAAoB,UAAU,EAAY,EAAG,EAAE,CAAC,CAAqB,EAAM,IAAI,CAAC,KAAK,QAAQ,MAAM,CAAC,SAAS,SAAS,IAAI,GAAG,MAAM,GAAG,WAAW,OAAO,MAAM,GAAG,OAAO,GAAG,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,OAAO,IAAI,MAAM,OAAO,CAAC,SAAS,CAAc,EAAK,MAAM,CAAC,MAAM,6BAA6B,KAAK,OAAO,OAAO,eAAe,YAAY,IAAI,QAAQ,YAAY,MAAM,KAAK,OAAO,KAAK,SAAsB,EAAK,OAAO,CAAC,cAAc,QAAQ,eAAe,QAAQ,EAAE,0GAA0G,CAAC,CAAC,CAAC,CAAC,EAAM,GAAgB,EAAK,OAAO,CAAC,MAAM,CAAC,SAAS,WAAW,IAAI,GAAG,MAAM,GAAG,WAAW,UAAU,MAAM,OAAO,SAAS,GAAG,WAAW,OAAO,aAAa,MAAM,MAAM,GAAG,OAAO,GAAG,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,CAAC,SAAS,EAAM,CAAC,CAAC,CAAC,CAAC,sBAAnsC,IAAsC"}