@campphillip/widgets 4.0.7 → 4.0.8

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/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # @campphillip/widgets
2
+
3
+ Web components for embedding Camp Phillip content.
4
+
5
+ ## Quick Start
6
+
7
+ ```html
8
+ <link rel="stylesheet" href="https://unpkg.com/@campphillip/widgets@latest/dist/widgets.css">
9
+ <div id="camp-events"></div>
10
+ <script type="module" src="https://unpkg.com/@campphillip/widgets@latest/dist/events.widget.js"></script>
11
+ ```
12
+
13
+ ## Available Widgets
14
+
15
+ | Widget | Container ID | Script |
16
+ |--------|--------------|--------|
17
+ | Events | `camp-events` | `events.widget.js` |
18
+ | Board Events | `camp-board-events` | `board-events.widget.js` |
19
+ | Calendar | `camp-calendar` | `calendar.widget.js` |
20
+ | Banners | `camp-banners` | `banners.widget.js` |
21
+ | Categories | `camp-categories` | `categories.widget.js` |
22
+ | Rates | `camp-rates` | `rates.widget.js` |
23
+
24
+ ## Local Dev
25
+
26
+ ```sh
27
+ npm run dev
28
+ ```
29
+
30
+ ## Local Testing
31
+
32
+ ```sh
33
+ npm run build
34
+ npm run serve
35
+ ```
@@ -0,0 +1,71 @@
1
+ import { j as t, r as o } from "./vendor.js";
2
+ import { E as c, f as h, a as d } from "./EventContainer.js";
3
+ const u = () => /* @__PURE__ */ t.jsxs(
4
+ "svg",
5
+ {
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ width: "24",
8
+ height: "24",
9
+ viewBox: "0 0 24 24",
10
+ fill: "none",
11
+ stroke: "currentColor",
12
+ strokeWidth: "2",
13
+ strokeLinecap: "round",
14
+ strokeLinejoin: "round",
15
+ className: "feather feather-calendar",
16
+ children: [
17
+ /* @__PURE__ */ t.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
18
+ /* @__PURE__ */ t.jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
19
+ /* @__PURE__ */ t.jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
20
+ /* @__PURE__ */ t.jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
21
+ ]
22
+ }
23
+ ), f = "_calendarButton_1m4jh_1", v = {
24
+ calendarButton: f
25
+ }, j = ({
26
+ events: e,
27
+ loading: n
28
+ }) => {
29
+ const s = /* @__PURE__ */ t.jsxs("a", { className: v.calendarButton, href: "/calendar", children: [
30
+ /* @__PURE__ */ t.jsx(u, {}),
31
+ "Check out our calendar"
32
+ ] });
33
+ return /* @__PURE__ */ t.jsx(
34
+ c,
35
+ {
36
+ events: e,
37
+ loading: n,
38
+ title: "What's going on at Camp?",
39
+ headerActions: s
40
+ }
41
+ );
42
+ }, E = ({
43
+ events: e,
44
+ loading: n
45
+ }) => /* @__PURE__ */ t.jsx(
46
+ c,
47
+ {
48
+ events: e,
49
+ loading: n,
50
+ title: "Upcoming Board Events"
51
+ }
52
+ ), g = ({ type: e }) => {
53
+ const [n, s] = o.useState([]), [a, i] = o.useState(!0);
54
+ return o.useEffect(() => {
55
+ async function l() {
56
+ const x = e === "events" ? h : d;
57
+ try {
58
+ const r = await x();
59
+ s(r);
60
+ } catch (r) {
61
+ console.error(r);
62
+ } finally {
63
+ i(!1);
64
+ }
65
+ }
66
+ l();
67
+ }, [e]), e === "events" ? /* @__PURE__ */ t.jsx(j, { events: n, loading: a }) : /* @__PURE__ */ t.jsx(E, { events: n, loading: a });
68
+ };
69
+ export {
70
+ g as E
71
+ };
@@ -0,0 +1,171 @@
1
+ import { s as j, u as N } from "./sanityClient.js";
2
+ import { j as e, S as g, a as h, b as p, P as S, i as q, f as x, d as D, R as M, r as B } from "./vendor.js";
3
+ const V = async () => await j.fetch(`*[_type == 'event'] | order(startDate asc)
4
+ {
5
+ name,
6
+ image,
7
+ imageType,
8
+ startDate,
9
+ endDate,
10
+ shortDescription,
11
+ buttons,
12
+ isSummerCampEvent
13
+ }`), X = async () => await j.fetch(`*[_type == 'board-event'] | order(startDate asc)
14
+ {
15
+ name,
16
+ image,
17
+ imageType,
18
+ startDate,
19
+ endDate,
20
+ shortDescription,
21
+ buttons,
22
+ isSummerCampEvent
23
+ }`), E = "_eventCard_17x4q_1", b = "_eventCardBody_17x4q_13", T = "_image_17x4q_27", W = "_square_17x4q_34", $ = "_eventCardTitle_17x4q_39", G = "_eventCardDate_17x4q_46", k = "_eventCardDescription_17x4q_51", H = "_eventButtons_17x4q_55", w = "_eventButton_17x4q_55", I = "_summerCamp_17x4q_140", n = {
24
+ eventCard: E,
25
+ eventCardBody: b,
26
+ image: T,
27
+ square: W,
28
+ eventCardTitle: $,
29
+ eventCardDate: G,
30
+ eventCardDescription: k,
31
+ eventButtons: H,
32
+ eventButton: w,
33
+ summerCamp: I
34
+ }, C = ({
35
+ name: t,
36
+ image: a,
37
+ imageType: d,
38
+ startDate: m,
39
+ endDate: _,
40
+ shortDescription: v,
41
+ buttons: u,
42
+ loading: f,
43
+ containerStyle: i,
44
+ isSummerCampEvent: o
45
+ }) => {
46
+ const l = L(m, _);
47
+ return /* @__PURE__ */ e.jsx(g, { baseColor: "#dcdcdc", children: /* @__PURE__ */ e.jsxs(
48
+ "div",
49
+ {
50
+ className: h(
51
+ n.eventCard,
52
+ o && n.summerCamp
53
+ ),
54
+ style: { ...i },
55
+ children: [
56
+ a ? /* @__PURE__ */ e.jsx(
57
+ "img",
58
+ {
59
+ src: N(a).height(400).url(),
60
+ className: h(
61
+ n.image,
62
+ d === "square" && n.square
63
+ ),
64
+ crossOrigin: "anonymous",
65
+ alt: ""
66
+ }
67
+ ) : /* @__PURE__ */ e.jsx("div", { className: n.image, children: /* @__PURE__ */ e.jsx(
68
+ p,
69
+ {
70
+ height: 400,
71
+ style: { lineHeight: "normal" }
72
+ }
73
+ ) }),
74
+ /* @__PURE__ */ e.jsxs("div", { className: n.eventCardBody, children: [
75
+ /* @__PURE__ */ e.jsxs("div", { children: [
76
+ /* @__PURE__ */ e.jsx("h3", { className: n.eventCardTitle, children: t || /* @__PURE__ */ e.jsx(p, {}) }),
77
+ /* @__PURE__ */ e.jsx("div", { className: n.eventCardDate, children: l || /* @__PURE__ */ e.jsx(p, {}) })
78
+ ] }),
79
+ /* @__PURE__ */ e.jsx("div", { className: n.eventCardDescription, children: v ? /* @__PURE__ */ e.jsx(S, { value: v }) : /* @__PURE__ */ e.jsx(p, { count: 7 }) }),
80
+ /* @__PURE__ */ e.jsx("div", { className: n.eventButtons, children: u ? u.map(({ url: s, text: r, _key: y }) => /* @__PURE__ */ e.jsx(
81
+ "a",
82
+ {
83
+ href: s,
84
+ className: n.eventButton,
85
+ children: /* @__PURE__ */ e.jsx("div", { children: r })
86
+ },
87
+ y
88
+ )) : f && /* @__PURE__ */ e.jsx(p, { className: n.eventButton }) })
89
+ ] })
90
+ ]
91
+ }
92
+ ) });
93
+ };
94
+ function L(t, a) {
95
+ if (!t || !a) return null;
96
+ const d = new Date(t), m = new Date(a);
97
+ return q(d, m) ? x(d, "MMMM d") : D(d, m) ? x(d, "MMMM d") + " – " + x(m, "d") : x(d, "MMMM d") + " – " + x(m, "MMMM d");
98
+ }
99
+ const F = "_eventsContainer_1fuij_1", R = "_eventsHeader_1fuij_11", P = "_eventsList_1fuij_28", O = "_eventWrapper_1fuij_34", z = "_summerCampGroup_1fuij_38", J = "_summerCampTitle_1fuij_50", K = "_empty_1fuij_60", c = {
100
+ eventsContainer: F,
101
+ eventsHeader: R,
102
+ eventsList: P,
103
+ eventWrapper: O,
104
+ summerCampGroup: z,
105
+ summerCampTitle: J,
106
+ empty: K
107
+ }, Y = ({
108
+ events: t,
109
+ loading: a,
110
+ className: d,
111
+ title: m = "What's going on at Camp?",
112
+ headerActions: _,
113
+ groupSummerCampEvents: v = !1
114
+ }) => {
115
+ const u = M.useMemo(() => {
116
+ if (!t) return [];
117
+ if (!v)
118
+ return t.map((s, r) => ({ isSummerCamp: !1, events: [s], startIndex: r }));
119
+ const i = t.filter((s) => s.isSummerCampEvent), o = t.findIndex((s) => s.isSummerCampEvent);
120
+ if (i.length === 0)
121
+ return t.map((s, r) => ({ isSummerCamp: !1, events: [s], startIndex: r }));
122
+ let l = !1;
123
+ return t.flatMap((s, r) => s.isSummerCampEvent ? l ? [] : (l = !0, [{ isSummerCamp: !0, events: i, startIndex: o }]) : [{ isSummerCamp: !1, events: [s], startIndex: r }]);
124
+ }, [t, v]), f = u.findIndex((i) => i.isSummerCamp);
125
+ return /* @__PURE__ */ e.jsxs("div", { className: `${c.eventsContainer} ${d || ""}`, children: [
126
+ (m || _) && /* @__PURE__ */ e.jsxs("div", { className: c.eventsHeader, children: [
127
+ m && /* @__PURE__ */ e.jsx("h1", { children: m }),
128
+ _
129
+ ] }),
130
+ /* @__PURE__ */ e.jsx("div", { className: c.eventsList, children: a ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
131
+ /* @__PURE__ */ e.jsx("div", { className: c.eventWrapper, children: /* @__PURE__ */ e.jsx(C, { loading: a }, "loading-1") }),
132
+ /* @__PURE__ */ e.jsx("div", { className: c.eventWrapper, children: /* @__PURE__ */ e.jsx(C, { loading: a }, "loading-2") }),
133
+ /* @__PURE__ */ e.jsx("div", { className: c.eventWrapper, children: /* @__PURE__ */ e.jsx(C, { loading: a }, "loading-3") })
134
+ ] }) : u.length > 0 ? u.map((i, o) => {
135
+ const l = o === f;
136
+ return i.isSummerCamp ? /* @__PURE__ */ e.jsxs(
137
+ "div",
138
+ {
139
+ className: c.summerCampGroup,
140
+ id: l ? "summer-camp" : void 0,
141
+ children: [
142
+ /* @__PURE__ */ e.jsx("h2", { className: c.summerCampTitle, children: "🏕️ Summer Camp" }),
143
+ i.events.map((s, r) => /* @__PURE__ */ B.createElement(
144
+ C,
145
+ {
146
+ ...s,
147
+ key: `${o}-${r}`,
148
+ loading: a
149
+ }
150
+ ))
151
+ ]
152
+ },
153
+ `group-${o}`
154
+ ) : i.events.map((s, r) => /* @__PURE__ */ e.jsx("div", { className: c.eventWrapper, children: /* @__PURE__ */ e.jsx(
155
+ C,
156
+ {
157
+ ...s,
158
+ loading: a
159
+ }
160
+ ) }, `${o}-${r}`));
161
+ }) : /* @__PURE__ */ e.jsxs("div", { className: c.empty, children: [
162
+ /* @__PURE__ */ e.jsx("img", { src: "https://d2114hmso7dut1.cloudfront.net/customers/096355b6-1a03-11eb-a9c3-0614187498c1/sites/096f9d4e-1a03-11eb-b2dd-0614187498c1/files/67900ba0-5f83-11eb-9222-e3d4d8baf1a9/original/file.png?t=1611630366" }),
163
+ "No upcoming events. Check back later!"
164
+ ] }) })
165
+ ] });
166
+ };
167
+ export {
168
+ Y as E,
169
+ X as a,
170
+ V as f
171
+ };
@@ -1,2 +1,47 @@
1
- import "./vendor.js";
2
- import "./campphillip.js";
1
+ import { j as n, b as l, P as b, r as s, c as d, R as p } from "./vendor.js";
2
+ import { s as u, u as m } from "./sanityClient.js";
3
+ const x = async () => await u.fetch("*[_type == 'banner']"), h = "_banner_1d1ur_1", c = {
4
+ banner: h
5
+ }, y = {
6
+ marks: {
7
+ color: ({ value: e, children: t }) => /* @__PURE__ */ n.jsx(
8
+ "span",
9
+ {
10
+ style: {
11
+ color: e.hex
12
+ },
13
+ children: t
14
+ }
15
+ )
16
+ }
17
+ }, j = ({ image: e, text: t, url: a, loading: o }) => {
18
+ const r = () => {
19
+ a && (window.location.href = a);
20
+ };
21
+ return o ? /* @__PURE__ */ n.jsx("div", { className: c.banner, style: { display: "block" }, children: /* @__PURE__ */ n.jsx(l, { height: "100%", width: "100%" }) }) : /* @__PURE__ */ n.jsx(
22
+ "span",
23
+ {
24
+ onClick: r,
25
+ style: {
26
+ cursor: a ? "pointer" : "",
27
+ backgroundImage: `linear-gradient(
28
+ rgba(0, 0, 0, 0.2),
29
+ rgba(0, 0, 0, 0.2)
30
+ ), url("${m(e).width(1440).url()}")`
31
+ },
32
+ className: c.banner,
33
+ children: /* @__PURE__ */ n.jsx(b, { value: t, components: y })
34
+ }
35
+ );
36
+ }, f = "_bannerContainer_79bac_1", _ = "_bannerApp_79bac_8", i = {
37
+ bannerContainer: f,
38
+ bannerApp: _
39
+ }, g = ({ children: e }) => /* @__PURE__ */ n.jsx("div", { className: i.bannerContainer, children: /* @__PURE__ */ n.jsx("div", { className: i.bannerApp, children: e }) }), C = () => {
40
+ const [e, t] = s.useState([]), [a, o] = s.useState(!0);
41
+ return s.useEffect(() => {
42
+ x().then((r) => t(r)).catch((r) => console.log(r)).finally(() => o(!1));
43
+ }, []), /* @__PURE__ */ n.jsx(g, { children: e.map((r) => /* @__PURE__ */ s.createElement(j, { ...r, loading: a, key: r._id })) });
44
+ }, k = document.getElementById("camp-banners"), B = d.createRoot(k);
45
+ B.render(
46
+ /* @__PURE__ */ n.jsx(p.StrictMode, { children: /* @__PURE__ */ n.jsx(C, {}) })
47
+ );
@@ -1,2 +1,6 @@
1
- import "./vendor.js";
2
- import "./campphillip.js";
1
+ import { c as e, j as t, R as o } from "./vendor.js";
2
+ import { E as r } from "./EventApiContainer.js";
3
+ const n = document.getElementById("board-events"), s = e.createRoot(n);
4
+ s.render(
5
+ /* @__PURE__ */ t.jsx(o.StrictMode, { children: /* @__PURE__ */ t.jsx(r, { type: "board-events" }) })
6
+ );
@@ -0,0 +1,54 @@
1
+ import { j as t, r as o, c as l, R as i } from "./vendor.js";
2
+ import { E, f as d } from "./EventContainer.js";
3
+ const p = "_summerEventsButton_lx20e_2", f = {
4
+ summerEventsButton: p
5
+ }, v = ({
6
+ events: e,
7
+ loading: s
8
+ }) => {
9
+ const n = e?.some((r) => r.isSummerCampEvent) ? /* @__PURE__ */ t.jsxs(
10
+ "a",
11
+ {
12
+ className: f.summerEventsButton,
13
+ href: "#summer-camp",
14
+ children: [
15
+ /* @__PURE__ */ t.jsx("span", { children: "🏕️" }),
16
+ " Jump to Summer Camp"
17
+ ]
18
+ }
19
+ ) : null;
20
+ return /* @__PURE__ */ t.jsx(
21
+ E,
22
+ {
23
+ events: e,
24
+ loading: s,
25
+ title: "Camp Calendar",
26
+ headerActions: n,
27
+ groupSummerCampEvents: !0
28
+ }
29
+ );
30
+ }, x = ({ className: e }) => {
31
+ const [s, m] = o.useState([]), [n, r] = o.useState(!0);
32
+ return o.useEffect(() => {
33
+ async function u() {
34
+ try {
35
+ const a = await d();
36
+ m(a);
37
+ } catch (a) {
38
+ console.error(a);
39
+ } finally {
40
+ r(!1);
41
+ }
42
+ }
43
+ u();
44
+ }, []), /* @__PURE__ */ t.jsx(
45
+ v,
46
+ {
47
+ events: s,
48
+ loading: n
49
+ }
50
+ );
51
+ }, c = document.getElementById("camp-calendar");
52
+ c && l.createRoot(c).render(
53
+ /* @__PURE__ */ t.jsx(i.StrictMode, { children: /* @__PURE__ */ t.jsx(x, {}) })
54
+ );
@@ -1,2 +1,70 @@
1
- import "./vendor.js";
2
- import "./campphillip.js";
1
+ import { j as t, b as c, r as i, c as l, R as u } from "./vendor.js";
2
+ import { s as d, u as g } from "./sanityClient.js";
3
+ const m = async () => d.fetch("*[_type == 'category']|order(orderRank)"), y = "_contentButton_2dk7a_1", h = "_overlay_2dk7a_40", _ = "_buttonTitle_2dk7a_56", x = "_buttonSubtitle_2dk7a_57", s = {
4
+ contentButton: y,
5
+ "category-image": "_category-image_2dk7a_25",
6
+ overlay: h,
7
+ buttonTitle: _,
8
+ buttonSubtitle: x
9
+ }, b = ({
10
+ title: e,
11
+ subtitle: o,
12
+ url: n,
13
+ imageUrl: a,
14
+ loading: r
15
+ }) => r ? /* @__PURE__ */ t.jsx(
16
+ "div",
17
+ {
18
+ className: s.contentButton,
19
+ style: { display: "block" },
20
+ children: /* @__PURE__ */ t.jsx(
21
+ c,
22
+ {
23
+ height: "100%",
24
+ width: "100%",
25
+ style: { lineHeight: "normal" }
26
+ }
27
+ )
28
+ }
29
+ ) : /* @__PURE__ */ t.jsxs("a", { href: n, className: s.contentButton, children: [
30
+ /* @__PURE__ */ t.jsx(
31
+ "img",
32
+ {
33
+ src: a,
34
+ alt: e,
35
+ className: s["category-image"]
36
+ }
37
+ ),
38
+ /* @__PURE__ */ t.jsxs("div", { className: s.overlay, children: [
39
+ /* @__PURE__ */ t.jsx("div", { className: s.buttonTitle, children: e }),
40
+ /* @__PURE__ */ t.jsx("div", { className: s.buttonSubtitle, children: o })
41
+ ] })
42
+ ] }), j = "_categoryContainer_1yxkk_1", p = {
43
+ categoryContainer: j
44
+ }, k = ({
45
+ categories: e,
46
+ loading: o
47
+ }) => /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx("div", { className: p.categoryContainer, children: e.length > 0 && e.map((n) => /* @__PURE__ */ t.jsx(
48
+ b,
49
+ {
50
+ title: n.title,
51
+ subtitle: n.subtitle,
52
+ url: n.url,
53
+ imageUrl: n.imageUrl,
54
+ loading: o
55
+ },
56
+ n.title
57
+ )) }) }), C = (e) => e.map((o) => ({
58
+ ...o,
59
+ imageUrl: g(o.image).width(800).url()
60
+ })), f = () => {
61
+ const [e, o] = i.useState([]), [n, a] = i.useState(!0);
62
+ return i.useEffect(() => {
63
+ m().then(
64
+ (r) => o(C(r))
65
+ ).catch((r) => console.log(r)).finally(() => a(!1));
66
+ }, []), /* @__PURE__ */ t.jsx(k, { categories: e, loading: n });
67
+ }, v = document.getElementById("camp-categories"), S = l.createRoot(v);
68
+ S.render(
69
+ /* @__PURE__ */ t.jsx(u.StrictMode, { children: /* @__PURE__ */ t.jsx(f, {}) })
70
+ );
@@ -1,2 +1,6 @@
1
- import "./vendor.js";
2
- import "./campphillip.js";
1
+ import { c as e, j as t, R as n } from "./vendor.js";
2
+ import { E as o } from "./EventApiContainer.js";
3
+ const r = document.getElementById("camp-events"), s = e.createRoot(r);
4
+ s.render(
5
+ /* @__PURE__ */ t.jsx(n.StrictMode, { children: /* @__PURE__ */ t.jsx(o, { type: "events" }) })
6
+ );
@@ -1,2 +1,90 @@
1
- import "./vendor.js";
2
- import "./campphillip.js";
1
+ import { j as t, r as o, c as u, R as m } from "./vendor.js";
2
+ import { s as _ } from "./sanityClient.js";
3
+ const x = async () => _.fetch("*[_type == 'rateCategory']|order(orderRank)"), j = "_description_z94kn_1", y = {
4
+ description: j
5
+ }, g = ({ rateDescription: a }) => {
6
+ const { title: r, text: n } = a || {};
7
+ return /* @__PURE__ */ t.jsxs("div", { className: y.description, children: [
8
+ r && /* @__PURE__ */ t.jsx("h4", { children: r }),
9
+ n && /* @__PURE__ */ t.jsx("span", { children: n })
10
+ ] });
11
+ }, c = ({
12
+ name: a,
13
+ detail: r,
14
+ value: n,
15
+ className: i
16
+ }) => /* @__PURE__ */ t.jsxs("tr", { className: i, children: [
17
+ /* @__PURE__ */ t.jsx("td", { children: a }),
18
+ r && /* @__PURE__ */ t.jsx("td", { children: r }),
19
+ /* @__PURE__ */ t.jsx("td", { children: n })
20
+ ] }), d = {
21
+ "group-title": "_group-title_12ylh_1",
22
+ "rate-group-child": "_rate-group-child_12ylh_5"
23
+ }, R = ({ rateGroup: a }) => /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
24
+ /* @__PURE__ */ t.jsx(c, { name: a.name, className: d["group-title"] }),
25
+ a.childRates.map((r) => /* @__PURE__ */ t.jsx(
26
+ c,
27
+ {
28
+ name: r.name,
29
+ value: r.cost,
30
+ className: d["rate-group-child"]
31
+ },
32
+ r.name
33
+ ))
34
+ ] }), p = {
35
+ "rate-table": "_rate-table_6wuu7_1",
36
+ "group-title": "_group-title_6wuu7_33"
37
+ }, f = (a) => {
38
+ const { rateTable: r } = a, n = r.some((e) => e._type === "rateGroup"), i = r.some((e) => e._type === "rate" && e.detail), s = r.map((e) => {
39
+ if (e._type === "rate")
40
+ return i && (e = {
41
+ detail: e.detail ?? " ",
42
+ ...e
43
+ }), /* @__PURE__ */ t.jsx(
44
+ c,
45
+ {
46
+ name: e.name,
47
+ detail: e.detail,
48
+ value: e.cost,
49
+ className: n ? p["group-title"] : ""
50
+ },
51
+ e.name
52
+ );
53
+ if (e._type === "rateGroup")
54
+ return /* @__PURE__ */ t.jsx(R, { rateGroup: e }, e.name);
55
+ });
56
+ return /* @__PURE__ */ t.jsx("table", { className: p["rate-table"], children: /* @__PURE__ */ t.jsx("tbody", { children: s }) });
57
+ }, h = {
58
+ "rate-card": "_rate-card_i5ys9_1",
59
+ "rate-card-heading": "_rate-card-heading_i5ys9_13"
60
+ }, b = (a) => {
61
+ const { heading: r, rates: n } = a, i = n.reduce((s, e) => {
62
+ if (e._type === "rateDescription")
63
+ return [...s, e];
64
+ {
65
+ const l = s[s.length - 1];
66
+ return Array.isArray(l) ? (l.push(e), s) : [...s, [e]];
67
+ }
68
+ }, []);
69
+ return /* @__PURE__ */ t.jsxs("div", { className: h["rate-card"], children: [
70
+ /* @__PURE__ */ t.jsx("div", { className: h["rate-card-heading"], children: /* @__PURE__ */ t.jsx("h3", { children: r }) }),
71
+ i.map((s, e) => Array.isArray(s) ? /* @__PURE__ */ t.jsx(f, { rateTable: s }, e) : /* @__PURE__ */ t.jsx(g, { rateDescription: s }, e))
72
+ ] });
73
+ }, N = {
74
+ "rates-container": "_rates-container_123ct_1"
75
+ }, v = () => {
76
+ const [a, r] = o.useState([]), [n, i] = o.useState(!0);
77
+ return o.useEffect(() => {
78
+ x().then((s) => r(s)).catch((s) => console.log(s)).finally(() => i(!1));
79
+ }, []), /* @__PURE__ */ t.jsx("div", { className: N["rates-container"], children: a.map((s) => /* @__PURE__ */ t.jsx(
80
+ b,
81
+ {
82
+ heading: s.name,
83
+ rates: s.rates
84
+ },
85
+ s.name
86
+ )) });
87
+ }, A = document.getElementById("camp-rates"), E = u.createRoot(A);
88
+ E.render(
89
+ /* @__PURE__ */ t.jsx(m.StrictMode, { children: /* @__PURE__ */ t.jsx(v, {}) })
90
+ );