{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/JIvAZHI1SwH5HmsXNloA/bmQN3tQhi8mW4NQgTjfu/SaleNotification.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{Frame,addPropertyControls,ControlType}from\"framer\";export function SaleNotification({streamUrl}){const[notifications,setNotifications]=useState([]);useEffect(()=>{if(!streamUrl)return;const eventSource=new EventSource(streamUrl);eventSource.onmessage=event=>{try{const data=JSON.parse(event.data);// Fallback message if none provided:\nconst saleMessage=data.message||\"New sale of $28,09 with Substy \uD83C\uDF89\";const id=Date.now();// Add new alert to the list\nsetNotifications(prev=>[...prev,{id,message:saleMessage}]);// Auto-remove after 5 seconds\nsetTimeout(()=>{setNotifications(prev=>prev.filter(n=>n.id!==id));},5e3);}catch(e){console.error(\"Invalid SSE message\",e);}};return()=>{eventSource.close();};},[streamUrl]);// The container for all notifications (stacked)\nreturn /*#__PURE__*/_jsx(\"div\",{style:{position:\"fixed\",bottom:24,left:24,zIndex:9999,display:\"flex\",flexDirection:\"column\",gap:\"8px\"},children:notifications.map(n=>/*#__PURE__*/_jsx(Frame,{width:\"auto\",height:\"auto\",background:\"#E6EDFB\"// Light blue background\n    ,radius:12,style:{color:\"#2D3E72\",padding:\"12px 16px\",fontSize:\"16px\",fontWeight:600,letterSpacing:\"0.3px\",boxShadow:\"0 4px 12px rgba(0,0,0,0.05)\",display:\"inline-block\"},children:n.message},n.id))});}addPropertyControls(SaleNotification,{streamUrl:{title:\"Stream URL\",type:ControlType.String,defaultValue:\"https://app.substy.ai/api/landing/events\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"SaleNotification\":{\"type\":\"reactComponent\",\"name\":\"SaleNotification\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SaleNotification.map"],
  "mappings": "8EAAkJ,SAASA,EAAiB,CAAC,UAAAC,CAAS,EAAE,CAAC,GAAK,CAACC,EAAcC,CAAgB,EAAEC,EAAS,CAAC,CAAC,EAAE,OAAAC,EAAU,IAAI,CAAC,GAAG,CAACJ,EAAU,OAAO,IAAMK,EAAY,IAAI,YAAYL,CAAS,EAAE,OAAAK,EAAY,UAAUC,GAAO,CAAC,GAAG,CAC9V,IAAMC,EADoW,KAAK,MAAMD,EAAM,IAAI,EACxW,SAAS,2CAA0CE,EAAG,KAAK,IAAI,EACtFN,EAAiBO,GAAM,CAAC,GAAGA,EAAK,CAAC,GAAAD,EAAG,QAAQD,CAAW,CAAC,CAAC,EACzD,WAAW,IAAI,CAACL,EAAiBO,GAAMA,EAAK,OAAOC,GAAGA,EAAE,KAAKF,CAAE,CAAC,CAAE,EAAE,GAAG,CAAE,OAAOG,EAAE,CAAC,QAAQ,MAAM,sBAAsBA,CAAC,CAAE,CAAC,EAAQ,IAAI,CAACN,EAAY,MAAM,CAAE,CAAE,EAAE,CAACL,CAAS,CAAC,EACvJY,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,QAAQ,OAAO,GAAG,KAAK,GAAG,OAAO,KAAK,QAAQ,OAAO,cAAc,SAAS,IAAI,KAAK,EAAE,SAASX,EAAc,IAAIS,GAAgBE,EAAKC,EAAM,CAAC,MAAM,OAAO,OAAO,OAAO,WAAW,UAC/N,OAAO,GAAG,MAAM,CAAC,MAAM,UAAU,QAAQ,YAAY,SAAS,OAAO,WAAW,IAAI,cAAc,QAAQ,UAAU,8BAA8B,QAAQ,cAAc,EAAE,SAASH,EAAE,OAAO,EAAEA,EAAE,EAAE,CAAC,CAAC,CAAC,CAAE,CAACI,EAAoBf,EAAiB,CAAC,UAAU,CAAC,MAAM,aAAa,KAAKgB,EAAY,OAAO,aAAa,0CAA0C,CAAC,CAAC",
  "names": ["SaleNotification", "streamUrl", "notifications", "setNotifications", "ye", "ue", "eventSource", "event", "saleMessage", "id", "prev", "n", "e", "p", "Frame", "addPropertyControls", "ControlType"]
}
