@opengovsg/confetti 0.5.1 → 0.6.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.
- package/build/Button-uM2fAs2N.js +7 -0
- package/build/{Confetti-ClwOwSrM.d.ts → Confetti-fis-IO5o.d.ts} +1 -1
- package/build/{DefaultConfettiTrigger-DFJBQ35H.js → DefaultConfettiTrigger-CxIyRNHv.js} +1 -1
- package/build/Embed-CtGEGKcw.js +1 -0
- package/build/ModalContainer-jzFfmvRQ.js +5 -0
- package/build/{RecordingReplayer-BvU_CHwb.js → RecordingReplayer-DNYXhses.js} +8 -8
- package/build/client-internals.js +1 -1
- package/build/components.d.ts +10 -4
- package/build/components.js +1 -1
- package/build/confetti.css +7 -2
- package/build/index.d.ts +2 -2
- package/build/index.js +1 -1
- package/build/internals-Cc32ucML.js +1 -0
- package/build/internals.d.ts +5 -5
- package/build/internals.js +1 -1
- package/build/record--U99gpCM.js +53 -0
- package/build/{snapdom-BQZEILL6.js → snapdom-BbRa4ZYv.js} +2 -2
- package/build/static.d.ts +2 -2
- package/build/static.js +1 -1
- package/build/types-NMQZur7D.d.ts +345 -0
- package/package.json +9 -11
- package/build/Button-giwEer5K.js +0 -7
- package/build/Embed-J5cfWjpk.js +0 -1
- package/build/ModalContainer-B-WGlRn4.js +0 -5
- package/build/internals-B5GhpjgM.js +0 -1
- package/build/record-BZwNFiEW.js +0 -53
- package/build/types-C-q5VrLk.d.ts +0 -333
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region ../validators/dist/questions/routing.d.ts
|
|
5
|
+
declare const binaryOperatorConditionSchema: z.ZodObject<{
|
|
6
|
+
type: z.ZodLiteral<"binary-operator">;
|
|
7
|
+
operator: z.ZodUnion<readonly [z.ZodLiteral<"equal">, z.ZodLiteral<"not-equal">, z.ZodLiteral<"greater">, z.ZodLiteral<"greater-or-equal">, z.ZodLiteral<"less">, z.ZodLiteral<"less-or-equal">, z.ZodLiteral<"contains">, z.ZodLiteral<"not-contains">]>;
|
|
8
|
+
value: z.ZodObject<{
|
|
9
|
+
type: z.ZodLiteral<"value">;
|
|
10
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"next">;
|
|
14
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
15
|
+
type: z.ZodLiteral<"jump">;
|
|
16
|
+
target: z.ZodNumber;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
type: z.ZodLiteral<"end">;
|
|
19
|
+
}, z.core.$strip>], "type">;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
type BinaryOperatorCondition = z.infer<typeof binaryOperatorConditionSchema>;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region ../validators/dist/questions/properties.d.ts
|
|
24
|
+
declare const ratingQuestionPropertiesSchema: z.ZodObject<{
|
|
25
|
+
type: z.ZodLiteral<"rating">;
|
|
26
|
+
buttonLabel: z.ZodOptional<z.ZodString>;
|
|
27
|
+
shouldAutoProgress: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
scale: z.ZodNumber;
|
|
29
|
+
labels: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
lower: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
31
|
+
upper: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
display: z.ZodOptional<z.ZodLiteral<"emoji" | "number" | "star">>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
type RatingQuestionProperties = z.infer<typeof ratingQuestionPropertiesSchema>;
|
|
36
|
+
declare const textQuestionPropertiesSchema: z.ZodObject<{
|
|
37
|
+
type: z.ZodLiteral<"open-ended">;
|
|
38
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
39
|
+
buttonLabel: z.ZodOptional<z.ZodString>;
|
|
40
|
+
max: z.ZodNumber;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
type TextQuestionProperties = z.infer<typeof textQuestionPropertiesSchema>;
|
|
43
|
+
declare const singleSelectQuestionPropertiesSchema: z.ZodObject<{
|
|
44
|
+
type: z.ZodLiteral<"single-select">;
|
|
45
|
+
shouldAutoProgress: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
options: z.ZodArray<z.ZodObject<{
|
|
47
|
+
value: z.ZodString;
|
|
48
|
+
description: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
buttonLabel: z.ZodOptional<z.ZodString>;
|
|
51
|
+
editable: z.ZodNullable<z.ZodObject<{
|
|
52
|
+
label: z.ZodString;
|
|
53
|
+
max: z.ZodNumber;
|
|
54
|
+
description: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, z.core.$strip>>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
type SingleSelectQuestionProperties = z.infer<typeof singleSelectQuestionPropertiesSchema>;
|
|
58
|
+
declare const multiSelectQuestionPropertiesSchema: z.ZodObject<{
|
|
59
|
+
type: z.ZodLiteral<"multi-select">;
|
|
60
|
+
buttonLabel: z.ZodOptional<z.ZodString>;
|
|
61
|
+
options: z.ZodArray<z.ZodObject<{
|
|
62
|
+
value: z.ZodString;
|
|
63
|
+
description: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
editable: z.ZodNullable<z.ZodObject<{
|
|
66
|
+
label: z.ZodString;
|
|
67
|
+
max: z.ZodNumber;
|
|
68
|
+
description: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
display: z.ZodOptional<z.ZodLiteral<"checkbox" | "tag">>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
type MultiSelectQuestionProperties = z.infer<typeof multiSelectQuestionPropertiesSchema>;
|
|
74
|
+
declare const statementQuestionPropertiesSchema: z.ZodObject<{
|
|
75
|
+
type: z.ZodLiteral<"statement">;
|
|
76
|
+
buttonLabel: z.ZodOptional<z.ZodString>;
|
|
77
|
+
buttonUrl: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
type StatementQuestionProperties = z.infer<typeof statementQuestionPropertiesSchema>;
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region ../validators/dist/questions/answers.d.ts
|
|
82
|
+
declare const bugReportAnswerSchema: z.ZodObject<{
|
|
83
|
+
title: z.ZodString;
|
|
84
|
+
description: z.ZodOptional<z.ZodString>;
|
|
85
|
+
screenshotDataUrl: z.ZodOptional<z.ZodString>;
|
|
86
|
+
recordingEventsJson: z.ZodOptional<z.ZodString>;
|
|
87
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
89
|
+
screenResolution: z.ZodOptional<z.ZodString>;
|
|
90
|
+
viewportSize: z.ZodOptional<z.ZodString>;
|
|
91
|
+
pageUrl: z.ZodOptional<z.ZodString>;
|
|
92
|
+
pageTitle: z.ZodOptional<z.ZodString>;
|
|
93
|
+
referrer: z.ZodOptional<z.ZodString>;
|
|
94
|
+
datadogTraceId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
95
|
+
datadogSessionId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
96
|
+
datadogSessionReplayLink: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
97
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodString>>>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
type BugReportAnswer = z.infer<typeof bugReportAnswerSchema>;
|
|
100
|
+
declare const ratingAnswerSchemaFactory: ({
|
|
101
|
+
scale
|
|
102
|
+
}: {
|
|
103
|
+
scale: number;
|
|
104
|
+
}, {
|
|
105
|
+
required
|
|
106
|
+
}: {
|
|
107
|
+
required: boolean;
|
|
108
|
+
}) => z.ZodNumber | z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
type RatingAnswer = z.infer<ReturnType<typeof ratingAnswerSchemaFactory>>;
|
|
110
|
+
declare const singleSelectAnswerSchemaFactory: ({
|
|
111
|
+
maxLength
|
|
112
|
+
}: {
|
|
113
|
+
maxLength?: number;
|
|
114
|
+
}, {
|
|
115
|
+
required
|
|
116
|
+
}: {
|
|
117
|
+
required: boolean;
|
|
118
|
+
}) => z.ZodOptional<z.ZodString> | z.ZodString;
|
|
119
|
+
type SingleSelectAnswer = z.infer<ReturnType<typeof singleSelectAnswerSchemaFactory>>;
|
|
120
|
+
declare const multiSelectAnswerSchemaFactory: ({
|
|
121
|
+
maxSelected,
|
|
122
|
+
maxLength
|
|
123
|
+
}: {
|
|
124
|
+
maxSelected?: number;
|
|
125
|
+
maxLength?: number;
|
|
126
|
+
}, {
|
|
127
|
+
required
|
|
128
|
+
}: {
|
|
129
|
+
required: boolean;
|
|
130
|
+
}) => z.ZodArray<z.ZodString>;
|
|
131
|
+
type MultiSelectAnswer = z.infer<ReturnType<typeof multiSelectAnswerSchemaFactory>>;
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region ../validators/dist/survey.d.ts
|
|
134
|
+
declare const publicGetSurveyOutputSchema: z.ZodObject<{
|
|
135
|
+
title: z.ZodString;
|
|
136
|
+
description: z.ZodNullable<z.ZodString>;
|
|
137
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
138
|
+
id: z.ZodString;
|
|
139
|
+
title: z.ZodString;
|
|
140
|
+
description: z.ZodNullable<z.ZodString>;
|
|
141
|
+
position: z.ZodNumber;
|
|
142
|
+
required: z.ZodBoolean;
|
|
143
|
+
properties: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
144
|
+
type: z.ZodLiteral<"rating">;
|
|
145
|
+
buttonLabel: z.ZodOptional<z.ZodString>;
|
|
146
|
+
shouldAutoProgress: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
+
scale: z.ZodNumber;
|
|
148
|
+
labels: z.ZodOptional<z.ZodObject<{
|
|
149
|
+
lower: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
150
|
+
upper: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
|
|
151
|
+
}, z.core.$strip>>;
|
|
152
|
+
display: z.ZodOptional<z.ZodLiteral<"emoji" | "number" | "star">>;
|
|
153
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
154
|
+
type: z.ZodLiteral<"single-select">;
|
|
155
|
+
shouldAutoProgress: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
options: z.ZodArray<z.ZodObject<{
|
|
157
|
+
value: z.ZodString;
|
|
158
|
+
description: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
buttonLabel: z.ZodOptional<z.ZodString>;
|
|
161
|
+
editable: z.ZodNullable<z.ZodObject<{
|
|
162
|
+
label: z.ZodString;
|
|
163
|
+
max: z.ZodNumber;
|
|
164
|
+
description: z.ZodOptional<z.ZodString>;
|
|
165
|
+
}, z.core.$strip>>;
|
|
166
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
167
|
+
type: z.ZodLiteral<"open-ended">;
|
|
168
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
169
|
+
buttonLabel: z.ZodOptional<z.ZodString>;
|
|
170
|
+
max: z.ZodNumber;
|
|
171
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
172
|
+
type: z.ZodLiteral<"multi-select">;
|
|
173
|
+
buttonLabel: z.ZodOptional<z.ZodString>;
|
|
174
|
+
options: z.ZodArray<z.ZodObject<{
|
|
175
|
+
value: z.ZodString;
|
|
176
|
+
description: z.ZodOptional<z.ZodString>;
|
|
177
|
+
}, z.core.$strip>>;
|
|
178
|
+
editable: z.ZodNullable<z.ZodObject<{
|
|
179
|
+
label: z.ZodString;
|
|
180
|
+
max: z.ZodNumber;
|
|
181
|
+
description: z.ZodOptional<z.ZodString>;
|
|
182
|
+
}, z.core.$strip>>;
|
|
183
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
display: z.ZodOptional<z.ZodLiteral<"checkbox" | "tag">>;
|
|
185
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
186
|
+
type: z.ZodLiteral<"statement">;
|
|
187
|
+
buttonLabel: z.ZodOptional<z.ZodString>;
|
|
188
|
+
buttonUrl: z.ZodOptional<z.ZodString>;
|
|
189
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
190
|
+
type: z.ZodLiteral<"bug-report">;
|
|
191
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
192
|
+
buttonLabel: z.ZodOptional<z.ZodString>;
|
|
193
|
+
enableScreenshot: z.ZodBoolean;
|
|
194
|
+
enableRecording: z.ZodBoolean;
|
|
195
|
+
detailsLabel: z.ZodString;
|
|
196
|
+
detailsPlaceholder: z.ZodOptional<z.ZodString>;
|
|
197
|
+
redactClasses: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
198
|
+
}, z.core.$strip>], "type">;
|
|
199
|
+
routingLogic: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
200
|
+
type: z.ZodLiteral<"always">;
|
|
201
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
202
|
+
type: z.ZodLiteral<"next">;
|
|
203
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
204
|
+
type: z.ZodLiteral<"jump">;
|
|
205
|
+
target: z.ZodNumber;
|
|
206
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
207
|
+
type: z.ZodLiteral<"end">;
|
|
208
|
+
}, z.core.$strip>], "type">;
|
|
209
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
210
|
+
type: z.ZodLiteral<"switch">;
|
|
211
|
+
cases: z.ZodArray<z.ZodObject<{
|
|
212
|
+
type: z.ZodLiteral<"binary-operator">;
|
|
213
|
+
operator: z.ZodUnion<readonly [z.ZodLiteral<"equal">, z.ZodLiteral<"not-equal">, z.ZodLiteral<"greater">, z.ZodLiteral<"greater-or-equal">, z.ZodLiteral<"less">, z.ZodLiteral<"less-or-equal">, z.ZodLiteral<"contains">, z.ZodLiteral<"not-contains">]>;
|
|
214
|
+
value: z.ZodObject<{
|
|
215
|
+
type: z.ZodLiteral<"value">;
|
|
216
|
+
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
217
|
+
}, z.core.$strip>;
|
|
218
|
+
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
219
|
+
type: z.ZodLiteral<"next">;
|
|
220
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
221
|
+
type: z.ZodLiteral<"jump">;
|
|
222
|
+
target: z.ZodNumber;
|
|
223
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
224
|
+
type: z.ZodLiteral<"end">;
|
|
225
|
+
}, z.core.$strip>], "type">;
|
|
226
|
+
}, z.core.$strip>>;
|
|
227
|
+
default: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
228
|
+
type: z.ZodLiteral<"next">;
|
|
229
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
230
|
+
type: z.ZodLiteral<"jump">;
|
|
231
|
+
target: z.ZodNumber;
|
|
232
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
233
|
+
type: z.ZodLiteral<"end">;
|
|
234
|
+
}, z.core.$strip>], "type">;
|
|
235
|
+
}, z.core.$strip>], "type">;
|
|
236
|
+
}, z.core.$strip>>;
|
|
237
|
+
confirmation: z.ZodObject<{
|
|
238
|
+
title: z.ZodString;
|
|
239
|
+
description: z.ZodString;
|
|
240
|
+
buttonText: z.ZodString;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
}, z.core.$strip>;
|
|
243
|
+
type PublicGetSurveyOutput = z.infer<typeof publicGetSurveyOutputSchema>;
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region src/core/types.d.ts
|
|
246
|
+
type Question = {
|
|
247
|
+
visible: boolean;
|
|
248
|
+
error?: string;
|
|
249
|
+
} & PublicGetSurveyOutput['questions'][number];
|
|
250
|
+
type Answer = BugReportAnswer | RatingAnswer | MultiSelectAnswer | SingleSelectAnswer;
|
|
251
|
+
interface ConfettiState {
|
|
252
|
+
questions: Question[];
|
|
253
|
+
current: number;
|
|
254
|
+
update: ({
|
|
255
|
+
question,
|
|
256
|
+
answer
|
|
257
|
+
}: {
|
|
258
|
+
question: number;
|
|
259
|
+
answer: Answer;
|
|
260
|
+
}) => {
|
|
261
|
+
next?: number;
|
|
262
|
+
error?: string;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Submits the survey, or, when a visible question is unanswered or invalid,
|
|
266
|
+
* refuses and reveals the blocking errors through `errors`. Render an
|
|
267
|
+
* always-enabled submit control and let this decide.
|
|
268
|
+
*
|
|
269
|
+
* Returns whether the submission was accepted. Anything that should only
|
|
270
|
+
* happen on a real submission — navigation, analytics — must be gated on
|
|
271
|
+
* this rather than assuming the press went through.
|
|
272
|
+
*/
|
|
273
|
+
submit: () => boolean;
|
|
274
|
+
isSubmitted: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Blocking errors keyed by question id. Empty until the first submit
|
|
277
|
+
* attempt, then updated live as answers change.
|
|
278
|
+
*/
|
|
279
|
+
errors: Record<Question['id'], string>;
|
|
280
|
+
}
|
|
281
|
+
interface Proxyable {
|
|
282
|
+
/**
|
|
283
|
+
* Origin of the proxy that forwards Confetti API requests. The hosted
|
|
284
|
+
* templates also load the widget bundle and stylesheet from it.
|
|
285
|
+
*/
|
|
286
|
+
proxyUrl?: string;
|
|
287
|
+
}
|
|
288
|
+
type WithProxyable<T> = Omit<T, 'apiBaseUrl'> & Proxyable;
|
|
289
|
+
interface Finishable {
|
|
290
|
+
/**
|
|
291
|
+
* Callback is invoked after the survey response is submitted and the
|
|
292
|
+
* submission network call settles.
|
|
293
|
+
*/
|
|
294
|
+
onFinished?: () => void;
|
|
295
|
+
}
|
|
296
|
+
interface Closable {
|
|
297
|
+
/**
|
|
298
|
+
* Callback is invoked whenever the survey closes, regardless of how it was closed.
|
|
299
|
+
*/
|
|
300
|
+
onClose?: () => void;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Wraps the rendered survey in a consumer-provided container. Receives an
|
|
304
|
+
* object holding the survey node and returns the wrapped tree. The object
|
|
305
|
+
* shape leaves room to pass extra render data in the future.
|
|
306
|
+
*/
|
|
307
|
+
type ConfettiContainer = (props: {
|
|
308
|
+
survey: ReactNode;
|
|
309
|
+
}) => ReactNode;
|
|
310
|
+
interface Containable {
|
|
311
|
+
/**
|
|
312
|
+
* Wraps the rendered survey in a consumer-provided container for theming.
|
|
313
|
+
* Only invoked once the survey passes its visibility gates, so the container
|
|
314
|
+
* never renders while the survey is hidden, and unmounts when the survey
|
|
315
|
+
* closes.
|
|
316
|
+
*
|
|
317
|
+
* Prefer an inline function. To carry state or animation, render your own
|
|
318
|
+
* component inside it: `container={({ survey }) => <BrandShell>{survey}</BrandShell>}`.
|
|
319
|
+
*/
|
|
320
|
+
container?: ConfettiContainer;
|
|
321
|
+
}
|
|
322
|
+
interface Dismissable extends Closable {
|
|
323
|
+
/**
|
|
324
|
+
* The widget will automatically close this many milliseconds
|
|
325
|
+
* after the survey is finished.
|
|
326
|
+
* Set to `null` to disable automatic closing.
|
|
327
|
+
* @default 3000
|
|
328
|
+
*/
|
|
329
|
+
closeOnFinishMs?: number | null;
|
|
330
|
+
/**
|
|
331
|
+
* Callback is invoked when the user dismisses the survey before submitting.
|
|
332
|
+
* Closing after submission is not a dismissal and does not invoke this.
|
|
333
|
+
*/
|
|
334
|
+
onDismiss?: () => void;
|
|
335
|
+
}
|
|
336
|
+
interface OptionallyDismissable extends Dismissable {
|
|
337
|
+
/**
|
|
338
|
+
* Allows the user to dismiss the modal via the close button and the
|
|
339
|
+
* overlay.
|
|
340
|
+
* @default true
|
|
341
|
+
*/
|
|
342
|
+
isDismissable?: boolean;
|
|
343
|
+
}
|
|
344
|
+
//#endregion
|
|
345
|
+
export { TextQuestionProperties as _, Containable as a, OptionallyDismissable as c, WithProxyable as d, PublicGetSurveyOutput as f, StatementQuestionProperties as g, SingleSelectQuestionProperties as h, ConfettiState as i, Proxyable as l, RatingQuestionProperties as m, Closable as n, Dismissable as o, MultiSelectQuestionProperties as p, ConfettiContainer as r, Finishable as s, Answer as t, Question as u, BinaryOperatorCondition as v };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengovsg/confetti",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"description": "Widgets for Confetti",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"ky": "^1.14.2",
|
|
73
73
|
"react-error-boundary": "^6.1.1",
|
|
74
74
|
"usehooks-ts": "^3.1.1",
|
|
75
|
-
"zod": "4.
|
|
75
|
+
"zod": "4.4.3"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"react": "^18.2.0 || ^19.0.0",
|
|
@@ -84,22 +84,19 @@
|
|
|
84
84
|
"@types/node": "24.10.8",
|
|
85
85
|
"@types/react": "^19.2.16",
|
|
86
86
|
"@types/react-dom": "^19.2.3",
|
|
87
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
88
|
+
"@vitest/coverage-v8": "4.1.8",
|
|
87
89
|
"dotenv-cli": "^11.0.0",
|
|
88
90
|
"esbuild": "^0.28.1",
|
|
89
|
-
"eslint": "^9.39.2",
|
|
90
91
|
"postcss": "^8.5.10",
|
|
91
92
|
"postcss-cli": "^11.0.1",
|
|
92
93
|
"postcss-preset-env": "^11.2.1",
|
|
93
|
-
"prettier": "^3.7.4",
|
|
94
94
|
"react-aria-components": "1.16.0",
|
|
95
95
|
"tsdown": "0.22.1",
|
|
96
|
-
"typescript": "
|
|
97
|
-
"@confetti/eslint-config": "0.0.0",
|
|
98
|
-
"@confetti/prettier-config": "0.0.0",
|
|
96
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
99
97
|
"@confetti/tsconfig": "0.0.0",
|
|
100
98
|
"@confetti/validators": "0.0.0"
|
|
101
99
|
},
|
|
102
|
-
"prettier": "@confetti/prettier-config",
|
|
103
100
|
"scripts": {
|
|
104
101
|
"build:css": "postcss ./src/confetti.css -o ./build/confetti.css",
|
|
105
102
|
"build:package": "tsdown -F package && pnpm run build:css",
|
|
@@ -107,9 +104,10 @@
|
|
|
107
104
|
"build": "pnpm run build:package && pnpm run build:script",
|
|
108
105
|
"clean": "git clean -xdf .cache .turbo dist node_modules",
|
|
109
106
|
"dev": "tsc",
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
107
|
+
"typegen": "tsc -p tsconfig.typegen.json",
|
|
108
|
+
"typecheck": "tsc --noEmit",
|
|
109
|
+
"test": "vitest",
|
|
110
|
+
"test:ci": "vitest run",
|
|
113
111
|
"with-env": "dotenv -e ../../.env --"
|
|
114
112
|
}
|
|
115
113
|
}
|
package/build/Button-giwEer5K.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import e,{createContext as t,forwardRef as n,useCallback as r,useContext as i,useEffect as a,useMemo as o,useRef as s,useState as c}from"react";import l from"ky";import{z as u}from"zod/v4/mini";import d from"clsx";import"react-dom";const f=l.create({prefixUrl:`https://confetti.gov.sg`,retry:{limit:3,methods:[`get`,`head`]},timeout:6e4});function p({publishableKey:e,apiBaseUrl:t}){return o(()=>{let n={headers:{"x-cfti-pk":e}};return t&&(n.prefixUrl=t),f.extend(n)},[t,e])}const m=u.object({type:u.literal(`next`)}),h=u.object({type:u.literal(`end`)}),g=u.object({type:u.literal(`jump`),target:u.number({error:`Target question is required`})}),_=u.discriminatedUnion(`type`,[m,g,h]),v=u.object({type:u.literal(`value`),value:u.union([u.string().check(u.trim(),u.minLength(1,{error:`Value is required`})),u.number({error:`Value is required`})])}),y=u.object({type:u.literal(`binary-operator`),operator:u.union([u.literal(`equal`),u.literal(`not-equal`),u.literal(`greater`),u.literal(`greater-or-equal`),u.literal(`less`),u.literal(`less-or-equal`),u.literal(`contains`),u.literal(`not-contains`)]),value:v,target:_}),b=u.object({type:u.literal(`switch`),cases:u.array(y),default:_}),x=u.object({type:u.literal(`always`),target:_}),S=u.discriminatedUnion(`type`,[x,b]),C=u.string().check(u.trim(),u.url({protocol:/^(https|mailto)/,error:`Link must start with https:// or mailto:`})),w=u.optional(u.string().check(u.trim(),u.maxLength(50))),T=u.object({value:u.string().check(u.trim(),u.minLength(1,{error:`Value is required`})),description:u.optional(u.string().check(u.trim()))}),E=u.nullable(u.object({label:u.string().check(u.trim(),u.minLength(1,{error:`Value is required`})),max:u.number(),description:u.optional(u.string().check(u.trim()))})),D=u.optional(u.boolean()),ee=u.object({type:u.literal(`rating`),buttonLabel:w,shouldAutoProgress:D,scale:u.number().check(u.minimum(2),u.maximum(10)),labels:u.optional(u.object({lower:u.optional(u.pipe(u.string().check(u.trim()),u.transform(e=>e===``?void 0:e))),upper:u.optional(u.pipe(u.string().check(u.trim()),u.transform(e=>e===``?void 0:e)))})),display:u.optional(u.literal([`star`,`emoji`,`number`]))}),O=u.object({type:u.literal(`open-ended`),placeholder:u.optional(u.string()),buttonLabel:w,max:u.number()}),te=u.object({type:u.literal(`single-select`),shouldAutoProgress:D,options:u.array(T),buttonLabel:w,editable:E}),k=u.object({type:u.literal(`multi-select`),buttonLabel:w,options:u.array(T),editable:E,max:u.optional(u.number()),display:u.optional(u.literal([`checkbox`,`tag`]))}),ne=u.object({type:u.literal(`statement`),buttonLabel:w,buttonUrl:u.optional(C)}),re=u.object({type:u.literal(`bug-report`),placeholder:u.optional(u.string()),buttonLabel:w,enableScreenshot:u.boolean(),enableRecording:u.boolean(),detailsLabel:u.string().check(u.trim(),u.minLength(1,{error:`Label is required`}),u.maxLength(128)),detailsPlaceholder:u.optional(u.string()),redactClasses:u.optional(u.array(u.string()))}),ie=u.discriminatedUnion(`type`,[ee,te,O,k,ne,re]),ae=`__CONFETTI_CHECKBOX_Others`,oe=`__CONFETTI_RADIO_Others`,se=u.optional(u.catchall(u.partial(u.looseObject({userAgent:u.string().check(u.trim(),u.maxLength(1e3)),screenResolution:u.string().check(u.trim(),u.maxLength(100)),viewportSize:u.string().check(u.trim(),u.maxLength(100)),pageUrl:u.string(),pageTitle:u.string().check(u.trim(),u.maxLength(1e3)),referrer:u.string(),datadogTraceId:u.optional(u.string()),datadogSessionId:u.optional(u.string()),datadogSessionReplayLink:u.optional(u.string())})),u.optional(u.string())));u.cuid2();const ce=u.looseObject({type:u.literal([0,1,2,3,4,5,6]),data:u.unknown(),timestamp:u.number(),delay:u.optional(u.number())});u.array(ce);const le=u.array(ce),ue=u.string().check(u.refine(e=>{try{return le.safeParse(JSON.parse(e)).success}catch{return!1}},{error:`Invalid recording events`})),de=u.string().check(u.regex(/^data:image\/(png|jpeg|jpg|webp|gif);base64,[A-Za-z0-9+/]+=*$/,{error:`Invalid image data URL`})),fe=e=>u.object({title:u.string().check(u.trim(),...e?[u.minLength(1,{error:`Title is required`})]:[],u.maxLength(256)),description:u.optional(u.string().check(u.trim(),u.maxLength(4096))),screenshotDataUrl:u.optional(de),recordingEventsJson:u.optional(ue),metadata:se}),pe=fe(!0),me=(e,{required:t})=>fe(t),he=e=>u.number().check(u.int(),u.minimum(1),u.maximum(e)),ge=({scale:e},{required:t})=>{let n=he(e);return t?n:u.optional(n)},_e=({maxLength:e},{required:t})=>u.string().check(u.trim(),...t?[u.minLength(1,{error:`This field is required`})]:[],u.maxLength(e??2048,{error:({maximum:e})=>`Please enter less than ${e} characters`})),ve=(e,t)=>u.string().check(u.trim(),...t?[u.minLength(1,{error:`This field is required`})]:[],u.maxLength(e??1024,{error:({maximum:e})=>`Please enter less than ${e} characters`}),u.refine(e=>e!==oe,{error:`Please fill out the free text field`})),ye=({maxLength:e},{required:t})=>{let n=ve(e,t);return t?n:u.optional(n)},be=({maxSelected:e,maxLength:t},{required:n})=>u.array(u.string().check(u.trim(),...n?[u.minLength(1,{error:`This field is required`})]:[],u.maxLength(t??1024,{error:({maximum:e})=>`Please enter less than ${e} characters`}),u.refine(e=>e!==ae,{error:`Please fill out the free text field`}))).check(...n?[u.minLength(1,{error:`Please select at least one option`})]:[],u.maxLength(e??1024,{error:({maximum:e})=>`Please select less than ${e} options`})),xe=()=>u.optional(u.string()),Se=u.cuid2(),Ce=u.object({title:u.string().check(u.trim()),description:u.string().check(u.trim()),buttonText:u.string().check(u.trim())}),we=u.object({title:u.string(),description:u.nullable(u.string()),questions:u.array(u.object({id:u.string(),title:u.string(),description:u.nullable(u.string()),position:u.number(),required:u.boolean(),properties:ie,routingLogic:S})),confirmation:Ce});u.object({surveyId:Se,responseId:u.union([u.cuid2(),u.uuid()])});const Te=u.catch(u.partial(u.object({type:u.enum([`embedded`,`popover`,`modal`]),version:u.string().check(u.trim(),u.minLength(1),u.maxLength(50)),build:u.string().check(u.trim(),u.minLength(1),u.maxLength(50))})),{});u.object({respondent:u.string().check(u.trim(),u.minLength(1),u.maxLength(2048)),data:u.record(u.string(),u.union([u.string().check(u.trim(),u.maxLength(2048)),u.number(),u.array(u.string().check(u.trim(),u.maxLength(2048))).check(u.maxLength(1024)),pe])),metadata:u.record(u.string().check(u.trim(),u.maxLength(1e3)),u.string().check(u.trim(),u.maxLength(1e3))),telemetry:u.optional(Te)}),u.object({surveyId:Se,respondent:u.string().check(u.trim(),u.minLength(1),u.maxLength(2048))}),u.object({surveyId:Se,respondent:u.string().check(u.trim(),u.minLength(1),u.maxLength(2048))}),u.object({surveyId:Se});const Ee=u.object({lastRespondedAt:u.nullable(u.union([u.iso.datetime(),u.date()])),lastViewedAt:u.nullable(u.union([u.iso.datetime(),u.date()])),lastDismissedAt:u.nullable(u.union([u.iso.datetime(),u.date()]))});u.object({type:u.enum([`view`,`dismiss`])});function De(e){if(typeof window>`u`||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function Oe(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function A(e){let t=null;return()=>(t??=e(),t)}const j=A(function(){return Oe(/^Mac/i)}),ke=A(function(){return Oe(/^iPhone/i)}),Ae=A(function(){return Oe(/^iPad/i)||j()&&navigator.maxTouchPoints>1}),je=A(function(){return ke()||Ae()}),Me=A(function(){return De(/AppleWebKit/i)&&!Ne()}),Ne=A(function(){return De(/Chrome/i)}),Pe=A(function(){return De(/Android/i)}),Fe=A(function(){return De(/Firefox/i)});function M(e){if(Ie())e.focus({preventScroll:!0});else{let t=Le(e);e.focus(),Re(t)}}let N=null;function Ie(){if(N==null){N=!1;try{document.createElement(`div`).focus({get preventScroll(){return N=!0,!0}})}catch{}}return N}function Le(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function Re(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function P(e,t,n=!0){let{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}=t;Fe()&&window.event?.type?.startsWith(`key`)&&e.target===`_blank`&&(j()?r=!0:i=!0);let s=Me()&&j()&&!Ae()?new KeyboardEvent(`keydown`,{keyIdentifier:`Enter`,metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}):new MouseEvent(`click`,{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o,detail:1,bubbles:!0,cancelable:!0});P.isOpening=n,M(e),e.dispatchEvent(s),P.isOpening=!1}P.isOpening=!1;const F=typeof document<`u`?e.useLayoutEffect:()=>{},ze={prefix:String(Math.round(Math.random()*1e10)),current:0},Be=e.createContext(ze),Ve=e.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement;let He=new WeakMap;function Ue(t=!1){let n=i(Be),r=s(null);if(r.current===null&&!t){let t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(t){let e=He.get(t);e==null?He.set(t,{id:n.current,state:t.memoizedState}):t.memoizedState!==e.state&&(n.current=e.id,He.delete(t))}r.current=++n.current}return r.current}function We(e){let t=i(Be),n=Ue(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function Ge(t){let n=e.useId(),[r]=c(Xe()),i=r?`react-aria`:`react-aria${ze.prefix}`;return t||`${i}-${n}`}const Ke=typeof e.useId==`function`?Ge:We;function qe(){return!1}function Je(){return!0}function Ye(e){return()=>{}}function Xe(){return typeof e.useSyncExternalStore==`function`?e.useSyncExternalStore(Ye,qe,Je):i(Ve)}function Ze(e){let[t,n]=c(e),i=s(t),a=s(null),o=s(()=>{if(!a.current)return;let e=a.current.next();if(e.done){a.current=null;return}i.current===e.value?o.current():n(e.value)});return F(()=>{i.current=t,a.current&&o.current()}),[t,r(e=>{a.current=e(i.current),o.current()},[o])]}let Qe=!!(typeof window<`u`&&window.document&&window.document.createElement),I=new Map,L;typeof FinalizationRegistry<`u`&&(L=new FinalizationRegistry(e=>{I.delete(e)}));function $e(e){let[t,n]=c(e),r=s(null),i=Ke(t),o=s(null);if(L&&L.register(o,i),Qe){let e=I.get(i);e&&!e.includes(r)?e.push(r):I.set(i,[r])}return F(()=>{let e=i;return()=>{L&&L.unregister(o),I.delete(e)}},[i]),a(()=>{let e=r.current;return e&&n(e),()=>{e&&(r.current=null)}}),i}function et(e,t){if(e===t)return e;let n=I.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=I.get(t);return r?(r.forEach(t=>t.current=e),e):t}function tt(e=[]){let t=$e(),[n,i]=Ze(t),a=r(()=>{i(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,i]);return F(a,[t,a,...e]),n}function nt(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}const R=e=>e?.ownerDocument??document,z=e=>e&&`window`in e&&e.window===e?e:R(e).defaultView||window;function rt(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function it(e){return rt(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&`host`in e}function B(){return!1}function V(e,t){if(!B())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n=n.tagName===`SLOT`&&n.assignedSlot?n.assignedSlot.parentNode:it(n)?n.host:n.parentNode}return!1}const H=(e=document)=>{if(!B())return e.activeElement;let t=e.activeElement;for(;t&&`shadowRoot`in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function U(e){if(B()&&e.target instanceof Element&&e.target.shadowRoot){if(`composedPath`in e)return e.composedPath()[0]??null;if(`composedPath`in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}function at(e){if(!e)return!1;let t=e.getRootNode(),n=z(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let r=t.activeElement;return r!=null&&e.contains(r)}function W(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1,r=e.map(e=>{let r=ot(e,t);return n||=typeof r==`function`,r});if(n)return()=>{r.forEach((t,n)=>{typeof t==`function`?t():ot(e[n],null)})}}}function ot(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function G(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],i=r[e];typeof n==`function`&&typeof i==`function`&&e[0]===`o`&&e[1]===`n`&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=nt(n,i):(e===`className`||e===`UNSAFE_className`)&&typeof n==`string`&&typeof i==`string`?t[e]=d(n,i):e===`id`&&n&&i?t.id=et(n,i):e===`ref`&&n&&i?t.ref=W(n,i):t[e]=i===void 0?n:i}}return t}const st=new Set([`id`]),ct=new Set([`aria-label`,`aria-labelledby`,`aria-describedby`,`aria-details`]),lt=new Set([`href`,`hrefLang`,`target`,`rel`,`download`,`ping`,`referrerPolicy`]),ut=new Set([`dir`,`lang`,`hidden`,`inert`,`translate`]),dt=new Set(`onClick.onAuxClick.onContextMenu.onDoubleClick.onMouseDown.onMouseEnter.onMouseLeave.onMouseMove.onMouseOut.onMouseOver.onMouseUp.onTouchCancel.onTouchEnd.onTouchMove.onTouchStart.onPointerDown.onPointerMove.onPointerUp.onPointerCancel.onPointerEnter.onPointerLeave.onPointerOver.onPointerOut.onGotPointerCapture.onLostPointerCapture.onScroll.onWheel.onAnimationStart.onAnimationEnd.onAnimationIteration.onTransitionCancel.onTransitionEnd.onTransitionRun.onTransitionStart`.split(`.`)),ft=/^(data-.*)$/;function pt(e,t={}){let{labelable:n,isLink:r,global:i,events:a=i,propNames:o}=t,s={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(st.has(t)||n&&ct.has(t)||r&<.has(t)||i&&ut.has(t)||a&&(dt.has(t)||t.endsWith(`Capture`)&&dt.has(t.slice(0,-7)))||o?.has(t)||ft.test(t))&&(s[t]=e[t]);return s}let K=new Map,mt=new Set;function ht(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=t=>{let r=U(t);if(!e(t)||!r)return;let i=K.get(r);i||(i=new Set,K.set(r,i),r.addEventListener(`transitioncancel`,n,{once:!0})),i.add(t.propertyName)},n=t=>{let r=U(t);if(!e(t)||!r)return;let i=K.get(r);if(i&&(i.delete(t.propertyName),i.size===0&&(r.removeEventListener(`transitioncancel`,n),K.delete(r)),K.size===0)){for(let e of mt)e();mt.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,ht):ht());function gt(){for(let[e]of K)`isConnected`in e&&!e.isConnected&&K.delete(e)}function _t(e){requestAnimationFrame(()=>{gt(),K.size===0?e():mt.add(e)})}function vt(){let e=s(new Map),t=r((t,n,r,i)=>{let a=i?.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:a,options:i}),t.addEventListener(n,a,i)},[]),n=r((t,n,r,i)=>{let a=e.current.get(r)?.fn||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),i=r(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return a(()=>i,[i]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:i}}function yt(e){let t=s(null),n=s(void 0),i=r(t=>{if(typeof e==`function`){let n=e,r=n(t);return()=>{typeof r==`function`?r():n(null)}}else if(e)return e.current=t,()=>{e.current=null}},[e]);return o(()=>({get current(){return t.current},set current(e){t.current=e,n.current&&=(n.current(),void 0),e!=null&&(n.current=i(e))}}),[i])}const bt=e.useInsertionEffect??F;function xt(e){let t=s(null);return bt(()=>{t.current=e},[e]),r((...e)=>{let n=t.current;return n?.(...e)},[])}function St(e,t){F(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function Ct(e){return e.pointerType===``&&e.isTrusted?!0:Pe()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function wt(e){return!Pe()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`}const Tt=typeof Element<`u`&&`checkVisibility`in Element.prototype;function Et(e){let t=z(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!==`none`&&r!==`hidden`&&r!==`collapse`;if(i){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r}=t(e);i=n!==`none`&&r!==`hidden`&&r!==`collapse`}return i}function Dt(e,t){return!e.hasAttribute(`hidden`)&&!e.hasAttribute(`data-react-aria-prevent-focus`)&&(e.nodeName===`DETAILS`&&t&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0)}function Ot(e,t){return Tt?e.checkVisibility({visibilityProperty:!0})&&!e.closest(`[data-react-aria-prevent-focus]`):e.nodeName!==`#comment`&&Et(e)&&Dt(e,t)&&(!e.parentElement||Ot(e.parentElement,e))}const kt=[`input:not([disabled]):not([type=hidden])`,`select:not([disabled])`,`textarea:not([disabled])`,`button:not([disabled])`,`a[href]`,`area[href]`,`summary`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable^="false"])`,`permission`],At=kt.join(`:not([hidden]),`)+`,[tabindex]:not([disabled]):not([hidden])`;kt.push(`[tabindex]:not([tabindex="-1"]):not([disabled])`);const jt=kt.join(`:not([hidden]):not([tabindex="-1"]),`);function Mt(e,t){return e.matches(At)&&!Pt(e)&&(t?.skipVisibilityCheck||Ot(e))}function Nt(e){return e.matches(jt)&&Ot(e)&&!Pt(e)}function Pt(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function Ft(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let It=new WeakMap;function Lt(e){let t=e??(typeof document<`u`?document:void 0);if(!t)return Ft(t);if(It.has(t))return It.get(t);let n=t.querySelector(`meta[property="csp-nonce"]`),r=n&&n instanceof z(n).HTMLMetaElement&&(n.nonce||n.content)||Ft(t)||void 0;return r!==void 0&&It.set(t,r),r}const Rt=Symbol(`default`);function zt({values:t,children:n}){for(let[r,i]of t)n=e.createElement(r.Provider,{value:i},n);return n}function Bt(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:s,values:c,render:l}=e;return o(()=>{let e,o,u;return e=typeof t==`function`?t({...c,defaultClassName:i}):t,o=typeof n==`function`?n({...c,defaultStyle:s||{}}):n,u=typeof r==`function`?r({...c,defaultChildren:a}):r??a,{className:e??i,style:o||s?{...s,...o}:void 0,children:u??a,"data-rac":``,render:l?e=>l(e,c):void 0}},[t,n,r,i,a,s,c,l])}function Vt(e,t){return n=>t(typeof e==`function`?e(n):e,n)}function Ht(e,t){let n=i(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||Rt;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function Ut(e,t,n){let{ref:r,...i}=Ht(n,e.slot)||{},a=yt(o(()=>W(t,r),[t,r])),s=G(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(typeof i.style==`function`||typeof e.style==`function`?s.style=t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:s.style={...i.style,...e.style}),[s,a]}function Wt(e=!0){let[t,n]=c(e),i=s(!1),a=r(e=>{i.current=!0,n(!!e)},[]);return F(()=>{i.current||n(!1)},[]),[a,t]}function Gt(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}function Kt(t,n,r){let{render:i,...a}=n,c=s(null),l=o(()=>W(r,c),[r,c]);F(()=>{},[t,i]);let u={...a,ref:l};return i?i(u,void 0):e.createElement(t,u)}const qt={},Jt=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let r=qt[t];return r||(r=n(Kt.bind(null,t)),qt[t]=r),r}});function Yt(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Xt(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function Zt(e){let t=s({isFocused:!1,observer:null});return F(()=>{let e=t.current;return()=>{e.observer&&=(e.observer.disconnect(),null)}},[]),r(n=>{let r=U(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){t.current.isFocused=!0;let n=r;n.addEventListener(`focusout`,r=>{if(t.current.isFocused=!1,n.disabled){let t=Yt(r);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){t.current.observer?.disconnect();let e=n===H()?null:H();n.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:e})),n.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:e}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:[`disabled`]})}},[e])}let Qt=!1;function $t(e){for(;e&&!Mt(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=z(e),n=t.document.activeElement;if(!n||n===e)return;Qt=!0;let r=!1,i=e=>{(U(e)===n||r)&&e.stopImmediatePropagation()},a=t=>{(U(t)===n||r)&&(t.stopImmediatePropagation(),!e&&!r&&(r=!0,M(n),c()))},o=t=>{(U(t)===e||r)&&t.stopImmediatePropagation()},s=t=>{(U(t)===e||r)&&(t.stopImmediatePropagation(),r||(r=!0,M(n),c()))};t.addEventListener(`blur`,i,!0),t.addEventListener(`focusout`,a,!0),t.addEventListener(`focusin`,s,!0),t.addEventListener(`focus`,o,!0);let c=()=>{cancelAnimationFrame(l),t.removeEventListener(`blur`,i,!0),t.removeEventListener(`focusout`,a,!0),t.removeEventListener(`focusin`,s,!0),t.removeEventListener(`focus`,o,!0),Qt=!1,r=!1},l=requestAnimationFrame(c);return c}let q=`default`,en=``,tn=new WeakMap;function nn(e){if(je()){if(q==="default"){let t=R(e);en=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect=`none`}q=`disabled`}else if(e instanceof HTMLElement||e instanceof SVGElement){let t=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;tn.set(e,e.style[t]),e.style[t]=`none`}}function rn(e){if(je()){if(q!==`disabled`)return;q=`restoring`,setTimeout(()=>{_t(()=>{if(q===`restoring`){let t=R(e);t.documentElement.style.webkitUserSelect===`none`&&(t.documentElement.style.webkitUserSelect=en||``),en=``,q=`default`}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&tn.has(e)){let t=tn.get(e),n=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;e.style[n]===`none`&&(e.style[n]=t),e.getAttribute(`style`)===``&&e.removeAttribute(`style`),tn.delete(e)}}const an=e.createContext({register:()=>{}});an.displayName=`PressResponderContext`;function on(e){let t=i(an);if(t){let{register:n,ref:r,...i}=t;e=G(i,e),n()}return St(t,e.ref),e}var sn=class{#e;constructor(e,t,n,r){this.#e=!0;let i=(r?.target??n.currentTarget)?.getBoundingClientRect(),a,o=0,s,c=null;n.clientX!=null&&n.clientY!=null&&(s=n.clientX,c=n.clientY),i&&(s!=null&&c!=null?(a=s-i.left,o=c-i.top):(a=i.width/2,o=i.height/2)),this.type=e,this.pointerType=t,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=a,this.y=o,this.key=n.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}};const cn=Symbol(`linkClicked`),ln=`react-aria-pressable-style`,un=`data-react-aria-pressable`;function dn(e){let{onPress:t,onPressChange:n,onPressStart:i,onPressEnd:l,onPressUp:u,onClick:d,isDisabled:f,isPressed:p,preventFocusOnPress:m,shouldCancelOnPointerExit:h,allowTextSelectionOnPress:g,ref:_,...v}=on(e),[y,b]=c(!1),x=s({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:S,removeAllGlobalListeners:C}=vt(),w=r((e,t)=>{let r=x.current;if(f||r.didFirePressStart)return!1;let a=!0;if(r.isTriggeringEvent=!0,i){let n=new sn(`pressstart`,t,e);i(n),a=n.shouldStopPropagation}return n&&n(!0),r.isTriggeringEvent=!1,r.didFirePressStart=!0,b(!0),a},[f,i,n]),T=r((e,r,i=!0)=>{let a=x.current;if(!a.didFirePressStart)return!1;a.didFirePressStart=!1,a.isTriggeringEvent=!0;let o=!0;if(l){let t=new sn(`pressend`,r,e);l(t),o=t.shouldStopPropagation}if(n&&n(!1),b(!1),t&&i&&!f){let n=new sn(`press`,r,e);t(n),o&&=n.shouldStopPropagation}return a.isTriggeringEvent=!1,o},[f,l,n,t]),E=xt(T),D=xt(r((e,t)=>{let n=x.current;if(f)return!1;if(u){n.isTriggeringEvent=!0;let r=new sn(`pressup`,t,e);return u(r),n.isTriggeringEvent=!1,r.shouldStopPropagation}return!0},[f,u])),ee=r(e=>{let t=x.current;if(t.isPressed&&t.target){t.didFirePressStart&&t.pointerType!=null&&T(J(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,C(),g||rn(t.target);for(let e of t.disposables)e();t.disposables=[]}},[g,C,T]),O=xt(ee),te=r(e=>{h&&ee(e)},[h,ee]),k=r(e=>{f||d?.(e)},[f,d]),ne=r((e,t)=>{if(!f&&d){let n=new MouseEvent(`click`,e);Xt(n,t),d(Yt(n))}},[f,d]),re=o(()=>{let e=x.current,t={onKeyDown(t){if(pn(t.nativeEvent,t.currentTarget)&&V(t.currentTarget,U(t))){hn(U(t),t.key)&&t.preventDefault();let r=!0;!e.isPressed&&!t.repeat&&(e.target=t.currentTarget,e.isPressed=!0,e.pointerType=`keyboard`,r=w(t,`keyboard`));let i=t.currentTarget;S(R(t.currentTarget),`keyup`,nt(t=>{pn(t,i)&&!t.repeat&&V(i,U(t))&&e.target&&D(J(e.target,t),`keyboard`)},n),!0),r&&t.stopPropagation(),t.metaKey&&j()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else t.key===`Meta`&&(e.metaKeyEvents=new Map)},onClick(t){if(!(t&&!V(t.currentTarget,U(t)))&&t&&t.button===0&&!e.isTriggeringEvent&&!P.isOpening){let n=!0;if(f&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&(e.pointerType===`virtual`||Ct(t.nativeEvent))){let e=w(t,`virtual`),r=D(t,`virtual`),i=E(t,`virtual`);k(t),n=e&&r&&i}else if(e.isPressed&&e.pointerType!==`keyboard`){let r=e.pointerType||t.nativeEvent.pointerType||`virtual`,i=D(J(t.currentTarget,t),r),a=E(J(t.currentTarget,t),r,!0);n=i&&a,e.isOverTarget=!1,k(t),O(t)}e.ignoreEmulatedMouseEvents=!1,n&&t.stopPropagation()}}},n=t=>{if(e.isPressed&&e.target&&pn(t,e.target)){hn(U(t),t.key)&&t.preventDefault();let n=U(t),r=V(e.target,n);E(J(e.target,t),`keyboard`,r),r&&ne(t,e.target),C(),t.key!==`Enter`&&fn(e.target)&&V(e.target,n)&&!t[cn]&&(t[cn]=!0,P(e.target,t,!1)),e.isPressed=!1,e.metaKeyEvents?.delete(t.key)}else if(t.key===`Meta`&&e.metaKeyEvents?.size){let t=e.metaKeyEvents;e.metaKeyEvents=void 0;for(let n of t.values())e.target?.dispatchEvent(new KeyboardEvent(`keyup`,n))}};if(typeof PointerEvent<`u`){t.onPointerDown=t=>{if(t.button!==0||!V(t.currentTarget,U(t)))return;if(wt(t.nativeEvent)){e.pointerType=`virtual`;return}e.pointerType=t.pointerType;let i=!0;if(!e.isPressed){e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=t.pointerId,e.target=t.currentTarget,g||nn(e.target),i=w(t,e.pointerType);let a=U(t);`releasePointerCapture`in a&&(`hasPointerCapture`in a?a.hasPointerCapture(t.pointerId)&&a.releasePointerCapture(t.pointerId):a.releasePointerCapture(t.pointerId)),S(R(t.currentTarget),`pointerup`,n,!1),S(R(t.currentTarget),`pointercancel`,r,!1)}i&&t.stopPropagation()},t.onMouseDown=t=>{if(V(t.currentTarget,U(t))&&t.button===0){if(m){let n=$t(t.target);n&&e.disposables.push(n)}t.stopPropagation()}},t.onPointerUp=t=>{!V(t.currentTarget,U(t))||e.pointerType===`virtual`||t.button===0&&!e.isPressed&&D(t,e.pointerType||t.pointerType)},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!0,w(J(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!1,E(J(e.target,t),e.pointerType,!1),te(t))};let n=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&t.button===0&&e.target){if(V(e.target,U(t))&&e.pointerType!=null){let n=!1,r=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(n?O(t):(M(e.target),e.target.click()))},80);S(t.currentTarget,`click`,()=>n=!0,!0),e.disposables.push(()=>clearTimeout(r))}else O(t);e.isOverTarget=!1}},r=e=>{O(e)};t.onDragStart=e=>{V(e.currentTarget,U(e))&&O(e)}}return t},[S,f,m,C,g,te,w,k,ne]);return a(()=>{if(!_)return;let e=R(_.current);if(!e||!e.head||e.getElementById(ln))return;let t=e.createElement(`style`);t.id=ln;let n=Lt(e);n&&(t.nonce=n),t.textContent=`
|
|
2
|
-
@layer {
|
|
3
|
-
[${un}] {
|
|
4
|
-
touch-action: pan-x pan-y pinch-zoom;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
`.trim(),e.head.prepend(t)},[_]),a(()=>{let e=x.current;return()=>{g||rn(e.target??void 0);for(let t of e.disposables)t();e.disposables=[]}},[g]),{isPressed:p||y,pressProps:G(v,re,{[un]:!0})}}function fn(e){return e.tagName===`A`&&e.hasAttribute(`href`)}function pn(e,t){let{key:n,code:r}=e,i=t,a=i.getAttribute(`role`);return(n===`Enter`||n===` `||n===`Spacebar`||r===`Space`)&&!(i instanceof z(i).HTMLInputElement&&!_n(i,n)||i instanceof z(i).HTMLTextAreaElement||i.isContentEditable)&&!((a===`link`||!a&&fn(i))&&n!==`Enter`)}function J(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r,key:t.key}}function mn(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!==`submit`&&e.type!==`reset`:!fn(e)}function hn(e,t){return e instanceof HTMLInputElement?!_n(e,t):mn(e)}const gn=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function _n(e,t){return e.type===`checkbox`||e.type===`radio`?t===` `:gn.has(e.type)}let Y=null;const vn=new Set;let X=new Map,Z=!1,yn=!1;const bn={Tab:!0,Escape:!0};function xn(e,t){for(let n of vn)n(e,t)}function Sn(e){return!(e.metaKey||!j()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function Cn(e){Z=!0,!P.isOpening&&Sn(e)&&(Y=`keyboard`,xn(`keyboard`,e))}function Q(e){Y=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(Z=!0,xn(`pointer`,e))}function wn(e){!P.isOpening&&Ct(e)&&(Z=!0,Y=`virtual`)}function Tn(e){let t=z(U(e)),n=R(U(e));U(e)===t||U(e)===n||Qt||!e.isTrusted||(!Z&&!yn&&(Y=`virtual`,xn(`virtual`,e)),Z=!1,yn=!1)}function En(){Qt||(Z=!1,yn=!0)}function Dn(e){if(typeof window>`u`||typeof document>`u`)return;let t=z(e),n=R(e);if(X.get(t))return;let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Z=!0,r.apply(this,arguments)},n.addEventListener(`keydown`,Cn,!0),n.addEventListener(`keyup`,Cn,!0),n.addEventListener(`click`,wn,!0),t.addEventListener(`focus`,Tn,!0),t.addEventListener(`blur`,En,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,Q,!0),n.addEventListener(`pointermove`,Q,!0),n.addEventListener(`pointerup`,Q,!0)),t.addEventListener(`beforeunload`,()=>{On(e)},{once:!0}),X.set(t,{focus:r})}const On=(e,t)=>{let n=z(e),r=R(e);t&&r.removeEventListener(`DOMContentLoaded`,t),X.has(n)&&(n.HTMLElement.prototype.focus=X.get(n).focus,r.removeEventListener(`keydown`,Cn,!0),r.removeEventListener(`keyup`,Cn,!0),r.removeEventListener(`click`,wn,!0),n.removeEventListener(`focus`,Tn,!0),n.removeEventListener(`blur`,En,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,Q,!0),r.removeEventListener(`pointermove`,Q,!0),r.removeEventListener(`pointerup`,Q,!0)),X.delete(n))};function kn(e){let t=R(e),n;return t.readyState===`loading`?(n=()=>{Dn(e)},t.addEventListener(`DOMContentLoaded`,n)):Dn(e),()=>On(e,n)}typeof document<`u`&&kn();function An(){return Y!==`pointer`}function jn(){return Y}function Mn(e){Y=e,xn(e,null)}const Nn=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Pn(e,t,n){let r=n?U(n):void 0,i=R(r),a=z(r),o=a===void 0?HTMLInputElement:a.HTMLInputElement,s=a===void 0?HTMLTextAreaElement:a.HTMLTextAreaElement,c=a===void 0?HTMLElement:a.HTMLElement,l=a===void 0?KeyboardEvent:a.KeyboardEvent,u=H(i);return e=e||u instanceof o&&!Nn.has(u.type)||u instanceof s||u instanceof c&&u.isContentEditable,!(e&&t===`keyboard`&&n instanceof l&&!bn[n.key])}function Fn(e,t,n){Dn(),a(()=>{if(n?.enabled===!1)return;let t=(t,r)=>{Pn(!!n?.isTextInput,t,r)&&e(An())};return vn.add(t),()=>{vn.delete(t)}},t)}function In(e){if(!e.isConnected)return;let t=R(e);if(jn()===`virtual`){let n=H(t);_t(()=>{let r=H(t);(r===n||r===t.body)&&e.isConnected&&M(e)})}else M(e)}function Ln(e){let{isDisabled:t,onFocus:n,onBlur:i,onFocusChange:a}=e,o=r(e=>{if(U(e)===e.currentTarget)return i&&i(e),a&&a(!1),!0},[i,a]),s=Zt(o),c=r(e=>{let t=U(e),r=R(t),i=r?H(r):H();t===e.currentTarget&&t===i&&(n&&n(e),a&&a(!0),s(e))},[a,n,s]);return{focusProps:{onFocus:!t&&(n||a||i)?c:void 0,onBlur:!t&&(i||a)?o:void 0}}}function Rn(e){if(!e)return;let t=!0;return n=>{e({...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}}),t&&n.stopPropagation()}}function zn(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:Rn(e.onKeyDown),onKeyUp:Rn(e.onKeyUp)}}}let Bn=e.createContext(null);function Vn(e){let t=i(Bn)||{};St(t,e);let{ref:n,...r}=t;return r}function Hn(e,t){let{focusProps:n}=Ln(e),{keyboardProps:r}=zn(e),i=G(n,r),o=Vn(t),c=e.isDisabled?{}:o,l=s(e.autoFocus);a(()=>{l.current&&t.current&&In(t.current),l.current=!1},[t]);let u=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(u=void 0),{focusableProps:G({...i,tabIndex:u},c)}}function Un(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:i,onFocusWithinChange:a}=e,o=s({isFocusWithin:!1}),{addGlobalListener:c,removeAllGlobalListeners:l}=vt(),u=r(e=>{V(e.currentTarget,U(e))&&o.current.isFocusWithin&&!V(e.currentTarget,e.relatedTarget)&&(o.current.isFocusWithin=!1,l(),n&&n(e),a&&a(!1))},[n,a,o,l]),d=Zt(u),f=r(e=>{if(!V(e.currentTarget,U(e)))return;let t=U(e),n=R(t),r=H(n);if(!o.current.isFocusWithin&&r===t){i&&i(e),a&&a(!0),o.current.isFocusWithin=!0,d(e);let t=e.currentTarget;c(n,`focus`,e=>{let r=U(e);if(o.current.isFocusWithin&&!V(t,r)){let e=new n.defaultView.FocusEvent(`blur`,{relatedTarget:r});Xt(e,t),u(Yt(e))}},{capture:!0})}},[i,a,d,c,u]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:f,onBlur:u}}}function Wn(e={}){let{autoFocus:t=!1,isTextInput:n,within:i}=e,a=s({isFocused:!1,isFocusVisible:t||An()}),[o,l]=c(!1),[u,d]=c(()=>a.current.isFocused&&a.current.isFocusVisible),f=r(()=>d(a.current.isFocused&&a.current.isFocusVisible),[]),p=r(e=>{a.current.isFocused=e,a.current.isFocusVisible=An(),l(e),f()},[f]);Fn(e=>{a.current.isFocusVisible=e,f()},[n,o],{enabled:o,isTextInput:n});let{focusProps:m}=Ln({isDisabled:i,onFocusChange:p}),{focusWithinProps:h}=Un({isDisabled:!i,onFocusWithinChange:p});return{isFocused:o,isFocusVisible:u,focusProps:i?h:m}}let Gn=!1,Kn=0;function qn(){Gn=!0,setTimeout(()=>{Gn=!1},500)}function Jn(e){e.pointerType===`touch`&&qn()}function Yn(){let e=R(null);if(e!==void 0)return Kn===0&&typeof PointerEvent<`u`&&e.addEventListener(`pointerup`,Jn),Kn++,()=>{Kn--,!(Kn>0)&&typeof PointerEvent<`u`&&e.removeEventListener(`pointerup`,Jn)}}function Xn(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[l,u]=c(!1),d=s({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:``,target:null}).current;a(Yn,[]);let{addGlobalListener:f,removeAllGlobalListeners:p}=vt(),{hoverProps:m,triggerHoverEnd:h}=o(()=>{let e=(e,r)=>{if(d.pointerType=r,i||r===`touch`||d.isHovered||!V(e.currentTarget,U(e)))return;d.isHovered=!0;let o=e.currentTarget;d.target=o,f(R(U(e)),`pointerover`,e=>{d.isHovered&&d.target&&!V(d.target,U(e))&&a(e,e.pointerType)},{capture:!0}),t&&t({type:`hoverstart`,target:o,pointerType:r}),n&&n(!0),u(!0)},a=(e,t)=>{let i=d.target;d.pointerType=``,d.target=null,!(t===`touch`||!d.isHovered||!i)&&(d.isHovered=!1,p(),r&&r({type:`hoverend`,target:i,pointerType:t}),n&&n(!1),u(!1))},o={};return typeof PointerEvent<`u`&&(o.onPointerEnter=t=>{Gn&&t.pointerType===`mouse`||e(t,t.pointerType)},o.onPointerLeave=e=>{!i&&V(e.currentTarget,U(e))&&a(e,e.pointerType)}),{hoverProps:o,triggerHoverEnd:a}},[t,n,r,i,d,f,p]);return a(()=>{i&&h({currentTarget:d.target},d.pointerType)},[i]),{hoverProps:m,isHovered:l}}typeof HTMLTemplateElement<`u`&&(Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.content.firstChild}}),Object.defineProperty(HTMLTemplateElement.prototype,"appendChild",{configurable:!0,enumerable:!0,value:function(e){return this.content.appendChild(e)}}),Object.defineProperty(HTMLTemplateElement.prototype,"removeChild",{configurable:!0,enumerable:!0,value:function(e){return this.content.removeChild(e)}}),Object.defineProperty(HTMLTemplateElement.prototype,"insertBefore",{configurable:!0,enumerable:!0,value:function(e,t){return this.content.insertBefore(e,t)}}));const Zn=t(!1);function Qn(e){let t=(t,n)=>i(Zn)?null:e(t,n);return t.displayName=e.displayName||e.name,n(t)}function $n(e,t){let{elementType:n=`button`,isDisabled:r,onPress:i,onPressStart:a,onPressEnd:o,onPressUp:s,onPressChange:c,preventFocusOnPress:l,allowFocusWhenDisabled:u,onClick:d,href:f,target:p,rel:m,type:h=`button`}=e,g;g=n===`button`?{type:h,disabled:r,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:{role:`button`,href:n===`a`&&!r?f:void 0,target:n===`a`?p:void 0,type:n===`input`?h:void 0,disabled:n===`input`?r:void 0,"aria-disabled":!r||n===`input`?void 0:r,rel:n===`a`?m:void 0};let{pressProps:_,isPressed:v}=dn({onPressStart:a,onPressEnd:o,onPressChange:c,onPress:i,onPressUp:s,onClick:d,isDisabled:r,preventFocusOnPress:l,ref:t}),{focusableProps:y}=Hn(e,t);u&&(y.tabIndex=r?-1:y.tabIndex);let b=G(y,_,pt(e,{labelable:!0}));return{isPressed:v,buttonProps:G(g,b,{"aria-haspopup":e[`aria-haspopup`],"aria-expanded":e[`aria-expanded`],"aria-controls":e[`aria-controls`],"aria-pressed":e[`aria-pressed`],"aria-current":e[`aria-current`],"aria-disabled":e[`aria-disabled`]})}}const er=t({}),tr=Qn(function(t,n){[t,n]=Ut(t,n,er);let{elementType:r=`label`,...i}=t,a=Jt[r];return e.createElement(a,{className:`react-aria-Label`,...i,ref:n})}),nr=t(null),rr=7e3;let $=null;function ir(e,t=`assertive`,n=rr){$?$.announce(e,t,n):($=new ar,(typeof IS_REACT_ACT_ENVIRONMENT==`boolean`?IS_REACT_ACT_ENVIRONMENT:typeof jest<`u`)?$.announce(e,t,n):setTimeout(()=>{$?.isAttached()&&$?.announce(e,t,n)},100))}var ar=class{isAttached(){return this.node?.isConnected}createLog(e){let t=document.createElement(`div`);return t.setAttribute(`role`,`log`),t.setAttribute(`aria-live`,e),t.setAttribute(`aria-relevant`,`additions`),t}destroy(){this.node&&=(document.body.removeChild(this.node),null)}announce(e,t=`assertive`,n=rr){var r,i;if(!this.node)return;let a=document.createElement(`div`);typeof e==`object`?(a.setAttribute(`role`,`img`),a.setAttribute(`aria-labelledby`,e[`aria-labelledby`])):a.textContent=e,t===`assertive`?(r=this.assertiveLog)==null||r.appendChild(a):(i=this.politeLog)==null||i.appendChild(a),e!==``&&setTimeout(()=>{a.remove()},n)}clear(e){this.node&&((!e||e===`assertive`)&&this.assertiveLog&&(this.assertiveLog.innerHTML=``),(!e||e===`polite`)&&this.politeLog&&(this.politeLog.innerHTML=``))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<`u`&&(this.node=document.createElement(`div`),this.node.dataset.liveAnnouncer=`true`,Object.assign(this.node.style,{border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`}),this.assertiveLog=this.createLog(`assertive`),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog(`polite`),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}};const or=t({}),sr=Qn(function(t,n){[t,n]=Ut(t,n,or);let r=t,{isPending:i}=r,{buttonProps:o,isPressed:c}=$n(t,n);o=lr(o,i);let{focusProps:l,isFocused:u,isFocusVisible:d}=Wn(t),{hoverProps:f,isHovered:p}=Xn({...t,isDisabled:t.isDisabled||i}),m={isHovered:p,isPressed:(r.isPressed||c)&&!i,isFocused:u,isFocusVisible:d,isDisabled:t.isDisabled||!1,isPending:i??!1},h=Bt({...t,values:m,defaultClassName:`react-aria-Button`}),g=$e(o.id),_=$e(),v=o[`aria-labelledby`];i&&(v?v=`${v} ${_}`:o[`aria-label`]&&(v=`${g} ${_}`));let y=s(i);a(()=>{let e={"aria-labelledby":v||g};(!y.current&&u&&i||y.current&&u&&!i)&&ir(e,`assertive`),y.current=i},[i,u,v,g]);let b=pt(t,{global:!0});return delete b.onClick,e.createElement(Jt.button,{...G(b,h,o,l,f),type:o.type===`submit`&&i?`button`:o.type,id:g,ref:n,"aria-labelledby":v,slot:t.slot||void 0,"aria-disabled":i?`true`:o[`aria-disabled`],"data-disabled":t.isDisabled||void 0,"data-pressed":m.isPressed||void 0,"data-hovered":p||void 0,"data-focused":u||void 0,"data-pending":i||void 0,"data-focus-visible":d||void 0},e.createElement(nr.Provider,{value:{id:_}},h.children))}),cr=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function lr(e,t){if(t){for(let t in e)t.startsWith(`on`)&&!cr.test(t)&&(e[t]=void 0);e.href=void 0,e.target=void 0}return e}export{ye as $,G as A,tt as B,Ht as C,xt as D,Nt as E,U as F,Pe as G,Xe as H,B as I,we as J,je as K,R as L,V as M,at as N,yt as O,H as P,ge as Q,z as R,Gt as S,Mt as T,F as U,$e as V,Ne as W,be as X,me as Y,_e as Z,Bt as _,Qn as a,Rt as b,Un as c,jn as d,xe as et,Mn as f,Ut as g,zt as h,tr as i,p as it,W as j,pt as k,Hn as l,an as m,sr as n,oe as nt,Xn as o,dn as p,Ee as q,er as r,C as rt,Wn as s,or as t,ae as tt,In as u,Wt as v,Lt as w,Jt as x,Vt as y,nt as z};
|
package/build/Embed-J5cfWjpk.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,i as t,o as n,r}from"./DefaultConfettiTrigger-DFJBQ35H.js";import{$ as i,A as a,B as o,C as s,D as c,F as l,O as u,Q as d,R as f,S as p,U as m,V as h,X as g,Y as _,Z as v,_ as y,a as b,c as x,et as S,f as C,g as w,h as T,i as E,it as D,j as O,k,l as A,n as j,o as ee,p as M,r as te,rt as ne,s as re,tt as ie,v as ae,x as N,y as oe}from"./Button-giwEer5K.js";import{d as se,f as ce,h as le,i as ue,l as de,m as fe,p as pe,r as me,s as he,u as ge}from"./ModalContainer-B-WGlRn4.js";import{a as _e,n as ve,o as ye,r as be,t as xe}from"./internals-B5GhpjgM.js";import P,{Suspense as Se,createContext as F,forwardRef as I,lazy as Ce,useCallback as L,useContext as R,useEffect as z,useMemo as B,useRef as V,useState as H}from"react";import{useTimeout as we}from"usehooks-ts";import{Fragment as U,jsx as W,jsxs as G}from"react/jsx-runtime";import K from"clsx";import"react-dom";function Te(e,t,n){let r=c(e=>{n&&!e.defaultPrevented&&n(t)});z(()=>{let t=e?.current?.form;return t?.addEventListener(`reset`,r),()=>{t?.removeEventListener(`reset`,r)}},[e])}function Ee(e){let{id:t,label:n,"aria-labelledby":r,"aria-label":i,labelElementType:a=`label`}=e;t=h(t);let o=h(),s={};n&&(r=r?`${o} ${r}`:o,s={id:o,htmlFor:a===`label`?t:void 0});let c=pe({id:t,"aria-label":i,"aria-labelledby":r});return{labelProps:s,fieldProps:c}}function De(e){let{description:t,errorMessage:n,isInvalid:r,validationState:i}=e,{labelProps:s,fieldProps:c}=Ee(e),l=o([!!t,!!n,r,i]),u=o([!!t,!!n,r,i]);return c=a(c,{"aria-describedby":[l,u,e[`aria-describedby`]].filter(Boolean).join(` `)||void 0}),{labelProps:s,fieldProps:c,descriptionProps:{id:l},errorMessageProps:{id:u}}}function Oe(e,t,n){let{validationBehavior:r,focus:i}=e;m(()=>{if(r===`native`&&n?.current&&!n.current.disabled){let e=t.realtimeValidation.isInvalid?t.realtimeValidation.validationErrors.join(` `)||`Invalid value.`:``;n.current.setCustomValidity(e),n.current.hasAttribute(`title`)||(n.current.title=``),t.realtimeValidation.isInvalid||t.updateValidation(Ae(n.current))}});let a=V(!1),o=c(()=>{a.current||t.resetValidation()}),s=c(e=>{t.displayValidation.isInvalid||t.commitValidation();let r=n?.current?.form;!e.defaultPrevented&&n&&r&&je(r)===n.current&&(i?i():n.current?.focus(),C(`keyboard`)),e.preventDefault()}),u=c(()=>{t.commitValidation()});z(()=>{let e=n?.current;if(!e)return;let t=e.form,r=t?.reset;return t&&(t.reset=()=>{a.current=!window.event||window.event.type===`message`&&l(window.event)instanceof MessagePort,r?.call(t),a.current=!1}),e.addEventListener(`invalid`,s),e.addEventListener(`change`,u),t?.addEventListener(`reset`,o),()=>{e.removeEventListener(`invalid`,s),e.removeEventListener(`change`,u),t?.removeEventListener(`reset`,o),t&&(t.reset=r)}},[n,r])}function ke(e){let t=e.validity;return{badInput:t.badInput,customError:t.customError,patternMismatch:t.patternMismatch,rangeOverflow:t.rangeOverflow,rangeUnderflow:t.rangeUnderflow,stepMismatch:t.stepMismatch,tooLong:t.tooLong,tooShort:t.tooShort,typeMismatch:t.typeMismatch,valueMissing:t.valueMissing,valid:t.valid}}function Ae(e){return{isInvalid:!e.validity.valid,validationDetails:ke(e),validationErrors:e.validationMessage?[e.validationMessage]:[]}}function je(e){for(let t=0;t<e.elements.length;t++){let n=e.elements[t];if(n.validity?.valid===!1)return n}return null}const Me={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},Ne={...Me,customError:!0,valid:!1},q={isInvalid:!1,validationDetails:Me,validationErrors:[]},Pe=F({}),Fe=`__reactAriaFormValidationState`;function J(e){if(e.__reactAriaFormValidationState){let{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}=e[Fe];return{realtimeValidation:t,displayValidation:n,updateValidation:r,resetValidation:i,commitValidation:a}}return Ie(e)}function Ie(e){let{isInvalid:t,validationState:n,name:r,value:i,builtinValidation:a,validate:o,validationBehavior:s=`aria`}=e;n&&(t||=n===`invalid`);let c=t===void 0?null:{isInvalid:t,validationErrors:[],validationDetails:Ne},l=B(()=>!o||i==null?null:ze(Re(o,i)),[o,i]);a?.validationDetails.valid&&(a=void 0);let u=R(Pe),d=B(()=>r?Array.isArray(r)?r.flatMap(e=>Le(u[e])):Le(u[r]):[],[u,r]),[f,p]=H(u),[m,h]=H(!1);u!==f&&(p(u),h(!1));let g=B(()=>ze(m?[]:d),[m,d]),_=V(q),[v,y]=H(q),b=V(q),x=()=>{if(!S)return;C(!1);let e=l||a||_.current;Be(e,b.current)||(b.current=e,y(e))},[S,C]=H(!1);return z(x),{realtimeValidation:c||g||l||a||q,displayValidation:s===`native`?c||g||v:c||g||l||a||v,updateValidation(e){s===`aria`&&!Be(v,e)?y(e):_.current=e},resetValidation(){let e=q;Be(e,b.current)||(b.current=e,y(e)),s===`native`&&C(!1),h(!0)},commitValidation(){s===`native`&&C(!0),h(!0)}}}function Le(e){return e?Array.isArray(e)?e:[e]:[]}function Re(e,t){if(typeof e==`function`){let n=e(t);if(n&&typeof n!=`boolean`)return Le(n)}return[]}function ze(e){return e.length?{isInvalid:!0,validationErrors:e,validationDetails:Ne}:null}function Be(e,t){return e===t?!0:!!e&&!!t&&e.isInvalid===t.isInvalid&&e.validationErrors.length===t.validationErrors.length&&e.validationErrors.every((e,n)=>e===t.validationErrors[n])&&Object.entries(e.validationDetails).every(([e,n])=>t.validationDetails[e]===n)}function Ve(...e){let t=new Set,n=!1,r={...Me};for(let i of e){for(let e of i.validationErrors)t.add(e);n||=i.isInvalid;for(let e in r)r[e]||=i.validationDetails[e]}return r.valid=!n,{isInvalid:n,validationErrors:[...t],validationDetails:r}}function He(e,t){let{inputElementType:n=`input`,isDisabled:r=!1,isRequired:i=!1,isReadOnly:o=!1,type:s=`text`,validationBehavior:c=`aria`}=e,[u,d]=ge(e.value,e.defaultValue||``,e.onChange),{focusableProps:f}=A(e,t),p=J({...e,value:u}),{isInvalid:m,validationErrors:h,validationDetails:g}=p.displayValidation,{labelProps:_,fieldProps:v,descriptionProps:y,errorMessageProps:b}=De({...e,isInvalid:m,errorMessage:e.errorMessage||h}),x=k(e,{labelable:!0}),S={type:s,pattern:e.pattern},[C]=H(u);return Te(t,e.defaultValue??C,d),Oe(e,p,t),{labelProps:_,inputProps:a(x,n===`input`?S:void 0,{disabled:r,readOnly:o,required:i&&c===`native`,"aria-required":i&&c===`aria`||void 0,"aria-invalid":m||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-activedescendant":e[`aria-activedescendant`],"aria-autocomplete":e[`aria-autocomplete`],"aria-haspopup":e[`aria-haspopup`],"aria-controls":e[`aria-controls`],value:u,onChange:e=>d(l(e).value),autoComplete:e.autoComplete,autoCapitalize:e.autoCapitalize,maxLength:e.maxLength,minLength:e.minLength,name:e.name,form:e.form,placeholder:e.placeholder,inputMode:e.inputMode,autoCorrect:e.autoCorrect,spellCheck:e.spellCheck,[parseInt(P.version,10)>=17?`enterKeyHint`:`enterkeyhint`]:e.enterKeyHint,onCopy:e.onCopy,onCut:e.onCut,onPaste:e.onPaste,onCompositionEnd:e.onCompositionEnd,onCompositionStart:e.onCompositionStart,onCompositionUpdate:e.onCompositionUpdate,onSelect:e.onSelect,onBeforeInput:e.onBeforeInput,onInput:e.onInput,...f,...v}),descriptionProps:y,errorMessageProps:b,isInvalid:m,validationErrors:h,validationDetails:g}}function Ue(e,t,n){let{isDisabled:r=!1,isReadOnly:i=!1,value:o,name:s,form:c,children:u,"aria-label":d,"aria-labelledby":f,validationState:p=`valid`,isInvalid:m,onPressStart:h,onPressEnd:g,onPressChange:_,onPress:v,onPressUp:y,onClick:b}=e,x=e=>{e.stopPropagation(),t.setSelected(l(e).checked)},{pressProps:S,isPressed:C}=M({onPressStart:h,onPressEnd:g,onPressChange:_,onPress:v,onPressUp:y,onClick:b,isDisabled:r}),{pressProps:w,isPressed:T}=M({onPressStart:h,onPressEnd:g,onPressChange:_,onPressUp:y,onClick:b,onPress(e){v?.(e),t.toggle(),n.current?.focus()},isDisabled:r||i}),{focusableProps:E}=A(e,n),D=a(S,E),O=k(e,{labelable:!0});return Te(n,t.defaultSelected,t.setSelected),{labelProps:a(w,{onClick:e=>e.preventDefault()}),inputProps:a(O,{"aria-invalid":m||p===`invalid`||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-controls":e[`aria-controls`],"aria-readonly":i||void 0,onChange:x,disabled:r,...o==null?{}:{value:o},name:s,form:c,type:`checkbox`,...D}),isSelected:t.isSelected,isPressed:C||T,isDisabled:r,isReadOnly:i,isInvalid:m||p===`invalid`}}function We(e,t,n){let r=J({...e,value:t.isSelected}),{isInvalid:i,validationErrors:o,validationDetails:s}=r.displayValidation,{labelProps:c,inputProps:l,isSelected:u,isPressed:d,isDisabled:f,isReadOnly:p}=Ue({...e,isInvalid:i},t,n);Oe(e,r,n);let{isIndeterminate:m,isRequired:h,validationBehavior:g=`aria`}=e;z(()=>{n.current&&(n.current.indeterminate=!!m)});let{pressProps:_}=M({isDisabled:f||p,onPress(){let{[Fe]:t}=e,{commitValidation:n}=t||r;n()}});return{labelProps:a(c,_,B(()=>({onMouseDown:e=>e.preventDefault()}),[])),inputProps:{...l,checked:u,"aria-required":h&&g===`aria`||void 0,required:h&&g===`native`},isSelected:u,isPressed:d,isDisabled:f,isReadOnly:p,isInvalid:i,validationErrors:o,validationDetails:s}}const Ge=new WeakMap;function Ke(e,t){let{isDisabled:n,name:r,form:i,validationBehavior:o=`aria`}=e,{isInvalid:s,validationErrors:c,validationDetails:l}=t.displayValidation,{labelProps:u,fieldProps:d,descriptionProps:f,errorMessageProps:p}=De({...e,labelElementType:`span`,isInvalid:s,errorMessage:e.errorMessage||c});Ge.set(t,{name:r,form:i,descriptionId:f.id,errorMessageId:p.id,validationBehavior:o});let m=k(e,{labelable:!0}),{focusWithinProps:h}=x({onBlurWithin:e.onBlur,onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange});return{groupProps:a(m,{role:`group`,"aria-disabled":n||void 0,...d,...h}),labelProps:u,descriptionProps:f,errorMessageProps:p,isInvalid:s,validationErrors:c,validationDetails:l}}function qe(e={}){let{isReadOnly:t}=e,[n,r]=ge(e.isSelected,e.defaultSelected||!1,e.onChange),[i]=H(n);function a(e){t||r(e)}function o(){t||r(!n)}return{isSelected:n,defaultSelected:e.defaultSelected??i,setSelected:a,toggle:o}}function Je(e,t,n){let r=qe({isReadOnly:e.isReadOnly||t.isReadOnly,isSelected:t.isSelected(e.value),defaultSelected:t.defaultValue.includes(e.value),onChange(n){n?t.addValue(e.value):t.removeValue(e.value),e.onChange&&e.onChange(n)}}),{name:i,form:a,descriptionId:o,errorMessageId:s,validationBehavior:c}=Ge.get(t);c=e.validationBehavior??c;let{realtimeValidation:l}=J({...e,value:r.isSelected,name:void 0,validationBehavior:`aria`}),u=V(q),d=()=>{t.setInvalid(e.value,l.isInvalid?l:u.current)};z(d);let f=t.realtimeValidation.isInvalid?t.realtimeValidation:l,p=c===`native`?t.displayValidation:f,m=We({...e,isReadOnly:e.isReadOnly||t.isReadOnly,isDisabled:e.isDisabled||t.isDisabled,name:e.name||i,form:e.form||a,isRequired:e.isRequired??t.isRequired,validationBehavior:c,[Fe]:{realtimeValidation:f,displayValidation:p,resetValidation:t.resetValidation,commitValidation:t.commitValidation,updateValidation(e){u.current=e,d()}}},r,n);return{...m,inputProps:{...m.inputProps,"aria-describedby":[e[`aria-describedby`],t.isInvalid?s:null,o].filter(Boolean).join(` `)||void 0}}}const Ye=new WeakMap;function Xe(e,t,n){let{value:r,children:i,"aria-label":o,"aria-labelledby":s,onPressStart:c,onPressEnd:l,onPressChange:u,onPress:d,onPressUp:f,onClick:p}=e,m=e.isDisabled||t.isDisabled,h=t.selectedValue===r,g=e=>{e.stopPropagation(),t.setSelectedValue(r)},{pressProps:_,isPressed:v}=M({onPressStart:c,onPressEnd:l,onPressChange:u,onPress:d,onPressUp:f,onClick:p,isDisabled:m}),{pressProps:y,isPressed:b}=M({onPressStart:c,onPressEnd:l,onPressChange:u,onPressUp:f,onClick:p,isDisabled:m,onPress(e){d?.(e),t.setSelectedValue(r),n.current?.focus()}}),{focusableProps:x}=A(a(e,{onFocus:()=>t.setLastFocusedValue(r)}),n),S=a(_,x),C=k(e,{labelable:!0}),w=-1;t.selectedValue==null?(t.lastFocusedValue===r||t.lastFocusedValue==null)&&(w=0):t.selectedValue===r&&(w=0),m&&(w=void 0);let{name:T,form:E,descriptionId:D,errorMessageId:O,validationBehavior:j}=Ye.get(t);return Te(n,t.defaultSelectedValue,t.setSelectedValue),Oe({validationBehavior:j},t,n),{labelProps:a(y,B(()=>({onClick:e=>e.preventDefault(),onMouseDown:e=>e.preventDefault()}),[])),inputProps:a(C,{...S,type:`radio`,name:T,form:E,tabIndex:w,disabled:m,required:t.isRequired&&j===`native`,checked:h,value:r,onChange:g,"aria-describedby":[e[`aria-describedby`],t.isInvalid?O:null,D].filter(Boolean).join(` `)||void 0}),isDisabled:m,isSelected:h,isPressed:v||b}}function Ze(e,t){let{name:n,form:r,isReadOnly:i,isRequired:o,isDisabled:s,orientation:c=`vertical`,validationBehavior:u=`aria`}=e,{direction:d}=ce(),{isInvalid:p,validationErrors:m,validationDetails:g}=t.displayValidation,{labelProps:_,fieldProps:v,descriptionProps:y,errorMessageProps:b}=De({...e,labelElementType:`span`,isInvalid:t.isInvalid,errorMessage:e.errorMessage||m}),S=k(e,{labelable:!0}),{focusWithinProps:C}=x({onBlurWithin(n){e.onBlur?.(n),t.selectedValue||t.setLastFocusedValue(null)},onFocusWithin:e.onFocus,onFocusWithinChange:e.onFocusChange}),w=e=>{let n;switch(e.key){case`ArrowRight`:n=d===`rtl`&&c!==`vertical`?`prev`:`next`;break;case`ArrowLeft`:n=d===`rtl`&&c!==`vertical`?`next`:`prev`;break;case`ArrowDown`:n=`next`;break;case`ArrowUp`:n=`prev`;break;default:return}e.preventDefault();let r=se(e.currentTarget,{from:l(e),accept:e=>e instanceof f(e).HTMLInputElement&&e.type===`radio`}),i;n===`next`?(i=r.nextNode(),i||=(r.currentNode=e.currentTarget,r.firstChild())):(i=r.previousNode(),i||=(r.currentNode=e.currentTarget,r.lastChild())),i&&(i.focus(),t.setSelectedValue(i.value))},T=h(n);return Ye.set(t,{name:T,form:r,descriptionId:y.id,errorMessageId:b.id,validationBehavior:u}),{radioGroupProps:a(S,{role:`radiogroup`,onKeyDown:w,"aria-invalid":t.isInvalid||void 0,"aria-errormessage":e[`aria-errormessage`],"aria-readonly":i||void 0,"aria-required":o||void 0,"aria-disabled":s||void 0,"aria-orientation":c,...v,...C}),labelProps:_,descriptionProps:y,errorMessageProps:b,isInvalid:p,validationErrors:m,validationDetails:g}}const Qe=F({}),Y=I(function(e,t){[e,t]=w(e,t,Qe);let{elementType:n=`span`,...r}=e,i=N[n];return P.createElement(i,{className:`react-aria-Text`,...r,ref:t})});function $e(e={}){let[t,n]=ge(e.value,e.defaultValue||[],e.onChange),[r]=H(t),i=!!e.isRequired&&t.length===0,a=V(new Map),o=J({...e,value:t}),s=o.displayValidation.isInvalid;return{...o,value:t,defaultValue:e.defaultValue??r,setValue(t){e.isReadOnly||e.isDisabled||n(t)},isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isSelected(e){return t.includes(e)},addValue(t){e.isReadOnly||e.isDisabled||n(e=>e.includes(t)?e:e.concat(t))},removeValue(r){e.isReadOnly||e.isDisabled||t.includes(r)&&n(t.filter(e=>e!==r))},toggleValue(r){e.isReadOnly||e.isDisabled||(t.includes(r)?n(t.filter(e=>e!==r)):n(t.concat(r)))},setInvalid(e,t){let n=new Map(a.current);t.isInvalid?n.set(e,t):n.delete(e),a.current=n,o.updateValidation(Ve(...n.values()))},validationState:e.validationState??(s?`invalid`:null),isInvalid:s,isRequired:i}}let et=Math.round(Math.random()*1e10),tt=0;function nt(e){let t=B(()=>e.name||`radio-group-${et}-${++tt}`,[e.name]),[n,r]=ge(e.value,e.defaultValue??null,e.onChange),[i]=H(n),[a,o]=H(null),s=J({...e,value:n}),c=t=>{!e.isReadOnly&&!e.isDisabled&&(r(t),s.commitValidation())},l=s.displayValidation.isInvalid;return{...s,name:t,selectedValue:n,defaultSelectedValue:e.value===void 0?e.defaultValue??null:i,setSelectedValue:c,lastFocusedValue:a,setLastFocusedValue:o,isDisabled:e.isDisabled||!1,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1,validationState:e.validationState||(l?`invalid`:null),isInvalid:l}}const X=F(null),Z=I(function(e,t){return R(X)?.isInvalid?P.createElement(rt,{...e,ref:t}):null}),rt=I((e,t)=>{let n=R(X),r=k(e,{global:!0}),i=y({...e,defaultClassName:`react-aria-FieldError`,defaultChildren:n.validationErrors.length===0?void 0:n.validationErrors.join(` `),values:n});return i.children==null?null:P.createElement(Y,{slot:`errorMessage`,...r,...i,ref:t})}),Q=F(null),it=F(null),at=F(null),ot=I(function(e,t){[e,t]=w(e,t,it);let{validationBehavior:n}=s(Q)||{},r=e.validationBehavior??n??`native`,i=$e({...e,validationBehavior:r}),[o,c]=ae(!e[`aria-label`]&&!e[`aria-labelledby`]),{groupProps:l,labelProps:u,descriptionProps:d,errorMessageProps:f,...p}=Ke({...e,label:c,validationBehavior:r},i),m=y({...e,values:{isDisabled:i.isDisabled,isReadOnly:i.isReadOnly,isRequired:e.isRequired||!1,isInvalid:i.isInvalid,state:i},defaultClassName:`react-aria-CheckboxGroup`}),h=k(e,{global:!0});return P.createElement(N.div,{...a(h,m,l),ref:t,slot:e.slot||void 0,"data-readonly":i.isReadOnly||void 0,"data-required":e.isRequired||void 0,"data-invalid":i.isInvalid||void 0,"data-disabled":e.isDisabled||void 0},P.createElement(T,{values:[[at,i],[te,{...u,ref:o,elementType:`span`}],[Qe,{slots:{description:d,errorMessage:f}}],[X,p]]},m.children))}),st=I(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=w(r,t,le);let{validationBehavior:i}=s(Q)||{},o=e.validationBehavior??i??`native`,c=R(at),l=u(B(()=>O(n,e.inputRef===void 0?null:e.inputRef),[n,e.inputRef])),{labelProps:d,inputProps:f,isSelected:m,isDisabled:h,isReadOnly:g,isPressed:_,isInvalid:v}=c?Je({...p(e),value:e.value,children:typeof e.children==`function`?!0:e.children},c,l):We({...p(e),children:typeof e.children==`function`?!0:e.children,validationBehavior:o},qe(e),l),{isFocused:b,isFocusVisible:x,focusProps:S}=re(),C=h||g,{hoverProps:T,isHovered:E}=ee({...e,isDisabled:C}),D=y({...e,defaultClassName:`react-aria-Checkbox`,values:{isSelected:m,isIndeterminate:e.isIndeterminate||!1,isPressed:_,isHovered:E,isFocused:b,isFocusVisible:x,isDisabled:h,isReadOnly:g,isInvalid:v,isRequired:e.isRequired||!1}}),A=k(e,{global:!0});return delete A.id,delete A.onClick,P.createElement(N.label,{...a(A,d,T,D),ref:t,slot:e.slot||void 0,"data-selected":m||void 0,"data-indeterminate":e.isIndeterminate||void 0,"data-pressed":_||void 0,"data-hovered":E||void 0,"data-focused":b||void 0,"data-focus-visible":x||void 0,"data-disabled":h||void 0,"data-readonly":g||void 0,"data-invalid":v||void 0,"data-required":e.isRequired||void 0},P.createElement(de,{elementType:`span`},P.createElement(`input`,{...a(f,S),ref:l})),D.children)}),ct=F({}),lt=F({});let ut=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i};const dt=b(function(e,t){[e,t]=w(e,t,lt);let{hoverProps:n,isHovered:r}=ee({...e,isDisabled:e.disabled}),{isFocused:i,isFocusVisible:o,focusProps:s}=re({isTextInput:!0,autoFocus:e.autoFocus}),c=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,l=y({...e,values:{isHovered:r,isFocused:i,isFocusVisible:o,isDisabled:e.disabled||!1,isInvalid:c},defaultClassName:`react-aria-Input`});return P.createElement(N.input,{...a(ut(e),s,n),...l,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":o||void 0,"data-invalid":c||void 0})}),ft=F(null);function pt(e){let t=V({});return P.createElement(ft.Provider,{value:t},e.children)}const mt=F({isSelected:!1}),ht=F(null),gt=F(null),_t=F(null),vt=I(function(e,t){[e,t]=w(e,t,ht);let{validationBehavior:n}=s(Q)||{},r=e.validationBehavior??n??`native`,i=nt({...e,validationBehavior:r}),[o,c]=ae(!e[`aria-label`]&&!e[`aria-labelledby`]),{radioGroupProps:l,labelProps:u,descriptionProps:d,errorMessageProps:f,...p}=Ze({...e,label:c,validationBehavior:r},i),m=y({...e,values:{orientation:e.orientation||`vertical`,isDisabled:i.isDisabled,isReadOnly:i.isReadOnly,isRequired:i.isRequired,isInvalid:i.isInvalid,state:i},defaultClassName:`react-aria-RadioGroup`}),h=k(e,{global:!0});return P.createElement(N.div,{...a(h,m,l),ref:t,slot:e.slot||void 0,"data-orientation":e.orientation||`vertical`,"data-invalid":i.isInvalid||void 0,"data-disabled":i.isDisabled||void 0,"data-readonly":i.isReadOnly||void 0,"data-required":i.isRequired||void 0},P.createElement(T,{values:[[_t,i],[te,{...u,ref:o,elementType:`span`}],[Qe,{slots:{description:d,errorMessage:f}}],[X,p]]},P.createElement(pt,null,m.children)))}),yt=I(function(e,t){let{inputRef:n=null,...r}=e;[e,t]=w(r,t,gt);let i=P.useContext(_t),o=u(B(()=>O(n,e.inputRef===void 0?null:e.inputRef),[n,e.inputRef])),{labelProps:s,inputProps:c,isSelected:l,isDisabled:d,isPressed:f}=Xe({...p(e),children:typeof e.children==`function`?!0:e.children},i,o),{isFocused:m,isFocusVisible:h,focusProps:g}=re(),_=d||i.isReadOnly,{hoverProps:v,isHovered:b}=ee({...e,isDisabled:_}),x=y({...e,defaultClassName:`react-aria-Radio`,values:{isSelected:l,isPressed:f,isHovered:b,isFocused:m,isFocusVisible:h,isDisabled:d,isReadOnly:i.isReadOnly,isInvalid:i.isInvalid,isRequired:i.isRequired}}),S=k(e,{global:!0});return delete S.id,delete S.onClick,P.createElement(N.label,{...a(S,s,v,x),ref:t,"data-selected":l||void 0,"data-pressed":f||void 0,"data-hovered":b||void 0,"data-focused":m||void 0,"data-focus-visible":h||void 0,"data-disabled":d||void 0,"data-readonly":i.isReadOnly||void 0,"data-invalid":i.isInvalid||void 0,"data-required":i.isRequired||void 0},P.createElement(de,{elementType:`span`},P.createElement(`input`,{...a(c,g),ref:o})),P.createElement(mt.Provider,{value:{isSelected:l}},x.children))}),bt=F({});let xt=e=>{let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,...i}=e;return i};const St=I(function(e,t){[e,t]=w(e,t,bt);let{hoverProps:n,isHovered:r}=ee(e),{isFocused:i,isFocusVisible:o,focusProps:s}=re({isTextInput:!0,autoFocus:e.autoFocus}),c=!!e[`aria-invalid`]&&e[`aria-invalid`]!==`false`,l=y({...e,values:{isHovered:r,isFocused:i,isFocusVisible:o,isDisabled:e.disabled||!1,isInvalid:c},defaultClassName:`react-aria-TextArea`});return P.createElement(N.textarea,{...a(xt(e),s,n),...l,ref:t,"data-focused":i||void 0,"data-disabled":e.disabled||void 0,"data-hovered":r||void 0,"data-focus-visible":o||void 0,"data-invalid":c||void 0})}),Ct=F(null),wt=b(function(e,t){[e,t]=w(e,t,Ct);let{validationBehavior:n}=s(Q)||{},r=e.validationBehavior??n??`native`,i=V(null);[e,i]=w(e,i,fe);let[a,o]=ae(!e[`aria-label`]&&!e[`aria-labelledby`]),[c,l]=H(`input`),{labelProps:u,inputProps:d,descriptionProps:f,errorMessageProps:m,...h}=He({...p(e),inputElementType:c,label:o,validationBehavior:r},i),g=L(e=>{i.current=e,e&&l(e instanceof HTMLTextAreaElement?`textarea`:`input`)},[i]),_=y({...e,values:{isDisabled:e.isDisabled||!1,isInvalid:h.isInvalid,isReadOnly:e.isReadOnly||!1,isRequired:e.isRequired||!1},defaultClassName:`react-aria-TextField`}),v=k(e,{global:!0});return delete v.id,P.createElement(N.div,{...v,..._,ref:t,slot:e.slot||void 0,"data-disabled":e.isDisabled||void 0,"data-invalid":h.isInvalid||void 0,"data-readonly":e.isReadOnly||void 0,"data-required":e.isRequired||void 0},P.createElement(T,{values:[[te,{...u,ref:a}],[lt,{...d,ref:g}],[bt,{...d,ref:g}],[ct,{role:`presentation`,isInvalid:h.isInvalid,isDisabled:e.isDisabled||!1}],[Qe,{slots:{description:f,errorMessage:m}}],[X,h]]},_.children))});function Tt(e){return e.issues[0]?.message??`Invalid input`}const $={rating:({scale:e},t)=>d({scale:e},t),"open-ended":({max:e},t)=>v({maxLength:e},t),"single-select":({editable:e},t)=>i({maxLength:e?.max},t),"multi-select":({editable:e,max:t},n)=>g({maxLength:e?.max,maxSelected:t},n),statement:(e,t)=>S(),"bug-report":(e,t)=>_({},t)},Et=(e,t)=>{let n=e.type;switch(n){case`rating`:{let r=$[n];return r(e,t)}case`open-ended`:{let r=$[n];return r(e,t)}case`single-select`:{let r=$[n];return r(e,t)}case`multi-select`:{let r=$[n];return r(e,t)}case`statement`:{let r=$[n];return r(e,t)}case`bug-report`:{let r=$[n];return r(e,t)}default:throw Error(`Unsupported question type`)}},Dt=({originalQuestions:e,answers:t,errors:n,pointer:r=-1})=>{if(!e)return{questions:[],currentIndex:-1};let i=e.sort((e,t)=>e.position-t.position).map(e=>{let t={...e},r=n[e.id];return r&&(t.error=r),{...t,visible:!1}});for(let e=0;e<i.length;e++){let n=i[e];if(!n)continue;let a=ye({index:e,questions:i,answers:t});n.visible=r===e||a}let a=i.findIndex((e,n)=>n>r&&e.visible&&t[e.id]===void 0);return a===-1&&(a=i.findLastIndex(e=>!!e.visible)),{questions:i,currentIndex:a}},Ot=({questions:e,answers:t})=>{let n=kt({questions:e,answers:t});return Object.fromEntries(Object.entries(n).filter(([,e])=>e!==null))},kt=({questions:e,answers:t})=>Object.fromEntries(Object.entries(t).filter(([t])=>!!e.find(e=>e.id===t)?.visible)),At=({questions:e,errors:t})=>Object.fromEntries(Object.entries(t).filter(([t])=>!!e.find(e=>e.id===t)?.visible)),jt=({current:e,shouldAutoSubmit:t,onSubmitted:n,onFinished:r,children:i})=>{let{survey:a,submit:o}=he(),[s,c]=H({}),[l,u]=H({}),d=B(()=>Dt({originalQuestions:a?.questions,answers:s,errors:l,pointer:e}),[a?.questions,s,l,e]),f=B(()=>!!d.questions.filter(({required:e,visible:t})=>!!e&&!!t).every(({id:e})=>s[e]!==void 0),[s,d.questions]),[p,m]=H(!1),h=L(({answers:e})=>{o({answers:e}).finally(()=>{r?.()})},[r,o]),g=L(()=>{h({answers:Ot({questions:d.questions,answers:s})}),m(!0),n?.()},[s,d.questions,h,n]),_=L(({question:r,answer:i})=>{let o=d.questions.at(r);if(!o)return{error:`Question index is invalid`};let f=Et(o.properties,{required:o.required}).safeParse(i);if(!f.success){let e=Tt(f.error);return u(t=>{if(t[o.id]===e)return t;let n={...t};return n[o.id]=e,n}),c(e=>{if(!(o.id in e))return e;let t={...e};return delete t[o.id],t}),{error:e}}u(e=>{if(!e[o.id])return e;let t={...e};return delete t[o.id],t});let p=!o.required&&!i?null:i,g={...s};if(g[o.id]===p)return{next:Dt({originalQuestions:a?.questions,answers:g,errors:l,pointer:e}).currentIndex};g[o.id]=p;let _=Dt({originalQuestions:a?.questions,answers:g,errors:l,pointer:e});return g=kt({questions:_.questions,answers:g}),c(g),u(At({questions:_.questions,errors:l})),_.questions.filter(({visible:e})=>!!e).every(({id:e})=>g[e]!==void 0)&&t&&(h({answers:Ot({questions:_.questions,answers:g})}),m(!0),n?.()),{next:_.currentIndex}},[d.questions,s,a?.questions,l,t,e,h,n]);return d.questions.length===0?W(U,{}):W(`div`,{className:`confetti ${xe}`,children:i({questions:d.questions,current:e??d.currentIndex,update:_,isCompleted:f,submit:g,isSubmitted:p,errors:l})})},Mt=F(null);function Nt({children:i,surveyId:a,publishableKey:o,apiBaseUrl:s,respondent:c,isSurveyVisible:l}){let u=e({surveyId:a,override:c}),d=D({publishableKey:o,apiBaseUrl:s}),{isAvailable:f,isSettled:p}=r({client:d,surveyId:a}),{state:m,isSettled:h}=t({client:d,surveyId:a,respondent:u}),g=B(()=>({respondent:u}),[u]);return!u||!p||!h||!f||!n(m,l)?null:W(Mt.Provider,{value:g,children:i})}function Pt(e){return R(Mt)?W(U,{children:e.children}):W(Nt,{...e})}function Ft(){let e=R(Mt);if(!e)throw Error(`useRespondentVisibility must be used within a RespondentVisibilityProvider`);return e}const It=({children:e,classNames:t,containerProps:n,onDismiss:r,onClose:i,closeOnFinishMs:a=3e3})=>{let{surveyId:o,survey:s,dismiss:c}=he(),[l,u]=H(!1),[d,f]=H(!1),[p,m]=H(!1),[h,g]=H(!1);return we(()=>{s&&i?.()},d&&!(p||h)?a:null),G(`div`,{className:K(`confetti-dialog ${xe}`,t?.dialog),id:`${o}-popover`,...n,onMouseEnter:e=>{n?.onMouseEnter?.(e),m(!0)},onMouseLeave:e=>{n?.onMouseLeave?.(e),m(!1)},onFocusCapture:e=>{n?.onFocusCapture?.(e),g(!0)},onBlurCapture:e=>{n?.onBlurCapture?.(e),e.currentTarget.contains(e.relatedTarget)||g(!1)},children:[W(me,{className:K(`confetti-dialog-close`,t?.closeButton),iconClassName:t?.icon,onClose:async()=>{l||(await c(),r?.()),i?.()}}),typeof e==`function`?e({setIsSubmitted:()=>u(!0),setIsFinished:()=>f(!0)}):e]})},Lt=3e4,Rt=({maskAllInputs:e}={})=>{let[t,n]=H(null),[r,i]=H(!1),[a,o]=H(null),[s,c]=H(30),l=V(null),u=V(null),d=V(null),f=V([]);z(()=>{let e=new CustomEvent(be,{detail:{isRecording:r}});document.dispatchEvent(e)},[r]);let p=L(()=>{u.current&&=(clearInterval(u.current),null),d.current&&=(clearTimeout(d.current),null),l.current=null,c(Lt/1e3)},[]),m=L(()=>{l.current?.(),p(),i(!1),n(JSON.stringify(f.current))},[p]);return{recordingEventsJson:t,isRecording:r,recordingError:a,remainingSeconds:s,startRecording:L(async()=>{i(!0),o(null),n(null),f.current=[];try{let{record:t}=await import(`./record-BZwNFiEW.js`);l.current=t({slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0},sampling:{mousemove:50,scroll:100,input:`last`},emit:e=>{f.current.push(e)},blockClass:`cfti-block`,maskTextClass:`cfti-mask`,maskAllInputs:e})??null;let n=Lt/1e3;c(n),u.current=setInterval(()=>{--n,c(n)},1e3),d.current=setTimeout(()=>{m()},Lt)}catch{o(`Failed to start recording. Please try again.`),i(!1),p()}},[e,m,p]),stopRecording:m,clear:L(()=>{p(),i(!1),n(null),o(null),f.current=[]},[p])}},zt=e=>e.replace(/\S/g,`*`),Bt=e=>`*`.repeat(e.length),Vt=(e,t)=>{for(let n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE?t(n):Vt(n,t)},Ht=e=>{if(e instanceof HTMLInputElement)e.setAttribute(`value`,Bt(e.getAttribute(`value`)??``));else if(e instanceof HTMLTextAreaElement)e.textContent=Bt(e.textContent);else if(e instanceof HTMLSelectElement)for(let t of e.querySelectorAll(`option`))t.textContent=Bt(t.textContent)},Ut=({maskInputs:e})=>({name:`cfti-redact`,afterClone:t=>{let{clone:n}=t;if(n instanceof HTMLElement){for(let e of n.querySelectorAll(`.${ve}`)){Vt(e,e=>{e.data=zt(e.data)}),Ht(e);for(let t of e.querySelectorAll(`input, textarea, select`))Ht(t)}if(e)for(let e of n.querySelectorAll(`input, textarea, select`))Ht(e)}}}),Wt=({maskAllInputs:e}={})=>{let[t,n]=H(null),[r,i]=H(!1),[a,o]=H(null);return{screenshotDataUrl:t,isCapturing:r,captureError:a,capture:L(async()=>{i(!0),o(null);try{let{snapdom:t}=await import(`./snapdom-BQZEILL6.js`),r=await(await t(document.documentElement,{embedFonts:!0,exclude:[`.${xe}`],excludeMode:`hide`,plugins:[Ut({maskInputs:!!e})],fast:!1})).toCanvas(),i=window.devicePixelRatio||1,a=Math.min(Math.round(window.innerWidth*i),r.width),o=Math.min(Math.round(window.innerHeight*i),r.height),s=document.createElement(`canvas`);s.width=a,s.height=o;let c=s.getContext(`2d`);if(!c)throw Error(`Failed to get 2D context for cropping`);c.drawImage(r,0,0,a,o,0,0,a,o),n(s.toDataURL(`image/png`))}catch{o(`Failed to capture screenshot. Please try again.`)}finally{i(!1)}},[e]),clear:L(()=>{n(null),o(null)},[])}},Gt=e=>G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[W(`circle`,{cx:`12`,cy:`12`,r:`10`}),W(`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`})]}),Kt=e=>G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,...e,children:[W(`path`,{d:`M10 11v6`}),W(`path`,{d:`M14 11v6`}),W(`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}),W(`path`,{d:`M3 6h18`}),W(`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`})]});function qt(){if(window.DD_RUM&&typeof window.DD_RUM?.getInternalContext==`function`&&typeof window.DD_RUM?.getSessionReplayLink==`function`)try{let e=window.DD_RUM?.getInternalContext?.(),t=window.DD_RUM?.getSessionReplayLink?.();return{sessionId:e?.session_id,sessionReplayLink:t}}catch{return null}return null}function Jt(){if(typeof window>`u`||typeof navigator>`u`)return;let e=navigator,t=window.screen,n=qt();return{userAgent:e.userAgent,screenResolution:`${t.width}x${t.height}`,viewportSize:`${window.innerWidth}x${window.innerHeight}`,pageUrl:window.location.href,pageTitle:document.title,referrer:document.referrer,language:e.language,timestamp:new Date().toISOString(),datadogTraceId:n?.traceId,datadogSessionId:n?.sessionId,datadogSessionReplayLink:n?.sessionReplayLink}}const Yt=Ce(()=>import(`./RecordingReplayer-BvU_CHwb.js`)),Xt=({id:e,title:t,description:n,properties:r,onChange:i,required:a,error:o,classNames:s,maskAllInputs:c})=>{let l=B(()=>Jt(),[]),[u,d]=H(``),[f,p]=H(``),{screenshotDataUrl:m,isCapturing:h,captureError:g,capture:_,clear:v}=Wt({maskAllInputs:c}),{recordingEventsJson:y,isRecording:b,recordingError:x,remainingSeconds:S,startRecording:C,stopRecording:w,clear:T}=Rt({maskAllInputs:c}),D=B(()=>({title:u,...f?{description:f}:{},...m?{screenshotDataUrl:m}:{},...y?{recordingEventsJson:y}:{},metadata:l}),[f,l,y,m,u]);z(()=>{i(D)},[D,i]),z(()=>()=>{w()},[w]);let O=B(()=>y?JSON.parse(y):[],[y]);return W(U,{children:b?G(j,{className:K(`cf-bug-report-button`,`cf-bug-report-record-button`,s?.button,s?.recordButton),onPress:w,children:[W(Gt,{}),G(`span`,{children:[30-S,`s /`,` `,30,`s`]})]}):G(`div`,{className:K(`cf-bug-report`,s?.base),children:[G(wt,{isRequired:a,isInvalid:!!o,name:`${e}-title`,value:u,onChange:d,className:K(`cf-question`,s?.question),children:[G(`div`,{className:K(`cf-header`,s?.header),children:[G(E,{className:K(`cf-title`,s?.title),children:[t,!a&&G(`span`,{className:K(`cf-label-optional`,s?.optionalLabel),children:[` `,`(optional)`]})]}),n&&W(Y,{slot:`description`,className:K(`cf-description`,s?.description),children:n})]}),W(dt,{placeholder:r.placeholder||`Brief description of the issue`,className:K(`cf-input`,s?.input)})]}),G(wt,{name:`${e}-description`,value:f,onChange:p,className:K(`cf-question`,s?.question),children:[W(E,{className:K(`cf-title`,s?.title),children:r.detailsLabel}),W(St,{placeholder:r.detailsPlaceholder||`Steps to reproduce, expected vs actual behavior, etc.`,className:K(`cf-textarea`,s?.textArea),rows:4})]}),r.enableScreenshot||r.enableRecording?G(`section`,{className:K(`cf-question`,s?.question),children:[W(E,{className:K(`cf-title`,s?.title),children:`Attachments`}),G(`div`,{className:K(`cf-bug-report-actions`,s?.actions),children:[r.enableScreenshot&&G(`div`,{className:K(`cf-bug-report-screenshot-section`,s?.screenshotSection),children:[m?G(`div`,{className:K(`cf-bug-report-media-preview`,s?.mediaPreview),children:[W(`img`,{src:m,alt:`Screenshot preview`,className:K(`cf-bug-report-screenshot-img`,s?.screenshotImg)}),W(`div`,{className:K(`cf-bug-report-media-actions`,s?.mediaActions),children:W(j,{className:K(`cf-bug-report-button`,`cf-bug-report-button-action`,s?.button,s?.buttonAction),onPress:v,"aria-label":`Remove screenshot`,children:W(Kt,{})})})]}):W(j,{className:K(`cf-bug-report-button`,s?.button),onPress:_,isDisabled:h,children:h?`Capturing...`:`Screenshot`}),g&&W(`div`,{className:K(`cf-error`,s?.error),children:g})]}),r.enableRecording&&G(`div`,{className:K(`cf-bug-report-recording-section`,s?.recordingSection),children:[O.length>0?G(`div`,{className:K(`cf-bug-report-media-preview`,s?.mediaPreview),children:[W(Se,{fallback:W(`span`,{className:K(`cf-bug-report-player-loading`,s?.playerLoading),"aria-label":`Loading recording preview...`}),children:W(Yt,{events:O})}),W(`div`,{className:K(`cf-bug-report-media-actions`,s?.mediaActions),children:W(j,{className:K(`cf-bug-report-button`,`cf-bug-report-button-action`,s?.button,s?.buttonAction),onPress:T,"aria-label":`Remove recording`,children:W(Kt,{})})})]}):W(j,{className:K(`cf-bug-report-button`,s?.button),onPress:C,children:`Record`}),x&&W(`div`,{className:K(`cf-error`,s?.error),children:x})]})]})]}):null,W(Z,{className:K(`cf-error`,s?.error),children:o})]})})},Zt=({id:e,title:t,description:n,properties:r,onChange:i,classNames:a,required:o,error:s})=>{let[c,l]=H(``);return z(()=>{i(c)},[i,c]),G(wt,{isRequired:o,isInvalid:!!s,name:e,className:K(`cf-question`,a?.question),value:c,onChange:e=>{l(e),i(e)},children:[G(`div`,{className:K(`cf-header`,a?.header),children:[G(E,{className:K(`cf-title`,a?.title),children:[t,!o&&G(`span`,{className:K(`cf-label-optional`,a?.optionalLabel),children:[` `,`(optional)`]})]}),n&&W(Y,{slot:`description`,className:K(`cf-description`,a?.description),children:n})]}),W(St,{className:K(`cf-textarea`,a?.textarea),maxLength:r.max,rows:4,placeholder:r.placeholder||`Start typing...`}),W(Z,{className:K(`cf-error`,a?.error),children:s})]})},Qt=({children:e,classNames:t,description:n,...r})=>W(st,{...r,children:({isIndeterminate:r})=>G(U,{children:[G(`div`,{className:K(`cf-choice-label`,t?.label),children:[W(`div`,{className:K(`cf-checkbox-indicator`,t?.indicator),children:W(`svg`,{viewBox:`0 0 18 18`,"aria-hidden":`true`,className:K(`cf-checkbox-indicator-svg`,t?.svg),children:r?W(`rect`,{x:1,y:7.5,width:16,height:3}):W(`polyline`,{points:`2 9 7 14 16 4`})},r?`indeterminate`:`check`)}),e]}),n&&W(`span`,{className:K(`cf-choice-description`,t?.choiceDescription),children:n})]})}),$t=({children:e,classNames:t,...n})=>W(st,{...n,children:W(`div`,{className:K(`cf-tag-label`,t?.tagLabel),children:e})}),en=({title:e,description:t,properties:n,classNames:r,onChange:i,id:a,required:o,error:s})=>{let c=!!n.editable,l=n.display??`checkbox`,[u,d]=H([]),[f,p]=H(``),m=V(null),h=V(null),g=B(()=>{let e=u.indexOf(ie);if(e===-1)return u;let t=[...u];return t[e]=f||`__CONFETTI_CHECKBOX_Others`,t},[f,u]),_=l===`tag`;return z(()=>{i(g)},[i,g]),W(ot,{isRequired:o,isInvalid:!!s,name:a,value:u,onChange:d,className:K(`cf-question`,r?.question),children:({state:i})=>G(U,{children:[G(`div`,{className:K(`cf-header`,r?.header),children:[G(E,{className:K(`cf-title`,r?.title),children:[e,!o&&G(`span`,{className:K(`cf-label-optional`,r?.optionalLabel),children:[` `,`(optional)`]})]}),t&&W(Y,{slot:`description`,className:K(`cf-description`,r?.description),children:t})]}),G(`div`,{className:K(`cf-response-choices`,l===`tag`&&`cf-response-choices-tag`,r?.group),children:[n.options.map((e,t)=>W(_?$t:Qt,{className:K(`cf-choice`,_&&[`cf-tag`,r?.tag],!_&&[`cf-checkbox`,r?.checkbox]),description:e.description,value:e.value,classNames:{tag:r?.tag,tagLabel:r?.tagLabel,choiceDescription:r?.choiceDescription,label:r?.label,indicator:r?.indicator,svg:r?.svg},children:e.value},t)),c&&(_?G(U,{children:[W($t,{inputRef:m,onChange:e=>{h.current&&e&&requestAnimationFrame(()=>{h.current&&h.current.focus()})},className:K(`cf-choice cf-tag`,r?.tag),value:`__CONFETTI_CHECKBOX_Others`,children:n.editable?.label}),W(dt,{"data-visible":i.value.includes(`__CONFETTI_CHECKBOX_Others`)||void 0,value:f,onChange:e=>{p(e.target.value)},ref:h,className:K(`cf-input cf-tag-input`,r?.othersInput)})]}):G(`div`,{className:K(`cf-choice cf-others-choice`,r?.othersChoice),children:[W(Qt,{inputRef:m,onChange:e=>{h.current&&e&&requestAnimationFrame(()=>{h.current&&h.current.focus()})},className:K(`cf-checkbox`,r?.checkbox),value:`__CONFETTI_CHECKBOX_Others`,classNames:{indicator:r?.indicator,svg:r?.svg},description:n.editable?.description,children:n.editable?.label}),W(dt,{value:f,onChange:e=>{p(e.target.value)},tabIndex:i.value.includes(`__CONFETTI_CHECKBOX_Others`)?0:-1,ref:h,onFocus:()=>{m.current?.checked===!1&&m.current.click()},className:K(`cf-input`,r?.othersInput)})]}))]}),W(Z,{className:K(`cf-error`,r?.error),children:s})]})})},tn=e=>G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[W(`circle`,{cx:12,cy:12,r:10}),W(`path`,{d:`M16 16s-1.5-2-4-2-4 2-4 2M7.5 8 10 9M14 9l2.5-1M9 10h.01M15 10h.01`})]}),nn=e=>G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[W(`circle`,{cx:12,cy:12,r:10}),W(`path`,{d:`M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12ZM9 9h.01M15 9h.01`})]}),rn=e=>G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[W(`circle`,{cx:12,cy:12,r:10}),W(`path`,{d:`M16 16s-1.5-2-4-2-4 2-4 2M9 9h.01M15 9h.01`})]}),an=e=>G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[W(`circle`,{cx:12,cy:12,r:10}),W(`path`,{d:`M8 15h8M9 9h.01M15 9h.01`})]}),on=e=>G(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,...e,children:[W(`circle`,{cx:12,cy:12,r:10}),W(`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2M9 9h.01M15 9h.01`})]}),sn=e=>W(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:40,height:40,fill:`none`,...e,children:W(`path`,{fill:`currentColor`,d:`m6.516 14.323-1.49 6.452a.998.998 0 0 0 1.529 1.057L12 18.202l5.445 3.63a1.001 1.001 0 0 0 1.517-1.106l-1.829-6.4 4.536-4.082a1 1 0 0 0-.59-1.74l-5.701-.454-2.467-5.461a.998.998 0 0 0-1.822 0L8.622 8.05l-5.701.453a1 1 0 0 0-.619 1.713l4.214 4.107zm2.853-4.326a.998.998 0 0 0 .832-.586L12 5.43l1.799 3.981a.998.998 0 0 0 .832.586l3.972.315-3.271 2.944c-.284.256-.397.65-.293 1.018l1.253 4.385-3.736-2.491a.995.995 0 0 0-1.109 0l-3.904 2.603 1.05-4.546a1 1 0 0 0-.276-.94l-3.038-2.962 4.09-.326z`})}),cn=e=>W(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:40,height:40,viewBox:`0 0 24 24`,...e,children:W(`path`,{fill:`currentColor`,d:`M21.947 9.179a1.001 1.001 0 0 0-.868-.676l-5.701-.453-2.467-5.461a.998.998 0 0 0-1.822-.001L8.622 8.05l-5.701.453a1 1 0 0 0-.619 1.713l4.213 4.107-1.49 6.452a1 1 0 0 0 1.53 1.057L12 18.202l5.445 3.63a1.001 1.001 0 0 0 1.517-1.106l-1.829-6.4 4.536-4.082c.297-.268.406-.686.278-1.065z`})}),ln=({state:e,properties:t,classNames:n})=>{let r=e.selectedValue?Number(e.selectedValue):null;return W(`div`,{className:K(`cf-rating-display-star`,n?.ratingDisplayStar),children:Array.from({length:t.scale},(e,t)=>{let i=t+1,a=String(i),o=r&&i<=r;return W(yt,{className:K(`cf-rating-star`,n?.ratingStar),value:a,"data-filled":o?`true`:void 0,children:W(o?cn:sn,{})},t)})})},un=({properties:e,classNames:t})=>W(`div`,{className:K(`cf-rating-display-number`,t?.ratingDisplayNumber),children:Array.from({length:e.scale},(e,n)=>{let r=n+1,i=String(r);return W(yt,{className:K(`cf-rating-number`,t?.ratingNumber),value:i,children:r},n)})}),dn=({properties:e,classNames:t,state:n})=>{let r=B(()=>[tn,rn,an,on,nn],[]),i=B(()=>[rn,an,on],[]);return B(()=>e.scale===3||e.scale===5,[e.scale])?W(`div`,{className:K(`cf-rating-display-emoji`,t?.ratingDisplayEmoji),children:Array.from({length:e.scale},(n,a)=>{let o=a+1,s=String(o),c=e.scale===5?r[a]:i[a];return W(yt,{className:K(`cf-rating-emoji`,t?.ratingEmoji),value:s,children:c&&W(c,{})},a)})}):W(un,{properties:e,classNames:t,state:n})},fn=e=>{switch(e.properties.display??`star`){case`emoji`:return W(dn,{...e});case`number`:return W(un,{...e});case`star`:return W(ln,{...e})}},pn=({properties:e,title:t,description:n,classNames:r,onChange:i,id:a,error:o,required:s})=>{let[c,l]=H(null),u=B(()=>c?Number(c):void 0,[c]);return z(()=>{i(u)},[i,u]),W(vt,{isRequired:s,isInvalid:!!o,name:a,className:K(`cf-question`,r?.question),value:c,onChange:l,children:({state:i})=>G(U,{children:[G(`div`,{className:K(`cf-header`,r?.header),children:[G(E,{className:K(`cf-title`,r?.title),children:[t,!s&&G(`span`,{className:K(`cf-label-optional`,r?.optionalLabel),children:[` `,`(optional)`]})]}),n&&W(Y,{slot:`description`,className:K(`cf-description`,r?.description),children:n})]}),G(`div`,{className:K(`cf-rating-section`,r?.ratingSection),children:[W(fn,{state:i,properties:e,classNames:r}),G(`div`,{className:K(`cf-rating-text`,r?.ratingText),children:[W(`span`,{className:K(`cf-rating-text-lower`,r?.ratingTextLower),children:e.labels?.lower}),W(`span`,{className:K(`cf-rating-text-upper`,r?.ratingTextUpper),children:e.labels?.upper})]})]}),W(Z,{className:K(`cf-error`,r?.error),children:o})]})})},mn=({classNames:e,className:t,description:n,...r})=>W(yt,{...r,className:K(t,e?.radio),children:oe(r.children,t=>G(U,{children:[G(`div`,{className:K(`cf-choice-label`,e?.label),children:[W(`div`,{className:K(`cf-radio-indicator`,e?.indicator)}),t]}),n&&W(`span`,{className:K(`cf-choice-description`,e?.choiceDescription),children:n})]}))}),hn=({title:e,description:t,properties:n,classNames:r,onChange:i,id:a,required:o,error:s})=>{let[c,l]=H(null),[u,d]=H(``),f=!!n.editable,p=V(null),m=V(null),h=B(()=>c===`__CONFETTI_RADIO_Others`?u||`__CONFETTI_RADIO_Others`:c??void 0,[u,c]);return z(()=>{i(h)},[i,h]),W(vt,{isRequired:o,isInvalid:!!s,name:a,onChange:e=>{l(e),e===`__CONFETTI_RADIO_Others`&&requestAnimationFrame(()=>{m.current&&m.current.focus()})},value:c,className:K(`cf-question`,r?.question),children:({state:i})=>G(U,{children:[G(`div`,{className:K(`cf-header`,r?.header),children:[G(E,{className:K(`cf-title`,r?.title),children:[e,!o&&G(`span`,{className:K(`cf-label-optional`,r?.optionalLabel),children:[` `,`(optional)`]})]}),t&&W(Y,{slot:`description`,className:K(`cf-description`,r?.description),children:t})]}),G(`div`,{className:K(`cf-response-choices`,r?.group),children:[n.options.map((e,t)=>W(mn,{classNames:{indicator:r?.indicator,radio:K(`cf-choice cf-radio`,r?.radio)},value:e.value,description:e.description,children:e.value},t)),f&&G(`div`,{className:K(`cf-choice cf-others-choice`,r?.othersChoice),children:[W(mn,{inputRef:p,value:`__CONFETTI_RADIO_Others`,classNames:{indicator:r?.indicator,radio:K(`cf-radio`,r?.radio)},description:n.editable?.description,children:n.editable?.label}),W(dt,{tabIndex:i.selectedValue===`__CONFETTI_RADIO_Others`?0:-1,ref:m,value:u,onChange:e=>d(e.target.value),onFocus:()=>{p.current?.checked===!1&&p.current.click()},className:K(`cf-input`,r?.othersInput)})]})]}),W(Z,{className:K(`cf-error`,r?.error),children:s})]})})},gn=({properties:e,title:t,description:n,classNames:r})=>W(`div`,{className:K(`cf-question`,r?.question),children:G(`div`,{className:K(`cf-header`,r?.header),children:[t&&W(`div`,{className:K(`cf-title`,r?.title),children:t}),n&&W(`div`,{className:K(`cf-description`,r?.description),children:n})]})}),_n=({question:e,onChange:t,error:n,maskAllInputs:r})=>{switch(e.properties.type){case`rating`:return W(pn,{...e,properties:e.properties,onChange:t,error:n},e.id);case`open-ended`:return W(Zt,{...e,properties:e.properties,onChange:t,error:n},e.id);case`single-select`:return W(hn,{...e,properties:e.properties,onChange:t,error:n},e.id);case`multi-select`:return W(en,{...e,properties:e.properties,onChange:t,error:n},e.id);case`statement`:return W(gn,{...e,properties:e.properties,onChange:t,error:n},e.id);case`bug-report`:return W(Xt,{...e,properties:e.properties,onChange:t,error:n,maskAllInputs:r},e.id)}return W(`div`,{children:`Unsupported question type`},e.id)},vn=({title:e,description:t,classNames:n,onClose:r})=>{let{survey:i}=he();if(!i)return null;let a=t||i.confirmation.description;return G(U,{children:[W(`div`,{className:K(`cf-question`,n?.question),children:G(`div`,{className:K(`cf-header`,n?.header),children:[W(E,{className:K(`cf-title`,n?.title),children:e||i.confirmation.title||`Feedback submitted!`}),a&&W(Y,{slot:`description`,className:K(`cf-description`,n?.description),children:a})]})}),W(j,{className:`cf-submit-button`,onPress:()=>{r?.()},children:i.confirmation.buttonText||`Close`})]})},yn=({onPress:e,isDisabled:t,children:n=`Submit`})=>ue()?null:W(j,{isDisabled:t,className:`cf-submit-button`,onPress:e,children:n}),bn=e=>{switch(e){case`multi-select`:return[];case`bug-report`:return{title:``};case`statement`:return;default:return``}},xn=e=>e!==void 0&&e!==``&&!(Array.isArray(e)&&e.length===0),Sn=({onSubmit:e,children:t,question:n,isLastQuestion:r})=>{let[i,a]=H(bn(n.properties.type)),o=B(()=>Et(n.properties,{required:n.required}),[n.properties,n.required]),s=B(()=>{let e=o.safeParse(i);if(!e.success)return Tt(e.error)},[i,o]),c=B(()=>{let e=n.routingLogic;if(e.type!==`always`&&!xn(i)&&n.required)return!0;let t=e.type===`always`?e.target:e.cases.find(e=>_e({answer:i,condition:e}))?.target??e.default;return t.type===`end`?!1:t.type===`next`?!r:!0},[i,r,n.required,n.routingLogic]),l=B(()=>n.properties.buttonLabel?n.properties.buttonLabel:c?!n.required&&!xn(i)?`Skip`:`Next`:`Submit`,[i,c,n.properties.buttonLabel,n.required]),u=L(()=>{switch(n.properties.type){case`statement`:if(n.properties.buttonUrl&&typeof window<`u`){let e=ne.safeParse(n.properties.buttonUrl).data;e&&window.open(e,`_blank`)}return e(void 0);default:return e(i)}},[i,e,n.properties]),d=B(()=>{switch(n.properties.type){case`rating`:case`single-select`:return!!n.properties.shouldAutoProgress;default:return!1}},[n.properties]);return G(U,{children:[t({onChange:L(t=>{a(t),d&&xn(t)&&o.safeParse(t).success&&e(t)},[d,o,e]),question:n,error:s}),(!d||!n.required)&&W(yn,{isDisabled:!!s,onPress:u,children:l})]})},Cn=({isCompleted:e,onSubmit:t,children:n})=>G(U,{children:[n,e&&W(yn,{onPress:t})]});export{gn as a,en as c,Mt as d,Pt as f,_n as i,Zt as l,jt as m,Sn as n,hn as o,Ft as p,vn as r,pn as s,Cn as t,It as u};
|