@encatch/schema 1.3.0-beta.2 → 1.3.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +597 -572
- package/dist/esm/index.js.map +2 -2
- package/dist/types/schemas/api/fetch-feedback-schema.d.ts +90 -72
- package/dist/types/schemas/api/submit-feedback-schema.d.ts +6 -6
- package/dist/types/schemas/fields/answer-schema.d.ts +3 -3
- package/dist/types/schemas/fields/app-props-schema.d.ts +45 -36
- package/dist/types/schemas/fields/field-schema.d.ts +103 -85
- package/dist/types/schemas/fields/form-properties-schema.d.ts +45 -36
- package/package.json +1 -1
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/schemas/fields/field-schema.ts", "../../src/schemas/fields/translations-schema.ts", "../../src/schemas/fields/completion-cta-schema.ts", "../../src/schemas/fields/answer-schema.ts", "../../src/schemas/fields/form-schema.ts", "../../src/schemas/fields/form-properties-schema.ts", "../../src/schemas/fields/other-screen-schema.ts", "../../src/schemas/fields/theme-schema.ts", "../../src/schemas/fields/auto-trigger-schema.ts", "../../src/schemas/fields/layout-schema.ts", "../../src/schemas/fields/other-properties-schema.ts", "../../src/schemas/api/other-schema.ts", "../../src/schemas/api/submit-feedback-schema.ts", "../../src/schemas/api/fetch-feedback-schema.ts", "../../src/schemas/api/refine-text-schema.ts", "../../src/helpers/case-convert-helper.ts", "../../src/schemas/fields/app-props-schema.ts", "../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from \"zod\";\nimport { sectionTranslationsByLanguageSchema } from \"./translations-schema\";\nimport { completionCtaSchema } from \"./completion-cta-schema\";\n\n// Question type enum for different form field types\nexport const questionTypeSchema = z\n .enum([\n \"rating\",\n \"single_choice\",\n \"nps\",\n \"nested_selection\",\n \"multiple_choice_multiple\",\n \"short_answer\",\n \"long_text\",\n \"annotation\",\n \"welcome\",\n \"thank_you\",\n \"message_panel\",\n \"yes_no\",\n \"rating_matrix\",\n \"matrix_single_choice\",\n \"matrix_multiple_choice\",\n \"exit_form\",\n \"consent\",\n \"date\",\n \"csat\",\n \"opinion_scale\",\n \"ranking\",\n \"picture_choice\",\n \"signature\",\n \"file_upload\",\n \"email\",\n \"number\",\n \"website\",\n \"phone_number\",\n \"address\",\n \"video_audio\",\n \"scheduler\",\n \"qna_with_ai\",\n \"payments_upi\",\n ])\n .describe(\"Enumeration of all supported question types for form fields\");\n\n// Constants for question types (explicit literal values for proper type inference)\nexport const QuestionTypes = {\n RATING: \"rating\" as const,\n SINGLE_CHOICE: \"single_choice\" as const,\n NPS: \"nps\" as const,\n NESTED_SELECTION: \"nested_selection\" as const,\n MULTIPLE_CHOICE_MULTIPLE: \"multiple_choice_multiple\" as const,\n SHORT_ANSWER: \"short_answer\" as const,\n LONG_TEXT: \"long_text\" as const,\n ANNOTATION: \"annotation\" as const,\n WELCOME: \"welcome\" as const,\n THANK_YOU: \"thank_you\" as const,\n MESSAGE_PANEL: \"message_panel\" as const,\n YES_NO: \"yes_no\" as const,\n RATING_MATRIX: \"rating_matrix\" as const,\n MATRIX_SINGLE_CHOICE: \"matrix_single_choice\" as const,\n MATRIX_MULTIPLE_CHOICE: \"matrix_multiple_choice\" as const,\n EXIT_FORM: \"exit_form\" as const,\n CONSENT: \"consent\" as const,\n DATE: \"date\" as const,\n CSAT: \"csat\" as const,\n OPINION_SCALE: \"opinion_scale\" as const,\n RANKING: \"ranking\" as const,\n PICTURE_CHOICE: \"picture_choice\" as const,\n SIGNATURE: \"signature\" as const,\n FILE_UPLOAD: \"file_upload\" as const,\n EMAIL: \"email\" as const,\n NUMBER: \"number\" as const,\n WEBSITE: \"website\" as const,\n PHONE_NUMBER: \"phone_number\" as const,\n ADDRESS: \"address\" as const,\n VIDEO_AUDIO: \"video_audio\" as const,\n SCHEDULER: \"scheduler\" as const,\n QNA_WITH_AI: \"qna_with_ai\" as const,\n PAYMENTS_UPI: \"payments_upi\" as const,\n} as const;\n\n// Validation rule type enum\nexport const validationRuleTypeSchema = z\n .enum([\n \"required\",\n \"min\",\n \"max\",\n \"minLength\",\n \"maxLength\",\n \"pattern\",\n \"email\",\n \"url\",\n \"custom\",\n ])\n .describe(\"Enumeration of all supported validation rule types\");\n\n// Constants for validation rule types (explicit literal values for proper type inference)\nexport const ValidationRuleTypes = {\n REQUIRED: \"required\" as const,\n MIN: \"min\" as const,\n MAX: \"max\" as const,\n MIN_LENGTH: \"minLength\" as const,\n MAX_LENGTH: \"maxLength\" as const,\n PATTERN: \"pattern\" as const,\n EMAIL: \"email\" as const,\n URL: \"url\" as const,\n CUSTOM: \"custom\" as const,\n} as const;\n\n// Validation rule schema for question validations\nexport const validationRuleSchema = z\n .object({\n type: validationRuleTypeSchema.describe(\"Type of validation rule to apply\"),\n value: z\n .union([z.string(), z.number(), z.boolean()])\n .optional()\n .describe(\"Value for the validation rule (string, number, or boolean)\"),\n message: z\n .string()\n .optional()\n .describe(\"Custom error message when validation fails\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this validation rule\"),\n })\n .describe(\"Schema defining validation rules for question responses\");\n\n// Visibility condition operator enum\nexport const visibilityConditionOperatorSchema = z\n .enum([\n \"equals\",\n \"not_equals\",\n \"contains\",\n \"not_contains\",\n \"greater_than\",\n \"less_than\",\n \"is_empty\",\n \"is_not_empty\",\n ])\n .describe(\"Enumeration of all supported visibility condition operators\");\n\n// Constants for visibility condition operators (explicit literal values for proper type inference)\nexport const VisibilityConditionOperators = {\n EQUALS: \"equals\" as const,\n NOT_EQUALS: \"not_equals\" as const,\n CONTAINS: \"contains\" as const,\n NOT_CONTAINS: \"not_contains\" as const,\n GREATER_THAN: \"greater_than\" as const,\n LESS_THAN: \"less_than\" as const,\n IS_EMPTY: \"is_empty\" as const,\n IS_NOT_EMPTY: \"is_not_empty\" as const,\n} as const;\n\n// Visibility condition schema for conditional visibility\nexport const visibilityConditionSchema = z\n .object({\n field: z.string().describe(\"ID of the field to check against\"),\n operator: visibilityConditionOperatorSchema.describe(\n \"Comparison operator for the condition\",\n ),\n value: z\n .union([z.string(), z.number(), z.boolean()])\n .optional()\n .describe(\"Value to compare against (string, number, or boolean)\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this visibility condition\"),\n })\n .describe(\n \"Schema defining conditions that control when questions are visible\",\n );\n\n// Section schema for organizing questions\nexport const sectionSchema = z\n .object({\n id: z.string().describe(\"Unique identifier for the section\"),\n title: z.string().min(1).max(200).describe(\"Display title for the section\"),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe(\"Optional detailed description or help text for the section\"),\n showTitle: z\n .boolean()\n .default(true)\n .describe(\"Whether to show the section title in the UI\"),\n showDescription: z\n .boolean()\n .default(true)\n .describe(\"Whether to show the section description in the UI\"),\n nextButtonLabel: z\n .string()\n .min(1)\n .max(50)\n .optional()\n .describe(\"Label for the next button when navigating from this section\"),\n translations: sectionTranslationsByLanguageSchema\n .optional()\n .describe(\n \"Per-language section copy (title, optional description and nextButtonLabel), keyed by language code\",\n ),\n inAppSingleQuestion: z\n .boolean()\n .default(false)\n .describe(\n \"When true, the native app shows one question at a time within this section\",\n ),\n isPreviousAllowed: z\n .boolean()\n .default(false)\n .optional()\n .describe(\n \"When the global previousButton mode is 'auto', controls whether the Previous button is shown for this section. Defaults to false (hidden).\",\n ),\n questionIds: z\n .array(z.string())\n .min(1)\n .describe(\"Array of question IDs that belong to this section\"),\n })\n .describe(\n \"Schema defining sections that organize questions into logical groups\",\n );\n\n// Question status enum\nexport const questionStatusSchema = z.enum([\"D\", \"P\", \"A\", \"S\"]); // Draft, Published, Archived, Suspended\n\n// Constants for question status (explicit literal values for proper type inference)\nexport const QuestionStatuses = {\n DRAFT: \"D\" as const,\n PUBLISHED: \"P\" as const,\n ARCHIVED: \"A\" as const,\n SUSPENDED: \"S\" as const,\n} as const;\n\n// Display style enum for rating questions\nexport const ratingDisplayStyleSchema = z.enum([\n \"star\",\n \"heart\",\n \"thumbs-up\",\n \"diamond\",\n \"emoji\",\n \"emoji-exp\",\n]);\n\n// Constants for rating display styles (explicit literal values for proper type inference)\nexport const RatingDisplayStyles = {\n STAR: \"star\" as const,\n HEART: \"heart\" as const,\n THUMBS_UP: \"thumbs_up\" as const,\n DIAMOND: \"diamond\" as const,\n EMOJI: \"emoji\" as const,\n EMOJI_EXP: \"emoji_exp\" as const,\n} as const;\n\n// Representation size enum for rating questions\nexport const ratingRepresentationSizeSchema = z.enum([\n \"small\",\n \"medium\",\n \"large\",\n]);\n\n// Constants for rating representation sizes (explicit literal values for proper type inference)\nexport const RatingRepresentationSizes = {\n SMALL: \"small\" as const,\n MEDIUM: \"medium\" as const,\n LARGE: \"large\" as const,\n} as const;\n\n// Display style enum for multiple choice questions\nexport const multipleChoiceDisplayStyleSchema = z.enum([\n \"radio\",\n \"list\",\n \"chip\",\n \"dropdown\",\n \"autosuggest\",\n]);\n\n// Constants for multiple choice display styles (explicit literal values for proper type inference)\nexport const MultipleChoiceDisplayStyles = {\n RADIO: \"radio\" as const,\n LIST: \"list\" as const,\n CHIP: \"chip\" as const,\n DROPDOWN: \"dropdown\" as const,\n AUTOSUGGEST: \"autosuggest\" as const,\n} as const;\n\n// Display style enum for multiple choice multiple questions\nexport const multipleChoiceMultipleDisplayStyleSchema = z.enum([\n \"checkbox\",\n \"list\",\n \"chip\",\n \"autosuggest\",\n]);\n\n// Constants for multiple choice multiple display styles (explicit literal values for proper type inference)\nexport const MultipleChoiceMultipleDisplayStyles = {\n CHECKBOX: \"checkbox\" as const,\n LIST: \"list\" as const,\n CHIP: \"chip\" as const,\n AUTOSUGGEST: \"autosuggest\" as const,\n} as const;\n\n// Display layout for yes/no questions (side-by-side vs stacked)\nexport const yesNoDisplayStyleSchema = z.enum([\"horizontal\", \"vertical\"]);\n\n// Constants for yes/no display styles (explicit literal values for proper type inference)\nexport const YesNoDisplayStyles = {\n HORIZONTAL: \"horizontal\" as const,\n VERTICAL: \"vertical\" as const,\n} as const;\n\n// Choice order options for nested selection questions\nexport const choiceOrderOptionSchema = z.enum([\n \"randomize\",\n \"flip\",\n \"rotate\",\n \"ascending\",\n \"none\",\n]);\n\n// Constants for choice order options (explicit literal values for proper type inference)\nexport const ChoiceOrderOptions = {\n RANDOMIZE: \"randomize\" as const,\n FLIP: \"flip\" as const,\n ROTATE: \"rotate\" as const,\n ASCENDING: \"ascending\" as const,\n NONE: \"none\" as const,\n} as const;\n\n// Main Question schema\nexport const questionSchema = z\n .object({\n id: z.string().describe(\"Unique identifier for the question\"),\n slug: z\n .string()\n .min(1)\n .max(128)\n .optional()\n .describe(\n \"Optional stable identifier for the question (e.g. URLs, analytics, or integrations)\",\n ),\n type: questionTypeSchema.describe(\n \"The type of question (rating, single_choice, etc.)\",\n ),\n title: z\n .string()\n .min(1)\n .max(200)\n .describe(\"The main title/question text displayed to users\"),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe(\"Optional detailed description or help text\"),\n describe: z\n .string()\n .max(2000)\n .optional()\n .describe(\n \"LLM tool call description for better AI understanding and context\",\n ),\n required: z\n .boolean()\n .default(false)\n .describe(\"Whether this question must be answered\"),\n isHidden: z\n .boolean()\n .default(false)\n .describe(\"When true, the question is hidden from the form UI\"),\n errorMessage: z\n .string()\n .max(500)\n .optional()\n .describe(\"Custom error message when validation fails\"),\n validations: z\n .array(validationRuleSchema)\n .optional()\n .default([])\n .describe(\"Array of validation rules to apply\"),\n visibility: z\n .array(visibilityConditionSchema)\n .optional()\n .default([])\n .describe(\"Conditions that control when this question is shown\"),\n sectionId: z\n .string()\n .optional()\n .describe(\"ID of the section this question belongs to\"),\n status: questionStatusSchema.describe(\n \"Current status of the question (Draft, Published, etc.)\",\n ),\n textAlign: z\n .enum([\"left\", \"center\", \"justify\"])\n .optional()\n .default(\"left\")\n .describe(\n \"Text alignment for the question title and description; `justify` is intended for consent questions (full-width justified consent body markdown)\",\n ),\n nextButtonLabel: z\n .string()\n .min(1)\n .max(50)\n .default(\"Next\")\n .describe(\n \"Label for the next button when advancing past this question (overrides section or form defaults when set)\",\n ),\n showQuestionTitle: z\n .boolean()\n .default(true)\n .describe(\"Whether to display the question title; defaults to true\"),\n questionMediaUrl: z\n .string()\n .url()\n .optional()\n .describe(\n \"Optional URL for media (image or video) displayed alongside the question\",\n ),\n questionMediaType: z\n .enum([\"image\", \"video\", \"youtube\", \"vimeo\"])\n .optional()\n .describe(\n \"Type of media referenced by questionMediaUrl; one of 'image', 'video', 'youtube', or 'vimeo'\",\n ),\n })\n .describe(\"Base schema for all question types with common properties\");\n\n// Rating question schema (extends base question with specific rating properties)\nexport const ratingQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"rating\").describe(\"Must be exactly 'rating'\"),\n showLabels: z\n .boolean()\n .optional()\n .describe(\"Whether to show min/max labels\"),\n minLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label for the minimum rating value\"),\n maxLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label for the maximum rating value\"),\n displayStyle: ratingDisplayStyleSchema\n .optional()\n .describe(\"Visual style for rating display\"),\n numberOfRatings: z\n .number()\n .int()\n .min(1)\n .max(10)\n .describe(\"Number of rating options (1-10)\"),\n representationSize: ratingRepresentationSizeSchema\n .optional()\n .describe(\"Size of rating visual elements\"),\n color: z\n .string()\n .regex(/^#[0-9A-F]{6}$/i, \"Must be a valid hex color\")\n .optional()\n .describe(\"Hex color for rating elements\"),\n })\n .describe(\"Schema for rating questions with customizable display options\");\n\n// Annotation question schema (extends base question with annotation properties)\nexport const annotationQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"annotation\").describe(\"Must be exactly 'annotation'\"),\n annotationText: z\n .string()\n .max(1000)\n .optional()\n .describe(\"Text to display when annotation is provided\"),\n noAnnotationText: z\n .string()\n .max(500)\n .optional()\n .describe(\"Text to display when no annotation is provided\"),\n })\n .describe(\n \"Schema for annotation questions that provide additional context or instructions\",\n );\n\n// Welcome question schema (display-only screen, no answer captured)\nexport const welcomeQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"welcome\").describe(\"Must be exactly 'welcome'\"),\n title: z\n .string()\n .min(1)\n .max(200)\n .describe(\"The main heading displayed on the welcome screen\"),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe(\"Optional sub-text body shown below the heading\"),\n imageUrl: z\n .string()\n .url()\n .optional()\n .describe(\"Optional image URL displayed on the welcome screen\"),\n })\n .describe(\n \"Schema for a welcome screen displayed at the start or inline within a form\",\n );\n\n// Thank you question schema (display-only screen, no answer captured)\nexport const thankYouQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"thank_you\").describe(\"Must be exactly 'thank_you'\"),\n title: z\n .string()\n .min(1)\n .max(200)\n .describe(\"The main heading displayed on the thank you screen\"),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe(\n \"Optional thank you body text; rendered as Markdown where the form supports it\",\n ),\n imageUrl: z\n .string()\n .url()\n .optional()\n .describe(\"Optional image URL displayed on the thank you screen\"),\n completionCta: completionCtaSchema\n .optional()\n .describe(\n \"Optional CTA shown after submission; supports primary + optional secondary buttons with per-surface action routing (inApp / link), and optional auto-trigger timer; when absent the engine falls back to nextButtonLabel as a single dismiss button\",\n ),\n })\n .describe(\n \"Schema for a thank you screen shown at the end or inline within a form\",\n );\n\n// Message panel question schema (display-only informational panel, same shape as welcome; no answer captured)\nexport const messagePanelQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"message_panel\")\n .describe(\"Must be exactly 'message_panel'\"),\n title: z\n .string()\n .min(1)\n .max(200)\n .describe(\"The main heading displayed on the message panel\"),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe(\"Optional body text shown below the heading\"),\n imageUrl: z\n .string()\n .url()\n .optional()\n .describe(\"Optional image URL displayed on the message panel\"),\n })\n .describe(\n \"Schema for an inline message panel (informational); distinct from welcome for UI semantics and analytics\",\n );\n\n// Exit form question schema (no UI \u2014 signals end of survey; used in branch logic to terminate a path without a thank-you screen)\nexport const exitFormQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"exit_form\").describe(\"Must be exactly 'exit_form'\"),\n completionCta: completionCtaSchema\n .optional()\n .describe(\n \"Optional silent completion action fired when the exit_form terminal is reached; no UI is shown \u2014 use redirect_internal / redirect_external for silent redirects or app_navigate for host routing; autoTriggerDelayMs defaults to 0 (immediate) when a configured action is present\",\n ),\n })\n .describe(\n \"Schema for an exit marker that silently ends the survey; carries no UI and captures no answer \u2014 intended for branch logic paths that should terminate without showing a thank-you screen\",\n );\n\n// Yes/no question schema (binary answer stored as boolean in responses)\nexport const yesNoQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"yes_no\").describe(\"Must be exactly 'yes_no'\"),\n yesLabel: z\n .string()\n .min(1)\n .max(50)\n .optional()\n .describe(\n \"Label for the Yes option (defaults to 'Yes' in the UI if omitted)\",\n ),\n noLabel: z\n .string()\n .min(1)\n .max(50)\n .optional()\n .describe(\n \"Label for the No option (defaults to 'No' in the UI if omitted)\",\n ),\n displayStyle: yesNoDisplayStyleSchema\n .optional()\n .describe(\n \"Layout for the Yes/No controls (horizontal row or vertical stack)\",\n ),\n })\n .describe(\n \"Schema for yes/no questions with optional custom labels and layout\",\n );\n\n// Consent question schema (single checkbox \u2014 answer is boolean true/false)\nexport const consentQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"consent\").describe(\"Must be exactly 'consent'\"),\n })\n .describe(\n \"Schema for a single-checkbox consent question; use description (rendered as markdown) for the checkbox label text and any policy/terms links; answer is boolean (true = checked)\",\n );\n\n// \u2500\u2500\u2500 Rating Matrix \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// Display style enum for rating matrix scale points (how each scale choice looks per row)\nexport const ratingMatrixDisplayStyleSchema = z.enum([\n \"radio\",\n \"star\",\n \"emoji\",\n \"button\",\n]);\n\n// Constants for rating matrix display styles (explicit literal values for proper type inference)\nexport const RatingMatrixDisplayStyles = {\n RADIO: \"radio\" as const,\n STAR: \"star\" as const,\n EMOJI: \"emoji\" as const,\n BUTTON: \"button\" as const,\n} as const;\n\n// Individual statement (row) for rating matrix questions\nexport const ratingMatrixStatementSchema = z\n .object({\n id: z\n .string()\n .describe(\n \"Unique identifier for this statement (system time milliseconds)\",\n ),\n value: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Internal value / export key for this statement\"),\n label: z\n .string()\n .min(1)\n .max(200)\n .describe(\"Display text shown to users for this statement\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this statement\"),\n })\n .describe(\"Schema for an individual statement (row) in a rating matrix\");\n\n// A single point on a custom rating scale\nexport const ratingMatrixScalePointSchema = z\n .object({\n id: z.string().describe(\"Unique identifier for this scale point\"),\n value: z\n .union([z.number(), z.string()])\n .describe(\n \"Stored response value for this scale point (number or string)\",\n ),\n label: z\n .string()\n .min(1)\n .max(200)\n .describe(\"Display label shown for this scale point\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this scale point\"),\n })\n .describe(\"Schema for a single point on a custom rating scale\");\n\n// Scale configuration \u2013 discriminated on kind\nexport const ratingMatrixScaleSchema = z\n .discriminatedUnion(\"kind\", [\n // Likert: symmetric ordinal scale -2\u2026+2, explicit scale points with labels\n z.object({\n kind: z.literal(\"likert\").describe(\"Symmetric ordinal scale (-2 to +2)\"),\n scalePoints: z\n .array(ratingMatrixScalePointSchema)\n .min(2)\n .max(10)\n .describe(\"Scale points with display labels for each column\"),\n }),\n // Numerical: 1\u2026N points where N is 2, 3, 4, or 5, explicit scale points with labels\n z.object({\n kind: z.literal(\"numerical\").describe(\"Numerical scale from 1 to N\"),\n scalePoints: z\n .array(ratingMatrixScalePointSchema)\n .min(2)\n .max(10)\n .describe(\"Scale points with display labels for each column\"),\n pointCount: z\n .union([z.literal(2), z.literal(3), z.literal(4), z.literal(5)])\n .describe(\"Number of scale points (2, 3, 4, or 5)\"),\n }),\n // Custom: consumer defines each point's value and label\n z.object({\n kind: z\n .literal(\"custom\")\n .describe(\"Custom scale with user-defined points and values\"),\n scalePoints: z\n .array(ratingMatrixScalePointSchema)\n .min(2)\n .max(10)\n .describe(\"Scale points with display labels for each column\"),\n }),\n ])\n .describe(\"Scale configuration for rating matrix questions\");\n\n// Rating matrix question schema\nexport const ratingMatrixQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"rating_matrix\")\n .describe(\"Must be exactly 'rating_matrix'\"),\n statements: z\n .array(ratingMatrixStatementSchema)\n .min(1)\n .max(10)\n .describe(\"Statements (rows) users will rate on the shared scale (1-10)\"),\n scale: ratingMatrixScaleSchema.describe(\n \"Scale configuration shared across all statement rows\",\n ),\n displayStyle: ratingMatrixDisplayStyleSchema\n .optional()\n .describe(\n \"Visual representation of scale points per row (radio buttons, stars, emoji, or buttons)\",\n ),\n randomizeStatements: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of statements\"),\n })\n .describe(\n \"Schema for rating matrix questions with multiple statements on a shared scale\",\n );\n\n// \u2500\u2500\u2500 Matrix Single Choice \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// Shared row schema for matrix choice questions\nexport const matrixRowSchema = z\n .object({\n id: z\n .string()\n .describe(\"Unique identifier for this row (system time milliseconds)\"),\n value: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Internal value / export key for this row\"),\n label: z\n .string()\n .min(1)\n .max(200)\n .describe(\"Display text shown to users for this row\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this row\"),\n })\n .describe(\"Schema for an individual row in a matrix choice question\");\n\n// Slim column schema for matrix choice questions (no imageUrl unlike questionOptionSchema)\nexport const matrixColumnSchema = z\n .object({\n id: z\n .string()\n .describe(\"Unique identifier for this column (system time milliseconds)\"),\n value: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Internal value / export key for this column\"),\n label: z\n .string()\n .min(1)\n .max(200)\n .describe(\"Display label shown for this column\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this column\"),\n })\n .describe(\"Schema for an individual column in a matrix choice question\");\n\n// Matrix single choice question schema (one column selected per row)\nexport const matrixSingleChoiceQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"matrix_single_choice\")\n .describe(\"Must be exactly 'matrix_single_choice'\"),\n rows: z\n .array(matrixRowSchema)\n .min(1)\n .max(20)\n .describe(\"Row items (1-20 rows)\"),\n columns: z\n .array(matrixColumnSchema)\n .min(2)\n .max(10)\n .describe(\"Column options shared across all rows (2-10 columns)\"),\n randomizeRows: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of rows\"),\n randomizeColumns: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of columns\"),\n })\n .describe(\n \"Schema for matrix single-choice questions where one column is selected per row\",\n );\n\n// \u2500\u2500\u2500 Matrix Multiple Choice \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// Matrix multiple choice question schema (one or more columns selected per row)\nexport const matrixMultipleChoiceQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"matrix_multiple_choice\")\n .describe(\"Must be exactly 'matrix_multiple_choice'\"),\n rows: z\n .array(matrixRowSchema)\n .min(1)\n .max(20)\n .describe(\"Row items (1-20 rows)\"),\n columns: z\n .array(matrixColumnSchema)\n .min(2)\n .max(10)\n .describe(\"Column options shared across all rows (2-10 columns)\"),\n minSelectionsPerRow: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of columns a user must select per row\"),\n maxSelectionsPerRow: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Maximum number of columns a user can select per row\"),\n randomizeRows: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of rows\"),\n randomizeColumns: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of columns\"),\n })\n .refine(\n (data) => {\n if (\n data.minSelectionsPerRow !== undefined &&\n data.maxSelectionsPerRow !== undefined\n ) {\n return data.minSelectionsPerRow <= data.maxSelectionsPerRow;\n }\n return true;\n },\n {\n message: \"minSelectionsPerRow cannot be greater than maxSelectionsPerRow\",\n path: [\"minSelectionsPerRow\"],\n },\n )\n .describe(\n \"Schema for matrix multiple-choice questions where one or more columns can be selected per row\",\n );\n\n// Question option schema for choice-based questions\nexport const questionOptionSchema = z\n .object({\n id: z\n .string()\n .describe(\"Unique identifier for this option (system time milliseconds)\"),\n value: z\n .string()\n .min(1)\n .max(100)\n .describe(\"The internal value used for this option\"),\n label: z\n .string()\n .min(1)\n .max(200)\n .describe(\"The display text shown to users for this option\"),\n hint: z\n .string()\n .max(300)\n .optional()\n .describe(\n \"Optional short description shown below the option label to help respondents understand what they are selecting or ranking\",\n ),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\n \"LLM tool call description providing context about this option\",\n ),\n imageUrl: z\n .string()\n .url()\n .optional()\n .describe(\"Optional image URL to display with this option\"),\n })\n .describe(\"Schema for individual options in choice-based questions\");\n\n// Nested option schema for hierarchical choice structures (recursive)\nexport const nestedOptionSchema: z.ZodType<any> = z.lazy(() =>\n z\n .object({\n id: z\n .string()\n .describe(\n \"Unique identifier for this nested option (system time milliseconds)\",\n ),\n value: z\n .string()\n .min(1)\n .max(100)\n .describe(\"The internal value used for this nested option\"),\n label: z\n .string()\n .min(1)\n .max(200)\n .describe(\"The display text shown for this nested option\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this nested option context\"),\n imageUrl: z\n .string()\n .url()\n .optional()\n .describe(\"Optional image URL for this nested option\"),\n hint: z\n .string()\n .max(500)\n .optional()\n .describe(\n \"Optional hint text to help users understand this nested option\",\n ),\n children: z\n .array(nestedOptionSchema)\n .optional()\n .default([])\n .describe(\"Array of child options for hierarchical structure\"),\n })\n .describe(\"Schema for nested options with hierarchical structure support\"),\n);\n\n// Multiple choice single question schema (extends base question with choice-specific properties)\nexport const multipleChoiceSingleQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"single_choice\")\n .describe(\"Must be exactly 'single_choice'\"),\n displayStyle: multipleChoiceDisplayStyleSchema\n .optional()\n .describe(\"Visual style for displaying options\"),\n allowOther: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to allow a custom \"other\" option'),\n otherTextConfig: z\n .object({\n minChars: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of characters required for the other text\"),\n maxChars: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Maximum number of characters allowed for the other text\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text for the other text input\"),\n showLimitIndicatorThreshold: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show\",\n ),\n })\n .optional()\n .describe('Configuration for the custom \"other\" text input'),\n randomizeOptions: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of options\"),\n options: z\n .array(questionOptionSchema)\n .min(1)\n .max(50)\n .describe(\"Array of options for user selection (1-50 options)\"),\n })\n .describe(\"Schema for single-choice multiple selection questions\");\n\n// Multiple choice multiple question schema (extends base question with multiple choice properties)\nexport const multipleChoiceMultipleQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"multiple_choice_multiple\")\n .describe(\"Must be exactly 'multiple_choice_multiple'\"),\n displayStyle: multipleChoiceMultipleDisplayStyleSchema\n .optional()\n .describe(\"Visual style for displaying multiple options\"),\n allowOther: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to allow a custom \"other\" option'),\n otherTextConfig: z\n .object({\n minChars: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of characters required for the other text\"),\n maxChars: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Maximum number of characters allowed for the other text\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text for the other text input\"),\n showLimitIndicatorThreshold: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show\",\n ),\n })\n .optional()\n .describe('Configuration for the custom \"other\" text input'),\n minSelections: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of options that must be selected\"),\n maxSelections: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Maximum number of options that can be selected\"),\n randomizeOptions: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of options\"),\n options: z\n .array(questionOptionSchema)\n .min(1)\n .max(50)\n .describe(\"Array of options for user selection (1-50 options)\"),\n })\n .refine(\n (data) => {\n // If both minSelections and maxSelections are provided, minSelections should be <= maxSelections\n if (\n data.minSelections !== undefined &&\n data.maxSelections !== undefined\n ) {\n return data.minSelections <= data.maxSelections;\n }\n return true;\n },\n {\n message: \"minSelections cannot be greater than maxSelections\",\n path: [\"minSelections\"], // Point to minSelections field for the error\n },\n )\n .describe(\n \"Schema for multiple-choice questions allowing multiple selections\",\n );\n\n// NPS question schema (extends base question with NPS-specific properties)\nexport const npsQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"nps\").describe(\"Must be exactly 'nps'\"),\n min: z.literal(0).describe(\"NPS always starts at 0\"),\n max: z.literal(10).describe(\"NPS always ends at 10\"),\n minLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label for the minimum NPS value (0)\"),\n maxLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label for the maximum NPS value (10)\"),\n scaleLabels: z\n .record(z.string().regex(/^\\d+$/), z.string().max(50))\n .optional()\n .describe(\"Custom labels for specific NPS values (0-10)\"),\n prepopulatedValue: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .describe(\"Default value to pre-select (0-10)\"),\n detractorColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Color applied to detractor scores (0\u20136); accepts any valid CSS color value (hex, rgb, hsl, named)\",\n ),\n passiveColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Color applied to passive scores (7\u20138); accepts any valid CSS color value\",\n ),\n promoterColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Color applied to promoter scores (9\u201310); accepts any valid CSS color value\",\n ),\n })\n .refine(\n (data) => {\n // If scaleLabels is provided, validate that all keys are within the 0-10 range\n if (data.scaleLabels) {\n const keys = Object.keys(data.scaleLabels);\n return keys.every((key) => {\n const numKey = Number(key);\n return !isNaN(numKey) && numKey >= 0 && numKey <= 10;\n });\n }\n return true;\n },\n {\n message: \"scaleLabels keys must be between 0 and 10 (inclusive)\",\n path: [\"scaleLabels\"],\n },\n )\n .describe(\"Schema for Net Promoter Score questions with 0-10 scale\");\n\n// Short answer question schema (extends base question with text input properties)\nexport const shortAnswerQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"short_answer\").describe(\"Must be exactly 'short_answer'\"),\n maxCharacters: z\n .number()\n .int()\n .min(1)\n .max(10000)\n .optional()\n .describe(\"Maximum number of characters allowed\"),\n minCharacters: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of characters required\"),\n showLimitIndicatorThreshold: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text shown in the input field\"),\n enableRegexValidation: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to enable regex pattern validation\"),\n regexPattern: z\n .string()\n .optional()\n .describe(\"Regular expression pattern for validation\"),\n enableEnhanceWithAi: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to enable AI enhancement features\"),\n promptTemplate: z\n .string()\n .max(2000)\n .optional()\n .describe(\"Template for AI enhancement prompts\"),\n maxTokenAllowed: z\n .number()\n .int()\n .min(1)\n .max(10000)\n .optional()\n .describe(\"Maximum tokens allowed for AI processing\"),\n minCharactersToEnhance: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Minimum characters needed to trigger AI enhancement\"),\n })\n .refine(\n (data) => {\n // If both minCharacters and maxCharacters are provided, minCharacters should be <= maxCharacters\n if (\n data.minCharacters !== undefined &&\n data.maxCharacters !== undefined\n ) {\n return data.minCharacters <= data.maxCharacters;\n }\n return true;\n },\n {\n message: \"minCharacters cannot be greater than maxCharacters\",\n path: [\"minCharacters\"],\n },\n )\n .refine(\n (data) => {\n // If enableRegexValidation is true, regexPattern should be provided\n if (data.enableRegexValidation && !data.regexPattern) {\n return false;\n }\n return true;\n },\n {\n message: \"regexPattern is required when enableRegexValidation is true\",\n path: [\"regexPattern\"],\n },\n )\n .refine(\n (data) => {\n // If enableEnhanceWithAi is true, promptTemplate should be provided\n if (data.enableEnhanceWithAi && !data.promptTemplate) {\n return false;\n }\n return true;\n },\n {\n message: \"promptTemplate is required when enableEnhanceWithAi is true\",\n path: [\"promptTemplate\"],\n },\n )\n .describe(\"Schema for short answer questions with optional AI enhancement\");\n\n// Long answer question schema (extends base question with rich text input properties)\nexport const longAnswerQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"long_text\").describe(\"Must be exactly 'long_text'\"),\n maxCharacters: z\n .number()\n .int()\n .min(1)\n .max(50000)\n .optional()\n .describe(\n \"Maximum number of characters allowed (higher limit for long text)\",\n ),\n minCharacters: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of characters required\"),\n showLimitIndicatorThreshold: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show\",\n ),\n rows: z\n .number()\n .int()\n .min(1)\n .max(20)\n .optional()\n .describe(\"Number of textarea rows to display (1-20)\"),\n placeholder: z\n .string()\n .max(500)\n .optional()\n .describe(\"Placeholder text for the textarea (longer for long text)\"),\n enableEnhanceWithAi: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to enable AI enhancement features\"),\n promptTemplate: z\n .string()\n .max(2000)\n .optional()\n .describe(\"Template for AI enhancement prompts\"),\n maxTokenAllowed: z\n .number()\n .int()\n .min(1)\n .max(25000)\n .optional()\n .describe(\n \"Maximum tokens allowed for AI processing (higher for long text)\",\n ),\n minCharactersToEnhance: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Minimum characters needed to trigger AI enhancement\"),\n })\n .refine(\n (data) => {\n // If both minCharacters and maxCharacters are provided, minCharacters should be <= maxCharacters\n if (\n data.minCharacters !== undefined &&\n data.maxCharacters !== undefined\n ) {\n return data.minCharacters <= data.maxCharacters;\n }\n return true;\n },\n {\n message: \"minCharacters cannot be greater than maxCharacters\",\n path: [\"minCharacters\"],\n },\n )\n .refine(\n (data) => {\n // If enableEnhanceWithAi is true, promptTemplate should be provided\n if (data.enableEnhanceWithAi && !data.promptTemplate) {\n return false;\n }\n return true;\n },\n {\n message: \"promptTemplate is required when enableEnhanceWithAi is true\",\n path: [\"promptTemplate\"],\n },\n )\n .describe(\n \"Schema for long answer questions with rich text support and AI enhancement\",\n );\n\n// Nested dropdown question schema (extends base question with hierarchical selection properties)\nexport const nestedDropdownQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"nested_selection\")\n .describe(\"Must be exactly 'nested_selection'\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text for the nested dropdown\"),\n options: z\n .array(nestedOptionSchema)\n .min(1)\n .max(100)\n .describe(\n \"Array of nested options for hierarchical selection (1-100 options)\",\n ),\n displayStyle: z\n .literal(\"list\")\n .describe(\"Fixed display style for nested dropdowns\"),\n choiceOrderOption: choiceOrderOptionSchema\n .optional()\n .default(\"none\")\n .describe(\"How to order the nested choices\"),\n preserveLastChoices: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .describe(\"Number of choice levels to preserve (0-10)\"),\n prepopulatedValue: z\n .string()\n .max(1000)\n .optional()\n .describe(\"Default value to pre-populate\"),\n allowOther: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to allow custom \"other\" options'),\n otherColumnName: z\n .string()\n .max(100)\n .optional()\n .describe('Column name for storing custom \"other\" values'),\n maxDepth: z\n .number()\n .int()\n .min(1)\n .max(10)\n .optional()\n .describe(\"Maximum nesting depth allowed (1-10)\"),\n cascadeLabels: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to cascade labels from parent options\"),\n })\n .refine(\n (data) => {\n // If allowOther is true, otherColumnName should be provided\n if (data.allowOther && !data.otherColumnName) {\n return false;\n }\n return true;\n },\n {\n message: \"otherColumnName is required when allowOther is true\",\n path: [\"otherColumnName\"],\n },\n )\n .describe(\n \"Schema for nested dropdown questions with hierarchical option structure\",\n );\n\n// Export inferred types\nexport type QuestionType = z.infer<typeof questionTypeSchema>;\nexport type QuestionTextAlign = \"left\" | \"center\";\nexport type ValidationRule = z.infer<typeof validationRuleSchema>;\nexport type VisibilityCondition = z.infer<typeof visibilityConditionSchema>;\nexport type QuestionStatus = z.infer<typeof questionStatusSchema>;\nexport type Question = z.infer<typeof questionSchema>;\nexport type RatingDisplayStyle = z.infer<typeof ratingDisplayStyleSchema>;\nexport type RatingRepresentationSize = z.infer<\n typeof ratingRepresentationSizeSchema\n>;\nexport type RatingQuestion = z.infer<typeof ratingQuestionSchema>;\nexport type AnnotationQuestion = z.infer<typeof annotationQuestionSchema>;\nexport type WelcomeQuestion = z.infer<typeof welcomeQuestionSchema>;\nexport type ThankYouQuestion = z.infer<typeof thankYouQuestionSchema>;\nexport type MessagePanelQuestion = z.infer<typeof messagePanelQuestionSchema>;\nexport type ExitFormQuestion = z.infer<typeof exitFormQuestionSchema>;\nexport type YesNoDisplayStyle = z.infer<typeof yesNoDisplayStyleSchema>;\nexport type YesNoQuestion = z.infer<typeof yesNoQuestionSchema>;\nexport type ConsentQuestion = z.infer<typeof consentQuestionSchema>;\nexport type RatingMatrixStatement = z.infer<typeof ratingMatrixStatementSchema>;\nexport type RatingMatrixScalePoint = z.infer<\n typeof ratingMatrixScalePointSchema\n>;\nexport type RatingMatrixScale = z.infer<typeof ratingMatrixScaleSchema>;\nexport type RatingMatrixDisplayStyle = z.infer<\n typeof ratingMatrixDisplayStyleSchema\n>;\nexport type RatingMatrixQuestion = z.infer<typeof ratingMatrixQuestionSchema>;\nexport type MatrixRow = z.infer<typeof matrixRowSchema>;\nexport type MatrixColumn = z.infer<typeof matrixColumnSchema>;\nexport type MatrixSingleChoiceQuestion = z.infer<\n typeof matrixSingleChoiceQuestionSchema\n>;\nexport type MatrixMultipleChoiceQuestion = z.infer<\n typeof matrixMultipleChoiceQuestionSchema\n>;\nexport type QuestionOption = z.infer<typeof questionOptionSchema>;\nexport type NestedOption = z.infer<typeof nestedOptionSchema>;\nexport type MultipleChoiceDisplayStyle = z.infer<\n typeof multipleChoiceDisplayStyleSchema\n>;\nexport type MultipleChoiceSingleQuestion = z.infer<\n typeof multipleChoiceSingleQuestionSchema\n>;\nexport type MultipleChoiceMultipleDisplayStyle = z.infer<\n typeof multipleChoiceMultipleDisplayStyleSchema\n>;\nexport type MultipleChoiceMultipleQuestion = z.infer<\n typeof multipleChoiceMultipleQuestionSchema\n>;\nexport type NpsQuestion = z.infer<typeof npsQuestionSchema>;\nexport type ShortAnswerQuestion = z.infer<typeof shortAnswerQuestionSchema>;\nexport type LongAnswerQuestion = z.infer<typeof longAnswerQuestionSchema>;\nexport type ChoiceOrderOption = z.infer<typeof choiceOrderOptionSchema>;\nexport type NestedDropdownQuestion = z.infer<\n typeof nestedDropdownQuestionSchema\n>;\nexport type DateFormat = z.infer<typeof dateFormatSchema>;\nexport type DateSeparator = z.infer<typeof dateSeparatorSchema>;\nexport type DateQuestion = z.infer<typeof dateQuestionSchema>;\nexport type CsatScale = z.infer<typeof csatScaleSchema>;\nexport type CsatDisplayStyle = z.infer<typeof csatDisplayStyleSchema>;\nexport type CsatQuestion = z.infer<typeof csatQuestionSchema>;\nexport type OpinionScaleQuestion = z.infer<typeof opinionScaleQuestionSchema>;\nexport type RankingDisplayStyle = z.infer<typeof rankingDisplayStyleSchema>;\nexport type RankingQuestion = z.infer<typeof rankingQuestionSchema>;\nexport type PictureChoiceQuestion = z.infer<typeof pictureChoiceQuestionSchema>;\nexport type SignatureMode = z.infer<typeof signatureModeSchema>;\nexport type SignatureQuestion = z.infer<typeof signatureQuestionSchema>;\nexport type FileUploadQuestion = z.infer<typeof fileUploadQuestionSchema>;\nexport type EmailQuestion = z.infer<typeof emailQuestionSchema>;\nexport type NumberQuestion = z.infer<typeof numberQuestionSchema>;\nexport type WebsiteQuestion = z.infer<typeof websiteQuestionSchema>;\nexport type PhoneNumberQuestion = z.infer<typeof phoneNumberQuestionSchema>;\nexport type AddressSubFieldConfig = z.infer<typeof addressSubFieldConfigSchema>;\nexport type AddressQuestion = z.infer<typeof addressQuestionSchema>;\nexport type VideoAudioMode = z.infer<typeof videoAudioModeSchema>;\nexport type VideoAudioQuestion = z.infer<typeof videoAudioQuestionSchema>;\nexport type SchedulerProvider = z.infer<typeof schedulerProviderSchema>;\nexport type SchedulerQuestion = z.infer<typeof schedulerQuestionSchema>;\nexport type QnaWithAiQuestion = z.infer<typeof qnaWithAiQuestionSchema>;\nexport type PaymentsUpiAmountConfig = z.infer<\n typeof paymentsUpiAmountConfigSchema\n>;\nexport type PaymentsUpiQuestion = z.infer<typeof paymentsUpiQuestionSchema>;\nexport type Section = z.infer<typeof sectionSchema>;\n\n// Date format enum \u2014 controls the order of day/month/year segments\nexport const dateFormatSchema = z.enum([\n \"MM/DD/YYYY\",\n \"DD/MM/YYYY\",\n \"YYYY/MM/DD\",\n]);\n\nexport const DateFormats = {\n MM_DD_YYYY: \"MM/DD/YYYY\" as const,\n DD_MM_YYYY: \"DD/MM/YYYY\" as const,\n YYYY_MM_DD: \"YYYY/MM/DD\" as const,\n} as const;\n\n// Date separator enum\nexport const dateSeparatorSchema = z.enum([\"/\", \"-\", \".\"]);\n\nexport const DateSeparators = {\n SLASH: \"/\" as const,\n DASH: \"-\" as const,\n DOT: \".\" as const,\n} as const;\n\n// Date question schema\nexport const dateQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"date\").describe(\"Must be exactly 'date'\"),\n format: dateFormatSchema\n .optional()\n .default(\"DD/MM/YYYY\")\n .describe(\"Order of day, month, and year segments in the input\"),\n separator: dateSeparatorSchema\n .optional()\n .default(\"/\")\n .describe(\"Character used to separate day, month, and year segments\"),\n includeTime: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to also collect a time (HH:MM) alongside the date\"),\n minDate: z\n .string()\n .optional()\n .describe(\n \"Earliest allowed date in ISO 8601 format (YYYY-MM-DD); when absent no lower bound is enforced\",\n ),\n maxDate: z\n .string()\n .optional()\n .describe(\n \"Latest allowed date in ISO 8601 format (YYYY-MM-DD); when absent no upper bound is enforced\",\n ),\n placeholder: z\n .string()\n .max(50)\n .optional()\n .describe(\"Placeholder text shown in the date input\"),\n segmentLabelDD: z\n .string()\n .max(40)\n .optional()\n .describe(\n \"Visible label above the day segment; when absent a locale default is used\",\n ),\n segmentLabelMM: z\n .string()\n .max(40)\n .optional()\n .describe(\"Visible label above the month segment\"),\n segmentLabelYYYY: z\n .string()\n .max(40)\n .optional()\n .describe(\"Visible label above the year segment\"),\n prepopulatedValue: z\n .string()\n .optional()\n .describe(\n \"Default date value in ISO 8601 format (YYYY-MM-DD) to pre-fill the input\",\n ),\n })\n .describe(\n \"Schema for a date question that collects a structured date (and optionally time) from the respondent\",\n );\n\n// CSAT scale enum \u2014 number of scale points\nexport const csatScaleSchema = z.union([\n z.literal(2),\n z.literal(3),\n z.literal(4),\n z.literal(5),\n]);\n\nexport const CsatScales = {\n TWO: 2 as const,\n THREE: 3 as const,\n FOUR: 4 as const,\n FIVE: 5 as const,\n} as const;\n\n// CSAT display style enum\nexport const csatDisplayStyleSchema = z.enum([\"emoji\", \"text\"]);\n\nexport const CsatDisplayStyles = {\n EMOJI: \"emoji\" as const,\n TEXT: \"text\" as const,\n} as const;\n\n// CSAT question schema\n// Response values use industry-standard positive numbering: 1 (lowest/worst) to N (highest/best)\n// where N matches the chosen scale size (2\u20135). CSAT % = responses rated in the top tier / total \u00D7 100.\nexport const csatQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"csat\").describe(\"Must be exactly 'csat'\"),\n scale: csatScaleSchema\n .optional()\n .default(5)\n .describe(\n \"Number of response points (2\u20135); 2 and 4 have no neutral option, default is 5\",\n ),\n displayStyle: csatDisplayStyleSchema\n .optional()\n .default(\"emoji\")\n .describe(\n \"How response options are rendered \u2014 emoji faces (default) or text buttons\",\n ),\n multicolor: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"Whether to apply distinct colors to negative, neutral, and positive segments\",\n ),\n negativeColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Color for negative response options (lower half of scale); any valid CSS color; used when multicolor is true\",\n ),\n neutralColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Color for the neutral midpoint option (odd scales only: scale 3 = value 2, scale 5 = value 3); any valid CSS color; used when multicolor is true\",\n ),\n positiveColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Color for positive response options (upper half of scale); any valid CSS color; used when multicolor is true\",\n ),\n showLabels: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"Whether to render per-point labels below each response option\",\n ),\n scaleLabels: z\n .record(z.string(), z.string().max(100))\n .optional()\n .describe(\n \"Per-point label text keyed by value string ('1'\u2013'5'); keys must match the chosen scale size\",\n ),\n })\n .describe(\n \"Schema for a CSAT (Customer Satisfaction Score) question using an industry-standard 1-to-N positive scale (N = 2\u20135)\",\n );\n\n// Opinion scale question schema \u2014 a numeric button scale (Likert-style), no icons\nexport const opinionScaleQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"opinion_scale\")\n .describe(\"Must be exactly 'opinion_scale'\"),\n startValue: z\n .union([z.literal(0), z.literal(1)])\n .optional()\n .default(0)\n .describe(\"Starting value of the scale \u2014 0 (default) or 1\"),\n steps: z\n .number()\n .int()\n .min(5)\n .max(11)\n .optional()\n .default(11)\n .describe(\n \"Number of points on the scale (5\u201311); default 11 gives a 0\u201310 or 1\u201311 range depending on startValue\",\n ),\n minLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\n \"Optional label anchoring the low end of the scale (e.g. 'Not at all likely')\",\n ),\n maxLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\n \"Optional label anchoring the high end of the scale (e.g. 'Extremely likely')\",\n ),\n })\n .describe(\n \"Schema for an opinion scale question \u2014 a horizontal numeric button scale with configurable range and optional end labels\",\n );\n\n// Ranking display style enum\nexport const rankingDisplayStyleSchema = z.enum([\n \"drag_drop\",\n \"dropdown\",\n \"up_down\",\n]);\n\nexport const RankingDisplayStyles = {\n DRAG_DROP: \"drag_drop\" as const,\n DROPDOWN: \"dropdown\" as const,\n UP_DOWN: \"up_down\" as const,\n} as const;\n\n// Ranking question schema \u2014 respondents order items by preference\nexport const rankingQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"ranking\").describe(\"Must be exactly 'ranking'\"),\n options: z\n .array(questionOptionSchema)\n .min(2)\n .max(30)\n .describe(\n \"List of items to rank (2\u201330 items); each item supports an optional hint for clarification\",\n ),\n randomizeOptions: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"Whether to shuffle item order per respondent to avoid position bias\",\n ),\n displayStyle: rankingDisplayStyleSchema\n .optional()\n .default(\"drag_drop\")\n .describe(\n \"Interaction mode \u2014 drag_drop (default) for drag-and-drop reordering, dropdown for selecting a rank number per item, up_down for arrow button reordering\",\n ),\n maxRank: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\n \"Maximum number of items the respondent must rank (e.g. 3 = 'rank your top 3'); when absent all items must be ranked\",\n ),\n })\n .refine(\n (data) => data.maxRank === undefined || data.maxRank <= data.options.length,\n {\n message: \"maxRank cannot exceed the number of options\",\n path: [\"maxRank\"],\n },\n )\n .describe(\n \"Schema for a ranking question where respondents order items by preference\",\n );\n\n// Picture choice question schema \u2014 image-based single or multiple selection\nexport const pictureChoiceQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"picture_choice\")\n .describe(\"Must be exactly 'picture_choice'\"),\n options: z\n .array(questionOptionSchema)\n .min(1)\n .max(50)\n .describe(\n \"Array of options; each should include an imageUrl for the picture to display\",\n ),\n multiple: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"When true respondents may select more than one image; when false (default) only one image can be selected\",\n ),\n minSelections: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\n \"Minimum number of images the respondent must select (only applies when multiple is true)\",\n ),\n maxSelections: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\n \"Maximum number of images the respondent may select (only applies when multiple is true)\",\n ),\n supersize: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to display images at an enlarged size\"),\n showLabels: z\n .boolean()\n .optional()\n .default(true)\n .describe(\"Whether to show the text label below each image\"),\n randomizeOptions: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"Whether to shuffle image order per respondent to avoid position bias\",\n ),\n allowOther: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to include a free-text \"other\" option'),\n otherTextConfig: z\n .object({\n minChars: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of characters required for the other text\"),\n maxChars: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Maximum number of characters allowed for the other text\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text for the other text input\"),\n showLimitIndicatorThreshold: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Show the character limit indicator once the user has typed this many characters; 0 = show immediately, absent = never show\",\n ),\n })\n .optional()\n .describe('Configuration for the custom \"other\" text input'),\n })\n .refine(\n (data) => {\n if (\n data.minSelections !== undefined &&\n data.maxSelections !== undefined\n ) {\n return data.minSelections <= data.maxSelections;\n }\n return true;\n },\n {\n message: \"minSelections cannot be greater than maxSelections\",\n path: [\"minSelections\"],\n },\n )\n .describe(\n \"Schema for a picture choice question where respondents select from image-based options\",\n );\n\n// Signature mode enum \u2014 which signing methods the respondent can use\nexport const signatureModeSchema = z.enum([\"type\", \"draw\", \"upload\"]);\n\nexport const SignatureModes = {\n TYPE: \"type\" as const,\n DRAW: \"draw\" as const,\n UPLOAD: \"upload\" as const,\n} as const;\n\n// Signature question schema \u2014 collects a legally-valid electronic signature via type, draw, or upload\nexport const signatureQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"signature\").describe(\"Must be exactly 'signature'\"),\n allowedModes: z\n .array(signatureModeSchema)\n .min(1)\n .optional()\n .describe(\n \"Which signing methods the respondent can choose from (type, draw, upload); when absent all three are enabled\",\n ),\n defaultMode: signatureModeSchema\n .optional()\n .describe(\n \"Which signing tab is pre-selected when the question is first shown; when absent the platform chooses\",\n ),\n collectSignerEmail: z\n .boolean()\n .optional()\n .default(true)\n .describe(\n \"Whether to auto-collect the signer's email so a signed PDF copy can be sent to them; set to false if the form already collects an email via signerEmailFieldId or another question\",\n ),\n signerEmailFieldId: z\n .string()\n .optional()\n .describe(\n \"ID of an existing email question in the form whose value will be used as the signer's email address, instead of auto-appending a new email prompt\",\n ),\n penColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Stroke color for the draw canvas; any valid CSS color; when absent the theme foreground color is used\",\n ),\n penWidth: z\n .number()\n .int()\n .min(1)\n .max(20)\n .optional()\n .describe(\n \"Pen stroke thickness in pixels for the draw canvas (1\u201320); when absent the renderer default (typically 2) is used\",\n ),\n backgroundColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Background color of the draw canvas; any valid CSS color; when absent the canvas is transparent and inherits the form background\",\n ),\n canvasHeight: z\n .number()\n .int()\n .min(60)\n .max(600)\n .optional()\n .describe(\n \"Draw canvas height in logical pixels (60\u2013600); width always fills the container; when absent the renderer chooses a sensible default (typically 200)\",\n ),\n clearButtonLabel: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Label for the clear/redo button in draw mode; when absent the platform default label or icon is shown\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Optional shared fallback copy for draw-canvas and upload-zone hints when their dedicated fields are unset\",\n ),\n modeTabLabelType: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom visible label for the Type tab; when absent only the tab icon is shown (use aria-label on the client)\",\n ),\n modeTabLabelDraw: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom visible label for the Draw tab; when absent only the tab icon is shown\",\n ),\n modeTabLabelUpload: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom visible label for the Upload tab; when absent only the tab icon is shown\",\n ),\n drawCanvasHint: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Hint shown on the empty draw canvas (e.g. 'Draw your signature here'); falls back to placeholder then platform default\",\n ),\n uploadZonePrimary: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Main prompt on the upload drop zone when idle (e.g. click to upload); falls back to placeholder then default\",\n ),\n uploadZoneDrag: z\n .string()\n .max(120)\n .optional()\n .describe(\n \"Short prompt when dragging a file over the upload zone; falls back to platform default\",\n ),\n })\n .describe(\n \"Schema for a signature question where respondents can type, draw, or upload their electronic signature\",\n );\n\n// File upload question schema \u2014 lets respondents attach one or more files\nexport const fileUploadQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"file_upload\").describe(\"Must be exactly 'file_upload'\"),\n allowedFileTypes: z\n .array(z.string())\n .min(1)\n .optional()\n .describe(\n \"MIME types and/or file extensions the respondent is allowed to upload (e.g. ['image/jpeg', '.pdf']); when absent all file types are accepted\",\n ),\n maxFileSizeMb: z\n .number()\n .int()\n .min(1)\n .max(100)\n .optional()\n .describe(\n \"Maximum size per uploaded file in megabytes (1\u2013100); when absent the platform enforces its own ceiling\",\n ),\n multiple: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"When true the respondent may upload more than one file in a single question; when false (default) only one file is accepted\",\n ),\n maxFiles: z\n .number()\n .int()\n .min(1)\n .max(20)\n .optional()\n .describe(\n \"Maximum number of files the respondent may upload (1\u201320); only applies when multiple is true; when absent no per-question file count limit is enforced\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Text shown inside the upload dropzone to guide respondents (e.g. 'Drop your CV here or click to browse')\",\n ),\n })\n .describe(\n \"Schema for a file upload question where respondents can attach one or more files from their device\",\n );\n\n// Email question schema \u2014 dedicated email input with built-in format enforcement\nexport const emailQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"email\").describe(\"Must be exactly 'email'\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text shown inside the email input\"),\n prepopulatedValue: z\n .string()\n .optional()\n .describe(\n \"Default email address to pre-fill the input (e.g. passed via URL param or hidden field)\",\n ),\n })\n .describe(\n \"Schema for an email question that only accepts correctly formatted email addresses\",\n );\n\n// Number question schema \u2014 numeric-only input with configurable constraints\nexport const numberQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"number\").describe(\"Must be exactly 'number'\"),\n min: z\n .number()\n .optional()\n .describe(\n \"Minimum allowed value (inclusive); when absent no lower bound is enforced\",\n ),\n max: z\n .number()\n .optional()\n .describe(\n \"Maximum allowed value (inclusive); when absent no upper bound is enforced\",\n ),\n allowDecimal: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"Whether decimal (non-integer) values are accepted; Typeform restricts to whole numbers only, making this a differentiator\",\n ),\n allowNegative: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"Whether negative values are accepted; Typeform restricts to positive numbers only, making this a differentiator\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text shown inside the number input\"),\n prepopulatedValue: z\n .number()\n .optional()\n .describe(\"Default numeric value to pre-fill the input\"),\n unit: z\n .string()\n .max(10)\n .optional()\n .describe(\n \"Unit label displayed beside the input (e.g. 'kg', '$', 'years')\",\n ),\n })\n .refine(\n (data) =>\n data.min === undefined || data.max === undefined || data.min <= data.max,\n {\n message: \"min cannot be greater than max\",\n path: [\"min\"],\n },\n )\n .describe(\n \"Schema for a number question that only accepts numeric input with configurable range and format constraints\",\n );\n\n// Website question schema \u2014 URL input with format validation\nexport const websiteQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"website\").describe(\"Must be exactly 'website'\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Placeholder text shown inside the URL input (e.g. 'https://yoursite.com')\",\n ),\n prepopulatedValue: z\n .string()\n .optional()\n .describe(\"Default URL to pre-fill the input\"),\n })\n .describe(\n \"Schema for a website question that collects a URL with built-in format validation\",\n );\n\n// Phone number question schema \u2014 phone input with country code picker\nexport const phoneNumberQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"phone_number\").describe(\"Must be exactly 'phone_number'\"),\n defaultCountryCode: z\n .string()\n .max(2)\n .optional()\n .describe(\n \"ISO 3166-1 alpha-2 country code to pre-select in the country picker (e.g. 'US', 'IN'); when absent the platform uses the device/locale default\",\n ),\n allowCountryChange: z\n .boolean()\n .optional()\n .default(true)\n .describe(\n \"Whether the respondent can change the country code; when false the default country is locked\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text shown inside the phone number input\"),\n prepopulatedValue: z\n .string()\n .optional()\n .describe(\n \"Default phone number to pre-fill the input; E.164 format recommended (e.g. '+14155552671')\",\n ),\n })\n .describe(\n \"Schema for a phone number question with country code picker and country-specific format validation\",\n );\n\n// Address sub-field config schema \u2014 reused for each address field\nexport const addressSubFieldConfigSchema = z\n .object({\n enabled: z\n .boolean()\n .default(true)\n .describe(\"Whether this sub-field is shown in the question\"),\n required: z\n .boolean()\n .default(false)\n .describe(\"Whether the respondent must fill in this sub-field\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text for this sub-field input\"),\n label: z\n .string()\n .max(120)\n .optional()\n .describe(\n \"Visible caption above this sub-field; defaults to built-in copy when omitted\",\n ),\n })\n .describe(\"Configuration for an individual address sub-field\");\n\n// Address question schema \u2014 structured multi-field address collection on a single screen\nexport const addressQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"address\").describe(\"Must be exactly 'address'\"),\n addressLine1: addressSubFieldConfigSchema\n .optional()\n .describe(\"Configuration for the primary street address line\"),\n addressLine2: addressSubFieldConfigSchema\n .optional()\n .describe(\n \"Configuration for the secondary address line (apartment, suite, etc.); hidden by default\",\n ),\n city: addressSubFieldConfigSchema\n .optional()\n .describe(\"Configuration for the city/town sub-field\"),\n stateProvince: addressSubFieldConfigSchema\n .optional()\n .describe(\"Configuration for the state, region, or province sub-field\"),\n postalCode: addressSubFieldConfigSchema\n .optional()\n .describe(\"Configuration for the ZIP/postal code sub-field\"),\n country: addressSubFieldConfigSchema\n .optional()\n .describe(\"Configuration for the country sub-field\"),\n defaultCountry: z\n .string()\n .max(2)\n .optional()\n .describe(\n \"ISO 3166-1 alpha-2 country code to pre-select in the country dropdown (e.g. 'US', 'GB')\",\n ),\n })\n .describe(\n \"Schema for an address question that collects a full structured address on a single screen\",\n );\n\n// Video/audio/photo mode enum \u2014 which answer recording modes are available\nexport const videoAudioModeSchema = z.enum([\"video\", \"audio\", \"photo\", \"text\"]);\n\nexport const VideoAudioModes = {\n VIDEO: \"video\" as const,\n AUDIO: \"audio\" as const,\n PHOTO: \"photo\" as const,\n TEXT: \"text\" as const,\n} as const;\n\n// Video, audio, photo, and text question schema \u2014 respondent records or uploads media or types a text answer\nexport const videoAudioQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"video_audio\").describe(\"Must be exactly 'video_audio'\"),\n allowedModes: z\n .array(videoAudioModeSchema)\n .min(1)\n .optional()\n .describe(\n \"Which answer types the respondent can choose from (video, audio, photo, text); when absent all four are enabled\",\n ),\n defaultMode: videoAudioModeSchema\n .optional()\n .describe(\n \"Which mode tab is pre-selected when the question opens; when absent the platform chooses\",\n ),\n maxDurationSeconds: z\n .number()\n .int()\n .min(5)\n .max(600)\n .optional()\n .describe(\n \"Maximum recording length in seconds (5\u2013600); Typeform hardcodes 120s with no config, making this a differentiator; when absent the platform default applies\",\n ),\n maxFileSizeMb: z\n .number()\n .int()\n .min(1)\n .max(500)\n .optional()\n .describe(\n \"Maximum size in megabytes for uploaded pre-recorded files (1\u2013500); when absent the platform ceiling applies\",\n ),\n allowUpload: z\n .boolean()\n .optional()\n .default(true)\n .describe(\n \"Whether the respondent can upload a file in addition to recording or capturing live (video, audio, or photo)\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Instructional text shown to the respondent before they begin recording or capturing\",\n ),\n modeTabLabelVideo: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom tab label for video mode in the respondent UI; when absent defaults to 'Video'\",\n ),\n modeTabLabelAudio: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom tab label for audio mode; when absent defaults to 'Audio'\",\n ),\n modeTabLabelPhoto: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom tab label for photo mode; when absent defaults to 'Photo'\",\n ),\n modeTabLabelText: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom tab label for text mode; when absent defaults to 'Text'\",\n ),\n recordButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Label for the Record button in video/audio modes\"),\n uploadMediaButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Label for the upload control in video/audio modes when uploads are allowed\",\n ),\n videoIdleHint: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Hint shown over the video preview when idle; falls back to placeholder then built-in copy\",\n ),\n photoEmptyHint: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Hint in the empty photo preview area; falls back to placeholder then built-in copy\",\n ),\n photoUseCameraButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Label for the Use camera button in photo mode\"),\n photoUploadImageButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Label for the upload image button in photo mode\"),\n })\n .describe(\n \"Schema for a video, audio, and photo question where respondents can record or upload media or enter a text answer\",\n );\n\n// Scheduler provider enum \u2014 which calendar integration to use\nexport const schedulerProviderSchema = z.enum([\"google_calendar\", \"calendly\"]);\n\nexport const SchedulerProviders = {\n GOOGLE_CALENDAR: \"google_calendar\" as const,\n CALENDLY: \"calendly\" as const,\n} as const;\n\n// Scheduler question schema \u2014 respondent books a time slot from a connected calendar\nexport const schedulerQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"scheduler\").describe(\"Must be exactly 'scheduler'\"),\n provider: schedulerProviderSchema\n .optional()\n .describe(\n \"Which calendar integration to use (google_calendar or calendly); when absent the platform uses whatever is connected\",\n ),\n calendarId: z\n .string()\n .optional()\n .describe(\n \"Specific Google Calendar ID or Calendly event-type URL/slug to book from; when absent the default calendar or event type is used\",\n ),\n showIntroScreen: z\n .boolean()\n .optional()\n .default(true)\n .describe(\n \"Whether to show the Calendly event intro screen (account name, event name, duration) before the time picker; only applies when provider is 'calendly'\",\n ),\n autofillNameFieldId: z\n .string()\n .optional()\n .describe(\n \"ID of a prior Short Text or Name question whose answer is pre-filled into the Calendly booking name field; only applies when provider is 'calendly'\",\n ),\n autofillEmailFieldId: z\n .string()\n .optional()\n .describe(\n \"ID of a prior Email question whose answer is pre-filled into the Calendly booking email field; only applies when provider is 'calendly'\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Fallback text for the book-a-meeting button when scheduleMeetingLabel is unset; also used as a secondary fallback in the CTA copy chain\",\n ),\n scheduleMeetingLabel: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Primary label on the book-a-meeting button and modal; when absent uses placeholder then the built-in default (e.g. 'Schedule a meeting')\",\n ),\n })\n .describe(\n \"Schema for a scheduler question where respondents book a time slot directly within the form via Google Calendar or Calendly\",\n );\n\n// Q&A with AI question schema \u2014 respondents ask questions answered by AI from a knowledge base\nexport const qnaWithAiQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"qna_with_ai\").describe(\"Must be exactly 'qna_with_ai'\"),\n knowledgeBase: z\n .string()\n .max(20000)\n .describe(\n \"The knowledge base content the AI draws from when answering respondent questions; Markdown formatting is recommended; up to 20,000 characters\",\n ),\n maxResponseLength: z\n .number()\n .int()\n .min(50)\n .max(2000)\n .optional()\n .describe(\n \"Maximum number of characters per AI-generated response (50\u20132000); Typeform hardcodes 300, making this configurable a differentiator; when absent the platform default (300) applies\",\n ),\n maxQaPairs: z\n .number()\n .int()\n .min(1)\n .max(100)\n .optional()\n .describe(\n \"Maximum number of Q&A exchanges allowed per submission (1\u2013100); Typeform hardcodes 20, making this configurable a differentiator; when absent the platform default (20) applies\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Hint text shown in the respondent's question input field (e.g. 'Ask me anything about this event...')\",\n ),\n askButtonLabel: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Label for the submit/ask button; when absent the platform default (e.g. 'Ask AI') is shown\",\n ),\n emptyStateHint: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Message in the empty chat area (e.g. 'Ask the AI a question to get started.'); when absent uses placeholder then a built-in default\",\n ),\n pairsRemainingTemplate: z\n .string()\n .max(160)\n .optional()\n .describe(\n \"Counter when under the limit; use tokens {remaining} and {max} (e.g. '{remaining} of {max} questions remaining'); when absent the client uses built-in English with pluralization\",\n ),\n pairsLimitReachedTemplate: z\n .string()\n .max(160)\n .optional()\n .describe(\n \"Counter when the exchange limit is reached; use token {max}; when absent the client uses built-in English with pluralization\",\n ),\n })\n .describe(\n \"Schema for a Q&A with AI question where respondents ask questions and receive AI-generated answers drawn from a configurable knowledge base\",\n );\n\n// UPI amount configuration \u2014 controls how the requested INR amount is resolved\nexport const paymentsUpiAmountConfigSchema = z\n .discriminatedUnion(\"mode\", [\n z.object({\n mode: z\n .literal(\"fixed\")\n .describe(\"A fixed amount configured by the form builder\"),\n amount: z.number().positive().describe(\"Fixed amount to request in INR\"),\n }),\n z.object({\n mode: z\n .literal(\"range\")\n .describe(\"Respondent enters an amount within the configured range\"),\n minAmount: z\n .number()\n .positive()\n .describe(\"Minimum allowed amount in INR\"),\n maxAmount: z\n .number()\n .positive()\n .describe(\"Maximum allowed amount in INR\"),\n defaultAmount: z\n .number()\n .positive()\n .optional()\n .describe(\"Optional initial amount shown to the respondent\"),\n }),\n z.object({\n mode: z\n .literal(\"question_mappings\")\n .describe(\"Amount is summed from one or more previous question answers\"),\n sources: z\n .array(\n z.object({\n sourceQuestionId: z\n .string()\n .describe(\n \"ID of the prior question whose answer contributes to the amount\",\n ),\n mappings: z\n .array(\n z.object({\n answerValue: z\n .string()\n .describe(\"Previous question answer value to match\"),\n amount: z\n .number()\n .nonnegative()\n .describe(\n \"Amount to add in INR when this answer is selected\",\n ),\n label: z\n .string()\n .max(120)\n .optional()\n .describe(\"Optional display label for this mapped amount\"),\n }),\n )\n .min(1)\n .describe(\"Answer-to-amount mappings for this source question\"),\n }),\n )\n .min(1)\n .describe(\"Previous question sources that contribute to the amount\"),\n fallbackAmount: z\n .number()\n .nonnegative()\n .optional()\n .describe(\"Optional amount to use when no source mapping matches\"),\n }),\n ])\n .superRefine((data, ctx) => {\n if (data.mode !== \"range\") return;\n if (data.minAmount > data.maxAmount) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"minAmount cannot be greater than maxAmount\",\n path: [\"minAmount\"],\n });\n }\n if (\n data.defaultAmount !== undefined &&\n (data.defaultAmount < data.minAmount ||\n data.defaultAmount > data.maxAmount)\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"defaultAmount must be within minAmount and maxAmount\",\n path: [\"defaultAmount\"],\n });\n }\n })\n .describe(\"Amount configuration for a payments_upi question\");\n\n// Payments UPI question schema \u2014 self-reported UPI payment reference collection\nexport const paymentsUpiQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"payments_upi\").describe(\"Must be exactly 'payments_upi'\"),\n payeeVpa: z\n .string()\n .min(3)\n .max(255)\n .regex(\n /^[\\w.\\-]+@[\\w.\\-]+$/,\n \"payeeVpa must be a valid UPI VPA such as merchant@bank\",\n )\n .describe(\"UPI virtual payment address that receives the payment\"),\n payeeName: z\n .string()\n .max(100)\n .optional()\n .describe(\"Display name for the UPI payee\"),\n amount: paymentsUpiAmountConfigSchema.describe(\n \"How the requested INR amount is determined\",\n ),\n sourceEmailQuestionId: z\n .string()\n .optional()\n .describe(\n \"Optional ID of the email question whose answer is used for form submission receipt emails\",\n ),\n transactionNote: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Short note included in the UPI intent; the platform may append the Encatch reference\",\n ),\n transactionReferencePrefix: z\n .string()\n .max(24)\n .optional()\n .describe(\"Optional prefix for generated Encatch payment references\"),\n qrLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label shown above the UPI QR code\"),\n openUpiAppLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Label for the mobile UPI intent button\"),\n copyUpiIdLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Label for the copy UPI ID button\"),\n transactionIdLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label for the self-reported transaction ID / UTR input\"),\n transactionIdPlaceholder: z\n .string()\n .max(120)\n .optional()\n .describe(\"Placeholder for the transaction ID / UTR input\"),\n })\n .describe(\n \"Schema for a self-reported UPI payment question that renders a UPI QR/intent link and collects the respondent-entered transaction ID\",\n );\n\n// Combined question schema using discriminated union for proper type safety\nexport const combinedQuestionSchema = z.discriminatedUnion(\"type\", [\n ratingQuestionSchema,\n annotationQuestionSchema,\n welcomeQuestionSchema,\n thankYouQuestionSchema,\n messagePanelQuestionSchema,\n exitFormQuestionSchema,\n yesNoQuestionSchema,\n consentQuestionSchema,\n ratingMatrixQuestionSchema,\n matrixSingleChoiceQuestionSchema,\n matrixMultipleChoiceQuestionSchema,\n multipleChoiceSingleQuestionSchema,\n multipleChoiceMultipleQuestionSchema,\n npsQuestionSchema,\n shortAnswerQuestionSchema,\n longAnswerQuestionSchema,\n nestedDropdownQuestionSchema,\n dateQuestionSchema,\n csatQuestionSchema,\n opinionScaleQuestionSchema,\n rankingQuestionSchema,\n pictureChoiceQuestionSchema,\n signatureQuestionSchema,\n fileUploadQuestionSchema,\n emailQuestionSchema,\n numberQuestionSchema,\n websiteQuestionSchema,\n phoneNumberQuestionSchema,\n addressQuestionSchema,\n videoAudioQuestionSchema,\n schedulerQuestionSchema,\n qnaWithAiQuestionSchema,\n paymentsUpiQuestionSchema,\n]);\n\n// Explicit type definition for better inference\nexport type CombinedQuestion =\n | z.infer<typeof ratingQuestionSchema>\n | z.infer<typeof annotationQuestionSchema>\n | z.infer<typeof welcomeQuestionSchema>\n | z.infer<typeof thankYouQuestionSchema>\n | z.infer<typeof messagePanelQuestionSchema>\n | z.infer<typeof exitFormQuestionSchema>\n | z.infer<typeof yesNoQuestionSchema>\n | z.infer<typeof consentQuestionSchema>\n | z.infer<typeof ratingMatrixQuestionSchema>\n | z.infer<typeof matrixSingleChoiceQuestionSchema>\n | z.infer<typeof matrixMultipleChoiceQuestionSchema>\n | z.infer<typeof multipleChoiceSingleQuestionSchema>\n | z.infer<typeof multipleChoiceMultipleQuestionSchema>\n | z.infer<typeof npsQuestionSchema>\n | z.infer<typeof shortAnswerQuestionSchema>\n | z.infer<typeof longAnswerQuestionSchema>\n | z.infer<typeof nestedDropdownQuestionSchema>\n | z.infer<typeof dateQuestionSchema>\n | z.infer<typeof csatQuestionSchema>\n | z.infer<typeof opinionScaleQuestionSchema>\n | z.infer<typeof rankingQuestionSchema>\n | z.infer<typeof pictureChoiceQuestionSchema>\n | z.infer<typeof signatureQuestionSchema>\n | z.infer<typeof fileUploadQuestionSchema>\n | z.infer<typeof emailQuestionSchema>\n | z.infer<typeof numberQuestionSchema>\n | z.infer<typeof websiteQuestionSchema>\n | z.infer<typeof phoneNumberQuestionSchema>\n | z.infer<typeof addressQuestionSchema>\n | z.infer<typeof videoAudioQuestionSchema>\n | z.infer<typeof schedulerQuestionSchema>\n | z.infer<typeof qnaWithAiQuestionSchema>\n | z.infer<typeof paymentsUpiQuestionSchema>;\n", "import { z } from \"zod\";\nimport { LanguageFieldSchema, LanguagesSchema } from \"./other-screen-schema\";\n\n// Base translation entry - simplified to just string values for the new structure\nexport const translationEntrySchema = z\n .string()\n .min(1)\n .describe(\"Translated text content\");\n\n// Base fields shared by all question translation schemas\nexport const baseQuestionTranslationFieldsSchema = z.object({\n title: translationEntrySchema.describe(\"Question title translation\"),\n description: translationEntrySchema\n .optional()\n .describe(\"Question description translation\"),\n errorMessage: translationEntrySchema\n .optional()\n .describe(\"Error message translation\"),\n nextButtonLabel: translationEntrySchema\n .max(50)\n .optional()\n .describe(\n \"Next button label translation when advancing past this question\",\n ),\n});\n\n// Keys present on every question translation (used in refine allowlists)\nexport const BASE_QUESTION_TRANSLATION_KEYS = [\n \"type\",\n \"title\",\n \"description\",\n \"errorMessage\",\n \"nextButtonLabel\",\n] as const;\n\n// Rating question translation schema with type field\nexport const ratingQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"rating\").describe(\"Question type identifier\"),\n minLabel: translationEntrySchema\n .optional()\n .describe(\"Minimum rating label translation\"),\n maxLabel: translationEntrySchema\n .optional()\n .describe(\"Maximum rating label translation\"),\n })\n .describe(\"Translation schema for rating questions\");\n\n// Single choice question translation schema with type field\nexport const singleChoiceQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"single_choice\").describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Input placeholder translation\"),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) =>\n ![...BASE_QUESTION_TRANSLATION_KEYS, \"placeholder\"].includes(key),\n );\n return additionalKeys.every((key) =>\n /^option\\..+\\.(label|value)$/.test(key),\n );\n },\n {\n message:\n \"Additional keys must follow the pattern 'option.{id}.{label|value}'\",\n },\n )\n .describe(\"Translation schema for single choice questions\");\n\n// Multiple choice question translation schema with type field\nexport const multipleChoiceQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z\n .literal(\"multiple_choice_multiple\")\n .describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Input placeholder translation\"),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) =>\n ![...BASE_QUESTION_TRANSLATION_KEYS, \"placeholder\"].includes(key),\n );\n return additionalKeys.every((key) =>\n /^option\\..+\\.(label|value)$/.test(key),\n );\n },\n {\n message:\n \"Additional keys must follow the pattern 'option.{id}.{label|value}'\",\n },\n )\n .describe(\"Translation schema for multiple choice questions\");\n\n// NPS question translation schema with type field\nexport const npsQuestionTranslationSchema = baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"nps\").describe(\"Question type identifier\"),\n minLabel: translationEntrySchema\n .optional()\n .describe(\"Minimum NPS label (0) translation\"),\n maxLabel: translationEntrySchema\n .optional()\n .describe(\"Maximum NPS label (10) translation\"),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) =>\n ![...BASE_QUESTION_TRANSLATION_KEYS, \"minLabel\", \"maxLabel\"].includes(\n key,\n ),\n );\n return additionalKeys.every((key) => /^scaleLabel\\.\\d+$/.test(key));\n },\n {\n message: \"Additional keys must follow the pattern 'scaleLabel.{number}'\",\n },\n )\n .describe(\"Translation schema for NPS questions\");\n\n// Short answer question translation schema with type field\nexport const shortAnswerQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"short_answer\").describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Input placeholder translation\"),\n })\n .describe(\"Translation schema for short answer questions\");\n\n// Long answer question translation schema with type field\nexport const longAnswerQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"long_text\").describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Textarea placeholder translation\"),\n })\n .describe(\"Translation schema for long answer questions\");\n\n// Video / audio / photo / text question translation schema\nexport const videoAudioQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"video_audio\").describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Placeholder for text/photo hints\"),\n modeTabLabelVideo: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated tab label for video mode\"),\n modeTabLabelAudio: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated tab label for audio mode\"),\n modeTabLabelPhoto: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated tab label for photo mode\"),\n modeTabLabelText: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated tab label for text mode\"),\n recordButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated Record button label\"),\n uploadMediaButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated upload button (video/audio)\"),\n videoIdleHint: z\n .string()\n .max(200)\n .optional()\n .describe(\"Translated video idle overlay hint\"),\n photoEmptyHint: z\n .string()\n .max(200)\n .optional()\n .describe(\"Translated empty photo area hint\"),\n photoUseCameraButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated Use camera button\"),\n photoUploadImageButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated Upload image button\"),\n })\n .describe(\"Translation schema for video/audio/photo/text questions\");\n\n// Date question translation schema\nexport const dateQuestionTranslationSchema = baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"date\").describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Placeholder for the date field\"),\n segmentLabelDD: z\n .string()\n .max(40)\n .optional()\n .describe(\"Label above the day digits\"),\n segmentLabelMM: z\n .string()\n .max(40)\n .optional()\n .describe(\"Label above the month digits\"),\n segmentLabelYYYY: z\n .string()\n .max(40)\n .optional()\n .describe(\"Label above the year digits\"),\n })\n .describe(\"Translation schema for date questions\");\n\n// Signature question translation schema\nexport const signatureQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"signature\").describe(\"Question type identifier\"),\n clearButtonLabel: z\n .string()\n .max(50)\n .optional()\n .describe(\"Translated clear button in draw mode\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Shared fallback for draw/upload hints\"),\n modeTabLabelType: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated Type tab label\"),\n modeTabLabelDraw: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated Draw tab label\"),\n modeTabLabelUpload: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated Upload tab label\"),\n drawCanvasHint: z\n .string()\n .max(200)\n .optional()\n .describe(\"Translated empty-canvas hint\"),\n uploadZonePrimary: z\n .string()\n .max(200)\n .optional()\n .describe(\"Translated idle upload prompt\"),\n uploadZoneDrag: z\n .string()\n .max(120)\n .optional()\n .describe(\"Translated drag-over upload prompt\"),\n })\n .describe(\"Translation schema for signature questions\");\n\n// Scheduler question translation schema\nexport const schedulerQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"scheduler\").describe(\"Question type identifier\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Fallback for meeting CTA when scheduleMeetingLabel is unset\",\n ),\n scheduleMeetingLabel: z\n .string()\n .max(200)\n .optional()\n .describe(\"Book-a-meeting button and modal label\"),\n })\n .describe(\"Translation schema for scheduler questions\");\n\n// Q&A with AI question translation schema\nexport const qnaWithAiQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"qna_with_ai\").describe(\"Question type identifier\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Input placeholder for the question field\"),\n askButtonLabel: z\n .string()\n .max(50)\n .optional()\n .describe(\"Ask / submit control label\"),\n emptyStateHint: z\n .string()\n .max(200)\n .optional()\n .describe(\"Empty chat area hint\"),\n pairsRemainingTemplate: z\n .string()\n .max(160)\n .optional()\n .describe(\"Under-limit counter; tokens {remaining} and {max}\"),\n pairsLimitReachedTemplate: z\n .string()\n .max(160)\n .optional()\n .describe(\"At-limit message; token {max}\"),\n })\n .describe(\"Translation schema for Q&A with AI questions\");\n\n// Payments UPI question translation schema\nexport const paymentsUpiQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"payments_upi\").describe(\"Question type identifier\"),\n qrLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label shown above the UPI QR code\"),\n openUpiAppLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"UPI intent button label\"),\n copyUpiIdLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Copy UPI ID button label\"),\n transactionIdLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Transaction ID / UTR input label\"),\n transactionIdPlaceholder: z\n .string()\n .max(120)\n .optional()\n .describe(\"Transaction ID / UTR input placeholder\"),\n })\n .describe(\"Translation schema for payments_upi questions\");\n\n// Nested selection question translation schema with type field\nexport const nestedSelectionQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"nested_selection\").describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Dropdown placeholder translation\"),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) =>\n ![...BASE_QUESTION_TRANSLATION_KEYS, \"placeholder\"].includes(key),\n );\n return additionalKeys.every((key) =>\n /^nestedOption\\..+\\.(label|hint)$/.test(key),\n );\n },\n {\n message:\n \"Additional keys must follow the pattern 'nestedOption.{id}.{label|hint}'\",\n },\n )\n .describe(\"Translation schema for nested selection questions\");\n\n// Annotation question translation schema with type field\nexport const annotationQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"annotation\").describe(\"Question type identifier\"),\n annotationText: translationEntrySchema\n .optional()\n .describe(\"Annotation display text translation\"),\n noAnnotationText: translationEntrySchema\n .optional()\n .describe(\"No annotation display text translation\"),\n })\n .describe(\"Translation schema for annotation questions\");\n\n// Welcome question translation schema with type field\nexport const welcomeQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"welcome\").describe(\"Question type identifier\"),\n })\n .describe(\"Translation schema for welcome screen questions\");\n\n// Thank you question translation schema with type field\nexport const thankYouQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"thank_you\").describe(\"Question type identifier\"),\n completionCta: z\n .object({\n label: translationEntrySchema\n .optional()\n .describe(\"Translated label for the primary CTA button\"),\n secondary: z\n .object({\n label: translationEntrySchema\n .optional()\n .describe(\"Translated label for the secondary CTA button\"),\n })\n .optional()\n .describe(\"Translated labels for the secondary CTA button\"),\n })\n .optional()\n .describe(\n \"Translations for completionCta button labels; only label fields are translatable \u2014 platform action configs (url, route, action) are locale-agnostic\",\n ),\n })\n .describe(\"Translation schema for thank you screen questions\");\n\n// Message panel question translation schema with type field (same shape as welcome)\nexport const messagePanelQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"message_panel\").describe(\"Question type identifier\"),\n })\n .describe(\"Translation schema for message panel questions\");\n\n// Consent question translation schema with type field\nexport const consentQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"consent\").describe(\"Question type identifier\"),\n })\n .describe(\n \"Translation schema for consent questions; description carries the translated checkbox label (markdown supported)\",\n );\n\n// Yes/no question translation schema with type field\nexport const yesNoQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"yes_no\").describe(\"Question type identifier\"),\n yesLabel: translationEntrySchema\n .optional()\n .describe(\"Translated Yes label\"),\n noLabel: translationEntrySchema\n .optional()\n .describe(\"Translated No label\"),\n })\n .describe(\"Translation schema for yes/no questions\");\n\n// Rating matrix question translation schema with type field\nexport const ratingMatrixQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"rating_matrix\").describe(\"Question type identifier\"),\n minLabel: translationEntrySchema\n .optional()\n .describe(\n \"Translated scale minimum end label (for likert and numerical kinds)\",\n ),\n maxLabel: translationEntrySchema\n .optional()\n .describe(\n \"Translated scale maximum end label (for likert and numerical kinds)\",\n ),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) =>\n ![\n ...BASE_QUESTION_TRANSLATION_KEYS,\n \"minLabel\",\n \"maxLabel\",\n ].includes(key as any),\n );\n return additionalKeys.every(\n (key) =>\n /^statement\\..+\\.label$/.test(key) ||\n /^scalePoint\\..+\\.label$/.test(key),\n );\n },\n {\n message:\n \"Additional keys must follow 'statement.{id}.label' or 'scalePoint.{id}.label'\",\n },\n )\n .describe(\"Translation schema for rating matrix questions\");\n\n// Matrix single-choice question translation schema with type field\nexport const matrixSingleChoiceQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z\n .literal(\"matrix_single_choice\")\n .describe(\"Question type identifier\"),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) => !BASE_QUESTION_TRANSLATION_KEYS.includes(key as any),\n );\n return additionalKeys.every(\n (key) =>\n /^row\\..+\\.label$/.test(key) || /^column\\..+\\.label$/.test(key),\n );\n },\n {\n message:\n \"Additional keys must follow 'row.{id}.label' or 'column.{id}.label'\",\n },\n )\n .describe(\"Translation schema for matrix single-choice questions\");\n\n// Matrix multiple-choice question translation schema with type field\nexport const matrixMultipleChoiceQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z\n .literal(\"matrix_multiple_choice\")\n .describe(\"Question type identifier\"),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) => !BASE_QUESTION_TRANSLATION_KEYS.includes(key as any),\n );\n return additionalKeys.every(\n (key) =>\n /^row\\..+\\.label$/.test(key) || /^column\\..+\\.label$/.test(key),\n );\n },\n {\n message:\n \"Additional keys must follow 'row.{id}.label' or 'column.{id}.label'\",\n },\n )\n .describe(\"Translation schema for matrix multiple-choice questions\");\n\n// Union of all question translation types\nexport const questionTranslationSchema = z\n .union([\n ratingQuestionTranslationSchema,\n singleChoiceQuestionTranslationSchema,\n multipleChoiceQuestionTranslationSchema,\n npsQuestionTranslationSchema,\n shortAnswerQuestionTranslationSchema,\n longAnswerQuestionTranslationSchema,\n videoAudioQuestionTranslationSchema,\n dateQuestionTranslationSchema,\n signatureQuestionTranslationSchema,\n schedulerQuestionTranslationSchema,\n qnaWithAiQuestionTranslationSchema,\n paymentsUpiQuestionTranslationSchema,\n nestedSelectionQuestionTranslationSchema,\n annotationQuestionTranslationSchema,\n welcomeQuestionTranslationSchema,\n thankYouQuestionTranslationSchema,\n messagePanelQuestionTranslationSchema,\n yesNoQuestionTranslationSchema,\n consentQuestionTranslationSchema,\n ratingMatrixQuestionTranslationSchema,\n matrixSingleChoiceQuestionTranslationSchema,\n matrixMultipleChoiceQuestionTranslationSchema,\n ])\n .describe(\"Union of all question type translation schemas\");\n\n// Language code schema for validation\nexport const languageCodeSchema = z\n .string()\n .min(2)\n .max(10)\n .describe(\"Language code (e.g., 'en', 'es', 'hi')\");\n\n// Section translation schema (one object per language, same pattern as question translations)\nexport const sectionTranslationSchema = z\n .object({\n title: translationEntrySchema\n .max(200)\n .describe(\"Section title translation\"),\n description: translationEntrySchema\n .max(1000)\n .optional()\n .describe(\"Section description translation\"),\n nextButtonLabel: translationEntrySchema\n .max(50)\n .optional()\n .describe(\"Next button label translation for this section\"),\n })\n .describe(\"Translation payload for a section in a single language\");\n\n// Section translations keyed by language code\nexport const sectionTranslationsByLanguageSchema = z\n .record(languageCodeSchema, sectionTranslationSchema)\n .describe(\"Section translations keyed by language code\");\n\n// Question translations keyed by language code\nexport const questionTranslationsByLanguageSchema = z\n .record(languageCodeSchema, questionTranslationSchema)\n .describe(\"Question translations keyed by language code\");\n\n// Main question-centric translation schema\nexport const questionCentricTranslationsSchema = z\n .record(z.string().uuid(), questionTranslationsByLanguageSchema)\n .describe(\n \"Question-centric translations keyed by question ID, then by language code\",\n );\n\n// Complete translation schema - questions directly at root level\nexport const translationsSchema = questionCentricTranslationsSchema.describe(\n \"Question-centric translations at root level\",\n);\n\n// Type exports\nexport type TranslationEntry = z.infer<typeof translationEntrySchema>;\nexport type RatingQuestionTranslation = z.infer<\n typeof ratingQuestionTranslationSchema\n>;\nexport type SingleChoiceQuestionTranslation = z.infer<\n typeof singleChoiceQuestionTranslationSchema\n>;\nexport type MultipleChoiceQuestionTranslation = z.infer<\n typeof multipleChoiceQuestionTranslationSchema\n>;\nexport type NpsQuestionTranslation = z.infer<\n typeof npsQuestionTranslationSchema\n>;\nexport type ShortAnswerQuestionTranslation = z.infer<\n typeof shortAnswerQuestionTranslationSchema\n>;\nexport type LongAnswerQuestionTranslation = z.infer<\n typeof longAnswerQuestionTranslationSchema\n>;\nexport type VideoAudioQuestionTranslation = z.infer<\n typeof videoAudioQuestionTranslationSchema\n>;\nexport type DateQuestionTranslation = z.infer<\n typeof dateQuestionTranslationSchema\n>;\nexport type SignatureQuestionTranslation = z.infer<\n typeof signatureQuestionTranslationSchema\n>;\nexport type SchedulerQuestionTranslation = z.infer<\n typeof schedulerQuestionTranslationSchema\n>;\nexport type QnaWithAiQuestionTranslation = z.infer<\n typeof qnaWithAiQuestionTranslationSchema\n>;\nexport type PaymentsUpiQuestionTranslation = z.infer<\n typeof paymentsUpiQuestionTranslationSchema\n>;\nexport type NestedSelectionQuestionTranslation = z.infer<\n typeof nestedSelectionQuestionTranslationSchema\n>;\nexport type AnnotationQuestionTranslation = z.infer<\n typeof annotationQuestionTranslationSchema\n>;\nexport type WelcomeQuestionTranslation = z.infer<\n typeof welcomeQuestionTranslationSchema\n>;\nexport type ThankYouQuestionTranslation = z.infer<\n typeof thankYouQuestionTranslationSchema\n>;\nexport type MessagePanelQuestionTranslation = z.infer<\n typeof messagePanelQuestionTranslationSchema\n>;\nexport type YesNoQuestionTranslation = z.infer<\n typeof yesNoQuestionTranslationSchema\n>;\nexport type ConsentQuestionTranslation = z.infer<\n typeof consentQuestionTranslationSchema\n>;\nexport type RatingMatrixQuestionTranslation = z.infer<\n typeof ratingMatrixQuestionTranslationSchema\n>;\nexport type MatrixSingleChoiceQuestionTranslation = z.infer<\n typeof matrixSingleChoiceQuestionTranslationSchema\n>;\nexport type MatrixMultipleChoiceQuestionTranslation = z.infer<\n typeof matrixMultipleChoiceQuestionTranslationSchema\n>;\n\n// Union type for all question translations\nexport type QuestionTranslation = z.infer<typeof questionTranslationSchema>;\n\nexport type SectionTranslation = z.infer<typeof sectionTranslationSchema>;\nexport type SectionTranslationsByLanguage = z.infer<\n typeof sectionTranslationsByLanguageSchema\n>;\n\n// Schema types\nexport type LanguageCode = z.infer<typeof languageCodeSchema>;\nexport type QuestionTranslationsByLanguage = z.infer<\n typeof questionTranslationsByLanguageSchema\n>;\nexport type QuestionCentricTranslations = z.infer<\n typeof questionCentricTranslationsSchema\n>;\nexport type Translations = z.infer<typeof translationsSchema>;\n\n// Translation helper class\nexport class TranslationProvider {\n private translations: Translations;\n private defaultLanguage: string;\n\n constructor(translations: Translations, defaultLanguage: string = \"en\") {\n this.translations = translations;\n this.defaultLanguage = defaultLanguage;\n }\n\n /**\n * Get translations for a specific question in a specific language\n */\n getQuestionTranslations(\n questionId: string,\n languageCode: string,\n ): QuestionTranslation | null {\n const questionTranslations = this.translations[questionId];\n if (!questionTranslations) return null;\n\n // Try to get the requested language\n let translation = questionTranslations[languageCode];\n\n // Fallback to default language if requested language not found\n if (!translation) {\n translation = questionTranslations[this.defaultLanguage];\n }\n\n return translation || null;\n }\n\n /**\n * Get a specific translation text by field path\n */\n getTranslationText(\n questionId: string,\n languageCode: string,\n fieldPath: string,\n ): string | null {\n const questionTranslation = this.getQuestionTranslations(\n questionId,\n languageCode,\n );\n if (!questionTranslation) return null;\n\n // Direct field access (e.g., \"title\", \"errorMessage\")\n if (fieldPath in questionTranslation) {\n const value =\n questionTranslation[fieldPath as keyof typeof questionTranslation];\n return typeof value === \"string\" ? value : null;\n }\n\n return null;\n }\n\n /**\n * Get all available languages for a specific question\n */\n getQuestionLanguages(questionId: string): string[] {\n const questionTranslations = this.translations[questionId];\n if (!questionTranslations) return [];\n\n return Object.keys(questionTranslations);\n }\n\n /**\n * Get all available languages across all questions\n */\n getAvailableLanguages(): string[] {\n const allLanguages = new Set<string>();\n\n Object.values(this.translations).forEach((questionTranslations) => {\n Object.keys(questionTranslations).forEach((langCode) => {\n allLanguages.add(langCode);\n });\n });\n\n return Array.from(allLanguages);\n }\n\n /**\n * Check if a language is supported for a specific question\n */\n isLanguageSupportedForQuestion(\n questionId: string,\n languageCode: string,\n ): boolean {\n const questionTranslations = this.translations[questionId];\n if (!questionTranslations) return false;\n\n return languageCode in questionTranslations;\n }\n\n /**\n * Check if a language is supported across all questions\n */\n isLanguageSupported(languageCode: string): boolean {\n return this.getAvailableLanguages().includes(languageCode);\n }\n\n /**\n * Get the default language\n */\n getDefaultLanguage(): string {\n return this.defaultLanguage;\n }\n\n /**\n * Get all questions that have translations\n */\n getQuestionIds(): string[] {\n return Object.keys(this.translations);\n }\n\n /**\n * Get question type for a specific question\n */\n getQuestionType(questionId: string, languageCode?: string): string | null {\n const langCode = languageCode || this.defaultLanguage;\n const translation = this.getQuestionTranslations(questionId, langCode);\n\n return translation?.type || null;\n }\n}\n\n// Factory function to create translation provider\nexport function createTranslationProvider(\n translations: Translations,\n defaultLanguage: string = \"en\",\n): TranslationProvider {\n return new TranslationProvider(translations, defaultLanguage);\n}\n", "import { z } from \"zod\";\n\n// \u2500\u2500\u2500 Platform action discriminated union \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const platformCompletionCtaSchema = z\n .discriminatedUnion(\"action\", [\n z\n .object({ action: z.literal(\"dismiss\") })\n .describe(\"Close/dismiss the form \u2014 fires form:complete then closes the embed\"),\n z\n .object({\n action: z.literal(\"app_navigate\"),\n route: z\n .string()\n .min(1)\n .max(500)\n .describe(\n \"App-specific route string passed to the host via form:ctaTriggered; the host is responsible for navigation\",\n ),\n })\n .describe(\n \"Delegate navigation to the host app via form:ctaTriggered event with the route string; web engine does not navigate\",\n ),\n z\n .object({\n action: z.literal(\"redirect_internal\"),\n url: z\n .string()\n .min(1)\n .max(2000)\n .describe(\n \"Target URL; on web opens in the same tab (_self); on native opens in an in-app browser (SFSafariView / Custom Tab)\",\n ),\n })\n .describe(\n \"Redirect within the current context \u2014 same tab on web, in-app browser on native\",\n ),\n z\n .object({\n action: z.literal(\"redirect_external\"),\n url: z\n .string()\n .min(1)\n .max(2000)\n .describe(\n \"Target URL; on web opens in a new tab (_blank); on native opens the system/external browser\",\n ),\n })\n .describe(\n \"Redirect to an external context \u2014 new tab on web, system browser on native\",\n ),\n ])\n .describe(\n \"Per-surface CTA action; discriminated on 'action' field \u2014 each variant carries only the fields relevant to its action\",\n );\n\n// \u2500\u2500\u2500 Secondary button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const completionCtaSecondarySchema = z\n .object({\n label: z\n .string()\n .min(1)\n .max(100)\n .describe(\n \"Label for the secondary button (e.g. 'Not right now', 'Learn more')\",\n ),\n inApp: platformCompletionCtaSchema\n .optional()\n .describe(\n \"Secondary button action when the form runs inside a host app; when this surface block is absent the engine defaults to dismiss (backward compatible with label-only secondary configs)\",\n ),\n link: platformCompletionCtaSchema\n .optional()\n .describe(\n \"Secondary button action when the form runs as a shareable link; when this surface block is absent the engine defaults to dismiss (backward compatible with label-only secondary configs)\",\n ),\n })\n .describe(\n \"Optional secondary button on thank_you screens; supports the same per-surface actions as the primary CTA (dismiss, app_navigate, redirect_internal, redirect_external); label-only configs default to dismiss on each surface\",\n );\n\n// \u2500\u2500\u2500 Root completionCta object \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const completionCtaSchema = z\n .object({\n label: z\n .string()\n .min(1)\n .max(100)\n .optional()\n .describe(\n \"Label for the primary CTA button; falls back to nextButtonLabel \u2192 section nextButtonLabel \u2192 'Done' when absent\",\n ),\n autoTriggerDelayMs: z\n .number()\n .int()\n .min(0)\n .max(30000)\n .optional()\n .describe(\n \"When set, automatically fires the primary action after this many milliseconds; fires for all actions including dismiss (e.g. set to 0 for immediate silent redirect, 3000 for auto-close after 3 s); when absent the action is manual only\",\n ),\n inApp: platformCompletionCtaSchema\n .optional()\n .describe(\n \"CTA action used when the form is rendered inside a host app \u2014 native WebView, web-sdk iframe, React Native / Flutter SDK bridge pages\",\n ),\n link: platformCompletionCtaSchema\n .optional()\n .describe(\n \"CTA action used when the form is rendered as a standalone shareable URL (browser tab or full-page embed)\",\n ),\n secondary: completionCtaSecondarySchema\n .optional()\n .describe(\n \"Optional secondary button on thank_you screens with its own per-surface action routing (inApp / link); label-only configs default to dismiss; not used on exit_form (no UI)\",\n ),\n })\n .describe(\n \"Optional completion CTA configuration for thank_you and exit_form questions; controls what happens after form submission \u2014 redirect, in-app navigation, or dismiss \u2014 with separate settings per rendering surface (inApp / link)\",\n );\n\n// \u2500\u2500\u2500 Type exports \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type PlatformCompletionCta = z.infer<typeof platformCompletionCtaSchema>;\nexport type CompletionCtaSecondary = z.infer<typeof completionCtaSecondarySchema>;\nexport type CompletionCta = z.infer<typeof completionCtaSchema>;\nexport type CompletionCtaAction = PlatformCompletionCta[\"action\"];\n", "import { z } from \"zod\";\n\n// Annotation marker schema\nexport const AnnotationMarkerSchema = z.object({\n markerNo: z.string(),\n timeline: z.string(),\n comment: z.string(),\n});\n\n// Annotation schema\nexport const AnnotationSchema = z.object({\n fileType: z.string(),\n fileName: z.string(),\n markers: z.array(AnnotationMarkerSchema),\n});\n\n// Signature answer schema \u2014 records which mode was used and the resulting artifact\nexport const SignatureAnswerSchema = z\n .object({\n mode: z\n .enum([\"type\", \"draw\", \"upload\"])\n .describe(\"The signing method the respondent used\"),\n fileUrl: z\n .string()\n .optional()\n .describe(\n \"Secure URL to the signature artifact for draw and upload modes\",\n ),\n typedName: z\n .string()\n .optional()\n .describe(\"The name the respondent typed for type mode\"),\n })\n .describe(\"Answer for a signature question\");\n\n// Single uploaded file entry\nexport const FileUploadAnswerItemSchema = z\n .object({\n fileUrl: z.string().describe(\"Secure URL to the uploaded file\"),\n fileName: z\n .string()\n .describe(\"Original filename as provided by the respondent\"),\n fileSizeMb: z.number().describe(\"File size in megabytes\"),\n mimeType: z\n .string()\n .optional()\n .describe(\n \"MIME type of the uploaded file (e.g. 'application/pdf', 'image/jpeg')\",\n ),\n })\n .describe(\"Metadata for a single uploaded file\");\n\n// File upload answer schema \u2014 array to support multiple: true\nexport const FileUploadAnswerSchema = z\n .array(FileUploadAnswerItemSchema)\n .describe(\n \"Answer for a file upload question; array supports single and multiple file uploads\",\n );\n\n// Phone number answer schema \u2014 structured to separate country code from local number\nexport const PhoneNumberAnswerSchema = z\n .object({\n countryCode: z\n .string()\n .describe(\n \"Dialing country code including the + prefix (e.g. '+1', '+91')\",\n ),\n number: z.string().describe(\"Local phone number without the country code\"),\n e164: z\n .string()\n .optional()\n .describe(\"Full phone number in E.164 format (e.g. '+14155552671')\"),\n })\n .describe(\"Answer for a phone number question\");\n\n// Address answer schema \u2014 mirrors the address question sub-fields\nexport const AddressAnswerSchema = z\n .object({\n addressLine1: z.string().optional().describe(\"Primary street address line\"),\n addressLine2: z\n .string()\n .optional()\n .describe(\"Secondary address line (apartment, suite, etc.)\"),\n city: z.string().optional().describe(\"City or town\"),\n stateProvince: z.string().optional().describe(\"State, region, or province\"),\n postalCode: z.string().optional().describe(\"ZIP or postal code\"),\n country: z\n .string()\n .optional()\n .describe(\"Country name or ISO 3166-1 alpha-2 code\"),\n })\n .describe(\"Answer for an address question\");\n\n// Video, audio, photo, and text answer schema\nexport const VideoAudioAnswerSchema = z\n .object({\n mode: z\n .enum([\"video\", \"audio\", \"photo\", \"text\"])\n .describe(\"The answer mode the respondent chose\"),\n fileUrl: z\n .string()\n .optional()\n .describe(\n \"Secure URL or temporary data URL to the recorded, captured, or uploaded video, audio, or image file\",\n ),\n text: z.string().optional().describe(\"Written answer for text mode\"),\n durationSeconds: z\n .number()\n .optional()\n .describe(\n \"Actual recording length in seconds for video and audio modes (not used for photo)\",\n ),\n transcriptText: z\n .string()\n .optional()\n .describe(\"Auto-generated transcript for video and audio recordings\"),\n })\n .describe(\"Answer for a video and audio question\");\n\n// Single Q&A pair \u2014 one respondent question and the AI-generated answer\nexport const QnaWithAiPairSchema = z\n .object({\n question: z.string().describe(\"The question the respondent asked\"),\n answer: z\n .string()\n .describe(\"The AI-generated answer based on the knowledge base\"),\n })\n .describe(\"A single Q&A exchange between the respondent and the AI\");\n\n// Q&A with AI answer schema \u2014 ordered transcript of all exchanges\nexport const QnaWithAiAnswerSchema = z\n .array(QnaWithAiPairSchema)\n .describe(\n \"Answer for a qna_with_ai question; ordered transcript of Q&A pairs from the session\",\n );\n\n// Scheduler answer schema \u2014 booking confirmation details\nexport const SchedulerAnswerSchema = z\n .discriminatedUnion(\"provider\", [\n z.object({\n provider: z\n .literal(\"google_calendar\")\n .describe(\"The calendar integration used to make the booking\"),\n bookedAt: z\n .string()\n .describe(\n \"Unix timestamp in seconds as a string when the respondent confirmed the booking\",\n ),\n }),\n z.object({\n provider: z\n .literal(\"calendly\")\n .describe(\"The calendar integration used to make the booking\"),\n slotStart: z\n .string()\n .describe(\n \"ISO 8601 datetime of the booked slot start (e.g. '2026-05-15T14:00:00Z')\",\n ),\n slotEnd: z\n .string()\n .describe(\n \"ISO 8601 datetime of the booked slot end (e.g. '2026-05-15T14:30:00Z')\",\n ),\n eventId: z.string().optional().describe(\"Calendly event UUID\"),\n bookedAt: z\n .string()\n .describe(\n \"Unix timestamp in seconds as a string when the respondent completed the booking\",\n ),\n }),\n ])\n .describe(\"Answer for a scheduler question\");\n\n// Payments UPI answer schema \u2014 self-reported payment reference plus immutable payment snapshot\nexport const PaymentsUpiAnswerSchema = z\n .object({\n transactionId: z\n .string()\n .describe(\n \"Respondent-entered UPI transaction ID / UTR; self-reported and not verified by Encatch\",\n ),\n encatchPaymentReference: z\n .string()\n .describe(\n \"Opaque Encatch-generated reconciliation reference included in the UPI intent\",\n ),\n amount: z\n .string()\n .trim()\n .refine((s) => {\n const n = Number(s);\n return Number.isFinite(n) && n > 0;\n }, { message: \"Amount must be a positive numeric value\" })\n .describe(\n \"INR amount shown to the respondent when the payment instruction was generated, as a decimal string (legacy numeric values are accepted when parsing)\",\n ),\n currency: z.literal(\"INR\").describe(\"Currency for UPI payments\"),\n payeeVpa: z.string().describe(\"UPI VPA shown to the respondent\"),\n payeeName: z\n .string()\n .optional()\n .describe(\"Payee display name shown to the respondent\"),\n sourceEmail: z\n .string()\n .optional()\n .describe(\"Email address resolved from the configured source email question\"),\n upiIntentUri: z\n .string()\n .optional()\n .describe(\"Generated UPI intent URI shown to the respondent\"),\n selfReported: z\n .literal(true)\n .describe(\n \"Always true: Encatch records this answer but does not verify the payment\",\n ),\n })\n .describe(\"Answer for a payments_upi question\");\n\n// AnswerItem schema\nexport const AnswerItemSchema = z\n .object({\n nps: z\n .number()\n .optional()\n .describe(\"Net Promoter Score value (e.g., 0-10)\"),\n nestedSelection: z\n .array(z.string())\n .optional()\n .describe(\"Array of selected nested option IDs\"),\n longText: z\n .string()\n .optional()\n .describe(\"Long text answer, e.g., paragraph or essay\"),\n shortAnswer: z\n .string()\n .optional()\n .describe(\"Short text answer, e.g., single sentence or word\"),\n singleChoice: z\n .string()\n .optional()\n .describe(\"Single selected option value for single choice questions\"),\n rating: z.number().optional().describe(\"Star rating value (e.g., 1-5)\"),\n yesNo: z\n .boolean()\n .optional()\n .describe(\"Yes/no answer for yes_no questions (true = Yes, false = No)\"),\n consent: z\n .boolean()\n .optional()\n .describe(\n \"Consent answer for consent questions (true = checked/agreed, false = unchecked)\",\n ),\n multipleChoiceMultiple: z\n .array(z.string())\n .optional()\n .describe(\n \"Array of selected option values for multiple choice questions\",\n ),\n singleChoiceOther: z\n .string()\n .optional()\n .describe(\n 'Free-text \"other\" answer for single choice questions when allowOther is enabled',\n ),\n multipleChoiceOther: z\n .string()\n .optional()\n .describe(\n 'Free-text \"other\" answer for multiple choice questions when allowOther is enabled',\n ),\n annotation: AnnotationSchema.optional().describe(\n \"Annotation object containing file and marker details\",\n ),\n ratingMatrix: z\n .record(z.string(), z.union([z.number(), z.string()]))\n .optional()\n .describe(\n \"Rating matrix answers keyed by statement value (export key), value is the selected scale value (number for likert/numerical, string for custom)\",\n ),\n matrixSingleChoice: z\n .record(z.string(), z.string())\n .optional()\n .describe(\n \"Matrix single-choice answers keyed by row value (export key), map value is the selected column option value\",\n ),\n matrixMultipleChoice: z\n .record(z.string(), z.array(z.string()))\n .optional()\n .describe(\n \"Matrix multiple-choice answers keyed by row value (export key), map value is array of selected column option values\",\n ),\n others: z\n .string()\n .optional()\n .describe(\n \"For multiple choice questions and single choice questions, this is the value of the other option\",\n ),\n // Date question\n date: z\n .string()\n .optional()\n .describe(\n \"Answer for a date question; ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:MM)\",\n ),\n // CSAT question\n csat: z\n .number()\n .optional()\n .describe(\n \"Answer for a CSAT question; industry-standard value: 1 (lowest/worst) to N (highest/best) where N is the scale size (2\u20135)\",\n ),\n // Opinion scale question\n opinionScale: z\n .number()\n .optional()\n .describe(\n \"Answer for an opinion scale question; the selected numeric value on the scale\",\n ),\n // Ranking question \u2014 ordered array of option values; index 0 = rank 1\n ranking: z\n .array(z.string())\n .optional()\n .describe(\n \"Answer for a ranking question; ordered array of option values where index 0 is rank 1\",\n ),\n // Picture choice \u2014 always an array of selected option values (single selection = one-element array)\n pictureChoice: z\n .array(z.string())\n .optional()\n .describe(\n \"Answer for a picture choice question; array of selected option values (single selection produces a one-element array)\",\n ),\n pictureChoiceOther: z\n .string()\n .optional()\n .describe(\n 'Free-text \"other\" answer for picture choice questions when allowOther is enabled',\n ),\n // Signature question\n signature: SignatureAnswerSchema.optional().describe(\n \"Answer for a signature question\",\n ),\n // File upload question\n fileUpload: FileUploadAnswerSchema.optional().describe(\n \"Answer for a file upload question; array supports single and multiple file uploads\",\n ),\n // Email question\n email: z\n .string()\n .optional()\n .describe(\"Answer for an email question; the submitted email address\"),\n // Number question\n number: z\n .string()\n .optional()\n .describe(\n \"Answer for a number question; the submitted numeric value as a string\",\n ),\n // Website question\n website: z\n .string()\n .optional()\n .describe(\"Answer for a website question; the submitted URL\"),\n // Phone number question\n phoneNumber: PhoneNumberAnswerSchema.optional().describe(\n \"Answer for a phone number question\",\n ),\n // Address question\n address: AddressAnswerSchema.optional().describe(\n \"Answer for an address question\",\n ),\n // Video and audio question\n videoAudio: VideoAudioAnswerSchema.optional().describe(\n \"Answer for a video and audio question\",\n ),\n // Scheduler question\n scheduler: SchedulerAnswerSchema.optional().describe(\n \"Answer for a scheduler question\",\n ),\n // Q&A with AI question\n qnaWithAi: QnaWithAiAnswerSchema.optional().describe(\n \"Answer for a qna_with_ai question; ordered transcript of Q&A pairs from the session\",\n ),\n // Payments UPI question\n paymentsUpi: PaymentsUpiAnswerSchema.optional().describe(\n \"Answer for a payments_upi question; self-reported UPI transaction reference\",\n ),\n })\n .describe(\n \"Flexible answer item supporting various question types and custom fields\",\n );\n\n// Legacy AnswerSchema for backward compatibility\nexport const AnswerSchema = AnswerItemSchema;\n\n// Type inference from schemas (for type safety)\nexport type AnnotationMarker = z.infer<typeof AnnotationMarkerSchema>;\nexport type Annotation = z.infer<typeof AnnotationSchema>;\nexport type SignatureAnswer = z.infer<typeof SignatureAnswerSchema>;\nexport type FileUploadAnswerItem = z.infer<typeof FileUploadAnswerItemSchema>;\nexport type FileUploadAnswer = z.infer<typeof FileUploadAnswerSchema>;\nexport type PhoneNumberAnswer = z.infer<typeof PhoneNumberAnswerSchema>;\nexport type AddressAnswer = z.infer<typeof AddressAnswerSchema>;\nexport type VideoAudioAnswer = z.infer<typeof VideoAudioAnswerSchema>;\nexport type SchedulerAnswer = z.infer<typeof SchedulerAnswerSchema>;\nexport type QnaWithAiPair = z.infer<typeof QnaWithAiPairSchema>;\nexport type QnaWithAiAnswer = z.infer<typeof QnaWithAiAnswerSchema>;\nexport type PaymentsUpiAnswer = z.infer<typeof PaymentsUpiAnswerSchema>;\nexport type AnswerItem = z.infer<typeof AnswerItemSchema>;\nexport type Answer = z.infer<typeof AnswerSchema>;\n", "import { z } from \"zod\";\n\n// External publishing properties schema\nexport const externalPublishingPropertiesSchema = z\n .object({\n isShareable: z\n .boolean()\n .describe(\"Whether the feedback results can be shared externally\"),\n isEmailShareable: z\n .boolean()\n .describe(\"Whether the feedback can be shared via email\"),\n })\n .describe(\"Schema defining external publishing and sharing properties for feedback\");\n\n// Publication status enum\nexport const publicationStatusSchema = z\n .enum([\"P\", \"D\",\"A\", \"S\"])\n .describe(\"Publication status: P=Published, D=Draft, A=Archived, S=Stopped\");\n\n// Constants for publication status (explicit literal values for proper type inference)\nexport const PublicationStatuses = {\n PUBLISHED: \"P\" as const,\n DRAFT: \"D\" as const,\n ARCHIVED: \"A\" as const,\n STOPPED: \"S\" as const,\n} as const;\n\n// Feedback configuration schema\nexport const feedbackConfigurationSchema = z\n .object({\n formTitle: z\n .string()\n .describe(\"Title of the feedback form\"),\n formDescription: z\n .string()\n .describe(\"Description of the feedback form\"),\n isPublished: publicationStatusSchema\n .describe(\"Publication status of the feedback form\"),\n })\n .describe(\"Schema defining feedback configuration properties\");\n\n// Type inference from schemas (for type safety)\nexport type PublicationStatus = z.infer<typeof publicationStatusSchema>;\nexport type FeedbackConfiguration = z.infer<typeof feedbackConfigurationSchema>;\nexport type ExternalPublishingProperties = z.infer<typeof externalPublishingPropertiesSchema>;\n", "import { z } from \"zod\";\nimport {\n feedbackConfigurationSchema,\n externalPublishingPropertiesSchema,\n} from \"./form-schema\";\nimport { combinedQuestionSchema, sectionSchema } from \"./field-schema\";\nimport { translationsSchema } from \"./translations-schema\";\nimport { LanguagesSchema, OtherFieldsSchema, OtherFieldsTranslationSchema } from \"./other-screen-schema\";\nimport { themeConfigurationSchema } from \"./theme-schema\";\nimport { audienceTriggerPropertiesSchema } from \"./auto-trigger-schema\";\nimport { sectionLayoutSchema } from \"./layout-schema\";\n\n// Other configuration properties schema using discriminated union for JSON schema compatibility\nexport const otherConfigurationPropertiesSchema = z\n .discriminatedUnion(\"isEnabled\", [\n // When other configuration is disabled\n z.object({\n isEnabled: z\n .literal(false)\n .describe(\"Whether other configuration properties are enabled\"),\n otherFields: OtherFieldsSchema\n .describe(\"Other form configuration fields including buttons and display options\"),\n translations: z.record(z.string(), OtherFieldsTranslationSchema)\n .optional()\n .describe(\"Translations for other configuration field labels and buttons keyed by language code\"),\n }),\n // When other configuration is enabled\n z.object({\n isEnabled: z\n .literal(true)\n .describe(\"Whether other configuration properties are enabled\"),\n otherFields: OtherFieldsSchema\n .describe(\"Other form configuration fields including buttons and display options\"),\n translations: z.record(z.string(), OtherFieldsTranslationSchema)\n .describe(\"Translations for other configuration field labels and buttons keyed by language code\"),\n }),\n ])\n .describe(\"Schema for other configuration properties including fields and translations\");\n\n// Appearance properties schema\nexport const appearancePropertiesSchema = z\n .object({\n themeConfiguration: themeConfigurationSchema\n .describe(\"Theme configuration including colors, features, and positioning\"),\n sectionLayoutDefaults: sectionLayoutSchema\n .optional()\n .describe(\n \"Default layout applied to sections that have no explicit entry in sectionLayouts. Resolved independently per surface (inApp, link.mobile, link.others)\"\n ),\n sectionLayouts: z\n .record(z.string(), sectionLayoutSchema)\n .optional()\n .describe(\n \"Per-section layout overrides keyed by section id. Takes precedence over sectionLayoutDefaults. Omit a section to fall back to sectionLayoutDefaults or engine default\"\n ),\n })\n .describe(\"Schema for appearance properties including theme configuration and per-section layouts\");\n\n// Combined form properties schema (if needed for complete form configuration)\nexport const formPropertiesSchema = z\n .object({\n feedbackConfigurationId: z.uuid()\n .describe(\"Unique identifier for the feedback configuration\"),\n feedbackConfiguration: feedbackConfigurationSchema\n .describe(\"Configuration properties for the feedback form\"),\n questionnaireFields: z\n .object({\n questions: z.record(z.string(), combinedQuestionSchema)\n .describe(\"Collection of questions keyed by their string identifiers\"),\n sections: z.array(sectionSchema)\n .describe(\"Array of sections that organize questions into logical groups\"),\n selectedLanguages: LanguagesSchema\n .describe(\"Array of languages selected for this questionnaire\"),\n translations: translationsSchema\n .describe(\"Multi-language translations for questions and form content\"),\n })\n .describe(\"Fields defining the questionnaire structure, questions, sections, selected languages, and translations\"),\n externalPublishingProperties: externalPublishingPropertiesSchema\n .describe(\"Properties controlling external sharing and publishing of feedback results\"),\n audienceTriggerProperties: audienceTriggerPropertiesSchema\n .describe(\"Properties defining audience targeting and trigger conditions for the feedback form\"),\n otherConfigurationProperties: otherConfigurationPropertiesSchema\n .describe(\"Additional configuration properties including form display options and translations\"),\n appearanceProperties: appearancePropertiesSchema\n .describe(\"Appearance configuration including themes, colors, and UI feature settings\"),\n })\n .describe(\"Complete schema for all feedback-level properties including publishing, audience targeting, configuration, and appearance\");\n\n// Type inference from schema (for type safety)\nexport type FormProperties = z.infer<typeof formPropertiesSchema>;\n\n// Explicit type definition for better inference\nexport type OtherConfigurationProperties = \n | {\n isEnabled: false;\n otherFields?: z.infer<typeof OtherFieldsSchema>;\n translations?: Record<string, z.infer<typeof OtherFieldsTranslationSchema>>;\n }\n | {\n isEnabled: true;\n otherFields: z.infer<typeof OtherFieldsSchema>;\n translations: Record<string, z.infer<typeof OtherFieldsTranslationSchema>>;\n };\n\nexport type AppearanceProperties = z.infer<typeof appearancePropertiesSchema>;\nexport type { SectionLayout } from \"./layout-schema\";\n", "import { z } from \"zod\";\n\n// Other configuration fields schema\nexport const OtherFieldsSchema = z\n .object({\n questionNumber: z\n .boolean()\n .describe(\"Whether to display question numbers\"),\n submitButtonLabel: z\n .string()\n .min(1)\n .max(50)\n .describe(\"Text for the submit button\"),\n previousButtonLabel: z\n .string()\n .min(1)\n .max(50)\n .describe(\"Text for the previous button in pagination\"),\n aiEnhancementSuccessMessage: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Message shown when AI enhancement is successful (max 100 characters)\"),\n aiEnhancementCooldownErrorMessage: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Message shown when AI enhancement is on cooldown (max 100 characters)\"),\n aiEnhancementMaxReachedErrorMessage: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Message shown when maximum AI enhancements reached (max 100 characters)\"),\n remindMeLaterButtonLabel: z\n .string()\n .max(50)\n .optional()\n .describe(\"Label for the remind me later button; when absent or blank the button is not shown\"),\n estimatedCompletionLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Estimated completion time label shown on the welcome or first screen (e.g. 'Takes about 2 minutes'); when absent the label is not shown\"),\n respondentsShowMinThreshold: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Minimum number of respondents required before the respondents badge is shown; when absent the badge is never shown\"),\n respondentsLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label template for the respondents badge (e.g. '{count} people have already responded'); client interpolates {count} at render time\"),\n windowTitle: z\n .string()\n .max(100)\n .optional()\n .describe(\"Custom browser window/tab title for the form; when absent the platform uses a default (e.g. the form title or app name)\"),\n })\n .describe(\"Schema for other form configuration fields\");\n\n// Language field schema\nexport const LanguageFieldSchema = z\n .object({\n value: z\n .string()\n .min(1)\n .max(10)\n .describe(\"Language code (e.g., 'en', 'es', 'fr')\"),\n label: z\n .string()\n .min(1)\n .max(50)\n .describe(\"Display name for the language (e.g., 'English', 'Spanish', 'French')\"),\n })\n .describe(\"Schema for individual language field with value and label\");\n\n// Languages configuration schema\nexport const LanguagesSchema = z\n .array(LanguageFieldSchema)\n .describe(\"Schema for array of available languages\");\n\n// Other fields translation schema\nexport const OtherFieldsTranslationSchema = z\n .object({\n submitButtonLabel: z\n .string()\n .min(1)\n .max(50)\n .describe(\"Translated text for the submit button\"),\n previousButtonLabel: z\n .string()\n .min(1)\n .max(50)\n .describe(\"Translated text for the previous button in pagination\"),\n aiEnhancementSuccessMessage: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Translated message shown when AI enhancement is successful (max 100 characters)\"),\n aiEnhancementCooldownErrorMessage: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Translated message shown when AI enhancement is on cooldown (max 100 characters)\"),\n aiEnhancementMaxReachedErrorMessage: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Translated message shown when maximum AI enhancements reached (max 100 characters)\"),\n remindMeLaterButtonLabel: z\n .string()\n .max(50)\n .optional()\n .describe(\"Translated label for the remind me later button\"),\n estimatedCompletionLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Translated estimated completion time label\"),\n respondentsLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Translated label template for the respondents badge (e.g. '{count} people have already responded'); client interpolates {count} at render time\"),\n windowTitle: z\n .string()\n .max(100)\n .optional()\n .describe(\"Translated browser window/tab title for the form\"),\n })\n .describe(\"Schema for other form configuration field translations\");\n\n// Export inferred types\nexport type OtherFields = z.infer<typeof OtherFieldsSchema>;\nexport type OtherFieldsTranslation = z.infer<typeof OtherFieldsTranslationSchema>;\nexport type LanguageField = z.infer<typeof LanguageFieldSchema>;\nexport type Languages = z.infer<typeof LanguagesSchema>;\n", "import { z } from \"zod\";\n\n// Position enum for widget positioning\nexport const positionSchema = z\n .enum([\n \"top-left\",\n \"top-center\",\n \"top-right\",\n \"middle-left\",\n \"middle-center\",\n \"middle-right\",\n \"bottom-left\",\n \"bottom-center\",\n \"bottom-right\",\n ])\n .describe(\"Available positions for widget placement\");\n\n// Constants for positions (explicit literal values for proper type inference)\nexport const Positions = {\n TOP_LEFT: \"top-left\" as const,\n TOP_CENTER: \"top-center\" as const,\n TOP_RIGHT: \"top-right\" as const,\n MIDDLE_LEFT: \"middle-left\" as const,\n MIDDLE_CENTER: \"middle-center\" as const,\n MIDDLE_RIGHT: \"middle-right\" as const,\n BOTTOM_LEFT: \"bottom-left\" as const,\n BOTTOM_CENTER: \"bottom-center\" as const,\n BOTTOM_RIGHT: \"bottom-right\" as const,\n} as const;\n\n// Theme mode enum for light and dark themes\nexport const themeModeSchema = z\n .enum([\"light\", \"dark\"])\n .describe(\"Available theme modes for the widget\");\n\n// Constants for theme modes (explicit literal values for proper type inference)\nexport const ThemeModes = {\n LIGHT: \"light\" as const,\n DARK: \"dark\" as const,\n} as const;\n\n// Shareable mode: light, dark, or follow system preference\nexport const shareableModeSchema = z\n .enum([\"light\", \"dark\", \"system\"])\n .describe(\n \"Display mode for the shareable widget: light, dark, or system preference\"\n );\n\nexport const ShareableModes = {\n LIGHT: \"light\" as const,\n DARK: \"dark\" as const,\n SYSTEM: \"system\" as const,\n} as const;\n\n// Previous button visibility mode enum\nexport const previousButtonModeSchema = z\n .enum([\"never\", \"always\", \"auto\"])\n .describe(\n \"Previous button visibility: never (always hidden), always (always shown), or auto (per-section via isPreviousAllowed)\"\n );\n\nexport const PreviousButtonModes = {\n NEVER: \"never\" as const,\n ALWAYS: \"always\" as const,\n AUTO: \"auto\" as const,\n} as const;\n\n// Logo placement enum \u2014 top row only (not middle/bottom)\nexport const logoPlacementSchema = z\n .enum([\"top-left\", \"top-center\", \"top-right\"])\n .describe(\"Where the logo is anchored in the form header\");\n\nexport const LogoPlacements = {\n TOP_LEFT: \"top-left\" as const,\n TOP_CENTER: \"top-center\" as const,\n TOP_RIGHT: \"top-right\" as const,\n} as const;\n\n// Logo size enum \u2014 rendered display size within the 96\u00D740 px container\nexport const logoSizeSchema = z\n .enum([\"small\", \"medium\", \"large\"])\n .describe(\"Rendered display size of the logo within the 96\u00D740 px container\");\n\nexport const LogoSizes = {\n SMALL: \"small\" as const,\n MEDIUM: \"medium\" as const,\n LARGE: \"large\" as const,\n} as const;\n\n// Per-surface logo overrides for link/shareable surfaces\nexport const logoSurfaceOverrideSchema = z\n .object({\n size: logoSizeSchema\n .optional()\n .describe(\"Size override for this surface; falls back to the global size\"),\n placement: logoPlacementSchema\n .optional()\n .describe(\"Placement override for this surface; falls back to the global placement\"),\n hidden: z\n .boolean()\n .optional()\n .describe(\"When true, the logo is suppressed on this surface\"),\n disableLink: z\n .boolean()\n .optional()\n .describe(\"When true, the logo is not clickable on this surface\"),\n })\n .describe(\"Per-surface overrides for logo display on link/shareable\");\n\n// Logo schema \u2014 applies to link/shareable surfaces only, not rendered in-app\nexport const logoSchema = z\n .object({\n href: z\n .object({\n light: z\n .string()\n .url()\n .describe(\"Logo URL for light mode \u2014 rendered within a 96\u00D740 px container\"),\n dark: z\n .string()\n .url()\n .optional()\n .describe(\"Logo URL for dark mode; falls back to light if absent\"),\n })\n .describe(\"Logo image URLs per theme mode\"),\n placement: logoPlacementSchema\n .default(\"top-left\")\n .describe(\"Default placement in the form header\"),\n size: logoSizeSchema\n .default(\"medium\")\n .describe(\"Default rendered size of the logo\"),\n linkUrl: z\n .string()\n .url()\n .optional()\n .describe(\"Optional URL to navigate to when the logo is clicked\"),\n altText: z\n .string()\n .max(200)\n .optional()\n .describe(\"Accessible alt text for the logo image\"),\n surfaces: z\n .object({\n link: z\n .object({\n mobile: logoSurfaceOverrideSchema\n .optional()\n .describe(\"Overrides for link/shareable on mobile viewports\"),\n others: logoSurfaceOverrideSchema\n .optional()\n .describe(\"Overrides for link/shareable on tablet and desktop viewports\"),\n })\n .optional(),\n })\n .optional()\n .describe(\"Per-surface overrides; logo is link/shareable only \u2014 not rendered in-app\"),\n })\n .describe(\"Logo displayed in the form header; applies to link/shareable surfaces only\");\n\n// Schema for feature settings controlling UI behavior\nexport const featureSettingsSchema = z\n .object({\n darkOverlay: z\n .boolean()\n .default(false)\n .describe(\"Whether to show a dark overlay behind the widget\"),\n closeButton: z\n .boolean()\n .default(true)\n .describe(\"Whether to display a close button on the widget\"),\n progressBar: z\n .boolean()\n .default(true)\n .describe(\"Whether to show a progress bar indicating completion status\"),\n showBranding: z\n .boolean()\n .default(true)\n .describe(\"Whether to display branding elements on the widget\"),\n customPosition: z\n .boolean()\n .describe(\"Whether custom positioning is enabled\"),\n customCss: z\n .string()\n .optional()\n .describe(\"Custom CSS to apply \u2014 either a URL ending in .css or raw CSS text\"),\n fontFamily: z\n .string()\n .optional()\n .default(\"default\")\n .describe(\"Font family to use for the widget\"),\n shareableMode: shareableModeSchema\n .optional()\n .default(ShareableModes.LIGHT)\n .describe(\n \"Display mode for the shareable: light, dark, or system preference\"\n ),\n enableShareableKeyboardNavigation: z\n .boolean()\n .default(false)\n .describe(\n \"Whether keyboard navigation is enabled for the shareable widget experience\"\n ),\n rtl: z\n .boolean()\n .default(false)\n .describe(\"Whether right-to-left text direction is enabled\"),\n previousButton: previousButtonModeSchema\n .default(PreviousButtonModes.ALWAYS)\n .describe(\"Previous button: never (hidden) or always (shown)\"),\n maxDialogHeightPercentInApp: z\n .number()\n .int()\n .min(10)\n .max(100)\n .optional()\n .describe(\"Maximum height of the in-app dialog as a percentage of the viewport height (10\u2013100); when absent the dialog uses its default height\"),\n faviconUrl: z\n .string()\n .optional()\n .describe(\"URL of a custom favicon image to display in the browser tab; when absent the platform default favicon is used\"),\n logo: logoSchema\n .optional()\n .describe(\"Optional form-level logo shown in the header on link/shareable surfaces; omit to show no logo\"),\n })\n .describe(\"Feature settings controlling widget UI behavior and appearance\");\n\n// Schema for individual theme (shadcn variables per mode)\nexport const themeColorsSchema = z\n .object({\n theme: z\n .string()\n .optional()\n .describe(\"Theme for a single mode (shadcn variables JSON)\"),\n })\n .describe(\"Theme for a single mode (shadcn variables)\");\n\n// Schema for the complete themes object\nexport const themesSchema = z\n .object({\n light: themeColorsSchema,\n dark: themeColorsSchema,\n })\n .describe(\"Complete theme configuration with light and dark variants\");\n\n// Schema for the complete theme configuration\nexport const themeConfigurationSchema = z\n .object({\n themes: themesSchema.describe(\"Color themes for light and dark modes\"),\n featureSettings: featureSettingsSchema.describe(\n \"UI feature settings controlling widget behavior\"\n ),\n selectedPosition: positionSchema.describe(\n \"Selected position for the main widget\"\n ),\n selectedIconPosition: positionSchema.describe(\n \"Selected position for the widget icon\"\n ),\n })\n .describe(\n \"Complete theme and UI configuration including colors, features, and positioning\"\n );\n\n// Type exports for TypeScript\nexport type Position = z.infer<typeof positionSchema>;\nexport type ThemeMode = z.infer<typeof themeModeSchema>;\nexport type ShareableMode = z.infer<typeof shareableModeSchema>;\nexport type PreviousButtonMode = z.infer<typeof previousButtonModeSchema>;\nexport type LogoPlacement = z.infer<typeof logoPlacementSchema>;\nexport type LogoSize = z.infer<typeof logoSizeSchema>;\nexport type LogoSurfaceOverride = z.infer<typeof logoSurfaceOverrideSchema>;\nexport type Logo = z.infer<typeof logoSchema>;\nexport type FeatureSettings = z.infer<typeof featureSettingsSchema>;\nexport type ThemeColors = z.infer<typeof themeColorsSchema>;\nexport type Themes = z.infer<typeof themesSchema>;\nexport type ThemeConfiguration = z.infer<typeof themeConfigurationSchema>;\n", "import { z } from \"zod\";\n\n// Custom event field operator schema\nexport const customEventFieldOperatorSchema = z\n .object({\n name: z\n .string()\n .describe(\"The operator name (e.g., '=', '!=', 'contains', 'beginsWith', 'matches')\"),\n label: z\n .string()\n .describe(\"Human-readable label for the operator (e.g., 'equals', 'not equals', 'contains')\"),\n })\n .describe(\"Schema defining an operator for custom event fields\");\n\n// Custom event field schema\nexport const customEventFieldSchema = z\n .object({\n name: z\n .string()\n .describe(\"The field name (e.g., 'event_name', 'add_to_cart', 'cart_item_number')\"),\n label: z\n .string()\n .describe(\"Human-readable label for the field\"),\n placeholder: z\n .string()\n .describe(\"Placeholder text for input fields\"),\n operators: z\n .array(customEventFieldOperatorSchema)\n .min(1)\n .describe(\"Array of available operators for this field\"),\n })\n .describe(\"Schema defining a custom event field with its operators\");\n\n// Metadata schema for conditional if\nexport const conditionalIfMetadataSchema = z\n .object({\n customEventFields: z\n .array(customEventFieldSchema)\n .optional()\n .describe(\"Array of custom event fields with their operators and labels\"),\n })\n .describe(\"Schema defining metadata for conditional if clauses\");\n\n// Query output schema with defined structure but all fields as strings\nexport const queryOutputSchema = z\n .object({\n query: z\n .string()\n .describe(\"The structured query definition as a JSON string\"),\n naturalLanguage: z\n .string()\n .describe(\"Human-readable description of the query conditions\"),\n jsonLogic: z\n .string()\n .describe(\"JSON Logic representation of the query as a JSON string\"),\n sqlQuery: z\n .string()\n .describe(\"SQL representation of the query for database operations\"),\n })\n .describe(\"Schema defining query output structure with all fields as strings\");\n\n// Conditional if clause schema\nexport const conditionalIfSchema = z\n .object({\n id: z\n .string()\n .describe(\"Unique identifier for this condition\"),\n event: z\n .string()\n .describe(\"The event that triggers evaluation of this condition (e.g., 'pageLoad', 'pageView', 'scroll', 'custom')\"),\n queryOutput: queryOutputSchema.describe(\"The query conditions to evaluate when the event occurs\"),\n metadata: conditionalIfMetadataSchema\n .optional()\n .describe(\"Optional metadata containing custom event fields and their configurations\"),\n })\n .describe(\"Schema defining the 'if' condition for auto-trigger logic\");\n\n// Trigger action schema for the 'then' clause\nexport const triggerActionSchema = z\n .object({\n triggerType: z\n .string()\n .describe(\"The type of action to perform (e.g., 'delay', 'scroll', 'immediately')\"),\n delay: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Delay in seconds before performing the action\"),\n scroll: z\n .union([z.string(), z.number()])\n .optional()\n .describe(\"Scroll position (percentage as string like '75%' or pixel value as number)\"),\n })\n .describe(\"Schema defining the action to perform when conditions are met\");\n\n// Conditional when clause schema (if-then structure)\nexport const conditionalWhenSchema = z\n .object({\n if: conditionalIfSchema.describe(\"The condition that must be met\"),\n then: triggerActionSchema.describe(\"The action to perform when the condition is met\"),\n })\n .describe(\"Schema defining a conditional when clause with if-then logic\");\n\n// Filter condition schema for category-specific filters\nexport const filterConditionSchema = z\n .object({\n id: z\n .string()\n .describe(\"Unique identifier for this filter condition\"),\n category: z\n .string()\n .describe(\"The category this filter belongs to (e.g., 'device', 'user', 'geo_location')\"),\n property: z\n .string()\n .describe(\"The property to filter on (e.g., 'device_type', 'age', 'country')\"),\n operator: z\n .string()\n .describe(\"The comparison operator (e.g., 'equals', 'greaterThan', 'lessThan')\"),\n values: z\n .array(z.string())\n .min(1)\n .describe(\"Array of values to compare against\"),\n tbl_key: z\n .string()\n .describe(\"The database table key for this property\"),\n })\n .describe(\"Schema defining a single filter condition within a category\");\n\n// Category-specific filters schema\nexport const categorySpecificFiltersSchema = z\n .object({\n device: z\n .array(filterConditionSchema)\n .optional()\n .describe(\"Array of device-specific filter conditions\"),\n user: z\n .array(filterConditionSchema)\n .optional()\n .describe(\"Array of user-specific filter conditions\"),\n geo_location: z\n .array(filterConditionSchema)\n .optional()\n .describe(\"Array of geo-location specific filter conditions\"),\n })\n .describe(\"Schema defining category-specific filters for audience targeting\");\n\n// Who schema for audience targeting\nexport const whoSchema = z\n .object({\n applications: z\n .array(z.string())\n .min(1)\n .describe(\"Array of application names this targeting applies to\"),\n userType: z\n .string()\n .describe(\"The type of user this targeting applies to (e.g., 'both', 'new', 'returning')\"),\n categorySpecificFilters: categorySpecificFiltersSchema\n .optional()\n .describe(\"Optional category-specific filters for more granular targeting\"),\n })\n .describe(\"Schema defining who the audience targeting applies to\");\n\n// Enhanced audience segment schema with conditional when logic\nexport const audienceSegmentSchema = z\n .object({\n id: z\n .string()\n .describe(\"Unique identifier for the audience segment\"),\n name: z\n .string()\n .min(1)\n .max(200)\n .describe(\"Display name for the audience segment\"),\n isImportant: z\n .boolean()\n .describe(\"Whether this segment is marked as important for targeting\"),\n when: z\n .array(conditionalWhenSchema)\n .min(1)\n .describe(\"Array of conditional when clauses with if-then logic\"),\n who: whoSchema\n .describe(\"User criteria and conditions defining who belongs to this segment\"),\n })\n .describe(\"Schema defining an audience segment for targeting with conditional logic\");\n\n// Audience trigger properties schema\nexport const audienceTriggerPropertiesSchema = z\n .object({\n isAuto: z\n .boolean()\n .describe(\"Whether automatic triggering is enabled for this audience\"),\n isManual: z\n .boolean()\n .describe(\"Whether manual triggering is enabled for this audience\"),\n segments: z\n .array(audienceSegmentSchema)\n .min(0)\n .describe(\"Array of audience segments for targeting conditions\"),\n })\n .refine(\n (data) => {\n // Ensure at least one of isAuto or isManual is true\n return data.isAuto || data.isManual;\n },\n {\n message: \"At least one of isAuto or isManual must be true\",\n path: [\"isAuto\"],\n }\n )\n .describe(\"Schema defining audience trigger properties for form targeting\");\n\n// Type inference from schemas\nexport type CustomEventFieldOperator = z.infer<typeof customEventFieldOperatorSchema>;\nexport type CustomEventField = z.infer<typeof customEventFieldSchema>;\nexport type ConditionalIfMetadata = z.infer<typeof conditionalIfMetadataSchema>;\nexport type QueryOutput = z.infer<typeof queryOutputSchema>;\nexport type ConditionalIf = z.infer<typeof conditionalIfSchema>;\nexport type TriggerAction = z.infer<typeof triggerActionSchema>;\nexport type ConditionalWhen = z.infer<typeof conditionalWhenSchema>;\nexport type FilterCondition = z.infer<typeof filterConditionSchema>;\nexport type CategorySpecificFilters = z.infer<typeof categorySpecificFiltersSchema>;\nexport type Who = z.infer<typeof whoSchema>;\nexport type AudienceSegment = z.infer<typeof audienceSegmentSchema>;\nexport type AudienceTriggerProperties = z.infer<typeof audienceTriggerPropertiesSchema>;\n", "import { z } from \"zod\";\n\n// \u2500\u2500\u2500 Focal Point \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const focalPointSchema = z\n .object({\n x: z\n .number()\n .min(-1)\n .max(1)\n .describe(\"Horizontal focal point from -1 (far left) to 1 (far right)\"),\n y: z\n .number()\n .min(-1)\n .max(1)\n .describe(\"Vertical focal point from -1 (top) to 1 (bottom)\"),\n })\n .describe(\"Focal point for image cropping and positioning within its container\");\n\n// \u2500\u2500\u2500 Attachment Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const imageAttachmentSchema = z\n .object({\n type: z.literal(\"image\"),\n href: z.string().url().describe(\"URL of the image asset\"),\n properties: z\n .object({\n description: z\n .string()\n .optional()\n .describe(\"Accessible description of the image (used as alt text when decorative is false)\"),\n decorative: z\n .boolean()\n .default(false)\n .describe(\n \"When true the image is purely visual; screen readers skip it and description is not surfaced as alt text\"\n ),\n brightness: z\n .number()\n .min(-100)\n .max(100)\n .optional()\n .describe(\"Brightness adjustment rendered with a black/white overlay: -100 fully black, 0 unchanged, +100 fully white.\"),\n focalPoint: focalPointSchema.optional(),\n })\n .optional()\n .describe(\"Optional display properties for the image\"),\n })\n .describe(\"Image attachment for section layouts\");\n\nexport const videoAttachmentSchema = z\n .object({\n type: z.literal(\"video\"),\n href: z\n .string()\n .url()\n .describe(\n \"URL of the video \u2014 YouTube, Vimeo, Pexels, or self-hosted CDN\"\n ),\n scale: z\n .enum([\"0.4\", \"0.6\", \"0.8\", \"1\"])\n .default(\"0.6\")\n .optional()\n .describe(\"Responsive scale for the video within its container\"),\n properties: z\n .object({\n description: z\n .string()\n .optional()\n .describe(\"Accessible description of the video\"),\n decorative: z\n .boolean()\n .default(false)\n .describe(\"When true the video is purely decorative and screen readers skip it\"),\n brightness: z\n .number()\n .min(-100)\n .max(100)\n .optional()\n .describe(\"Brightness adjustment rendered with a black/white overlay: -100 fully black, 0 unchanged, +100 fully white.\"),\n })\n .optional()\n .describe(\"Optional display properties for the video\"),\n })\n .describe(\"Video attachment for section layouts (external embed or self-hosted CDN)\");\n\nexport const colorAttachmentSchema = z\n .object({\n type: z.literal(\"color\"),\n value: z\n .string()\n .regex(\n /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/,\n \"Must be a valid hex color: #RGB, #RRGGBB, or #RRGGBBAA\"\n )\n .describe(\"Hex color value e.g. #FF5733 (opaque) or #FF5733CC (with alpha)\"),\n })\n .describe(\"Solid color background attachment for section layouts\");\n\nexport const gradientAttachmentSchema = z\n .object({\n type: z.literal(\"gradient\"),\n value: z\n .string()\n .min(1)\n .describe(\n \"CSS gradient string e.g. linear-gradient(135deg, #FF5733, #3498db) or radial-gradient(circle, #FF5733, #3498db)\"\n ),\n })\n .describe(\"CSS gradient background attachment for section layouts\");\n\n// Discriminated union over all attachment variants\nexport const layoutAttachmentSchema = z\n .discriminatedUnion(\"type\", [\n imageAttachmentSchema,\n videoAttachmentSchema,\n colorAttachmentSchema,\n gradientAttachmentSchema,\n ])\n .describe(\n \"Attachment used in a section layout \u2014 image, video, solid color, or gradient\"\n );\n\nexport const LayoutAttachmentTypes = {\n IMAGE: \"image\" as const,\n VIDEO: \"video\" as const,\n COLOR: \"color\" as const,\n GRADIENT: \"gradient\" as const,\n} as const;\n\n// \u2500\u2500\u2500 Layout Variants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * stack \u2014 attachment fills the background behind the question content (full bleed).\n * This is the default Typeform-like \"hero behind question\" treatment.\n */\nexport const stackLayoutSchema = z\n .object({\n type: z.literal(\"stack\"),\n align: z\n .enum([\"left\", \"center\", \"cover\"])\n .default(\"center\")\n .optional()\n .describe(\n \"How the media strip is displayed: 'center' (default, natural size centred at form width), 'left' (natural size left-aligned), 'cover' (full-bleed, fills strip edge-to-edge)\"\n ),\n attachment: layoutAttachmentSchema\n .optional()\n .describe(\"Background media rendered behind the question content\"),\n })\n .describe(\n \"Stack layout: attachment renders as a full-bleed background behind the question\"\n );\n\n/**\n * float \u2014 attachment floats beside the question without splitting the viewport.\n * The question content reflows around the media.\n */\nexport const floatLayoutSchema = z\n .object({\n type: z.literal(\"float\"),\n placement: z\n .enum([\"left\", \"right\"])\n .describe(\"Side the media floats on\"),\n attachment: layoutAttachmentSchema\n .optional()\n .describe(\"Media that floats beside the question content\"),\n })\n .describe(\n \"Float layout: attachment floats to the left or right of the question content\"\n );\n\n/**\n * split \u2014 viewport is divided 50/50 between attachment and question content.\n */\nexport const splitLayoutSchema = z\n .object({\n type: z.literal(\"split\"),\n placement: z\n .enum([\"left\", \"right\"])\n .describe(\"Side the media occupies in the split\"),\n attachment: layoutAttachmentSchema\n .optional()\n .describe(\"Media that occupies its half of the split viewport\"),\n })\n .describe(\n \"Split layout: viewport is divided equally between media and question content\"\n );\n\n/**\n * wallpaper \u2014 attachment tiles or stretches across the entire viewport as a\n * full-page background, behind both the question and any chrome.\n */\nexport const wallpaperLayoutSchema = z\n .object({\n type: z.literal(\"wallpaper\"),\n attachment: layoutAttachmentSchema\n .optional()\n .describe(\"Full-page background media\"),\n })\n .describe(\n \"Wallpaper layout: attachment stretches or tiles across the entire viewport\"\n );\n\n// Discriminated union over all layout variants\nexport const sectionLayoutVariantSchema = z\n .discriminatedUnion(\"type\", [\n stackLayoutSchema,\n floatLayoutSchema,\n splitLayoutSchema,\n wallpaperLayoutSchema,\n ])\n .describe(\n \"Layout variant controlling how attachment is rendered relative to the question\"\n );\n\nexport const LayoutTypes = {\n STACK: \"stack\" as const,\n FLOAT: \"float\" as const,\n SPLIT: \"split\" as const,\n WALLPAPER: \"wallpaper\" as const,\n} as const;\n\n// \u2500\u2500\u2500 Surface \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * A LayoutSurface is the full layout config for a single rendering surface\n * (e.g. in-app, link/mobile, link/others).\n *\n * - attachment: optional top-level media shown inline alongside the question\n * (distinct from the layout's inner attachment which controls positioning)\n * - layout: required variant that controls how the inner attachment is placed\n */\nexport const layoutSurfaceSchema = z\n .object({\n attachment: layoutAttachmentSchema\n .optional()\n .describe(\n \"Top-level media displayed inline with the question (separate from the layout's own attachment)\"\n ),\n layout: sectionLayoutVariantSchema.describe(\n \"How the attachment is positioned relative to the question content\"\n ),\n })\n .describe(\"Layout configuration for a single rendering surface\");\n\n// \u2500\u2500\u2500 Section Layout \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Per-section layout config scoped to two channels:\n * - inApp: native app or in-app webview\n * - link: shareable/link-based form, split into mobile (phones) and others (tablet + desktop)\n *\n * All fields are optional. When absent for a surface, the engine renders with no custom layout.\n *\n * Merge precedence (per surface):\n * sectionLayouts[id] > sectionLayoutDefaults > engine default (no layout)\n */\nexport const sectionLayoutSchema = z\n .object({\n inApp: layoutSurfaceSchema\n .optional()\n .describe(\"Layout for in-app (native/webview) surfaces\"),\n link: z\n .object({\n mobile: layoutSurfaceSchema\n .optional()\n .describe(\"Layout for link-based forms on mobile viewports (phones)\"),\n others: layoutSurfaceSchema\n .optional()\n .describe(\n \"Layout for link-based forms on tablet and desktop viewports\"\n ),\n })\n .optional()\n .describe(\n \"Layout overrides for link/shareable surfaces, split by mobile and others (tablet + desktop)\"\n ),\n })\n .describe(\n \"Per-section layout configuration scoped to in-app and link surfaces\"\n );\n\n// \u2500\u2500\u2500 Type exports \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type FocalPoint = z.infer<typeof focalPointSchema>;\nexport type ImageAttachment = z.infer<typeof imageAttachmentSchema>;\nexport type VideoAttachment = z.infer<typeof videoAttachmentSchema>;\nexport type ColorAttachment = z.infer<typeof colorAttachmentSchema>;\nexport type GradientAttachment = z.infer<typeof gradientAttachmentSchema>;\nexport type LayoutAttachment = z.infer<typeof layoutAttachmentSchema>;\nexport type StackLayout = z.infer<typeof stackLayoutSchema>;\nexport type FloatLayout = z.infer<typeof floatLayoutSchema>;\nexport type SplitLayout = z.infer<typeof splitLayoutSchema>;\nexport type WallpaperLayout = z.infer<typeof wallpaperLayoutSchema>;\nexport type SectionLayoutVariant = z.infer<typeof sectionLayoutVariantSchema>;\nexport type LayoutSurface = z.infer<typeof layoutSurfaceSchema>;\nexport type SectionLayout = z.infer<typeof sectionLayoutSchema>;\n", "import { z } from \"zod\";\n\n// Master properties schema\nexport const masterPropertiesSchema = z\n .object({\n mandatoryFetchConfigAtPaths: z\n .array(z.string())\n .describe(\"Array of paths where configuration must be fetched from server when navigated by user\"),\n configSyncIntervalSeconds: z\n .number()\n .int()\n .positive()\n .describe(\"Interval in seconds for configuration synchronization between client and server\"),\n disableAllSurvey: z\n .boolean()\n .describe(\"Flag to disable all surveys globally\"),\n feedbackIntervalDuration: z\n .number()\n .int()\n .positive()\n .describe(\"Duration in seconds for feedback interval between two auto triggered feedbacks\"),\n })\n .describe(\"Master properties configuration for global survey settings\");\n\n// Type inference from schema\nexport type MasterProperties = z.infer<typeof masterPropertiesSchema>;\n", "import { z } from \"zod\";\n\n// Theme mode enum for device themes\nexport const deviceThemeSchema = z\n .enum([\"light\", \"dark\", \"system\"])\n .describe(\"Enumeration of supported theme modes\");\n\n// Constants for device themes (explicit literal values for proper type inference)\nexport const DeviceThemes = {\n LIGHT: \"light\" as const,\n DARK: \"dark\" as const,\n SYSTEM: \"system\" as const,\n} as const;\n\n// Device info schema\nexport const deviceInfoSchema = z\n .object({\n $deviceType: z.string().describe(\"Type of device being used\"),\n $timezone: z.string().describe(\"Device timezone (e.g., 'Asia/Calcutta')\"),\n $theme: deviceThemeSchema.describe(\"Current theme mode preference\"),\n $os: z.string().describe(\"Operating system running on the device\"),\n $osVersion: z.string().describe(\"Version of the operating system\"),\n $appVersion: z.string().describe(\"Version of the application\"),\n $app: z.string().describe(\"Browser or application being used\"),\n $language: z.string().describe(\"Language preference (e.g., 'en-GB')\"),\n $deviceId: z.string().describe(\"Unique device identifier\"),\n })\n .describe(\"Device information collected from the client\");\n\n// Session info schema\nexport const sessionInfoSchema = z\n .object({\n $sessionId: z.string().uuid().describe(\"Unique session identifier\"),\n $timestamp: z.string().optional().describe(\"ISO timestamp of the session\"),\n })\n .describe(\"Session information for tracking user sessions\");\n\n// Combined device and session info schema\nexport const deviceSessionInfoSchema = z\n .object({\n deviceInfo: deviceInfoSchema.describe(\"Device information\"),\n sessionInfo: sessionInfoSchema.describe(\"Session information\"),\n })\n .describe(\"Combined device and session information\");\n\n// User properties schema for counter and other dynamic properties\nexport const userPropertiesSchema = z\n .object({\n $counter: z\n .record(z.string(), z.number().int())\n .describe(\n \"Counter properties for user tracking (can be positive or negative)\"\n )\n .optional(),\n $set: z\n .record(z.string(), z.any())\n .describe(\"Properties to set for the user\")\n .optional(),\n $setOnce: z\n .record(z.string(), z.any())\n .describe(\n \"Properties to set once for the user (won't overwrite existing values)\"\n )\n .optional(),\n $unset: z\n .array(z.string())\n .describe(\"Array of property names to unset/remove from the user\")\n .optional(),\n })\n .loose() // Allow additional user properties\n .describe(\n \"User properties including counters, set operations, and other dynamic data\"\n );\n\n// User info schema\nexport const userInfoSchema = z\n .object({\n userName: z.string().email().describe(\"User's email address as username\"),\n properties: userPropertiesSchema.describe(\"User properties and counters\"),\n })\n .describe(\"User information including identification and properties\");\n\n// Type exports\nexport type DeviceTheme = z.infer<typeof deviceThemeSchema>;\nexport type DeviceInfo = z.infer<typeof deviceInfoSchema>;\nexport type SessionInfo = z.infer<typeof sessionInfoSchema>;\nexport type DeviceSessionInfo = z.infer<typeof deviceSessionInfoSchema>;\nexport type UserProperties = z.infer<typeof userPropertiesSchema>;\nexport type UserInfo = z.infer<typeof userInfoSchema>;\n", "import { z } from \"zod\";\nimport {\n deviceInfoSchema,\n sessionInfoSchema,\n userInfoSchema,\n} from \"./other-schema\";\nimport { AnswerSchema } from \"../fields/answer-schema\";\n\n// Form configuration schema\nexport const formConfigSchema = z\n .object({\n feedbackIdentifier: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the feedback instance\"),\n feedbackConfigurationId: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the feedback configuration\"),\n completionTimeInSeconds: z\n .number()\n .int()\n .min(0)\n .describe(\"Time taken to complete the feedback in seconds\"),\n isPartialSubmit: z\n .boolean()\n .describe(\"Whether this is a partial submission (true) or full submission (false)\"),\n responseLanguageCode: z\n .string()\n .length(2)\n .describe(\"Language code for the response (e.g., 'en', 'es')\"),\n })\n .describe(\"Configuration information for the feedback form\");\n\n// Question response schema\nexport const questionResponseSchema = z\n .object({\n questionId: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the question\"),\n answer: AnswerSchema.describe(\"The answer provided for this question\"),\n type: z\n .string()\n .describe(\"Type of the question (e.g., 'rating', 'single_choice')\"),\n error: z.string().optional().describe(\"Error message if any validation failed\"),\n isOnPath: z\n .boolean()\n .optional()\n .describe(\n \"When present, whether this question was on the respondent's navigation path (e.g. logic jumps); false for questions not reached\"\n ),\n timeSpentMs: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Milliseconds the respondent spent on this question (even split across all visible questions in the section)\"\n ),\n isPathTraversed: z\n .boolean()\n .optional()\n .describe(\n \"Whether this question was on the logical traversal path \u2014 true for visible questions and hidden questions whose rules were evaluated, false for questions never reached\"\n ),\n })\n .describe(\"Response to a specific question in the feedback form\");\n\n// Response schema (contains question responses)\nexport const responseSchema = z\n .object({\n questions: z\n .array(questionResponseSchema)\n .min(1)\n .describe(\"Array of question responses\"),\n })\n .describe(\"User responses to feedback questions\");\n\n// Matched trigger properties schema (flexible object since definition is unknown)\nexport const matchedTriggerPropertiesSchema = z\n .object({\n customEventName: z\n .string()\n .nullable()\n .describe(\"Custom event name that triggered the feedback\"),\n currentPath: z\n .string()\n .describe(\"Current page path where feedback was triggered\"),\n eventType: z.string().describe(\"Type of event that triggered the feedback\"),\n })\n .passthrough()\n .describe(\"Properties of the trigger that matched for this feedback\");\n\n// Base submit feedback schema (without conditional response)\nexport const baseSubmitFeedbackSchema = z\n .object({\n formConfig: formConfigSchema.describe(\"Form configuration information\"),\n deviceInfo: deviceInfoSchema.describe(\"Device information\"),\n sessionInfo: sessionInfoSchema.optional().describe(\"Session information\"),\n userInfo: userInfoSchema.optional().describe(\"User information (optional)\"),\n matchedTriggerProperties: matchedTriggerPropertiesSchema.optional().describe(\n \"Properties of the matched trigger\"\n ),\n customProperties: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\"Custom properties for advanced use cases\"),\n })\n .describe(\"Base submit feedback request schema\");\n\n// Partial feedback schema (isPartialSubmit: true, response optional)\nexport const partialFeedbackSchema = baseSubmitFeedbackSchema\n .extend({\n formConfig: formConfigSchema.extend({\n isPartialSubmit: z\n .literal(true)\n .describe(\"Indicates this is a partial submission\"),\n }),\n response: responseSchema.optional().describe(\"User responses (optional for partial submit)\"),\n })\n .describe(\"Partial feedback request schema (response optional)\");\n\n// Full submit feedback schema (isPartialSubmit: false, response required)\nexport const submitFeedbackSchema = baseSubmitFeedbackSchema\n .extend({\n formConfig: formConfigSchema.extend({\n isPartialSubmit: z\n .literal(false)\n .describe(\"Indicates this is a full submission\"),\n }),\n response: responseSchema.describe(\"User responses (required for full submit)\"),\n })\n .describe(\"Full submit feedback request schema (response required)\");\n\n// Union schema for both cases (using regular union instead of discriminated union)\nexport const feedbackRequestSchema = z\n .union([partialFeedbackSchema, submitFeedbackSchema])\n .describe(\"Union schema for both partial and full feedback submissions\");\n\n// Type exports\nexport type FormConfig = z.infer<typeof formConfigSchema>;\nexport type QuestionResponse = z.infer<typeof questionResponseSchema>;\nexport type Response = z.infer<typeof responseSchema>;\nexport type MatchedTriggerProperties = z.infer<\n typeof matchedTriggerPropertiesSchema\n>;\nexport type BaseSubmitFeedback = z.infer<typeof baseSubmitFeedbackSchema>;\nexport type PartialFeedback = z.infer<typeof partialFeedbackSchema>;\nexport type SubmitFeedback = z.infer<typeof submitFeedbackSchema>;\nexport type FeedbackRequest = z.infer<typeof feedbackRequestSchema>;\n", "import { z } from \"zod\";\nimport {\n deviceInfoSchema,\n sessionInfoSchema,\n userInfoSchema,\n} from \"./other-schema\";\nimport { combinedQuestionSchema, sectionSchema } from \"../fields/field-schema\";\nimport { LanguagesSchema } from \"../fields/other-screen-schema\";\nimport {\n otherConfigurationPropertiesSchema,\n appearancePropertiesSchema,\n} from \"../fields/form-properties-schema\";\nimport { masterPropertiesSchema } from \"../fields/other-properties-schema\";\nimport { audienceTriggerPropertiesSchema } from \"../fields/auto-trigger-schema\";\n\n// Individual feedback configuration item schema\nexport const feedbackConfigurationItemSchema = z\n .object({\n feedbackConfigurationId: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the feedback configuration\"),\n feedbackTitle: z.string().describe(\"Title of the feedback configuration\"),\n // duration: durationSchema\n // .describe(\"Active duration for this feedback configuration\"),\n triggerProperties: audienceTriggerPropertiesSchema.describe(\n \"Trigger properties including auto/manual settings and audience segments\"\n ),\n appearanceProperties: z\n .object({\n themes: z\n .object({\n light: z\n .object({\n theme: z\n .string()\n .optional()\n .describe(\"Theme for light mode (shadcn variables JSON)\"),\n })\n .describe(\"Light theme\"),\n dark: z\n .object({\n theme: z\n .string()\n .optional()\n .describe(\"Theme for dark mode (shadcn variables JSON)\"),\n })\n .describe(\"Dark theme\"),\n })\n .nullable()\n .optional()\n .describe(\"Theme configuration (optional)\"),\n featureSettings: z\n .object({\n darkOverlay: z.boolean().describe(\"Whether to show dark overlay\"),\n closeButton: z.boolean().describe(\"Whether to show close button\"),\n progressBar: z.boolean().describe(\"Whether to show progress bar\"),\n showBranding: z.boolean().describe(\"Whether to show branding\"),\n customPosition: z\n .boolean()\n .describe(\"Whether custom position is enabled\"),\n customIconPosition: z\n .boolean()\n .describe(\"Whether custom icon position is enabled\"),\n customCss: z\n .string()\n .nullable()\n .optional()\n .describe(\"Custom CSS link (optional)\"),\n enableShareableKeyboardNavigation: z\n .boolean()\n .default(false)\n .describe(\n \"Whether keyboard navigation is enabled for the shareable widget experience\"\n ),\n rtl: z\n .boolean()\n .describe(\"Whether right-to-left text direction is enabled\"),\n previousButton: z\n .enum([\"never\", \"always\"])\n .describe(\"Previous button: never (hidden) or always (shown)\"),\n maxDialogHeightPercentInApp: z\n .number()\n .int()\n .min(10)\n .max(100)\n .optional()\n .describe(\"Maximum height of the in-app dialog as a percentage of the viewport height (10\u2013100)\"),\n })\n .describe(\"Feature settings for the feedback form\"),\n selectedIconPosition: z\n .string()\n .describe(\"Selected position for the feedback icon\"),\n selectedPosition: z\n .string()\n .describe(\"Selected position for the feedback form\"),\n })\n .describe(\"Appearance properties for the feedback form\"),\n })\n .describe(\"Individual feedback configuration item in the list\");\n\n// Form configuration schema for fetch operations\nexport const fetchFormConfigSchema = z\n .object({\n feedbackConfigurationId: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the feedback configuration\"),\n responseLanguageCode: z\n .string()\n .length(2)\n .describe(\"Language code for the response (e.g., 'en', 'es')\"),\n })\n .describe(\"Form configuration for fetching feedback details\");\n\n// Fetch configuration list request schema\nexport const fetchConfigurationListSchema = z\n .object({\n deviceInfo: deviceInfoSchema.describe(\"Device information\"),\n sessionInfo: sessionInfoSchema.describe(\"Session information\"),\n userInfo: userInfoSchema.optional().describe(\"User information (optional)\"),\n force: z\n .boolean()\n .optional()\n .describe(\"Forcefully fetch eligible feedback list (optional)\"),\n })\n .strict()\n .describe(\"Request schema for fetching available feedback configurations\");\n\n// Fetch feedback details request schema\nexport const fetchFeedbackDetailsSchema = z\n .object({\n formConfig: fetchFormConfigSchema.describe(\n \"Form configuration for the specific feedback\"\n ),\n deviceInfo: deviceInfoSchema.describe(\"Device information\"),\n sessionInfo: sessionInfoSchema.describe(\"Session information\"),\n userInfo: userInfoSchema.optional().describe(\"User information (optional)\"),\n })\n .strict()\n .describe(\"Request schema for fetching specific feedback form details\");\n\n// Form configuration response schema (title/description + optional server-enriched fields)\nexport const formConfigurationResponseSchema = z\n .object({\n formTitle: z.string().describe(\"Title of the feedback form\"),\n formDescription: z.string().describe(\"Description of the feedback form\"),\n respondentsCount: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Total number of respondents enriched by the server at fetch time; used alongside respondentsShowMinThreshold to decide whether to display the welcome badge\"\n ),\n })\n .describe(\"Form configuration response with title, description, and optional respondent count\");\n\n// Logic jump rule schema \u2014 a single conditional branch with a JSON Logic expression and target question\nexport const logicJumpRuleSchema = z\n .object({\n jsonLogic: z\n .record(z.string(), z.unknown())\n .describe(\"JSON Logic expression to evaluate\"),\n targetQuestionId: z\n .string()\n .describe(\"Question ID to navigate to when this rule matches\"),\n })\n .describe(\"A single logic jump rule mapping a condition to a target question\");\n\n// Logic jump rules schema \u2014 keyed by questionId or the special key '__workflow_start__'\nexport const logicJumpRulesSchema = z\n .record(\n z.string(),\n z.array(logicJumpRuleSchema)\n )\n .describe(\n \"Logic jump rules keyed by question ID (or '__workflow_start__'). Each entry is an ordered array of rules evaluated top-down; the first matching rule wins.\"\n );\n\n// Questionnaire fields response schema (matches actual API response structure)\nexport const questionnaireFieldsResponseSchema = z\n .object({\n questions: z\n .record(z.string(), combinedQuestionSchema)\n .describe(\"Collection of questions keyed by their string identifiers\"),\n sections: z\n .array(sectionSchema)\n .describe(\n \"Array of sections that organize questions into logical groups\"\n ),\n translations: z\n .record(z.string(), z.any())\n .describe(\n \"Translations object (can be empty or contain language-specific translations)\"\n ),\n selectedLanguages: LanguagesSchema.describe(\n \"Array of languages selected for this questionnaire\"\n ),\n isLogicJumpsEnabled: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"When true, form navigation follows logicJumpRules instead of linear section order\"),\n logicJumpRules: logicJumpRulesSchema\n .optional()\n .describe(\"Conditional navigation rules evaluated per question to determine the next question to show\"),\n contextVariables: z\n .array(z.string())\n .optional()\n .describe(\"List of context variable keys expected by the form (informational)\"),\n })\n .describe(\n \"Questionnaire fields response including questions, sections, translations, selected languages, and optional logic jump configuration\"\n );\n\n// Fetch feedback details response schema using existing schemas\nexport const fetchFeedbackDetailsResponseSchema = z\n .object({\n feedbackConfigurationId: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the feedback configuration\"),\n feedbackIdentifier: z\n .string()\n .uuid()\n .describe(\"Unique identifier for this specific feedback instance\"),\n formConfiguration: formConfigurationResponseSchema.describe(\n \"Form configuration including title, description, and optional respondent count for the welcome badge\"\n ),\n questionnaireFields: questionnaireFieldsResponseSchema.describe(\n \"Questionnaire structure including questions, sections, translations, and languages\"\n ),\n otherConfigurationProperties: otherConfigurationPropertiesSchema.describe(\n \"Other configuration properties using existing schema\"\n ),\n appearanceProperties: appearancePropertiesSchema.describe(\n \"Appearance properties including theme configuration\"\n ),\n })\n .strict()\n .describe(\n \"Complete response schema for fetchFeedbackDetails API using existing field schemas\"\n );\n\n// Fetch configuration list response schema\nexport const fetchConfigurationListResponseSchema = z\n .object({\n masterProperties: masterPropertiesSchema.describe(\n \"Master properties for global survey settings\"\n ),\n feedbackConfiguration: z\n .array(feedbackConfigurationItemSchema)\n .describe(\"Array of available feedback configurations\"),\n })\n .strict()\n .describe(\"Response schema for fetchConfigurationList API\");\n\n// Type exports\nexport type FeedbackConfigurationItem = z.infer<\n typeof feedbackConfigurationItemSchema\n>;\nexport type FetchFormConfig = z.infer<typeof fetchFormConfigSchema>;\nexport type FetchConfigurationListRequest = z.infer<\n typeof fetchConfigurationListSchema\n>;\nexport type FetchFeedbackDetailsRequest = z.infer<\n typeof fetchFeedbackDetailsSchema\n>;\nexport type FormConfigurationResponse = z.infer<\n typeof formConfigurationResponseSchema\n>;\nexport type QuestionnaireFieldsResponse = z.infer<\n typeof questionnaireFieldsResponseSchema\n>;\nexport type FetchFeedbackDetailsResponse = z.infer<\n typeof fetchFeedbackDetailsResponseSchema\n>;\nexport type FetchConfigurationListResponse = z.infer<\n typeof fetchConfigurationListResponseSchema\n>;\nexport type LogicJumpRule = z.infer<typeof logicJumpRuleSchema>;\nexport type LogicJumpRules = z.infer<typeof logicJumpRulesSchema>;\n", "import { z } from \"zod\";\n\n// Refine text request schema\nexport const refineTextParamsSchema = z\n .object({\n questionId: z\n .string()\n .describe(\"Unique identifier for the question\"),\n feedbackConfigurationId: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the feedback configuration\"),\n userText: z\n .string()\n .describe(\"Original text input from the user\"),\n })\n .strict()\n .describe(\"Request schema for refining user text input\");\n\n// Refine text response schema (flat format)\n// Success: { message: \"ok\", refinedText: \"...\" }\n// Error: { status?: number, error?: string, message: \"...\" }\nexport const refineTextResponseSchema = z\n .object({\n message: z.string().optional().describe(\"Human-readable message\"),\n refinedText: z\n .string()\n .optional()\n .describe(\"Refined/improved version of the user text (success only)\"),\n status: z\n .number()\n .optional()\n .describe(\"HTTP status code (error responses)\"),\n error: z.string().optional().describe(\"Error type (error responses)\"),\n code: z.string().optional().describe(\"Error code for display mapping\"),\n })\n .describe(\"Response schema for refine text API operation\");\n\n// Legacy data schema - kept for backwards compatibility if needed\nexport const refineTextDataSchema = z\n .object({\n userText: z.string().describe(\"Original text input from the user\"),\n refinedText: z.string().describe(\"Refined/improved version of the user text\"),\n })\n .describe(\"Data containing original and refined text (legacy nested format)\");\n\n// Type exports\nexport type RefineTextParams = z.infer<typeof refineTextParamsSchema>;\nexport type RefineTextData = z.infer<typeof refineTextDataSchema>;\nexport type RefineTextResponse = z.infer<typeof refineTextResponseSchema>;", "export function convertObject<\n TInput extends object,\n TResult extends\n | ObjectToCamel<TInput>\n | ObjectToSnake<TInput>\n | ObjectToPascal<TInput>,\n>(obj: TInput, keyConverter: (arg: string) => string): TResult {\n if (obj === null || typeof obj === 'undefined' || typeof obj !== 'object') {\n return obj;\n }\n\n const out = (Array.isArray(obj) ? [] : {}) as TResult;\n for (const [k, v] of Object.entries(obj)) {\n let newKey = k;\n if (typeof k === 'string' && !k.includes('-')) {\n newKey = keyConverter(k);\n }\n\n // eslint-disable-next-line\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n out[newKey] = Array.isArray(v)\n ? (v.map(<ArrayItem extends object>(item: ArrayItem) =>\n typeof item === 'object' &&\n !(item instanceof Uint8Array) &&\n !(item instanceof Date)\n ? convertObject<\n ArrayItem,\n TResult extends ObjectToCamel<TInput>\n ? ObjectToCamel<ArrayItem>\n : TResult extends ObjectToPascal<TInput>\n ? ObjectToPascal<ArrayItem>\n : ObjectToSnake<ArrayItem>\n >(item, keyConverter)\n : item,\n ) as unknown[])\n : v instanceof Uint8Array || v instanceof Date\n ? v\n : typeof v === 'object'\n ? convertObject<\n typeof v,\n TResult extends ObjectToCamel<TInput>\n ? ObjectToCamel<typeof v>\n : TResult extends ObjectToPascal<TInput>\n ? ObjectToPascal<typeof v>\n : ObjectToSnake<typeof v>\n >(v, keyConverter)\n : (v as unknown);\n }\n return out;\n}\n\nexport function toCamel<T extends string>(term: T): ToCamel<T> {\n return (\n term.length === 1\n ? term.toLowerCase()\n : term\n .replace(/^([A-Z])/, (m) => m[0].toLowerCase())\n .replace(/[_-]([a-z0-9])/g, (m) => m[1].toUpperCase())\n ) as ToCamel<T>;\n}\n\nexport function objectToCamel<T extends object>(obj: T): ObjectToCamel<T> {\n return convertObject(obj, toCamel);\n}\n\nexport function toSnake<T extends string>(term: T): ToSnake<T> {\n let result: string = term;\n let circuitBreaker = 0;\n\n while (\n (/([a-z])([0-9])/.exec(result)?.length || 0) > 2 &&\n circuitBreaker < 10\n ) {\n result = result.replace(\n /([a-z])([0-9])/,\n (_all, $1: string, $2: string) =>\n `${$1.toLowerCase()}_${$2.toLowerCase()}`,\n );\n\n circuitBreaker += 1;\n }\n\n while (\n (/(.+?)([A-Z])/.exec(result)?.length || 0) > 2 &&\n circuitBreaker < 10\n ) {\n result = result.replace(\n /(.+?)([A-Z])/,\n (_all, $1: string, $2: string) =>\n `${$1.toLowerCase()}_${$2.toLowerCase()}`,\n );\n circuitBreaker += 1;\n }\n\n return result.toLowerCase() as ToSnake<T>;\n}\n\nexport function objectToSnake<T extends object>(obj: T): ObjectToSnake<T> {\n return convertObject(obj, toSnake);\n}\n\nexport function toPascal<T extends string>(term: T): ToPascal<T> {\n return toCamel(term).replace(/^([a-z])/, (m) =>\n m[0].toUpperCase(),\n ) as ToPascal<T>;\n}\n\nexport function objectToPascal<T extends object>(obj: T): ObjectToPascal<T> {\n return convertObject(obj, toPascal);\n}\n\nexport type ToCamel<S extends string | number | symbol> = S extends string\n ? S extends `${infer Head}_${infer Tail}`\n ? `${ToCamel<Uncapitalize<Head>>}${Capitalize<ToCamel<Tail>>}`\n : S extends `${infer Head}-${infer Tail}`\n ? `${ToCamel<Uncapitalize<Head>>}${Capitalize<ToCamel<Tail>>}`\n : Uncapitalize<S>\n : never;\n\nexport type ObjectToCamel<T extends object | undefined | null> =\n T extends undefined\n ? undefined\n : T extends null\n ? null\n : T extends Array<infer ArrayType>\n ? ArrayType extends object\n ? Array<ObjectToCamel<ArrayType>>\n : Array<ArrayType>\n : T extends Uint8Array\n ? Uint8Array\n : T extends Date\n ? Date\n : {\n [K in keyof T as K extends `${string}-${string}` ? K : ToCamel<K>]: T[K] extends\n | Array<infer ArrayType>\n | undefined\n | null\n ? ArrayType extends object\n ? Array<ObjectToCamel<ArrayType>>\n : Array<ArrayType>\n : T[K] extends object | undefined | null\n ? ObjectToCamel<T[K]>\n : T[K];\n };\n\nexport type ToPascal<S extends string | number | symbol> = S extends string\n ? S extends `${infer Head}_${infer Tail}`\n ? `${Capitalize<ToCamel<Head>>}${Capitalize<ToCamel<Tail>>}`\n : S extends `${infer Head}-${infer Tail}`\n ? `${Capitalize<ToCamel<Head>>}${Capitalize<ToCamel<Tail>>}`\n : Capitalize<S>\n : never;\n\nexport type ObjectToPascal<T extends object | undefined | null> =\n T extends undefined\n ? undefined\n : T extends null\n ? null\n : T extends Array<infer ArrayType>\n ? ArrayType extends object\n ? Array<ObjectToPascal<ArrayType>>\n : Array<ArrayType>\n : T extends Uint8Array\n ? Uint8Array\n : T extends Date\n ? Date\n : {\n [K in keyof T as K extends `${string}-${string}` ? K : ToPascal<K>]: T[K] extends\n | Array<infer ArrayType>\n | undefined\n | null\n ? ArrayType extends object\n ? Array<ObjectToPascal<ArrayType>>\n : Array<ArrayType>\n : T[K] extends object | undefined | null\n ? ObjectToPascal<T[K]>\n : T[K];\n };\n\nexport type ToSnake<S extends string | number | symbol> = S extends string\n ? S extends `${infer Head}${CapitalChars}${infer Tail}` // string has a capital char somewhere\n ? Head extends '' // there is a capital char in the first position\n ? Tail extends ''\n ? Lowercase<S> /* 'A' */\n : S extends `${infer Caps}${Tail}` // tail exists, has capital characters\n ? Caps extends CapitalChars\n ? Tail extends CapitalLetters\n ? `${Lowercase<Caps>}_${Lowercase<Tail>}` /* 'AB' */\n : Tail extends `${CapitalLetters}${string}`\n ? `${ToSnake<Caps>}_${ToSnake<Tail>}` /* first tail char is upper? 'ABcd' */\n : `${ToSnake<Caps>}${ToSnake<Tail>}` /* 'AbCD','AbcD', */ /* TODO: if tail is only numbers, append without underscore */\n : never /* never reached, used for inference of caps */\n : never\n : Tail extends '' /* 'aB' 'abCD' 'ABCD' 'AB' */\n ? S extends `${Head}${infer Caps}`\n ? Caps extends CapitalChars\n ? Head extends Lowercase<Head> /* 'abcD' */\n ? Caps extends Numbers\n ? // Head exists and is lowercase, tail does not, Caps is a number, we may be in a sub-select\n // if head ends with number, don't split head an Caps, keep contiguous numbers together\n Head extends `${string}${Numbers}`\n ? never\n : // head does not end in number, safe to split. 'abc2' -> 'abc_2'\n `${ToSnake<Head>}_${Caps}`\n : `${ToSnake<Head>}_${ToSnake<Caps>}` /* 'abcD' 'abc25' */\n : never /* stop union type forming */\n : never\n : never /* never reached, used for inference of caps */\n : S extends `${Head}${infer Caps}${Tail}` /* 'abCd' 'ABCD' 'AbCd' 'ABcD' */\n ? Caps extends CapitalChars\n ? Head extends Lowercase<Head> /* is 'abCd' 'abCD' ? */\n ? Tail extends CapitalLetters /* is 'abCD' where Caps = 'C' */\n ? `${ToSnake<Head>}_${ToSnake<Caps>}_${Lowercase<Tail>}` /* aBCD Tail = 'D', Head = 'aB' */\n : Tail extends `${CapitalLetters}${string}` /* is 'aBCd' where Caps = 'B' */\n ? Head extends Numbers\n ? never /* stop union type forming */\n : Head extends `${string}${Numbers}`\n ? never /* stop union type forming */\n : `${Head}_${ToSnake<Caps>}_${ToSnake<Tail>}` /* 'aBCd' => `${'a'}_${Lowercase<'B'>}_${ToSnake<'Cd'>}` */\n : `${ToSnake<Head>}_${Lowercase<Caps>}${ToSnake<Tail>}` /* 'aBcD' where Caps = 'B' tail starts as lowercase */\n : never\n : never\n : never\n : S /* 'abc' */\n : never;\n\nexport type ObjectToSnake<T extends object | undefined | null> =\n T extends undefined\n ? undefined\n : T extends null\n ? null\n : T extends Array<infer ArrayType>\n ? ArrayType extends object\n ? Array<ObjectToSnake<ArrayType>>\n : Array<ArrayType>\n : T extends Uint8Array\n ? Uint8Array\n : T extends Date\n ? Date\n : {\n [K in keyof T as K extends `${string}-${string}` ? K : ToSnake<K>]: T[K] extends\n | Array<infer ArrayType>\n | undefined\n | null\n ? ArrayType extends object\n ? Array<ObjectToSnake<ArrayType>>\n : Array<ArrayType>\n : T[K] extends object | undefined | null\n ? ObjectToSnake<T[K]>\n : T[K];\n };\n\ntype CapitalLetters =\n | 'A'\n | 'B'\n | 'C'\n | 'D'\n | 'E'\n | 'F'\n | 'G'\n | 'H'\n | 'I'\n | 'J'\n | 'K'\n | 'L'\n | 'M'\n | 'N'\n | 'O'\n | 'P'\n | 'Q'\n | 'R'\n | 'S'\n | 'T'\n | 'U'\n | 'V'\n | 'W'\n | 'X'\n | 'Y'\n | 'Z';\n\ntype Numbers = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';\n\ntype CapitalChars = CapitalLetters | Numbers;", "import { z } from \"zod\";\nimport { themesSchema, themeConfigurationSchema } from \"./theme-schema\";\nimport { LanguageFieldSchema, LanguagesSchema } from \"./other-screen-schema\";\nimport { combinedQuestionSchema, sectionSchema } from \"./field-schema\";\nimport {\n otherConfigurationPropertiesSchema,\n} from \"./form-properties-schema\";\nimport { translationsSchema } from \"./translations-schema\";\n\n// Theme mode schema for current app mode\nexport const currentModeSchema = z\n .enum([\"light\", \"dark\"])\n .describe(\"Current theme mode of the application\");\n\n// Constants for current modes (explicit literal values for proper type inference)\nexport const CurrentModes = {\n LIGHT: \"light\" as const,\n DARK: \"dark\" as const,\n} as const;\n\n// App props schema\nexport const appPropsSchema = z\n .object({\n theme: themesSchema.describe(\n \"Theme configuration including light and dark theme colors\"\n ),\n currentMode: currentModeSchema.describe(\n \"Current theme mode (light or dark)\"\n ),\n currentLanguage: LanguageFieldSchema.describe(\n \"Currently selected language configuration\"\n ),\n questions: z\n .record(z.string(), combinedQuestionSchema)\n .describe(\"Collection of questions keyed by their string identifiers\"),\n questionLanguages: LanguagesSchema.describe(\n \"Available languages for questions\"\n ),\n otherConfigurationProperties: otherConfigurationPropertiesSchema.describe(\n \"Other configuration properties including form display options and translations\"\n ),\n translations: translationsSchema\n .optional()\n .describe(\n \"Multi-language translations for questions and form content (optional)\"\n ),\n onSectionChange: z\n .function({\n input: [z.number(), z.string()],\n output: z.void(),\n })\n .optional()\n .describe(\"Optional callback function triggered when section changes\"),\n onClose: z\n .function({\n input: [],\n output: z.void(),\n })\n .optional()\n .describe(\"Optional callback function triggered when the form is closed\"),\n sections: z\n .array(sectionSchema)\n .describe(\n \"Array of sections that organize questions into logical groups\"\n ),\n themeSettings: themeConfigurationSchema.describe(\n \"Complete theme configuration including colors, features, and positioning\"\n ),\n })\n .describe(\n \"Schema for application props interface containing all form configuration and state\"\n );\n\n// Type exports for TypeScript\nexport type CurrentMode = z.infer<typeof currentModeSchema>;\nexport type AppProps = z.infer<typeof appPropsSchema>;\n", "// Main entry point for encatch-typescript schemas\n\n// Field schema exports\nexport {\n questionTypeSchema,\n validationRuleTypeSchema,\n validationRuleSchema,\n visibilityConditionSchema,\n sectionSchema,\n questionStatusSchema,\n ratingDisplayStyleSchema,\n ratingRepresentationSizeSchema,\n multipleChoiceDisplayStyleSchema,\n multipleChoiceMultipleDisplayStyleSchema,\n yesNoDisplayStyleSchema,\n ratingMatrixDisplayStyleSchema,\n choiceOrderOptionSchema,\n questionSchema,\n ratingQuestionSchema,\n annotationQuestionSchema,\n questionOptionSchema,\n nestedOptionSchema,\n multipleChoiceSingleQuestionSchema,\n multipleChoiceMultipleQuestionSchema,\n npsQuestionSchema,\n shortAnswerQuestionSchema,\n longAnswerQuestionSchema,\n nestedDropdownQuestionSchema,\n dateQuestionSchema,\n dateFormatSchema,\n dateSeparatorSchema,\n csatQuestionSchema,\n csatScaleSchema,\n csatDisplayStyleSchema,\n opinionScaleQuestionSchema,\n rankingQuestionSchema,\n rankingDisplayStyleSchema,\n pictureChoiceQuestionSchema,\n signatureModeSchema,\n signatureQuestionSchema,\n fileUploadQuestionSchema,\n emailQuestionSchema,\n numberQuestionSchema,\n websiteQuestionSchema,\n phoneNumberQuestionSchema,\n addressSubFieldConfigSchema,\n addressQuestionSchema,\n videoAudioModeSchema,\n videoAudioQuestionSchema,\n schedulerProviderSchema,\n schedulerQuestionSchema,\n qnaWithAiQuestionSchema,\n paymentsUpiAmountConfigSchema,\n paymentsUpiQuestionSchema,\n combinedQuestionSchema,\n welcomeQuestionSchema,\n thankYouQuestionSchema,\n messagePanelQuestionSchema,\n exitFormQuestionSchema,\n yesNoQuestionSchema,\n consentQuestionSchema,\n ratingMatrixQuestionSchema,\n matrixSingleChoiceQuestionSchema,\n matrixMultipleChoiceQuestionSchema,\n // building blocks\n ratingMatrixStatementSchema,\n ratingMatrixScalePointSchema,\n ratingMatrixScaleSchema,\n matrixRowSchema,\n matrixColumnSchema,\n // Enum constants\n DateFormats,\n DateSeparators,\n CsatScales,\n CsatDisplayStyles,\n RankingDisplayStyles,\n SignatureModes,\n VideoAudioModes,\n SchedulerProviders,\n QuestionTypes,\n ValidationRuleTypes,\n VisibilityConditionOperators,\n QuestionStatuses,\n RatingDisplayStyles,\n RatingRepresentationSizes,\n MultipleChoiceDisplayStyles,\n MultipleChoiceMultipleDisplayStyles,\n YesNoDisplayStyles,\n RatingMatrixDisplayStyles,\n ChoiceOrderOptions,\n // Types\n type QuestionType,\n type ValidationRule,\n type VisibilityCondition,\n type QuestionStatus,\n type Question,\n type RatingDisplayStyle,\n type RatingRepresentationSize,\n type RatingQuestion,\n type AnnotationQuestion,\n type WelcomeQuestion,\n type ThankYouQuestion,\n type MessagePanelQuestion,\n type ExitFormQuestion,\n type YesNoDisplayStyle,\n type YesNoQuestion,\n type ConsentQuestion,\n type RatingMatrixStatement,\n type RatingMatrixScalePoint,\n type RatingMatrixScale,\n type RatingMatrixDisplayStyle,\n type RatingMatrixQuestion,\n type MatrixRow,\n type MatrixColumn,\n type MatrixSingleChoiceQuestion,\n type MatrixMultipleChoiceQuestion,\n type QuestionOption,\n type NestedOption,\n type MultipleChoiceDisplayStyle,\n type MultipleChoiceSingleQuestion,\n type MultipleChoiceMultipleDisplayStyle,\n type MultipleChoiceMultipleQuestion,\n type NpsQuestion,\n type ShortAnswerQuestion,\n type LongAnswerQuestion,\n type ChoiceOrderOption,\n type NestedDropdownQuestion,\n type DateFormat,\n type DateSeparator,\n type DateQuestion,\n type CsatScale,\n type CsatDisplayStyle,\n type CsatQuestion,\n type OpinionScaleQuestion,\n type RankingDisplayStyle,\n type RankingQuestion,\n type PictureChoiceQuestion,\n type SignatureMode,\n type SignatureQuestion,\n type FileUploadQuestion,\n type EmailQuestion,\n type NumberQuestion,\n type WebsiteQuestion,\n type PhoneNumberQuestion,\n type AddressSubFieldConfig,\n type AddressQuestion,\n type VideoAudioMode,\n type VideoAudioQuestion,\n type SchedulerProvider,\n type SchedulerQuestion,\n type QnaWithAiQuestion,\n type PaymentsUpiAmountConfig,\n type PaymentsUpiQuestion,\n type Section,\n type CombinedQuestion,\n} from \"./schemas/fields/field-schema\";\n\n// Answer schema exports\nexport {\n AnnotationMarkerSchema,\n AnnotationSchema,\n SignatureAnswerSchema,\n FileUploadAnswerItemSchema,\n FileUploadAnswerSchema,\n PhoneNumberAnswerSchema,\n AddressAnswerSchema,\n VideoAudioAnswerSchema,\n SchedulerAnswerSchema,\n QnaWithAiPairSchema,\n QnaWithAiAnswerSchema,\n PaymentsUpiAnswerSchema,\n AnswerItemSchema,\n AnswerSchema,\n type AnnotationMarker,\n type Annotation,\n type SignatureAnswer,\n type FileUploadAnswerItem,\n type FileUploadAnswer,\n type PhoneNumberAnswer,\n type AddressAnswer,\n type VideoAudioAnswer,\n type SchedulerAnswer,\n type QnaWithAiPair,\n type QnaWithAiAnswer,\n type PaymentsUpiAnswer,\n type AnswerItem,\n type Answer,\n} from \"./schemas/fields/answer-schema\";\n\n// Form schema exports\nexport {\n externalPublishingPropertiesSchema,\n publicationStatusSchema,\n feedbackConfigurationSchema,\n // Enum constants\n PublicationStatuses,\n // Types\n type PublicationStatus,\n type FeedbackConfiguration,\n type ExternalPublishingProperties,\n} from \"./schemas/fields/form-schema\";\n\n// Form properties schema exports\nexport {\n otherConfigurationPropertiesSchema,\n appearancePropertiesSchema,\n formPropertiesSchema,\n type FormProperties,\n type OtherConfigurationProperties,\n type AppearanceProperties,\n} from \"./schemas/fields/form-properties-schema\";\n\n// Other screen schema exports\nexport {\n OtherFieldsSchema,\n LanguageFieldSchema,\n LanguagesSchema,\n OtherFieldsTranslationSchema,\n // Types\n type OtherFields,\n type OtherFieldsTranslation,\n type LanguageField,\n type Languages,\n} from \"./schemas/fields/other-screen-schema\";\n\n// Theme schema exports\nexport {\n positionSchema,\n themeModeSchema,\n shareableModeSchema,\n previousButtonModeSchema,\n featureSettingsSchema,\n themeColorsSchema,\n themesSchema,\n themeConfigurationSchema,\n // Enum constants\n Positions,\n ThemeModes,\n ShareableModes,\n PreviousButtonModes,\n // Types\n type Position,\n type FeatureSettings,\n type ThemeColors,\n type Themes,\n type ThemeMode,\n type ShareableMode,\n type PreviousButtonMode,\n type ThemeConfiguration,\n} from \"./schemas/fields/theme-schema\";\n\n// Layout schema exports\nexport {\n focalPointSchema,\n imageAttachmentSchema,\n videoAttachmentSchema,\n colorAttachmentSchema,\n gradientAttachmentSchema,\n layoutAttachmentSchema,\n stackLayoutSchema,\n floatLayoutSchema,\n splitLayoutSchema,\n wallpaperLayoutSchema,\n sectionLayoutVariantSchema,\n layoutSurfaceSchema,\n sectionLayoutSchema,\n // Enum constants\n LayoutAttachmentTypes,\n LayoutTypes,\n // Types\n type FocalPoint,\n type ImageAttachment,\n type VideoAttachment,\n type ColorAttachment,\n type GradientAttachment,\n type LayoutAttachment,\n type StackLayout,\n type FloatLayout,\n type SplitLayout,\n type WallpaperLayout,\n type SectionLayoutVariant,\n type LayoutSurface,\n type SectionLayout,\n} from \"./schemas/fields/layout-schema\";\n\n// Translations schema exports\nexport {\n translationEntrySchema,\n ratingQuestionTranslationSchema,\n singleChoiceQuestionTranslationSchema,\n multipleChoiceQuestionTranslationSchema,\n npsQuestionTranslationSchema,\n shortAnswerQuestionTranslationSchema,\n longAnswerQuestionTranslationSchema,\n videoAudioQuestionTranslationSchema,\n dateQuestionTranslationSchema,\n signatureQuestionTranslationSchema,\n schedulerQuestionTranslationSchema,\n qnaWithAiQuestionTranslationSchema,\n paymentsUpiQuestionTranslationSchema,\n nestedSelectionQuestionTranslationSchema,\n annotationQuestionTranslationSchema,\n welcomeQuestionTranslationSchema,\n thankYouQuestionTranslationSchema,\n messagePanelQuestionTranslationSchema,\n yesNoQuestionTranslationSchema,\n consentQuestionTranslationSchema,\n ratingMatrixQuestionTranslationSchema,\n matrixSingleChoiceQuestionTranslationSchema,\n matrixMultipleChoiceQuestionTranslationSchema,\n questionTranslationSchema,\n sectionTranslationSchema,\n sectionTranslationsByLanguageSchema,\n questionCentricTranslationsSchema,\n translationsSchema,\n TranslationProvider,\n createTranslationProvider,\n type TranslationEntry,\n type RatingQuestionTranslation,\n type SingleChoiceQuestionTranslation,\n type MultipleChoiceQuestionTranslation,\n type NpsQuestionTranslation,\n type ShortAnswerQuestionTranslation,\n type LongAnswerQuestionTranslation,\n type VideoAudioQuestionTranslation,\n type DateQuestionTranslation,\n type SignatureQuestionTranslation,\n type SchedulerQuestionTranslation,\n type QnaWithAiQuestionTranslation,\n type PaymentsUpiQuestionTranslation,\n type NestedSelectionQuestionTranslation,\n type AnnotationQuestionTranslation,\n type WelcomeQuestionTranslation,\n type ThankYouQuestionTranslation,\n type MessagePanelQuestionTranslation,\n type YesNoQuestionTranslation,\n type ConsentQuestionTranslation,\n type RatingMatrixQuestionTranslation,\n type MatrixSingleChoiceQuestionTranslation,\n type MatrixMultipleChoiceQuestionTranslation,\n type QuestionTranslation,\n type SectionTranslation,\n type SectionTranslationsByLanguage,\n type QuestionCentricTranslations,\n type Translations,\n} from \"./schemas/fields/translations-schema\";\n\n// Completion CTA schema exports\nexport {\n platformCompletionCtaSchema,\n completionCtaSecondarySchema,\n completionCtaSchema,\n type PlatformCompletionCta,\n type CompletionCtaSecondary,\n type CompletionCta,\n type CompletionCtaAction,\n} from \"./schemas/fields/completion-cta-schema\";\n\n// Auto trigger schema exports\nexport {\n customEventFieldOperatorSchema,\n customEventFieldSchema,\n conditionalIfMetadataSchema,\n queryOutputSchema,\n conditionalIfSchema,\n triggerActionSchema,\n conditionalWhenSchema,\n filterConditionSchema,\n categorySpecificFiltersSchema,\n whoSchema,\n audienceSegmentSchema,\n audienceTriggerPropertiesSchema,\n type CustomEventFieldOperator,\n type CustomEventField,\n type ConditionalIfMetadata,\n type QueryOutput,\n type ConditionalIf,\n type TriggerAction,\n type ConditionalWhen,\n type FilterCondition,\n type CategorySpecificFilters,\n type Who,\n type AudienceSegment,\n type AudienceTriggerProperties,\n} from \"./schemas/fields/auto-trigger-schema\";\n\n// Master properties schema exports\nexport {\n masterPropertiesSchema,\n type MasterProperties,\n} from \"./schemas/fields/other-properties-schema\";\n\n// Device and session info schema exports\nexport {\n deviceThemeSchema,\n deviceInfoSchema,\n sessionInfoSchema,\n deviceSessionInfoSchema,\n userPropertiesSchema,\n userInfoSchema,\n // Enum constants\n DeviceThemes,\n // Types\n type DeviceTheme,\n type DeviceInfo,\n type SessionInfo,\n type DeviceSessionInfo,\n type UserProperties,\n type UserInfo,\n} from \"./schemas/api/other-schema\";\n\n// Submit feedback schema exports\nexport {\n formConfigSchema,\n questionResponseSchema,\n responseSchema,\n matchedTriggerPropertiesSchema,\n baseSubmitFeedbackSchema,\n partialFeedbackSchema,\n submitFeedbackSchema,\n feedbackRequestSchema,\n // Types\n type FormConfig,\n type QuestionResponse,\n type Response,\n type MatchedTriggerProperties,\n type BaseSubmitFeedback,\n type PartialFeedback,\n type SubmitFeedback,\n type FeedbackRequest,\n} from \"./schemas/api/submit-feedback-schema\";\n\n// Fetch feedback schema exports\nexport {\n feedbackConfigurationItemSchema,\n fetchFormConfigSchema,\n fetchConfigurationListSchema,\n fetchFeedbackDetailsSchema,\n formConfigurationResponseSchema,\n questionnaireFieldsResponseSchema,\n fetchFeedbackDetailsResponseSchema,\n fetchConfigurationListResponseSchema,\n logicJumpRuleSchema,\n logicJumpRulesSchema,\n // Types\n type FeedbackConfigurationItem,\n type FetchFormConfig,\n type FetchConfigurationListRequest,\n type FetchFeedbackDetailsRequest,\n type FormConfigurationResponse,\n type QuestionnaireFieldsResponse,\n type FetchFeedbackDetailsResponse,\n type FetchConfigurationListResponse,\n type LogicJumpRule,\n type LogicJumpRules,\n} from \"./schemas/api/fetch-feedback-schema\";\n\nexport {\n RefineTextParams,\n RefineTextResponse,\n RefineTextData,\n //Types\n refineTextDataSchema,\n refineTextParamsSchema,\n refineTextResponseSchema,\n} from \"./schemas/api/refine-text-schema\";\n\n// Case conversion utility exports\nexport {\n objectToCamel,\n objectToSnake,\n toSnake,\n toCamel,\n toPascal,\n objectToPascal,\n} from \"./helpers/case-convert-helper\";\n\nexport type {\n ObjectToCamel,\n ObjectToSnake,\n ToSnake,\n ToCamel,\n ToPascal,\n ObjectToPascal,\n} from \"./helpers/case-convert-helper\";\n\n// App props schema exports\nexport {\n currentModeSchema,\n appPropsSchema,\n // Enum constants\n CurrentModes,\n // Types\n type CurrentMode,\n type AppProps,\n} from \"./schemas/fields/app-props-schema\";\n\n// Re-export Zod for convenience (consumers should add zod to their dependencies)\nexport { z } from \"zod\";\n"],
|
|
5
|
-
"mappings": ";;;;AAAA,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAIX,IAAM,yBAAyB,EACnC,OAAO,EACP,IAAI,CAAC,EACL,SAAS,yBAAyB;AAG9B,IAAM,sCAAsC,EAAE,OAAO;AAAA,EAC1D,OAAO,uBAAuB,SAAS,4BAA4B;AAAA,EACnE,aAAa,uBACV,SAAS,EACT,SAAS,kCAAkC;AAAA,EAC9C,cAAc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AAO,GAAGA,IAAE,OAAO,CAAC;AAAA,IAC9B,QAAQA,IAAE,KAAK;AAAA,EACjB,CAAC,EACA,SAAS,EACT,SAAS,2DAA2D;AAAA,EACvE,SAASA,IACN,SAAS;AAAA,IACR,OAAO,CAAC;AAAA,IACR,QAAQA,IAAE,KAAK;AAAA,EACjB,CAAC,EACA,SAAS,EACT,SAAS,8DAA8D;AAAA,EAC1E,UAAUA,IACP,MAAM,aAAa,EACnB;AAAA,IACC;AAAA,EACF;AAAA,EACF,eAAe,yBAAyB;AAAA,IACtC;AAAA,EACF;AACF,CAAC,EACA;AAAA,EACC;AACF;;;AC2aF,SAAS,KAAAC,WAAS;",
|
|
4
|
+
"sourcesContent": ["import { z } from \"zod\";\nimport { sectionTranslationsByLanguageSchema } from \"./translations-schema\";\nimport { completionCtaSchema } from \"./completion-cta-schema\";\nimport { AddressAnswerSchema } from \"./answer-schema\";\n\n// Question type enum for different form field types\nexport const questionTypeSchema = z\n .enum([\n \"rating\",\n \"single_choice\",\n \"nps\",\n \"nested_selection\",\n \"multiple_choice_multiple\",\n \"short_answer\",\n \"long_text\",\n \"annotation\",\n \"welcome\",\n \"thank_you\",\n \"message_panel\",\n \"yes_no\",\n \"rating_matrix\",\n \"matrix_single_choice\",\n \"matrix_multiple_choice\",\n \"exit_form\",\n \"consent\",\n \"date\",\n \"csat\",\n \"opinion_scale\",\n \"ranking\",\n \"picture_choice\",\n \"signature\",\n \"file_upload\",\n \"email\",\n \"number\",\n \"website\",\n \"phone_number\",\n \"address\",\n \"video_audio\",\n \"scheduler\",\n \"qna_with_ai\",\n \"payments_upi\",\n ])\n .describe(\"Enumeration of all supported question types for form fields\");\n\n// Constants for question types (explicit literal values for proper type inference)\nexport const QuestionTypes = {\n RATING: \"rating\" as const,\n SINGLE_CHOICE: \"single_choice\" as const,\n NPS: \"nps\" as const,\n NESTED_SELECTION: \"nested_selection\" as const,\n MULTIPLE_CHOICE_MULTIPLE: \"multiple_choice_multiple\" as const,\n SHORT_ANSWER: \"short_answer\" as const,\n LONG_TEXT: \"long_text\" as const,\n ANNOTATION: \"annotation\" as const,\n WELCOME: \"welcome\" as const,\n THANK_YOU: \"thank_you\" as const,\n MESSAGE_PANEL: \"message_panel\" as const,\n YES_NO: \"yes_no\" as const,\n RATING_MATRIX: \"rating_matrix\" as const,\n MATRIX_SINGLE_CHOICE: \"matrix_single_choice\" as const,\n MATRIX_MULTIPLE_CHOICE: \"matrix_multiple_choice\" as const,\n EXIT_FORM: \"exit_form\" as const,\n CONSENT: \"consent\" as const,\n DATE: \"date\" as const,\n CSAT: \"csat\" as const,\n OPINION_SCALE: \"opinion_scale\" as const,\n RANKING: \"ranking\" as const,\n PICTURE_CHOICE: \"picture_choice\" as const,\n SIGNATURE: \"signature\" as const,\n FILE_UPLOAD: \"file_upload\" as const,\n EMAIL: \"email\" as const,\n NUMBER: \"number\" as const,\n WEBSITE: \"website\" as const,\n PHONE_NUMBER: \"phone_number\" as const,\n ADDRESS: \"address\" as const,\n VIDEO_AUDIO: \"video_audio\" as const,\n SCHEDULER: \"scheduler\" as const,\n QNA_WITH_AI: \"qna_with_ai\" as const,\n PAYMENTS_UPI: \"payments_upi\" as const,\n} as const;\n\n// Validation rule type enum\nexport const validationRuleTypeSchema = z\n .enum([\n \"required\",\n \"min\",\n \"max\",\n \"minLength\",\n \"maxLength\",\n \"pattern\",\n \"email\",\n \"url\",\n \"custom\",\n ])\n .describe(\"Enumeration of all supported validation rule types\");\n\n// Constants for validation rule types (explicit literal values for proper type inference)\nexport const ValidationRuleTypes = {\n REQUIRED: \"required\" as const,\n MIN: \"min\" as const,\n MAX: \"max\" as const,\n MIN_LENGTH: \"minLength\" as const,\n MAX_LENGTH: \"maxLength\" as const,\n PATTERN: \"pattern\" as const,\n EMAIL: \"email\" as const,\n URL: \"url\" as const,\n CUSTOM: \"custom\" as const,\n} as const;\n\n// Validation rule schema for question validations\nexport const validationRuleSchema = z\n .object({\n type: validationRuleTypeSchema.describe(\"Type of validation rule to apply\"),\n value: z\n .union([z.string(), z.number(), z.boolean()])\n .optional()\n .describe(\"Value for the validation rule (string, number, or boolean)\"),\n message: z\n .string()\n .optional()\n .describe(\"Custom error message when validation fails\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this validation rule\"),\n })\n .describe(\"Schema defining validation rules for question responses\");\n\n// Visibility condition operator enum\nexport const visibilityConditionOperatorSchema = z\n .enum([\n \"equals\",\n \"not_equals\",\n \"contains\",\n \"not_contains\",\n \"greater_than\",\n \"less_than\",\n \"is_empty\",\n \"is_not_empty\",\n ])\n .describe(\"Enumeration of all supported visibility condition operators\");\n\n// Constants for visibility condition operators (explicit literal values for proper type inference)\nexport const VisibilityConditionOperators = {\n EQUALS: \"equals\" as const,\n NOT_EQUALS: \"not_equals\" as const,\n CONTAINS: \"contains\" as const,\n NOT_CONTAINS: \"not_contains\" as const,\n GREATER_THAN: \"greater_than\" as const,\n LESS_THAN: \"less_than\" as const,\n IS_EMPTY: \"is_empty\" as const,\n IS_NOT_EMPTY: \"is_not_empty\" as const,\n} as const;\n\n// Visibility condition schema for conditional visibility\nexport const visibilityConditionSchema = z\n .object({\n field: z.string().describe(\"ID of the field to check against\"),\n operator: visibilityConditionOperatorSchema.describe(\n \"Comparison operator for the condition\",\n ),\n value: z\n .union([z.string(), z.number(), z.boolean()])\n .optional()\n .describe(\"Value to compare against (string, number, or boolean)\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this visibility condition\"),\n })\n .describe(\n \"Schema defining conditions that control when questions are visible\",\n );\n\n// Section schema for organizing questions\nexport const sectionSchema = z\n .object({\n id: z.string().describe(\"Unique identifier for the section\"),\n title: z.string().min(1).max(200).describe(\"Display title for the section\"),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe(\"Optional detailed description or help text for the section\"),\n showTitle: z\n .boolean()\n .default(true)\n .describe(\"Whether to show the section title in the UI\"),\n showDescription: z\n .boolean()\n .default(true)\n .describe(\"Whether to show the section description in the UI\"),\n nextButtonLabel: z\n .string()\n .min(1)\n .max(50)\n .optional()\n .describe(\"Label for the next button when navigating from this section\"),\n translations: sectionTranslationsByLanguageSchema\n .optional()\n .describe(\n \"Per-language section copy (title, optional description and nextButtonLabel), keyed by language code\",\n ),\n inAppSingleQuestion: z\n .boolean()\n .default(false)\n .describe(\n \"When true, the native app shows one question at a time within this section\",\n ),\n isPreviousAllowed: z\n .boolean()\n .default(false)\n .optional()\n .describe(\n \"When the global previousButton mode is 'auto', controls whether the Previous button is shown for this section. Defaults to false (hidden).\",\n ),\n questionIds: z\n .array(z.string())\n .min(1)\n .describe(\"Array of question IDs that belong to this section\"),\n })\n .describe(\n \"Schema defining sections that organize questions into logical groups\",\n );\n\n// Question status enum\nexport const questionStatusSchema = z.enum([\"D\", \"P\", \"A\", \"S\"]); // Draft, Published, Archived, Suspended\n\n// Constants for question status (explicit literal values for proper type inference)\nexport const QuestionStatuses = {\n DRAFT: \"D\" as const,\n PUBLISHED: \"P\" as const,\n ARCHIVED: \"A\" as const,\n SUSPENDED: \"S\" as const,\n} as const;\n\n// Display style enum for rating questions\nexport const ratingDisplayStyleSchema = z.enum([\n \"star\",\n \"heart\",\n \"thumbs-up\",\n \"diamond\",\n \"emoji\",\n \"emoji-exp\",\n]);\n\n// Constants for rating display styles (explicit literal values for proper type inference)\nexport const RatingDisplayStyles = {\n STAR: \"star\" as const,\n HEART: \"heart\" as const,\n THUMBS_UP: \"thumbs_up\" as const,\n DIAMOND: \"diamond\" as const,\n EMOJI: \"emoji\" as const,\n EMOJI_EXP: \"emoji_exp\" as const,\n} as const;\n\n// Representation size enum for rating questions\nexport const ratingRepresentationSizeSchema = z.enum([\n \"small\",\n \"medium\",\n \"large\",\n]);\n\n// Constants for rating representation sizes (explicit literal values for proper type inference)\nexport const RatingRepresentationSizes = {\n SMALL: \"small\" as const,\n MEDIUM: \"medium\" as const,\n LARGE: \"large\" as const,\n} as const;\n\n// Display style enum for multiple choice questions\nexport const multipleChoiceDisplayStyleSchema = z.enum([\n \"radio\",\n \"list\",\n \"chip\",\n \"dropdown\",\n \"autosuggest\",\n]);\n\n// Constants for multiple choice display styles (explicit literal values for proper type inference)\nexport const MultipleChoiceDisplayStyles = {\n RADIO: \"radio\" as const,\n LIST: \"list\" as const,\n CHIP: \"chip\" as const,\n DROPDOWN: \"dropdown\" as const,\n AUTOSUGGEST: \"autosuggest\" as const,\n} as const;\n\n// Display style enum for multiple choice multiple questions\nexport const multipleChoiceMultipleDisplayStyleSchema = z.enum([\n \"checkbox\",\n \"list\",\n \"chip\",\n \"autosuggest\",\n]);\n\n// Constants for multiple choice multiple display styles (explicit literal values for proper type inference)\nexport const MultipleChoiceMultipleDisplayStyles = {\n CHECKBOX: \"checkbox\" as const,\n LIST: \"list\" as const,\n CHIP: \"chip\" as const,\n AUTOSUGGEST: \"autosuggest\" as const,\n} as const;\n\n// Display layout for yes/no questions (side-by-side vs stacked)\nexport const yesNoDisplayStyleSchema = z.enum([\"horizontal\", \"vertical\"]);\n\n// Constants for yes/no display styles (explicit literal values for proper type inference)\nexport const YesNoDisplayStyles = {\n HORIZONTAL: \"horizontal\" as const,\n VERTICAL: \"vertical\" as const,\n} as const;\n\n// Choice order options for nested selection questions\nexport const choiceOrderOptionSchema = z.enum([\n \"randomize\",\n \"flip\",\n \"rotate\",\n \"ascending\",\n \"none\",\n]);\n\n// Constants for choice order options (explicit literal values for proper type inference)\nexport const ChoiceOrderOptions = {\n RANDOMIZE: \"randomize\" as const,\n FLIP: \"flip\" as const,\n ROTATE: \"rotate\" as const,\n ASCENDING: \"ascending\" as const,\n NONE: \"none\" as const,\n} as const;\n\n// Main Question schema\nexport const questionSchema = z\n .object({\n id: z.string().describe(\"Unique identifier for the question\"),\n slug: z\n .string()\n .min(1)\n .max(128)\n .optional()\n .describe(\n \"Optional stable identifier for the question (e.g. URLs, analytics, or integrations)\",\n ),\n type: questionTypeSchema.describe(\n \"The type of question (rating, single_choice, etc.)\",\n ),\n title: z\n .string()\n .min(1)\n .max(200)\n .describe(\"The main title/question text displayed to users\"),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe(\"Optional detailed description or help text\"),\n describe: z\n .string()\n .max(2000)\n .optional()\n .describe(\n \"LLM tool call description for better AI understanding and context\",\n ),\n required: z\n .boolean()\n .default(false)\n .describe(\"Whether this question must be answered\"),\n isHidden: z\n .boolean()\n .default(false)\n .describe(\"When true, the question is hidden from the form UI\"),\n errorMessage: z\n .string()\n .max(500)\n .optional()\n .describe(\"Custom error message when validation fails\"),\n validations: z\n .array(validationRuleSchema)\n .optional()\n .default([])\n .describe(\"Array of validation rules to apply\"),\n visibility: z\n .array(visibilityConditionSchema)\n .optional()\n .default([])\n .describe(\"Conditions that control when this question is shown\"),\n sectionId: z\n .string()\n .optional()\n .describe(\"ID of the section this question belongs to\"),\n status: questionStatusSchema.describe(\n \"Current status of the question (Draft, Published, etc.)\",\n ),\n textAlign: z\n .enum([\"left\", \"center\", \"justify\"])\n .optional()\n .default(\"left\")\n .describe(\n \"Text alignment for the question title and description; `justify` is intended for consent questions (full-width justified consent body markdown)\",\n ),\n nextButtonLabel: z\n .string()\n .min(1)\n .max(50)\n .default(\"Next\")\n .describe(\n \"Label for the next button when advancing past this question (overrides section or form defaults when set)\",\n ),\n showQuestionTitle: z\n .boolean()\n .default(true)\n .describe(\"Whether to display the question title; defaults to true\"),\n questionMediaUrl: z\n .string()\n .url()\n .optional()\n .describe(\n \"Optional URL for media (image or video) displayed alongside the question\",\n ),\n questionMediaType: z\n .enum([\"image\", \"video\", \"youtube\", \"vimeo\"])\n .optional()\n .describe(\n \"Type of media referenced by questionMediaUrl; one of 'image', 'video', 'youtube', or 'vimeo'\",\n ),\n })\n .describe(\"Base schema for all question types with common properties\");\n\n// Rating question schema (extends base question with specific rating properties)\nexport const ratingQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"rating\").describe(\"Must be exactly 'rating'\"),\n showLabels: z\n .boolean()\n .optional()\n .describe(\"Whether to show min/max labels\"),\n minLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label for the minimum rating value\"),\n maxLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label for the maximum rating value\"),\n displayStyle: ratingDisplayStyleSchema\n .optional()\n .describe(\"Visual style for rating display\"),\n numberOfRatings: z\n .number()\n .int()\n .min(1)\n .max(10)\n .describe(\"Number of rating options (1-10)\"),\n representationSize: ratingRepresentationSizeSchema\n .optional()\n .describe(\"Size of rating visual elements\"),\n color: z\n .string()\n .regex(/^#[0-9A-F]{6}$/i, \"Must be a valid hex color\")\n .optional()\n .describe(\"Hex color for rating elements\"),\n })\n .describe(\"Schema for rating questions with customizable display options\");\n\n// Annotation question schema (extends base question with annotation properties)\nexport const annotationQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"annotation\").describe(\"Must be exactly 'annotation'\"),\n annotationText: z\n .string()\n .max(1000)\n .optional()\n .describe(\"Text to display when annotation is provided\"),\n noAnnotationText: z\n .string()\n .max(500)\n .optional()\n .describe(\"Text to display when no annotation is provided\"),\n })\n .describe(\n \"Schema for annotation questions that provide additional context or instructions\",\n );\n\n// Welcome question schema (display-only screen, no answer captured)\nexport const welcomeQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"welcome\").describe(\"Must be exactly 'welcome'\"),\n title: z\n .string()\n .min(1)\n .max(200)\n .describe(\"The main heading displayed on the welcome screen\"),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe(\"Optional sub-text body shown below the heading\"),\n imageUrl: z\n .string()\n .url()\n .optional()\n .describe(\"Optional image URL displayed on the welcome screen\"),\n })\n .describe(\n \"Schema for a welcome screen displayed at the start or inline within a form\",\n );\n\n// Thank you question schema (display-only screen, no answer captured)\nexport const thankYouQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"thank_you\").describe(\"Must be exactly 'thank_you'\"),\n title: z\n .string()\n .min(1)\n .max(200)\n .describe(\"The main heading displayed on the thank you screen\"),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe(\n \"Optional thank you body text; rendered as Markdown where the form supports it\",\n ),\n imageUrl: z\n .string()\n .url()\n .optional()\n .describe(\"Optional image URL displayed on the thank you screen\"),\n completionCta: completionCtaSchema\n .optional()\n .describe(\n \"Optional CTA shown after submission; supports primary + optional secondary buttons with per-surface action routing (inApp / link), and optional auto-trigger timer; when absent the engine falls back to nextButtonLabel as a single dismiss button\",\n ),\n })\n .describe(\n \"Schema for a thank you screen shown at the end or inline within a form\",\n );\n\n// Message panel question schema (display-only informational panel, same shape as welcome; no answer captured)\nexport const messagePanelQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"message_panel\")\n .describe(\"Must be exactly 'message_panel'\"),\n title: z\n .string()\n .min(1)\n .max(200)\n .describe(\"The main heading displayed on the message panel\"),\n description: z\n .string()\n .max(1000)\n .optional()\n .describe(\"Optional body text shown below the heading\"),\n imageUrl: z\n .string()\n .url()\n .optional()\n .describe(\"Optional image URL displayed on the message panel\"),\n })\n .describe(\n \"Schema for an inline message panel (informational); distinct from welcome for UI semantics and analytics\",\n );\n\n// Exit form question schema (no UI \u2014 signals end of survey; used in branch logic to terminate a path without a thank-you screen)\nexport const exitFormQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"exit_form\").describe(\"Must be exactly 'exit_form'\"),\n completionCta: completionCtaSchema\n .optional()\n .describe(\n \"Optional silent completion action fired when the exit_form terminal is reached; no UI is shown \u2014 use redirect_internal / redirect_external for silent redirects or app_navigate for host routing; autoTriggerDelayMs defaults to 0 (immediate) when a configured action is present\",\n ),\n })\n .describe(\n \"Schema for an exit marker that silently ends the survey; carries no UI and captures no answer \u2014 intended for branch logic paths that should terminate without showing a thank-you screen\",\n );\n\n// Yes/no question schema (binary answer stored as boolean in responses)\nexport const yesNoQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"yes_no\").describe(\"Must be exactly 'yes_no'\"),\n yesLabel: z\n .string()\n .min(1)\n .max(50)\n .optional()\n .describe(\n \"Label for the Yes option (defaults to 'Yes' in the UI if omitted)\",\n ),\n noLabel: z\n .string()\n .min(1)\n .max(50)\n .optional()\n .describe(\n \"Label for the No option (defaults to 'No' in the UI if omitted)\",\n ),\n displayStyle: yesNoDisplayStyleSchema\n .optional()\n .describe(\n \"Layout for the Yes/No controls (horizontal row or vertical stack)\",\n ),\n })\n .describe(\n \"Schema for yes/no questions with optional custom labels and layout\",\n );\n\n// Consent question schema (single checkbox \u2014 answer is boolean true/false)\nexport const consentQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"consent\").describe(\"Must be exactly 'consent'\"),\n })\n .describe(\n \"Schema for a single-checkbox consent question; use description (rendered as markdown) for the checkbox label text and any policy/terms links; answer is boolean (true = checked)\",\n );\n\n// \u2500\u2500\u2500 Rating Matrix \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// Display style enum for rating matrix scale points (how each scale choice looks per row)\nexport const ratingMatrixDisplayStyleSchema = z.enum([\n \"radio\",\n \"star\",\n \"emoji\",\n \"button\",\n]);\n\n// Constants for rating matrix display styles (explicit literal values for proper type inference)\nexport const RatingMatrixDisplayStyles = {\n RADIO: \"radio\" as const,\n STAR: \"star\" as const,\n EMOJI: \"emoji\" as const,\n BUTTON: \"button\" as const,\n} as const;\n\n// Individual statement (row) for rating matrix questions\nexport const ratingMatrixStatementSchema = z\n .object({\n id: z\n .string()\n .describe(\n \"Unique identifier for this statement (system time milliseconds)\",\n ),\n value: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Internal value / export key for this statement\"),\n label: z\n .string()\n .min(1)\n .max(200)\n .describe(\"Display text shown to users for this statement\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this statement\"),\n })\n .describe(\"Schema for an individual statement (row) in a rating matrix\");\n\n// A single point on a custom rating scale\nexport const ratingMatrixScalePointSchema = z\n .object({\n id: z.string().describe(\"Unique identifier for this scale point\"),\n value: z\n .union([z.number(), z.string()])\n .describe(\n \"Stored response value for this scale point (number or string)\",\n ),\n label: z\n .string()\n .min(1)\n .max(200)\n .describe(\"Display label shown for this scale point\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this scale point\"),\n })\n .describe(\"Schema for a single point on a custom rating scale\");\n\n// Scale configuration \u2013 discriminated on kind\nexport const ratingMatrixScaleSchema = z\n .discriminatedUnion(\"kind\", [\n // Likert: symmetric ordinal scale -2\u2026+2, explicit scale points with labels\n z.object({\n kind: z.literal(\"likert\").describe(\"Symmetric ordinal scale (-2 to +2)\"),\n scalePoints: z\n .array(ratingMatrixScalePointSchema)\n .min(2)\n .max(10)\n .describe(\"Scale points with display labels for each column\"),\n }),\n // Numerical: 1\u2026N points where N is 2, 3, 4, or 5, explicit scale points with labels\n z.object({\n kind: z.literal(\"numerical\").describe(\"Numerical scale from 1 to N\"),\n scalePoints: z\n .array(ratingMatrixScalePointSchema)\n .min(2)\n .max(10)\n .describe(\"Scale points with display labels for each column\"),\n pointCount: z\n .union([z.literal(2), z.literal(3), z.literal(4), z.literal(5)])\n .describe(\"Number of scale points (2, 3, 4, or 5)\"),\n }),\n // Custom: consumer defines each point's value and label\n z.object({\n kind: z\n .literal(\"custom\")\n .describe(\"Custom scale with user-defined points and values\"),\n scalePoints: z\n .array(ratingMatrixScalePointSchema)\n .min(2)\n .max(10)\n .describe(\"Scale points with display labels for each column\"),\n }),\n ])\n .describe(\"Scale configuration for rating matrix questions\");\n\n// Rating matrix question schema\nexport const ratingMatrixQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"rating_matrix\")\n .describe(\"Must be exactly 'rating_matrix'\"),\n statements: z\n .array(ratingMatrixStatementSchema)\n .min(1)\n .max(10)\n .describe(\"Statements (rows) users will rate on the shared scale (1-10)\"),\n scale: ratingMatrixScaleSchema.describe(\n \"Scale configuration shared across all statement rows\",\n ),\n displayStyle: ratingMatrixDisplayStyleSchema\n .optional()\n .describe(\n \"Visual representation of scale points per row (radio buttons, stars, emoji, or buttons)\",\n ),\n randomizeStatements: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of statements\"),\n })\n .describe(\n \"Schema for rating matrix questions with multiple statements on a shared scale\",\n );\n\n// \u2500\u2500\u2500 Matrix Single Choice \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// Shared row schema for matrix choice questions\nexport const matrixRowSchema = z\n .object({\n id: z\n .string()\n .describe(\"Unique identifier for this row (system time milliseconds)\"),\n value: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Internal value / export key for this row\"),\n label: z\n .string()\n .min(1)\n .max(200)\n .describe(\"Display text shown to users for this row\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this row\"),\n })\n .describe(\"Schema for an individual row in a matrix choice question\");\n\n// Slim column schema for matrix choice questions (no imageUrl unlike questionOptionSchema)\nexport const matrixColumnSchema = z\n .object({\n id: z\n .string()\n .describe(\"Unique identifier for this column (system time milliseconds)\"),\n value: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Internal value / export key for this column\"),\n label: z\n .string()\n .min(1)\n .max(200)\n .describe(\"Display label shown for this column\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this column\"),\n })\n .describe(\"Schema for an individual column in a matrix choice question\");\n\n// Matrix single choice question schema (one column selected per row)\nexport const matrixSingleChoiceQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"matrix_single_choice\")\n .describe(\"Must be exactly 'matrix_single_choice'\"),\n rows: z\n .array(matrixRowSchema)\n .min(1)\n .max(20)\n .describe(\"Row items (1-20 rows)\"),\n columns: z\n .array(matrixColumnSchema)\n .min(2)\n .max(10)\n .describe(\"Column options shared across all rows (2-10 columns)\"),\n randomizeRows: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of rows\"),\n randomizeColumns: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of columns\"),\n })\n .describe(\n \"Schema for matrix single-choice questions where one column is selected per row\",\n );\n\n// \u2500\u2500\u2500 Matrix Multiple Choice \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// Matrix multiple choice question schema (one or more columns selected per row)\nexport const matrixMultipleChoiceQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"matrix_multiple_choice\")\n .describe(\"Must be exactly 'matrix_multiple_choice'\"),\n rows: z\n .array(matrixRowSchema)\n .min(1)\n .max(20)\n .describe(\"Row items (1-20 rows)\"),\n columns: z\n .array(matrixColumnSchema)\n .min(2)\n .max(10)\n .describe(\"Column options shared across all rows (2-10 columns)\"),\n minSelectionsPerRow: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of columns a user must select per row\"),\n maxSelectionsPerRow: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Maximum number of columns a user can select per row\"),\n randomizeRows: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of rows\"),\n randomizeColumns: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of columns\"),\n })\n .refine(\n (data) => {\n if (\n data.minSelectionsPerRow !== undefined &&\n data.maxSelectionsPerRow !== undefined\n ) {\n return data.minSelectionsPerRow <= data.maxSelectionsPerRow;\n }\n return true;\n },\n {\n message: \"minSelectionsPerRow cannot be greater than maxSelectionsPerRow\",\n path: [\"minSelectionsPerRow\"],\n },\n )\n .describe(\n \"Schema for matrix multiple-choice questions where one or more columns can be selected per row\",\n );\n\n// Question option schema for choice-based questions\nexport const questionOptionSchema = z\n .object({\n id: z\n .string()\n .describe(\"Unique identifier for this option (system time milliseconds)\"),\n value: z\n .string()\n .min(1)\n .max(100)\n .describe(\"The internal value used for this option\"),\n label: z\n .string()\n .min(1)\n .max(200)\n .describe(\"The display text shown to users for this option\"),\n hint: z\n .string()\n .max(300)\n .optional()\n .describe(\n \"Optional short description shown below the option label to help respondents understand what they are selecting or ranking\",\n ),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\n \"LLM tool call description providing context about this option\",\n ),\n imageUrl: z\n .string()\n .url()\n .optional()\n .describe(\"Optional image URL to display with this option\"),\n })\n .describe(\"Schema for individual options in choice-based questions\");\n\n// Nested option schema for hierarchical choice structures (recursive)\nexport const nestedOptionSchema: z.ZodType<any> = z.lazy(() =>\n z\n .object({\n id: z\n .string()\n .describe(\n \"Unique identifier for this nested option (system time milliseconds)\",\n ),\n value: z\n .string()\n .min(1)\n .max(100)\n .describe(\"The internal value used for this nested option\"),\n label: z\n .string()\n .min(1)\n .max(200)\n .describe(\"The display text shown for this nested option\"),\n describe: z\n .string()\n .max(500)\n .optional()\n .describe(\"LLM tool call description for this nested option context\"),\n imageUrl: z\n .string()\n .url()\n .optional()\n .describe(\"Optional image URL for this nested option\"),\n hint: z\n .string()\n .max(500)\n .optional()\n .describe(\n \"Optional hint text to help users understand this nested option\",\n ),\n children: z\n .array(nestedOptionSchema)\n .optional()\n .default([])\n .describe(\"Array of child options for hierarchical structure\"),\n })\n .describe(\"Schema for nested options with hierarchical structure support\"),\n);\n\n// Multiple choice single question schema (extends base question with choice-specific properties)\nexport const multipleChoiceSingleQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"single_choice\")\n .describe(\"Must be exactly 'single_choice'\"),\n displayStyle: multipleChoiceDisplayStyleSchema\n .optional()\n .describe(\"Visual style for displaying options\"),\n allowOther: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to allow a custom \"other\" option'),\n otherTextConfig: z\n .object({\n minChars: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of characters required for the other text\"),\n maxChars: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Maximum number of characters allowed for the other text\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text for the other text input\"),\n showLimitIndicatorThreshold: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show\",\n ),\n })\n .optional()\n .describe('Configuration for the custom \"other\" text input'),\n randomizeOptions: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of options\"),\n options: z\n .array(questionOptionSchema)\n .min(1)\n .max(50)\n .describe(\"Array of options for user selection (1-50 options)\"),\n })\n .describe(\"Schema for single-choice multiple selection questions\");\n\n// Multiple choice multiple question schema (extends base question with multiple choice properties)\nexport const multipleChoiceMultipleQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"multiple_choice_multiple\")\n .describe(\"Must be exactly 'multiple_choice_multiple'\"),\n displayStyle: multipleChoiceMultipleDisplayStyleSchema\n .optional()\n .describe(\"Visual style for displaying multiple options\"),\n allowOther: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to allow a custom \"other\" option'),\n otherTextConfig: z\n .object({\n minChars: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of characters required for the other text\"),\n maxChars: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Maximum number of characters allowed for the other text\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text for the other text input\"),\n showLimitIndicatorThreshold: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show\",\n ),\n })\n .optional()\n .describe('Configuration for the custom \"other\" text input'),\n minSelections: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of options that must be selected\"),\n maxSelections: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Maximum number of options that can be selected\"),\n randomizeOptions: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to randomize the order of options\"),\n options: z\n .array(questionOptionSchema)\n .min(1)\n .max(50)\n .describe(\"Array of options for user selection (1-50 options)\"),\n })\n .refine(\n (data) => {\n // If both minSelections and maxSelections are provided, minSelections should be <= maxSelections\n if (\n data.minSelections !== undefined &&\n data.maxSelections !== undefined\n ) {\n return data.minSelections <= data.maxSelections;\n }\n return true;\n },\n {\n message: \"minSelections cannot be greater than maxSelections\",\n path: [\"minSelections\"], // Point to minSelections field for the error\n },\n )\n .describe(\n \"Schema for multiple-choice questions allowing multiple selections\",\n );\n\n// NPS question schema (extends base question with NPS-specific properties)\nexport const npsQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"nps\").describe(\"Must be exactly 'nps'\"),\n min: z.literal(0).describe(\"NPS always starts at 0\"),\n max: z.literal(10).describe(\"NPS always ends at 10\"),\n minLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label for the minimum NPS value (0)\"),\n maxLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label for the maximum NPS value (10)\"),\n scaleLabels: z\n .record(z.string().regex(/^\\d+$/), z.string().max(50))\n .optional()\n .describe(\"Custom labels for specific NPS values (0-10)\"),\n prepopulatedValue: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .describe(\"Default value to pre-select (0-10)\"),\n detractorColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Color applied to detractor scores (0\u20136); accepts any valid CSS color value (hex, rgb, hsl, named)\",\n ),\n passiveColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Color applied to passive scores (7\u20138); accepts any valid CSS color value\",\n ),\n promoterColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Color applied to promoter scores (9\u201310); accepts any valid CSS color value\",\n ),\n })\n .refine(\n (data) => {\n // If scaleLabels is provided, validate that all keys are within the 0-10 range\n if (data.scaleLabels) {\n const keys = Object.keys(data.scaleLabels);\n return keys.every((key) => {\n const numKey = Number(key);\n return !isNaN(numKey) && numKey >= 0 && numKey <= 10;\n });\n }\n return true;\n },\n {\n message: \"scaleLabels keys must be between 0 and 10 (inclusive)\",\n path: [\"scaleLabels\"],\n },\n )\n .describe(\"Schema for Net Promoter Score questions with 0-10 scale\");\n\n// Short answer question schema (extends base question with text input properties)\nexport const shortAnswerQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"short_answer\").describe(\"Must be exactly 'short_answer'\"),\n maxCharacters: z\n .number()\n .int()\n .min(1)\n .max(10000)\n .optional()\n .describe(\"Maximum number of characters allowed\"),\n minCharacters: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of characters required\"),\n showLimitIndicatorThreshold: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text shown in the input field\"),\n enableRegexValidation: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to enable regex pattern validation\"),\n regexPattern: z\n .string()\n .optional()\n .describe(\"Regular expression pattern for validation\"),\n enableEnhanceWithAi: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to enable AI enhancement features\"),\n promptTemplate: z\n .string()\n .max(2000)\n .optional()\n .describe(\"Template for AI enhancement prompts\"),\n maxTokenAllowed: z\n .number()\n .int()\n .min(1)\n .max(10000)\n .optional()\n .describe(\"Maximum tokens allowed for AI processing\"),\n minCharactersToEnhance: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Minimum characters needed to trigger AI enhancement\"),\n })\n .refine(\n (data) => {\n // If both minCharacters and maxCharacters are provided, minCharacters should be <= maxCharacters\n if (\n data.minCharacters !== undefined &&\n data.maxCharacters !== undefined\n ) {\n return data.minCharacters <= data.maxCharacters;\n }\n return true;\n },\n {\n message: \"minCharacters cannot be greater than maxCharacters\",\n path: [\"minCharacters\"],\n },\n )\n .refine(\n (data) => {\n // If enableRegexValidation is true, regexPattern should be provided\n if (data.enableRegexValidation && !data.regexPattern) {\n return false;\n }\n return true;\n },\n {\n message: \"regexPattern is required when enableRegexValidation is true\",\n path: [\"regexPattern\"],\n },\n )\n .refine(\n (data) => {\n // If enableEnhanceWithAi is true, promptTemplate should be provided\n if (data.enableEnhanceWithAi && !data.promptTemplate) {\n return false;\n }\n return true;\n },\n {\n message: \"promptTemplate is required when enableEnhanceWithAi is true\",\n path: [\"promptTemplate\"],\n },\n )\n .describe(\"Schema for short answer questions with optional AI enhancement\");\n\n// Long answer question schema (extends base question with rich text input properties)\nexport const longAnswerQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"long_text\").describe(\"Must be exactly 'long_text'\"),\n maxCharacters: z\n .number()\n .int()\n .min(1)\n .max(50000)\n .optional()\n .describe(\n \"Maximum number of characters allowed (higher limit for long text)\",\n ),\n minCharacters: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of characters required\"),\n showLimitIndicatorThreshold: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Show the character limit indicator (e.g. '12/100') once the user has typed this many characters; 0 = show immediately, absent = never show\",\n ),\n rows: z\n .number()\n .int()\n .min(1)\n .max(20)\n .optional()\n .describe(\"Number of textarea rows to display (1-20)\"),\n placeholder: z\n .string()\n .max(500)\n .optional()\n .describe(\"Placeholder text for the textarea (longer for long text)\"),\n enableEnhanceWithAi: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to enable AI enhancement features\"),\n promptTemplate: z\n .string()\n .max(2000)\n .optional()\n .describe(\"Template for AI enhancement prompts\"),\n maxTokenAllowed: z\n .number()\n .int()\n .min(1)\n .max(25000)\n .optional()\n .describe(\n \"Maximum tokens allowed for AI processing (higher for long text)\",\n ),\n minCharactersToEnhance: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Minimum characters needed to trigger AI enhancement\"),\n })\n .refine(\n (data) => {\n // If both minCharacters and maxCharacters are provided, minCharacters should be <= maxCharacters\n if (\n data.minCharacters !== undefined &&\n data.maxCharacters !== undefined\n ) {\n return data.minCharacters <= data.maxCharacters;\n }\n return true;\n },\n {\n message: \"minCharacters cannot be greater than maxCharacters\",\n path: [\"minCharacters\"],\n },\n )\n .refine(\n (data) => {\n // If enableEnhanceWithAi is true, promptTemplate should be provided\n if (data.enableEnhanceWithAi && !data.promptTemplate) {\n return false;\n }\n return true;\n },\n {\n message: \"promptTemplate is required when enableEnhanceWithAi is true\",\n path: [\"promptTemplate\"],\n },\n )\n .describe(\n \"Schema for long answer questions with rich text support and AI enhancement\",\n );\n\n// Nested dropdown question schema (extends base question with hierarchical selection properties)\nexport const nestedDropdownQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"nested_selection\")\n .describe(\"Must be exactly 'nested_selection'\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text for the nested dropdown\"),\n options: z\n .array(nestedOptionSchema)\n .min(1)\n .max(100)\n .describe(\n \"Array of nested options for hierarchical selection (1-100 options)\",\n ),\n displayStyle: z\n .literal(\"list\")\n .describe(\"Fixed display style for nested dropdowns\"),\n choiceOrderOption: choiceOrderOptionSchema\n .optional()\n .default(\"none\")\n .describe(\"How to order the nested choices\"),\n preserveLastChoices: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .describe(\"Number of choice levels to preserve (0-10)\"),\n prepopulatedValue: z\n .string()\n .max(1000)\n .optional()\n .describe(\"Default value to pre-populate\"),\n allowOther: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to allow custom \"other\" options'),\n otherColumnName: z\n .string()\n .max(100)\n .optional()\n .describe('Column name for storing custom \"other\" values'),\n maxDepth: z\n .number()\n .int()\n .min(1)\n .max(10)\n .optional()\n .describe(\"Maximum nesting depth allowed (1-10)\"),\n cascadeLabels: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to cascade labels from parent options\"),\n })\n .refine(\n (data) => {\n // If allowOther is true, otherColumnName should be provided\n if (data.allowOther && !data.otherColumnName) {\n return false;\n }\n return true;\n },\n {\n message: \"otherColumnName is required when allowOther is true\",\n path: [\"otherColumnName\"],\n },\n )\n .describe(\n \"Schema for nested dropdown questions with hierarchical option structure\",\n );\n\n// Export inferred types\nexport type QuestionType = z.infer<typeof questionTypeSchema>;\nexport type QuestionTextAlign = \"left\" | \"center\";\nexport type ValidationRule = z.infer<typeof validationRuleSchema>;\nexport type VisibilityCondition = z.infer<typeof visibilityConditionSchema>;\nexport type QuestionStatus = z.infer<typeof questionStatusSchema>;\nexport type Question = z.infer<typeof questionSchema>;\nexport type RatingDisplayStyle = z.infer<typeof ratingDisplayStyleSchema>;\nexport type RatingRepresentationSize = z.infer<\n typeof ratingRepresentationSizeSchema\n>;\nexport type RatingQuestion = z.infer<typeof ratingQuestionSchema>;\nexport type AnnotationQuestion = z.infer<typeof annotationQuestionSchema>;\nexport type WelcomeQuestion = z.infer<typeof welcomeQuestionSchema>;\nexport type ThankYouQuestion = z.infer<typeof thankYouQuestionSchema>;\nexport type MessagePanelQuestion = z.infer<typeof messagePanelQuestionSchema>;\nexport type ExitFormQuestion = z.infer<typeof exitFormQuestionSchema>;\nexport type YesNoDisplayStyle = z.infer<typeof yesNoDisplayStyleSchema>;\nexport type YesNoQuestion = z.infer<typeof yesNoQuestionSchema>;\nexport type ConsentQuestion = z.infer<typeof consentQuestionSchema>;\nexport type RatingMatrixStatement = z.infer<typeof ratingMatrixStatementSchema>;\nexport type RatingMatrixScalePoint = z.infer<\n typeof ratingMatrixScalePointSchema\n>;\nexport type RatingMatrixScale = z.infer<typeof ratingMatrixScaleSchema>;\nexport type RatingMatrixDisplayStyle = z.infer<\n typeof ratingMatrixDisplayStyleSchema\n>;\nexport type RatingMatrixQuestion = z.infer<typeof ratingMatrixQuestionSchema>;\nexport type MatrixRow = z.infer<typeof matrixRowSchema>;\nexport type MatrixColumn = z.infer<typeof matrixColumnSchema>;\nexport type MatrixSingleChoiceQuestion = z.infer<\n typeof matrixSingleChoiceQuestionSchema\n>;\nexport type MatrixMultipleChoiceQuestion = z.infer<\n typeof matrixMultipleChoiceQuestionSchema\n>;\nexport type QuestionOption = z.infer<typeof questionOptionSchema>;\nexport type NestedOption = z.infer<typeof nestedOptionSchema>;\nexport type MultipleChoiceDisplayStyle = z.infer<\n typeof multipleChoiceDisplayStyleSchema\n>;\nexport type MultipleChoiceSingleQuestion = z.infer<\n typeof multipleChoiceSingleQuestionSchema\n>;\nexport type MultipleChoiceMultipleDisplayStyle = z.infer<\n typeof multipleChoiceMultipleDisplayStyleSchema\n>;\nexport type MultipleChoiceMultipleQuestion = z.infer<\n typeof multipleChoiceMultipleQuestionSchema\n>;\nexport type NpsQuestion = z.infer<typeof npsQuestionSchema>;\nexport type ShortAnswerQuestion = z.infer<typeof shortAnswerQuestionSchema>;\nexport type LongAnswerQuestion = z.infer<typeof longAnswerQuestionSchema>;\nexport type ChoiceOrderOption = z.infer<typeof choiceOrderOptionSchema>;\nexport type NestedDropdownQuestion = z.infer<\n typeof nestedDropdownQuestionSchema\n>;\nexport type DateFormat = z.infer<typeof dateFormatSchema>;\nexport type DateSeparator = z.infer<typeof dateSeparatorSchema>;\nexport type DateQuestion = z.infer<typeof dateQuestionSchema>;\nexport type CsatScale = z.infer<typeof csatScaleSchema>;\nexport type CsatDisplayStyle = z.infer<typeof csatDisplayStyleSchema>;\nexport type CsatQuestion = z.infer<typeof csatQuestionSchema>;\nexport type OpinionScaleQuestion = z.infer<typeof opinionScaleQuestionSchema>;\nexport type RankingDisplayStyle = z.infer<typeof rankingDisplayStyleSchema>;\nexport type RankingQuestion = z.infer<typeof rankingQuestionSchema>;\nexport type PictureChoiceQuestion = z.infer<typeof pictureChoiceQuestionSchema>;\nexport type SignatureMode = z.infer<typeof signatureModeSchema>;\nexport type SignatureQuestion = z.infer<typeof signatureQuestionSchema>;\nexport type FileUploadQuestion = z.infer<typeof fileUploadQuestionSchema>;\nexport type EmailQuestion = z.infer<typeof emailQuestionSchema>;\nexport type NumberQuestion = z.infer<typeof numberQuestionSchema>;\nexport type WebsiteQuestion = z.infer<typeof websiteQuestionSchema>;\nexport type PhoneNumberQuestion = z.infer<typeof phoneNumberQuestionSchema>;\nexport type AddressSubFieldConfig = z.infer<typeof addressSubFieldConfigSchema>;\nexport type AddressQuestion = z.infer<typeof addressQuestionSchema>;\nexport type VideoAudioMode = z.infer<typeof videoAudioModeSchema>;\nexport type VideoAudioQuestion = z.infer<typeof videoAudioQuestionSchema>;\nexport type SchedulerProvider = z.infer<typeof schedulerProviderSchema>;\nexport type SchedulerQuestion = z.infer<typeof schedulerQuestionSchema>;\nexport type QnaWithAiQuestion = z.infer<typeof qnaWithAiQuestionSchema>;\nexport type PaymentsUpiAmountConfig = z.infer<\n typeof paymentsUpiAmountConfigSchema\n>;\nexport type PaymentsUpiQuestion = z.infer<typeof paymentsUpiQuestionSchema>;\nexport type Section = z.infer<typeof sectionSchema>;\n\n// Date format enum \u2014 controls the order of day/month/year segments\nexport const dateFormatSchema = z.enum([\n \"MM/DD/YYYY\",\n \"DD/MM/YYYY\",\n \"YYYY/MM/DD\",\n]);\n\nexport const DateFormats = {\n MM_DD_YYYY: \"MM/DD/YYYY\" as const,\n DD_MM_YYYY: \"DD/MM/YYYY\" as const,\n YYYY_MM_DD: \"YYYY/MM/DD\" as const,\n} as const;\n\n// Date separator enum\nexport const dateSeparatorSchema = z.enum([\"/\", \"-\", \".\"]);\n\nexport const DateSeparators = {\n SLASH: \"/\" as const,\n DASH: \"-\" as const,\n DOT: \".\" as const,\n} as const;\n\n// Date question schema\nexport const dateQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"date\").describe(\"Must be exactly 'date'\"),\n format: dateFormatSchema\n .optional()\n .default(\"DD/MM/YYYY\")\n .describe(\"Order of day, month, and year segments in the input\"),\n separator: dateSeparatorSchema\n .optional()\n .default(\"/\")\n .describe(\"Character used to separate day, month, and year segments\"),\n includeTime: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to also collect a time (HH:MM) alongside the date\"),\n minDate: z\n .string()\n .optional()\n .describe(\n \"Earliest allowed date in ISO 8601 format (YYYY-MM-DD); when absent no lower bound is enforced\",\n ),\n maxDate: z\n .string()\n .optional()\n .describe(\n \"Latest allowed date in ISO 8601 format (YYYY-MM-DD); when absent no upper bound is enforced\",\n ),\n placeholder: z\n .string()\n .max(50)\n .optional()\n .describe(\"Placeholder text shown in the date input\"),\n segmentLabelDD: z\n .string()\n .max(40)\n .optional()\n .describe(\n \"Visible label above the day segment; when absent a locale default is used\",\n ),\n segmentLabelMM: z\n .string()\n .max(40)\n .optional()\n .describe(\"Visible label above the month segment\"),\n segmentLabelYYYY: z\n .string()\n .max(40)\n .optional()\n .describe(\"Visible label above the year segment\"),\n prepopulatedValue: z\n .string()\n .optional()\n .describe(\n \"Default date value in ISO 8601 format (YYYY-MM-DD) to pre-fill the input\",\n ),\n })\n .describe(\n \"Schema for a date question that collects a structured date (and optionally time) from the respondent\",\n );\n\n// CSAT scale enum \u2014 number of scale points\nexport const csatScaleSchema = z.union([\n z.literal(2),\n z.literal(3),\n z.literal(4),\n z.literal(5),\n]);\n\nexport const CsatScales = {\n TWO: 2 as const,\n THREE: 3 as const,\n FOUR: 4 as const,\n FIVE: 5 as const,\n} as const;\n\n// CSAT display style enum\nexport const csatDisplayStyleSchema = z.enum([\"emoji\", \"text\"]);\n\nexport const CsatDisplayStyles = {\n EMOJI: \"emoji\" as const,\n TEXT: \"text\" as const,\n} as const;\n\n// CSAT question schema\n// Response values use industry-standard positive numbering: 1 (lowest/worst) to N (highest/best)\n// where N matches the chosen scale size (2\u20135). CSAT % = responses rated in the top tier / total \u00D7 100.\nexport const csatQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"csat\").describe(\"Must be exactly 'csat'\"),\n scale: csatScaleSchema\n .optional()\n .default(5)\n .describe(\n \"Number of response points (2\u20135); 2 and 4 have no neutral option, default is 5\",\n ),\n displayStyle: csatDisplayStyleSchema\n .optional()\n .default(\"emoji\")\n .describe(\n \"How response options are rendered \u2014 emoji faces (default) or text buttons\",\n ),\n multicolor: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"Whether to apply distinct colors to negative, neutral, and positive segments\",\n ),\n negativeColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Color for negative response options (lower half of scale); any valid CSS color; used when multicolor is true\",\n ),\n neutralColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Color for the neutral midpoint option (odd scales only: scale 3 = value 2, scale 5 = value 3); any valid CSS color; used when multicolor is true\",\n ),\n positiveColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Color for positive response options (upper half of scale); any valid CSS color; used when multicolor is true\",\n ),\n showLabels: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"Whether to render per-point labels below each response option\",\n ),\n scaleLabels: z\n .record(z.string(), z.string().max(100))\n .optional()\n .describe(\n \"Per-point label text keyed by value string ('1'\u2013'5'); keys must match the chosen scale size\",\n ),\n })\n .describe(\n \"Schema for a CSAT (Customer Satisfaction Score) question using an industry-standard 1-to-N positive scale (N = 2\u20135)\",\n );\n\n// Opinion scale question schema \u2014 a numeric button scale (Likert-style), no icons\nexport const opinionScaleQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"opinion_scale\")\n .describe(\"Must be exactly 'opinion_scale'\"),\n startValue: z\n .union([z.literal(0), z.literal(1)])\n .optional()\n .default(0)\n .describe(\"Starting value of the scale \u2014 0 (default) or 1\"),\n steps: z\n .number()\n .int()\n .min(5)\n .max(11)\n .optional()\n .default(11)\n .describe(\n \"Number of points on the scale (5\u201311); default 11 gives a 0\u201310 or 1\u201311 range depending on startValue\",\n ),\n minLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\n \"Optional label anchoring the low end of the scale (e.g. 'Not at all likely')\",\n ),\n maxLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\n \"Optional label anchoring the high end of the scale (e.g. 'Extremely likely')\",\n ),\n })\n .describe(\n \"Schema for an opinion scale question \u2014 a horizontal numeric button scale with configurable range and optional end labels\",\n );\n\n// Ranking display style enum\nexport const rankingDisplayStyleSchema = z.enum([\n \"drag_drop\",\n \"dropdown\",\n \"up_down\",\n]);\n\nexport const RankingDisplayStyles = {\n DRAG_DROP: \"drag_drop\" as const,\n DROPDOWN: \"dropdown\" as const,\n UP_DOWN: \"up_down\" as const,\n} as const;\n\n// Ranking question schema \u2014 respondents order items by preference\nexport const rankingQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"ranking\").describe(\"Must be exactly 'ranking'\"),\n options: z\n .array(questionOptionSchema)\n .min(2)\n .max(30)\n .describe(\n \"List of items to rank (2\u201330 items); each item supports an optional hint for clarification\",\n ),\n randomizeOptions: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"Whether to shuffle item order per respondent to avoid position bias\",\n ),\n displayStyle: rankingDisplayStyleSchema\n .optional()\n .default(\"drag_drop\")\n .describe(\n \"Interaction mode \u2014 drag_drop (default) for drag-and-drop reordering, dropdown for selecting a rank number per item, up_down for arrow button reordering\",\n ),\n maxRank: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\n \"Maximum number of items the respondent must rank (e.g. 3 = 'rank your top 3'); when absent all items must be ranked\",\n ),\n prepopulatedValue: z\n .array(z.string())\n .optional()\n .describe(\n \"Default ranked order as option value strings (index 0 = rank 1)\",\n ),\n })\n .refine(\n (data) => data.maxRank === undefined || data.maxRank <= data.options.length,\n {\n message: \"maxRank cannot exceed the number of options\",\n path: [\"maxRank\"],\n },\n )\n .refine(\n (data) => {\n if (!data.prepopulatedValue?.length) return true;\n const optionValues = new Set(data.options.map((o) => o.value));\n return data.prepopulatedValue.every((v) => optionValues.has(v));\n },\n {\n message: \"Prepopulated value must use valid option values\",\n path: [\"prepopulatedValue\"],\n },\n )\n .refine(\n (data) => {\n if (!data.prepopulatedValue?.length || data.maxRank === undefined) return true;\n return data.prepopulatedValue.length <= data.maxRank;\n },\n {\n message: \"Prepopulated value cannot exceed maxRank\",\n path: [\"prepopulatedValue\"],\n },\n )\n .describe(\n \"Schema for a ranking question where respondents order items by preference\",\n );\n\n// Picture choice question schema \u2014 image-based single or multiple selection\nexport const pictureChoiceQuestionSchema = questionSchema\n .extend({\n type: z\n .literal(\"picture_choice\")\n .describe(\"Must be exactly 'picture_choice'\"),\n options: z\n .array(questionOptionSchema)\n .min(1)\n .max(50)\n .describe(\n \"Array of options; each should include an imageUrl for the picture to display\",\n ),\n multiple: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"When true respondents may select more than one image; when false (default) only one image can be selected\",\n ),\n minSelections: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\n \"Minimum number of images the respondent must select (only applies when multiple is true)\",\n ),\n maxSelections: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\n \"Maximum number of images the respondent may select (only applies when multiple is true)\",\n ),\n supersize: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"Whether to display images at an enlarged size\"),\n showLabels: z\n .boolean()\n .optional()\n .default(true)\n .describe(\"Whether to show the text label below each image\"),\n randomizeOptions: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"Whether to shuffle image order per respondent to avoid position bias\",\n ),\n allowOther: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to include a free-text \"other\" option'),\n otherTextConfig: z\n .object({\n minChars: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Minimum number of characters required for the other text\"),\n maxChars: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Maximum number of characters allowed for the other text\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text for the other text input\"),\n showLimitIndicatorThreshold: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Show the character limit indicator once the user has typed this many characters; 0 = show immediately, absent = never show\",\n ),\n })\n .optional()\n .describe('Configuration for the custom \"other\" text input'),\n })\n .refine(\n (data) => {\n if (\n data.minSelections !== undefined &&\n data.maxSelections !== undefined\n ) {\n return data.minSelections <= data.maxSelections;\n }\n return true;\n },\n {\n message: \"minSelections cannot be greater than maxSelections\",\n path: [\"minSelections\"],\n },\n )\n .describe(\n \"Schema for a picture choice question where respondents select from image-based options\",\n );\n\n// Signature mode enum \u2014 which signing methods the respondent can use\nexport const signatureModeSchema = z.enum([\"type\", \"draw\", \"upload\"]);\n\nexport const SignatureModes = {\n TYPE: \"type\" as const,\n DRAW: \"draw\" as const,\n UPLOAD: \"upload\" as const,\n} as const;\n\n// Signature question schema \u2014 collects a legally-valid electronic signature via type, draw, or upload\nexport const signatureQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"signature\").describe(\"Must be exactly 'signature'\"),\n allowedModes: z\n .array(signatureModeSchema)\n .min(1)\n .optional()\n .describe(\n \"Which signing methods the respondent can choose from (type, draw, upload); when absent all three are enabled\",\n ),\n defaultMode: signatureModeSchema\n .optional()\n .describe(\n \"Which signing tab is pre-selected when the question is first shown; when absent the platform chooses\",\n ),\n collectSignerEmail: z\n .boolean()\n .optional()\n .default(true)\n .describe(\n \"Whether to auto-collect the signer's email so a signed PDF copy can be sent to them; set to false if the form already collects an email via signerEmailFieldId or another question\",\n ),\n signerEmailFieldId: z\n .string()\n .optional()\n .describe(\n \"ID of an existing email question in the form whose value will be used as the signer's email address, instead of auto-appending a new email prompt\",\n ),\n penColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Stroke color for the draw canvas; any valid CSS color; when absent the theme foreground color is used\",\n ),\n penWidth: z\n .number()\n .int()\n .min(1)\n .max(20)\n .optional()\n .describe(\n \"Pen stroke thickness in pixels for the draw canvas (1\u201320); when absent the renderer default (typically 2) is used\",\n ),\n backgroundColor: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Background color of the draw canvas; any valid CSS color; when absent the canvas is transparent and inherits the form background\",\n ),\n canvasHeight: z\n .number()\n .int()\n .min(60)\n .max(600)\n .optional()\n .describe(\n \"Draw canvas height in logical pixels (60\u2013600); width always fills the container; when absent the renderer chooses a sensible default (typically 200)\",\n ),\n clearButtonLabel: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Label for the clear/redo button in draw mode; when absent the platform default label or icon is shown\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Optional shared fallback copy for draw-canvas and upload-zone hints when their dedicated fields are unset\",\n ),\n modeTabLabelType: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom visible label for the Type tab; when absent only the tab icon is shown (use aria-label on the client)\",\n ),\n modeTabLabelDraw: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom visible label for the Draw tab; when absent only the tab icon is shown\",\n ),\n modeTabLabelUpload: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom visible label for the Upload tab; when absent only the tab icon is shown\",\n ),\n drawCanvasHint: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Hint shown on the empty draw canvas (e.g. 'Draw your signature here'); falls back to placeholder then platform default\",\n ),\n uploadZonePrimary: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Main prompt on the upload drop zone when idle (e.g. click to upload); falls back to placeholder then default\",\n ),\n uploadZoneDrag: z\n .string()\n .max(120)\n .optional()\n .describe(\n \"Short prompt when dragging a file over the upload zone; falls back to platform default\",\n ),\n })\n .describe(\n \"Schema for a signature question where respondents can type, draw, or upload their electronic signature\",\n );\n\n// File upload question schema \u2014 lets respondents attach one or more files\nexport const fileUploadQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"file_upload\").describe(\"Must be exactly 'file_upload'\"),\n allowedFileTypes: z\n .array(z.string())\n .min(1)\n .optional()\n .describe(\n \"MIME types and/or file extensions the respondent is allowed to upload (e.g. ['image/jpeg', '.pdf']); when absent all file types are accepted\",\n ),\n maxFileSizeMb: z\n .number()\n .int()\n .min(1)\n .max(100)\n .optional()\n .describe(\n \"Maximum size per uploaded file in megabytes (1\u2013100); when absent the platform enforces its own ceiling\",\n ),\n multiple: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"When true the respondent may upload more than one file in a single question; when false (default) only one file is accepted\",\n ),\n maxFiles: z\n .number()\n .int()\n .min(1)\n .max(20)\n .optional()\n .describe(\n \"Maximum number of files the respondent may upload (1\u201320); only applies when multiple is true; when absent no per-question file count limit is enforced\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Text shown inside the upload dropzone to guide respondents (e.g. 'Drop your CV here or click to browse')\",\n ),\n })\n .describe(\n \"Schema for a file upload question where respondents can attach one or more files from their device\",\n );\n\n// Email question schema \u2014 dedicated email input with built-in format enforcement\nexport const emailQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"email\").describe(\"Must be exactly 'email'\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text shown inside the email input\"),\n prepopulatedValue: z\n .string()\n .optional()\n .describe(\n \"Default email address to pre-fill the input (e.g. passed via URL param or hidden field)\",\n ),\n })\n .describe(\n \"Schema for an email question that only accepts correctly formatted email addresses\",\n );\n\n// Number question schema \u2014 numeric-only input with configurable constraints\nexport const numberQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"number\").describe(\"Must be exactly 'number'\"),\n min: z\n .number()\n .optional()\n .describe(\n \"Minimum allowed value (inclusive); when absent no lower bound is enforced\",\n ),\n max: z\n .number()\n .optional()\n .describe(\n \"Maximum allowed value (inclusive); when absent no upper bound is enforced\",\n ),\n allowDecimal: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"Whether decimal (non-integer) values are accepted; Typeform restricts to whole numbers only, making this a differentiator\",\n ),\n allowNegative: z\n .boolean()\n .optional()\n .default(false)\n .describe(\n \"Whether negative values are accepted; Typeform restricts to positive numbers only, making this a differentiator\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text shown inside the number input\"),\n prepopulatedValue: z\n .number()\n .optional()\n .describe(\"Default numeric value to pre-fill the input\"),\n unit: z\n .string()\n .max(10)\n .optional()\n .describe(\n \"Unit label displayed beside the input (e.g. 'kg', '$', 'years')\",\n ),\n })\n .refine(\n (data) =>\n data.min === undefined || data.max === undefined || data.min <= data.max,\n {\n message: \"min cannot be greater than max\",\n path: [\"min\"],\n },\n )\n .describe(\n \"Schema for a number question that only accepts numeric input with configurable range and format constraints\",\n );\n\n// Website question schema \u2014 URL input with format validation\nexport const websiteQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"website\").describe(\"Must be exactly 'website'\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Placeholder text shown inside the URL input (e.g. 'https://yoursite.com')\",\n ),\n prepopulatedValue: z\n .string()\n .optional()\n .describe(\"Default URL to pre-fill the input\"),\n })\n .describe(\n \"Schema for a website question that collects a URL with built-in format validation\",\n );\n\n// Phone number question schema \u2014 phone input with country code picker\nexport const phoneNumberQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"phone_number\").describe(\"Must be exactly 'phone_number'\"),\n defaultCountryCode: z\n .string()\n .max(2)\n .optional()\n .describe(\n \"ISO 3166-1 alpha-2 country code to pre-select in the country picker (e.g. 'US', 'IN'); when absent the platform uses the device/locale default\",\n ),\n allowCountryChange: z\n .boolean()\n .optional()\n .default(true)\n .describe(\n \"Whether the respondent can change the country code; when false the default country is locked\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text shown inside the phone number input\"),\n prepopulatedValue: z\n .string()\n .optional()\n .describe(\n \"Default phone number to pre-fill the input; E.164 format recommended (e.g. '+14155552671')\",\n ),\n })\n .describe(\n \"Schema for a phone number question with country code picker and country-specific format validation\",\n );\n\n// Address sub-field config schema \u2014 reused for each address field\nexport const addressSubFieldConfigSchema = z\n .object({\n enabled: z\n .boolean()\n .default(true)\n .describe(\"Whether this sub-field is shown in the question\"),\n required: z\n .boolean()\n .default(false)\n .describe(\"Whether the respondent must fill in this sub-field\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Placeholder text for this sub-field input\"),\n label: z\n .string()\n .max(120)\n .optional()\n .describe(\n \"Visible caption above this sub-field; defaults to built-in copy when omitted\",\n ),\n })\n .describe(\"Configuration for an individual address sub-field\");\n\n// Address question schema \u2014 structured multi-field address collection on a single screen\nexport const addressQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"address\").describe(\"Must be exactly 'address'\"),\n addressLine1: addressSubFieldConfigSchema\n .optional()\n .describe(\"Configuration for the primary street address line\"),\n addressLine2: addressSubFieldConfigSchema\n .optional()\n .describe(\n \"Configuration for the secondary address line (apartment, suite, etc.); hidden by default\",\n ),\n city: addressSubFieldConfigSchema\n .optional()\n .describe(\"Configuration for the city/town sub-field\"),\n stateProvince: addressSubFieldConfigSchema\n .optional()\n .describe(\"Configuration for the state, region, or province sub-field\"),\n postalCode: addressSubFieldConfigSchema\n .optional()\n .describe(\"Configuration for the ZIP/postal code sub-field\"),\n country: addressSubFieldConfigSchema\n .optional()\n .describe(\"Configuration for the country sub-field\"),\n defaultCountry: z\n .string()\n .max(2)\n .optional()\n .describe(\n \"ISO 3166-1 alpha-2 country code to pre-select in the country dropdown (e.g. 'US', 'GB')\",\n ),\n prepopulatedValue: AddressAnswerSchema.optional().describe(\n \"Default address values to pre-fill the sub-fields\",\n ),\n })\n .describe(\n \"Schema for an address question that collects a full structured address on a single screen\",\n );\n\n// Video/audio/photo mode enum \u2014 which answer recording modes are available\nexport const videoAudioModeSchema = z.enum([\"video\", \"audio\", \"photo\", \"text\"]);\n\nexport const VideoAudioModes = {\n VIDEO: \"video\" as const,\n AUDIO: \"audio\" as const,\n PHOTO: \"photo\" as const,\n TEXT: \"text\" as const,\n} as const;\n\n// Video, audio, photo, and text question schema \u2014 respondent records or uploads media or types a text answer\nexport const videoAudioQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"video_audio\").describe(\"Must be exactly 'video_audio'\"),\n allowedModes: z\n .array(videoAudioModeSchema)\n .min(1)\n .optional()\n .describe(\n \"Which answer types the respondent can choose from (video, audio, photo, text); when absent all four are enabled\",\n ),\n defaultMode: videoAudioModeSchema\n .optional()\n .describe(\n \"Which mode tab is pre-selected when the question opens; when absent the platform chooses\",\n ),\n maxDurationSeconds: z\n .number()\n .int()\n .min(5)\n .max(600)\n .optional()\n .describe(\n \"Maximum recording length in seconds (5\u2013600); Typeform hardcodes 120s with no config, making this a differentiator; when absent the platform default applies\",\n ),\n maxFileSizeMb: z\n .number()\n .int()\n .min(1)\n .max(500)\n .optional()\n .describe(\n \"Maximum size in megabytes for uploaded pre-recorded files (1\u2013500); when absent the platform ceiling applies\",\n ),\n allowUpload: z\n .boolean()\n .optional()\n .default(true)\n .describe(\n \"Whether the respondent can upload a file in addition to recording or capturing live (video, audio, or photo)\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Instructional text shown to the respondent before they begin recording or capturing\",\n ),\n modeTabLabelVideo: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom tab label for video mode in the respondent UI; when absent defaults to 'Video'\",\n ),\n modeTabLabelAudio: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom tab label for audio mode; when absent defaults to 'Audio'\",\n ),\n modeTabLabelPhoto: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom tab label for photo mode; when absent defaults to 'Photo'\",\n ),\n modeTabLabelText: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Custom tab label for text mode; when absent defaults to 'Text'\",\n ),\n recordButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Label for the Record button in video/audio modes\"),\n uploadMediaButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Label for the upload control in video/audio modes when uploads are allowed\",\n ),\n videoIdleHint: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Hint shown over the video preview when idle; falls back to placeholder then built-in copy\",\n ),\n photoEmptyHint: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Hint in the empty photo preview area; falls back to placeholder then built-in copy\",\n ),\n photoUseCameraButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Label for the Use camera button in photo mode\"),\n photoUploadImageButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Label for the upload image button in photo mode\"),\n })\n .describe(\n \"Schema for a video, audio, and photo question where respondents can record or upload media or enter a text answer\",\n );\n\n// Scheduler provider enum \u2014 which calendar integration to use\nexport const schedulerProviderSchema = z.enum([\"google_calendar\", \"calendly\"]);\n\nexport const SchedulerProviders = {\n GOOGLE_CALENDAR: \"google_calendar\" as const,\n CALENDLY: \"calendly\" as const,\n} as const;\n\n// Scheduler question schema \u2014 respondent books a time slot from a connected calendar\nexport const schedulerQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"scheduler\").describe(\"Must be exactly 'scheduler'\"),\n provider: schedulerProviderSchema\n .optional()\n .describe(\n \"Which calendar integration to use (google_calendar or calendly); when absent the platform uses whatever is connected\",\n ),\n calendarId: z\n .string()\n .optional()\n .describe(\n \"Specific Google Calendar ID or Calendly event-type URL/slug to book from; when absent the default calendar or event type is used\",\n ),\n showIntroScreen: z\n .boolean()\n .optional()\n .default(true)\n .describe(\n \"Whether to show the Calendly event intro screen (account name, event name, duration) before the time picker; only applies when provider is 'calendly'\",\n ),\n autofillNameFieldId: z\n .string()\n .optional()\n .describe(\n \"ID of a prior Short Text or Name question whose answer is pre-filled into the Calendly booking name field; only applies when provider is 'calendly'\",\n ),\n autofillEmailFieldId: z\n .string()\n .optional()\n .describe(\n \"ID of a prior Email question whose answer is pre-filled into the Calendly booking email field; only applies when provider is 'calendly'\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Fallback text for the book-a-meeting button when scheduleMeetingLabel is unset; also used as a secondary fallback in the CTA copy chain\",\n ),\n scheduleMeetingLabel: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Primary label on the book-a-meeting button and modal; when absent uses placeholder then the built-in default (e.g. 'Schedule a meeting')\",\n ),\n })\n .describe(\n \"Schema for a scheduler question where respondents book a time slot directly within the form via Google Calendar or Calendly\",\n );\n\n// Q&A with AI question schema \u2014 respondents ask questions answered by AI from a knowledge base\nexport const qnaWithAiQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"qna_with_ai\").describe(\"Must be exactly 'qna_with_ai'\"),\n knowledgeBase: z\n .string()\n .max(20000)\n .describe(\n \"The knowledge base content the AI draws from when answering respondent questions; Markdown formatting is recommended; up to 20,000 characters\",\n ),\n maxResponseLength: z\n .number()\n .int()\n .min(50)\n .max(2000)\n .optional()\n .describe(\n \"Maximum number of characters per AI-generated response (50\u20132000); Typeform hardcodes 300, making this configurable a differentiator; when absent the platform default (300) applies\",\n ),\n maxQaPairs: z\n .number()\n .int()\n .min(1)\n .max(100)\n .optional()\n .describe(\n \"Maximum number of Q&A exchanges allowed per submission (1\u2013100); Typeform hardcodes 20, making this configurable a differentiator; when absent the platform default (20) applies\",\n ),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Hint text shown in the respondent's question input field (e.g. 'Ask me anything about this event...')\",\n ),\n askButtonLabel: z\n .string()\n .max(50)\n .optional()\n .describe(\n \"Label for the submit/ask button; when absent the platform default (e.g. 'Ask AI') is shown\",\n ),\n emptyStateHint: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Message in the empty chat area (e.g. 'Ask the AI a question to get started.'); when absent uses placeholder then a built-in default\",\n ),\n pairsRemainingTemplate: z\n .string()\n .max(160)\n .optional()\n .describe(\n \"Counter when under the limit; use tokens {remaining} and {max} (e.g. '{remaining} of {max} questions remaining'); when absent the client uses built-in English with pluralization\",\n ),\n pairsLimitReachedTemplate: z\n .string()\n .max(160)\n .optional()\n .describe(\n \"Counter when the exchange limit is reached; use token {max}; when absent the client uses built-in English with pluralization\",\n ),\n })\n .describe(\n \"Schema for a Q&A with AI question where respondents ask questions and receive AI-generated answers drawn from a configurable knowledge base\",\n );\n\n// UPI amount configuration \u2014 controls how the requested INR amount is resolved\nexport const paymentsUpiAmountConfigSchema = z\n .discriminatedUnion(\"mode\", [\n z.object({\n mode: z\n .literal(\"fixed\")\n .describe(\"A fixed amount configured by the form builder\"),\n amount: z.number().positive().describe(\"Fixed amount to request in INR\"),\n }),\n z.object({\n mode: z\n .literal(\"range\")\n .describe(\"Respondent enters an amount within the configured range\"),\n minAmount: z\n .number()\n .positive()\n .describe(\"Minimum allowed amount in INR\"),\n maxAmount: z\n .number()\n .positive()\n .describe(\"Maximum allowed amount in INR\"),\n defaultAmount: z\n .number()\n .positive()\n .optional()\n .describe(\"Optional initial amount shown to the respondent\"),\n }),\n z.object({\n mode: z\n .literal(\"question_mappings\")\n .describe(\"Amount is summed from one or more previous question answers\"),\n sources: z\n .array(\n z.object({\n sourceQuestionId: z\n .string()\n .describe(\n \"ID of the prior question whose answer contributes to the amount\",\n ),\n mappings: z\n .array(\n z.object({\n answerValue: z\n .string()\n .describe(\"Previous question answer value to match\"),\n amount: z\n .number()\n .nonnegative()\n .describe(\n \"Amount to add in INR when this answer is selected\",\n ),\n label: z\n .string()\n .max(120)\n .optional()\n .describe(\"Optional display label for this mapped amount\"),\n }),\n )\n .min(1)\n .describe(\"Answer-to-amount mappings for this source question\"),\n }),\n )\n .min(1)\n .describe(\"Previous question sources that contribute to the amount\"),\n fallbackAmount: z\n .number()\n .nonnegative()\n .optional()\n .describe(\"Optional amount to use when no source mapping matches\"),\n }),\n ])\n .superRefine((data, ctx) => {\n if (data.mode !== \"range\") return;\n if (data.minAmount > data.maxAmount) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"minAmount cannot be greater than maxAmount\",\n path: [\"minAmount\"],\n });\n }\n if (\n data.defaultAmount !== undefined &&\n (data.defaultAmount < data.minAmount ||\n data.defaultAmount > data.maxAmount)\n ) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"defaultAmount must be within minAmount and maxAmount\",\n path: [\"defaultAmount\"],\n });\n }\n })\n .describe(\"Amount configuration for a payments_upi question\");\n\n// Payments UPI question schema \u2014 self-reported UPI payment reference collection\nexport const paymentsUpiQuestionSchema = questionSchema\n .extend({\n type: z.literal(\"payments_upi\").describe(\"Must be exactly 'payments_upi'\"),\n payeeVpa: z\n .string()\n .min(3)\n .max(255)\n .regex(\n /^[\\w.\\-]+@[\\w.\\-]+$/,\n \"payeeVpa must be a valid UPI VPA such as merchant@bank\",\n )\n .describe(\"UPI virtual payment address that receives the payment\"),\n payeeName: z\n .string()\n .max(100)\n .optional()\n .describe(\"Display name for the UPI payee\"),\n amount: paymentsUpiAmountConfigSchema.describe(\n \"How the requested INR amount is determined\",\n ),\n sourceEmailQuestionId: z\n .string()\n .optional()\n .describe(\n \"Optional ID of the email question whose answer is used for form submission receipt emails\",\n ),\n transactionNote: z\n .string()\n .max(80)\n .optional()\n .describe(\n \"Short note included in the UPI intent; the platform may append the Encatch reference\",\n ),\n transactionReferencePrefix: z\n .string()\n .max(24)\n .optional()\n .describe(\"Optional prefix for generated Encatch payment references\"),\n qrLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label shown above the UPI QR code\"),\n openUpiAppLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Label for the mobile UPI intent button\"),\n copyUpiIdLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Label for the copy UPI ID button\"),\n transactionIdLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label for the self-reported transaction ID / UTR input\"),\n transactionIdPlaceholder: z\n .string()\n .max(120)\n .optional()\n .describe(\"Placeholder for the transaction ID / UTR input\"),\n })\n .describe(\n \"Schema for a self-reported UPI payment question that renders a UPI QR/intent link and collects the respondent-entered transaction ID\",\n );\n\n// Combined question schema using discriminated union for proper type safety\nexport const combinedQuestionSchema = z.discriminatedUnion(\"type\", [\n ratingQuestionSchema,\n annotationQuestionSchema,\n welcomeQuestionSchema,\n thankYouQuestionSchema,\n messagePanelQuestionSchema,\n exitFormQuestionSchema,\n yesNoQuestionSchema,\n consentQuestionSchema,\n ratingMatrixQuestionSchema,\n matrixSingleChoiceQuestionSchema,\n matrixMultipleChoiceQuestionSchema,\n multipleChoiceSingleQuestionSchema,\n multipleChoiceMultipleQuestionSchema,\n npsQuestionSchema,\n shortAnswerQuestionSchema,\n longAnswerQuestionSchema,\n nestedDropdownQuestionSchema,\n dateQuestionSchema,\n csatQuestionSchema,\n opinionScaleQuestionSchema,\n rankingQuestionSchema,\n pictureChoiceQuestionSchema,\n signatureQuestionSchema,\n fileUploadQuestionSchema,\n emailQuestionSchema,\n numberQuestionSchema,\n websiteQuestionSchema,\n phoneNumberQuestionSchema,\n addressQuestionSchema,\n videoAudioQuestionSchema,\n schedulerQuestionSchema,\n qnaWithAiQuestionSchema,\n paymentsUpiQuestionSchema,\n]);\n\n// Explicit type definition for better inference\nexport type CombinedQuestion =\n | z.infer<typeof ratingQuestionSchema>\n | z.infer<typeof annotationQuestionSchema>\n | z.infer<typeof welcomeQuestionSchema>\n | z.infer<typeof thankYouQuestionSchema>\n | z.infer<typeof messagePanelQuestionSchema>\n | z.infer<typeof exitFormQuestionSchema>\n | z.infer<typeof yesNoQuestionSchema>\n | z.infer<typeof consentQuestionSchema>\n | z.infer<typeof ratingMatrixQuestionSchema>\n | z.infer<typeof matrixSingleChoiceQuestionSchema>\n | z.infer<typeof matrixMultipleChoiceQuestionSchema>\n | z.infer<typeof multipleChoiceSingleQuestionSchema>\n | z.infer<typeof multipleChoiceMultipleQuestionSchema>\n | z.infer<typeof npsQuestionSchema>\n | z.infer<typeof shortAnswerQuestionSchema>\n | z.infer<typeof longAnswerQuestionSchema>\n | z.infer<typeof nestedDropdownQuestionSchema>\n | z.infer<typeof dateQuestionSchema>\n | z.infer<typeof csatQuestionSchema>\n | z.infer<typeof opinionScaleQuestionSchema>\n | z.infer<typeof rankingQuestionSchema>\n | z.infer<typeof pictureChoiceQuestionSchema>\n | z.infer<typeof signatureQuestionSchema>\n | z.infer<typeof fileUploadQuestionSchema>\n | z.infer<typeof emailQuestionSchema>\n | z.infer<typeof numberQuestionSchema>\n | z.infer<typeof websiteQuestionSchema>\n | z.infer<typeof phoneNumberQuestionSchema>\n | z.infer<typeof addressQuestionSchema>\n | z.infer<typeof videoAudioQuestionSchema>\n | z.infer<typeof schedulerQuestionSchema>\n | z.infer<typeof qnaWithAiQuestionSchema>\n | z.infer<typeof paymentsUpiQuestionSchema>;\n", "import { z } from \"zod\";\nimport { LanguageFieldSchema, LanguagesSchema } from \"./other-screen-schema\";\n\n// Base translation entry - simplified to just string values for the new structure\nexport const translationEntrySchema = z\n .string()\n .min(1)\n .describe(\"Translated text content\");\n\n// Base fields shared by all question translation schemas\nexport const baseQuestionTranslationFieldsSchema = z.object({\n title: translationEntrySchema.describe(\"Question title translation\"),\n description: translationEntrySchema\n .optional()\n .describe(\"Question description translation\"),\n errorMessage: translationEntrySchema\n .optional()\n .describe(\"Error message translation\"),\n nextButtonLabel: translationEntrySchema\n .max(50)\n .optional()\n .describe(\n \"Next button label translation when advancing past this question\",\n ),\n});\n\n// Keys present on every question translation (used in refine allowlists)\nexport const BASE_QUESTION_TRANSLATION_KEYS = [\n \"type\",\n \"title\",\n \"description\",\n \"errorMessage\",\n \"nextButtonLabel\",\n] as const;\n\n// Rating question translation schema with type field\nexport const ratingQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"rating\").describe(\"Question type identifier\"),\n minLabel: translationEntrySchema\n .optional()\n .describe(\"Minimum rating label translation\"),\n maxLabel: translationEntrySchema\n .optional()\n .describe(\"Maximum rating label translation\"),\n })\n .describe(\"Translation schema for rating questions\");\n\n// Single choice question translation schema with type field\nexport const singleChoiceQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"single_choice\").describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Input placeholder translation\"),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) =>\n ![...BASE_QUESTION_TRANSLATION_KEYS, \"placeholder\"].includes(key),\n );\n return additionalKeys.every((key) =>\n /^option\\..+\\.(label|value)$/.test(key),\n );\n },\n {\n message:\n \"Additional keys must follow the pattern 'option.{id}.{label|value}'\",\n },\n )\n .describe(\"Translation schema for single choice questions\");\n\n// Multiple choice question translation schema with type field\nexport const multipleChoiceQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z\n .literal(\"multiple_choice_multiple\")\n .describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Input placeholder translation\"),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) =>\n ![...BASE_QUESTION_TRANSLATION_KEYS, \"placeholder\"].includes(key),\n );\n return additionalKeys.every((key) =>\n /^option\\..+\\.(label|value)$/.test(key),\n );\n },\n {\n message:\n \"Additional keys must follow the pattern 'option.{id}.{label|value}'\",\n },\n )\n .describe(\"Translation schema for multiple choice questions\");\n\n// NPS question translation schema with type field\nexport const npsQuestionTranslationSchema = baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"nps\").describe(\"Question type identifier\"),\n minLabel: translationEntrySchema\n .optional()\n .describe(\"Minimum NPS label (0) translation\"),\n maxLabel: translationEntrySchema\n .optional()\n .describe(\"Maximum NPS label (10) translation\"),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) =>\n ![...BASE_QUESTION_TRANSLATION_KEYS, \"minLabel\", \"maxLabel\"].includes(\n key,\n ),\n );\n return additionalKeys.every((key) => /^scaleLabel\\.\\d+$/.test(key));\n },\n {\n message: \"Additional keys must follow the pattern 'scaleLabel.{number}'\",\n },\n )\n .describe(\"Translation schema for NPS questions\");\n\n// Short answer question translation schema with type field\nexport const shortAnswerQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"short_answer\").describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Input placeholder translation\"),\n })\n .describe(\"Translation schema for short answer questions\");\n\n// Long answer question translation schema with type field\nexport const longAnswerQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"long_text\").describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Textarea placeholder translation\"),\n })\n .describe(\"Translation schema for long answer questions\");\n\n// Video / audio / photo / text question translation schema\nexport const videoAudioQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"video_audio\").describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Placeholder for text/photo hints\"),\n modeTabLabelVideo: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated tab label for video mode\"),\n modeTabLabelAudio: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated tab label for audio mode\"),\n modeTabLabelPhoto: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated tab label for photo mode\"),\n modeTabLabelText: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated tab label for text mode\"),\n recordButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated Record button label\"),\n uploadMediaButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated upload button (video/audio)\"),\n videoIdleHint: z\n .string()\n .max(200)\n .optional()\n .describe(\"Translated video idle overlay hint\"),\n photoEmptyHint: z\n .string()\n .max(200)\n .optional()\n .describe(\"Translated empty photo area hint\"),\n photoUseCameraButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated Use camera button\"),\n photoUploadImageButtonLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated Upload image button\"),\n })\n .describe(\"Translation schema for video/audio/photo/text questions\");\n\n// Date question translation schema\nexport const dateQuestionTranslationSchema = baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"date\").describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Placeholder for the date field\"),\n segmentLabelDD: z\n .string()\n .max(40)\n .optional()\n .describe(\"Label above the day digits\"),\n segmentLabelMM: z\n .string()\n .max(40)\n .optional()\n .describe(\"Label above the month digits\"),\n segmentLabelYYYY: z\n .string()\n .max(40)\n .optional()\n .describe(\"Label above the year digits\"),\n })\n .describe(\"Translation schema for date questions\");\n\n// Signature question translation schema\nexport const signatureQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"signature\").describe(\"Question type identifier\"),\n clearButtonLabel: z\n .string()\n .max(50)\n .optional()\n .describe(\"Translated clear button in draw mode\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Shared fallback for draw/upload hints\"),\n modeTabLabelType: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated Type tab label\"),\n modeTabLabelDraw: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated Draw tab label\"),\n modeTabLabelUpload: z\n .string()\n .max(80)\n .optional()\n .describe(\"Translated Upload tab label\"),\n drawCanvasHint: z\n .string()\n .max(200)\n .optional()\n .describe(\"Translated empty-canvas hint\"),\n uploadZonePrimary: z\n .string()\n .max(200)\n .optional()\n .describe(\"Translated idle upload prompt\"),\n uploadZoneDrag: z\n .string()\n .max(120)\n .optional()\n .describe(\"Translated drag-over upload prompt\"),\n })\n .describe(\"Translation schema for signature questions\");\n\n// Scheduler question translation schema\nexport const schedulerQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"scheduler\").describe(\"Question type identifier\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\n \"Fallback for meeting CTA when scheduleMeetingLabel is unset\",\n ),\n scheduleMeetingLabel: z\n .string()\n .max(200)\n .optional()\n .describe(\"Book-a-meeting button and modal label\"),\n })\n .describe(\"Translation schema for scheduler questions\");\n\n// Q&A with AI question translation schema\nexport const qnaWithAiQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"qna_with_ai\").describe(\"Question type identifier\"),\n placeholder: z\n .string()\n .max(200)\n .optional()\n .describe(\"Input placeholder for the question field\"),\n askButtonLabel: z\n .string()\n .max(50)\n .optional()\n .describe(\"Ask / submit control label\"),\n emptyStateHint: z\n .string()\n .max(200)\n .optional()\n .describe(\"Empty chat area hint\"),\n pairsRemainingTemplate: z\n .string()\n .max(160)\n .optional()\n .describe(\"Under-limit counter; tokens {remaining} and {max}\"),\n pairsLimitReachedTemplate: z\n .string()\n .max(160)\n .optional()\n .describe(\"At-limit message; token {max}\"),\n })\n .describe(\"Translation schema for Q&A with AI questions\");\n\n// Payments UPI question translation schema\nexport const paymentsUpiQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"payments_upi\").describe(\"Question type identifier\"),\n qrLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label shown above the UPI QR code\"),\n openUpiAppLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"UPI intent button label\"),\n copyUpiIdLabel: z\n .string()\n .max(80)\n .optional()\n .describe(\"Copy UPI ID button label\"),\n transactionIdLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Transaction ID / UTR input label\"),\n transactionIdPlaceholder: z\n .string()\n .max(120)\n .optional()\n .describe(\"Transaction ID / UTR input placeholder\"),\n })\n .describe(\"Translation schema for payments_upi questions\");\n\n// Nested selection question translation schema with type field\nexport const nestedSelectionQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"nested_selection\").describe(\"Question type identifier\"),\n placeholder: translationEntrySchema\n .optional()\n .describe(\"Dropdown placeholder translation\"),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) =>\n ![...BASE_QUESTION_TRANSLATION_KEYS, \"placeholder\"].includes(key),\n );\n return additionalKeys.every((key) =>\n /^nestedOption\\..+\\.(label|hint)$/.test(key),\n );\n },\n {\n message:\n \"Additional keys must follow the pattern 'nestedOption.{id}.{label|hint}'\",\n },\n )\n .describe(\"Translation schema for nested selection questions\");\n\n// Annotation question translation schema with type field\nexport const annotationQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"annotation\").describe(\"Question type identifier\"),\n annotationText: translationEntrySchema\n .optional()\n .describe(\"Annotation display text translation\"),\n noAnnotationText: translationEntrySchema\n .optional()\n .describe(\"No annotation display text translation\"),\n })\n .describe(\"Translation schema for annotation questions\");\n\n// Welcome question translation schema with type field\nexport const welcomeQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"welcome\").describe(\"Question type identifier\"),\n })\n .describe(\"Translation schema for welcome screen questions\");\n\n// Thank you question translation schema with type field\nexport const thankYouQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"thank_you\").describe(\"Question type identifier\"),\n completionCta: z\n .object({\n label: translationEntrySchema\n .optional()\n .describe(\"Translated label for the primary CTA button\"),\n secondary: z\n .object({\n label: translationEntrySchema\n .optional()\n .describe(\"Translated label for the secondary CTA button\"),\n })\n .optional()\n .describe(\"Translated labels for the secondary CTA button\"),\n })\n .optional()\n .describe(\n \"Translations for completionCta button labels; only label fields are translatable \u2014 platform action configs (url, route, action) are locale-agnostic\",\n ),\n })\n .describe(\"Translation schema for thank you screen questions\");\n\n// Message panel question translation schema with type field (same shape as welcome)\nexport const messagePanelQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"message_panel\").describe(\"Question type identifier\"),\n })\n .describe(\"Translation schema for message panel questions\");\n\n// Consent question translation schema with type field\nexport const consentQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"consent\").describe(\"Question type identifier\"),\n })\n .describe(\n \"Translation schema for consent questions; description carries the translated checkbox label (markdown supported)\",\n );\n\n// Yes/no question translation schema with type field\nexport const yesNoQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"yes_no\").describe(\"Question type identifier\"),\n yesLabel: translationEntrySchema\n .optional()\n .describe(\"Translated Yes label\"),\n noLabel: translationEntrySchema\n .optional()\n .describe(\"Translated No label\"),\n })\n .describe(\"Translation schema for yes/no questions\");\n\n// Rating matrix question translation schema with type field\nexport const ratingMatrixQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z.literal(\"rating_matrix\").describe(\"Question type identifier\"),\n minLabel: translationEntrySchema\n .optional()\n .describe(\n \"Translated scale minimum end label (for likert and numerical kinds)\",\n ),\n maxLabel: translationEntrySchema\n .optional()\n .describe(\n \"Translated scale maximum end label (for likert and numerical kinds)\",\n ),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) =>\n ![\n ...BASE_QUESTION_TRANSLATION_KEYS,\n \"minLabel\",\n \"maxLabel\",\n ].includes(key as any),\n );\n return additionalKeys.every(\n (key) =>\n /^statement\\..+\\.label$/.test(key) ||\n /^scalePoint\\..+\\.label$/.test(key),\n );\n },\n {\n message:\n \"Additional keys must follow 'statement.{id}.label' or 'scalePoint.{id}.label'\",\n },\n )\n .describe(\"Translation schema for rating matrix questions\");\n\n// Matrix single-choice question translation schema with type field\nexport const matrixSingleChoiceQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z\n .literal(\"matrix_single_choice\")\n .describe(\"Question type identifier\"),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) => !BASE_QUESTION_TRANSLATION_KEYS.includes(key as any),\n );\n return additionalKeys.every(\n (key) =>\n /^row\\..+\\.label$/.test(key) || /^column\\..+\\.label$/.test(key),\n );\n },\n {\n message:\n \"Additional keys must follow 'row.{id}.label' or 'column.{id}.label'\",\n },\n )\n .describe(\"Translation schema for matrix single-choice questions\");\n\n// Matrix multiple-choice question translation schema with type field\nexport const matrixMultipleChoiceQuestionTranslationSchema =\n baseQuestionTranslationFieldsSchema\n .extend({\n type: z\n .literal(\"matrix_multiple_choice\")\n .describe(\"Question type identifier\"),\n })\n .catchall(translationEntrySchema)\n .refine(\n (data) => {\n const additionalKeys = Object.keys(data).filter(\n (key) => !BASE_QUESTION_TRANSLATION_KEYS.includes(key as any),\n );\n return additionalKeys.every(\n (key) =>\n /^row\\..+\\.label$/.test(key) || /^column\\..+\\.label$/.test(key),\n );\n },\n {\n message:\n \"Additional keys must follow 'row.{id}.label' or 'column.{id}.label'\",\n },\n )\n .describe(\"Translation schema for matrix multiple-choice questions\");\n\n// Union of all question translation types\nexport const questionTranslationSchema = z\n .union([\n ratingQuestionTranslationSchema,\n singleChoiceQuestionTranslationSchema,\n multipleChoiceQuestionTranslationSchema,\n npsQuestionTranslationSchema,\n shortAnswerQuestionTranslationSchema,\n longAnswerQuestionTranslationSchema,\n videoAudioQuestionTranslationSchema,\n dateQuestionTranslationSchema,\n signatureQuestionTranslationSchema,\n schedulerQuestionTranslationSchema,\n qnaWithAiQuestionTranslationSchema,\n paymentsUpiQuestionTranslationSchema,\n nestedSelectionQuestionTranslationSchema,\n annotationQuestionTranslationSchema,\n welcomeQuestionTranslationSchema,\n thankYouQuestionTranslationSchema,\n messagePanelQuestionTranslationSchema,\n yesNoQuestionTranslationSchema,\n consentQuestionTranslationSchema,\n ratingMatrixQuestionTranslationSchema,\n matrixSingleChoiceQuestionTranslationSchema,\n matrixMultipleChoiceQuestionTranslationSchema,\n ])\n .describe(\"Union of all question type translation schemas\");\n\n// Language code schema for validation\nexport const languageCodeSchema = z\n .string()\n .min(2)\n .max(10)\n .describe(\"Language code (e.g., 'en', 'es', 'hi')\");\n\n// Section translation schema (one object per language, same pattern as question translations)\nexport const sectionTranslationSchema = z\n .object({\n title: translationEntrySchema\n .max(200)\n .describe(\"Section title translation\"),\n description: translationEntrySchema\n .max(1000)\n .optional()\n .describe(\"Section description translation\"),\n nextButtonLabel: translationEntrySchema\n .max(50)\n .optional()\n .describe(\"Next button label translation for this section\"),\n })\n .describe(\"Translation payload for a section in a single language\");\n\n// Section translations keyed by language code\nexport const sectionTranslationsByLanguageSchema = z\n .record(languageCodeSchema, sectionTranslationSchema)\n .describe(\"Section translations keyed by language code\");\n\n// Question translations keyed by language code\nexport const questionTranslationsByLanguageSchema = z\n .record(languageCodeSchema, questionTranslationSchema)\n .describe(\"Question translations keyed by language code\");\n\n// Main question-centric translation schema\nexport const questionCentricTranslationsSchema = z\n .record(z.string().uuid(), questionTranslationsByLanguageSchema)\n .describe(\n \"Question-centric translations keyed by question ID, then by language code\",\n );\n\n// Complete translation schema - questions directly at root level\nexport const translationsSchema = questionCentricTranslationsSchema.describe(\n \"Question-centric translations at root level\",\n);\n\n// Type exports\nexport type TranslationEntry = z.infer<typeof translationEntrySchema>;\nexport type RatingQuestionTranslation = z.infer<\n typeof ratingQuestionTranslationSchema\n>;\nexport type SingleChoiceQuestionTranslation = z.infer<\n typeof singleChoiceQuestionTranslationSchema\n>;\nexport type MultipleChoiceQuestionTranslation = z.infer<\n typeof multipleChoiceQuestionTranslationSchema\n>;\nexport type NpsQuestionTranslation = z.infer<\n typeof npsQuestionTranslationSchema\n>;\nexport type ShortAnswerQuestionTranslation = z.infer<\n typeof shortAnswerQuestionTranslationSchema\n>;\nexport type LongAnswerQuestionTranslation = z.infer<\n typeof longAnswerQuestionTranslationSchema\n>;\nexport type VideoAudioQuestionTranslation = z.infer<\n typeof videoAudioQuestionTranslationSchema\n>;\nexport type DateQuestionTranslation = z.infer<\n typeof dateQuestionTranslationSchema\n>;\nexport type SignatureQuestionTranslation = z.infer<\n typeof signatureQuestionTranslationSchema\n>;\nexport type SchedulerQuestionTranslation = z.infer<\n typeof schedulerQuestionTranslationSchema\n>;\nexport type QnaWithAiQuestionTranslation = z.infer<\n typeof qnaWithAiQuestionTranslationSchema\n>;\nexport type PaymentsUpiQuestionTranslation = z.infer<\n typeof paymentsUpiQuestionTranslationSchema\n>;\nexport type NestedSelectionQuestionTranslation = z.infer<\n typeof nestedSelectionQuestionTranslationSchema\n>;\nexport type AnnotationQuestionTranslation = z.infer<\n typeof annotationQuestionTranslationSchema\n>;\nexport type WelcomeQuestionTranslation = z.infer<\n typeof welcomeQuestionTranslationSchema\n>;\nexport type ThankYouQuestionTranslation = z.infer<\n typeof thankYouQuestionTranslationSchema\n>;\nexport type MessagePanelQuestionTranslation = z.infer<\n typeof messagePanelQuestionTranslationSchema\n>;\nexport type YesNoQuestionTranslation = z.infer<\n typeof yesNoQuestionTranslationSchema\n>;\nexport type ConsentQuestionTranslation = z.infer<\n typeof consentQuestionTranslationSchema\n>;\nexport type RatingMatrixQuestionTranslation = z.infer<\n typeof ratingMatrixQuestionTranslationSchema\n>;\nexport type MatrixSingleChoiceQuestionTranslation = z.infer<\n typeof matrixSingleChoiceQuestionTranslationSchema\n>;\nexport type MatrixMultipleChoiceQuestionTranslation = z.infer<\n typeof matrixMultipleChoiceQuestionTranslationSchema\n>;\n\n// Union type for all question translations\nexport type QuestionTranslation = z.infer<typeof questionTranslationSchema>;\n\nexport type SectionTranslation = z.infer<typeof sectionTranslationSchema>;\nexport type SectionTranslationsByLanguage = z.infer<\n typeof sectionTranslationsByLanguageSchema\n>;\n\n// Schema types\nexport type LanguageCode = z.infer<typeof languageCodeSchema>;\nexport type QuestionTranslationsByLanguage = z.infer<\n typeof questionTranslationsByLanguageSchema\n>;\nexport type QuestionCentricTranslations = z.infer<\n typeof questionCentricTranslationsSchema\n>;\nexport type Translations = z.infer<typeof translationsSchema>;\n\n// Translation helper class\nexport class TranslationProvider {\n private translations: Translations;\n private defaultLanguage: string;\n\n constructor(translations: Translations, defaultLanguage: string = \"en\") {\n this.translations = translations;\n this.defaultLanguage = defaultLanguage;\n }\n\n /**\n * Get translations for a specific question in a specific language\n */\n getQuestionTranslations(\n questionId: string,\n languageCode: string,\n ): QuestionTranslation | null {\n const questionTranslations = this.translations[questionId];\n if (!questionTranslations) return null;\n\n // Try to get the requested language\n let translation = questionTranslations[languageCode];\n\n // Fallback to default language if requested language not found\n if (!translation) {\n translation = questionTranslations[this.defaultLanguage];\n }\n\n return translation || null;\n }\n\n /**\n * Get a specific translation text by field path\n */\n getTranslationText(\n questionId: string,\n languageCode: string,\n fieldPath: string,\n ): string | null {\n const questionTranslation = this.getQuestionTranslations(\n questionId,\n languageCode,\n );\n if (!questionTranslation) return null;\n\n // Direct field access (e.g., \"title\", \"errorMessage\")\n if (fieldPath in questionTranslation) {\n const value =\n questionTranslation[fieldPath as keyof typeof questionTranslation];\n return typeof value === \"string\" ? value : null;\n }\n\n return null;\n }\n\n /**\n * Get all available languages for a specific question\n */\n getQuestionLanguages(questionId: string): string[] {\n const questionTranslations = this.translations[questionId];\n if (!questionTranslations) return [];\n\n return Object.keys(questionTranslations);\n }\n\n /**\n * Get all available languages across all questions\n */\n getAvailableLanguages(): string[] {\n const allLanguages = new Set<string>();\n\n Object.values(this.translations).forEach((questionTranslations) => {\n Object.keys(questionTranslations).forEach((langCode) => {\n allLanguages.add(langCode);\n });\n });\n\n return Array.from(allLanguages);\n }\n\n /**\n * Check if a language is supported for a specific question\n */\n isLanguageSupportedForQuestion(\n questionId: string,\n languageCode: string,\n ): boolean {\n const questionTranslations = this.translations[questionId];\n if (!questionTranslations) return false;\n\n return languageCode in questionTranslations;\n }\n\n /**\n * Check if a language is supported across all questions\n */\n isLanguageSupported(languageCode: string): boolean {\n return this.getAvailableLanguages().includes(languageCode);\n }\n\n /**\n * Get the default language\n */\n getDefaultLanguage(): string {\n return this.defaultLanguage;\n }\n\n /**\n * Get all questions that have translations\n */\n getQuestionIds(): string[] {\n return Object.keys(this.translations);\n }\n\n /**\n * Get question type for a specific question\n */\n getQuestionType(questionId: string, languageCode?: string): string | null {\n const langCode = languageCode || this.defaultLanguage;\n const translation = this.getQuestionTranslations(questionId, langCode);\n\n return translation?.type || null;\n }\n}\n\n// Factory function to create translation provider\nexport function createTranslationProvider(\n translations: Translations,\n defaultLanguage: string = \"en\",\n): TranslationProvider {\n return new TranslationProvider(translations, defaultLanguage);\n}\n", "import { z } from \"zod\";\n\n// \u2500\u2500\u2500 Platform action discriminated union \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const platformCompletionCtaSchema = z\n .discriminatedUnion(\"action\", [\n z\n .object({ action: z.literal(\"dismiss\") })\n .describe(\"Close/dismiss the form \u2014 fires form:complete then closes the embed\"),\n z\n .object({\n action: z.literal(\"app_navigate\"),\n route: z\n .string()\n .min(1)\n .max(500)\n .describe(\n \"App-specific route string passed to the host via form:ctaTriggered; the host is responsible for navigation\",\n ),\n })\n .describe(\n \"Delegate navigation to the host app via form:ctaTriggered event with the route string; web engine does not navigate\",\n ),\n z\n .object({\n action: z.literal(\"redirect_internal\"),\n url: z\n .string()\n .min(1)\n .max(2000)\n .describe(\n \"Target URL; on web opens in the same tab (_self); on native opens in an in-app browser (SFSafariView / Custom Tab)\",\n ),\n })\n .describe(\n \"Redirect within the current context \u2014 same tab on web, in-app browser on native\",\n ),\n z\n .object({\n action: z.literal(\"redirect_external\"),\n url: z\n .string()\n .min(1)\n .max(2000)\n .describe(\n \"Target URL; on web opens in a new tab (_blank); on native opens the system/external browser\",\n ),\n })\n .describe(\n \"Redirect to an external context \u2014 new tab on web, system browser on native\",\n ),\n ])\n .describe(\n \"Per-surface CTA action; discriminated on 'action' field \u2014 each variant carries only the fields relevant to its action\",\n );\n\n// \u2500\u2500\u2500 Secondary button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const completionCtaSecondarySchema = z\n .object({\n label: z\n .string()\n .min(1)\n .max(100)\n .describe(\n \"Label for the secondary button (e.g. 'Close form', 'Learn more')\",\n ),\n inApp: platformCompletionCtaSchema\n .optional()\n .describe(\n \"Secondary button action when the form runs inside a host app; when this surface block is absent the engine defaults to dismiss (backward compatible with label-only secondary configs)\",\n ),\n link: platformCompletionCtaSchema\n .optional()\n .describe(\n \"Secondary button action when the form runs as a shareable link; when this surface block is absent the engine defaults to dismiss (backward compatible with label-only secondary configs)\",\n ),\n })\n .describe(\n \"Optional secondary button on thank_you screens; supports the same per-surface actions as the primary CTA (dismiss, app_navigate, redirect_internal, redirect_external); label-only configs default to dismiss on each surface\",\n );\n\n// \u2500\u2500\u2500 Root completionCta object \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const completionCtaSchema = z\n .object({\n label: z\n .string()\n .min(1)\n .max(100)\n .optional()\n .describe(\n \"Label for the primary CTA button; falls back to nextButtonLabel \u2192 section nextButtonLabel \u2192 'Done' when absent\",\n ),\n autoTriggerDelayMs: z\n .number()\n .int()\n .min(0)\n .max(30000)\n .optional()\n .describe(\n \"When set, automatically fires the primary action after this many milliseconds; fires for all actions including dismiss (e.g. set to 0 for immediate silent redirect, 3000 for auto-close after 3 s); when absent the action is manual only; on the link surface, auto-fired redirect_external opens in the same tab because browsers block delayed new-tab popups\",\n ),\n inApp: platformCompletionCtaSchema\n .optional()\n .describe(\n \"CTA action used when the form is rendered inside a host app \u2014 native WebView, web-sdk iframe, React Native / Flutter SDK bridge pages\",\n ),\n link: platformCompletionCtaSchema\n .optional()\n .describe(\n \"CTA action used when the form is rendered as a standalone shareable URL (browser tab or full-page embed)\",\n ),\n secondary: completionCtaSecondarySchema\n .optional()\n .describe(\n \"Optional secondary button on thank_you screens with its own per-surface action routing (inApp / link); label-only configs default to dismiss; not used on exit_form (no UI)\",\n ),\n })\n .describe(\n \"Optional completion CTA configuration for thank_you and exit_form questions; controls what happens after form submission \u2014 redirect, in-app navigation, or dismiss \u2014 with separate settings per rendering surface (inApp / link)\",\n );\n\n// \u2500\u2500\u2500 Type exports \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type PlatformCompletionCta = z.infer<typeof platformCompletionCtaSchema>;\nexport type CompletionCtaSecondary = z.infer<typeof completionCtaSecondarySchema>;\nexport type CompletionCta = z.infer<typeof completionCtaSchema>;\nexport type CompletionCtaAction = PlatformCompletionCta[\"action\"];\n", "import { z } from \"zod\";\n\n// Annotation marker schema\nexport const AnnotationMarkerSchema = z.object({\n markerNo: z.string(),\n timeline: z.string(),\n comment: z.string(),\n});\n\n// Annotation schema\nexport const AnnotationSchema = z.object({\n fileType: z.string(),\n fileName: z.string(),\n markers: z.array(AnnotationMarkerSchema),\n});\n\n// Signature answer schema \u2014 records which mode was used and the resulting artifact\nexport const SignatureAnswerSchema = z\n .object({\n mode: z\n .enum([\"type\", \"draw\", \"upload\"])\n .describe(\"The signing method the respondent used\"),\n fileUrl: z\n .string()\n .optional()\n .describe(\n \"Secure URL to the signature artifact for draw and upload modes\",\n ),\n typedName: z\n .string()\n .optional()\n .describe(\"The name the respondent typed for type mode\"),\n })\n .describe(\"Answer for a signature question\");\n\n// Single uploaded file entry\nexport const FileUploadAnswerItemSchema = z\n .object({\n fileUrl: z.string().describe(\"Secure URL to the uploaded file\"),\n fileName: z\n .string()\n .describe(\"Original filename as provided by the respondent\"),\n fileSizeMb: z.number().describe(\"File size in megabytes\"),\n mimeType: z\n .string()\n .optional()\n .describe(\n \"MIME type of the uploaded file (e.g. 'application/pdf', 'image/jpeg')\",\n ),\n })\n .describe(\"Metadata for a single uploaded file\");\n\n// File upload answer schema \u2014 array to support multiple: true\nexport const FileUploadAnswerSchema = z\n .array(FileUploadAnswerItemSchema)\n .describe(\n \"Answer for a file upload question; array supports single and multiple file uploads\",\n );\n\n// Phone number answer schema \u2014 structured to separate country code from local number\nexport const PhoneNumberAnswerSchema = z\n .object({\n countryCode: z\n .string()\n .describe(\n \"Dialing country code including the + prefix (e.g. '+1', '+91')\",\n ),\n number: z.string().describe(\"Local phone number without the country code\"),\n e164: z\n .string()\n .optional()\n .describe(\"Full phone number in E.164 format (e.g. '+14155552671')\"),\n })\n .describe(\"Answer for a phone number question\");\n\n// Address answer schema \u2014 mirrors the address question sub-fields\nexport const AddressAnswerSchema = z\n .object({\n addressLine1: z.string().optional().describe(\"Primary street address line\"),\n addressLine2: z\n .string()\n .optional()\n .describe(\"Secondary address line (apartment, suite, etc.)\"),\n city: z.string().optional().describe(\"City or town\"),\n stateProvince: z.string().optional().describe(\"State, region, or province\"),\n postalCode: z.string().optional().describe(\"ZIP or postal code\"),\n country: z\n .string()\n .optional()\n .describe(\"Country name or ISO 3166-1 alpha-2 code\"),\n })\n .describe(\"Answer for an address question\");\n\n// Video, audio, photo, and text answer schema\nexport const VideoAudioAnswerSchema = z\n .object({\n mode: z\n .enum([\"video\", \"audio\", \"photo\", \"text\"])\n .describe(\"The answer mode the respondent chose\"),\n fileUrl: z\n .string()\n .optional()\n .describe(\n \"Secure URL or temporary data URL to the recorded, captured, or uploaded video, audio, or image file\",\n ),\n text: z.string().optional().describe(\"Written answer for text mode\"),\n durationSeconds: z\n .number()\n .optional()\n .describe(\n \"Actual recording length in seconds for video and audio modes (not used for photo)\",\n ),\n transcriptText: z\n .string()\n .optional()\n .describe(\"Auto-generated transcript for video and audio recordings\"),\n })\n .describe(\"Answer for a video and audio question\");\n\n// Single Q&A pair \u2014 one respondent question and the AI-generated answer\nexport const QnaWithAiPairSchema = z\n .object({\n question: z.string().describe(\"The question the respondent asked\"),\n answer: z\n .string()\n .describe(\"The AI-generated answer based on the knowledge base\"),\n })\n .describe(\"A single Q&A exchange between the respondent and the AI\");\n\n// Q&A with AI answer schema \u2014 ordered transcript of all exchanges\nexport const QnaWithAiAnswerSchema = z\n .array(QnaWithAiPairSchema)\n .describe(\n \"Answer for a qna_with_ai question; ordered transcript of Q&A pairs from the session\",\n );\n\n// Scheduler answer schema \u2014 booking confirmation details\nexport const SchedulerAnswerSchema = z\n .discriminatedUnion(\"provider\", [\n z.object({\n provider: z\n .literal(\"google_calendar\")\n .describe(\"The calendar integration used to make the booking\"),\n bookedAt: z\n .string()\n .describe(\n \"Unix timestamp in seconds as a string when the respondent confirmed the booking\",\n ),\n }),\n z.object({\n provider: z\n .literal(\"calendly\")\n .describe(\"The calendar integration used to make the booking\"),\n slotStart: z\n .string()\n .describe(\n \"ISO 8601 datetime of the booked slot start (e.g. '2026-05-15T14:00:00Z')\",\n ),\n slotEnd: z\n .string()\n .describe(\n \"ISO 8601 datetime of the booked slot end (e.g. '2026-05-15T14:30:00Z')\",\n ),\n eventId: z.string().optional().describe(\"Calendly event UUID\"),\n bookedAt: z\n .string()\n .describe(\n \"Unix timestamp in seconds as a string when the respondent completed the booking\",\n ),\n }),\n ])\n .describe(\"Answer for a scheduler question\");\n\n// Payments UPI answer schema \u2014 self-reported payment reference plus immutable payment snapshot\nexport const PaymentsUpiAnswerSchema = z\n .object({\n transactionId: z\n .string()\n .describe(\n \"Respondent-entered UPI transaction ID / UTR; self-reported and not verified by Encatch\",\n ),\n encatchPaymentReference: z\n .string()\n .describe(\n \"Opaque Encatch-generated reconciliation reference included in the UPI intent\",\n ),\n amount: z\n .string()\n .trim()\n .refine((s) => {\n const n = Number(s);\n return Number.isFinite(n) && n > 0;\n }, { message: \"Amount must be a positive numeric value\" })\n .describe(\n \"INR amount shown to the respondent when the payment instruction was generated, as a decimal string (legacy numeric values are accepted when parsing)\",\n ),\n currency: z.literal(\"INR\").describe(\"Currency for UPI payments\"),\n payeeVpa: z.string().describe(\"UPI VPA shown to the respondent\"),\n payeeName: z\n .string()\n .optional()\n .describe(\"Payee display name shown to the respondent\"),\n sourceEmail: z\n .string()\n .optional()\n .describe(\"Email address resolved from the configured source email question\"),\n upiIntentUri: z\n .string()\n .optional()\n .describe(\"Generated UPI intent URI shown to the respondent\"),\n selfReported: z\n .literal(true)\n .describe(\n \"Always true: Encatch records this answer but does not verify the payment\",\n ),\n })\n .describe(\"Answer for a payments_upi question\");\n\n// AnswerItem schema\nexport const AnswerItemSchema = z\n .object({\n nps: z\n .number()\n .optional()\n .describe(\"Net Promoter Score value (e.g., 0-10)\"),\n nestedSelection: z\n .array(z.string())\n .optional()\n .describe(\"Array of selected nested option IDs\"),\n longText: z\n .string()\n .optional()\n .describe(\"Long text answer, e.g., paragraph or essay\"),\n shortAnswer: z\n .string()\n .optional()\n .describe(\"Short text answer, e.g., single sentence or word\"),\n singleChoice: z\n .string()\n .optional()\n .describe(\"Single selected option value for single choice questions\"),\n rating: z.number().optional().describe(\"Star rating value (e.g., 1-5)\"),\n yesNo: z\n .boolean()\n .optional()\n .describe(\"Yes/no answer for yes_no questions (true = Yes, false = No)\"),\n consent: z\n .boolean()\n .optional()\n .describe(\n \"Consent answer for consent questions (true = checked/agreed, false = unchecked)\",\n ),\n multipleChoiceMultiple: z\n .array(z.string())\n .optional()\n .describe(\n \"Array of selected option values for multiple choice questions\",\n ),\n singleChoiceOther: z\n .string()\n .optional()\n .describe(\n 'Free-text \"other\" answer for single choice questions when allowOther is enabled',\n ),\n multipleChoiceOther: z\n .string()\n .optional()\n .describe(\n 'Free-text \"other\" answer for multiple choice questions when allowOther is enabled',\n ),\n annotation: AnnotationSchema.optional().describe(\n \"Annotation object containing file and marker details\",\n ),\n ratingMatrix: z\n .record(z.string(), z.union([z.number(), z.string()]))\n .optional()\n .describe(\n \"Rating matrix answers keyed by statement value (export key), value is the selected scale value (number for likert/numerical, string for custom)\",\n ),\n matrixSingleChoice: z\n .record(z.string(), z.string())\n .optional()\n .describe(\n \"Matrix single-choice answers keyed by row value (export key), map value is the selected column option value\",\n ),\n matrixMultipleChoice: z\n .record(z.string(), z.array(z.string()))\n .optional()\n .describe(\n \"Matrix multiple-choice answers keyed by row value (export key), map value is array of selected column option values\",\n ),\n others: z\n .string()\n .optional()\n .describe(\n \"For multiple choice questions and single choice questions, this is the value of the other option\",\n ),\n // Date question\n date: z\n .string()\n .optional()\n .describe(\n \"Answer for a date question; ISO 8601 format (YYYY-MM-DD or YYYY-MM-DDTHH:MM)\",\n ),\n // CSAT question\n csat: z\n .number()\n .optional()\n .describe(\n \"Answer for a CSAT question; industry-standard value: 1 (lowest/worst) to N (highest/best) where N is the scale size (2\u20135)\",\n ),\n // Opinion scale question\n opinionScale: z\n .number()\n .optional()\n .describe(\n \"Answer for an opinion scale question; the selected numeric value on the scale\",\n ),\n // Ranking question \u2014 ordered array of option values; index 0 = rank 1\n ranking: z\n .array(z.string())\n .optional()\n .describe(\n \"Answer for a ranking question; ordered array of option values where index 0 is rank 1\",\n ),\n // Picture choice \u2014 always an array of selected option values (single selection = one-element array)\n pictureChoice: z\n .array(z.string())\n .optional()\n .describe(\n \"Answer for a picture choice question; array of selected option values (single selection produces a one-element array)\",\n ),\n pictureChoiceOther: z\n .string()\n .optional()\n .describe(\n 'Free-text \"other\" answer for picture choice questions when allowOther is enabled',\n ),\n // Signature question\n signature: SignatureAnswerSchema.optional().describe(\n \"Answer for a signature question\",\n ),\n // File upload question\n fileUpload: FileUploadAnswerSchema.optional().describe(\n \"Answer for a file upload question; array supports single and multiple file uploads\",\n ),\n // Email question\n email: z\n .string()\n .optional()\n .describe(\"Answer for an email question; the submitted email address\"),\n // Number question\n number: z\n .string()\n .optional()\n .describe(\n \"Answer for a number question; the submitted numeric value as a string\",\n ),\n // Website question\n website: z\n .string()\n .optional()\n .describe(\"Answer for a website question; the submitted URL\"),\n // Phone number question\n phoneNumber: PhoneNumberAnswerSchema.optional().describe(\n \"Answer for a phone number question\",\n ),\n // Address question\n address: AddressAnswerSchema.optional().describe(\n \"Answer for an address question\",\n ),\n // Video and audio question\n videoAudio: VideoAudioAnswerSchema.optional().describe(\n \"Answer for a video and audio question\",\n ),\n // Scheduler question\n scheduler: SchedulerAnswerSchema.optional().describe(\n \"Answer for a scheduler question\",\n ),\n // Q&A with AI question\n qnaWithAi: QnaWithAiAnswerSchema.optional().describe(\n \"Answer for a qna_with_ai question; ordered transcript of Q&A pairs from the session\",\n ),\n // Payments UPI question\n paymentsUpi: PaymentsUpiAnswerSchema.optional().describe(\n \"Answer for a payments_upi question; self-reported UPI transaction reference\",\n ),\n })\n .describe(\n \"Flexible answer item supporting various question types and custom fields\",\n );\n\n// Legacy AnswerSchema for backward compatibility\nexport const AnswerSchema = AnswerItemSchema;\n\n// Type inference from schemas (for type safety)\nexport type AnnotationMarker = z.infer<typeof AnnotationMarkerSchema>;\nexport type Annotation = z.infer<typeof AnnotationSchema>;\nexport type SignatureAnswer = z.infer<typeof SignatureAnswerSchema>;\nexport type FileUploadAnswerItem = z.infer<typeof FileUploadAnswerItemSchema>;\nexport type FileUploadAnswer = z.infer<typeof FileUploadAnswerSchema>;\nexport type PhoneNumberAnswer = z.infer<typeof PhoneNumberAnswerSchema>;\nexport type AddressAnswer = z.infer<typeof AddressAnswerSchema>;\nexport type VideoAudioAnswer = z.infer<typeof VideoAudioAnswerSchema>;\nexport type SchedulerAnswer = z.infer<typeof SchedulerAnswerSchema>;\nexport type QnaWithAiPair = z.infer<typeof QnaWithAiPairSchema>;\nexport type QnaWithAiAnswer = z.infer<typeof QnaWithAiAnswerSchema>;\nexport type PaymentsUpiAnswer = z.infer<typeof PaymentsUpiAnswerSchema>;\nexport type AnswerItem = z.infer<typeof AnswerItemSchema>;\nexport type Answer = z.infer<typeof AnswerSchema>;\n", "import { z } from \"zod\";\n\n// External publishing properties schema\nexport const externalPublishingPropertiesSchema = z\n .object({\n isShareable: z\n .boolean()\n .describe(\"Whether the feedback results can be shared externally\"),\n isEmailShareable: z\n .boolean()\n .describe(\"Whether the feedback can be shared via email\"),\n })\n .describe(\"Schema defining external publishing and sharing properties for feedback\");\n\n// Publication status enum\nexport const publicationStatusSchema = z\n .enum([\"P\", \"D\",\"A\", \"S\"])\n .describe(\"Publication status: P=Published, D=Draft, A=Archived, S=Stopped\");\n\n// Constants for publication status (explicit literal values for proper type inference)\nexport const PublicationStatuses = {\n PUBLISHED: \"P\" as const,\n DRAFT: \"D\" as const,\n ARCHIVED: \"A\" as const,\n STOPPED: \"S\" as const,\n} as const;\n\n// Feedback configuration schema\nexport const feedbackConfigurationSchema = z\n .object({\n formTitle: z\n .string()\n .describe(\"Title of the feedback form\"),\n formDescription: z\n .string()\n .describe(\"Description of the feedback form\"),\n isPublished: publicationStatusSchema\n .describe(\"Publication status of the feedback form\"),\n })\n .describe(\"Schema defining feedback configuration properties\");\n\n// Type inference from schemas (for type safety)\nexport type PublicationStatus = z.infer<typeof publicationStatusSchema>;\nexport type FeedbackConfiguration = z.infer<typeof feedbackConfigurationSchema>;\nexport type ExternalPublishingProperties = z.infer<typeof externalPublishingPropertiesSchema>;\n", "import { z } from \"zod\";\nimport {\n feedbackConfigurationSchema,\n externalPublishingPropertiesSchema,\n} from \"./form-schema\";\nimport { combinedQuestionSchema, sectionSchema } from \"./field-schema\";\nimport { translationsSchema } from \"./translations-schema\";\nimport { LanguagesSchema, OtherFieldsSchema, OtherFieldsTranslationSchema } from \"./other-screen-schema\";\nimport { themeConfigurationSchema } from \"./theme-schema\";\nimport { audienceTriggerPropertiesSchema } from \"./auto-trigger-schema\";\nimport { sectionLayoutSchema } from \"./layout-schema\";\n\n// Other configuration properties schema using discriminated union for JSON schema compatibility\nexport const otherConfigurationPropertiesSchema = z\n .discriminatedUnion(\"isEnabled\", [\n // When other configuration is disabled\n z.object({\n isEnabled: z\n .literal(false)\n .describe(\"Whether other configuration properties are enabled\"),\n otherFields: OtherFieldsSchema\n .describe(\"Other form configuration fields including buttons and display options\"),\n translations: z.record(z.string(), OtherFieldsTranslationSchema)\n .optional()\n .describe(\"Translations for other configuration field labels and buttons keyed by language code\"),\n }),\n // When other configuration is enabled\n z.object({\n isEnabled: z\n .literal(true)\n .describe(\"Whether other configuration properties are enabled\"),\n otherFields: OtherFieldsSchema\n .describe(\"Other form configuration fields including buttons and display options\"),\n translations: z.record(z.string(), OtherFieldsTranslationSchema)\n .describe(\"Translations for other configuration field labels and buttons keyed by language code\"),\n }),\n ])\n .describe(\"Schema for other configuration properties including fields and translations\");\n\n// Appearance properties schema\nexport const appearancePropertiesSchema = z\n .object({\n themeConfiguration: themeConfigurationSchema\n .describe(\"Theme configuration including colors, features, and positioning\"),\n sectionLayoutDefaults: sectionLayoutSchema\n .optional()\n .describe(\n \"Default layout applied to sections that have no explicit entry in sectionLayouts. Resolved independently per surface (inApp, link.mobile, link.others)\"\n ),\n sectionLayouts: z\n .record(z.string(), sectionLayoutSchema)\n .optional()\n .describe(\n \"Per-section layout overrides keyed by section id. Takes precedence over sectionLayoutDefaults. Omit a section to fall back to sectionLayoutDefaults or engine default\"\n ),\n })\n .describe(\"Schema for appearance properties including theme configuration and per-section layouts\");\n\n// Combined form properties schema (if needed for complete form configuration)\nexport const formPropertiesSchema = z\n .object({\n feedbackConfigurationId: z.uuid()\n .describe(\"Unique identifier for the feedback configuration\"),\n feedbackConfiguration: feedbackConfigurationSchema\n .describe(\"Configuration properties for the feedback form\"),\n questionnaireFields: z\n .object({\n questions: z.record(z.string(), combinedQuestionSchema)\n .describe(\"Collection of questions keyed by their string identifiers\"),\n sections: z.array(sectionSchema)\n .describe(\"Array of sections that organize questions into logical groups\"),\n selectedLanguages: LanguagesSchema\n .describe(\"Array of languages selected for this questionnaire\"),\n translations: translationsSchema\n .describe(\"Multi-language translations for questions and form content\"),\n })\n .describe(\"Fields defining the questionnaire structure, questions, sections, selected languages, and translations\"),\n externalPublishingProperties: externalPublishingPropertiesSchema\n .describe(\"Properties controlling external sharing and publishing of feedback results\"),\n audienceTriggerProperties: audienceTriggerPropertiesSchema\n .describe(\"Properties defining audience targeting and trigger conditions for the feedback form\"),\n otherConfigurationProperties: otherConfigurationPropertiesSchema\n .describe(\"Additional configuration properties including form display options and translations\"),\n appearanceProperties: appearancePropertiesSchema\n .describe(\"Appearance configuration including themes, colors, and UI feature settings\"),\n })\n .describe(\"Complete schema for all feedback-level properties including publishing, audience targeting, configuration, and appearance\");\n\n// Type inference from schema (for type safety)\nexport type FormProperties = z.infer<typeof formPropertiesSchema>;\n\n// Explicit type definition for better inference\nexport type OtherConfigurationProperties = \n | {\n isEnabled: false;\n otherFields?: z.infer<typeof OtherFieldsSchema>;\n translations?: Record<string, z.infer<typeof OtherFieldsTranslationSchema>>;\n }\n | {\n isEnabled: true;\n otherFields: z.infer<typeof OtherFieldsSchema>;\n translations: Record<string, z.infer<typeof OtherFieldsTranslationSchema>>;\n };\n\nexport type AppearanceProperties = z.infer<typeof appearancePropertiesSchema>;\nexport type { SectionLayout } from \"./layout-schema\";\n", "import { z } from \"zod\";\n\n// Other configuration fields schema\nexport const OtherFieldsSchema = z\n .object({\n questionNumber: z\n .boolean()\n .describe(\"Whether to display question numbers\"),\n submitButtonLabel: z\n .string()\n .min(1)\n .max(50)\n .describe(\"Text for the submit button\"),\n previousButtonLabel: z\n .string()\n .min(1)\n .max(50)\n .describe(\"Text for the previous button in pagination\"),\n aiEnhancementSuccessMessage: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Message shown when AI enhancement is successful (max 100 characters)\"),\n aiEnhancementCooldownErrorMessage: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Message shown when AI enhancement is on cooldown (max 100 characters)\"),\n aiEnhancementMaxReachedErrorMessage: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Message shown when maximum AI enhancements reached (max 100 characters)\"),\n remindMeLaterButtonLabel: z\n .string()\n .max(50)\n .optional()\n .describe(\"Label for the remind me later button; when absent or blank the button is not shown\"),\n estimatedCompletionLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Estimated completion time label shown on the welcome or first screen (e.g. 'Takes about 2 minutes'); when absent the label is not shown\"),\n respondentsShowMinThreshold: z\n .number()\n .int()\n .min(1)\n .optional()\n .describe(\"Minimum number of respondents required before the respondents badge is shown; when absent the badge is never shown\"),\n respondentsLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Label template for the respondents badge (e.g. '{count} people have already responded'); client interpolates {count} at render time\"),\n windowTitle: z\n .string()\n .max(100)\n .optional()\n .describe(\"Custom browser window/tab title for the form; when absent the platform uses a default (e.g. the form title or app name)\"),\n })\n .describe(\"Schema for other form configuration fields\");\n\n// Language field schema\nexport const LanguageFieldSchema = z\n .object({\n value: z\n .string()\n .min(1)\n .max(10)\n .describe(\"Language code (e.g., 'en', 'es', 'fr')\"),\n label: z\n .string()\n .min(1)\n .max(50)\n .describe(\"Display name for the language (e.g., 'English', 'Spanish', 'French')\"),\n })\n .describe(\"Schema for individual language field with value and label\");\n\n// Languages configuration schema\nexport const LanguagesSchema = z\n .array(LanguageFieldSchema)\n .describe(\"Schema for array of available languages\");\n\n// Other fields translation schema\nexport const OtherFieldsTranslationSchema = z\n .object({\n submitButtonLabel: z\n .string()\n .min(1)\n .max(50)\n .describe(\"Translated text for the submit button\"),\n previousButtonLabel: z\n .string()\n .min(1)\n .max(50)\n .describe(\"Translated text for the previous button in pagination\"),\n aiEnhancementSuccessMessage: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Translated message shown when AI enhancement is successful (max 100 characters)\"),\n aiEnhancementCooldownErrorMessage: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Translated message shown when AI enhancement is on cooldown (max 100 characters)\"),\n aiEnhancementMaxReachedErrorMessage: z\n .string()\n .min(1)\n .max(100)\n .describe(\"Translated message shown when maximum AI enhancements reached (max 100 characters)\"),\n remindMeLaterButtonLabel: z\n .string()\n .max(50)\n .optional()\n .describe(\"Translated label for the remind me later button\"),\n estimatedCompletionLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Translated estimated completion time label\"),\n respondentsLabel: z\n .string()\n .max(100)\n .optional()\n .describe(\"Translated label template for the respondents badge (e.g. '{count} people have already responded'); client interpolates {count} at render time\"),\n windowTitle: z\n .string()\n .max(100)\n .optional()\n .describe(\"Translated browser window/tab title for the form\"),\n })\n .describe(\"Schema for other form configuration field translations\");\n\n// Export inferred types\nexport type OtherFields = z.infer<typeof OtherFieldsSchema>;\nexport type OtherFieldsTranslation = z.infer<typeof OtherFieldsTranslationSchema>;\nexport type LanguageField = z.infer<typeof LanguageFieldSchema>;\nexport type Languages = z.infer<typeof LanguagesSchema>;\n", "import { z } from \"zod\";\n\n// Position enum for widget positioning\nexport const positionSchema = z\n .enum([\n \"top-left\",\n \"top-center\",\n \"top-right\",\n \"middle-left\",\n \"middle-center\",\n \"middle-right\",\n \"bottom-left\",\n \"bottom-center\",\n \"bottom-right\",\n ])\n .describe(\"Available positions for widget placement\");\n\n// Constants for positions (explicit literal values for proper type inference)\nexport const Positions = {\n TOP_LEFT: \"top-left\" as const,\n TOP_CENTER: \"top-center\" as const,\n TOP_RIGHT: \"top-right\" as const,\n MIDDLE_LEFT: \"middle-left\" as const,\n MIDDLE_CENTER: \"middle-center\" as const,\n MIDDLE_RIGHT: \"middle-right\" as const,\n BOTTOM_LEFT: \"bottom-left\" as const,\n BOTTOM_CENTER: \"bottom-center\" as const,\n BOTTOM_RIGHT: \"bottom-right\" as const,\n} as const;\n\n// Theme mode enum for light and dark themes\nexport const themeModeSchema = z\n .enum([\"light\", \"dark\"])\n .describe(\"Available theme modes for the widget\");\n\n// Constants for theme modes (explicit literal values for proper type inference)\nexport const ThemeModes = {\n LIGHT: \"light\" as const,\n DARK: \"dark\" as const,\n} as const;\n\n// Shareable mode: light, dark, or follow system preference\nexport const shareableModeSchema = z\n .enum([\"light\", \"dark\", \"system\"])\n .describe(\n \"Display mode for the shareable widget: light, dark, or system preference\"\n );\n\nexport const ShareableModes = {\n LIGHT: \"light\" as const,\n DARK: \"dark\" as const,\n SYSTEM: \"system\" as const,\n} as const;\n\n// Previous button visibility mode enum\nexport const previousButtonModeSchema = z\n .enum([\"never\", \"always\", \"auto\"])\n .describe(\n \"Previous button visibility: never (always hidden), always (always shown), or auto (per-section via isPreviousAllowed)\"\n );\n\nexport const PreviousButtonModes = {\n NEVER: \"never\" as const,\n ALWAYS: \"always\" as const,\n AUTO: \"auto\" as const,\n} as const;\n\n// Logo placement enum \u2014 top row only (not middle/bottom)\nexport const logoPlacementSchema = z\n .enum([\"top-left\", \"top-center\", \"top-right\"])\n .describe(\"Where the logo is anchored in the form header\");\n\nexport const LogoPlacements = {\n TOP_LEFT: \"top-left\" as const,\n TOP_CENTER: \"top-center\" as const,\n TOP_RIGHT: \"top-right\" as const,\n} as const;\n\n// Logo size enum \u2014 rendered display size within the 96\u00D740 px container\nexport const logoSizeSchema = z\n .enum([\"small\", \"medium\", \"large\"])\n .describe(\"Rendered display size of the logo within the 96\u00D740 px container\");\n\nexport const LogoSizes = {\n SMALL: \"small\" as const,\n MEDIUM: \"medium\" as const,\n LARGE: \"large\" as const,\n} as const;\n\n// Per-surface logo overrides for link/shareable surfaces\nexport const logoSurfaceOverrideSchema = z\n .object({\n size: logoSizeSchema\n .optional()\n .describe(\"Size override for this surface; falls back to the global size\"),\n placement: logoPlacementSchema\n .optional()\n .describe(\"Placement override for this surface; falls back to the global placement\"),\n hidden: z\n .boolean()\n .optional()\n .describe(\"When true, the logo is suppressed on this surface\"),\n disableLink: z\n .boolean()\n .optional()\n .describe(\"When true, the logo is not clickable on this surface\"),\n })\n .describe(\"Per-surface overrides for logo display on link/shareable\");\n\n// Logo schema \u2014 applies to link/shareable surfaces only, not rendered in-app\nexport const logoSchema = z\n .object({\n href: z\n .object({\n light: z\n .string()\n .url()\n .describe(\"Logo URL for light mode \u2014 rendered within a 96\u00D740 px container\"),\n dark: z\n .string()\n .url()\n .optional()\n .describe(\"Logo URL for dark mode; falls back to light if absent\"),\n })\n .describe(\"Logo image URLs per theme mode\"),\n placement: logoPlacementSchema\n .default(\"top-left\")\n .describe(\"Default placement in the form header\"),\n size: logoSizeSchema\n .default(\"medium\")\n .describe(\"Default rendered size of the logo\"),\n linkUrl: z\n .string()\n .url()\n .optional()\n .describe(\"Optional URL to navigate to when the logo is clicked\"),\n altText: z\n .string()\n .max(200)\n .optional()\n .describe(\"Accessible alt text for the logo image\"),\n surfaces: z\n .object({\n link: z\n .object({\n mobile: logoSurfaceOverrideSchema\n .optional()\n .describe(\"Overrides for link/shareable on mobile viewports\"),\n others: logoSurfaceOverrideSchema\n .optional()\n .describe(\"Overrides for link/shareable on tablet and desktop viewports\"),\n })\n .optional(),\n })\n .optional()\n .describe(\"Per-surface overrides; logo is link/shareable only \u2014 not rendered in-app\"),\n })\n .describe(\"Logo displayed in the form header; applies to link/shareable surfaces only\");\n\n// Schema for feature settings controlling UI behavior\nexport const featureSettingsSchema = z\n .object({\n darkOverlay: z\n .boolean()\n .default(false)\n .describe(\"Whether to show a dark overlay behind the widget\"),\n closeButton: z\n .boolean()\n .default(true)\n .describe(\"Whether to display a close button on the widget\"),\n progressBar: z\n .boolean()\n .default(true)\n .describe(\"Whether to show a progress bar indicating completion status\"),\n showBranding: z\n .boolean()\n .default(true)\n .describe(\"Whether to display branding elements on the widget\"),\n customPosition: z\n .boolean()\n .describe(\"Whether custom positioning is enabled\"),\n customCss: z\n .string()\n .optional()\n .describe(\"Custom CSS to apply \u2014 either a URL ending in .css or raw CSS text\"),\n fontFamily: z\n .string()\n .optional()\n .default(\"default\")\n .describe(\"Font family to use for the widget\"),\n shareableMode: shareableModeSchema\n .optional()\n .default(ShareableModes.LIGHT)\n .describe(\n \"Display mode for the shareable: light, dark, or system preference\"\n ),\n enableShareableKeyboardNavigation: z\n .boolean()\n .default(false)\n .describe(\n \"Whether keyboard navigation is enabled for the shareable widget experience\"\n ),\n rtl: z\n .boolean()\n .default(false)\n .describe(\"Whether right-to-left text direction is enabled\"),\n previousButton: previousButtonModeSchema\n .default(PreviousButtonModes.ALWAYS)\n .describe(\"Previous button: never (hidden) or always (shown)\"),\n maxDialogHeightPercentInApp: z\n .number()\n .int()\n .min(10)\n .max(100)\n .optional()\n .describe(\"Maximum height of the in-app dialog as a percentage of the viewport height (10\u2013100); when absent the dialog uses its default height\"),\n faviconUrl: z\n .string()\n .optional()\n .describe(\"URL of a custom favicon image to display in the browser tab; when absent the platform default favicon is used\"),\n logo: logoSchema\n .optional()\n .describe(\"Optional form-level logo shown in the header on link/shareable surfaces; omit to show no logo\"),\n })\n .describe(\"Feature settings controlling widget UI behavior and appearance\");\n\n// Schema for individual theme (shadcn variables per mode)\nexport const themeColorsSchema = z\n .object({\n theme: z\n .string()\n .optional()\n .describe(\"Theme for a single mode (shadcn variables JSON)\"),\n })\n .describe(\"Theme for a single mode (shadcn variables)\");\n\n// Schema for the complete themes object\nexport const themesSchema = z\n .object({\n light: themeColorsSchema,\n dark: themeColorsSchema,\n })\n .describe(\"Complete theme configuration with light and dark variants\");\n\n// Schema for the complete theme configuration\nexport const themeConfigurationSchema = z\n .object({\n themes: themesSchema.describe(\"Color themes for light and dark modes\"),\n featureSettings: featureSettingsSchema.describe(\n \"UI feature settings controlling widget behavior\"\n ),\n selectedPosition: positionSchema.describe(\n \"Selected position for the main widget\"\n ),\n selectedIconPosition: positionSchema.describe(\n \"Selected position for the widget icon\"\n ),\n })\n .describe(\n \"Complete theme and UI configuration including colors, features, and positioning\"\n );\n\n// Type exports for TypeScript\nexport type Position = z.infer<typeof positionSchema>;\nexport type ThemeMode = z.infer<typeof themeModeSchema>;\nexport type ShareableMode = z.infer<typeof shareableModeSchema>;\nexport type PreviousButtonMode = z.infer<typeof previousButtonModeSchema>;\nexport type LogoPlacement = z.infer<typeof logoPlacementSchema>;\nexport type LogoSize = z.infer<typeof logoSizeSchema>;\nexport type LogoSurfaceOverride = z.infer<typeof logoSurfaceOverrideSchema>;\nexport type Logo = z.infer<typeof logoSchema>;\nexport type FeatureSettings = z.infer<typeof featureSettingsSchema>;\nexport type ThemeColors = z.infer<typeof themeColorsSchema>;\nexport type Themes = z.infer<typeof themesSchema>;\nexport type ThemeConfiguration = z.infer<typeof themeConfigurationSchema>;\n", "import { z } from \"zod\";\n\n// Custom event field operator schema\nexport const customEventFieldOperatorSchema = z\n .object({\n name: z\n .string()\n .describe(\"The operator name (e.g., '=', '!=', 'contains', 'beginsWith', 'matches')\"),\n label: z\n .string()\n .describe(\"Human-readable label for the operator (e.g., 'equals', 'not equals', 'contains')\"),\n })\n .describe(\"Schema defining an operator for custom event fields\");\n\n// Custom event field schema\nexport const customEventFieldSchema = z\n .object({\n name: z\n .string()\n .describe(\"The field name (e.g., 'event_name', 'add_to_cart', 'cart_item_number')\"),\n label: z\n .string()\n .describe(\"Human-readable label for the field\"),\n placeholder: z\n .string()\n .describe(\"Placeholder text for input fields\"),\n operators: z\n .array(customEventFieldOperatorSchema)\n .min(1)\n .describe(\"Array of available operators for this field\"),\n })\n .describe(\"Schema defining a custom event field with its operators\");\n\n// Metadata schema for conditional if\nexport const conditionalIfMetadataSchema = z\n .object({\n customEventFields: z\n .array(customEventFieldSchema)\n .optional()\n .describe(\"Array of custom event fields with their operators and labels\"),\n })\n .describe(\"Schema defining metadata for conditional if clauses\");\n\n// Query output schema with defined structure but all fields as strings\nexport const queryOutputSchema = z\n .object({\n query: z\n .string()\n .describe(\"The structured query definition as a JSON string\"),\n naturalLanguage: z\n .string()\n .describe(\"Human-readable description of the query conditions\"),\n jsonLogic: z\n .string()\n .describe(\"JSON Logic representation of the query as a JSON string\"),\n sqlQuery: z\n .string()\n .describe(\"SQL representation of the query for database operations\"),\n })\n .describe(\"Schema defining query output structure with all fields as strings\");\n\n// Conditional if clause schema\nexport const conditionalIfSchema = z\n .object({\n id: z\n .string()\n .describe(\"Unique identifier for this condition\"),\n event: z\n .string()\n .describe(\"The event that triggers evaluation of this condition (e.g., 'pageLoad', 'pageView', 'scroll', 'custom')\"),\n queryOutput: queryOutputSchema.describe(\"The query conditions to evaluate when the event occurs\"),\n metadata: conditionalIfMetadataSchema\n .optional()\n .describe(\"Optional metadata containing custom event fields and their configurations\"),\n })\n .describe(\"Schema defining the 'if' condition for auto-trigger logic\");\n\n// Trigger action schema for the 'then' clause\nexport const triggerActionSchema = z\n .object({\n triggerType: z\n .string()\n .describe(\"The type of action to perform (e.g., 'delay', 'scroll', 'immediately')\"),\n delay: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\"Delay in seconds before performing the action\"),\n scroll: z\n .union([z.string(), z.number()])\n .optional()\n .describe(\"Scroll position (percentage as string like '75%' or pixel value as number)\"),\n })\n .describe(\"Schema defining the action to perform when conditions are met\");\n\n// Conditional when clause schema (if-then structure)\nexport const conditionalWhenSchema = z\n .object({\n if: conditionalIfSchema.describe(\"The condition that must be met\"),\n then: triggerActionSchema.describe(\"The action to perform when the condition is met\"),\n })\n .describe(\"Schema defining a conditional when clause with if-then logic\");\n\n// Filter condition schema for category-specific filters\nexport const filterConditionSchema = z\n .object({\n id: z\n .string()\n .describe(\"Unique identifier for this filter condition\"),\n category: z\n .string()\n .describe(\"The category this filter belongs to (e.g., 'device', 'user', 'geo_location')\"),\n property: z\n .string()\n .describe(\"The property to filter on (e.g., 'device_type', 'age', 'country')\"),\n operator: z\n .string()\n .describe(\"The comparison operator (e.g., 'equals', 'greaterThan', 'lessThan')\"),\n values: z\n .array(z.string())\n .min(1)\n .describe(\"Array of values to compare against\"),\n tbl_key: z\n .string()\n .describe(\"The database table key for this property\"),\n })\n .describe(\"Schema defining a single filter condition within a category\");\n\n// Category-specific filters schema\nexport const categorySpecificFiltersSchema = z\n .object({\n device: z\n .array(filterConditionSchema)\n .optional()\n .describe(\"Array of device-specific filter conditions\"),\n user: z\n .array(filterConditionSchema)\n .optional()\n .describe(\"Array of user-specific filter conditions\"),\n geo_location: z\n .array(filterConditionSchema)\n .optional()\n .describe(\"Array of geo-location specific filter conditions\"),\n })\n .describe(\"Schema defining category-specific filters for audience targeting\");\n\n// Who schema for audience targeting\nexport const whoSchema = z\n .object({\n applications: z\n .array(z.string())\n .min(1)\n .describe(\"Array of application names this targeting applies to\"),\n userType: z\n .string()\n .describe(\"The type of user this targeting applies to (e.g., 'both', 'new', 'returning')\"),\n categorySpecificFilters: categorySpecificFiltersSchema\n .optional()\n .describe(\"Optional category-specific filters for more granular targeting\"),\n })\n .describe(\"Schema defining who the audience targeting applies to\");\n\n// Enhanced audience segment schema with conditional when logic\nexport const audienceSegmentSchema = z\n .object({\n id: z\n .string()\n .describe(\"Unique identifier for the audience segment\"),\n name: z\n .string()\n .min(1)\n .max(200)\n .describe(\"Display name for the audience segment\"),\n isImportant: z\n .boolean()\n .describe(\"Whether this segment is marked as important for targeting\"),\n when: z\n .array(conditionalWhenSchema)\n .min(1)\n .describe(\"Array of conditional when clauses with if-then logic\"),\n who: whoSchema\n .describe(\"User criteria and conditions defining who belongs to this segment\"),\n })\n .describe(\"Schema defining an audience segment for targeting with conditional logic\");\n\n// Audience trigger properties schema\nexport const audienceTriggerPropertiesSchema = z\n .object({\n isAuto: z\n .boolean()\n .describe(\"Whether automatic triggering is enabled for this audience\"),\n isManual: z\n .boolean()\n .describe(\"Whether manual triggering is enabled for this audience\"),\n segments: z\n .array(audienceSegmentSchema)\n .min(0)\n .describe(\"Array of audience segments for targeting conditions\"),\n })\n .refine(\n (data) => {\n // Ensure at least one of isAuto or isManual is true\n return data.isAuto || data.isManual;\n },\n {\n message: \"At least one of isAuto or isManual must be true\",\n path: [\"isAuto\"],\n }\n )\n .describe(\"Schema defining audience trigger properties for form targeting\");\n\n// Type inference from schemas\nexport type CustomEventFieldOperator = z.infer<typeof customEventFieldOperatorSchema>;\nexport type CustomEventField = z.infer<typeof customEventFieldSchema>;\nexport type ConditionalIfMetadata = z.infer<typeof conditionalIfMetadataSchema>;\nexport type QueryOutput = z.infer<typeof queryOutputSchema>;\nexport type ConditionalIf = z.infer<typeof conditionalIfSchema>;\nexport type TriggerAction = z.infer<typeof triggerActionSchema>;\nexport type ConditionalWhen = z.infer<typeof conditionalWhenSchema>;\nexport type FilterCondition = z.infer<typeof filterConditionSchema>;\nexport type CategorySpecificFilters = z.infer<typeof categorySpecificFiltersSchema>;\nexport type Who = z.infer<typeof whoSchema>;\nexport type AudienceSegment = z.infer<typeof audienceSegmentSchema>;\nexport type AudienceTriggerProperties = z.infer<typeof audienceTriggerPropertiesSchema>;\n", "import { z } from \"zod\";\n\n// \u2500\u2500\u2500 Focal Point \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const focalPointSchema = z\n .object({\n x: z\n .number()\n .min(-1)\n .max(1)\n .describe(\"Horizontal focal point from -1 (far left) to 1 (far right)\"),\n y: z\n .number()\n .min(-1)\n .max(1)\n .describe(\"Vertical focal point from -1 (top) to 1 (bottom)\"),\n })\n .describe(\"Focal point for image cropping and positioning within its container\");\n\n// \u2500\u2500\u2500 Attachment Types \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const imageAttachmentSchema = z\n .object({\n type: z.literal(\"image\"),\n href: z.string().url().describe(\"URL of the image asset\"),\n properties: z\n .object({\n description: z\n .string()\n .optional()\n .describe(\"Accessible description of the image (used as alt text when decorative is false)\"),\n decorative: z\n .boolean()\n .default(false)\n .describe(\n \"When true the image is purely visual; screen readers skip it and description is not surfaced as alt text\"\n ),\n brightness: z\n .number()\n .min(-100)\n .max(100)\n .optional()\n .describe(\"Brightness adjustment rendered with a black/white overlay: -100 fully black, 0 unchanged, +100 fully white.\"),\n focalPoint: focalPointSchema.optional(),\n })\n .optional()\n .describe(\"Optional display properties for the image\"),\n })\n .describe(\"Image attachment for section layouts\");\n\nexport const videoAttachmentSchema = z\n .object({\n type: z.literal(\"video\"),\n href: z\n .string()\n .url()\n .describe(\n \"URL of the video \u2014 YouTube, Vimeo, Pexels, or self-hosted CDN\"\n ),\n scale: z\n .enum([\"0.4\", \"0.6\", \"0.8\", \"1\"])\n .default(\"0.6\")\n .optional()\n .describe(\"Responsive scale for the video within its container\"),\n properties: z\n .object({\n description: z\n .string()\n .optional()\n .describe(\"Accessible description of the video\"),\n decorative: z\n .boolean()\n .default(false)\n .describe(\"When true the video is purely decorative and screen readers skip it\"),\n brightness: z\n .number()\n .min(-100)\n .max(100)\n .optional()\n .describe(\"Brightness adjustment rendered with a black/white overlay: -100 fully black, 0 unchanged, +100 fully white.\"),\n })\n .optional()\n .describe(\"Optional display properties for the video\"),\n })\n .describe(\"Video attachment for section layouts (external embed or self-hosted CDN)\");\n\nexport const colorAttachmentSchema = z\n .object({\n type: z.literal(\"color\"),\n value: z\n .string()\n .regex(\n /^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$/,\n \"Must be a valid hex color: #RGB, #RRGGBB, or #RRGGBBAA\"\n )\n .describe(\"Hex color value e.g. #FF5733 (opaque) or #FF5733CC (with alpha)\"),\n })\n .describe(\"Solid color background attachment for section layouts\");\n\nexport const gradientAttachmentSchema = z\n .object({\n type: z.literal(\"gradient\"),\n value: z\n .string()\n .min(1)\n .describe(\n \"CSS gradient string e.g. linear-gradient(135deg, #FF5733, #3498db) or radial-gradient(circle, #FF5733, #3498db)\"\n ),\n })\n .describe(\"CSS gradient background attachment for section layouts\");\n\n// Discriminated union over all attachment variants\nexport const layoutAttachmentSchema = z\n .discriminatedUnion(\"type\", [\n imageAttachmentSchema,\n videoAttachmentSchema,\n colorAttachmentSchema,\n gradientAttachmentSchema,\n ])\n .describe(\n \"Attachment used in a section layout \u2014 image, video, solid color, or gradient\"\n );\n\nexport const LayoutAttachmentTypes = {\n IMAGE: \"image\" as const,\n VIDEO: \"video\" as const,\n COLOR: \"color\" as const,\n GRADIENT: \"gradient\" as const,\n} as const;\n\n// \u2500\u2500\u2500 Layout Variants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * stack \u2014 attachment fills the background behind the question content (full bleed).\n * This is the default Typeform-like \"hero behind question\" treatment.\n */\nexport const stackLayoutSchema = z\n .object({\n type: z.literal(\"stack\"),\n align: z\n .enum([\"left\", \"center\", \"cover\"])\n .default(\"center\")\n .optional()\n .describe(\n \"How the media strip is displayed: 'center' (default, natural size centred at form width), 'left' (natural size left-aligned), 'cover' (full-bleed, fills strip edge-to-edge)\"\n ),\n attachment: layoutAttachmentSchema\n .optional()\n .describe(\"Background media rendered behind the question content\"),\n })\n .describe(\n \"Stack layout: attachment renders as a full-bleed background behind the question\"\n );\n\n/**\n * float \u2014 attachment floats beside the question without splitting the viewport.\n * The question content reflows around the media.\n */\nexport const floatLayoutSchema = z\n .object({\n type: z.literal(\"float\"),\n placement: z\n .enum([\"left\", \"right\"])\n .describe(\"Side the media floats on\"),\n attachment: layoutAttachmentSchema\n .optional()\n .describe(\"Media that floats beside the question content\"),\n })\n .describe(\n \"Float layout: attachment floats to the left or right of the question content\"\n );\n\n/**\n * split \u2014 viewport is divided 50/50 between attachment and question content.\n */\nexport const splitLayoutSchema = z\n .object({\n type: z.literal(\"split\"),\n placement: z\n .enum([\"left\", \"right\"])\n .describe(\"Side the media occupies in the split\"),\n attachment: layoutAttachmentSchema\n .optional()\n .describe(\"Media that occupies its half of the split viewport\"),\n })\n .describe(\n \"Split layout: viewport is divided equally between media and question content\"\n );\n\n/**\n * wallpaper \u2014 attachment tiles or stretches across the entire viewport as a\n * full-page background, behind both the question and any chrome.\n */\nexport const wallpaperLayoutSchema = z\n .object({\n type: z.literal(\"wallpaper\"),\n attachment: layoutAttachmentSchema\n .optional()\n .describe(\"Full-page background media\"),\n })\n .describe(\n \"Wallpaper layout: attachment stretches or tiles across the entire viewport\"\n );\n\n// Discriminated union over all layout variants\nexport const sectionLayoutVariantSchema = z\n .discriminatedUnion(\"type\", [\n stackLayoutSchema,\n floatLayoutSchema,\n splitLayoutSchema,\n wallpaperLayoutSchema,\n ])\n .describe(\n \"Layout variant controlling how attachment is rendered relative to the question\"\n );\n\nexport const LayoutTypes = {\n STACK: \"stack\" as const,\n FLOAT: \"float\" as const,\n SPLIT: \"split\" as const,\n WALLPAPER: \"wallpaper\" as const,\n} as const;\n\n// \u2500\u2500\u2500 Surface \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * A LayoutSurface is the full layout config for a single rendering surface\n * (e.g. in-app, link/mobile, link/others).\n *\n * - attachment: optional top-level media shown inline alongside the question\n * (distinct from the layout's inner attachment which controls positioning)\n * - layout: required variant that controls how the inner attachment is placed\n */\nexport const layoutSurfaceSchema = z\n .object({\n attachment: layoutAttachmentSchema\n .optional()\n .describe(\n \"Top-level media displayed inline with the question (separate from the layout's own attachment)\"\n ),\n layout: sectionLayoutVariantSchema.describe(\n \"How the attachment is positioned relative to the question content\"\n ),\n })\n .describe(\"Layout configuration for a single rendering surface\");\n\n// \u2500\u2500\u2500 Section Layout \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Per-section layout config scoped to two channels:\n * - inApp: native app or in-app webview\n * - link: shareable/link-based form, split into mobile (phones) and others (tablet + desktop)\n *\n * All fields are optional. When absent for a surface, the engine renders with no custom layout.\n *\n * Merge precedence (per surface):\n * sectionLayouts[id] > sectionLayoutDefaults > engine default (no layout)\n */\nexport const sectionLayoutSchema = z\n .object({\n inApp: layoutSurfaceSchema\n .optional()\n .describe(\"Layout for in-app (native/webview) surfaces\"),\n link: z\n .object({\n mobile: layoutSurfaceSchema\n .optional()\n .describe(\"Layout for link-based forms on mobile viewports (phones)\"),\n others: layoutSurfaceSchema\n .optional()\n .describe(\n \"Layout for link-based forms on tablet and desktop viewports\"\n ),\n })\n .optional()\n .describe(\n \"Layout overrides for link/shareable surfaces, split by mobile and others (tablet + desktop)\"\n ),\n })\n .describe(\n \"Per-section layout configuration scoped to in-app and link surfaces\"\n );\n\n// \u2500\u2500\u2500 Type exports \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type FocalPoint = z.infer<typeof focalPointSchema>;\nexport type ImageAttachment = z.infer<typeof imageAttachmentSchema>;\nexport type VideoAttachment = z.infer<typeof videoAttachmentSchema>;\nexport type ColorAttachment = z.infer<typeof colorAttachmentSchema>;\nexport type GradientAttachment = z.infer<typeof gradientAttachmentSchema>;\nexport type LayoutAttachment = z.infer<typeof layoutAttachmentSchema>;\nexport type StackLayout = z.infer<typeof stackLayoutSchema>;\nexport type FloatLayout = z.infer<typeof floatLayoutSchema>;\nexport type SplitLayout = z.infer<typeof splitLayoutSchema>;\nexport type WallpaperLayout = z.infer<typeof wallpaperLayoutSchema>;\nexport type SectionLayoutVariant = z.infer<typeof sectionLayoutVariantSchema>;\nexport type LayoutSurface = z.infer<typeof layoutSurfaceSchema>;\nexport type SectionLayout = z.infer<typeof sectionLayoutSchema>;\n", "import { z } from \"zod\";\n\n// Master properties schema\nexport const masterPropertiesSchema = z\n .object({\n mandatoryFetchConfigAtPaths: z\n .array(z.string())\n .describe(\"Array of paths where configuration must be fetched from server when navigated by user\"),\n configSyncIntervalSeconds: z\n .number()\n .int()\n .positive()\n .describe(\"Interval in seconds for configuration synchronization between client and server\"),\n disableAllSurvey: z\n .boolean()\n .describe(\"Flag to disable all surveys globally\"),\n feedbackIntervalDuration: z\n .number()\n .int()\n .positive()\n .describe(\"Duration in seconds for feedback interval between two auto triggered feedbacks\"),\n })\n .describe(\"Master properties configuration for global survey settings\");\n\n// Type inference from schema\nexport type MasterProperties = z.infer<typeof masterPropertiesSchema>;\n", "import { z } from \"zod\";\n\n// Theme mode enum for device themes\nexport const deviceThemeSchema = z\n .enum([\"light\", \"dark\", \"system\"])\n .describe(\"Enumeration of supported theme modes\");\n\n// Constants for device themes (explicit literal values for proper type inference)\nexport const DeviceThemes = {\n LIGHT: \"light\" as const,\n DARK: \"dark\" as const,\n SYSTEM: \"system\" as const,\n} as const;\n\n// Device info schema\nexport const deviceInfoSchema = z\n .object({\n $deviceType: z.string().describe(\"Type of device being used\"),\n $timezone: z.string().describe(\"Device timezone (e.g., 'Asia/Calcutta')\"),\n $theme: deviceThemeSchema.describe(\"Current theme mode preference\"),\n $os: z.string().describe(\"Operating system running on the device\"),\n $osVersion: z.string().describe(\"Version of the operating system\"),\n $appVersion: z.string().describe(\"Version of the application\"),\n $app: z.string().describe(\"Browser or application being used\"),\n $language: z.string().describe(\"Language preference (e.g., 'en-GB')\"),\n $deviceId: z.string().describe(\"Unique device identifier\"),\n })\n .describe(\"Device information collected from the client\");\n\n// Session info schema\nexport const sessionInfoSchema = z\n .object({\n $sessionId: z.string().uuid().describe(\"Unique session identifier\"),\n $timestamp: z.string().optional().describe(\"ISO timestamp of the session\"),\n })\n .describe(\"Session information for tracking user sessions\");\n\n// Combined device and session info schema\nexport const deviceSessionInfoSchema = z\n .object({\n deviceInfo: deviceInfoSchema.describe(\"Device information\"),\n sessionInfo: sessionInfoSchema.describe(\"Session information\"),\n })\n .describe(\"Combined device and session information\");\n\n// User properties schema for counter and other dynamic properties\nexport const userPropertiesSchema = z\n .object({\n $counter: z\n .record(z.string(), z.number().int())\n .describe(\n \"Counter properties for user tracking (can be positive or negative)\"\n )\n .optional(),\n $set: z\n .record(z.string(), z.any())\n .describe(\"Properties to set for the user\")\n .optional(),\n $setOnce: z\n .record(z.string(), z.any())\n .describe(\n \"Properties to set once for the user (won't overwrite existing values)\"\n )\n .optional(),\n $unset: z\n .array(z.string())\n .describe(\"Array of property names to unset/remove from the user\")\n .optional(),\n })\n .loose() // Allow additional user properties\n .describe(\n \"User properties including counters, set operations, and other dynamic data\"\n );\n\n// User info schema\nexport const userInfoSchema = z\n .object({\n userName: z.string().email().describe(\"User's email address as username\"),\n properties: userPropertiesSchema.describe(\"User properties and counters\"),\n })\n .describe(\"User information including identification and properties\");\n\n// Type exports\nexport type DeviceTheme = z.infer<typeof deviceThemeSchema>;\nexport type DeviceInfo = z.infer<typeof deviceInfoSchema>;\nexport type SessionInfo = z.infer<typeof sessionInfoSchema>;\nexport type DeviceSessionInfo = z.infer<typeof deviceSessionInfoSchema>;\nexport type UserProperties = z.infer<typeof userPropertiesSchema>;\nexport type UserInfo = z.infer<typeof userInfoSchema>;\n", "import { z } from \"zod\";\nimport {\n deviceInfoSchema,\n sessionInfoSchema,\n userInfoSchema,\n} from \"./other-schema\";\nimport { AnswerSchema } from \"../fields/answer-schema\";\n\n// Form configuration schema\nexport const formConfigSchema = z\n .object({\n feedbackIdentifier: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the feedback instance\"),\n feedbackConfigurationId: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the feedback configuration\"),\n completionTimeInSeconds: z\n .number()\n .int()\n .min(0)\n .describe(\"Time taken to complete the feedback in seconds\"),\n isPartialSubmit: z\n .boolean()\n .describe(\"Whether this is a partial submission (true) or full submission (false)\"),\n responseLanguageCode: z\n .string()\n .length(2)\n .describe(\"Language code for the response (e.g., 'en', 'es')\"),\n })\n .describe(\"Configuration information for the feedback form\");\n\n// Question response schema\nexport const questionResponseSchema = z\n .object({\n questionId: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the question\"),\n answer: AnswerSchema.describe(\"The answer provided for this question\"),\n type: z\n .string()\n .describe(\"Type of the question (e.g., 'rating', 'single_choice')\"),\n error: z.string().optional().describe(\"Error message if any validation failed\"),\n isOnPath: z\n .boolean()\n .optional()\n .describe(\n \"When present, whether this question was on the respondent's navigation path (e.g. logic jumps); false for questions not reached\"\n ),\n timeSpentMs: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Milliseconds the respondent spent on this question (even split across all visible questions in the section)\"\n ),\n isPathTraversed: z\n .boolean()\n .optional()\n .describe(\n \"Whether this question was on the logical traversal path \u2014 true for visible questions and hidden questions whose rules were evaluated, false for questions never reached\"\n ),\n })\n .describe(\"Response to a specific question in the feedback form\");\n\n// Response schema (contains question responses)\nexport const responseSchema = z\n .object({\n questions: z\n .array(questionResponseSchema)\n .min(1)\n .describe(\"Array of question responses\"),\n })\n .describe(\"User responses to feedback questions\");\n\n// Matched trigger properties schema (flexible object since definition is unknown)\nexport const matchedTriggerPropertiesSchema = z\n .object({\n customEventName: z\n .string()\n .nullable()\n .describe(\"Custom event name that triggered the feedback\"),\n currentPath: z\n .string()\n .describe(\"Current page path where feedback was triggered\"),\n eventType: z.string().describe(\"Type of event that triggered the feedback\"),\n })\n .passthrough()\n .describe(\"Properties of the trigger that matched for this feedback\");\n\n// Base submit feedback schema (without conditional response)\nexport const baseSubmitFeedbackSchema = z\n .object({\n formConfig: formConfigSchema.describe(\"Form configuration information\"),\n deviceInfo: deviceInfoSchema.describe(\"Device information\"),\n sessionInfo: sessionInfoSchema.optional().describe(\"Session information\"),\n userInfo: userInfoSchema.optional().describe(\"User information (optional)\"),\n matchedTriggerProperties: matchedTriggerPropertiesSchema.optional().describe(\n \"Properties of the matched trigger\"\n ),\n customProperties: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\"Custom properties for advanced use cases\"),\n })\n .describe(\"Base submit feedback request schema\");\n\n// Partial feedback schema (isPartialSubmit: true, response optional)\nexport const partialFeedbackSchema = baseSubmitFeedbackSchema\n .extend({\n formConfig: formConfigSchema.extend({\n isPartialSubmit: z\n .literal(true)\n .describe(\"Indicates this is a partial submission\"),\n }),\n response: responseSchema.optional().describe(\"User responses (optional for partial submit)\"),\n })\n .describe(\"Partial feedback request schema (response optional)\");\n\n// Full submit feedback schema (isPartialSubmit: false, response required)\nexport const submitFeedbackSchema = baseSubmitFeedbackSchema\n .extend({\n formConfig: formConfigSchema.extend({\n isPartialSubmit: z\n .literal(false)\n .describe(\"Indicates this is a full submission\"),\n }),\n response: responseSchema.describe(\"User responses (required for full submit)\"),\n })\n .describe(\"Full submit feedback request schema (response required)\");\n\n// Union schema for both cases (using regular union instead of discriminated union)\nexport const feedbackRequestSchema = z\n .union([partialFeedbackSchema, submitFeedbackSchema])\n .describe(\"Union schema for both partial and full feedback submissions\");\n\n// Type exports\nexport type FormConfig = z.infer<typeof formConfigSchema>;\nexport type QuestionResponse = z.infer<typeof questionResponseSchema>;\nexport type Response = z.infer<typeof responseSchema>;\nexport type MatchedTriggerProperties = z.infer<\n typeof matchedTriggerPropertiesSchema\n>;\nexport type BaseSubmitFeedback = z.infer<typeof baseSubmitFeedbackSchema>;\nexport type PartialFeedback = z.infer<typeof partialFeedbackSchema>;\nexport type SubmitFeedback = z.infer<typeof submitFeedbackSchema>;\nexport type FeedbackRequest = z.infer<typeof feedbackRequestSchema>;\n", "import { z } from \"zod\";\nimport {\n deviceInfoSchema,\n sessionInfoSchema,\n userInfoSchema,\n} from \"./other-schema\";\nimport { combinedQuestionSchema, sectionSchema } from \"../fields/field-schema\";\nimport { LanguagesSchema } from \"../fields/other-screen-schema\";\nimport {\n otherConfigurationPropertiesSchema,\n appearancePropertiesSchema,\n} from \"../fields/form-properties-schema\";\nimport { masterPropertiesSchema } from \"../fields/other-properties-schema\";\nimport { audienceTriggerPropertiesSchema } from \"../fields/auto-trigger-schema\";\n\n// Individual feedback configuration item schema\nexport const feedbackConfigurationItemSchema = z\n .object({\n feedbackConfigurationId: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the feedback configuration\"),\n feedbackTitle: z.string().describe(\"Title of the feedback configuration\"),\n // duration: durationSchema\n // .describe(\"Active duration for this feedback configuration\"),\n triggerProperties: audienceTriggerPropertiesSchema.describe(\n \"Trigger properties including auto/manual settings and audience segments\"\n ),\n appearanceProperties: z\n .object({\n themes: z\n .object({\n light: z\n .object({\n theme: z\n .string()\n .optional()\n .describe(\"Theme for light mode (shadcn variables JSON)\"),\n })\n .describe(\"Light theme\"),\n dark: z\n .object({\n theme: z\n .string()\n .optional()\n .describe(\"Theme for dark mode (shadcn variables JSON)\"),\n })\n .describe(\"Dark theme\"),\n })\n .nullable()\n .optional()\n .describe(\"Theme configuration (optional)\"),\n featureSettings: z\n .object({\n darkOverlay: z.boolean().describe(\"Whether to show dark overlay\"),\n closeButton: z.boolean().describe(\"Whether to show close button\"),\n progressBar: z.boolean().describe(\"Whether to show progress bar\"),\n showBranding: z.boolean().describe(\"Whether to show branding\"),\n customPosition: z\n .boolean()\n .describe(\"Whether custom position is enabled\"),\n customIconPosition: z\n .boolean()\n .describe(\"Whether custom icon position is enabled\"),\n customCss: z\n .string()\n .nullable()\n .optional()\n .describe(\"Custom CSS link (optional)\"),\n enableShareableKeyboardNavigation: z\n .boolean()\n .default(false)\n .describe(\n \"Whether keyboard navigation is enabled for the shareable widget experience\"\n ),\n rtl: z\n .boolean()\n .describe(\"Whether right-to-left text direction is enabled\"),\n previousButton: z\n .enum([\"never\", \"always\"])\n .describe(\"Previous button: never (hidden) or always (shown)\"),\n maxDialogHeightPercentInApp: z\n .number()\n .int()\n .min(10)\n .max(100)\n .optional()\n .describe(\"Maximum height of the in-app dialog as a percentage of the viewport height (10\u2013100)\"),\n })\n .describe(\"Feature settings for the feedback form\"),\n selectedIconPosition: z\n .string()\n .describe(\"Selected position for the feedback icon\"),\n selectedPosition: z\n .string()\n .describe(\"Selected position for the feedback form\"),\n })\n .describe(\"Appearance properties for the feedback form\"),\n })\n .describe(\"Individual feedback configuration item in the list\");\n\n// Form configuration schema for fetch operations\nexport const fetchFormConfigSchema = z\n .object({\n feedbackConfigurationId: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the feedback configuration\"),\n responseLanguageCode: z\n .string()\n .length(2)\n .describe(\"Language code for the response (e.g., 'en', 'es')\"),\n })\n .describe(\"Form configuration for fetching feedback details\");\n\n// Fetch configuration list request schema\nexport const fetchConfigurationListSchema = z\n .object({\n deviceInfo: deviceInfoSchema.describe(\"Device information\"),\n sessionInfo: sessionInfoSchema.describe(\"Session information\"),\n userInfo: userInfoSchema.optional().describe(\"User information (optional)\"),\n force: z\n .boolean()\n .optional()\n .describe(\"Forcefully fetch eligible feedback list (optional)\"),\n })\n .strict()\n .describe(\"Request schema for fetching available feedback configurations\");\n\n// Fetch feedback details request schema\nexport const fetchFeedbackDetailsSchema = z\n .object({\n formConfig: fetchFormConfigSchema.describe(\n \"Form configuration for the specific feedback\"\n ),\n deviceInfo: deviceInfoSchema.describe(\"Device information\"),\n sessionInfo: sessionInfoSchema.describe(\"Session information\"),\n userInfo: userInfoSchema.optional().describe(\"User information (optional)\"),\n })\n .strict()\n .describe(\"Request schema for fetching specific feedback form details\");\n\n// Form configuration response schema (title/description + optional server-enriched fields)\nexport const formConfigurationResponseSchema = z\n .object({\n formTitle: z.string().describe(\"Title of the feedback form\"),\n formDescription: z.string().describe(\"Description of the feedback form\"),\n respondentsCount: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe(\n \"Total number of respondents enriched by the server at fetch time; used alongside respondentsShowMinThreshold to decide whether to display the welcome badge\"\n ),\n })\n .describe(\"Form configuration response with title, description, and optional respondent count\");\n\n// Logic jump rule schema \u2014 a single conditional branch with a JSON Logic expression and target question\nexport const logicJumpRuleSchema = z\n .object({\n jsonLogic: z\n .record(z.string(), z.unknown())\n .describe(\"JSON Logic expression to evaluate\"),\n targetQuestionId: z\n .string()\n .describe(\"Question ID to navigate to when this rule matches\"),\n })\n .describe(\"A single logic jump rule mapping a condition to a target question\");\n\n// Logic jump rules schema \u2014 keyed by questionId or the special key '__workflow_start__'\nexport const logicJumpRulesSchema = z\n .record(\n z.string(),\n z.array(logicJumpRuleSchema)\n )\n .describe(\n \"Logic jump rules keyed by question ID (or '__workflow_start__'). Each entry is an ordered array of rules evaluated top-down; the first matching rule wins.\"\n );\n\n// Questionnaire fields response schema (matches actual API response structure)\nexport const questionnaireFieldsResponseSchema = z\n .object({\n questions: z\n .record(z.string(), combinedQuestionSchema)\n .describe(\"Collection of questions keyed by their string identifiers\"),\n sections: z\n .array(sectionSchema)\n .describe(\n \"Array of sections that organize questions into logical groups\"\n ),\n translations: z\n .record(z.string(), z.any())\n .describe(\n \"Translations object (can be empty or contain language-specific translations)\"\n ),\n selectedLanguages: LanguagesSchema.describe(\n \"Array of languages selected for this questionnaire\"\n ),\n isLogicJumpsEnabled: z\n .boolean()\n .optional()\n .default(false)\n .describe(\"When true, form navigation follows logicJumpRules instead of linear section order\"),\n logicJumpRules: logicJumpRulesSchema\n .optional()\n .describe(\"Conditional navigation rules evaluated per question to determine the next question to show\"),\n contextVariables: z\n .array(z.string())\n .optional()\n .describe(\"List of context variable keys expected by the form (informational)\"),\n })\n .describe(\n \"Questionnaire fields response including questions, sections, translations, selected languages, and optional logic jump configuration\"\n );\n\n// Fetch feedback details response schema using existing schemas\nexport const fetchFeedbackDetailsResponseSchema = z\n .object({\n feedbackConfigurationId: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the feedback configuration\"),\n feedbackIdentifier: z\n .string()\n .uuid()\n .describe(\"Unique identifier for this specific feedback instance\"),\n formConfiguration: formConfigurationResponseSchema.describe(\n \"Form configuration including title, description, and optional respondent count for the welcome badge\"\n ),\n questionnaireFields: questionnaireFieldsResponseSchema.describe(\n \"Questionnaire structure including questions, sections, translations, and languages\"\n ),\n otherConfigurationProperties: otherConfigurationPropertiesSchema.describe(\n \"Other configuration properties using existing schema\"\n ),\n appearanceProperties: appearancePropertiesSchema.describe(\n \"Appearance properties including theme configuration\"\n ),\n })\n .strict()\n .describe(\n \"Complete response schema for fetchFeedbackDetails API using existing field schemas\"\n );\n\n// Fetch configuration list response schema\nexport const fetchConfigurationListResponseSchema = z\n .object({\n masterProperties: masterPropertiesSchema.describe(\n \"Master properties for global survey settings\"\n ),\n feedbackConfiguration: z\n .array(feedbackConfigurationItemSchema)\n .describe(\"Array of available feedback configurations\"),\n })\n .strict()\n .describe(\"Response schema for fetchConfigurationList API\");\n\n// Type exports\nexport type FeedbackConfigurationItem = z.infer<\n typeof feedbackConfigurationItemSchema\n>;\nexport type FetchFormConfig = z.infer<typeof fetchFormConfigSchema>;\nexport type FetchConfigurationListRequest = z.infer<\n typeof fetchConfigurationListSchema\n>;\nexport type FetchFeedbackDetailsRequest = z.infer<\n typeof fetchFeedbackDetailsSchema\n>;\nexport type FormConfigurationResponse = z.infer<\n typeof formConfigurationResponseSchema\n>;\nexport type QuestionnaireFieldsResponse = z.infer<\n typeof questionnaireFieldsResponseSchema\n>;\nexport type FetchFeedbackDetailsResponse = z.infer<\n typeof fetchFeedbackDetailsResponseSchema\n>;\nexport type FetchConfigurationListResponse = z.infer<\n typeof fetchConfigurationListResponseSchema\n>;\nexport type LogicJumpRule = z.infer<typeof logicJumpRuleSchema>;\nexport type LogicJumpRules = z.infer<typeof logicJumpRulesSchema>;\n", "import { z } from \"zod\";\n\n// Refine text request schema\nexport const refineTextParamsSchema = z\n .object({\n questionId: z\n .string()\n .describe(\"Unique identifier for the question\"),\n feedbackConfigurationId: z\n .string()\n .uuid()\n .describe(\"Unique identifier for the feedback configuration\"),\n userText: z\n .string()\n .describe(\"Original text input from the user\"),\n })\n .strict()\n .describe(\"Request schema for refining user text input\");\n\n// Refine text response schema (flat format)\n// Success: { message: \"ok\", refinedText: \"...\" }\n// Error: { status?: number, error?: string, message: \"...\" }\nexport const refineTextResponseSchema = z\n .object({\n message: z.string().optional().describe(\"Human-readable message\"),\n refinedText: z\n .string()\n .optional()\n .describe(\"Refined/improved version of the user text (success only)\"),\n status: z\n .number()\n .optional()\n .describe(\"HTTP status code (error responses)\"),\n error: z.string().optional().describe(\"Error type (error responses)\"),\n code: z.string().optional().describe(\"Error code for display mapping\"),\n })\n .describe(\"Response schema for refine text API operation\");\n\n// Legacy data schema - kept for backwards compatibility if needed\nexport const refineTextDataSchema = z\n .object({\n userText: z.string().describe(\"Original text input from the user\"),\n refinedText: z.string().describe(\"Refined/improved version of the user text\"),\n })\n .describe(\"Data containing original and refined text (legacy nested format)\");\n\n// Type exports\nexport type RefineTextParams = z.infer<typeof refineTextParamsSchema>;\nexport type RefineTextData = z.infer<typeof refineTextDataSchema>;\nexport type RefineTextResponse = z.infer<typeof refineTextResponseSchema>;", "export function convertObject<\n TInput extends object,\n TResult extends\n | ObjectToCamel<TInput>\n | ObjectToSnake<TInput>\n | ObjectToPascal<TInput>,\n>(obj: TInput, keyConverter: (arg: string) => string): TResult {\n if (obj === null || typeof obj === 'undefined' || typeof obj !== 'object') {\n return obj;\n }\n\n const out = (Array.isArray(obj) ? [] : {}) as TResult;\n for (const [k, v] of Object.entries(obj)) {\n let newKey = k;\n if (typeof k === 'string' && !k.includes('-')) {\n newKey = keyConverter(k);\n }\n\n // eslint-disable-next-line\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n out[newKey] = Array.isArray(v)\n ? (v.map(<ArrayItem extends object>(item: ArrayItem) =>\n typeof item === 'object' &&\n !(item instanceof Uint8Array) &&\n !(item instanceof Date)\n ? convertObject<\n ArrayItem,\n TResult extends ObjectToCamel<TInput>\n ? ObjectToCamel<ArrayItem>\n : TResult extends ObjectToPascal<TInput>\n ? ObjectToPascal<ArrayItem>\n : ObjectToSnake<ArrayItem>\n >(item, keyConverter)\n : item,\n ) as unknown[])\n : v instanceof Uint8Array || v instanceof Date\n ? v\n : typeof v === 'object'\n ? convertObject<\n typeof v,\n TResult extends ObjectToCamel<TInput>\n ? ObjectToCamel<typeof v>\n : TResult extends ObjectToPascal<TInput>\n ? ObjectToPascal<typeof v>\n : ObjectToSnake<typeof v>\n >(v, keyConverter)\n : (v as unknown);\n }\n return out;\n}\n\nexport function toCamel<T extends string>(term: T): ToCamel<T> {\n return (\n term.length === 1\n ? term.toLowerCase()\n : term\n .replace(/^([A-Z])/, (m) => m[0].toLowerCase())\n .replace(/[_-]([a-z0-9])/g, (m) => m[1].toUpperCase())\n ) as ToCamel<T>;\n}\n\nexport function objectToCamel<T extends object>(obj: T): ObjectToCamel<T> {\n return convertObject(obj, toCamel);\n}\n\nexport function toSnake<T extends string>(term: T): ToSnake<T> {\n let result: string = term;\n let circuitBreaker = 0;\n\n while (\n (/([a-z])([0-9])/.exec(result)?.length || 0) > 2 &&\n circuitBreaker < 10\n ) {\n result = result.replace(\n /([a-z])([0-9])/,\n (_all, $1: string, $2: string) =>\n `${$1.toLowerCase()}_${$2.toLowerCase()}`,\n );\n\n circuitBreaker += 1;\n }\n\n while (\n (/(.+?)([A-Z])/.exec(result)?.length || 0) > 2 &&\n circuitBreaker < 10\n ) {\n result = result.replace(\n /(.+?)([A-Z])/,\n (_all, $1: string, $2: string) =>\n `${$1.toLowerCase()}_${$2.toLowerCase()}`,\n );\n circuitBreaker += 1;\n }\n\n return result.toLowerCase() as ToSnake<T>;\n}\n\nexport function objectToSnake<T extends object>(obj: T): ObjectToSnake<T> {\n return convertObject(obj, toSnake);\n}\n\nexport function toPascal<T extends string>(term: T): ToPascal<T> {\n return toCamel(term).replace(/^([a-z])/, (m) =>\n m[0].toUpperCase(),\n ) as ToPascal<T>;\n}\n\nexport function objectToPascal<T extends object>(obj: T): ObjectToPascal<T> {\n return convertObject(obj, toPascal);\n}\n\nexport type ToCamel<S extends string | number | symbol> = S extends string\n ? S extends `${infer Head}_${infer Tail}`\n ? `${ToCamel<Uncapitalize<Head>>}${Capitalize<ToCamel<Tail>>}`\n : S extends `${infer Head}-${infer Tail}`\n ? `${ToCamel<Uncapitalize<Head>>}${Capitalize<ToCamel<Tail>>}`\n : Uncapitalize<S>\n : never;\n\nexport type ObjectToCamel<T extends object | undefined | null> =\n T extends undefined\n ? undefined\n : T extends null\n ? null\n : T extends Array<infer ArrayType>\n ? ArrayType extends object\n ? Array<ObjectToCamel<ArrayType>>\n : Array<ArrayType>\n : T extends Uint8Array\n ? Uint8Array\n : T extends Date\n ? Date\n : {\n [K in keyof T as K extends `${string}-${string}` ? K : ToCamel<K>]: T[K] extends\n | Array<infer ArrayType>\n | undefined\n | null\n ? ArrayType extends object\n ? Array<ObjectToCamel<ArrayType>>\n : Array<ArrayType>\n : T[K] extends object | undefined | null\n ? ObjectToCamel<T[K]>\n : T[K];\n };\n\nexport type ToPascal<S extends string | number | symbol> = S extends string\n ? S extends `${infer Head}_${infer Tail}`\n ? `${Capitalize<ToCamel<Head>>}${Capitalize<ToCamel<Tail>>}`\n : S extends `${infer Head}-${infer Tail}`\n ? `${Capitalize<ToCamel<Head>>}${Capitalize<ToCamel<Tail>>}`\n : Capitalize<S>\n : never;\n\nexport type ObjectToPascal<T extends object | undefined | null> =\n T extends undefined\n ? undefined\n : T extends null\n ? null\n : T extends Array<infer ArrayType>\n ? ArrayType extends object\n ? Array<ObjectToPascal<ArrayType>>\n : Array<ArrayType>\n : T extends Uint8Array\n ? Uint8Array\n : T extends Date\n ? Date\n : {\n [K in keyof T as K extends `${string}-${string}` ? K : ToPascal<K>]: T[K] extends\n | Array<infer ArrayType>\n | undefined\n | null\n ? ArrayType extends object\n ? Array<ObjectToPascal<ArrayType>>\n : Array<ArrayType>\n : T[K] extends object | undefined | null\n ? ObjectToPascal<T[K]>\n : T[K];\n };\n\nexport type ToSnake<S extends string | number | symbol> = S extends string\n ? S extends `${infer Head}${CapitalChars}${infer Tail}` // string has a capital char somewhere\n ? Head extends '' // there is a capital char in the first position\n ? Tail extends ''\n ? Lowercase<S> /* 'A' */\n : S extends `${infer Caps}${Tail}` // tail exists, has capital characters\n ? Caps extends CapitalChars\n ? Tail extends CapitalLetters\n ? `${Lowercase<Caps>}_${Lowercase<Tail>}` /* 'AB' */\n : Tail extends `${CapitalLetters}${string}`\n ? `${ToSnake<Caps>}_${ToSnake<Tail>}` /* first tail char is upper? 'ABcd' */\n : `${ToSnake<Caps>}${ToSnake<Tail>}` /* 'AbCD','AbcD', */ /* TODO: if tail is only numbers, append without underscore */\n : never /* never reached, used for inference of caps */\n : never\n : Tail extends '' /* 'aB' 'abCD' 'ABCD' 'AB' */\n ? S extends `${Head}${infer Caps}`\n ? Caps extends CapitalChars\n ? Head extends Lowercase<Head> /* 'abcD' */\n ? Caps extends Numbers\n ? // Head exists and is lowercase, tail does not, Caps is a number, we may be in a sub-select\n // if head ends with number, don't split head an Caps, keep contiguous numbers together\n Head extends `${string}${Numbers}`\n ? never\n : // head does not end in number, safe to split. 'abc2' -> 'abc_2'\n `${ToSnake<Head>}_${Caps}`\n : `${ToSnake<Head>}_${ToSnake<Caps>}` /* 'abcD' 'abc25' */\n : never /* stop union type forming */\n : never\n : never /* never reached, used for inference of caps */\n : S extends `${Head}${infer Caps}${Tail}` /* 'abCd' 'ABCD' 'AbCd' 'ABcD' */\n ? Caps extends CapitalChars\n ? Head extends Lowercase<Head> /* is 'abCd' 'abCD' ? */\n ? Tail extends CapitalLetters /* is 'abCD' where Caps = 'C' */\n ? `${ToSnake<Head>}_${ToSnake<Caps>}_${Lowercase<Tail>}` /* aBCD Tail = 'D', Head = 'aB' */\n : Tail extends `${CapitalLetters}${string}` /* is 'aBCd' where Caps = 'B' */\n ? Head extends Numbers\n ? never /* stop union type forming */\n : Head extends `${string}${Numbers}`\n ? never /* stop union type forming */\n : `${Head}_${ToSnake<Caps>}_${ToSnake<Tail>}` /* 'aBCd' => `${'a'}_${Lowercase<'B'>}_${ToSnake<'Cd'>}` */\n : `${ToSnake<Head>}_${Lowercase<Caps>}${ToSnake<Tail>}` /* 'aBcD' where Caps = 'B' tail starts as lowercase */\n : never\n : never\n : never\n : S /* 'abc' */\n : never;\n\nexport type ObjectToSnake<T extends object | undefined | null> =\n T extends undefined\n ? undefined\n : T extends null\n ? null\n : T extends Array<infer ArrayType>\n ? ArrayType extends object\n ? Array<ObjectToSnake<ArrayType>>\n : Array<ArrayType>\n : T extends Uint8Array\n ? Uint8Array\n : T extends Date\n ? Date\n : {\n [K in keyof T as K extends `${string}-${string}` ? K : ToSnake<K>]: T[K] extends\n | Array<infer ArrayType>\n | undefined\n | null\n ? ArrayType extends object\n ? Array<ObjectToSnake<ArrayType>>\n : Array<ArrayType>\n : T[K] extends object | undefined | null\n ? ObjectToSnake<T[K]>\n : T[K];\n };\n\ntype CapitalLetters =\n | 'A'\n | 'B'\n | 'C'\n | 'D'\n | 'E'\n | 'F'\n | 'G'\n | 'H'\n | 'I'\n | 'J'\n | 'K'\n | 'L'\n | 'M'\n | 'N'\n | 'O'\n | 'P'\n | 'Q'\n | 'R'\n | 'S'\n | 'T'\n | 'U'\n | 'V'\n | 'W'\n | 'X'\n | 'Y'\n | 'Z';\n\ntype Numbers = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';\n\ntype CapitalChars = CapitalLetters | Numbers;", "import { z } from \"zod\";\nimport { themesSchema, themeConfigurationSchema } from \"./theme-schema\";\nimport { LanguageFieldSchema, LanguagesSchema } from \"./other-screen-schema\";\nimport { combinedQuestionSchema, sectionSchema } from \"./field-schema\";\nimport {\n otherConfigurationPropertiesSchema,\n} from \"./form-properties-schema\";\nimport { translationsSchema } from \"./translations-schema\";\n\n// Theme mode schema for current app mode\nexport const currentModeSchema = z\n .enum([\"light\", \"dark\"])\n .describe(\"Current theme mode of the application\");\n\n// Constants for current modes (explicit literal values for proper type inference)\nexport const CurrentModes = {\n LIGHT: \"light\" as const,\n DARK: \"dark\" as const,\n} as const;\n\n// App props schema\nexport const appPropsSchema = z\n .object({\n theme: themesSchema.describe(\n \"Theme configuration including light and dark theme colors\"\n ),\n currentMode: currentModeSchema.describe(\n \"Current theme mode (light or dark)\"\n ),\n currentLanguage: LanguageFieldSchema.describe(\n \"Currently selected language configuration\"\n ),\n questions: z\n .record(z.string(), combinedQuestionSchema)\n .describe(\"Collection of questions keyed by their string identifiers\"),\n questionLanguages: LanguagesSchema.describe(\n \"Available languages for questions\"\n ),\n otherConfigurationProperties: otherConfigurationPropertiesSchema.describe(\n \"Other configuration properties including form display options and translations\"\n ),\n translations: translationsSchema\n .optional()\n .describe(\n \"Multi-language translations for questions and form content (optional)\"\n ),\n onSectionChange: z\n .function({\n input: [z.number(), z.string()],\n output: z.void(),\n })\n .optional()\n .describe(\"Optional callback function triggered when section changes\"),\n onClose: z\n .function({\n input: [],\n output: z.void(),\n })\n .optional()\n .describe(\"Optional callback function triggered when the form is closed\"),\n sections: z\n .array(sectionSchema)\n .describe(\n \"Array of sections that organize questions into logical groups\"\n ),\n themeSettings: themeConfigurationSchema.describe(\n \"Complete theme configuration including colors, features, and positioning\"\n ),\n })\n .describe(\n \"Schema for application props interface containing all form configuration and state\"\n );\n\n// Type exports for TypeScript\nexport type CurrentMode = z.infer<typeof currentModeSchema>;\nexport type AppProps = z.infer<typeof appPropsSchema>;\n", "// Main entry point for encatch-typescript schemas\n\n// Field schema exports\nexport {\n questionTypeSchema,\n validationRuleTypeSchema,\n validationRuleSchema,\n visibilityConditionSchema,\n sectionSchema,\n questionStatusSchema,\n ratingDisplayStyleSchema,\n ratingRepresentationSizeSchema,\n multipleChoiceDisplayStyleSchema,\n multipleChoiceMultipleDisplayStyleSchema,\n yesNoDisplayStyleSchema,\n ratingMatrixDisplayStyleSchema,\n choiceOrderOptionSchema,\n questionSchema,\n ratingQuestionSchema,\n annotationQuestionSchema,\n questionOptionSchema,\n nestedOptionSchema,\n multipleChoiceSingleQuestionSchema,\n multipleChoiceMultipleQuestionSchema,\n npsQuestionSchema,\n shortAnswerQuestionSchema,\n longAnswerQuestionSchema,\n nestedDropdownQuestionSchema,\n dateQuestionSchema,\n dateFormatSchema,\n dateSeparatorSchema,\n csatQuestionSchema,\n csatScaleSchema,\n csatDisplayStyleSchema,\n opinionScaleQuestionSchema,\n rankingQuestionSchema,\n rankingDisplayStyleSchema,\n pictureChoiceQuestionSchema,\n signatureModeSchema,\n signatureQuestionSchema,\n fileUploadQuestionSchema,\n emailQuestionSchema,\n numberQuestionSchema,\n websiteQuestionSchema,\n phoneNumberQuestionSchema,\n addressSubFieldConfigSchema,\n addressQuestionSchema,\n videoAudioModeSchema,\n videoAudioQuestionSchema,\n schedulerProviderSchema,\n schedulerQuestionSchema,\n qnaWithAiQuestionSchema,\n paymentsUpiAmountConfigSchema,\n paymentsUpiQuestionSchema,\n combinedQuestionSchema,\n welcomeQuestionSchema,\n thankYouQuestionSchema,\n messagePanelQuestionSchema,\n exitFormQuestionSchema,\n yesNoQuestionSchema,\n consentQuestionSchema,\n ratingMatrixQuestionSchema,\n matrixSingleChoiceQuestionSchema,\n matrixMultipleChoiceQuestionSchema,\n // building blocks\n ratingMatrixStatementSchema,\n ratingMatrixScalePointSchema,\n ratingMatrixScaleSchema,\n matrixRowSchema,\n matrixColumnSchema,\n // Enum constants\n DateFormats,\n DateSeparators,\n CsatScales,\n CsatDisplayStyles,\n RankingDisplayStyles,\n SignatureModes,\n VideoAudioModes,\n SchedulerProviders,\n QuestionTypes,\n ValidationRuleTypes,\n VisibilityConditionOperators,\n QuestionStatuses,\n RatingDisplayStyles,\n RatingRepresentationSizes,\n MultipleChoiceDisplayStyles,\n MultipleChoiceMultipleDisplayStyles,\n YesNoDisplayStyles,\n RatingMatrixDisplayStyles,\n ChoiceOrderOptions,\n // Types\n type QuestionType,\n type ValidationRule,\n type VisibilityCondition,\n type QuestionStatus,\n type Question,\n type RatingDisplayStyle,\n type RatingRepresentationSize,\n type RatingQuestion,\n type AnnotationQuestion,\n type WelcomeQuestion,\n type ThankYouQuestion,\n type MessagePanelQuestion,\n type ExitFormQuestion,\n type YesNoDisplayStyle,\n type YesNoQuestion,\n type ConsentQuestion,\n type RatingMatrixStatement,\n type RatingMatrixScalePoint,\n type RatingMatrixScale,\n type RatingMatrixDisplayStyle,\n type RatingMatrixQuestion,\n type MatrixRow,\n type MatrixColumn,\n type MatrixSingleChoiceQuestion,\n type MatrixMultipleChoiceQuestion,\n type QuestionOption,\n type NestedOption,\n type MultipleChoiceDisplayStyle,\n type MultipleChoiceSingleQuestion,\n type MultipleChoiceMultipleDisplayStyle,\n type MultipleChoiceMultipleQuestion,\n type NpsQuestion,\n type ShortAnswerQuestion,\n type LongAnswerQuestion,\n type ChoiceOrderOption,\n type NestedDropdownQuestion,\n type DateFormat,\n type DateSeparator,\n type DateQuestion,\n type CsatScale,\n type CsatDisplayStyle,\n type CsatQuestion,\n type OpinionScaleQuestion,\n type RankingDisplayStyle,\n type RankingQuestion,\n type PictureChoiceQuestion,\n type SignatureMode,\n type SignatureQuestion,\n type FileUploadQuestion,\n type EmailQuestion,\n type NumberQuestion,\n type WebsiteQuestion,\n type PhoneNumberQuestion,\n type AddressSubFieldConfig,\n type AddressQuestion,\n type VideoAudioMode,\n type VideoAudioQuestion,\n type SchedulerProvider,\n type SchedulerQuestion,\n type QnaWithAiQuestion,\n type PaymentsUpiAmountConfig,\n type PaymentsUpiQuestion,\n type Section,\n type CombinedQuestion,\n} from \"./schemas/fields/field-schema\";\n\n// Answer schema exports\nexport {\n AnnotationMarkerSchema,\n AnnotationSchema,\n SignatureAnswerSchema,\n FileUploadAnswerItemSchema,\n FileUploadAnswerSchema,\n PhoneNumberAnswerSchema,\n AddressAnswerSchema,\n VideoAudioAnswerSchema,\n SchedulerAnswerSchema,\n QnaWithAiPairSchema,\n QnaWithAiAnswerSchema,\n PaymentsUpiAnswerSchema,\n AnswerItemSchema,\n AnswerSchema,\n type AnnotationMarker,\n type Annotation,\n type SignatureAnswer,\n type FileUploadAnswerItem,\n type FileUploadAnswer,\n type PhoneNumberAnswer,\n type AddressAnswer,\n type VideoAudioAnswer,\n type SchedulerAnswer,\n type QnaWithAiPair,\n type QnaWithAiAnswer,\n type PaymentsUpiAnswer,\n type AnswerItem,\n type Answer,\n} from \"./schemas/fields/answer-schema\";\n\n// Form schema exports\nexport {\n externalPublishingPropertiesSchema,\n publicationStatusSchema,\n feedbackConfigurationSchema,\n // Enum constants\n PublicationStatuses,\n // Types\n type PublicationStatus,\n type FeedbackConfiguration,\n type ExternalPublishingProperties,\n} from \"./schemas/fields/form-schema\";\n\n// Form properties schema exports\nexport {\n otherConfigurationPropertiesSchema,\n appearancePropertiesSchema,\n formPropertiesSchema,\n type FormProperties,\n type OtherConfigurationProperties,\n type AppearanceProperties,\n} from \"./schemas/fields/form-properties-schema\";\n\n// Other screen schema exports\nexport {\n OtherFieldsSchema,\n LanguageFieldSchema,\n LanguagesSchema,\n OtherFieldsTranslationSchema,\n // Types\n type OtherFields,\n type OtherFieldsTranslation,\n type LanguageField,\n type Languages,\n} from \"./schemas/fields/other-screen-schema\";\n\n// Theme schema exports\nexport {\n positionSchema,\n themeModeSchema,\n shareableModeSchema,\n previousButtonModeSchema,\n featureSettingsSchema,\n themeColorsSchema,\n themesSchema,\n themeConfigurationSchema,\n // Enum constants\n Positions,\n ThemeModes,\n ShareableModes,\n PreviousButtonModes,\n // Types\n type Position,\n type FeatureSettings,\n type ThemeColors,\n type Themes,\n type ThemeMode,\n type ShareableMode,\n type PreviousButtonMode,\n type ThemeConfiguration,\n} from \"./schemas/fields/theme-schema\";\n\n// Layout schema exports\nexport {\n focalPointSchema,\n imageAttachmentSchema,\n videoAttachmentSchema,\n colorAttachmentSchema,\n gradientAttachmentSchema,\n layoutAttachmentSchema,\n stackLayoutSchema,\n floatLayoutSchema,\n splitLayoutSchema,\n wallpaperLayoutSchema,\n sectionLayoutVariantSchema,\n layoutSurfaceSchema,\n sectionLayoutSchema,\n // Enum constants\n LayoutAttachmentTypes,\n LayoutTypes,\n // Types\n type FocalPoint,\n type ImageAttachment,\n type VideoAttachment,\n type ColorAttachment,\n type GradientAttachment,\n type LayoutAttachment,\n type StackLayout,\n type FloatLayout,\n type SplitLayout,\n type WallpaperLayout,\n type SectionLayoutVariant,\n type LayoutSurface,\n type SectionLayout,\n} from \"./schemas/fields/layout-schema\";\n\n// Translations schema exports\nexport {\n translationEntrySchema,\n ratingQuestionTranslationSchema,\n singleChoiceQuestionTranslationSchema,\n multipleChoiceQuestionTranslationSchema,\n npsQuestionTranslationSchema,\n shortAnswerQuestionTranslationSchema,\n longAnswerQuestionTranslationSchema,\n videoAudioQuestionTranslationSchema,\n dateQuestionTranslationSchema,\n signatureQuestionTranslationSchema,\n schedulerQuestionTranslationSchema,\n qnaWithAiQuestionTranslationSchema,\n paymentsUpiQuestionTranslationSchema,\n nestedSelectionQuestionTranslationSchema,\n annotationQuestionTranslationSchema,\n welcomeQuestionTranslationSchema,\n thankYouQuestionTranslationSchema,\n messagePanelQuestionTranslationSchema,\n yesNoQuestionTranslationSchema,\n consentQuestionTranslationSchema,\n ratingMatrixQuestionTranslationSchema,\n matrixSingleChoiceQuestionTranslationSchema,\n matrixMultipleChoiceQuestionTranslationSchema,\n questionTranslationSchema,\n sectionTranslationSchema,\n sectionTranslationsByLanguageSchema,\n questionCentricTranslationsSchema,\n translationsSchema,\n TranslationProvider,\n createTranslationProvider,\n type TranslationEntry,\n type RatingQuestionTranslation,\n type SingleChoiceQuestionTranslation,\n type MultipleChoiceQuestionTranslation,\n type NpsQuestionTranslation,\n type ShortAnswerQuestionTranslation,\n type LongAnswerQuestionTranslation,\n type VideoAudioQuestionTranslation,\n type DateQuestionTranslation,\n type SignatureQuestionTranslation,\n type SchedulerQuestionTranslation,\n type QnaWithAiQuestionTranslation,\n type PaymentsUpiQuestionTranslation,\n type NestedSelectionQuestionTranslation,\n type AnnotationQuestionTranslation,\n type WelcomeQuestionTranslation,\n type ThankYouQuestionTranslation,\n type MessagePanelQuestionTranslation,\n type YesNoQuestionTranslation,\n type ConsentQuestionTranslation,\n type RatingMatrixQuestionTranslation,\n type MatrixSingleChoiceQuestionTranslation,\n type MatrixMultipleChoiceQuestionTranslation,\n type QuestionTranslation,\n type SectionTranslation,\n type SectionTranslationsByLanguage,\n type QuestionCentricTranslations,\n type Translations,\n} from \"./schemas/fields/translations-schema\";\n\n// Completion CTA schema exports\nexport {\n platformCompletionCtaSchema,\n completionCtaSecondarySchema,\n completionCtaSchema,\n type PlatformCompletionCta,\n type CompletionCtaSecondary,\n type CompletionCta,\n type CompletionCtaAction,\n} from \"./schemas/fields/completion-cta-schema\";\n\n// Auto trigger schema exports\nexport {\n customEventFieldOperatorSchema,\n customEventFieldSchema,\n conditionalIfMetadataSchema,\n queryOutputSchema,\n conditionalIfSchema,\n triggerActionSchema,\n conditionalWhenSchema,\n filterConditionSchema,\n categorySpecificFiltersSchema,\n whoSchema,\n audienceSegmentSchema,\n audienceTriggerPropertiesSchema,\n type CustomEventFieldOperator,\n type CustomEventField,\n type ConditionalIfMetadata,\n type QueryOutput,\n type ConditionalIf,\n type TriggerAction,\n type ConditionalWhen,\n type FilterCondition,\n type CategorySpecificFilters,\n type Who,\n type AudienceSegment,\n type AudienceTriggerProperties,\n} from \"./schemas/fields/auto-trigger-schema\";\n\n// Master properties schema exports\nexport {\n masterPropertiesSchema,\n type MasterProperties,\n} from \"./schemas/fields/other-properties-schema\";\n\n// Device and session info schema exports\nexport {\n deviceThemeSchema,\n deviceInfoSchema,\n sessionInfoSchema,\n deviceSessionInfoSchema,\n userPropertiesSchema,\n userInfoSchema,\n // Enum constants\n DeviceThemes,\n // Types\n type DeviceTheme,\n type DeviceInfo,\n type SessionInfo,\n type DeviceSessionInfo,\n type UserProperties,\n type UserInfo,\n} from \"./schemas/api/other-schema\";\n\n// Submit feedback schema exports\nexport {\n formConfigSchema,\n questionResponseSchema,\n responseSchema,\n matchedTriggerPropertiesSchema,\n baseSubmitFeedbackSchema,\n partialFeedbackSchema,\n submitFeedbackSchema,\n feedbackRequestSchema,\n // Types\n type FormConfig,\n type QuestionResponse,\n type Response,\n type MatchedTriggerProperties,\n type BaseSubmitFeedback,\n type PartialFeedback,\n type SubmitFeedback,\n type FeedbackRequest,\n} from \"./schemas/api/submit-feedback-schema\";\n\n// Fetch feedback schema exports\nexport {\n feedbackConfigurationItemSchema,\n fetchFormConfigSchema,\n fetchConfigurationListSchema,\n fetchFeedbackDetailsSchema,\n formConfigurationResponseSchema,\n questionnaireFieldsResponseSchema,\n fetchFeedbackDetailsResponseSchema,\n fetchConfigurationListResponseSchema,\n logicJumpRuleSchema,\n logicJumpRulesSchema,\n // Types\n type FeedbackConfigurationItem,\n type FetchFormConfig,\n type FetchConfigurationListRequest,\n type FetchFeedbackDetailsRequest,\n type FormConfigurationResponse,\n type QuestionnaireFieldsResponse,\n type FetchFeedbackDetailsResponse,\n type FetchConfigurationListResponse,\n type LogicJumpRule,\n type LogicJumpRules,\n} from \"./schemas/api/fetch-feedback-schema\";\n\nexport {\n RefineTextParams,\n RefineTextResponse,\n RefineTextData,\n //Types\n refineTextDataSchema,\n refineTextParamsSchema,\n refineTextResponseSchema,\n} from \"./schemas/api/refine-text-schema\";\n\n// Case conversion utility exports\nexport {\n objectToCamel,\n objectToSnake,\n toSnake,\n toCamel,\n toPascal,\n objectToPascal,\n} from \"./helpers/case-convert-helper\";\n\nexport type {\n ObjectToCamel,\n ObjectToSnake,\n ToSnake,\n ToCamel,\n ToPascal,\n ObjectToPascal,\n} from \"./helpers/case-convert-helper\";\n\n// App props schema exports\nexport {\n currentModeSchema,\n appPropsSchema,\n // Enum constants\n CurrentModes,\n // Types\n type CurrentMode,\n type AppProps,\n} from \"./schemas/fields/app-props-schema\";\n\n// Re-export Zod for convenience (consumers should add zod to their dependencies)\nexport { z } from \"zod\";\n"],
|
|
5
|
+
"mappings": ";;;;AAAA,SAAS,KAAAA,UAAS;;;ACAlB,SAAS,SAAS;AAIX,IAAM,yBAAyB,EACnC,OAAO,EACP,IAAI,CAAC,EACL,SAAS,yBAAyB;AAG9B,IAAM,sCAAsC,EAAE,OAAO;AAAA,EAC1D,OAAO,uBAAuB,SAAS,4BAA4B;AAAA,EACnE,aAAa,uBACV,SAAS,EACT,SAAS,kCAAkC;AAAA,EAC9C,cAAc,uBACX,SAAS,EACT,SAAS,2BA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