{"version":3,"file":"CalendarEventGenerator.BO-FSxPL.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/un8bvcIhbqXiOogcFG7X/j3eUT1ZcIGrNFvdjkQbJ/CalendarEventGenerator.js"],"sourcesContent":["// Text component pulling title, Zoom link, date/time from CMS, generating Google/Outlook/Yahoo calendar links\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * Text With Calendar Links from CMS\n *\n * @framerIntrinsicWidth 500\n * @framerIntrinsicHeight 200\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */function formatDateForCalendar(dateString){// Returns: YYYYMMDDTHHmmssZ for Google/Outlook, or YYYYMMDDTHHmmssZ in UTC\nconst date=new Date(dateString);const yyyy=date.getUTCFullYear();const mm=String(date.getUTCMonth()+1).padStart(2,\"0\");const dd=String(date.getUTCDate()).padStart(2,\"0\");const hh=String(date.getUTCHours()).padStart(2,\"0\");const mi=String(date.getUTCMinutes()).padStart(2,\"0\");const ss=String(date.getUTCSeconds()).padStart(2,\"0\");return`${yyyy}${mm}${dd}T${hh}${mi}${ss}Z`;}function getGoogleCalendarUrl({title,start,end,description,location}){const params=new URLSearchParams({action:\"TEMPLATE\",text:title,dates:`${formatDateForCalendar(start)}/${formatDateForCalendar(end)}`,details:description,location});return`https://www.google.com/calendar/render?${params.toString()}`;}function getOutlookCalendarUrl({title,start,end,description,location}){// Outlook uses outlook.live.com link\nconst params=new URLSearchParams({path:\"/calendar/action/compose\",rru:\"addevent\",subject:title,body:description,location,startdt:new Date(start).toISOString(),enddt:new Date(end).toISOString()});return`https://outlook.live.com/calendar/0/deeplink/compose?${params.toString()}`;}function getYahooCalendarUrl({title,start,end,description,location}){// Yahoo: parameters in native time format YYYYMMDDTHHmmssZ\nconst params=new URLSearchParams({v:\"60\",title,st:formatDateForCalendar(start),et:formatDateForCalendar(end),desc:description,in_loc:location});return`https://calendar.yahoo.com/?${params.toString()}`;}export default function CalendarEventGenerator(props){const{title,zoomRoom,startDateTime,description,style,...rest}=props;const eventInfo=useMemo(()=>({title:title||\"Sample Meeting\",start:startDateTime||new Date().toISOString(),end:new Date(new Date(startDateTime||Date.now()).getTime()+60*60*1e3).toISOString(),description:zoomRoom?`👉 Join Live Event here: ${zoomRoom}`:undefined,location:zoomRoom||\"Online Event Link\"}),[title,zoomRoom,startDateTime]);if(!title&&!startDateTime&&!zoomRoom){return /*#__PURE__*/_jsx(\"div\",{style:{color:\"#000\",fontSize:20},children:\"Missing required event information\"});}const googleLink=useMemo(()=>getGoogleCalendarUrl(eventInfo),[eventInfo]);const outlookLink=useMemo(()=>getOutlookCalendarUrl(eventInfo),[eventInfo]);const yahooLink=useMemo(()=>getYahooCalendarUrl(eventInfo),[eventInfo]);return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",flexWrap:\"wrap\",padding:0,margin:0,color:\"#2C2C2C\",fontFamily:\"figtree, sans-serif\",fontSize:18,lineHeight:1.2,fontWeight:400,background:\"none\",boxShadow:\"none\",border:\"none\",gap:0,textAlign:\"left\"},...rest,children:[props.showGoogle!==false&&/*#__PURE__*/_jsxs(\"span\",{style:{padding:0,margin:0},children:[\"(\",/*#__PURE__*/_jsx(\"a\",{href:googleLink,target:\"_blank\",rel:\"noopener noreferrer\",style:{all:\"unset\",cursor:\"pointer\",color:\"#2C2C2C\",textDecoration:\"underline\"},\"aria-label\":\"Add to Google Calendar\",children:\"Google\"}),\")\"]}),props.showOutlook!==false&&/*#__PURE__*/_jsxs(\"span\",{style:{padding:0,margin:0},children:[\"(\",/*#__PURE__*/_jsx(\"a\",{href:outlookLink,target:\"_blank\",rel:\"noopener noreferrer\",style:{all:\"unset\",cursor:\"pointer\",color:\"#2C2C2C\",textDecoration:\"underline\"},\"aria-label\":\"Add to Outlook Calendar\",children:\"Outlook\"}),\")\"]}),props.showYahoo!==false&&/*#__PURE__*/_jsxs(\"span\",{style:{padding:0,margin:0},children:[\"(\",/*#__PURE__*/_jsx(\"a\",{href:yahooLink,target:\"_blank\",rel:\"noopener noreferrer\",style:{all:\"unset\",cursor:\"pointer\",color:\"#2C2C2C\",textDecoration:\"underline\"},\"aria-label\":\"Add to Yahoo Calendar\",children:\"Yahoo\"}),\")\"]})]});}addPropertyControls(CalendarEventGenerator,{title:{type:ControlType.String,title:\"Title\",defaultValue:\"Team Meeting on Zoom\"},zoomRoom:{type:ControlType.Link,title:\"Live Event Link\",defaultValue:\"https://zoom.us/j/yourmeeting\"},startDateTime:{type:ControlType.Date,title:\"Start Time\",defaultValue:new Date(Date.now()+24*60*60*1e3).toISOString(),displayTime:true},showGoogle:{type:ControlType.Boolean,title:\"Google Link\",defaultValue:true},showOutlook:{type:ControlType.Boolean,title:\"Outlook Link\",defaultValue:true},showYahoo:{type:ControlType.Boolean,title:\"Yahoo Link\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CalendarEventGenerator\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CalendarEventGenerator.map"],"mappings":"iLAQG,SAAS,EAAsB,EAAW,CAC7C,IAAM,EAAK,IAAI,KAAK,EAAW,CAA2S,MAAM,GAArS,EAAK,gBAAgB,GAAU,OAAO,EAAK,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,GAAU,OAAO,EAAK,YAAY,CAAC,CAAC,SAAS,EAAE,IAAI,CAAyL,GAA/K,OAAO,EAAK,aAAa,CAAC,CAAC,SAAS,EAAE,IAAI,GAAU,OAAO,EAAK,eAAe,CAAC,CAAC,SAAS,EAAE,IAAI,GAAU,OAAO,EAAK,eAAe,CAAC,CAAC,SAAS,EAAE,IAAI,CAAyC,GAAI,SAAS,EAAqB,CAAC,QAAM,QAAM,MAAI,cAAY,YAAU,CAAqK,MAAM,0CAA7J,IAAI,g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