prefect 3.6.16.dev2__py3-none-any.whl → 3.6.16.dev3__py3-none-any.whl

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.
prefect/_build_info.py CHANGED
@@ -1,5 +1,5 @@
1
1
  # Generated by versioningit
2
- __version__ = "3.6.16.dev2"
3
- __build_date__ = "2026-01-30 21:51:06.104489+00:00"
4
- __git_commit__ = "17574a7bfd5d441988acf1b86b1aa618e06af271"
2
+ __version__ = "3.6.16.dev3"
3
+ __build_date__ = "2026-02-01 08:13:48.533566+00:00"
4
+ __git_commit__ = "d264f42f6e99ead48f89c9793129eef4b7875eec"
5
5
  __dirty__ = False
@@ -16,6 +16,25 @@ ExceptionInfoType = Union[
16
16
  ]
17
17
 
18
18
 
19
+ def _make_record_serializable(record_dict: dict[str, Any]) -> dict[str, Any]:
20
+ """
21
+ Convert a log record dict to be JSON-serializable by replacing
22
+ non-serializable values with placeholder strings.
23
+
24
+ This is used as a fallback when the initial serialization attempt fails,
25
+ which can happen when log records contain objects like websocket connections
26
+ or other non-serializable types.
27
+ """
28
+ result = {}
29
+ for key, value in record_dict.items():
30
+ try:
31
+ orjson.dumps(value)
32
+ result[key] = value
33
+ except (TypeError, ValueError):
34
+ result[key] = f"<non-serializable: {type(value).__name__}>"
35
+ return result
36
+
37
+
19
38
  def format_exception_info(exc_info: ExceptionInfoType) -> dict[str, Any]:
20
39
  # if sys.exc_info() returned a (None, None, None) tuple,
21
40
  # then there's nothing to format
@@ -66,7 +85,11 @@ class JsonFormatter(logging.Formatter):
66
85
  if record.exc_info:
67
86
  record_dict["exc_info"] = format_exception_info(record.exc_info)
68
87
 
69
- log_json_bytes = self.serializer.dumps(record_dict)
88
+ try:
89
+ log_json_bytes = self.serializer.dumps(record_dict)
90
+ except Exception:
91
+ record_dict = _make_record_serializable(record_dict)
92
+ log_json_bytes = self.serializer.dumps(record_dict)
70
93
 
71
94
  # JSONSerializer returns bytes; decode to string to conform to
72
95
  # the `logging.Formatter.format` interface
@@ -1 +1 @@
1
- {"version":3,"file":"schema-form-BwTmkvJk.js","sources":["../../node_modules/lucide-react/dist/esm/icons/eye-off.js","../../node_modules/lucide-react/dist/esm/icons/eye.js","../../node_modules/lucide-react/dist/esm/icons/grip-vertical.js","../../src/components/schemas/utilities/guards.ts","../../src/components/schemas/utilities/mergeSchemaPropertyDefinition.ts","../../src/components/schemas/schema-form-input-all-of.tsx","../../src/components/schemas/utilities/getIndexForAnyOfPropertyValue.ts","../../src/components/schemas/utilities/getSchemaObjectLabel.ts","../../src/components/schemas/schema-form-input-any-of.tsx","../../node_modules/uuid/dist/stringify.js","../../node_modules/uuid/dist/rng.js","../../node_modules/uuid/dist/native.js","../../node_modules/uuid/dist/v4.js","../../src/components/schemas/types/errors.ts","../../src/components/schemas/schema-form-property-errors.tsx","../../src/components/schemas/types/prefect-kind-value.ts","../../src/components/schemas/utilities/convertValueToPrefectKind.ts","../../src/components/schemas/schema-form-property-menu.tsx","../../src/components/schemas/schema-form-input-array-item.tsx","../../src/components/schemas/schema-form-input-array-list.tsx","../../src/components/schemas/schema-form-input-enum.tsx","../../src/components/schemas/types/schemas.ts","../../src/components/schemas/utilities/asType.ts","../../src/components/schemas/schema-form-input-array.tsx","../../src/components/blocks/block-document-combobox/block-document-combobox.tsx","../../src/components/schemas/schema-form-input-block-document.tsx","../../src/components/schemas/schema-form-input-boolean.tsx","../../src/components/schemas/schema-form-input-integer.tsx","../../src/components/schemas/schema-form-input-null.tsx","../../src/components/schemas/schema-form-input-number.tsx","../../src/components/schemas/schema-form-input-prefect-kind-jinja.tsx","../../src/components/schemas/schema-form-input-prefect-kind-json.tsx","../../src/components/variables/variable-combobox/variable-combobox.tsx","../../src/components/schemas/schema-form-input-prefect-kind-workspace-variable.tsx","../../src/components/schemas/schema-form-input-string-format-date.tsx","../../src/components/schemas/schema-form-input-string-format-json.tsx","../../src/components/schemas/schema-form-input-string-format-password.tsx","../../src/components/schemas/schema-form-input-string-format-time-delta.tsx","../../src/components/schemas/schema-form-input-string.tsx","../../src/components/schemas/schema-form-input-unknown.tsx","../../src/components/schemas/schema-form-input.tsx","../../src/components/schemas/schema-form-property-description.tsx","../../src/components/schemas/schema-form-property-label.tsx","../../src/components/schemas/schema-form-property.tsx","../../src/components/schemas/utilities/sortByPropertyPosition.ts","../../src/components/schemas/schema-form-input-object.tsx","../../src/components/schemas/schema-form-provider.tsx","../../src/components/schemas/schema-form.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\",\n key: \"ct8e1f\"\n }\n ],\n [\"path\", { d: \"M14.084 14.158a3 3 0 0 1-4.242-4.242\", key: \"151rxh\" }],\n [\n \"path\",\n {\n d: \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\",\n key: \"13bj9a\"\n }\n ],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n];\nconst EyeOff = createLucideIcon(\"eye-off\", __iconNode);\n\nexport { __iconNode, EyeOff as default };\n//# sourceMappingURL=eye-off.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Eye = createLucideIcon(\"eye\", __iconNode);\n\nexport { __iconNode, Eye as default };\n//# sourceMappingURL=eye.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"9\", cy: \"12\", r: \"1\", key: \"1vctgf\" }],\n [\"circle\", { cx: \"9\", cy: \"5\", r: \"1\", key: \"hp0tcf\" }],\n [\"circle\", { cx: \"9\", cy: \"19\", r: \"1\", key: \"fkjjf6\" }],\n [\"circle\", { cx: \"15\", cy: \"12\", r: \"1\", key: \"1tmaij\" }],\n [\"circle\", { cx: \"15\", cy: \"5\", r: \"1\", key: \"19l28e\" }],\n [\"circle\", { cx: \"15\", cy: \"19\", r: \"1\", key: \"f4zoj3\" }]\n];\nconst GripVertical = createLucideIcon(\"grip-vertical\", __iconNode);\n\nexport { __iconNode, GripVertical as default };\n//# sourceMappingURL=grip-vertical.js.map\n","import { isDate } from \"date-fns\";\nimport type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\n\nexport function isString(value: unknown): value is string {\n\treturn typeof value === \"string\";\n}\n\nexport function isDefined<T>(value: T | undefined): value is T {\n\treturn value !== undefined;\n}\n\nexport function isRecord(item: unknown): item is Record<PropertyKey, unknown> {\n\treturn (\n\t\titem !== null &&\n\t\ttypeof item === \"object\" &&\n\t\t!Array.isArray(item) &&\n\t\t!isDate(item)\n\t);\n}\n\nexport function isArray(item: unknown): item is unknown[] {\n\treturn Array.isArray(item);\n}\n\nexport function isEmptyObject(value: unknown): value is Record<string, never> {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\t!Array.isArray(value) &&\n\t\tvalue !== null &&\n\t\tObject.keys(value).length === 0\n\t);\n}\n\nexport function isReferenceObject(\n\tproperty: SchemaObject | ReferenceObject,\n): property is ReferenceObject {\n\treturn \"$ref\" in property;\n}\n\nexport function isAnyOfObject(\n\tproperty: SchemaObject,\n): property is SchemaObject & { anyOf: (SchemaObject | ReferenceObject)[] } {\n\treturn \"anyOf\" in property && isDefined(property.anyOf);\n}\n\nexport function isOneOfObject(\n\tproperty: SchemaObject,\n): property is SchemaObject & { oneOf: (SchemaObject | ReferenceObject)[] } {\n\treturn \"oneOf\" in property && isDefined(property.oneOf);\n}\n\nexport function isAllOfObject(\n\tproperty: SchemaObject,\n): property is SchemaObject & { allOf: (SchemaObject | ReferenceObject)[] } {\n\treturn \"allOf\" in property && isDefined(property.allOf);\n}\n\nexport function isItemsObject(\n\tproperty: SchemaObject,\n): property is SchemaObject & {\n\titems: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n} {\n\treturn \"items\" in property && isDefined(property.items);\n}\n","import merge from \"lodash.merge\";\nimport type {\n\tObjectSubtype,\n\tReferenceObject,\n\tSchemaObject,\n} from \"openapi-typescript\";\nimport { isRecord, isReferenceObject } from \"./guards\";\n\ntype SchemaWithDefinitions = SchemaObject &\n\tObjectSubtype & {\n\t\tdefinitions: Record<string, SchemaObject>;\n\t};\n\nfunction isSchemaWithDefinitions(\n\tschema: SchemaObject | ReferenceObject | ObjectSubtype,\n): schema is SchemaWithDefinitions {\n\treturn \"definitions\" in schema && isRecord(schema.definitions);\n}\n\nexport function getSchemaDefinition(\n\tschema: SchemaObject | ReferenceObject | ObjectSubtype,\n\tdefinition: string,\n): SchemaObject {\n\tif (isSchemaWithDefinitions(schema)) {\n\t\tconst definitionKey = definition.replace(\"#/definitions/\", \"\");\n\t\tconst definitionSchema = schema.definitions?.[definitionKey];\n\n\t\tif (!definitionSchema) {\n\t\t\tthrow new Error(`Definition not found for ${definition}`);\n\t\t}\n\n\t\treturn definitionSchema;\n\t}\n\tif (\"$defs\" in schema && isRecord(schema.$defs)) {\n\t\tconst definitionKey = definition.replace(\"#/$defs/\", \"\");\n\t\tconst definitionSchema = schema.$defs?.[definitionKey];\n\t\tif (!definitionSchema) {\n\t\t\tthrow new Error(`Definition not found for ${definition}`);\n\t\t}\n\n\t\treturn definitionSchema;\n\t}\n\n\tthrow new Error(\"Schema does not contain definitions\");\n}\n\nexport function mergeSchemaPropertyDefinition(\n\tproperty: SchemaObject | ReferenceObject,\n\tschema: SchemaObject & ObjectSubtype,\n): SchemaObject {\n\tif (isReferenceObject(property) && typeof property.$ref === \"string\") {\n\t\tconst { $ref, ...rest } = property;\n\n\t\treturn merge({}, getSchemaDefinition(schema, $ref), rest);\n\t}\n\n\treturn property as SchemaObject;\n}\n","import merge from \"lodash.merge\";\nimport type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\nimport { useMemo } from \"react\";\nimport { SchemaFormInput } from \"./schema-form-input\";\nimport type { SchemaFormErrors } from \"./types/errors\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { isReferenceObject } from \"./utilities/guards\";\nimport { getSchemaDefinition } from \"./utilities/mergeSchemaPropertyDefinition\";\n\nexport type SchemaFormInputAllOfProps = {\n\tproperty: SchemaObject & { allOf: (SchemaObject | ReferenceObject)[] };\n\tvalue: unknown;\n\tonValueChange: (value: unknown) => void;\n\terrors: SchemaFormErrors;\n\tid: string;\n};\n\nexport function SchemaFormInputAllOf({\n\tproperty,\n\tvalue,\n\tonValueChange,\n\terrors,\n\tid,\n}: SchemaFormInputAllOfProps) {\n\tconst { schema } = useSchemaFormContext();\n\n\tconst merged = useMemo(() => {\n\t\tconst { allOf, ...baseProperty } = property;\n\n\t\tconst definitions = allOf.reduce((property, definition) => {\n\t\t\tif (isReferenceObject(definition)) {\n\t\t\t\tconst reference = getSchemaDefinition(schema, definition.$ref);\n\n\t\t\t\treturn merge({}, property, reference);\n\t\t\t}\n\n\t\t\treturn merge({}, property, definition);\n\t\t}, {});\n\n\t\treturn merge({}, definitions, baseProperty);\n\t}, [property, schema]);\n\n\treturn (\n\t\t<SchemaFormInput\n\t\t\tvalue={value}\n\t\t\tonValueChange={onValueChange}\n\t\t\terrors={errors}\n\t\t\tproperty={merged}\n\t\t\tid={id}\n\t\t/>\n\t);\n}\n","import type { SchemaObject } from \"openapi-typescript\";\nimport {\n\tisArray,\n\tisDefined,\n\tisEmptyObject,\n\tisRecord,\n\tisReferenceObject,\n} from \"./guards\";\nimport { getSchemaDefinition } from \"./mergeSchemaPropertyDefinition\";\n\ntype InitialIndexContext = {\n\tproperty: SchemaObject;\n\tvalue: unknown;\n\tschema: SchemaObject;\n};\n\n/**\n * Get the index of the definition that matches the value\n * @param value - The value to match\n * @param property - The property to match\n * @param schema - The schema to match\n * @returns The index of the definition that matches the value\n */\nexport function getIndexForAnyOfPropertyValue({\n\tvalue,\n\tproperty,\n\tschema,\n}: InitialIndexContext): number {\n\tconst valueOrDefaultValue = isDefined(value) ? value : property.default;\n\n\t// if there's no value default to showing the first definition\n\tif (!isDefined(valueOrDefaultValue)) {\n\t\treturn 0;\n\t}\n\n\tconst definitions = getSchemaPropertyAnyOfDefinitions(property, schema);\n\n\tswitch (typeof valueOrDefaultValue) {\n\t\tcase \"string\":\n\t\t\treturn definitions.findIndex(\n\t\t\t\t(definition) => definition.type === \"string\",\n\t\t\t);\n\t\tcase \"number\":\n\t\t\treturn definitions.findIndex(\n\t\t\t\t(definition) =>\n\t\t\t\t\tdefinition.type === \"number\" || definition.type === \"integer\",\n\t\t\t);\n\t\tcase \"boolean\":\n\t\t\treturn definitions.findIndex(\n\t\t\t\t(definition) => definition.type === \"boolean\",\n\t\t\t);\n\t\tcase \"object\":\n\t\t\treturn getObjectDefinitionIndex(valueOrDefaultValue, definitions);\n\t\tdefault:\n\t\t\treturn -1;\n\t}\n}\n\n/**\n * Get the definitions for the anyOf property\n * @param property - The property to get the definitions for\n * @param schema - The schema to get the definitions for\n * @returns The definitions for the anyOf property\n */\nfunction getSchemaPropertyAnyOfDefinitions(\n\tproperty: SchemaObject,\n\tschema: SchemaObject,\n): SchemaObject[] {\n\tif (!property.anyOf) {\n\t\treturn [];\n\t}\n\n\treturn property.anyOf.map((definition) => {\n\t\tif (isReferenceObject(definition)) {\n\t\t\treturn getSchemaDefinition(schema, definition.$ref);\n\t\t}\n\n\t\treturn definition;\n\t});\n}\n\n/**\n * Get the index of the definition that matches a value that is an array, record, or null\n * @param value - The value to match\n * @param definitions - The definitions to match\n * @returns The index of the definition that matches the value\n */\nfunction getObjectDefinitionIndex(\n\tvalue: object | null,\n\tdefinitions: SchemaObject[],\n): number {\n\tif (isRecord(value)) {\n\t\treturn getRecordDefinitionIndex(value, definitions);\n\t}\n\n\tif (isArray(value)) {\n\t\treturn definitions.findIndex((definition) => definition.type === \"array\");\n\t}\n\n\tif (value === null) {\n\t\treturn definitions.findIndex((definition) => definition.type === \"null\");\n\t}\n\n\treturn -1;\n}\n\n/**\n * Get the index of the definition that matches a value that is an record\n * @param value - The value to match\n * @param definitions - The definitions to match\n * @returns The index of the definition that matches the value\n */\nfunction getRecordDefinitionIndex(\n\tvalue: Record<string, unknown>,\n\tdefinitions: SchemaObject[],\n): number {\n\tif (isEmptyObject(value)) {\n\t\treturn definitions.findIndex((definition) => definition.type === \"object\");\n\t}\n\n\tconst valueKeys = Object.keys(value);\n\n\tconst [index, keysInCommon] = definitions.reduce<[number, number]>(\n\t\t([resultIndex, resultKeysInCommon], definition, definitionIndex) => {\n\t\t\tif (!(\"properties\" in definition) || !definition.properties) {\n\t\t\t\treturn [resultIndex, resultKeysInCommon];\n\t\t\t}\n\n\t\t\tconst definitionKeys = Object.keys(definition.properties);\n\t\t\tconst definitionKeysInCommon = valueKeys.filter((value) =>\n\t\t\t\tdefinitionKeys.includes(value),\n\t\t\t).length;\n\n\t\t\tif (definitionKeysInCommon > resultKeysInCommon) {\n\t\t\t\treturn [definitionIndex, definitionKeysInCommon];\n\t\t\t}\n\n\t\t\treturn [resultIndex, resultKeysInCommon];\n\t\t},\n\t\t[0, 0],\n\t);\n\n\tif (keysInCommon === 0) {\n\t\treturn -1;\n\t}\n\n\treturn index;\n}\n","import type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\nimport { isReferenceObject } from \"./guards\";\nimport { getSchemaDefinition } from \"./mergeSchemaPropertyDefinition\";\n\nconst schemaObjectTypeLabels: Record<string, string | undefined> = {\n\tnull: \"None\",\n\tstring: \"str\",\n\tboolean: \"bool\",\n\tinteger: \"int\",\n\tnumber: \"float\",\n\tarray: \"list\",\n\tobject: \"dict\",\n};\n\nfunction getSchemaObjectTypeLabel(property: SchemaObject): string | undefined {\n\tif (property.type && typeof property.type === \"string\") {\n\t\treturn schemaObjectTypeLabels[property.type];\n\t}\n\n\treturn undefined;\n}\n\nexport function getSchemaObjectLabel(\n\tproperty: SchemaObject | ReferenceObject,\n\tschema: SchemaObject,\n): string {\n\tif (isReferenceObject(property)) {\n\t\tconst definition = getSchemaDefinition(schema, property.$ref);\n\n\t\treturn getSchemaObjectLabel(definition, schema);\n\t}\n\n\tconst fallback = getSchemaObjectTypeLabel(property) ?? \"Field\";\n\n\treturn property.title ?? property.format ?? fallback;\n}\n","import type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\nimport { useRef, useState } from \"react\";\nimport { Card } from \"../ui/card\";\nimport { ToggleGroup, ToggleGroupItem } from \"../ui/toggle-group\";\nimport { SchemaFormProperty } from \"./schema-form-property\";\nimport type { SchemaFormErrors } from \"./types/errors\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { getIndexForAnyOfPropertyValue } from \"./utilities/getIndexForAnyOfPropertyValue\";\nimport { getSchemaObjectLabel } from \"./utilities/getSchemaObjectLabel\";\nexport type SchemaFormInputAnyOfProps = {\n\tvalue: unknown;\n\tproperty: SchemaObject & { anyOf: (SchemaObject | ReferenceObject)[] };\n\tonValueChange: (value: unknown) => void;\n\terrors: SchemaFormErrors;\n};\n\nexport function SchemaFormInputAnyOf({\n\tvalue,\n\tproperty,\n\tonValueChange,\n\terrors,\n}: SchemaFormInputAnyOfProps) {\n\tconst { schema } = useSchemaFormContext();\n\tconst [selectedIndex, setSelectedIndex] = useState(\n\t\tgetIndexForAnyOfPropertyValue({ value, property, schema }),\n\t);\n\tconst values = useRef(new Map<number, unknown>());\n\n\tfunction onSelectedIndexChange(newSelectedIndexValue: string) {\n\t\tconst newSelectedIndex = Number.parseInt(newSelectedIndexValue, 10);\n\n\t\tif (Number.isNaN(newSelectedIndex)) {\n\t\t\tthrow new Error(`Invalid index: ${newSelectedIndexValue}`);\n\t\t}\n\n\t\tvalues.current.set(selectedIndex, value);\n\n\t\tsetSelectedIndex(newSelectedIndex);\n\n\t\tonValueChange(values.current.get(newSelectedIndex));\n\t}\n\n\treturn (\n\t\t<div className=\"grid grid-cols-1 gap-2\">\n\t\t\t<ToggleGroup\n\t\t\t\tsize=\"sm\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\ttype=\"single\"\n\t\t\t\tvalue={selectedIndex.toString()}\n\t\t\t\tonValueChange={onSelectedIndexChange}\n\t\t\t\tclassName=\"justify-start\"\n\t\t\t>\n\t\t\t\t{property.anyOf.map((option, index) => {\n\t\t\t\t\tconst label = getSchemaObjectLabel(option, schema);\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ToggleGroupItem key={label} value={index.toString()}>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</ToggleGroupItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ToggleGroup>\n\n\t\t\t<Card className=\"p-2\">\n\t\t\t\t<SchemaFormProperty\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tproperty={property.anyOf[selectedIndex]}\n\t\t\t\t\tonValueChange={onValueChange}\n\t\t\t\t\terrors={errors}\n\t\t\t\t\tshowLabel={false}\n\t\t\t\t\tnested={false}\n\t\t\t\t\t// This form property is nested within the anyOf property, so hard coding required to false because the anyOf property itself is what can be required\n\t\t\t\t\trequired={false}\n\t\t\t\t/>\n\t\t\t</Card>\n\t\t</div>\n\t);\n}\n","import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction _v4(options, buf, offset) {\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n return _v4(options, buf, offset);\n}\nexport default v4;\n","import type { components } from \"@/api/prefect\";\nimport { isRecord } from \"../utilities/guards\";\n\nexport type SchemaValueError = string;\nexport type SchemaValuePropertyError =\n\tcomponents[\"schemas\"][\"SchemaValuePropertyError\"];\nexport type SchemaValueIndexError =\n\tcomponents[\"schemas\"][\"SchemaValueIndexError\"];\nexport type SchemaFormError =\n\t| SchemaValueError\n\t| SchemaValuePropertyError\n\t| SchemaValueIndexError;\nexport type SchemaFormErrors = SchemaFormError[];\n\nexport function isSchemaValueError(error: unknown): error is SchemaValueError {\n\treturn typeof error === \"string\";\n}\n\nexport function isSchemaValuePropertyError(\n\terror: unknown,\n): error is SchemaValuePropertyError {\n\treturn isRecord(error) && \"property\" in error;\n}\n\nexport function isSchemaValueIndexError(\n\terror: unknown,\n): error is SchemaValueIndexError {\n\treturn isRecord(error) && \"index\" in error;\n}\n","import { useMemo } from \"react\";\nimport { isSchemaValueError, type SchemaFormErrors } from \"./types/errors\";\n\nexport type SchemaFormPropertyErrorsProps = {\n\terrors: SchemaFormErrors;\n};\n\nexport function SchemaFormPropertyErrors({\n\terrors,\n}: SchemaFormPropertyErrorsProps) {\n\tconst propertyErrors = useMemo(() => {\n\t\treturn errors.filter((error) => isSchemaValueError(error));\n\t}, [errors]);\n\n\tif (propertyErrors.length === 0) {\n\t\treturn null;\n\t}\n\n\tif (propertyErrors.length === 1) {\n\t\treturn <p className=\"text-red-500 text-sm\">{propertyErrors[0]}</p>;\n\t}\n\n\treturn (\n\t\t<ul className=\"list-disc text-red-500 text-sm pl-4\">\n\t\t\t{propertyErrors.map((error) => (\n\t\t\t\t<li key={error}>{error}</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n}\n","import { isDefined, isRecord, isString } from \"../utilities/guards\";\nimport { isPrefectKind, type PrefectKind } from \"./prefect-kind\";\n\ntype BasePrefectKindValue<\n\tTKind extends PrefectKind = PrefectKind,\n\tTRest extends Record<string, unknown> = Record<string, unknown>,\n> = {\n\t__prefect_kind: TKind;\n} & TRest;\n\nexport type PrefectKindValue =\n\t| PrefectKindValueJinja\n\t| PrefectKindValueJson\n\t| PrefectKindValueWorkspaceVariable;\n\nexport function getPrefectKindFromValue(value: unknown): PrefectKind | null {\n\tif (isPrefectKindValue(value)) {\n\t\treturn value.__prefect_kind;\n\t}\n\n\treturn null;\n}\n\nexport function isPrefectKindValue<T extends PrefectKind = PrefectKind>(\n\tvalue: unknown,\n\tkind?: T,\n): value is PrefectKindValue & { __prefect_kind: T } {\n\tconst isKindObject = isRecord(value) && isPrefectKind(value.__prefect_kind);\n\n\tif (!isKindObject) {\n\t\treturn false;\n\t}\n\n\tif (isPrefectKind(kind)) {\n\t\treturn value.__prefect_kind === kind;\n\t}\n\n\treturn true;\n}\n\nexport type PrefectKindValueJson = BasePrefectKindValue<\n\t\"json\",\n\t{\n\t\tvalue?: string;\n\t}\n>;\n\nexport function isPrefectKindValueJson(\n\tvalue: unknown,\n): value is PrefectKindValueJson {\n\treturn (\n\t\tisPrefectKindValue(value, \"json\") &&\n\t\t(isString(value.value) || !isDefined(value.value))\n\t);\n}\n\nexport type PrefectKindValueJinja = BasePrefectKindValue<\n\t\"jinja\",\n\t{\n\t\ttemplate?: string;\n\t}\n>;\n\nexport function isPrefectKindValueJinja(\n\tvalue: unknown,\n): value is PrefectKindValueJinja {\n\treturn isPrefectKindValue(value, \"jinja\") && isString(value.template);\n}\n\nexport type PrefectKindValueWorkspaceVariable = BasePrefectKindValue<\n\t\"workspace_variable\",\n\t{\n\t\tvariable_name?: string;\n\t}\n>;\n\nexport function isPrefectKindValueWorkspaceVariable(\n\tvalue: unknown,\n): value is PrefectKindValueWorkspaceVariable {\n\treturn (\n\t\tisPrefectKindValue(value, \"workspace_variable\") &&\n\t\t(isString(value.variable_name) || !isDefined(value.variable_name))\n\t);\n}\n","import type {\n\tArraySubtype,\n\tObjectSubtype,\n\tReferenceObject,\n\tSchemaObject,\n} from \"openapi-typescript\";\nimport type { PrefectKind } from \"../types/prefect-kind\";\nimport type {\n\tPrefectKindValueJinja,\n\tPrefectKindValueJson,\n\tPrefectKindValueWorkspaceVariable,\n} from \"../types/prefect-kind-value\";\nimport { getPrefectKindFromValue } from \"../types/prefect-kind-value\";\nimport { isAnyOfObject, isArray, isRecord } from \"./guards\";\nimport { mergeSchemaPropertyDefinition } from \"./mergeSchemaPropertyDefinition\";\n\ntype ConvertValueToPrefectKindInput = {\n\tvalue: unknown;\n\tproperty: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tschema: SchemaObject & ObjectSubtype;\n\tto: PrefectKind;\n};\n\nexport function convertValueToPrefectKind({\n\tvalue,\n\tproperty,\n\tschema,\n\tto,\n}: ConvertValueToPrefectKindInput) {\n\tconst from = getPrefectKindFromValue(value);\n\n\ttry {\n\t\tswitch (from) {\n\t\t\tcase \"json\":\n\t\t\t\treturn convertPrefectKindValueJson({\n\t\t\t\t\tjson: value as PrefectKindValueJson,\n\t\t\t\t\tproperty,\n\t\t\t\t\tschema,\n\t\t\t\t\tto,\n\t\t\t\t});\n\n\t\t\tcase \"jinja\":\n\t\t\t\treturn convertPrefectKindValueJinja({\n\t\t\t\t\tjinja: value as PrefectKindValueJinja,\n\t\t\t\t\tproperty,\n\t\t\t\t\tschema,\n\t\t\t\t\tto,\n\t\t\t\t});\n\n\t\t\tcase \"workspace_variable\":\n\t\t\t\treturn convertPrefectKindValueWorkspaceVariable({\n\t\t\t\t\tworkspaceVariable: value as PrefectKindValueWorkspaceVariable,\n\t\t\t\t\tto,\n\t\t\t\t});\n\n\t\t\tcase null:\n\t\t\t\treturn convertPrefectKindValueNull({ value, property, schema, to });\n\n\t\t\tdefault:\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\t\tthrow new Error(`Unknown prefect kind value: ${from satisfies never}`);\n\t\t}\n\t} catch (error) {\n\t\tconsole.error(error);\n\n\t\treturn undefined;\n\t}\n}\n\ntype ConvertPrefectKindValueJsonInput = {\n\tjson: PrefectKindValueJson;\n\tproperty: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tschema: SchemaObject & ObjectSubtype;\n\tto: PrefectKind;\n};\n\nfunction convertPrefectKindValueJson({\n\tjson,\n\tproperty,\n\tschema,\n\tto,\n}: ConvertPrefectKindValueJsonInput): unknown {\n\tswitch (to) {\n\t\tcase \"jinja\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"jinja\",\n\t\t\t\ttemplate: json.value,\n\t\t\t} satisfies PrefectKindValueJinja;\n\n\t\tcase \"json\":\n\t\t\treturn json;\n\n\t\tcase \"workspace_variable\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"workspace_variable\",\n\t\t\t\tvariable_name: undefined,\n\t\t\t} satisfies PrefectKindValueWorkspaceVariable;\n\n\t\tcase null:\n\t\t\tif (json.value === undefined) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst parsed: unknown = JSON.parse(json.value);\n\n\t\t\t\treturn coerceValueToProperties({ value: parsed, property, schema });\n\t\t\t} catch {\n\t\t\t\tthrow new InvalidSchemaValueTransformation(\"json\", null);\n\t\t\t}\n\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\t\t`mapSchemaValueJson missing case for kind: ${to satisfies never}`,\n\t\t\t);\n\t}\n}\n\ntype ConvertPrefectKindValueJinjaInput = {\n\tjinja: PrefectKindValueJinja;\n\tproperty: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tschema: SchemaObject & ObjectSubtype;\n\tto: PrefectKind;\n};\n\nfunction convertPrefectKindValueJinja({\n\tjinja,\n\tproperty,\n\tschema,\n\tto,\n}: ConvertPrefectKindValueJinjaInput): unknown {\n\tswitch (to) {\n\t\tcase \"jinja\":\n\t\t\treturn jinja;\n\n\t\tcase \"json\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"json\",\n\t\t\t\tvalue: jinja.template,\n\t\t\t} satisfies PrefectKindValueJson;\n\n\t\tcase \"workspace_variable\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"workspace_variable\",\n\t\t\t\tvariable_name: undefined,\n\t\t\t} satisfies PrefectKindValueWorkspaceVariable;\n\n\t\tcase null:\n\t\t\tif (jinja.template === undefined) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst parsed: unknown = JSON.parse(jinja.template);\n\n\t\t\t\treturn coerceValueToProperties({ value: parsed, property, schema });\n\t\t\t} catch {\n\t\t\t\tthrow new InvalidSchemaValueTransformation(\"jinja\", null);\n\t\t\t}\n\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\t\t`mapSchemaValueJson missing case for kind: ${to satisfies never}`,\n\t\t\t);\n\t}\n}\n\ntype ConvertPrefectKindValueWorkspaceVariableInput = {\n\tworkspaceVariable: PrefectKindValueWorkspaceVariable;\n\tto: PrefectKind;\n};\n\nfunction convertPrefectKindValueWorkspaceVariable({\n\tworkspaceVariable,\n\tto,\n}: ConvertPrefectKindValueWorkspaceVariableInput): unknown {\n\tswitch (to) {\n\t\tcase \"workspace_variable\":\n\t\t\treturn workspaceVariable;\n\n\t\tcase \"jinja\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"jinja\",\n\t\t\t\ttemplate: undefined,\n\t\t\t} satisfies PrefectKindValueJinja;\n\n\t\tcase \"json\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"json\",\n\t\t\t\tvalue: undefined,\n\t\t\t} satisfies PrefectKindValueJson;\n\n\t\tcase null:\n\t\t\treturn undefined;\n\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\t\t`mapSchemaValueWorkspaceVariable missing case for kind: ${to satisfies never}`,\n\t\t\t);\n\t}\n}\n\ntype ConvertPrefectKindValueNullInput = {\n\tvalue: unknown;\n\tproperty: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tschema: SchemaObject & ObjectSubtype;\n\tto: PrefectKind;\n};\n\nfunction convertPrefectKindValueNull({\n\tvalue,\n\tproperty,\n\tschema,\n\tto,\n}: ConvertPrefectKindValueNullInput): unknown {\n\tswitch (to) {\n\t\tcase \"jinja\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"jinja\",\n\t\t\t\ttemplate:\n\t\t\t\t\tvalue === undefined ? undefined : JSON.stringify(value, null, 2),\n\t\t\t} satisfies PrefectKindValueJinja;\n\n\t\tcase \"json\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"json\",\n\t\t\t\tvalue: value === undefined ? undefined : JSON.stringify(value, null, 2),\n\t\t\t} satisfies PrefectKindValueJson;\n\n\t\tcase \"workspace_variable\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"workspace_variable\",\n\t\t\t\tvariable_name: undefined,\n\t\t\t} satisfies PrefectKindValueWorkspaceVariable;\n\n\t\tcase null:\n\t\t\treturn coerceValueToProperties({ value, property, schema });\n\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\t\t`mapSchemaValueNull missing case for kind: ${to satisfies never}`,\n\t\t\t);\n\t}\n}\n\ntype CoerceValueToPropertiesInput = {\n\tvalue: unknown;\n\tproperty: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tschema: SchemaObject & ObjectSubtype;\n};\n\nfunction coerceValueToProperties({\n\tvalue,\n\tproperty,\n\tschema,\n}: CoerceValueToPropertiesInput): unknown {\n\tif (isArray(property)) {\n\t\tconst responses = property.map((property) =>\n\t\t\tcoerceValueToProperty({ value, property, schema }),\n\t\t);\n\n\t\treturn responses.find((response) => response !== undefined);\n\t}\n\n\treturn coerceValueToProperty({ value, property, schema });\n}\n\ntype CoerceValueToPropertyInput = {\n\tvalue: unknown;\n\tproperty: SchemaObject | ReferenceObject;\n\tschema: SchemaObject & ObjectSubtype;\n};\n\nfunction coerceValueToProperty({\n\tvalue,\n\tproperty,\n\tschema,\n}: CoerceValueToPropertyInput): unknown {\n\tconst merged = mergeSchemaPropertyDefinition(property, schema);\n\n\tif (isAnyOfObject(merged)) {\n\t\treturn coerceValueToProperties({ value, property: merged.anyOf, schema });\n\t}\n\n\tswitch (merged.type) {\n\t\tcase \"null\":\n\t\t\treturn null;\n\n\t\tcase \"string\":\n\t\t\treturn typeof value === \"string\" ? value : undefined;\n\n\t\tcase \"boolean\":\n\t\t\treturn typeof value === \"boolean\" ? value : undefined;\n\n\t\tcase \"number\":\n\t\t\treturn typeof value === \"number\" ? value : undefined;\n\n\t\tcase \"integer\":\n\t\t\treturn typeof value === \"number\" ? Math.round(value) : undefined;\n\n\t\tcase \"array\":\n\t\t\treturn coerceValueToArrayProperty({ value, property: merged, schema });\n\n\t\tcase \"object\":\n\t\t\treturn coerceValueToObjectProperty({ value, property: merged, schema });\n\n\t\tdefault:\n\t\t\tif (isArray(merged.type)) {\n\t\t\t\tconsole.error(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\"Array types are not supported for schema coercing values to schema properties\",\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\t\t`Unsupported property type: ${merged.type satisfies never}`,\n\t\t\t);\n\t}\n}\n\ntype CoerceValueToArrayPropertyInput = {\n\tvalue: unknown;\n\tproperty: SchemaObject & ArraySubtype;\n\tschema: SchemaObject & ObjectSubtype;\n};\n\nfunction coerceValueToArrayProperty({\n\tvalue,\n\tproperty,\n\tschema,\n}: CoerceValueToArrayPropertyInput): unknown[] | undefined {\n\tif (!isArray(value)) {\n\t\treturn undefined;\n\t}\n\n\tconst response = [...value];\n\n\treturn response.map((item) =>\n\t\tcoerceValueToProperty({ value: item, property, schema }),\n\t);\n}\n\ntype CoerceValueToObjectPropertyInput = {\n\tvalue: unknown;\n\tproperty: SchemaObject & ObjectSubtype;\n\tschema: SchemaObject & ObjectSubtype;\n};\n\nfunction coerceValueToObjectProperty({\n\tvalue,\n\tproperty,\n\tschema,\n}: CoerceValueToObjectPropertyInput): Record<string, unknown> | undefined {\n\tif (!isRecord(value)) {\n\t\treturn undefined;\n\t}\n\n\tif (property.properties === undefined) {\n\t\treturn value;\n\t}\n\n\tconst response = { ...value };\n\n\tfor (const [key, propertyValue] of Object.entries(property.properties)) {\n\t\tconst coercedValue = coerceValueToProperty({\n\t\t\tvalue: value[key],\n\t\t\tproperty: propertyValue,\n\t\t\tschema,\n\t\t});\n\n\t\tif (coercedValue === undefined) {\n\t\t\tdelete response[key];\n\t\t}\n\t}\n\n\treturn response;\n}\n\nclass InvalidSchemaValueTransformation extends Error {\n\tpublic constructor(from: PrefectKind, to: PrefectKind | null) {\n\t\tsuper(\n\t\t\t`Unable to convert prefect kind value from \"${from}\" to \"${to ?? \"null\"}\"`,\n\t\t);\n\t}\n}\n","import type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\nimport { type ReactNode, useMemo, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuSeparator,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icons\";\nimport {\n\tgetPrefectKindLabel,\n\ttype PrefectKind,\n\tprefectKinds,\n} from \"./types/prefect-kind\";\nimport { getPrefectKindFromValue } from \"./types/prefect-kind-value\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { convertValueToPrefectKind } from \"./utilities/convertValueToPrefectKind\";\n\nexport type SchemaFormPropertyMenuProps = {\n\tvalue: unknown;\n\tonValueChange: (value: unknown) => void;\n\tproperty: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tdisableKinds?: boolean;\n\tchildren?: ReactNode;\n\tdefaultValue?: unknown;\n\thasDefaultValue?: boolean;\n};\n\nexport const SchemaFormPropertyMenu = ({\n\tvalue,\n\tonValueChange,\n\tproperty,\n\tchildren,\n\tdisableKinds,\n\tdefaultValue,\n\thasDefaultValue,\n}: SchemaFormPropertyMenuProps) => {\n\tconst { schema, kinds } = useSchemaFormContext();\n\tconst [open, setOpen] = useState(false);\n\n\tconst isDefaultValueDisabled =\n\t\t!hasDefaultValue || JSON.stringify(value) === JSON.stringify(defaultValue);\n\n\tfunction handleUseDefaultValue() {\n\t\tif (hasDefaultValue) {\n\t\t\tonValueChange(defaultValue);\n\t\t}\n\t}\n\n\tfunction convertValueKind(kind: PrefectKind) {\n\t\tconst newValue = convertValueToPrefectKind({\n\t\t\tvalue,\n\t\t\tproperty,\n\t\t\tschema,\n\t\t\tto: kind,\n\t\t});\n\n\t\tonValueChange(newValue);\n\t}\n\n\tconst kindOptions = useMemo(() => {\n\t\tconst current = getPrefectKindFromValue(value);\n\n\t\treturn prefectKinds.filter(\n\t\t\t(kind) =>\n\t\t\t\tkind !== current &&\n\t\t\t\t(kinds.includes(kind) || kind === null) &&\n\t\t\t\t!disableKinds,\n\t\t);\n\t}, [value, kinds, disableKinds]);\n\n\treturn (\n\t\t<DropdownMenu open={open} onOpenChange={setOpen}>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button variant=\"ghost\" data-open={open} className=\"h-8 w-8 p-0\">\n\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t{kindOptions.map((kind) => (\n\t\t\t\t\t<DropdownMenuItem key={kind} onClick={() => convertValueKind(kind)}>\n\t\t\t\t\t\t{getPrefectKindLabel(kind)}\n\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t))}\n\n\t\t\t\t{hasDefaultValue && (\n\t\t\t\t\t<DropdownMenuItem\n\t\t\t\t\t\tonClick={handleUseDefaultValue}\n\t\t\t\t\t\tdisabled={isDefaultValueDisabled}\n\t\t\t\t\t>\n\t\t\t\t\t\tUse default value\n\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t)}\n\n\t\t\t\t<DropdownMenuSeparator />\n\n\t\t\t\t{children}\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import { useSortable } from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { GripVertical } from \"lucide-react\";\nimport type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\nimport { useId, useMemo } from \"react\";\nimport { DropdownMenuItem } from \"../ui/dropdown-menu\";\nimport { SchemaFormInput } from \"./schema-form-input\";\nimport { SchemaFormPropertyErrors } from \"./schema-form-property-errors\";\nimport { SchemaFormPropertyMenu } from \"./schema-form-property-menu\";\nimport type { SchemaFormErrors } from \"./types/errors\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { isArray, isReferenceObject } from \"./utilities/guards\";\nimport { getSchemaDefinition } from \"./utilities/mergeSchemaPropertyDefinition\";\n\nexport type SchemaFormInputArrayItemProps = {\n\titemKey: string;\n\titems: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tvalue: unknown;\n\tonValueChange: (value: unknown) => void;\n\terrors: SchemaFormErrors;\n\tonDelete: () => void;\n\tfirst: boolean;\n\tlast: boolean;\n\tcanMove: boolean;\n\tmoveUp: () => void;\n\tmoveDown: () => void;\n\tmoveToTop: () => void;\n\tmoveToBottom: () => void;\n};\n\nexport function SchemaFormInputArrayItem({\n\titemKey,\n\titems,\n\tvalue,\n\tonValueChange,\n\terrors,\n\tonDelete,\n\tfirst,\n\tlast,\n\tcanMove,\n\tmoveUp,\n\tmoveDown,\n\tmoveToTop,\n\tmoveToBottom,\n}: SchemaFormInputArrayItemProps) {\n\tconst { schema } = useSchemaFormContext();\n\tconst id = useId();\n\n\tconst {\n\t\tattributes,\n\t\tlisteners,\n\t\tsetNodeRef,\n\t\ttransform,\n\t\ttransition,\n\t\tisDragging,\n\t} = useSortable({ id: itemKey, disabled: !canMove });\n\n\tconst style = {\n\t\ttransform: CSS.Transform.toString(transform),\n\t\ttransition,\n\t\topacity: isDragging ? 0.5 : 1,\n\t};\n\n\tconst property = useMemo(() => {\n\t\tif (isArray(items)) {\n\t\t\t// @ts-expect-error The SchemaObject type requires a type property but in an anyOf property the type comes from the anyOf property\n\t\t\tconst property: SchemaObject = {\n\t\t\t\tanyOf: items,\n\t\t\t};\n\n\t\t\treturn property;\n\t\t}\n\n\t\tif (isReferenceObject(items)) {\n\t\t\treturn getSchemaDefinition(schema, items.$ref);\n\t\t}\n\n\t\treturn items;\n\t}, [items, schema]);\n\n\treturn (\n\t\t<div\n\t\t\tref={setNodeRef}\n\t\t\tstyle={style}\n\t\t\tclassName=\"grid grid-cols-[auto_1fr_auto] gap-2\"\n\t\t>\n\t\t\t{canMove ? (\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"flex items-center justify-center cursor-grab text-muted-foreground hover:text-foreground focus:outline-none\"\n\t\t\t\t\taria-label=\"Drag to reorder\"\n\t\t\t\t\t{...attributes}\n\t\t\t\t\t{...listeners}\n\t\t\t\t>\n\t\t\t\t\t<GripVertical className=\"h-5 w-5\" />\n\t\t\t\t</button>\n\t\t\t) : (\n\t\t\t\t<div className=\"w-5\" />\n\t\t\t)}\n\t\t\t<div className=\"grid grid-cols-1 gap-2\">\n\t\t\t\t<SchemaFormInput\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tonValueChange={onValueChange}\n\t\t\t\t\tproperty={property}\n\t\t\t\t\terrors={errors}\n\t\t\t\t\tid={id}\n\t\t\t\t/>\n\t\t\t\t<SchemaFormPropertyErrors errors={errors} />\n\t\t\t</div>\n\t\t\t<SchemaFormPropertyMenu\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tproperty={items}\n\t\t\t>\n\t\t\t\t<DropdownMenuItem onClick={onDelete}>Delete</DropdownMenuItem>\n\t\t\t\t{canMove && !first && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<DropdownMenuItem onClick={moveToTop}>Move to top</DropdownMenuItem>\n\t\t\t\t\t\t<DropdownMenuItem onClick={moveUp}>Move up</DropdownMenuItem>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t{canMove && !last && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<DropdownMenuItem onClick={moveDown}>Move down</DropdownMenuItem>\n\t\t\t\t\t\t<DropdownMenuItem onClick={moveToBottom}>\n\t\t\t\t\t\t\tMove to bottom\n\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</SchemaFormPropertyMenu>\n\t\t</div>\n\t);\n}\n","import {\n\tclosestCenter,\n\tDndContext,\n\ttype DragEndEvent,\n\tKeyboardSensor,\n\tPointerSensor,\n\tuseSensor,\n\tuseSensors,\n} from \"@dnd-kit/core\";\nimport {\n\tSortableContext,\n\tsortableKeyboardCoordinates,\n\tverticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport type { ArraySubtype, SchemaObject } from \"openapi-typescript\";\nimport { useState } from \"react\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { Button } from \"../ui/button\";\nimport { Card } from \"../ui/card\";\nimport { SchemaFormInputArrayItem } from \"./schema-form-input-array-item\";\nimport {\n\tisSchemaValueIndexError,\n\ttype SchemaFormErrors,\n\ttype SchemaValueIndexError,\n} from \"./types/errors\";\nimport { isArray } from \"./utilities/guards\";\nexport type SchemaFormInputArrayListProps = {\n\tproperty: SchemaObject & ArraySubtype;\n\tvalues: unknown[] | undefined;\n\tonValuesChange: (values: unknown[] | undefined) => void;\n\terrors: SchemaFormErrors;\n};\n\nexport function SchemaFormInputArrayList({\n\tproperty,\n\tvalues,\n\tonValuesChange,\n\terrors,\n}: SchemaFormInputArrayListProps) {\n\tconst isEmpty = values === undefined || values.length === 0;\n\tconst canAddMore =\n\t\tproperty.maxItems === undefined ||\n\t\t(values?.length ?? 0) < (property.maxItems ?? Number.POSITIVE_INFINITY);\n\n\tconst prefixItemsCount = isArray(property.prefixItems)\n\t\t? property.prefixItems.length\n\t\t: 0;\n\n\tconst sensors = useSensors(\n\t\tuseSensor(PointerSensor),\n\t\tuseSensor(KeyboardSensor, {\n\t\t\tcoordinateGetter: sortableKeyboardCoordinates,\n\t\t}),\n\t);\n\n\tconst [localKeyedValues, setLocalKeyedValues] = useState<\n\t\t{\n\t\t\tkey: string;\n\t\t\tvalue: unknown;\n\t\t}[]\n\t>(\n\t\tvalues?.map((value) => ({\n\t\t\tkey: uuidv4(),\n\t\t\tvalue,\n\t\t})) ?? [],\n\t);\n\n\tfunction getPropertyForIndex(index: number) {\n\t\tif (isArray(property.prefixItems) && index < property.prefixItems.length) {\n\t\t\treturn property.prefixItems[index];\n\t\t}\n\n\t\treturn property.items ?? { type: \"string\" };\n\t}\n\n\tfunction getErrorsForIndex(index: number) {\n\t\treturn errors\n\t\t\t.filter(\n\t\t\t\t(error): error is SchemaValueIndexError =>\n\t\t\t\t\tisSchemaValueIndexError(error) && error.index === index,\n\t\t\t)\n\t\t\t.flatMap((error) => error.errors);\n\t}\n\n\tfunction getFirstForIndex(index: number): boolean {\n\t\treturn index === 0;\n\t}\n\n\tfunction getLastForIndex(index: number): boolean {\n\t\treturn index === (values?.length ?? 0) - 1;\n\t}\n\n\tfunction getCanMoveForIndex(index: number): boolean {\n\t\tconst isPrefixItem =\n\t\t\tisArray(property.prefixItems) && index < property.prefixItems.length;\n\n\t\treturn !isPrefixItem;\n\t}\n\n\tfunction handleValueChange(key: string, value: unknown) {\n\t\tsetLocalKeyedValues(\n\t\t\tlocalKeyedValues.map((item) =>\n\t\t\t\titem.key === key ? { ...item, value } : item,\n\t\t\t),\n\t\t);\n\t}\n\n\tfunction addItem() {\n\t\tconst newKeyedValues = [\n\t\t\t...localKeyedValues,\n\t\t\t{ key: uuidv4(), value: undefined },\n\t\t];\n\t\tsetLocalKeyedValues(newKeyedValues);\n\t\tonValuesChange(newKeyedValues.map(({ value }) => value));\n\t}\n\n\tfunction moveItem(from: number, to: number) {\n\t\tconst newValues = [...localKeyedValues];\n\t\tnewValues.splice(to, 0, newValues.splice(from, 1)[0]);\n\t\tsetLocalKeyedValues(newValues);\n\t\tonValuesChange(newValues.map(({ value }) => value));\n\t}\n\n\tfunction moveToTop(index: number) {\n\t\tmoveItem(index, 0);\n\t}\n\n\tfunction moveToBottom(index: number) {\n\t\tmoveItem(index, localKeyedValues.length - 1);\n\t}\n\n\tfunction deleteItem(key: string) {\n\t\tconst newValues = localKeyedValues.filter((item) => item.key !== key);\n\t\tsetLocalKeyedValues(newValues);\n\t\tonValuesChange(newValues.map(({ value }) => value));\n\t}\n\n\tfunction handleDragEnd(event: DragEndEvent) {\n\t\tconst { active, over } = event;\n\n\t\tif (over && active.id !== over.id) {\n\t\t\tconst oldIndex = localKeyedValues.findIndex(\n\t\t\t\t(item) => item.key === active.id,\n\t\t\t);\n\t\t\tconst newIndex = localKeyedValues.findIndex(\n\t\t\t\t(item) => item.key === over.id,\n\t\t\t);\n\n\t\t\tif (oldIndex !== -1 && newIndex !== -1) {\n\t\t\t\tmoveItem(oldIndex, newIndex);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Get the keys of items that can be dragged (non-prefix items)\n\tconst sortableKeys = localKeyedValues\n\t\t.slice(prefixItemsCount)\n\t\t.map((item) => item.key);\n\n\treturn (\n\t\t<Card className=\"flex flex-col gap-2 p-2\">\n\t\t\t{isEmpty && (\n\t\t\t\t<p className=\"text-sm text-subdued italic\">No items in this list</p>\n\t\t\t)}\n\n\t\t\t<DndContext\n\t\t\t\tsensors={sensors}\n\t\t\t\tcollisionDetection={closestCenter}\n\t\t\t\tonDragEnd={handleDragEnd}\n\t\t\t>\n\t\t\t\t<SortableContext\n\t\t\t\t\titems={sortableKeys}\n\t\t\t\t\tstrategy={verticalListSortingStrategy}\n\t\t\t\t>\n\t\t\t\t\t{localKeyedValues?.map(({ key, value }, index) => (\n\t\t\t\t\t\t<SchemaFormInputArrayItem\n\t\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\t\titemKey={key}\n\t\t\t\t\t\t\titems={getPropertyForIndex(index)}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tonValueChange={(value) => handleValueChange(key, value)}\n\t\t\t\t\t\t\terrors={getErrorsForIndex(index)}\n\t\t\t\t\t\t\tonDelete={() => deleteItem(key)}\n\t\t\t\t\t\t\tfirst={getFirstForIndex(index)}\n\t\t\t\t\t\t\tlast={getLastForIndex(index)}\n\t\t\t\t\t\t\tcanMove={getCanMoveForIndex(index)}\n\t\t\t\t\t\t\tmoveUp={() => moveItem(index, index - 1)}\n\t\t\t\t\t\t\tmoveDown={() => moveItem(index, index + 1)}\n\t\t\t\t\t\t\tmoveToTop={() => moveToTop(index)}\n\t\t\t\t\t\t\tmoveToBottom={() => moveToBottom(index)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</SortableContext>\n\t\t\t</DndContext>\n\n\t\t\t{canAddMore && (\n\t\t\t\t<div className=\"flex justify-end\">\n\t\t\t\t\t<Button size=\"sm\" variant=\"outline\" onClick={addItem}>\n\t\t\t\t\t\tAdd item\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!canAddMore && (\n\t\t\t\t<p className=\"text-sm text-subdued text-right\">\n\t\t\t\t\tYou can&apos;t add more items\n\t\t\t\t</p>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n","import type { SchemaObject } from \"openapi-typescript\";\nimport { useMemo, useState } from \"react\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"../ui/combobox\";\nimport type { PrimitiveProperty } from \"./types/primitives\";\nimport type { WithPrimitiveEnum } from \"./types/schemas\";\n\ntype SingleValueProps<T extends PrimitiveProperty> = {\n\tvalue: T | undefined;\n\tmultiple: false;\n\tonValueChange: (value: T | undefined) => void;\n};\n\ntype MultipleValueProps<T extends PrimitiveProperty> = {\n\tvalues: T[] | undefined;\n\tmultiple: true;\n\tonValuesChange: (values: T[] | undefined) => void;\n};\n\ntype SchemaFormInputArrayComboboxProps<T extends PrimitiveProperty> = {\n\tproperty: SchemaObject & WithPrimitiveEnum;\n\tid: string;\n} & (SingleValueProps<T> | MultipleValueProps<T>);\n\nexport function SchemaFormInputEnum<T extends PrimitiveProperty>({\n\tproperty,\n\tid,\n\t...props\n}: SchemaFormInputArrayComboboxProps<T>) {\n\tconst [search, setSearch] = useState(\"\");\n\n\tconst options = useMemo(() => {\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries(property.enum).filter(([, value]) =>\n\t\t\t\tString(value).toLowerCase().includes(search.toLowerCase()),\n\t\t\t),\n\t\t);\n\t}, [property.enum, search]);\n\n\tconst selected = Boolean(props.multiple ? props.values?.length : props.value);\n\tconst label = props.multiple ? props.values?.join(\", \") : String(props.value);\n\n\tfunction isSelected(key: string) {\n\t\tconst value = options[key] as T;\n\n\t\treturn props.multiple\n\t\t\t? props.values?.includes(value)\n\t\t\t: props.value === value;\n\t}\n\n\tfunction onSelect(key: string) {\n\t\tsetSearch(\"\");\n\n\t\tconst value = options[key] as T;\n\n\t\treturn props.multiple ? onSelectMultiple(value) : onSelectSingle(value);\n\t}\n\n\tfunction onSelectSingle(value: T) {\n\t\tif (props.multiple) {\n\t\t\tthrow new Error(\"onSingleSelect called on multiple value input\");\n\t\t}\n\n\t\tprops.onValueChange(value);\n\t}\n\n\tfunction onSelectMultiple(value: T) {\n\t\tif (!props.multiple) {\n\t\t\tthrow new Error(\"onMultipleSelect called on single value input\");\n\t\t}\n\n\t\tif (!props.values) {\n\t\t\tprops.onValuesChange([value]);\n\t\t\treturn;\n\t\t}\n\n\t\tif (props.values?.includes(value)) {\n\t\t\tprops.onValuesChange(props.values.filter((v) => v !== value));\n\t\t\treturn;\n\t\t}\n\n\t\tprops.onValuesChange([...props.values, value]);\n\t}\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\tselected={selected}\n\t\t\t\taria-label={`Select ${property.title}`}\n\t\t\t\tid={id}\n\t\t\t>\n\t\t\t\t{selected ? label : \"Select\"}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandEmtpy>No values found</ComboboxCommandEmtpy>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t{Object.entries(options).map(([index, value]) => (\n\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\tvalue={index}\n\t\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\t\tselected={isSelected(index)}\n\t\t\t\t\t\t\tcloseOnSelect={!props.multiple}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{String(value)}\n\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t))}\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n}\n","import type { ObjectSubtype, SchemaObject } from \"openapi-typescript\";\nimport {\n\tisPrimitivePropertyType,\n\ttype PrimitivePropertyType,\n} from \"./primitives\";\n\nexport type WithPosition = {\n\tposition?: number;\n};\n\nexport type PrefectObjectSubtype = {\n\tproperties?: {\n\t\t[name: string]: WithPosition;\n\t};\n};\n\nexport type WithBlockDocumentSlug = {\n\tblock_type_slug?: string;\n};\n\nexport type WithDefinitions = {\n\tdefinitions?: {\n\t\t[name: string]: SchemaObject;\n\t};\n};\n\nexport type PrefectSchemaObject = SchemaObject &\n\tObjectSubtype &\n\tWithBlockDocumentSlug &\n\tWithDefinitions;\n\nexport type WithPrimitiveEnum = {\n\tenum: PrimitivePropertyType[];\n};\n\nexport function isWithPrimitiveEnum<T extends SchemaObject>(\n\tproperty: T,\n): property is T & WithPrimitiveEnum {\n\treturn (\n\t\t\"enum\" in property &&\n\t\tArray.isArray(property.enum) &&\n\t\tproperty.enum.every((value) => isPrimitivePropertyType(typeof value))\n\t);\n}\n","import type { PrimitiveProperty } from \"../types/primitives\";\nimport { isRecord } from \"./guards\";\n\ntype PrimitiveConstructor =\n\t| BooleanConstructor\n\t| NumberConstructor\n\t| StringConstructor;\n\nexport function asType<T extends PrimitiveConstructor>(\n\tvalue: unknown,\n\ttype: T,\n): ReturnType<T> | undefined {\n\tif (typeof value === typeof type()) {\n\t\treturn value as ReturnType<T>;\n\t}\n\n\treturn undefined;\n}\n\nexport function asObject(value: unknown): Record<string, unknown> | undefined {\n\tif (isRecord(value)) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n}\n\nexport function asPrimitive(value: unknown): PrimitiveProperty | undefined {\n\treturn (\n\t\tasType(value, String) ?? asType(value, Number) ?? asType(value, Boolean)\n\t);\n}\n\nexport function asArray(value: unknown): unknown[] | undefined;\nexport function asArray(\n\tvalue: unknown,\n\ttype: BooleanConstructor,\n): boolean[] | undefined;\nexport function asArray(\n\tvalue: unknown,\n\ttype: NumberConstructor,\n): number[] | undefined;\nexport function asArray(\n\tvalue: unknown,\n\ttype: StringConstructor,\n): string[] | undefined;\nexport function asArray(\n\tvalue: unknown,\n\ttype: \"primitive\",\n): PrimitiveProperty[] | undefined;\nexport function asArray(\n\tvalue: unknown,\n\ttype?: \"primitive\" | PrimitiveConstructor,\n): unknown[] | undefined {\n\tif (type === undefined && Array.isArray(value)) {\n\t\treturn value as unknown[];\n\t}\n\n\tif (!Array.isArray(value)) {\n\t\treturn undefined;\n\t}\n\n\tswitch (type) {\n\t\tcase String:\n\t\t\treturn value\n\t\t\t\t.map((value) => asType(value, String))\n\t\t\t\t.filter((value) => value !== undefined);\n\t\tcase Number:\n\t\t\treturn value\n\t\t\t\t.map((value) => asType(value, Number))\n\t\t\t\t.filter((value) => value !== undefined);\n\t\tcase Boolean:\n\t\t\treturn value\n\t\t\t\t.map((value) => asType(value, Boolean))\n\t\t\t\t.filter((value) => value !== undefined);\n\t\tcase \"primitive\":\n\t\t\treturn value\n\t\t\t\t.map(\n\t\t\t\t\t(value) =>\n\t\t\t\t\t\tasType(value, String) ??\n\t\t\t\t\t\tasType(value, Number) ??\n\t\t\t\t\t\tasType(value, Boolean),\n\t\t\t\t)\n\t\t\t\t.filter((value) => value !== undefined);\n\t\tdefault:\n\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\tthrow new Error(`Invalid array type: ${type}`);\n\t}\n}\n","import type {\n\tArraySubtype,\n\tReferenceObject,\n\tSchemaObject,\n} from \"openapi-typescript\";\nimport { SchemaFormInputArrayList } from \"./schema-form-input-array-list\";\nimport { SchemaFormInputEnum } from \"./schema-form-input-enum\";\nimport type { SchemaFormErrors } from \"./types/errors\";\nimport { isWithPrimitiveEnum } from \"./types/schemas\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { asArray } from \"./utilities/asType\";\nimport { isItemsObject, isRecord, isReferenceObject } from \"./utilities/guards\";\nimport { getSchemaDefinition } from \"./utilities/mergeSchemaPropertyDefinition\";\n\ntype SchemaFormInputArrayProps = {\n\tvalues: unknown[] | undefined;\n\tonValuesChange: (values: unknown[] | undefined) => void;\n\tproperty: SchemaObject & ArraySubtype;\n\terrors: SchemaFormErrors;\n\tid: string;\n};\n\nexport function SchemaFormInputArray({\n\tvalues,\n\tproperty,\n\tonValuesChange,\n\terrors,\n\tid,\n}: SchemaFormInputArrayProps) {\n\tconst { schema } = useSchemaFormContext();\n\n\tfunction handleValuesChange(values: unknown[] | undefined) {\n\t\tif (values === undefined || values.length === 0) {\n\t\t\tonValuesChange(undefined);\n\t\t\treturn;\n\t\t}\n\n\t\tonValuesChange(values);\n\t}\n\n\tif (isItemsObject(property) && isRecord(property.items)) {\n\t\tlet items: SchemaObject | ReferenceObject = property.items;\n\n\t\tif (isReferenceObject(items)) {\n\t\t\titems = getSchemaDefinition(schema, items.$ref);\n\t\t}\n\n\t\tif (isWithPrimitiveEnum(items)) {\n\t\t\tconst merged = { ...property, ...items };\n\n\t\t\treturn (\n\t\t\t\t<SchemaFormInputEnum\n\t\t\t\t\tmultiple={true}\n\t\t\t\t\tvalues={asArray(values, \"primitive\")}\n\t\t\t\t\tproperty={merged}\n\t\t\t\t\tonValuesChange={handleValuesChange}\n\t\t\t\t\tid={id}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t}\n\n\treturn (\n\t\t<SchemaFormInputArrayList\n\t\t\tproperty={property}\n\t\t\tvalues={values}\n\t\t\tonValuesChange={handleValuesChange}\n\t\t\terrors={errors}\n\t\t/>\n\t);\n}\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Suspense, useDeferredValue, useMemo, useState } from \"react\";\nimport { buildListFilterBlockDocumentsQuery } from \"@/api/block-documents\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandGroup,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"@/components/ui/combobox\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype BlockDocumentComboboxProps = {\n\tblockTypeSlug: string;\n\tselectedBlockDocumentId: string | undefined;\n\tonSelect: (blockDocumentId: string | undefined) => void;\n\tonCreateNew?: () => void;\n};\n\nexport const BlockDocumentCombobox = ({\n\tblockTypeSlug,\n\tselectedBlockDocumentId,\n\tonSelect,\n\tonCreateNew,\n}: BlockDocumentComboboxProps) => {\n\treturn (\n\t\t<Suspense>\n\t\t\t<BlockDocumentComboboxImplementation\n\t\t\t\tblockTypeSlug={blockTypeSlug}\n\t\t\t\tselectedBlockDocumentId={selectedBlockDocumentId}\n\t\t\t\tonSelect={onSelect}\n\t\t\t\tonCreateNew={onCreateNew}\n\t\t\t/>\n\t\t</Suspense>\n\t);\n};\n\nconst BlockDocumentComboboxImplementation = ({\n\tblockTypeSlug,\n\tselectedBlockDocumentId,\n\tonSelect,\n\tonCreateNew,\n}: BlockDocumentComboboxProps) => {\n\tconst [search, setSearch] = useState(\"\");\n\tconst deferredSearch = useDeferredValue(search);\n\n\tconst { data } = useSuspenseQuery(\n\t\tbuildListFilterBlockDocumentsQuery({\n\t\t\toffset: 0,\n\t\t\tsort: \"BLOCK_TYPE_AND_NAME_ASC\",\n\t\t\tinclude_secrets: false,\n\t\t\tblock_types: {\n\t\t\t\tslug: { any_: [blockTypeSlug] },\n\t\t\t},\n\t\t\tblock_documents: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tis_anonymous: { eq_: false },\n\t\t\t\t...(deferredSearch ? { name: { like_: deferredSearch } } : {}),\n\t\t\t},\n\t\t\tlimit: 50,\n\t\t}),\n\t);\n\n\tconst filteredData = useMemo(() => {\n\t\treturn data.filter((blockDocument) =>\n\t\t\tblockDocument.name?.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [data, deferredSearch]);\n\n\tconst selectedBlockDocument = useMemo(() => {\n\t\treturn data.find(\n\t\t\t(blockDocument) => blockDocument.id === selectedBlockDocumentId,\n\t\t);\n\t}, [data, selectedBlockDocumentId]);\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\tselected={Boolean(selectedBlockDocumentId)}\n\t\t\t\taria-label=\"Select a block\"\n\t\t\t>\n\t\t\t\t{selectedBlockDocument?.name ?? \"Select a block...\"}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search for a block...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandEmtpy>No block found</ComboboxCommandEmtpy>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t{filteredData.map((blockDocument) => (\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tkey={blockDocument.id}\n\t\t\t\t\t\t\t\tselected={selectedBlockDocumentId === blockDocument.id}\n\t\t\t\t\t\t\t\tonSelect={(value) => {\n\t\t\t\t\t\t\t\t\tonSelect(value);\n\t\t\t\t\t\t\t\t\tsetSearch(\"\");\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvalue={blockDocument.id}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{blockDocument.name}\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t\t{onCreateNew && (\n\t\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tonSelect={() => {\n\t\t\t\t\t\t\t\t\tonCreateNew();\n\t\t\t\t\t\t\t\t\tsetSearch(\"\");\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvalue=\"__create_new__\"\n\t\t\t\t\t\t\t\tcloseOnSelect={true}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon id=\"Plus\" className=\"mr-2 size-4\" />\n\t\t\t\t\t\t\t\tCreate new block\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t\t)}\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Suspense, useState } from \"react\";\nimport { buildCountFilterBlockDocumentsQuery } from \"@/api/block-documents\";\nimport { buildGetBlockTypeQuery } from \"@/api/block-types\";\nimport { BlockTypeLogo } from \"@/components/block-type-logo/block-type-logo\";\nimport { BlockDocumentCombobox } from \"@/components/blocks/block-document-combobox\";\nimport { BlockDocumentCreateDialog } from \"@/components/blocks/block-document-create-dialog\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\ntype BlockDocumentReferenceValue =\n\t| {\n\t\t\t$ref: string;\n\t }\n\t| undefined;\n\ntype SchemaFormInputBlockDocumentProps = {\n\tvalue: BlockDocumentReferenceValue;\n\tonValueChange: (value: BlockDocumentReferenceValue) => void;\n\tblockTypeSlug: string;\n\tid: string;\n};\n\nexport function SchemaFormInputBlockDocument({\n\tvalue,\n\tonValueChange,\n\tblockTypeSlug,\n\tid,\n}: SchemaFormInputBlockDocumentProps) {\n\treturn (\n\t\t<Suspense fallback={<SchemaFormInputBlockDocumentSkeleton />}>\n\t\t\t<SchemaFormInputBlockDocumentContent\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tblockTypeSlug={blockTypeSlug}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t</Suspense>\n\t);\n}\n\nfunction SchemaFormInputBlockDocumentSkeleton() {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<Skeleton className=\"size-8 rounded\" />\n\t\t\t<Skeleton className=\"h-9 flex-1\" />\n\t\t\t<Skeleton className=\"h-9 w-20\" />\n\t\t</div>\n\t);\n}\n\nfunction SchemaFormInputBlockDocumentContent({\n\tvalue,\n\tonValueChange,\n\tblockTypeSlug,\n\tid,\n}: SchemaFormInputBlockDocumentProps) {\n\tconst [createDialogOpen, setCreateDialogOpen] = useState(false);\n\n\tconst { data: blockType } = useSuspenseQuery(\n\t\tbuildGetBlockTypeQuery(blockTypeSlug),\n\t);\n\n\tconst { data: blockDocumentCount } = useSuspenseQuery(\n\t\tbuildCountFilterBlockDocumentsQuery({\n\t\t\tblock_types: {\n\t\t\t\tslug: { any_: [blockTypeSlug] },\n\t\t\t},\n\t\t\tblock_documents: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tis_anonymous: { eq_: false },\n\t\t\t},\n\t\t\tinclude_secrets: false,\n\t\t\tsort: \"BLOCK_TYPE_AND_NAME_ASC\",\n\t\t\toffset: 0,\n\t\t}),\n\t);\n\n\tconst hasBlockDocuments = blockDocumentCount > 0;\n\tconst selectedBlockDocumentId = value?.$ref;\n\n\tconst handleSelect = (blockDocumentId: string | undefined) => {\n\t\tif (blockDocumentId) {\n\t\t\tonValueChange({ $ref: blockDocumentId });\n\t\t} else {\n\t\t\tonValueChange(undefined);\n\t\t}\n\t};\n\n\tconst handleCreated = (blockDocumentId: string) => {\n\t\tonValueChange({ $ref: blockDocumentId });\n\t};\n\n\treturn (\n\t\t<div id={id} className=\"flex items-center gap-2\">\n\t\t\t<BlockTypeLogo logoUrl={blockType.logo_url} alt={blockType.name} />\n\t\t\t{hasBlockDocuments && (\n\t\t\t\t<div className=\"flex-1\">\n\t\t\t\t\t<BlockDocumentCombobox\n\t\t\t\t\t\tblockTypeSlug={blockTypeSlug}\n\t\t\t\t\t\tselectedBlockDocumentId={selectedBlockDocumentId}\n\t\t\t\t\t\tonSelect={handleSelect}\n\t\t\t\t\t\tonCreateNew={() => setCreateDialogOpen(true)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<Button\n\t\t\t\ttype=\"button\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\tonClick={() => setCreateDialogOpen(true)}\n\t\t\t>\n\t\t\t\tAdd\n\t\t\t\t<Icon id=\"Plus\" className=\"ml-2 size-4\" />\n\t\t\t</Button>\n\t\t\t<BlockDocumentCreateDialog\n\t\t\t\topen={createDialogOpen}\n\t\t\t\tonOpenChange={setCreateDialogOpen}\n\t\t\t\tblockTypeSlug={blockTypeSlug}\n\t\t\t\tonCreated={handleCreated}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n","import type { CheckedState } from \"@radix-ui/react-checkbox\";\nimport type { BooleanSubtype, SchemaObject } from \"openapi-typescript\";\nimport { Switch } from \"@/components/ui/switch\";\nimport { SchemaFormInputEnum } from \"./schema-form-input-enum\";\nimport { isWithPrimitiveEnum } from \"./types/schemas\";\nimport { asType } from \"./utilities/asType\";\n\ntype SchemaFormInputBooleanProps = {\n\tvalue: boolean | undefined;\n\tonValueChange: (value: boolean | undefined) => void;\n\tproperty: SchemaObject & BooleanSubtype;\n\tid: string;\n};\n\nexport function SchemaFormInputBoolean({\n\tvalue,\n\tonValueChange,\n\tproperty,\n\tid,\n}: SchemaFormInputBooleanProps) {\n\tfunction onCheckedChange(checked: CheckedState) {\n\t\tonValueChange(asType(checked, Boolean));\n\t}\n\n\tif (isWithPrimitiveEnum(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputEnum\n\t\t\t\tmultiple={false}\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={property}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn <Switch checked={value} onCheckedChange={onCheckedChange} id={id} />;\n}\n","import type {\n\tIntegerSubtype,\n\tNumberSubtype,\n\tSchemaObject,\n} from \"openapi-typescript\";\nimport { Input } from \"../ui/input\";\nimport { SchemaFormInputEnum } from \"./schema-form-input-enum\";\nimport { isWithPrimitiveEnum } from \"./types/schemas\";\n\ntype SchemaFormInputIntegerProps = {\n\tvalue: number | undefined;\n\tonValueChange: (value: number | undefined) => void;\n\tproperty: SchemaObject & (NumberSubtype | IntegerSubtype);\n\tid: string;\n};\n\nexport function SchemaFormInputInteger({\n\tvalue,\n\tonValueChange,\n\tproperty,\n\tid,\n}: SchemaFormInputIntegerProps) {\n\tif (isWithPrimitiveEnum(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputEnum\n\t\t\t\tmultiple={false}\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={property}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tfunction handleChange(value: string) {\n\t\tif (value === \"\") {\n\t\t\tonValueChange(undefined);\n\t\t} else {\n\t\t\tonValueChange(Number(value));\n\t\t}\n\t}\n\n\treturn (\n\t\t<Input\n\t\t\ttype=\"number\"\n\t\t\tmin={property.minimum}\n\t\t\tmax={property.maximum}\n\t\t\tvalue={value ?? \"\"}\n\t\t\tstep=\"1\"\n\t\t\tonChange={(e) => handleChange(e.target.value)}\n\t\t\tid={id}\n\t\t/>\n\t);\n}\n","export function SchemaFormInputNull() {\n\treturn (\n\t\t<p className=\"text-subdued text-sm\">Property is type &quot;None&quot;</p>\n\t);\n}\n","import type { NumberSubtype, SchemaObject } from \"openapi-typescript\";\nimport { Input } from \"../ui/input\";\nimport { SchemaFormInputEnum } from \"./schema-form-input-enum\";\nimport { isWithPrimitiveEnum } from \"./types/schemas\";\n\ntype SchemaFormInputNumberProps = {\n\tvalue: number | undefined;\n\tonValueChange: (value: number | undefined) => void;\n\tproperty: SchemaObject & NumberSubtype;\n\tid: string;\n};\n\nexport function SchemaFormInputNumber({\n\tvalue,\n\tonValueChange,\n\tproperty,\n\tid,\n}: SchemaFormInputNumberProps) {\n\tif (isWithPrimitiveEnum(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputEnum\n\t\t\t\tmultiple={false}\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={property}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tfunction handleChange(value: string) {\n\t\tif (value === \"\") {\n\t\t\tonValueChange(undefined);\n\t\t} else {\n\t\t\tonValueChange(Number(value));\n\t\t}\n\t}\n\n\treturn (\n\t\t<Input\n\t\t\ttype=\"number\"\n\t\t\tmin={property.minimum}\n\t\t\tmax={property.maximum}\n\t\t\tvalue={value ?? \"\"}\n\t\t\tonChange={(e) => handleChange(e.target.value)}\n\t\t\tid={id}\n\t\t/>\n\t);\n}\n","import type { JsonInputOnChange } from \"../ui/json-input\";\nimport { LazyJsonInput as JsonInput } from \"../ui/json-input-lazy\";\nimport type { PrefectKindValueJinja } from \"./types/prefect-kind-value\";\n\ntype SchemaFormInputPrefectKindJinjaProps = {\n\tvalue: PrefectKindValueJinja;\n\tonValueChange: (value: PrefectKindValueJinja) => void;\n\tid: string;\n};\n\nexport function SchemaFormInputPrefectKindJinja({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputPrefectKindJinjaProps) {\n\tconst onChange: JsonInputOnChange = (newValue) => {\n\t\tif (typeof newValue === \"string\" || newValue === undefined) {\n\t\t\tonValueChange({\n\t\t\t\t__prefect_kind: \"jinja\",\n\t\t\t\ttemplate: newValue || undefined,\n\t\t\t});\n\t\t}\n\t};\n\n\treturn <JsonInput value={value.template} onChange={onChange} id={id} />;\n}\n","import type { JsonInputOnChange } from \"../ui/json-input\";\nimport { LazyJsonInput as JsonInput } from \"../ui/json-input-lazy\";\nimport type { PrefectKindValueJson } from \"./types/prefect-kind-value\";\n\ntype SchemaFormInputPrefectKindJsonProps = {\n\tvalue: PrefectKindValueJson;\n\tonValueChange: (value: PrefectKindValueJson) => void;\n\tid: string;\n};\n\nexport function SchemaFormInputPrefectKindJson({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputPrefectKindJsonProps) {\n\tconst onChange: JsonInputOnChange = (value) => {\n\t\tif (typeof value === \"string\" || value === undefined) {\n\t\t\tonValueChange({\n\t\t\t\t__prefect_kind: \"json\",\n\t\t\t\tvalue: value || undefined,\n\t\t\t});\n\t\t}\n\t};\n\n\treturn <JsonInput value={value.value} onChange={onChange} id={id} />;\n}\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Suspense, useDeferredValue, useMemo, useState } from \"react\";\nimport { buildFilterVariablesQuery } from \"@/api/variables\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandGroup,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"@/components/ui/combobox\";\n\ntype VariableComboboxProps = {\n\tselectedVariableName: string | undefined;\n\tonSelect: (variableName: string | undefined) => void;\n};\n\nexport const VariableCombobox = ({\n\tselectedVariableName,\n\tonSelect,\n}: VariableComboboxProps) => {\n\treturn (\n\t\t<Suspense>\n\t\t\t<VariableComboboxImplementation\n\t\t\t\tselectedVariableName={selectedVariableName}\n\t\t\t\tonSelect={onSelect}\n\t\t\t/>\n\t\t</Suspense>\n\t);\n};\n\nconst VariableComboboxImplementation = ({\n\tselectedVariableName,\n\tonSelect,\n}: VariableComboboxProps) => {\n\tconst [search, setSearch] = useState(\"\");\n\tconst deferredSearch = useDeferredValue(search);\n\n\tconst { data } = useSuspenseQuery(\n\t\tbuildFilterVariablesQuery({\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t\tvariables: deferredSearch\n\t\t\t\t? { operator: \"and_\", name: { like_: deferredSearch } }\n\t\t\t\t: undefined,\n\t\t\tlimit: 50,\n\t\t}),\n\t);\n\n\tconst filteredData = useMemo(() => {\n\t\treturn data.filter((variable) =>\n\t\t\tvariable.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [data, deferredSearch]);\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\tselected={Boolean(selectedVariableName)}\n\t\t\t\taria-label=\"Select a variable\"\n\t\t\t>\n\t\t\t\t{selectedVariableName ?? \"Select a variable...\"}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search for a variable...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandEmtpy>No variable found</ComboboxCommandEmtpy>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t{filteredData.map((variable) => (\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tkey={variable.id}\n\t\t\t\t\t\t\t\tselected={selectedVariableName === variable.name}\n\t\t\t\t\t\t\t\tonSelect={(value) => {\n\t\t\t\t\t\t\t\t\tonSelect(value);\n\t\t\t\t\t\t\t\t\tsetSearch(\"\");\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvalue={variable.name}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{variable.name}\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n};\n","import { VariableCombobox } from \"@/components/variables/variable-combobox\";\nimport type { PrefectKindValueWorkspaceVariable } from \"./types/prefect-kind-value\";\n\ntype SchemaFormInputPrefectKindWorkspaceVariableProps = {\n\tvalue: PrefectKindValueWorkspaceVariable;\n\tonValueChange: (value: PrefectKindValueWorkspaceVariable) => void;\n\tid: string;\n};\n\nexport function SchemaFormInputPrefectKindWorkspaceVariable({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputPrefectKindWorkspaceVariableProps) {\n\tconst handleSelect = (variableName: string | undefined) => {\n\t\tonValueChange({\n\t\t\t__prefect_kind: \"workspace_variable\",\n\t\t\tvariable_name: variableName,\n\t\t});\n\t};\n\n\treturn (\n\t\t<div id={id}>\n\t\t\t<VariableCombobox\n\t\t\t\tselectedVariableName={value.variable_name}\n\t\t\t\tonSelect={handleSelect}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n","import { format, parse, startOfToday } from \"date-fns\";\nimport { Calendar as CalendarIcon } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport {\n\tPopover,\n\tPopoverContent,\n\tPopoverTrigger,\n} from \"@/components/ui/popover\";\nimport { cn } from \"@/utils\";\n\ntype SchemaFormInputStringFormatDateProps = {\n\tvalue: string | undefined;\n\tonValueChange: (value: string | undefined) => void;\n\tid: string;\n};\n\nconst dateFormat = \"yyyy-MM-dd\";\n\nexport function SchemaFormInputStringFormatDate({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputStringFormatDateProps) {\n\tconst initialDate = value\n\t\t? parse(value, dateFormat, startOfToday())\n\t\t: undefined;\n\tconst [date, setDate] = useState<Date | undefined>(initialDate);\n\n\tfunction handleDateChange(date: Date | undefined) {\n\t\tsetDate(date);\n\t\tonValueChange(date ? format(date, dateFormat) : undefined);\n\t}\n\n\treturn (\n\t\t<Popover>\n\t\t\t<PopoverTrigger asChild>\n\t\t\t\t<Button\n\t\t\t\t\tvariant={\"outline\"}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"justify-start text-left font-normal w-full\",\n\t\t\t\t\t\t!date && \"text-muted-foreground\",\n\t\t\t\t\t)}\n\t\t\t\t\tid={id}\n\t\t\t\t>\n\t\t\t\t\t<CalendarIcon className=\"mr-2 h-4 w-4\" />\n\t\t\t\t\t{date ? format(date, \"PPP\") : <span>Pick a date</span>}\n\t\t\t\t</Button>\n\t\t\t</PopoverTrigger>\n\t\t\t<PopoverContent className=\"w-auto p-0\">\n\t\t\t\t<Calendar\n\t\t\t\t\tmode=\"single\"\n\t\t\t\t\tselected={date}\n\t\t\t\t\tonSelect={handleDateChange}\n\t\t\t\t\trequired={true}\n\t\t\t\t\tautoFocus\n\t\t\t\t/>\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n","import { LazyJsonInput as JsonInput } from \"../ui/json-input-lazy\";\n\nexport type SchemaFormInputStringFormatJsonProps = {\n\tvalue: string | undefined;\n\tonValueChange: (value: string | undefined) => void;\n\tid: string;\n};\n\nexport function SchemaFormInputStringFormatJson({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputStringFormatJsonProps) {\n\t// the JsonInput's types for onChange are probably wrong but this makes it work\n\tconst onChange: React.FormEventHandler<HTMLDivElement> &\n\t\t((value: string) => void) = (value) => {\n\t\tif (typeof value === \"string\" || value === undefined) {\n\t\t\tonValueChange(value || undefined);\n\t\t}\n\t};\n\n\treturn <JsonInput value={value} onChange={onChange} id={id} />;\n}\n","import { Eye, EyeOff } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\n\ntype SchemaFormInputStringFormatPasswordProps = {\n\tvalue: string | undefined;\n\tonValueChange: (value: string | undefined) => void;\n\tid: string;\n};\n\nexport function SchemaFormInputStringFormatPassword({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputStringFormatPasswordProps) {\n\tconst [showPassword, setShowPassword] = useState(false);\n\n\tconst handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\tonValueChange(e.target.value || undefined);\n\t};\n\n\treturn (\n\t\t<div className=\"relative\">\n\t\t\t<Input\n\t\t\t\tid={id}\n\t\t\t\ttype={showPassword ? \"text\" : \"password\"}\n\t\t\t\tvalue={value ?? \"\"}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tclassName=\"pr-10\"\n\t\t\t/>\n\t\t\t<Button\n\t\t\t\ttype=\"button\"\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName=\"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7\"\n\t\t\t\tonClick={() => setShowPassword(!showPassword)}\n\t\t\t\taria-label={showPassword ? \"Hide password\" : \"Show password\"}\n\t\t\t>\n\t\t\t\t{showPassword ? (\n\t\t\t\t\t<EyeOff className=\"h-4 w-4\" />\n\t\t\t\t) : (\n\t\t\t\t\t<Eye className=\"h-4 w-4\" />\n\t\t\t\t)}\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n","import { Input } from \"@/components/ui/input\";\n\ntype SchemaFormInputStringFormatTimeDeltaProps = {\n\tvalue: string | undefined;\n\tonValueChange: (value: string | undefined) => void;\n\tid: string;\n};\n\nexport function SchemaFormInputStringFormatTimeDelta({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputStringFormatTimeDeltaProps) {\n\tfunction handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n\t\tconst inputValue = e.target.value;\n\t\tif (inputValue === \"\") {\n\t\t\tonValueChange(undefined);\n\t\t\treturn;\n\t\t}\n\t\tconst numericValue = Number(inputValue);\n\t\tif (!Number.isNaN(numericValue)) {\n\t\t\tonValueChange(String(numericValue));\n\t\t}\n\t}\n\n\treturn (\n\t\t<Input\n\t\t\ttype=\"number\"\n\t\t\tvalue={value ?? \"\"}\n\t\t\tonChange={handleChange}\n\t\t\tid={id}\n\t\t\tplaceholder=\"Duration in seconds\"\n\t\t\tmin={0}\n\t\t/>\n\t);\n}\n","import type { SchemaObject, StringSubtype } from \"openapi-typescript\";\nimport { Textarea } from \"../ui/textarea\";\nimport { SchemaFormInputEnum } from \"./schema-form-input-enum\";\nimport { SchemaFormInputStringFormatDate } from \"./schema-form-input-string-format-date\";\nimport { SchemaFormInputStringFormatDateTime } from \"./schema-form-input-string-format-datetime\";\nimport { SchemaFormInputStringFormatJson } from \"./schema-form-input-string-format-json\";\nimport { SchemaFormInputStringFormatPassword } from \"./schema-form-input-string-format-password\";\nimport { SchemaFormInputStringFormatTimeDelta } from \"./schema-form-input-string-format-time-delta\";\nimport { isWithPrimitiveEnum } from \"./types/schemas\";\n\nexport type SchemaFormInputStringProps = {\n\tvalue: string | undefined;\n\tonValueChange: (value: string | undefined) => void;\n\tproperty: SchemaObject & StringSubtype;\n\tid: string;\n};\n\nexport function SchemaFormInputString({\n\tvalue,\n\tonValueChange,\n\tproperty,\n\tid,\n}: SchemaFormInputStringProps) {\n\tfunction handleChange(value: string | undefined) {\n\t\tonValueChange(value || undefined);\n\t}\n\n\tif (isWithPrimitiveEnum(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputEnum\n\t\t\t\tmultiple={false}\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={property}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.format === \"date\") {\n\t\treturn (\n\t\t\t<SchemaFormInputStringFormatDate\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.format === \"date-time\") {\n\t\treturn (\n\t\t\t<SchemaFormInputStringFormatDateTime\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.format === \"json-string\") {\n\t\treturn (\n\t\t\t<SchemaFormInputStringFormatJson\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.format === \"time-delta\") {\n\t\treturn (\n\t\t\t<SchemaFormInputStringFormatTimeDelta\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.format === \"password\") {\n\t\treturn (\n\t\t\t<SchemaFormInputStringFormatPassword\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Textarea\n\t\t\tvalue={value ?? \"\"}\n\t\t\trows={1}\n\t\t\tclassName=\"min-h-min\"\n\t\t\tonChange={(e) => handleChange(e.target.value)}\n\t\t\tid={id}\n\t\t/>\n\t);\n}\n","import type { SchemaObject } from \"openapi-typescript\";\nimport { useEffect } from \"react\";\nimport { SchemaFormInputEnum } from \"./schema-form-input-enum\";\nimport { isWithPrimitiveEnum } from \"./types/schemas\";\nimport { asPrimitive } from \"./utilities/asType\";\n\nexport type SchemaFormInputUnknownProps = {\n\tvalue: unknown;\n\tonValueChange: (value: unknown) => void;\n\tproperty: SchemaObject & { type: undefined };\n\tid: string;\n};\n\nexport function SchemaFormInputUnknown({\n\tvalue,\n\tonValueChange,\n\tproperty,\n\tid,\n}: SchemaFormInputUnknownProps) {\n\t// if this isn't a simple enum we want to autoamtically switch to json\n\tuseEffect(() => {\n\t\tif (!isWithPrimitiveEnum(property)) {\n\t\t\tonValueChange({\n\t\t\t\t__prefect_kind: \"json\",\n\t\t\t});\n\t\t}\n\t}, [property, onValueChange]);\n\n\tif (isWithPrimitiveEnum(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputEnum\n\t\t\t\tmultiple={false}\n\t\t\t\tvalue={asPrimitive(value)}\n\t\t\t\tproperty={property}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn null;\n}\n","import type { SchemaObject } from \"openapi-typescript\";\nimport { SchemaFormInputAllOf } from \"./schema-form-input-all-of\";\nimport { SchemaFormInputAnyOf } from \"./schema-form-input-any-of\";\nimport { SchemaFormInputArray } from \"./schema-form-input-array\";\nimport { SchemaFormInputBlockDocument } from \"./schema-form-input-block-document\";\nimport { SchemaFormInputBoolean } from \"./schema-form-input-boolean\";\nimport { SchemaFormInputInteger } from \"./schema-form-input-integer\";\nimport { SchemaFormInputNull } from \"./schema-form-input-null\";\nimport { SchemaFormInputNumber } from \"./schema-form-input-number\";\nimport { SchemaFormInputObject } from \"./schema-form-input-object\";\nimport { SchemaFormInputPrefectKindJinja } from \"./schema-form-input-prefect-kind-jinja\";\nimport { SchemaFormInputPrefectKindJson } from \"./schema-form-input-prefect-kind-json\";\nimport { SchemaFormInputPrefectKindWorkspaceVariable } from \"./schema-form-input-prefect-kind-workspace-variable\";\nimport { SchemaFormInputString } from \"./schema-form-input-string\";\nimport { SchemaFormInputUnknown } from \"./schema-form-input-unknown\";\nimport type { SchemaFormErrors } from \"./types/errors\";\nimport { isPrefectKindValue } from \"./types/prefect-kind-value\";\nimport { asArray, asObject, asType } from \"./utilities/asType\";\nimport {\n\tisAllOfObject,\n\tisAnyOfObject,\n\tisOneOfObject,\n} from \"./utilities/guards\";\n\nexport type SchemaFormInputProps = {\n\tvalue: unknown;\n\tonValueChange: (value: unknown) => void;\n\terrors: SchemaFormErrors;\n\tproperty: SchemaObject;\n\tid: string;\n\tnested?: boolean;\n};\n\nexport function SchemaFormInput({\n\tvalue,\n\tonValueChange,\n\terrors,\n\tproperty,\n\tid,\n\tnested = true,\n}: SchemaFormInputProps) {\n\tif (isPrefectKindValue(value)) {\n\t\tif (isPrefectKindValue(value, \"json\")) {\n\t\t\treturn (\n\t\t\t\t<SchemaFormInputPrefectKindJson\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tonValueChange={onValueChange}\n\t\t\t\t\tid={id}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tif (isPrefectKindValue(value, \"jinja\")) {\n\t\t\treturn (\n\t\t\t\t<SchemaFormInputPrefectKindJinja\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tonValueChange={onValueChange}\n\t\t\t\t\tid={id}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tif (isPrefectKindValue(value, \"workspace_variable\")) {\n\t\t\treturn (\n\t\t\t\t<SchemaFormInputPrefectKindWorkspaceVariable\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tonValueChange={onValueChange}\n\t\t\t\t\tid={id}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\t// @ts-expect-error This is an exhaustive check. If a prefect kind is not implemented this will get flaggged.\n\t\tthrow new Error(`Prefect kind not implemented: ${value.__prefect_kind}`);\n\t}\n\n\tif (\"block_type_slug\" in property) {\n\t\tconst blockTypeSlug = property.block_type_slug;\n\t\tif (typeof blockTypeSlug === \"string\") {\n\t\t\treturn (\n\t\t\t\t<SchemaFormInputBlockDocument\n\t\t\t\t\tvalue={value as { $ref: string } | undefined}\n\t\t\t\t\tonValueChange={onValueChange}\n\t\t\t\t\tblockTypeSlug={blockTypeSlug}\n\t\t\t\t\tid={id}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t}\n\n\tif (isAnyOfObject(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputAnyOf\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={property}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\terrors={errors}\n\t\t\t/>\n\t\t);\n\t}\n\n\t// According to the spec, anyOf and oneOf are different. But pydantic always uses anyOf even when it should use oneOf. So we treat them the same.\n\t// This block shouldn't ever be hit because we handle anyOf above. But this offers some typesafety and a fallback in case of future changes.\n\t// https://swagger.io/docs/specification/v3_0/data-models/oneof-anyof-allof-not/\n\t// https://github.com/pydantic/pydantic/issues/4125\n\tif (isOneOfObject(property)) {\n\t\tconst propertyWithAnyOf = {\n\t\t\t...property,\n\t\t\tanyOf: property.oneOf,\n\t\t};\n\n\t\treturn (\n\t\t\t<SchemaFormInputAnyOf\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={propertyWithAnyOf}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\terrors={errors}\n\t\t\t/>\n\t\t);\n\t}\n\n\t// this is the same as an anyOf so we can convert it here and use the same logic component\n\tif (Array.isArray(property.type)) {\n\t\tconst propertyWithAnyOf = {\n\t\t\t...property,\n\t\t\tanyOf: Object.values(property.type).map((type) => ({\n\t\t\t\ttype,\n\t\t\t})),\n\t\t};\n\n\t\treturn (\n\t\t\t<SchemaFormInputAnyOf\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={propertyWithAnyOf}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\terrors={errors}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (isAllOfObject(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputAllOf\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\terrors={errors}\n\t\t\t\tproperty={property}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"string\") {\n\t\treturn (\n\t\t\t<SchemaFormInputString\n\t\t\t\tvalue={asType(value, String)}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tproperty={property}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"integer\") {\n\t\treturn (\n\t\t\t<SchemaFormInputInteger\n\t\t\t\tvalue={asType(value, Number)}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tproperty={property}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"number\") {\n\t\treturn (\n\t\t\t<SchemaFormInputNumber\n\t\t\t\tvalue={asType(value, Number)}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tproperty={property}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"boolean\") {\n\t\treturn (\n\t\t\t<SchemaFormInputBoolean\n\t\t\t\tvalue={asType(value, Boolean)}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tproperty={property}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"object\") {\n\t\treturn (\n\t\t\t<SchemaFormInputObject\n\t\t\t\tvalues={asObject(value)}\n\t\t\t\tproperty={property}\n\t\t\t\tonValuesChange={onValueChange}\n\t\t\t\terrors={errors}\n\t\t\t\tnested={nested}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"array\") {\n\t\treturn (\n\t\t\t<SchemaFormInputArray\n\t\t\t\tvalues={asArray(value)}\n\t\t\t\tproperty={property}\n\t\t\t\tonValuesChange={onValueChange}\n\t\t\t\terrors={errors}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"null\") {\n\t\treturn <SchemaFormInputNull />;\n\t}\n\n\tif (property.type === undefined) {\n\t\treturn (\n\t\t\t<SchemaFormInputUnknown\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tproperty={property}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tthrow new Error(\n\t\t`Schema type not implemented: ${String(property.type satisfies never)}`,\n\t);\n}\n","import type { SchemaObject } from \"openapi-typescript\";\nimport { useMemo } from \"react\";\n\nexport type SchemaFormPropertyDescriptionProps = {\n\tproperty: SchemaObject;\n};\n\nexport function SchemaFormPropertyDescription({\n\tproperty,\n}: SchemaFormPropertyDescriptionProps) {\n\t// Description come from the doc strings which frequently have very short line lengths. We remove the single line breaks to make it easier to read.\n\tconst description = useMemo(() => {\n\t\treturn property.description?.replace(/\\n(?!\\n)/g, \" \");\n\t}, [property.description]);\n\n\t// todo: support markdown\n\treturn description && <p className=\"text-sm text-gray-500\">{description}</p>;\n}\n","import type { SchemaObject } from \"openapi-typescript\";\nimport { useMemo } from \"react\";\nimport { Label } from \"../ui/label\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { getSchemaObjectLabel } from \"./utilities/getSchemaObjectLabel\";\n\nexport type SchemaFormPropertyLabelProps = {\n\tproperty: SchemaObject;\n\trequired: boolean;\n\tid: string;\n};\n\nexport function SchemaFormPropertyLabel({\n\tproperty,\n\trequired,\n\tid,\n}: SchemaFormPropertyLabelProps) {\n\tconst { schema } = useSchemaFormContext();\n\n\tconst label = useMemo(() => {\n\t\tconst label = getSchemaObjectLabel(property, schema);\n\n\t\tif (required) {\n\t\t\treturn label;\n\t\t}\n\n\t\treturn `${label} (Optional)`;\n\t}, [property, required, schema]);\n\n\treturn <Label htmlFor={id}>{label}</Label>;\n}\n","import type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\nimport { useCallback, useEffect, useId, useMemo, useState } from \"react\";\nimport { DropdownMenuItem } from \"../ui/dropdown-menu\";\nimport { SchemaFormInput } from \"./schema-form-input\";\nimport { SchemaFormPropertyDescription } from \"./schema-form-property-description\";\nimport { SchemaFormPropertyErrors } from \"./schema-form-property-errors\";\nimport { SchemaFormPropertyLabel } from \"./schema-form-property-label\";\nimport { SchemaFormPropertyMenu } from \"./schema-form-property-menu\";\nimport {\n\tisSchemaValueIndexError,\n\tisSchemaValuePropertyError,\n\ttype SchemaFormErrors,\n\ttype SchemaValueIndexError,\n\ttype SchemaValuePropertyError,\n} from \"./types/errors\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { isDefined } from \"./utilities/guards\";\nimport { mergeSchemaPropertyDefinition } from \"./utilities/mergeSchemaPropertyDefinition\";\n\nexport type SchemaFormPropertyProps = {\n\tvalue: unknown;\n\tonValueChange: (value: unknown) => void;\n\tproperty: SchemaObject | ReferenceObject;\n\trequired: boolean;\n\terrors: SchemaFormErrors;\n\tshowLabel?: boolean;\n\tnested?: boolean;\n};\n\nexport function SchemaFormProperty({\n\tproperty: propertyDefinition,\n\tvalue,\n\tonValueChange,\n\trequired,\n\terrors,\n\tshowLabel = true,\n\tnested = true,\n}: SchemaFormPropertyProps) {\n\tconst { schema, skipDefaultValueInitialization } = useSchemaFormContext();\n\n\tconst property = useMemo(() => {\n\t\treturn mergeSchemaPropertyDefinition(propertyDefinition, schema);\n\t}, [propertyDefinition, schema]);\n\n\tconst unknownPropertyType = useMemo(() => {\n\t\treturn !isDefined(property.type);\n\t}, [property.type]);\n\n\tconst nestedErrors = useMemo(() => {\n\t\treturn errors.filter(\n\t\t\t(error): error is SchemaValuePropertyError | SchemaValueIndexError =>\n\t\t\t\tisSchemaValuePropertyError(error) || isSchemaValueIndexError(error),\n\t\t);\n\t}, [errors]);\n\n\tconst [initialized, setInitialized] = useState(false);\n\tconst [internalValue, setInternalValue] = useState(getInitialValue);\n\tconst [omitted, setOmitted] = useState(false);\n\tconst id = useId();\n\n\tconst handleValueChange = useCallback(\n\t\t(value: unknown) => {\n\t\t\tsetInternalValue(value);\n\t\t\tonValueChange(value);\n\t\t},\n\t\t[onValueChange],\n\t);\n\n\tconst handleOmittedChange = useCallback(() => {\n\t\tconst isOmitted = !omitted;\n\n\t\tsetOmitted(isOmitted);\n\t\tonValueChange(isOmitted ? undefined : internalValue);\n\t}, [omitted, onValueChange, internalValue]);\n\n\tuseEffect(() => {\n\t\tif (initialized || skipDefaultValueInitialization) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isDefined(property.default) && !isDefined(value)) {\n\t\t\tonValueChange(property.default);\n\t\t}\n\n\t\tsetInitialized(true);\n\t}, [\n\t\tinitialized,\n\t\tskipDefaultValueInitialization,\n\t\tonValueChange,\n\t\tproperty.default,\n\t\tvalue,\n\t]);\n\n\tfunction getInitialValue() {\n\t\tif (isDefined(value)) {\n\t\t\treturn value;\n\t\t}\n\n\t\tif (isDefined(property.default) && !skipDefaultValueInitialization) {\n\t\t\treturn property.default;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-2 group\">\n\t\t\t{showLabel && (\n\t\t\t\t<div className=\"grid grid-cols-[1fr_auto] items-center gap-2\">\n\t\t\t\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t\t\t\t<SchemaFormPropertyLabel\n\t\t\t\t\t\t\tproperty={property}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<SchemaFormPropertyDescription property={property} />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"ml-auto\">\n\t\t\t\t\t\t<SchemaFormPropertyMenu\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tonValueChange={handleValueChange}\n\t\t\t\t\t\t\tproperty={property}\n\t\t\t\t\t\t\tdisableKinds={unknownPropertyType}\n\t\t\t\t\t\t\tdefaultValue={property.default}\n\t\t\t\t\t\t\thasDefaultValue={isDefined(property.default)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DropdownMenuItem onClick={handleOmittedChange}>\n\t\t\t\t\t\t\t\t{omitted ? \"Include value\" : \"Omit value\"}\n\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t</SchemaFormPropertyMenu>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!showLabel && <SchemaFormPropertyDescription property={property} />}\n\n\t\t\t<fieldset disabled={omitted}>\n\t\t\t\t<SchemaFormInput\n\t\t\t\t\tproperty={property}\n\t\t\t\t\tvalue={internalValue}\n\t\t\t\t\tonValueChange={handleValueChange}\n\t\t\t\t\terrors={nestedErrors}\n\t\t\t\t\tid={id}\n\t\t\t\t\tnested={nested}\n\t\t\t\t/>\n\t\t\t</fieldset>\n\n\t\t\t<SchemaFormPropertyErrors errors={errors} />\n\t\t</div>\n\t);\n}\n","import type { WithPosition } from \"../types/schemas\";\n\nexport function sortByPropertyPosition(a: WithPosition, b: WithPosition) {\n\treturn (a.position ?? 0) - (b.position ?? 0);\n}\n","import type { ObjectSubtype, SchemaObject } from \"openapi-typescript\";\nimport { useCallback, useMemo, useRef } from \"react\";\nimport useDebounceCallback from \"@/hooks/use-debounce-callback\";\nimport { Card } from \"../ui/card\";\nimport { SchemaFormProperty } from \"./schema-form-property\";\nimport {\n\tisSchemaValuePropertyError,\n\ttype SchemaFormErrors,\n} from \"./types/errors\";\nimport type { PrefectObjectSubtype } from \"./types/schemas\";\nimport { sortByPropertyPosition } from \"./utilities/sortByPropertyPosition\";\n\nexport type SchemaFormInputObjectProps = {\n\tvalues: Record<string, unknown> | undefined;\n\tonValuesChange: (values: Record<string, unknown> | undefined) => void;\n\tproperty: SchemaObject & ObjectSubtype & PrefectObjectSubtype;\n\terrors: SchemaFormErrors;\n\tnested: boolean;\n};\n\nexport function SchemaFormInputObject({\n\tvalues,\n\tonValuesChange,\n\tproperty,\n\terrors,\n\tnested,\n}: SchemaFormInputObjectProps) {\n\tconst patches = useRef<{ key: string; value: unknown }[]>([]);\n\n\tconst flush = useDebounceCallback(\n\t\tuseCallback(() => {\n\t\t\tconst newValues = { ...values };\n\n\t\t\tfor (const { key, value } of patches.current) {\n\t\t\t\tnewValues[key] = value;\n\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tdelete newValues[key];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpatches.current = [];\n\n\t\t\tif (Object.keys(newValues).length === 0) {\n\t\t\t\tonValuesChange(undefined);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonValuesChange(newValues);\n\t\t}, [values, onValuesChange]),\n\t\t10,\n\t);\n\n\tfunction onPropertyValueChange(key: string, value: unknown) {\n\t\tpatches.current.push({ key, value });\n\n\t\tflush();\n\t}\n\n\tfunction getPropertyValue(key: string): unknown {\n\t\treturn values?.[key];\n\t}\n\n\tfunction getPropertyErrors(key: string): SchemaFormErrors {\n\t\treturn errors\n\t\t\t.filter(isSchemaValuePropertyError)\n\t\t\t.filter((error) => error.property === key)\n\t\t\t.flatMap((error) => error.errors);\n\t}\n\n\tconst properties = useMemo(() => {\n\t\treturn Object.entries(property.properties ?? {}).sort(([, a], [, b]) =>\n\t\t\tsortByPropertyPosition(a, b),\n\t\t);\n\t}, [property.properties]);\n\n\tconst output = (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t{properties.map(([key, subProperty]) => (\n\t\t\t\t<SchemaFormProperty\n\t\t\t\t\tkey={key}\n\t\t\t\t\tvalue={getPropertyValue(key)}\n\t\t\t\t\tonValueChange={(value) => onPropertyValueChange(key, value)}\n\t\t\t\t\tproperty={subProperty}\n\t\t\t\t\terrors={getPropertyErrors(key)}\n\t\t\t\t\trequired={Boolean(property.required?.includes(key))}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n\n\tif (nested) {\n\t\treturn <Card className=\"p-2\">{output}</Card>;\n\t}\n\n\treturn output;\n}\n","import type { ReactNode } from \"react\";\nimport { SchemaFormContext } from \"./use-schema-form-context\";\n\ntype SchemaFormProviderProps = SchemaFormContext & {\n\tchildren: ReactNode;\n};\n\nexport const SchemaFormProvider = ({\n\tchildren,\n\t...context\n}: SchemaFormProviderProps) => {\n\treturn (\n\t\t<SchemaFormContext.Provider value={context}>\n\t\t\t{children}\n\t\t</SchemaFormContext.Provider>\n\t);\n};\n","import { useCallback } from \"react\";\nimport {\n\tSchemaFormInputObject,\n\ttype SchemaFormInputObjectProps,\n} from \"./schema-form-input-object\";\nimport { SchemaFormProvider } from \"./schema-form-provider\";\nimport type { SchemaFormErrors } from \"./types/errors\";\nimport type { SchemaFormValues } from \"./types/values\";\nimport type { SchemaFormContext } from \"./use-schema-form-context\";\n\nexport type SchemaFormProps = SchemaFormContext & {\n\terrors: SchemaFormErrors;\n\tvalues: SchemaFormValues;\n\tonValuesChange: (values: SchemaFormValues) => void;\n};\n\nexport const SchemaForm = ({\n\tschema,\n\tkinds,\n\tskipDefaultValueInitialization,\n\tvalues,\n\tonValuesChange,\n\terrors,\n}: SchemaFormProps) => {\n\tconst context: SchemaFormContext = {\n\t\tschema,\n\t\tkinds,\n\t\tskipDefaultValueInitialization,\n\t};\n\n\tconst handleValuesChange = useCallback(\n\t\t(values: Record<string, unknown> | undefined) => {\n\t\t\tif (values === undefined) {\n\t\t\t\tonValuesChange({});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonValuesChange(values);\n\t\t},\n\t\t[onValuesChange],\n\t);\n\n\tconst properties: Omit<SchemaFormInputObjectProps, \"nested\"> = {\n\t\tvalues,\n\t\tproperty: schema,\n\t\tonValuesChange: handleValuesChange,\n\t\terrors,\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<SchemaFormProvider {...context}>\n\t\t\t\t<SchemaFormInputObject {...properties} nested={false} />\n\t\t\t</SchemaFormProvider>\n\t\t</div>\n\t);\n};\n"],"names":["__iconNode","EyeOff","createLucideIcon","Eye","GripVertical","isDefined","value","isRecord","item","isDate","isArray","isEmptyObject","isReferenceObject","property","isAnyOfObject","isOneOfObject","isAllOfObject","isItemsObject","isSchemaWithDefinitions","schema","getSchemaDefinition","definition","definitionKey","definitionSchema","mergeSchemaPropertyDefinition","$ref","rest","merge","SchemaFormInputAllOf","onValueChange","errors","id","useSchemaFormContext","merged","useMemo","allOf","baseProperty","definitions","reference","jsx","SchemaFormInput","getIndexForAnyOfPropertyValue","valueOrDefaultValue","getSchemaPropertyAnyOfDefinitions","getObjectDefinitionIndex","getRecordDefinitionIndex","valueKeys","index","keysInCommon","resultIndex","resultKeysInCommon","definitionIndex","definitionKeys","definitionKeysInCommon","schemaObjectTypeLabels","getSchemaObjectTypeLabel","getSchemaObjectLabel","fallback","SchemaFormInputAnyOf","selectedIndex","setSelectedIndex","useState","values","useRef","onSelectedIndexChange","newSelectedIndexValue","newSelectedIndex","jsxs","ToggleGroup","option","label","ToggleGroupItem","Card","SchemaFormProperty","byteToHex","i","unsafeStringify","arr","offset","getRandomValues","rnds8","rng","randomUUID","native","_v4","options","buf","rnds","v4","isSchemaValueError","error","isSchemaValuePropertyError","isSchemaValueIndexError","SchemaFormPropertyErrors","propertyErrors","getPrefectKindFromValue","isPrefectKindValue","kind","isPrefectKind","convertValueToPrefectKind","to","from","convertPrefectKindValueJson","convertPrefectKindValueJinja","convertPrefectKindValueWorkspaceVariable","convertPrefectKindValueNull","json","parsed","coerceValueToProperties","InvalidSchemaValueTransformation","jinja","workspaceVariable","coerceValueToProperty","response","coerceValueToArrayProperty","coerceValueToObjectProperty","key","propertyValue","SchemaFormPropertyMenu","children","disableKinds","defaultValue","hasDefaultValue","kinds","open","setOpen","isDefaultValueDisabled","handleUseDefaultValue","convertValueKind","newValue","kindOptions","current","prefectKinds","DropdownMenu","DropdownMenuTrigger","Button","Icon","DropdownMenuContent","DropdownMenuItem","getPrefectKindLabel","DropdownMenuSeparator","SchemaFormInputArrayItem","itemKey","items","onDelete","first","last","canMove","moveUp","moveDown","moveToTop","moveToBottom","useId","attributes","listeners","setNodeRef","transform","transition","isDragging","useSortable","style","CSS","Fragment","SchemaFormInputArrayList","onValuesChange","isEmpty","canAddMore","prefixItemsCount","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","sortableKeyboardCoordinates","localKeyedValues","setLocalKeyedValues","uuidv4","getPropertyForIndex","getErrorsForIndex","getFirstForIndex","getLastForIndex","getCanMoveForIndex","handleValueChange","addItem","newKeyedValues","moveItem","newValues","deleteItem","handleDragEnd","event","active","over","oldIndex","newIndex","sortableKeys","DndContext","closestCenter","SortableContext","verticalListSortingStrategy","SchemaFormInputEnum","props","search","setSearch","selected","isSelected","onSelect","onSelectMultiple","onSelectSingle","v","Combobox","ComboboxTrigger","ComboboxContent","ComboboxCommandInput","ComboboxCommandEmtpy","ComboboxCommandList","ComboboxCommandItem","isWithPrimitiveEnum","isPrimitivePropertyType","asType","type","asObject","asPrimitive","asArray","SchemaFormInputArray","handleValuesChange","BlockDocumentCombobox","blockTypeSlug","selectedBlockDocumentId","onCreateNew","Suspense","BlockDocumentComboboxImplementation","deferredSearch","useDeferredValue","data","useSuspenseQuery","buildListFilterBlockDocumentsQuery","filteredData","blockDocument","selectedBlockDocument","ComboboxCommandGroup","SchemaFormInputBlockDocument","SchemaFormInputBlockDocumentSkeleton","SchemaFormInputBlockDocumentContent","Skeleton","createDialogOpen","setCreateDialogOpen","blockType","buildGetBlockTypeQuery","blockDocumentCount","buildCountFilterBlockDocumentsQuery","hasBlockDocuments","handleSelect","blockDocumentId","handleCreated","BlockTypeLogo","BlockDocumentCreateDialog","SchemaFormInputBoolean","onCheckedChange","checked","Switch","SchemaFormInputInteger","handleChange","Input","e","SchemaFormInputNull","SchemaFormInputNumber","SchemaFormInputPrefectKindJinja","onChange","JsonInput","SchemaFormInputPrefectKindJson","VariableCombobox","selectedVariableName","VariableComboboxImplementation","buildFilterVariablesQuery","variable","SchemaFormInputPrefectKindWorkspaceVariable","variableName","dateFormat","SchemaFormInputStringFormatDate","initialDate","parse","startOfToday","date","setDate","handleDateChange","format","Popover","PopoverTrigger","cn","CalendarIcon","PopoverContent","Calendar","SchemaFormInputStringFormatJson","SchemaFormInputStringFormatPassword","showPassword","setShowPassword","SchemaFormInputStringFormatTimeDelta","inputValue","numericValue","SchemaFormInputString","SchemaFormInputStringFormatDateTime","Textarea","SchemaFormInputUnknown","useEffect","nested","propertyWithAnyOf","SchemaFormInputObject","SchemaFormPropertyDescription","description","SchemaFormPropertyLabel","required","Label","propertyDefinition","showLabel","skipDefaultValueInitialization","unknownPropertyType","nestedErrors","initialized","setInitialized","internalValue","setInternalValue","getInitialValue","omitted","setOmitted","useCallback","handleOmittedChange","isOmitted","sortByPropertyPosition","a","b","patches","flush","useDebounceCallback","onPropertyValueChange","getPropertyValue","getPropertyErrors","properties","output","subProperty","SchemaFormProvider","context","SchemaFormContext","SchemaForm"],"mappings":"2nCASA,MAAMA,GAAa,CACjB,CACE,OACA,CACE,EAAG,iGACH,IAAK,QACX,CACA,EACE,CAAC,OAAQ,CAAE,EAAG,uCAAwC,IAAK,QAAQ,CAAE,EACrE,CACE,OACA,CACE,EAAG,+FACH,IAAK,QACX,CACA,EACE,CAAC,OAAQ,CAAE,EAAG,aAAc,IAAK,QAAQ,CAAE,CAC7C,EACMC,GAASC,EAAiB,UAAWF,EAAU,EClBrD,MAAMA,GAAa,CACjB,CACE,OACA,CACE,EAAG,wGACH,IAAK,QACX,CACA,EACE,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,IAAK,IAAK,QAAQ,CAAE,CAC1D,EACMG,GAAMD,EAAiB,MAAOF,EAAU,ECV9C,MAAMA,GAAa,CACjB,CAAC,SAAU,CAAE,GAAI,IAAK,GAAI,KAAM,EAAG,IAAK,IAAK,SAAU,EACvD,CAAC,SAAU,CAAE,GAAI,IAAK,GAAI,IAAK,EAAG,IAAK,IAAK,SAAU,EACtD,CAAC,SAAU,CAAE,GAAI,IAAK,GAAI,KAAM,EAAG,IAAK,IAAK,SAAU,EACvD,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI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ACb,SAAAyS,EAAW,IAAI,CAAC,CAAC5N,EAAK8N,CAAW,IACjC3S,EAAAA,IAACkC,GAAA,CAEA,MAAOqQ,EAAiB1N,CAAG,EAC3B,cAAgB9G,GAAUuU,EAAsBzN,EAAK9G,CAAK,EAC1D,SAAU4U,EACV,OAAQH,EAAkB3N,CAAG,EAC7B,SAAU,EAAQvG,EAAS,UAAU,SAASuG,CAAG,CAAC,EAL7CA,CAAA,CAON,EACF,EAGD,OAAI4L,EACIzQ,EAAAA,IAACiC,GAAA,CAAK,UAAU,MAAO,SAAAyQ,EAAO,EAG/BA,CACR,CCzFO,MAAME,GAAqB,CAAC,CAClC,SAAA5N,EACA,GAAG6N,CACJ,UAEGC,GAAkB,SAAlB,CAA2B,MAAOD,EACjC,SAAA7N,EACF,ECEW+N,GAAa,CAAC,CAC1B,OAAAnU,EACA,MAAAwG,EACA,+BAAA+L,EACA,OAAA5P,EACA,eAAAsG,EACA,OAAAtI,CACD,IAAuB,CACtB,MAAMsT,EAA6B,CAClC,OAAAjU,EACA,MAAAwG,EACA,+BAAA+L,CAAA,EAGK1F,EAAqBoG,EAAAA,YACzBtQ,GAAgD,CAChD,GAAIA,IAAW,OAAW,CACzBsG,EAAe,CAAA,CAAE,EACjB,MACD,CAEAA,EAAetG,CAAM,CACtB,EACA,CAACsG,CAAc,CAAA,EAGV4K,EAAyD,CAC9D,OAAAlR,EACA,SAAU3C,EACV,eAAgB6M,EAChB,OAAAlM,CAAA,EAGD,OACCS,EAAAA,IAAC,MAAA,CAAI,UAAU,sBACd,eAAC4S,GAAA,CAAoB,GAAGC,EACvB,SAAA7S,EAAAA,IAAC2Q,IAAuB,GAAG8B,EAAY,OAAQ,EAAA,CAAO,EACvD,EACD,CAEF","x_google_ignoreList":[0,1,2,9,10,11,12]}
1
+ {"version":3,"file":"schema-form-BwTmkvJk.js","sources":["../../node_modules/lucide-react/dist/esm/icons/eye-off.js","../../node_modules/lucide-react/dist/esm/icons/eye.js","../../node_modules/lucide-react/dist/esm/icons/grip-vertical.js","../../src/components/schemas/utilities/guards.ts","../../src/components/schemas/utilities/mergeSchemaPropertyDefinition.ts","../../src/components/schemas/schema-form-input-all-of.tsx","../../src/components/schemas/utilities/getIndexForAnyOfPropertyValue.ts","../../src/components/schemas/utilities/getSchemaObjectLabel.ts","../../src/components/schemas/schema-form-input-any-of.tsx","../../node_modules/uuid/dist/stringify.js","../../node_modules/uuid/dist/rng.js","../../node_modules/uuid/dist/native.js","../../node_modules/uuid/dist/v4.js","../../src/components/schemas/types/errors.ts","../../src/components/schemas/schema-form-property-errors.tsx","../../src/components/schemas/types/prefect-kind-value.ts","../../src/components/schemas/utilities/convertValueToPrefectKind.ts","../../src/components/schemas/schema-form-property-menu.tsx","../../src/components/schemas/schema-form-input-array-item.tsx","../../src/components/schemas/schema-form-input-array-list.tsx","../../src/components/schemas/schema-form-input-enum.tsx","../../src/components/schemas/types/schemas.ts","../../src/components/schemas/utilities/asType.ts","../../src/components/schemas/schema-form-input-array.tsx","../../src/components/blocks/block-document-combobox/block-document-combobox.tsx","../../src/components/schemas/schema-form-input-block-document.tsx","../../src/components/schemas/schema-form-input-boolean.tsx","../../src/components/schemas/schema-form-input-integer.tsx","../../src/components/schemas/schema-form-input-null.tsx","../../src/components/schemas/schema-form-input-number.tsx","../../src/components/schemas/schema-form-input-prefect-kind-jinja.tsx","../../src/components/schemas/schema-form-input-prefect-kind-json.tsx","../../src/components/variables/variable-combobox/variable-combobox.tsx","../../src/components/schemas/schema-form-input-prefect-kind-workspace-variable.tsx","../../src/components/schemas/schema-form-input-string-format-date.tsx","../../src/components/schemas/schema-form-input-string-format-json.tsx","../../src/components/schemas/schema-form-input-string-format-password.tsx","../../src/components/schemas/schema-form-input-string-format-time-delta.tsx","../../src/components/schemas/schema-form-input-string.tsx","../../src/components/schemas/schema-form-input-unknown.tsx","../../src/components/schemas/schema-form-input.tsx","../../src/components/schemas/schema-form-property-description.tsx","../../src/components/schemas/schema-form-property-label.tsx","../../src/components/schemas/schema-form-property.tsx","../../src/components/schemas/utilities/sortByPropertyPosition.ts","../../src/components/schemas/schema-form-input-object.tsx","../../src/components/schemas/schema-form-provider.tsx","../../src/components/schemas/schema-form.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\",\n key: \"ct8e1f\"\n }\n ],\n [\"path\", { d: \"M14.084 14.158a3 3 0 0 1-4.242-4.242\", key: \"151rxh\" }],\n [\n \"path\",\n {\n d: \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\",\n key: \"13bj9a\"\n }\n ],\n [\"path\", { d: \"m2 2 20 20\", key: \"1ooewy\" }]\n];\nconst EyeOff = createLucideIcon(\"eye-off\", __iconNode);\n\nexport { __iconNode, EyeOff as default };\n//# sourceMappingURL=eye-off.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\",\n key: \"1nclc0\"\n }\n ],\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"3\", key: \"1v7zrd\" }]\n];\nconst Eye = createLucideIcon(\"eye\", __iconNode);\n\nexport { __iconNode, Eye as default };\n//# sourceMappingURL=eye.js.map\n","/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"circle\", { cx: \"9\", cy: \"12\", r: \"1\", key: \"1vctgf\" }],\n [\"circle\", { cx: \"9\", cy: \"5\", r: \"1\", key: \"hp0tcf\" }],\n [\"circle\", { cx: \"9\", cy: \"19\", r: \"1\", key: \"fkjjf6\" }],\n [\"circle\", { cx: \"15\", cy: \"12\", r: \"1\", key: \"1tmaij\" }],\n [\"circle\", { cx: \"15\", cy: \"5\", r: \"1\", key: \"19l28e\" }],\n [\"circle\", { cx: \"15\", cy: \"19\", r: \"1\", key: \"f4zoj3\" }]\n];\nconst GripVertical = createLucideIcon(\"grip-vertical\", __iconNode);\n\nexport { __iconNode, GripVertical as default };\n//# sourceMappingURL=grip-vertical.js.map\n","import { isDate } from \"date-fns\";\nimport type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\n\nexport function isString(value: unknown): value is string {\n\treturn typeof value === \"string\";\n}\n\nexport function isDefined<T>(value: T | undefined): value is T {\n\treturn value !== undefined;\n}\n\nexport function isRecord(item: unknown): item is Record<PropertyKey, unknown> {\n\treturn (\n\t\titem !== null &&\n\t\ttypeof item === \"object\" &&\n\t\t!Array.isArray(item) &&\n\t\t!isDate(item)\n\t);\n}\n\nexport function isArray(item: unknown): item is unknown[] {\n\treturn Array.isArray(item);\n}\n\nexport function isEmptyObject(value: unknown): value is Record<string, never> {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\t!Array.isArray(value) &&\n\t\tvalue !== null &&\n\t\tObject.keys(value).length === 0\n\t);\n}\n\nexport function isReferenceObject(\n\tproperty: SchemaObject | ReferenceObject,\n): property is ReferenceObject {\n\treturn \"$ref\" in property;\n}\n\nexport function isAnyOfObject(\n\tproperty: SchemaObject,\n): property is SchemaObject & { anyOf: (SchemaObject | ReferenceObject)[] } {\n\treturn \"anyOf\" in property && isDefined(property.anyOf);\n}\n\nexport function isOneOfObject(\n\tproperty: SchemaObject,\n): property is SchemaObject & { oneOf: (SchemaObject | ReferenceObject)[] } {\n\treturn \"oneOf\" in property && isDefined(property.oneOf);\n}\n\nexport function isAllOfObject(\n\tproperty: SchemaObject,\n): property is SchemaObject & { allOf: (SchemaObject | ReferenceObject)[] } {\n\treturn \"allOf\" in property && isDefined(property.allOf);\n}\n\nexport function isItemsObject(\n\tproperty: SchemaObject,\n): property is SchemaObject & {\n\titems: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n} {\n\treturn \"items\" in property && isDefined(property.items);\n}\n","import merge from \"lodash.merge\";\nimport type {\n\tObjectSubtype,\n\tReferenceObject,\n\tSchemaObject,\n} from \"openapi-typescript\";\nimport { isRecord, isReferenceObject } from \"./guards\";\n\ntype SchemaWithDefinitions = SchemaObject &\n\tObjectSubtype & {\n\t\tdefinitions: Record<string, SchemaObject>;\n\t};\n\nfunction isSchemaWithDefinitions(\n\tschema: SchemaObject | ReferenceObject | ObjectSubtype,\n): schema is SchemaWithDefinitions {\n\treturn \"definitions\" in schema && isRecord(schema.definitions);\n}\n\nexport function getSchemaDefinition(\n\tschema: SchemaObject | ReferenceObject | ObjectSubtype,\n\tdefinition: string,\n): SchemaObject {\n\tif (isSchemaWithDefinitions(schema)) {\n\t\tconst definitionKey = definition.replace(\"#/definitions/\", \"\");\n\t\tconst definitionSchema = schema.definitions?.[definitionKey];\n\n\t\tif (!definitionSchema) {\n\t\t\tthrow new Error(`Definition not found for ${definition}`);\n\t\t}\n\n\t\treturn definitionSchema;\n\t}\n\tif (\"$defs\" in schema && isRecord(schema.$defs)) {\n\t\tconst definitionKey = definition.replace(\"#/$defs/\", \"\");\n\t\tconst definitionSchema = schema.$defs?.[definitionKey];\n\t\tif (!definitionSchema) {\n\t\t\tthrow new Error(`Definition not found for ${definition}`);\n\t\t}\n\n\t\treturn definitionSchema;\n\t}\n\n\tthrow new Error(\"Schema does not contain definitions\");\n}\n\nexport function mergeSchemaPropertyDefinition(\n\tproperty: SchemaObject | ReferenceObject,\n\tschema: SchemaObject & ObjectSubtype,\n): SchemaObject {\n\tif (isReferenceObject(property) && typeof property.$ref === \"string\") {\n\t\tconst { $ref, ...rest } = property;\n\n\t\treturn merge({}, getSchemaDefinition(schema, $ref), rest);\n\t}\n\n\treturn property as SchemaObject;\n}\n","import merge from \"lodash.merge\";\nimport type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\nimport { useMemo } from \"react\";\nimport { SchemaFormInput } from \"./schema-form-input\";\nimport type { SchemaFormErrors } from \"./types/errors\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { isReferenceObject } from \"./utilities/guards\";\nimport { getSchemaDefinition } from \"./utilities/mergeSchemaPropertyDefinition\";\n\nexport type SchemaFormInputAllOfProps = {\n\tproperty: SchemaObject & { allOf: (SchemaObject | ReferenceObject)[] };\n\tvalue: unknown;\n\tonValueChange: (value: unknown) => void;\n\terrors: SchemaFormErrors;\n\tid: string;\n};\n\nexport function SchemaFormInputAllOf({\n\tproperty,\n\tvalue,\n\tonValueChange,\n\terrors,\n\tid,\n}: SchemaFormInputAllOfProps) {\n\tconst { schema } = useSchemaFormContext();\n\n\tconst merged = useMemo(() => {\n\t\tconst { allOf, ...baseProperty } = property;\n\n\t\tconst definitions = allOf.reduce((property, definition) => {\n\t\t\tif (isReferenceObject(definition)) {\n\t\t\t\tconst reference = getSchemaDefinition(schema, definition.$ref);\n\n\t\t\t\treturn merge({}, property, reference);\n\t\t\t}\n\n\t\t\treturn merge({}, property, definition);\n\t\t}, {});\n\n\t\treturn merge({}, definitions, baseProperty);\n\t}, [property, schema]);\n\n\treturn (\n\t\t<SchemaFormInput\n\t\t\tvalue={value}\n\t\t\tonValueChange={onValueChange}\n\t\t\terrors={errors}\n\t\t\tproperty={merged}\n\t\t\tid={id}\n\t\t/>\n\t);\n}\n","import type { SchemaObject } from \"openapi-typescript\";\nimport {\n\tisArray,\n\tisDefined,\n\tisEmptyObject,\n\tisRecord,\n\tisReferenceObject,\n} from \"./guards\";\nimport { getSchemaDefinition } from \"./mergeSchemaPropertyDefinition\";\n\ntype InitialIndexContext = {\n\tproperty: SchemaObject;\n\tvalue: unknown;\n\tschema: SchemaObject;\n};\n\n/**\n * Get the index of the definition that matches the value\n * @param value - The value to match\n * @param property - The property to match\n * @param schema - The schema to match\n * @returns The index of the definition that matches the value\n */\nexport function getIndexForAnyOfPropertyValue({\n\tvalue,\n\tproperty,\n\tschema,\n}: InitialIndexContext): number {\n\tconst valueOrDefaultValue = isDefined(value) ? value : property.default;\n\n\t// if there's no value default to showing the first definition\n\tif (!isDefined(valueOrDefaultValue)) {\n\t\treturn 0;\n\t}\n\n\tconst definitions = getSchemaPropertyAnyOfDefinitions(property, schema);\n\n\tswitch (typeof valueOrDefaultValue) {\n\t\tcase \"string\":\n\t\t\treturn definitions.findIndex(\n\t\t\t\t(definition) => definition.type === \"string\",\n\t\t\t);\n\t\tcase \"number\":\n\t\t\treturn definitions.findIndex(\n\t\t\t\t(definition) =>\n\t\t\t\t\tdefinition.type === \"number\" || definition.type === \"integer\",\n\t\t\t);\n\t\tcase \"boolean\":\n\t\t\treturn definitions.findIndex(\n\t\t\t\t(definition) => definition.type === \"boolean\",\n\t\t\t);\n\t\tcase \"object\":\n\t\t\treturn getObjectDefinitionIndex(valueOrDefaultValue, definitions);\n\t\tdefault:\n\t\t\treturn -1;\n\t}\n}\n\n/**\n * Get the definitions for the anyOf property\n * @param property - The property to get the definitions for\n * @param schema - The schema to get the definitions for\n * @returns The definitions for the anyOf property\n */\nfunction getSchemaPropertyAnyOfDefinitions(\n\tproperty: SchemaObject,\n\tschema: SchemaObject,\n): SchemaObject[] {\n\tif (!property.anyOf) {\n\t\treturn [];\n\t}\n\n\treturn property.anyOf.map((definition) => {\n\t\tif (isReferenceObject(definition)) {\n\t\t\treturn getSchemaDefinition(schema, definition.$ref);\n\t\t}\n\n\t\treturn definition;\n\t});\n}\n\n/**\n * Get the index of the definition that matches a value that is an array, record, or null\n * @param value - The value to match\n * @param definitions - The definitions to match\n * @returns The index of the definition that matches the value\n */\nfunction getObjectDefinitionIndex(\n\tvalue: object | null,\n\tdefinitions: SchemaObject[],\n): number {\n\tif (isRecord(value)) {\n\t\treturn getRecordDefinitionIndex(value, definitions);\n\t}\n\n\tif (isArray(value)) {\n\t\treturn definitions.findIndex((definition) => definition.type === \"array\");\n\t}\n\n\tif (value === null) {\n\t\treturn definitions.findIndex((definition) => definition.type === \"null\");\n\t}\n\n\treturn -1;\n}\n\n/**\n * Get the index of the definition that matches a value that is an record\n * @param value - The value to match\n * @param definitions - The definitions to match\n * @returns The index of the definition that matches the value\n */\nfunction getRecordDefinitionIndex(\n\tvalue: Record<string, unknown>,\n\tdefinitions: SchemaObject[],\n): number {\n\tif (isEmptyObject(value)) {\n\t\treturn definitions.findIndex((definition) => definition.type === \"object\");\n\t}\n\n\tconst valueKeys = Object.keys(value);\n\n\tconst [index, keysInCommon] = definitions.reduce<[number, number]>(\n\t\t([resultIndex, resultKeysInCommon], definition, definitionIndex) => {\n\t\t\tif (!(\"properties\" in definition) || !definition.properties) {\n\t\t\t\treturn [resultIndex, resultKeysInCommon];\n\t\t\t}\n\n\t\t\tconst definitionKeys = Object.keys(definition.properties);\n\t\t\tconst definitionKeysInCommon = valueKeys.filter((value) =>\n\t\t\t\tdefinitionKeys.includes(value),\n\t\t\t).length;\n\n\t\t\tif (definitionKeysInCommon > resultKeysInCommon) {\n\t\t\t\treturn [definitionIndex, definitionKeysInCommon];\n\t\t\t}\n\n\t\t\treturn [resultIndex, resultKeysInCommon];\n\t\t},\n\t\t[0, 0],\n\t);\n\n\tif (keysInCommon === 0) {\n\t\treturn -1;\n\t}\n\n\treturn index;\n}\n","import type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\nimport { isReferenceObject } from \"./guards\";\nimport { getSchemaDefinition } from \"./mergeSchemaPropertyDefinition\";\n\nconst schemaObjectTypeLabels: Record<string, string | undefined> = {\n\tnull: \"None\",\n\tstring: \"str\",\n\tboolean: \"bool\",\n\tinteger: \"int\",\n\tnumber: \"float\",\n\tarray: \"list\",\n\tobject: \"dict\",\n};\n\nfunction getSchemaObjectTypeLabel(property: SchemaObject): string | undefined {\n\tif (property.type && typeof property.type === \"string\") {\n\t\treturn schemaObjectTypeLabels[property.type];\n\t}\n\n\treturn undefined;\n}\n\nexport function getSchemaObjectLabel(\n\tproperty: SchemaObject | ReferenceObject,\n\tschema: SchemaObject,\n): string {\n\tif (isReferenceObject(property)) {\n\t\tconst definition = getSchemaDefinition(schema, property.$ref);\n\n\t\treturn getSchemaObjectLabel(definition, schema);\n\t}\n\n\tconst fallback = getSchemaObjectTypeLabel(property) ?? \"Field\";\n\n\treturn property.title ?? property.format ?? fallback;\n}\n","import type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\nimport { useRef, useState } from \"react\";\nimport { Card } from \"../ui/card\";\nimport { ToggleGroup, ToggleGroupItem } from \"../ui/toggle-group\";\nimport { SchemaFormProperty } from \"./schema-form-property\";\nimport type { SchemaFormErrors } from \"./types/errors\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { getIndexForAnyOfPropertyValue } from \"./utilities/getIndexForAnyOfPropertyValue\";\nimport { getSchemaObjectLabel } from \"./utilities/getSchemaObjectLabel\";\nexport type SchemaFormInputAnyOfProps = {\n\tvalue: unknown;\n\tproperty: SchemaObject & { anyOf: (SchemaObject | ReferenceObject)[] };\n\tonValueChange: (value: unknown) => void;\n\terrors: SchemaFormErrors;\n};\n\nexport function SchemaFormInputAnyOf({\n\tvalue,\n\tproperty,\n\tonValueChange,\n\terrors,\n}: SchemaFormInputAnyOfProps) {\n\tconst { schema } = useSchemaFormContext();\n\tconst [selectedIndex, setSelectedIndex] = useState(\n\t\tgetIndexForAnyOfPropertyValue({ value, property, schema }),\n\t);\n\tconst values = useRef(new Map<number, unknown>());\n\n\tfunction onSelectedIndexChange(newSelectedIndexValue: string) {\n\t\tconst newSelectedIndex = Number.parseInt(newSelectedIndexValue, 10);\n\n\t\tif (Number.isNaN(newSelectedIndex)) {\n\t\t\tthrow new Error(`Invalid index: ${newSelectedIndexValue}`);\n\t\t}\n\n\t\tvalues.current.set(selectedIndex, value);\n\n\t\tsetSelectedIndex(newSelectedIndex);\n\n\t\tonValueChange(values.current.get(newSelectedIndex));\n\t}\n\n\treturn (\n\t\t<div className=\"grid grid-cols-1 gap-2\">\n\t\t\t<ToggleGroup\n\t\t\t\tsize=\"sm\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\ttype=\"single\"\n\t\t\t\tvalue={selectedIndex.toString()}\n\t\t\t\tonValueChange={onSelectedIndexChange}\n\t\t\t\tclassName=\"justify-start\"\n\t\t\t>\n\t\t\t\t{property.anyOf.map((option, index) => {\n\t\t\t\t\tconst label = getSchemaObjectLabel(option, schema);\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<ToggleGroupItem key={label} value={index.toString()}>\n\t\t\t\t\t\t\t{label}\n\t\t\t\t\t\t</ToggleGroupItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</ToggleGroup>\n\n\t\t\t<Card className=\"p-2\">\n\t\t\t\t<SchemaFormProperty\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tproperty={property.anyOf[selectedIndex]}\n\t\t\t\t\tonValueChange={onValueChange}\n\t\t\t\t\terrors={errors}\n\t\t\t\t\tshowLabel={false}\n\t\t\t\t\tnested={false}\n\t\t\t\t\t// This form property is nested within the anyOf property, so hard coding required to false because the anyOf property itself is what can be required\n\t\t\t\t\trequired={false}\n\t\t\t\t/>\n\t\t\t</Card>\n\t\t</div>\n\t);\n}\n","import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction _v4(options, buf, offset) {\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n return _v4(options, buf, offset);\n}\nexport default v4;\n","import type { components } from \"@/api/prefect\";\nimport { isRecord } from \"../utilities/guards\";\n\nexport type SchemaValueError = string;\nexport type SchemaValuePropertyError =\n\tcomponents[\"schemas\"][\"SchemaValuePropertyError\"];\nexport type SchemaValueIndexError =\n\tcomponents[\"schemas\"][\"SchemaValueIndexError\"];\nexport type SchemaFormError =\n\t| SchemaValueError\n\t| SchemaValuePropertyError\n\t| SchemaValueIndexError;\nexport type SchemaFormErrors = SchemaFormError[];\n\nexport function isSchemaValueError(error: unknown): error is SchemaValueError {\n\treturn typeof error === \"string\";\n}\n\nexport function isSchemaValuePropertyError(\n\terror: unknown,\n): error is SchemaValuePropertyError {\n\treturn isRecord(error) && \"property\" in error;\n}\n\nexport function isSchemaValueIndexError(\n\terror: unknown,\n): error is SchemaValueIndexError {\n\treturn isRecord(error) && \"index\" in error;\n}\n","import { useMemo } from \"react\";\nimport { isSchemaValueError, type SchemaFormErrors } from \"./types/errors\";\n\nexport type SchemaFormPropertyErrorsProps = {\n\terrors: SchemaFormErrors;\n};\n\nexport function SchemaFormPropertyErrors({\n\terrors,\n}: SchemaFormPropertyErrorsProps) {\n\tconst propertyErrors = useMemo(() => {\n\t\treturn errors.filter((error) => isSchemaValueError(error));\n\t}, [errors]);\n\n\tif (propertyErrors.length === 0) {\n\t\treturn null;\n\t}\n\n\tif (propertyErrors.length === 1) {\n\t\treturn <p className=\"text-red-500 text-sm\">{propertyErrors[0]}</p>;\n\t}\n\n\treturn (\n\t\t<ul className=\"list-disc text-red-500 text-sm pl-4\">\n\t\t\t{propertyErrors.map((error) => (\n\t\t\t\t<li key={error}>{error}</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n}\n","import { isDefined, isRecord, isString } from \"../utilities/guards\";\nimport { isPrefectKind, type PrefectKind } from \"./prefect-kind\";\n\ntype BasePrefectKindValue<\n\tTKind extends PrefectKind = PrefectKind,\n\tTRest extends Record<string, unknown> = Record<string, unknown>,\n> = {\n\t__prefect_kind: TKind;\n} & TRest;\n\nexport type PrefectKindValue =\n\t| PrefectKindValueJinja\n\t| PrefectKindValueJson\n\t| PrefectKindValueWorkspaceVariable;\n\nexport function getPrefectKindFromValue(value: unknown): PrefectKind | null {\n\tif (isPrefectKindValue(value)) {\n\t\treturn value.__prefect_kind;\n\t}\n\n\treturn null;\n}\n\nexport function isPrefectKindValue<T extends PrefectKind = PrefectKind>(\n\tvalue: unknown,\n\tkind?: T,\n): value is PrefectKindValue & { __prefect_kind: T } {\n\tconst isKindObject = isRecord(value) && isPrefectKind(value.__prefect_kind);\n\n\tif (!isKindObject) {\n\t\treturn false;\n\t}\n\n\tif (isPrefectKind(kind)) {\n\t\treturn value.__prefect_kind === kind;\n\t}\n\n\treturn true;\n}\n\nexport type PrefectKindValueJson = BasePrefectKindValue<\n\t\"json\",\n\t{\n\t\tvalue?: string;\n\t}\n>;\n\nexport function isPrefectKindValueJson(\n\tvalue: unknown,\n): value is PrefectKindValueJson {\n\treturn (\n\t\tisPrefectKindValue(value, \"json\") &&\n\t\t(isString(value.value) || !isDefined(value.value))\n\t);\n}\n\nexport type PrefectKindValueJinja = BasePrefectKindValue<\n\t\"jinja\",\n\t{\n\t\ttemplate?: string;\n\t}\n>;\n\nexport function isPrefectKindValueJinja(\n\tvalue: unknown,\n): value is PrefectKindValueJinja {\n\treturn isPrefectKindValue(value, \"jinja\") && isString(value.template);\n}\n\nexport type PrefectKindValueWorkspaceVariable = BasePrefectKindValue<\n\t\"workspace_variable\",\n\t{\n\t\tvariable_name?: string;\n\t}\n>;\n\nexport function isPrefectKindValueWorkspaceVariable(\n\tvalue: unknown,\n): value is PrefectKindValueWorkspaceVariable {\n\treturn (\n\t\tisPrefectKindValue(value, \"workspace_variable\") &&\n\t\t(isString(value.variable_name) || !isDefined(value.variable_name))\n\t);\n}\n","import type {\n\tArraySubtype,\n\tObjectSubtype,\n\tReferenceObject,\n\tSchemaObject,\n} from \"openapi-typescript\";\nimport type { PrefectKind } from \"../types/prefect-kind\";\nimport type {\n\tPrefectKindValueJinja,\n\tPrefectKindValueJson,\n\tPrefectKindValueWorkspaceVariable,\n} from \"../types/prefect-kind-value\";\nimport { getPrefectKindFromValue } from \"../types/prefect-kind-value\";\nimport { isAnyOfObject, isArray, isRecord } from \"./guards\";\nimport { mergeSchemaPropertyDefinition } from \"./mergeSchemaPropertyDefinition\";\n\ntype ConvertValueToPrefectKindInput = {\n\tvalue: unknown;\n\tproperty: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tschema: SchemaObject & ObjectSubtype;\n\tto: PrefectKind;\n};\n\nexport function convertValueToPrefectKind({\n\tvalue,\n\tproperty,\n\tschema,\n\tto,\n}: ConvertValueToPrefectKindInput) {\n\tconst from = getPrefectKindFromValue(value);\n\n\ttry {\n\t\tswitch (from) {\n\t\t\tcase \"json\":\n\t\t\t\treturn convertPrefectKindValueJson({\n\t\t\t\t\tjson: value as PrefectKindValueJson,\n\t\t\t\t\tproperty,\n\t\t\t\t\tschema,\n\t\t\t\t\tto,\n\t\t\t\t});\n\n\t\t\tcase \"jinja\":\n\t\t\t\treturn convertPrefectKindValueJinja({\n\t\t\t\t\tjinja: value as PrefectKindValueJinja,\n\t\t\t\t\tproperty,\n\t\t\t\t\tschema,\n\t\t\t\t\tto,\n\t\t\t\t});\n\n\t\t\tcase \"workspace_variable\":\n\t\t\t\treturn convertPrefectKindValueWorkspaceVariable({\n\t\t\t\t\tworkspaceVariable: value as PrefectKindValueWorkspaceVariable,\n\t\t\t\t\tto,\n\t\t\t\t});\n\n\t\t\tcase null:\n\t\t\t\treturn convertPrefectKindValueNull({ value, property, schema, to });\n\n\t\t\tdefault:\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\t\tthrow new Error(`Unknown prefect kind value: ${from satisfies never}`);\n\t\t}\n\t} catch (error) {\n\t\tconsole.error(error);\n\n\t\treturn undefined;\n\t}\n}\n\ntype ConvertPrefectKindValueJsonInput = {\n\tjson: PrefectKindValueJson;\n\tproperty: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tschema: SchemaObject & ObjectSubtype;\n\tto: PrefectKind;\n};\n\nfunction convertPrefectKindValueJson({\n\tjson,\n\tproperty,\n\tschema,\n\tto,\n}: ConvertPrefectKindValueJsonInput): unknown {\n\tswitch (to) {\n\t\tcase \"jinja\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"jinja\",\n\t\t\t\ttemplate: json.value,\n\t\t\t} satisfies PrefectKindValueJinja;\n\n\t\tcase \"json\":\n\t\t\treturn json;\n\n\t\tcase \"workspace_variable\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"workspace_variable\",\n\t\t\t\tvariable_name: undefined,\n\t\t\t} satisfies PrefectKindValueWorkspaceVariable;\n\n\t\tcase null:\n\t\t\tif (json.value === undefined) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst parsed: unknown = JSON.parse(json.value);\n\n\t\t\t\treturn coerceValueToProperties({ value: parsed, property, schema });\n\t\t\t} catch {\n\t\t\t\tthrow new InvalidSchemaValueTransformation(\"json\", null);\n\t\t\t}\n\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\t\t`mapSchemaValueJson missing case for kind: ${to satisfies never}`,\n\t\t\t);\n\t}\n}\n\ntype ConvertPrefectKindValueJinjaInput = {\n\tjinja: PrefectKindValueJinja;\n\tproperty: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tschema: SchemaObject & ObjectSubtype;\n\tto: PrefectKind;\n};\n\nfunction convertPrefectKindValueJinja({\n\tjinja,\n\tproperty,\n\tschema,\n\tto,\n}: ConvertPrefectKindValueJinjaInput): unknown {\n\tswitch (to) {\n\t\tcase \"jinja\":\n\t\t\treturn jinja;\n\n\t\tcase \"json\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"json\",\n\t\t\t\tvalue: jinja.template,\n\t\t\t} satisfies PrefectKindValueJson;\n\n\t\tcase \"workspace_variable\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"workspace_variable\",\n\t\t\t\tvariable_name: undefined,\n\t\t\t} satisfies PrefectKindValueWorkspaceVariable;\n\n\t\tcase null:\n\t\t\tif (jinja.template === undefined) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst parsed: unknown = JSON.parse(jinja.template);\n\n\t\t\t\treturn coerceValueToProperties({ value: parsed, property, schema });\n\t\t\t} catch {\n\t\t\t\tthrow new InvalidSchemaValueTransformation(\"jinja\", null);\n\t\t\t}\n\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\t\t`mapSchemaValueJson missing case for kind: ${to satisfies never}`,\n\t\t\t);\n\t}\n}\n\ntype ConvertPrefectKindValueWorkspaceVariableInput = {\n\tworkspaceVariable: PrefectKindValueWorkspaceVariable;\n\tto: PrefectKind;\n};\n\nfunction convertPrefectKindValueWorkspaceVariable({\n\tworkspaceVariable,\n\tto,\n}: ConvertPrefectKindValueWorkspaceVariableInput): unknown {\n\tswitch (to) {\n\t\tcase \"workspace_variable\":\n\t\t\treturn workspaceVariable;\n\n\t\tcase \"jinja\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"jinja\",\n\t\t\t\ttemplate: undefined,\n\t\t\t} satisfies PrefectKindValueJinja;\n\n\t\tcase \"json\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"json\",\n\t\t\t\tvalue: undefined,\n\t\t\t} satisfies PrefectKindValueJson;\n\n\t\tcase null:\n\t\t\treturn undefined;\n\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\t\t`mapSchemaValueWorkspaceVariable missing case for kind: ${to satisfies never}`,\n\t\t\t);\n\t}\n}\n\ntype ConvertPrefectKindValueNullInput = {\n\tvalue: unknown;\n\tproperty: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tschema: SchemaObject & ObjectSubtype;\n\tto: PrefectKind;\n};\n\nfunction convertPrefectKindValueNull({\n\tvalue,\n\tproperty,\n\tschema,\n\tto,\n}: ConvertPrefectKindValueNullInput): unknown {\n\tswitch (to) {\n\t\tcase \"jinja\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"jinja\",\n\t\t\t\ttemplate:\n\t\t\t\t\tvalue === undefined ? undefined : JSON.stringify(value, null, 2),\n\t\t\t} satisfies PrefectKindValueJinja;\n\n\t\tcase \"json\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"json\",\n\t\t\t\tvalue: value === undefined ? undefined : JSON.stringify(value, null, 2),\n\t\t\t} satisfies PrefectKindValueJson;\n\n\t\tcase \"workspace_variable\":\n\t\t\treturn {\n\t\t\t\t__prefect_kind: \"workspace_variable\",\n\t\t\t\tvariable_name: undefined,\n\t\t\t} satisfies PrefectKindValueWorkspaceVariable;\n\n\t\tcase null:\n\t\t\treturn coerceValueToProperties({ value, property, schema });\n\n\t\tdefault:\n\t\t\tthrow new Error(\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\t\t`mapSchemaValueNull missing case for kind: ${to satisfies never}`,\n\t\t\t);\n\t}\n}\n\ntype CoerceValueToPropertiesInput = {\n\tvalue: unknown;\n\tproperty: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tschema: SchemaObject & ObjectSubtype;\n};\n\nfunction coerceValueToProperties({\n\tvalue,\n\tproperty,\n\tschema,\n}: CoerceValueToPropertiesInput): unknown {\n\tif (isArray(property)) {\n\t\tconst responses = property.map((property) =>\n\t\t\tcoerceValueToProperty({ value, property, schema }),\n\t\t);\n\n\t\treturn responses.find((response) => response !== undefined);\n\t}\n\n\treturn coerceValueToProperty({ value, property, schema });\n}\n\ntype CoerceValueToPropertyInput = {\n\tvalue: unknown;\n\tproperty: SchemaObject | ReferenceObject;\n\tschema: SchemaObject & ObjectSubtype;\n};\n\nfunction coerceValueToProperty({\n\tvalue,\n\tproperty,\n\tschema,\n}: CoerceValueToPropertyInput): unknown {\n\tconst merged = mergeSchemaPropertyDefinition(property, schema);\n\n\tif (isAnyOfObject(merged)) {\n\t\treturn coerceValueToProperties({ value, property: merged.anyOf, schema });\n\t}\n\n\tswitch (merged.type) {\n\t\tcase \"null\":\n\t\t\treturn null;\n\n\t\tcase \"string\":\n\t\t\treturn typeof value === \"string\" ? value : undefined;\n\n\t\tcase \"boolean\":\n\t\t\treturn typeof value === \"boolean\" ? value : undefined;\n\n\t\tcase \"number\":\n\t\t\treturn typeof value === \"number\" ? value : undefined;\n\n\t\tcase \"integer\":\n\t\t\treturn typeof value === \"number\" ? Math.round(value) : undefined;\n\n\t\tcase \"array\":\n\t\t\treturn coerceValueToArrayProperty({ value, property: merged, schema });\n\n\t\tcase \"object\":\n\t\t\treturn coerceValueToObjectProperty({ value, property: merged, schema });\n\n\t\tdefault:\n\t\t\tif (isArray(merged.type)) {\n\t\t\t\tconsole.error(\n\t\t\t\t\tnew Error(\n\t\t\t\t\t\t\"Array types are not supported for schema coercing values to schema properties\",\n\t\t\t\t\t),\n\t\t\t\t);\n\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\t\t`Unsupported property type: ${merged.type satisfies never}`,\n\t\t\t);\n\t}\n}\n\ntype CoerceValueToArrayPropertyInput = {\n\tvalue: unknown;\n\tproperty: SchemaObject & ArraySubtype;\n\tschema: SchemaObject & ObjectSubtype;\n};\n\nfunction coerceValueToArrayProperty({\n\tvalue,\n\tproperty,\n\tschema,\n}: CoerceValueToArrayPropertyInput): unknown[] | undefined {\n\tif (!isArray(value)) {\n\t\treturn undefined;\n\t}\n\n\tconst response = [...value];\n\n\treturn response.map((item) =>\n\t\tcoerceValueToProperty({ value: item, property, schema }),\n\t);\n}\n\ntype CoerceValueToObjectPropertyInput = {\n\tvalue: unknown;\n\tproperty: SchemaObject & ObjectSubtype;\n\tschema: SchemaObject & ObjectSubtype;\n};\n\nfunction coerceValueToObjectProperty({\n\tvalue,\n\tproperty,\n\tschema,\n}: CoerceValueToObjectPropertyInput): Record<string, unknown> | undefined {\n\tif (!isRecord(value)) {\n\t\treturn undefined;\n\t}\n\n\tif (property.properties === undefined) {\n\t\treturn value;\n\t}\n\n\tconst response = { ...value };\n\n\tfor (const [key, propertyValue] of Object.entries(property.properties)) {\n\t\tconst coercedValue = coerceValueToProperty({\n\t\t\tvalue: value[key],\n\t\t\tproperty: propertyValue,\n\t\t\tschema,\n\t\t});\n\n\t\tif (coercedValue === undefined) {\n\t\t\tdelete response[key];\n\t\t}\n\t}\n\n\treturn response;\n}\n\nclass InvalidSchemaValueTransformation extends Error {\n\tpublic constructor(from: PrefectKind, to: PrefectKind | null) {\n\t\tsuper(\n\t\t\t`Unable to convert prefect kind value from \"${from}\" to \"${to ?? \"null\"}\"`,\n\t\t);\n\t}\n}\n","import type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\nimport { type ReactNode, useMemo, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuSeparator,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icons\";\nimport {\n\tgetPrefectKindLabel,\n\ttype PrefectKind,\n\tprefectKinds,\n} from \"./types/prefect-kind\";\nimport { getPrefectKindFromValue } from \"./types/prefect-kind-value\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { convertValueToPrefectKind } from \"./utilities/convertValueToPrefectKind\";\n\nexport type SchemaFormPropertyMenuProps = {\n\tvalue: unknown;\n\tonValueChange: (value: unknown) => void;\n\tproperty: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tdisableKinds?: boolean;\n\tchildren?: ReactNode;\n\tdefaultValue?: unknown;\n\thasDefaultValue?: boolean;\n};\n\nexport const SchemaFormPropertyMenu = ({\n\tvalue,\n\tonValueChange,\n\tproperty,\n\tchildren,\n\tdisableKinds,\n\tdefaultValue,\n\thasDefaultValue,\n}: SchemaFormPropertyMenuProps) => {\n\tconst { schema, kinds } = useSchemaFormContext();\n\tconst [open, setOpen] = useState(false);\n\n\tconst isDefaultValueDisabled =\n\t\t!hasDefaultValue || JSON.stringify(value) === JSON.stringify(defaultValue);\n\n\tfunction handleUseDefaultValue() {\n\t\tif (hasDefaultValue) {\n\t\t\tonValueChange(defaultValue);\n\t\t}\n\t}\n\n\tfunction convertValueKind(kind: PrefectKind) {\n\t\tconst newValue = convertValueToPrefectKind({\n\t\t\tvalue,\n\t\t\tproperty,\n\t\t\tschema,\n\t\t\tto: kind,\n\t\t});\n\n\t\tonValueChange(newValue);\n\t}\n\n\tconst kindOptions = useMemo(() => {\n\t\tconst current = getPrefectKindFromValue(value);\n\n\t\treturn prefectKinds.filter(\n\t\t\t(kind) =>\n\t\t\t\tkind !== current &&\n\t\t\t\t(kinds.includes(kind) || kind === null) &&\n\t\t\t\t!disableKinds,\n\t\t);\n\t}, [value, kinds, disableKinds]);\n\n\treturn (\n\t\t<DropdownMenu open={open} onOpenChange={setOpen}>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button variant=\"ghost\" data-open={open} className=\"h-8 w-8 p-0\">\n\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t{kindOptions.map((kind) => (\n\t\t\t\t\t<DropdownMenuItem key={kind} onClick={() => convertValueKind(kind)}>\n\t\t\t\t\t\t{getPrefectKindLabel(kind)}\n\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t))}\n\n\t\t\t\t{hasDefaultValue && (\n\t\t\t\t\t<DropdownMenuItem\n\t\t\t\t\t\tonClick={handleUseDefaultValue}\n\t\t\t\t\t\tdisabled={isDefaultValueDisabled}\n\t\t\t\t\t>\n\t\t\t\t\t\tUse default value\n\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t)}\n\n\t\t\t\t<DropdownMenuSeparator />\n\n\t\t\t\t{children}\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import { useSortable } from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { GripVertical } from \"lucide-react\";\nimport type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\nimport { useId, useMemo } from \"react\";\nimport { DropdownMenuItem } from \"../ui/dropdown-menu\";\nimport { SchemaFormInput } from \"./schema-form-input\";\nimport { SchemaFormPropertyErrors } from \"./schema-form-property-errors\";\nimport { SchemaFormPropertyMenu } from \"./schema-form-property-menu\";\nimport type { SchemaFormErrors } from \"./types/errors\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { isArray, isReferenceObject } from \"./utilities/guards\";\nimport { getSchemaDefinition } from \"./utilities/mergeSchemaPropertyDefinition\";\n\nexport type SchemaFormInputArrayItemProps = {\n\titemKey: string;\n\titems: SchemaObject | ReferenceObject | (SchemaObject | ReferenceObject)[];\n\tvalue: unknown;\n\tonValueChange: (value: unknown) => void;\n\terrors: SchemaFormErrors;\n\tonDelete: () => void;\n\tfirst: boolean;\n\tlast: boolean;\n\tcanMove: boolean;\n\tmoveUp: () => void;\n\tmoveDown: () => void;\n\tmoveToTop: () => void;\n\tmoveToBottom: () => void;\n};\n\nexport function SchemaFormInputArrayItem({\n\titemKey,\n\titems,\n\tvalue,\n\tonValueChange,\n\terrors,\n\tonDelete,\n\tfirst,\n\tlast,\n\tcanMove,\n\tmoveUp,\n\tmoveDown,\n\tmoveToTop,\n\tmoveToBottom,\n}: SchemaFormInputArrayItemProps) {\n\tconst { schema } = useSchemaFormContext();\n\tconst id = useId();\n\n\tconst {\n\t\tattributes,\n\t\tlisteners,\n\t\tsetNodeRef,\n\t\ttransform,\n\t\ttransition,\n\t\tisDragging,\n\t} = useSortable({ id: itemKey, disabled: !canMove });\n\n\tconst style = {\n\t\ttransform: CSS.Transform.toString(transform),\n\t\ttransition,\n\t\topacity: isDragging ? 0.5 : 1,\n\t};\n\n\tconst property = useMemo(() => {\n\t\tif (isArray(items)) {\n\t\t\t// @ts-expect-error The SchemaObject type requires a type property but in an anyOf property the type comes from the anyOf property\n\t\t\tconst property: SchemaObject = {\n\t\t\t\tanyOf: items,\n\t\t\t};\n\n\t\t\treturn property;\n\t\t}\n\n\t\tif (isReferenceObject(items)) {\n\t\t\treturn getSchemaDefinition(schema, items.$ref);\n\t\t}\n\n\t\treturn items;\n\t}, [items, schema]);\n\n\treturn (\n\t\t<div\n\t\t\tref={setNodeRef}\n\t\t\tstyle={style}\n\t\t\tclassName=\"grid grid-cols-[auto_1fr_auto] gap-2\"\n\t\t>\n\t\t\t{canMove ? (\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"flex items-center justify-center cursor-grab text-muted-foreground hover:text-foreground focus:outline-none\"\n\t\t\t\t\taria-label=\"Drag to reorder\"\n\t\t\t\t\t{...attributes}\n\t\t\t\t\t{...listeners}\n\t\t\t\t>\n\t\t\t\t\t<GripVertical className=\"h-5 w-5\" />\n\t\t\t\t</button>\n\t\t\t) : (\n\t\t\t\t<div className=\"w-5\" />\n\t\t\t)}\n\t\t\t<div className=\"grid grid-cols-1 gap-2\">\n\t\t\t\t<SchemaFormInput\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tonValueChange={onValueChange}\n\t\t\t\t\tproperty={property}\n\t\t\t\t\terrors={errors}\n\t\t\t\t\tid={id}\n\t\t\t\t/>\n\t\t\t\t<SchemaFormPropertyErrors errors={errors} />\n\t\t\t</div>\n\t\t\t<SchemaFormPropertyMenu\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tproperty={items}\n\t\t\t>\n\t\t\t\t<DropdownMenuItem onClick={onDelete}>Delete</DropdownMenuItem>\n\t\t\t\t{canMove && !first && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<DropdownMenuItem onClick={moveToTop}>Move to top</DropdownMenuItem>\n\t\t\t\t\t\t<DropdownMenuItem onClick={moveUp}>Move up</DropdownMenuItem>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t\t{canMove && !last && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<DropdownMenuItem onClick={moveDown}>Move down</DropdownMenuItem>\n\t\t\t\t\t\t<DropdownMenuItem onClick={moveToBottom}>\n\t\t\t\t\t\t\tMove to bottom\n\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t</>\n\t\t\t\t)}\n\t\t\t</SchemaFormPropertyMenu>\n\t\t</div>\n\t);\n}\n","import {\n\tclosestCenter,\n\tDndContext,\n\ttype DragEndEvent,\n\tKeyboardSensor,\n\tPointerSensor,\n\tuseSensor,\n\tuseSensors,\n} from \"@dnd-kit/core\";\nimport {\n\tSortableContext,\n\tsortableKeyboardCoordinates,\n\tverticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport type { ArraySubtype, SchemaObject } from \"openapi-typescript\";\nimport { useState } from \"react\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { Button } from \"../ui/button\";\nimport { Card } from \"../ui/card\";\nimport { SchemaFormInputArrayItem } from \"./schema-form-input-array-item\";\nimport {\n\tisSchemaValueIndexError,\n\ttype SchemaFormErrors,\n\ttype SchemaValueIndexError,\n} from \"./types/errors\";\nimport { isArray } from \"./utilities/guards\";\nexport type SchemaFormInputArrayListProps = {\n\tproperty: SchemaObject & ArraySubtype;\n\tvalues: unknown[] | undefined;\n\tonValuesChange: (values: unknown[] | undefined) => void;\n\terrors: SchemaFormErrors;\n};\n\nexport function SchemaFormInputArrayList({\n\tproperty,\n\tvalues,\n\tonValuesChange,\n\terrors,\n}: SchemaFormInputArrayListProps) {\n\tconst isEmpty = values === undefined || values.length === 0;\n\tconst canAddMore =\n\t\tproperty.maxItems === undefined ||\n\t\t(values?.length ?? 0) < (property.maxItems ?? Number.POSITIVE_INFINITY);\n\n\tconst prefixItemsCount = isArray(property.prefixItems)\n\t\t? property.prefixItems.length\n\t\t: 0;\n\n\tconst sensors = useSensors(\n\t\tuseSensor(PointerSensor),\n\t\tuseSensor(KeyboardSensor, {\n\t\t\tcoordinateGetter: sortableKeyboardCoordinates,\n\t\t}),\n\t);\n\n\tconst [localKeyedValues, setLocalKeyedValues] = useState<\n\t\t{\n\t\t\tkey: string;\n\t\t\tvalue: unknown;\n\t\t}[]\n\t>(\n\t\tvalues?.map((value) => ({\n\t\t\tkey: uuidv4(),\n\t\t\tvalue,\n\t\t})) ?? [],\n\t);\n\n\tfunction getPropertyForIndex(index: number) {\n\t\tif (isArray(property.prefixItems) && index < property.prefixItems.length) {\n\t\t\treturn property.prefixItems[index];\n\t\t}\n\n\t\treturn property.items ?? { type: \"string\" };\n\t}\n\n\tfunction getErrorsForIndex(index: number) {\n\t\treturn errors\n\t\t\t.filter(\n\t\t\t\t(error): error is SchemaValueIndexError =>\n\t\t\t\t\tisSchemaValueIndexError(error) && error.index === index,\n\t\t\t)\n\t\t\t.flatMap((error) => error.errors);\n\t}\n\n\tfunction getFirstForIndex(index: number): boolean {\n\t\treturn index === 0;\n\t}\n\n\tfunction getLastForIndex(index: number): boolean {\n\t\treturn index === (values?.length ?? 0) - 1;\n\t}\n\n\tfunction getCanMoveForIndex(index: number): boolean {\n\t\tconst isPrefixItem =\n\t\t\tisArray(property.prefixItems) && index < property.prefixItems.length;\n\n\t\treturn !isPrefixItem;\n\t}\n\n\tfunction handleValueChange(key: string, value: unknown) {\n\t\tsetLocalKeyedValues(\n\t\t\tlocalKeyedValues.map((item) =>\n\t\t\t\titem.key === key ? { ...item, value } : item,\n\t\t\t),\n\t\t);\n\t}\n\n\tfunction addItem() {\n\t\tconst newKeyedValues = [\n\t\t\t...localKeyedValues,\n\t\t\t{ key: uuidv4(), value: undefined },\n\t\t];\n\t\tsetLocalKeyedValues(newKeyedValues);\n\t\tonValuesChange(newKeyedValues.map(({ value }) => value));\n\t}\n\n\tfunction moveItem(from: number, to: number) {\n\t\tconst newValues = [...localKeyedValues];\n\t\tnewValues.splice(to, 0, newValues.splice(from, 1)[0]);\n\t\tsetLocalKeyedValues(newValues);\n\t\tonValuesChange(newValues.map(({ value }) => value));\n\t}\n\n\tfunction moveToTop(index: number) {\n\t\tmoveItem(index, 0);\n\t}\n\n\tfunction moveToBottom(index: number) {\n\t\tmoveItem(index, localKeyedValues.length - 1);\n\t}\n\n\tfunction deleteItem(key: string) {\n\t\tconst newValues = localKeyedValues.filter((item) => item.key !== key);\n\t\tsetLocalKeyedValues(newValues);\n\t\tonValuesChange(newValues.map(({ value }) => value));\n\t}\n\n\tfunction handleDragEnd(event: DragEndEvent) {\n\t\tconst { active, over } = event;\n\n\t\tif (over && active.id !== over.id) {\n\t\t\tconst oldIndex = localKeyedValues.findIndex(\n\t\t\t\t(item) => item.key === active.id,\n\t\t\t);\n\t\t\tconst newIndex = localKeyedValues.findIndex(\n\t\t\t\t(item) => item.key === over.id,\n\t\t\t);\n\n\t\t\tif (oldIndex !== -1 && newIndex !== -1) {\n\t\t\t\tmoveItem(oldIndex, newIndex);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Get the keys of items that can be dragged (non-prefix items)\n\tconst sortableKeys = localKeyedValues\n\t\t.slice(prefixItemsCount)\n\t\t.map((item) => item.key);\n\n\treturn (\n\t\t<Card className=\"flex flex-col gap-2 p-2\">\n\t\t\t{isEmpty && (\n\t\t\t\t<p className=\"text-sm text-subdued italic\">No items in this list</p>\n\t\t\t)}\n\n\t\t\t<DndContext\n\t\t\t\tsensors={sensors}\n\t\t\t\tcollisionDetection={closestCenter}\n\t\t\t\tonDragEnd={handleDragEnd}\n\t\t\t>\n\t\t\t\t<SortableContext\n\t\t\t\t\titems={sortableKeys}\n\t\t\t\t\tstrategy={verticalListSortingStrategy}\n\t\t\t\t>\n\t\t\t\t\t{localKeyedValues?.map(({ key, value }, index) => (\n\t\t\t\t\t\t<SchemaFormInputArrayItem\n\t\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\t\titemKey={key}\n\t\t\t\t\t\t\titems={getPropertyForIndex(index)}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tonValueChange={(value) => handleValueChange(key, value)}\n\t\t\t\t\t\t\terrors={getErrorsForIndex(index)}\n\t\t\t\t\t\t\tonDelete={() => deleteItem(key)}\n\t\t\t\t\t\t\tfirst={getFirstForIndex(index)}\n\t\t\t\t\t\t\tlast={getLastForIndex(index)}\n\t\t\t\t\t\t\tcanMove={getCanMoveForIndex(index)}\n\t\t\t\t\t\t\tmoveUp={() => moveItem(index, index - 1)}\n\t\t\t\t\t\t\tmoveDown={() => moveItem(index, index + 1)}\n\t\t\t\t\t\t\tmoveToTop={() => moveToTop(index)}\n\t\t\t\t\t\t\tmoveToBottom={() => moveToBottom(index)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</SortableContext>\n\t\t\t</DndContext>\n\n\t\t\t{canAddMore && (\n\t\t\t\t<div className=\"flex justify-end\">\n\t\t\t\t\t<Button size=\"sm\" variant=\"outline\" onClick={addItem}>\n\t\t\t\t\t\tAdd item\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!canAddMore && (\n\t\t\t\t<p className=\"text-sm text-subdued text-right\">\n\t\t\t\t\tYou can&apos;t add more items\n\t\t\t\t</p>\n\t\t\t)}\n\t\t</Card>\n\t);\n}\n","import type { SchemaObject } from \"openapi-typescript\";\nimport { useMemo, useState } from \"react\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"../ui/combobox\";\nimport type { PrimitiveProperty } from \"./types/primitives\";\nimport type { WithPrimitiveEnum } from \"./types/schemas\";\n\ntype SingleValueProps<T extends PrimitiveProperty> = {\n\tvalue: T | undefined;\n\tmultiple: false;\n\tonValueChange: (value: T | undefined) => void;\n};\n\ntype MultipleValueProps<T extends PrimitiveProperty> = {\n\tvalues: T[] | undefined;\n\tmultiple: true;\n\tonValuesChange: (values: T[] | undefined) => void;\n};\n\ntype SchemaFormInputArrayComboboxProps<T extends PrimitiveProperty> = {\n\tproperty: SchemaObject & WithPrimitiveEnum;\n\tid: string;\n} & (SingleValueProps<T> | MultipleValueProps<T>);\n\nexport function SchemaFormInputEnum<T extends PrimitiveProperty>({\n\tproperty,\n\tid,\n\t...props\n}: SchemaFormInputArrayComboboxProps<T>) {\n\tconst [search, setSearch] = useState(\"\");\n\n\tconst options = useMemo(() => {\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries(property.enum).filter(([, value]) =>\n\t\t\t\tString(value).toLowerCase().includes(search.toLowerCase()),\n\t\t\t),\n\t\t);\n\t}, [property.enum, search]);\n\n\tconst selected = Boolean(props.multiple ? props.values?.length : props.value);\n\tconst label = props.multiple ? props.values?.join(\", \") : String(props.value);\n\n\tfunction isSelected(key: string) {\n\t\tconst value = options[key] as T;\n\n\t\treturn props.multiple\n\t\t\t? props.values?.includes(value)\n\t\t\t: props.value === value;\n\t}\n\n\tfunction onSelect(key: string) {\n\t\tsetSearch(\"\");\n\n\t\tconst value = options[key] as T;\n\n\t\treturn props.multiple ? onSelectMultiple(value) : onSelectSingle(value);\n\t}\n\n\tfunction onSelectSingle(value: T) {\n\t\tif (props.multiple) {\n\t\t\tthrow new Error(\"onSingleSelect called on multiple value input\");\n\t\t}\n\n\t\tprops.onValueChange(value);\n\t}\n\n\tfunction onSelectMultiple(value: T) {\n\t\tif (!props.multiple) {\n\t\t\tthrow new Error(\"onMultipleSelect called on single value input\");\n\t\t}\n\n\t\tif (!props.values) {\n\t\t\tprops.onValuesChange([value]);\n\t\t\treturn;\n\t\t}\n\n\t\tif (props.values?.includes(value)) {\n\t\t\tprops.onValuesChange(props.values.filter((v) => v !== value));\n\t\t\treturn;\n\t\t}\n\n\t\tprops.onValuesChange([...props.values, value]);\n\t}\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\tselected={selected}\n\t\t\t\taria-label={`Select ${property.title}`}\n\t\t\t\tid={id}\n\t\t\t>\n\t\t\t\t{selected ? label : \"Select\"}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandEmtpy>No values found</ComboboxCommandEmtpy>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t{Object.entries(options).map(([index, value]) => (\n\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\tvalue={index}\n\t\t\t\t\t\t\tonSelect={onSelect}\n\t\t\t\t\t\t\tselected={isSelected(index)}\n\t\t\t\t\t\t\tcloseOnSelect={!props.multiple}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{String(value)}\n\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t))}\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n}\n","import type { ObjectSubtype, SchemaObject } from \"openapi-typescript\";\nimport {\n\tisPrimitivePropertyType,\n\ttype PrimitivePropertyType,\n} from \"./primitives\";\n\nexport type WithPosition = {\n\tposition?: number;\n};\n\nexport type PrefectObjectSubtype = {\n\tproperties?: {\n\t\t[name: string]: WithPosition;\n\t};\n};\n\nexport type WithBlockDocumentSlug = {\n\tblock_type_slug?: string;\n};\n\nexport type WithDefinitions = {\n\tdefinitions?: {\n\t\t[name: string]: SchemaObject;\n\t};\n};\n\nexport type PrefectSchemaObject = SchemaObject &\n\tObjectSubtype &\n\tWithBlockDocumentSlug &\n\tWithDefinitions;\n\nexport type WithPrimitiveEnum = {\n\tenum: PrimitivePropertyType[];\n};\n\nexport function isWithPrimitiveEnum<T extends SchemaObject>(\n\tproperty: T,\n): property is T & WithPrimitiveEnum {\n\treturn (\n\t\t\"enum\" in property &&\n\t\tArray.isArray(property.enum) &&\n\t\tproperty.enum.every((value) => isPrimitivePropertyType(typeof value))\n\t);\n}\n","import type { PrimitiveProperty } from \"../types/primitives\";\nimport { isRecord } from \"./guards\";\n\ntype PrimitiveConstructor =\n\t| BooleanConstructor\n\t| NumberConstructor\n\t| StringConstructor;\n\nexport function asType<T extends PrimitiveConstructor>(\n\tvalue: unknown,\n\ttype: T,\n): ReturnType<T> | undefined {\n\tif (typeof value === typeof type()) {\n\t\treturn value as ReturnType<T>;\n\t}\n\n\treturn undefined;\n}\n\nexport function asObject(value: unknown): Record<string, unknown> | undefined {\n\tif (isRecord(value)) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n}\n\nexport function asPrimitive(value: unknown): PrimitiveProperty | undefined {\n\treturn (\n\t\tasType(value, String) ?? asType(value, Number) ?? asType(value, Boolean)\n\t);\n}\n\nexport function asArray(value: unknown): unknown[] | undefined;\nexport function asArray(\n\tvalue: unknown,\n\ttype: BooleanConstructor,\n): boolean[] | undefined;\nexport function asArray(\n\tvalue: unknown,\n\ttype: NumberConstructor,\n): number[] | undefined;\nexport function asArray(\n\tvalue: unknown,\n\ttype: StringConstructor,\n): string[] | undefined;\nexport function asArray(\n\tvalue: unknown,\n\ttype: \"primitive\",\n): PrimitiveProperty[] | undefined;\nexport function asArray(\n\tvalue: unknown,\n\ttype?: \"primitive\" | PrimitiveConstructor,\n): unknown[] | undefined {\n\tif (type === undefined && Array.isArray(value)) {\n\t\treturn value as unknown[];\n\t}\n\n\tif (!Array.isArray(value)) {\n\t\treturn undefined;\n\t}\n\n\tswitch (type) {\n\t\tcase String:\n\t\t\treturn value\n\t\t\t\t.map((value) => asType(value, String))\n\t\t\t\t.filter((value) => value !== undefined);\n\t\tcase Number:\n\t\t\treturn value\n\t\t\t\t.map((value) => asType(value, Number))\n\t\t\t\t.filter((value) => value !== undefined);\n\t\tcase Boolean:\n\t\t\treturn value\n\t\t\t\t.map((value) => asType(value, Boolean))\n\t\t\t\t.filter((value) => value !== undefined);\n\t\tcase \"primitive\":\n\t\t\treturn value\n\t\t\t\t.map(\n\t\t\t\t\t(value) =>\n\t\t\t\t\t\tasType(value, String) ??\n\t\t\t\t\t\tasType(value, Number) ??\n\t\t\t\t\t\tasType(value, Boolean),\n\t\t\t\t)\n\t\t\t\t.filter((value) => value !== undefined);\n\t\tdefault:\n\t\t\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\t\t\tthrow new Error(`Invalid array type: ${type}`);\n\t}\n}\n","import type {\n\tArraySubtype,\n\tReferenceObject,\n\tSchemaObject,\n} from \"openapi-typescript\";\nimport { SchemaFormInputArrayList } from \"./schema-form-input-array-list\";\nimport { SchemaFormInputEnum } from \"./schema-form-input-enum\";\nimport type { SchemaFormErrors } from \"./types/errors\";\nimport { isWithPrimitiveEnum } from \"./types/schemas\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { asArray } from \"./utilities/asType\";\nimport { isItemsObject, isRecord, isReferenceObject } from \"./utilities/guards\";\nimport { getSchemaDefinition } from \"./utilities/mergeSchemaPropertyDefinition\";\n\ntype SchemaFormInputArrayProps = {\n\tvalues: unknown[] | undefined;\n\tonValuesChange: (values: unknown[] | undefined) => void;\n\tproperty: SchemaObject & ArraySubtype;\n\terrors: SchemaFormErrors;\n\tid: string;\n};\n\nexport function SchemaFormInputArray({\n\tvalues,\n\tproperty,\n\tonValuesChange,\n\terrors,\n\tid,\n}: SchemaFormInputArrayProps) {\n\tconst { schema } = useSchemaFormContext();\n\n\tfunction handleValuesChange(values: unknown[] | undefined) {\n\t\tif (values === undefined || values.length === 0) {\n\t\t\tonValuesChange(undefined);\n\t\t\treturn;\n\t\t}\n\n\t\tonValuesChange(values);\n\t}\n\n\tif (isItemsObject(property) && isRecord(property.items)) {\n\t\tlet items: SchemaObject | ReferenceObject = property.items;\n\n\t\tif (isReferenceObject(items)) {\n\t\t\titems = getSchemaDefinition(schema, items.$ref);\n\t\t}\n\n\t\tif (isWithPrimitiveEnum(items)) {\n\t\t\tconst merged = { ...property, ...items };\n\n\t\t\treturn (\n\t\t\t\t<SchemaFormInputEnum\n\t\t\t\t\tmultiple={true}\n\t\t\t\t\tvalues={asArray(values, \"primitive\")}\n\t\t\t\t\tproperty={merged}\n\t\t\t\t\tonValuesChange={handleValuesChange}\n\t\t\t\t\tid={id}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t}\n\n\treturn (\n\t\t<SchemaFormInputArrayList\n\t\t\tproperty={property}\n\t\t\tvalues={values}\n\t\t\tonValuesChange={handleValuesChange}\n\t\t\terrors={errors}\n\t\t/>\n\t);\n}\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Suspense, useDeferredValue, useMemo, useState } from \"react\";\nimport { buildListFilterBlockDocumentsQuery } from \"@/api/block-documents\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandGroup,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"@/components/ui/combobox\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype BlockDocumentComboboxProps = {\n\tblockTypeSlug: string;\n\tselectedBlockDocumentId: string | undefined;\n\tonSelect: (blockDocumentId: string | undefined) => void;\n\tonCreateNew?: () => void;\n};\n\nexport const BlockDocumentCombobox = ({\n\tblockTypeSlug,\n\tselectedBlockDocumentId,\n\tonSelect,\n\tonCreateNew,\n}: BlockDocumentComboboxProps) => {\n\treturn (\n\t\t<Suspense>\n\t\t\t<BlockDocumentComboboxImplementation\n\t\t\t\tblockTypeSlug={blockTypeSlug}\n\t\t\t\tselectedBlockDocumentId={selectedBlockDocumentId}\n\t\t\t\tonSelect={onSelect}\n\t\t\t\tonCreateNew={onCreateNew}\n\t\t\t/>\n\t\t</Suspense>\n\t);\n};\n\nconst BlockDocumentComboboxImplementation = ({\n\tblockTypeSlug,\n\tselectedBlockDocumentId,\n\tonSelect,\n\tonCreateNew,\n}: BlockDocumentComboboxProps) => {\n\tconst [search, setSearch] = useState(\"\");\n\tconst deferredSearch = useDeferredValue(search);\n\n\tconst { data } = useSuspenseQuery(\n\t\tbuildListFilterBlockDocumentsQuery({\n\t\t\toffset: 0,\n\t\t\tsort: \"BLOCK_TYPE_AND_NAME_ASC\",\n\t\t\tinclude_secrets: false,\n\t\t\tblock_types: {\n\t\t\t\tslug: { any_: [blockTypeSlug] },\n\t\t\t},\n\t\t\tblock_documents: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tis_anonymous: { eq_: false },\n\t\t\t\t...(deferredSearch ? { name: { like_: deferredSearch } } : {}),\n\t\t\t},\n\t\t\tlimit: 50,\n\t\t}),\n\t);\n\n\tconst filteredData = useMemo(() => {\n\t\treturn data.filter((blockDocument) =>\n\t\t\tblockDocument.name?.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [data, deferredSearch]);\n\n\tconst selectedBlockDocument = useMemo(() => {\n\t\treturn data.find(\n\t\t\t(blockDocument) => blockDocument.id === selectedBlockDocumentId,\n\t\t);\n\t}, [data, selectedBlockDocumentId]);\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\tselected={Boolean(selectedBlockDocumentId)}\n\t\t\t\taria-label=\"Select a block\"\n\t\t\t>\n\t\t\t\t{selectedBlockDocument?.name ?? \"Select a block...\"}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search for a block...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandEmtpy>No block found</ComboboxCommandEmtpy>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t{filteredData.map((blockDocument) => (\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tkey={blockDocument.id}\n\t\t\t\t\t\t\t\tselected={selectedBlockDocumentId === blockDocument.id}\n\t\t\t\t\t\t\t\tonSelect={(value) => {\n\t\t\t\t\t\t\t\t\tonSelect(value);\n\t\t\t\t\t\t\t\t\tsetSearch(\"\");\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvalue={blockDocument.id}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{blockDocument.name}\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t\t{onCreateNew && (\n\t\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tonSelect={() => {\n\t\t\t\t\t\t\t\t\tonCreateNew();\n\t\t\t\t\t\t\t\t\tsetSearch(\"\");\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvalue=\"__create_new__\"\n\t\t\t\t\t\t\t\tcloseOnSelect={true}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon id=\"Plus\" className=\"mr-2 size-4\" />\n\t\t\t\t\t\t\t\tCreate new block\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t\t)}\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n};\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Suspense, useState } from \"react\";\nimport { buildCountFilterBlockDocumentsQuery } from \"@/api/block-documents\";\nimport { buildGetBlockTypeQuery } from \"@/api/block-types\";\nimport { BlockTypeLogo } from \"@/components/block-type-logo/block-type-logo\";\nimport { BlockDocumentCombobox } from \"@/components/blocks/block-document-combobox\";\nimport { BlockDocumentCreateDialog } from \"@/components/blocks/block-document-create-dialog/block-document-create-dialog\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\n\ntype BlockDocumentReferenceValue =\n\t| {\n\t\t\t$ref: string;\n\t }\n\t| undefined;\n\ntype SchemaFormInputBlockDocumentProps = {\n\tvalue: BlockDocumentReferenceValue;\n\tonValueChange: (value: BlockDocumentReferenceValue) => void;\n\tblockTypeSlug: string;\n\tid: string;\n};\n\nexport function SchemaFormInputBlockDocument({\n\tvalue,\n\tonValueChange,\n\tblockTypeSlug,\n\tid,\n}: SchemaFormInputBlockDocumentProps) {\n\treturn (\n\t\t<Suspense fallback={<SchemaFormInputBlockDocumentSkeleton />}>\n\t\t\t<SchemaFormInputBlockDocumentContent\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tblockTypeSlug={blockTypeSlug}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t</Suspense>\n\t);\n}\n\nfunction SchemaFormInputBlockDocumentSkeleton() {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<Skeleton className=\"size-8 rounded\" />\n\t\t\t<Skeleton className=\"h-9 flex-1\" />\n\t\t\t<Skeleton className=\"h-9 w-20\" />\n\t\t</div>\n\t);\n}\n\nfunction SchemaFormInputBlockDocumentContent({\n\tvalue,\n\tonValueChange,\n\tblockTypeSlug,\n\tid,\n}: SchemaFormInputBlockDocumentProps) {\n\tconst [createDialogOpen, setCreateDialogOpen] = useState(false);\n\n\tconst { data: blockType } = useSuspenseQuery(\n\t\tbuildGetBlockTypeQuery(blockTypeSlug),\n\t);\n\n\tconst { data: blockDocumentCount } = useSuspenseQuery(\n\t\tbuildCountFilterBlockDocumentsQuery({\n\t\t\tblock_types: {\n\t\t\t\tslug: { any_: [blockTypeSlug] },\n\t\t\t},\n\t\t\tblock_documents: {\n\t\t\t\toperator: \"and_\",\n\t\t\t\tis_anonymous: { eq_: false },\n\t\t\t},\n\t\t\tinclude_secrets: false,\n\t\t\tsort: \"BLOCK_TYPE_AND_NAME_ASC\",\n\t\t\toffset: 0,\n\t\t}),\n\t);\n\n\tconst hasBlockDocuments = blockDocumentCount > 0;\n\tconst selectedBlockDocumentId = value?.$ref;\n\n\tconst handleSelect = (blockDocumentId: string | undefined) => {\n\t\tif (blockDocumentId) {\n\t\t\tonValueChange({ $ref: blockDocumentId });\n\t\t} else {\n\t\t\tonValueChange(undefined);\n\t\t}\n\t};\n\n\tconst handleCreated = (blockDocumentId: string) => {\n\t\tonValueChange({ $ref: blockDocumentId });\n\t};\n\n\treturn (\n\t\t<div id={id} className=\"flex items-center gap-2\">\n\t\t\t<BlockTypeLogo logoUrl={blockType.logo_url} alt={blockType.name} />\n\t\t\t{hasBlockDocuments && (\n\t\t\t\t<div className=\"flex-1\">\n\t\t\t\t\t<BlockDocumentCombobox\n\t\t\t\t\t\tblockTypeSlug={blockTypeSlug}\n\t\t\t\t\t\tselectedBlockDocumentId={selectedBlockDocumentId}\n\t\t\t\t\t\tonSelect={handleSelect}\n\t\t\t\t\t\tonCreateNew={() => setCreateDialogOpen(true)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<Button\n\t\t\t\ttype=\"button\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\tonClick={() => setCreateDialogOpen(true)}\n\t\t\t>\n\t\t\t\tAdd\n\t\t\t\t<Icon id=\"Plus\" className=\"ml-2 size-4\" />\n\t\t\t</Button>\n\t\t\t<BlockDocumentCreateDialog\n\t\t\t\topen={createDialogOpen}\n\t\t\t\tonOpenChange={setCreateDialogOpen}\n\t\t\t\tblockTypeSlug={blockTypeSlug}\n\t\t\t\tonCreated={handleCreated}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n","import type { CheckedState } from \"@radix-ui/react-checkbox\";\nimport type { BooleanSubtype, SchemaObject } from \"openapi-typescript\";\nimport { Switch } from \"@/components/ui/switch\";\nimport { SchemaFormInputEnum } from \"./schema-form-input-enum\";\nimport { isWithPrimitiveEnum } from \"./types/schemas\";\nimport { asType } from \"./utilities/asType\";\n\ntype SchemaFormInputBooleanProps = {\n\tvalue: boolean | undefined;\n\tonValueChange: (value: boolean | undefined) => void;\n\tproperty: SchemaObject & BooleanSubtype;\n\tid: string;\n};\n\nexport function SchemaFormInputBoolean({\n\tvalue,\n\tonValueChange,\n\tproperty,\n\tid,\n}: SchemaFormInputBooleanProps) {\n\tfunction onCheckedChange(checked: CheckedState) {\n\t\tonValueChange(asType(checked, Boolean));\n\t}\n\n\tif (isWithPrimitiveEnum(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputEnum\n\t\t\t\tmultiple={false}\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={property}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn <Switch checked={value} onCheckedChange={onCheckedChange} id={id} />;\n}\n","import type {\n\tIntegerSubtype,\n\tNumberSubtype,\n\tSchemaObject,\n} from \"openapi-typescript\";\nimport { Input } from \"../ui/input\";\nimport { SchemaFormInputEnum } from \"./schema-form-input-enum\";\nimport { isWithPrimitiveEnum } from \"./types/schemas\";\n\ntype SchemaFormInputIntegerProps = {\n\tvalue: number | undefined;\n\tonValueChange: (value: number | undefined) => void;\n\tproperty: SchemaObject & (NumberSubtype | IntegerSubtype);\n\tid: string;\n};\n\nexport function SchemaFormInputInteger({\n\tvalue,\n\tonValueChange,\n\tproperty,\n\tid,\n}: SchemaFormInputIntegerProps) {\n\tif (isWithPrimitiveEnum(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputEnum\n\t\t\t\tmultiple={false}\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={property}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tfunction handleChange(value: string) {\n\t\tif (value === \"\") {\n\t\t\tonValueChange(undefined);\n\t\t} else {\n\t\t\tonValueChange(Number(value));\n\t\t}\n\t}\n\n\treturn (\n\t\t<Input\n\t\t\ttype=\"number\"\n\t\t\tmin={property.minimum}\n\t\t\tmax={property.maximum}\n\t\t\tvalue={value ?? \"\"}\n\t\t\tstep=\"1\"\n\t\t\tonChange={(e) => handleChange(e.target.value)}\n\t\t\tid={id}\n\t\t/>\n\t);\n}\n","export function SchemaFormInputNull() {\n\treturn (\n\t\t<p className=\"text-subdued text-sm\">Property is type &quot;None&quot;</p>\n\t);\n}\n","import type { NumberSubtype, SchemaObject } from \"openapi-typescript\";\nimport { Input } from \"../ui/input\";\nimport { SchemaFormInputEnum } from \"./schema-form-input-enum\";\nimport { isWithPrimitiveEnum } from \"./types/schemas\";\n\ntype SchemaFormInputNumberProps = {\n\tvalue: number | undefined;\n\tonValueChange: (value: number | undefined) => void;\n\tproperty: SchemaObject & NumberSubtype;\n\tid: string;\n};\n\nexport function SchemaFormInputNumber({\n\tvalue,\n\tonValueChange,\n\tproperty,\n\tid,\n}: SchemaFormInputNumberProps) {\n\tif (isWithPrimitiveEnum(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputEnum\n\t\t\t\tmultiple={false}\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={property}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tfunction handleChange(value: string) {\n\t\tif (value === \"\") {\n\t\t\tonValueChange(undefined);\n\t\t} else {\n\t\t\tonValueChange(Number(value));\n\t\t}\n\t}\n\n\treturn (\n\t\t<Input\n\t\t\ttype=\"number\"\n\t\t\tmin={property.minimum}\n\t\t\tmax={property.maximum}\n\t\t\tvalue={value ?? \"\"}\n\t\t\tonChange={(e) => handleChange(e.target.value)}\n\t\t\tid={id}\n\t\t/>\n\t);\n}\n","import type { JsonInputOnChange } from \"../ui/json-input\";\nimport { LazyJsonInput as JsonInput } from \"../ui/json-input-lazy\";\nimport type { PrefectKindValueJinja } from \"./types/prefect-kind-value\";\n\ntype SchemaFormInputPrefectKindJinjaProps = {\n\tvalue: PrefectKindValueJinja;\n\tonValueChange: (value: PrefectKindValueJinja) => void;\n\tid: string;\n};\n\nexport function SchemaFormInputPrefectKindJinja({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputPrefectKindJinjaProps) {\n\tconst onChange: JsonInputOnChange = (newValue) => {\n\t\tif (typeof newValue === \"string\" || newValue === undefined) {\n\t\t\tonValueChange({\n\t\t\t\t__prefect_kind: \"jinja\",\n\t\t\t\ttemplate: newValue || undefined,\n\t\t\t});\n\t\t}\n\t};\n\n\treturn <JsonInput value={value.template} onChange={onChange} id={id} />;\n}\n","import type { JsonInputOnChange } from \"../ui/json-input\";\nimport { LazyJsonInput as JsonInput } from \"../ui/json-input-lazy\";\nimport type { PrefectKindValueJson } from \"./types/prefect-kind-value\";\n\ntype SchemaFormInputPrefectKindJsonProps = {\n\tvalue: PrefectKindValueJson;\n\tonValueChange: (value: PrefectKindValueJson) => void;\n\tid: string;\n};\n\nexport function SchemaFormInputPrefectKindJson({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputPrefectKindJsonProps) {\n\tconst onChange: JsonInputOnChange = (value) => {\n\t\tif (typeof value === \"string\" || value === undefined) {\n\t\t\tonValueChange({\n\t\t\t\t__prefect_kind: \"json\",\n\t\t\t\tvalue: value || undefined,\n\t\t\t});\n\t\t}\n\t};\n\n\treturn <JsonInput value={value.value} onChange={onChange} id={id} />;\n}\n","import { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Suspense, useDeferredValue, useMemo, useState } from \"react\";\nimport { buildFilterVariablesQuery } from \"@/api/variables\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandGroup,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"@/components/ui/combobox\";\n\ntype VariableComboboxProps = {\n\tselectedVariableName: string | undefined;\n\tonSelect: (variableName: string | undefined) => void;\n};\n\nexport const VariableCombobox = ({\n\tselectedVariableName,\n\tonSelect,\n}: VariableComboboxProps) => {\n\treturn (\n\t\t<Suspense>\n\t\t\t<VariableComboboxImplementation\n\t\t\t\tselectedVariableName={selectedVariableName}\n\t\t\t\tonSelect={onSelect}\n\t\t\t/>\n\t\t</Suspense>\n\t);\n};\n\nconst VariableComboboxImplementation = ({\n\tselectedVariableName,\n\tonSelect,\n}: VariableComboboxProps) => {\n\tconst [search, setSearch] = useState(\"\");\n\tconst deferredSearch = useDeferredValue(search);\n\n\tconst { data } = useSuspenseQuery(\n\t\tbuildFilterVariablesQuery({\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t\tvariables: deferredSearch\n\t\t\t\t? { operator: \"and_\", name: { like_: deferredSearch } }\n\t\t\t\t: undefined,\n\t\t\tlimit: 50,\n\t\t}),\n\t);\n\n\tconst filteredData = useMemo(() => {\n\t\treturn data.filter((variable) =>\n\t\t\tvariable.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [data, deferredSearch]);\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\tselected={Boolean(selectedVariableName)}\n\t\t\t\taria-label=\"Select a variable\"\n\t\t\t>\n\t\t\t\t{selectedVariableName ?? \"Select a variable...\"}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search for a variable...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandEmtpy>No variable found</ComboboxCommandEmtpy>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t{filteredData.map((variable) => (\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tkey={variable.id}\n\t\t\t\t\t\t\t\tselected={selectedVariableName === variable.name}\n\t\t\t\t\t\t\t\tonSelect={(value) => {\n\t\t\t\t\t\t\t\t\tonSelect(value);\n\t\t\t\t\t\t\t\t\tsetSearch(\"\");\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tvalue={variable.name}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{variable.name}\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n};\n","import { VariableCombobox } from \"@/components/variables/variable-combobox\";\nimport type { PrefectKindValueWorkspaceVariable } from \"./types/prefect-kind-value\";\n\ntype SchemaFormInputPrefectKindWorkspaceVariableProps = {\n\tvalue: PrefectKindValueWorkspaceVariable;\n\tonValueChange: (value: PrefectKindValueWorkspaceVariable) => void;\n\tid: string;\n};\n\nexport function SchemaFormInputPrefectKindWorkspaceVariable({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputPrefectKindWorkspaceVariableProps) {\n\tconst handleSelect = (variableName: string | undefined) => {\n\t\tonValueChange({\n\t\t\t__prefect_kind: \"workspace_variable\",\n\t\t\tvariable_name: variableName,\n\t\t});\n\t};\n\n\treturn (\n\t\t<div id={id}>\n\t\t\t<VariableCombobox\n\t\t\t\tselectedVariableName={value.variable_name}\n\t\t\t\tonSelect={handleSelect}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n","import { format, parse, startOfToday } from \"date-fns\";\nimport { Calendar as CalendarIcon } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport {\n\tPopover,\n\tPopoverContent,\n\tPopoverTrigger,\n} from \"@/components/ui/popover\";\nimport { cn } from \"@/utils\";\n\ntype SchemaFormInputStringFormatDateProps = {\n\tvalue: string | undefined;\n\tonValueChange: (value: string | undefined) => void;\n\tid: string;\n};\n\nconst dateFormat = \"yyyy-MM-dd\";\n\nexport function SchemaFormInputStringFormatDate({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputStringFormatDateProps) {\n\tconst initialDate = value\n\t\t? parse(value, dateFormat, startOfToday())\n\t\t: undefined;\n\tconst [date, setDate] = useState<Date | undefined>(initialDate);\n\n\tfunction handleDateChange(date: Date | undefined) {\n\t\tsetDate(date);\n\t\tonValueChange(date ? format(date, dateFormat) : undefined);\n\t}\n\n\treturn (\n\t\t<Popover>\n\t\t\t<PopoverTrigger asChild>\n\t\t\t\t<Button\n\t\t\t\t\tvariant={\"outline\"}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"justify-start text-left font-normal w-full\",\n\t\t\t\t\t\t!date && \"text-muted-foreground\",\n\t\t\t\t\t)}\n\t\t\t\t\tid={id}\n\t\t\t\t>\n\t\t\t\t\t<CalendarIcon className=\"mr-2 h-4 w-4\" />\n\t\t\t\t\t{date ? format(date, \"PPP\") : <span>Pick a date</span>}\n\t\t\t\t</Button>\n\t\t\t</PopoverTrigger>\n\t\t\t<PopoverContent className=\"w-auto p-0\">\n\t\t\t\t<Calendar\n\t\t\t\t\tmode=\"single\"\n\t\t\t\t\tselected={date}\n\t\t\t\t\tonSelect={handleDateChange}\n\t\t\t\t\trequired={true}\n\t\t\t\t\tautoFocus\n\t\t\t\t/>\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t);\n}\n","import { LazyJsonInput as JsonInput } from \"../ui/json-input-lazy\";\n\nexport type SchemaFormInputStringFormatJsonProps = {\n\tvalue: string | undefined;\n\tonValueChange: (value: string | undefined) => void;\n\tid: string;\n};\n\nexport function SchemaFormInputStringFormatJson({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputStringFormatJsonProps) {\n\t// the JsonInput's types for onChange are probably wrong but this makes it work\n\tconst onChange: React.FormEventHandler<HTMLDivElement> &\n\t\t((value: string) => void) = (value) => {\n\t\tif (typeof value === \"string\" || value === undefined) {\n\t\t\tonValueChange(value || undefined);\n\t\t}\n\t};\n\n\treturn <JsonInput value={value} onChange={onChange} id={id} />;\n}\n","import { Eye, EyeOff } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\n\ntype SchemaFormInputStringFormatPasswordProps = {\n\tvalue: string | undefined;\n\tonValueChange: (value: string | undefined) => void;\n\tid: string;\n};\n\nexport function SchemaFormInputStringFormatPassword({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputStringFormatPasswordProps) {\n\tconst [showPassword, setShowPassword] = useState(false);\n\n\tconst handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\tonValueChange(e.target.value || undefined);\n\t};\n\n\treturn (\n\t\t<div className=\"relative\">\n\t\t\t<Input\n\t\t\t\tid={id}\n\t\t\t\ttype={showPassword ? \"text\" : \"password\"}\n\t\t\t\tvalue={value ?? \"\"}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tclassName=\"pr-10\"\n\t\t\t/>\n\t\t\t<Button\n\t\t\t\ttype=\"button\"\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName=\"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7\"\n\t\t\t\tonClick={() => setShowPassword(!showPassword)}\n\t\t\t\taria-label={showPassword ? \"Hide password\" : \"Show password\"}\n\t\t\t>\n\t\t\t\t{showPassword ? (\n\t\t\t\t\t<EyeOff className=\"h-4 w-4\" />\n\t\t\t\t) : (\n\t\t\t\t\t<Eye className=\"h-4 w-4\" />\n\t\t\t\t)}\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n","import { Input } from \"@/components/ui/input\";\n\ntype SchemaFormInputStringFormatTimeDeltaProps = {\n\tvalue: string | undefined;\n\tonValueChange: (value: string | undefined) => void;\n\tid: string;\n};\n\nexport function SchemaFormInputStringFormatTimeDelta({\n\tvalue,\n\tonValueChange,\n\tid,\n}: SchemaFormInputStringFormatTimeDeltaProps) {\n\tfunction handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n\t\tconst inputValue = e.target.value;\n\t\tif (inputValue === \"\") {\n\t\t\tonValueChange(undefined);\n\t\t\treturn;\n\t\t}\n\t\tconst numericValue = Number(inputValue);\n\t\tif (!Number.isNaN(numericValue)) {\n\t\t\tonValueChange(String(numericValue));\n\t\t}\n\t}\n\n\treturn (\n\t\t<Input\n\t\t\ttype=\"number\"\n\t\t\tvalue={value ?? \"\"}\n\t\t\tonChange={handleChange}\n\t\t\tid={id}\n\t\t\tplaceholder=\"Duration in seconds\"\n\t\t\tmin={0}\n\t\t/>\n\t);\n}\n","import type { SchemaObject, StringSubtype } from \"openapi-typescript\";\nimport { Textarea } from \"../ui/textarea\";\nimport { SchemaFormInputEnum } from \"./schema-form-input-enum\";\nimport { SchemaFormInputStringFormatDate } from \"./schema-form-input-string-format-date\";\nimport { SchemaFormInputStringFormatDateTime } from \"./schema-form-input-string-format-datetime\";\nimport { SchemaFormInputStringFormatJson } from \"./schema-form-input-string-format-json\";\nimport { SchemaFormInputStringFormatPassword } from \"./schema-form-input-string-format-password\";\nimport { SchemaFormInputStringFormatTimeDelta } from \"./schema-form-input-string-format-time-delta\";\nimport { isWithPrimitiveEnum } from \"./types/schemas\";\n\nexport type SchemaFormInputStringProps = {\n\tvalue: string | undefined;\n\tonValueChange: (value: string | undefined) => void;\n\tproperty: SchemaObject & StringSubtype;\n\tid: string;\n};\n\nexport function SchemaFormInputString({\n\tvalue,\n\tonValueChange,\n\tproperty,\n\tid,\n}: SchemaFormInputStringProps) {\n\tfunction handleChange(value: string | undefined) {\n\t\tonValueChange(value || undefined);\n\t}\n\n\tif (isWithPrimitiveEnum(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputEnum\n\t\t\t\tmultiple={false}\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={property}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.format === \"date\") {\n\t\treturn (\n\t\t\t<SchemaFormInputStringFormatDate\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.format === \"date-time\") {\n\t\treturn (\n\t\t\t<SchemaFormInputStringFormatDateTime\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.format === \"json-string\") {\n\t\treturn (\n\t\t\t<SchemaFormInputStringFormatJson\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.format === \"time-delta\") {\n\t\treturn (\n\t\t\t<SchemaFormInputStringFormatTimeDelta\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.format === \"password\") {\n\t\treturn (\n\t\t\t<SchemaFormInputStringFormatPassword\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<Textarea\n\t\t\tvalue={value ?? \"\"}\n\t\t\trows={1}\n\t\t\tclassName=\"min-h-min\"\n\t\t\tonChange={(e) => handleChange(e.target.value)}\n\t\t\tid={id}\n\t\t/>\n\t);\n}\n","import type { SchemaObject } from \"openapi-typescript\";\nimport { useEffect } from \"react\";\nimport { SchemaFormInputEnum } from \"./schema-form-input-enum\";\nimport { isWithPrimitiveEnum } from \"./types/schemas\";\nimport { asPrimitive } from \"./utilities/asType\";\n\nexport type SchemaFormInputUnknownProps = {\n\tvalue: unknown;\n\tonValueChange: (value: unknown) => void;\n\tproperty: SchemaObject & { type: undefined };\n\tid: string;\n};\n\nexport function SchemaFormInputUnknown({\n\tvalue,\n\tonValueChange,\n\tproperty,\n\tid,\n}: SchemaFormInputUnknownProps) {\n\t// if this isn't a simple enum we want to autoamtically switch to json\n\tuseEffect(() => {\n\t\tif (!isWithPrimitiveEnum(property)) {\n\t\t\tonValueChange({\n\t\t\t\t__prefect_kind: \"json\",\n\t\t\t});\n\t\t}\n\t}, [property, onValueChange]);\n\n\tif (isWithPrimitiveEnum(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputEnum\n\t\t\t\tmultiple={false}\n\t\t\t\tvalue={asPrimitive(value)}\n\t\t\t\tproperty={property}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn null;\n}\n","import type { SchemaObject } from \"openapi-typescript\";\nimport { SchemaFormInputAllOf } from \"./schema-form-input-all-of\";\nimport { SchemaFormInputAnyOf } from \"./schema-form-input-any-of\";\nimport { SchemaFormInputArray } from \"./schema-form-input-array\";\nimport { SchemaFormInputBlockDocument } from \"./schema-form-input-block-document\";\nimport { SchemaFormInputBoolean } from \"./schema-form-input-boolean\";\nimport { SchemaFormInputInteger } from \"./schema-form-input-integer\";\nimport { SchemaFormInputNull } from \"./schema-form-input-null\";\nimport { SchemaFormInputNumber } from \"./schema-form-input-number\";\nimport { SchemaFormInputObject } from \"./schema-form-input-object\";\nimport { SchemaFormInputPrefectKindJinja } from \"./schema-form-input-prefect-kind-jinja\";\nimport { SchemaFormInputPrefectKindJson } from \"./schema-form-input-prefect-kind-json\";\nimport { SchemaFormInputPrefectKindWorkspaceVariable } from \"./schema-form-input-prefect-kind-workspace-variable\";\nimport { SchemaFormInputString } from \"./schema-form-input-string\";\nimport { SchemaFormInputUnknown } from \"./schema-form-input-unknown\";\nimport type { SchemaFormErrors } from \"./types/errors\";\nimport { isPrefectKindValue } from \"./types/prefect-kind-value\";\nimport { asArray, asObject, asType } from \"./utilities/asType\";\nimport {\n\tisAllOfObject,\n\tisAnyOfObject,\n\tisOneOfObject,\n} from \"./utilities/guards\";\n\nexport type SchemaFormInputProps = {\n\tvalue: unknown;\n\tonValueChange: (value: unknown) => void;\n\terrors: SchemaFormErrors;\n\tproperty: SchemaObject;\n\tid: string;\n\tnested?: boolean;\n};\n\nexport function SchemaFormInput({\n\tvalue,\n\tonValueChange,\n\terrors,\n\tproperty,\n\tid,\n\tnested = true,\n}: SchemaFormInputProps) {\n\tif (isPrefectKindValue(value)) {\n\t\tif (isPrefectKindValue(value, \"json\")) {\n\t\t\treturn (\n\t\t\t\t<SchemaFormInputPrefectKindJson\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tonValueChange={onValueChange}\n\t\t\t\t\tid={id}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tif (isPrefectKindValue(value, \"jinja\")) {\n\t\t\treturn (\n\t\t\t\t<SchemaFormInputPrefectKindJinja\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tonValueChange={onValueChange}\n\t\t\t\t\tid={id}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\tif (isPrefectKindValue(value, \"workspace_variable\")) {\n\t\t\treturn (\n\t\t\t\t<SchemaFormInputPrefectKindWorkspaceVariable\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tonValueChange={onValueChange}\n\t\t\t\t\tid={id}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\t// @ts-expect-error This is an exhaustive check. If a prefect kind is not implemented this will get flaggged.\n\t\tthrow new Error(`Prefect kind not implemented: ${value.__prefect_kind}`);\n\t}\n\n\tif (\"block_type_slug\" in property) {\n\t\tconst blockTypeSlug = property.block_type_slug;\n\t\tif (typeof blockTypeSlug === \"string\") {\n\t\t\treturn (\n\t\t\t\t<SchemaFormInputBlockDocument\n\t\t\t\t\tvalue={value as { $ref: string } | undefined}\n\t\t\t\t\tonValueChange={onValueChange}\n\t\t\t\t\tblockTypeSlug={blockTypeSlug}\n\t\t\t\t\tid={id}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t}\n\n\tif (isAnyOfObject(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputAnyOf\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={property}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\terrors={errors}\n\t\t\t/>\n\t\t);\n\t}\n\n\t// According to the spec, anyOf and oneOf are different. But pydantic always uses anyOf even when it should use oneOf. So we treat them the same.\n\t// This block shouldn't ever be hit because we handle anyOf above. But this offers some typesafety and a fallback in case of future changes.\n\t// https://swagger.io/docs/specification/v3_0/data-models/oneof-anyof-allof-not/\n\t// https://github.com/pydantic/pydantic/issues/4125\n\tif (isOneOfObject(property)) {\n\t\tconst propertyWithAnyOf = {\n\t\t\t...property,\n\t\t\tanyOf: property.oneOf,\n\t\t};\n\n\t\treturn (\n\t\t\t<SchemaFormInputAnyOf\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={propertyWithAnyOf}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\terrors={errors}\n\t\t\t/>\n\t\t);\n\t}\n\n\t// this is the same as an anyOf so we can convert it here and use the same logic component\n\tif (Array.isArray(property.type)) {\n\t\tconst propertyWithAnyOf = {\n\t\t\t...property,\n\t\t\tanyOf: Object.values(property.type).map((type) => ({\n\t\t\t\ttype,\n\t\t\t})),\n\t\t};\n\n\t\treturn (\n\t\t\t<SchemaFormInputAnyOf\n\t\t\t\tvalue={value}\n\t\t\t\tproperty={propertyWithAnyOf}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\terrors={errors}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (isAllOfObject(property)) {\n\t\treturn (\n\t\t\t<SchemaFormInputAllOf\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\terrors={errors}\n\t\t\t\tproperty={property}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"string\") {\n\t\treturn (\n\t\t\t<SchemaFormInputString\n\t\t\t\tvalue={asType(value, String)}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tproperty={property}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"integer\") {\n\t\treturn (\n\t\t\t<SchemaFormInputInteger\n\t\t\t\tvalue={asType(value, Number)}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tproperty={property}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"number\") {\n\t\treturn (\n\t\t\t<SchemaFormInputNumber\n\t\t\t\tvalue={asType(value, Number)}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tproperty={property}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"boolean\") {\n\t\treturn (\n\t\t\t<SchemaFormInputBoolean\n\t\t\t\tvalue={asType(value, Boolean)}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tproperty={property}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"object\") {\n\t\treturn (\n\t\t\t<SchemaFormInputObject\n\t\t\t\tvalues={asObject(value)}\n\t\t\t\tproperty={property}\n\t\t\t\tonValuesChange={onValueChange}\n\t\t\t\terrors={errors}\n\t\t\t\tnested={nested}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"array\") {\n\t\treturn (\n\t\t\t<SchemaFormInputArray\n\t\t\t\tvalues={asArray(value)}\n\t\t\t\tproperty={property}\n\t\t\t\tonValuesChange={onValueChange}\n\t\t\t\terrors={errors}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tif (property.type === \"null\") {\n\t\treturn <SchemaFormInputNull />;\n\t}\n\n\tif (property.type === undefined) {\n\t\treturn (\n\t\t\t<SchemaFormInputUnknown\n\t\t\t\tvalue={value}\n\t\t\t\tonValueChange={onValueChange}\n\t\t\t\tproperty={property}\n\t\t\t\tid={id}\n\t\t\t/>\n\t\t);\n\t}\n\n\tthrow new Error(\n\t\t`Schema type not implemented: ${String(property.type satisfies never)}`,\n\t);\n}\n","import type { SchemaObject } from \"openapi-typescript\";\nimport { useMemo } from \"react\";\n\nexport type SchemaFormPropertyDescriptionProps = {\n\tproperty: SchemaObject;\n};\n\nexport function SchemaFormPropertyDescription({\n\tproperty,\n}: SchemaFormPropertyDescriptionProps) {\n\t// Description come from the doc strings which frequently have very short line lengths. We remove the single line breaks to make it easier to read.\n\tconst description = useMemo(() => {\n\t\treturn property.description?.replace(/\\n(?!\\n)/g, \" \");\n\t}, [property.description]);\n\n\t// todo: support markdown\n\treturn description && <p className=\"text-sm text-gray-500\">{description}</p>;\n}\n","import type { SchemaObject } from \"openapi-typescript\";\nimport { useMemo } from \"react\";\nimport { Label } from \"../ui/label\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { getSchemaObjectLabel } from \"./utilities/getSchemaObjectLabel\";\n\nexport type SchemaFormPropertyLabelProps = {\n\tproperty: SchemaObject;\n\trequired: boolean;\n\tid: string;\n};\n\nexport function SchemaFormPropertyLabel({\n\tproperty,\n\trequired,\n\tid,\n}: SchemaFormPropertyLabelProps) {\n\tconst { schema } = useSchemaFormContext();\n\n\tconst label = useMemo(() => {\n\t\tconst label = getSchemaObjectLabel(property, schema);\n\n\t\tif (required) {\n\t\t\treturn label;\n\t\t}\n\n\t\treturn `${label} (Optional)`;\n\t}, [property, required, schema]);\n\n\treturn <Label htmlFor={id}>{label}</Label>;\n}\n","import type { ReferenceObject, SchemaObject } from \"openapi-typescript\";\nimport { useCallback, useEffect, useId, useMemo, useState } from \"react\";\nimport { DropdownMenuItem } from \"../ui/dropdown-menu\";\nimport { SchemaFormInput } from \"./schema-form-input\";\nimport { SchemaFormPropertyDescription } from \"./schema-form-property-description\";\nimport { SchemaFormPropertyErrors } from \"./schema-form-property-errors\";\nimport { SchemaFormPropertyLabel } from \"./schema-form-property-label\";\nimport { SchemaFormPropertyMenu } from \"./schema-form-property-menu\";\nimport {\n\tisSchemaValueIndexError,\n\tisSchemaValuePropertyError,\n\ttype SchemaFormErrors,\n\ttype SchemaValueIndexError,\n\ttype SchemaValuePropertyError,\n} from \"./types/errors\";\nimport { useSchemaFormContext } from \"./use-schema-form-context\";\nimport { isDefined } from \"./utilities/guards\";\nimport { mergeSchemaPropertyDefinition } from \"./utilities/mergeSchemaPropertyDefinition\";\n\nexport type SchemaFormPropertyProps = {\n\tvalue: unknown;\n\tonValueChange: (value: unknown) => void;\n\tproperty: SchemaObject | ReferenceObject;\n\trequired: boolean;\n\terrors: SchemaFormErrors;\n\tshowLabel?: boolean;\n\tnested?: boolean;\n};\n\nexport function SchemaFormProperty({\n\tproperty: propertyDefinition,\n\tvalue,\n\tonValueChange,\n\trequired,\n\terrors,\n\tshowLabel = true,\n\tnested = true,\n}: SchemaFormPropertyProps) {\n\tconst { schema, skipDefaultValueInitialization } = useSchemaFormContext();\n\n\tconst property = useMemo(() => {\n\t\treturn mergeSchemaPropertyDefinition(propertyDefinition, schema);\n\t}, [propertyDefinition, schema]);\n\n\tconst unknownPropertyType = useMemo(() => {\n\t\treturn !isDefined(property.type);\n\t}, [property.type]);\n\n\tconst nestedErrors = useMemo(() => {\n\t\treturn errors.filter(\n\t\t\t(error): error is SchemaValuePropertyError | SchemaValueIndexError =>\n\t\t\t\tisSchemaValuePropertyError(error) || isSchemaValueIndexError(error),\n\t\t);\n\t}, [errors]);\n\n\tconst [initialized, setInitialized] = useState(false);\n\tconst [internalValue, setInternalValue] = useState(getInitialValue);\n\tconst [omitted, setOmitted] = useState(false);\n\tconst id = useId();\n\n\tconst handleValueChange = useCallback(\n\t\t(value: unknown) => {\n\t\t\tsetInternalValue(value);\n\t\t\tonValueChange(value);\n\t\t},\n\t\t[onValueChange],\n\t);\n\n\tconst handleOmittedChange = useCallback(() => {\n\t\tconst isOmitted = !omitted;\n\n\t\tsetOmitted(isOmitted);\n\t\tonValueChange(isOmitted ? undefined : internalValue);\n\t}, [omitted, onValueChange, internalValue]);\n\n\tuseEffect(() => {\n\t\tif (initialized || skipDefaultValueInitialization) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isDefined(property.default) && !isDefined(value)) {\n\t\t\tonValueChange(property.default);\n\t\t}\n\n\t\tsetInitialized(true);\n\t}, [\n\t\tinitialized,\n\t\tskipDefaultValueInitialization,\n\t\tonValueChange,\n\t\tproperty.default,\n\t\tvalue,\n\t]);\n\n\tfunction getInitialValue() {\n\t\tif (isDefined(value)) {\n\t\t\treturn value;\n\t\t}\n\n\t\tif (isDefined(property.default) && !skipDefaultValueInitialization) {\n\t\t\treturn property.default;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-2 group\">\n\t\t\t{showLabel && (\n\t\t\t\t<div className=\"grid grid-cols-[1fr_auto] items-center gap-2\">\n\t\t\t\t\t<div className=\"flex flex-col gap-1\">\n\t\t\t\t\t\t<SchemaFormPropertyLabel\n\t\t\t\t\t\t\tproperty={property}\n\t\t\t\t\t\t\trequired={required}\n\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<SchemaFormPropertyDescription property={property} />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"ml-auto\">\n\t\t\t\t\t\t<SchemaFormPropertyMenu\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tonValueChange={handleValueChange}\n\t\t\t\t\t\t\tproperty={property}\n\t\t\t\t\t\t\tdisableKinds={unknownPropertyType}\n\t\t\t\t\t\t\tdefaultValue={property.default}\n\t\t\t\t\t\t\thasDefaultValue={isDefined(property.default)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DropdownMenuItem onClick={handleOmittedChange}>\n\t\t\t\t\t\t\t\t{omitted ? \"Include value\" : \"Omit value\"}\n\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t</SchemaFormPropertyMenu>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{!showLabel && <SchemaFormPropertyDescription property={property} />}\n\n\t\t\t<fieldset disabled={omitted}>\n\t\t\t\t<SchemaFormInput\n\t\t\t\t\tproperty={property}\n\t\t\t\t\tvalue={internalValue}\n\t\t\t\t\tonValueChange={handleValueChange}\n\t\t\t\t\terrors={nestedErrors}\n\t\t\t\t\tid={id}\n\t\t\t\t\tnested={nested}\n\t\t\t\t/>\n\t\t\t</fieldset>\n\n\t\t\t<SchemaFormPropertyErrors errors={errors} />\n\t\t</div>\n\t);\n}\n","import type { WithPosition } from \"../types/schemas\";\n\nexport function sortByPropertyPosition(a: WithPosition, b: WithPosition) {\n\treturn (a.position ?? 0) - (b.position ?? 0);\n}\n","import type { ObjectSubtype, SchemaObject } from \"openapi-typescript\";\nimport { useCallback, useMemo, useRef } from \"react\";\nimport useDebounceCallback from \"@/hooks/use-debounce-callback\";\nimport { Card } from \"../ui/card\";\nimport { SchemaFormProperty } from \"./schema-form-property\";\nimport {\n\tisSchemaValuePropertyError,\n\ttype SchemaFormErrors,\n} from \"./types/errors\";\nimport type { PrefectObjectSubtype } from \"./types/schemas\";\nimport { sortByPropertyPosition } from \"./utilities/sortByPropertyPosition\";\n\nexport type SchemaFormInputObjectProps = {\n\tvalues: Record<string, unknown> | undefined;\n\tonValuesChange: (values: Record<string, unknown> | undefined) => void;\n\tproperty: SchemaObject & ObjectSubtype & PrefectObjectSubtype;\n\terrors: SchemaFormErrors;\n\tnested: boolean;\n};\n\nexport function SchemaFormInputObject({\n\tvalues,\n\tonValuesChange,\n\tproperty,\n\terrors,\n\tnested,\n}: SchemaFormInputObjectProps) {\n\tconst patches = useRef<{ key: string; value: unknown }[]>([]);\n\n\tconst flush = useDebounceCallback(\n\t\tuseCallback(() => {\n\t\t\tconst newValues = { ...values };\n\n\t\t\tfor (const { key, value } of patches.current) {\n\t\t\t\tnewValues[key] = value;\n\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tdelete newValues[key];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpatches.current = [];\n\n\t\t\tif (Object.keys(newValues).length === 0) {\n\t\t\t\tonValuesChange(undefined);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonValuesChange(newValues);\n\t\t}, [values, onValuesChange]),\n\t\t10,\n\t);\n\n\tfunction onPropertyValueChange(key: string, value: unknown) {\n\t\tpatches.current.push({ key, value });\n\n\t\tflush();\n\t}\n\n\tfunction getPropertyValue(key: string): unknown {\n\t\treturn values?.[key];\n\t}\n\n\tfunction getPropertyErrors(key: string): SchemaFormErrors {\n\t\treturn errors\n\t\t\t.filter(isSchemaValuePropertyError)\n\t\t\t.filter((error) => error.property === key)\n\t\t\t.flatMap((error) => error.errors);\n\t}\n\n\tconst properties = useMemo(() => {\n\t\treturn Object.entries(property.properties ?? {}).sort(([, a], [, b]) =>\n\t\t\tsortByPropertyPosition(a, b),\n\t\t);\n\t}, [property.properties]);\n\n\tconst output = (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t{properties.map(([key, subProperty]) => (\n\t\t\t\t<SchemaFormProperty\n\t\t\t\t\tkey={key}\n\t\t\t\t\tvalue={getPropertyValue(key)}\n\t\t\t\t\tonValueChange={(value) => onPropertyValueChange(key, value)}\n\t\t\t\t\tproperty={subProperty}\n\t\t\t\t\terrors={getPropertyErrors(key)}\n\t\t\t\t\trequired={Boolean(property.required?.includes(key))}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n\n\tif (nested) {\n\t\treturn <Card className=\"p-2\">{output}</Card>;\n\t}\n\n\treturn output;\n}\n","import type { ReactNode } from \"react\";\nimport { SchemaFormContext } from \"./use-schema-form-context\";\n\ntype SchemaFormProviderProps = SchemaFormContext & {\n\tchildren: ReactNode;\n};\n\nexport const SchemaFormProvider = ({\n\tchildren,\n\t...context\n}: SchemaFormProviderProps) => {\n\treturn (\n\t\t<SchemaFormContext.Provider value={context}>\n\t\t\t{children}\n\t\t</SchemaFormContext.Provider>\n\t);\n};\n","import { useCallback } from \"react\";\nimport {\n\tSchemaFormInputObject,\n\ttype SchemaFormInputObjectProps,\n} from \"./schema-form-input-object\";\nimport { SchemaFormProvider } from \"./schema-form-provider\";\nimport type { SchemaFormErrors } from \"./types/errors\";\nimport type { SchemaFormValues } from \"./types/values\";\nimport type { SchemaFormContext } from \"./use-schema-form-context\";\n\nexport type SchemaFormProps = SchemaFormContext & {\n\terrors: SchemaFormErrors;\n\tvalues: SchemaFormValues;\n\tonValuesChange: (values: SchemaFormValues) => void;\n};\n\nexport const SchemaForm = ({\n\tschema,\n\tkinds,\n\tskipDefaultValueInitialization,\n\tvalues,\n\tonValuesChange,\n\terrors,\n}: SchemaFormProps) => {\n\tconst context: SchemaFormContext = {\n\t\tschema,\n\t\tkinds,\n\t\tskipDefaultValueInitialization,\n\t};\n\n\tconst handleValuesChange = useCallback(\n\t\t(values: Record<string, unknown> | undefined) => {\n\t\t\tif (values === undefined) {\n\t\t\t\tonValuesChange({});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tonValuesChange(values);\n\t\t},\n\t\t[onValuesChange],\n\t);\n\n\tconst properties: Omit<SchemaFormInputObjectProps, \"nested\"> = {\n\t\tvalues,\n\t\tproperty: schema,\n\t\tonValuesChange: handleValuesChange,\n\t\terrors,\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<SchemaFormProvider {...context}>\n\t\t\t\t<SchemaFormInputObject {...properties} nested={false} />\n\t\t\t</SchemaFormProvider>\n\t\t</div>\n\t);\n};\n"],"names":["__iconNode","EyeOff","createLucideIcon","Eye","GripVertical","isDefined","value","isRecord","item","isDate","isArray","isEmptyObject","isReferenceObject","property","isAnyOfObject","isOneOfObject","isAllOfObject","isItemsObject","isSchemaWithDefinitions","schema","getSchemaDefinition","definition","definitionKey","definitionSchema","mergeSchemaPropertyDefinition","$ref","rest","merge","SchemaFormInputAllOf","onValueChange","errors","id","useSchemaFormContext","merged","useMemo","allOf","baseProperty","definitions","reference","jsx","SchemaFormInput","getIndexForAnyOfPropertyValue","valueOrDefaultValue","getSchemaPropertyAnyOfDefinitions","getObjectDefinitionIndex","getRecordDefinitionIndex","valueKeys","index","keysInCommon","resultIndex","resultKeysInCommon","definitionIndex","definitionKeys","definitionKeysInCommon","schemaObjectTypeLabels","getSchemaObjectTypeLabel","getSchemaObjectLabel","fallback","SchemaFormInputAnyOf","selectedIndex","setSelectedIndex","useState","values","useRef","onSelectedIndexChange","newSelectedIndexValue","newSelectedIndex","jsxs","ToggleGroup","option","label","ToggleGroupItem","Card","SchemaFormProperty","byteToHex","i","unsafeStringify","arr","offset","getRandomValues","rnds8","rng","randomUUID","native","_v4","options","buf","rnds","v4","isSchemaValueError","error","isSchemaValuePropertyError","isSchemaValueIndexError","SchemaFormPropertyErrors","propertyErrors","getPrefectKindFromValue","isPrefectKindValue","kind","isPrefectKind","convertValueToPrefectKind","to","from","convertPrefectKindValueJson","convertPrefectKindValueJinja","convertPrefectKindValueWorkspaceVariable","convertPrefectKindValueNull","json","parsed","coerceValueToProperties","InvalidSchemaValueTransformation","jinja","workspaceVariable","coerceValueToProperty","response","coerceValueToArrayProperty","coerceValueToObjectProperty","key","propertyValue","SchemaFormPropertyMenu","children","disableKinds","defaultValue","hasDefaultValue","kinds","open","setOpen","isDefaultValueDisabled","handleUseDefaultValue","convertValueKind","newValue","kindOptions","current","prefectKinds","DropdownMenu","DropdownMenuTrigger","Button","Icon","DropdownMenuContent","DropdownMenuItem","getPrefectKindLabel","DropdownMenuSeparator","SchemaFormInputArrayItem","itemKey","items","onDelete","first","last","canMove","moveUp","moveDown","moveToTop","moveToBottom","useId","attributes","listeners","setNodeRef","transform","transition","isDragging","useSortable","style","CSS","Fragment","SchemaFormInputArrayList","onValuesChange","isEmpty","canAddMore","prefixItemsCount","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","sortableKeyboardCoordinates","localKeyedValues","setLocalKeyedValues","uuidv4","getPropertyForIndex","getErrorsForIndex","getFirstForIndex","getLastForIndex","getCanMoveForIndex","handleValueChange","addItem","newKeyedValues","moveItem","newValues","deleteItem","handleDragEnd","event","active","over","oldIndex","newIndex","sortableKeys","DndContext","closestCenter","SortableContext","verticalListSortingStrategy","SchemaFormInputEnum","props","search","setSearch","selected","isSelected","onSelect","onSelectMultiple","onSelectSingle","v","Combobox","ComboboxTrigger","ComboboxContent","ComboboxCommandInput","ComboboxCommandEmtpy","ComboboxCommandList","ComboboxCommandItem","isWithPrimitiveEnum","isPrimitivePropertyType","asType","type","asObject","asPrimitive","asArray","SchemaFormInputArray","handleValuesChange","BlockDocumentCombobox","blockTypeSlug","selectedBlockDocumentId","onCreateNew","Suspense","BlockDocumentComboboxImplementation","deferredSearch","useDeferredValue","data","useSuspenseQuery","buildListFilterBlockDocumentsQuery","filteredData","blockDocument","selectedBlockDocument","ComboboxCommandGroup","SchemaFormInputBlockDocument","SchemaFormInputBlockDocumentSkeleton","SchemaFormInputBlockDocumentContent","Skeleton","createDialogOpen","setCreateDialogOpen","blockType","buildGetBlockTypeQuery","blockDocumentCount","buildCountFilterBlockDocumentsQuery","hasBlockDocuments","handleSelect","blockDocumentId","handleCreated","BlockTypeLogo","BlockDocumentCreateDialog","SchemaFormInputBoolean","onCheckedChange","checked","Switch","SchemaFormInputInteger","handleChange","Input","e","SchemaFormInputNull","SchemaFormInputNumber","SchemaFormInputPrefectKindJinja","onChange","JsonInput","SchemaFormInputPrefectKindJson","VariableCombobox","selectedVariableName","VariableComboboxImplementation","buildFilterVariablesQuery","variable","SchemaFormInputPrefectKindWorkspaceVariable","variableName","dateFormat","SchemaFormInputStringFormatDate","initialDate","parse","startOfToday","date","setDate","handleDateChange","format","Popover","PopoverTrigger","cn","CalendarIcon","PopoverContent","Calendar","SchemaFormInputStringFormatJson","SchemaFormInputStringFormatPassword","showPassword","setShowPassword","SchemaFormInputStringFormatTimeDelta","inputValue","numericValue","SchemaFormInputString","SchemaFormInputStringFormatDateTime","Textarea","SchemaFormInputUnknown","useEffect","nested","propertyWithAnyOf","SchemaFormInputObject","SchemaFormPropertyDescription","description","SchemaFormPropertyLabel","required","Label","propertyDefinition","showLabel","skipDefaultValueInitialization","unknownPropertyType","nestedErrors","initialized","setInitialized","internalValue","setInternalValue","getInitialValue","omitted","setOmitted","useCallback","handleOmittedChange","isOmitted","sortByPropertyPosition","a","b","patches","flush","useDebounceCallback","onPropertyValueChange","getPropertyValue","getPropertyErrors","properties","output","subProperty","SchemaFormProvider","context","SchemaFormContext","SchemaForm"],"mappings":"2nCASA,MAAMA,GAAa,CACjB,CACE,OACA,CACE,EAAG,iGACH,IAAK,QACX,CACA,EACE,CAAC,OAAQ,CAAE,EAAG,uCAAwC,IAAK,QAAQ,CAAE,EACrE,CACE,OACA,CACE,EAAG,+FACH,IAAK,QACX,CACA,EACE,CAAC,OAAQ,CAAE,EAAG,aAAc,IAAK,QAAQ,CAAE,CAC7C,EACMC,GAASC,EAAiB,UAAWF,EAAU,EClBrD,MAAMA,GAAa,CACjB,CACE,OACA,CACE,EAAG,wGACH,IAAK,QACX,CACA,EACE,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,IAAK,IAAK,QAAQ,CAAE,CAC1D,EACMG,GAAMD,EAAiB,MAAOF,EAAU,ECV9C,MAAMA,GAAa,CACjB,CAAC,SAAU,CAAE,GAAI,IAAK,GAAI,KAAM,EAAG,IAAK,IAAK,SAAU,EACvD,CAAC,SAAU,CAAE,GAAI,IAAK,GAAI,IAAK,EAAG,IAAK,IAAK,SAAU,EACtD,CAAC,SAAU,CAAE,GAAI,IAAK,GAAI,KAAM,EAAG,IAAK,IAAK,SAAU,EACvD,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,IAAK,IAAK,SAAU,EACxD,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,IAAK,EAAG,IAAK,IAAK,SAAU,EACvD,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAA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AAK9G,CAAK,EAC1D,SAAU4U,EACV,OAAQH,EAAkB3N,CAAG,EAC7B,SAAU,EAAQvG,EAAS,UAAU,SAASuG,CAAG,CAAC,EAL7CA,CAAA,CAON,EACF,EAGD,OAAI4L,EACIzQ,EAAAA,IAACiC,GAAA,CAAK,UAAU,MAAO,SAAAyQ,EAAO,EAG/BA,CACR,CCzFO,MAAME,GAAqB,CAAC,CAClC,SAAA5N,EACA,GAAG6N,CACJ,UAEGC,GAAkB,SAAlB,CAA2B,MAAOD,EACjC,SAAA7N,EACF,ECEW+N,GAAa,CAAC,CAC1B,OAAAnU,EACA,MAAAwG,EACA,+BAAA+L,EACA,OAAA5P,EACA,eAAAsG,EACA,OAAAtI,CACD,IAAuB,CACtB,MAAMsT,EAA6B,CAClC,OAAAjU,EACA,MAAAwG,EACA,+BAAA+L,CAAA,EAGK1F,EAAqBoG,EAAAA,YACzBtQ,GAAgD,CAChD,GAAIA,IAAW,OAAW,CACzBsG,EAAe,CAAA,CAAE,EACjB,MACD,CAEAA,EAAetG,CAAM,CACtB,EACA,CAACsG,CAAc,CAAA,EAGV4K,EAAyD,CAC9D,OAAAlR,EACA,SAAU3C,EACV,eAAgB6M,EAChB,OAAAlM,CAAA,EAGD,OACCS,EAAAA,IAAC,MAAA,CAAI,UAAU,sBACd,eAAC4S,GAAA,CAAoB,GAAGC,EACvB,SAAA7S,EAAAA,IAAC2Q,IAAuB,GAAG8B,EAAY,OAAQ,EAAA,CAAO,EACvD,EACD,CAEF","x_google_ignoreList":[0,1,2,9,10,11,12]}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prefect
3
- Version: 3.6.16.dev2
3
+ Version: 3.6.16.dev3
4
4
  Summary: Workflow orchestration and management.
5
5
  Project-URL: Changelog, https://github.com/PrefectHQ/prefect/releases
6
6
  Project-URL: Documentation, https://docs.prefect.io
@@ -2,7 +2,7 @@ prefect/.prefectignore,sha256=awSprvKT0vI8a64mEOLrMxhxqcO-b0ERQeYpA2rNKVQ,390
2
2
  prefect/AGENTS.md,sha256=qmCZAuKIF9jQyp5TrW_T8bsM_97-QaiCoQp71A_b2Lg,1008
3
3
  prefect/__init__.py,sha256=BKX4WKriD3fpvlxNI8H6k5d0i5bW6y7QpRuOO2AMedM,6720
4
4
  prefect/__main__.py,sha256=WFjw3kaYJY6pOTA7WDOgqjsz8zUEUZHCcj3P5wyVa-g,66
5
- prefect/_build_info.py,sha256=aQJ8paBHVIVai6HMox1QQetbIVKkx5frmRzmxe9-6Ag,186
5
+ prefect/_build_info.py,sha256=8cnzJv4dnuWYDKEdQonykEsuNL-hHFGCbKLjYOldb30,186
6
6
  prefect/_observers.py,sha256=blhA5sQ7Pb2lJonL5Pvt7qguOywzeM4HhnXmyyDW6vc,9002
7
7
  prefect/_result_records.py,sha256=S6QmsODkehGVSzbMm6ig022PYbI6gNKz671p_8kBYx4,7789
8
8
  prefect/_states.py,sha256=VMO6uTO4g4f93p48qj7iszczLcy-JUosqB9c9Gpa-k8,10572
@@ -295,7 +295,7 @@ prefect/logging/__init__.py,sha256=DpRZzZeWeiDHFlMDEQdknRzbxpL0ObFh5IqqS9iaZwQ,1
295
295
  prefect/logging/clients.py,sha256=nKEv-Xfzy5QwtFmZvNirBI8G5YraZ9YzuIkKHb4XVXM,11825
296
296
  prefect/logging/configuration.py,sha256=JSU_DsnfCC_CPxCUTu_gLQPIduJhnO7whm_P1FxLzh8,4002
297
297
  prefect/logging/filters.py,sha256=NnRYubh9dMmWcCAjuW32cIVQ37rLxdn8ci26wTtQMyU,1136
298
- prefect/logging/formatters.py,sha256=Sum42BmYZ7mns64jSOy4OA_K8KudEZjeG2h7SZcY9mA,4167
298
+ prefect/logging/formatters.py,sha256=kGrIx0iedqmSMl2KgtLhnzbnzUoUgE0_LE26gcBKt98,5018
299
299
  prefect/logging/handlers.py,sha256=-HyJ3J4zjChs9VHrWdK1E6d0xBS4Z3aY0vugBfJrMyY,13547
300
300
  prefect/logging/highlighters.py,sha256=BCf_LNhFInIfGPqwuu8YVrGa4wVxNc4YXo2pYgftpg4,1811
301
301
  prefect/logging/loggers.py,sha256=fuipFM01X6FcuzqklZAlStU3byNLAAWZ9AqJ70_Sglw,13507
@@ -971,7 +971,7 @@ prefect/server/ui-v2/assets/radio-group-BUsmwdrt.js.map,sha256=9HvNhvs4UHu8AkaUD
971
971
  prefect/server/ui-v2/assets/route-error-state-BFBpiIhD.js,sha256=ud5VrvrEIkwMDJpA-FYAn6ugyFpJUD2KjUXluuSHvEE,1446
972
972
  prefect/server/ui-v2/assets/route-error-state-BFBpiIhD.js.map,sha256=Wr3lTwIPW_ZNAaCuHSNc1qHP8jH9l9vdeJ0RTsxVCHg,5007
973
973
  prefect/server/ui-v2/assets/schema-form-BwTmkvJk.js,sha256=ai_GkLWKY1lXwBK7UUn-1RxbpZrndfvME0SS5o8fcG4,27525
974
- prefect/server/ui-v2/assets/schema-form-BwTmkvJk.js.map,sha256=R1AWQvY1DVwgJZpR-nOBj5wz6GcbuAPmb7If-xUxnCQ,142411
974
+ prefect/server/ui-v2/assets/schema-form-BwTmkvJk.js.map,sha256=Pqw8petstspSHabuOIMwAU6iK4Gg2Spi5Sf43P4-2Ts,142440
975
975
  prefect/server/ui-v2/assets/schema-form-input-string-format-datetime-nrb3g-JJ.js,sha256=PsaYxAD2SZWPI6AE_h5ty0YOmpxzRcdvA6AU4G1s7T4,61269
976
976
  prefect/server/ui-v2/assets/schema-form-input-string-format-datetime-nrb3g-JJ.js.map,sha256=1f1urhU9HzODzQxwJGiL612OzJDBuEJKWCxfO87_p3M,309507
977
977
  prefect/server/ui-v2/assets/settings-CUBtK5aW.js,sha256=_a8GdvOBHriev_GO90oTHBT4TBkz9KQJ0jjgXDk_Ugo,4121
@@ -1179,8 +1179,8 @@ prefect/workers/cloud.py,sha256=dPvG1jDGD5HSH7aM2utwtk6RaJ9qg13XjkA0lAIgQmY,287
1179
1179
  prefect/workers/process.py,sha256=O_HZ39lBjedQat4gmIh2SiC2N_Q5q7grBGD13HXB2eo,12235
1180
1180
  prefect/workers/server.py,sha256=bWnYfMfJf5_IO3y3aJOpia7p9lFKC3ZZjiMvHox-UKY,1992
1181
1181
  prefect/workers/utilities.py,sha256=VfPfAlGtTuDj0-Kb8WlMgAuOfgXCdrGAnKMapPSBrwc,2483
1182
- prefect-3.6.16.dev2.dist-info/METADATA,sha256=1KZZ1E3gb1bYcL54lLqDbbAEpDKoM-6Adq-RD76-xsA,13840
1183
- prefect-3.6.16.dev2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
1184
- prefect-3.6.16.dev2.dist-info/entry_points.txt,sha256=HlY8up83iIq2vU2r33a0qSis4eOFSyb1mRH4l7Xt9X8,126
1185
- prefect-3.6.16.dev2.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
1186
- prefect-3.6.16.dev2.dist-info/RECORD,,
1182
+ prefect-3.6.16.dev3.dist-info/METADATA,sha256=t-EWFmy3-8W8dk8DARj14yI4_nbSLXsHNiyA6PB_FnM,13840
1183
+ prefect-3.6.16.dev3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
1184
+ prefect-3.6.16.dev3.dist-info/entry_points.txt,sha256=HlY8up83iIq2vU2r33a0qSis4eOFSyb1mRH4l7Xt9X8,126
1185
+ prefect-3.6.16.dev3.dist-info/licenses/LICENSE,sha256=MCxsn8osAkzfxKC4CC_dLcUkU8DZLkyihZ8mGs3Ah3Q,11357
1186
+ prefect-3.6.16.dev3.dist-info/RECORD,,