{"version":3,"file":"shared-lib.BDfnI53r.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/hh1rorVVkzvpMIEt3ns5/EuIljcRTNP1vLViOshEN/ReleaseBadgeWidget.js","https:/framerusercontent.com/modules/hGWQ6DoocusTRlKjXbzF/itczqvbEqpED3jEVlLGI/siteMetadata.js"],"sourcesContent":["// // ReleaseBadge: free \"What's New\" changelog widget. Get a Project Key at releasebadge.com\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const API_BASE=\"https://releasebadge.com\";const SAMPLE=[{id:\"s1\",title:\"Faster dashboard\",version:\"v1.2.0\",category:\"Performance\",content:\"Pages now load twice as fast.\",publishedAt:new Date().toISOString()},{id:\"s2\",title:\"Dark mode is here\",version:\"v1.1.0\",category:\"Feature\",content:\"Switch themes from settings.\",publishedAt:new Date(Date.now()-864e5*5).toISOString()}];function fmtDate(d){if(!d)return\"\";const dt=new Date(d);if(isNaN(dt.getTime()))return\"\";return dt.toLocaleDateString(undefined,{month:\"short\",day:\"numeric\",year:\"numeric\"});}/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function ReleaseBadgeWidget(props){const{projectKey,label,showCount,showDot,dotColor,buttonColor,buttonTextColor,radius,theme,panelAlign,panelDirection,panelWidth,previewOpen}=props;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[open,setOpen]=React.useState(false);const[entries,setEntries]=React.useState(isCanvas?SAMPLE:[]);const[error,setError]=React.useState(\"\");const[loading,setLoading]=React.useState(false);const[showBadge,setShowBadge]=React.useState(true);const[seen,setSeen]=React.useState(false);const isOpen=open||isCanvas&&previewOpen;const dark=theme===\"dark\";const bg=dark?\"#18181b\":\"#ffffff\";const fg=dark?\"#f4f4f5\":\"#18181b\";const muted=dark?\"#a1a1aa\":\"#71717a\";const border=dark?\"#27272a\":\"#e4e4e7\";React.useEffect(()=>{if(isCanvas)return;if(!projectKey){setError(\"select the button and then Add your Project Key in the right-hand panel.\");return;}let cancelled=false;setLoading(true);setError(\"\");fetch(`${API_BASE}/api/v1/changelog?projectKey=${encodeURIComponent(projectKey)}`).then(async res=>{const data=await res.json().catch(()=>null);if(cancelled)return;if(res.status===402)setError(\"This changelog has reached its free monthly view limit.\");else if(res.status===403)setError(\"This site is not authorized for this Project Key. Add it under Authorized Domains in your dashboard.\");else if(res.status===404)setError(\"Invalid Project Key.\");else if(!res.ok||!Array.isArray(data))setError(\"Updates are temporarily unavailable.\");else setEntries(data);}).catch(()=>!cancelled&&setError(\"Updates are temporarily unavailable.\")).finally(()=>!cancelled&&setLoading(false));fetch(`${API_BASE}/api/v1/badge-status?projectKey=${encodeURIComponent(projectKey)}`).then(r=>r.json()).then(d=>!cancelled&&setShowBadge(d.plan!==\"pro\")).catch(()=>{});return()=>{cancelled=true;};},[projectKey,isCanvas]);// const toggle = () => {\n//     const next = !open\n//     setOpen(next)\n//     if (next && !seen) {\n//         setSeen(true)\n//         if (!isCanvas && projectKey) {\n//             fetch(`${API_BASE}/api/v1/track`, {\n//                 method: \"POST\",\n//                 headers: { \"Content-Type\": \"application/json\" },\n//                 body: JSON.stringify({ projectKey }),\n//             }).catch(() => {})\n//         }\n//     }\n// }\nconst toggle=()=>{const next=!open;setOpen(next);if(next&&!seen)setSeen(true);};const panelStyle={position:\"absolute\",[panelDirection===\"up\"?\"bottom\":\"top\"]:\"calc(100% + 8px)\",[panelAlign===\"right\"?\"right\":\"left\"]:0,width:panelWidth,maxHeight:420,overflowY:\"auto\",background:bg,color:fg,border:`1px solid ${border}`,borderRadius:14,boxShadow:\"0 12px 32px rgba(0,0,0,0.18)\",padding:16,zIndex:9999,fontFamily:\"Inter, system-ui, sans-serif\",fontSize:14,textAlign:\"left\"};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:\"inline-block\",fontFamily:\"Inter, system-ui, sans-serif\"},children:[/*#__PURE__*/_jsxs(\"button\",{onClick:toggle,style:{background:buttonColor,color:buttonTextColor,border:\"none\",borderRadius:radius,padding:\"10px 16px\",fontSize:14,fontWeight:600,cursor:\"pointer\",display:\"inline-flex\",alignItems:\"center\",gap:8,position:\"relative\"},children:[label,showCount&&entries.length>0&&/*#__PURE__*/_jsx(\"span\",{style:{background:\"rgba(255,255,255,0.25)\",borderRadius:999,padding:\"1px 8px\",fontSize:12},children:entries.length}),showDot&&!seen&&entries.length>0&&/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",top:-3,right:-3,width:10,height:10,borderRadius:999,background:dotColor,border:`2px solid ${bg}`}})]}),isOpen&&/*#__PURE__*/_jsxs(\"div\",{style:panelStyle,children:[loading&&/*#__PURE__*/_jsx(\"div\",{style:{color:muted},children:\"Loading…\"}),!loading&&error&&/*#__PURE__*/_jsx(\"div\",{style:{color:muted},children:error}),!loading&&!error&&entries.length===0&&/*#__PURE__*/_jsx(\"div\",{style:{color:muted},children:\"No updates yet.\"}),!loading&&!error&&entries.map((e,i)=>/*#__PURE__*/_jsxs(\"div\",{style:{paddingBottom:12,marginBottom:12,borderBottom:i===entries.length-1?\"none\":`1px solid ${border}`},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:8,alignItems:\"center\",fontSize:12,color:muted},children:[e.version&&/*#__PURE__*/_jsx(\"span\",{style:{fontWeight:600},children:e.version}),e.category&&/*#__PURE__*/_jsxs(\"span\",{children:[\"\\xb7 \",e.category]}),/*#__PURE__*/_jsx(\"span\",{style:{marginLeft:\"auto\"},children:fmtDate(e.publishedAt)})]}),/*#__PURE__*/_jsx(\"div\",{style:{fontWeight:600,margin:\"4px 0\"},children:e.title}),e.content&&/*#__PURE__*/_jsx(\"div\",{style:{color:muted,whiteSpace:\"pre-wrap\",lineHeight:1.5},children:e.content})]},e.id)),showBadge&&/*#__PURE__*/_jsx(\"a\",{href:\"https://releasebadge.com\",target:\"_blank\",rel:\"noopener noreferrer\",style:{display:\"block\",textAlign:\"center\",fontSize:11,color:muted,textDecoration:\"none\",marginTop:4},children:\"Powered by ReleaseBadge\"})]})]});}ReleaseBadgeWidget.defaultProps={projectKey:\"\",label:\"What's New\",showCount:true,showDot:true,dotColor:\"#ef4444\",buttonColor:\"#4f46e5\",buttonTextColor:\"#ffffff\",radius:10,theme:\"light\",panelAlign:\"left\",panelDirection:\"down\",panelWidth:340,previewOpen:false};addPropertyControls(ReleaseBadgeWidget,{projectKey:{type:ControlType.String,title:\"Project Key\",placeholder:\"paste from dashboard\"},label:{type:ControlType.String,title:\"Button Text\"},showCount:{type:ControlType.Boolean,title:\"Show Count\"},showDot:{type:ControlType.Boolean,title:\"Unread Dot\"},dotColor:{type:ControlType.Color,title:\"Dot Color\"},buttonColor:{type:ControlType.Color,title:\"Button\"},buttonTextColor:{type:ControlType.Color,title:\"Text\"},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:40},theme:{type:ControlType.Enum,title:\"Theme\",options:[\"light\",\"dark\"],optionTitles:[\"Light\",\"Dark\"]},panelAlign:{type:ControlType.Enum,title:\"Panel Align\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"]},panelDirection:{type:ControlType.Enum,title:\"Opens\",options:[\"down\",\"up\"],optionTitles:[\"Down\",\"Up\"]},panelWidth:{type:ControlType.Number,title:\"Panel Width\",min:260,max:520},previewOpen:{type:ControlType.Boolean,title:\"Show Panel (canvas)\",hidden:()=>false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ReleaseBadgeWidget\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ReleaseBadgeWidget.map","// Generated by Framer (3ad0d99)\nexport default function metadata(params,activeLocale){return{description:\"Made with Framer\",robots:\"max-image-preview:large\",title:\"My Framer Site\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"+LAC6gB,SAAS,EAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAM,EAAG,IAAI,KAAK,CAAC,EAAkC,OAA7B,MAAM,EAAG,QAAQ,CAAC,EAAQ,GAAU,EAAG,mBAAmB,IAAA,GAAU,CAAC,MAAM,QAAQ,IAAI,UAAU,KAAK,SAAS,CAAC,CAAE,CAGvrB,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,aAAW,QAAM,YAAU,UAAQ,WAAS,cAAY,kBAAgB,SAAO,QAAM,aAAW,iBAAe,aAAW,eAAa,EAAY,EAAS,EAAa,QAAQ,IAAI,EAAa,OAAY,CAAC,EAAK,GAASA,EAAe,EAAK,EAAO,CAAC,EAAQ,GAAYA,EAAe,EAAS,EAAO,CAAC,CAAC,EAAO,CAAC,EAAM,GAAUA,EAAe,EAAE,EAAO,CAAC,EAAQ,GAAYA,EAAe,EAAK,EAAO,CAAC,EAAU,GAAcA,EAAe,EAAI,EAAO,CAAC,EAAK,GAASA,EAAe,EAAK,EAAQ,EAAO,GAAM,GAAU,EAAkB,EAAK,IAAQ,OAAa,EAAG,EAAK,UAAU,UAAgB,EAAG,EAAK,UAAU,UAAgB,EAAM,EAAK,UAAU,UAAgB,EAAO,EAAK,UAAU,UAAU,MAAoB,CAAC,GAAG,EAAS,OAAO,GAAG,CAAC,EAAW,CAAC,EAAS,0EAA0E,EAAE,MAAO,CAAC,IAAI,EAAU,GAA+2B,OAAz2B,EAAW,EAAI,EAAE,EAAS,EAAE,EAAE,MAAM,GAAG,EAAS,+BAA+B,mBAAmB,CAAU,GAAG,CAAC,CAAC,KAAK,KAAM,IAAK,CAAC,IAAM,EAAK,MAAM,EAAI,KAAK,CAAC,CAAC,UAA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