@sensefolks/fastpoll 0.1.0

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 (107) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +21 -0
  3. package/dist/cjs/app-globals-V2Kpy_OQ.js +8 -0
  4. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  5. package/dist/cjs/index-CC5IS5t8.js +1437 -0
  6. package/dist/cjs/index-CC5IS5t8.js.map +1 -0
  7. package/dist/cjs/index-D8TNlmQq.js +201 -0
  8. package/dist/cjs/index-D8TNlmQq.js.map +1 -0
  9. package/dist/cjs/index.cjs.js +11 -0
  10. package/dist/cjs/index.cjs.js.map +1 -0
  11. package/dist/cjs/loader.cjs.js +16 -0
  12. package/dist/cjs/loader.cjs.js.map +1 -0
  13. package/dist/cjs/sf-fastpoll.cjs.entry.js +395 -0
  14. package/dist/cjs/sf-fastpoll.cjs.entry.js.map +1 -0
  15. package/dist/cjs/sf-fastpoll.cjs.js +28 -0
  16. package/dist/cjs/sf-fastpoll.cjs.js.map +1 -0
  17. package/dist/cjs/sf-fastpoll.entry.cjs.js.map +1 -0
  18. package/dist/collection/collection-manifest.json +12 -0
  19. package/dist/collection/components/sf-fastpoll/sf-fastpoll.css +76 -0
  20. package/dist/collection/components/sf-fastpoll/sf-fastpoll.js +454 -0
  21. package/dist/collection/components/sf-fastpoll/sf-fastpoll.js.map +1 -0
  22. package/dist/collection/index.js +11 -0
  23. package/dist/collection/index.js.map +1 -0
  24. package/dist/collection/utils/utils.js +189 -0
  25. package/dist/collection/utils/utils.js.map +1 -0
  26. package/dist/components/index.d.ts +33 -0
  27. package/dist/components/index.js +1427 -0
  28. package/dist/components/index.js.map +1 -0
  29. package/dist/components/sf-fastpoll.d.ts +11 -0
  30. package/dist/components/sf-fastpoll.js +425 -0
  31. package/dist/components/sf-fastpoll.js.map +1 -0
  32. package/dist/esm/app-globals-DQuL1Twl.js +6 -0
  33. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  34. package/dist/esm/index-CfdIRf0W.js +193 -0
  35. package/dist/esm/index-CfdIRf0W.js.map +1 -0
  36. package/dist/esm/index-XYfqntZe.js +1428 -0
  37. package/dist/esm/index-XYfqntZe.js.map +1 -0
  38. package/dist/esm/index.js +4 -0
  39. package/dist/esm/index.js.map +1 -0
  40. package/dist/esm/loader.js +14 -0
  41. package/dist/esm/loader.js.map +1 -0
  42. package/dist/esm/polyfills/core-js.js +11 -0
  43. package/dist/esm/polyfills/dom.js +79 -0
  44. package/dist/esm/polyfills/es5-html-element.js +1 -0
  45. package/dist/esm/polyfills/index.js +34 -0
  46. package/dist/esm/polyfills/system.js +6 -0
  47. package/dist/esm/sf-fastpoll.entry.js +393 -0
  48. package/dist/esm/sf-fastpoll.entry.js.map +1 -0
  49. package/dist/esm/sf-fastpoll.js +24 -0
  50. package/dist/esm/sf-fastpoll.js.map +1 -0
  51. package/dist/esm-es5/app-globals-DQuL1Twl.js +2 -0
  52. package/dist/esm-es5/app-globals-DQuL1Twl.js.map +1 -0
  53. package/dist/esm-es5/index-CfdIRf0W.js +2 -0
  54. package/dist/esm-es5/index-CfdIRf0W.js.map +1 -0
  55. package/dist/esm-es5/index-XYfqntZe.js +3 -0
  56. package/dist/esm-es5/index-XYfqntZe.js.map +1 -0
  57. package/dist/esm-es5/index.js +2 -0
  58. package/dist/esm-es5/index.js.map +1 -0
  59. package/dist/esm-es5/loader.js +2 -0
  60. package/dist/esm-es5/loader.js.map +1 -0
  61. package/dist/esm-es5/sf-fastpoll.entry.js +2 -0
  62. package/dist/esm-es5/sf-fastpoll.entry.js.map +1 -0
  63. package/dist/esm-es5/sf-fastpoll.js +2 -0
  64. package/dist/esm-es5/sf-fastpoll.js.map +1 -0
  65. package/dist/index.cjs.js +1 -0
  66. package/dist/index.js +1 -0
  67. package/dist/sf-fastpoll/index.esm.js +2 -0
  68. package/dist/sf-fastpoll/index.esm.js.map +1 -0
  69. package/dist/sf-fastpoll/loader.esm.js.map +1 -0
  70. package/dist/sf-fastpoll/p-1f6dca2a.system.entry.js +2 -0
  71. package/dist/sf-fastpoll/p-1f6dca2a.system.entry.js.map +1 -0
  72. package/dist/sf-fastpoll/p-4648bca3.entry.js +2 -0
  73. package/dist/sf-fastpoll/p-4648bca3.entry.js.map +1 -0
  74. package/dist/sf-fastpoll/p-BbPAtVJG.system.js +2 -0
  75. package/dist/sf-fastpoll/p-BbPAtVJG.system.js.map +1 -0
  76. package/dist/sf-fastpoll/p-C7EMppj8.system.js.map +1 -0
  77. package/dist/sf-fastpoll/p-C9ESvisV.system.js +3 -0
  78. package/dist/sf-fastpoll/p-C9ESvisV.system.js.map +1 -0
  79. package/dist/sf-fastpoll/p-CfdIRf0W.js +2 -0
  80. package/dist/sf-fastpoll/p-CfdIRf0W.js.map +1 -0
  81. package/dist/sf-fastpoll/p-CpmSDeqe.system.js +2 -0
  82. package/dist/sf-fastpoll/p-CpmSDeqe.system.js.map +1 -0
  83. package/dist/sf-fastpoll/p-DQuL1Twl.js +2 -0
  84. package/dist/sf-fastpoll/p-DQuL1Twl.js.map +1 -0
  85. package/dist/sf-fastpoll/p-JC66e5NR.system.js.map +1 -0
  86. package/dist/sf-fastpoll/p-S-cJYJS7.system.js +2 -0
  87. package/dist/sf-fastpoll/p-S-cJYJS7.system.js.map +1 -0
  88. package/dist/sf-fastpoll/p-XYfqntZe.js +3 -0
  89. package/dist/sf-fastpoll/p-XYfqntZe.js.map +1 -0
  90. package/dist/sf-fastpoll/p-zRZYYxiz.system.js +2 -0
  91. package/dist/sf-fastpoll/p-zRZYYxiz.system.js.map +1 -0
  92. package/dist/sf-fastpoll/sf-fastpoll.entry.esm.js.map +1 -0
  93. package/dist/sf-fastpoll/sf-fastpoll.esm.js +2 -0
  94. package/dist/sf-fastpoll/sf-fastpoll.esm.js.map +1 -0
  95. package/dist/sf-fastpoll/sf-fastpoll.js +127 -0
  96. package/dist/types/components/sf-fastpoll/sf-fastpoll.d.ts +77 -0
  97. package/dist/types/components.d.ts +47 -0
  98. package/dist/types/index.d.ts +11 -0
  99. package/dist/types/stencil-public-runtime.d.ts +1709 -0
  100. package/dist/types/utils/utils.d.ts +86 -0
  101. package/loader/cdn.js +2 -0
  102. package/loader/index.cjs.js +2 -0
  103. package/loader/index.d.ts +24 -0
  104. package/loader/index.es2017.js +2 -0
  105. package/loader/index.js +3 -0
  106. package/package.json +86 -0
  107. package/readme.md +239 -0
@@ -0,0 +1,393 @@
1
+ import { r as registerInstance, E as Env, h, H as Host, g as getElement } from './index-XYfqntZe.js';
2
+ import { i as isValidKey, g as getFieldConfig, s as sanitizeInput, a as addToCommaSeparatedList, r as removeFromCommaSeparatedList, b as sanitizeByType } from './index-CfdIRf0W.js';
3
+
4
+ const sfFastpollCss = ":host{display:block}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}input:focus,select:focus,button:focus{outline:2px solid #005fcc;outline-offset:2px}[aria-invalid='true']{border-color:#d32f2f}[part='error-message']{color:#d32f2f;font-size:0.875rem;margin-top:0.25rem}[part='choice-option']{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin:0.5rem 0;cursor:pointer}[part='choice-option']:hover{background-color:rgba(0, 95, 204, 0.1)}@media (prefers-contrast: high){input:focus,select:focus,button:focus{outline:3px solid}[part='error-message']{background-color:#d32f2f;color:white;padding:0.25rem}[part='choice-option']:hover{background-color:highlight;color:highlighttext}}@media (prefers-reduced-motion: reduce){*{-webkit-animation-duration:0.01ms !important;animation-duration:0.01ms !important;-webkit-animation-iteration-count:1 !important;animation-iteration-count:1 !important;-webkit-transition-duration:0.01ms !important;transition-duration:0.01ms !important}}";
5
+
6
+ const SURVEY_API_ENDPOINT = Env.SURVEY_API_ENDPOINT;
7
+ const RESPONSE_API_ENDPOINT = Env.RESPONSE_API_ENDPOINT;
8
+ var SurveyStep;
9
+ (function (SurveyStep) {
10
+ SurveyStep[SurveyStep["POLL"] = 0] = "POLL";
11
+ SurveyStep[SurveyStep["FOLLOW_UP"] = 1] = "FOLLOW_UP";
12
+ SurveyStep[SurveyStep["RESPONDENT_DETAILS"] = 2] = "RESPONDENT_DETAILS";
13
+ SurveyStep[SurveyStep["COMPLETION"] = 3] = "COMPLETION";
14
+ })(SurveyStep || (SurveyStep = {}));
15
+ const SfFastpoll = class {
16
+ constructor(hostRef) {
17
+ registerInstance(this, hostRef);
18
+ this.completionMessage = 'Thank you for your response!';
19
+ this.config = null;
20
+ this.respondentDetails = [];
21
+ this.loading = false;
22
+ this.error = null;
23
+ this.currentStep = SurveyStep.POLL;
24
+ this.selectedChoices = [];
25
+ this.selectedFollowUpChoices = [];
26
+ this.userRespondentDetails = {};
27
+ this.submitted = false;
28
+ this.announceMessage = '';
29
+ this.formErrors = {};
30
+ this.surveyStartTime = 0;
31
+ }
32
+ componentWillLoad() {
33
+ if (isValidKey(this.surveyKey)) {
34
+ return this.fetchSurveyData();
35
+ }
36
+ return Promise.resolve();
37
+ }
38
+ async fetchSurveyData() {
39
+ this.loading = true;
40
+ this.error = null;
41
+ this.surveyStartTime = Date.now();
42
+ try {
43
+ const response = await fetch(`${SURVEY_API_ENDPOINT}/${this.surveyKey}`);
44
+ const data = await response.json();
45
+ if (!data.success) {
46
+ throw new Error(data.message);
47
+ }
48
+ this.config = data.payload.config;
49
+ this.respondentDetails = data.payload.respondentDetails || [];
50
+ }
51
+ catch (error) {
52
+ this.error = error instanceof Error ? error.message : String(error);
53
+ }
54
+ finally {
55
+ this.loading = false;
56
+ }
57
+ }
58
+ async retryOperation() {
59
+ if (this.config) {
60
+ // If we have config, retry submission
61
+ await this.submitResponse();
62
+ }
63
+ else {
64
+ // Otherwise, retry fetching survey data
65
+ await this.fetchSurveyData();
66
+ }
67
+ }
68
+ async submitResponse() {
69
+ if (!this.config || this.submitted) {
70
+ return;
71
+ }
72
+ this.loading = true;
73
+ this.error = null;
74
+ try {
75
+ const completionTimeSeconds = this.surveyStartTime > 0 ? Math.round((Date.now() - this.surveyStartTime) / 1000) : 0;
76
+ const userAgentInfo = this.getUserAgentInfo();
77
+ const submissionData = {
78
+ surveyPublicKey: this.surveyKey,
79
+ responseData: {
80
+ selectedChoices: this.selectedChoices,
81
+ selectedFollowUpChoices: this.selectedFollowUpChoices,
82
+ },
83
+ respondentDetails: this.userRespondentDetails,
84
+ userAgent: userAgentInfo,
85
+ completionTime: completionTimeSeconds,
86
+ surveyType: 'fastPoll',
87
+ };
88
+ const response = await fetch(`${RESPONSE_API_ENDPOINT}`, {
89
+ method: 'POST',
90
+ headers: {
91
+ 'Content-Type': 'application/json',
92
+ },
93
+ body: JSON.stringify(submissionData),
94
+ });
95
+ const result = await response.json();
96
+ if (!result.success) {
97
+ throw new Error(result.message);
98
+ }
99
+ this.submitted = true;
100
+ this.currentStep = SurveyStep.COMPLETION;
101
+ }
102
+ catch (error) {
103
+ this.error = error instanceof Error ? error.message : String(error);
104
+ }
105
+ finally {
106
+ this.loading = false;
107
+ }
108
+ }
109
+ getUserAgentInfo() {
110
+ // Use modern navigator.userAgentData when available, fallback to userAgent parsing
111
+ const getPlatform = () => {
112
+ var _a;
113
+ if ('userAgentData' in navigator && ((_a = navigator.userAgentData) === null || _a === void 0 ? void 0 : _a.platform)) {
114
+ return navigator.userAgentData.platform;
115
+ }
116
+ // Fallback: extract platform info from userAgent
117
+ const ua = navigator.userAgent;
118
+ if (ua.includes('Win'))
119
+ return 'Windows';
120
+ if (ua.includes('Mac'))
121
+ return 'macOS';
122
+ if (ua.includes('Linux'))
123
+ return 'Linux';
124
+ if (ua.includes('Android'))
125
+ return 'Android';
126
+ if (ua.includes('iOS'))
127
+ return 'iOS';
128
+ return 'Unknown';
129
+ };
130
+ return {
131
+ userAgent: navigator.userAgent,
132
+ language: navigator.language,
133
+ platform: getPlatform(),
134
+ cookieEnabled: navigator.cookieEnabled,
135
+ onLine: navigator.onLine,
136
+ screenResolution: `${screen.width}x${screen.height}`,
137
+ colorDepth: screen.colorDepth,
138
+ timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
139
+ timestamp: new Date().toISOString(),
140
+ };
141
+ }
142
+ nextStep() {
143
+ if (!this.validateForm()) {
144
+ return;
145
+ }
146
+ if (this.currentStep === SurveyStep.POLL) {
147
+ if (this.hasFollowUpStep()) {
148
+ this.currentStep = SurveyStep.FOLLOW_UP;
149
+ this.announceToScreenReader('Moving to follow-up question');
150
+ }
151
+ else if (this.hasRespondentDetailsStep()) {
152
+ this.currentStep = SurveyStep.RESPONDENT_DETAILS;
153
+ this.announceToScreenReader('Moving to respondent details');
154
+ }
155
+ else {
156
+ this.announceToScreenReader('Submitting poll...');
157
+ this.submitResponse();
158
+ }
159
+ }
160
+ else if (this.currentStep === SurveyStep.FOLLOW_UP) {
161
+ if (this.hasRespondentDetailsStep()) {
162
+ this.currentStep = SurveyStep.RESPONDENT_DETAILS;
163
+ this.announceToScreenReader('Moving to respondent details');
164
+ }
165
+ else {
166
+ this.announceToScreenReader('Submitting poll...');
167
+ this.submitResponse();
168
+ }
169
+ }
170
+ else if (this.currentStep === SurveyStep.RESPONDENT_DETAILS) {
171
+ this.announceToScreenReader('Submitting poll...');
172
+ this.submitResponse();
173
+ }
174
+ }
175
+ prevStep() {
176
+ if (this.currentStep === SurveyStep.FOLLOW_UP) {
177
+ this.currentStep = SurveyStep.POLL;
178
+ }
179
+ else if (this.currentStep === SurveyStep.RESPONDENT_DETAILS) {
180
+ if (this.hasFollowUpStep()) {
181
+ this.currentStep = SurveyStep.FOLLOW_UP;
182
+ }
183
+ else {
184
+ this.currentStep = SurveyStep.POLL;
185
+ }
186
+ }
187
+ }
188
+ hasFollowUpStep() {
189
+ var _a, _b, _c;
190
+ return !!(((_a = this.config) === null || _a === void 0 ? void 0 : _a.followUpQuestion) && ((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.followUpChoices) === null || _c === void 0 ? void 0 : _c.length));
191
+ }
192
+ hasRespondentDetailsStep() {
193
+ return this.respondentDetails.length > 0;
194
+ }
195
+ announceToScreenReader(message) {
196
+ this.announceMessage = message;
197
+ setTimeout(() => {
198
+ this.announceMessage = '';
199
+ }, 1000);
200
+ }
201
+ isValidEmail(email) {
202
+ // Basic email validation regex
203
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
204
+ return emailRegex.test(email.trim());
205
+ }
206
+ validateRespondentField(detail, value) {
207
+ if (detail.required !== false && (!value || value.trim().length === 0)) {
208
+ return 'This field is required';
209
+ }
210
+ if (value && value.trim().length > 0) {
211
+ const config = getFieldConfig(detail, value);
212
+ if (config.inputType === 'email') {
213
+ if (!this.isValidEmail(value)) {
214
+ return 'Please enter a valid email address';
215
+ }
216
+ }
217
+ }
218
+ return null;
219
+ }
220
+ validateForm() {
221
+ const errors = {};
222
+ if (this.currentStep === SurveyStep.POLL && this.selectedChoices.length === 0) {
223
+ errors['poll'] = 'Please select at least one option';
224
+ }
225
+ if (this.currentStep === SurveyStep.FOLLOW_UP && this.selectedFollowUpChoices.length === 0) {
226
+ errors['followup'] = 'Please select at least one option';
227
+ }
228
+ this.formErrors = errors;
229
+ return Object.keys(errors).length === 0;
230
+ }
231
+ handleChoiceSelect(choice) {
232
+ var _a;
233
+ const choiceValue = choice.value;
234
+ const isMultipleChoice = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.choiceType) === 'multiChoice';
235
+ if (isMultipleChoice) {
236
+ if (this.selectedChoices.includes(choiceValue)) {
237
+ this.selectedChoices = this.selectedChoices.filter(c => c !== choiceValue);
238
+ this.announceToScreenReader(`Deselected: ${choice.label}`);
239
+ }
240
+ else {
241
+ this.selectedChoices = [...this.selectedChoices, choiceValue];
242
+ this.announceToScreenReader(`Selected: ${choice.label}`);
243
+ }
244
+ }
245
+ else {
246
+ this.selectedChoices = [choiceValue];
247
+ this.announceToScreenReader(`Selected: ${choice.label}`);
248
+ }
249
+ // Clear any validation errors when user makes a selection
250
+ if (this.formErrors['poll']) {
251
+ const errors = Object.assign({}, this.formErrors);
252
+ delete errors['poll'];
253
+ this.formErrors = errors;
254
+ }
255
+ }
256
+ handleFollowUpChoiceSelect(choice) {
257
+ const choiceValue = choice.value;
258
+ if (this.selectedFollowUpChoices.includes(choiceValue)) {
259
+ this.selectedFollowUpChoices = this.selectedFollowUpChoices.filter(c => c !== choiceValue);
260
+ }
261
+ else {
262
+ this.selectedFollowUpChoices = [...this.selectedFollowUpChoices, choiceValue];
263
+ }
264
+ }
265
+ handleRespondentDetailChange(key, event) {
266
+ const target = event.target;
267
+ const detail = this.respondentDetails.find(d => d.value === key);
268
+ const inputType = (detail === null || detail === void 0 ? void 0 : detail.inputType) || 'text';
269
+ let value;
270
+ if (target.type === 'checkbox') {
271
+ // Handle checkbox inputs - maintain comma-separated list using browser-compatible helpers
272
+ const currentValue = this.userRespondentDetails[key] || '';
273
+ const sanitizedCheckboxValue = sanitizeInput(target.value, 100);
274
+ if (target.checked) {
275
+ value = addToCommaSeparatedList(currentValue, sanitizedCheckboxValue);
276
+ }
277
+ else {
278
+ value = removeFromCommaSeparatedList(currentValue, sanitizedCheckboxValue);
279
+ }
280
+ }
281
+ else {
282
+ // Handle all other input types (text, email, number, radio, select)
283
+ // Sanitize based on field type
284
+ value = sanitizeByType(target.value, inputType);
285
+ }
286
+ this.userRespondentDetails = Object.assign(Object.assign({}, this.userRespondentDetails), { [key]: value });
287
+ }
288
+ createInputHandler(fieldValue) {
289
+ const self = this;
290
+ return function (e) {
291
+ self.handleRespondentDetailChange(fieldValue, e);
292
+ };
293
+ }
294
+ isValueInArray(array, value) {
295
+ for (let i = 0; i < array.length; i++) {
296
+ if (array[i] === value) {
297
+ return true;
298
+ }
299
+ }
300
+ return false;
301
+ }
302
+ renderField(detail) {
303
+ const config = getFieldConfig(detail, this.userRespondentDetails[detail.value] || '');
304
+ const inputHandler = this.createInputHandler(detail.value);
305
+ switch (config.inputType) {
306
+ case 'text':
307
+ case 'email':
308
+ case 'number':
309
+ return (h("input", { part: "input form-input", type: config.inputType, value: config.currentValue, onInput: inputHandler, placeholder: config.placeholder, required: config.required }));
310
+ case 'dropdown':
311
+ if (!config.hasOptions) {
312
+ return h("input", { part: "input form-input", type: "text", value: config.currentValue, onInput: inputHandler, placeholder: config.placeholder, required: config.required });
313
+ }
314
+ return (h("select", { part: "select form-select", onChange: inputHandler, required: config.required }, !config.defaultValue && (h("option", { value: "", disabled: true }, config.placeholder)), config.options.map(function (option) {
315
+ return (h("option", { key: option.value, value: option.value, selected: config.currentValue === option.value || (!config.currentValue && config.defaultValue === option.value) }, option.label));
316
+ })));
317
+ case 'radio':
318
+ if (!config.hasOptions) {
319
+ return h("input", { part: "input form-input", type: "text", value: config.currentValue, onInput: inputHandler, placeholder: config.placeholder, required: config.required });
320
+ }
321
+ return (h("div", { part: "radio-group" }, config.options.map(function (option) {
322
+ return (h("div", { key: option.value, part: "radio-option" }, h("input", { part: "radio-input", type: "radio", id: config.fieldValue + '-' + option.value, name: config.fieldValue, value: option.value, checked: config.currentValue === option.value || (!config.currentValue && config.defaultValue === option.value), onChange: inputHandler, required: config.required }), h("label", { part: "radio-label", htmlFor: config.fieldValue + '-' + option.value }, option.label)));
323
+ })));
324
+ case 'checkbox':
325
+ if (!config.hasOptions) {
326
+ return h("input", { part: "input form-input", type: "text", value: config.currentValue, onInput: inputHandler, placeholder: config.placeholder, required: config.required });
327
+ }
328
+ const self = this;
329
+ return (h("div", { part: "checkbox-group" }, config.options.map(function (option) {
330
+ return (h("div", { key: option.value, part: "checkbox-option" }, h("input", { part: "checkbox-input", type: "checkbox", id: config.fieldValue + '-' + option.value, name: config.fieldValue, value: option.value, checked: self.isValueInArray(config.selectedValues, option.value), onChange: inputHandler }), h("label", { part: "checkbox-label", htmlFor: config.fieldValue + '-' + option.value }, option.label)));
331
+ })));
332
+ default:
333
+ return h("input", { part: "input form-input", type: "text", value: config.currentValue, onInput: inputHandler, placeholder: config.placeholder, required: config.required });
334
+ }
335
+ }
336
+ isRespondentDetailsValid() {
337
+ return this.respondentDetails.every(detail => {
338
+ const value = this.userRespondentDetails[detail.value] || '';
339
+ const error = this.validateRespondentField(detail, value);
340
+ return error === null;
341
+ });
342
+ }
343
+ renderPollStep() {
344
+ var _a, _b, _c, _d;
345
+ const isFinalStep = !this.hasFollowUpStep() && !this.hasRespondentDetailsStep();
346
+ const isMultiple = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.choiceType) === 'multiChoice';
347
+ const hasError = !!this.formErrors['poll'];
348
+ return (h("div", { part: "step poll-step" }, h("h2", { part: "heading poll-heading", id: "poll-heading" }, ((_b = this.config) === null || _b === void 0 ? void 0 : _b.question) || 'What is your choice?'), h("div", { part: "choices-container", role: isMultiple ? 'group' : 'radiogroup', "aria-labelledby": "poll-heading", "aria-invalid": hasError, "aria-describedby": hasError ? 'poll-error' : undefined }, (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.choices) === null || _d === void 0 ? void 0 : _d.map((choice, index) => (h("label", { part: "choice-option", key: choice.value }, h("input", { part: isMultiple ? 'checkbox-input' : 'radio-input', type: isMultiple ? 'checkbox' : 'radio', id: `poll-choice-${index}`, name: "poll-choice", value: choice.value, checked: this.selectedChoices.includes(choice.value), onChange: () => this.handleChoiceSelect(choice), "aria-describedby": `poll-choice-${index}-label` }), h("span", { part: "choice-label", id: `poll-choice-${index}-label` }, choice.label))))), hasError && (h("div", { part: "error-message", id: "poll-error", role: "alert", "aria-live": "polite" }, this.formErrors['poll'])), h("div", { part: "button-container" }, h("button", { part: "button next-button", onClick: () => this.nextStep(), disabled: this.selectedChoices.length === 0 }, isFinalStep ? 'Submit' : 'Next'))));
349
+ }
350
+ renderFollowUpStep() {
351
+ var _a, _b, _c;
352
+ const isFinalStep = !this.hasRespondentDetailsStep();
353
+ return (h("div", { part: "step follow-up-step" }, h("h2", { part: "heading follow-up-heading" }, ((_a = this.config) === null || _a === void 0 ? void 0 : _a.followUpQuestion) || 'Follow-up question'), h("div", { part: "choices-container" }, (_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.followUpChoices) === null || _c === void 0 ? void 0 : _c.map(choice => (h("label", { part: "choice-option", key: choice.value }, h("input", { part: "checkbox-input", type: "checkbox", name: "follow-up-choice", value: choice.value, checked: this.selectedFollowUpChoices.includes(choice.value), onChange: () => this.handleFollowUpChoiceSelect(choice) }), h("span", { part: "choice-label" }, choice.label))))), h("div", { part: "button-container" }, h("button", { part: "button back-button", onClick: () => this.prevStep() }, "Back"), h("button", { part: "button next-button", onClick: () => this.nextStep() }, isFinalStep ? 'Submit' : 'Next'))));
354
+ }
355
+ renderRespondentDetailsStep() {
356
+ return (h("div", { part: "step respondent-details-step" }, h("h2", { part: "heading respondent-details-heading" }, "Tell us about yourself"), h("div", { part: "form-container" }, this.respondentDetails.map(detail => (h("div", { part: "form-field" }, h("label", { part: "form-label" }, detail.label, detail.required && h("span", { part: "required-indicator" }, " *")), this.renderField(detail))))), h("div", { part: "button-container" }, h("button", { part: "button back-button", onClick: () => this.prevStep() }, "Back"), h("button", { part: "button submit-button", onClick: () => this.submitResponse(), disabled: !this.isRespondentDetailsValid() }, "Submit"))));
357
+ }
358
+ renderCompletionStep() {
359
+ return (h("div", { part: "step completion-step" }, h("h2", { part: "heading completion-heading" }, this.completionMessage)));
360
+ }
361
+ renderCurrentStep() {
362
+ const stepRenderers = {
363
+ [SurveyStep.POLL]: this.renderPollStep.bind(this),
364
+ [SurveyStep.FOLLOW_UP]: this.renderFollowUpStep.bind(this),
365
+ [SurveyStep.RESPONDENT_DETAILS]: this.renderRespondentDetailsStep.bind(this),
366
+ [SurveyStep.COMPLETION]: this.renderCompletionStep.bind(this),
367
+ };
368
+ const renderer = stepRenderers[this.currentStep] || stepRenderers[SurveyStep.POLL];
369
+ return renderer();
370
+ }
371
+ render() {
372
+ if (!isValidKey(this.surveyKey)) {
373
+ return (h(Host, null, h("p", { part: "message error-message" }, "Unable to render survey due to invalid public key")));
374
+ }
375
+ if (this.loading) {
376
+ return (h(Host, null, h("p", { part: "message loading-message" }, "Loading survey...")));
377
+ }
378
+ if (this.error) {
379
+ return (h(Host, null, h("div", { part: "error-container" }, h("p", { part: "message error-message" }, this.error), h("button", { part: "button retry-button", onClick: () => this.retryOperation() }, "Try again"))));
380
+ }
381
+ if (!this.config) {
382
+ return (h(Host, null, h("div", { part: "error-container" }, h("p", { part: "message error-message" }, "No survey configuration found"), h("button", { part: "button retry-button", onClick: () => this.retryOperation() }, "Try again"))));
383
+ }
384
+ return (h(Host, null, h("div", { part: "survey-container", role: "main", "aria-label": "Poll Survey" }, this.renderCurrentStep(), h("div", { "aria-live": "polite", "aria-atomic": "true", class: "sr-only", part: "announcements" }, this.announceMessage))));
385
+ }
386
+ get el() { return getElement(this); }
387
+ };
388
+ SfFastpoll.style = sfFastpollCss;
389
+
390
+ export { SfFastpoll as sf_fastpoll };
391
+ //# sourceMappingURL=sf-fastpoll.entry.js.map
392
+
393
+ //# sourceMappingURL=sf-fastpoll.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sf-fastpoll.entry.js","sources":["src/components/sf-fastpoll/sf-fastpoll.css?tag=sf-fastpoll&encapsulation=shadow","src/components/sf-fastpoll/sf-fastpoll.tsx"],"sourcesContent":[":host {\n display: block;\n}\n\n/* Screen reader only content */\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Focus indicators for accessibility */\ninput:focus,\nselect:focus,\nbutton:focus {\n outline: 2px solid #005fcc;\n outline-offset: 2px;\n}\n\n/* Error state styling */\n[aria-invalid='true'] {\n border-color: #d32f2f;\n}\n\n[part='error-message'] {\n color: #d32f2f;\n font-size: 0.875rem;\n margin-top: 0.25rem;\n}\n\n/* Choice options styling */\n[part='choice-option'] {\n display: flex;\n align-items: center;\n margin: 0.5rem 0;\n cursor: pointer;\n}\n\n[part='choice-option']:hover {\n background-color: rgba(0, 95, 204, 0.1);\n}\n\n/* High contrast mode support */\n@media (prefers-contrast: high) {\n input:focus,\n select:focus,\n button:focus {\n outline: 3px solid;\n }\n\n [part='error-message'] {\n background-color: #d32f2f;\n color: white;\n padding: 0.25rem;\n }\n\n [part='choice-option']:hover {\n background-color: highlight;\n color: highlighttext;\n }\n}\n\n/* Reduced motion support */\n@media (prefers-reduced-motion: reduce) {\n * {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n }\n}\n","import { Component, Host, h, Prop, State, Element, Env } from '@stencil/core';\nimport { isValidKey, getFieldConfig, addToCommaSeparatedList, removeFromCommaSeparatedList, sanitizeByType, sanitizeInput } from '../../utils/utils';\n\nconst SURVEY_API_ENDPOINT = Env.SURVEY_API_ENDPOINT;\nconst RESPONSE_API_ENDPOINT = Env.RESPONSE_API_ENDPOINT;\n\nenum SurveyStep {\n POLL = 0,\n FOLLOW_UP = 1,\n RESPONDENT_DETAILS = 2,\n COMPLETION = 3,\n}\n\ninterface RespondentDetail {\n label: string;\n value: string;\n inputType: string; // 'text', 'email', 'dropdown', 'radio', 'checkbox', 'number'\n required?: boolean;\n placeholder?: string;\n options?: Array<{\n value: string;\n label: string;\n }>;\n defaultValue?: any;\n}\n\ninterface Choice {\n label: string;\n value: string;\n}\n\ninterface SurveyConfig {\n question: string;\n choiceType: string; // 'single' or 'multiple'\n choices: Choice[];\n followUpChoices?: Choice[];\n followUpQuestion?: string;\n}\n\ninterface SurveyPayload {\n config: SurveyConfig;\n respondentDetails?: RespondentDetail[];\n}\n\ninterface ApiResponse {\n success: boolean;\n message: string;\n payload: SurveyPayload;\n}\n\n@Component({\n tag: 'sf-fastpoll',\n styleUrl: 'sf-fastpoll.css',\n shadow: true,\n})\nexport class SfFastpoll {\n @Element() el: HTMLElement;\n\n @Prop() surveyKey: string;\n\n @Prop() completionMessage: string = 'Thank you for your response!';\n\n @State() config: SurveyConfig | null = null;\n\n @State() respondentDetails: RespondentDetail[] = [];\n\n @State() loading: boolean = false;\n\n @State() error: string | null = null;\n\n @State() currentStep: SurveyStep = SurveyStep.POLL;\n\n @State() selectedChoices: string[] = [];\n\n @State() selectedFollowUpChoices: string[] = [];\n\n @State() userRespondentDetails: { [key: string]: string } = {};\n\n @State() submitted: boolean = false;\n\n @State() announceMessage: string = '';\n\n @State() formErrors: { [key: string]: string } = {};\n\n private surveyStartTime: number = 0;\n\n componentWillLoad() {\n if (isValidKey(this.surveyKey)) {\n return this.fetchSurveyData();\n }\n return Promise.resolve();\n }\n\n private async fetchSurveyData() {\n this.loading = true;\n this.error = null;\n this.surveyStartTime = Date.now();\n\n try {\n const response = await fetch(`${SURVEY_API_ENDPOINT}/${this.surveyKey}`);\n const data: ApiResponse = await response.json();\n\n if (!data.success) {\n throw new Error(data.message);\n }\n\n this.config = data.payload.config;\n this.respondentDetails = data.payload.respondentDetails || [];\n } catch (error) {\n this.error = error instanceof Error ? error.message : String(error);\n } finally {\n this.loading = false;\n }\n }\n\n private async retryOperation() {\n if (this.config) {\n // If we have config, retry submission\n await this.submitResponse();\n } else {\n // Otherwise, retry fetching survey data\n await this.fetchSurveyData();\n }\n }\n\n private async submitResponse() {\n if (!this.config || this.submitted) {\n return;\n }\n\n this.loading = true;\n this.error = null;\n\n try {\n const completionTimeSeconds = this.surveyStartTime > 0 ? Math.round((Date.now() - this.surveyStartTime) / 1000) : 0;\n const userAgentInfo = this.getUserAgentInfo();\n\n const submissionData = {\n surveyPublicKey: this.surveyKey,\n responseData: {\n selectedChoices: this.selectedChoices,\n selectedFollowUpChoices: this.selectedFollowUpChoices,\n },\n respondentDetails: this.userRespondentDetails,\n userAgent: userAgentInfo,\n completionTime: completionTimeSeconds,\n surveyType: 'fastPoll',\n };\n\n const response = await fetch(`${RESPONSE_API_ENDPOINT}`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(submissionData),\n });\n\n const result = await response.json();\n\n if (!result.success) {\n throw new Error(result.message);\n }\n\n this.submitted = true;\n this.currentStep = SurveyStep.COMPLETION;\n } catch (error) {\n this.error = error instanceof Error ? error.message : String(error);\n } finally {\n this.loading = false;\n }\n }\n\n private getUserAgentInfo() {\n // Use modern navigator.userAgentData when available, fallback to userAgent parsing\n const getPlatform = () => {\n if ('userAgentData' in navigator && (navigator as any).userAgentData?.platform) {\n return (navigator as any).userAgentData.platform;\n }\n // Fallback: extract platform info from userAgent\n const ua = navigator.userAgent;\n if (ua.includes('Win')) return 'Windows';\n if (ua.includes('Mac')) return 'macOS';\n if (ua.includes('Linux')) return 'Linux';\n if (ua.includes('Android')) return 'Android';\n if (ua.includes('iOS')) return 'iOS';\n return 'Unknown';\n };\n\n return {\n userAgent: navigator.userAgent,\n language: navigator.language,\n platform: getPlatform(),\n cookieEnabled: navigator.cookieEnabled,\n onLine: navigator.onLine,\n screenResolution: `${screen.width}x${screen.height}`,\n colorDepth: screen.colorDepth,\n timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,\n timestamp: new Date().toISOString(),\n };\n }\n\n private nextStep() {\n if (!this.validateForm()) {\n return;\n }\n\n if (this.currentStep === SurveyStep.POLL) {\n if (this.hasFollowUpStep()) {\n this.currentStep = SurveyStep.FOLLOW_UP;\n this.announceToScreenReader('Moving to follow-up question');\n } else if (this.hasRespondentDetailsStep()) {\n this.currentStep = SurveyStep.RESPONDENT_DETAILS;\n this.announceToScreenReader('Moving to respondent details');\n } else {\n this.announceToScreenReader('Submitting poll...');\n this.submitResponse();\n }\n } else if (this.currentStep === SurveyStep.FOLLOW_UP) {\n if (this.hasRespondentDetailsStep()) {\n this.currentStep = SurveyStep.RESPONDENT_DETAILS;\n this.announceToScreenReader('Moving to respondent details');\n } else {\n this.announceToScreenReader('Submitting poll...');\n this.submitResponse();\n }\n } else if (this.currentStep === SurveyStep.RESPONDENT_DETAILS) {\n this.announceToScreenReader('Submitting poll...');\n this.submitResponse();\n }\n }\n\n private prevStep() {\n if (this.currentStep === SurveyStep.FOLLOW_UP) {\n this.currentStep = SurveyStep.POLL;\n } else if (this.currentStep === SurveyStep.RESPONDENT_DETAILS) {\n if (this.hasFollowUpStep()) {\n this.currentStep = SurveyStep.FOLLOW_UP;\n } else {\n this.currentStep = SurveyStep.POLL;\n }\n }\n }\n\n private hasFollowUpStep(): boolean {\n return !!(this.config?.followUpQuestion && this.config?.followUpChoices?.length);\n }\n\n private hasRespondentDetailsStep(): boolean {\n return this.respondentDetails.length > 0;\n }\n\n private announceToScreenReader(message: string) {\n this.announceMessage = message;\n setTimeout(() => {\n this.announceMessage = '';\n }, 1000);\n }\n\n private isValidEmail(email: string): boolean {\n // Basic email validation regex\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(email.trim());\n }\n\n private validateRespondentField(detail: RespondentDetail, value: string): string | null {\n if (detail.required !== false && (!value || value.trim().length === 0)) {\n return 'This field is required';\n }\n\n if (value && value.trim().length > 0) {\n const config = getFieldConfig(detail, value);\n if (config.inputType === 'email') {\n if (!this.isValidEmail(value)) {\n return 'Please enter a valid email address';\n }\n }\n }\n\n return null;\n }\n\n private validateForm(): boolean {\n const errors: { [key: string]: string } = {};\n\n if (this.currentStep === SurveyStep.POLL && this.selectedChoices.length === 0) {\n errors['poll'] = 'Please select at least one option';\n }\n\n if (this.currentStep === SurveyStep.FOLLOW_UP && this.selectedFollowUpChoices.length === 0) {\n errors['followup'] = 'Please select at least one option';\n }\n\n this.formErrors = errors;\n return Object.keys(errors).length === 0;\n }\n\n private handleChoiceSelect(choice: Choice) {\n const choiceValue = choice.value;\n const isMultipleChoice = this.config?.choiceType === 'multiChoice';\n\n if (isMultipleChoice) {\n if (this.selectedChoices.includes(choiceValue)) {\n this.selectedChoices = this.selectedChoices.filter(c => c !== choiceValue);\n this.announceToScreenReader(`Deselected: ${choice.label}`);\n } else {\n this.selectedChoices = [...this.selectedChoices, choiceValue];\n this.announceToScreenReader(`Selected: ${choice.label}`);\n }\n } else {\n this.selectedChoices = [choiceValue];\n this.announceToScreenReader(`Selected: ${choice.label}`);\n }\n\n // Clear any validation errors when user makes a selection\n if (this.formErrors['poll']) {\n const errors = { ...this.formErrors };\n delete errors['poll'];\n this.formErrors = errors;\n }\n }\n\n private handleFollowUpChoiceSelect(choice: Choice) {\n const choiceValue = choice.value;\n if (this.selectedFollowUpChoices.includes(choiceValue)) {\n this.selectedFollowUpChoices = this.selectedFollowUpChoices.filter(c => c !== choiceValue);\n } else {\n this.selectedFollowUpChoices = [...this.selectedFollowUpChoices, choiceValue];\n }\n }\n\n private handleRespondentDetailChange(key: string, event: Event) {\n const target = event.target as HTMLInputElement | HTMLSelectElement;\n const detail = this.respondentDetails.find(d => d.value === key);\n const inputType = detail?.inputType || 'text';\n let value: string;\n\n if (target.type === 'checkbox') {\n // Handle checkbox inputs - maintain comma-separated list using browser-compatible helpers\n const currentValue = this.userRespondentDetails[key] || '';\n const sanitizedCheckboxValue = sanitizeInput(target.value, 100);\n if (target.checked) {\n value = addToCommaSeparatedList(currentValue, sanitizedCheckboxValue);\n } else {\n value = removeFromCommaSeparatedList(currentValue, sanitizedCheckboxValue);\n }\n } else {\n // Handle all other input types (text, email, number, radio, select)\n // Sanitize based on field type\n value = sanitizeByType(target.value, inputType);\n }\n\n this.userRespondentDetails = {\n ...this.userRespondentDetails,\n [key]: value,\n };\n }\n\n private createInputHandler(fieldValue: string) {\n const self = this;\n return function (e: Event) {\n self.handleRespondentDetailChange(fieldValue, e);\n };\n }\n\n private isValueInArray(array: string[], value: string): boolean {\n for (let i = 0; i < array.length; i++) {\n if (array[i] === value) {\n return true;\n }\n }\n return false;\n }\n\n private renderField(detail: RespondentDetail) {\n const config = getFieldConfig(detail, this.userRespondentDetails[detail.value] || '');\n const inputHandler = this.createInputHandler(detail.value);\n\n switch (config.inputType) {\n case 'text':\n case 'email':\n case 'number':\n return (\n <input part=\"input form-input\" type={config.inputType} value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />\n );\n\n case 'dropdown':\n if (!config.hasOptions) {\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n return (\n <select part=\"select form-select\" onChange={inputHandler} required={config.required}>\n {!config.defaultValue && (\n <option value=\"\" disabled>\n {config.placeholder}\n </option>\n )}\n {config.options.map(function (option) {\n return (\n <option key={option.value} value={option.value} selected={config.currentValue === option.value || (!config.currentValue && config.defaultValue === option.value)}>\n {option.label}\n </option>\n );\n })}\n </select>\n );\n\n case 'radio':\n if (!config.hasOptions) {\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n return (\n <div part=\"radio-group\">\n {config.options.map(function (option) {\n return (\n <div key={option.value} part=\"radio-option\">\n <input\n part=\"radio-input\"\n type=\"radio\"\n id={config.fieldValue + '-' + option.value}\n name={config.fieldValue}\n value={option.value}\n checked={config.currentValue === option.value || (!config.currentValue && config.defaultValue === option.value)}\n onChange={inputHandler}\n required={config.required}\n />\n <label part=\"radio-label\" htmlFor={config.fieldValue + '-' + option.value}>\n {option.label}\n </label>\n </div>\n );\n })}\n </div>\n );\n\n case 'checkbox':\n if (!config.hasOptions) {\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n const self = this;\n return (\n <div part=\"checkbox-group\">\n {config.options.map(function (option) {\n return (\n <div key={option.value} part=\"checkbox-option\">\n <input\n part=\"checkbox-input\"\n type=\"checkbox\"\n id={config.fieldValue + '-' + option.value}\n name={config.fieldValue}\n value={option.value}\n checked={self.isValueInArray(config.selectedValues, option.value)}\n onChange={inputHandler}\n />\n <label part=\"checkbox-label\" htmlFor={config.fieldValue + '-' + option.value}>\n {option.label}\n </label>\n </div>\n );\n })}\n </div>\n );\n\n default:\n return <input part=\"input form-input\" type=\"text\" value={config.currentValue} onInput={inputHandler} placeholder={config.placeholder} required={config.required} />;\n }\n }\n\n private isRespondentDetailsValid(): boolean {\n return this.respondentDetails.every(detail => {\n const value = this.userRespondentDetails[detail.value] || '';\n const error = this.validateRespondentField(detail, value);\n return error === null;\n });\n }\n\n private renderPollStep() {\n const isFinalStep = !this.hasFollowUpStep() && !this.hasRespondentDetailsStep();\n const isMultiple = this.config?.choiceType === 'multiChoice';\n const hasError = !!this.formErrors['poll'];\n\n return (\n <div part=\"step poll-step\">\n <h2 part=\"heading poll-heading\" id=\"poll-heading\">\n {this.config?.question || 'What is your choice?'}\n </h2>\n <div\n part=\"choices-container\"\n role={isMultiple ? 'group' : 'radiogroup'}\n aria-labelledby=\"poll-heading\"\n aria-invalid={hasError}\n aria-describedby={hasError ? 'poll-error' : undefined}\n >\n {this.config?.choices?.map((choice, index) => (\n <label part=\"choice-option\" key={choice.value}>\n <input\n part={isMultiple ? 'checkbox-input' : 'radio-input'}\n type={isMultiple ? 'checkbox' : 'radio'}\n id={`poll-choice-${index}`}\n name=\"poll-choice\"\n value={choice.value}\n checked={this.selectedChoices.includes(choice.value)}\n onChange={() => this.handleChoiceSelect(choice)}\n aria-describedby={`poll-choice-${index}-label`}\n />\n <span part=\"choice-label\" id={`poll-choice-${index}-label`}>\n {choice.label}\n </span>\n </label>\n ))}\n </div>\n {hasError && (\n <div part=\"error-message\" id=\"poll-error\" role=\"alert\" aria-live=\"polite\">\n {this.formErrors['poll']}\n </div>\n )}\n <div part=\"button-container\">\n <button part=\"button next-button\" onClick={() => this.nextStep()} disabled={this.selectedChoices.length === 0}>\n {isFinalStep ? 'Submit' : 'Next'}\n </button>\n </div>\n </div>\n );\n }\n\n private renderFollowUpStep() {\n const isFinalStep = !this.hasRespondentDetailsStep();\n\n return (\n <div part=\"step follow-up-step\">\n <h2 part=\"heading follow-up-heading\">{this.config?.followUpQuestion || 'Follow-up question'}</h2>\n <div part=\"choices-container\">\n {this.config?.followUpChoices?.map(choice => (\n <label part=\"choice-option\" key={choice.value}>\n <input\n part=\"checkbox-input\"\n type=\"checkbox\"\n name=\"follow-up-choice\"\n value={choice.value}\n checked={this.selectedFollowUpChoices.includes(choice.value)}\n onChange={() => this.handleFollowUpChoiceSelect(choice)}\n />\n <span part=\"choice-label\">{choice.label}</span>\n </label>\n ))}\n </div>\n <div part=\"button-container\">\n <button part=\"button back-button\" onClick={() => this.prevStep()}>\n Back\n </button>\n <button part=\"button next-button\" onClick={() => this.nextStep()}>\n {isFinalStep ? 'Submit' : 'Next'}\n </button>\n </div>\n </div>\n );\n }\n\n private renderRespondentDetailsStep() {\n return (\n <div part=\"step respondent-details-step\">\n <h2 part=\"heading respondent-details-heading\">Tell us about yourself</h2>\n <div part=\"form-container\">\n {this.respondentDetails.map(detail => (\n <div part=\"form-field\">\n <label part=\"form-label\">\n {detail.label}\n {detail.required && <span part=\"required-indicator\"> *</span>}\n </label>\n {this.renderField(detail)}\n </div>\n ))}\n </div>\n <div part=\"button-container\">\n <button part=\"button back-button\" onClick={() => this.prevStep()}>\n Back\n </button>\n <button part=\"button submit-button\" onClick={() => this.submitResponse()} disabled={!this.isRespondentDetailsValid()}>\n Submit\n </button>\n </div>\n </div>\n );\n }\n\n private renderCompletionStep() {\n return (\n <div part=\"step completion-step\">\n <h2 part=\"heading completion-heading\">{this.completionMessage}</h2>\n </div>\n );\n }\n\n private renderCurrentStep() {\n const stepRenderers = {\n [SurveyStep.POLL]: this.renderPollStep.bind(this),\n [SurveyStep.FOLLOW_UP]: this.renderFollowUpStep.bind(this),\n [SurveyStep.RESPONDENT_DETAILS]: this.renderRespondentDetailsStep.bind(this),\n [SurveyStep.COMPLETION]: this.renderCompletionStep.bind(this),\n };\n\n const renderer = stepRenderers[this.currentStep] || stepRenderers[SurveyStep.POLL];\n\n return renderer();\n }\n\n render() {\n if (!isValidKey(this.surveyKey)) {\n return (\n <Host>\n <p part=\"message error-message\">Unable to render survey due to invalid public key</p>\n </Host>\n );\n }\n\n if (this.loading) {\n return (\n <Host>\n <p part=\"message loading-message\">Loading survey...</p>\n </Host>\n );\n }\n\n if (this.error) {\n return (\n <Host>\n <div part=\"error-container\">\n <p part=\"message error-message\">{this.error}</p>\n <button part=\"button retry-button\" onClick={() => this.retryOperation()}>\n Try again\n </button>\n </div>\n </Host>\n );\n }\n\n if (!this.config) {\n return (\n <Host>\n <div part=\"error-container\">\n <p part=\"message error-message\">No survey configuration found</p>\n <button part=\"button retry-button\" onClick={() => this.retryOperation()}>\n Try again\n </button>\n </div>\n </Host>\n );\n }\n\n return (\n <Host>\n <div part=\"survey-container\" role=\"main\" aria-label=\"Poll Survey\">\n {this.renderCurrentStep()}\n {/* ARIA live region for screen reader announcements */}\n <div aria-live=\"polite\" aria-atomic=\"true\" class=\"sr-only\" part=\"announcements\">\n {this.announceMessage}\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"names":[],"mappings":";;;AAAA,MAAM,aAAa,GAAG,mkCAAmkC;;ACGzlC,MAAM,mBAAmB,GAAG,GAAG,CAAC,mBAAmB;AACnD,MAAM,qBAAqB,GAAG,GAAG,CAAC,qBAAqB;AAEvD,IAAK,UAKJ;AALD,CAAA,UAAK,UAAU,EAAA;IACb,UAAA,CAAA,UAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;IACR,UAAA,CAAA,UAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAa;IACb,UAAA,CAAA,UAAA,CAAA,oBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,oBAAsB;IACtB,UAAA,CAAA,UAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAc;AAChB,CAAC,EALI,UAAU,KAAV,UAAU,GAKd,EAAA,CAAA,CAAA;MA4CY,UAAU,GAAA,MAAA;AALvB,IAAA,WAAA,CAAA,OAAA,EAAA;;AAUU,QAAA,IAAiB,CAAA,iBAAA,GAAW,8BAA8B;AAEzD,QAAA,IAAM,CAAA,MAAA,GAAwB,IAAI;AAElC,QAAA,IAAiB,CAAA,iBAAA,GAAuB,EAAE;AAE1C,QAAA,IAAO,CAAA,OAAA,GAAY,KAAK;AAExB,QAAA,IAAK,CAAA,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AAC,MAAM,EAAE;YAChB,QACE,EAAC,IAAI,EAAA,IAAA,EACH,CAAK,CAAA,KAAA,EAAA,EAAA,IAAI,EAAC,iBAAiB,EAAA,EACzB,CAAG,CAAA,GAAA,EAAA,EAAA,IAAI,EAAC,uBAAuB,EAAkC,EAAA,+BAAA,CAAA,EACjE,CAAA,CAAA,QAAA,EAAA,EAAQ,IAAI,EAAC,qBAAqB,EAAC,OAAO,EAAE,MAAM,IAAI,CAAC,cAAc,EAAE,gBAE9D,CACL,CACD;;QAIX,QACE,EAAC,IAAI,EAAA,IAAA,EACH,CAAK,CAAA,KAAA,EAAA,EAAA,IAAI,EAAC,kBAAkB,EAAC,IAAI,EAAC,MAAM,gBAAY,aAAa,EAAA,EAC9D,IAAI,CAAC,iBAAiB,EAAE,EAEzB,CAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EAAe,QAAQ,EAAa,aAAA,EAAA,MAAM,EAAC,KAAK,EAAC,SAAS,EAAC,IAAI,EAAC,eAAe,EAAA,EAC5E,IAAI,CAAC,eAAe,CACjB,CACF,CACD;;;;;;;;"}
@@ -0,0 +1,24 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-XYfqntZe.js';
2
+ export { s as setNonce } from './index-XYfqntZe.js';
3
+ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.36.0 | MIT Licensed | https://stenciljs.com
7
+ */
8
+
9
+ var patchBrowser = () => {
10
+ const importMeta = import.meta.url;
11
+ const opts = {};
12
+ if (importMeta !== "") {
13
+ opts.resourcesUrl = new URL(".", importMeta).href;
14
+ }
15
+ return promiseResolve(opts);
16
+ };
17
+
18
+ patchBrowser().then(async (options) => {
19
+ await globalScripts();
20
+ return bootstrapLazy([["sf-fastpoll",[[1,"sf-fastpoll",{"surveyKey":[1,"survey-key"],"completionMessage":[1,"completion-message"],"config":[32],"respondentDetails":[32],"loading":[32],"error":[32],"currentStep":[32],"selectedChoices":[32],"selectedFollowUpChoices":[32],"userRespondentDetails":[32],"submitted":[32],"announceMessage":[32],"formErrors":[32]}]]]], options);
21
+ });
22
+ //# sourceMappingURL=sf-fastpoll.js.map
23
+
24
+ //# sourceMappingURL=sf-fastpoll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sf-fastpoll.js","sources":["node_modules/@stencil/core/internal/client/patch-browser.js","@lazy-browser-entrypoint?app-data=conditional"],"sourcesContent":["/*\n Stencil Client Patch Browser v4.36.0 | MIT Licensed | https://stenciljs.com\n */\n\n// src/client/client-patch-browser.ts\nimport { BUILD, NAMESPACE } from \"@stencil/core/internal/app-data\";\nimport { consoleDevInfo, H, promiseResolve, win } from \"@stencil/core\";\nvar patchBrowser = () => {\n if (BUILD.isDev && !BUILD.isTesting) {\n consoleDevInfo(\"Running in development mode.\");\n }\n if (BUILD.cloneNodeFix) {\n patchCloneNodeFix(H.prototype);\n }\n const scriptElm = BUILD.scriptDataOpts ? win.document && Array.from(win.document.querySelectorAll(\"script\")).find(\n (s) => new RegExp(`/${NAMESPACE}(\\\\.esm)?\\\\.js($|\\\\?|#)`).test(s.src) || s.getAttribute(\"data-stencil-namespace\") === NAMESPACE\n ) : null;\n const importMeta = import.meta.url;\n const opts = BUILD.scriptDataOpts ? (scriptElm || {})[\"data-opts\"] || {} : {};\n if (importMeta !== \"\") {\n opts.resourcesUrl = new URL(\".\", importMeta).href;\n }\n return promiseResolve(opts);\n};\nvar patchCloneNodeFix = (HTMLElementPrototype) => {\n const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;\n HTMLElementPrototype.cloneNode = function(deep) {\n if (this.nodeName === \"TEMPLATE\") {\n return nativeCloneNodeFn.call(this, deep);\n }\n const clonedNode = nativeCloneNodeFn.call(this, false);\n const srcChildNodes = this.childNodes;\n if (deep) {\n for (let i = 0; i < srcChildNodes.length; i++) {\n if (srcChildNodes[i].nodeType !== 2) {\n clonedNode.appendChild(srcChildNodes[i].cloneNode(true));\n }\n }\n }\n return clonedNode;\n };\n};\nexport {\n patchBrowser\n};\n","export { setNonce } from '@stencil/core';\nimport { bootstrapLazy } from '@stencil/core';\nimport { patchBrowser } from '@stencil/core/internal/client/patch-browser';\nimport { globalScripts } from '@stencil/core/internal/app-globals';\npatchBrowser().then(async (options) => {\n await globalScripts();\n return bootstrapLazy([/*!__STENCIL_LAZY_DATA__*/], options);\n});\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;;AAKA,IAAI,YAAY,GAAG,MAAM;AAUzB,EAAE,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG;AACpC,EAAE,MAAM,IAAI,GAAiE,EAAE;AAC/E,EAAE,IAAI,UAAU,KAAK,EAAE,EAAE;AACzB,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI;AACrD;AACA,EAAE,OAAO,cAAc,CAAC,IAAI,CAAC;AAC7B,CAAC;;ACnBD,YAAY,EAAE,CAAC,IAAI,CAAC,OAAO,OAAO,KAAK;AACvC,EAAE,MAAM,aAAa,EAAE;AACvB,EAAE,OAAO,aAAa,CAAC,4BAA4B,EAAE,OAAO,CAAC;AAC7D,CAAC,CAAC","x_google_ignoreList":[0]}
@@ -0,0 +1,2 @@
1
+ var globalScripts=function(){};export{globalScripts as g};
2
+ //# sourceMappingURL=app-globals-DQuL1Twl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-globals-DQuL1Twl.js","sources":["@stencil/core/internal/app-globals"],"sourcesContent":["export const globalScripts = () => {};\nexport const globalStyles = \"\";\n"],"names":[],"mappings":"AAAY,MAAC,aAAa,GAAG,MAAM;;;;"}
@@ -0,0 +1,2 @@
1
+ var MAX_TEXT_LENGTH=500;var MAX_EMAIL_LENGTH=254;function sanitizeInput(r,a){if(a===void 0){a=MAX_TEXT_LENGTH}if(typeof r!=="string"){return""}var e=r.replace(/^\s+|\s+$/g,"");e=e.replace(/\0/g,"");e=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;");if(e.length>a){e=e.substring(0,a)}return e}function sanitizeEmail(r){if(typeof r!=="string"){return""}var a=r.replace(/^\s+|\s+$/g,"").toLowerCase();a=a.replace(/[\0\x00-\x1F\x7F]/g,"");if(a.length>MAX_EMAIL_LENGTH){a=a.substring(0,MAX_EMAIL_LENGTH)}return a}function sanitizeByType(r,a){switch(a){case"email":return sanitizeEmail(r);case"number":var e=String(r).replace(/[^0-9.\-]/g,"");return e.substring(0,20);case"dropdown":case"radio":return sanitizeInput(r,100);case"checkbox":return r.split(",").map((function(r){return sanitizeInput(r.replace(/^\s+|\s+$/g,""),100)})).join(", ");default:return sanitizeInput(r)}}function isValidKey(r){if(typeof r!=="string"||r.trim().length===0){return false}var a=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;return a.test(r.trim())}function formatErrorMessage(r){if(typeof r==="string"){return r}if(r instanceof Error){return r.message}return"An unknown error occurred"}function arrayContains(r,a){for(var e=0;e<r.length;e++){if(r[e]===a){return true}}return false}function parseCommaSeparatedValues(r){if(!r){return[]}var a=r.split(",");var e=[];for(var t=0;t<a.length;t++){var n=a[t].replace(/^\s+|\s+$/g,"");if(n){e.push(n)}}return e}function getFieldConfig(r,a){var e=r.inputType||"text";var t=r.placeholder||"Enter your "+r.label.toLowerCase();var n=r.required!==false;return{inputType:e,placeholder:t,required:n,options:r.options||[],defaultValue:r.defaultValue,hasOptions:r.options&&r.options.length>0,selectedValues:parseCommaSeparatedValues(a),fieldValue:r.value,currentValue:a||""}}function addToCommaSeparatedList(r,a){var e=parseCommaSeparatedValues(r);if(!arrayContains(e,a)){e.push(a)}return e.join(", ")}function removeFromCommaSeparatedList(r,a){var e=parseCommaSeparatedValues(r);var t=[];for(var n=0;n<e.length;n++){if(e[n]!==a){t.push(e[n])}}return t.join(", ")}export{addToCommaSeparatedList as a,sanitizeByType as b,formatErrorMessage as f,getFieldConfig as g,isValidKey as i,removeFromCommaSeparatedList as r,sanitizeInput as s};
2
+ //# sourceMappingURL=index-CfdIRf0W.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CfdIRf0W.js","sources":["src/utils/utils.ts"],"sourcesContent":["/**\n * Utility functions for sf-fastpoll\n */\n\n/**\n * Maximum allowed length for text inputs\n */\nconst MAX_TEXT_LENGTH = 500;\nconst MAX_EMAIL_LENGTH = 254;\n\n/**\n * Sanitize user input to prevent XSS and limit length\n * @param input The raw user input\n * @param maxLength Maximum allowed length (default: 500)\n * @returns Sanitized string\n */\nexport function sanitizeInput(input: string, maxLength: number = MAX_TEXT_LENGTH): string {\n if (typeof input !== 'string') {\n return '';\n }\n\n // Trim whitespace\n let sanitized = input.replace(/^\\s+|\\s+$/g, '');\n\n // Remove null bytes\n sanitized = sanitized.replace(/\\0/g, '');\n\n // Encode HTML entities to prevent XSS\n sanitized = sanitized.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;').replace(/'/g, '&#x27;');\n\n // Truncate to max length\n if (sanitized.length > maxLength) {\n sanitized = sanitized.substring(0, maxLength);\n }\n\n return sanitized;\n}\n\n/**\n * Sanitize email input with email-specific rules\n * @param email The raw email input\n * @returns Sanitized email string\n */\nexport function sanitizeEmail(email: string): string {\n if (typeof email !== 'string') {\n return '';\n }\n\n // Trim and lowercase\n let sanitized = email.replace(/^\\s+|\\s+$/g, '').toLowerCase();\n\n // Remove null bytes and control characters\n sanitized = sanitized.replace(/[\\0\\x00-\\x1F\\x7F]/g, '');\n\n // Truncate to max email length (RFC 5321)\n if (sanitized.length > MAX_EMAIL_LENGTH) {\n sanitized = sanitized.substring(0, MAX_EMAIL_LENGTH);\n }\n\n return sanitized;\n}\n\n/**\n * Sanitize a value based on field type\n * @param value The raw value\n * @param inputType The type of input field\n * @returns Sanitized value\n */\nexport function sanitizeByType(value: string, inputType: string): string {\n switch (inputType) {\n case 'email':\n return sanitizeEmail(value);\n case 'number':\n // Only allow digits, decimal point, and minus sign\n const numStr = String(value).replace(/[^0-9.\\-]/g, '');\n return numStr.substring(0, 20); // Reasonable max for numbers\n case 'dropdown':\n case 'radio':\n // For select/radio, sanitize but be more permissive (values come from config)\n return sanitizeInput(value, 100);\n case 'checkbox':\n // Checkbox values are comma-separated, sanitize each\n return value\n .split(',')\n .map(v => sanitizeInput(v.replace(/^\\s+|\\s+$/g, ''), 100))\n .join(', ');\n default:\n return sanitizeInput(value);\n }\n}\n\n/**\n * Interface for respondent detail options\n */\ninterface RespondentDetailOption {\n value: string;\n label: string;\n}\n\n/**\n * Interface for respondent detail configuration\n */\ninterface RespondentDetail {\n label: string;\n value: string;\n inputType: string;\n required?: boolean;\n placeholder?: string;\n options?: RespondentDetailOption[];\n defaultValue?: any;\n}\n\n/**\n * Check if a survey key is valid UUID\n * @param key The survey key to validate\n * @returns True if the key is a valid UUID, false otherwise\n */\nexport function isValidKey(key: string | undefined | null): boolean {\n if (typeof key !== 'string' || key.trim().length === 0) {\n return false;\n }\n\n // UUID v4 regex pattern\n const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\n return uuidRegex.test(key.trim());\n}\n\n/**\n * Format error messages for display\n * @param error The error object or message\n * @returns A formatted error message string\n */\nexport function formatErrorMessage(error: any): string {\n if (typeof error === 'string') {\n return error;\n }\n\n if (error instanceof Error) {\n return error.message;\n }\n\n return 'An unknown error occurred';\n}\n\n/**\n * Browser-compatible helper to check if array contains a value\n * @param array The array to search\n * @param value The value to find\n * @returns true if value is found in array\n */\nfunction arrayContains(array: string[], value: string): boolean {\n for (let i = 0; i < array.length; i++) {\n if (array[i] === value) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Browser-compatible helper to trim and split comma-separated values\n * @param value The comma-separated string\n * @returns Array of trimmed values\n */\nfunction parseCommaSeparatedValues(value: string): string[] {\n if (!value) {\n return [];\n }\n const parts = value.split(',');\n const result = [];\n for (let i = 0; i < parts.length; i++) {\n const trimmed = parts[i].replace(/^\\s+|\\s+$/g, ''); // Manual trim for IE compatibility\n if (trimmed) {\n result.push(trimmed);\n }\n }\n return result;\n}\n\n/**\n * Get field configuration for rendering\n * @param detail The respondent detail configuration\n * @param value The current value of the field\n * @returns Field configuration object\n */\nexport function getFieldConfig(detail: RespondentDetail, value: string) {\n const inputType = detail.inputType || 'text';\n const placeholder = detail.placeholder || 'Enter your ' + detail.label.toLowerCase();\n const required = detail.required !== false;\n\n return {\n inputType: inputType,\n placeholder: placeholder,\n required: required,\n options: detail.options || [],\n defaultValue: detail.defaultValue,\n hasOptions: detail.options && detail.options.length > 0,\n selectedValues: parseCommaSeparatedValues(value),\n fieldValue: detail.value,\n currentValue: value || '',\n };\n}\n\n/**\n * Browser-compatible helper to add value to comma-separated list\n * @param currentValue The current comma-separated string\n * @param valueToAdd The value to add\n * @returns Updated comma-separated string\n */\nexport function addToCommaSeparatedList(currentValue: string, valueToAdd: string): string {\n const values = parseCommaSeparatedValues(currentValue);\n if (!arrayContains(values, valueToAdd)) {\n values.push(valueToAdd);\n }\n return values.join(', ');\n}\n\n/**\n * Browser-compatible helper to remove value from comma-separated list\n * @param currentValue The current comma-separated string\n * @param valueToRemove The value to remove\n * @returns Updated comma-separated string\n */\nexport function removeFromCommaSeparatedList(currentValue: string, valueToRemove: string): string {\n const values = parseCommaSeparatedValues(currentValue);\n const result = [];\n for (let i = 0; i < values.length; i++) {\n if (values[i] !== valueToRemove) {\n result.push(values[i]);\n }\n }\n return result.join(', ');\n}\n"],"names":[],"mappings":"AAAA;;AAEG;AAEH;;AAEG;AACH,MAAM,eAAe,GAAG,GAAG;AAC3B,MAAM,gBAAgB,GAAG,GAAG;AAE5B;;;;;AAKG;SACa,aAAa,CAAC,KAAa,EAAE,YAAoB,eAAe,EAAA;AAC9E,IAAA,IAAI,OAAO,KAAK,K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