@calcom/atoms 1.1.0-booker → 1.1.1-debug-dont-use

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.
Files changed (137) hide show
  1. package/dist/{AddressInput-6TIOefqU.js → AddressInput-CVMPei2D.js} +3 -3
  2. package/dist/{AlbyPriceComponent-zZlkVZTy.js → AlbyPriceComponent-E6ULoDL6.js} +29 -29
  3. package/dist/AppCard-cTGNOAHy.js +281 -0
  4. package/dist/AppListCardPlatformWrapper-NSThSuXk.js +9 -0
  5. package/dist/AppListCardWebWrapper-XwKnQn63.js +74 -0
  6. package/dist/AppSettingsInterface-YBMLeXt4.js +23 -0
  7. package/dist/AppSettingsInterface-ZH3XhiYG.js +75 -0
  8. package/dist/AppSettingsInterface-x5iDZUBe.js +29 -0
  9. package/dist/DateRangePicker-f_B5u4e9.js +2405 -0
  10. package/dist/EventTypeAppCardInterface--fNkLgYH.js +858 -0
  11. package/dist/EventTypeAppCardInterface-0cii-lHS.js +34 -0
  12. package/dist/EventTypeAppCardInterface-0gSJQJit.js +32 -0
  13. package/dist/EventTypeAppCardInterface-2TR5xhf8.js +33 -0
  14. package/dist/EventTypeAppCardInterface-9C3Wfgpy.js +24 -0
  15. package/dist/EventTypeAppCardInterface-C6ns7UmL.js +51 -0
  16. package/dist/EventTypeAppCardInterface-F5At064k.js +41 -0
  17. package/dist/EventTypeAppCardInterface-JCEQYUtS.js +31 -0
  18. package/dist/EventTypeAppCardInterface-L_OQx-GG.js +34 -0
  19. package/dist/EventTypeAppCardInterface-NMuTJqnR.js +32 -0
  20. package/dist/EventTypeAppCardInterface-Q8BoN8IR.js +24 -0
  21. package/dist/EventTypeAppCardInterface-TSa1z_cz.js +24 -0
  22. package/dist/EventTypeAppCardInterface-V2CVt-gp.js +39 -0
  23. package/dist/EventTypeAppCardInterface-VdYfOsab.js +51 -0
  24. package/dist/EventTypeAppCardInterface-VxD1hz61.js +34 -0
  25. package/dist/EventTypeAppCardInterface-Zei_gfk9.js +42 -0
  26. package/dist/EventTypeAppCardInterface-_2yZa06r.js +34 -0
  27. package/dist/EventTypeAppCardInterface-_mJKoptx.js +41 -0
  28. package/dist/EventTypeAppCardInterface-cZjp0yNN.js +34 -0
  29. package/dist/EventTypeAppCardInterface-ix9-eOy7.js +34 -0
  30. package/dist/EventTypeAppCardInterface-omHgFR_2.js +24 -0
  31. package/dist/EventTypeAppCardInterface-pS7YojCs.js +34 -0
  32. package/dist/EventTypeAppCardInterface-qaVZIE5N.js +49 -0
  33. package/dist/EventTypeAppCardInterface-ugSSelEX.js +42 -0
  34. package/dist/EventTypeAppCardInterface-wPiG1Uab.js +24 -0
  35. package/dist/EventTypeAppCardInterface-x8x6_qO2.js +86 -0
  36. package/dist/EventTypeAppSettingsInterface-A-zPsqPN.js +298 -0
  37. package/dist/EventTypeAppSettingsInterface-Mw0nUm2I.js +48 -0
  38. package/dist/EventTypeAppSettingsInterface-N-387tFo.js +120 -0
  39. package/dist/EventTypeAppSettingsInterface-SrOLSflD.js +43 -0
  40. package/dist/EventTypeAppSettingsInterface-TxRlEgaM.js +78 -0
  41. package/dist/EventTypeAppSettingsInterface-USUuP18O.js +24 -0
  42. package/dist/EventTypeAppSettingsInterface-_jGTLesb.js +72 -0
  43. package/dist/EventTypeAppSettingsInterface-aGQavYPZ.js +42 -0
  44. package/dist/EventTypeAppSettingsInterface-mf5L8PKf.js +25 -0
  45. package/dist/EventTypeAppSettingsInterface-uJw6TEuG.js +221 -0
  46. package/dist/EventTypeAppSettingsInterface-wRyNHA8Z.js +23 -0
  47. package/dist/EventTypeAppSettingsInterface-xfI4WyE9.js +23 -0
  48. package/dist/InstallAppButton-3pRRFAeS.js +14 -0
  49. package/dist/InstallAppButton-JXhBVaYJ.js +29 -0
  50. package/dist/InstallAppButton-sMIEaIrB.js +58 -0
  51. package/dist/InstallAppButton-xME8ESsW.js +14 -0
  52. package/dist/{PhoneInput-_EJl7Rqu.js → PhoneInput-_96ULuJw.js} +1 -1
  53. package/dist/StripePaymentForm-1ANfOJyB.js +493 -0
  54. package/dist/cal-atoms.js +36 -5
  55. package/dist/currencyOptions-kannG2hu.js +61 -0
  56. package/dist/index-VZRHTsae.js +28 -0
  57. package/dist/index-ZQlxzdt5.js +157233 -0
  58. package/dist/index-me6CfU0W.js +518 -0
  59. package/dist/{index-_P-UqUYu.js → index-qcnOr3S-.js} +1 -1
  60. package/dist/packages/features/bookings/Booker/components/hooks/useCalendars.d.ts +4 -0
  61. package/dist/packages/features/bookings/Booker/components/hooks/useCalendars.d.ts.map +1 -1
  62. package/dist/packages/features/bookings/Booker/store.d.ts +3 -1
  63. package/dist/packages/features/bookings/Booker/store.d.ts.map +1 -1
  64. package/dist/packages/features/bookings/Booker/types.d.ts +1 -0
  65. package/dist/packages/features/bookings/Booker/types.d.ts.map +1 -1
  66. package/dist/packages/features/bookings/lib/book-event-form/booking-to-mutation-input-mapper.d.ts +2 -1
  67. package/dist/packages/features/bookings/lib/book-event-form/booking-to-mutation-input-mapper.d.ts.map +1 -1
  68. package/dist/packages/features/bookings/lib/getBookingDataSchema.d.ts +3 -0
  69. package/dist/packages/features/bookings/lib/getBookingDataSchema.d.ts.map +1 -1
  70. package/dist/packages/features/bookings/lib/getBookingDataSchemaForApi.d.ts +5 -0
  71. package/dist/packages/features/bookings/lib/getBookingDataSchemaForApi.d.ts.map +1 -1
  72. package/dist/packages/features/bookings/lib/getBookingInfo.d.ts +2 -0
  73. package/dist/packages/features/bookings/lib/getBookingInfo.d.ts.map +1 -1
  74. package/dist/packages/features/bookings/lib/getUserBooking.d.ts +1 -0
  75. package/dist/packages/features/bookings/lib/getUserBooking.d.ts.map +1 -1
  76. package/dist/packages/features/bookings/lib/handleNewBooking/getBookingData.d.ts +4 -0
  77. package/dist/packages/features/bookings/lib/handleNewBooking/getBookingData.d.ts.map +1 -1
  78. package/dist/packages/features/bookings/lib/handleNewBooking/loadUsers.d.ts.map +1 -1
  79. package/dist/packages/features/bookings/lib/handleNewBooking.d.ts.map +1 -1
  80. package/dist/packages/features/data-table/lib/__tests__/server.test.d.ts +2 -0
  81. package/dist/packages/features/data-table/lib/__tests__/server.test.d.ts.map +1 -0
  82. package/dist/packages/features/data-table/lib/server.d.ts +8 -0
  83. package/dist/packages/features/data-table/lib/server.d.ts.map +1 -1
  84. package/dist/packages/features/ee/round-robin/assignmentReason/AssignmentReasonRecorder.d.ts +3 -1
  85. package/dist/packages/features/ee/round-robin/assignmentReason/AssignmentReasonRecorder.d.ts.map +1 -1
  86. package/dist/packages/features/ee/round-robin/assignmentReason/appAssignmentReasonHandler.d.ts +2 -1
  87. package/dist/packages/features/ee/round-robin/assignmentReason/appAssignmentReasonHandler.d.ts.map +1 -1
  88. package/dist/packages/features/ee/round-robin/roundRobinReassignment.d.ts.map +1 -1
  89. package/dist/packages/features/ee/workflows/api/scheduleSMSReminders.d.ts.map +1 -1
  90. package/dist/packages/features/ee/workflows/api/scheduleWhatsappReminders.d.ts.map +1 -1
  91. package/dist/packages/features/ee/workflows/lib/getWorkflowReminders.d.ts.map +1 -1
  92. package/dist/packages/features/eventtypes/components/EditWeightsForAllTeamMembers.d.ts.map +1 -1
  93. package/dist/packages/features/eventtypes/components/Locations.d.ts.map +1 -1
  94. package/dist/packages/features/eventtypes/components/tabs/advanced/RequiresConfirmationController.d.ts.map +1 -1
  95. package/dist/packages/features/eventtypes/lib/getPublicEvent.d.ts +985 -1
  96. package/dist/packages/features/eventtypes/lib/getPublicEvent.d.ts.map +1 -1
  97. package/dist/packages/features/eventtypes/lib/getTeamEventType.d.ts +166 -0
  98. package/dist/packages/features/eventtypes/lib/getTeamEventType.d.ts.map +1 -0
  99. package/dist/packages/features/eventtypes/lib/types.d.ts +1 -0
  100. package/dist/packages/features/eventtypes/lib/types.d.ts.map +1 -1
  101. package/dist/packages/features/schedules/components/Schedule.d.ts.map +1 -1
  102. package/dist/packages/platform/atoms/booker/BookerPlatformWrapper.d.ts.map +1 -1
  103. package/dist/packages/platform/atoms/cal-provider/BaseCalProvider.d.ts.map +1 -1
  104. package/dist/packages/platform/atoms/event-types/hooks/useAtomEventTypeById.d.ts +1 -0
  105. package/dist/packages/platform/atoms/event-types/hooks/useAtomEventTypeById.d.ts.map +1 -1
  106. package/dist/packages/platform/atoms/event-types/hooks/useAtomUpdateEventType.d.ts +1 -0
  107. package/dist/packages/platform/atoms/event-types/hooks/useAtomUpdateEventType.d.ts.map +1 -1
  108. package/dist/packages/platform/atoms/event-types/hooks/useEventTypeForm.d.ts.map +1 -1
  109. package/dist/packages/platform/atoms/hooks/bookings/useCreateInstantBooking.d.ts +1 -0
  110. package/dist/packages/platform/atoms/hooks/bookings/useCreateInstantBooking.d.ts.map +1 -1
  111. package/dist/packages/platform/atoms/hooks/bookings/useHandleBookEvent.d.ts.map +1 -1
  112. package/dist/packages/platform/atoms/hooks/event-types/public/useAtomGetPublicEvent.d.ts.map +1 -1
  113. package/dist/packages/platform/atoms/index.d.ts +34 -0
  114. package/dist/packages/platform/atoms/index.d.ts.map +1 -1
  115. package/dist/packages/platform/libraries/repositories.d.ts +1 -1
  116. package/dist/packages/platform/libraries/repositories.d.ts.map +1 -1
  117. package/dist/packages/platform/types/event-types/event-types_2024_06_14/inputs/booking-fields.input.d.ts.map +1 -1
  118. package/dist/packages/platform/types/slots/slots-2024-09-04/inputs/get-slots-input.pipe.d.ts +6 -0
  119. package/dist/packages/platform/types/slots/slots-2024-09-04/inputs/get-slots-input.pipe.d.ts.map +1 -1
  120. package/dist/packages/platform/types/slots/slots-2024-09-04/inputs/get-slots.input.d.ts +0 -4
  121. package/dist/packages/platform/types/slots/slots-2024-09-04/inputs/get-slots.input.d.ts.map +1 -1
  122. package/dist/packages/prisma/zod/calendarcache.d.ts +3 -0
  123. package/dist/packages/prisma/zod/calendarcache.d.ts.map +1 -1
  124. package/dist/packages/prisma/zod/calvideosettings.d.ts +3 -0
  125. package/dist/packages/prisma/zod/calvideosettings.d.ts.map +1 -1
  126. package/dist/packages/prisma/zod/custom/booking.d.ts +9 -0
  127. package/dist/packages/prisma/zod/custom/booking.d.ts.map +1 -1
  128. package/dist/packages/prisma-client/index.d.ts +65 -0
  129. package/dist/packages/trpc/server/routers/viewer/slots/util.d.ts +1 -1
  130. package/dist/packages/trpc/server/routers/viewer/slots/util.d.ts.map +1 -1
  131. package/dist/packages/trpc/server/routers/viewer/slots/util.test.d.ts +2 -0
  132. package/dist/packages/trpc/server/routers/viewer/slots/util.test.d.ts.map +1 -0
  133. package/dist/style.css +1 -1
  134. package/dist/useIsAppEnabled-V8Jl9FX-.js +18 -0
  135. package/package.json +1 -1
  136. package/dist/index-4kA2xtz7.js +0 -1957
  137. package/dist/index-ESVL5ZDq.js +0 -82852
@@ -0,0 +1,14 @@
1
+ import { jsx as e, Fragment as a } from "react/jsx-runtime";
2
+ import { u as o } from "./index-ZQlxzdt5.js";
3
+ function u(t) {
4
+ const n = o("exchange2016_calendar");
5
+ return /* @__PURE__ */ e(a, { children: t.render({
6
+ onClick() {
7
+ n.mutate("");
8
+ },
9
+ loading: n.isPending
10
+ }) });
11
+ }
12
+ export {
13
+ u as default
14
+ };
@@ -0,0 +1,29 @@
1
+ import { jsx as i, Fragment as a } from "react/jsx-runtime";
2
+ import { useState as s } from "react";
3
+ function f(n) {
4
+ const o = async () => {
5
+ const t = await fetch("/api/integrations/vital/token", {
6
+ method: "POST",
7
+ body: JSON.stringify({}),
8
+ headers: {
9
+ "Content-Type": "application/json"
10
+ }
11
+ });
12
+ if (!t.ok)
13
+ throw new Error("Failed to get link token");
14
+ return await t.json();
15
+ }, [r, e] = s(!1);
16
+ return /* @__PURE__ */ i(a, { children: n.render({
17
+ onClick() {
18
+ e(!0), o().then((t) => {
19
+ e(!1), window.open(`${t.url}&token=${t.token}`, "_self");
20
+ }).catch((t) => {
21
+ e(!1), console.error(t);
22
+ });
23
+ },
24
+ loading: r
25
+ }) });
26
+ }
27
+ export {
28
+ f as default
29
+ };
@@ -0,0 +1,58 @@
1
+ import { jsxs as f, Fragment as l, jsx as m } from "react/jsx-runtime";
2
+ import { useState as p } from "react";
3
+ import { u as d, af as E, W as g } from "./index-ZQlxzdt5.js";
4
+ var s = /* @__PURE__ */ ((n) => (n.ACCOUNTS_STEP = "accounts", n.EVENT_TYPES_STEP = "event-types", n.CONFIGURE_STEP = "configure", n))(s || {}), i = function(n) {
5
+ switch (typeof n) {
6
+ case "string":
7
+ return n;
8
+ case "boolean":
9
+ return n ? "true" : "false";
10
+ case "number":
11
+ return isFinite(n) ? n : "";
12
+ default:
13
+ return "";
14
+ }
15
+ }, y = function(n, t, e, o) {
16
+ return t = t || "&", e = e || "=", n === null && (n = void 0), typeof n == "object" ? Object.keys(n).map(function(r) {
17
+ var a = encodeURIComponent(i(r)) + e;
18
+ return Array.isArray(n[r]) ? n[r].map(function(c) {
19
+ return a + encodeURIComponent(i(c));
20
+ }).join(t) : a + encodeURIComponent(i(n[r]));
21
+ }).filter(Boolean).join(t) : o ? encodeURIComponent(i(o)) + e + encodeURIComponent(i(n)) : "";
22
+ }, u;
23
+ u = y;
24
+ const C = ({
25
+ slug: n,
26
+ step: t,
27
+ teamId: e
28
+ }) => {
29
+ const o = { slug: n };
30
+ e && (o.teamId = e);
31
+ const r = u(o);
32
+ return `/apps/installation/${t}?${r}`;
33
+ };
34
+ function I(n) {
35
+ const [t, e] = p(!1), o = d(null), r = () => {
36
+ o.mutate({
37
+ type: "office365_video",
38
+ variant: "conferencing",
39
+ slug: "msteams",
40
+ returnTo: g + C({
41
+ slug: "msteams",
42
+ step: s.EVENT_TYPES_STEP
43
+ })
44
+ });
45
+ };
46
+ return /* @__PURE__ */ f(l, { children: [
47
+ n.render({
48
+ onClick() {
49
+ e(!0);
50
+ },
51
+ disabled: t
52
+ }),
53
+ /* @__PURE__ */ m(E, { open: t, onOpenChange: e, handleSubmit: r })
54
+ ] });
55
+ }
56
+ export {
57
+ I as default
58
+ };
@@ -0,0 +1,14 @@
1
+ import { jsx as e, Fragment as a } from "react/jsx-runtime";
2
+ import { u as o } from "./index-ZQlxzdt5.js";
3
+ function u(t) {
4
+ const n = o("exchange2013_calendar");
5
+ return /* @__PURE__ */ e(a, { children: t.render({
6
+ onClick() {
7
+ n.mutate("");
8
+ },
9
+ loading: n.isPending
10
+ }) });
11
+ }
12
+ export {
13
+ u as default
14
+ };
@@ -1,6 +1,6 @@
1
1
  import { jsx as vt } from "react/jsx-runtime";
2
2
  import Bt, { useState as $t, useEffect as Gt } from "react";
3
- import { w as Vt, i as qt, g as Kt, u as Ut, c as It, t as Wt } from "./index-ESVL5ZDq.js";
3
+ import { ab as Vt, ac as qt, ad as Kt, ae as Ut, M as It, y as Wt } from "./index-ZQlxzdt5.js";
4
4
  function Ht() {
5
5
  return Vt(qt, arguments);
6
6
  }
@@ -0,0 +1,493 @@
1
+ import { jsxs as H, jsx as g } from "react/jsx-runtime";
2
+ import f, { useState as R, useEffect as Z } from "react";
3
+ import { am as S, q as ee, b as Ce, r as G, W as Oe } from "./index-ZQlxzdt5.js";
4
+ function Y(n, e) {
5
+ var t = Object.keys(n);
6
+ if (Object.getOwnPropertySymbols) {
7
+ var r = Object.getOwnPropertySymbols(n);
8
+ e && (r = r.filter(function(i) {
9
+ return Object.getOwnPropertyDescriptor(n, i).enumerable;
10
+ })), t.push.apply(t, r);
11
+ }
12
+ return t;
13
+ }
14
+ function V(n) {
15
+ for (var e = 1; e < arguments.length; e++) {
16
+ var t = arguments[e] != null ? arguments[e] : {};
17
+ e % 2 ? Y(Object(t), !0).forEach(function(r) {
18
+ te(n, r, t[r]);
19
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(t)) : Y(Object(t)).forEach(function(r) {
20
+ Object.defineProperty(n, r, Object.getOwnPropertyDescriptor(t, r));
21
+ });
22
+ }
23
+ return n;
24
+ }
25
+ function A(n) {
26
+ "@babel/helpers - typeof";
27
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? A = function(e) {
28
+ return typeof e;
29
+ } : A = function(e) {
30
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
31
+ }, A(n);
32
+ }
33
+ function te(n, e, t) {
34
+ return e in n ? Object.defineProperty(n, e, {
35
+ value: t,
36
+ enumerable: !0,
37
+ configurable: !0,
38
+ writable: !0
39
+ }) : n[e] = t, n;
40
+ }
41
+ function Pe(n, e) {
42
+ return we(n) || je(n, e) || xe(n, e) || Ae();
43
+ }
44
+ function we(n) {
45
+ if (Array.isArray(n))
46
+ return n;
47
+ }
48
+ function je(n, e) {
49
+ var t = n && (typeof Symbol < "u" && n[Symbol.iterator] || n["@@iterator"]);
50
+ if (t != null) {
51
+ var r = [], i = !0, a = !1, d, l;
52
+ try {
53
+ for (t = t.call(n); !(i = (d = t.next()).done) && (r.push(d.value), !(e && r.length === e)); i = !0)
54
+ ;
55
+ } catch (o) {
56
+ a = !0, l = o;
57
+ } finally {
58
+ try {
59
+ !i && t.return != null && t.return();
60
+ } finally {
61
+ if (a)
62
+ throw l;
63
+ }
64
+ }
65
+ return r;
66
+ }
67
+ }
68
+ function xe(n, e) {
69
+ if (n) {
70
+ if (typeof n == "string")
71
+ return X(n, e);
72
+ var t = Object.prototype.toString.call(n).slice(8, -1);
73
+ if (t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set")
74
+ return Array.from(n);
75
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
76
+ return X(n, e);
77
+ }
78
+ }
79
+ function X(n, e) {
80
+ (e == null || e > n.length) && (e = n.length);
81
+ for (var t = 0, r = new Array(e); t < e; t++)
82
+ r[t] = n[t];
83
+ return r;
84
+ }
85
+ function Ae() {
86
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
87
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
88
+ }
89
+ var T = function(e) {
90
+ var t = f.useRef(e);
91
+ return f.useEffect(function() {
92
+ t.current = e;
93
+ }, [e]), t.current;
94
+ }, P = function(e) {
95
+ return e !== null && A(e) === "object";
96
+ }, Le = function(e) {
97
+ return P(e) && typeof e.then == "function";
98
+ }, Re = function(e) {
99
+ return P(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
100
+ }, z = "[object Object]", Ie = function n(e, t) {
101
+ if (!P(e) || !P(t))
102
+ return e === t;
103
+ var r = Array.isArray(e), i = Array.isArray(t);
104
+ if (r !== i)
105
+ return !1;
106
+ var a = Object.prototype.toString.call(e) === z, d = Object.prototype.toString.call(t) === z;
107
+ if (a !== d)
108
+ return !1;
109
+ if (!a && !r)
110
+ return e === t;
111
+ var l = Object.keys(e), o = Object.keys(t);
112
+ if (l.length !== o.length)
113
+ return !1;
114
+ for (var s = {}, c = 0; c < l.length; c += 1)
115
+ s[l[c]] = !0;
116
+ for (var y = 0; y < o.length; y += 1)
117
+ s[o[y]] = !0;
118
+ var u = Object.keys(s);
119
+ if (u.length !== l.length)
120
+ return !1;
121
+ var b = e, _ = t, C = function(j) {
122
+ return n(b[j], _[j]);
123
+ };
124
+ return u.every(C);
125
+ }, ne = function(e, t, r) {
126
+ return P(e) ? Object.keys(e).reduce(function(i, a) {
127
+ var d = !P(t) || !Ie(e[a], t[a]);
128
+ return r.includes(a) ? (d && console.warn("Unsupported prop change: options.".concat(a, " is not a mutable property.")), i) : d ? V(V({}, i || {}), {}, te({}, a, e[a])) : i;
129
+ }, null) : null;
130
+ }, ke = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", J = function(e) {
131
+ if (e === null || Re(e))
132
+ return e;
133
+ throw new Error(ke);
134
+ }, Ne = function(e) {
135
+ if (Le(e))
136
+ return {
137
+ tag: "async",
138
+ stripePromise: Promise.resolve(e).then(J)
139
+ };
140
+ var t = J(e);
141
+ return t === null ? {
142
+ tag: "empty"
143
+ } : {
144
+ tag: "sync",
145
+ stripe: t
146
+ };
147
+ }, $ = /* @__PURE__ */ f.createContext(null);
148
+ $.displayName = "ElementsContext";
149
+ var Te = function(e, t) {
150
+ if (!e)
151
+ throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t, " in an <Elements> provider."));
152
+ return e;
153
+ }, re = function(e) {
154
+ var t = e.stripe, r = e.options, i = e.children, a = f.useMemo(function() {
155
+ return Ne(t);
156
+ }, [t]), d = f.useState(function() {
157
+ return {
158
+ stripe: a.tag === "sync" ? a.stripe : null,
159
+ elements: a.tag === "sync" ? a.stripe.elements(r) : null
160
+ };
161
+ }), l = Pe(d, 2), o = l[0], s = l[1];
162
+ f.useEffect(function() {
163
+ var u = !0, b = function(C) {
164
+ s(function(w) {
165
+ return w.stripe ? w : {
166
+ stripe: C,
167
+ elements: C.elements(r)
168
+ };
169
+ });
170
+ };
171
+ return a.tag === "async" && !o.stripe ? a.stripePromise.then(function(_) {
172
+ _ && u && b(_);
173
+ }) : a.tag === "sync" && !o.stripe && b(a.stripe), function() {
174
+ u = !1;
175
+ };
176
+ }, [a, o, r]);
177
+ var c = T(t);
178
+ f.useEffect(function() {
179
+ c !== null && c !== t && console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.");
180
+ }, [c, t]);
181
+ var y = T(r);
182
+ return f.useEffect(function() {
183
+ if (o.elements) {
184
+ var u = ne(r, y, ["clientSecret", "fonts"]);
185
+ u && o.elements.update(u);
186
+ }
187
+ }, [r, y, o.elements]), f.useEffect(function() {
188
+ var u = o.stripe;
189
+ !u || !u._registerWrapper || !u.registerAppInfo || (u._registerWrapper({
190
+ name: "react-stripe-js",
191
+ version: "1.10.0"
192
+ }), u.registerAppInfo({
193
+ name: "react-stripe-js",
194
+ version: "1.10.0",
195
+ url: "https://stripe.com/docs/stripe-js/react"
196
+ }));
197
+ }, [o.stripe]), /* @__PURE__ */ f.createElement($.Provider, {
198
+ value: o
199
+ }, i);
200
+ };
201
+ re.propTypes = {
202
+ stripe: S.any,
203
+ options: S.object
204
+ };
205
+ var I = function(e) {
206
+ var t = f.useContext($);
207
+ return Te(t, e);
208
+ }, $e = function() {
209
+ var e = I("calls useElements()"), t = e.elements;
210
+ return t;
211
+ }, Be = function() {
212
+ var e = I("calls useStripe()"), t = e.stripe;
213
+ return t;
214
+ };
215
+ S.func.isRequired;
216
+ var h = function(e) {
217
+ var t = f.useRef(e);
218
+ return f.useEffect(function() {
219
+ t.current = e;
220
+ }, [e]), function() {
221
+ t.current && t.current.apply(t, arguments);
222
+ };
223
+ }, E = function() {
224
+ }, Ue = function(e) {
225
+ return e.charAt(0).toUpperCase() + e.slice(1);
226
+ }, p = function(e, t) {
227
+ var r = "".concat(Ue(e), "Element"), i = function(o) {
228
+ var s = o.id, c = o.className, y = o.options, u = y === void 0 ? {} : y, b = o.onBlur, _ = b === void 0 ? E : b, C = o.onFocus, w = C === void 0 ? E : C, j = o.onReady, ce = j === void 0 ? E : j, U = o.onChange, ue = U === void 0 ? E : U, W = o.onEscape, le = W === void 0 ? E : W, F = o.onClick, fe = F === void 0 ? E : F, q = o.onLoadError, de = q === void 0 ? E : q, D = o.onLoaderStart, pe = D === void 0 ? E : D, me = I("mounts <".concat(r, ">")), M = me.elements, O = f.useRef(null), k = f.useRef(null), ye = h(ce), ve = h(_), ge = h(w), Se = h(fe), be = h(ue), he = h(le), Ee = h(de), _e = h(pe);
229
+ f.useLayoutEffect(function() {
230
+ if (O.current == null && M && k.current != null) {
231
+ var v = M.create(e, u);
232
+ O.current = v, v.mount(k.current), v.on("ready", function() {
233
+ return ye(v);
234
+ }), v.on("change", be), v.on("blur", ve), v.on("focus", ge), v.on("escape", he), v.on("loaderror", Ee), v.on("loaderstart", _e), v.on("click", Se);
235
+ }
236
+ });
237
+ var K = T(u);
238
+ return f.useEffect(function() {
239
+ if (O.current) {
240
+ var v = ne(u, K, ["paymentRequest"]);
241
+ v && O.current.update(v);
242
+ }
243
+ }, [u, K]), f.useLayoutEffect(function() {
244
+ return function() {
245
+ O.current && (O.current.destroy(), O.current = null);
246
+ };
247
+ }, []), /* @__PURE__ */ f.createElement("div", {
248
+ id: s,
249
+ className: c,
250
+ ref: k
251
+ });
252
+ }, a = function(o) {
253
+ I("mounts <".concat(r, ">"));
254
+ var s = o.id, c = o.className;
255
+ return /* @__PURE__ */ f.createElement("div", {
256
+ id: s,
257
+ className: c
258
+ });
259
+ }, d = t ? a : i;
260
+ return d.propTypes = {
261
+ id: S.string,
262
+ className: S.string,
263
+ onChange: S.func,
264
+ onBlur: S.func,
265
+ onFocus: S.func,
266
+ onReady: S.func,
267
+ onClick: S.func,
268
+ onLoadError: S.func,
269
+ onLoaderStart: S.func,
270
+ options: S.object
271
+ }, d.displayName = r, d.__elementType = e, d;
272
+ }, m = typeof window > "u";
273
+ p("auBankAccount", m);
274
+ p("card", m);
275
+ p("cardNumber", m);
276
+ p("cardExpiry", m);
277
+ p("cardCvc", m);
278
+ p("fpxBank", m);
279
+ p("iban", m);
280
+ p("idealBank", m);
281
+ p("p24Bank", m);
282
+ p("epsBank", m);
283
+ var We = p("payment", m);
284
+ p("paymentRequestButton", m);
285
+ p("linkAuthentication", m);
286
+ p("shippingAddress", m);
287
+ p("affirmMessage", m);
288
+ p("afterpayClearpayMessage", m);
289
+ var B = {};
290
+ Object.defineProperty(B, "__esModule", { value: !0 });
291
+ function L(n) {
292
+ "@babel/helpers - typeof";
293
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? L = function(e) {
294
+ return typeof e;
295
+ } : L = function(e) {
296
+ return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
297
+ }, L(n);
298
+ }
299
+ var ae = "https://js.stripe.com/v3", Fe = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, Q = "loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used", qe = function() {
300
+ for (var e = document.querySelectorAll('script[src^="'.concat(ae, '"]')), t = 0; t < e.length; t++) {
301
+ var r = e[t];
302
+ if (Fe.test(r.src))
303
+ return r;
304
+ }
305
+ return null;
306
+ }, De = function(e) {
307
+ var t = e && !e.advancedFraudSignals ? "?advancedFraudSignals=false" : "", r = document.createElement("script");
308
+ r.src = "".concat(ae).concat(t);
309
+ var i = document.head || document.body;
310
+ if (!i)
311
+ throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
312
+ return i.appendChild(r), r;
313
+ }, Me = function(e, t) {
314
+ !e || !e._registerWrapper || e._registerWrapper({
315
+ name: "stripe-js",
316
+ version: "1.35.0",
317
+ startTime: t
318
+ });
319
+ }, x = null, Ke = function(e) {
320
+ return x !== null || (x = new Promise(function(t, r) {
321
+ if (typeof window > "u") {
322
+ t(null);
323
+ return;
324
+ }
325
+ if (window.Stripe && e && console.warn(Q), window.Stripe) {
326
+ t(window.Stripe);
327
+ return;
328
+ }
329
+ try {
330
+ var i = qe();
331
+ i && e ? console.warn(Q) : i || (i = De(e)), i.addEventListener("load", function() {
332
+ window.Stripe ? t(window.Stripe) : r(new Error("Stripe.js not available"));
333
+ }), i.addEventListener("error", function() {
334
+ r(new Error("Failed to load Stripe.js"));
335
+ });
336
+ } catch (a) {
337
+ r(a);
338
+ return;
339
+ }
340
+ })), x;
341
+ }, He = function(e, t, r) {
342
+ if (e === null)
343
+ return null;
344
+ var i = e.apply(void 0, t);
345
+ return Me(i, r), i;
346
+ }, Ge = function(e) {
347
+ var t = `invalid load parameters; expected object of shape
348
+
349
+ {advancedFraudSignals: boolean}
350
+
351
+ but received
352
+
353
+ `.concat(JSON.stringify(e), `
354
+ `);
355
+ if (e === null || L(e) !== "object")
356
+ throw new Error(t);
357
+ if (Object.keys(e).length === 1 && typeof e.advancedFraudSignals == "boolean")
358
+ return e;
359
+ throw new Error(t);
360
+ }, oe, ie = !1, se = function() {
361
+ for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
362
+ t[r] = arguments[r];
363
+ ie = !0;
364
+ var i = Date.now();
365
+ return Ke(oe).then(function(a) {
366
+ return He(a, t, i);
367
+ });
368
+ };
369
+ se.setLoadParameters = function(n) {
370
+ if (ie)
371
+ throw new Error("You cannot change load parameters after calling loadStripe");
372
+ oe = Ge(n);
373
+ };
374
+ B.loadStripe = se;
375
+ var Ye = B;
376
+ const Ve = process.env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY || "";
377
+ let N;
378
+ const Xe = (n) => (N || (N = Ye.loadStripe(
379
+ n || Ve
380
+ /* , {
381
+ locale: "es-419" TODO: Handle multiple locales,
382
+ } */
383
+ )), N), ze = Xe, Je = (n) => {
384
+ const { t: e, i18n: t } = ee(), { paymentOption: r, elements: i, state: a, onPaymentElementChange: d } = n, [l, o] = R(!1), [s, c] = R(r !== "HOLD"), y = l || !s || ["processing", "error"].includes(a.status), u = {
385
+ layout: "accordion"
386
+ };
387
+ return Z(() => {
388
+ i == null || i.update({ locale: t.language });
389
+ }, [i, t.language]), /* @__PURE__ */ H("form", { id: "payment-form", className: "bg-subtle mt-4 rounded-md p-6", onSubmit: n.onSubmit, children: [
390
+ /* @__PURE__ */ g("div", { children: /* @__PURE__ */ g(We, { options: u, onChange: (b) => d() }) }),
391
+ r === "HOLD" && /* @__PURE__ */ g("div", { className: "bg-info mb-5 mt-2 rounded-md p-3", children: /* @__PURE__ */ g(
392
+ Ce,
393
+ {
394
+ description: e("acknowledge_booking_no_show_fee", {
395
+ amount: n.payment.amount / 100,
396
+ formatParams: { amount: { currency: n.payment.currency } }
397
+ }),
398
+ onChange: (b) => c(b.target.checked),
399
+ descriptionClassName: "text-info font-semibold"
400
+ }
401
+ ) }),
402
+ /* @__PURE__ */ H("div", { className: "mt-2 flex justify-end space-x-2", children: [
403
+ /* @__PURE__ */ g(
404
+ G,
405
+ {
406
+ color: "minimal",
407
+ disabled: y,
408
+ id: "cancel",
409
+ type: "button",
410
+ loading: l,
411
+ onClick: () => {
412
+ o(!0), n.onCancel();
413
+ },
414
+ children: /* @__PURE__ */ g("span", { id: "button-text", children: e("cancel") })
415
+ }
416
+ ),
417
+ /* @__PURE__ */ g(
418
+ G,
419
+ {
420
+ type: "submit",
421
+ disabled: y,
422
+ loading: a.status === "processing",
423
+ id: "submit",
424
+ color: "secondary",
425
+ children: /* @__PURE__ */ g("span", { id: "button-text", children: a.status === "processing" ? /* @__PURE__ */ g("div", { className: "spinner", id: "spinner" }) : e(r === "HOLD" ? "submit_card" : "pay_now") })
426
+ }
427
+ )
428
+ ] }),
429
+ a.status === "error" && /* @__PURE__ */ g("div", { className: "mt-4 text-center text-red-900 dark:text-gray-300", role: "alert", children: a.error.message })
430
+ ] });
431
+ }, Qe = (n) => {
432
+ const { t: e } = ee(), t = $e(), r = n.payment.paymentOption, i = n.booking.attendees[0].email, a = Be(), [d, l] = R({ status: "idle" });
433
+ return /* @__PURE__ */ g(
434
+ Je,
435
+ {
436
+ ...n,
437
+ elements: t,
438
+ paymentOption: r,
439
+ state: d,
440
+ onSubmit: async (o) => {
441
+ var y;
442
+ if (o.preventDefault(), !a || !t)
443
+ return;
444
+ l({ status: "processing" });
445
+ let s;
446
+ const c = {
447
+ uid: n.booking.uid,
448
+ email: i
449
+ };
450
+ r === "HOLD" && "setupIntent" in n.payment.data ? (s = await a.confirmSetup({
451
+ elements: t,
452
+ redirect: "if_required"
453
+ }), s.setupIntent && (c.payment_intent = s.setupIntent.id, c.payment_intent_client_secret = s.setupIntent.client_secret || void 0, c.redirect_status = s.setupIntent.status)) : r === "ON_BOOKING" && (s = await a.confirmPayment({
454
+ elements: t,
455
+ redirect: "if_required",
456
+ confirmParams: {
457
+ return_url: `${Oe}/booking/${c.uid}`
458
+ }
459
+ }), s.paymentIntent && (c.payment_intent = s.paymentIntent.id, c.payment_intent_client_secret = s.paymentIntent.client_secret || void 0, c.redirect_status = s.paymentIntent.status)), s != null && s.error ? l({
460
+ status: "error",
461
+ error: new Error(`Payment failed: ${s.error.message}`)
462
+ }) : (l({ status: "idle" }), (y = n.onPaymentSuccess) == null || y.call(n, n), n.location && (n.location.includes("integration") ? c.location = e("web_conferencing_details_to_follow") : c.location = n.location));
463
+ },
464
+ onCancel: () => {
465
+ var o;
466
+ (o = n.onPaymentCancellation) == null || o.call(n, n);
467
+ },
468
+ onPaymentElementChange: () => {
469
+ l({ status: "idle" });
470
+ }
471
+ }
472
+ );
473
+ }, nt = (n) => {
474
+ const e = ze(n.payment.data.stripe_publishable_key), [t, r] = R("stripe");
475
+ return Z(() => {
476
+ document.documentElement.classList.contains("dark") && r("night");
477
+ }, []), /* @__PURE__ */ g(
478
+ re,
479
+ {
480
+ stripe: e,
481
+ options: {
482
+ clientSecret: n.clientSecret,
483
+ appearance: {
484
+ theme: t
485
+ }
486
+ },
487
+ children: /* @__PURE__ */ g(Qe, { ...n })
488
+ }
489
+ );
490
+ };
491
+ export {
492
+ nt as default
493
+ };
package/dist/cal-atoms.js CHANGED
@@ -1,7 +1,38 @@
1
- import { al as s, ak as e, am as r, u as t } from "./index-ESVL5ZDq.js";
1
+ import { aD as s, aE as n, aR as t, aB as o, aZ as r, a$ as i, aQ as u, b1 as C, aY as l, a_ as d, aC as g, aP as c, b2 as p, aS as v, aX as S, b0 as T, aU as m, aF as y, aM as E, aN as b, aL as B, aG as k, b3 as A, b4 as O, aT as P, aJ as f, aK as D, aH as I, ae as R, aO as x, b5 as z, b6 as F, aV as G, aI as M, aW as U } from "./index-ZQlxzdt5.js";
2
2
  export {
3
- s as Booker,
4
- e as CalProvider,
5
- r as useAtomsContext,
6
- t as useIsPlatform
3
+ s as AvailabilitySettings,
4
+ n as Booker,
5
+ t as BookerEmbed,
6
+ o as CalProvider,
7
+ r as CalendarSettings,
8
+ i as ConferencingAppsSettings,
9
+ u as Connect,
10
+ C as CreateEventType,
11
+ l as DestinationCalendarSettings,
12
+ d as EventTypeSettings,
13
+ g as GcalConnect,
14
+ c as OutlookConnect,
15
+ p as PaymentForm,
16
+ v as Router,
17
+ S as SelectedCalendarsSettings,
18
+ T as StripeConnect,
19
+ m as useAddSelectedCalendar,
20
+ y as useAtomsContext,
21
+ E as useBooking,
22
+ b as useBookings,
23
+ B as useCancelBooking,
24
+ k as useConnectedCalendars,
25
+ A as useCreateEventType,
26
+ O as useCreateTeamEventType,
27
+ P as useDeleteCalendarCredentials,
28
+ f as useEvent,
29
+ D as useEventTypeById,
30
+ I as useEventTypes,
31
+ R as useIsPlatform,
32
+ x as useMe,
33
+ z as useOrganizationBookings,
34
+ F as useOrganizationUserBookings,
35
+ G as useRemoveSelectedCalendar,
36
+ M as useTeamEventTypes,
37
+ U as useTeams
7
38
  };