@mulmochat-plugin/form 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,354 @@
1
+ //#region src/core/definition.ts
2
+ var e = "presentForm", t = {
3
+ type: "function",
4
+ name: e,
5
+ description: "Create a structured form to collect information from the user. Supports various field types including text input, textarea, multiple choice (radio), dropdown menus, checkboxes, date/time pickers, and number inputs. Each field can have validation rules and help text.",
6
+ parameters: {
7
+ type: "object",
8
+ properties: {
9
+ title: {
10
+ type: "string",
11
+ description: "Optional title for the form (e.g., 'User Registration')"
12
+ },
13
+ description: {
14
+ type: "string",
15
+ description: "Optional description explaining the purpose of the form"
16
+ },
17
+ fields: {
18
+ type: "array",
19
+ description: "Array of form fields with various types and configurations",
20
+ items: {
21
+ type: "object",
22
+ properties: {
23
+ id: {
24
+ type: "string",
25
+ description: "Unique identifier for the field (e.g., 'email', 'birthdate'). This will be the key in the JSON response. Use descriptive camelCase or snake_case names."
26
+ },
27
+ type: {
28
+ type: "string",
29
+ enum: [
30
+ "text",
31
+ "textarea",
32
+ "radio",
33
+ "dropdown",
34
+ "checkbox",
35
+ "date",
36
+ "time",
37
+ "number"
38
+ ],
39
+ description: "Field type: 'text' for short text, 'textarea' for long text, 'radio' for 2-6 choices, 'dropdown' for many choices, 'checkbox' for multiple selections, 'date' for date picker, 'time' for time picker, 'number' for numeric input"
40
+ },
41
+ label: {
42
+ type: "string",
43
+ description: "Field label shown to the user"
44
+ },
45
+ description: {
46
+ type: "string",
47
+ description: "Optional help text explaining the field"
48
+ },
49
+ required: {
50
+ type: "boolean",
51
+ description: "Whether the field is required (default: false)"
52
+ },
53
+ placeholder: {
54
+ type: "string",
55
+ description: "Placeholder text for text/textarea fields"
56
+ },
57
+ validation: {
58
+ type: "string",
59
+ description: "For text fields: 'email', 'url', 'phone', or a regex pattern"
60
+ },
61
+ minLength: {
62
+ type: "number",
63
+ description: "Minimum character length for textarea fields"
64
+ },
65
+ maxLength: {
66
+ type: "number",
67
+ description: "Maximum character length for textarea fields"
68
+ },
69
+ rows: {
70
+ type: "number",
71
+ description: "Number of visible rows for textarea (default: 4)"
72
+ },
73
+ choices: {
74
+ type: "array",
75
+ items: { type: "string" },
76
+ description: "Array of choices for radio/dropdown/checkbox fields. Radio should have 2-6 choices, dropdown for 7+ choices."
77
+ },
78
+ searchable: {
79
+ type: "boolean",
80
+ description: "Make dropdown searchable (for large lists)"
81
+ },
82
+ minSelections: {
83
+ type: "number",
84
+ description: "Minimum number of selections for checkbox fields"
85
+ },
86
+ maxSelections: {
87
+ type: "number",
88
+ description: "Maximum number of selections for checkbox fields"
89
+ },
90
+ minDate: {
91
+ type: "string",
92
+ description: "Minimum date (ISO format: YYYY-MM-DD)"
93
+ },
94
+ maxDate: {
95
+ type: "string",
96
+ description: "Maximum date (ISO format: YYYY-MM-DD)"
97
+ },
98
+ format: {
99
+ type: "string",
100
+ description: "Format for time fields: '12hr' or '24hr'"
101
+ },
102
+ min: {
103
+ type: "number",
104
+ description: "Minimum value for number fields"
105
+ },
106
+ max: {
107
+ type: "number",
108
+ description: "Maximum value for number fields"
109
+ },
110
+ step: {
111
+ type: "number",
112
+ description: "Step increment for number fields"
113
+ },
114
+ defaultValue: { description: "Optional default/pre-filled value for the field. Type varies by field: string for text/textarea/radio/dropdown/date/time, number for number fields, array of strings for checkbox fields. For radio/dropdown, must be one of the choices. For checkbox, must be a subset of choices." }
115
+ },
116
+ required: [
117
+ "id",
118
+ "type",
119
+ "label"
120
+ ]
121
+ },
122
+ minItems: 1
123
+ }
124
+ },
125
+ required: ["fields"]
126
+ }
127
+ }, n = [
128
+ {
129
+ name: "Contact Form",
130
+ args: {
131
+ title: "Contact Us",
132
+ description: "Please fill out the form below to get in touch.",
133
+ fields: [
134
+ {
135
+ id: "name",
136
+ type: "text",
137
+ label: "Full Name",
138
+ required: !0,
139
+ placeholder: "John Doe"
140
+ },
141
+ {
142
+ id: "email",
143
+ type: "text",
144
+ label: "Email Address",
145
+ required: !0,
146
+ placeholder: "john@example.com",
147
+ validation: "email"
148
+ },
149
+ {
150
+ id: "subject",
151
+ type: "dropdown",
152
+ label: "Subject",
153
+ choices: [
154
+ "General Inquiry",
155
+ "Technical Support",
156
+ "Sales",
157
+ "Feedback"
158
+ ],
159
+ required: !0
160
+ },
161
+ {
162
+ id: "message",
163
+ type: "textarea",
164
+ label: "Message",
165
+ required: !0,
166
+ minLength: 10,
167
+ maxLength: 500,
168
+ rows: 5
169
+ }
170
+ ]
171
+ }
172
+ },
173
+ {
174
+ name: "Survey Form",
175
+ args: {
176
+ title: "Customer Satisfaction Survey",
177
+ fields: [
178
+ {
179
+ id: "satisfaction",
180
+ type: "radio",
181
+ label: "How satisfied are you with our service?",
182
+ choices: [
183
+ "Very Satisfied",
184
+ "Satisfied",
185
+ "Neutral",
186
+ "Dissatisfied",
187
+ "Very Dissatisfied"
188
+ ],
189
+ required: !0
190
+ },
191
+ {
192
+ id: "features",
193
+ type: "checkbox",
194
+ label: "Which features do you use most?",
195
+ choices: [
196
+ "Dashboard",
197
+ "Reports",
198
+ "Analytics",
199
+ "API",
200
+ "Integrations"
201
+ ],
202
+ minSelections: 1,
203
+ maxSelections: 3
204
+ },
205
+ {
206
+ id: "recommendation",
207
+ type: "number",
208
+ label: "How likely are you to recommend us? (0-10)",
209
+ min: 0,
210
+ max: 10,
211
+ step: 1
212
+ }
213
+ ]
214
+ }
215
+ },
216
+ {
217
+ name: "Event Registration",
218
+ args: {
219
+ title: "Event Registration",
220
+ description: "Register for our upcoming conference.",
221
+ fields: [
222
+ {
223
+ id: "attendeeName",
224
+ type: "text",
225
+ label: "Attendee Name",
226
+ required: !0
227
+ },
228
+ {
229
+ id: "eventDate",
230
+ type: "date",
231
+ label: "Preferred Date",
232
+ required: !0,
233
+ minDate: "2025-01-01",
234
+ maxDate: "2025-12-31"
235
+ },
236
+ {
237
+ id: "sessionTime",
238
+ type: "time",
239
+ label: "Session Time",
240
+ format: "12hr"
241
+ },
242
+ {
243
+ id: "dietaryRestrictions",
244
+ type: "checkbox",
245
+ label: "Dietary Restrictions",
246
+ choices: [
247
+ "Vegetarian",
248
+ "Vegan",
249
+ "Gluten-Free",
250
+ "Halal",
251
+ "Kosher"
252
+ ]
253
+ }
254
+ ]
255
+ }
256
+ }
257
+ ], r = async (e, t) => {
258
+ try {
259
+ let { title: e, description: n, fields: r } = t;
260
+ if (!r || !Array.isArray(r) || r.length === 0) throw Error("At least one field is required");
261
+ let i = /* @__PURE__ */ new Set();
262
+ for (let e = 0; e < r.length; e++) {
263
+ let t = r[e];
264
+ if (!t.id || typeof t.id != "string") throw Error(`Field ${e + 1} must have a valid 'id' property`);
265
+ if (!t.type || typeof t.type != "string") throw Error(`Field ${e + 1} must have a valid 'type' property`);
266
+ if (!t.label || typeof t.label != "string") throw Error(`Field ${e + 1} must have a valid 'label' property`);
267
+ if (i.has(t.id)) throw Error(`Duplicate field ID: '${t.id}'`);
268
+ switch (i.add(t.id), t.type) {
269
+ case "text":
270
+ case "textarea":
271
+ if (t.minLength !== void 0 && t.maxLength !== void 0 && t.minLength > t.maxLength) throw Error(`Field '${t.id}': minLength cannot be greater than maxLength`);
272
+ break;
273
+ case "radio":
274
+ if (!Array.isArray(t.choices) || t.choices.length < 2) throw Error(`Field '${t.id}': radio fields must have at least 2 choices`);
275
+ t.choices.length > 6 && console.warn(`Field '${t.id}': radio fields with more than 6 choices should use 'dropdown' type instead`);
276
+ break;
277
+ case "dropdown":
278
+ case "checkbox":
279
+ if (!Array.isArray(t.choices) || t.choices.length < 1) throw Error(`Field '${t.id}': ${t.type} fields must have at least 1 choice`);
280
+ break;
281
+ case "number":
282
+ if (t.min !== void 0 && t.max !== void 0 && t.min > t.max) throw Error(`Field '${t.id}': min cannot be greater than max`);
283
+ break;
284
+ case "date":
285
+ if (t.minDate && t.maxDate && t.minDate > t.maxDate) throw Error(`Field '${t.id}': minDate cannot be after maxDate`);
286
+ break;
287
+ case "time": break;
288
+ default: {
289
+ let e = t;
290
+ throw Error(`Field '${e.id}': unknown field type '${e.type}'`);
291
+ }
292
+ }
293
+ if (t.type === "checkbox") {
294
+ if (t.minSelections !== void 0 && t.maxSelections !== void 0 && t.minSelections > t.maxSelections) throw Error(`Field '${t.id}': minSelections cannot be greater than maxSelections`);
295
+ if (t.maxSelections !== void 0 && t.maxSelections > t.choices.length) throw Error(`Field '${t.id}': maxSelections cannot exceed number of choices`);
296
+ }
297
+ if (t.defaultValue !== void 0) switch (t.type) {
298
+ case "text":
299
+ case "textarea":
300
+ if (typeof t.defaultValue != "string") throw Error(`Field '${t.id}': defaultValue must be a string`);
301
+ if (t.minLength !== void 0 && t.defaultValue.length < t.minLength) throw Error(`Field '${t.id}': defaultValue length is less than minLength`);
302
+ if (t.maxLength !== void 0 && t.defaultValue.length > t.maxLength) throw Error(`Field '${t.id}': defaultValue length exceeds maxLength`);
303
+ break;
304
+ case "radio":
305
+ case "dropdown":
306
+ if (typeof t.defaultValue != "string") throw Error(`Field '${t.id}': defaultValue must be a string`);
307
+ if (!t.choices.includes(t.defaultValue)) throw Error(`Field '${t.id}': defaultValue '${t.defaultValue}' is not in choices`);
308
+ break;
309
+ case "checkbox":
310
+ if (!Array.isArray(t.defaultValue)) throw Error(`Field '${t.id}': defaultValue must be an array`);
311
+ for (let e of t.defaultValue) if (!t.choices.includes(e)) throw Error(`Field '${t.id}': defaultValue contains '${e}' which is not in choices`);
312
+ if (t.minSelections !== void 0 && t.defaultValue.length < t.minSelections) throw Error(`Field '${t.id}': defaultValue has fewer selections than minSelections`);
313
+ if (t.maxSelections !== void 0 && t.defaultValue.length > t.maxSelections) throw Error(`Field '${t.id}': defaultValue has more selections than maxSelections`);
314
+ break;
315
+ case "number":
316
+ if (typeof t.defaultValue != "number") throw Error(`Field '${t.id}': defaultValue must be a number`);
317
+ if (t.min !== void 0 && t.defaultValue < t.min) throw Error(`Field '${t.id}': defaultValue is less than min`);
318
+ if (t.max !== void 0 && t.defaultValue > t.max) throw Error(`Field '${t.id}': defaultValue is greater than max`);
319
+ break;
320
+ case "date":
321
+ if (typeof t.defaultValue != "string") throw Error(`Field '${t.id}': defaultValue must be a string (ISO date format)`);
322
+ if (t.minDate !== void 0 && t.defaultValue < t.minDate) throw Error(`Field '${t.id}': defaultValue is before minDate`);
323
+ if (t.maxDate !== void 0 && t.defaultValue > t.maxDate) throw Error(`Field '${t.id}': defaultValue is after maxDate`);
324
+ break;
325
+ case "time":
326
+ if (typeof t.defaultValue != "string") throw Error(`Field '${t.id}': defaultValue must be a string`);
327
+ break;
328
+ }
329
+ }
330
+ let a = {
331
+ title: e,
332
+ description: n,
333
+ fields: r
334
+ };
335
+ return {
336
+ message: `Form created with ${`${r.length} field${r.length > 1 ? "s" : ""}`}${e ? `: ${e}` : ""}`,
337
+ jsonData: a,
338
+ instructions: "The form has been presented to the user. Wait for the user to fill out and submit the form. They will send their responses as a JSON message."
339
+ };
340
+ } catch (e) {
341
+ return console.error("ERR: exception\n Form creation error", e), {
342
+ message: `Form error: ${e instanceof Error ? e.message : "Unknown error"}`,
343
+ instructions: "Acknowledge that there was an error creating the form and suggest trying again with corrected field definitions."
344
+ };
345
+ }
346
+ }, i = {
347
+ toolDefinition: t,
348
+ execute: r,
349
+ generatingMessage: "Preparing form...",
350
+ isEnabled: () => !0,
351
+ samples: n
352
+ };
353
+ //#endregion
354
+ export { e as a, t as i, i as n, n as r, r as t };
@@ -0,0 +1,2 @@
1
+ var e=`presentForm`,t={type:`function`,name:e,description:`Create a structured form to collect information from the user. Supports various field types including text input, textarea, multiple choice (radio), dropdown menus, checkboxes, date/time pickers, and number inputs. Each field can have validation rules and help text.`,parameters:{type:`object`,properties:{title:{type:`string`,description:`Optional title for the form (e.g., 'User Registration')`},description:{type:`string`,description:`Optional description explaining the purpose of the form`},fields:{type:`array`,description:`Array of form fields with various types and configurations`,items:{type:`object`,properties:{id:{type:`string`,description:`Unique identifier for the field (e.g., 'email', 'birthdate'). This will be the key in the JSON response. Use descriptive camelCase or snake_case names.`},type:{type:`string`,enum:[`text`,`textarea`,`radio`,`dropdown`,`checkbox`,`date`,`time`,`number`],description:`Field type: 'text' for short text, 'textarea' for long text, 'radio' for 2-6 choices, 'dropdown' for many choices, 'checkbox' for multiple selections, 'date' for date picker, 'time' for time picker, 'number' for numeric input`},label:{type:`string`,description:`Field label shown to the user`},description:{type:`string`,description:`Optional help text explaining the field`},required:{type:`boolean`,description:`Whether the field is required (default: false)`},placeholder:{type:`string`,description:`Placeholder text for text/textarea fields`},validation:{type:`string`,description:`For text fields: 'email', 'url', 'phone', or a regex pattern`},minLength:{type:`number`,description:`Minimum character length for textarea fields`},maxLength:{type:`number`,description:`Maximum character length for textarea fields`},rows:{type:`number`,description:`Number of visible rows for textarea (default: 4)`},choices:{type:`array`,items:{type:`string`},description:`Array of choices for radio/dropdown/checkbox fields. Radio should have 2-6 choices, dropdown for 7+ choices.`},searchable:{type:`boolean`,description:`Make dropdown searchable (for large lists)`},minSelections:{type:`number`,description:`Minimum number of selections for checkbox fields`},maxSelections:{type:`number`,description:`Maximum number of selections for checkbox fields`},minDate:{type:`string`,description:`Minimum date (ISO format: YYYY-MM-DD)`},maxDate:{type:`string`,description:`Maximum date (ISO format: YYYY-MM-DD)`},format:{type:`string`,description:`Format for time fields: '12hr' or '24hr'`},min:{type:`number`,description:`Minimum value for number fields`},max:{type:`number`,description:`Maximum value for number fields`},step:{type:`number`,description:`Step increment for number fields`},defaultValue:{description:`Optional default/pre-filled value for the field. Type varies by field: string for text/textarea/radio/dropdown/date/time, number for number fields, array of strings for checkbox fields. For radio/dropdown, must be one of the choices. For checkbox, must be a subset of choices.`}},required:[`id`,`type`,`label`]},minItems:1}},required:[`fields`]}},n=[{name:`Contact Form`,args:{title:`Contact Us`,description:`Please fill out the form below to get in touch.`,fields:[{id:`name`,type:`text`,label:`Full Name`,required:!0,placeholder:`John Doe`},{id:`email`,type:`text`,label:`Email Address`,required:!0,placeholder:`john@example.com`,validation:`email`},{id:`subject`,type:`dropdown`,label:`Subject`,choices:[`General Inquiry`,`Technical Support`,`Sales`,`Feedback`],required:!0},{id:`message`,type:`textarea`,label:`Message`,required:!0,minLength:10,maxLength:500,rows:5}]}},{name:`Survey Form`,args:{title:`Customer Satisfaction Survey`,fields:[{id:`satisfaction`,type:`radio`,label:`How satisfied are you with our service?`,choices:[`Very Satisfied`,`Satisfied`,`Neutral`,`Dissatisfied`,`Very Dissatisfied`],required:!0},{id:`features`,type:`checkbox`,label:`Which features do you use most?`,choices:[`Dashboard`,`Reports`,`Analytics`,`API`,`Integrations`],minSelections:1,maxSelections:3},{id:`recommendation`,type:`number`,label:`How likely are you to recommend us? (0-10)`,min:0,max:10,step:1}]}},{name:`Event Registration`,args:{title:`Event Registration`,description:`Register for our upcoming conference.`,fields:[{id:`attendeeName`,type:`text`,label:`Attendee Name`,required:!0},{id:`eventDate`,type:`date`,label:`Preferred Date`,required:!0,minDate:`2025-01-01`,maxDate:`2025-12-31`},{id:`sessionTime`,type:`time`,label:`Session Time`,format:`12hr`},{id:`dietaryRestrictions`,type:`checkbox`,label:`Dietary Restrictions`,choices:[`Vegetarian`,`Vegan`,`Gluten-Free`,`Halal`,`Kosher`]}]}}],r=async(e,t)=>{try{let{title:e,description:n,fields:r}=t;if(!r||!Array.isArray(r)||r.length===0)throw Error(`At least one field is required`);let i=new Set;for(let e=0;e<r.length;e++){let t=r[e];if(!t.id||typeof t.id!=`string`)throw Error(`Field ${e+1} must have a valid 'id' property`);if(!t.type||typeof t.type!=`string`)throw Error(`Field ${e+1} must have a valid 'type' property`);if(!t.label||typeof t.label!=`string`)throw Error(`Field ${e+1} must have a valid 'label' property`);if(i.has(t.id))throw Error(`Duplicate field ID: '${t.id}'`);switch(i.add(t.id),t.type){case`text`:case`textarea`:if(t.minLength!==void 0&&t.maxLength!==void 0&&t.minLength>t.maxLength)throw Error(`Field '${t.id}': minLength cannot be greater than maxLength`);break;case`radio`:if(!Array.isArray(t.choices)||t.choices.length<2)throw Error(`Field '${t.id}': radio fields must have at least 2 choices`);t.choices.length>6&&console.warn(`Field '${t.id}': radio fields with more than 6 choices should use 'dropdown' type instead`);break;case`dropdown`:case`checkbox`:if(!Array.isArray(t.choices)||t.choices.length<1)throw Error(`Field '${t.id}': ${t.type} fields must have at least 1 choice`);break;case`number`:if(t.min!==void 0&&t.max!==void 0&&t.min>t.max)throw Error(`Field '${t.id}': min cannot be greater than max`);break;case`date`:if(t.minDate&&t.maxDate&&t.minDate>t.maxDate)throw Error(`Field '${t.id}': minDate cannot be after maxDate`);break;case`time`:break;default:{let e=t;throw Error(`Field '${e.id}': unknown field type '${e.type}'`)}}if(t.type===`checkbox`){if(t.minSelections!==void 0&&t.maxSelections!==void 0&&t.minSelections>t.maxSelections)throw Error(`Field '${t.id}': minSelections cannot be greater than maxSelections`);if(t.maxSelections!==void 0&&t.maxSelections>t.choices.length)throw Error(`Field '${t.id}': maxSelections cannot exceed number of choices`)}if(t.defaultValue!==void 0)switch(t.type){case`text`:case`textarea`:if(typeof t.defaultValue!=`string`)throw Error(`Field '${t.id}': defaultValue must be a string`);if(t.minLength!==void 0&&t.defaultValue.length<t.minLength)throw Error(`Field '${t.id}': defaultValue length is less than minLength`);if(t.maxLength!==void 0&&t.defaultValue.length>t.maxLength)throw Error(`Field '${t.id}': defaultValue length exceeds maxLength`);break;case`radio`:case`dropdown`:if(typeof t.defaultValue!=`string`)throw Error(`Field '${t.id}': defaultValue must be a string`);if(!t.choices.includes(t.defaultValue))throw Error(`Field '${t.id}': defaultValue '${t.defaultValue}' is not in choices`);break;case`checkbox`:if(!Array.isArray(t.defaultValue))throw Error(`Field '${t.id}': defaultValue must be an array`);for(let e of t.defaultValue)if(!t.choices.includes(e))throw Error(`Field '${t.id}': defaultValue contains '${e}' which is not in choices`);if(t.minSelections!==void 0&&t.defaultValue.length<t.minSelections)throw Error(`Field '${t.id}': defaultValue has fewer selections than minSelections`);if(t.maxSelections!==void 0&&t.defaultValue.length>t.maxSelections)throw Error(`Field '${t.id}': defaultValue has more selections than maxSelections`);break;case`number`:if(typeof t.defaultValue!=`number`)throw Error(`Field '${t.id}': defaultValue must be a number`);if(t.min!==void 0&&t.defaultValue<t.min)throw Error(`Field '${t.id}': defaultValue is less than min`);if(t.max!==void 0&&t.defaultValue>t.max)throw Error(`Field '${t.id}': defaultValue is greater than max`);break;case`date`:if(typeof t.defaultValue!=`string`)throw Error(`Field '${t.id}': defaultValue must be a string (ISO date format)`);if(t.minDate!==void 0&&t.defaultValue<t.minDate)throw Error(`Field '${t.id}': defaultValue is before minDate`);if(t.maxDate!==void 0&&t.defaultValue>t.maxDate)throw Error(`Field '${t.id}': defaultValue is after maxDate`);break;case`time`:if(typeof t.defaultValue!=`string`)throw Error(`Field '${t.id}': defaultValue must be a string`);break}}let a={title:e,description:n,fields:r};return{message:`Form created with ${`${r.length} field${r.length>1?`s`:``}`}${e?`: ${e}`:``}`,jsonData:a,instructions:`The form has been presented to the user. Wait for the user to fill out and submit the form. They will send their responses as a JSON message.`}}catch(e){return console.error(`ERR: exception
2
+ Form creation error`,e),{message:`Form error: ${e instanceof Error?e.message:`Unknown error`}`,instructions:`Acknowledge that there was an error creating the form and suggest trying again with corrected field definitions.`}}},i={toolDefinition:t,execute:r,generatingMessage:`Preparing form...`,isEnabled:()=>!0,samples:n};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
package/dist/style.css CHANGED
@@ -1 +1,3 @@
1
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-amber-600:oklch(66.6% .179 58.318);--color-green-100:oklch(96.2% .044 156.743);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-800:oklch(43.2% .095 166.913);--color-blue-50:oklch(97% .014 254.604);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.m-0{margin:calc(var(--spacing)*0)}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-8{margin-top:calc(var(--spacing)*8)}.mr-3{margin-right:calc(var(--spacing)*3)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-5{margin-bottom:calc(var(--spacing)*5)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-12{height:calc(var(--spacing)*12)}.h-full{height:100%}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-12{width:calc(var(--spacing)*12)}.w-32{width:calc(var(--spacing)*32)}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[200px\]{max-width:200px}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing)*1)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-none{--tw-border-style:none;border-style:none}.border-blue-500{border-color:var(--color-blue-500)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-indigo-200{border-color:var(--color-indigo-200)}.border-red-500{border-color:var(--color-red-500)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-600{background-color:var(--color-green-600)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-red-50{background-color:var(--color-red-50)}.bg-white{background-color:var(--color-white)}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-blue-50{--tw-gradient-from:var(--color-blue-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-indigo-50{--tw-gradient-to:var(--color-indigo-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-8{padding:calc(var(--spacing)*8)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.px-8{padding-inline:calc(var(--spacing)*8)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-600{color:var(--color-amber-600)}.text-blue-600{color:var(--color-blue-600)}.text-emerald-800{color:var(--color-emerald-800)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-700{color:var(--color-green-700)}.text-indigo-700{color:var(--color-indigo-700)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-white{color:var(--color-white)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}@media(hover:hover){.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab,var(--color-indigo-500)10%,transparent)}}.focus\:ring-red-500:focus{--tw-ring-color:var(--color-red-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}.form-field[data-v-cd2c3f48]{transition:all .2s ease}.form-field.has-error[data-v-cd2c3f48]{animation:shake-cd2c3f48 .3s ease}@keyframes shake-cd2c3f48{0%,to{transform:translate(0)}25%{transform:translate(-5px)}75%{transform:translate(5px)}}
1
+ /*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-amber-600:oklch(66.6% .179 58.318);--color-green-100:oklch(96.2% .044 156.743);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-emerald-50:oklch(97.9% .021 166.113);--color-emerald-100:oklch(95% .052 163.051);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-800:oklch(43.2% .095 166.913);--color-blue-50:oklch(97% .014 254.604);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-indigo-50:oklch(96.2% .018 272.314);--color-indigo-100:oklch(93% .034 272.788);--color-indigo-200:oklch(87% .065 274.039);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-700:oklch(45.7% .24 277.023);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-white:#fff;--spacing:.25rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.m-0{margin:calc(var(--spacing) * 0)}.mx-auto{margin-inline:auto}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-1{margin-left:calc(var(--spacing) * 1)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-12{height:calc(var(--spacing) * 12)}.h-full{height:100%}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-12{width:calc(var(--spacing) * 12)}.w-32{width:calc(var(--spacing) * 32)}.w-full{width:100%}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[200px\]{max-width:200px}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.resize-y{resize:vertical}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-none{--tw-border-style:none;border-style:none}.border-blue-500{border-color:var(--color-blue-500)}.border-emerald-200{border-color:var(--color-emerald-200)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-indigo-200{border-color:var(--color-indigo-200)}.border-red-500{border-color:var(--color-red-500)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-600{background-color:var(--color-green-600)}.bg-indigo-100{background-color:var(--color-indigo-100)}.bg-indigo-600{background-color:var(--color-indigo-600)}.bg-red-50{background-color:var(--color-red-50)}.bg-white{background-color:var(--color-white)}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-blue-50{--tw-gradient-from:var(--color-blue-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-indigo-50{--tw-gradient-to:var(--color-indigo-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-8{padding:calc(var(--spacing) * 8)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.text-center{text-align:center}.font-mono{font-family:var(--font-mono)}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-600{color:var(--color-amber-600)}.text-blue-600{color:var(--color-blue-600)}.text-emerald-800{color:var(--color-emerald-800)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-700{color:var(--color-green-700)}.text-indigo-700{color:var(--color-indigo-700)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-white{color:var(--color-white)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}@media (hover:hover){.hover\:border-indigo-300:hover{border-color:var(--color-indigo-300)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-indigo-200:hover{background-color:var(--color-indigo-200)}.hover\:bg-indigo-700:hover{background-color:var(--color-indigo-700)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-indigo-500:focus{border-color:var(--color-indigo-500)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-\[3px\]:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-indigo-500\/10:focus{--tw-ring-color:#625fff1a}@supports (color:color-mix(in lab, red, red)){.focus\:ring-indigo-500\/10:focus{--tw-ring-color:color-mix(in oklab, var(--color-indigo-500) 10%, transparent)}}.focus\:ring-red-500:focus{--tw-ring-color:var(--color-red-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}.form-field[data-v-cd2c3f48]{transition:all .2s}.form-field.has-error[data-v-cd2c3f48]{animation:.3s shake-cd2c3f48}@keyframes shake-cd2c3f48{0%,to{transform:translate(0)}25%{transform:translate(-5px)}75%{transform:translate(5px)}}
3
+ /*$vite$:1*/
package/dist/vue.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("./core.cjs"),t=require("vue"),O={class:"w-full h-full overflow-y-auto p-8"},R={key:0,class:"max-w-3xl w-full mx-auto"},q={key:0,class:"text-gray-900 text-3xl font-bold mb-4 text-center"},P={key:1,class:"text-gray-600 text-center mb-8 text-lg"},j={key:2,class:"bg-red-50 border-2 border-red-500 rounded-lg p-4 mb-6",role:"alert"},A={class:"text-red-700 space-y-1"},I=["href","onClick"],H=["id"],J=["for"],W={key:0,class:"text-red-500 ml-1","aria-label":"required"},G={key:0,class:"text-gray-600 text-sm mb-2"},K=["id","onUpdate:modelValue","placeholder","aria-invalid","aria-describedby","onBlur","onInput"],Q=["id","onUpdate:modelValue","placeholder","rows","aria-invalid","aria-describedby","onBlur","onInput"],X=["id","onUpdate:modelValue","min","max","step","aria-invalid","aria-describedby","onBlur","onInput"],Y=["id","onUpdate:modelValue","min","max","aria-invalid","aria-describedby","onBlur","onChange"],Z=["id","onUpdate:modelValue","aria-invalid","aria-describedby","onBlur","onChange"],ee=["aria-invalid","aria-describedby"],te=["name","value","onUpdate:modelValue","onChange","onBlur"],re={class:"text-gray-800"},oe=["id","onUpdate:modelValue","aria-invalid","aria-describedby","onBlur","onChange"],ae=["value"],ne=["aria-invalid","aria-describedby"],se=["value","onUpdate:modelValue","onChange","onBlur"],le={class:"text-gray-800"},ie=["id"],ue={key:0},ce={class:"mt-8 flex justify-center"},de=["disabled"],me={class:"mt-4 text-center text-gray-600 text-sm"},pe=t.defineComponent({__name:"View",props:{selectedResult:{},sendTextMessage:{type:Function}},emits:["updateResult"],setup(x,{emit:g}){const m=x,k=g,i=t.ref(null),s=t.ref({}),n=t.ref(new Set),d=t.ref(new Map),c=t.ref(!1),B=t.ref(!1),b=t.ref(!1);t.watch(()=>m.selectedResult,(r,a)=>{if(r?.toolName==="presentForm"&&r.jsonData&&(!a||!a.jsonData||a.uuid!==r.uuid||a.jsonData!==r.jsonData)){if(b.value=!0,i.value=r.jsonData,s.value={},i.value.fields.forEach(o=>{s.value[o.id]=p(o)}),r.viewState){const o=r.viewState;o.userResponses&&Object.assign(s.value,o.userResponses),o.touched&&(n.value=new Set(o.touched),o.touched.forEach(u=>{E(u)})),o.submitted!==void 0&&(c.value=o.submitted)}b.value=!1}},{immediate:!0}),t.watch([s,n,c],()=>{if(b.value||!m.selectedResult)return;const r={...m.selectedResult,viewState:{userResponses:{...s.value},touched:Array.from(n.value),submitted:c.value}};k("updateResult",r)},{deep:!0});function p(r){const a=r;if(a.defaultValue!==void 0)switch(r.type){case"radio":case"dropdown":{const e=r.choices.indexOf(a.defaultValue);return e!==-1?e:null}case"checkbox":return Array.isArray(a.defaultValue)?a.defaultValue.map(e=>r.choices.indexOf(e)).filter(e=>e!==-1):[];default:return a.defaultValue}switch(r.type){case"text":case"textarea":return"";case"number":return r.min!==void 0?r.min:0;case"date":case"time":return"";case"radio":case"dropdown":return null;case"checkbox":return[];default:return null}}function V(r){return r==null?!0:typeof r=="string"?r.trim()==="":Array.isArray(r)?r.length===0:!1}function D(r){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r)}function f(r){try{return new URL(r),!0}catch{return!1}}function L(r){return/^[\d\s\-+()]+$/.test(r)&&r.replace(/\D/g,"").length>=10}function M(r,a){if(r.required&&V(a))return`${r.label} is required`;if(V(a))return null;switch(r.type){case"text":{const e=r;if(e.validation==="email"&&!D(a))return"Please enter a valid email address";if(e.validation==="url"&&!f(a))return"Please enter a valid URL";if(e.validation==="phone"&&!L(a))return"Please enter a valid phone number";if(typeof e.validation=="string"&&e.validation!=="email"&&e.validation!=="url"&&e.validation!=="phone")try{if(!new RegExp(e.validation).test(a))return`${r.label} format is invalid`}catch{console.warn(`Invalid regex pattern: ${e.validation}`)}break}case"textarea":{const e=r;if(e.minLength&&a.length<e.minLength)return`Must be at least ${e.minLength} characters (currently ${a.length})`;if(e.maxLength&&a.length>e.maxLength)return`Must be no more than ${e.maxLength} characters (currently ${a.length})`;break}case"number":{const e=r;if(e.min!==void 0&&a<e.min)return`Must be at least ${e.min}`;if(e.max!==void 0&&a>e.max)return`Must be no more than ${e.max}`;break}case"date":{const e=r;if(e.minDate&&a<e.minDate)return`Date must be on or after ${e.minDate}`;if(e.maxDate&&a>e.maxDate)return`Date must be on or before ${e.maxDate}`;break}case"checkbox":{const e=r,o=a?.length||0;if(e.minSelections&&o<e.minSelections)return`Please select at least ${e.minSelections} option${e.minSelections>1?"s":""}`;if(e.maxSelections&&o>e.maxSelections)return`Please select no more than ${e.maxSelections} option${e.maxSelections>1?"s":""}`;break}}return null}function E(r){const a=i.value?.fields.find(u=>u.id===r);if(!a)return!0;const e=s.value[r],o=M(a,e);return o?(d.value.set(r,{fieldId:r,message:o,type:"custom"}),!1):(d.value.delete(r),!0)}function v(r){n.value.add(r),E(r)}function h(r){n.value.has(r)&&E(r)}function l(r){return d.value.has(r)}function w(r){const a=document.getElementById(`input-${r}`);a&&(a.focus(),a.scrollIntoView({behavior:"smooth",block:"center"}))}function F(r){return(r.type==="text"||r.type==="textarea")&&r.maxLength!==void 0}function $(r){if(r.type!=="text"&&r.type!=="textarea")return!1;const a=r.maxLength;return a?(s.value[r.id]||"").length/a>.9:!1}const z=t.computed(()=>i.value?.fields.filter(r=>r.required).length||0),T=t.computed(()=>i.value?i.value.fields.filter(r=>r.required&&!V(s.value[r.id])).length:0);function U(){if(c.value)return;if(i.value?.fields.forEach(e=>{n.value.add(e.id),E(e.id)}),d.value.size>0){B.value=!0;const e=Array.from(d.value.keys())[0];w(e);return}const r={};i.value?.fields.forEach(e=>{const o=s.value[e.id];e.type==="radio"||e.type==="dropdown"?o!=null?r[e.id]=e.choices[o]:r[e.id]=null:e.type==="checkbox"?r[e.id]=(o||[]).map(u=>e.choices[u]):r[e.id]=o});const a=JSON.stringify({formSubmission:{formTitle:i.value?.title||"Form",responses:r}},null,2);c.value=!0,m.sendTextMessage(a)}return(r,a)=>(t.openBlock(),t.createElementBlock("div",O,[i.value?(t.openBlock(),t.createElementBlock("div",R,[i.value.title?(t.openBlock(),t.createElementBlock("h2",q,t.toDisplayString(i.value.title),1)):t.createCommentVNode("",!0),i.value.description?(t.openBlock(),t.createElementBlock("p",P,t.toDisplayString(i.value.description),1)):t.createCommentVNode("",!0),B.value&&d.value.size>0?(t.openBlock(),t.createElementBlock("div",j,[a[0]||(a[0]=t.createElementVNode("h3",{class:"text-red-800 font-semibold mb-2 flex items-center gap-2"},[t.createElementVNode("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"})]),t.createTextVNode(" Please fix the following errors: ")],-1)),t.createElementVNode("ul",A,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,([e,o])=>(t.openBlock(),t.createElementBlock("li",{key:e},[t.createElementVNode("a",{href:`#${e}`,onClick:t.withModifiers(u=>w(e),["prevent"]),class:"hover:underline cursor-pointer"},t.toDisplayString(o.message),9,I)]))),128))])])):t.createCommentVNode("",!0),t.createElementVNode("form",{onSubmit:t.withModifiers(U,["prevent"]),class:"space-y-6"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value.fields,e=>(t.openBlock(),t.createElementBlock("div",{key:e.id,id:e.id,class:t.normalizeClass(["form-field",{"has-error":l(e.id)&&n.value.has(e.id)}])},[t.createElementVNode("label",{for:`input-${e.id}`,class:t.normalizeClass(["block text-gray-800 font-semibold mb-2",{"text-red-600":l(e.id)&&n.value.has(e.id)}])},[t.createTextVNode(t.toDisplayString(e.label)+" ",1),e.required?(t.openBlock(),t.createElementBlock("span",W,"*")):t.createCommentVNode("",!0)],10,J),e.description?(t.openBlock(),t.createElementBlock("p",G,t.toDisplayString(e.description),1)):t.createCommentVNode("",!0),e.type==="text"?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:1,id:`input-${e.id}`,"onUpdate:modelValue":o=>s.value[e.id]=o,type:"text",placeholder:e.placeholder,"aria-invalid":l(e.id)&&n.value.has(e.id),"aria-describedby":l(e.id)&&n.value.has(e.id)?`${e.id}-error`:void 0,onBlur:o=>v(e.id),onInput:o=>h(e.id),class:t.normalizeClass(["w-full px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors",{"border-red-500 focus:ring-red-500":l(e.id)&&n.value.has(e.id),"border-gray-300":!l(e.id)||!n.value.has(e.id)}])},null,42,K)),[[t.vModelText,s.value[e.id]]]):e.type==="textarea"?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:2,id:`input-${e.id}`,"onUpdate:modelValue":o=>s.value[e.id]=o,placeholder:e.placeholder,rows:e.rows||4,"aria-invalid":l(e.id)&&n.value.has(e.id),"aria-describedby":l(e.id)&&n.value.has(e.id)?`${e.id}-error`:void 0,onBlur:o=>v(e.id),onInput:o=>h(e.id),class:t.normalizeClass(["w-full px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors resize-y",{"border-red-500 focus:ring-red-500":l(e.id)&&n.value.has(e.id),"border-gray-300":!l(e.id)||!n.value.has(e.id)}])},null,42,Q)),[[t.vModelText,s.value[e.id]]]):e.type==="number"?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:3,id:`input-${e.id}`,"onUpdate:modelValue":o=>s.value[e.id]=o,type:"number",min:e.min,max:e.max,step:e.step,"aria-invalid":l(e.id)&&n.value.has(e.id),"aria-describedby":l(e.id)&&n.value.has(e.id)?`${e.id}-error`:void 0,onBlur:o=>v(e.id),onInput:o=>h(e.id),class:t.normalizeClass(["w-full px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors",{"border-red-500 focus:ring-red-500":l(e.id)&&n.value.has(e.id),"border-gray-300":!l(e.id)||!n.value.has(e.id)}])},null,42,X)),[[t.vModelText,s.value[e.id],void 0,{number:!0}]]):e.type==="date"?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:4,id:`input-${e.id}`,"onUpdate:modelValue":o=>s.value[e.id]=o,type:"date",min:e.minDate,max:e.maxDate,"aria-invalid":l(e.id)&&n.value.has(e.id),"aria-describedby":l(e.id)&&n.value.has(e.id)?`${e.id}-error`:void 0,onBlur:o=>v(e.id),onChange:o=>h(e.id),class:t.normalizeClass(["w-full px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors",{"border-red-500 focus:ring-red-500":l(e.id)&&n.value.has(e.id),"border-gray-300":!l(e.id)||!n.value.has(e.id)}])},null,42,Y)),[[t.vModelText,s.value[e.id]]]):e.type==="time"?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:5,id:`input-${e.id}`,"onUpdate:modelValue":o=>s.value[e.id]=o,type:"time","aria-invalid":l(e.id)&&n.value.has(e.id),"aria-describedby":l(e.id)&&n.value.has(e.id)?`${e.id}-error`:void 0,onBlur:o=>v(e.id),onChange:o=>h(e.id),class:t.normalizeClass(["w-full px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors",{"border-red-500 focus:ring-red-500":l(e.id)&&n.value.has(e.id),"border-gray-300":!l(e.id)||!n.value.has(e.id)}])},null,42,Z)),[[t.vModelText,s.value[e.id]]]):e.type==="radio"?(t.openBlock(),t.createElementBlock("div",{key:6,class:"space-y-2",role:"radiogroup","aria-invalid":l(e.id)&&n.value.has(e.id),"aria-describedby":l(e.id)&&n.value.has(e.id)?`${e.id}-error`:void 0},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.choices,(o,u)=>(t.openBlock(),t.createElementBlock("label",{key:u,class:t.normalizeClass(["flex items-center p-3 border-2 border-gray-300 rounded-lg cursor-pointer transition-all hover:bg-gray-50",{"border-blue-500 bg-blue-50":s.value[e.id]===u,"border-gray-300":s.value[e.id]!==u}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:e.id,value:u,"onUpdate:modelValue":y=>s.value[e.id]=y,onChange:y=>h(e.id),onBlur:y=>v(e.id),class:"mr-3 h-4 w-4 flex-shrink-0"},null,40,te),[[t.vModelRadio,s.value[e.id]]]),t.createElementVNode("span",re,t.toDisplayString(o),1)],2))),128))],8,ee)):e.type==="dropdown"?t.withDirectives((t.openBlock(),t.createElementBlock("select",{key:7,id:`input-${e.id}`,"onUpdate:modelValue":o=>s.value[e.id]=o,"aria-invalid":l(e.id)&&n.value.has(e.id),"aria-describedby":l(e.id)&&n.value.has(e.id)?`${e.id}-error`:void 0,onBlur:o=>v(e.id),onChange:o=>h(e.id),class:t.normalizeClass(["w-full px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors bg-white",{"border-red-500 focus:ring-red-500":l(e.id)&&n.value.has(e.id),"border-gray-300":!l(e.id)||!n.value.has(e.id)}])},[a[1]||(a[1]=t.createElementVNode("option",{value:null,disabled:""},"Select an option...",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.choices,(o,u)=>(t.openBlock(),t.createElementBlock("option",{key:u,value:u},t.toDisplayString(o),9,ae))),128))],42,oe)),[[t.vModelSelect,s.value[e.id]]]):e.type==="checkbox"?(t.openBlock(),t.createElementBlock("div",{key:8,class:"space-y-2",role:"group","aria-invalid":l(e.id)&&n.value.has(e.id),"aria-describedby":l(e.id)&&n.value.has(e.id)?`${e.id}-error`:void 0},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.choices,(o,u)=>(t.openBlock(),t.createElementBlock("label",{key:u,class:t.normalizeClass(["flex items-center p-3 border-2 border-gray-300 rounded-lg cursor-pointer transition-all hover:bg-gray-50",{"border-blue-500 bg-blue-50":(s.value[e.id]||[]).includes(u),"border-gray-300":!(s.value[e.id]||[]).includes(u)}])},[t.withDirectives(t.createElementVNode("input",{type:"checkbox",value:u,"onUpdate:modelValue":y=>s.value[e.id]=y,onChange:y=>h(e.id),onBlur:y=>v(e.id),class:"mr-3 h-4 w-4 flex-shrink-0"},null,40,se),[[t.vModelCheckbox,s.value[e.id]]]),t.createElementVNode("span",le,t.toDisplayString(o),1)],2))),128))],8,ne)):t.createCommentVNode("",!0),l(e.id)&&n.value.has(e.id)?(t.openBlock(),t.createElementBlock("div",{key:9,id:`${e.id}-error`,class:"flex items-center gap-2 mt-2 text-red-600 text-sm",role:"alert"},[a[2]||(a[2]=t.createElementVNode("svg",{class:"w-4 h-4 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"})],-1)),t.createTextVNode(" "+t.toDisplayString(d.value.get(e.id)?.message),1)],8,ie)):t.createCommentVNode("",!0),F(e)?(t.openBlock(),t.createElementBlock("div",{key:10,class:t.normalizeClass(["text-sm mt-2",{"text-amber-600 font-semibold":$(e),"text-gray-500":!$(e)}])},[t.createTextVNode(t.toDisplayString((s.value[e.id]||"").length)+" ",1),e.maxLength?(t.openBlock(),t.createElementBlock("span",ue," / "+t.toDisplayString(e.maxLength),1)):t.createCommentVNode("",!0),a[3]||(a[3]=t.createTextVNode(" characters ",-1))],2)):t.createCommentVNode("",!0)],10,H))),128)),t.createElementVNode("div",ce,[t.createElementVNode("button",{type:"submit",disabled:c.value,class:t.normalizeClass([c.value?"bg-green-600 cursor-default":"bg-blue-600 hover:bg-blue-700","px-8 py-3 rounded-lg text-white font-semibold text-lg transition-colors"])},t.toDisplayString(c.value?"Submitted":"Submit Form"),11,de)]),t.createElementVNode("div",me,t.toDisplayString(T.value)+" / "+t.toDisplayString(z.value)+" required fields completed ",1)],32)])):t.createCommentVNode("",!0)]))}}),ve=(x,g)=>{const m=x.__vccOpts||x;for(const[k,i]of g)m[k]=i;return m},N=ve(pe,[["__scopeId","data-v-cd2c3f48"]]),he={class:"w-full h-full flex flex-col items-center justify-center p-4 bg-gradient-to-br from-blue-50 to-indigo-50 rounded-lg border-2 border-gray-200"},ge={class:"text-center"},be={class:"text-gray-900 font-bold text-lg mb-1 line-clamp-2"},ye={class:"text-gray-600 text-sm mb-2"},xe={key:0,class:"flex items-center justify-center gap-2"},ke={class:"w-32 h-2 bg-gray-200 rounded-full overflow-hidden"},_e={class:"text-xs text-gray-500"},Be={key:1,class:"inline-flex items-center gap-1 px-3 py-1 bg-green-100 text-green-700 rounded-full text-xs font-semibold"},C=t.defineComponent({__name:"Preview",props:{result:{}},setup(x){const g=x,m=t.computed(()=>g.result?.toolName==="presentForm"?g.result.jsonData:null),k=t.computed(()=>g.result?.viewState||null),i=t.computed(()=>m.value?.fields.length||0),s=t.computed(()=>k.value?.submitted||!1),n=t.computed(()=>{if(!m.value||s.value)return 100;const d=m.value.fields.filter(b=>b.required);if(d.length===0)return 0;const c=k.value?.userResponses||{},B=d.filter(b=>{const p=c[b.id];return p==null?!1:typeof p=="string"?p.trim()!=="":Array.isArray(p)?p.length>0:!0}).length;return Math.round(B/d.length*100)});return(d,c)=>(t.openBlock(),t.createElementBlock("div",he,[t.createElementVNode("div",ge,[c[1]||(c[1]=t.createElementVNode("svg",{class:"w-12 h-12 mx-auto mb-3 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),t.createElementVNode("h3",be,t.toDisplayString(m.value?.title||"Form"),1),t.createElementVNode("p",ye,t.toDisplayString(i.value)+" field"+t.toDisplayString(i.value!==1?"s":""),1),s.value?(t.openBlock(),t.createElementBlock("div",Be,[...c[0]||(c[0]=[t.createElementVNode("svg",{class:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1),t.createTextVNode(" Submitted ",-1)])])):(t.openBlock(),t.createElementBlock("div",xe,[t.createElementVNode("div",ke,[t.createElementVNode("div",{class:"h-full bg-blue-600 transition-all duration-300",style:t.normalizeStyle({width:`${n.value}%`})},null,4)]),t.createElementVNode("span",_e,t.toDisplayString(n.value)+"%",1)]))])]))}}),S={..._.pluginCore,viewComponent:N,previewComponent:C},Ee={plugin:S};exports.SAMPLES=_.SAMPLES;exports.TOOL_DEFINITION=_.TOOL_DEFINITION;exports.TOOL_NAME=_.TOOL_NAME;exports.executeForm=_.executeForm;exports.pluginCore=_.pluginCore;exports.Preview=C;exports.View=N;exports.default=Ee;exports.plugin=S;
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./plugin-DbwkQIio.cjs`);let t=require(`vue`);var n={class:`w-full h-full overflow-y-auto p-8`},r={key:0,class:`max-w-3xl w-full mx-auto`},i={key:0,class:`text-gray-900 text-3xl font-bold mb-4 text-center`},a={key:1,class:`text-gray-600 text-center mb-8 text-lg`},o={key:2,class:`bg-red-50 border-2 border-red-500 rounded-lg p-4 mb-6`,role:`alert`},s={class:`text-red-700 space-y-1`},c=[`href`,`onClick`],l=[`id`],u=[`for`],d={key:0,class:`text-red-500 ml-1`,"aria-label":`required`},f={key:0,class:`text-gray-600 text-sm mb-2`},p=[`id`,`onUpdate:modelValue`,`placeholder`,`aria-invalid`,`aria-describedby`,`onBlur`,`onInput`],m=[`id`,`onUpdate:modelValue`,`placeholder`,`rows`,`aria-invalid`,`aria-describedby`,`onBlur`,`onInput`],h=[`id`,`onUpdate:modelValue`,`min`,`max`,`step`,`aria-invalid`,`aria-describedby`,`onBlur`,`onInput`],g=[`id`,`onUpdate:modelValue`,`min`,`max`,`aria-invalid`,`aria-describedby`,`onBlur`,`onChange`],_=[`id`,`onUpdate:modelValue`,`aria-invalid`,`aria-describedby`,`onBlur`,`onChange`],v=[`aria-invalid`,`aria-describedby`],y=[`name`,`value`,`onUpdate:modelValue`,`onChange`,`onBlur`],b={class:`text-gray-800`},x=[`id`,`onUpdate:modelValue`,`aria-invalid`,`aria-describedby`,`onBlur`,`onChange`],S=[`value`],C=[`aria-invalid`,`aria-describedby`],w=[`value`,`onUpdate:modelValue`,`onChange`,`onBlur`],T={class:`text-gray-800`},E=[`id`],D={key:0},O={class:`mt-8 flex justify-center`},k=[`disabled`],A={class:`mt-4 text-center text-gray-600 text-sm`},j=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})((0,t.defineComponent)({__name:`View`,props:{selectedResult:{},sendTextMessage:{type:Function}},emits:[`updateResult`],setup(e,{emit:j}){let M=e,N=j,P=(0,t.ref)(null),F=(0,t.ref)({}),I=(0,t.ref)(new Set),L=(0,t.ref)(new Map),R=(0,t.ref)(!1),z=(0,t.ref)(!1),B=(0,t.ref)(!1);(0,t.watch)(()=>M.selectedResult,(e,t)=>{if(e?.toolName===`presentForm`&&e.jsonData&&(!t||!t.jsonData||t.uuid!==e.uuid||t.jsonData!==e.jsonData)){if(B.value=!0,P.value=e.jsonData,F.value={},P.value.fields.forEach(e=>{F.value[e.id]=V(e)}),e.viewState){let t=e.viewState;t.userResponses&&Object.assign(F.value,t.userResponses),t.touched&&(I.value=new Set(t.touched),t.touched.forEach(e=>{q(e)})),t.submitted!==void 0&&(R.value=t.submitted)}B.value=!1}},{immediate:!0}),(0,t.watch)([F,I,R],()=>{B.value||!M.selectedResult||N(`updateResult`,{...M.selectedResult,viewState:{userResponses:{...F.value},touched:Array.from(I.value),submitted:R.value}})},{deep:!0});function V(e){let t=e;if(t.defaultValue!==void 0)switch(e.type){case`radio`:case`dropdown`:{let n=e.choices.indexOf(t.defaultValue);return n===-1?null:n}case`checkbox`:return Array.isArray(t.defaultValue)?t.defaultValue.map(t=>e.choices.indexOf(t)).filter(e=>e!==-1):[];default:return t.defaultValue}switch(e.type){case`text`:case`textarea`:return``;case`number`:return e.min===void 0?0:e.min;case`date`:case`time`:return``;case`radio`:case`dropdown`:return null;case`checkbox`:return[];default:return null}}function H(e){return e==null?!0:typeof e==`string`?e.trim()===``:Array.isArray(e)?e.length===0:!1}function U(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function W(e){try{return new URL(e),!0}catch{return!1}}function G(e){return/^[\d\s\-+()]+$/.test(e)&&e.replace(/\D/g,``).length>=10}function K(e,t){if(e.required&&H(t))return`${e.label} is required`;if(H(t))return null;switch(e.type){case`text`:{let n=e;if(n.validation===`email`&&!U(t))return`Please enter a valid email address`;if(n.validation===`url`&&!W(t))return`Please enter a valid URL`;if(n.validation===`phone`&&!G(t))return`Please enter a valid phone number`;if(typeof n.validation==`string`&&n.validation!==`email`&&n.validation!==`url`&&n.validation!==`phone`)try{if(!new RegExp(n.validation).test(t))return`${e.label} format is invalid`}catch{console.warn(`Invalid regex pattern: ${n.validation}`)}break}case`textarea`:{let n=e;if(n.minLength&&t.length<n.minLength)return`Must be at least ${n.minLength} characters (currently ${t.length})`;if(n.maxLength&&t.length>n.maxLength)return`Must be no more than ${n.maxLength} characters (currently ${t.length})`;break}case`number`:{let n=e;if(n.min!==void 0&&t<n.min)return`Must be at least ${n.min}`;if(n.max!==void 0&&t>n.max)return`Must be no more than ${n.max}`;break}case`date`:{let n=e;if(n.minDate&&t<n.minDate)return`Date must be on or after ${n.minDate}`;if(n.maxDate&&t>n.maxDate)return`Date must be on or before ${n.maxDate}`;break}case`checkbox`:{let n=e,r=t?.length||0;if(n.minSelections&&r<n.minSelections)return`Please select at least ${n.minSelections} option${n.minSelections>1?`s`:``}`;if(n.maxSelections&&r>n.maxSelections)return`Please select no more than ${n.maxSelections} option${n.maxSelections>1?`s`:``}`;break}}return null}function q(e){let t=P.value?.fields.find(t=>t.id===e);if(!t)return!0;let n=F.value[e],r=K(t,n);return r?(L.value.set(e,{fieldId:e,message:r,type:`custom`}),!1):(L.value.delete(e),!0)}function J(e){I.value.add(e),q(e)}function Y(e){I.value.has(e)&&q(e)}function X(e){return L.value.has(e)}function Z(e){let t=document.getElementById(`input-${e}`);t&&(t.focus(),t.scrollIntoView({behavior:`smooth`,block:`center`}))}function Q(e){return(e.type===`text`||e.type===`textarea`)&&e.maxLength!==void 0}function $(e){if(e.type!==`text`&&e.type!==`textarea`)return!1;let t=e.maxLength;return t?(F.value[e.id]||``).length/t>.9:!1}let ee=(0,t.computed)(()=>P.value?.fields.filter(e=>e.required).length||0),te=(0,t.computed)(()=>P.value?P.value.fields.filter(e=>e.required&&!H(F.value[e.id])).length:0);function ne(){if(R.value)return;if(P.value?.fields.forEach(e=>{I.value.add(e.id),q(e.id)}),L.value.size>0){z.value=!0;let e=Array.from(L.value.keys())[0];Z(e);return}let e={};P.value?.fields.forEach(t=>{let n=F.value[t.id];t.type===`radio`||t.type===`dropdown`?n==null?e[t.id]=null:e[t.id]=t.choices[n]:t.type===`checkbox`?e[t.id]=(n||[]).map(e=>t.choices[e]):e[t.id]=n});let t=JSON.stringify({formSubmission:{formTitle:P.value?.title||`Form`,responses:e}},null,2);R.value=!0,M.sendTextMessage(t)}return(e,j)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,n,[P.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,r,[P.value.title?((0,t.openBlock)(),(0,t.createElementBlock)(`h2`,i,(0,t.toDisplayString)(P.value.title),1)):(0,t.createCommentVNode)(``,!0),P.value.description?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,a,(0,t.toDisplayString)(P.value.description),1)):(0,t.createCommentVNode)(``,!0),z.value&&L.value.size>0?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,o,[j[0]||=(0,t.createElementVNode)(`h3`,{class:`text-red-800 font-semibold mb-2 flex items-center gap-2`},[(0,t.createElementVNode)(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`,"aria-hidden":`true`},[(0,t.createElementVNode)(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z`,"clip-rule":`evenodd`})]),(0,t.createTextVNode)(` Please fix the following errors: `)],-1),(0,t.createElementVNode)(`ul`,s,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(L.value,([e,n])=>((0,t.openBlock)(),(0,t.createElementBlock)(`li`,{key:e},[(0,t.createElementVNode)(`a`,{href:`#${e}`,onClick:(0,t.withModifiers)(t=>Z(e),[`prevent`]),class:`hover:underline cursor-pointer`},(0,t.toDisplayString)(n.message),9,c)]))),128))])])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`form`,{onSubmit:(0,t.withModifiers)(ne,[`prevent`]),class:`space-y-6`},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(P.value.fields,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:e.id,id:e.id,class:(0,t.normalizeClass)([`form-field`,{"has-error":X(e.id)&&I.value.has(e.id)}])},[(0,t.createElementVNode)(`label`,{for:`input-${e.id}`,class:(0,t.normalizeClass)([`block text-gray-800 font-semibold mb-2`,{"text-red-600":X(e.id)&&I.value.has(e.id)}])},[(0,t.createTextVNode)((0,t.toDisplayString)(e.label)+` `,1),e.required?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,d,`*`)):(0,t.createCommentVNode)(``,!0)],10,u),e.description?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,f,(0,t.toDisplayString)(e.description),1)):(0,t.createCommentVNode)(``,!0),e.type===`text`?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:1,id:`input-${e.id}`,"onUpdate:modelValue":t=>F.value[e.id]=t,type:`text`,placeholder:e.placeholder,"aria-invalid":X(e.id)&&I.value.has(e.id),"aria-describedby":X(e.id)&&I.value.has(e.id)?`${e.id}-error`:void 0,onBlur:t=>J(e.id),onInput:t=>Y(e.id),class:(0,t.normalizeClass)([`w-full px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors`,{"border-red-500 focus:ring-red-500":X(e.id)&&I.value.has(e.id),"border-gray-300":!X(e.id)||!I.value.has(e.id)}])},null,42,p)),[[t.vModelText,F.value[e.id]]]):e.type===`textarea`?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`textarea`,{key:2,id:`input-${e.id}`,"onUpdate:modelValue":t=>F.value[e.id]=t,placeholder:e.placeholder,rows:e.rows||4,"aria-invalid":X(e.id)&&I.value.has(e.id),"aria-describedby":X(e.id)&&I.value.has(e.id)?`${e.id}-error`:void 0,onBlur:t=>J(e.id),onInput:t=>Y(e.id),class:(0,t.normalizeClass)([`w-full px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors resize-y`,{"border-red-500 focus:ring-red-500":X(e.id)&&I.value.has(e.id),"border-gray-300":!X(e.id)||!I.value.has(e.id)}])},null,42,m)),[[t.vModelText,F.value[e.id]]]):e.type===`number`?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:3,id:`input-${e.id}`,"onUpdate:modelValue":t=>F.value[e.id]=t,type:`number`,min:e.min,max:e.max,step:e.step,"aria-invalid":X(e.id)&&I.value.has(e.id),"aria-describedby":X(e.id)&&I.value.has(e.id)?`${e.id}-error`:void 0,onBlur:t=>J(e.id),onInput:t=>Y(e.id),class:(0,t.normalizeClass)([`w-full px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors`,{"border-red-500 focus:ring-red-500":X(e.id)&&I.value.has(e.id),"border-gray-300":!X(e.id)||!I.value.has(e.id)}])},null,42,h)),[[t.vModelText,F.value[e.id],void 0,{number:!0}]]):e.type===`date`?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:4,id:`input-${e.id}`,"onUpdate:modelValue":t=>F.value[e.id]=t,type:`date`,min:e.minDate,max:e.maxDate,"aria-invalid":X(e.id)&&I.value.has(e.id),"aria-describedby":X(e.id)&&I.value.has(e.id)?`${e.id}-error`:void 0,onBlur:t=>J(e.id),onChange:t=>Y(e.id),class:(0,t.normalizeClass)([`w-full px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors`,{"border-red-500 focus:ring-red-500":X(e.id)&&I.value.has(e.id),"border-gray-300":!X(e.id)||!I.value.has(e.id)}])},null,42,g)),[[t.vModelText,F.value[e.id]]]):e.type===`time`?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`input`,{key:5,id:`input-${e.id}`,"onUpdate:modelValue":t=>F.value[e.id]=t,type:`time`,"aria-invalid":X(e.id)&&I.value.has(e.id),"aria-describedby":X(e.id)&&I.value.has(e.id)?`${e.id}-error`:void 0,onBlur:t=>J(e.id),onChange:t=>Y(e.id),class:(0,t.normalizeClass)([`w-full px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors`,{"border-red-500 focus:ring-red-500":X(e.id)&&I.value.has(e.id),"border-gray-300":!X(e.id)||!I.value.has(e.id)}])},null,42,_)),[[t.vModelText,F.value[e.id]]]):e.type===`radio`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:6,class:`space-y-2`,role:`radiogroup`,"aria-invalid":X(e.id)&&I.value.has(e.id),"aria-describedby":X(e.id)&&I.value.has(e.id)?`${e.id}-error`:void 0},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.choices,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{key:r,class:(0,t.normalizeClass)([`flex items-center p-3 border-2 border-gray-300 rounded-lg cursor-pointer transition-all hover:bg-gray-50`,{"border-blue-500 bg-blue-50":F.value[e.id]===r,"border-gray-300":F.value[e.id]!==r}])},[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{type:`radio`,name:e.id,value:r,"onUpdate:modelValue":t=>F.value[e.id]=t,onChange:t=>Y(e.id),onBlur:t=>J(e.id),class:`mr-3 h-4 w-4 flex-shrink-0`},null,40,y),[[t.vModelRadio,F.value[e.id]]]),(0,t.createElementVNode)(`span`,b,(0,t.toDisplayString)(n),1)],2))),128))],8,v)):e.type===`dropdown`?(0,t.withDirectives)(((0,t.openBlock)(),(0,t.createElementBlock)(`select`,{key:7,id:`input-${e.id}`,"onUpdate:modelValue":t=>F.value[e.id]=t,"aria-invalid":X(e.id)&&I.value.has(e.id),"aria-describedby":X(e.id)&&I.value.has(e.id)?`${e.id}-error`:void 0,onBlur:t=>J(e.id),onChange:t=>Y(e.id),class:(0,t.normalizeClass)([`w-full px-4 py-2 border-2 border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition-colors bg-white`,{"border-red-500 focus:ring-red-500":X(e.id)&&I.value.has(e.id),"border-gray-300":!X(e.id)||!I.value.has(e.id)}])},[j[1]||=(0,t.createElementVNode)(`option`,{value:null,disabled:``},`Select an option...`,-1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.choices,(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`option`,{key:n,value:n},(0,t.toDisplayString)(e),9,S))),128))],42,x)),[[t.vModelSelect,F.value[e.id]]]):e.type===`checkbox`?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:8,class:`space-y-2`,role:`group`,"aria-invalid":X(e.id)&&I.value.has(e.id),"aria-describedby":X(e.id)&&I.value.has(e.id)?`${e.id}-error`:void 0},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.choices,(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`label`,{key:r,class:(0,t.normalizeClass)([`flex items-center p-3 border-2 border-gray-300 rounded-lg cursor-pointer transition-all hover:bg-gray-50`,{"border-blue-500 bg-blue-50":(F.value[e.id]||[]).includes(r),"border-gray-300":!(F.value[e.id]||[]).includes(r)}])},[(0,t.withDirectives)((0,t.createElementVNode)(`input`,{type:`checkbox`,value:r,"onUpdate:modelValue":t=>F.value[e.id]=t,onChange:t=>Y(e.id),onBlur:t=>J(e.id),class:`mr-3 h-4 w-4 flex-shrink-0`},null,40,w),[[t.vModelCheckbox,F.value[e.id]]]),(0,t.createElementVNode)(`span`,T,(0,t.toDisplayString)(n),1)],2))),128))],8,C)):(0,t.createCommentVNode)(``,!0),X(e.id)&&I.value.has(e.id)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:9,id:`${e.id}-error`,class:`flex items-center gap-2 mt-2 text-red-600 text-sm`,role:`alert`},[j[2]||=(0,t.createElementVNode)(`svg`,{class:`w-4 h-4 flex-shrink-0`,fill:`currentColor`,viewBox:`0 0 20 20`,"aria-hidden":`true`},[(0,t.createElementVNode)(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z`,"clip-rule":`evenodd`})],-1),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(L.value.get(e.id)?.message),1)],8,E)):(0,t.createCommentVNode)(``,!0),Q(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:10,class:(0,t.normalizeClass)([`text-sm mt-2`,{"text-amber-600 font-semibold":$(e),"text-gray-500":!$(e)}])},[(0,t.createTextVNode)((0,t.toDisplayString)((F.value[e.id]||``).length)+` `,1),e.maxLength?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,D,` / `+(0,t.toDisplayString)(e.maxLength),1)):(0,t.createCommentVNode)(``,!0),j[3]||=(0,t.createTextVNode)(` characters `,-1)],2)):(0,t.createCommentVNode)(``,!0)],10,l))),128)),(0,t.createElementVNode)(`div`,O,[(0,t.createElementVNode)(`button`,{type:`submit`,disabled:R.value,class:(0,t.normalizeClass)([R.value?`bg-green-600 cursor-default`:`bg-blue-600 hover:bg-blue-700`,`px-8 py-3 rounded-lg text-white font-semibold text-lg transition-colors`])},(0,t.toDisplayString)(R.value?`Submitted`:`Submit Form`),11,k)]),(0,t.createElementVNode)(`div`,A,(0,t.toDisplayString)(te.value)+` / `+(0,t.toDisplayString)(ee.value)+` required fields completed `,1)],32)])):(0,t.createCommentVNode)(``,!0)]))}}),[[`__scopeId`,`data-v-cd2c3f48`]]),M={class:`w-full h-full flex flex-col items-center justify-center p-4 bg-gradient-to-br from-blue-50 to-indigo-50 rounded-lg border-2 border-gray-200`},N={class:`text-center`},P={class:`text-gray-900 font-bold text-lg mb-1 line-clamp-2`},F={class:`text-gray-600 text-sm mb-2`},I={key:0,class:`flex items-center justify-center gap-2`},L={class:`w-32 h-2 bg-gray-200 rounded-full overflow-hidden`},R={class:`text-xs text-gray-500`},z={key:1,class:`inline-flex items-center gap-1 px-3 py-1 bg-green-100 text-green-700 rounded-full text-xs font-semibold`},B=(0,t.defineComponent)({__name:`Preview`,props:{result:{}},setup(e){let n=e,r=(0,t.computed)(()=>n.result?.toolName===`presentForm`?n.result.jsonData:null),i=(0,t.computed)(()=>n.result?.viewState||null),a=(0,t.computed)(()=>r.value?.fields.length||0),o=(0,t.computed)(()=>i.value?.submitted||!1),s=(0,t.computed)(()=>{if(!r.value||o.value)return 100;let e=r.value.fields.filter(e=>e.required);if(e.length===0)return 0;let t=i.value?.userResponses||{},n=e.filter(e=>{let n=t[e.id];return n==null?!1:typeof n==`string`?n.trim()!==``:Array.isArray(n)?n.length>0:!0}).length;return Math.round(n/e.length*100)});return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,M,[(0,t.createElementVNode)(`div`,N,[n[1]||=(0,t.createElementVNode)(`svg`,{class:`w-12 h-12 mx-auto mb-3 text-blue-600`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z`})],-1),(0,t.createElementVNode)(`h3`,P,(0,t.toDisplayString)(r.value?.title||`Form`),1),(0,t.createElementVNode)(`p`,F,(0,t.toDisplayString)(a.value)+` field`+(0,t.toDisplayString)(a.value===1?``:`s`),1),o.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,z,[...n[0]||=[(0,t.createElementVNode)(`svg`,{class:`w-3 h-3`,fill:`currentColor`,viewBox:`0 0 20 20`},[(0,t.createElementVNode)(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z`,"clip-rule":`evenodd`})],-1),(0,t.createTextVNode)(` Submitted `,-1)]])):((0,t.openBlock)(),(0,t.createElementBlock)(`div`,I,[(0,t.createElementVNode)(`div`,L,[(0,t.createElementVNode)(`div`,{class:`h-full bg-blue-600 transition-all duration-300`,style:(0,t.normalizeStyle)({width:`${s.value}%`})},null,4)]),(0,t.createElementVNode)(`span`,R,(0,t.toDisplayString)(s.value)+`%`,1)]))])]))}}),V={...e.n,viewComponent:j,previewComponent:B},H={plugin:V};exports.Preview=B,exports.SAMPLES=e.r,exports.TOOL_DEFINITION=e.i,exports.TOOL_NAME=e.a,exports.View=j,exports.default=H,exports.executeForm=e.t,exports.plugin=V,exports.pluginCore=e.n;