@burdenoff/microfe-govcitizenhub 2026.720.7 → 2026.730.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.
Files changed (155) hide show
  1. package/dist/govcitizenhub/GovCitizenHubRoot.d.ts.map +1 -1
  2. package/dist/govcitizenhub/GovCitizenHubRoot.js +44 -36
  3. package/dist/govcitizenhub/GovCitizenHubRoot.js.map +1 -1
  4. package/dist/govcitizenhub/GovCitizenHubRoutes.d.ts.map +1 -1
  5. package/dist/govcitizenhub/GovCitizenHubRoutes.js +134 -6
  6. package/dist/govcitizenhub/GovCitizenHubRoutes.js.map +1 -1
  7. package/dist/govcitizenhub/components/DocumentUploadField.d.ts +17 -11
  8. package/dist/govcitizenhub/components/DocumentUploadField.d.ts.map +1 -1
  9. package/dist/govcitizenhub/components/DocumentUploadField.js +45 -42
  10. package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
  11. package/dist/govcitizenhub/components/GovCharts.js +127 -51
  12. package/dist/govcitizenhub/components/GovCharts.js.map +1 -1
  13. package/dist/govcitizenhub/hooks/index.d.ts +1 -0
  14. package/dist/govcitizenhub/hooks/index.d.ts.map +1 -1
  15. package/dist/govcitizenhub/hooks/index.js +1 -0
  16. package/dist/govcitizenhub/hooks/useGovApi.d.ts +3 -0
  17. package/dist/govcitizenhub/hooks/useGovApi.d.ts.map +1 -1
  18. package/dist/govcitizenhub/hooks/useGovApi.js +1 -1
  19. package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
  20. package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts +214 -0
  21. package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts.map +1 -0
  22. package/dist/govcitizenhub/hooks/useIntelligenceApi.js +1140 -0
  23. package/dist/govcitizenhub/hooks/useIntelligenceApi.js.map +1 -0
  24. package/dist/govcitizenhub/index.d.ts +1 -0
  25. package/dist/govcitizenhub/index.d.ts.map +1 -1
  26. package/dist/govcitizenhub/index.js +18 -0
  27. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +7 -7
  28. package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js +6 -6
  29. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +16 -16
  30. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +35 -35
  31. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
  32. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +1 -1
  33. package/dist/govcitizenhub/pages/documents/DocumentsPage.js +5 -5
  34. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +30 -30
  35. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
  36. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +15 -15
  37. package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts +4 -0
  38. package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts.map +1 -0
  39. package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js +634 -0
  40. package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js.map +1 -0
  41. package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts +20 -0
  42. package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts.map +1 -0
  43. package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js +537 -0
  44. package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js.map +1 -0
  45. package/dist/govcitizenhub/pages/intelligence/AssetImage.d.ts +11 -0
  46. package/dist/govcitizenhub/pages/intelligence/AssetImage.d.ts.map +1 -0
  47. package/dist/govcitizenhub/pages/intelligence/AssetImage.js +25 -0
  48. package/dist/govcitizenhub/pages/intelligence/AssetImage.js.map +1 -0
  49. package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts +15 -0
  50. package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts.map +1 -0
  51. package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js +203 -0
  52. package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js.map +1 -0
  53. package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts +4 -0
  54. package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts.map +1 -0
  55. package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js +497 -0
  56. package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js.map +1 -0
  57. package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts +4 -0
  58. package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts.map +1 -0
  59. package/dist/govcitizenhub/pages/intelligence/BudgetPage.js +1084 -0
  60. package/dist/govcitizenhub/pages/intelligence/BudgetPage.js.map +1 -0
  61. package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts +13 -0
  62. package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts.map +1 -0
  63. package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js +581 -0
  64. package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js.map +1 -0
  65. package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts +11 -0
  66. package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts.map +1 -0
  67. package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js +429 -0
  68. package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js.map +1 -0
  69. package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts +8 -0
  70. package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts.map +1 -0
  71. package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js +235 -0
  72. package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js.map +1 -0
  73. package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts +4 -0
  74. package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts.map +1 -0
  75. package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js +534 -0
  76. package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js.map +1 -0
  77. package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.d.ts +4 -0
  78. package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.d.ts.map +1 -0
  79. package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js +723 -0
  80. package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js.map +1 -0
  81. package/dist/govcitizenhub/pages/intelligence/ElectionsPage.d.ts +5 -0
  82. package/dist/govcitizenhub/pages/intelligence/ElectionsPage.d.ts.map +1 -0
  83. package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js +1029 -0
  84. package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js.map +1 -0
  85. package/dist/govcitizenhub/pages/intelligence/GovernancePage.d.ts +5 -0
  86. package/dist/govcitizenhub/pages/intelligence/GovernancePage.d.ts.map +1 -0
  87. package/dist/govcitizenhub/pages/intelligence/GovernancePage.js +1545 -0
  88. package/dist/govcitizenhub/pages/intelligence/GovernancePage.js.map +1 -0
  89. package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.d.ts +4 -0
  90. package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.d.ts.map +1 -0
  91. package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js +960 -0
  92. package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js.map +1 -0
  93. package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.d.ts +13 -0
  94. package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.d.ts.map +1 -0
  95. package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js +927 -0
  96. package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js.map +1 -0
  97. package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts +4 -0
  98. package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts.map +1 -0
  99. package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js +620 -0
  100. package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js.map +1 -0
  101. package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts +20 -0
  102. package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts.map +1 -0
  103. package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js +183 -0
  104. package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js.map +1 -0
  105. package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts +4 -0
  106. package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts.map +1 -0
  107. package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js +629 -0
  108. package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js.map +1 -0
  109. package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts +4 -0
  110. package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts.map +1 -0
  111. package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js +1125 -0
  112. package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js.map +1 -0
  113. package/dist/govcitizenhub/pages/intelligence/ProjectsPage.d.ts +4 -0
  114. package/dist/govcitizenhub/pages/intelligence/ProjectsPage.d.ts.map +1 -0
  115. package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js +1518 -0
  116. package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js.map +1 -0
  117. package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts +4 -0
  118. package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts.map +1 -0
  119. package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js +577 -0
  120. package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js.map +1 -0
  121. package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.d.ts +4 -0
  122. package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.d.ts.map +1 -0
  123. package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js +534 -0
  124. package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js.map +1 -0
  125. package/dist/govcitizenhub/pages/intelligence/TimelinePage.d.ts +5 -0
  126. package/dist/govcitizenhub/pages/intelligence/TimelinePage.d.ts.map +1 -0
  127. package/dist/govcitizenhub/pages/intelligence/TimelinePage.js +538 -0
  128. package/dist/govcitizenhub/pages/intelligence/TimelinePage.js.map +1 -0
  129. package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts +53 -0
  130. package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts.map +1 -0
  131. package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js +138 -0
  132. package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js.map +1 -0
  133. package/dist/govcitizenhub/pages/intelligence/index.d.ts +27 -0
  134. package/dist/govcitizenhub/pages/intelligence/index.d.ts.map +1 -0
  135. package/dist/govcitizenhub/pages/intelligence/index.js +17 -0
  136. package/dist/govcitizenhub/pages/payments/PaymentsPage.js +11 -11
  137. package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
  138. package/dist/govcitizenhub/pages/permits/PermitsPage.js +6 -6
  139. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +8 -8
  140. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +98 -98
  141. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
  142. package/dist/govcitizenhub/types/index.d.ts +1 -0
  143. package/dist/govcitizenhub/types/index.d.ts.map +1 -1
  144. package/dist/govcitizenhub/types/intelligence.d.ts +1559 -0
  145. package/dist/govcitizenhub/types/intelligence.d.ts.map +1 -0
  146. package/dist/govcitizenhub/types/intelligence.js +125 -0
  147. package/dist/govcitizenhub/types/intelligence.js.map +1 -0
  148. package/dist/index.js +19 -2
  149. package/dist/node_modules/recharts/es6/chart/BarChart.js +24 -0
  150. package/dist/node_modules/recharts/es6/chart/BarChart.js.map +1 -0
  151. package/dist/utils/pageContext.d.ts +1 -0
  152. package/dist/utils/pageContext.d.ts.map +1 -1
  153. package/dist/utils/pageContext.js +44 -17
  154. package/dist/utils/pageContext.js.map +1 -1
  155. package/package.json +1 -1
@@ -0,0 +1,11 @@
1
+ import { ReactElement } from 'react';
2
+ import { GovConsultation } from '../../types';
3
+
4
+ export interface ConsultationParticipateDialogProps {
5
+ consultation: GovConsultation;
6
+ onClose: () => void;
7
+ /** Fired after a successful submission, before the dialog closes. */
8
+ onSubmitted?: () => void;
9
+ }
10
+ export declare function ConsultationParticipateDialog({ consultation, onClose, onSubmitted, }: ConsultationParticipateDialogProps): ReactElement;
11
+ //# sourceMappingURL=ConsultationParticipateDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsultationParticipateDialog.d.ts","sourceRoot":"","sources":["../../../../src/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AA+B7D,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,aAAa,CAAC;AAcjE,MAAM,WAAW,kCAAkC;IACjD,YAAY,EAAE,eAAe,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,YAAY,EACZ,OAAO,EACP,WAAW,GACZ,EAAE,kCAAkC,GAAG,YAAY,CA8YnD"}
@@ -0,0 +1,429 @@
1
+ import { cn as e } from "../../utils/cn.js";
2
+ import { formatCurrency as t, formatNumber as n } from "../../utils/formatters.js";
3
+ import { useGovSubmitConsultationResponse as r } from "../../hooks/useIntelligenceApi.js";
4
+ import "../../hooks/index.js";
5
+ import { describeError as i, notify as a } from "../../lib/toast.js";
6
+ import { BUDGET_SUM_TOLERANCE as o, parseConsultationQuestions as s } from "./consultationQuestions.js";
7
+ import { useMemo as c, useState as l } from "react";
8
+ import { AlertTriangle as u, Send as d, ShieldOff as f } from "lucide-react";
9
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
10
+ import { Button as h, Checkbox as g, Input as _, Label as v, ResponsiveDialog as y, ResponsiveDialogContent as b, ResponsiveDialogDescription as x, ResponsiveDialogFooter as S, ResponsiveDialogHeader as C, ResponsiveDialogTitle as w, Select as T, SelectContent as E, SelectItem as ee, SelectTrigger as te, SelectValue as D, Switch as O, Textarea as k } from "@burdenoff/fe-libs/ui";
11
+ //#region src/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.tsx
12
+ var A = 12, j = {
13
+ NONE: "Prefer not to say",
14
+ POSITIVE: "Positive",
15
+ NEUTRAL: "Neutral",
16
+ NEGATIVE: "Negative"
17
+ };
18
+ function M({ consultation: n, onClose: o, onSubmitted: _ }) {
19
+ let A = c(() => s(n.questions), [n.questions]), [M, F] = l({}), [I, L] = l({}), [R, z] = l({}), [B, V] = l(!1), [H, U] = l("NONE"), [W, G] = l(null), K = r(), q = n.budgetAmount ?? null, J = n.currencyCode, Y = (e, t) => {
20
+ F((n) => ({
21
+ ...n,
22
+ [e]: t
23
+ }));
24
+ }, X = (e, t, n) => {
25
+ L((r) => {
26
+ let i = r[e] ?? [], a = n ? i.includes(t) ? i : [...i, t] : i.filter((e) => e !== t);
27
+ return {
28
+ ...r,
29
+ [e]: a
30
+ };
31
+ });
32
+ }, Z = (e, t, n) => {
33
+ z((r) => ({
34
+ ...r,
35
+ [e]: {
36
+ ...r[e] ?? {},
37
+ [t]: n
38
+ }
39
+ }));
40
+ }, ne = (e) => {
41
+ let t = R[e.id] ?? {}, n = 0;
42
+ for (let r of e.options) {
43
+ let e = Number(t[r] ?? "");
44
+ Number.isFinite(e) && (n += e);
45
+ }
46
+ return n;
47
+ }, re = (e) => {
48
+ let t = R[e.id] ?? {};
49
+ return e.options.every((e) => (t[e] ?? "").trim().length === 0);
50
+ }, ie = (e) => {
51
+ switch (e.type) {
52
+ case "MULTI_CHOICE": return (I[e.id] ?? []).length > 0;
53
+ case "BUDGET_ALLOCATION": return !re(e);
54
+ default: return (M[e.id] ?? "").trim().length > 0;
55
+ }
56
+ }, Q = c(() => {
57
+ let e = [];
58
+ for (let n of A) {
59
+ let r = n.type === "MULTI_CHOICE" ? (I[n.id] ?? []).length > 0 : n.type === "BUDGET_ALLOCATION" ? n.options.some((e) => ((R[n.id] ?? {})[e] ?? "").trim().length > 0) : (M[n.id] ?? "").trim().length > 0;
60
+ if (n.required && !r && e.push(`“${n.label}” is required.`), n.type === "RATING" && r) {
61
+ let t = Number(M[n.id]);
62
+ Number.isFinite(t) ? (n.min !== null && t < n.min || n.max !== null && t > n.max) && e.push(`“${n.label}” must be between ${n.min} and ${n.max}.`) : e.push(`“${n.label}” needs a number.`);
63
+ }
64
+ if (n.type === "BUDGET_ALLOCATION" && (r || n.required)) if (q === null || q <= 0) e.push(`“${n.label}” cannot be answered: this consultation has no budget pot recorded.`);
65
+ else {
66
+ let r = R[n.id] ?? {}, i = 0, a = !1;
67
+ for (let e of n.options) {
68
+ let t = (r[e] ?? "").trim();
69
+ if (t.length === 0) continue;
70
+ let n = Number(t);
71
+ if (!Number.isFinite(n)) {
72
+ a = !0;
73
+ break;
74
+ }
75
+ n < 0 && (a = !0), i += n;
76
+ }
77
+ a ? e.push(`“${n.label}” only accepts non-negative amounts.`) : Math.abs(i - q) > .01 && e.push(`“${n.label}” must allocate exactly ${t(q, J)}.`);
78
+ }
79
+ }
80
+ return e;
81
+ }, [
82
+ A,
83
+ M,
84
+ I,
85
+ R,
86
+ q,
87
+ J
88
+ ]), $ = K.isPending, ae = A.length > 0 && Q.length === 0 && !$, oe = async () => {
89
+ let e = [];
90
+ for (let t of A) if (ie(t)) switch (t.type) {
91
+ case "SINGLE_CHOICE":
92
+ e.push({
93
+ questionId: t.id,
94
+ value: M[t.id].trim()
95
+ });
96
+ break;
97
+ case "TEXT":
98
+ e.push({
99
+ questionId: t.id,
100
+ value: M[t.id].trim()
101
+ });
102
+ break;
103
+ case "RATING":
104
+ e.push({
105
+ questionId: t.id,
106
+ value: Number(M[t.id])
107
+ });
108
+ break;
109
+ case "MULTI_CHOICE":
110
+ e.push({
111
+ questionId: t.id,
112
+ value: I[t.id]
113
+ });
114
+ break;
115
+ case "BUDGET_ALLOCATION": {
116
+ let n = R[t.id] ?? {}, r = {};
117
+ for (let e of t.options) {
118
+ let t = Number((n[e] ?? "").trim());
119
+ r[e] = Number.isFinite(t) ? t : 0;
120
+ }
121
+ e.push({
122
+ questionId: t.id,
123
+ value: r
124
+ });
125
+ break;
126
+ }
127
+ default: break;
128
+ }
129
+ G(null);
130
+ try {
131
+ await K.mutateAsync({
132
+ consultationId: n.id,
133
+ answers: e,
134
+ sentiment: H === "NONE" ? void 0 : H,
135
+ anonymous: B ? !0 : void 0
136
+ }), a.success("Response submitted", B ? "Your answers were recorded without your identity." : "Thank you for taking part."), _?.(), o();
137
+ } catch (e) {
138
+ G(i(e));
139
+ }
140
+ };
141
+ return /* @__PURE__ */ p(y, {
142
+ open: !0,
143
+ onOpenChange: (e) => {
144
+ !e && !$ && o();
145
+ },
146
+ children: /* @__PURE__ */ m(b, {
147
+ className: "max-h-[90vh] overflow-y-auto sm:max-w-2xl",
148
+ children: [
149
+ /* @__PURE__ */ m(C, { children: [/* @__PURE__ */ p(w, { children: n.title }), /* @__PURE__ */ p(x, { children: n.description ?? "Answer the questions below to take part." })] }),
150
+ /* @__PURE__ */ m("div", {
151
+ className: "flex flex-col gap-5 py-2",
152
+ children: [
153
+ A.length === 0 ? /* @__PURE__ */ p("p", {
154
+ className: "text-sm text-text-muted",
155
+ children: "This consultation has no published questions yet, so there is nothing to answer."
156
+ }) : A.map((t, n) => /* @__PURE__ */ m("fieldset", {
157
+ className: "rounded-xl border border-border-seam bg-bg-surface p-4",
158
+ children: [
159
+ /* @__PURE__ */ m("legend", {
160
+ className: "px-1 text-sm font-semibold text-text-primary",
161
+ children: [
162
+ n + 1,
163
+ ". ",
164
+ t.label,
165
+ t.required && /* @__PURE__ */ p("span", {
166
+ className: "ml-1 text-status-error-text",
167
+ "aria-label": "required",
168
+ children: "*"
169
+ })
170
+ ]
171
+ }),
172
+ t.type === "SINGLE_CHOICE" && /* @__PURE__ */ p("div", {
173
+ role: "radiogroup",
174
+ "aria-label": t.label,
175
+ className: "mt-3 flex flex-col gap-2",
176
+ children: t.options.map((n) => {
177
+ let r = M[t.id] === n;
178
+ return /* @__PURE__ */ m("button", {
179
+ type: "button",
180
+ role: "radio",
181
+ "aria-checked": r,
182
+ onClick: () => Y(t.id, n),
183
+ className: e("flex w-full items-center gap-2.5 rounded-lg border px-3 py-2 text-left text-sm transition-colors", r ? "border-action-primary-bg bg-[var(--color-accent-soft)] text-text-primary" : "border-border-seam bg-bg-surface text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
184
+ children: [/* @__PURE__ */ p("span", {
185
+ "aria-hidden": "true",
186
+ className: e("size-4 shrink-0 rounded-full border-2", r ? "border-[5px] border-action-primary-bg" : "border-border-strong")
187
+ }), n]
188
+ }, n);
189
+ })
190
+ }),
191
+ t.type === "MULTI_CHOICE" && /* @__PURE__ */ p("div", {
192
+ className: "mt-3 flex flex-col gap-2",
193
+ children: t.options.map((e) => {
194
+ let n = `${t.id}-${e}`;
195
+ return /* @__PURE__ */ m("label", {
196
+ htmlFor: n,
197
+ className: "flex cursor-pointer items-center gap-2.5 rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
198
+ children: [/* @__PURE__ */ p(g, {
199
+ id: n,
200
+ checked: (I[t.id] ?? []).includes(e),
201
+ onCheckedChange: (n) => X(t.id, e, n === !0)
202
+ }), e]
203
+ }, e);
204
+ })
205
+ }),
206
+ t.type === "RATING" && /* @__PURE__ */ p(N, {
207
+ question: t,
208
+ value: M[t.id] ?? "",
209
+ onChange: (e) => Y(t.id, e)
210
+ }),
211
+ t.type === "TEXT" && /* @__PURE__ */ p(k, {
212
+ className: "mt-3",
213
+ rows: 3,
214
+ value: M[t.id] ?? "",
215
+ onChange: (e) => Y(t.id, e.target.value),
216
+ placeholder: "Your answer",
217
+ "aria-label": t.label
218
+ }),
219
+ t.type === "BUDGET_ALLOCATION" && /* @__PURE__ */ p(P, {
220
+ question: t,
221
+ pot: q,
222
+ currency: J,
223
+ values: R[t.id] ?? {},
224
+ total: ne(t),
225
+ onChange: (e, n) => Z(t.id, e, n)
226
+ })
227
+ ]
228
+ }, t.id)),
229
+ A.length > 0 && /* @__PURE__ */ m("div", {
230
+ className: "grid gap-1.5",
231
+ children: [/* @__PURE__ */ p(v, { children: "Overall sentiment (optional)" }), /* @__PURE__ */ m(T, {
232
+ value: H,
233
+ onValueChange: (e) => U(e),
234
+ children: [/* @__PURE__ */ p(te, {
235
+ "aria-label": "Overall sentiment",
236
+ children: /* @__PURE__ */ p(D, {})
237
+ }), /* @__PURE__ */ p(E, { children: [
238
+ "NONE",
239
+ "POSITIVE",
240
+ "NEUTRAL",
241
+ "NEGATIVE"
242
+ ].map((e) => /* @__PURE__ */ p(ee, {
243
+ value: e,
244
+ children: j[e]
245
+ }, e)) })]
246
+ })]
247
+ }),
248
+ n.allowAnonymous && A.length > 0 && /* @__PURE__ */ m("div", {
249
+ className: "flex items-start gap-3 rounded-xl border border-border-seam bg-bg-sunken/40 p-4",
250
+ children: [/* @__PURE__ */ p(O, {
251
+ id: "consultation-anonymous",
252
+ checked: B,
253
+ onCheckedChange: (e) => V(e === !0)
254
+ }), /* @__PURE__ */ m("div", {
255
+ className: "min-w-0",
256
+ children: [/* @__PURE__ */ p(v, {
257
+ htmlFor: "consultation-anonymous",
258
+ className: "cursor-pointer",
259
+ children: "Submit anonymously"
260
+ }), /* @__PURE__ */ m("p", {
261
+ className: "mt-1 flex items-start gap-1.5 text-xs text-text-muted",
262
+ children: [/* @__PURE__ */ p(f, {
263
+ className: "mt-0.5 size-3.5 shrink-0",
264
+ "aria-hidden": "true"
265
+ }), "No respondent id is stored. Because nothing links the response back to you, you will not be able to view or change it afterwards."]
266
+ })]
267
+ })]
268
+ }),
269
+ Q.length > 0 && /* @__PURE__ */ m("div", {
270
+ className: "rounded-xl border border-border-seam bg-status-warning-bg-subtle p-3",
271
+ role: "status",
272
+ children: [/* @__PURE__ */ m("p", {
273
+ className: "flex items-center gap-1.5 text-sm font-medium text-status-warning-text",
274
+ children: [/* @__PURE__ */ p(u, {
275
+ className: "size-4 shrink-0",
276
+ "aria-hidden": "true"
277
+ }), " Before you can submit"]
278
+ }), /* @__PURE__ */ p("ul", {
279
+ className: "mt-1.5 list-inside list-disc text-sm text-status-warning-text",
280
+ children: Q.map((e) => /* @__PURE__ */ p("li", { children: e }, e))
281
+ })]
282
+ }),
283
+ W && /* @__PURE__ */ p("p", {
284
+ className: "text-sm text-status-error-text",
285
+ children: W
286
+ })
287
+ ]
288
+ }),
289
+ /* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(h, {
290
+ variant: "outline",
291
+ onClick: o,
292
+ disabled: $,
293
+ children: "Cancel"
294
+ }), /* @__PURE__ */ m(h, {
295
+ disabled: !ae,
296
+ onClick: () => {
297
+ oe();
298
+ },
299
+ children: [/* @__PURE__ */ p(d, {
300
+ className: "mr-1.5 h-4 w-4",
301
+ "aria-hidden": "true"
302
+ }), $ ? "Submitting…" : "Submit response"]
303
+ })] })
304
+ ]
305
+ })
306
+ });
307
+ }
308
+ function N({ question: t, value: r, onChange: i }) {
309
+ let a = t.min, o = t.max;
310
+ if (a === null || o === null || o - a + 1 > A) return /* @__PURE__ */ m("div", {
311
+ className: "mt-3",
312
+ children: [/* @__PURE__ */ p(_, {
313
+ type: "number",
314
+ value: r,
315
+ min: a ?? void 0,
316
+ max: o ?? void 0,
317
+ onChange: (e) => i(e.target.value),
318
+ "aria-label": t.label,
319
+ placeholder: a !== null && o !== null ? `${a} to ${o}` : "Your rating"
320
+ }), a !== null && o !== null && /* @__PURE__ */ m("p", {
321
+ className: "mt-1 text-xs text-text-muted",
322
+ children: [
323
+ "Rate between ",
324
+ n(a),
325
+ " and ",
326
+ n(o),
327
+ "."
328
+ ]
329
+ })]
330
+ });
331
+ let s = [];
332
+ for (let e = a; e <= o; e += 1) s.push(e);
333
+ return /* @__PURE__ */ m("div", {
334
+ className: "mt-3",
335
+ children: [/* @__PURE__ */ p("div", {
336
+ role: "radiogroup",
337
+ "aria-label": t.label,
338
+ className: "flex flex-wrap gap-1.5",
339
+ children: s.map((t) => {
340
+ let n = r === String(t);
341
+ return /* @__PURE__ */ p("button", {
342
+ type: "button",
343
+ role: "radio",
344
+ "aria-checked": n,
345
+ onClick: () => i(String(t)),
346
+ className: e("inline-flex size-10 items-center justify-center rounded-lg border text-sm font-medium tabular-nums transition-colors", n ? "border-transparent bg-action-primary-bg text-action-primary-text" : "border-border-seam bg-bg-surface text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
347
+ children: t
348
+ }, t);
349
+ })
350
+ }), /* @__PURE__ */ m("p", {
351
+ className: "mt-1.5 text-xs text-text-muted",
352
+ children: [
353
+ n(a),
354
+ " is the lowest, ",
355
+ n(o),
356
+ " the highest."
357
+ ]
358
+ })]
359
+ });
360
+ }
361
+ function P({ question: n, pot: r, currency: i, values: a, total: s, onChange: c }) {
362
+ if (r === null || r <= 0) return /* @__PURE__ */ p("p", {
363
+ className: "mt-3 text-sm text-status-error-text",
364
+ children: "This question cannot be answered: no budget pot has been recorded for the consultation."
365
+ });
366
+ let l = r - s, u = Math.abs(l) <= o, d = l < -o, f = Math.max(0, Math.min(100, s / r * 100));
367
+ return /* @__PURE__ */ m("div", {
368
+ className: "mt-3 flex flex-col gap-3",
369
+ children: [/* @__PURE__ */ p("div", {
370
+ className: "flex flex-col gap-2",
371
+ children: n.options.map((e) => /* @__PURE__ */ m("div", {
372
+ className: "flex flex-wrap items-center gap-2",
373
+ children: [/* @__PURE__ */ p(v, {
374
+ htmlFor: `${n.id}-${e}`,
375
+ className: "min-w-0 flex-1 text-sm font-normal text-text-secondary",
376
+ children: e
377
+ }), /* @__PURE__ */ p(_, {
378
+ id: `${n.id}-${e}`,
379
+ type: "number",
380
+ min: "0",
381
+ step: "any",
382
+ inputMode: "decimal",
383
+ className: "w-40",
384
+ value: a[e] ?? "",
385
+ onChange: (t) => c(e, t.target.value),
386
+ placeholder: "0"
387
+ })]
388
+ }, e))
389
+ }), /* @__PURE__ */ m("div", {
390
+ className: "rounded-xl border border-border-seam bg-bg-sunken/40 p-3",
391
+ children: [
392
+ /* @__PURE__ */ m("div", {
393
+ className: "flex flex-wrap items-baseline justify-between gap-2 text-sm",
394
+ children: [/* @__PURE__ */ p("span", {
395
+ className: "text-text-secondary",
396
+ children: "Allocated"
397
+ }), /* @__PURE__ */ m("span", {
398
+ className: "font-semibold tabular-nums text-text-primary",
399
+ children: [
400
+ t(s, i),
401
+ " of ",
402
+ t(r, i)
403
+ ]
404
+ })]
405
+ }),
406
+ /* @__PURE__ */ p("div", {
407
+ className: "mt-2 h-2 w-full overflow-hidden rounded-full bg-bg-sunken",
408
+ role: "progressbar",
409
+ "aria-valuemin": 0,
410
+ "aria-valuemax": r,
411
+ "aria-valuenow": s,
412
+ "aria-label": "Budget allocated",
413
+ children: /* @__PURE__ */ p("div", {
414
+ className: e("h-full rounded-full transition-[width] duration-200", d ? "bg-status-error-bg" : u ? "bg-status-success-bg" : "bg-action-primary-bg"),
415
+ style: { width: `${f}%` }
416
+ })
417
+ }),
418
+ /* @__PURE__ */ p("p", {
419
+ className: e("mt-2 text-sm tabular-nums", d ? "text-status-error-text" : u ? "text-status-success-text" : "text-text-secondary"),
420
+ children: d ? `Over by ${t(Math.abs(l), i)} — reduce an allocation to continue.` : u ? "The full pot is allocated." : `${t(l, i)} still to allocate.`
421
+ })
422
+ ]
423
+ })]
424
+ });
425
+ }
426
+ //#endregion
427
+ export { M as ConsultationParticipateDialog };
428
+
429
+ //# sourceMappingURL=ConsultationParticipateDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsultationParticipateDialog.js","names":[],"sources":["../../../../src/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.tsx"],"sourcesContent":["/**\n * ConsultationParticipateDialog — the citizen participation form.\n * @module govcitizenhub/pages/intelligence\n *\n * Renders the consultation's own `questions` JSON schema: there is no hard-coded\n * questionnaire anywhere here. All five declared types are supported —\n * SINGLE_CHOICE (radio), MULTI_CHOICE (checkboxes), RATING (a min..max scale),\n * TEXT (free text) and BUDGET_ALLOCATION (an amount per option with a live\n * running total and a remaining-balance indicator).\n *\n * The budget rule is the API's rule: allocations must sum to the consultation's\n * pot within `BUDGET_SUM_TOLERANCE`, so submission stays BLOCKED until they do\n * rather than sending a request the service will reject.\n *\n * Anonymity: the toggle only appears when the consultation allows it. An\n * anonymous submission stores no respondent id at all — which also means the\n * respondent can never retrieve it afterwards, and the dialog says so before it\n * is sent rather than letting the reader discover it later.\n */\n\nimport { useMemo, useState, type ReactElement } from 'react';\nimport { AlertTriangle, Send, ShieldOff } from 'lucide-react';\nimport {\n Button,\n Checkbox,\n Input,\n Label,\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogDescription,\n ResponsiveDialogFooter,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Switch,\n Textarea,\n} from '@burdenoff/fe-libs/ui';\n\nimport {\n BUDGET_SUM_TOLERANCE,\n parseConsultationQuestions,\n type ConsultationQuestion,\n} from './consultationQuestions';\nimport { useGovSubmitConsultationResponse } from '../../hooks';\nimport { describeError, notify } from '../../lib/toast';\nimport { formatCurrency, formatNumber } from '../../utils/formatters';\nimport { cn } from '../../utils/cn';\nimport type { GovConsultation, GovSentiment } from '../../types';\n\n/** Beyond this many steps a rating scale becomes a number field, not buttons. */\nconst MAX_RATING_BUTTONS = 12;\n\ntype SentimentChoice = GovSentiment | 'NONE';\n\nconst SENTIMENT_LABELS: Record<SentimentChoice, string> = {\n NONE: 'Prefer not to say',\n POSITIVE: 'Positive',\n NEUTRAL: 'Neutral',\n NEGATIVE: 'Negative',\n};\n\nexport interface ConsultationParticipateDialogProps {\n consultation: GovConsultation;\n onClose: () => void;\n /** Fired after a successful submission, before the dialog closes. */\n onSubmitted?: () => void;\n}\n\nexport function ConsultationParticipateDialog({\n consultation,\n onClose,\n onSubmitted,\n}: ConsultationParticipateDialogProps): ReactElement {\n const questions = useMemo(\n () => parseConsultationQuestions(consultation.questions),\n [consultation.questions]\n );\n\n /** SINGLE_CHOICE option, RATING value and TEXT body all live here as strings. */\n const [singleValues, setSingleValues] = useState<Record<string, string>>({});\n const [multiValues, setMultiValues] = useState<Record<string, string[]>>({});\n const [budgetValues, setBudgetValues] = useState<Record<string, Record<string, string>>>({});\n const [anonymous, setAnonymous] = useState(false);\n const [sentiment, setSentiment] = useState<SentimentChoice>('NONE');\n const [error, setError] = useState<string | null>(null);\n\n const submitResponse = useGovSubmitConsultationResponse();\n const pot = consultation.budgetAmount ?? null;\n const currency = consultation.currencyCode;\n\n const setSingle = (questionId: string, value: string): void => {\n setSingleValues((current) => ({ ...current, [questionId]: value }));\n };\n\n const toggleMulti = (questionId: string, option: string, checked: boolean): void => {\n setMultiValues((current) => {\n const chosen = current[questionId] ?? [];\n const next = checked\n ? chosen.includes(option)\n ? chosen\n : [...chosen, option]\n : chosen.filter((entry) => entry !== option);\n return { ...current, [questionId]: next };\n });\n };\n\n const setAllocation = (questionId: string, option: string, value: string): void => {\n setBudgetValues((current) => ({\n ...current,\n [questionId]: { ...(current[questionId] ?? {}), [option]: value },\n }));\n };\n\n /** Sum of the amounts typed against one budget question. */\n const allocationTotal = (question: ConsultationQuestion): number => {\n const entries = budgetValues[question.id] ?? {};\n let total = 0;\n for (const option of question.options) {\n const parsed = Number(entries[option] ?? '');\n if (Number.isFinite(parsed)) total += parsed;\n }\n return total;\n };\n\n /** True when the respondent has typed nothing at all against a budget question. */\n const allocationUntouched = (question: ConsultationQuestion): boolean => {\n const entries = budgetValues[question.id] ?? {};\n return question.options.every((option) => (entries[option] ?? '').trim().length === 0);\n };\n\n const isAnswered = (question: ConsultationQuestion): boolean => {\n switch (question.type) {\n case 'MULTI_CHOICE':\n return (multiValues[question.id] ?? []).length > 0;\n case 'BUDGET_ALLOCATION':\n return !allocationUntouched(question);\n default:\n return (singleValues[question.id] ?? '').trim().length > 0;\n }\n };\n\n /** Everything that currently blocks submission, mirroring the API's rules. */\n const issues = useMemo<string[]>(() => {\n const found: string[] = [];\n for (const question of questions) {\n const answered =\n question.type === 'MULTI_CHOICE'\n ? (multiValues[question.id] ?? []).length > 0\n : question.type === 'BUDGET_ALLOCATION'\n ? question.options.some(\n (option) => ((budgetValues[question.id] ?? {})[option] ?? '').trim().length > 0\n )\n : (singleValues[question.id] ?? '').trim().length > 0;\n\n if (question.required && !answered) {\n found.push(`“${question.label}” is required.`);\n }\n\n if (question.type === 'RATING' && answered) {\n const value = Number(singleValues[question.id]);\n if (!Number.isFinite(value)) {\n found.push(`“${question.label}” needs a number.`);\n } else if (\n (question.min !== null && value < question.min) ||\n (question.max !== null && value > question.max)\n ) {\n found.push(`“${question.label}” must be between ${question.min} and ${question.max}.`);\n }\n }\n\n if (question.type === 'BUDGET_ALLOCATION' && (answered || question.required)) {\n if (pot === null || pot <= 0) {\n found.push(\n `“${question.label}” cannot be answered: this consultation has no budget pot recorded.`\n );\n } else {\n const entries = budgetValues[question.id] ?? {};\n let total = 0;\n let negative = false;\n for (const option of question.options) {\n const raw = (entries[option] ?? '').trim();\n if (raw.length === 0) continue;\n const parsed = Number(raw);\n if (!Number.isFinite(parsed)) {\n negative = true;\n break;\n }\n if (parsed < 0) negative = true;\n total += parsed;\n }\n if (negative) {\n found.push(`“${question.label}” only accepts non-negative amounts.`);\n } else if (Math.abs(total - pot) > BUDGET_SUM_TOLERANCE) {\n found.push(\n `“${question.label}” must allocate exactly ${formatCurrency(pot, currency)}.`\n );\n }\n }\n }\n }\n return found;\n }, [questions, singleValues, multiValues, budgetValues, pot, currency]);\n\n const busy = submitResponse.isPending;\n const canSubmit = questions.length > 0 && issues.length === 0 && !busy;\n\n const submit = async (): Promise<void> => {\n const answers: { questionId: string; value: unknown }[] = [];\n\n for (const question of questions) {\n if (!isAnswered(question)) continue;\n\n switch (question.type) {\n case 'SINGLE_CHOICE':\n answers.push({ questionId: question.id, value: singleValues[question.id].trim() });\n break;\n case 'TEXT':\n answers.push({ questionId: question.id, value: singleValues[question.id].trim() });\n break;\n case 'RATING':\n answers.push({ questionId: question.id, value: Number(singleValues[question.id]) });\n break;\n case 'MULTI_CHOICE':\n answers.push({ questionId: question.id, value: multiValues[question.id] });\n break;\n case 'BUDGET_ALLOCATION': {\n const entries = budgetValues[question.id] ?? {};\n const allocation: Record<string, number> = {};\n for (const option of question.options) {\n const parsed = Number((entries[option] ?? '').trim());\n allocation[option] = Number.isFinite(parsed) ? parsed : 0;\n }\n answers.push({ questionId: question.id, value: allocation });\n break;\n }\n default:\n break;\n }\n }\n\n setError(null);\n try {\n await submitResponse.mutateAsync({\n consultationId: consultation.id,\n answers,\n sentiment: sentiment === 'NONE' ? undefined : sentiment,\n anonymous: anonymous ? true : undefined,\n });\n notify.success(\n 'Response submitted',\n anonymous\n ? 'Your answers were recorded without your identity.'\n : 'Thank you for taking part.'\n );\n onSubmitted?.();\n onClose();\n } catch (err) {\n setError(describeError(err));\n }\n };\n\n return (\n <ResponsiveDialog\n open\n onOpenChange={(next) => {\n if (!next && !busy) onClose();\n }}\n >\n <ResponsiveDialogContent className=\"max-h-[90vh] overflow-y-auto sm:max-w-2xl\">\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>{consultation.title}</ResponsiveDialogTitle>\n <ResponsiveDialogDescription>\n {consultation.description ?? 'Answer the questions below to take part.'}\n </ResponsiveDialogDescription>\n </ResponsiveDialogHeader>\n\n <div className=\"flex flex-col gap-5 py-2\">\n {questions.length === 0 ? (\n <p className=\"text-sm text-text-muted\">\n This consultation has no published questions yet, so there is nothing to answer.\n </p>\n ) : (\n questions.map((question, index) => (\n <fieldset\n key={question.id}\n className=\"rounded-xl border border-border-seam bg-bg-surface p-4\"\n >\n <legend className=\"px-1 text-sm font-semibold text-text-primary\">\n {index + 1}. {question.label}\n {question.required && (\n <span className=\"ml-1 text-status-error-text\" aria-label=\"required\">\n *\n </span>\n )}\n </legend>\n\n {question.type === 'SINGLE_CHOICE' && (\n <div\n role=\"radiogroup\"\n aria-label={question.label}\n className=\"mt-3 flex flex-col gap-2\"\n >\n {question.options.map((option) => {\n const selected = singleValues[question.id] === option;\n return (\n <button\n key={option}\n type=\"button\"\n role=\"radio\"\n aria-checked={selected}\n onClick={() => setSingle(question.id, option)}\n className={cn(\n 'flex w-full items-center gap-2.5 rounded-lg border px-3 py-2 text-left text-sm transition-colors',\n selected\n ? 'border-action-primary-bg bg-[var(--color-accent-soft)] text-text-primary'\n : 'border-border-seam bg-bg-surface text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n )}\n >\n <span\n aria-hidden=\"true\"\n className={cn(\n 'size-4 shrink-0 rounded-full border-2',\n selected\n ? 'border-[5px] border-action-primary-bg'\n : 'border-border-strong'\n )}\n />\n {option}\n </button>\n );\n })}\n </div>\n )}\n\n {question.type === 'MULTI_CHOICE' && (\n <div className=\"mt-3 flex flex-col gap-2\">\n {question.options.map((option) => {\n const checkboxId = `${question.id}-${option}`;\n const chosen = (multiValues[question.id] ?? []).includes(option);\n return (\n <label\n key={option}\n htmlFor={checkboxId}\n className=\"flex cursor-pointer items-center gap-2.5 rounded-lg border border-border-seam bg-bg-surface px-3 py-2 text-sm text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary\"\n >\n <Checkbox\n id={checkboxId}\n checked={chosen}\n onCheckedChange={(next) =>\n toggleMulti(question.id, option, next === true)\n }\n />\n {option}\n </label>\n );\n })}\n </div>\n )}\n\n {question.type === 'RATING' && (\n <RatingField\n question={question}\n value={singleValues[question.id] ?? ''}\n onChange={(value) => setSingle(question.id, value)}\n />\n )}\n\n {question.type === 'TEXT' && (\n <Textarea\n className=\"mt-3\"\n rows={3}\n value={singleValues[question.id] ?? ''}\n onChange={(event) => setSingle(question.id, event.target.value)}\n placeholder=\"Your answer\"\n aria-label={question.label}\n />\n )}\n\n {question.type === 'BUDGET_ALLOCATION' && (\n <BudgetAllocationField\n question={question}\n pot={pot}\n currency={currency}\n values={budgetValues[question.id] ?? {}}\n total={allocationTotal(question)}\n onChange={(option, value) => setAllocation(question.id, option, value)}\n />\n )}\n </fieldset>\n ))\n )}\n\n {questions.length > 0 && (\n <div className=\"grid gap-1.5\">\n <Label>Overall sentiment (optional)</Label>\n <Select\n value={sentiment}\n onValueChange={(value) => setSentiment(value as SentimentChoice)}\n >\n <SelectTrigger aria-label=\"Overall sentiment\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {(['NONE', 'POSITIVE', 'NEUTRAL', 'NEGATIVE'] as const).map((entry) => (\n <SelectItem key={entry} value={entry}>\n {SENTIMENT_LABELS[entry]}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n )}\n\n {consultation.allowAnonymous && questions.length > 0 && (\n <div className=\"flex items-start gap-3 rounded-xl border border-border-seam bg-bg-sunken/40 p-4\">\n <Switch\n id=\"consultation-anonymous\"\n checked={anonymous}\n onCheckedChange={(next) => setAnonymous(next === true)}\n />\n <div className=\"min-w-0\">\n <Label htmlFor=\"consultation-anonymous\" className=\"cursor-pointer\">\n Submit anonymously\n </Label>\n <p className=\"mt-1 flex items-start gap-1.5 text-xs text-text-muted\">\n <ShieldOff className=\"mt-0.5 size-3.5 shrink-0\" aria-hidden=\"true\" />\n No respondent id is stored. Because nothing links the response back to you, you\n will not be able to view or change it afterwards.\n </p>\n </div>\n </div>\n )}\n\n {issues.length > 0 && (\n <div\n className=\"rounded-xl border border-border-seam bg-status-warning-bg-subtle p-3\"\n role=\"status\"\n >\n <p className=\"flex items-center gap-1.5 text-sm font-medium text-status-warning-text\">\n <AlertTriangle className=\"size-4 shrink-0\" aria-hidden=\"true\" /> Before you can\n submit\n </p>\n <ul className=\"mt-1.5 list-inside list-disc text-sm text-status-warning-text\">\n {issues.map((issue) => (\n <li key={issue}>{issue}</li>\n ))}\n </ul>\n </div>\n )}\n\n {error && <p className=\"text-sm text-status-error-text\">{error}</p>}\n </div>\n\n <ResponsiveDialogFooter>\n <Button variant=\"outline\" onClick={onClose} disabled={busy}>\n Cancel\n </Button>\n <Button\n disabled={!canSubmit}\n onClick={() => {\n void submit();\n }}\n >\n <Send className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" />\n {busy ? 'Submitting…' : 'Submit response'}\n </Button>\n </ResponsiveDialogFooter>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n\ninterface RatingFieldProps {\n question: ConsultationQuestion;\n value: string;\n onChange: (value: string) => void;\n}\n\n/** A min..max scale — buttons for a short scale, a number field for a long one. */\nfunction RatingField({ question, value, onChange }: RatingFieldProps): ReactElement {\n const min = question.min;\n const max = question.max;\n\n if (min === null || max === null || max - min + 1 > MAX_RATING_BUTTONS) {\n return (\n <div className=\"mt-3\">\n <Input\n type=\"number\"\n value={value}\n min={min ?? undefined}\n max={max ?? undefined}\n onChange={(event) => onChange(event.target.value)}\n aria-label={question.label}\n placeholder={min !== null && max !== null ? `${min} to ${max}` : 'Your rating'}\n />\n {min !== null && max !== null && (\n <p className=\"mt-1 text-xs text-text-muted\">\n Rate between {formatNumber(min)} and {formatNumber(max)}.\n </p>\n )}\n </div>\n );\n }\n\n const steps: number[] = [];\n for (let step = min; step <= max; step += 1) steps.push(step);\n\n return (\n <div className=\"mt-3\">\n <div role=\"radiogroup\" aria-label={question.label} className=\"flex flex-wrap gap-1.5\">\n {steps.map((step) => {\n const selected = value === String(step);\n return (\n <button\n key={step}\n type=\"button\"\n role=\"radio\"\n aria-checked={selected}\n onClick={() => onChange(String(step))}\n className={cn(\n 'inline-flex size-10 items-center justify-center rounded-lg border text-sm font-medium tabular-nums transition-colors',\n selected\n ? 'border-transparent bg-action-primary-bg text-action-primary-text'\n : 'border-border-seam bg-bg-surface text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n )}\n >\n {step}\n </button>\n );\n })}\n </div>\n <p className=\"mt-1.5 text-xs text-text-muted\">\n {formatNumber(min)} is the lowest, {formatNumber(max)} the highest.\n </p>\n </div>\n );\n}\n\ninterface BudgetAllocationFieldProps {\n question: ConsultationQuestion;\n /** The consultation's pot. Null when the author has not recorded one. */\n pot: number | null;\n currency?: string | null;\n values: Record<string, string>;\n total: number;\n onChange: (option: string, value: string) => void;\n}\n\n/**\n * An amount per option with a live running total and a remaining-balance\n * indicator. The submit button stays disabled until the balance is settled —\n * the same rule `validateConsultationAnswers` enforces server-side.\n */\nfunction BudgetAllocationField({\n question,\n pot,\n currency,\n values,\n total,\n onChange,\n}: BudgetAllocationFieldProps): ReactElement {\n if (pot === null || pot <= 0) {\n return (\n <p className=\"mt-3 text-sm text-status-error-text\">\n This question cannot be answered: no budget pot has been recorded for the consultation.\n </p>\n );\n }\n\n const remaining = pot - total;\n const settled = Math.abs(remaining) <= BUDGET_SUM_TOLERANCE;\n const overAllocated = remaining < -BUDGET_SUM_TOLERANCE;\n const filled = Math.max(0, Math.min(100, (total / pot) * 100));\n\n return (\n <div className=\"mt-3 flex flex-col gap-3\">\n <div className=\"flex flex-col gap-2\">\n {question.options.map((option) => (\n <div key={option} className=\"flex flex-wrap items-center gap-2\">\n <Label\n htmlFor={`${question.id}-${option}`}\n className=\"min-w-0 flex-1 text-sm font-normal text-text-secondary\"\n >\n {option}\n </Label>\n <Input\n id={`${question.id}-${option}`}\n type=\"number\"\n min=\"0\"\n step=\"any\"\n inputMode=\"decimal\"\n className=\"w-40\"\n value={values[option] ?? ''}\n onChange={(event) => onChange(option, event.target.value)}\n placeholder=\"0\"\n />\n </div>\n ))}\n </div>\n\n <div className=\"rounded-xl border border-border-seam bg-bg-sunken/40 p-3\">\n <div className=\"flex flex-wrap items-baseline justify-between gap-2 text-sm\">\n <span className=\"text-text-secondary\">Allocated</span>\n <span className=\"font-semibold tabular-nums text-text-primary\">\n {formatCurrency(total, currency)} of {formatCurrency(pot, currency)}\n </span>\n </div>\n <div\n className=\"mt-2 h-2 w-full overflow-hidden rounded-full bg-bg-sunken\"\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={pot}\n aria-valuenow={total}\n aria-label=\"Budget allocated\"\n >\n <div\n className={cn(\n 'h-full rounded-full transition-[width] duration-200',\n overAllocated\n ? 'bg-status-error-bg'\n : settled\n ? 'bg-status-success-bg'\n : 'bg-action-primary-bg'\n )}\n style={{ width: `${filled}%` }}\n />\n </div>\n <p\n className={cn(\n 'mt-2 text-sm tabular-nums',\n overAllocated\n ? 'text-status-error-text'\n : settled\n ? 'text-status-success-text'\n : 'text-text-secondary'\n )}\n >\n {overAllocated\n ? `Over by ${formatCurrency(Math.abs(remaining), currency)} — reduce an allocation to continue.`\n : settled\n ? 'The full pot is allocated.'\n : `${formatCurrency(remaining, currency)} still to allocate.`}\n </p>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAsDA,IAAM,IAAqB,IAIrB,IAAoD;CACxD,MAAM;CACN,UAAU;CACV,SAAS;CACT,UAAU;AACZ;AASA,SAAgB,EAA8B,EAC5C,iBACA,YACA,kBACmD;CACnD,IAAM,IAAY,QACV,EAA2B,EAAa,SAAS,GACvD,CAAC,EAAa,SAAS,CACzB,GAGM,CAAC,GAAc,KAAmB,EAAiC,CAAC,CAAC,GACrE,CAAC,GAAa,KAAkB,EAAmC,CAAC,CAAC,GACrE,CAAC,GAAc,KAAmB,EAAiD,CAAC,CAAC,GACrF,CAAC,GAAW,KAAgB,EAAS,EAAK,GAC1C,CAAC,GAAW,KAAgB,EAA0B,MAAM,GAC5D,CAAC,GAAO,KAAY,EAAwB,IAAI,GAEhD,IAAiB,EAAiC,GAClD,IAAM,EAAa,gBAAgB,MACnC,IAAW,EAAa,cAExB,KA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KACE,SAAS,GAAG,EAAS,GAAG,GAAG;KAC3B,WAAU;eAET;IACI,CAAA,GACP,kBAAC,GAAD;KACE,IAAI,GAAG,EAAS,GAAG,GAAG;KACtB,MAAK;KACL,KAAI;KACJ,MAAK;KACL,WAAU;KACV,WAAU;KACV,OAAO,EAAO,MAAW;KACzB,WAAW,MAAU,EAAS,GAAQ,EAAM,OAAO,KAAK;KACxD,aAAY;IACb,CAAA,CACE;MAlBK,CAkBL,CACN;EACE,CAAA,GAEL,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,QAAD;MAAM,WAAU;gBAAsB;KAAe,CAAA,GACrD,kBAAC,QAAD;MAAM,WAAU;gBAAhB;OACG,EAAe,GAAO,CAAQ;OAAE;OAAK,EAAe,GAAK,CAAQ;MAC9D;OACH;;IACL,kBAAC,OAAD;KACE,WAAU;KACV,MAAK;KACL,iBAAe;KACf,iBAAe;KACf,iBAAe;KACf,cAAW;eAEX,kBAAC,OAAD;MACE,WAAW,EACT,uDACA,IACI,uBACA,IACE,yBACA,sBACR;MACA,OAAO,EAAE,OAAO,GAAG,EAAO,GAAG;KAC9B,CAAA;IACE,CAAA;IACL,kBAAC,KAAD;KACE,WAAW,EACT,6BACA,IACI,2BACA,IACE,6BACA,qBACR;eAEC,IACG,WAAW,EAAe,KAAK,IAAI,CAAS,GAAG,CAAQ,EAAE,wCACzD,IACE,+BACA,GAAG,EAAe,GAAW,CAAQ,EAAE;IAC5C,CAAA;GACA;IACF;;AAET"}
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ import { GovConsultation } from '../../types';
3
+
4
+ export interface ConsultationResultsPanelProps {
5
+ consultation: GovConsultation;
6
+ }
7
+ export declare const ConsultationResultsPanel: FC<ConsultationResultsPanelProps>;
8
+ //# sourceMappingURL=ConsultationResultsPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsultationResultsPanel.d.ts","sourceRoot":"","sources":["../../../../src/govcitizenhub/pages/intelligence/ConsultationResultsPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAgB,MAAM,OAAO,CAAC;AAqB9C,OAAO,KAAK,EAAE,eAAe,EAAiC,MAAM,aAAa,CAAC;AAKlF,MAAM,WAAW,6BAA6B;IAC5C,YAAY,EAAE,eAAe,CAAC;CAC/B;AAED,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,6BAA6B,CAqFtE,CAAC"}