ical-generator 11.1.3-develop.1 → 11.1.3-develop.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region src/attendee.d.ts
2
- declare enum ICalAttendeeRole {
2
+ export declare enum ICalAttendeeRole {
3
3
  CHAIR = "CHAIR",
4
4
  NON = "NON-PARTICIPANT",
5
5
  OPT = "OPT-PARTICIPANT",
@@ -10,14 +10,14 @@ declare enum ICalAttendeeScheduleAgent {
10
10
  NONE = "NONE",
11
11
  SERVER = "SERVER"
12
12
  }
13
- declare enum ICalAttendeeStatus {
13
+ export declare enum ICalAttendeeStatus {
14
14
  ACCEPTED = "ACCEPTED",
15
15
  DECLINED = "DECLINED",
16
16
  DELEGATED = "DELEGATED",
17
17
  NEEDSACTION = "NEEDS-ACTION",
18
18
  TENTATIVE = "TENTATIVE"
19
19
  }
20
- declare enum ICalAttendeeType {
20
+ export declare enum ICalAttendeeType {
21
21
  GROUP = "GROUP",
22
22
  INDIVIDUAL = "INDIVIDUAL",
23
23
  RESOURCE = "RESOURCE",
@@ -326,7 +326,7 @@ declare class ICalAttendee {
326
326
  }
327
327
  //#endregion
328
328
  //#region src/types.d.ts
329
- declare enum ICalEventRepeatingFreq {
329
+ export declare enum ICalEventRepeatingFreq {
330
330
  DAILY = "DAILY",
331
331
  HOURLY = "HOURLY",
332
332
  MINUTELY = "MINUTELY",
@@ -340,7 +340,7 @@ declare enum ICalEventRepeatingFreq {
340
340
  *
341
341
  * Controls whether Apple clients give suggestions like "Time to leave" notifications, route prompts in Apple Maps, etc.
342
342
  */
343
- declare enum ICalEventTravelTimeSuggestion {
343
+ export declare enum ICalEventTravelTimeSuggestion {
344
344
  AUTOMATIC = "AUTOMATIC",
345
345
  DISABLED = "DISABLED",
346
346
  ENABLED = "ENABLED"
@@ -350,13 +350,13 @@ declare enum ICalEventTravelTimeSuggestion {
350
350
  *
351
351
  * Controls which mode of transportation is used by Apple Calendar clients for calculating travel time and suggesting routes
352
352
  */
353
- declare enum ICalEventTravelTimeTransportation {
353
+ export declare enum ICalEventTravelTimeTransportation {
354
354
  BICYCLE = "BICYCLE",
355
355
  CAR = "CAR",
356
356
  TRANSIT = "TRANSIT",
357
357
  WALKING = "WALKING"
358
358
  }
359
- declare enum ICalWeekday {
359
+ export declare enum ICalWeekday {
360
360
  FR = "FR",
361
361
  MO = "MO",
362
362
  SA = "SA",
@@ -505,12 +505,12 @@ interface ICalTZDateStub extends Date {
505
505
  }
506
506
  //#endregion
507
507
  //#region src/alarm.d.ts
508
- declare enum ICalAlarmType {
508
+ export declare enum ICalAlarmType {
509
509
  audio = "audio",
510
510
  display = "display",
511
511
  email = "email"
512
512
  }
513
- declare const ICalAlarmRelatesTo: {
513
+ export declare const ICalAlarmRelatesTo: {
514
514
  readonly end: "END";
515
515
  readonly start: "START";
516
516
  };
@@ -543,7 +543,7 @@ interface ICalAlarmJSONData {
543
543
  value: string;
544
544
  }[];
545
545
  }
546
- type ICalAlarmRelatesTo = (typeof ICalAlarmRelatesTo)[keyof typeof ICalAlarmRelatesTo];
546
+ export type ICalAlarmRelatesTo = (typeof ICalAlarmRelatesTo)[keyof typeof ICalAlarmRelatesTo];
547
547
  interface ICalAlarmRepeatData {
548
548
  interval: number;
549
549
  times: number;
@@ -961,23 +961,23 @@ declare class ICalCategory {
961
961
  }
962
962
  //#endregion
963
963
  //#region src/event.d.ts
964
- declare enum ICalEventBusyStatus {
964
+ export declare enum ICalEventBusyStatus {
965
965
  BUSY = "BUSY",
966
966
  FREE = "FREE",
967
967
  OOF = "OOF",
968
968
  TENTATIVE = "TENTATIVE"
969
969
  }
970
- declare enum ICalEventClass {
970
+ export declare enum ICalEventClass {
971
971
  CONFIDENTIAL = "CONFIDENTIAL",
972
972
  PRIVATE = "PRIVATE",
973
973
  PUBLIC = "PUBLIC"
974
974
  }
975
- declare enum ICalEventStatus {
975
+ export declare enum ICalEventStatus {
976
976
  CANCELLED = "CANCELLED",
977
977
  CONFIRMED = "CONFIRMED",
978
978
  TENTATIVE = "TENTATIVE"
979
979
  }
980
- declare enum ICalEventTransparency {
980
+ export declare enum ICalEventTransparency {
981
981
  OPAQUE = "OPAQUE",
982
982
  TRANSPARENT = "TRANSPARENT"
983
983
  }
@@ -1967,7 +1967,7 @@ declare class ICalEvent {
1967
1967
  }
1968
1968
  //#endregion
1969
1969
  //#region src/calendar.d.ts
1970
- declare enum ICalCalendarMethod {
1970
+ export declare enum ICalCalendarMethod {
1971
1971
  ADD = "ADD",
1972
1972
  CANCEL = "CANCEL",
1973
1973
  COUNTER = "COUNTER",
@@ -2469,18 +2469,18 @@ declare class ICalCalendar {
2469
2469
  * parameter value encoding (RFC 6868), otherwise the TEXT escaping of
2470
2470
  * RFC 5545 section 3.3.11 is applied.
2471
2471
  */
2472
- declare function escape(str: string | unknown, inQuotes: boolean): string;
2473
- declare function foldLines(input: string): string;
2472
+ export declare function escape(str: string | unknown, inQuotes: boolean): string;
2473
+ export declare function foldLines(input: string): string;
2474
2474
  /**
2475
2475
  * Converts a valid date/time object supported by this library to a string.
2476
2476
  */
2477
- declare function formatDate(timezone: null | string, d: ICalDateTimeValue, dateonly?: boolean, floating?: boolean): string;
2477
+ export declare function formatDate(timezone: null | string, d: ICalDateTimeValue, dateonly?: boolean, floating?: boolean): string;
2478
2478
  /**
2479
2479
  * Converts a valid date/time object supported by this library to a string.
2480
2480
  * For information about this format, see RFC 5545, section 3.3.5
2481
2481
  * https://tools.ietf.org/html/rfc5545#section-3.3.5
2482
2482
  */
2483
- declare function formatDateTZ(timezone: null | string, property: string, date: Date | ICalDateTimeValue | string, eventData?: {
2483
+ export declare function formatDateTZ(timezone: null | string, property: string, date: Date | ICalDateTimeValue | string, eventData?: {
2484
2484
  floating?: boolean | null;
2485
2485
  timezone?: null | string;
2486
2486
  }): string;
@@ -2521,5 +2521,5 @@ declare function formatDateTZ(timezone: null | string, property: string, date: D
2521
2521
  */
2522
2522
  declare function ical(data?: ICalCalendarData): ICalCalendar;
2523
2523
  //#endregion
2524
- export { ICalAlarm, type ICalAlarmBaseData, type ICalAlarmData, type ICalAlarmJSONData, ICalAlarmRelatesTo, type ICalAlarmRepeatData, type ICalAlarmTriggerAfterData, type ICalAlarmTriggerBeforeData, type ICalAlarmTriggerData, ICalAlarmType, type ICalAlarmTypeValue, type ICalAttachment, ICalAttendee, type ICalAttendeeData, type ICalAttendeeJSONData, ICalAttendeeRole, type ICalAttendeeScheduleAgent, ICalAttendeeStatus, ICalAttendeeType, ICalCalendar, type ICalCalendarData, type ICalCalendarJSONData, ICalCalendarMethod, type ICalCalendarProdIdData, ICalCategory, type ICalCategoryData, type ICalCategoryJSONData, type ICalDateTimeValue, type ICalDayJsStub, type ICalDescription, ICalEvent, ICalEventBusyStatus, ICalEventClass, type ICalEventData, type ICalEventJSONData, type ICalEventJSONRepeatingData, ICalEventRepeatingFreq, ICalEventStatus, ICalEventTransparency, type ICalEventTravelTime, ICalEventTravelTimeSuggestion, ICalEventTravelTimeTransportation, type ICalGeo, type ICalLocation, type ICalLocationWithTitle, type ICalLocationWithoutTitle, type ICalLuxonDateTimeStub, type ICalMomentDurationStub, type ICalMomentStub, type ICalMomentTimezoneStub, type ICalOrganizer, type ICalRRuleStub, type ICalRepeatingOptions, type ICalTZDateStub, type ICalTemporalInstantStub, type ICalTemporalPlainDateStub, type ICalTemporalPlainDateTimeStub, type ICalTemporalZonedDateTimeStub, type ICalTimezone, ICalWeekday, ical as default, escape, foldLines, formatDate, formatDateTZ };
2524
+ export { ICalAlarm, type ICalAlarmBaseData, type ICalAlarmData, type ICalAlarmJSONData, type ICalAlarmRepeatData, type ICalAlarmTriggerAfterData, type ICalAlarmTriggerBeforeData, type ICalAlarmTriggerData, type ICalAlarmTypeValue, type ICalAttachment, ICalAttendee, type ICalAttendeeData, type ICalAttendeeJSONData, type ICalAttendeeScheduleAgent, ICalCalendar, type ICalCalendarData, type ICalCalendarJSONData, type ICalCalendarProdIdData, ICalCategory, type ICalCategoryData, type ICalCategoryJSONData, type ICalDateTimeValue, type ICalDayJsStub, type ICalDescription, ICalEvent, type ICalEventData, type ICalEventJSONData, type ICalEventJSONRepeatingData, type ICalEventTravelTime, type ICalGeo, type ICalLocation, type ICalLocationWithTitle, type ICalLocationWithoutTitle, type ICalLuxonDateTimeStub, type ICalMomentDurationStub, type ICalMomentStub, type ICalMomentTimezoneStub, type ICalOrganizer, type ICalRRuleStub, type ICalRepeatingOptions, type ICalTZDateStub, type ICalTemporalInstantStub, type ICalTemporalPlainDateStub, type ICalTemporalPlainDateTimeStub, type ICalTemporalZonedDateTimeStub, type ICalTimezone, ical as default };
2525
2525
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region src/attendee.d.ts
2
- declare enum ICalAttendeeRole {
2
+ export declare enum ICalAttendeeRole {
3
3
  CHAIR = "CHAIR",
4
4
  NON = "NON-PARTICIPANT",
5
5
  OPT = "OPT-PARTICIPANT",
@@ -10,14 +10,14 @@ declare enum ICalAttendeeScheduleAgent {
10
10
  NONE = "NONE",
11
11
  SERVER = "SERVER"
12
12
  }
13
- declare enum ICalAttendeeStatus {
13
+ export declare enum ICalAttendeeStatus {
14
14
  ACCEPTED = "ACCEPTED",
15
15
  DECLINED = "DECLINED",
16
16
  DELEGATED = "DELEGATED",
17
17
  NEEDSACTION = "NEEDS-ACTION",
18
18
  TENTATIVE = "TENTATIVE"
19
19
  }
20
- declare enum ICalAttendeeType {
20
+ export declare enum ICalAttendeeType {
21
21
  GROUP = "GROUP",
22
22
  INDIVIDUAL = "INDIVIDUAL",
23
23
  RESOURCE = "RESOURCE",
@@ -326,7 +326,7 @@ declare class ICalAttendee {
326
326
  }
327
327
  //#endregion
328
328
  //#region src/types.d.ts
329
- declare enum ICalEventRepeatingFreq {
329
+ export declare enum ICalEventRepeatingFreq {
330
330
  DAILY = "DAILY",
331
331
  HOURLY = "HOURLY",
332
332
  MINUTELY = "MINUTELY",
@@ -340,7 +340,7 @@ declare enum ICalEventRepeatingFreq {
340
340
  *
341
341
  * Controls whether Apple clients give suggestions like "Time to leave" notifications, route prompts in Apple Maps, etc.
342
342
  */
343
- declare enum ICalEventTravelTimeSuggestion {
343
+ export declare enum ICalEventTravelTimeSuggestion {
344
344
  AUTOMATIC = "AUTOMATIC",
345
345
  DISABLED = "DISABLED",
346
346
  ENABLED = "ENABLED"
@@ -350,13 +350,13 @@ declare enum ICalEventTravelTimeSuggestion {
350
350
  *
351
351
  * Controls which mode of transportation is used by Apple Calendar clients for calculating travel time and suggesting routes
352
352
  */
353
- declare enum ICalEventTravelTimeTransportation {
353
+ export declare enum ICalEventTravelTimeTransportation {
354
354
  BICYCLE = "BICYCLE",
355
355
  CAR = "CAR",
356
356
  TRANSIT = "TRANSIT",
357
357
  WALKING = "WALKING"
358
358
  }
359
- declare enum ICalWeekday {
359
+ export declare enum ICalWeekday {
360
360
  FR = "FR",
361
361
  MO = "MO",
362
362
  SA = "SA",
@@ -505,12 +505,12 @@ interface ICalTZDateStub extends Date {
505
505
  }
506
506
  //#endregion
507
507
  //#region src/alarm.d.ts
508
- declare enum ICalAlarmType {
508
+ export declare enum ICalAlarmType {
509
509
  audio = "audio",
510
510
  display = "display",
511
511
  email = "email"
512
512
  }
513
- declare const ICalAlarmRelatesTo: {
513
+ export declare const ICalAlarmRelatesTo: {
514
514
  readonly end: "END";
515
515
  readonly start: "START";
516
516
  };
@@ -543,7 +543,7 @@ interface ICalAlarmJSONData {
543
543
  value: string;
544
544
  }[];
545
545
  }
546
- type ICalAlarmRelatesTo = (typeof ICalAlarmRelatesTo)[keyof typeof ICalAlarmRelatesTo];
546
+ export type ICalAlarmRelatesTo = (typeof ICalAlarmRelatesTo)[keyof typeof ICalAlarmRelatesTo];
547
547
  interface ICalAlarmRepeatData {
548
548
  interval: number;
549
549
  times: number;
@@ -961,23 +961,23 @@ declare class ICalCategory {
961
961
  }
962
962
  //#endregion
963
963
  //#region src/event.d.ts
964
- declare enum ICalEventBusyStatus {
964
+ export declare enum ICalEventBusyStatus {
965
965
  BUSY = "BUSY",
966
966
  FREE = "FREE",
967
967
  OOF = "OOF",
968
968
  TENTATIVE = "TENTATIVE"
969
969
  }
970
- declare enum ICalEventClass {
970
+ export declare enum ICalEventClass {
971
971
  CONFIDENTIAL = "CONFIDENTIAL",
972
972
  PRIVATE = "PRIVATE",
973
973
  PUBLIC = "PUBLIC"
974
974
  }
975
- declare enum ICalEventStatus {
975
+ export declare enum ICalEventStatus {
976
976
  CANCELLED = "CANCELLED",
977
977
  CONFIRMED = "CONFIRMED",
978
978
  TENTATIVE = "TENTATIVE"
979
979
  }
980
- declare enum ICalEventTransparency {
980
+ export declare enum ICalEventTransparency {
981
981
  OPAQUE = "OPAQUE",
982
982
  TRANSPARENT = "TRANSPARENT"
983
983
  }
@@ -1967,7 +1967,7 @@ declare class ICalEvent {
1967
1967
  }
1968
1968
  //#endregion
1969
1969
  //#region src/calendar.d.ts
1970
- declare enum ICalCalendarMethod {
1970
+ export declare enum ICalCalendarMethod {
1971
1971
  ADD = "ADD",
1972
1972
  CANCEL = "CANCEL",
1973
1973
  COUNTER = "COUNTER",
@@ -2469,18 +2469,18 @@ declare class ICalCalendar {
2469
2469
  * parameter value encoding (RFC 6868), otherwise the TEXT escaping of
2470
2470
  * RFC 5545 section 3.3.11 is applied.
2471
2471
  */
2472
- declare function escape(str: string | unknown, inQuotes: boolean): string;
2473
- declare function foldLines(input: string): string;
2472
+ export declare function escape(str: string | unknown, inQuotes: boolean): string;
2473
+ export declare function foldLines(input: string): string;
2474
2474
  /**
2475
2475
  * Converts a valid date/time object supported by this library to a string.
2476
2476
  */
2477
- declare function formatDate(timezone: null | string, d: ICalDateTimeValue, dateonly?: boolean, floating?: boolean): string;
2477
+ export declare function formatDate(timezone: null | string, d: ICalDateTimeValue, dateonly?: boolean, floating?: boolean): string;
2478
2478
  /**
2479
2479
  * Converts a valid date/time object supported by this library to a string.
2480
2480
  * For information about this format, see RFC 5545, section 3.3.5
2481
2481
  * https://tools.ietf.org/html/rfc5545#section-3.3.5
2482
2482
  */
2483
- declare function formatDateTZ(timezone: null | string, property: string, date: Date | ICalDateTimeValue | string, eventData?: {
2483
+ export declare function formatDateTZ(timezone: null | string, property: string, date: Date | ICalDateTimeValue | string, eventData?: {
2484
2484
  floating?: boolean | null;
2485
2485
  timezone?: null | string;
2486
2486
  }): string;
@@ -2521,5 +2521,5 @@ declare function formatDateTZ(timezone: null | string, property: string, date: D
2521
2521
  */
2522
2522
  declare function ical(data?: ICalCalendarData): ICalCalendar;
2523
2523
  //#endregion
2524
- export { ICalAlarm, type ICalAlarmBaseData, type ICalAlarmData, type ICalAlarmJSONData, ICalAlarmRelatesTo, type ICalAlarmRepeatData, type ICalAlarmTriggerAfterData, type ICalAlarmTriggerBeforeData, type ICalAlarmTriggerData, ICalAlarmType, type ICalAlarmTypeValue, type ICalAttachment, ICalAttendee, type ICalAttendeeData, type ICalAttendeeJSONData, ICalAttendeeRole, type ICalAttendeeScheduleAgent, ICalAttendeeStatus, ICalAttendeeType, ICalCalendar, type ICalCalendarData, type ICalCalendarJSONData, ICalCalendarMethod, type ICalCalendarProdIdData, ICalCategory, type ICalCategoryData, type ICalCategoryJSONData, type ICalDateTimeValue, type ICalDayJsStub, type ICalDescription, ICalEvent, ICalEventBusyStatus, ICalEventClass, type ICalEventData, type ICalEventJSONData, type ICalEventJSONRepeatingData, ICalEventRepeatingFreq, ICalEventStatus, ICalEventTransparency, type ICalEventTravelTime, ICalEventTravelTimeSuggestion, ICalEventTravelTimeTransportation, type ICalGeo, type ICalLocation, type ICalLocationWithTitle, type ICalLocationWithoutTitle, type ICalLuxonDateTimeStub, type ICalMomentDurationStub, type ICalMomentStub, type ICalMomentTimezoneStub, type ICalOrganizer, type ICalRRuleStub, type ICalRepeatingOptions, type ICalTZDateStub, type ICalTemporalInstantStub, type ICalTemporalPlainDateStub, type ICalTemporalPlainDateTimeStub, type ICalTemporalZonedDateTimeStub, type ICalTimezone, ICalWeekday, ical as default, escape, foldLines, formatDate, formatDateTZ };
2524
+ export { ICalAlarm, type ICalAlarmBaseData, type ICalAlarmData, type ICalAlarmJSONData, type ICalAlarmRepeatData, type ICalAlarmTriggerAfterData, type ICalAlarmTriggerBeforeData, type ICalAlarmTriggerData, type ICalAlarmTypeValue, type ICalAttachment, ICalAttendee, type ICalAttendeeData, type ICalAttendeeJSONData, type ICalAttendeeScheduleAgent, ICalCalendar, type ICalCalendarData, type ICalCalendarJSONData, type ICalCalendarProdIdData, ICalCategory, type ICalCategoryData, type ICalCategoryJSONData, type ICalDateTimeValue, type ICalDayJsStub, type ICalDescription, ICalEvent, type ICalEventData, type ICalEventJSONData, type ICalEventJSONRepeatingData, type ICalEventTravelTime, type ICalGeo, type ICalLocation, type ICalLocationWithTitle, type ICalLocationWithoutTitle, type ICalLuxonDateTimeStub, type ICalMomentDurationStub, type ICalMomentStub, type ICalMomentTimezoneStub, type ICalOrganizer, type ICalRRuleStub, type ICalRepeatingOptions, type ICalTZDateStub, type ICalTemporalInstantStub, type ICalTemporalPlainDateStub, type ICalTemporalPlainDateTimeStub, type ICalTemporalZonedDateTimeStub, type ICalTimezone, ical as default };
2525
2525
  //# sourceMappingURL=index.d.mts.map
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
- let e=function(e){return e.DAILY=`DAILY`,e.HOURLY=`HOURLY`,e.MINUTELY=`MINUTELY`,e.MONTHLY=`MONTHLY`,e.SECONDLY=`SECONDLY`,e.WEEKLY=`WEEKLY`,e.YEARLY=`YEARLY`,e}({}),t=function(e){return e.AUTOMATIC=`AUTOMATIC`,e.DISABLED=`DISABLED`,e.ENABLED=`ENABLED`,e}({}),n=function(e){return e.BICYCLE=`BICYCLE`,e.CAR=`CAR`,e.TRANSIT=`TRANSIT`,e.WALKING=`WALKING`,e}({}),r=function(e){return e.FR=`FR`,e.MO=`MO`,e.SA=`SA`,e.SU=`SU`,e.TH=`TH`,e.TU=`TU`,e.WE=`WE`,e}({});function i(e,t,n){if(Array.isArray(t))e.x=t.map(e=>{if(Array.isArray(e))return e;if(typeof e.key!=`string`||typeof e.value!=`string`)throw Error(`Either key or value is not a string!`);if(e.key.substr(0,2)!==`X-`)throw Error("Key has to start with `X-`!");return[e.key,e.value]});else if(typeof t==`object`)e.x=Object.entries(t).map(([e,t])=>{if(typeof e!=`string`||typeof t!=`string`)throw Error(`Either key or value is not a string!`);if(e.substr(0,2)!==`X-`)throw Error("Key has to start with `X-`!");return[e,t]});else if(typeof t==`string`&&typeof n==`string`){if(t.substr(0,2)!==`X-`)throw Error("Key has to start with `X-`!");e.x.push([t,n])}else return e.x.map(e=>({key:e[0],value:e[1]}))}function a(e,t){if(e instanceof Date&&isNaN(e.getTime())||typeof e==`string`&&isNaN(new Date(e).getTime()))throw Error(`\`${t}\` has to be a valid date!`);if(e instanceof Date||typeof e==`string`||typeof e==`object`&&e&&(w(e)||C(e)||S(e)||x(e))||h(e)&&e.isValid===!0||(g(e)||m(e))&&e.isValid())return e;throw Error(`\`${t}\` has to be a valid date!`)}function o(e,t){let n=Object.values(e),r=String(t).toUpperCase();if(!r||!n.includes(r))throw Error(`Input must be one of the following: ${n.join(`, `)}`);return r}function s(e,t){let n=null;if(typeof t==`string`){let e=t.match(/^(.+) ?<([^>]+)>$/);e?n={email:e[2].trim(),name:e[1].trim()}:t.includes(`@`)&&(n={email:t.trim(),name:t.trim()})}else typeof t==`object`&&(n={email:t.email,mailto:t.mailto,name:t.name,sentBy:t.sentBy});if(!n&&typeof t==`string`)throw Error("`"+e+"` isn't formated correctly. See https://sebbo2002.github.io/ical-generator/develop/reference/interfaces/ICalOrganizer.html");if(!n)throw Error("`"+e+"` needs to be a valid formed string or an object. See https://sebbo2002.github.io/ical-generator/develop/reference/interfaces/ICalOrganizer.html");if(!n.name)throw Error("`"+e+".name` is empty!");if(!n.email)throw Error("`"+e+".email` is empty!");return n}function c(e,t){return t?l(e):String(e).replace(/[\\;,]/g,e=>`\\`+e).replace(/(?:\r\n|\r|\n)/g,`\\n`)}function l(e){return String(e).replace(/\^/g,`^^`).replace(/"/g,`^'`).replace(/(?:\r\n|\r|\n)/g,`^n`)}function u(e){return e.split(`\r
1
+ let e=/* @__PURE__ */ function(e){return e.DAILY=`DAILY`,e.HOURLY=`HOURLY`,e.MINUTELY=`MINUTELY`,e.MONTHLY=`MONTHLY`,e.SECONDLY=`SECONDLY`,e.WEEKLY=`WEEKLY`,e.YEARLY=`YEARLY`,e}({}),t=/* @__PURE__ */ function(e){return e.AUTOMATIC=`AUTOMATIC`,e.DISABLED=`DISABLED`,e.ENABLED=`ENABLED`,e}({}),n=/* @__PURE__ */ function(e){return e.BICYCLE=`BICYCLE`,e.CAR=`CAR`,e.TRANSIT=`TRANSIT`,e.WALKING=`WALKING`,e}({}),r=/* @__PURE__ */ function(e){return e.FR=`FR`,e.MO=`MO`,e.SA=`SA`,e.SU=`SU`,e.TH=`TH`,e.TU=`TU`,e.WE=`WE`,e}({});function i(e,t,n){if(Array.isArray(t))e.x=t.map(e=>{if(Array.isArray(e))return e;if(typeof e.key!=`string`||typeof e.value!=`string`)throw Error(`Either key or value is not a string!`);if(e.key.substr(0,2)!==`X-`)throw Error("Key has to start with `X-`!");return[e.key,e.value]});else if(typeof t==`object`)e.x=Object.entries(t).map(([e,t])=>{if(typeof e!=`string`||typeof t!=`string`)throw Error(`Either key or value is not a string!`);if(e.substr(0,2)!==`X-`)throw Error("Key has to start with `X-`!");return[e,t]});else if(typeof t==`string`&&typeof n==`string`){if(t.substr(0,2)!==`X-`)throw Error("Key has to start with `X-`!");e.x.push([t,n])}else return e.x.map(e=>({key:e[0],value:e[1]}))}function a(e,t){if(e instanceof Date&&isNaN(e.getTime())||typeof e==`string`&&isNaN(new Date(e).getTime()))throw Error(`\`${t}\` has to be a valid date!`);if(e instanceof Date||typeof e==`string`||typeof e==`object`&&e&&(w(e)||C(e)||S(e)||x(e))||h(e)&&e.isValid===!0||(g(e)||m(e))&&e.isValid())return e;throw Error(`\`${t}\` has to be a valid date!`)}function o(e,t){let n=Object.values(e),r=String(t).toUpperCase();if(!r||!n.includes(r))throw Error(`Input must be one of the following: ${n.join(`, `)}`);return r}function s(e,t){let n=null;if(typeof t==`string`){let e=t.match(/^(.+) ?<([^>]+)>$/);e?n={email:e[2].trim(),name:e[1].trim()}:t.includes(`@`)&&(n={email:t.trim(),name:t.trim()})}else typeof t==`object`&&(n={email:t.email,mailto:t.mailto,name:t.name,sentBy:t.sentBy});if(!n&&typeof t==`string`)throw Error("`"+e+"` isn't formated correctly. See https://sebbo2002.github.io/ical-generator/develop/reference/interfaces/ICalOrganizer.html");if(!n)throw Error("`"+e+"` needs to be a valid formed string or an object. See https://sebbo2002.github.io/ical-generator/develop/reference/interfaces/ICalOrganizer.html");if(!n.name)throw Error("`"+e+".name` is empty!");if(!n.email)throw Error("`"+e+".email` is empty!");return n}function c(e,t){return t?l(e):String(e).replace(/[\\;,]/g,e=>`\\`+e).replace(/(?:\r\n|\r|\n)/g,`\\n`)}function l(e){return String(e).replace(/\^/g,`^^`).replace(/"/g,`^'`).replace(/(?:\r\n|\r|\n)/g,`^n`)}function u(e){return e.split(`\r
2
2
  `).map(function(e){if(e.length<=74&&A(e))return e;let t=``,n=0;for(let r=0;r<e.length;r++){let i=e.charAt(r),a=e.charCodeAt(r),o;a<128?o=1:a<2048?o=2:a>=55296&&a<=56319?(i+=e.charAt(++r),o=4):o=3,n+=o,n>74&&(t+=`\r
3
3
  `,n=o),t+=i}return t}).join(`\r
4
4
  `)}function d(e,t,n,r){if(e?.startsWith(`/`)&&(e=e.substr(1)),typeof t==`string`||t instanceof Date){let i=T(t)?t.withTimeZone(e):new Date(t),a=i.getUTCFullYear().toString().padStart(4,`0`)+String(i.getUTCMonth()+1).padStart(2,`0`)+i.getUTCDate().toString().padStart(2,`0`);return e&&(a=i.getFullYear().toString().padStart(2,`0`)+String(i.getMonth()+1).padStart(2,`0`)+i.getDate().toString().padStart(2,`0`)),n?a:e?(a+=`T`+i.getHours().toString().padStart(2,`0`)+i.getMinutes().toString().padStart(2,`0`)+i.getSeconds().toString().padStart(2,`0`),a):(a+=`T`+i.getUTCHours().toString().padStart(2,`0`)+i.getUTCMinutes().toString().padStart(2,`0`)+i.getUTCSeconds().toString().padStart(2,`0`)+(r?``:`Z`),a)}if(g(t)){let i=e?v(t)&&!t.tz()?t.clone().tz(e):t:r||n&&v(t)&&t.tz()?t:t.utc();return i.format(`YYYYMMDD`)+(n?``:`T`+i.format(`HHmmss`)+(r||e?``:`Z`))}if(h(t)){let i=e?t.setZone(e):r||n&&t.zone.type!==`system`?t:t.setZone(`utc`);return i.toFormat(`yyyyLLdd`)+(n?``:`T`+i.toFormat(`HHmmss`)+(r||e?``:`Z`))}if(w(t)){let i=t;return e&&(i=t.withTimeZone(e)),!e&&t.timeZoneId!==`UTC`&&(i=t.withTimeZone(`UTC`)),d(null,i.toPlainDateTime(),n,r||!!e)}if(C(t)){if(n)return t.year.toString().padStart(4,`0`)+t.month.toString().padStart(2,`0`)+t.day.toString().padStart(2,`0`);if(e){let i=t.toZonedDateTime(e);return d(e,i,n,r)}return t.year.toString().padStart(4,`0`)+t.month.toString().padStart(2,`0`)+t.day.toString().padStart(2,`0`)+`T`+t.hour.toString().padStart(2,`0`)+t.minute.toString().padStart(2,`0`)+t.second.toString().padStart(2,`0`)+(r||e?``:`Z`)}if(S(t))return t.year.toString().padStart(4,`0`)+t.month.toString().padStart(2,`0`)+t.day.toString().padStart(2,`0`)+(n?``:`T000000`+(r||e?``:`Z`));if(x(t)){let i=e||`UTC`,a=t.toZonedDateTimeISO(i);return d(e,a,n,r)}{let i=t;if(e)i=typeof t.tz==`function`?t.tz(e):t;else if(!r){if(typeof t.utc==`function`)i=t.utc();else throw Error(`Unable to convert dayjs object to UTC value: UTC plugin is not available!`)}return i.format(`YYYYMMDD`)+(n?``:`T`+i.format(`HHmmss`)+(r||e?``:`Z`))}}function f(e,t,n,r){let i=``,a=r?.floating||!1;return r?.timezone&&(i=`;TZID=`+r.timezone,a=!0),t+i+`:`+d(e,n,!1,a)}function p(e){let t=e.x.map(([e,t])=>e.toUpperCase()+`:`+c(t,!1)).join(`\r
5
5
  `);return t.length?t+`\r
6
- `:``}function m(e){return typeof e==`object`&&!!e&&!(e instanceof Date)&&!g(e)&&!h(e)&&!b(e)}function h(e){return typeof e==`object`&&!!e&&`toJSDate`in e&&typeof e.toJSDate==`function`&&!b(e)}function g(e){return e!=null&&e._isAMomentObject!=null&&!b(e)}function _(e){return typeof e==`object`&&!!e&&`asSeconds`in e&&typeof e.asSeconds==`function`}function v(e){return g(e)&&`tz`in e&&typeof e.tz==`function`}function y(e){return typeof e==`object`&&!!e&&`between`in e&&typeof e.between==`function`&&typeof e.toString==`function`}function b(e){return w(e)||C(e)||S(e)||x(e)}function x(e){return typeof e==`object`&&!!e&&!w(e)&&!C(e)&&!S(e)&&`toZonedDateTimeISO`in e&&typeof e.toZonedDateTimeISO==`function`&&!(`year`in e)&&!(`timeZoneId`in e)}function S(e){return typeof e==`object`&&!!e&&!w(e)&&!C(e)&&`toPlainDateTime`in e&&typeof e.toPlainDateTime==`function`&&`year`in e&&typeof e.year==`number`&&`month`in e&&typeof e.month==`number`&&`day`in e&&typeof e.day==`number`&&!(`hour`in e)&&!(`timeZoneId`in e)&&!(`epochSeconds`in e)}function C(e){return typeof e==`object`&&!!e&&!w(e)&&`toZonedDateTime`in e&&typeof e.toZonedDateTime==`function`&&`toPlainDate`in e&&typeof e.toPlainDate==`function`&&`year`in e&&typeof e.year==`number`&&`month`in e&&typeof e.month==`number`&&`day`in e&&typeof e.day==`number`&&`hour`in e&&typeof e.hour==`number`&&`minute`in e&&typeof e.minute==`number`&&`second`in e&&typeof e.second==`number`&&!(`timeZone`in e)}function w(e){return typeof e==`object`&&!!e&&`timeZoneId`in e&&typeof e.timeZoneId==`string`&&`toPlainDateTime`in e&&typeof e.toPlainDateTime==`function`&&`year`in e&&typeof e.year==`number`&&`month`in e&&typeof e.month==`number`&&`day`in e&&typeof e.day==`number`&&`hour`in e&&typeof e.hour==`number`&&`minute`in e&&typeof e.minute==`number`&&`second`in e&&typeof e.second==`number`}function T(e){return e instanceof Date&&`internal`in e&&e.internal instanceof Date&&`withTimeZone`in e&&typeof e.withTimeZone==`function`&&`tzComponents`in e&&typeof e.tzComponents==`function`}function E(e){let t=l(e);return/[,:;]/.test(t)?`"`+t+`"`:t}function D(e){if(typeof e==`string`||e instanceof Date)return new Date(e);if(w(e)){let t=e.toInstant();return new Date(t.epochMilliseconds)}return C(e)?new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second)):S(e)?new Date(Date.UTC(e.year,e.month-1,e.day)):x(e)?new Date(e.epochMilliseconds):h(e)?e.toJSDate():e.toDate()}function O(e){let t=``;return e<0&&(t=`-`,e*=-1),t+=`P`,e>=86400&&(t+=Math.floor(e/86400)+`D`,e%=86400),!e&&t.length>1?t:(t+=`T`,e>=3600&&(t+=Math.floor(e/3600)+`H`,e%=3600),e>=60&&(t+=Math.floor(e/60)+`M`,e%=60),e>0?t+=e+`S`:t.length<=2&&(t+=`0S`),t)}function k(e){return e?typeof e==`string`?e:w(e)?k(e.withTimeZone(`UTC`).toPlainDateTime()):(b(e),e.toJSON()):null}function A(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!1;return!0}let j=function(e){return e.CHAIR=`CHAIR`,e.NON=`NON-PARTICIPANT`,e.OPT=`OPT-PARTICIPANT`,e.REQ=`REQ-PARTICIPANT`,e}({}),M=function(e){return e.CLIENT=`CLIENT`,e.NONE=`NONE`,e.SERVER=`SERVER`,e}({}),N=function(e){return e.ACCEPTED=`ACCEPTED`,e.DECLINED=`DECLINED`,e.DELEGATED=`DELEGATED`,e.NEEDSACTION=`NEEDS-ACTION`,e.TENTATIVE=`TENTATIVE`,e}({}),P=function(e){return e.GROUP=`GROUP`,e.INDIVIDUAL=`INDIVIDUAL`,e.RESOURCE=`RESOURCE`,e.ROOM=`ROOM`,e.UNKNOWN=`UNKNOWN`,e}({});var F=class e{data;parent;constructor(e,t){if(this.data={delegatedFrom:null,delegatedTo:null,email:``,mailto:null,name:null,role:`REQ-PARTICIPANT`,rsvp:null,scheduleAgent:null,sentBy:null,status:null,type:null,x:[]},this.parent=t,!this.parent)throw Error("`event` option required!");if(!e.email)throw Error("No value for `email` in ICalAttendee given!");e.name!==void 0&&this.name(e.name),e.email!==void 0&&this.email(e.email),e.mailto!==void 0&&this.mailto(e.mailto),e.sentBy!==void 0&&this.sentBy(e.sentBy),e.status!==void 0&&this.status(e.status),e.role!==void 0&&this.role(e.role),e.rsvp!==void 0&&this.rsvp(e.rsvp),e.type!==void 0&&this.type(e.type),e.delegatedTo!==void 0&&this.delegatedTo(e.delegatedTo),e.delegatedFrom!==void 0&&this.delegatedFrom(e.delegatedFrom),e.delegatesTo&&this.delegatesTo(e.delegatesTo),e.delegatesFrom&&this.delegatesFrom(e.delegatesFrom),e.scheduleAgent!==void 0&&this.scheduleAgent(e.scheduleAgent),e.x!==void 0&&this.x(e.x)}delegatedFrom(t){return t===void 0?this.data.delegatedFrom:(t?typeof t==`string`?this.data.delegatedFrom=new e(s(`delegatedFrom`,t),this.parent):t instanceof e?this.data.delegatedFrom=t:this.data.delegatedFrom=new e(t,this.parent):this.data.delegatedFrom=null,this)}delegatedTo(t){return t===void 0?this.data.delegatedTo:t?(typeof t==`string`?this.data.delegatedTo=new e(s(`delegatedTo`,t),this.parent):t instanceof e?this.data.delegatedTo=t:this.data.delegatedTo=new e(t,this.parent),this.data.status=`DELEGATED`,this):(this.data.delegatedTo=null,this.data.status===`DELEGATED`&&(this.data.status=null),this)}delegatesFrom(t){let n=t instanceof e?t:this.parent.createAttendee(t);return this.delegatedFrom(n),n.delegatedTo(this),n}delegatesTo(t){let n=t instanceof e?t:this.parent.createAttendee(t);return this.delegatedTo(n),n.delegatedFrom(this),n}email(e){return e?(this.data.email=e,this):this.data.email}mailto(e){return e===void 0?this.data.mailto:(this.data.mailto=e||null,this)}name(e){return e===void 0?this.data.name:(this.data.name=e||null,this)}role(e){return e===void 0?this.data.role:(this.data.role=o(j,e),this)}rsvp(e){return e===void 0?this.data.rsvp:e===null?(this.data.rsvp=null,this):(this.data.rsvp=!!e,this)}scheduleAgent(e){return e===void 0?this.data.scheduleAgent:e?typeof e==`string`&&e.toUpperCase().startsWith(`X-`)?(this.data.scheduleAgent=e,this):(this.data.scheduleAgent=o(M,e),this):(this.data.scheduleAgent=null,this)}sentBy(e){return e?(this.data.sentBy=e,this):this.data.sentBy}status(e){return e===void 0?this.data.status:e?(this.data.status=o(N,e),this):(this.data.status=null,this)}toJSON(){return Object.assign({},this.data,{delegatedFrom:this.data.delegatedFrom?.email()||null,delegatedTo:this.data.delegatedTo?.email()||null,x:this.x()})}toString(){let e=`ATTENDEE`;if(!this.data.email)throw Error("No value for `email` in ICalAttendee given!");return e+=`;ROLE=`+this.data.role,this.data.type&&(e+=`;CUTYPE=`+this.data.type),this.data.status&&(e+=`;PARTSTAT=`+this.data.status),this.data.rsvp!==null&&(e+=`;RSVP=`+this.data.rsvp.toString().toUpperCase()),this.data.sentBy!==null&&(e+=`;SENT-BY="mailto:`+l(this.data.sentBy)+`"`),this.data.delegatedTo&&(e+=`;DELEGATED-TO="`+l(this.data.delegatedTo.email())+`"`),this.data.delegatedFrom&&(e+=`;DELEGATED-FROM="`+l(this.data.delegatedFrom.email())+`"`),this.data.name&&(e+=`;CN="`+l(this.data.name)+`"`),this.data.email&&this.data.mailto&&(e+=`;EMAIL=`+E(this.data.email)),this.data.scheduleAgent&&(e+=`;SCHEDULE-AGENT=`+this.data.scheduleAgent),this.data.x.length&&(e+=`;`+this.data.x.map(([e,t])=>e.toUpperCase()+`=`+E(t)).join(`;`)),e+=`:MAILTO:`+c(this.data.mailto||this.data.email,!1)+`\r
7
- `,e}type(e){return e===void 0?this.data.type:e?(this.data.type=o(P,e),this):(this.data.type=null,this)}x(e,t){if(e===void 0)return i(this.data);if(typeof e==`string`&&typeof t==`string`)i(this.data,e,t);else if(typeof e==`object`)i(this.data,e);else throw Error(`Either key or value is not a string!`);return this}};let I=function(e){return e.audio=`audio`,e.display=`display`,e.email=`email`,e}({});const L={end:`END`,start:`START`};var R=class{data;event;constructor(e,t){if(this.data={attach:null,attendees:[],description:null,interval:null,relatesTo:null,repeat:null,summary:null,trigger:-600,type:`display`,x:[]},this.event=t,!t)throw Error("`event` option required!");e.type!==void 0&&this.type(e.type),`trigger`in e&&e.trigger!==void 0&&this.trigger(e.trigger),`triggerBefore`in e&&e.triggerBefore!==void 0&&this.triggerBefore(e.triggerBefore),`triggerAfter`in e&&e.triggerAfter!==void 0&&this.triggerAfter(e.triggerAfter),e.repeat&&this.repeat(e.repeat),e.attach!==void 0&&this.attach(e.attach),e.description!==void 0&&this.description(e.description),e.summary!==void 0&&this.summary(e.summary),e.attendees!==void 0&&this.attendees(e.attendees),e.x!==void 0&&this.x(e.x)}attach(e){if(e===void 0)return this.data.attach;if(!e)return this.data.attach=null,this;let t;if(typeof e==`string`)t={mime:null,uri:e};else if(typeof e==`object`)t={mime:e.mime||null,uri:e.uri};else throw Error("`attachment` needs to be a valid formed string or an object. See https://sebbo2002.github.io/ical-generator/develop/reference/classes/ICalAlarm.html#attach");if(!t.uri)throw Error("`attach.uri` is empty!");return this.data.attach={mime:t.mime,uri:t.uri},this}attendees(e){return e?(e.forEach(e=>this.createAttendee(e)),this):this.data.attendees}createAttendee(e){if(e instanceof F)return this.data.attendees.push(e),e;typeof e==`string`&&(e=s(`data`,e));let t=new F(e,this);return this.data.attendees.push(t),t}description(e){return e===void 0?this.data.description:e?(this.data.description=e,this):(this.data.description=null,this)}relatesTo(e){if(e===void 0)return this.data.relatesTo;if(!e)return this.data.relatesTo=null,this;if(!Object.values(L).includes(e))throw Error("`relatesTo` is not correct, must be either `START` or `END`!");return this.data.relatesTo=e,this}repeat(e){if(e===void 0)return this.data.repeat;if(!e)return this.data.repeat=null,this;if(typeof e!=`object`)throw Error("`repeat` is not correct, must be an object!");if(typeof e.times!=`number`||!isFinite(e.times))throw Error("`repeat.times` is not correct, must be numeric!");if(typeof e.interval!=`number`||!isFinite(e.interval))throw Error("`repeat.interval` is not correct, must be numeric!");return this.data.repeat=e,this}summary(e){return e===void 0?this.data.summary:e?(this.data.summary=e,this):(this.data.summary=null,this)}toJSON(){let e=this.trigger();return Object.assign({},this.data,{trigger:typeof e==`number`?e:k(e),x:this.x()})}toString(){let e=`BEGIN:VALARM\r
6
+ `:``}function m(e){return typeof e==`object`&&!!e&&!(e instanceof Date)&&!g(e)&&!h(e)&&!b(e)}function h(e){return typeof e==`object`&&!!e&&`toJSDate`in e&&typeof e.toJSDate==`function`&&!b(e)}function g(e){return e!=null&&e._isAMomentObject!=null&&!b(e)}function _(e){return typeof e==`object`&&!!e&&`asSeconds`in e&&typeof e.asSeconds==`function`}function v(e){return g(e)&&`tz`in e&&typeof e.tz==`function`}function y(e){return typeof e==`object`&&!!e&&`between`in e&&typeof e.between==`function`&&typeof e.toString==`function`}function b(e){return w(e)||C(e)||S(e)||x(e)}function x(e){return typeof e==`object`&&!!e&&!w(e)&&!C(e)&&!S(e)&&`toZonedDateTimeISO`in e&&typeof e.toZonedDateTimeISO==`function`&&!(`year`in e)&&!(`timeZoneId`in e)}function S(e){return typeof e==`object`&&!!e&&!w(e)&&!C(e)&&`toPlainDateTime`in e&&typeof e.toPlainDateTime==`function`&&`year`in e&&typeof e.year==`number`&&`month`in e&&typeof e.month==`number`&&`day`in e&&typeof e.day==`number`&&!(`hour`in e)&&!(`timeZoneId`in e)&&!(`epochSeconds`in e)}function C(e){return typeof e==`object`&&!!e&&!w(e)&&`toZonedDateTime`in e&&typeof e.toZonedDateTime==`function`&&`toPlainDate`in e&&typeof e.toPlainDate==`function`&&`year`in e&&typeof e.year==`number`&&`month`in e&&typeof e.month==`number`&&`day`in e&&typeof e.day==`number`&&`hour`in e&&typeof e.hour==`number`&&`minute`in e&&typeof e.minute==`number`&&`second`in e&&typeof e.second==`number`&&!(`timeZone`in e)}function w(e){return typeof e==`object`&&!!e&&`timeZoneId`in e&&typeof e.timeZoneId==`string`&&`toPlainDateTime`in e&&typeof e.toPlainDateTime==`function`&&`year`in e&&typeof e.year==`number`&&`month`in e&&typeof e.month==`number`&&`day`in e&&typeof e.day==`number`&&`hour`in e&&typeof e.hour==`number`&&`minute`in e&&typeof e.minute==`number`&&`second`in e&&typeof e.second==`number`}function T(e){return e instanceof Date&&`internal`in e&&e.internal instanceof Date&&`withTimeZone`in e&&typeof e.withTimeZone==`function`&&`tzComponents`in e&&typeof e.tzComponents==`function`}function E(e){let t=l(e);return/[,:;]/.test(t)?`"`+t+`"`:t}function D(e){if(typeof e==`string`||e instanceof Date)return new Date(e);if(w(e)){let t=e.toInstant();return new Date(t.epochMilliseconds)}return C(e)?new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second)):S(e)?new Date(Date.UTC(e.year,e.month-1,e.day)):x(e)?new Date(e.epochMilliseconds):h(e)?e.toJSDate():e.toDate()}function O(e){let t=``;return e<0&&(t=`-`,e*=-1),t+=`P`,e>=86400&&(t+=Math.floor(e/86400)+`D`,e%=86400),!e&&t.length>1?t:(t+=`T`,e>=3600&&(t+=Math.floor(e/3600)+`H`,e%=3600),e>=60&&(t+=Math.floor(e/60)+`M`,e%=60),e>0?t+=e+`S`:t.length<=2&&(t+=`0S`),t)}function k(e){return e?typeof e==`string`?e:w(e)?k(e.withTimeZone(`UTC`).toPlainDateTime()):(b(e),e.toJSON()):null}function A(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!1;return!0}let j=/* @__PURE__ */ function(e){return e.CHAIR=`CHAIR`,e.NON=`NON-PARTICIPANT`,e.OPT=`OPT-PARTICIPANT`,e.REQ=`REQ-PARTICIPANT`,e}({}),M=/* @__PURE__ */ function(e){return e.CLIENT=`CLIENT`,e.NONE=`NONE`,e.SERVER=`SERVER`,e}({}),N=/* @__PURE__ */ function(e){return e.ACCEPTED=`ACCEPTED`,e.DECLINED=`DECLINED`,e.DELEGATED=`DELEGATED`,e.NEEDSACTION=`NEEDS-ACTION`,e.TENTATIVE=`TENTATIVE`,e}({}),P=/* @__PURE__ */ function(e){return e.GROUP=`GROUP`,e.INDIVIDUAL=`INDIVIDUAL`,e.RESOURCE=`RESOURCE`,e.ROOM=`ROOM`,e.UNKNOWN=`UNKNOWN`,e}({});var F=class e{data;parent;constructor(e,t){if(this.data={delegatedFrom:null,delegatedTo:null,email:``,mailto:null,name:null,role:`REQ-PARTICIPANT`,rsvp:null,scheduleAgent:null,sentBy:null,status:null,type:null,x:[]},this.parent=t,!this.parent)throw Error("`event` option required!");if(!e.email)throw Error("No value for `email` in ICalAttendee given!");e.name!==void 0&&this.name(e.name),e.email!==void 0&&this.email(e.email),e.mailto!==void 0&&this.mailto(e.mailto),e.sentBy!==void 0&&this.sentBy(e.sentBy),e.status!==void 0&&this.status(e.status),e.role!==void 0&&this.role(e.role),e.rsvp!==void 0&&this.rsvp(e.rsvp),e.type!==void 0&&this.type(e.type),e.delegatedTo!==void 0&&this.delegatedTo(e.delegatedTo),e.delegatedFrom!==void 0&&this.delegatedFrom(e.delegatedFrom),e.delegatesTo&&this.delegatesTo(e.delegatesTo),e.delegatesFrom&&this.delegatesFrom(e.delegatesFrom),e.scheduleAgent!==void 0&&this.scheduleAgent(e.scheduleAgent),e.x!==void 0&&this.x(e.x)}delegatedFrom(t){return t===void 0?this.data.delegatedFrom:(t?typeof t==`string`?this.data.delegatedFrom=new e(s(`delegatedFrom`,t),this.parent):t instanceof e?this.data.delegatedFrom=t:this.data.delegatedFrom=new e(t,this.parent):this.data.delegatedFrom=null,this)}delegatedTo(t){return t===void 0?this.data.delegatedTo:t?(typeof t==`string`?this.data.delegatedTo=new e(s(`delegatedTo`,t),this.parent):t instanceof e?this.data.delegatedTo=t:this.data.delegatedTo=new e(t,this.parent),this.data.status=`DELEGATED`,this):(this.data.delegatedTo=null,this.data.status===`DELEGATED`&&(this.data.status=null),this)}delegatesFrom(t){let n=t instanceof e?t:this.parent.createAttendee(t);return this.delegatedFrom(n),n.delegatedTo(this),n}delegatesTo(t){let n=t instanceof e?t:this.parent.createAttendee(t);return this.delegatedTo(n),n.delegatedFrom(this),n}email(e){return e?(this.data.email=e,this):this.data.email}mailto(e){return e===void 0?this.data.mailto:(this.data.mailto=e||null,this)}name(e){return e===void 0?this.data.name:(this.data.name=e||null,this)}role(e){return e===void 0?this.data.role:(this.data.role=o(j,e),this)}rsvp(e){return e===void 0?this.data.rsvp:e===null?(this.data.rsvp=null,this):(this.data.rsvp=!!e,this)}scheduleAgent(e){return e===void 0?this.data.scheduleAgent:e?typeof e==`string`&&e.toUpperCase().startsWith(`X-`)?(this.data.scheduleAgent=e,this):(this.data.scheduleAgent=o(M,e),this):(this.data.scheduleAgent=null,this)}sentBy(e){return e?(this.data.sentBy=e,this):this.data.sentBy}status(e){return e===void 0?this.data.status:e?(this.data.status=o(N,e),this):(this.data.status=null,this)}toJSON(){return Object.assign({},this.data,{delegatedFrom:this.data.delegatedFrom?.email()||null,delegatedTo:this.data.delegatedTo?.email()||null,x:this.x()})}toString(){let e=`ATTENDEE`;if(!this.data.email)throw Error("No value for `email` in ICalAttendee given!");return e+=`;ROLE=`+this.data.role,this.data.type&&(e+=`;CUTYPE=`+this.data.type),this.data.status&&(e+=`;PARTSTAT=`+this.data.status),this.data.rsvp!==null&&(e+=`;RSVP=`+this.data.rsvp.toString().toUpperCase()),this.data.sentBy!==null&&(e+=`;SENT-BY="mailto:`+l(this.data.sentBy)+`"`),this.data.delegatedTo&&(e+=`;DELEGATED-TO="`+l(this.data.delegatedTo.email())+`"`),this.data.delegatedFrom&&(e+=`;DELEGATED-FROM="`+l(this.data.delegatedFrom.email())+`"`),this.data.name&&(e+=`;CN="`+l(this.data.name)+`"`),this.data.email&&this.data.mailto&&(e+=`;EMAIL=`+E(this.data.email)),this.data.scheduleAgent&&(e+=`;SCHEDULE-AGENT=`+this.data.scheduleAgent),this.data.x.length&&(e+=`;`+this.data.x.map(([e,t])=>e.toUpperCase()+`=`+E(t)).join(`;`)),e+=`:MAILTO:`+c(this.data.mailto||this.data.email,!1)+`\r
7
+ `,e}type(e){return e===void 0?this.data.type:e?(this.data.type=o(P,e),this):(this.data.type=null,this)}x(e,t){if(e===void 0)return i(this.data);if(typeof e==`string`&&typeof t==`string`)i(this.data,e,t);else if(typeof e==`object`)i(this.data,e);else throw Error(`Either key or value is not a string!`);return this}};let I=/* @__PURE__ */ function(e){return e.audio=`audio`,e.display=`display`,e.email=`email`,e}({});const L={end:`END`,start:`START`};var R=class{data;event;constructor(e,t){if(this.data={attach:null,attendees:[],description:null,interval:null,relatesTo:null,repeat:null,summary:null,trigger:-600,type:`display`,x:[]},this.event=t,!t)throw Error("`event` option required!");e.type!==void 0&&this.type(e.type),`trigger`in e&&e.trigger!==void 0&&this.trigger(e.trigger),`triggerBefore`in e&&e.triggerBefore!==void 0&&this.triggerBefore(e.triggerBefore),`triggerAfter`in e&&e.triggerAfter!==void 0&&this.triggerAfter(e.triggerAfter),e.repeat&&this.repeat(e.repeat),e.attach!==void 0&&this.attach(e.attach),e.description!==void 0&&this.description(e.description),e.summary!==void 0&&this.summary(e.summary),e.attendees!==void 0&&this.attendees(e.attendees),e.x!==void 0&&this.x(e.x)}attach(e){if(e===void 0)return this.data.attach;if(!e)return this.data.attach=null,this;let t;if(typeof e==`string`)t={mime:null,uri:e};else if(typeof e==`object`)t={mime:e.mime||null,uri:e.uri};else throw Error("`attachment` needs to be a valid formed string or an object. See https://sebbo2002.github.io/ical-generator/develop/reference/classes/ICalAlarm.html#attach");if(!t.uri)throw Error("`attach.uri` is empty!");return this.data.attach={mime:t.mime,uri:t.uri},this}attendees(e){return e?(e.forEach(e=>this.createAttendee(e)),this):this.data.attendees}createAttendee(e){if(e instanceof F)return this.data.attendees.push(e),e;typeof e==`string`&&(e=s(`data`,e));let t=new F(e,this);return this.data.attendees.push(t),t}description(e){return e===void 0?this.data.description:e?(this.data.description=e,this):(this.data.description=null,this)}relatesTo(e){if(e===void 0)return this.data.relatesTo;if(!e)return this.data.relatesTo=null,this;if(!Object.values(L).includes(e))throw Error("`relatesTo` is not correct, must be either `START` or `END`!");return this.data.relatesTo=e,this}repeat(e){if(e===void 0)return this.data.repeat;if(!e)return this.data.repeat=null,this;if(typeof e!=`object`)throw Error("`repeat` is not correct, must be an object!");if(typeof e.times!=`number`||!isFinite(e.times))throw Error("`repeat.times` is not correct, must be numeric!");if(typeof e.interval!=`number`||!isFinite(e.interval))throw Error("`repeat.interval` is not correct, must be numeric!");return this.data.repeat=e,this}summary(e){return e===void 0?this.data.summary:e?(this.data.summary=e,this):(this.data.summary=null,this)}toJSON(){let e=this.trigger();return Object.assign({},this.data,{trigger:typeof e==`number`?e:k(e),x:this.x()})}toString(){let e=`BEGIN:VALARM\r
8
8
  `;if(e+=`ACTION:`+this.data.type.toUpperCase()+`\r
9
9
  `,typeof this.data.trigger==`number`&&this.data.relatesTo===null?this.data.trigger>0?e+=`TRIGGER;RELATED=END:`+O(this.data.trigger)+`\r
10
10
  `:e+=`TRIGGER:`+O(this.data.trigger)+`\r
@@ -20,7 +20,7 @@ let e=function(e){return e.DAILY=`DAILY`,e.HOURLY=`HOURLY`,e.MINUTELY=`MINUTELY`
20
20
  `),this.data.type===`email`&&this.data.summary?e+=`SUMMARY:`+c(this.data.summary,!1)+`\r
21
21
  `:this.data.type===`email`&&(e+=`SUMMARY:`+c(this.event.summary(),!1)+`\r
22
22
  `),this.data.type===`email`&&this.data.attendees.forEach(t=>{e+=t.toString()}),e+=p(this.data),e+=`END:VALARM\r
23
- `,e}trigger(e){if(e===void 0&&typeof this.data.trigger==`number`)return-1*this.data.trigger;if(e===void 0)return this.data.trigger;if(typeof e==`number`&&isFinite(e))this.data.trigger=-1*e;else if(!e||typeof e==`number`)throw Error("`trigger` is not correct, must be a finite number or a supported date!");else this.data.trigger=a(e,`trigger`);return this}triggerAfter(e){return e===void 0?this.data.trigger:this.trigger(typeof e==`number`?-1*e:e)}triggerBefore(e){return e===void 0?this.trigger():this.trigger(e)}type(e){if(e===void 0)return this.data.type;if(!e||!Object.keys(I).includes(e))throw Error("`type` is not correct, must be either `display` or `audio`!");return this.data.type=e,this}x(e,t){if(e===void 0)return i(this.data);if(typeof e==`string`&&typeof t==`string`)i(this.data,e,t);else if(typeof e==`object`)i(this.data,e);else throw Error(`Either key or value is not a string!`);return this}},z=class{data;constructor(e){if(this.data={name:``},!e.name)throw Error("No value for `name` in ICalCategory given!");this.name(e.name)}name(e){return e===void 0?this.data.name:(this.data.name=e,this)}toJSON(){return Object.assign({},this.data)}toString(){return c(this.data.name,!1)}};let B=function(e){return e.BUSY=`BUSY`,e.FREE=`FREE`,e.OOF=`OOF`,e.TENTATIVE=`TENTATIVE`,e}({}),V=function(e){return e.CONFIDENTIAL=`CONFIDENTIAL`,e.PRIVATE=`PRIVATE`,e.PUBLIC=`PUBLIC`,e}({}),H=function(e){return e.CANCELLED=`CANCELLED`,e.CONFIRMED=`CONFIRMED`,e.TENTATIVE=`TENTATIVE`,e}({}),U=function(e){return e.OPAQUE=`OPAQUE`,e.TRANSPARENT=`TRANSPARENT`,e}({});var W=class{calendar;data;constructor(e,t){if(this.data={alarms:[],allDay:!1,attachments:[],attendees:[],busystatus:null,categories:[],class:null,created:null,description:null,end:null,floating:!1,id:crypto.randomUUID(),lastModified:null,location:null,organizer:null,priority:null,recurrenceId:null,repeating:null,sequence:0,stamp:new Date,start:new Date,status:null,summary:``,timezone:null,transparency:null,travelTime:null,url:null,x:[]},this.calendar=t,!t)throw Error("`calendar` option required!");e.id&&this.id(e.id),e.sequence!==void 0&&this.sequence(e.sequence),e.start&&this.start(e.start),e.end!==void 0&&this.end(e.end),e.recurrenceId!==void 0&&this.recurrenceId(e.recurrenceId),e.timezone!==void 0&&this.timezone(e.timezone),e.stamp!==void 0&&this.stamp(e.stamp),e.allDay!==void 0&&this.allDay(e.allDay),e.floating!==void 0&&this.floating(e.floating),e.repeating!==void 0&&this.repeating(e.repeating),e.summary!==void 0&&this.summary(e.summary),e.location!==void 0&&this.location(e.location),e.description!==void 0&&this.description(e.description),e.organizer!==void 0&&this.organizer(e.organizer),e.attendees!==void 0&&this.attendees(e.attendees),e.alarms!==void 0&&this.alarms(e.alarms),e.categories!==void 0&&this.categories(e.categories),e.status!==void 0&&this.status(e.status),e.busystatus!==void 0&&this.busystatus(e.busystatus),e.priority!==void 0&&this.priority(e.priority),e.url!==void 0&&this.url(e.url),e.attachments!==void 0&&this.attachments(e.attachments),e.transparency!==void 0&&this.transparency(e.transparency),e.travelTime!==void 0&&this.travelTime(e.travelTime),e.created!==void 0&&this.created(e.created),e.lastModified!==void 0&&this.lastModified(e.lastModified),e.class!==void 0&&this.class(e.class),e.x!==void 0&&this.x(e.x)}alarms(e){return e?(e.forEach(e=>this.createAlarm(e)),this):this.data.alarms}allDay(e){return e===void 0?this.data.allDay:(this.data.allDay=!!e,this)}attachments(e){return e?(e.forEach(e=>this.createAttachment(e)),this):this.data.attachments}attendees(e){return e?(e.forEach(e=>this.createAttendee(e)),this):this.data.attendees}busystatus(e){return e===void 0?this.data.busystatus:e===null?(this.data.busystatus=null,this):(this.data.busystatus=o(B,e),this)}categories(e){return e?(e.forEach(e=>this.createCategory(e)),this):this.data.categories}class(e){return e===void 0?this.data.class:e===null?(this.data.class=null,this):(this.data.class=o(V,e),this)}createAlarm(e){let t=e instanceof R?e:new R(e,this);return this.data.alarms.push(t),t}createAttachment(e){return this.data.attachments.push(e),this}createAttendee(e){if(e instanceof F)return this.data.attendees.push(e),e;typeof e==`string`&&(e=s(`data`,e));let t=new F(e,this);return this.data.attendees.push(t),t}createCategory(e){let t=e instanceof z?e:new z(e);return this.data.categories.push(t),t}created(e){return e===void 0?this.data.created:e===null?(this.data.created=null,this):(this.data.created=a(e,`created`),this)}description(e){return e===void 0?this.data.description:e===null?(this.data.description=null,this):(typeof e==`string`?this.data.description={plain:e}:this.data.description=e,this)}end(e){return e===void 0?(this.swapStartAndEndIfRequired(),this.data.end):e===null?(this.data.end=null,this):(this.data.end=a(e,`end`),this)}floating(e){return e===void 0?this.data.floating:(this.data.floating=!!e,this.data.floating&&(this.data.timezone=null),this)}id(e){return e===void 0?this.data.id:(this.data.id=String(e),this)}lastModified(e){return e===void 0?this.data.lastModified:e===null?(this.data.lastModified=null,this):(this.data.lastModified=a(e,`lastModified`),this)}location(e){if(e===void 0)return this.data.location;if(typeof e==`string`)return this.data.location={title:e},this;if(e&&(`title`in e&&!e.title||e?.geo&&(typeof e.geo.lat!=`number`||!isFinite(e.geo.lat)||typeof e.geo.lon!=`number`||!isFinite(e.geo.lon))||!(`title`in e)&&!e?.geo))throw Error("`location` isn't formatted correctly. See https://sebbo2002.github.io/ical-generator/develop/reference/classes/ICalEvent.html#location");return this.data.location=e||null,this}organizer(e){return e===void 0?this.data.organizer:e===null?(this.data.organizer=null,this):(this.data.organizer=s(`organizer`,e),this)}priority(e){if(e===void 0)return this.data.priority;if(e===null)return this.data.priority=null,this;if(e<0||e>9)throw Error("`priority` is invalid, musst be 0 ≤ priority ≤ 9.");return this.data.priority=Math.round(e),this}recurrenceId(e){return e===void 0?this.data.recurrenceId:e===null?(this.data.recurrenceId=null,this):(this.data.recurrenceId=a(e,`recurrenceId`),this)}repeating(t){if(t===void 0)return this.data.repeating;if(!t)return this.data.repeating=null,this;if(y(t)||typeof t==`string`)return this.data.repeating=t,this;if(this.data.repeating={freq:o(e,t.freq)},t.count){if(!isFinite(t.count))throw Error("`repeating.count` must be a finite number!");this.data.repeating.count=t.count}if(t.interval){if(!isFinite(t.interval))throw Error("`repeating.interval` must be a finite number!");this.data.repeating.interval=t.interval}if(t.until!==void 0&&(this.data.repeating.until=a(t.until,`repeating.until`)),t.byDay){let e=Array.isArray(t.byDay)?t.byDay:[t.byDay];this.data.repeating.byDay=e.map(e=>o(r,e))}if(t.byMonth){let e=Array.isArray(t.byMonth)?t.byMonth:[t.byMonth];this.data.repeating.byMonth=e.map(e=>{if(typeof e!=`number`||e<1||e>12)throw Error("`repeating.byMonth` contains invalid value `"+e+"`!");return e})}if(t.byMonthDay){let e=Array.isArray(t.byMonthDay)?t.byMonthDay:[t.byMonthDay];this.data.repeating.byMonthDay=e.map(e=>{if(typeof e!=`number`||e<-31||e>31||e===0)throw Error("`repeating.byMonthDay` contains invalid value `"+e+"`!");return e})}if(t.bySetPos){if(!this.data.repeating.byDay)throw"`repeating.bySetPos` must be used along with `repeating.byDay`!";let e=Array.isArray(t.bySetPos)?t.bySetPos:[t.bySetPos];this.data.repeating.bySetPos=e.map(e=>{if(typeof e!=`number`||e<-366||e>366||e===0)throw"`repeating.bySetPos` contains invalid value `"+e+"`!";return e})}if(t.exclude){let e=Array.isArray(t.exclude)?t.exclude:[t.exclude];this.data.repeating.exclude=e.map((e,t)=>a(e,`repeating.exclude[${t}]`))}return t.startOfWeek&&(this.data.repeating.startOfWeek=o(r,t.startOfWeek)),this}sequence(e){if(e===void 0)return this.data.sequence;if(isNaN(parseInt(String(e),10)))throw Error("`sequence` must be a number!");return this.data.sequence=e,this}stamp(e){return e===void 0?this.data.stamp:(this.data.stamp=a(e,`stamp`),this)}start(e){return e===void 0?(this.swapStartAndEndIfRequired(),this.data.start):(this.data.start=a(e,`start`),this)}status(e){return e===void 0?this.data.status:e===null?(this.data.status=null,this):(this.data.status=o(H,e),this)}summary(e){return e===void 0?this.data.summary:(this.data.summary=e?String(e):``,this)}timestamp(e){return e===void 0?this.stamp():this.stamp(e)}timezone(e){return e===void 0&&this.data.timezone!==null?this.data.timezone:e===void 0?this.calendar.timezone():(this.data.timezone=e&&e!==`UTC`?e.toString():null,this.data.timezone&&(this.data.floating=!1),this)}toJSON(){let e=null;return y(this.data.repeating)||typeof this.data.repeating==`string`?e=this.data.repeating.toString():this.data.repeating&&(e=Object.assign({},this.data.repeating,{exclude:this.data.repeating.exclude?.map(e=>k(e)),until:k(this.data.repeating.until)||void 0})),this.swapStartAndEndIfRequired(),Object.assign({},this.data,{created:k(this.data.created)||null,end:k(this.data.end)||null,lastModified:k(this.data.lastModified)||null,recurrenceId:k(this.data.recurrenceId)||null,repeating:e,stamp:k(this.data.stamp)||null,start:k(this.data.start)||null,x:this.x()})}toString(){let e=``;if(e+=`BEGIN:VEVENT\r
23
+ `,e}trigger(e){if(e===void 0&&typeof this.data.trigger==`number`)return-1*this.data.trigger;if(e===void 0)return this.data.trigger;if(typeof e==`number`&&isFinite(e))this.data.trigger=-1*e;else if(!e||typeof e==`number`)throw Error("`trigger` is not correct, must be a finite number or a supported date!");else this.data.trigger=a(e,`trigger`);return this}triggerAfter(e){return e===void 0?this.data.trigger:this.trigger(typeof e==`number`?-1*e:e)}triggerBefore(e){return e===void 0?this.trigger():this.trigger(e)}type(e){if(e===void 0)return this.data.type;if(!e||!Object.keys(I).includes(e))throw Error("`type` is not correct, must be either `display` or `audio`!");return this.data.type=e,this}x(e,t){if(e===void 0)return i(this.data);if(typeof e==`string`&&typeof t==`string`)i(this.data,e,t);else if(typeof e==`object`)i(this.data,e);else throw Error(`Either key or value is not a string!`);return this}},z=class{data;constructor(e){if(this.data={name:``},!e.name)throw Error("No value for `name` in ICalCategory given!");this.name(e.name)}name(e){return e===void 0?this.data.name:(this.data.name=e,this)}toJSON(){return Object.assign({},this.data)}toString(){return c(this.data.name,!1)}};let B=/* @__PURE__ */ function(e){return e.BUSY=`BUSY`,e.FREE=`FREE`,e.OOF=`OOF`,e.TENTATIVE=`TENTATIVE`,e}({}),V=/* @__PURE__ */ function(e){return e.CONFIDENTIAL=`CONFIDENTIAL`,e.PRIVATE=`PRIVATE`,e.PUBLIC=`PUBLIC`,e}({}),H=/* @__PURE__ */ function(e){return e.CANCELLED=`CANCELLED`,e.CONFIRMED=`CONFIRMED`,e.TENTATIVE=`TENTATIVE`,e}({}),U=/* @__PURE__ */ function(e){return e.OPAQUE=`OPAQUE`,e.TRANSPARENT=`TRANSPARENT`,e}({});var W=class{calendar;data;constructor(e,t){if(this.data={alarms:[],allDay:!1,attachments:[],attendees:[],busystatus:null,categories:[],class:null,created:null,description:null,end:null,floating:!1,id:crypto.randomUUID(),lastModified:null,location:null,organizer:null,priority:null,recurrenceId:null,repeating:null,sequence:0,stamp:/* @__PURE__ */ new Date,start:/* @__PURE__ */ new Date,status:null,summary:``,timezone:null,transparency:null,travelTime:null,url:null,x:[]},this.calendar=t,!t)throw Error("`calendar` option required!");e.id&&this.id(e.id),e.sequence!==void 0&&this.sequence(e.sequence),e.start&&this.start(e.start),e.end!==void 0&&this.end(e.end),e.recurrenceId!==void 0&&this.recurrenceId(e.recurrenceId),e.timezone!==void 0&&this.timezone(e.timezone),e.stamp!==void 0&&this.stamp(e.stamp),e.allDay!==void 0&&this.allDay(e.allDay),e.floating!==void 0&&this.floating(e.floating),e.repeating!==void 0&&this.repeating(e.repeating),e.summary!==void 0&&this.summary(e.summary),e.location!==void 0&&this.location(e.location),e.description!==void 0&&this.description(e.description),e.organizer!==void 0&&this.organizer(e.organizer),e.attendees!==void 0&&this.attendees(e.attendees),e.alarms!==void 0&&this.alarms(e.alarms),e.categories!==void 0&&this.categories(e.categories),e.status!==void 0&&this.status(e.status),e.busystatus!==void 0&&this.busystatus(e.busystatus),e.priority!==void 0&&this.priority(e.priority),e.url!==void 0&&this.url(e.url),e.attachments!==void 0&&this.attachments(e.attachments),e.transparency!==void 0&&this.transparency(e.transparency),e.travelTime!==void 0&&this.travelTime(e.travelTime),e.created!==void 0&&this.created(e.created),e.lastModified!==void 0&&this.lastModified(e.lastModified),e.class!==void 0&&this.class(e.class),e.x!==void 0&&this.x(e.x)}alarms(e){return e?(e.forEach(e=>this.createAlarm(e)),this):this.data.alarms}allDay(e){return e===void 0?this.data.allDay:(this.data.allDay=!!e,this)}attachments(e){return e?(e.forEach(e=>this.createAttachment(e)),this):this.data.attachments}attendees(e){return e?(e.forEach(e=>this.createAttendee(e)),this):this.data.attendees}busystatus(e){return e===void 0?this.data.busystatus:e===null?(this.data.busystatus=null,this):(this.data.busystatus=o(B,e),this)}categories(e){return e?(e.forEach(e=>this.createCategory(e)),this):this.data.categories}class(e){return e===void 0?this.data.class:e===null?(this.data.class=null,this):(this.data.class=o(V,e),this)}createAlarm(e){let t=e instanceof R?e:new R(e,this);return this.data.alarms.push(t),t}createAttachment(e){return this.data.attachments.push(e),this}createAttendee(e){if(e instanceof F)return this.data.attendees.push(e),e;typeof e==`string`&&(e=s(`data`,e));let t=new F(e,this);return this.data.attendees.push(t),t}createCategory(e){let t=e instanceof z?e:new z(e);return this.data.categories.push(t),t}created(e){return e===void 0?this.data.created:e===null?(this.data.created=null,this):(this.data.created=a(e,`created`),this)}description(e){return e===void 0?this.data.description:e===null?(this.data.description=null,this):(typeof e==`string`?this.data.description={plain:e}:this.data.description=e,this)}end(e){return e===void 0?(this.swapStartAndEndIfRequired(),this.data.end):e===null?(this.data.end=null,this):(this.data.end=a(e,`end`),this)}floating(e){return e===void 0?this.data.floating:(this.data.floating=!!e,this.data.floating&&(this.data.timezone=null),this)}id(e){return e===void 0?this.data.id:(this.data.id=String(e),this)}lastModified(e){return e===void 0?this.data.lastModified:e===null?(this.data.lastModified=null,this):(this.data.lastModified=a(e,`lastModified`),this)}location(e){if(e===void 0)return this.data.location;if(typeof e==`string`)return this.data.location={title:e},this;if(e&&(`title`in e&&!e.title||e?.geo&&(typeof e.geo.lat!=`number`||!isFinite(e.geo.lat)||typeof e.geo.lon!=`number`||!isFinite(e.geo.lon))||!(`title`in e)&&!e?.geo))throw Error("`location` isn't formatted correctly. See https://sebbo2002.github.io/ical-generator/develop/reference/classes/ICalEvent.html#location");return this.data.location=e||null,this}organizer(e){return e===void 0?this.data.organizer:e===null?(this.data.organizer=null,this):(this.data.organizer=s(`organizer`,e),this)}priority(e){if(e===void 0)return this.data.priority;if(e===null)return this.data.priority=null,this;if(e<0||e>9)throw Error("`priority` is invalid, musst be 0 ≤ priority ≤ 9.");return this.data.priority=Math.round(e),this}recurrenceId(e){return e===void 0?this.data.recurrenceId:e===null?(this.data.recurrenceId=null,this):(this.data.recurrenceId=a(e,`recurrenceId`),this)}repeating(t){if(t===void 0)return this.data.repeating;if(!t)return this.data.repeating=null,this;if(y(t)||typeof t==`string`)return this.data.repeating=t,this;if(this.data.repeating={freq:o(e,t.freq)},t.count){if(!isFinite(t.count))throw Error("`repeating.count` must be a finite number!");this.data.repeating.count=t.count}if(t.interval){if(!isFinite(t.interval))throw Error("`repeating.interval` must be a finite number!");this.data.repeating.interval=t.interval}if(t.until!==void 0&&(this.data.repeating.until=a(t.until,`repeating.until`)),t.byDay){let e=Array.isArray(t.byDay)?t.byDay:[t.byDay];this.data.repeating.byDay=e.map(e=>o(r,e))}if(t.byMonth){let e=Array.isArray(t.byMonth)?t.byMonth:[t.byMonth];this.data.repeating.byMonth=e.map(e=>{if(typeof e!=`number`||e<1||e>12)throw Error("`repeating.byMonth` contains invalid value `"+e+"`!");return e})}if(t.byMonthDay){let e=Array.isArray(t.byMonthDay)?t.byMonthDay:[t.byMonthDay];this.data.repeating.byMonthDay=e.map(e=>{if(typeof e!=`number`||e<-31||e>31||e===0)throw Error("`repeating.byMonthDay` contains invalid value `"+e+"`!");return e})}if(t.bySetPos){if(!this.data.repeating.byDay)throw"`repeating.bySetPos` must be used along with `repeating.byDay`!";let e=Array.isArray(t.bySetPos)?t.bySetPos:[t.bySetPos];this.data.repeating.bySetPos=e.map(e=>{if(typeof e!=`number`||e<-366||e>366||e===0)throw"`repeating.bySetPos` contains invalid value `"+e+"`!";return e})}if(t.exclude){let e=Array.isArray(t.exclude)?t.exclude:[t.exclude];this.data.repeating.exclude=e.map((e,t)=>a(e,`repeating.exclude[${t}]`))}return t.startOfWeek&&(this.data.repeating.startOfWeek=o(r,t.startOfWeek)),this}sequence(e){if(e===void 0)return this.data.sequence;if(isNaN(parseInt(String(e),10)))throw Error("`sequence` must be a number!");return this.data.sequence=e,this}stamp(e){return e===void 0?this.data.stamp:(this.data.stamp=a(e,`stamp`),this)}start(e){return e===void 0?(this.swapStartAndEndIfRequired(),this.data.start):(this.data.start=a(e,`start`),this)}status(e){return e===void 0?this.data.status:e===null?(this.data.status=null,this):(this.data.status=o(H,e),this)}summary(e){return e===void 0?this.data.summary:(this.data.summary=e?String(e):``,this)}timestamp(e){return e===void 0?this.stamp():this.stamp(e)}timezone(e){return e===void 0&&this.data.timezone!==null?this.data.timezone:e===void 0?this.calendar.timezone():(this.data.timezone=e&&e!==`UTC`?e.toString():null,this.data.timezone&&(this.data.floating=!1),this)}toJSON(){let e=null;return y(this.data.repeating)||typeof this.data.repeating==`string`?e=this.data.repeating.toString():this.data.repeating&&(e=Object.assign({},this.data.repeating,{exclude:this.data.repeating.exclude?.map(e=>k(e)),until:k(this.data.repeating.until)||void 0})),this.swapStartAndEndIfRequired(),Object.assign({},this.data,{created:k(this.data.created)||null,end:k(this.data.end)||null,lastModified:k(this.data.lastModified)||null,recurrenceId:k(this.data.recurrenceId)||null,repeating:e,stamp:k(this.data.stamp)||null,start:k(this.data.start)||null,x:this.x()})}toString(){let e=``;if(e+=`BEGIN:VEVENT\r
24
24
  `,e+=`UID:`+this.data.id+`\r
25
25
  `,e+=`SEQUENCE:`+this.data.sequence+`\r
26
26
  `,this.swapStartAndEndIfRequired(),e+=`DTSTAMP:`+d(this.calendar.timezone(),this.data.stamp)+`\r
@@ -62,7 +62,7 @@ let e=function(e){return e.DAILY=`DAILY`,e.HOURLY=`HOURLY`,e.MINUTELY=`MINUTELY`
62
62
  `),this.data.lastModified&&(e+=`LAST-MODIFIED:`+d(this.calendar.timezone(),this.data.lastModified)+`\r
63
63
  `),this.data.class&&(e+=`CLASS:`+this.data.class.toUpperCase()+`\r
64
64
  `),e+=`END:VEVENT\r
65
- `,e}transparency(e){return e===void 0?this.data.transparency:e?(this.data.transparency=o(U,e),this):(this.data.transparency=null,this)}travelTime(e){if(e===void 0)return this.data.travelTime;if(typeof e==`number`&&e<=0)throw Error("`travelTime` has to be more than 0!");if(e&&typeof e==`object`&&`seconds`in e&&e.seconds<=0)throw Error("`travelTime.seconds` has to be more than 0!");return typeof e==`number`?(this.data.travelTime={seconds:e},this):(this.data.travelTime=e,this)}uid(e){return e===void 0?this.id():this.id(e)}url(e){return e===void 0?this.data.url:(this.data.url=e?String(e):null,this)}x(e,t){return e===void 0?i(this.data):(typeof e==`string`&&typeof t==`string`&&i(this.data,e,t),typeof e==`object`&&i(this.data,e),this)}swapStartAndEndIfRequired(){if(this.data.start&&this.data.end&&D(this.data.start).getTime()>D(this.data.end).getTime()){let e=this.data.start;this.data.start=this.data.end,this.data.end=e}}};let G=function(e){return e.ADD=`ADD`,e.CANCEL=`CANCEL`,e.COUNTER=`COUNTER`,e.DECLINECOUNTER=`DECLINECOUNTER`,e.PUBLISH=`PUBLISH`,e.REFRESH=`REFRESH`,e.REPLY=`REPLY`,e.REQUEST=`REQUEST`,e}({});var K=class{data;constructor(e={}){this.data={color:null,description:null,events:[],method:null,name:null,prodId:`//sebbo.net//ical-generator//EN`,scale:null,source:null,timezone:null,ttl:null,url:null,x:[]},e.prodId!==void 0&&this.prodId(e.prodId),e.method!==void 0&&this.method(e.method),e.name!==void 0&&this.name(e.name),e.description!==void 0&&this.description(e.description),e.timezone!==void 0&&this.timezone(e.timezone),e.source!==void 0&&this.source(e.source),e.url!==void 0&&this.url(e.url),e.scale!==void 0&&this.scale(e.scale),e.ttl!==void 0&&this.ttl(e.ttl),e.color!==void 0&&this.color(e.color),e.events!==void 0&&this.events(e.events),e.x!==void 0&&this.x(e.x)}clear(){return this.data.events=[],this}color(e){if(e===void 0)return this.data.color;if(typeof e==`string`&&!/^#[A-F0-9]{6}$/gi.test(e))throw Error("`color` is malformed!");return this.data.color=e?String(e).toUpperCase():null,this}createEvent(e){let t=e instanceof W?e:new W(e,this);return this.data.events.push(t),t}description(e){return e===void 0?this.data.description:(this.data.description=e?String(e):null,this)}events(e){return e?(e.forEach(e=>this.createEvent(e)),this):this.data.events}length(){return this.data.events.length}method(e){return e===void 0?this.data.method:e?(this.data.method=o(G,e),this):(this.data.method=null,this)}name(e){return e===void 0?this.data.name:(this.data.name=e?String(e):null,this)}prodId(e){if(!e)return this.data.prodId;if(typeof e==`string`)return this.data.prodId=e,this;if(typeof e!=`object`)throw Error("`prodid` needs to be a string or an object!");if(!e.company)throw Error("`prodid.company` is a mandatory item!");if(!e.product)throw Error("`prodid.product` is a mandatory item!");let t=(e.language||`EN`).toUpperCase();return this.data.prodId=`//`+e.company+`//`+e.product+`//`+t,this}scale(e){return e===void 0?this.data.scale:(e===null?this.data.scale=null:this.data.scale=e.toUpperCase(),this)}source(e){return e===void 0?this.data.source:(this.data.source=e||null,this)}timezone(e){return e===void 0?this.data.timezone?.name||null:(e===`UTC`?this.data.timezone=null:typeof e==`string`?this.data.timezone={name:e}:e===null?this.data.timezone=null:this.data.timezone=e,this)}toJSON(){return Object.assign({},this.data,{events:this.data.events.map(e=>e.toJSON()),timezone:this.timezone(),x:this.x()})}toString(){let e=``;return e=`BEGIN:VCALENDAR\r
65
+ `,e}transparency(e){return e===void 0?this.data.transparency:e?(this.data.transparency=o(U,e),this):(this.data.transparency=null,this)}travelTime(e){if(e===void 0)return this.data.travelTime;if(typeof e==`number`&&e<=0)throw Error("`travelTime` has to be more than 0!");if(e&&typeof e==`object`&&`seconds`in e&&e.seconds<=0)throw Error("`travelTime.seconds` has to be more than 0!");return typeof e==`number`?(this.data.travelTime={seconds:e},this):(this.data.travelTime=e,this)}uid(e){return e===void 0?this.id():this.id(e)}url(e){return e===void 0?this.data.url:(this.data.url=e?String(e):null,this)}x(e,t){return e===void 0?i(this.data):(typeof e==`string`&&typeof t==`string`&&i(this.data,e,t),typeof e==`object`&&i(this.data,e),this)}swapStartAndEndIfRequired(){if(this.data.start&&this.data.end&&D(this.data.start).getTime()>D(this.data.end).getTime()){let e=this.data.start;this.data.start=this.data.end,this.data.end=e}}};let G=/* @__PURE__ */ function(e){return e.ADD=`ADD`,e.CANCEL=`CANCEL`,e.COUNTER=`COUNTER`,e.DECLINECOUNTER=`DECLINECOUNTER`,e.PUBLISH=`PUBLISH`,e.REFRESH=`REFRESH`,e.REPLY=`REPLY`,e.REQUEST=`REQUEST`,e}({});var K=class{data;constructor(e={}){this.data={color:null,description:null,events:[],method:null,name:null,prodId:`//sebbo.net//ical-generator//EN`,scale:null,source:null,timezone:null,ttl:null,url:null,x:[]},e.prodId!==void 0&&this.prodId(e.prodId),e.method!==void 0&&this.method(e.method),e.name!==void 0&&this.name(e.name),e.description!==void 0&&this.description(e.description),e.timezone!==void 0&&this.timezone(e.timezone),e.source!==void 0&&this.source(e.source),e.url!==void 0&&this.url(e.url),e.scale!==void 0&&this.scale(e.scale),e.ttl!==void 0&&this.ttl(e.ttl),e.color!==void 0&&this.color(e.color),e.events!==void 0&&this.events(e.events),e.x!==void 0&&this.x(e.x)}clear(){return this.data.events=[],this}color(e){if(e===void 0)return this.data.color;if(typeof e==`string`&&!/^#[A-F0-9]{6}$/gi.test(e))throw Error("`color` is malformed!");return this.data.color=e?String(e).toUpperCase():null,this}createEvent(e){let t=e instanceof W?e:new W(e,this);return this.data.events.push(t),t}description(e){return e===void 0?this.data.description:(this.data.description=e?String(e):null,this)}events(e){return e?(e.forEach(e=>this.createEvent(e)),this):this.data.events}length(){return this.data.events.length}method(e){return e===void 0?this.data.method:e?(this.data.method=o(G,e),this):(this.data.method=null,this)}name(e){return e===void 0?this.data.name:(this.data.name=e?String(e):null,this)}prodId(e){if(!e)return this.data.prodId;if(typeof e==`string`)return this.data.prodId=e,this;if(typeof e!=`object`)throw Error("`prodid` needs to be a string or an object!");if(!e.company)throw Error("`prodid.company` is a mandatory item!");if(!e.product)throw Error("`prodid.product` is a mandatory item!");let t=(e.language||`EN`).toUpperCase();return this.data.prodId=`//`+e.company+`//`+e.product+`//`+t,this}scale(e){return e===void 0?this.data.scale:(e===null?this.data.scale=null:this.data.scale=e.toUpperCase(),this)}source(e){return e===void 0?this.data.source:(this.data.source=e||null,this)}timezone(e){return e===void 0?this.data.timezone?.name||null:(e===`UTC`?this.data.timezone=null:typeof e==`string`?this.data.timezone={name:e}:e===null?this.data.timezone=null:this.data.timezone=e,this)}toJSON(){return Object.assign({},this.data,{events:this.data.events.map(e=>e.toJSON()),timezone:this.timezone(),x:this.x()})}toString(){let e=``;return e=`BEGIN:VCALENDAR\r
66
66
  VERSION:2.0\r
67
67
  `,e+=`PRODID:-`+this.data.prodId+`\r
68
68
  `,this.data.url&&(e+=`URL:`+this.data.url+`\r
@@ -72,7 +72,7 @@ VERSION:2.0\r
72
72
  `),this.data.name&&(e+=`NAME:`+this.data.name+`\r
73
73
  `,e+=`X-WR-CALNAME:`+this.data.name+`\r
74
74
  `),this.data.description&&(e+=`X-WR-CALDESC:`+this.data.description+`\r
75
- `),this.data.timezone?.generator&&[...new Set([this.timezone(),...this.data.events.map(e=>e.timezone())])].filter(e=>e!==null&&!e.startsWith(`/`)).forEach(t=>{if(!this.data.timezone?.generator)return;let n=this.data.timezone.generator(t);n&&(e+=n.replace(/\r\n/g,`
75
+ `),this.data.timezone?.generator&&[.../* @__PURE__ */ new Set([this.timezone(),...this.data.events.map(e=>e.timezone())])].filter(e=>e!==null&&!e.startsWith(`/`)).forEach(t=>{if(!this.data.timezone?.generator)return;let n=this.data.timezone.generator(t);n&&(e+=n.replace(/\r\n/g,`
76
76
  `).replace(/\n/g,`\r
77
77
  `).trim()+`\r
78
78
  `)}),this.data.timezone?.name&&(e+=`TIMEZONE-ID:`+this.data.timezone.name+`\r