@powerhousedao/workflow 6.2.3-dev.13 → 6.2.3-dev.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/{PieceMarkdown-Q9C9CPGu.mjs → PieceMarkdown-D9nI2gI2.mjs} +2 -2
- package/dist/node/{PieceMarkdown-Q9C9CPGu.mjs.map → PieceMarkdown-D9nI2gI2.mjs.map} +1 -1
- package/dist/node/{editor-D7WL8J_4.mjs → editor-iDEb5EeC.mjs} +2 -2
- package/dist/node/{editor-D7WL8J_4.mjs.map → editor-iDEb5EeC.mjs.map} +1 -1
- package/dist/node/editors/workflow-editor/module.mjs +1 -1
- package/dist/node/pieces/reactor/descriptor.json +424 -0
- package/dist/node/pieces/reactor/index.mjs +1646 -703
- package/dist/node/pieces/reactor/index.mjs.map +1 -1
- package/dist/node/pieces/reactor/package.json +9 -0
- package/dist/powerhouse.manifest.json +14 -4
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["BLOCK"],"sources":["../../../../../pieces-framework/dist/markdown-property-Df2l6_y_.js","../../../../../pieces-framework/dist/input-COuhC1I-.js","../../../../../pieces-framework/dist/authentication-B7brX_It.js","../../../../../../node_modules/.pnpm/nanoid@3.3.17/node_modules/nanoid/index.js","../../../../../pieces-framework/dist/index.js","../../../../pieces/reactor/lib/logo.ts","../../../../pieces/reactor/lib/parse.ts","../../../../pieces/reactor/lib/reactor.ts","../../../../pieces/reactor/lib/actions/document-create.ts","../../../../pieces/reactor/lib/actions/document-dispatch.ts","../../../../pieces/reactor/lib/actions/document-find.ts","../../../../pieces/reactor/lib/actions/document-get.ts","../../../../pieces/reactor/lib/actions/document-schema.ts","../../../../pieces/reactor/lib/actions/document-types.ts","../../../../pieces/reactor/lib/triggers/document-event.ts","../../../../pieces/reactor/index.ts"],"sourcesContent":["import * as z from \"zod/mini\";\n\n//#region upstream/framework/lib/property/input/common.ts\nconst BasePropertySchema = z.object({\n\tdisplayName: z.string(),\n\tdescription: z.optional(z.string()),\n\tadvanced: z.optional(z.boolean()),\n\twidth: z.optional(z.enum([\"half\", \"full\"])),\n\ticon: z.optional(z.string()),\n\tplaceholder: z.optional(z.string())\n});\nconst TPropertyValue = (_T, propertyType) => z.object({\n\ttype: z.literal(propertyType),\n\trequired: z.boolean(),\n\tdefaultValue: z.optional(z.any())\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/property-type.ts\nlet PropertyType = /* @__PURE__ */ function(PropertyType) {\n\tPropertyType[\"SHORT_TEXT\"] = \"SHORT_TEXT\";\n\tPropertyType[\"LONG_TEXT\"] = \"LONG_TEXT\";\n\tPropertyType[\"RICH_TEXT\"] = \"RICH_TEXT\";\n\tPropertyType[\"MARKDOWN\"] = \"MARKDOWN\";\n\tPropertyType[\"DROPDOWN\"] = \"DROPDOWN\";\n\tPropertyType[\"STATIC_DROPDOWN\"] = \"STATIC_DROPDOWN\";\n\tPropertyType[\"NUMBER\"] = \"NUMBER\";\n\tPropertyType[\"CHECKBOX\"] = \"CHECKBOX\";\n\tPropertyType[\"OAUTH2\"] = \"OAUTH2\";\n\tPropertyType[\"SECRET_TEXT\"] = \"SECRET_TEXT\";\n\tPropertyType[\"ARRAY\"] = \"ARRAY\";\n\tPropertyType[\"OBJECT\"] = \"OBJECT\";\n\tPropertyType[\"BASIC_AUTH\"] = \"BASIC_AUTH\";\n\tPropertyType[\"JSON\"] = \"JSON\";\n\tPropertyType[\"MULTI_SELECT_DROPDOWN\"] = \"MULTI_SELECT_DROPDOWN\";\n\tPropertyType[\"STATIC_MULTI_SELECT_DROPDOWN\"] = \"STATIC_MULTI_SELECT_DROPDOWN\";\n\tPropertyType[\"DYNAMIC\"] = \"DYNAMIC\";\n\tPropertyType[\"CUSTOM_AUTH\"] = \"CUSTOM_AUTH\";\n\tPropertyType[\"OIDC\"] = \"OIDC\";\n\tPropertyType[\"DATE_TIME\"] = \"DATE_TIME\";\n\tPropertyType[\"DATE_RANGE\"] = \"DATE_RANGE\";\n\tPropertyType[\"FILE\"] = \"FILE\";\n\tPropertyType[\"CUSTOM\"] = \"CUSTOM\";\n\tPropertyType[\"COLOR\"] = \"COLOR\";\n\treturn PropertyType;\n}({});\n\n//#endregion\n//#region upstream/framework/lib/property/input/text-property.ts\nconst ShortTextProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.string(), PropertyType.SHORT_TEXT).shape\n});\nconst LongTextProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.string(), PropertyType.LONG_TEXT).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/dropdown/common.ts\nconst DropdownOption = z.object({\n\tlabel: z.string(),\n\tvalue: z.unknown(),\n\tdescription: z.optional(z.string()),\n\ticon: z.optional(z.string())\n});\nconst DropdownState = z.object({\n\tdisabled: z.optional(z.boolean()),\n\tplaceholder: z.optional(z.string()),\n\toptions: z.array(DropdownOption)\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/dropdown/static-dropdown.ts\nconst StaticDropdownDisplay = z.enum([\"cards\"]);\nconst StaticDropdownProperty = z.object({\n\t...BasePropertySchema.shape,\n\toptions: DropdownState,\n\tdisplay: z.optional(StaticDropdownDisplay),\n\t...TPropertyValue(z.unknown(), PropertyType.STATIC_DROPDOWN).shape\n});\nconst StaticMultiSelectDropdownProperty = z.object({\n\t...BasePropertySchema.shape,\n\toptions: DropdownState,\n\t...TPropertyValue(z.array(z.unknown()), PropertyType.STATIC_MULTI_SELECT_DROPDOWN).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/checkbox-property.ts\nconst CheckboxProperty = z.object({\n\t...BasePropertySchema.shape,\n\treveals: z.optional(z.array(z.string())),\n\t...TPropertyValue(z.boolean(), PropertyType.CHECKBOX).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/number-property.ts\nconst NumberProperty = z.object({\n\t...BasePropertySchema.shape,\n\tdisplay: z.optional(z.enum([\"stepper\"])),\n\tmin: z.optional(z.number()),\n\tmax: z.optional(z.number()),\n\tstep: z.optional(z.number()),\n\t...TPropertyValue(z.number(), PropertyType.NUMBER).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/file-property.ts\nvar ApFile = class {\n\tconstructor(filename, data, extension) {\n\t\tthis.filename = filename;\n\t\tthis.data = data;\n\t\tthis.extension = extension;\n\t}\n\tget base64() {\n\t\treturn this.data.toString(\"base64\");\n\t}\n};\nconst FileProperty = z.object({\n\t...BasePropertySchema.shape,\n\tstreaming: z.optional(z.boolean()),\n\t...TPropertyValue(z.unknown(), PropertyType.FILE).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/date-range-property.ts\nconst DateRangePreset = z.enum([\n\t\"any_time\",\n\t\"last_24_hours\",\n\t\"last_7_days\",\n\t\"last_30_days\",\n\t\"last_90_days\",\n\t\"this_month\",\n\t\"custom\"\n]);\nconst DateRangeValue = z.object({\n\tpreset: z.optional(DateRangePreset),\n\tafter: z.optional(z.string()),\n\tbefore: z.optional(z.string())\n});\nconst DateRangeProperty = z.object({\n\t...BasePropertySchema.shape,\n\tdisplay: z.optional(z.enum([\"dropdown\"])),\n\t...TPropertyValue(DateRangeValue, PropertyType.DATE_RANGE).shape\n});\nfunction isoDaysAgo(days) {\n\treturn (/* @__PURE__ */ new Date(Date.now() - days * 24 * 60 * 60 * 1e3)).toISOString();\n}\nfunction startOfThisMonth() {\n\tconst now = /* @__PURE__ */ new Date();\n\treturn new Date(now.getFullYear(), now.getMonth(), 1).toISOString();\n}\nfunction resolve(value) {\n\tif (!value || !value.preset || value.preset === \"any_time\") return {};\n\tswitch (value.preset) {\n\t\tcase \"last_24_hours\": return { after: isoDaysAgo(1) };\n\t\tcase \"last_7_days\": return { after: isoDaysAgo(7) };\n\t\tcase \"last_30_days\": return { after: isoDaysAgo(30) };\n\t\tcase \"last_90_days\": return { after: isoDaysAgo(90) };\n\t\tcase \"this_month\": return { after: startOfThisMonth() };\n\t\tcase \"custom\": return {\n\t\t\tafter: value.after && value.after.length > 0 ? value.after : void 0,\n\t\t\tbefore: value.before && value.before.length > 0 ? value.before : void 0\n\t\t};\n\t\tdefault: return {};\n\t}\n}\nconst dateRangeUtils = { resolve };\n\n//#endregion\n//#region upstream/core-piece-types/lib/markdown.ts\nlet MarkdownVariant = /* @__PURE__ */ function(MarkdownVariant) {\n\tMarkdownVariant[\"BORDERLESS\"] = \"BORDERLESS\";\n\tMarkdownVariant[\"INFO\"] = \"INFO\";\n\tMarkdownVariant[\"WARNING\"] = \"WARNING\";\n\tMarkdownVariant[\"TIP\"] = \"TIP\";\n\treturn MarkdownVariant;\n}({});\n\n//#endregion\n//#region upstream/core-utils/lib/utils.ts\nfunction isString(str) {\n\treturn str != null && typeof str === \"string\";\n}\nfunction isNil(value) {\n\treturn value === null || value === void 0;\n}\nfunction kebabCase(str) {\n\treturn str.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/\\s+/g, \"-\").replace(/_/g, \"-\").toLowerCase().replace(/^-+|-+$/g, \"\");\n}\nfunction isEmpty(value) {\n\tif (value == null) return true;\n\tif (typeof value === \"string\" || Array.isArray(value)) return value.length === 0;\n\tif (typeof value === \"object\") return Object.keys(value).length === 0;\n\treturn false;\n}\nfunction startCase(str) {\n\treturn str.replace(/([a-z])([A-Z])/g, \"$1 $2\").replace(/[_-]+/g, \" \").replace(/\\s+/g, \" \").replace(/^[a-z]/, (match) => match.toUpperCase()).replace(/\\b[a-z]/g, (match) => match.toUpperCase());\n}\nfunction camelCase(str) {\n\treturn str.replace(/([-_][a-z])/g, (group) => group.toUpperCase().replace(\"-\", \"\").replace(\"_\", \"\"));\n}\nfunction parseToJsonIfPossible(str) {\n\ttry {\n\t\treturn JSON.parse(str);\n\t} catch (e) {\n\t\treturn str;\n\t}\n}\nfunction pickBy(object, predicate) {\n\treturn Object.keys(object).reduce((result, key) => {\n\t\tif (predicate(object[key], key)) result[key] = object[key];\n\t\treturn result;\n\t}, {});\n}\nfunction chunk(records, size) {\n\tconst chunks = [];\n\tfor (let i = 0; i < records.length; i += size) chunks.push(records.slice(i, i + size));\n\treturn chunks;\n}\nfunction unique(array) {\n\tconst seen = /* @__PURE__ */ new Set();\n\treturn array.filter((item) => {\n\t\tconst key = JSON.stringify(item);\n\t\tif (seen.has(key)) return false;\n\t\tseen.add(key);\n\t\treturn true;\n\t});\n}\nconst INVALID_BASE64_CHARS = /[^A-Za-z0-9+/=]/;\nfunction isBase64(value, options) {\n\tif (!isString(value) || value.length === 0) return false;\n\tif (options?.allowMime) {\n\t\tconst base64MarkerIndex = value.indexOf(\";base64,\");\n\t\tif (base64MarkerIndex !== -1 && value.startsWith(\"data:\")) return _isValidBase64String(value.slice(base64MarkerIndex + 8));\n\t}\n\treturn _isValidBase64String(value);\n}\nfunction _isValidBase64String(str) {\n\tconst len = str.length;\n\tif (len === 0 || len % 4 !== 0 || INVALID_BASE64_CHARS.test(str)) return false;\n\tconst firstPaddingIndex = str.indexOf(\"=\");\n\treturn firstPaddingIndex === -1 || firstPaddingIndex === len - 1 || firstPaddingIndex === len - 2 && str[len - 1] === \"=\";\n}\n\n//#endregion\n//#region upstream/core-utils/lib/try-catch.ts\nasync function tryCatch(fn) {\n\ttry {\n\t\treturn {\n\t\t\tdata: await fn(),\n\t\t\terror: null\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tdata: null,\n\t\t\terror\n\t\t};\n\t}\n}\nfunction tryCatchSync(fn) {\n\ttry {\n\t\treturn {\n\t\t\tdata: fn(),\n\t\t\terror: null\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tdata: null,\n\t\t\terror\n\t\t};\n\t}\n}\n\n//#endregion\n//#region upstream/framework/lib/property/input/markdown-property.ts\nconst MarkDownProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.void(), PropertyType.MARKDOWN).shape,\n\tvariant: z.optional(z.enum(MarkdownVariant))\n});\n\n//#endregion\nexport { PropertyType as A, CheckboxProperty as C, DropdownState as D, DropdownOption as E, TPropertyValue as M, LongTextProperty as O, NumberProperty as S, StaticMultiSelectDropdownProperty as T, DateRangeProperty as _, chunk as a, ApFile as b, isNil as c, parseToJsonIfPossible as d, pickBy as f, DateRangePreset as g, MarkdownVariant as h, camelCase as i, BasePropertySchema as j, ShortTextProperty as k, isString as l, unique as m, tryCatch as n, isBase64 as o, startCase as p, tryCatchSync as r, isEmpty as s, MarkDownProperty as t, kebabCase as u, DateRangeValue as v, StaticDropdownProperty as w, FileProperty as x, dateRangeUtils as y };\n//# sourceMappingURL=markdown-property-Df2l6_y_.js.map","import { A as PropertyType, C as CheckboxProperty, M as TPropertyValue, O as LongTextProperty, S as NumberProperty, T as StaticMultiSelectDropdownProperty, _ as DateRangeProperty, h as MarkdownVariant, j as BasePropertySchema, k as ShortTextProperty, t as MarkDownProperty, w as StaticDropdownProperty, x as FileProperty } from \"./markdown-property-Df2l6_y_.js\";\nimport * as z from \"zod/mini\";\n\n//#region upstream/framework/lib/action/action.ts\nconst ErrorHandlingOptionsParam = z.object({\n\tretryOnFailure: z.object({\n\t\tdefaultValue: z.optional(z.boolean()),\n\t\thide: z.optional(z.boolean())\n\t}),\n\tcontinueOnFailure: z.object({\n\t\tdefaultValue: z.optional(z.boolean()),\n\t\thide: z.optional(z.boolean())\n\t})\n});\nvar IAction = class {\n\tconstructor(name, displayName, description, props, propertyGroups, run, test, requireAuth, errorHandlingOptions, outputSchema, audience, aiMetadata, classification) {\n\t\tthis.name = name;\n\t\tthis.displayName = displayName;\n\t\tthis.description = description;\n\t\tthis.props = props;\n\t\tthis.propertyGroups = propertyGroups;\n\t\tthis.run = run;\n\t\tthis.test = test;\n\t\tthis.requireAuth = requireAuth;\n\t\tthis.errorHandlingOptions = errorHandlingOptions;\n\t\tthis.outputSchema = outputSchema;\n\t\tthis.audience = audience;\n\t\tthis.aiMetadata = aiMetadata;\n\t\tthis.classification = classification;\n\t}\n};\nconst createAction = (params) => {\n\treturn new IAction(params.name, params.displayName, params.description, params.props, params.propertyGroups, params.run, params.test ?? params.run, params.requireAuth ?? true, params.errorHandlingOptions ?? {\n\t\tcontinueOnFailure: { defaultValue: false },\n\t\tretryOnFailure: { defaultValue: false }\n\t}, params.outputSchema, params.audience, params.aiMetadata, params.classification);\n};\n\n//#endregion\n//#region upstream/framework/lib/property/input/dropdown/dropdown-prop.ts\nconst DropdownProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.unknown(), PropertyType.DROPDOWN).shape,\n\trefreshers: z.array(z.string())\n});\nconst MultiSelectDropdownProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.array(z.unknown()), PropertyType.MULTI_SELECT_DROPDOWN).shape,\n\trefreshers: z.array(z.string())\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/json-property.ts\nconst JsonProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.union([z.record(z.string(), z.unknown())]), PropertyType.JSON).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/color-property.ts\nconst ColorProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.string(), PropertyType.COLOR).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/date-time-property.ts\nconst DateTimeProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.string(), PropertyType.DATE_TIME).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/array-property.ts\nconst ArraySubProps = z.record(z.string(), z.union([\n\tShortTextProperty,\n\tLongTextProperty,\n\tStaticDropdownProperty,\n\tMultiSelectDropdownProperty,\n\tStaticMultiSelectDropdownProperty,\n\tCheckboxProperty,\n\tNumberProperty,\n\tFileProperty,\n\tJsonProperty,\n\tColorProperty,\n\tDateTimeProperty\n]));\nconst ArrayProperty = z.object({\n\t...BasePropertySchema.shape,\n\tproperties: z.optional(ArraySubProps),\n\t...TPropertyValue(z.array(z.unknown()), PropertyType.ARRAY).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/dynamic-prop.ts\nconst DynamicProp = z.union([\n\tShortTextProperty,\n\tStaticDropdownProperty,\n\tJsonProperty,\n\tArrayProperty,\n\tStaticMultiSelectDropdownProperty\n]);\nconst DynamicPropsValue = z.record(z.string(), DynamicProp);\nconst DynamicProperties = z.object({\n\trefreshers: z.array(z.string()),\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.unknown(), PropertyType.DYNAMIC).shape\n});\n\n//#endregion\n//#region upstream/core-utils/lib/assertions.ts\nfunction assertNotNullOrUndefined(value, fieldName) {\n\tif (value === null || value === void 0) throw new Error(`${fieldName} is null or undefined`);\n}\nconst isNotUndefined = (value) => {\n\treturn value !== void 0;\n};\n\n//#endregion\n//#region upstream/framework/lib/property/input/object-property.ts\nconst ObjectProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.record(z.string(), z.unknown()), PropertyType.OBJECT).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/rich-text-property.ts\nconst RichTextProperty = z.object({\n\t...BasePropertySchema.shape,\n\tformatProperty: z.optional(z.string()),\n\t...TPropertyValue(z.string(), PropertyType.RICH_TEXT).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/custom-property.ts\nconst CustomProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.unknown(), PropertyType.CUSTOM).shape,\n\tcode: z.string()\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/index.ts\nconst InputProperty = z.union([\n\tShortTextProperty,\n\tLongTextProperty,\n\tRichTextProperty,\n\tMarkDownProperty,\n\tCheckboxProperty,\n\tStaticDropdownProperty,\n\tStaticMultiSelectDropdownProperty,\n\tDropdownProperty,\n\tMultiSelectDropdownProperty,\n\tDynamicProperties,\n\tNumberProperty,\n\tArrayProperty,\n\tObjectProperty,\n\tJsonProperty,\n\tDateTimeProperty,\n\tDateRangeProperty,\n\tFileProperty,\n\tCustomProperty,\n\tColorProperty\n]);\nconst Property = {\n\tShortText(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.SHORT_TEXT\n\t\t};\n\t},\n\tCheckbox(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.CHECKBOX\n\t\t};\n\t},\n\tLongText(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.LONG_TEXT\n\t\t};\n\t},\n\tRichText(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.RICH_TEXT\n\t\t};\n\t},\n\tMarkDown(request) {\n\t\treturn {\n\t\t\tdisplayName: \"Markdown\",\n\t\t\trequired: false,\n\t\t\tdescription: request.value,\n\t\t\ttype: PropertyType.MARKDOWN,\n\t\t\tvalueSchema: void 0,\n\t\t\tvariant: request.variant ?? MarkdownVariant.INFO\n\t\t};\n\t},\n\tNumber(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.NUMBER\n\t\t};\n\t},\n\tJson(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.JSON\n\t\t};\n\t},\n\tArray(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.ARRAY\n\t\t};\n\t},\n\tObject(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.OBJECT\n\t\t};\n\t},\n\tDropdown(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.DROPDOWN\n\t\t};\n\t},\n\tStaticDropdown(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.STATIC_DROPDOWN\n\t\t};\n\t},\n\tMultiSelectDropdown(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.MULTI_SELECT_DROPDOWN\n\t\t};\n\t},\n\tDynamicProperties(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.DYNAMIC\n\t\t};\n\t},\n\tStaticMultiSelectDropdown(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.STATIC_MULTI_SELECT_DROPDOWN\n\t\t};\n\t},\n\tDateTime(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.DATE_TIME\n\t\t};\n\t},\n\tDateRange(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.DATE_RANGE\n\t\t};\n\t},\n\tFile(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.FILE\n\t\t};\n\t},\n\tCustom(request) {\n\t\tconst code = request.code.toString();\n\t\treturn {\n\t\t\t...request,\n\t\t\tcode,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.CUSTOM\n\t\t};\n\t},\n\tColor(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.COLOR\n\t\t};\n\t}\n};\n\n//#endregion\nexport { ErrorHandlingOptionsParam as _, ObjectProperty as a, DynamicProp as c, ArrayProperty as d, ArraySubProps as f, MultiSelectDropdownProperty as g, DropdownProperty as h, RichTextProperty as i, DynamicProperties as l, JsonProperty as m, Property as n, assertNotNullOrUndefined as o, DateTimeProperty as p, CustomProperty as r, isNotUndefined as s, InputProperty as t, DynamicPropsValue as u, IAction as v, createAction as y };\n//# sourceMappingURL=input-COuhC1I-.js.map","import { A as PropertyType, C as CheckboxProperty, M as TPropertyValue, O as LongTextProperty, S as NumberProperty, T as StaticMultiSelectDropdownProperty, c as isNil, k as ShortTextProperty, t as MarkDownProperty, w as StaticDropdownProperty } from \"./markdown-property-Df2l6_y_.js\";\nimport * as z from \"zod/mini\";\n\n//#region upstream/core-piece-types/lib/app-connection.ts\nlet AppConnectionType = /* @__PURE__ */ function(AppConnectionType) {\n\tAppConnectionType[\"OAUTH2\"] = \"OAUTH2\";\n\tAppConnectionType[\"PLATFORM_OAUTH2\"] = \"PLATFORM_OAUTH2\";\n\tAppConnectionType[\"CLOUD_OAUTH2\"] = \"CLOUD_OAUTH2\";\n\tAppConnectionType[\"SECRET_TEXT\"] = \"SECRET_TEXT\";\n\tAppConnectionType[\"BASIC_AUTH\"] = \"BASIC_AUTH\";\n\tAppConnectionType[\"CUSTOM_AUTH\"] = \"CUSTOM_AUTH\";\n\tAppConnectionType[\"OIDC\"] = \"OIDC\";\n\tAppConnectionType[\"NO_AUTH\"] = \"NO_AUTH\";\n\treturn AppConnectionType;\n}({});\nlet OAuth2GrantType = /* @__PURE__ */ function(OAuth2GrantType) {\n\tOAuth2GrantType[\"AUTHORIZATION_CODE\"] = \"authorization_code\";\n\tOAuth2GrantType[\"CLIENT_CREDENTIALS\"] = \"client_credentials\";\n\treturn OAuth2GrantType;\n}({});\nconst BOTH_CLIENT_CREDENTIALS_AND_AUTHORIZATION_CODE = \"both_client_credentials_and_authorization_code\";\n\n//#endregion\n//#region upstream/core-piece-types/lib/trigger.ts\nlet TriggerStrategy = /* @__PURE__ */ function(TriggerStrategy) {\n\tTriggerStrategy[\"POLLING\"] = \"POLLING\";\n\tTriggerStrategy[\"WEBHOOK\"] = \"WEBHOOK\";\n\tTriggerStrategy[\"APP_WEBHOOK\"] = \"APP_WEBHOOK\";\n\tTriggerStrategy[\"MANUAL\"] = \"MANUAL\";\n\treturn TriggerStrategy;\n}({});\nlet WebhookHandshakeStrategy = /* @__PURE__ */ function(WebhookHandshakeStrategy) {\n\tWebhookHandshakeStrategy[\"NONE\"] = \"NONE\";\n\tWebhookHandshakeStrategy[\"HEADER_PRESENT\"] = \"HEADER_PRESENT\";\n\tWebhookHandshakeStrategy[\"QUERY_PRESENT\"] = \"QUERY_PRESENT\";\n\tWebhookHandshakeStrategy[\"BODY_PARAM_PRESENT\"] = \"BODY_PARAM_PRESENT\";\n\tWebhookHandshakeStrategy[\"HEAD_REQUEST\"] = \"HEAD_REQUEST\";\n\treturn WebhookHandshakeStrategy;\n}({});\nconst WebhookHandshakeConfiguration = z.object({\n\tstrategy: z.enum(WebhookHandshakeStrategy),\n\tparamName: z.optional(z.string())\n});\nlet TriggerTestStrategy = /* @__PURE__ */ function(TriggerTestStrategy) {\n\tTriggerTestStrategy[\"SIMULATION\"] = \"SIMULATION\";\n\tTriggerTestStrategy[\"TEST_FUNCTION\"] = \"TEST_FUNCTION\";\n\treturn TriggerTestStrategy;\n}({});\nconst AUTHENTICATION_PROPERTY_NAME = \"auth\";\n\n//#endregion\n//#region upstream/core-utils/lib/object-utils.ts\nconst spreadIfDefined = (key, value) => {\n\tif (isNil(value)) return {};\n\treturn { [key]: value };\n};\nconst isObject = (obj) => {\n\treturn typeof obj === \"object\" && obj !== null && !Array.isArray(obj);\n};\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/common.ts\nconst BasePieceAuthSchema = z.object({\n\tdisplayName: z.string(),\n\tdescription: z.optional(z.string()),\n\thasConnectionIdentifier: z.optional(z.boolean())\n});\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/basic-auth-prop.ts\nconst BasicAuthPropertyValue = z.object({\n\tusername: z.string(),\n\tpassword: z.string()\n});\nconst BasicAuthProperty = z.object({\n\t...BasePieceAuthSchema.shape,\n\tusername: z.object({\n\t\tdisplayName: z.string(),\n\t\tdescription: z.optional(z.string())\n\t}),\n\tpassword: z.object({\n\t\tdisplayName: z.string(),\n\t\tdescription: z.optional(z.string())\n\t}),\n\t...TPropertyValue(BasicAuthPropertyValue, PropertyType.BASIC_AUTH).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/secret-text-property.ts\nconst SecretTextProperty = z.object({\n\t...BasePieceAuthSchema.shape,\n\t...TPropertyValue(z.object({ auth: z.string() }), PropertyType.SECRET_TEXT).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/custom-auth-prop.ts\nconst CustomAuthProps = z.record(z.string(), z.union([\n\tShortTextProperty,\n\tLongTextProperty,\n\tSecretTextProperty,\n\tNumberProperty,\n\tStaticDropdownProperty,\n\tCheckboxProperty,\n\tMarkDownProperty,\n\tStaticMultiSelectDropdownProperty\n]));\nconst CustomAuthProperty = z.object({\n\t...BasePieceAuthSchema.shape,\n\tprops: CustomAuthProps,\n\t...TPropertyValue(z.unknown(), PropertyType.CUSTOM_AUTH).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/oidc-prop.ts\nconst OIDCAuthProps = z.record(z.string(), z.union([\n\tShortTextProperty,\n\tLongTextProperty,\n\tSecretTextProperty,\n\tNumberProperty,\n\tCheckboxProperty,\n\tStaticDropdownProperty,\n\tStaticMultiSelectDropdownProperty,\n\tMarkDownProperty\n]));\nconst OIDCProperty = z.object({\n\t...BasePieceAuthSchema.shape,\n\tprops: OIDCAuthProps,\n\t...TPropertyValue(z.unknown(), PropertyType.OIDC).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/oauth2-prop.ts\nlet OAuth2AuthorizationMethod = /* @__PURE__ */ function(OAuth2AuthorizationMethod) {\n\tOAuth2AuthorizationMethod[\"HEADER\"] = \"HEADER\";\n\tOAuth2AuthorizationMethod[\"BODY\"] = \"BODY\";\n\treturn OAuth2AuthorizationMethod;\n}({});\nconst OAuthProp = z.union([\n\tShortTextProperty,\n\tSecretTextProperty,\n\tStaticDropdownProperty\n]);\nconst OAuth2Props = z.record(z.string(), OAuthProp);\nconst OAuth2ExtraProps = z.object({\n\tprops: z.optional(z.record(z.string(), OAuthProp)),\n\tauthUrl: z.string(),\n\ttokenUrl: z.string(),\n\tscope: z.array(z.string()),\n\tprompt: z.optional(z.union([\n\t\tz.literal(\"none\"),\n\t\tz.literal(\"consent\"),\n\t\tz.literal(\"login\"),\n\t\tz.literal(\"omit\")\n\t])),\n\tpkce: z.optional(z.boolean()),\n\tpkceMethod: z.optional(z.union([z.literal(\"plain\"), z.literal(\"S256\")])),\n\tauthorizationMethod: z.optional(z.enum(OAuth2AuthorizationMethod)),\n\tgrantType: z.optional(z.union([z.enum(OAuth2GrantType), z.literal(BOTH_CLIENT_CREDENTIALS_AND_AUTHORIZATION_CODE)])),\n\textra: z.optional(z.record(z.string(), z.string()))\n});\nconst OAuth2PropertyValue = z.object({\n\taccess_token: z.string(),\n\tprops: z.optional(OAuth2Props),\n\tdata: z.record(z.string(), z.any())\n});\nconst OAuth2Property = z.object({\n\t...BasePieceAuthSchema.shape,\n\t...OAuth2ExtraProps.shape,\n\t...TPropertyValue(OAuth2PropertyValue, PropertyType.OAUTH2).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/index.ts\nconst PieceAuthProperty = z.union([\n\tBasicAuthProperty,\n\tCustomAuthProperty,\n\tOIDCProperty,\n\tOAuth2Property,\n\tSecretTextProperty\n]);\nconst DEFAULT_CONNECTION_DISPLAY_NAME = \"Connection\";\nconst PieceAuth = {\n\tSecretText(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.SECRET_TEXT\n\t\t};\n\t},\n\tOAuth2(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.OAUTH2,\n\t\t\tdisplayName: request.displayName || \"Connection\"\n\t\t};\n\t},\n\tBasicAuth(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.BASIC_AUTH,\n\t\t\tdisplayName: request.displayName || \"Connection\",\n\t\t\trequired: true\n\t\t};\n\t},\n\tCustomAuth(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.CUSTOM_AUTH,\n\t\t\tdisplayName: request.displayName || \"Connection\"\n\t\t};\n\t},\n\tOIDC(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.OIDC,\n\t\t\tdisplayName: request.displayName || \"Connection\"\n\t\t};\n\t},\n\tNone() {}\n};\nfunction getAuthPropertyForValue({ authValueType, pieceAuth }) {\n\tif (!Array.isArray(pieceAuth) || isNil(pieceAuth)) return pieceAuth;\n\treturn pieceAuth.find((auth) => authConnectionTypeToPropertyType[authValueType] === auth.type) ?? pieceAuth.at(0);\n}\nconst authConnectionTypeToPropertyType = {\n\t[AppConnectionType.OAUTH2]: PropertyType.OAUTH2,\n\t[AppConnectionType.CLOUD_OAUTH2]: PropertyType.OAUTH2,\n\t[AppConnectionType.PLATFORM_OAUTH2]: PropertyType.OAUTH2,\n\t[AppConnectionType.BASIC_AUTH]: PropertyType.BASIC_AUTH,\n\t[AppConnectionType.CUSTOM_AUTH]: PropertyType.CUSTOM_AUTH,\n\t[AppConnectionType.OIDC]: PropertyType.OIDC,\n\t[AppConnectionType.SECRET_TEXT]: PropertyType.SECRET_TEXT,\n\t[AppConnectionType.NO_AUTH]: void 0\n};\n\n//#endregion\nexport { TriggerStrategy as _, OAuth2AuthorizationMethod as a, AppConnectionType as b, OAuth2Props as c, SecretTextProperty as d, BasicAuthProperty as f, AUTHENTICATION_PROPERTY_NAME as g, spreadIfDefined as h, getAuthPropertyForValue as i, OIDCProperty as l, isObject as m, PieceAuth as n, OAuth2Property as o, BasicAuthPropertyValue as p, PieceAuthProperty as r, OAuth2PropertyValue as s, DEFAULT_CONNECTION_DISPLAY_NAME as t, CustomAuthProperty as u, TriggerTestStrategy as v, OAuth2GrantType as x, WebhookHandshakeStrategy as y };\n//# sourceMappingURL=authentication-B7brX_It.js.map","import crypto from 'crypto'\n\nimport { urlAlphabet } from './url-alphabet/index.js'\n\nconst POOL_SIZE_MULTIPLIER = 128\nlet pool, poolOffset\n\nlet fillPool = bytes => {\n if (bytes < 0) throw new RangeError('Wrong ID size')\n try {\n if (!pool || pool.length < bytes) {\n pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)\n crypto.randomFillSync(pool)\n poolOffset = 0\n } else if (poolOffset + bytes > pool.length) {\n crypto.randomFillSync(pool)\n poolOffset = 0\n }\n } catch (e) {\n pool = undefined\n throw e\n }\n poolOffset += bytes\n}\n\nlet random = bytes => {\n fillPool((bytes |= 0))\n return pool.subarray(poolOffset - bytes, poolOffset)\n}\n\nlet customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1\n\n\n let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)\n\n return (size = defaultSize) => {\n if (size <= 0) return ''\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let i = step\n while (i--) {\n id += alphabet[bytes[i] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\n\nlet customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\n\nlet nanoid = (size = 21) => {\n fillPool((size |= 0))\n let id = ''\n for (let i = poolOffset - size; i < poolOffset; i++) {\n id += urlAlphabet[pool[i] & 63]\n }\n return id\n}\n\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","import { _ as ErrorHandlingOptionsParam, a as ObjectProperty, c as DynamicProp, d as ArrayProperty, f as ArraySubProps, g as MultiSelectDropdownProperty, h as DropdownProperty, i as RichTextProperty, l as DynamicProperties, m as JsonProperty, n as Property, o as assertNotNullOrUndefined, p as DateTimeProperty, r as CustomProperty, s as isNotUndefined, t as InputProperty, u as DynamicPropsValue, v as IAction, y as createAction } from \"./input-COuhC1I-.js\";\nimport { A as PropertyType, C as CheckboxProperty, D as DropdownState, E as DropdownOption, O as LongTextProperty, S as NumberProperty, T as StaticMultiSelectDropdownProperty, _ as DateRangeProperty, a as chunk, b as ApFile, c as isNil, f as pickBy, g as DateRangePreset, h as MarkdownVariant, i as camelCase, j as BasePropertySchema, k as ShortTextProperty, l as isString, m as unique, n as tryCatch, p as startCase, s as isEmpty, u as kebabCase, v as DateRangeValue, w as StaticDropdownProperty, x as FileProperty, y as dateRangeUtils } from \"./markdown-property-Df2l6_y_.js\";\nimport { _ as TriggerStrategy, a as OAuth2AuthorizationMethod, b as AppConnectionType, c as OAuth2Props, d as SecretTextProperty, f as BasicAuthProperty, g as AUTHENTICATION_PROPERTY_NAME, h as spreadIfDefined, i as getAuthPropertyForValue, l as OIDCProperty, n as PieceAuth, o as OAuth2Property, p as BasicAuthPropertyValue, r as PieceAuthProperty, s as OAuth2PropertyValue, t as DEFAULT_CONNECTION_DISPLAY_NAME, u as CustomAuthProperty, v as TriggerTestStrategy, x as OAuth2GrantType, y as WebhookHandshakeStrategy } from \"./authentication-B7brX_It.js\";\nimport * as z from \"zod/mini\";\nimport { customAlphabet } from \"nanoid\";\nimport path from \"node:path\";\nimport fs from \"node:fs/promises\";\n\n//#region upstream/core-piece-types/lib/piece.ts\nlet PackageType = /* @__PURE__ */ function(PackageType) {\n\tPackageType[\"ARCHIVE\"] = \"ARCHIVE\";\n\tPackageType[\"REGISTRY\"] = \"REGISTRY\";\n\treturn PackageType;\n}({});\nlet PieceType = /* @__PURE__ */ function(PieceType) {\n\tPieceType[\"CUSTOM\"] = \"CUSTOM\";\n\tPieceType[\"OFFICIAL\"] = \"OFFICIAL\";\n\treturn PieceType;\n}({});\nlet PieceCategory = /* @__PURE__ */ function(PieceCategory) {\n\tPieceCategory[\"ARTIFICIAL_INTELLIGENCE\"] = \"ARTIFICIAL_INTELLIGENCE\";\n\tPieceCategory[\"COMMUNICATION\"] = \"COMMUNICATION\";\n\tPieceCategory[\"COMMERCE\"] = \"COMMERCE\";\n\tPieceCategory[\"CORE\"] = \"CORE\";\n\tPieceCategory[\"UNIVERSAL_AI\"] = \"UNIVERSAL_AI\";\n\tPieceCategory[\"FLOW_CONTROL\"] = \"FLOW_CONTROL\";\n\tPieceCategory[\"BUSINESS_INTELLIGENCE\"] = \"BUSINESS_INTELLIGENCE\";\n\tPieceCategory[\"ACCOUNTING\"] = \"ACCOUNTING\";\n\tPieceCategory[\"PRODUCTIVITY\"] = \"PRODUCTIVITY\";\n\tPieceCategory[\"CONTENT_AND_FILES\"] = \"CONTENT_AND_FILES\";\n\tPieceCategory[\"DEVELOPER_TOOLS\"] = \"DEVELOPER_TOOLS\";\n\tPieceCategory[\"CUSTOMER_SUPPORT\"] = \"CUSTOMER_SUPPORT\";\n\tPieceCategory[\"FORMS_AND_SURVEYS\"] = \"FORMS_AND_SURVEYS\";\n\tPieceCategory[\"HUMAN_RESOURCES\"] = \"HUMAN_RESOURCES\";\n\tPieceCategory[\"PAYMENT_PROCESSING\"] = \"PAYMENT_PROCESSING\";\n\tPieceCategory[\"MARKETING\"] = \"MARKETING\";\n\tPieceCategory[\"SALES_AND_CRM\"] = \"SALES_AND_CRM\";\n\treturn PieceCategory;\n}({});\n\n//#endregion\n//#region upstream/core-piece-types/lib/execution.ts\nlet ExecutionType = /* @__PURE__ */ function(ExecutionType) {\n\tExecutionType[\"BEGIN\"] = \"BEGIN\";\n\tExecutionType[\"RESUME\"] = \"RESUME\";\n\treturn ExecutionType;\n}({});\nlet PauseType = /* @__PURE__ */ function(PauseType) {\n\tPauseType[\"DELAY\"] = \"DELAY\";\n\tPauseType[\"WEBHOOK\"] = \"WEBHOOK\";\n\treturn PauseType;\n}({});\nlet StreamStepProgress = /* @__PURE__ */ function(StreamStepProgress) {\n\tStreamStepProgress[\"WEBSOCKET\"] = \"WEBSOCKET\";\n\tStreamStepProgress[\"NONE\"] = \"NONE\";\n\treturn StreamStepProgress;\n}({});\nconst RespondResponse = z.object({\n\tstatus: z.optional(z.number()),\n\tbody: z.optional(z.unknown()),\n\theaders: z.optional(z.record(z.string(), z.string()))\n});\nconst DelayPauseMetadata = z.object({\n\ttype: z.literal(PauseType.DELAY),\n\tresumeDateTime: z.string(),\n\trequestIdToReply: z.optional(z.string()),\n\thandlerId: z.optional(z.string()),\n\tstreamStepProgress: z.optional(z.enum(StreamStepProgress))\n});\nconst WebhookPauseMetadata = z.object({\n\ttype: z.literal(PauseType.WEBHOOK),\n\trequestId: z.string(),\n\trequestIdToReply: z.optional(z.string()),\n\tresponse: RespondResponse,\n\thandlerId: z.optional(z.string()),\n\tstreamStepProgress: z.optional(z.enum(StreamStepProgress))\n});\nconst PauseMetadata = z.union([DelayPauseMetadata, WebhookPauseMetadata]);\n\n//#endregion\n//#region upstream/core-utils/lib/id-generator.ts\nconst ALPHABET = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\nconst ID_LENGTH = 21;\nconst ApId = z.string().check(z.regex(new RegExp(`^[0-9a-zA-Z]{${ID_LENGTH}}$`)));\nconst apId = customAlphabet(ALPHABET, ID_LENGTH);\n\n//#endregion\n//#region upstream/core-utils/lib/base-model.ts\nconst DateOrString = z.pipe(z.transform((val) => val instanceof Date ? val.toISOString() : val), z.string());\nconst BaseModelSchema = {\n\tid: z.string(),\n\tcreated: DateOrString,\n\tupdated: DateOrString\n};\nconst Nullable = (schema) => z.optional(z.nullable(schema));\nfunction NullableEnum(enumObj) {\n\treturn z.optional(z.nullable(z.enum(enumObj)));\n}\nconst OptionalBooleanFromQuery = z.pipe(z.transform((val) => val === \"true\" || val === true ? true : val === \"false\" || val === false ? false : void 0), z.optional(z.boolean()));\nconst OptionalArrayFromQuery = (schema) => z.pipe(z.transform((val) => Array.isArray(val) ? val : val !== void 0 ? [val] : void 0), z.optional(z.array(schema)));\n\n//#endregion\n//#region upstream/core-utils/lib/seek-page.ts\nconst SeekPage = (t) => z.object({\n\tdata: z.array(t),\n\tnext: Nullable(z.string()),\n\tprevious: Nullable(z.string())\n});\n\n//#endregion\n//#region upstream/core-utils/lib/locale.ts\nlet LocalesEnum = /* @__PURE__ */ function(LocalesEnum) {\n\tLocalesEnum[\"DUTCH\"] = \"nl\";\n\tLocalesEnum[\"ENGLISH\"] = \"en\";\n\tLocalesEnum[\"GERMAN\"] = \"de\";\n\tLocalesEnum[\"FRENCH\"] = \"fr\";\n\tLocalesEnum[\"SPANISH\"] = \"es\";\n\tLocalesEnum[\"JAPANESE\"] = \"ja\";\n\tLocalesEnum[\"CHINESE_SIMPLIFIED\"] = \"zh\";\n\tLocalesEnum[\"PORTUGUESE\"] = \"pt\";\n\tLocalesEnum[\"ARABIC\"] = \"ar\";\n\tLocalesEnum[\"CHINESE_TRADITIONAL\"] = \"zh-TW\";\n\treturn LocalesEnum;\n}({});\n\n//#endregion\n//#region upstream/core-utils/lib/permission.ts\nlet AIProviderName = /* @__PURE__ */ function(AIProviderName) {\n\tAIProviderName[\"OPENAI\"] = \"openai\";\n\tAIProviderName[\"OPENROUTER\"] = \"openrouter\";\n\tAIProviderName[\"ANTHROPIC\"] = \"anthropic\";\n\tAIProviderName[\"AZURE\"] = \"azure\";\n\tAIProviderName[\"GOOGLE\"] = \"google\";\n\tAIProviderName[\"ACTIVEPIECES\"] = \"activepieces\";\n\tAIProviderName[\"CLOUDFLARE_GATEWAY\"] = \"cloudflare-gateway\";\n\tAIProviderName[\"CUSTOM\"] = \"custom\";\n\tAIProviderName[\"BEDROCK\"] = \"bedrock\";\n\tAIProviderName[\"VERTEX\"] = \"vertex\";\n\tAIProviderName[\"MISTRAL\"] = \"mistral\";\n\tAIProviderName[\"XAI\"] = \"xai\";\n\tAIProviderName[\"DEEPSEEK\"] = \"deepseek\";\n\tAIProviderName[\"ZAI\"] = \"zai\";\n\tAIProviderName[\"QWEN\"] = \"qwen\";\n\tAIProviderName[\"MINIMAX\"] = \"minimax\";\n\tAIProviderName[\"MOONSHOT\"] = \"moonshot\";\n\treturn AIProviderName;\n}({});\n\n//#endregion\n//#region upstream/core-piece-types/lib/agents.ts\nconst TASK_COMPLETION_TOOL_NAME = \"updateTaskStatus\";\nlet AgentToolType = /* @__PURE__ */ function(AgentToolType) {\n\tAgentToolType[\"PIECE\"] = \"PIECE\";\n\tAgentToolType[\"FLOW\"] = \"FLOW\";\n\tAgentToolType[\"MCP\"] = \"MCP\";\n\tAgentToolType[\"KNOWLEDGE_BASE\"] = \"KNOWLEDGE_BASE\";\n\treturn AgentToolType;\n}({});\nlet FieldControlMode = /* @__PURE__ */ function(FieldControlMode) {\n\tFieldControlMode[\"AGENT_DECIDE\"] = \"agent-decide\";\n\tFieldControlMode[\"CHOOSE_YOURSELF\"] = \"choose-yourself\";\n\tFieldControlMode[\"LEAVE_EMPTY\"] = \"leave-empty\";\n\treturn FieldControlMode;\n}({});\nlet KnowledgeBaseSourceType = /* @__PURE__ */ function(KnowledgeBaseSourceType) {\n\tKnowledgeBaseSourceType[\"FILE\"] = \"FILE\";\n\tKnowledgeBaseSourceType[\"TABLE\"] = \"TABLE\";\n\treturn KnowledgeBaseSourceType;\n}({});\nlet McpProtocol = /* @__PURE__ */ function(McpProtocol) {\n\tMcpProtocol[\"SSE\"] = \"sse\";\n\tMcpProtocol[\"STREAMABLE_HTTP\"] = \"streamable-http\";\n\tMcpProtocol[\"SIMPLE_HTTP\"] = \"http\";\n\treturn McpProtocol;\n}({});\nlet McpAuthType = /* @__PURE__ */ function(McpAuthType) {\n\tMcpAuthType[\"NONE\"] = \"none\";\n\tMcpAuthType[\"ACCESS_TOKEN\"] = \"access_token\";\n\tMcpAuthType[\"API_KEY\"] = \"api_key\";\n\tMcpAuthType[\"HEADERS\"] = \"headers\";\n\treturn McpAuthType;\n}({});\nlet AgentOutputFieldType = /* @__PURE__ */ function(AgentOutputFieldType) {\n\tAgentOutputFieldType[\"TEXT\"] = \"text\";\n\tAgentOutputFieldType[\"NUMBER\"] = \"number\";\n\tAgentOutputFieldType[\"BOOLEAN\"] = \"boolean\";\n\treturn AgentOutputFieldType;\n}({});\nlet AgentTaskStatus = /* @__PURE__ */ function(AgentTaskStatus) {\n\tAgentTaskStatus[\"COMPLETED\"] = \"COMPLETED\";\n\tAgentTaskStatus[\"FAILED\"] = \"FAILED\";\n\tAgentTaskStatus[\"IN_PROGRESS\"] = \"IN_PROGRESS\";\n\treturn AgentTaskStatus;\n}({});\nlet ContentBlockType = /* @__PURE__ */ function(ContentBlockType) {\n\tContentBlockType[\"MARKDOWN\"] = \"MARKDOWN\";\n\tContentBlockType[\"TOOL_CALL\"] = \"TOOL_CALL\";\n\treturn ContentBlockType;\n}({});\nlet ToolCallStatus = /* @__PURE__ */ function(ToolCallStatus) {\n\tToolCallStatus[\"IN_PROGRESS\"] = \"in-progress\";\n\tToolCallStatus[\"COMPLETED\"] = \"completed\";\n\treturn ToolCallStatus;\n}({});\nlet ExecutionToolStatus = /* @__PURE__ */ function(ExecutionToolStatus) {\n\tExecutionToolStatus[\"SUCCESS\"] = \"SUCCESS\";\n\tExecutionToolStatus[\"FAILED\"] = \"FAILED\";\n\treturn ExecutionToolStatus;\n}({});\nlet ToolCallType = /* @__PURE__ */ function(ToolCallType) {\n\tToolCallType[\"PIECE\"] = \"PIECE\";\n\tToolCallType[\"FLOW\"] = \"FLOW\";\n\tToolCallType[\"MCP\"] = \"MCP\";\n\tToolCallType[\"KNOWLEDGE_BASE\"] = \"KNOWLEDGE_BASE\";\n\tToolCallType[\"UNKNOWN\"] = \"UNKNOWN\";\n\treturn ToolCallType;\n}({});\nlet AgentPieceProps = /* @__PURE__ */ function(AgentPieceProps) {\n\tAgentPieceProps[\"AGENT_ID\"] = \"agentId\";\n\tAgentPieceProps[\"AGENT_TOOLS\"] = \"agentTools\";\n\tAgentPieceProps[\"STRUCTURED_OUTPUT\"] = \"structuredOutput\";\n\tAgentPieceProps[\"PROMPT\"] = \"prompt\";\n\tAgentPieceProps[\"MAX_STEPS\"] = \"maxSteps\";\n\tAgentPieceProps[\"AI_PROVIDER_MODEL\"] = \"aiProviderModel\";\n\tAgentPieceProps[\"WEB_SEARCH\"] = \"webSearch\";\n\tAgentPieceProps[\"WEB_SEARCH_OPTIONS\"] = \"webSearchOptions\";\n\treturn AgentPieceProps;\n}({});\nconst PredefinedInputField = z.object({\n\tmode: z.enum(FieldControlMode),\n\tvalue: z.unknown()\n});\nconst PredefinedInputsStructure = z.object({\n\tauth: z.optional(z.string()),\n\tfields: z.record(z.string(), PredefinedInputField)\n});\nconst AgentPieceToolMetadata = z.object({\n\tpieceName: z.string(),\n\tpieceVersion: z.string(),\n\tactionName: z.string(),\n\tpredefinedInput: z.optional(PredefinedInputsStructure)\n});\nconst AgentPieceTool = z.object({\n\ttype: z.literal(AgentToolType.PIECE),\n\ttoolName: z.string().check(z.minLength(1)),\n\tpieceMetadata: AgentPieceToolMetadata\n});\nconst McpAuthNone = z.object({ type: z.literal(McpAuthType.NONE) });\nconst McpAuthAccessToken = z.object({\n\ttype: z.literal(McpAuthType.ACCESS_TOKEN),\n\taccessToken: z.string()\n});\nconst McpAuthApiKey = z.object({\n\ttype: z.literal(McpAuthType.API_KEY),\n\tapiKey: z.string(),\n\tapiKeyHeader: z.string()\n});\nconst McpAuthHeaders = z.object({\n\ttype: z.literal(McpAuthType.HEADERS),\n\theaders: z.record(z.string(), z.string())\n});\nconst McpAuthConfig = z.discriminatedUnion(\"type\", [\n\tMcpAuthNone,\n\tMcpAuthAccessToken,\n\tMcpAuthApiKey,\n\tMcpAuthHeaders\n]);\nconst AgentFlowTool = z.object({\n\ttype: z.literal(AgentToolType.FLOW),\n\ttoolName: z.string().check(z.minLength(1)),\n\texternalFlowId: z.string(),\n\tflowDisplayName: z.optional(z.string())\n});\nconst AgentMcpTool = z.object({\n\ttype: z.literal(AgentToolType.MCP),\n\ttoolName: z.string().check(z.minLength(1)),\n\tserverUrl: z.url(),\n\tprotocol: z.enum(McpProtocol),\n\tauth: McpAuthConfig\n});\nconst AgentKnowledgeBaseTool = z.object({\n\ttype: z.literal(AgentToolType.KNOWLEDGE_BASE),\n\ttoolName: z.string().check(z.minLength(1)),\n\tsourceType: z.enum(KnowledgeBaseSourceType),\n\tsourceId: z.string(),\n\tsourceName: z.string()\n});\nconst AgentTool = z.discriminatedUnion(\"type\", [\n\tAgentPieceTool,\n\tAgentFlowTool,\n\tAgentMcpTool,\n\tAgentKnowledgeBaseTool\n]);\nconst AgentOutputField = z.object({\n\tdisplayName: z.string(),\n\tdescription: z.optional(z.string()),\n\ttype: z.enum(AgentOutputFieldType)\n});\nconst MarkdownContentBlock = z.object({\n\ttype: z.literal(ContentBlockType.MARKDOWN),\n\tmarkdown: z.string()\n});\nconst toolCallBaseShape = {\n\ttype: z.literal(ContentBlockType.TOOL_CALL),\n\tinput: Nullable(z.record(z.string(), z.unknown())),\n\toutput: z.optional(z.unknown()),\n\ttoolName: z.string(),\n\tstatus: z.enum(ToolCallStatus),\n\ttoolCallId: z.string(),\n\tstartTime: z.string(),\n\tendTime: z.optional(z.string())\n};\nz.object(toolCallBaseShape);\nconst ToolCallContentBlock = z.discriminatedUnion(\"toolCallType\", [\n\tz.object({\n\t\t...toolCallBaseShape,\n\t\ttoolCallType: z.literal(ToolCallType.PIECE),\n\t\tpieceName: z.string(),\n\t\tpieceVersion: z.string(),\n\t\tactionName: z.string()\n\t}),\n\tz.object({\n\t\t...toolCallBaseShape,\n\t\ttoolCallType: z.literal(ToolCallType.FLOW),\n\t\tdisplayName: z.string(),\n\t\texternalFlowId: z.string()\n\t}),\n\tz.object({\n\t\t...toolCallBaseShape,\n\t\ttoolCallType: z.literal(ToolCallType.MCP),\n\t\tdisplayName: z.string(),\n\t\tserverUrl: z.string()\n\t}),\n\tz.object({\n\t\t...toolCallBaseShape,\n\t\ttoolCallType: z.literal(ToolCallType.KNOWLEDGE_BASE),\n\t\tdisplayName: z.string(),\n\t\tsourceType: z.string()\n\t}),\n\tz.object({\n\t\t...toolCallBaseShape,\n\t\ttoolCallType: z.literal(ToolCallType.UNKNOWN),\n\t\tdisplayName: z.string()\n\t})\n]);\nconst AgentStepBlock = z.union([MarkdownContentBlock, ToolCallContentBlock]);\nfunction buildAuthHeaders(authConfig) {\n\tlet headers = {};\n\tswitch (authConfig.type) {\n\t\tcase McpAuthType.NONE: break;\n\t\tcase McpAuthType.HEADERS:\n\t\t\theaders = authConfig.headers;\n\t\t\tbreak;\n\t\tcase McpAuthType.ACCESS_TOKEN:\n\t\t\theaders[\"Authorization\"] = `Bearer ${authConfig.accessToken}`;\n\t\t\tbreak;\n\t\tcase McpAuthType.API_KEY: {\n\t\t\tconst headerName = authConfig.apiKeyHeader;\n\t\t\theaders[headerName] = authConfig.apiKey;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn headers;\n}\nfunction shortHash(str) {\n\tlet h = 5381;\n\tfor (let i = 0; i < str.length; i++) h = (Math.imul(h, 33) ^ str.charCodeAt(i)) >>> 0;\n\treturn h.toString(36).padStart(6, \"0\").slice(-6);\n}\nfunction sanitizeToolName(name) {\n\treturn name.toLowerCase().replace(/[^a-z0-9_-]/g, \"_\").replace(/_+/g, \"_\").replace(/^_+|_+$/g, \"\");\n}\nfunction createToolName(name) {\n\tconst sanitized = sanitizeToolName(name);\n\treturn `${sanitized.slice(0, MAX_PREFIX_LENGTH)}_${shortHash(sanitized.length > 0 ? sanitized : name)}_mcp`;\n}\nfunction toValidToolName(name) {\n\tif (PROVIDER_TOOL_NAME_PATTERN.test(name)) return name;\n\tconst generated = createToolName(name);\n\treturn PROVIDER_TOOL_NAME_PATTERN.test(generated) ? generated : createToolName(`tool_${name}`);\n}\nfunction suggestToolName(sourceName) {\n\treturn toValidToolName(sanitizeToolName(sourceName));\n}\nfunction isProviderSafeIdentifier(name) {\n\treturn PROVIDER_TOOL_NAME_PATTERN.test(name);\n}\nfunction toProviderSafeIdentifier({ name, fallback }) {\n\tif (isProviderSafeIdentifier(name)) return name;\n\tconst sanitized = sanitizeToolName(name).slice(0, MAX_IDENTIFIER_LENGTH);\n\tif (sanitized.length === 0) return fallback;\n\tconst seeded = /^[a-z_]/.test(sanitized) ? sanitized : `_${sanitized}`;\n\treturn isProviderSafeIdentifier(seeded) ? seeded : fallback;\n}\nfunction createPieceToolName(pieceName, actionName) {\n\tconst idx = pieceName.indexOf(\"piece-\");\n\treturn createToolName(`${idx >= 0 ? pieceName.substring(idx + 6) : pieceName}-${actionName}`);\n}\nconst MAX_PREFIX_LENGTH = 53;\nconst MAX_IDENTIFIER_LENGTH = 64;\nconst PROVIDER_TOOL_NAME_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_-]{0,63}$/;\nconst mcpToolNameUtils = {\n\tcreateToolName,\n\tcreatePieceToolName,\n\ttoValidToolName,\n\tsuggestToolName,\n\tisProviderSafeIdentifier,\n\ttoProviderSafeIdentifier\n};\nconst AGENT_STEP_TIMEOUT_MS = 10800 * 1e3;\nconst AGENT_STEP_TEST_TIMEOUT_MS = 900 * 1e3;\n\n//#endregion\n//#region upstream/core-piece-types/lib/ai-providers.ts\nlet AIProviderModelType = /* @__PURE__ */ function(AIProviderModelType) {\n\tAIProviderModelType[\"IMAGE\"] = \"image\";\n\tAIProviderModelType[\"TEXT\"] = \"text\";\n\treturn AIProviderModelType;\n}({});\nconst BaseAIProviderAuthConfig = z.object({ apiKey: z.string() });\nconst AnthropicProviderAuthConfig = BaseAIProviderAuthConfig;\nconst ActivePiecesProviderAuthConfig = z.object({\n\tapiKey: z.string(),\n\tapiKeyHash: z.string()\n});\nconst OpenAICompatibleProviderAuthConfig = BaseAIProviderAuthConfig;\nconst CloudflareGatewayProviderAuthConfig = BaseAIProviderAuthConfig;\nconst AzureProviderAuthConfig = BaseAIProviderAuthConfig;\nconst GoogleProviderAuthConfig = BaseAIProviderAuthConfig;\nconst OpenAIProviderAuthConfig = BaseAIProviderAuthConfig;\nconst OpenRouterProviderAuthConfig = BaseAIProviderAuthConfig;\nconst MistralProviderAuthConfig = BaseAIProviderAuthConfig;\nconst VertexProviderAuthConfig = z.object({ serviceAccountJson: z.string().check(z.minLength(1)) });\nconst BedrockProviderAuthConfig = z.object({\n\taccessKeyId: z.string().check(z.minLength(1)),\n\tsecretAccessKey: z.string().check(z.minLength(1))\n});\nconst AnthropicProviderConfig = z.object({});\nconst ActivePiecesProviderConfig = z.object({});\nconst GoogleProviderConfig = z.object({});\nconst OpenAIProviderConfig = z.object({});\nconst OpenRouterProviderConfig = z.object({});\nconst MistralProviderConfig = z.object({});\nconst ProviderModelConfig = z.object({\n\tmodelId: z.string(),\n\tmodelName: z.string(),\n\tmodelType: z.enum(AIProviderModelType)\n});\nconst OpenAICompatibleProviderConfig = z.object({\n\tapiKeyHeader: z.string(),\n\tbaseUrl: z.string(),\n\tmodels: z.array(ProviderModelConfig),\n\tdefaultHeaders: z.optional(z.record(z.string(), z.string())),\n\tapiStyle: z.optional(z.enum([\"chat\", \"responses\"]))\n});\nconst CloudflareGatewayProviderConfig = z.object({\n\taccountId: z.string(),\n\tgatewayId: z.string(),\n\tmodels: z.array(ProviderModelConfig),\n\tvertexProject: z.optional(z.string()),\n\tvertexRegion: z.optional(z.string())\n});\nconst AzureProviderConfig = z.object({\n\tresourceName: z.string(),\n\tapiVersion: z.pipe(z.transform((v) => typeof v === \"string\" && v.trim().length === 0 ? void 0 : v), z.optional(z.string()))\n});\nconst BedrockProviderConfig = z.object({ region: z.string().check(z.minLength(1)) });\nconst VertexProviderConfig = z.object({\n\tproject: z.string().check(z.regex(/^[a-z0-9][a-z0-9-]{0,62}$/)),\n\tregion: z.string().check(z.regex(/^[a-z0-9][a-z0-9-]{0,62}$/)),\n\tmodels: z.array(ProviderModelConfig)\n});\nconst OpenAiCompatibleVendorConfig = z.object({});\nconst AIProviderAuthConfig = z.union([\n\tAnthropicProviderAuthConfig,\n\tAzureProviderAuthConfig,\n\tGoogleProviderAuthConfig,\n\tOpenAIProviderAuthConfig,\n\tOpenRouterProviderAuthConfig,\n\tCloudflareGatewayProviderAuthConfig,\n\tOpenAICompatibleProviderAuthConfig,\n\tActivePiecesProviderAuthConfig,\n\tBedrockProviderAuthConfig,\n\tVertexProviderAuthConfig,\n\tMistralProviderAuthConfig\n]);\nconst AIProviderConfig = z.union([\n\tOpenAICompatibleProviderConfig,\n\tCloudflareGatewayProviderConfig,\n\tAzureProviderConfig,\n\tVertexProviderConfig,\n\tBedrockProviderConfig,\n\tAnthropicProviderConfig,\n\tGoogleProviderConfig,\n\tOpenAIProviderConfig,\n\tOpenRouterProviderConfig,\n\tActivePiecesProviderConfig,\n\tMistralProviderConfig,\n\tOpenAiCompatibleVendorConfig\n]);\nconst AIProviderModel = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\ttype: z.enum(AIProviderModelType)\n});\nconst AIProviderWithoutSensitiveData = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tprovider: z.enum(AIProviderName),\n\tconfig: AIProviderConfig,\n\tenabledForChat: z.boolean()\n});\nconst ProjectAIProvider = z.object({\n\tprovider: z.enum(AIProviderName),\n\tname: z.string(),\n\tenabledForChat: z.boolean(),\n\tkeys: z.array(z.object({\n\t\tid: z.string(),\n\t\tname: z.string()\n\t}))\n});\nconst GetProviderConfigResponse = z.object({\n\tprovider: z.enum(AIProviderName),\n\tconfigId: z.string(),\n\tconfig: AIProviderConfig,\n\tauth: AIProviderAuthConfig,\n\tplatformId: z.string()\n});\nfunction splitCloudflareGatewayModelId(modelId) {\n\tconst slashIndex = modelId.indexOf(\"/\");\n\tif (slashIndex === -1) return {\n\t\tprovider: void 0,\n\t\tmodel: modelId,\n\t\tpublisher: void 0\n\t};\n\tconst provider = modelId.substring(0, slashIndex).trim().toLowerCase();\n\tconst rest = modelId.substring(slashIndex + 1);\n\tif (provider === \"google-vertex-ai\") {\n\t\tconst secondSlashIndex = rest.indexOf(\"/\");\n\t\tif (secondSlashIndex === -1) return {\n\t\t\tprovider: void 0,\n\t\t\tmodel: modelId,\n\t\t\tpublisher: void 0\n\t\t};\n\t\treturn {\n\t\t\tprovider: \"google-vertex-ai\",\n\t\t\tpublisher: rest.substring(0, secondSlashIndex),\n\t\t\tmodel: rest.substring(secondSlashIndex + 1)\n\t\t};\n\t}\n\treturn {\n\t\tprovider,\n\t\tmodel: rest,\n\t\tpublisher: void 0\n\t};\n}\nfunction getEffectiveProviderAndModel({ provider, model }) {\n\tif (provider !== AIProviderName.CLOUDFLARE_GATEWAY || !model) return {\n\t\tprovider,\n\t\tmodel\n\t};\n\tconst split = splitCloudflareGatewayModelId(model);\n\tconst mapped = CF_GATEWAY_SUBMODEL_TO_PROVIDER[(split.provider ?? \"\").trim().toLowerCase()];\n\tif (!mapped) return {\n\t\tprovider,\n\t\tmodel\n\t};\n\treturn {\n\t\tprovider: mapped,\n\t\tmodel: split.model\n\t};\n}\nconst CF_GATEWAY_SUBMODEL_TO_PROVIDER = {\n\topenai: AIProviderName.OPENAI,\n\tanthropic: AIProviderName.ANTHROPIC,\n\t\"google-ai-studio\": AIProviderName.GOOGLE,\n\t\"google-vertex-ai\": AIProviderName.GOOGLE\n};\nconst OPENAI_CHAT_MODELS = [\n\t\"gpt-5.5\",\n\t\"gpt-5.4-mini\",\n\t\"gpt-5.4-nano\",\n\t\"gpt-4.1\",\n\t\"gpt-4.1-mini\"\n];\nconst ANTHROPIC_CHAT_MODELS = [\n\t\"claude-sonnet-4-6\",\n\t\"claude-opus-4-7\",\n\t\"claude-haiku-4-5\"\n];\nconst ANTHROPIC_OPENROUTER_CHAT_MODELS = [\n\t\"claude-sonnet-4.6\",\n\t\"claude-opus-4.7\",\n\t\"claude-opus-4.8\",\n\t\"claude-haiku-4.5\"\n];\nconst GOOGLE_CHAT_MODELS = [\n\t\"gemini-2.5-pro\",\n\t\"gemini-2.5-flash\",\n\t\"gemini-3.7-flash\",\n\t\"gemini-3.1-pro-preview\",\n\t\"gemini-3-flash-preview\"\n];\nconst X_AI_OPENROUTER_CHAT_MODELS = [\"grok-4.20\"];\nconst REASONING_OPTIONAL_CHAT_MODELS = ANTHROPIC_OPENROUTER_CHAT_MODELS.map((model) => `${AIProviderName.ANTHROPIC}/${model}`);\nconst ALLOWED_CHAT_MODELS_BY_PROVIDER = {\n\t[AIProviderName.OPENAI]: OPENAI_CHAT_MODELS,\n\t[AIProviderName.ANTHROPIC]: ANTHROPIC_CHAT_MODELS,\n\t[AIProviderName.GOOGLE]: GOOGLE_CHAT_MODELS,\n\t[AIProviderName.VERTEX]: GOOGLE_CHAT_MODELS,\n\t[AIProviderName.ACTIVEPIECES]: [\n\t\t...ANTHROPIC_OPENROUTER_CHAT_MODELS.map((m) => `${AIProviderName.ANTHROPIC}/${m}`),\n\t\t...OPENAI_CHAT_MODELS.map((m) => `${AIProviderName.OPENAI}/${m}`),\n\t\t...GOOGLE_CHAT_MODELS.map((m) => `${AIProviderName.GOOGLE}/${m}`),\n\t\t...X_AI_OPENROUTER_CHAT_MODELS.map((m) => `x-ai/${m}`)\n\t]\n};\nconst DEFAULT_MAX_CONTEXT_TOKENS = 128e3;\nconst PROVIDER_MAX_CONTEXT_TOKENS = {\n\t[AIProviderName.OPENAI]: 128e3,\n\t[AIProviderName.ANTHROPIC]: 2e5,\n\t[AIProviderName.GOOGLE]: 1048576,\n\t[AIProviderName.BEDROCK]: 2e5,\n\t[AIProviderName.VERTEX]: 1048576,\n\t[AIProviderName.AZURE]: 128e3,\n\t[AIProviderName.OPENROUTER]: 128e3,\n\t[AIProviderName.ACTIVEPIECES]: 2e5,\n\t[AIProviderName.MISTRAL]: 128e3\n};\nfunction getMaxContextTokens({ provider }) {\n\tif (!provider) return DEFAULT_MAX_CONTEXT_TOKENS;\n\treturn PROVIDER_MAX_CONTEXT_TOKENS[provider] ?? DEFAULT_MAX_CONTEXT_TOKENS;\n}\nconst DEFAULT_EMBEDDING_MODELS = {\n\t[AIProviderName.OPENAI]: \"text-embedding-3-small\",\n\t[AIProviderName.GOOGLE]: \"text-embedding-004\",\n\t[AIProviderName.AZURE]: \"text-embedding-3-small\",\n\t[AIProviderName.ACTIVEPIECES]: \"text-embedding-3-small\",\n\t[AIProviderName.OPENROUTER]: \"openai/text-embedding-3-small\"\n};\nconst WEB_SEARCH_MODE_BY_PROVIDER = {\n\t[AIProviderName.ANTHROPIC]: \"native\",\n\t[AIProviderName.GOOGLE]: \"native\",\n\t[AIProviderName.OPENROUTER]: \"plugin\",\n\t[AIProviderName.ACTIVEPIECES]: \"plugin\"\n};\nconst NO_IMAGE_GENERATION_PROVIDERS = new Set([\n\tAIProviderName.ANTHROPIC,\n\tAIProviderName.MISTRAL,\n\tAIProviderName.XAI,\n\tAIProviderName.DEEPSEEK,\n\tAIProviderName.ZAI,\n\tAIProviderName.QWEN,\n\tAIProviderName.MINIMAX,\n\tAIProviderName.MOONSHOT\n]);\nconst OPENAI_COMPATIBLE_VENDOR_BASE_URLS = {\n\t[AIProviderName.XAI]: \"https://api.x.ai/v1\",\n\t[AIProviderName.DEEPSEEK]: \"https://api.deepseek.com/v1\",\n\t[AIProviderName.ZAI]: \"https://api.z.ai/api/paas/v4\",\n\t[AIProviderName.QWEN]: \"https://dashscope-intl.aliyuncs.com/compatible-mode/v1\",\n\t[AIProviderName.MINIMAX]: \"https://api.minimax.io/v1\",\n\t[AIProviderName.MOONSHOT]: \"https://api.moonshot.ai/v1\"\n};\nfunction buildProviderCapabilities(provider) {\n\treturn {\n\t\tchatModels: ALLOWED_CHAT_MODELS_BY_PROVIDER[provider],\n\t\tmaxContextTokens: getMaxContextTokens({ provider }),\n\t\tdefaultEmbeddingModel: DEFAULT_EMBEDDING_MODELS[provider],\n\t\tsupportsEmbedding: DEFAULT_EMBEDDING_MODELS[provider] !== void 0,\n\t\tsupportsImageGeneration: !NO_IMAGE_GENERATION_PROVIDERS.has(provider),\n\t\twebSearch: WEB_SEARCH_MODE_BY_PROVIDER[provider]\n\t};\n}\nconst ACTIVEPIECES_CHAT_TIERS = [\n\t{\n\t\tid: \"fast\",\n\t\tlabel: \"Fast\",\n\t\tmodelId: \"anthropic/claude-haiku-4.5\",\n\t\tnativeModelId: \"claude-haiku-4-5\",\n\t\tthinkingBudget: 5e3,\n\t\tcreditWeight: 2\n\t},\n\t{\n\t\tid: \"smart\",\n\t\tlabel: \"Expert\",\n\t\tmodelId: \"anthropic/claude-sonnet-4.6\",\n\t\tnativeModelId: \"claude-sonnet-4-6\",\n\t\tthinkingBudget: 1e4,\n\t\tcreditWeight: 10\n\t},\n\t{\n\t\tid: \"premium\",\n\t\tlabel: \"Heavy\",\n\t\tmodelId: \"anthropic/claude-opus-4.8\",\n\t\tnativeModelId: \"claude-opus-4-7\",\n\t\tthinkingBudget: 2e4,\n\t\tcreditWeight: 20\n\t}\n];\nconst DEFAULT_CHAT_TIER_ID = \"smart\";\nconst AI_PROVIDER_CAPABILITIES = {\n\t[AIProviderName.OPENAI]: buildProviderCapabilities(AIProviderName.OPENAI),\n\t[AIProviderName.ANTHROPIC]: buildProviderCapabilities(AIProviderName.ANTHROPIC),\n\t[AIProviderName.OPENROUTER]: buildProviderCapabilities(AIProviderName.OPENROUTER),\n\t[AIProviderName.AZURE]: buildProviderCapabilities(AIProviderName.AZURE),\n\t[AIProviderName.GOOGLE]: buildProviderCapabilities(AIProviderName.GOOGLE),\n\t[AIProviderName.CLOUDFLARE_GATEWAY]: buildProviderCapabilities(AIProviderName.CLOUDFLARE_GATEWAY),\n\t[AIProviderName.CUSTOM]: buildProviderCapabilities(AIProviderName.CUSTOM),\n\t[AIProviderName.BEDROCK]: buildProviderCapabilities(AIProviderName.BEDROCK),\n\t[AIProviderName.VERTEX]: buildProviderCapabilities(AIProviderName.VERTEX),\n\t[AIProviderName.MISTRAL]: buildProviderCapabilities(AIProviderName.MISTRAL),\n\t[AIProviderName.ACTIVEPIECES]: buildProviderCapabilities(AIProviderName.ACTIVEPIECES),\n\t[AIProviderName.XAI]: buildProviderCapabilities(AIProviderName.XAI),\n\t[AIProviderName.DEEPSEEK]: buildProviderCapabilities(AIProviderName.DEEPSEEK),\n\t[AIProviderName.ZAI]: buildProviderCapabilities(AIProviderName.ZAI),\n\t[AIProviderName.QWEN]: buildProviderCapabilities(AIProviderName.QWEN),\n\t[AIProviderName.MINIMAX]: buildProviderCapabilities(AIProviderName.MINIMAX),\n\t[AIProviderName.MOONSHOT]: buildProviderCapabilities(AIProviderName.MOONSHOT)\n};\n\n//#endregion\n//#region upstream/core-piece-types/lib/forms.ts\nconst FileResponseInterfaceV1 = z.object({\n\tbase64Url: z.string(),\n\tfileName: z.string(),\n\textension: z.optional(z.string())\n});\nconst FileResponseInterfaceV2 = z.object({\n\tmimeType: z.string(),\n\turl: z.string(),\n\tfileName: z.optional(z.string())\n});\nconst FileResponseInterface = z.union([FileResponseInterfaceV1, FileResponseInterfaceV2]);\nlet HumanInputFormResultTypes = /* @__PURE__ */ function(HumanInputFormResultTypes) {\n\tHumanInputFormResultTypes[\"FILE\"] = \"file\";\n\tHumanInputFormResultTypes[\"MARKDOWN\"] = \"markdown\";\n\treturn HumanInputFormResultTypes;\n}({});\nfunction createKeyForFormInput(displayName) {\n\t/**We do this because react form inputs must not contain quotes */\n\treturn displayName.toLowerCase().replace(/\\s+(\\w)/g, (_, letter) => letter.toUpperCase()).replace(/^(.)/, (letter) => letter.toLowerCase()).replaceAll(/[\\\\\"''\\n\\r\\t]/g, \"\");\n}\nconst HumanInputFormResult = z.union([z.object({\n\ttype: z.literal(HumanInputFormResultTypes.FILE),\n\tvalue: FileResponseInterface\n}), z.object({\n\ttype: z.literal(HumanInputFormResultTypes.MARKDOWN),\n\tvalue: z.string(),\n\tfiles: z.optional(z.array(FileResponseInterface))\n})]);\nconst ChatFormResponse = z.object({\n\tsessionId: z.string(),\n\tmessage: z.string(),\n\tfiles: z.optional(z.array(z.string()))\n});\n\n//#endregion\n//#region upstream/core-piece-types/lib/tables.ts\nlet FieldType = /* @__PURE__ */ function(FieldType) {\n\tFieldType[\"TEXT\"] = \"TEXT\";\n\tFieldType[\"NUMBER\"] = \"NUMBER\";\n\tFieldType[\"DATE\"] = \"DATE\";\n\tFieldType[\"DATETIME\"] = \"DATETIME\";\n\tFieldType[\"STATIC_DROPDOWN\"] = \"STATIC_DROPDOWN\";\n\treturn FieldType;\n}({});\nlet TableAutomationTrigger = /* @__PURE__ */ function(TableAutomationTrigger) {\n\tTableAutomationTrigger[\"ON_NEW_RECORD\"] = \"ON_NEW_RECORD\";\n\tTableAutomationTrigger[\"ON_UPDATE_RECORD\"] = \"ON_UPDATE_RECORD\";\n\treturn TableAutomationTrigger;\n}({});\nlet TableAutomationStatus = /* @__PURE__ */ function(TableAutomationStatus) {\n\tTableAutomationStatus[\"ENABLED\"] = \"ENABLED\";\n\tTableAutomationStatus[\"DISABLED\"] = \"DISABLED\";\n\treturn TableAutomationStatus;\n}({});\nlet TableWebhookEventType = /* @__PURE__ */ function(TableWebhookEventType) {\n\tTableWebhookEventType[\"RECORD_CREATED\"] = \"RECORD_CREATED\";\n\tTableWebhookEventType[\"RECORD_UPDATED\"] = \"RECORD_UPDATED\";\n\tTableWebhookEventType[\"RECORD_DELETED\"] = \"RECORD_DELETED\";\n\treturn TableWebhookEventType;\n}({});\nlet FilterOperator = /* @__PURE__ */ function(FilterOperator) {\n\tFilterOperator[\"EQ\"] = \"eq\";\n\tFilterOperator[\"NEQ\"] = \"neq\";\n\tFilterOperator[\"GT\"] = \"gt\";\n\tFilterOperator[\"GTE\"] = \"gte\";\n\tFilterOperator[\"LT\"] = \"lt\";\n\tFilterOperator[\"LTE\"] = \"lte\";\n\tFilterOperator[\"CO\"] = \"co\";\n\tFilterOperator[\"EXISTS\"] = \"exists\";\n\tFilterOperator[\"NOT_EXISTS\"] = \"not_exists\";\n\treturn FilterOperator;\n}({});\nconst Field = z.union([z.object({\n\t...BaseModelSchema,\n\tname: z.string(),\n\texternalId: z.string(),\n\ttype: z.literal(FieldType.STATIC_DROPDOWN),\n\ttableId: z.string(),\n\tprojectId: z.string(),\n\tdata: z.object({ options: z.array(z.object({ value: z.string() })) })\n}), z.object({\n\t...BaseModelSchema,\n\tname: z.string(),\n\texternalId: z.string(),\n\ttype: z.union([\n\t\tz.literal(FieldType.TEXT),\n\t\tz.literal(FieldType.NUMBER),\n\t\tz.literal(FieldType.DATE),\n\t\tz.literal(FieldType.DATETIME)\n\t]),\n\ttableId: z.string(),\n\tprojectId: z.string()\n})]);\nconst Table = z.object({\n\t...BaseModelSchema,\n\tname: z.string(),\n\tfolderId: Nullable(z.string()),\n\tprojectId: z.string(),\n\texternalId: z.string(),\n\tstatus: NullableEnum(TableAutomationStatus),\n\ttrigger: NullableEnum(TableAutomationTrigger)\n});\nconst PopulatedRecord = z.object({\n\t...BaseModelSchema,\n\ttableId: z.string(),\n\tprojectId: z.string(),\n\tcells: z.record(z.string(), z.object({\n\t\tupdated: z.string(),\n\t\tcreated: z.string(),\n\t\tvalue: z.unknown(),\n\t\tfieldName: z.string()\n\t}))\n});\nconst CreateTableWebhookRequest = z.object({\n\tevents: z.array(z.enum(TableWebhookEventType)),\n\twebhookUrl: z.string(),\n\tflowId: z.string()\n});\nconst ExportTableResponse = z.object({\n\tfields: z.array(z.object({\n\t\tid: z.string(),\n\t\tname: z.string()\n\t})),\n\trows: z.array(z.record(z.string(), z.string())),\n\tname: z.string()\n});\nconst ListTablesRequest = z.object({\n\tprojectId: z.string(),\n\tlimit: z.optional(z.coerce.number()),\n\tcursor: z.optional(z.string()),\n\tname: z.optional(z.string()),\n\texternalIds: OptionalArrayFromQuery(z.string()),\n\tfolderId: z.optional(z.string()),\n\tfolderIds: OptionalArrayFromQuery(z.string())\n});\nconst CreateRecordsRequest = z.object({\n\trecords: z.array(z.array(z.object({\n\t\tfieldId: z.string(),\n\t\tvalue: coerceToString()\n\t}))),\n\ttableId: z.string()\n});\nconst UpdateRecordRequest = z.object({\n\tcells: z.optional(z.array(z.object({\n\t\tfieldId: z.string(),\n\t\tvalue: coerceToString()\n\t}))),\n\ttableId: z.string(),\n\tagentUpdate: z.optional(z.boolean())\n});\nconst Filter = z.discriminatedUnion(\"operator\", [\n\tvalueFilter(FilterOperator.EQ),\n\tvalueFilter(FilterOperator.NEQ),\n\tvalueFilter(FilterOperator.GT),\n\tvalueFilter(FilterOperator.GTE),\n\tvalueFilter(FilterOperator.LT),\n\tvalueFilter(FilterOperator.LTE),\n\tvalueFilter(FilterOperator.CO),\n\texistenceFilter(FilterOperator.EXISTS),\n\texistenceFilter(FilterOperator.NOT_EXISTS)\n]);\nconst ListRecordsRequest = z.object({\n\ttableId: z.string(),\n\tlimit: z.optional(z.coerce.number()),\n\tcursor: z.optional(z.string()),\n\tfilters: OptionalArrayFromQuery(Filter)\n});\nconst StaticDropdownEmptyOption = {\n\tlabel: \"\",\n\tvalue: \"\"\n};\nfunction coerceToString() {\n\treturn z.pipe(z.transform((v) => v === null || v === void 0 ? v : String(v)), z.nullable(z.string()));\n}\nfunction valueFilter(op) {\n\treturn z.object({\n\t\tfieldId: z.string(),\n\t\toperator: z.literal(op),\n\t\tvalue: z.string()\n\t});\n}\nfunction existenceFilter(op) {\n\treturn z.object({\n\t\tfieldId: z.string(),\n\t\toperator: z.literal(op)\n\t});\n}\n\n//#endregion\n//#region upstream/core-piece-types/lib/flow-contracts.ts\nlet FlowStatus = /* @__PURE__ */ function(FlowStatus) {\n\tFlowStatus[\"ENABLED\"] = \"ENABLED\";\n\tFlowStatus[\"DISABLED\"] = \"DISABLED\";\n\treturn FlowStatus;\n}({});\nlet FlowTriggerType = /* @__PURE__ */ function(FlowTriggerType) {\n\tFlowTriggerType[\"EMPTY\"] = \"EMPTY\";\n\tFlowTriggerType[\"PIECE\"] = \"PIECE_TRIGGER\";\n\treturn FlowTriggerType;\n}({});\nconst StopResponse = z.object({\n\tstatus: z.optional(z.number()),\n\tbody: z.optional(z.unknown()),\n\theaders: z.optional(z.record(z.string(), z.string()))\n});\nconst Project = z.object({\n\t...BaseModelSchema,\n\tdeleted: Nullable(DateOrString),\n\townerId: z.string(),\n\tdisplayName: z.string(),\n\tplatformId: z.string(),\n\texternalId: Nullable(z.string())\n});\nconst USE_DRAFT_QUERY_PARAM_NAME = \"useDraft\";\nconst PARENT_RUN_ID_HEADER = \"ap-parent-run-id\";\nconst FAIL_PARENT_ON_FAILURE_HEADER = \"ap-fail-parent-on-failure\";\nconst RAW_PAYLOAD_HEADER = \"ap-raw-payload\";\n\n//#endregion\n//#region upstream/core-piece-types/lib/mcp-piece.ts\nlet McpPropertyType = /* @__PURE__ */ function(McpPropertyType) {\n\tMcpPropertyType[\"TEXT\"] = \"Text\";\n\tMcpPropertyType[\"BOOLEAN\"] = \"Boolean\";\n\tMcpPropertyType[\"DATE\"] = \"Date\";\n\tMcpPropertyType[\"NUMBER\"] = \"Number\";\n\tMcpPropertyType[\"ARRAY\"] = \"Array\";\n\tMcpPropertyType[\"OBJECT\"] = \"Object\";\n\treturn McpPropertyType;\n}({});\nconst McpProperty = z.object({\n\tname: z.string(),\n\tdescription: z.optional(z.string()),\n\ttype: z.string(),\n\trequired: z.boolean()\n});\nconst McpTrigger = z.object({\n\tpieceName: z.string(),\n\ttriggerName: z.string(),\n\tinput: z.object({\n\t\ttoolName: z.string(),\n\t\ttoolDescription: z.string(),\n\t\tinputSchema: z.array(McpProperty),\n\t\treturnsResponse: z.boolean()\n\t})\n});\n\n//#endregion\n//#region upstream/core-piece-types/lib/engine-tools.ts\nfunction normalizeToolOutputToExecuteResponse(raw) {\n\tif (raw === null || typeof raw !== \"object\") return {\n\t\tstatus: ExecutionToolStatus.FAILED,\n\t\toutput: raw,\n\t\tresolvedInput: {},\n\t\terrorMessage: \"Invalid tool output\"\n\t};\n\tconst o = raw;\n\tif (o[\"status\"] === ExecutionToolStatus.SUCCESS || o[\"status\"] === ExecutionToolStatus.FAILED) return {\n\t\tstatus: o[\"status\"],\n\t\toutput: o[\"output\"],\n\t\tresolvedInput: o[\"resolvedInput\"] ?? {},\n\t\terrorMessage: o[\"errorMessage\"]\n\t};\n\tconst isError = o[\"isError\"] === true;\n\tlet output = o[\"structuredContent\"];\n\tif (output === void 0 && Array.isArray(o[\"content\"])) {\n\t\tconst parts = o[\"content\"].map((c) => c?.text).filter(Boolean);\n\t\toutput = parts.length === 1 ? parts[0] : parts.length ? { text: parts.join(\"\") } : o[\"content\"];\n\t}\n\tif (output === void 0) output = o;\n\treturn {\n\t\tstatus: isError ? ExecutionToolStatus.FAILED : ExecutionToolStatus.SUCCESS,\n\t\toutput,\n\t\tresolvedInput: {},\n\t\terrorMessage: isError ? o[\"content\"]?.[0]?.text ?? o[\"message\"] ?? \"Tool failed\" : void 0\n\t};\n}\n\n//#endregion\n//#region upstream/framework/lib/property/util.ts\nfunction buildSchema(props, auth, requireAuth = true) {\n\tconst entries = Object.entries(props);\n\tconst propsSchema = {};\n\tfor (const [name, property] of entries) {\n\t\tswitch (property.type) {\n\t\t\tcase PropertyType.MARKDOWN:\n\t\t\t\tpropsSchema[name] = z.optional(z.union([\n\t\t\t\t\tz.null(),\n\t\t\t\t\tz.undefined(),\n\t\t\t\t\tz.never(),\n\t\t\t\t\tz.unknown()\n\t\t\t\t]));\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.DATE_TIME:\n\t\t\tcase PropertyType.SHORT_TEXT:\n\t\t\tcase PropertyType.LONG_TEXT:\n\t\t\tcase PropertyType.RICH_TEXT:\n\t\t\tcase PropertyType.COLOR:\n\t\t\tcase PropertyType.FILE:\n\t\t\t\tpropsSchema[name] = property.required ? z.string().check(z.minLength(1)) : z.string();\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.CHECKBOX:\n\t\t\t\tpropsSchema[name] = z.union([z.boolean(), z.string()]);\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.NUMBER:\n\t\t\t\tpropsSchema[name] = z.union([property.required ? z.string().check(z.minLength(1)) : z.string(), z.number()]);\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.STATIC_DROPDOWN:\n\t\t\tcase PropertyType.DROPDOWN:\n\t\t\t\tpropsSchema[name] = z.unknown().check(z.refine((val) => val !== null && val !== void 0, { error: \"Value must not be null or undefined\" }));\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.SECRET_TEXT:\n\t\t\t\tpropsSchema[name] = property.required ? z.string().check(z.minLength(1)) : z.string();\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.BASIC_AUTH:\n\t\t\tcase PropertyType.CUSTOM_AUTH:\n\t\t\tcase PropertyType.OAUTH2: break;\n\t\t\tcase PropertyType.ARRAY: {\n\t\t\t\tconst arrayItemSchema = isNil(property.properties) ? property.required ? z.string().check(z.minLength(1)) : z.string() : buildSchema(property.properties, void 0);\n\t\t\t\tpropsSchema[name] = z.union([\n\t\t\t\t\tproperty.required ? z.array(arrayItemSchema).check(z.minLength(1)) : z.array(arrayItemSchema),\n\t\t\t\t\tz.record(z.string(), z.unknown()),\n\t\t\t\t\tproperty.required ? z.string().check(z.minLength(1)) : z.string()\n\t\t\t\t]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase PropertyType.OBJECT:\n\t\t\t\tpropsSchema[name] = z.union([z.record(z.string(), z.any()), property.required ? z.string().check(z.minLength(1)) : z.string()]);\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.DATE_RANGE:\n\t\t\t\tpropsSchema[name] = z.union([z.record(z.string(), z.any()), z.string()]);\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.JSON:\n\t\t\t\tpropsSchema[name] = z.union([\n\t\t\t\t\tz.record(z.string(), z.any()),\n\t\t\t\t\tz.array(z.any()),\n\t\t\t\t\tproperty.required ? z.string().check(z.minLength(1)) : z.string()\n\t\t\t\t]);\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.MULTI_SELECT_DROPDOWN:\n\t\t\tcase PropertyType.STATIC_MULTI_SELECT_DROPDOWN:\n\t\t\t\tpropsSchema[name] = z.union([property.required ? z.array(z.any()).check(z.minLength(1)) : z.array(z.any()), property.required ? z.string().check(z.minLength(1)) : z.string()]);\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.DYNAMIC:\n\t\t\t\tpropsSchema[name] = z.record(z.string(), z.any());\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.CUSTOM:\n\t\t\t\tpropsSchema[name] = z.unknown();\n\t\t\t\tbreak;\n\t\t}\n\t\tif (!property.required && property.type !== PropertyType.ARRAY) propsSchema[name] = z.optional(z.union(isEmpty(propsSchema[name]) ? [\n\t\t\tz.any(),\n\t\t\tz.null(),\n\t\t\tz.undefined()\n\t\t] : [\n\t\t\tpropsSchema[name],\n\t\t\tz.null(),\n\t\t\tz.undefined()\n\t\t]));\n\t}\n\tif (auth && requireAuth) propsSchema[AUTHENTICATION_PROPERTY_NAME] = z.string().check(z.minLength(1));\n\treturn z.object(propsSchema);\n}\nconst piecePropertiesUtils = { buildSchema };\n\n//#endregion\n//#region upstream/framework/lib/property/index.ts\nconst PieceProperty = z.union([InputProperty, PieceAuthProperty]);\nconst PiecePropertyMap = z.record(z.string(), PieceProperty);\nconst InputPropertyMap = z.record(z.string(), InputProperty);\n\n//#endregion\n//#region upstream/framework/lib/trigger/trigger.ts\nconst DEDUPE_KEY_PROPERTY = \"_dedupe_key\";\nlet WebhookRenewStrategy = /* @__PURE__ */ function(WebhookRenewStrategy) {\n\tWebhookRenewStrategy[\"CRON\"] = \"CRON\";\n\tWebhookRenewStrategy[\"NONE\"] = \"NONE\";\n\treturn WebhookRenewStrategy;\n}({});\nconst WebhookRenewConfiguration = z.union([z.object({\n\tstrategy: z.literal(WebhookRenewStrategy.CRON),\n\tcronExpression: z.string()\n}), z.object({ strategy: z.literal(WebhookRenewStrategy.NONE) })]);\nvar ITrigger = class {\n\tconstructor(name, displayName, description, requireAuth, props, type, handshakeConfiguration, onHandshake, renewConfiguration, onRenew, onEnable, onDisable, onStart, run, test, sampleData, testStrategy, outputSchema, aiMetadata, classification, propertyGroups) {\n\t\tthis.name = name;\n\t\tthis.displayName = displayName;\n\t\tthis.description = description;\n\t\tthis.requireAuth = requireAuth;\n\t\tthis.props = props;\n\t\tthis.type = type;\n\t\tthis.handshakeConfiguration = handshakeConfiguration;\n\t\tthis.onHandshake = onHandshake;\n\t\tthis.renewConfiguration = renewConfiguration;\n\t\tthis.onRenew = onRenew;\n\t\tthis.onEnable = onEnable;\n\t\tthis.onDisable = onDisable;\n\t\tthis.onStart = onStart;\n\t\tthis.run = run;\n\t\tthis.test = test;\n\t\tthis.sampleData = sampleData;\n\t\tthis.testStrategy = testStrategy;\n\t\tthis.outputSchema = outputSchema;\n\t\tthis.aiMetadata = aiMetadata;\n\t\tthis.classification = classification;\n\t\tthis.propertyGroups = propertyGroups;\n\t}\n};\nconst createTrigger = (params) => {\n\tswitch (params.type) {\n\t\tcase TriggerStrategy.WEBHOOK: return new ITrigger(params.name, params.displayName, params.description, params.requireAuth ?? true, params.props, params.type, params.handshakeConfiguration ?? { strategy: WebhookHandshakeStrategy.NONE }, params.onHandshake ?? (async () => ({ status: 200 })), params.renewConfiguration ?? { strategy: WebhookRenewStrategy.NONE }, params.onRenew ?? (async () => Promise.resolve()), params.onEnable, params.onDisable, params.onStart ?? (async () => Promise.resolve()), params.run, params.test ?? (() => Promise.resolve([params.sampleData])), params.sampleData, params.test ? TriggerTestStrategy.TEST_FUNCTION : TriggerTestStrategy.SIMULATION, params.outputSchema, params.aiMetadata, params.classification, params.propertyGroups);\n\t\tcase TriggerStrategy.POLLING: return new ITrigger(params.name, params.displayName, params.description, params.requireAuth ?? true, params.props, params.type, { strategy: WebhookHandshakeStrategy.NONE }, async () => ({ status: 200 }), { strategy: WebhookRenewStrategy.NONE }, async () => Promise.resolve(), params.onEnable, params.onDisable, params.onStart ?? (async () => Promise.resolve()), params.run, params.test ?? (() => Promise.resolve([params.sampleData])), params.sampleData, TriggerTestStrategy.TEST_FUNCTION, params.outputSchema, params.aiMetadata, params.classification, params.propertyGroups);\n\t\tcase TriggerStrategy.MANUAL: return new ITrigger(params.name, params.displayName, params.description, params.requireAuth ?? true, params.props, params.type, { strategy: WebhookHandshakeStrategy.NONE }, async () => ({ status: 200 }), { strategy: WebhookRenewStrategy.NONE }, async () => Promise.resolve(), params.onEnable, params.onDisable, params.onStart ?? (async () => Promise.resolve()), params.run, params.test ?? (() => Promise.resolve([params.sampleData])), params.sampleData, TriggerTestStrategy.TEST_FUNCTION, params.outputSchema, params.aiMetadata, params.classification, params.propertyGroups);\n\t\tcase TriggerStrategy.APP_WEBHOOK: return new ITrigger(params.name, params.displayName, params.description, params.requireAuth ?? true, params.props, params.type, { strategy: WebhookHandshakeStrategy.NONE }, async () => ({ status: 200 }), { strategy: WebhookRenewStrategy.NONE }, async () => Promise.resolve(), params.onEnable, params.onDisable, params.onStart ?? (async () => Promise.resolve()), params.run, params.test ?? (() => Promise.resolve([params.sampleData])), params.sampleData, isNil(params.sampleData) && isNil(params.test) ? TriggerTestStrategy.SIMULATION : TriggerTestStrategy.TEST_FUNCTION, params.outputSchema, params.aiMetadata, params.classification, params.propertyGroups);\n\t}\n};\n\n//#endregion\n//#region upstream/framework/lib/context/index.ts\nvar PieceServerContextError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"PieceServerContextError\";\n\t}\n};\nfunction isPieceServerContextError(error) {\n\treturn error instanceof Error && error.name === \"PieceServerContextError\";\n}\nlet StoreScope = /* @__PURE__ */ function(StoreScope) {\n\tStoreScope[\"PROJECT\"] = \"COLLECTION\";\n\tStoreScope[\"FLOW\"] = \"FLOW\";\n\treturn StoreScope;\n}({});\n\n//#endregion\n//#region upstream/framework/lib/context/versioning.ts\nlet ContextVersion = /* @__PURE__ */ function(ContextVersion) {\n\tContextVersion[\"V1\"] = \"1\";\n\tContextVersion[\"V2\"] = \"2\";\n\treturn ContextVersion;\n}({});\nconst LATEST_CONTEXT_VERSION = ContextVersion.V2;\nconst MINIMUM_SUPPORTED_RELEASE_AFTER_LATEST_CONTEXT_VERSION = \"0.82.0\";\nconst backwardCompatabilityContextUtils = { makeActionContextBackwardCompatible({ context, contextVersion }) {\n\tswitch (contextVersion) {\n\t\tcase ContextVersion.V2: return context;\n\t\tcase ContextVersion.V1: return addLegacyMethods({ context });\n\t\tcase void 0: return addLegacyMethodsAndServerUrl({ context });\n\t}\n} };\nfunction addLegacyMethods({ context }) {\n\treturn {\n\t\t...context,\n\t\tgenerateResumeUrl: buildLegacyGenerateResumeUrl({ context }),\n\t\trun: {\n\t\t\t...context.run,\n\t\t\tpause: buildLegacyPauseHook({ context })\n\t\t}\n\t};\n}\nfunction addLegacyMethodsAndServerUrl({ context }) {\n\treturn {\n\t\t...addLegacyMethods({ context }),\n\t\tserverUrl: context.server.publicUrl\n\t};\n}\n/**\n* @deprecated Since 2026-04-12. Remove after 2026-10-12 once all pieces migrate to createWaitpoint/waitForWaitpoint.\n*/\nfunction buildLegacyPauseHook({ context }) {\n\treturn (req) => {\n\t\tconst type = req.pauseMetadata.type === PauseType.DELAY ? \"DELAY\" : \"WEBHOOK\";\n\t\tconst responseToSend = req.pauseMetadata.type === PauseType.WEBHOOK ? req.pauseMetadata.response : void 0;\n\t\tconst resumeDateTime = req.pauseMetadata.type === PauseType.DELAY ? req.pauseMetadata.resumeDateTime : void 0;\n\t\tcontext.run.createWaitpoint({\n\t\t\ttype,\n\t\t\tversion: \"V0\",\n\t\t\tresumeDateTime,\n\t\t\tresponseToSend\n\t\t}).catch((e) => {\n\t\t\tconsole.error(\"[buildLegacyPauseHook] Failed to create waitpoint\", e);\n\t\t\tprocess.exit(1);\n\t\t});\n\t\tcontext.run.waitForWaitpoint(\"\");\n\t};\n}\n/**\n* @deprecated Since 2026-04-12. Remove after 2026-10-12 once all pieces migrate to createWaitpoint/waitForWaitpoint.\n*/\nfunction buildLegacyGenerateResumeUrl({ context }) {\n\treturn (params) => {\n\t\tconst randomId = Math.random().toString(36).substring(2);\n\t\tconst url = new URL(`${context.server.publicUrl}v1/flow-runs/${context.run.id}/requests/${randomId}${params.sync ? \"/sync\" : \"\"}`);\n\t\turl.search = new URLSearchParams(params.queryParams).toString();\n\t\treturn url.toString();\n\t};\n}\n\n//#endregion\n//#region upstream/framework/lib/piece.ts\nvar Piece = class {\n\t_actions = {};\n\t_triggers = {};\n\tgetContextInfo = () => ({ version: LATEST_CONTEXT_VERSION });\n\tconstructor(displayName, logoUrl, authors, events, actions, triggers, categories, auth, minimumSupportedRelease = MINIMUM_SUPPORTED_RELEASE_AFTER_LATEST_CONTEXT_VERSION, maximumSupportedRelease, description = \"\", deprecated) {\n\t\tthis.displayName = displayName;\n\t\tthis.logoUrl = logoUrl;\n\t\tthis.authors = authors;\n\t\tthis.events = events;\n\t\tthis.categories = categories;\n\t\tthis.auth = auth;\n\t\tthis.minimumSupportedRelease = minimumSupportedRelease;\n\t\tthis.maximumSupportedRelease = maximumSupportedRelease;\n\t\tthis.description = description;\n\t\tthis.deprecated = deprecated;\n\t\tif (!isValidSimpleSemver(minimumSupportedRelease) || isSemverLessThan(minimumSupportedRelease, \"0.82.0\")) this.minimumSupportedRelease = MINIMUM_SUPPORTED_RELEASE_AFTER_LATEST_CONTEXT_VERSION;\n\t\tactions.forEach((action) => this._actions[action.name] = action);\n\t\ttriggers.forEach((trigger) => this._triggers[trigger.name] = trigger);\n\t}\n\tmetadata() {\n\t\treturn {\n\t\t\tdisplayName: this.displayName,\n\t\t\tlogoUrl: this.logoUrl,\n\t\t\tactions: this._actions,\n\t\t\ttriggers: this._triggers,\n\t\t\tcategories: this.categories,\n\t\t\tdescription: this.description,\n\t\t\tauthors: this.authors,\n\t\t\tauth: withConnectionIdentifierFlag(this.auth),\n\t\t\tminimumSupportedRelease: this.minimumSupportedRelease,\n\t\t\tmaximumSupportedRelease: this.maximumSupportedRelease,\n\t\t\tdeprecated: this.deprecated,\n\t\t\tcontextInfo: this.getContextInfo?.()\n\t\t};\n\t}\n\tgetAction(actionName) {\n\t\treturn this._actions[actionName];\n\t}\n\tgetTrigger(triggerName) {\n\t\treturn this._triggers[triggerName];\n\t}\n\tactions() {\n\t\treturn this._actions;\n\t}\n\ttriggers() {\n\t\treturn this._triggers;\n\t}\n};\nconst createPiece = (params) => {\n\tif (params.auth && Array.isArray(params.auth)) {\n\t\tif (!params.auth.every((auth, index, self) => index === self.findIndex((t) => t.type === auth.type))) throw new Error(\"Auth properties must be unique by type\");\n\t}\n\treturn new Piece(params.displayName, params.logoUrl, params.authors ?? [], params.events, params.actions, params.triggers, params.categories ?? [], params.auth, params.minimumSupportedRelease, params.maximumSupportedRelease, params.description, params.deprecated);\n};\nfunction withConnectionIdentifierFlag(auth) {\n\tif (auth === void 0) return;\n\treturn Array.isArray(auth) ? auth.map(flagConnectionIdentifier) : flagConnectionIdentifier(auth);\n}\nfunction flagConnectionIdentifier(auth) {\n\treturn {\n\t\t...auth,\n\t\thasConnectionIdentifier: auth.getConnectionIdentifier !== void 0\n\t};\n}\nfunction isValidSimpleSemver(version) {\n\treturn /^\\d+\\.\\d+\\.\\d+$/.test(version);\n}\nfunction isSemverLessThan(a, b) {\n\tconst [a1, a2, a3] = a.split(\".\").map(Number);\n\tconst [b1, b2, b3] = b.split(\".\").map(Number);\n\tif (a1 !== b1) return a1 < b1;\n\tif (a2 !== b2) return a2 < b2;\n\treturn a3 < b3;\n}\n\n//#endregion\n//#region upstream/framework/lib/piece-metadata.ts\nconst I18nForPiece = z.optional(z.record(z.string(), z.record(z.string(), z.string())));\nconst PieceBase = z.object({\n\tid: z.optional(z.string()),\n\tname: z.string(),\n\tdisplayName: z.string(),\n\tlogoUrl: z.string(),\n\tdescription: z.string(),\n\tauthors: z.array(z.string()),\n\tplatformId: z.optional(z.string()),\n\tdirectoryPath: z.optional(z.string()),\n\tauth: z.optional(z.union([PieceAuthProperty, z.array(PieceAuthProperty)])),\n\tversion: z.string(),\n\tcategories: z.optional(z.array(z.enum(PieceCategory))),\n\tminimumSupportedRelease: z.optional(z.string()),\n\tmaximumSupportedRelease: z.optional(z.string()),\n\tdeprecated: z.optional(z.boolean()),\n\ti18n: I18nForPiece\n});\nconst Audience = z.enum([\n\t\"human\",\n\t\"ai\",\n\t\"both\"\n]);\nconst AiMetadata = z.object({\n\tdescription: z.optional(z.string()),\n\tidempotent: z.optional(z.boolean())\n});\nconst ActionClassification = z.enum([\n\t\"READ\",\n\t\"SEARCH\",\n\t\"WRITE\",\n\t\"DESTRUCTIVE\"\n]);\nconst READ_ONLY_CLASSIFICATIONS = [\"READ\", \"SEARCH\"];\nconst isReadOnlyClassification = (classification) => classification !== void 0 && READ_ONLY_CLASSIFICATIONS.includes(classification);\nconst PropertyGroupDisplay = z.enum([\n\t\"tabs\",\n\t\"section\",\n\t\"summary\",\n\t\"builder\",\n\t\"footer\"\n]);\nconst PropertyGroup = z.object({\n\tkey: z.string(),\n\tdisplay: PropertyGroupDisplay,\n\tlabel: z.optional(z.string()),\n\tdescription: z.optional(z.string()),\n\ticon: z.optional(z.string()),\n\tprops: z.array(z.string())\n});\nconst ActionBase = z.object({\n\tname: z.string(),\n\tdisplayName: z.string(),\n\tdescription: z.string(),\n\tprops: PiecePropertyMap,\n\tpropertyGroups: z.optional(z.array(PropertyGroup)),\n\trequireAuth: z.boolean(),\n\terrorHandlingOptions: z.optional(ErrorHandlingOptionsParam),\n\toutputSchema: z.optional(z.custom()),\n\taudience: z.optional(Audience),\n\taiMetadata: z.optional(AiMetadata),\n\tclassification: z.optional(ActionClassification)\n});\nconst TriggerBase = z.object({\n\tname: z.string(),\n\tdisplayName: z.string(),\n\tdescription: z.string(),\n\tprops: PiecePropertyMap,\n\tpropertyGroups: z.optional(z.array(PropertyGroup)),\n\terrorHandlingOptions: z.optional(ErrorHandlingOptionsParam),\n\ttype: z.enum(TriggerStrategy),\n\tsampleData: z.unknown(),\n\thandshakeConfiguration: z.optional(z.custom()),\n\trenewConfiguration: z.optional(WebhookRenewConfiguration),\n\ttestStrategy: z.enum(TriggerTestStrategy),\n\toutputSchema: z.optional(z.custom()),\n\taiMetadata: z.optional(AiMetadata),\n\tclassification: z.optional(ActionClassification)\n});\nconst PieceMetadata = z.object({\n\t...PieceBase.shape,\n\tactions: z.record(z.string(), ActionBase),\n\ttriggers: z.record(z.string(), TriggerBase)\n});\nconst PieceMetadataSummary = z.object({\n\t...PieceBase.shape,\n\tactions: z.number(),\n\ttriggers: z.number(),\n\tsuggestedActions: z.optional(z.array(ActionBase)),\n\tsuggestedTriggers: z.optional(z.array(TriggerBase))\n});\nconst PiecePackageMetadata = z.object({\n\tprojectUsage: z.number(),\n\tpieceType: z.enum(PieceType),\n\tpackageType: z.enum(PackageType),\n\tplatformId: z.optional(z.string()),\n\tarchiveId: z.optional(z.string())\n});\nconst PieceMetadataModel = z.object({\n\t...PieceMetadata.shape,\n\t...PiecePackageMetadata.shape\n});\nconst PieceMetadataModelSummary = z.object({\n\t...PieceMetadataSummary.shape,\n\t...PiecePackageMetadata.shape\n});\nconst PiecePackageInformation = z.object({\n\tname: z.string(),\n\tversion: z.string()\n});\n\n//#endregion\n//#region upstream/framework/lib/i18n.ts\nconst pieceTranslation = {\n\ttranslatePiece: (params) => {\n\t\tconst { piece, locale, mutate = false } = params;\n\t\tif (!locale) return piece;\n\t\ttry {\n\t\t\tconst target = piece.i18n?.[locale];\n\t\t\tif (!target) return piece;\n\t\t\tconst translatedPiece = mutate ? piece : JSON.parse(JSON.stringify(piece));\n\t\t\tpieceTranslation.pathsToValuesToTranslate.forEach((key) => {\n\t\t\t\ttranslateProperty(translatedPiece, key, target);\n\t\t\t});\n\t\t\treturn translatedPiece;\n\t\t} catch (err) {\n\t\t\tconsole.error(`error translating piece ${piece.name}:`, err);\n\t\t\treturn piece;\n\t\t}\n\t},\n\tinitializeI18n: async (pieceOutputPath) => {\n\t\ttry {\n\t\t\tconst locales = Object.values(LocalesEnum);\n\t\t\tconst i18n = {};\n\t\t\tfor (const locale of locales) {\n\t\t\t\tconst translations = await readLocaleFile(locale, pieceOutputPath);\n\t\t\t\tif (translations) i18n[locale] = translations;\n\t\t\t}\n\t\t\treturn Object.keys(i18n).length > 0 ? i18n : void 0;\n\t\t} catch (err) {\n\t\t\tconsole.log(`Error initializing i18n for ${pieceOutputPath}:`, err);\n\t\t\treturn;\n\t\t}\n\t},\n\tpathsToValuesToTranslate: [\n\t\t\"description\",\n\t\t\"auth.username.displayName\",\n\t\t\"auth.username.description\",\n\t\t\"auth.password.displayName\",\n\t\t\"auth.password.description\",\n\t\t\"auth.props.*.displayName\",\n\t\t\"auth.props.*.description\",\n\t\t\"auth.props.*.options.options.*.label\",\n\t\t\"auth.description\",\n\t\t\"actions.*.displayName\",\n\t\t\"actions.*.description\",\n\t\t\"actions.*.props.*.displayName\",\n\t\t\"actions.*.props.*.description\",\n\t\t\"actions.*.props.*.options.options.*.label\",\n\t\t\"triggers.*.displayName\",\n\t\t\"triggers.*.description\",\n\t\t\"triggers.*.props.*.displayName\",\n\t\t\"triggers.*.props.*.description\",\n\t\t\"triggers.*.props.*.options.options.*.label\"\n\t]\n};\n/**This function translates a property inside a piece, i.e description, displayName, etc...\n*\n* @param pieceModelOrProperty - The piece model or property to translate\n* @param path - The path to the property to translate, i.e auth.username.displayName\n* @param i18n - The i18n object\n*/\nfunction translateProperty(pieceModelOrProperty, path, i18n) {\n\tconst parsedKeys = path.split(\".\");\n\tif (parsedKeys[0] === \"*\") return Object.values(pieceModelOrProperty).forEach((item) => translateProperty(item, parsedKeys.slice(1).join(\".\"), i18n));\n\tconst nextObject = pieceModelOrProperty[parsedKeys[0]];\n\tif (!nextObject) return;\n\tif (parsedKeys.length > 1) return translateProperty(nextObject, parsedKeys.slice(1).join(\".\"), i18n);\n\tconst valueInI18n = i18n[pieceModelOrProperty[parsedKeys[0]].slice(0, 512)];\n\tif (valueInI18n) pieceModelOrProperty[parsedKeys[0]] = valueInI18n;\n}\nasync function fileExists(filePath) {\n\ttry {\n\t\tawait fs.access(filePath);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\nconst readLocaleFile = async (locale, pieceOutputPath) => {\n\tconst filePath = path.join(pieceOutputPath, \"src\", \"i18n\", `${locale}.json`);\n\tif (!await fileExists(filePath)) return null;\n\ttry {\n\t\tconst fileContent = await fs.readFile(filePath, \"utf8\");\n\t\tconst translations = JSON.parse(fileContent);\n\t\tif (typeof translations === \"object\" && translations !== null) return translations;\n\t\tthrow new Error(`Invalid i18n file format for ${locale} in piece ${pieceOutputPath}`);\n\t} catch (error) {\n\t\tconsole.error(`Error reading i18n file for ${locale} in piece ${pieceOutputPath}:`, error);\n\t\treturn null;\n\t}\n};\n\n//#endregion\n//#region upstream/framework/lib/test/index.ts\nfunction createMockActionContext(params) {\n\treturn {\n\t\texecutionType: ExecutionType.BEGIN,\n\t\tauth: void 0,\n\t\tpropsValue: params.propsValue,\n\t\tstore: {\n\t\t\tput: async (key, value) => value,\n\t\t\tget: async () => null,\n\t\t\tdelete: async () => {}\n\t\t},\n\t\tconnections: { get: async () => null },\n\t\ttags: { add: async () => {} },\n\t\tserver: {\n\t\t\tapiUrl: \"http://localhost:3000\",\n\t\t\tpublicUrl: \"http://localhost:4200\",\n\t\t\ttoken: \"test-token\"\n\t\t},\n\t\tfiles: { write: async () => \"test-file-url\" },\n\t\toutput: { update: async () => {} },\n\t\tagent: { tools: async () => ({}) },\n\t\trun: {\n\t\t\tid: \"test-run-id\",\n\t\t\tstop: () => {},\n\t\t\tpause: () => {},\n\t\t\trespond: () => {}\n\t\t},\n\t\tproject: {\n\t\t\tid: \"test-project-id\",\n\t\t\texternalId: async () => void 0\n\t\t},\n\t\tflows: {\n\t\t\tlist: async () => ({\n\t\t\t\tdata: [],\n\t\t\t\tnext: null,\n\t\t\t\tprevious: null\n\t\t\t}),\n\t\t\tcurrent: {\n\t\t\t\tid: \"test-flow-id\",\n\t\t\t\tversion: { id: \"test-flow-version-id\" }\n\t\t\t}\n\t\t},\n\t\tstep: { name: \"test-step\" },\n\t\tgenerateResumeUrl: () => \"http://localhost:3000/resume\"\n\t};\n}\nfunction createMockPollingTriggerContext(params) {\n\treturn {\n\t\t...createMockActionContext({ propsValue: params.propsValue }),\n\t\tsetSchedule: (schedule) => {\n\t\t\tparams.onSetSchedule?.(schedule);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/powerhouse/context.ts\nfunction reactorOf(ctx) {\n\tconst reactor = ctx !== null && typeof ctx === \"object\" ? ctx.reactor : void 0;\n\tif (!reactor) throw new Error(\"ctx.reactor is not available: this piece is not running on a Powerhouse reactor\");\n\treturn reactor;\n}\n\n//#endregion\nexport { ACTIVEPIECES_CHAT_TIERS, AGENT_STEP_TEST_TIMEOUT_MS, AGENT_STEP_TIMEOUT_MS, AIProviderModel, AIProviderName, AIProviderWithoutSensitiveData, AI_PROVIDER_CAPABILITIES, ActionBase, ActionClassification, AgentFlowTool, AgentKnowledgeBaseTool, AgentMcpTool, AgentOutputField, AgentOutputFieldType, AgentPieceProps, AgentStepBlock, AgentTaskStatus, AgentTool, AgentToolType, AiMetadata, ApFile, AppConnectionType, ArrayProperty, ArraySubProps, Audience, AzureProviderConfig, BaseAIProviderAuthConfig, BasePropertySchema, BasicAuthProperty, BasicAuthPropertyValue, BedrockProviderAuthConfig, BedrockProviderConfig, ChatFormResponse, CheckboxProperty, CloudflareGatewayProviderConfig, ContentBlockType, ContextVersion, CreateRecordsRequest, CreateTableWebhookRequest, CustomAuthProperty, CustomProperty, DEDUPE_KEY_PROPERTY, DEFAULT_CHAT_TIER_ID, DEFAULT_CONNECTION_DISPLAY_NAME, DateRangePreset, DateRangeProperty, DateRangeValue, DateTimeProperty, DropdownOption, DropdownProperty, DropdownState, DynamicProp, DynamicProperties, DynamicPropsValue, ErrorHandlingOptionsParam, ExecutionToolStatus, ExecutionType, ExportTableResponse, FAIL_PARENT_ON_FAILURE_HEADER, Field, FieldType, FileProperty, FileResponseInterface, Filter, FilterOperator, FlowStatus, FlowTriggerType, GetProviderConfigResponse, HumanInputFormResult, HumanInputFormResultTypes, IAction, ITrigger, InputProperty, InputPropertyMap, JsonProperty, KnowledgeBaseSourceType, LATEST_CONTEXT_VERSION, ListRecordsRequest, ListTablesRequest, LongTextProperty, MINIMUM_SUPPORTED_RELEASE_AFTER_LATEST_CONTEXT_VERSION, MarkdownContentBlock, MarkdownVariant, McpAuthConfig, McpAuthType, McpProperty, McpPropertyType, McpProtocol, McpTrigger, MultiSelectDropdownProperty, NumberProperty, OAuth2AuthorizationMethod, OAuth2GrantType, OAuth2Property, OAuth2PropertyValue, OAuth2Props, OIDCProperty, OPENAI_COMPATIBLE_VENDOR_BASE_URLS, ObjectProperty, OpenAICompatibleProviderConfig, OpenAiCompatibleVendorConfig, PARENT_RUN_ID_HEADER, Piece, PieceAuth, PieceAuthProperty, PieceBase, PieceCategory, PieceMetadata, PieceMetadataModel, PieceMetadataModelSummary, PieceMetadataSummary, PiecePackageInformation, PieceProperty, PiecePropertyMap, PieceServerContextError, PopulatedRecord, Project, ProjectAIProvider, Property, PropertyGroup, PropertyGroupDisplay, PropertyType, RAW_PAYLOAD_HEADER, READ_ONLY_CLASSIFICATIONS, RichTextProperty, SecretTextProperty, SeekPage, ShortTextProperty, StaticDropdownEmptyOption, StaticDropdownProperty, StaticMultiSelectDropdownProperty, StopResponse, StoreScope, TASK_COMPLETION_TOOL_NAME, Table, TableWebhookEventType, ToolCallContentBlock, ToolCallStatus, ToolCallType, TriggerBase, TriggerStrategy, USE_DRAFT_QUERY_PARAM_NAME, UpdateRecordRequest, VertexProviderAuthConfig, VertexProviderConfig, WebhookHandshakeStrategy, WebhookRenewConfiguration, WebhookRenewStrategy, apId, assertNotNullOrUndefined, backwardCompatabilityContextUtils, buildAuthHeaders, camelCase, chunk, createAction, createKeyForFormInput, createMockActionContext, createMockPollingTriggerContext, createPiece, createTrigger, dateRangeUtils, getAuthPropertyForValue, getEffectiveProviderAndModel, isEmpty, isNil, isNotUndefined, isPieceServerContextError, isReadOnlyClassification, isString, kebabCase, mcpToolNameUtils, normalizeToolOutputToExecuteResponse, pickBy, piecePropertiesUtils, pieceTranslation, reactorOf, splitCloudflareGatewayModelId, spreadIfDefined, startCase, tryCatch, unique };\n//# sourceMappingURL=index.js.map","// The Powerhouse mark, from the logo powerhouse.inc serves (its first path,\n// which is the icon; the rest of that file is the wordmark).\n\n// The mark alone, not the app icon: the app icon insets it on a dark canvas,\n// and the editor frames every piece logo with padding of its own, so that\n// version would sit padded twice. Filled dark because the frame is white.\nexport const POWERHOUSE_LOGO =\n \"data:image/svg+xml;base64,\" +\n \"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMTQg\" +\n \"MTE0IiBmaWxsPSJub25lIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZl\" +\n \"bm9kZCIgZmlsbD0iIzE2MTYxNiIgZD0iTTcxLjI5MTkgMEwyNC4zNDE1IDM4Ljg3NzJDMTcuNDU0\" +\n \"OCA0NC41Nzk4IDE2Ljk1MzkgNTQuOTY1OSAyMy4yNiA2MS4zMDQ3TDM5LjUwMjggNzcuNjMxOEM0\" +\n \"NC4yNjg0IDgyLjQyMjEgNDUuMjk5NiA4OS43ODM0IDQyLjAzMzUgOTUuNjk4OEwzMS45MjkgMTE0\" +\n \"SDE1LjJDNi44MDUyNyAxMTQgMCAxMDcuMTk1IDAgOTguOFYxNS4yQzAgNi44MDUyNyA2LjgwNTI3\" +\n \"IDAgMTUuMiAwSDcxLjI5MTlaTTgwLjExMSAwTDcxLjM0MTIgMTUuOTc1OEM2OC4xMDc4IDIxLjg2\" +\n \"NiA2OS4xMjU1IDI5LjE4MDQgNzMuODQ0MSAzMy45NjQxTDkxLjA3NTEgNTEuNDMzMUM5Ny4zNjc0\" +\n \"IDU3LjgxMjQgOTYuODA0NCA2OC4yMjI3IDg5Ljg2MDcgNzMuODg2MUw0MC42NzgyIDExNEg5OC44\" +\n \"QzEwNy4xOTUgMTE0IDExNCAxMDcuMTk1IDExNCA5OC44VjE1LjJDMTE0IDYuODA1MjcgMTA3LjE5\" +\n \"NSAwIDk4LjggMEg4MC4xMTFaIi8+PC9zdmc+\";\n","// Config parsing shared by the document actions.\n\n// Every one of these accepts what a model step produces as readily as what an\n// author typed: fenced JSON, a bare object, a quoted id inside a sentence.\nexport interface ActionInputConfig {\n type: string;\n input?: unknown;\n scope?: string;\n}\n\nexport interface DispatchPayload {\n // Present when the payload object named its own target document.\n documentId?: string;\n actions: ActionInputConfig[];\n}\n\nexport interface CreatePayload {\n documentType?: string;\n name?: string;\n actions?: unknown;\n}\n\nfunction unfence(text: string): string {\n return text\n .trim()\n .replace(/^```(?:json)?\\s*/i, \"\")\n .replace(/```$/, \"\")\n .trim();\n}\n\n// Every top-level {...} or [...] in a string, in the order they appear.\n//\n// Scanned rather than matched with a regular expression because a brace inside\n// a string literal is not a brace: `{\"note\": \"a } here\"}` is one value, and a\n// regex that does not track quoting splits it.\nfunction jsonSpans(text: string): string[] {\n const spans: string[] = [];\n let depth = 0;\n let start = -1;\n let inString = false;\n let escaped = false;\n for (let index = 0; index < text.length; index++) {\n const character = text[index];\n if (inString) {\n if (escaped) escaped = false;\n else if (character === \"\\\\\") escaped = true;\n else if (character === '\"') inString = false;\n continue;\n }\n if (character === '\"') {\n inString = true;\n continue;\n }\n if (character === \"{\" || character === \"[\") {\n if (depth === 0) start = index;\n depth++;\n continue;\n }\n if (character === \"}\" || character === \"]\") {\n if (depth === 0) continue;\n depth--;\n if (depth === 0 && start >= 0) {\n spans.push(text.slice(start, index + 1));\n start = -1;\n }\n }\n }\n return spans;\n}\n\n// JSON out of whatever a model actually said.\n//\n// The prompt asks for JSON alone and a model may still reason out loud first:\n// a reasoning model answered this piece with two pages of deliberation and the\n// object on the last line, behind a leaked channel marker. Fences were already\n// tolerated here for the same reason — this is the same accommodation, one step\n// further.\n//\n// The LAST top-level value wins, because the pattern is deliberation first and\n// answer last; an example the model quoted from the prompt would otherwise be\n// preferred over the answer it worked out.\nexport function parseModelJson(text: string): unknown {\n const cleaned = unfence(text);\n try {\n return JSON.parse(cleaned);\n } catch {\n // Not JSON on its own; look for JSON inside it.\n }\n const spans = jsonSpans(cleaned);\n for (let index = spans.length - 1; index >= 0; index--) {\n try {\n return JSON.parse(spans[index]);\n } catch {\n // A span that does not parse is prose that happened to hold a brace.\n }\n }\n throw new SyntaxError(\"no JSON value found\");\n}\n\nexport function parseActions(\n value: unknown,\n blockName: string,\n): ActionInputConfig[] {\n return parseDispatchPayload(value, blockName).actions;\n}\n\n// Accepts an array, a single action object, or JSON text (typically an LLM's\n// output, possibly fenced); an object may also carry the target documentId.\nexport function parseDispatchPayload(\n value: unknown,\n blockName: string,\n): DispatchPayload {\n let documentId: string | undefined;\n if (typeof value === \"string\") {\n try {\n value = parseModelJson(value);\n } catch {\n throw new Error(`${blockName}: \"actions\" is a string but not valid JSON`);\n }\n }\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n const record = value as Record<string, unknown>;\n if (typeof record.documentId === \"string\") documentId = record.documentId;\n value = Array.isArray(record.actions) ? record.actions : [value];\n }\n if (!Array.isArray(value)) return { documentId, actions: [] };\n const actions = value.map((entry, index) => {\n const record = entry as Record<string, unknown> | null;\n if (!record || typeof record.type !== \"string\") {\n throw new Error(`${blockName}: actions[${index}] needs a string \"type\"`);\n }\n return {\n type: record.type,\n input: record.input,\n scope: typeof record.scope === \"string\" ? record.scope : undefined,\n };\n });\n return { documentId, actions };\n}\n\n// {documentType, name, actions?} as an object or as JSON text, possibly fenced.\nexport function parseCreatePayload(\n value: unknown,\n blockName: string,\n): CreatePayload {\n let record = value;\n if (typeof record === \"string\") {\n if (unfence(record) === \"\") return {};\n try {\n record = parseModelJson(record);\n } catch {\n throw new Error(`${blockName}: \"payload\" is a string but not valid JSON`);\n }\n }\n if (!record || typeof record !== \"object\" || Array.isArray(record)) return {};\n const entry = record as Record<string, unknown>;\n return {\n documentType:\n typeof entry.documentType === \"string\" ? entry.documentType : undefined,\n name: typeof entry.name === \"string\" ? entry.name : undefined,\n actions: entry.actions,\n };\n}\n\n// Whitelist for the dispatch action: a comma-separated string, a list of\n// names, or a document-schema actions array.\nexport function allowedActionTypes(value: unknown): string[] {\n const raw = typeof value === \"string\" ? value.split(\",\") : value;\n if (!Array.isArray(raw)) return [];\n return raw\n .map((entry) => {\n if (typeof entry === \"string\") return entry;\n const record = entry as { type?: unknown } | null;\n return typeof record?.type === \"string\" ? record.type : \"\";\n })\n .map((entry) => entry.trim())\n .filter(Boolean);\n}\n\nconst UUID = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;\n\n// Ids fed by an AI step arrive quoted, fenced or wrapped in prose; documents\n// are addressed by uuid, so prefer one when the text contains it.\nexport function resolveDocumentId(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const text = value.trim();\n if (!text) return undefined;\n const uuid = UUID.exec(text);\n if (uuid) return uuid[0];\n // Slugs are valid identifiers too, so fall back to the bare text.\n return text.replace(/^[\"'`]+|[\"'`]+$/g, \"\").trim() || undefined;\n}\n\n// A design-time value that can actually be resolved: an expression cannot.\nexport function staticString(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n if (!trimmed || trimmed.includes(\"{{\")) return undefined;\n return trimmed;\n}\n","// Reaching the reactor from piece code, and the props whose choices come\n// from it.\n\n// `ctx.reactor` is served by the host over the worker's call channel and only\n// to a piece an installed reactor package ships. Absent, reactorOf throws by\n// name, so a piece that ends up somewhere else fails legibly.\nimport {\n Property,\n reactorOf,\n type ReactorService,\n} from \"@powerhousedao/pieces-framework\";\nimport { staticString } from \"./parse.js\";\n\nconst DRIVE_DOCUMENT_TYPE = \"powerhouse/document-drive\";\n\ninterface OptionEntry {\n label: string;\n value: string;\n // actionType only: SDL of the operation's input type, which the editor's\n // action list turns into a starter input object.\n inputSchema?: string;\n}\n\ninterface OptionState {\n options: OptionEntry[];\n placeholder?: string;\n}\n\nconst SET_NAME: OptionEntry = {\n label: \"SET_NAME (base)\",\n value: \"SET_NAME\",\n inputSchema: \"input SetNameInput {\\n name: String!\\n}\",\n};\n\nasync function documentOptions(\n reactor: ReactorService,\n documentType: string | undefined,\n): Promise<OptionState> {\n const documents = await reactor.find(documentType ? { documentType } : {});\n return {\n options: documents.map((document) => ({\n label: `${document.name || document.slug || \"(unnamed)\"} — ${document.documentType}`,\n value: document.documentId,\n })),\n placeholder: documentType\n ? `Documents of type ${documentType}`\n : \"All documents on this reactor\",\n };\n}\n\n// The installed document models. Free text stays possible in this editor,\n// which is what an expression-fed step needs.\nexport const documentTypeProp = (\n displayName = \"Document type\",\n required = false,\n description?: string,\n) =>\n Property.Dropdown<string>({\n auth: undefined,\n displayName,\n description,\n required,\n refreshers: [],\n options: async (_propsValue, ctx) => {\n const models = await reactorOf(ctx).models();\n return {\n options: models\n .map((model) => ({\n label: model.name\n ? `${model.name} (${model.documentType})`\n : model.documentType,\n value: model.documentType,\n }))\n .sort((a, b) => a.value.localeCompare(b.value)),\n };\n },\n });\n\nexport const documentIdProp = (\n displayName = \"Document id\",\n required = false,\n description?: string,\n) =>\n Property.Dropdown<string>({\n auth: undefined,\n displayName,\n description,\n required,\n // Narrowed by the sibling type when one is set, which is why it refreshes.\n refreshers: [\"documentType\"],\n options: (propsValue, ctx) =>\n documentOptions(reactorOf(ctx), staticString(propsValue.documentType)),\n });\n\nexport const driveProp = (displayName: string, description?: string) =>\n Property.Dropdown<string>({\n auth: undefined,\n displayName,\n description,\n required: false,\n refreshers: [],\n options: (_propsValue, ctx) =>\n documentOptions(reactorOf(ctx), DRIVE_DOCUMENT_TYPE),\n });\n\n// The actions to dispatch: a JSON array of {type, input, scope?}. This editor\n// renders it as a list whose types come from actionTypeProp below; elsewhere\n// it is the JSON it says it is.\nexport const actionsProp = (displayName: string, required = false) =>\n Property.Json({\n displayName,\n description:\n 'e.g. [{ \"type\": \"SET_NAME\", \"input\": { \"name\": \"Invoice\" } }]',\n required,\n });\n\n// The target type's own actions, each carrying its input SDL, plus the base\n// actions every document accepts.\nexport const actionTypeProp = (\n displayName = \"Action type\",\n required = false,\n description?: string,\n) =>\n Property.Dropdown<string>({\n auth: undefined,\n displayName,\n description,\n required,\n refreshers: [\"documentType\", \"documentId\"],\n options: async (propsValue, ctx) => {\n const reactor = reactorOf(ctx);\n let documentType = staticString(propsValue.documentType);\n if (!documentType) {\n // A resolvable id names its own type, which is what a step that only\n // knows the document has to offer.\n const documentId = staticString(propsValue.documentId);\n if (documentId) {\n documentType = (await reactor.get({ documentId })).documentType;\n }\n }\n if (!documentType) {\n return {\n options: [SET_NAME],\n placeholder:\n \"Set a document type (or a resolvable document id) to list its actions\",\n };\n }\n const model = await reactor.model(documentType);\n return {\n options: [\n ...model.actions.map((action) => ({\n label: `${action.type} (${action.module})`,\n value: action.type,\n ...(action.inputSchema ? { inputSchema: action.inputSchema } : {}),\n })),\n ],\n placeholder: `Actions of ${documentType}`,\n };\n },\n });\n","import {\n createAction,\n Property,\n reactorOf,\n} from \"@powerhousedao/pieces-framework\";\nimport { parseActions, parseCreatePayload } from \"../parse.js\";\nimport {\n actionsProp,\n actionTypeProp,\n documentTypeProp,\n driveProp,\n} from \"../reactor.js\";\n\nconst BLOCK = \"document-create\";\n\nexport const documentCreateAction = createAction({\n name: BLOCK,\n displayName: \"Create document\",\n description: \"Creates a Powerhouse document.\",\n requireAuth: false,\n props: {\n documentType: documentTypeProp(),\n name: Property.ShortText({ displayName: \"Document name\", required: false }),\n parentId: driveProp(\"Parent drive/folder\"),\n actions: actionsProp(\"Initial actions\"),\n actionType: actionTypeProp(\n \"Action type\",\n false,\n \"Suggestions for the action list above\",\n ),\n payload: Property.ShortText({\n displayName: \"Payload\",\n description:\n \"JSON {documentType, name, actions?}, e.g. {{steps.draft.output}}\",\n required: false,\n }),\n },\n run: async (ctx) => {\n const reactor = reactorOf(ctx);\n const config = ctx.propsValue;\n // A payload (typically model output) can name the type and the document.\n const payload = parseCreatePayload(config.payload, BLOCK);\n const documentType =\n (typeof config.documentType === \"string\" && config.documentType) ||\n payload.documentType;\n if (!documentType) {\n throw new Error(\n `${BLOCK}: \"documentType\" is required, in the config or the payload`,\n );\n }\n const name =\n (typeof config.name === \"string\" && config.name) || payload.name;\n const created = await reactor.create({\n documentType,\n ...(name ? { name } : {}),\n ...(config.parentId ? { parentId: config.parentId } : {}),\n });\n\n // The name travelled with the create; only the author's own actions are\n // left to dispatch.\n const followUps = parseActions(config.actions ?? payload.actions, BLOCK);\n const document = followUps.length\n ? await reactor.execute({\n documentId: created.documentId,\n actions: followUps,\n })\n : created;\n\n return {\n documentId: document.documentId,\n documentType: document.documentType,\n name: document.name,\n state: document.state,\n };\n },\n});\n","import {\n createAction,\n Property,\n reactorOf,\n} from \"@powerhousedao/pieces-framework\";\nimport {\n allowedActionTypes,\n parseDispatchPayload,\n resolveDocumentId,\n} from \"../parse.js\";\nimport {\n actionsProp,\n actionTypeProp,\n documentIdProp,\n documentTypeProp,\n} from \"../reactor.js\";\n\nconst BLOCK = \"document-dispatch\";\n\nexport const documentDispatchAction = createAction({\n name: BLOCK,\n displayName: \"Dispatch actions\",\n description: \"Sends actions to a document.\",\n requireAuth: false,\n props: {\n documentId: documentIdProp(\n \"Document id\",\n true,\n \"e.g. {{steps.create.output.documentId}}\",\n ),\n documentType: documentTypeProp(\n \"Document type\",\n false,\n \"Design-time hint when the document id is an expression\",\n ),\n actions: actionsProp(\"Actions\", true),\n actionType: actionTypeProp(\n \"Action type\",\n false,\n \"Suggestions for the action list above\",\n ),\n allowedActions: Property.ShortText({\n displayName: \"Allowed action types\",\n description: \"Comma-separated whitelist; enforced when set\",\n required: false,\n }),\n branch: Property.ShortText({\n displayName: \"Branch\",\n description: 'Defaults to \"main\"',\n required: false,\n }),\n },\n run: async (ctx) => {\n const config = ctx.propsValue;\n const payload = parseDispatchPayload(config.actions, BLOCK);\n const documentId =\n resolveDocumentId(config.documentId) ??\n resolveDocumentId(payload.documentId);\n if (!documentId) {\n throw new Error(\n `${BLOCK}: \"documentId\" is required, in the config or the actions payload`,\n );\n }\n // Enforced, not merely suggested: the payload may come from an LLM.\n const allowed = allowedActionTypes(config.allowedActions);\n const rejected = allowed.length\n ? payload.actions.filter((entry) => !allowed.includes(entry.type))\n : [];\n if (rejected.length > 0) {\n throw new Error(\n `${BLOCK}: action(s) not allowed here: ${[\n ...new Set(rejected.map((entry) => entry.type)),\n ].join(\", \")}`,\n );\n }\n if (payload.actions.length === 0) {\n throw new Error(`${BLOCK}: \"actions\" must be a non-empty list`);\n }\n const document = await reactorOf(ctx).execute({\n documentId,\n ...(config.branch ? { branch: config.branch } : {}),\n actions: payload.actions,\n });\n return {\n documentId: document.documentId,\n documentType: document.documentType,\n name: document.name,\n state: document.state,\n };\n },\n});\n","import {\n createAction,\n Property,\n reactorOf,\n} from \"@powerhousedao/pieces-framework\";\nimport { documentTypeProp, driveProp } from \"../reactor.js\";\n\nconst DEFAULT_LIMIT = 25;\nconst MAX_LIMIT = 100;\n\nexport const documentFindAction = createAction({\n name: \"document-find\",\n displayName: \"Find documents\",\n description: \"Lists documents by type and name.\",\n requireAuth: false,\n props: {\n documentType: documentTypeProp(\"Document type\", false, \"Omit for any type\"),\n parentId: driveProp(\"In drive/folder\", \"Omit for the whole reactor\"),\n name: Property.ShortText({\n displayName: \"Name contains\",\n description: \"Case-insensitive match\",\n required: false,\n }),\n matchPath: Property.ShortText({\n displayName: \"State field\",\n description:\n 'Dotted path into the document\\'s state, e.g. \"orderId\" or \"settlement.status\". With a value below, only documents holding it are returned.',\n required: false,\n }),\n matchValue: Property.ShortText({\n displayName: \"State value\",\n description:\n \"Compared as text, e.g. {{trigger.payload.orderId}}. Documents missing the field never match.\",\n required: false,\n }),\n includeState: Property.Checkbox({\n displayName: \"Include state\",\n description:\n \"Returns each document's state as well as its id and name. Off by default: a page of documents carries a page of states.\",\n required: false,\n defaultValue: false,\n }),\n limit: Property.Number({\n displayName: \"Max results\",\n description: `Defaults to ${DEFAULT_LIMIT}`,\n required: false,\n }),\n },\n run: async (ctx) => {\n const {\n documentType,\n parentId,\n name,\n limit,\n matchPath,\n matchValue,\n includeState,\n } = ctx.propsValue;\n const capped = Math.min(\n Math.max(typeof limit === \"number\" ? limit : DEFAULT_LIMIT, 1),\n MAX_LIMIT,\n );\n // A state match names a field but not its value, or the other way round:\n // that is an unfinished step, and answering it as \"no filter\" would return\n // every document of the type to something that asked for one.\n const path = typeof matchPath === \"string\" ? matchPath.trim() : \"\";\n const wanted = typeof matchValue === \"string\" ? matchValue.trim() : \"\";\n if ((path === \"\") !== (wanted === \"\")) {\n throw new Error(\n 'document-find: \"State field\" and \"State value\" are set together or not at all',\n );\n }\n // Neither the name nor the state filter is an index query, so either one\n // has to see more rows than the step will keep; without one, ask for\n // exactly the page wanted rather than a default page per model.\n const needle = typeof name === \"string\" ? name.trim().toLowerCase() : \"\";\n const filtered = needle !== \"\" || path !== \"\";\n const found = await reactorOf(ctx).find({\n ...(documentType ? { documentType } : {}),\n ...(parentId ? { parentId } : {}),\n ...(filtered ? {} : { limit: capped }),\n ...(path ? { match: { path, value: wanted } } : {}),\n ...(includeState === true ? { withState: true } : {}),\n });\n const documents = found\n .filter(\n (document) => !needle || document.name.toLowerCase().includes(needle),\n )\n .slice(0, capped);\n return { count: documents.length, documents };\n },\n});\n","import { createAction, reactorOf } from \"@powerhousedao/pieces-framework\";\nimport { resolveDocumentId } from \"../parse.js\";\nimport { documentIdProp, documentTypeProp } from \"../reactor.js\";\n\nexport const documentGetAction = createAction({\n name: \"document-get\",\n displayName: \"Get document\",\n description: \"Reads a document's current state.\",\n requireAuth: false,\n props: {\n documentId: documentIdProp(\n \"Document id\",\n true,\n \"e.g. {{steps.find.output.documents.0.documentId}}\",\n ),\n documentType: documentTypeProp(\n \"Document type\",\n false,\n \"Design-time hint when the document id is an expression\",\n ),\n },\n run: async (ctx) => {\n const documentId = resolveDocumentId(ctx.propsValue.documentId);\n if (!documentId) {\n throw new Error('document-get: \"documentId\" is required');\n }\n return reactorOf(ctx).get({ documentId });\n },\n});\n","import { createAction, reactorOf } from \"@powerhousedao/pieces-framework\";\nimport { resolveDocumentId } from \"../parse.js\";\nimport {\n actionTypeProp,\n documentIdProp,\n documentTypeProp,\n} from \"../reactor.js\";\n\nexport const documentSchemaAction = createAction({\n name: \"document-schema\",\n displayName: \"Get document schema\",\n description: \"Action and state schemas of a document type.\",\n requireAuth: false,\n props: {\n documentType: documentTypeProp(\n \"Document type\",\n false,\n \"Required unless a document id is given\",\n ),\n documentId: documentIdProp(\n \"Document id\",\n false,\n \"Resolves the type from this document instead\",\n ),\n actionType: actionTypeProp(\n \"Only this action\",\n false,\n \"Omit to list every action\",\n ),\n },\n run: async (ctx) => {\n const reactor = reactorOf(ctx);\n const { actionType } = ctx.propsValue;\n let documentType =\n typeof ctx.propsValue.documentType === \"string\"\n ? ctx.propsValue.documentType\n : \"\";\n // A document id is accepted in place of a type, for expression-fed steps.\n const fromId = resolveDocumentId(ctx.propsValue.documentId);\n if (!documentType && fromId) {\n documentType = (await reactor.get({ documentId: fromId })).documentType;\n }\n if (!documentType) {\n throw new Error('document-schema: \"documentType\" is required');\n }\n const model = await reactor.model(documentType);\n return {\n documentType: model.documentType,\n name: model.name,\n stateSchema: model.stateSchema,\n actions: actionType\n ? model.actions.filter((action) => action.type === actionType)\n : model.actions,\n };\n },\n});\n","import { createAction, reactorOf } from \"@powerhousedao/pieces-framework\";\n\nexport const documentTypesAction = createAction({\n name: \"document-types\",\n displayName: \"List document types\",\n description: \"Document models installed on this reactor.\",\n requireAuth: false,\n props: {},\n run: async (ctx) => {\n const types = await reactorOf(ctx).models();\n return { count: types.length, types };\n },\n});\n","// The three document triggers the reactor feeds.\n\n// Their hooks are never called: matching an operation against a filter is the\n// host's, because the processor sees every operation in the reactor and an IPC\n// round trip per operation would sit on that path. The piece declares them so\n// the editor reads their props and payload shape from the same place it reads\n// every other block's.\nimport {\n createTrigger,\n TriggerStrategy,\n} from \"@powerhousedao/pieces-framework\";\nimport {\n actionTypeProp,\n documentIdProp,\n documentTypeProp,\n driveProp,\n} from \"../reactor.js\";\n\n// A hook that runs would mean the host stopped feeding this trigger, which is\n// a bug in the host rather than something a piece can answer.\nfunction hostFed(name: string): () => Promise<never> {\n return () =>\n Promise.reject(\n new Error(`The \"${name}\" trigger is fired by the reactor, not polled`),\n );\n}\n\nconst OPERATION_SAMPLE = {\n documentId: \"01234567-89ab-cdef-0123-456789abcdef\",\n documentType: \"powerhouse/workflow\",\n branch: \"main\",\n scope: \"global\",\n action: { type: \"SET_NAME\", input: { name: \"Invoice\" } },\n operation: { index: 7, timestampUtcMs: \"1757500000000\" },\n};\n\nconst LIFECYCLE_SAMPLE = {\n documentId: \"01234567-89ab-cdef-0123-456789abcdef\",\n documentType: \"powerhouse/workflow\",\n name: \"Invoice\",\n driveId: \"fedcba98-7654-3210-fedc-ba9876543210\",\n parentId: null,\n operation: { index: 0, timestampUtcMs: \"1757500000000\" },\n};\n\nexport const documentEventTrigger = createTrigger({\n name: \"document-event\",\n displayName: \"Document event\",\n description: \"Fires when a matching document operation lands.\",\n type: TriggerStrategy.POLLING,\n requireAuth: false,\n props: {\n documentType: documentTypeProp(\n \"Document type\",\n false,\n \"e.g. powerhouse/connection\",\n ),\n documentId: documentIdProp(\n \"Document id\",\n false,\n \"Omit to match any document\",\n ),\n actionType: actionTypeProp(\n \"Action type\",\n false,\n \"Omit to match any action\",\n ),\n },\n sampleData: OPERATION_SAMPLE,\n onEnable: hostFed(\"document-event\"),\n onDisable: hostFed(\"document-event\"),\n run: hostFed(\"document-event\"),\n});\n\nexport const documentCreatedTrigger = createTrigger({\n name: \"document-created\",\n displayName: \"Document created\",\n description: \"Fires when a document is added to a drive.\",\n type: TriggerStrategy.POLLING,\n requireAuth: false,\n props: {\n documentType: documentTypeProp(\n \"Document type\",\n false,\n \"Type of the created document; omit to match any\",\n ),\n driveId: driveProp(\n \"Drive\",\n \"Omit to match documents outside every drive too\",\n ),\n },\n sampleData: LIFECYCLE_SAMPLE,\n onEnable: hostFed(\"document-created\"),\n onDisable: hostFed(\"document-created\"),\n run: hostFed(\"document-created\"),\n});\n\nexport const documentDeletedTrigger = createTrigger({\n name: \"document-deleted\",\n displayName: \"Document deleted\",\n description: \"Fires when a document is removed from a drive.\",\n type: TriggerStrategy.POLLING,\n requireAuth: false,\n props: {\n documentType: documentTypeProp(\n \"Document type\",\n false,\n \"Type of the deleted document; omit to match any\",\n ),\n driveId: driveProp(\n \"Drive\",\n \"Omit to match documents outside every drive too\",\n ),\n },\n sampleData: LIFECYCLE_SAMPLE,\n onEnable: hostFed(\"document-deleted\"),\n onDisable: hostFed(\"document-deleted\"),\n run: hostFed(\"document-deleted\"),\n});\n","// The Powerhouse reactor piece: documents and document models as workflow\n// blocks, for the reactor the workflow itself runs in.\n\n// It reaches the reactor through ctx.reactor, which the host serves over the\n// worker's call channel — piece code never holds a reactor client, and a copy\n// of this piece fetched from a registry would find the member throwing.\nimport { createPiece } from \"@powerhousedao/pieces-framework\";\nimport { POWERHOUSE_LOGO } from \"./lib/logo.js\";\nimport { documentCreateAction } from \"./lib/actions/document-create.js\";\nimport { documentDispatchAction } from \"./lib/actions/document-dispatch.js\";\nimport { documentFindAction } from \"./lib/actions/document-find.js\";\nimport { documentGetAction } from \"./lib/actions/document-get.js\";\nimport { documentSchemaAction } from \"./lib/actions/document-schema.js\";\nimport { documentTypesAction } from \"./lib/actions/document-types.js\";\nimport {\n documentCreatedTrigger,\n documentDeletedTrigger,\n documentEventTrigger,\n} from \"./lib/triggers/document-event.js\";\n\nexport const reactor = createPiece({\n displayName: \"Powerhouse Reactor\",\n description:\n \"Read and write Powerhouse documents on the reactor this workflow runs in: create documents, dispatch actions, read state and schemas, and fire on document events.\",\n logoUrl: POWERHOUSE_LOGO,\n authors: [\"powerhouse\"],\n // The reactor is reached through the host, not over a connection.\n auth: undefined,\n actions: [\n documentCreateAction,\n documentDispatchAction,\n documentGetAction,\n documentFindAction,\n documentSchemaAction,\n documentTypesAction,\n ],\n triggers: [\n documentEventTrigger,\n documentCreatedTrigger,\n documentDeletedTrigger,\n ],\n});\n\nexport default reactor;\n"],"x_google_ignoreList":[3],"mappings":";;;AAGA,MAAM,qBAAqB,EAAE,OAAO;CACnC,aAAa,EAAE,QAAQ;CACvB,aAAa,EAAE,SAAS,EAAE,QAAQ,CAAC;CACnC,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC;CACjC,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,QAAQ,OAAO,CAAC,CAAC;CAC3C,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;CAC5B,aAAa,EAAE,SAAS,EAAE,QAAQ,CAAC;CACnC,CAAC;AACF,MAAM,kBAAkB,IAAI,iBAAiB,EAAE,OA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OACA,2BACD;EACF;CACD,YAAY;CACZ,UAAU,QAAQ,iBAAiB;CACnC,WAAW,QAAQ,iBAAiB;CACpC,KAAK,QAAQ,iBAAiB;CAC/B,CAAC;AAEF,MAAa,yBAAyB,cAAc;CAClD,MAAM;CACN,aAAa;CACb,aAAa;CACb,MAAM,gBAAgB;CACtB,aAAa;CACb,OAAO;EACL,cAAc,iBACZ,iBACA,OACA,kDACD;EACD,SAAS,UACP,SACA,kDACD;EACF;CACD,YAAY;CACZ,UAAU,QAAQ,mBAAmB;CACrC,WAAW,QAAQ,mBAAmB;CACtC,KAAK,QAAQ,mBAAmB;CACjC,CAAC;AAEF,MAAa,yBAAyB,cAAc;CAClD,MAAM;CACN,aAAa;CACb,aAAa;CACb,MAAM,gBAAgB;CACtB,aAAa;CACb,OAAO;EACL,cAAc,iBACZ,iBACA,OACA,kDACD;EACD,SAAS,UACP,SACA,kDACD;EACF;CACD,YAAY;CACZ,UAAU,QAAQ,mBAAmB;CACrC,WAAW,QAAQ,mBAAmB;CACtC,KAAK,QAAQ,mBAAmB;CACjC,CAAC;;;AClGF,MAAa,UAAU,YAAY;CACjC,aAAa;CACb,aACE;CACF,SAAS;CACT,SAAS,CAAC,aAAa;CAEvB,MAAM,KAAA;CACN,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACD;CACD,UAAU;EACR;EACA;EACA;EACD;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["util.jsonStringifyReplacer","core.$ZodAsyncError","util.finalizeIssue","core.config","errors.$ZodRealError","errors.$ZodError","string","number","boolean","util.nullish","util.getLengthableOrigin","util.aborted","core.$ZodAsyncError","regexes.string","regexes.number","regexes.boolean","util.prefixIssues","util.optionalKeys","util.cached","isObject","util.isObject","util.finalizeIssue","core.config","util.cleanRegex","util.isPlainObject","util.getEnumValues","util.escapeRegex","core.$ZodEncodeError","util.issue","util.normalizeParams","_void","checks.$ZodCheckMinLength","checks.$ZodCheckRegex","describe","checks.$ZodCheck","meta","parse.parse","parse.safeParse","parse.parseAsync","parse.safeParseAsync","core.clone","core._string","core._url","number","core._number","core._boolean","core._any","core._unknown","core._void","util.normalizeParams","core._custom","core.describe","core.meta","core._coercedNumber","schemas.ZodMiniNumber","z.object","z.string","z.optional","z.boolean","z.enum","z.literal","z.any","z.unknown","z.array","z.number","z.void","z.object","z.optional","z.boolean","z.unknown","z.array","z.string","z.union","z.record","z.object","z.enum","z.optional","z.string","z.boolean","z.record","z.union","z.unknown","z.array","z.literal","z.any","z.object","z.optional","z.number","z.unknown","z.record","z.string","z.literal","z.enum","z.union","z.regex","z.pipe","z.transform","z.nullable","z.boolean","z.array","z.minLength","z.discriminatedUnion","z.url","z.coerce.number","z.custom","BLOCK"],"sources":["../../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/core.js","../../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js","../../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js","../../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js","../../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js","../../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js","../../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js","../../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js","../../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js","../../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js","../../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/mini/schemas.js","../../../../../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/mini/coerce.js","../../../../../pieces-framework/dist/markdown-property-Df2l6_y_.js","../../../../../pieces-framework/dist/input-COuhC1I-.js","../../../../../pieces-framework/dist/authentication-B7brX_It.js","../../../../../../node_modules/.pnpm/nanoid@3.3.17/node_modules/nanoid/index.js","../../../../../pieces-framework/dist/index.js","../../../../pieces/reactor/lib/logo.ts","../../../../pieces/reactor/lib/parse.ts","../../../../pieces/reactor/lib/reactor.ts","../../../../pieces/reactor/lib/actions/document-create.ts","../../../../pieces/reactor/lib/actions/document-dispatch.ts","../../../../pieces/reactor/lib/actions/document-find.ts","../../../../pieces/reactor/lib/actions/document-get.ts","../../../../pieces/reactor/lib/actions/document-schema.ts","../../../../pieces/reactor/lib/actions/document-types.ts","../../../../pieces/reactor/lib/triggers/document-event.ts","../../../../pieces/reactor/index.ts"],"sourcesContent":["/** A special constant with type `never` */\nexport const NEVER = Object.freeze({\n status: \"aborted\",\n});\nexport /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, params) {\n function init(inst, def) {\n if (!inst._zod) {\n Object.defineProperty(inst, \"_zod\", {\n value: {\n def,\n constr: _,\n traits: new Set(),\n },\n enumerable: false,\n });\n }\n if (inst._zod.traits.has(name)) {\n return;\n }\n inst._zod.traits.add(name);\n initializer(inst, def);\n // support prototype modifications\n const proto = _.prototype;\n const keys = Object.keys(proto);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n if (!(k in inst)) {\n inst[k] = proto[k].bind(inst);\n }\n }\n }\n // doesn't work if Parent has a constructor with arguments\n const Parent = params?.Parent ?? Object;\n class Definition extends Parent {\n }\n Object.defineProperty(Definition, \"name\", { value: name });\n function _(def) {\n var _a;\n const inst = params?.Parent ? new Definition() : this;\n init(inst, def);\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n for (const fn of inst._zod.deferred) {\n fn();\n }\n return inst;\n }\n Object.defineProperty(_, \"init\", { value: init });\n Object.defineProperty(_, Symbol.hasInstance, {\n value: (inst) => {\n if (params?.Parent && inst instanceof params.Parent)\n return true;\n return inst?._zod?.traits?.has(name);\n },\n });\n Object.defineProperty(_, \"name\", { value: name });\n return _;\n}\n////////////////////////////// UTILITIES ///////////////////////////////////////\nexport const $brand = Symbol(\"zod_brand\");\nexport class $ZodAsyncError extends Error {\n constructor() {\n super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);\n }\n}\nexport class $ZodEncodeError extends Error {\n constructor(name) {\n super(`Encountered unidirectional transform during encode: ${name}`);\n this.name = \"ZodEncodeError\";\n }\n}\nexport const globalConfig = {};\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n","// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n throw new Error(\"Unexpected value in exhaustive check\");\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n const values = Object.entries(entries)\n .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n .map(([_, v]) => v);\n return values;\n}\nexport function joinValues(array, separator = \"|\") {\n return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n if (typeof value === \"bigint\")\n return value.toString();\n return value;\n}\nexport function cached(getter) {\n const set = false;\n return {\n get value() {\n if (!set) {\n const value = getter();\n Object.defineProperty(this, \"value\", { value });\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n };\n}\nexport function nullish(input) {\n return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepString = step.toString();\n let stepDecCount = (stepString.split(\".\")[1] || \"\").length;\n if (stepDecCount === 0 && /\\d?e-\\d?/.test(stepString)) {\n const match = stepString.match(/\\d?e-(\\d?)/);\n if (match?.[1]) {\n stepDecCount = Number.parseInt(match[1]);\n }\n }\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nconst EVALUATING = Symbol(\"evaluating\");\nexport function defineLazy(object, key, getter) {\n let value = undefined;\n Object.defineProperty(object, key, {\n get() {\n if (value === EVALUATING) {\n // Circular reference detected, return undefined to break the cycle\n return undefined;\n }\n if (value === undefined) {\n value = EVALUATING;\n value = getter();\n }\n return value;\n },\n set(v) {\n Object.defineProperty(object, key, {\n value: v,\n // configurable: true,\n });\n // object[key] = v;\n },\n configurable: true,\n });\n}\nexport function objectClone(obj) {\n return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));\n}\nexport function assignProp(target, prop, value) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\nexport function mergeDefs(...defs) {\n const mergedDescriptors = {};\n for (const def of defs) {\n const descriptors = Object.getOwnPropertyDescriptors(def);\n Object.assign(mergedDescriptors, descriptors);\n }\n return Object.defineProperties({}, mergedDescriptors);\n}\nexport function cloneDef(schema) {\n return mergeDefs(schema._zod.def);\n}\nexport function getElementAtPath(obj, path) {\n if (!path)\n return obj;\n return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n const keys = Object.keys(promisesObj);\n const promises = keys.map((key) => promisesObj[key]);\n return Promise.all(promises).then((results) => {\n const resolvedObj = {};\n for (let i = 0; i < keys.length; i++) {\n resolvedObj[keys[i]] = results[i];\n }\n return resolvedObj;\n });\n}\nexport function randomString(length = 10) {\n const chars = \"abcdefghijklmnopqrstuvwxyz\";\n let str = \"\";\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n}\nexport function esc(str) {\n return JSON.stringify(str);\n}\nexport function slugify(input) {\n return input\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\nexport const captureStackTrace = (\"captureStackTrace\" in Error ? Error.captureStackTrace : (..._args) => { });\nexport function isObject(data) {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = cached(() => {\n // @ts-ignore\n if (typeof navigator !== \"undefined\" && navigator?.userAgent?.includes(\"Cloudflare\")) {\n return false;\n }\n try {\n const F = Function;\n new F(\"\");\n return true;\n }\n catch (_) {\n return false;\n }\n});\nexport function isPlainObject(o) {\n if (isObject(o) === false)\n return false;\n // modified constructor\n const ctor = o.constructor;\n if (ctor === undefined)\n return true;\n if (typeof ctor !== \"function\")\n return true;\n // modified prototype\n const prot = ctor.prototype;\n if (isObject(prot) === false)\n return false;\n // ctor doesn't have static `isPrototypeOf`\n if (Object.prototype.hasOwnProperty.call(prot, \"isPrototypeOf\") === false) {\n return false;\n }\n return true;\n}\nexport function shallowClone(o) {\n if (isPlainObject(o))\n return { ...o };\n if (Array.isArray(o))\n return [...o];\n return o;\n}\nexport function numKeys(data) {\n let keyCount = 0;\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n keyCount++;\n }\n }\n return keyCount;\n}\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n return \"string\";\n case \"number\":\n return Number.isNaN(data) ? \"nan\" : \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"function\":\n return \"function\";\n case \"bigint\":\n return \"bigint\";\n case \"symbol\":\n return \"symbol\";\n case \"object\":\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return \"promise\";\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return \"map\";\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return \"set\";\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return \"date\";\n }\n // @ts-ignore\n if (typeof File !== \"undefined\" && data instanceof File) {\n return \"file\";\n }\n return \"object\";\n default:\n throw new Error(`Unknown data type: ${t}`);\n }\n};\nexport const propertyKeyTypes = new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = new Set([\"string\", \"number\", \"bigint\", \"boolean\", \"symbol\", \"undefined\"]);\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n const cl = new inst._zod.constr(def ?? inst._zod.def);\n if (!def || params?.parent)\n cl._zod.parent = inst;\n return cl;\n}\nexport function normalizeParams(_params) {\n const params = _params;\n if (!params)\n return {};\n if (typeof params === \"string\")\n return { error: () => params };\n if (params?.message !== undefined) {\n if (params?.error !== undefined)\n throw new Error(\"Cannot specify both `message` and `error` params\");\n params.error = params.message;\n }\n delete params.message;\n if (typeof params.error === \"string\")\n return { ...params, error: () => params.error };\n return params;\n}\nexport function createTransparentProxy(getter) {\n let target;\n return new Proxy({}, {\n get(_, prop, receiver) {\n target ?? (target = getter());\n return Reflect.get(target, prop, receiver);\n },\n set(_, prop, value, receiver) {\n target ?? (target = getter());\n return Reflect.set(target, prop, value, receiver);\n },\n has(_, prop) {\n target ?? (target = getter());\n return Reflect.has(target, prop);\n },\n deleteProperty(_, prop) {\n target ?? (target = getter());\n return Reflect.deleteProperty(target, prop);\n },\n ownKeys(_) {\n target ?? (target = getter());\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(_, prop) {\n target ?? (target = getter());\n return Reflect.getOwnPropertyDescriptor(target, prop);\n },\n defineProperty(_, prop, descriptor) {\n target ?? (target = getter());\n return Reflect.defineProperty(target, prop, descriptor);\n },\n });\n}\nexport function stringifyPrimitive(value) {\n if (typeof value === \"bigint\")\n return value.toString() + \"n\";\n if (typeof value === \"string\")\n return `\"${value}\"`;\n return `${value}`;\n}\nexport function optionalKeys(shape) {\n return Object.keys(shape).filter((k) => {\n return shape[k]._zod.optin === \"optional\" && shape[k]._zod.optout === \"optional\";\n });\n}\nexport const NUMBER_FORMAT_RANGES = {\n safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n int32: [-2147483648, 2147483647],\n uint32: [0, 4294967295],\n float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n};\nexport const BIGINT_FORMAT_RANGES = {\n int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".pick() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = {};\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n newShape[key] = currDef.shape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function omit(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".omit() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = { ...schema._zod.def.shape };\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n delete newShape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function extend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to extend: expected a plain object\");\n }\n const checks = schema._zod.def.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n // Only throw if new shape overlaps with existing shape\n // Use getOwnPropertyDescriptor to check key existence without accessing values\n const existingShape = schema._zod.def.shape;\n for (const key in shape) {\n if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {\n throw new Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\");\n }\n }\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function safeExtend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function merge(a, b) {\n const def = mergeDefs(a._zod.def, {\n get shape() {\n const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n get catchall() {\n return b._zod.def.catchall;\n },\n checks: [], // delete existing checks\n });\n return clone(a, def);\n}\nexport function partial(Class, schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".partial() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in oldShape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n else {\n for (const key in oldShape) {\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function required(Class, schema, mask) {\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n else {\n for (const key in oldShape) {\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n });\n return clone(schema, def);\n}\n// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom\nexport function aborted(x, startIndex = 0) {\n if (x.aborted === true)\n return true;\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i]?.continue !== true) {\n return true;\n }\n }\n return false;\n}\nexport function prefixIssues(path, issues) {\n return issues.map((iss) => {\n var _a;\n (_a = iss).path ?? (_a.path = []);\n iss.path.unshift(path);\n return iss;\n });\n}\nexport function unwrapMessage(message) {\n return typeof message === \"string\" ? message : message?.message;\n}\nexport function finalizeIssue(iss, ctx, config) {\n const full = { ...iss, path: iss.path ?? [] };\n // for backwards compatibility\n if (!iss.message) {\n const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\";\n full.message = message;\n }\n // delete (full as any).def;\n delete full.inst;\n delete full.continue;\n if (!ctx?.reportInput) {\n delete full.input;\n }\n return full;\n}\nexport function getSizableOrigin(input) {\n if (input instanceof Set)\n return \"set\";\n if (input instanceof Map)\n return \"map\";\n // @ts-ignore\n if (input instanceof File)\n return \"file\";\n return \"unknown\";\n}\nexport function getLengthableOrigin(input) {\n if (Array.isArray(input))\n return \"array\";\n if (typeof input === \"string\")\n return \"string\";\n return \"unknown\";\n}\nexport function parsedType(data) {\n const t = typeof data;\n switch (t) {\n case \"number\": {\n return Number.isNaN(data) ? \"nan\" : \"number\";\n }\n case \"object\": {\n if (data === null) {\n return \"null\";\n }\n if (Array.isArray(data)) {\n return \"array\";\n }\n const obj = data;\n if (obj && Object.getPrototypeOf(obj) !== Object.prototype && \"constructor\" in obj && obj.constructor) {\n return obj.constructor.name;\n }\n }\n }\n return t;\n}\nexport function issue(...args) {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n return { ...iss };\n}\nexport function cleanEnum(obj) {\n return Object.entries(obj)\n .filter(([k, _]) => {\n // return true if NaN, meaning it's not a number, thus a string key\n return Number.isNaN(Number.parseInt(k, 10));\n })\n .map((el) => el[1]);\n}\n// Codec utility functions\nexport function base64ToUint8Array(base64) {\n const binaryString = atob(base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes;\n}\nexport function uint8ArrayToBase64(bytes) {\n let binaryString = \"\";\n for (let i = 0; i < bytes.length; i++) {\n binaryString += String.fromCharCode(bytes[i]);\n }\n return btoa(binaryString);\n}\nexport function base64urlToUint8Array(base64url) {\n const base64 = base64url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padding = \"=\".repeat((4 - (base64.length % 4)) % 4);\n return base64ToUint8Array(base64 + padding);\n}\nexport function uint8ArrayToBase64url(bytes) {\n return uint8ArrayToBase64(bytes).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\");\n}\nexport function hexToUint8Array(hex) {\n const cleanHex = hex.replace(/^0x/, \"\");\n if (cleanHex.length % 2 !== 0) {\n throw new Error(\"Invalid hex string length\");\n }\n const bytes = new Uint8Array(cleanHex.length / 2);\n for (let i = 0; i < cleanHex.length; i += 2) {\n bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);\n }\n return bytes;\n}\nexport function uint8ArrayToHex(bytes) {\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n// instanceof\nexport class Class {\n constructor(..._args) { }\n}\n","import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n Object.defineProperty(inst, \"_zod\", {\n value: inst._zod,\n enumerable: false,\n });\n Object.defineProperty(inst, \"issues\", {\n value: def,\n enumerable: false,\n });\n inst.message = JSON.stringify(def, util.jsonStringifyReplacer, 2);\n Object.defineProperty(inst, \"toString\", {\n value: () => inst.message,\n enumerable: false,\n });\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, { Parent: Error });\nexport function flattenError(error, mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of error.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n}\nexport function formatError(error, mapper = (issue) => issue.message) {\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues });\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues });\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(error);\n return fieldErrors;\n}\nexport function treeifyError(error, mapper = (issue) => issue.message) {\n const result = { errors: [] };\n const processError = (error, path = []) => {\n var _a, _b;\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n // regular union error\n issue.errors.map((issues) => processError({ issues }, issue.path));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n result.errors.push(mapper(issue));\n continue;\n }\n let curr = result;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (typeof el === \"string\") {\n curr.properties ?? (curr.properties = {});\n (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_b = curr.items)[el] ?? (_b[el] = { errors: [] });\n curr = curr.items[el];\n }\n if (terminal) {\n curr.errors.push(mapper(issue));\n }\n i++;\n }\n }\n }\n };\n processError(error);\n return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(_path) {\n const segs = [];\n const path = _path.map((seg) => (typeof seg === \"object\" ? seg.key : seg));\n for (const seg of path) {\n if (typeof seg === \"number\")\n segs.push(`[${seg}]`);\n else if (typeof seg === \"symbol\")\n segs.push(`[${JSON.stringify(String(seg))}]`);\n else if (/[^\\w$]/.test(seg))\n segs.push(`[${JSON.stringify(seg)}]`);\n else {\n if (segs.length)\n segs.push(\".\");\n segs.push(seg);\n }\n }\n return segs.join(\"\");\n}\nexport function prettifyError(error) {\n const lines = [];\n // sort by path length\n const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);\n // Process each issue\n for (const issue of issues) {\n lines.push(`✖ ${issue.message}`);\n if (issue.path?.length)\n lines.push(` → at ${toDotPath(issue.path)}`);\n }\n // Convert Map to formatted string\n return lines.join(\"\\n\");\n}\n","import * as core from \"./core.js\";\nimport * as errors from \"./errors.js\";\nimport * as util from \"./util.js\";\nexport const _parse = (_Err) => (schema, value, _ctx, _params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n if (result.issues.length) {\n const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, _params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n if (result.issues.length) {\n const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);\nexport const _safeParse = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length\n ? {\n success: false,\n error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length\n ? {\n success: false,\n error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\nexport const _encode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parse(_Err)(schema, value, ctx);\n};\nexport const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);\nexport const _decode = (_Err) => (schema, value, _ctx) => {\n return _parse(_Err)(schema, value, _ctx);\n};\nexport const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);\nexport const _encodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parseAsync(_Err)(schema, value, ctx);\n};\nexport const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);\nexport const _decodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _parseAsync(_Err)(schema, value, _ctx);\n};\nexport const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);\nexport const _safeEncode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParse(_Err)(schema, value, ctx);\n};\nexport const safeEncode = /* @__PURE__*/ _safeEncode(errors.$ZodRealError);\nexport const _safeDecode = (_Err) => (schema, value, _ctx) => {\n return _safeParse(_Err)(schema, value, _ctx);\n};\nexport const safeDecode = /* @__PURE__*/ _safeDecode(errors.$ZodRealError);\nexport const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParseAsync(_Err)(schema, value, ctx);\n};\nexport const safeEncodeAsync = /* @__PURE__*/ _safeEncodeAsync(errors.$ZodRealError);\nexport const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _safeParseAsync(_Err)(schema, value, _ctx);\n};\nexport const safeDecodeAsync = /* @__PURE__*/ _safeDecodeAsync(errors.$ZodRealError);\n","import * as util from \"./util.js\";\nexport const cuid = /^[cC][^\\s-]{8,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\n/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */\nexport const duration = /^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;\n/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */\nexport const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */\nexport const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;\n/** Returns a regex for validating an RFC 9562/4122 UUID.\n *\n * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */\nexport const uuid = (version) => {\n if (!version)\n return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;\n return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);\n};\nexport const uuid4 = /*@__PURE__*/ uuid(4);\nexport const uuid6 = /*@__PURE__*/ uuid(6);\nexport const uuid7 = /*@__PURE__*/ uuid(7);\n/** Practical email validation */\nexport const email = /^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;\n/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */\nexport const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/** The classic emailregex.com regex for RFC 5322-compliant emails */\nexport const rfc5322Email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */\nexport const unicodeEmail = /^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u;\nexport const idnEmail = unicodeEmail;\nexport const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emoji = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nexport function emoji() {\n return new RegExp(_emoji, \"u\");\n}\nexport const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nexport const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;\nexport const mac = (delimiter) => {\n const escapedDelim = util.escapeRegex(delimiter ?? \":\");\n return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);\n};\nexport const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/;\nexport const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nexport const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;\nexport const base64url = /^[A-Za-z0-9_-]*$/;\n// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address\n// export const hostname: RegExp = /^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/;\nexport const hostname = /^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$/;\nexport const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)\n// E.164: leading digit must be 1-9; total digits (excluding '+') between 7-15\nexport const e164 = /^\\+[1-9]\\d{6,14}$/;\n// const dateSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateSource = `(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))`;\nexport const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);\nfunction timeSource(args) {\n const hhmm = `(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;\n const regex = typeof args.precision === \"number\"\n ? args.precision === -1\n ? `${hhmm}`\n : args.precision === 0\n ? `${hhmm}:[0-5]\\\\d`\n : `${hhmm}:[0-5]\\\\d\\\\.\\\\d{${args.precision}}`\n : `${hhmm}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`;\n return regex;\n}\nexport function time(args) {\n return new RegExp(`^${timeSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetime(args) {\n const time = timeSource({ precision: args.precision });\n const opts = [\"Z\"];\n if (args.local)\n opts.push(\"\");\n // if (args.offset) opts.push(`([+-]\\\\d{2}:\\\\d{2})`);\n if (args.offset)\n opts.push(`([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)`);\n const timeRegex = `${time}(?:${opts.join(\"|\")})`;\n return new RegExp(`^${dateSource}T(?:${timeRegex})$`);\n}\nexport const string = (params) => {\n const regex = params ? `[\\\\s\\\\S]{${params?.minimum ?? 0},${params?.maximum ?? \"\"}}` : `[\\\\s\\\\S]*`;\n return new RegExp(`^${regex}$`);\n};\nexport const bigint = /^-?\\d+n?$/;\nexport const integer = /^-?\\d+$/;\nexport const number = /^-?\\d+(?:\\.\\d+)?$/;\nexport const boolean = /^(?:true|false)$/i;\nconst _null = /^null$/i;\nexport { _null as null };\nconst _undefined = /^undefined$/i;\nexport { _undefined as undefined };\n// regex for string with no uppercase letters\nexport const lowercase = /^[^A-Z]*$/;\n// regex for string with no lowercase letters\nexport const uppercase = /^[^a-z]*$/;\n// regex for hexadecimal strings (any length)\nexport const hex = /^[0-9a-fA-F]*$/;\n// Hash regexes for different algorithms and encodings\n// Helper function to create base64 regex with exact length and padding\nfunction fixedBase64(bodyLength, padding) {\n return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);\n}\n// Helper function to create base64url regex with exact length (no padding)\nfunction fixedBase64url(length) {\n return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);\n}\n// MD5 (16 bytes): base64 = 24 chars total (22 + \"==\")\nexport const md5_hex = /^[0-9a-fA-F]{32}$/;\nexport const md5_base64 = /*@__PURE__*/ fixedBase64(22, \"==\");\nexport const md5_base64url = /*@__PURE__*/ fixedBase64url(22);\n// SHA1 (20 bytes): base64 = 28 chars total (27 + \"=\")\nexport const sha1_hex = /^[0-9a-fA-F]{40}$/;\nexport const sha1_base64 = /*@__PURE__*/ fixedBase64(27, \"=\");\nexport const sha1_base64url = /*@__PURE__*/ fixedBase64url(27);\n// SHA256 (32 bytes): base64 = 44 chars total (43 + \"=\")\nexport const sha256_hex = /^[0-9a-fA-F]{64}$/;\nexport const sha256_base64 = /*@__PURE__*/ fixedBase64(43, \"=\");\nexport const sha256_base64url = /*@__PURE__*/ fixedBase64url(43);\n// SHA384 (48 bytes): base64 = 64 chars total (no padding)\nexport const sha384_hex = /^[0-9a-fA-F]{96}$/;\nexport const sha384_base64 = /*@__PURE__*/ fixedBase64(64, \"\");\nexport const sha384_base64url = /*@__PURE__*/ fixedBase64url(64);\n// SHA512 (64 bytes): base64 = 88 chars total (86 + \"==\")\nexport const sha512_hex = /^[0-9a-fA-F]{128}$/;\nexport const sha512_base64 = /*@__PURE__*/ fixedBase64(86, \"==\");\nexport const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);\n","// import { $ZodType } from \"./schemas.js\";\nimport * as core from \"./core.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nexport const $ZodCheck = /*@__PURE__*/ core.$constructor(\"$ZodCheck\", (inst, def) => {\n var _a;\n inst._zod ?? (inst._zod = {});\n inst._zod.def = def;\n (_a = inst._zod).onattach ?? (_a.onattach = []);\n});\nconst numericOriginMap = {\n number: \"number\",\n bigint: \"bigint\",\n object: \"date\",\n};\nexport const $ZodCheckLessThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckLessThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;\n if (def.value < curr) {\n if (def.inclusive)\n bag.maximum = def.value;\n else\n bag.exclusiveMaximum = def.value;\n }\n });\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {\n return;\n }\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckGreaterThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckGreaterThan\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const origin = numericOriginMap[typeof def.value];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;\n if (def.value > curr) {\n if (def.inclusive)\n bag.minimum = def.value;\n else\n bag.exclusiveMinimum = def.value;\n }\n });\n inst._zod.check = (payload) => {\n if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {\n return;\n }\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n input: payload.value,\n inclusive: def.inclusive,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMultipleOf = \n/*@__PURE__*/ core.$constructor(\"$ZodCheckMultipleOf\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.onattach.push((inst) => {\n var _a;\n (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);\n });\n inst._zod.check = (payload) => {\n if (typeof payload.value !== typeof def.value)\n throw new Error(\"Cannot mix number and bigint in multiple_of check.\");\n const isMultiple = typeof payload.value === \"bigint\"\n ? payload.value % def.value === BigInt(0)\n : util.floatSafeRemainder(payload.value, def.value) === 0;\n if (isMultiple)\n return;\n payload.issues.push({\n origin: typeof payload.value,\n code: \"not_multiple_of\",\n divisor: def.value,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckNumberFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n def.format = def.format || \"float64\";\n const isInt = def.format?.includes(\"int\");\n const origin = isInt ? \"int\" : \"number\";\n const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n bag.minimum = minimum;\n bag.maximum = maximum;\n if (isInt)\n bag.pattern = regexes.integer;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (isInt) {\n if (!Number.isInteger(input)) {\n // invalid_format issue\n // payload.issues.push({\n // expected: def.format,\n // format: def.format,\n // code: \"invalid_format\",\n // input,\n // inst,\n // });\n // invalid_type issue\n payload.issues.push({\n expected: origin,\n format: def.format,\n code: \"invalid_type\",\n continue: false,\n input,\n inst,\n });\n return;\n // not_multiple_of issue\n // payload.issues.push({\n // code: \"not_multiple_of\",\n // origin: \"number\",\n // input,\n // inst,\n // divisor: 1,\n // });\n }\n if (!Number.isSafeInteger(input)) {\n if (input > 0) {\n // too_big\n payload.issues.push({\n input,\n code: \"too_big\",\n maximum: Number.MAX_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n else {\n // too_small\n payload.issues.push({\n input,\n code: \"too_small\",\n minimum: Number.MIN_SAFE_INTEGER,\n note: \"Integers must be within the safe integer range.\",\n inst,\n origin,\n inclusive: true,\n continue: !def.abort,\n });\n }\n return;\n }\n }\n if (input < minimum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_small\",\n minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"number\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckBigIntFormat\", (inst, def) => {\n $ZodCheck.init(inst, def); // no format checks\n const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n bag.minimum = minimum;\n bag.maximum = maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n if (input < minimum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_small\",\n minimum: minimum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n if (input > maximum) {\n payload.issues.push({\n origin: \"bigint\",\n input,\n code: \"too_big\",\n maximum,\n inclusive: true,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodCheckMaxSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n if (def.maximum < curr)\n inst._zod.bag.maximum = def.maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size <= def.maximum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinSize\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n if (def.minimum > curr)\n inst._zod.bag.minimum = def.minimum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size >= def.minimum)\n return;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckSizeEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckSizeEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.size !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.minimum = def.size;\n bag.maximum = def.size;\n bag.size = def.size;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const size = input.size;\n if (size === def.size)\n return;\n const tooBig = size > def.size;\n payload.issues.push({\n origin: util.getSizableOrigin(input),\n ...(tooBig ? { code: \"too_big\", maximum: def.size } : { code: \"too_small\", minimum: def.size }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMaxLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n if (def.maximum < curr)\n inst._zod.bag.maximum = def.maximum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length <= def.maximum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_big\",\n maximum: def.maximum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckMinLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinLength\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n if (def.minimum > curr)\n inst._zod.bag.minimum = def.minimum;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length >= def.minimum)\n return;\n const origin = util.getLengthableOrigin(input);\n payload.issues.push({\n origin,\n code: \"too_small\",\n minimum: def.minimum,\n inclusive: true,\n input,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLengthEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckLengthEquals\", (inst, def) => {\n var _a;\n $ZodCheck.init(inst, def);\n (_a = inst._zod.def).when ?? (_a.when = (payload) => {\n const val = payload.value;\n return !util.nullish(val) && val.length !== undefined;\n });\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.minimum = def.length;\n bag.maximum = def.length;\n bag.length = def.length;\n });\n inst._zod.check = (payload) => {\n const input = payload.value;\n const length = input.length;\n if (length === def.length)\n return;\n const origin = util.getLengthableOrigin(input);\n const tooBig = length > def.length;\n payload.issues.push({\n origin,\n ...(tooBig ? { code: \"too_big\", maximum: def.length } : { code: \"too_small\", minimum: def.length }),\n inclusive: true,\n exact: true,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckStringFormat\", (inst, def) => {\n var _a, _b;\n $ZodCheck.init(inst, def);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.format = def.format;\n if (def.pattern) {\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(def.pattern);\n }\n });\n if (def.pattern)\n (_a = inst._zod).check ?? (_a.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n ...(def.pattern ? { pattern: def.pattern.toString() } : {}),\n inst,\n continue: !def.abort,\n });\n });\n else\n (_b = inst._zod).check ?? (_b.check = () => { });\n});\nexport const $ZodCheckRegex = /*@__PURE__*/ core.$constructor(\"$ZodCheckRegex\", (inst, def) => {\n $ZodCheckStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n def.pattern.lastIndex = 0;\n if (def.pattern.test(payload.value))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"regex\",\n input: payload.value,\n pattern: def.pattern.toString(),\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckLowerCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckLowerCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.lowercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckUpperCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckUpperCase\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.uppercase);\n $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckIncludes = /*@__PURE__*/ core.$constructor(\"$ZodCheckIncludes\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const escapedRegex = util.escapeRegex(def.includes);\n const pattern = new RegExp(typeof def.position === \"number\" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);\n def.pattern = pattern;\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.includes(def.includes, def.position))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"includes\",\n includes: def.includes,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckStartsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckStartsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.startsWith(def.prefix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"starts_with\",\n prefix: def.prefix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckEndsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckEndsWith\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);\n def.pattern ?? (def.pattern = pattern);\n inst._zod.onattach.push((inst) => {\n const bag = inst._zod.bag;\n bag.patterns ?? (bag.patterns = new Set());\n bag.patterns.add(pattern);\n });\n inst._zod.check = (payload) => {\n if (payload.value.endsWith(def.suffix))\n return;\n payload.issues.push({\n origin: \"string\",\n code: \"invalid_format\",\n format: \"ends_with\",\n suffix: def.suffix,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n///////////////////////////////////\n///// $ZodCheckProperty /////\n///////////////////////////////////\nfunction handleCheckPropertyResult(result, payload, property) {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(property, result.issues));\n }\n}\nexport const $ZodCheckProperty = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperty\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n const result = def.schema._zod.run({\n value: payload.value[def.property],\n issues: [],\n }, {});\n if (result instanceof Promise) {\n return result.then((result) => handleCheckPropertyResult(result, payload, def.property));\n }\n handleCheckPropertyResult(result, payload, def.property);\n return;\n };\n});\nexport const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor(\"$ZodCheckMimeType\", (inst, def) => {\n $ZodCheck.init(inst, def);\n const mimeSet = new Set(def.mime);\n inst._zod.onattach.push((inst) => {\n inst._zod.bag.mime = def.mime;\n });\n inst._zod.check = (payload) => {\n if (mimeSet.has(payload.value.type))\n return;\n payload.issues.push({\n code: \"invalid_value\",\n values: def.mime,\n input: payload.value.type,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCheckOverwrite = /*@__PURE__*/ core.$constructor(\"$ZodCheckOverwrite\", (inst, def) => {\n $ZodCheck.init(inst, def);\n inst._zod.check = (payload) => {\n payload.value = def.tx(payload.value);\n };\n});\n","export const version = {\n major: 4,\n minor: 3,\n patch: 6,\n};\n","import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { parse, parseAsync, safeParse, safeParseAsync } from \"./parse.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nimport { version } from \"./versions.js\";\nexport const $ZodType = /*@__PURE__*/ core.$constructor(\"$ZodType\", (inst, def) => {\n var _a;\n inst ?? (inst = {});\n inst._zod.def = def; // set _def property\n inst._zod.bag = inst._zod.bag || {}; // initialize _bag object\n inst._zod.version = version;\n const checks = [...(inst._zod.def.checks ?? [])];\n // if inst is itself a checks.$ZodCheck, run it as a check\n if (inst._zod.traits.has(\"$ZodCheck\")) {\n checks.unshift(inst);\n }\n for (const ch of checks) {\n for (const fn of ch._zod.onattach) {\n fn(inst);\n }\n }\n if (checks.length === 0) {\n // deferred initializer\n // inst._zod.parse is not yet defined\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred?.push(() => {\n inst._zod.run = inst._zod.parse;\n });\n }\n else {\n const runChecks = (payload, checks, ctx) => {\n let isAborted = util.aborted(payload);\n let asyncResult;\n for (const ch of checks) {\n if (ch._zod.def.when) {\n const shouldRun = ch._zod.def.when(payload);\n if (!shouldRun)\n continue;\n }\n else if (isAborted) {\n continue;\n }\n const currLen = payload.issues.length;\n const _ = ch._zod.check(payload);\n if (_ instanceof Promise && ctx?.async === false) {\n throw new core.$ZodAsyncError();\n }\n if (asyncResult || _ instanceof Promise) {\n asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {\n await _;\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n return;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n });\n }\n else {\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n continue;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n }\n }\n if (asyncResult) {\n return asyncResult.then(() => {\n return payload;\n });\n }\n return payload;\n };\n const handleCanaryResult = (canary, payload, ctx) => {\n // abort if the canary is aborted\n if (util.aborted(canary)) {\n canary.aborted = true;\n return canary;\n }\n // run checks first, then\n const checkResult = runChecks(payload, checks, ctx);\n if (checkResult instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));\n }\n return inst._zod.parse(checkResult, ctx);\n };\n inst._zod.run = (payload, ctx) => {\n if (ctx.skipChecks) {\n return inst._zod.parse(payload, ctx);\n }\n if (ctx.direction === \"backward\") {\n // run canary\n // initial pass (no checks)\n const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });\n if (canary instanceof Promise) {\n return canary.then((canary) => {\n return handleCanaryResult(canary, payload, ctx);\n });\n }\n return handleCanaryResult(canary, payload, ctx);\n }\n // forward\n const result = inst._zod.parse(payload, ctx);\n if (result instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return result.then((result) => runChecks(result, checks, ctx));\n }\n return runChecks(result, checks, ctx);\n };\n }\n // Lazy initialize ~standard to avoid creating objects for every schema\n util.defineLazy(inst, \"~standard\", () => ({\n validate: (value) => {\n try {\n const r = safeParse(inst, value);\n return r.success ? { value: r.data } : { issues: r.error?.issues };\n }\n catch (_) {\n return safeParseAsync(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));\n }\n },\n vendor: \"zod\",\n version: 1,\n }));\n});\nexport { clone } from \"./util.js\";\nexport const $ZodString = /*@__PURE__*/ core.$constructor(\"$ZodString\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);\n inst._zod.parse = (payload, _) => {\n if (def.coerce)\n try {\n payload.value = String(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"string\")\n return payload;\n payload.issues.push({\n expected: \"string\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodStringFormat\", (inst, def) => {\n // check initialization must come first\n checks.$ZodCheckStringFormat.init(inst, def);\n $ZodString.init(inst, def);\n});\nexport const $ZodGUID = /*@__PURE__*/ core.$constructor(\"$ZodGUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.guid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodUUID = /*@__PURE__*/ core.$constructor(\"$ZodUUID\", (inst, def) => {\n if (def.version) {\n const versionMap = {\n v1: 1,\n v2: 2,\n v3: 3,\n v4: 4,\n v5: 5,\n v6: 6,\n v7: 7,\n v8: 8,\n };\n const v = versionMap[def.version];\n if (v === undefined)\n throw new Error(`Invalid UUID version: \"${def.version}\"`);\n def.pattern ?? (def.pattern = regexes.uuid(v));\n }\n else\n def.pattern ?? (def.pattern = regexes.uuid());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodEmail = /*@__PURE__*/ core.$constructor(\"$ZodEmail\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.email);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodURL = /*@__PURE__*/ core.$constructor(\"$ZodURL\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n try {\n // Trim whitespace from input\n const trimmed = payload.value.trim();\n // @ts-ignore\n const url = new URL(trimmed);\n if (def.hostname) {\n def.hostname.lastIndex = 0;\n if (!def.hostname.test(url.hostname)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid hostname\",\n pattern: def.hostname.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n if (def.protocol) {\n def.protocol.lastIndex = 0;\n if (!def.protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid protocol\",\n pattern: def.protocol.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n // Set the output value based on normalize flag\n if (def.normalize) {\n // Use normalized URL\n payload.value = url.href;\n }\n else {\n // Preserve the original input (trimmed)\n payload.value = trimmed;\n }\n return;\n }\n catch (_) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodEmoji = /*@__PURE__*/ core.$constructor(\"$ZodEmoji\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.emoji());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodNanoID = /*@__PURE__*/ core.$constructor(\"$ZodNanoID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.nanoid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID = /*@__PURE__*/ core.$constructor(\"$ZodCUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID2 = /*@__PURE__*/ core.$constructor(\"$ZodCUID2\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid2);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodULID = /*@__PURE__*/ core.$constructor(\"$ZodULID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ulid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodXID = /*@__PURE__*/ core.$constructor(\"$ZodXID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.xid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodKSUID = /*@__PURE__*/ core.$constructor(\"$ZodKSUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ksuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODateTime = /*@__PURE__*/ core.$constructor(\"$ZodISODateTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.datetime(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODate = /*@__PURE__*/ core.$constructor(\"$ZodISODate\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.date);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISOTime = /*@__PURE__*/ core.$constructor(\"$ZodISOTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.time(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODuration = /*@__PURE__*/ core.$constructor(\"$ZodISODuration\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.duration);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodIPv4 = /*@__PURE__*/ core.$constructor(\"$ZodIPv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv4);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv4`;\n});\nexport const $ZodIPv6 = /*@__PURE__*/ core.$constructor(\"$ZodIPv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv6);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv6`;\n inst._zod.check = (payload) => {\n try {\n // @ts-ignore\n new URL(`http://[${payload.value}]`);\n // return;\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"ipv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodMAC = /*@__PURE__*/ core.$constructor(\"$ZodMAC\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.mac(def.delimiter));\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `mac`;\n});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv4);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n const parts = payload.value.split(\"/\");\n try {\n if (parts.length !== 2)\n throw new Error();\n const [address, prefix] = parts;\n if (!prefix)\n throw new Error();\n const prefixNum = Number(prefix);\n if (`${prefixNum}` !== prefix)\n throw new Error();\n if (prefixNum < 0 || prefixNum > 128)\n throw new Error();\n // @ts-ignore\n new URL(`http://[${address}]`);\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"cidrv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64(data) {\n if (data === \"\")\n return true;\n if (data.length % 4 !== 0)\n return false;\n try {\n // @ts-ignore\n atob(data);\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64\";\n inst._zod.check = (payload) => {\n if (isValidBase64(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64URL(data) {\n if (!regexes.base64url.test(data))\n return false;\n const base64 = data.replace(/[-_]/g, (c) => (c === \"-\" ? \"+\" : \"/\"));\n const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, \"=\");\n return isValidBase64(padded);\n}\nexport const $ZodBase64URL = /*@__PURE__*/ core.$constructor(\"$ZodBase64URL\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64url);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64url\";\n inst._zod.check = (payload) => {\n if (isValidBase64URL(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodE164 = /*@__PURE__*/ core.$constructor(\"$ZodE164\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.e164);\n $ZodStringFormat.init(inst, def);\n});\n////////////////////////////// ZodJWT //////////////////////////////\nexport function isValidJWT(token, algorithm = null) {\n try {\n const tokensParts = token.split(\".\");\n if (tokensParts.length !== 3)\n return false;\n const [header] = tokensParts;\n if (!header)\n return false;\n // @ts-ignore\n const parsedHeader = JSON.parse(atob(header));\n if (\"typ\" in parsedHeader && parsedHeader?.typ !== \"JWT\")\n return false;\n if (!parsedHeader.alg)\n return false;\n if (algorithm && (!(\"alg\" in parsedHeader) || parsedHeader.alg !== algorithm))\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodJWT = /*@__PURE__*/ core.$constructor(\"$ZodJWT\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidJWT(payload.value, def.alg))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"jwt\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCustomStringFormat\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (def.fn(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodNumber = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Number(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"number\" && !Number.isNaN(input) && Number.isFinite(input)) {\n return payload;\n }\n const received = typeof input === \"number\"\n ? Number.isNaN(input)\n ? \"NaN\"\n : !Number.isFinite(input)\n ? \"Infinity\"\n : undefined\n : undefined;\n payload.issues.push({\n expected: \"number\",\n code: \"invalid_type\",\n input,\n inst,\n ...(received ? { received } : {}),\n });\n return payload;\n };\n});\nexport const $ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodNumberFormat\", (inst, def) => {\n checks.$ZodCheckNumberFormat.init(inst, def);\n $ZodNumber.init(inst, def); // no format checks\n});\nexport const $ZodBoolean = /*@__PURE__*/ core.$constructor(\"$ZodBoolean\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.boolean;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Boolean(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"boolean\")\n return payload;\n payload.issues.push({\n expected: \"boolean\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigInt = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.bigint;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = BigInt(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"bigint\")\n return payload;\n payload.issues.push({\n expected: \"bigint\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodBigIntFormat\", (inst, def) => {\n checks.$ZodCheckBigIntFormat.init(inst, def);\n $ZodBigInt.init(inst, def); // no format checks\n});\nexport const $ZodSymbol = /*@__PURE__*/ core.$constructor(\"$ZodSymbol\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"symbol\")\n return payload;\n payload.issues.push({\n expected: \"symbol\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodUndefined = /*@__PURE__*/ core.$constructor(\"$ZodUndefined\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.undefined;\n inst._zod.values = new Set([undefined]);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"undefined\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodNull = /*@__PURE__*/ core.$constructor(\"$ZodNull\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.null;\n inst._zod.values = new Set([null]);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (input === null)\n return payload;\n payload.issues.push({\n expected: \"null\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodAny = /*@__PURE__*/ core.$constructor(\"$ZodAny\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodUnknown = /*@__PURE__*/ core.$constructor(\"$ZodUnknown\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodNever = /*@__PURE__*/ core.$constructor(\"$ZodNever\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n payload.issues.push({\n expected: \"never\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodVoid = /*@__PURE__*/ core.$constructor(\"$ZodVoid\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"void\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodDate = /*@__PURE__*/ core.$constructor(\"$ZodDate\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce) {\n try {\n payload.value = new Date(payload.value);\n }\n catch (_err) { }\n }\n const input = payload.value;\n const isDate = input instanceof Date;\n const isValidDate = isDate && !Number.isNaN(input.getTime());\n if (isValidDate)\n return payload;\n payload.issues.push({\n expected: \"date\",\n code: \"invalid_type\",\n input,\n ...(isDate ? { received: \"Invalid Date\" } : {}),\n inst,\n });\n return payload;\n };\n});\nfunction handleArrayResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodArray = /*@__PURE__*/ core.$constructor(\"$ZodArray\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n expected: \"array\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = Array(input.length);\n const proms = [];\n for (let i = 0; i < input.length; i++) {\n const item = input[i];\n const result = def.element._zod.run({\n value: item,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleArrayResult(result, payload, i)));\n }\n else {\n handleArrayResult(result, payload, i);\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload; //handleArrayResultsAsync(parseResults, final);\n };\n});\nfunction handlePropertyResult(result, final, key, input, isOptionalOut) {\n if (result.issues.length) {\n // For optional-out schemas, ignore errors on absent keys\n if (isOptionalOut && !(key in input)) {\n return;\n }\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n if (result.value === undefined) {\n if (key in input) {\n final.value[key] = undefined;\n }\n }\n else {\n final.value[key] = result.value;\n }\n}\nfunction normalizeDef(def) {\n const keys = Object.keys(def.shape);\n for (const k of keys) {\n if (!def.shape?.[k]?._zod?.traits?.has(\"$ZodType\")) {\n throw new Error(`Invalid element at key \"${k}\": expected a Zod schema`);\n }\n }\n const okeys = util.optionalKeys(def.shape);\n return {\n ...def,\n keys,\n keySet: new Set(keys),\n numKeys: keys.length,\n optionalKeys: new Set(okeys),\n };\n}\nfunction handleCatchall(proms, input, payload, ctx, def, inst) {\n const unrecognized = [];\n // iterate over input keys\n const keySet = def.keySet;\n const _catchall = def.catchall._zod;\n const t = _catchall.def.type;\n const isOptionalOut = _catchall.optout === \"optional\";\n for (const key in input) {\n if (keySet.has(key))\n continue;\n if (t === \"never\") {\n unrecognized.push(key);\n continue;\n }\n const r = _catchall.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));\n }\n else {\n handlePropertyResult(r, payload, key, input, isOptionalOut);\n }\n }\n if (unrecognized.length) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n keys: unrecognized,\n input,\n inst,\n });\n }\n if (!proms.length)\n return payload;\n return Promise.all(proms).then(() => {\n return payload;\n });\n}\nexport const $ZodObject = /*@__PURE__*/ core.$constructor(\"$ZodObject\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodType.init(inst, def);\n // const sh = def.shape;\n const desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n if (!desc?.get) {\n const sh = def.shape;\n Object.defineProperty(def, \"shape\", {\n get: () => {\n const newSh = { ...sh };\n Object.defineProperty(def, \"shape\", {\n value: newSh,\n });\n return newSh;\n },\n });\n }\n const _normalized = util.cached(() => normalizeDef(def));\n util.defineLazy(inst._zod, \"propValues\", () => {\n const shape = def.shape;\n const propValues = {};\n for (const key in shape) {\n const field = shape[key]._zod;\n if (field.values) {\n propValues[key] ?? (propValues[key] = new Set());\n for (const v of field.values)\n propValues[key].add(v);\n }\n }\n return propValues;\n });\n const isObject = util.isObject;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = {};\n const proms = [];\n const shape = value.shape;\n for (const key of value.keys) {\n const el = shape[key];\n const isOptionalOut = el._zod.optout === \"optional\";\n const r = el._zod.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));\n }\n else {\n handlePropertyResult(r, payload, key, input, isOptionalOut);\n }\n }\n if (!catchall) {\n return proms.length ? Promise.all(proms).then(() => payload) : payload;\n }\n return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);\n };\n});\nexport const $ZodObjectJIT = /*@__PURE__*/ core.$constructor(\"$ZodObjectJIT\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodObject.init(inst, def);\n const superParse = inst._zod.parse;\n const _normalized = util.cached(() => normalizeDef(def));\n const generateFastpass = (shape) => {\n const doc = new Doc([\"shape\", \"payload\", \"ctx\"]);\n const normalized = _normalized.value;\n const parseStr = (key) => {\n const k = util.esc(key);\n return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n };\n doc.write(`const input = payload.value;`);\n const ids = Object.create(null);\n let counter = 0;\n for (const key of normalized.keys) {\n ids[key] = `key_${counter++}`;\n }\n // A: preserve key order {\n doc.write(`const newResult = {};`);\n for (const key of normalized.keys) {\n const id = ids[key];\n const k = util.esc(key);\n const schema = shape[key];\n const isOptionalOut = schema?._zod?.optout === \"optional\";\n doc.write(`const ${id} = ${parseStr(key)};`);\n if (isOptionalOut) {\n // For optional-out schemas, ignore errors on absent keys\n doc.write(`\n if (${id}.issues.length) {\n if (${k} in input) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n }\n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n else {\n doc.write(`\n if (${id}.issues.length) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n }\n doc.write(`payload.value = newResult;`);\n doc.write(`return payload;`);\n const fn = doc.compile();\n return (payload, ctx) => fn(shape, payload, ctx);\n };\n let fastpass;\n const isObject = util.isObject;\n const jit = !core.globalConfig.jitless;\n const allowsEval = util.allowsEval;\n const fastEnabled = jit && allowsEval.value; // && !def.catchall;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {\n // always synchronous\n if (!fastpass)\n fastpass = generateFastpass(def.shape);\n payload = fastpass(payload, ctx);\n if (!catchall)\n return payload;\n return handleCatchall([], input, payload, ctx, value, inst);\n }\n return superParse(payload, ctx);\n };\n});\nfunction handleUnionResults(results, final, inst, ctx) {\n for (const result of results) {\n if (result.issues.length === 0) {\n final.value = result.value;\n return final;\n }\n }\n const nonaborted = results.filter((r) => !util.aborted(r));\n if (nonaborted.length === 1) {\n final.value = nonaborted[0].value;\n return nonaborted[0];\n }\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n return final;\n}\nexport const $ZodUnion = /*@__PURE__*/ core.$constructor(\"$ZodUnion\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.options.some((o) => o._zod.optin === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"optout\", () => def.options.some((o) => o._zod.optout === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"values\", () => {\n if (def.options.every((o) => o._zod.values)) {\n return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));\n }\n return undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n if (def.options.every((o) => o._zod.pattern)) {\n const patterns = def.options.map((o) => o._zod.pattern);\n return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join(\"|\")})$`);\n }\n return undefined;\n });\n const single = def.options.length === 1;\n const first = def.options[0]._zod.run;\n inst._zod.parse = (payload, ctx) => {\n if (single) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n if (result.issues.length === 0)\n return result;\n results.push(result);\n }\n }\n if (!async)\n return handleUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleUnionResults(results, payload, inst, ctx);\n });\n };\n});\nfunction handleExclusiveUnionResults(results, final, inst, ctx) {\n const successes = results.filter((r) => r.issues.length === 0);\n if (successes.length === 1) {\n final.value = successes[0].value;\n return final;\n }\n if (successes.length === 0) {\n // No matches - same as regular union\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n }\n else {\n // Multiple matches - exclusive union failure\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: [],\n inclusive: false,\n });\n }\n return final;\n}\nexport const $ZodXor = /*@__PURE__*/ core.$constructor(\"$ZodXor\", (inst, def) => {\n $ZodUnion.init(inst, def);\n def.inclusive = false;\n const single = def.options.length === 1;\n const first = def.options[0]._zod.run;\n inst._zod.parse = (payload, ctx) => {\n if (single) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n results.push(result);\n }\n }\n if (!async)\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n });\n };\n});\nexport const $ZodDiscriminatedUnion = \n/*@__PURE__*/\ncore.$constructor(\"$ZodDiscriminatedUnion\", (inst, def) => {\n def.inclusive = false;\n $ZodUnion.init(inst, def);\n const _super = inst._zod.parse;\n util.defineLazy(inst._zod, \"propValues\", () => {\n const propValues = {};\n for (const option of def.options) {\n const pv = option._zod.propValues;\n if (!pv || Object.keys(pv).length === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(option)}\"`);\n for (const [k, v] of Object.entries(pv)) {\n if (!propValues[k])\n propValues[k] = new Set();\n for (const val of v) {\n propValues[k].add(val);\n }\n }\n }\n return propValues;\n });\n const disc = util.cached(() => {\n const opts = def.options;\n const map = new Map();\n for (const o of opts) {\n const values = o._zod.propValues?.[def.discriminator];\n if (!values || values.size === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(o)}\"`);\n for (const v of values) {\n if (map.has(v)) {\n throw new Error(`Duplicate discriminator value \"${String(v)}\"`);\n }\n map.set(v, o);\n }\n }\n return map;\n });\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isObject(input)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"object\",\n input,\n inst,\n });\n return payload;\n }\n const opt = disc.value.get(input?.[def.discriminator]);\n if (opt) {\n return opt._zod.run(payload, ctx);\n }\n if (def.unionFallback) {\n return _super(payload, ctx);\n }\n // no matching discriminator\n payload.issues.push({\n code: \"invalid_union\",\n errors: [],\n note: \"No matching discriminator\",\n discriminator: def.discriminator,\n input,\n path: [def.discriminator],\n inst,\n });\n return payload;\n };\n});\nexport const $ZodIntersection = /*@__PURE__*/ core.$constructor(\"$ZodIntersection\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n const left = def.left._zod.run({ value: input, issues: [] }, ctx);\n const right = def.right._zod.run({ value: input, issues: [] }, ctx);\n const async = left instanceof Promise || right instanceof Promise;\n if (async) {\n return Promise.all([left, right]).then(([left, right]) => {\n return handleIntersectionResults(payload, left, right);\n });\n }\n return handleIntersectionResults(payload, left, right);\n };\n});\nfunction mergeValues(a, b) {\n // const aType = parse.t(a);\n // const bType = parse.t(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n if (a instanceof Date && b instanceof Date && +a === +b) {\n return { valid: true, data: a };\n }\n if (util.isPlainObject(a) && util.isPlainObject(b)) {\n const bKeys = Object.keys(b);\n const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [key, ...sharedValue.mergeErrorPath],\n };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return { valid: false, mergeErrorPath: [] };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [index, ...sharedValue.mergeErrorPath],\n };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n return { valid: false, mergeErrorPath: [] };\n}\nfunction handleIntersectionResults(result, left, right) {\n // Track which side(s) report each key as unrecognized\n const unrecKeys = new Map();\n let unrecIssue;\n for (const iss of left.issues) {\n if (iss.code === \"unrecognized_keys\") {\n unrecIssue ?? (unrecIssue = iss);\n for (const k of iss.keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k).l = true;\n }\n }\n else {\n result.issues.push(iss);\n }\n }\n for (const iss of right.issues) {\n if (iss.code === \"unrecognized_keys\") {\n for (const k of iss.keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k).r = true;\n }\n }\n else {\n result.issues.push(iss);\n }\n }\n // Report only keys unrecognized by BOTH sides\n const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);\n if (bothKeys.length && unrecIssue) {\n result.issues.push({ ...unrecIssue, keys: bothKeys });\n }\n if (util.aborted(result))\n return result;\n const merged = mergeValues(left.value, right.value);\n if (!merged.valid) {\n throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);\n }\n result.value = merged.data;\n return result;\n}\nexport const $ZodTuple = /*@__PURE__*/ core.$constructor(\"$ZodTuple\", (inst, def) => {\n $ZodType.init(inst, def);\n const items = def.items;\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n input,\n inst,\n expected: \"tuple\",\n code: \"invalid_type\",\n });\n return payload;\n }\n payload.value = [];\n const proms = [];\n const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== \"optional\");\n const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;\n if (!def.rest) {\n const tooBig = input.length > items.length;\n const tooSmall = input.length < optStart - 1;\n if (tooBig || tooSmall) {\n payload.issues.push({\n ...(tooBig\n ? { code: \"too_big\", maximum: items.length, inclusive: true }\n : { code: \"too_small\", minimum: items.length }),\n input,\n inst,\n origin: \"array\",\n });\n return payload;\n }\n }\n let i = -1;\n for (const item of items) {\n i++;\n if (i >= input.length)\n if (i >= optStart)\n continue;\n const result = item._zod.run({\n value: input[i],\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n if (def.rest) {\n const rest = input.slice(items.length);\n for (const el of rest) {\n i++;\n const result = def.rest._zod.run({\n value: el,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleTupleResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isPlainObject(input)) {\n payload.issues.push({\n expected: \"record\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n const values = def.keyType._zod.values;\n if (values) {\n payload.value = {};\n const recordKeys = new Set();\n for (const key of values) {\n if (typeof key === \"string\" || typeof key === \"number\" || typeof key === \"symbol\") {\n recordKeys.add(typeof key === \"number\" ? key.toString() : key);\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }\n }\n }\n let unrecognized;\n for (const key in input) {\n if (!recordKeys.has(key)) {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n });\n }\n }\n else {\n payload.value = {};\n for (const key of Reflect.ownKeys(input)) {\n if (key === \"__proto__\")\n continue;\n let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n if (keyResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n // Numeric string fallback: if key is a numeric string and failed, retry with Number(key)\n // This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals\n const checkNumericKey = typeof key === \"string\" && regexes.number.test(key) && keyResult.issues.length;\n if (checkNumericKey) {\n const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);\n if (retryResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n if (retryResult.issues.length === 0) {\n keyResult = retryResult;\n }\n }\n if (keyResult.issues.length) {\n if (def.mode === \"loose\") {\n // Pass through unchanged\n payload.value[key] = input[key];\n }\n else {\n // Default \"strict\" behavior: error on invalid key\n payload.issues.push({\n code: \"invalid_key\",\n origin: \"record\",\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n input: key,\n path: [key],\n inst,\n });\n }\n continue;\n }\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload;\n };\n});\nexport const $ZodMap = /*@__PURE__*/ core.$constructor(\"$ZodMap\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Map)) {\n payload.issues.push({\n expected: \"map\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n payload.value = new Map();\n for (const [key, value] of input) {\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);\n if (keyResult instanceof Promise || valueResult instanceof Promise) {\n proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }));\n }\n else {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {\n if (keyResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, keyResult.issues));\n }\n else {\n final.issues.push({\n code: \"invalid_key\",\n origin: \"map\",\n input,\n inst,\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n if (valueResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, valueResult.issues));\n }\n else {\n final.issues.push({\n origin: \"map\",\n code: \"invalid_element\",\n input,\n inst,\n key: key,\n issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n final.value.set(keyResult.value, valueResult.value);\n}\nexport const $ZodSet = /*@__PURE__*/ core.$constructor(\"$ZodSet\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Set)) {\n payload.issues.push({\n input,\n inst,\n expected: \"set\",\n code: \"invalid_type\",\n });\n return payload;\n }\n const proms = [];\n payload.value = new Set();\n for (const item of input) {\n const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleSetResult(result, payload)));\n }\n else\n handleSetResult(result, payload);\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleSetResult(result, final) {\n if (result.issues.length) {\n final.issues.push(...result.issues);\n }\n final.value.add(result.value);\n}\nexport const $ZodEnum = /*@__PURE__*/ core.$constructor(\"$ZodEnum\", (inst, def) => {\n $ZodType.init(inst, def);\n const values = util.getEnumValues(def.entries);\n const valuesSet = new Set(values);\n inst._zod.values = valuesSet;\n inst._zod.pattern = new RegExp(`^(${values\n .filter((k) => util.propertyKeyTypes.has(typeof k))\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o.toString()))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (valuesSet.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodLiteral = /*@__PURE__*/ core.$constructor(\"$ZodLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n if (def.values.length === 0) {\n throw new Error(\"Cannot create literal schema with no valid values\");\n }\n const values = new Set(def.values);\n inst._zod.values = values;\n inst._zod.pattern = new RegExp(`^(${def.values\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (values.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values: def.values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodFile = /*@__PURE__*/ core.$constructor(\"$ZodFile\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n // @ts-ignore\n if (input instanceof File)\n return payload;\n payload.issues.push({\n expected: \"file\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodTransform = /*@__PURE__*/ core.$constructor(\"$ZodTransform\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n const _out = def.transform(payload.value, payload);\n if (ctx.async) {\n const output = _out instanceof Promise ? _out : Promise.resolve(_out);\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n if (_out instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n payload.value = _out;\n return payload;\n };\n});\nfunction handleOptionalResult(result, input) {\n if (result.issues.length && input === undefined) {\n return { issues: [], value: undefined };\n }\n return result;\n}\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (def.innerType._zod.optin === \"optional\") {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise)\n return result.then((r) => handleOptionalResult(r, payload.value));\n return handleOptionalResult(result, payload.value);\n }\n if (payload.value === undefined) {\n return payload;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodExactOptional = /*@__PURE__*/ core.$constructor(\"$ZodExactOptional\", (inst, def) => {\n // Call parent init - inherits optin/optout = \"optional\"\n $ZodOptional.init(inst, def);\n // Override values/pattern to NOT add undefined\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"pattern\", () => def.innerType._zod.pattern);\n // Override parse to just delegate (no undefined handling)\n inst._zod.parse = (payload, ctx) => {\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNullable = /*@__PURE__*/ core.$constructor(\"$ZodNullable\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n });\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n // Forward direction (decode): allow null to pass through\n if (payload.value === null)\n return payload;\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodDefault = /*@__PURE__*/ core.$constructor(\"$ZodDefault\", (inst, def) => {\n $ZodType.init(inst, def);\n // inst._zod.qin = \"true\";\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply defaults for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n /**\n * $ZodDefault returns the default value immediately in forward direction.\n * It doesn't pass the default value into the validator (\"prefault\"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a \"prefault\" for the pipe. */\n return payload;\n }\n // Forward direction: continue with default handling\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleDefaultResult(result, def));\n }\n return handleDefaultResult(result, def);\n };\n});\nfunction handleDefaultResult(payload, def) {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return payload;\n}\nexport const $ZodPrefault = /*@__PURE__*/ core.$constructor(\"$ZodPrefault\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply prefault for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNonOptional = /*@__PURE__*/ core.$constructor(\"$ZodNonOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => {\n const v = def.innerType._zod.values;\n return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleNonOptionalResult(result, inst));\n }\n return handleNonOptionalResult(result, inst);\n };\n});\nfunction handleNonOptionalResult(payload, inst) {\n if (!payload.issues.length && payload.value === undefined) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: payload.value,\n inst,\n });\n }\n return payload;\n}\nexport const $ZodSuccess = /*@__PURE__*/ core.$constructor(\"$ZodSuccess\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(\"ZodSuccess\");\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.issues.length === 0;\n return payload;\n });\n }\n payload.value = result.issues.length === 0;\n return payload;\n };\n});\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply catch logic\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n });\n }\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n };\n});\nexport const $ZodNaN = /*@__PURE__*/ core.$constructor(\"$ZodNaN\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"number\" || !Number.isNaN(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"nan\",\n code: \"invalid_type\",\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodPipe = /*@__PURE__*/ core.$constructor(\"$ZodPipe\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handlePipeResult(right, def.in, ctx));\n }\n return handlePipeResult(right, def.in, ctx);\n }\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handlePipeResult(left, def.out, ctx));\n }\n return handlePipeResult(left, def.out, ctx);\n };\n});\nfunction handlePipeResult(left, next, ctx) {\n if (left.issues.length) {\n // prevent further checks\n left.aborted = true;\n return left;\n }\n return next._zod.run({ value: left.value, issues: left.issues }, ctx);\n}\nexport const $ZodCodec = /*@__PURE__*/ core.$constructor(\"$ZodCodec\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handleCodecAResult(left, def, ctx));\n }\n return handleCodecAResult(left, def, ctx);\n }\n else {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handleCodecAResult(right, def, ctx));\n }\n return handleCodecAResult(right, def, ctx);\n }\n };\n});\nfunction handleCodecAResult(result, def, ctx) {\n if (result.issues.length) {\n // prevent further checks\n result.aborted = true;\n return result;\n }\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const transformed = def.transform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));\n }\n return handleCodecTxResult(result, transformed, def.out, ctx);\n }\n else {\n const transformed = def.reverseTransform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));\n }\n return handleCodecTxResult(result, transformed, def.in, ctx);\n }\n}\nfunction handleCodecTxResult(left, value, nextSchema, ctx) {\n // Check if transform added any issues\n if (left.issues.length) {\n left.aborted = true;\n return left;\n }\n return nextSchema._zod.run({ value, issues: left.issues }, ctx);\n}\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"propValues\", () => def.innerType._zod.propValues);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType?._zod?.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType?._zod?.optout);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then(handleReadonlyResult);\n }\n return handleReadonlyResult(result);\n };\n});\nfunction handleReadonlyResult(payload) {\n payload.value = Object.freeze(payload.value);\n return payload;\n}\nexport const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"$ZodTemplateLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n const regexParts = [];\n for (const part of def.parts) {\n if (typeof part === \"object\" && part !== null) {\n // is Zod schema\n if (!part._zod.pattern) {\n // if (!source)\n throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n }\n const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;\n if (!source)\n throw new Error(`Invalid template literal part: ${part._zod.traits}`);\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n regexParts.push(source.slice(start, end));\n }\n else if (part === null || util.primitiveTypes.has(typeof part)) {\n regexParts.push(util.escapeRegex(`${part}`));\n }\n else {\n throw new Error(`Invalid template literal part: ${part}`);\n }\n }\n inst._zod.pattern = new RegExp(`^${regexParts.join(\"\")}$`);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"string\") {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"string\",\n code: \"invalid_type\",\n });\n return payload;\n }\n inst._zod.pattern.lastIndex = 0;\n if (!inst._zod.pattern.test(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n code: \"invalid_format\",\n format: def.format ?? \"template_literal\",\n pattern: inst._zod.pattern.source,\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodFunction = /*@__PURE__*/ core.$constructor(\"$ZodFunction\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._def = def;\n inst._zod.def = def;\n inst.implement = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implement() must be called with a function\");\n }\n return function (...args) {\n const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;\n const result = Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return parse(inst._def.output, result);\n }\n return result;\n };\n };\n inst.implementAsync = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implementAsync() must be called with a function\");\n }\n return async function (...args) {\n const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;\n const result = await Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return await parseAsync(inst._def.output, result);\n }\n return result;\n };\n };\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"function\") {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"function\",\n input: payload.value,\n inst,\n });\n return payload;\n }\n // Check if output is a promise type to determine if we should use async implementation\n const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === \"promise\";\n if (hasPromiseOutput) {\n payload.value = inst.implementAsync(payload.value);\n }\n else {\n payload.value = inst.implement(payload.value);\n }\n return payload;\n };\n inst.input = (...args) => {\n const F = inst.constructor;\n if (Array.isArray(args[0])) {\n return new F({\n type: \"function\",\n input: new $ZodTuple({\n type: \"tuple\",\n items: args[0],\n rest: args[1],\n }),\n output: inst._def.output,\n });\n }\n return new F({\n type: \"function\",\n input: args[0],\n output: inst._def.output,\n });\n };\n inst.output = (output) => {\n const F = inst.constructor;\n return new F({\n type: \"function\",\n input: inst._def.input,\n output,\n });\n };\n return inst;\n});\nexport const $ZodPromise = /*@__PURE__*/ core.$constructor(\"$ZodPromise\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));\n };\n});\nexport const $ZodLazy = /*@__PURE__*/ core.$constructor(\"$ZodLazy\", (inst, def) => {\n $ZodType.init(inst, def);\n // let _innerType!: any;\n // util.defineLazy(def, \"getter\", () => {\n // if (!_innerType) {\n // _innerType = def.getter();\n // }\n // return () => _innerType;\n // });\n util.defineLazy(inst._zod, \"innerType\", () => def.getter());\n util.defineLazy(inst._zod, \"pattern\", () => inst._zod.innerType?._zod?.pattern);\n util.defineLazy(inst._zod, \"propValues\", () => inst._zod.innerType?._zod?.propValues);\n util.defineLazy(inst._zod, \"optin\", () => inst._zod.innerType?._zod?.optin ?? undefined);\n util.defineLazy(inst._zod, \"optout\", () => inst._zod.innerType?._zod?.optout ?? undefined);\n inst._zod.parse = (payload, ctx) => {\n const inner = inst._zod.innerType;\n return inner._zod.run(payload, ctx);\n };\n});\nexport const $ZodCustom = /*@__PURE__*/ core.$constructor(\"$ZodCustom\", (inst, def) => {\n checks.$ZodCheck.init(inst, def);\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _) => {\n return payload;\n };\n inst._zod.check = (payload) => {\n const input = payload.value;\n const r = def.fn(input);\n if (r instanceof Promise) {\n return r.then((r) => handleRefineResult(r, payload, input, inst));\n }\n handleRefineResult(r, payload, input, inst);\n return;\n };\n});\nfunction handleRefineResult(result, payload, input, inst) {\n if (!result) {\n const _iss = {\n code: \"custom\",\n input,\n inst, // incorporates params.error into issue reporting\n path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting\n continue: !inst._zod.def.abort,\n // params: inst._zod.def.params,\n };\n if (inst._zod.def.params)\n _iss.params = inst._zod.def.params;\n payload.issues.push(util.issue(_iss));\n }\n}\n","var _a;\nexport const $output = Symbol(\"ZodOutput\");\nexport const $input = Symbol(\"ZodInput\");\nexport class $ZodRegistry {\n constructor() {\n this._map = new WeakMap();\n this._idmap = new Map();\n }\n add(schema, ..._meta) {\n const meta = _meta[0];\n this._map.set(schema, meta);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.set(meta.id, schema);\n }\n return this;\n }\n clear() {\n this._map = new WeakMap();\n this._idmap = new Map();\n return this;\n }\n remove(schema) {\n const meta = this._map.get(schema);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.delete(meta.id);\n }\n this._map.delete(schema);\n return this;\n }\n get(schema) {\n // return this._map.get(schema) as any;\n // inherit metadata\n const p = schema._zod.parent;\n if (p) {\n const pm = { ...(this.get(p) ?? {}) };\n delete pm.id; // do not inherit id\n const f = { ...pm, ...this._map.get(schema) };\n return Object.keys(f).length ? f : undefined;\n }\n return this._map.get(schema);\n }\n has(schema) {\n return this._map.has(schema);\n }\n}\n// registries\nexport function registry() {\n return new $ZodRegistry();\n}\n(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());\nexport const globalRegistry = globalThis.__zod_globalRegistry;\n","import * as checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\n// @__NO_SIDE_EFFECTS__\nexport function _string(Class, params) {\n return new Class({\n type: \"string\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedString(Class, params) {\n return new Class({\n type: \"string\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _email(Class, params) {\n return new Class({\n type: \"string\",\n format: \"email\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _guid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"guid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v6\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv7(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v7\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _emoji(Class, params) {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nanoid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"nanoid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid2(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid2\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ulid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ulid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _xid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"xid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ksuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ksuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mac(Class, params) {\n return new Class({\n type: \"string\",\n format: \"mac\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _e164(Class, params) {\n return new Class({\n type: \"string\",\n format: \"e164\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _jwt(Class, params) {\n return new Class({\n type: \"string\",\n format: \"jwt\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport const TimePrecision = {\n Any: null,\n Minute: -1,\n Second: 0,\n Millisecond: 3,\n Microsecond: 6,\n};\n// @__NO_SIDE_EFFECTS__\nexport function _isoDateTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDate(Class, params) {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDuration(Class, params) {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _number(Class, params) {\n return new Class({\n type: \"number\",\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedNumber(Class, params) {\n return new Class({\n type: \"number\",\n coerce: true,\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"safeint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float64(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"int32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"uint32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _boolean(Class, params) {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBoolean(Class, params) {\n return new Class({\n type: \"boolean\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _bigint(Class, params) {\n return new Class({\n type: \"bigint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBigint(Class, params) {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"int64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"uint64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _symbol(Class, params) {\n return new Class({\n type: \"symbol\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _undefined(Class, params) {\n return new Class({\n type: \"undefined\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _null(Class, params) {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _any(Class) {\n return new Class({\n type: \"any\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _unknown(Class) {\n return new Class({\n type: \"unknown\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _never(Class, params) {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _void(Class, params) {\n return new Class({\n type: \"void\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _date(Class, params) {\n return new Class({\n type: \"date\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedDate(Class, params) {\n return new Class({\n type: \"date\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nan(Class, params) {\n return new Class({\n type: \"nan\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lt(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lte(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\n// @__NO_SIDE_EFFECTS__\nexport function _gt(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _gte(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\n// @__NO_SIDE_EFFECTS__\nexport function _positive(params) {\n return _gt(0, params);\n}\n// negative\n// @__NO_SIDE_EFFECTS__\nexport function _negative(params) {\n return _lt(0, params);\n}\n// nonpositive\n// @__NO_SIDE_EFFECTS__\nexport function _nonpositive(params) {\n return _lte(0, params);\n}\n// nonnegative\n// @__NO_SIDE_EFFECTS__\nexport function _nonnegative(params) {\n return _gte(0, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function _multipleOf(value, params) {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxSize(maximum, params) {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minSize(minimum, params) {\n return new checks.$ZodCheckMinSize({\n check: \"min_size\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _size(size, params) {\n return new checks.$ZodCheckSizeEquals({\n check: \"size_equals\",\n ...util.normalizeParams(params),\n size,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxLength(maximum, params) {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minLength(minimum, params) {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _length(length, params) {\n return new checks.$ZodCheckLengthEquals({\n check: \"length_equals\",\n ...util.normalizeParams(params),\n length,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _regex(pattern, params) {\n return new checks.$ZodCheckRegex({\n check: \"string_format\",\n format: \"regex\",\n ...util.normalizeParams(params),\n pattern,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lowercase(params) {\n return new checks.$ZodCheckLowerCase({\n check: \"string_format\",\n format: \"lowercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uppercase(params) {\n return new checks.$ZodCheckUpperCase({\n check: \"string_format\",\n format: \"uppercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _includes(includes, params) {\n return new checks.$ZodCheckIncludes({\n check: \"string_format\",\n format: \"includes\",\n ...util.normalizeParams(params),\n includes,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _startsWith(prefix, params) {\n return new checks.$ZodCheckStartsWith({\n check: \"string_format\",\n format: \"starts_with\",\n ...util.normalizeParams(params),\n prefix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _endsWith(suffix, params) {\n return new checks.$ZodCheckEndsWith({\n check: \"string_format\",\n format: \"ends_with\",\n ...util.normalizeParams(params),\n suffix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _property(property, schema, params) {\n return new checks.$ZodCheckProperty({\n check: \"property\",\n property,\n schema,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mime(types, params) {\n return new checks.$ZodCheckMimeType({\n check: \"mime_type\",\n mime: types,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _overwrite(tx) {\n return new checks.$ZodCheckOverwrite({\n check: \"overwrite\",\n tx,\n });\n}\n// normalize\n// @__NO_SIDE_EFFECTS__\nexport function _normalize(form) {\n return _overwrite((input) => input.normalize(form));\n}\n// trim\n// @__NO_SIDE_EFFECTS__\nexport function _trim() {\n return _overwrite((input) => input.trim());\n}\n// toLowerCase\n// @__NO_SIDE_EFFECTS__\nexport function _toLowerCase() {\n return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\n// @__NO_SIDE_EFFECTS__\nexport function _toUpperCase() {\n return _overwrite((input) => input.toUpperCase());\n}\n// slugify\n// @__NO_SIDE_EFFECTS__\nexport function _slugify() {\n return _overwrite((input) => util.slugify(input));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _array(Class, element, params) {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _union(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport function _xor(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n return new Class({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _intersection(Class, left, right) {\n return new Class({\n type: \"intersection\",\n left,\n right,\n });\n}\n// export function _tuple(\n// Class: util.SchemaClass<schemas.$ZodTuple>,\n// items: [],\n// params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\n// @__NO_SIDE_EFFECTS__\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new Class({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _record(Class, keyType, valueType, params) {\n return new Class({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _map(Class, keyType, valueType, params) {\n return new Class({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _set(Class, valueType, params) {\n return new Class({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _enum(Class, values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n // if (Array.isArray(values)) {\n // for (const value of values) {\n // entries[value] = value;\n // }\n // } else {\n // Object.assign(entries, values);\n // }\n // const entries: util.EnumLike = {};\n // for (const val of values) {\n // entries[val] = val;\n // }\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _literal(Class, value, params) {\n return new Class({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _file(Class, params) {\n return new Class({\n type: \"file\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _transform(Class, fn) {\n return new Class({\n type: \"transform\",\n transform: fn,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _optional(Class, innerType) {\n return new Class({\n type: \"optional\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nullable(Class, innerType) {\n return new Class({\n type: \"nullable\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _default(Class, innerType, defaultValue) {\n return new Class({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nonoptional(Class, innerType, params) {\n return new Class({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _success(Class, innerType) {\n return new Class({\n type: \"success\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _catch(Class, innerType, catchValue) {\n return new Class({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _pipe(Class, in_, out) {\n return new Class({\n type: \"pipe\",\n in: in_,\n out,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _readonly(Class, innerType) {\n return new Class({\n type: \"readonly\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _templateLiteral(Class, parts, params) {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lazy(Class, getter) {\n return new Class({\n type: \"lazy\",\n getter,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _promise(Class, innerType) {\n return new Class({\n type: \"promise\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _custom(Class, fn, _params) {\n const norm = util.normalizeParams(_params);\n norm.abort ?? (norm.abort = true); // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...norm,\n });\n return schema;\n}\n// same as _custom but defaults to abort:false\n// @__NO_SIDE_EFFECTS__\nexport function _refine(Class, fn, _params) {\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...util.normalizeParams(_params),\n });\n return schema;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _superRefine(fn) {\n const ch = _check((payload) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = ch);\n _issue.continue ?? (_issue.continue = !ch._zod.def.abort); // abort is always undefined, so this is always true...\n payload.issues.push(util.issue(_issue));\n }\n };\n return fn(payload.value, payload);\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _check(fn, params) {\n const ch = new checks.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function describe(description) {\n const ch = new checks.$ZodCheck({ check: \"describe\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, description });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function meta(metadata) {\n const ch = new checks.$ZodCheck({ check: \"meta\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, ...metadata });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringbool(Classes, _params) {\n const params = util.normalizeParams(_params);\n let truthyArray = params.truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"];\n let falsyArray = params.falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"];\n if (params.case !== \"sensitive\") {\n truthyArray = truthyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n falsyArray = falsyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n }\n const truthySet = new Set(truthyArray);\n const falsySet = new Set(falsyArray);\n const _Codec = Classes.Codec ?? schemas.$ZodCodec;\n const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n const _String = Classes.String ?? schemas.$ZodString;\n const stringSchema = new _String({ type: \"string\", error: params.error });\n const booleanSchema = new _Boolean({ type: \"boolean\", error: params.error });\n const codec = new _Codec({\n type: \"pipe\",\n in: stringSchema,\n out: booleanSchema,\n transform: ((input, payload) => {\n let data = input;\n if (params.case !== \"sensitive\")\n data = data.toLowerCase();\n if (truthySet.has(data)) {\n return true;\n }\n else if (falsySet.has(data)) {\n return false;\n }\n else {\n payload.issues.push({\n code: \"invalid_value\",\n expected: \"stringbool\",\n values: [...truthySet, ...falsySet],\n input: payload.value,\n inst: codec,\n continue: false,\n });\n return {};\n }\n }),\n reverseTransform: ((input, _payload) => {\n if (input === true) {\n return truthyArray[0] || \"true\";\n }\n else {\n return falsyArray[0] || \"false\";\n }\n }),\n error: params.error,\n });\n return codec;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringFormat(Class, format, fnOrRegex, _params = {}) {\n const params = util.normalizeParams(_params);\n const def = {\n ...util.normalizeParams(_params),\n check: \"string_format\",\n type: \"string\",\n format,\n fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n ...params,\n };\n if (fnOrRegex instanceof RegExp) {\n def.pattern = fnOrRegex;\n }\n const inst = new Class(def);\n return inst;\n}\n","import * as core from \"../core/index.js\";\nimport * as util from \"../core/util.js\";\nimport * as parse from \"./parse.js\";\nexport const ZodMiniType = /*@__PURE__*/ core.$constructor(\"ZodMiniType\", (inst, def) => {\n if (!inst._zod)\n throw new Error(\"Uninitialized schema in ZodMiniType.\");\n core.$ZodType.init(inst, def);\n inst.def = def;\n inst.type = def.type;\n inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });\n inst.safeParse = (data, params) => parse.safeParse(inst, data, params);\n inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });\n inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);\n inst.check = (...checks) => {\n return inst.clone({\n ...def,\n checks: [\n ...(def.checks ?? []),\n ...checks.map((ch) => typeof ch === \"function\" ? { _zod: { check: ch, def: { check: \"custom\" }, onattach: [] } } : ch),\n ],\n }, { parent: true });\n };\n inst.with = inst.check;\n inst.clone = (_def, params) => core.clone(inst, _def, params);\n inst.brand = () => inst;\n inst.register = ((reg, meta) => {\n reg.add(inst, meta);\n return inst;\n });\n inst.apply = (fn) => fn(inst);\n});\nexport const ZodMiniString = /*@__PURE__*/ core.$constructor(\"ZodMiniString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function string(params) {\n return core._string(ZodMiniString, params);\n}\nexport const ZodMiniStringFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniStringFormat\", (inst, def) => {\n core.$ZodStringFormat.init(inst, def);\n ZodMiniString.init(inst, def);\n});\nexport const ZodMiniEmail = /*@__PURE__*/ core.$constructor(\"ZodMiniEmail\", (inst, def) => {\n core.$ZodEmail.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function email(params) {\n return core._email(ZodMiniEmail, params);\n}\nexport const ZodMiniGUID = /*@__PURE__*/ core.$constructor(\"ZodMiniGUID\", (inst, def) => {\n core.$ZodGUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function guid(params) {\n return core._guid(ZodMiniGUID, params);\n}\nexport const ZodMiniUUID = /*@__PURE__*/ core.$constructor(\"ZodMiniUUID\", (inst, def) => {\n core.$ZodUUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function uuid(params) {\n return core._uuid(ZodMiniUUID, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function uuidv4(params) {\n return core._uuidv4(ZodMiniUUID, params);\n}\n// ZodMiniUUIDv6\n// @__NO_SIDE_EFFECTS__\nexport function uuidv6(params) {\n return core._uuidv6(ZodMiniUUID, params);\n}\n// ZodMiniUUIDv7\n// @__NO_SIDE_EFFECTS__\nexport function uuidv7(params) {\n return core._uuidv7(ZodMiniUUID, params);\n}\nexport const ZodMiniURL = /*@__PURE__*/ core.$constructor(\"ZodMiniURL\", (inst, def) => {\n core.$ZodURL.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function url(params) {\n return core._url(ZodMiniURL, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function httpUrl(params) {\n return core._url(ZodMiniURL, {\n protocol: /^https?$/,\n hostname: core.regexes.domain,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniEmoji = /*@__PURE__*/ core.$constructor(\"ZodMiniEmoji\", (inst, def) => {\n core.$ZodEmoji.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function emoji(params) {\n return core._emoji(ZodMiniEmoji, params);\n}\nexport const ZodMiniNanoID = /*@__PURE__*/ core.$constructor(\"ZodMiniNanoID\", (inst, def) => {\n core.$ZodNanoID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function nanoid(params) {\n return core._nanoid(ZodMiniNanoID, params);\n}\nexport const ZodMiniCUID = /*@__PURE__*/ core.$constructor(\"ZodMiniCUID\", (inst, def) => {\n core.$ZodCUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function cuid(params) {\n return core._cuid(ZodMiniCUID, params);\n}\nexport const ZodMiniCUID2 = /*@__PURE__*/ core.$constructor(\"ZodMiniCUID2\", (inst, def) => {\n core.$ZodCUID2.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function cuid2(params) {\n return core._cuid2(ZodMiniCUID2, params);\n}\nexport const ZodMiniULID = /*@__PURE__*/ core.$constructor(\"ZodMiniULID\", (inst, def) => {\n core.$ZodULID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function ulid(params) {\n return core._ulid(ZodMiniULID, params);\n}\nexport const ZodMiniXID = /*@__PURE__*/ core.$constructor(\"ZodMiniXID\", (inst, def) => {\n core.$ZodXID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function xid(params) {\n return core._xid(ZodMiniXID, params);\n}\nexport const ZodMiniKSUID = /*@__PURE__*/ core.$constructor(\"ZodMiniKSUID\", (inst, def) => {\n core.$ZodKSUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function ksuid(params) {\n return core._ksuid(ZodMiniKSUID, params);\n}\nexport const ZodMiniIPv4 = /*@__PURE__*/ core.$constructor(\"ZodMiniIPv4\", (inst, def) => {\n core.$ZodIPv4.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function ipv4(params) {\n return core._ipv4(ZodMiniIPv4, params);\n}\nexport const ZodMiniIPv6 = /*@__PURE__*/ core.$constructor(\"ZodMiniIPv6\", (inst, def) => {\n core.$ZodIPv6.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function ipv6(params) {\n return core._ipv6(ZodMiniIPv6, params);\n}\nexport const ZodMiniCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodMiniCIDRv4\", (inst, def) => {\n core.$ZodCIDRv4.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function cidrv4(params) {\n return core._cidrv4(ZodMiniCIDRv4, params);\n}\nexport const ZodMiniCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodMiniCIDRv6\", (inst, def) => {\n core.$ZodCIDRv6.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function cidrv6(params) {\n return core._cidrv6(ZodMiniCIDRv6, params);\n}\nexport const ZodMiniMAC = /*@__PURE__*/ core.$constructor(\"ZodMiniMAC\", (inst, def) => {\n core.$ZodMAC.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function mac(params) {\n return core._mac(ZodMiniMAC, params);\n}\nexport const ZodMiniBase64 = /*@__PURE__*/ core.$constructor(\"ZodMiniBase64\", (inst, def) => {\n core.$ZodBase64.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function base64(params) {\n return core._base64(ZodMiniBase64, params);\n}\nexport const ZodMiniBase64URL = /*@__PURE__*/ core.$constructor(\"ZodMiniBase64URL\", (inst, def) => {\n core.$ZodBase64URL.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function base64url(params) {\n return core._base64url(ZodMiniBase64URL, params);\n}\nexport const ZodMiniE164 = /*@__PURE__*/ core.$constructor(\"ZodMiniE164\", (inst, def) => {\n core.$ZodE164.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function e164(params) {\n return core._e164(ZodMiniE164, params);\n}\nexport const ZodMiniJWT = /*@__PURE__*/ core.$constructor(\"ZodMiniJWT\", (inst, def) => {\n core.$ZodJWT.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function jwt(params) {\n return core._jwt(ZodMiniJWT, params);\n}\nexport const ZodMiniCustomStringFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniCustomStringFormat\", (inst, def) => {\n core.$ZodCustomStringFormat.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function stringFormat(format, fnOrRegex, _params = {}) {\n return core._stringFormat(ZodMiniCustomStringFormat, format, fnOrRegex, _params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function hostname(_params) {\n return core._stringFormat(ZodMiniCustomStringFormat, \"hostname\", core.regexes.hostname, _params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function hex(_params) {\n return core._stringFormat(ZodMiniCustomStringFormat, \"hex\", core.regexes.hex, _params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function hash(alg, params) {\n const enc = params?.enc ?? \"hex\";\n const format = `${alg}_${enc}`;\n const regex = core.regexes[format];\n // check for unrecognized format\n if (!regex)\n throw new Error(`Unrecognized hash format: ${format}`);\n return core._stringFormat(ZodMiniCustomStringFormat, format, regex, params);\n}\nexport const ZodMiniNumber = /*@__PURE__*/ core.$constructor(\"ZodMiniNumber\", (inst, def) => {\n core.$ZodNumber.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function number(params) {\n return core._number(ZodMiniNumber, params);\n}\nexport const ZodMiniNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniNumberFormat\", (inst, def) => {\n core.$ZodNumberFormat.init(inst, def);\n ZodMiniNumber.init(inst, def);\n});\n// int\n// @__NO_SIDE_EFFECTS__\nexport function int(params) {\n return core._int(ZodMiniNumberFormat, params);\n}\n// float32\n// @__NO_SIDE_EFFECTS__\nexport function float32(params) {\n return core._float32(ZodMiniNumberFormat, params);\n}\n// float64\n// @__NO_SIDE_EFFECTS__\nexport function float64(params) {\n return core._float64(ZodMiniNumberFormat, params);\n}\n// int32\n// @__NO_SIDE_EFFECTS__\nexport function int32(params) {\n return core._int32(ZodMiniNumberFormat, params);\n}\n// uint32\n// @__NO_SIDE_EFFECTS__\nexport function uint32(params) {\n return core._uint32(ZodMiniNumberFormat, params);\n}\nexport const ZodMiniBoolean = /*@__PURE__*/ core.$constructor(\"ZodMiniBoolean\", (inst, def) => {\n core.$ZodBoolean.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function boolean(params) {\n return core._boolean(ZodMiniBoolean, params);\n}\nexport const ZodMiniBigInt = /*@__PURE__*/ core.$constructor(\"ZodMiniBigInt\", (inst, def) => {\n core.$ZodBigInt.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function bigint(params) {\n return core._bigint(ZodMiniBigInt, params);\n}\nexport const ZodMiniBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniBigIntFormat\", (inst, def) => {\n core.$ZodBigIntFormat.init(inst, def);\n ZodMiniBigInt.init(inst, def);\n});\n// int64\n// @__NO_SIDE_EFFECTS__\nexport function int64(params) {\n return core._int64(ZodMiniBigIntFormat, params);\n}\n// uint64\n// @__NO_SIDE_EFFECTS__\nexport function uint64(params) {\n return core._uint64(ZodMiniBigIntFormat, params);\n}\nexport const ZodMiniSymbol = /*@__PURE__*/ core.$constructor(\"ZodMiniSymbol\", (inst, def) => {\n core.$ZodSymbol.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function symbol(params) {\n return core._symbol(ZodMiniSymbol, params);\n}\nexport const ZodMiniUndefined = /*@__PURE__*/ core.$constructor(\"ZodMiniUndefined\", (inst, def) => {\n core.$ZodUndefined.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _undefined(params) {\n return core._undefined(ZodMiniUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodMiniNull = /*@__PURE__*/ core.$constructor(\"ZodMiniNull\", (inst, def) => {\n core.$ZodNull.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _null(params) {\n return core._null(ZodMiniNull, params);\n}\nexport { _null as null };\nexport const ZodMiniAny = /*@__PURE__*/ core.$constructor(\"ZodMiniAny\", (inst, def) => {\n core.$ZodAny.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function any() {\n return core._any(ZodMiniAny);\n}\nexport const ZodMiniUnknown = /*@__PURE__*/ core.$constructor(\"ZodMiniUnknown\", (inst, def) => {\n core.$ZodUnknown.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function unknown() {\n return core._unknown(ZodMiniUnknown);\n}\nexport const ZodMiniNever = /*@__PURE__*/ core.$constructor(\"ZodMiniNever\", (inst, def) => {\n core.$ZodNever.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function never(params) {\n return core._never(ZodMiniNever, params);\n}\nexport const ZodMiniVoid = /*@__PURE__*/ core.$constructor(\"ZodMiniVoid\", (inst, def) => {\n core.$ZodVoid.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _void(params) {\n return core._void(ZodMiniVoid, params);\n}\nexport { _void as void };\nexport const ZodMiniDate = /*@__PURE__*/ core.$constructor(\"ZodMiniDate\", (inst, def) => {\n core.$ZodDate.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function date(params) {\n return core._date(ZodMiniDate, params);\n}\nexport const ZodMiniArray = /*@__PURE__*/ core.$constructor(\"ZodMiniArray\", (inst, def) => {\n core.$ZodArray.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function array(element, params) {\n return new ZodMiniArray({\n type: \"array\",\n element: element,\n ...util.normalizeParams(params),\n });\n}\n// .keyof\n// @__NO_SIDE_EFFECTS__\nexport function keyof(schema) {\n const shape = schema._zod.def.shape;\n return _enum(Object.keys(shape));\n}\nexport const ZodMiniObject = /*@__PURE__*/ core.$constructor(\"ZodMiniObject\", (inst, def) => {\n core.$ZodObject.init(inst, def);\n ZodMiniType.init(inst, def);\n util.defineLazy(inst, \"shape\", () => def.shape);\n});\n// @__NO_SIDE_EFFECTS__\nexport function object(shape, params) {\n const def = {\n type: \"object\",\n shape: shape ?? {},\n ...util.normalizeParams(params),\n };\n return new ZodMiniObject(def);\n}\n// strictObject\n// @__NO_SIDE_EFFECTS__\nexport function strictObject(shape, params) {\n return new ZodMiniObject({\n type: \"object\",\n shape,\n catchall: never(),\n ...util.normalizeParams(params),\n });\n}\n// looseObject\n// @__NO_SIDE_EFFECTS__\nexport function looseObject(shape, params) {\n return new ZodMiniObject({\n type: \"object\",\n shape,\n catchall: unknown(),\n ...util.normalizeParams(params),\n });\n}\n// object methods\n// @__NO_SIDE_EFFECTS__\nexport function extend(schema, shape) {\n return util.extend(schema, shape);\n}\n// @__NO_SIDE_EFFECTS__\nexport function safeExtend(schema, shape) {\n return util.safeExtend(schema, shape);\n}\n// @__NO_SIDE_EFFECTS__\nexport function merge(schema, shape) {\n return util.extend(schema, shape);\n}\n// @__NO_SIDE_EFFECTS__\nexport function pick(schema, mask) {\n return util.pick(schema, mask);\n}\n// .omit\n// @__NO_SIDE_EFFECTS__\nexport function omit(schema, mask) {\n return util.omit(schema, mask);\n}\n// @__NO_SIDE_EFFECTS__\nexport function partial(schema, mask) {\n return util.partial(ZodMiniOptional, schema, mask);\n}\n// @__NO_SIDE_EFFECTS__\nexport function required(schema, mask) {\n return util.required(ZodMiniNonOptional, schema, mask);\n}\n// @__NO_SIDE_EFFECTS__\nexport function catchall(inst, catchall) {\n return inst.clone({ ...inst._zod.def, catchall: catchall });\n}\nexport const ZodMiniUnion = /*@__PURE__*/ core.$constructor(\"ZodMiniUnion\", (inst, def) => {\n core.$ZodUnion.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function union(options, params) {\n return new ZodMiniUnion({\n type: \"union\",\n options: options,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniXor = /*@__PURE__*/ core.$constructor(\"ZodMiniXor\", (inst, def) => {\n ZodMiniUnion.init(inst, def);\n core.$ZodXor.init(inst, def);\n});\n/** Creates an exclusive union (XOR) where exactly one option must match.\n * Unlike regular unions that succeed when any option matches, xor fails if\n * zero or more than one option matches the input. */\nexport function xor(options, params) {\n return new ZodMiniXor({\n type: \"union\",\n options: options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodMiniDiscriminatedUnion\", (inst, def) => {\n core.$ZodDiscriminatedUnion.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function discriminatedUnion(discriminator, options, params) {\n return new ZodMiniDiscriminatedUnion({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniIntersection = /*@__PURE__*/ core.$constructor(\"ZodMiniIntersection\", (inst, def) => {\n core.$ZodIntersection.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function intersection(left, right) {\n return new ZodMiniIntersection({\n type: \"intersection\",\n left: left,\n right: right,\n });\n}\nexport const ZodMiniTuple = /*@__PURE__*/ core.$constructor(\"ZodMiniTuple\", (inst, def) => {\n core.$ZodTuple.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function tuple(items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof core.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new ZodMiniTuple({\n type: \"tuple\",\n items: items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniRecord = /*@__PURE__*/ core.$constructor(\"ZodMiniRecord\", (inst, def) => {\n core.$ZodRecord.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function record(keyType, valueType, params) {\n return new ZodMiniRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function partialRecord(keyType, valueType, params) {\n const k = core.clone(keyType);\n k._zod.values = undefined;\n return new ZodMiniRecord({\n type: \"record\",\n keyType: k,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function looseRecord(keyType, valueType, params) {\n return new ZodMiniRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n mode: \"loose\",\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniMap = /*@__PURE__*/ core.$constructor(\"ZodMiniMap\", (inst, def) => {\n core.$ZodMap.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function map(keyType, valueType, params) {\n return new ZodMiniMap({\n type: \"map\",\n keyType: keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniSet = /*@__PURE__*/ core.$constructor(\"ZodMiniSet\", (inst, def) => {\n core.$ZodSet.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function set(valueType, params) {\n return new ZodMiniSet({\n type: \"set\",\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniEnum = /*@__PURE__*/ core.$constructor(\"ZodMiniEnum\", (inst, def) => {\n core.$ZodEnum.init(inst, def);\n ZodMiniType.init(inst, def);\n inst.options = Object.values(def.entries);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _enum(values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n return new ZodMiniEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport { _enum as enum };\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function nativeEnum(entries, params) {\n return new ZodMiniEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniLiteral = /*@__PURE__*/ core.$constructor(\"ZodMiniLiteral\", (inst, def) => {\n core.$ZodLiteral.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function literal(value, params) {\n return new ZodMiniLiteral({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniFile = /*@__PURE__*/ core.$constructor(\"ZodMiniFile\", (inst, def) => {\n core.$ZodFile.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function file(params) {\n return core._file(ZodMiniFile, params);\n}\nexport const ZodMiniTransform = /*@__PURE__*/ core.$constructor(\"ZodMiniTransform\", (inst, def) => {\n core.$ZodTransform.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function transform(fn) {\n return new ZodMiniTransform({\n type: \"transform\",\n transform: fn,\n });\n}\nexport const ZodMiniOptional = /*@__PURE__*/ core.$constructor(\"ZodMiniOptional\", (inst, def) => {\n core.$ZodOptional.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function optional(innerType) {\n return new ZodMiniOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodMiniExactOptional = /*@__PURE__*/ core.$constructor(\"ZodMiniExactOptional\", (inst, def) => {\n core.$ZodExactOptional.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function exactOptional(innerType) {\n return new ZodMiniExactOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodMiniNullable = /*@__PURE__*/ core.$constructor(\"ZodMiniNullable\", (inst, def) => {\n core.$ZodNullable.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function nullable(innerType) {\n return new ZodMiniNullable({\n type: \"nullable\",\n innerType: innerType,\n });\n}\n// nullish\n// @__NO_SIDE_EFFECTS__\nexport function nullish(innerType) {\n return optional(nullable(innerType));\n}\nexport const ZodMiniDefault = /*@__PURE__*/ core.$constructor(\"ZodMiniDefault\", (inst, def) => {\n core.$ZodDefault.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function _default(innerType, defaultValue) {\n return new ZodMiniDefault({\n type: \"default\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodMiniPrefault = /*@__PURE__*/ core.$constructor(\"ZodMiniPrefault\", (inst, def) => {\n core.$ZodPrefault.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function prefault(innerType, defaultValue) {\n return new ZodMiniPrefault({\n type: \"prefault\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodMiniNonOptional = /*@__PURE__*/ core.$constructor(\"ZodMiniNonOptional\", (inst, def) => {\n core.$ZodNonOptional.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function nonoptional(innerType, params) {\n return new ZodMiniNonOptional({\n type: \"nonoptional\",\n innerType: innerType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniSuccess = /*@__PURE__*/ core.$constructor(\"ZodMiniSuccess\", (inst, def) => {\n core.$ZodSuccess.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function success(innerType) {\n return new ZodMiniSuccess({\n type: \"success\",\n innerType: innerType,\n });\n}\nexport const ZodMiniCatch = /*@__PURE__*/ core.$constructor(\"ZodMiniCatch\", (inst, def) => {\n core.$ZodCatch.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _catch(innerType, catchValue) {\n return new ZodMiniCatch({\n type: \"catch\",\n innerType: innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\nexport { _catch as catch };\nexport const ZodMiniNaN = /*@__PURE__*/ core.$constructor(\"ZodMiniNaN\", (inst, def) => {\n core.$ZodNaN.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function nan(params) {\n return core._nan(ZodMiniNaN, params);\n}\nexport const ZodMiniPipe = /*@__PURE__*/ core.$constructor(\"ZodMiniPipe\", (inst, def) => {\n core.$ZodPipe.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function pipe(in_, out) {\n return new ZodMiniPipe({\n type: \"pipe\",\n in: in_,\n out: out,\n });\n}\nexport const ZodMiniCodec = /*@__PURE__*/ core.$constructor(\"ZodMiniCodec\", (inst, def) => {\n ZodMiniPipe.init(inst, def);\n core.$ZodCodec.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function codec(in_, out, params) {\n return new ZodMiniCodec({\n type: \"pipe\",\n in: in_,\n out: out,\n transform: params.decode,\n reverseTransform: params.encode,\n });\n}\nexport const ZodMiniReadonly = /*@__PURE__*/ core.$constructor(\"ZodMiniReadonly\", (inst, def) => {\n core.$ZodReadonly.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function readonly(innerType) {\n return new ZodMiniReadonly({\n type: \"readonly\",\n innerType: innerType,\n });\n}\nexport const ZodMiniTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodMiniTemplateLiteral\", (inst, def) => {\n core.$ZodTemplateLiteral.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function templateLiteral(parts, params) {\n return new ZodMiniTemplateLiteral({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniLazy = /*@__PURE__*/ core.$constructor(\"ZodMiniLazy\", (inst, def) => {\n core.$ZodLazy.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// export function lazy<T extends object>(getter: () => T): T {\n// return util.createTransparentProxy<T>(getter);\n// }\n// @__NO_SIDE_EFFECTS__\nfunction _lazy(getter) {\n return new ZodMiniLazy({\n type: \"lazy\",\n getter: getter,\n });\n}\nexport { _lazy as lazy };\nexport const ZodMiniPromise = /*@__PURE__*/ core.$constructor(\"ZodMiniPromise\", (inst, def) => {\n core.$ZodPromise.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function promise(innerType) {\n return new ZodMiniPromise({\n type: \"promise\",\n innerType: innerType,\n });\n}\nexport const ZodMiniCustom = /*@__PURE__*/ core.$constructor(\"ZodMiniCustom\", (inst, def) => {\n core.$ZodCustom.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// custom checks\n// @__NO_SIDE_EFFECTS__\nexport function check(fn, params) {\n const ch = new core.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// ZodCustom\n// custom schema\n// @__NO_SIDE_EFFECTS__\nexport function custom(fn, _params) {\n return core._custom(ZodMiniCustom, fn ?? (() => true), _params);\n}\n// refine\n// @__NO_SIDE_EFFECTS__\nexport function refine(fn, _params = {}) {\n return core._refine(ZodMiniCustom, fn, _params);\n}\n// superRefine\n// @__NO_SIDE_EFFECTS__\nexport function superRefine(fn) {\n return core._superRefine(fn);\n}\n// Re-export describe and meta from core\nexport const describe = core.describe;\nexport const meta = core.meta;\n// instanceof\nclass Class {\n constructor(..._args) { }\n}\n// @__NO_SIDE_EFFECTS__\nfunction _instanceof(cls, params = {}) {\n const inst = custom((data) => data instanceof cls, params);\n inst._zod.bag.Class = cls;\n // Override check to emit invalid_type instead of custom\n inst._zod.check = (payload) => {\n if (!(payload.value instanceof cls)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: cls.name,\n input: payload.value,\n inst,\n path: [...(inst._zod.def.path ?? [])],\n });\n }\n };\n return inst;\n}\nexport { _instanceof as instanceof };\n// stringbool\nexport const stringbool = (...args) => core._stringbool({\n Codec: ZodMiniCodec,\n Boolean: ZodMiniBoolean,\n String: ZodMiniString,\n}, ...args);\n// @__NO_SIDE_EFFECTS__\nexport function json() {\n const jsonSchema = _lazy(() => {\n return union([string(), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n });\n return jsonSchema;\n}\nexport const ZodMiniFunction = /*@__PURE__*/ core.$constructor(\"ZodMiniFunction\", (inst, def) => {\n core.$ZodFunction.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function _function(params) {\n return new ZodMiniFunction({\n type: \"function\",\n input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),\n output: params?.output ?? unknown(),\n });\n}\nexport { _function as function };\n","import * as core from \"../core/index.js\";\nimport * as schemas from \"./schemas.js\";\n// @__NO_SIDE_EFFECTS__\nexport function string(params) {\n return core._coercedString(schemas.ZodMiniString, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function number(params) {\n return core._coercedNumber(schemas.ZodMiniNumber, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function boolean(params) {\n return core._coercedBoolean(schemas.ZodMiniBoolean, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function bigint(params) {\n return core._coercedBigint(schemas.ZodMiniBigInt, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function date(params) {\n return core._coercedDate(schemas.ZodMiniDate, params);\n}\n","import * as z from \"zod/mini\";\n\n//#region upstream/framework/lib/property/input/common.ts\nconst BasePropertySchema = z.object({\n\tdisplayName: z.string(),\n\tdescription: z.optional(z.string()),\n\tadvanced: z.optional(z.boolean()),\n\twidth: z.optional(z.enum([\"half\", \"full\"])),\n\ticon: z.optional(z.string()),\n\tplaceholder: z.optional(z.string())\n});\nconst TPropertyValue = (_T, propertyType) => z.object({\n\ttype: z.literal(propertyType),\n\trequired: z.boolean(),\n\tdefaultValue: z.optional(z.any())\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/property-type.ts\nlet PropertyType = /* @__PURE__ */ function(PropertyType) {\n\tPropertyType[\"SHORT_TEXT\"] = \"SHORT_TEXT\";\n\tPropertyType[\"LONG_TEXT\"] = \"LONG_TEXT\";\n\tPropertyType[\"RICH_TEXT\"] = \"RICH_TEXT\";\n\tPropertyType[\"MARKDOWN\"] = \"MARKDOWN\";\n\tPropertyType[\"DROPDOWN\"] = \"DROPDOWN\";\n\tPropertyType[\"STATIC_DROPDOWN\"] = \"STATIC_DROPDOWN\";\n\tPropertyType[\"NUMBER\"] = \"NUMBER\";\n\tPropertyType[\"CHECKBOX\"] = \"CHECKBOX\";\n\tPropertyType[\"OAUTH2\"] = \"OAUTH2\";\n\tPropertyType[\"SECRET_TEXT\"] = \"SECRET_TEXT\";\n\tPropertyType[\"ARRAY\"] = \"ARRAY\";\n\tPropertyType[\"OBJECT\"] = \"OBJECT\";\n\tPropertyType[\"BASIC_AUTH\"] = \"BASIC_AUTH\";\n\tPropertyType[\"JSON\"] = \"JSON\";\n\tPropertyType[\"MULTI_SELECT_DROPDOWN\"] = \"MULTI_SELECT_DROPDOWN\";\n\tPropertyType[\"STATIC_MULTI_SELECT_DROPDOWN\"] = \"STATIC_MULTI_SELECT_DROPDOWN\";\n\tPropertyType[\"DYNAMIC\"] = \"DYNAMIC\";\n\tPropertyType[\"CUSTOM_AUTH\"] = \"CUSTOM_AUTH\";\n\tPropertyType[\"OIDC\"] = \"OIDC\";\n\tPropertyType[\"DATE_TIME\"] = \"DATE_TIME\";\n\tPropertyType[\"DATE_RANGE\"] = \"DATE_RANGE\";\n\tPropertyType[\"FILE\"] = \"FILE\";\n\tPropertyType[\"CUSTOM\"] = \"CUSTOM\";\n\tPropertyType[\"COLOR\"] = \"COLOR\";\n\treturn PropertyType;\n}({});\n\n//#endregion\n//#region upstream/framework/lib/property/input/text-property.ts\nconst ShortTextProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.string(), PropertyType.SHORT_TEXT).shape\n});\nconst LongTextProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.string(), PropertyType.LONG_TEXT).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/dropdown/common.ts\nconst DropdownOption = z.object({\n\tlabel: z.string(),\n\tvalue: z.unknown(),\n\tdescription: z.optional(z.string()),\n\ticon: z.optional(z.string())\n});\nconst DropdownState = z.object({\n\tdisabled: z.optional(z.boolean()),\n\tplaceholder: z.optional(z.string()),\n\toptions: z.array(DropdownOption)\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/dropdown/static-dropdown.ts\nconst StaticDropdownDisplay = z.enum([\"cards\"]);\nconst StaticDropdownProperty = z.object({\n\t...BasePropertySchema.shape,\n\toptions: DropdownState,\n\tdisplay: z.optional(StaticDropdownDisplay),\n\t...TPropertyValue(z.unknown(), PropertyType.STATIC_DROPDOWN).shape\n});\nconst StaticMultiSelectDropdownProperty = z.object({\n\t...BasePropertySchema.shape,\n\toptions: DropdownState,\n\t...TPropertyValue(z.array(z.unknown()), PropertyType.STATIC_MULTI_SELECT_DROPDOWN).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/checkbox-property.ts\nconst CheckboxProperty = z.object({\n\t...BasePropertySchema.shape,\n\treveals: z.optional(z.array(z.string())),\n\t...TPropertyValue(z.boolean(), PropertyType.CHECKBOX).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/number-property.ts\nconst NumberProperty = z.object({\n\t...BasePropertySchema.shape,\n\tdisplay: z.optional(z.enum([\"stepper\"])),\n\tmin: z.optional(z.number()),\n\tmax: z.optional(z.number()),\n\tstep: z.optional(z.number()),\n\t...TPropertyValue(z.number(), PropertyType.NUMBER).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/file-property.ts\nvar ApFile = class {\n\tconstructor(filename, data, extension) {\n\t\tthis.filename = filename;\n\t\tthis.data = data;\n\t\tthis.extension = extension;\n\t}\n\tget base64() {\n\t\treturn this.data.toString(\"base64\");\n\t}\n};\nconst FileProperty = z.object({\n\t...BasePropertySchema.shape,\n\tstreaming: z.optional(z.boolean()),\n\t...TPropertyValue(z.unknown(), PropertyType.FILE).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/date-range-property.ts\nconst DateRangePreset = z.enum([\n\t\"any_time\",\n\t\"last_24_hours\",\n\t\"last_7_days\",\n\t\"last_30_days\",\n\t\"last_90_days\",\n\t\"this_month\",\n\t\"custom\"\n]);\nconst DateRangeValue = z.object({\n\tpreset: z.optional(DateRangePreset),\n\tafter: z.optional(z.string()),\n\tbefore: z.optional(z.string())\n});\nconst DateRangeProperty = z.object({\n\t...BasePropertySchema.shape,\n\tdisplay: z.optional(z.enum([\"dropdown\"])),\n\t...TPropertyValue(DateRangeValue, PropertyType.DATE_RANGE).shape\n});\nfunction isoDaysAgo(days) {\n\treturn (/* @__PURE__ */ new Date(Date.now() - days * 24 * 60 * 60 * 1e3)).toISOString();\n}\nfunction startOfThisMonth() {\n\tconst now = /* @__PURE__ */ new Date();\n\treturn new Date(now.getFullYear(), now.getMonth(), 1).toISOString();\n}\nfunction resolve(value) {\n\tif (!value || !value.preset || value.preset === \"any_time\") return {};\n\tswitch (value.preset) {\n\t\tcase \"last_24_hours\": return { after: isoDaysAgo(1) };\n\t\tcase \"last_7_days\": return { after: isoDaysAgo(7) };\n\t\tcase \"last_30_days\": return { after: isoDaysAgo(30) };\n\t\tcase \"last_90_days\": return { after: isoDaysAgo(90) };\n\t\tcase \"this_month\": return { after: startOfThisMonth() };\n\t\tcase \"custom\": return {\n\t\t\tafter: value.after && value.after.length > 0 ? value.after : void 0,\n\t\t\tbefore: value.before && value.before.length > 0 ? value.before : void 0\n\t\t};\n\t\tdefault: return {};\n\t}\n}\nconst dateRangeUtils = { resolve };\n\n//#endregion\n//#region upstream/core-piece-types/lib/markdown.ts\nlet MarkdownVariant = /* @__PURE__ */ function(MarkdownVariant) {\n\tMarkdownVariant[\"BORDERLESS\"] = \"BORDERLESS\";\n\tMarkdownVariant[\"INFO\"] = \"INFO\";\n\tMarkdownVariant[\"WARNING\"] = \"WARNING\";\n\tMarkdownVariant[\"TIP\"] = \"TIP\";\n\treturn MarkdownVariant;\n}({});\n\n//#endregion\n//#region upstream/core-utils/lib/utils.ts\nfunction isString(str) {\n\treturn str != null && typeof str === \"string\";\n}\nfunction isNil(value) {\n\treturn value === null || value === void 0;\n}\nfunction kebabCase(str) {\n\treturn str.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/\\s+/g, \"-\").replace(/_/g, \"-\").toLowerCase().replace(/^-+|-+$/g, \"\");\n}\nfunction isEmpty(value) {\n\tif (value == null) return true;\n\tif (typeof value === \"string\" || Array.isArray(value)) return value.length === 0;\n\tif (typeof value === \"object\") return Object.keys(value).length === 0;\n\treturn false;\n}\nfunction startCase(str) {\n\treturn str.replace(/([a-z])([A-Z])/g, \"$1 $2\").replace(/[_-]+/g, \" \").replace(/\\s+/g, \" \").replace(/^[a-z]/, (match) => match.toUpperCase()).replace(/\\b[a-z]/g, (match) => match.toUpperCase());\n}\nfunction camelCase(str) {\n\treturn str.replace(/([-_][a-z])/g, (group) => group.toUpperCase().replace(\"-\", \"\").replace(\"_\", \"\"));\n}\nfunction parseToJsonIfPossible(str) {\n\ttry {\n\t\treturn JSON.parse(str);\n\t} catch (e) {\n\t\treturn str;\n\t}\n}\nfunction pickBy(object, predicate) {\n\treturn Object.keys(object).reduce((result, key) => {\n\t\tif (predicate(object[key], key)) result[key] = object[key];\n\t\treturn result;\n\t}, {});\n}\nfunction chunk(records, size) {\n\tconst chunks = [];\n\tfor (let i = 0; i < records.length; i += size) chunks.push(records.slice(i, i + size));\n\treturn chunks;\n}\nfunction unique(array) {\n\tconst seen = /* @__PURE__ */ new Set();\n\treturn array.filter((item) => {\n\t\tconst key = JSON.stringify(item);\n\t\tif (seen.has(key)) return false;\n\t\tseen.add(key);\n\t\treturn true;\n\t});\n}\nconst INVALID_BASE64_CHARS = /[^A-Za-z0-9+/=]/;\nfunction isBase64(value, options) {\n\tif (!isString(value) || value.length === 0) return false;\n\tif (options?.allowMime) {\n\t\tconst base64MarkerIndex = value.indexOf(\";base64,\");\n\t\tif (base64MarkerIndex !== -1 && value.startsWith(\"data:\")) return _isValidBase64String(value.slice(base64MarkerIndex + 8));\n\t}\n\treturn _isValidBase64String(value);\n}\nfunction _isValidBase64String(str) {\n\tconst len = str.length;\n\tif (len === 0 || len % 4 !== 0 || INVALID_BASE64_CHARS.test(str)) return false;\n\tconst firstPaddingIndex = str.indexOf(\"=\");\n\treturn firstPaddingIndex === -1 || firstPaddingIndex === len - 1 || firstPaddingIndex === len - 2 && str[len - 1] === \"=\";\n}\n\n//#endregion\n//#region upstream/core-utils/lib/try-catch.ts\nasync function tryCatch(fn) {\n\ttry {\n\t\treturn {\n\t\t\tdata: await fn(),\n\t\t\terror: null\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tdata: null,\n\t\t\terror\n\t\t};\n\t}\n}\nfunction tryCatchSync(fn) {\n\ttry {\n\t\treturn {\n\t\t\tdata: fn(),\n\t\t\terror: null\n\t\t};\n\t} catch (error) {\n\t\treturn {\n\t\t\tdata: null,\n\t\t\terror\n\t\t};\n\t}\n}\n\n//#endregion\n//#region upstream/framework/lib/property/input/markdown-property.ts\nconst MarkDownProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.void(), PropertyType.MARKDOWN).shape,\n\tvariant: z.optional(z.enum(MarkdownVariant))\n});\n\n//#endregion\nexport { PropertyType as A, CheckboxProperty as C, DropdownState as D, DropdownOption as E, TPropertyValue as M, LongTextProperty as O, NumberProperty as S, StaticMultiSelectDropdownProperty as T, DateRangeProperty as _, chunk as a, ApFile as b, isNil as c, parseToJsonIfPossible as d, pickBy as f, DateRangePreset as g, MarkdownVariant as h, camelCase as i, BasePropertySchema as j, ShortTextProperty as k, isString as l, unique as m, tryCatch as n, isBase64 as o, startCase as p, tryCatchSync as r, isEmpty as s, MarkDownProperty as t, kebabCase as u, DateRangeValue as v, StaticDropdownProperty as w, FileProperty as x, dateRangeUtils as y };\n//# sourceMappingURL=markdown-property-Df2l6_y_.js.map","import { A as PropertyType, C as CheckboxProperty, M as TPropertyValue, O as LongTextProperty, S as NumberProperty, T as StaticMultiSelectDropdownProperty, _ as DateRangeProperty, h as MarkdownVariant, j as BasePropertySchema, k as ShortTextProperty, t as MarkDownProperty, w as StaticDropdownProperty, x as FileProperty } from \"./markdown-property-Df2l6_y_.js\";\nimport * as z from \"zod/mini\";\n\n//#region upstream/framework/lib/action/action.ts\nconst ErrorHandlingOptionsParam = z.object({\n\tretryOnFailure: z.object({\n\t\tdefaultValue: z.optional(z.boolean()),\n\t\thide: z.optional(z.boolean())\n\t}),\n\tcontinueOnFailure: z.object({\n\t\tdefaultValue: z.optional(z.boolean()),\n\t\thide: z.optional(z.boolean())\n\t})\n});\nvar IAction = class {\n\tconstructor(name, displayName, description, props, propertyGroups, run, test, requireAuth, errorHandlingOptions, outputSchema, audience, aiMetadata, classification) {\n\t\tthis.name = name;\n\t\tthis.displayName = displayName;\n\t\tthis.description = description;\n\t\tthis.props = props;\n\t\tthis.propertyGroups = propertyGroups;\n\t\tthis.run = run;\n\t\tthis.test = test;\n\t\tthis.requireAuth = requireAuth;\n\t\tthis.errorHandlingOptions = errorHandlingOptions;\n\t\tthis.outputSchema = outputSchema;\n\t\tthis.audience = audience;\n\t\tthis.aiMetadata = aiMetadata;\n\t\tthis.classification = classification;\n\t}\n};\nconst createAction = (params) => {\n\treturn new IAction(params.name, params.displayName, params.description, params.props, params.propertyGroups, params.run, params.test ?? params.run, params.requireAuth ?? true, params.errorHandlingOptions ?? {\n\t\tcontinueOnFailure: { defaultValue: false },\n\t\tretryOnFailure: { defaultValue: false }\n\t}, params.outputSchema, params.audience, params.aiMetadata, params.classification);\n};\n\n//#endregion\n//#region upstream/framework/lib/property/input/dropdown/dropdown-prop.ts\nconst DropdownProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.unknown(), PropertyType.DROPDOWN).shape,\n\trefreshers: z.array(z.string())\n});\nconst MultiSelectDropdownProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.array(z.unknown()), PropertyType.MULTI_SELECT_DROPDOWN).shape,\n\trefreshers: z.array(z.string())\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/json-property.ts\nconst JsonProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.union([z.record(z.string(), z.unknown())]), PropertyType.JSON).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/color-property.ts\nconst ColorProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.string(), PropertyType.COLOR).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/date-time-property.ts\nconst DateTimeProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.string(), PropertyType.DATE_TIME).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/array-property.ts\nconst ArraySubProps = z.record(z.string(), z.union([\n\tShortTextProperty,\n\tLongTextProperty,\n\tStaticDropdownProperty,\n\tMultiSelectDropdownProperty,\n\tStaticMultiSelectDropdownProperty,\n\tCheckboxProperty,\n\tNumberProperty,\n\tFileProperty,\n\tJsonProperty,\n\tColorProperty,\n\tDateTimeProperty\n]));\nconst ArrayProperty = z.object({\n\t...BasePropertySchema.shape,\n\tproperties: z.optional(ArraySubProps),\n\t...TPropertyValue(z.array(z.unknown()), PropertyType.ARRAY).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/dynamic-prop.ts\nconst DynamicProp = z.union([\n\tShortTextProperty,\n\tStaticDropdownProperty,\n\tJsonProperty,\n\tArrayProperty,\n\tStaticMultiSelectDropdownProperty\n]);\nconst DynamicPropsValue = z.record(z.string(), DynamicProp);\nconst DynamicProperties = z.object({\n\trefreshers: z.array(z.string()),\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.unknown(), PropertyType.DYNAMIC).shape\n});\n\n//#endregion\n//#region upstream/core-utils/lib/assertions.ts\nfunction assertNotNullOrUndefined(value, fieldName) {\n\tif (value === null || value === void 0) throw new Error(`${fieldName} is null or undefined`);\n}\nconst isNotUndefined = (value) => {\n\treturn value !== void 0;\n};\n\n//#endregion\n//#region upstream/framework/lib/property/input/object-property.ts\nconst ObjectProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.record(z.string(), z.unknown()), PropertyType.OBJECT).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/rich-text-property.ts\nconst RichTextProperty = z.object({\n\t...BasePropertySchema.shape,\n\tformatProperty: z.optional(z.string()),\n\t...TPropertyValue(z.string(), PropertyType.RICH_TEXT).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/custom-property.ts\nconst CustomProperty = z.object({\n\t...BasePropertySchema.shape,\n\t...TPropertyValue(z.unknown(), PropertyType.CUSTOM).shape,\n\tcode: z.string()\n});\n\n//#endregion\n//#region upstream/framework/lib/property/input/index.ts\nconst InputProperty = z.union([\n\tShortTextProperty,\n\tLongTextProperty,\n\tRichTextProperty,\n\tMarkDownProperty,\n\tCheckboxProperty,\n\tStaticDropdownProperty,\n\tStaticMultiSelectDropdownProperty,\n\tDropdownProperty,\n\tMultiSelectDropdownProperty,\n\tDynamicProperties,\n\tNumberProperty,\n\tArrayProperty,\n\tObjectProperty,\n\tJsonProperty,\n\tDateTimeProperty,\n\tDateRangeProperty,\n\tFileProperty,\n\tCustomProperty,\n\tColorProperty\n]);\nconst Property = {\n\tShortText(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.SHORT_TEXT\n\t\t};\n\t},\n\tCheckbox(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.CHECKBOX\n\t\t};\n\t},\n\tLongText(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.LONG_TEXT\n\t\t};\n\t},\n\tRichText(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.RICH_TEXT\n\t\t};\n\t},\n\tMarkDown(request) {\n\t\treturn {\n\t\t\tdisplayName: \"Markdown\",\n\t\t\trequired: false,\n\t\t\tdescription: request.value,\n\t\t\ttype: PropertyType.MARKDOWN,\n\t\t\tvalueSchema: void 0,\n\t\t\tvariant: request.variant ?? MarkdownVariant.INFO\n\t\t};\n\t},\n\tNumber(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.NUMBER\n\t\t};\n\t},\n\tJson(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.JSON\n\t\t};\n\t},\n\tArray(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.ARRAY\n\t\t};\n\t},\n\tObject(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.OBJECT\n\t\t};\n\t},\n\tDropdown(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.DROPDOWN\n\t\t};\n\t},\n\tStaticDropdown(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.STATIC_DROPDOWN\n\t\t};\n\t},\n\tMultiSelectDropdown(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.MULTI_SELECT_DROPDOWN\n\t\t};\n\t},\n\tDynamicProperties(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.DYNAMIC\n\t\t};\n\t},\n\tStaticMultiSelectDropdown(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.STATIC_MULTI_SELECT_DROPDOWN\n\t\t};\n\t},\n\tDateTime(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.DATE_TIME\n\t\t};\n\t},\n\tDateRange(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.DATE_RANGE\n\t\t};\n\t},\n\tFile(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.FILE\n\t\t};\n\t},\n\tCustom(request) {\n\t\tconst code = request.code.toString();\n\t\treturn {\n\t\t\t...request,\n\t\t\tcode,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.CUSTOM\n\t\t};\n\t},\n\tColor(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.COLOR\n\t\t};\n\t}\n};\n\n//#endregion\nexport { ErrorHandlingOptionsParam as _, ObjectProperty as a, DynamicProp as c, ArrayProperty as d, ArraySubProps as f, MultiSelectDropdownProperty as g, DropdownProperty as h, RichTextProperty as i, DynamicProperties as l, JsonProperty as m, Property as n, assertNotNullOrUndefined as o, DateTimeProperty as p, CustomProperty as r, isNotUndefined as s, InputProperty as t, DynamicPropsValue as u, IAction as v, createAction as y };\n//# sourceMappingURL=input-COuhC1I-.js.map","import { A as PropertyType, C as CheckboxProperty, M as TPropertyValue, O as LongTextProperty, S as NumberProperty, T as StaticMultiSelectDropdownProperty, c as isNil, k as ShortTextProperty, t as MarkDownProperty, w as StaticDropdownProperty } from \"./markdown-property-Df2l6_y_.js\";\nimport * as z from \"zod/mini\";\n\n//#region upstream/core-piece-types/lib/app-connection.ts\nlet AppConnectionType = /* @__PURE__ */ function(AppConnectionType) {\n\tAppConnectionType[\"OAUTH2\"] = \"OAUTH2\";\n\tAppConnectionType[\"PLATFORM_OAUTH2\"] = \"PLATFORM_OAUTH2\";\n\tAppConnectionType[\"CLOUD_OAUTH2\"] = \"CLOUD_OAUTH2\";\n\tAppConnectionType[\"SECRET_TEXT\"] = \"SECRET_TEXT\";\n\tAppConnectionType[\"BASIC_AUTH\"] = \"BASIC_AUTH\";\n\tAppConnectionType[\"CUSTOM_AUTH\"] = \"CUSTOM_AUTH\";\n\tAppConnectionType[\"OIDC\"] = \"OIDC\";\n\tAppConnectionType[\"NO_AUTH\"] = \"NO_AUTH\";\n\treturn AppConnectionType;\n}({});\nlet OAuth2GrantType = /* @__PURE__ */ function(OAuth2GrantType) {\n\tOAuth2GrantType[\"AUTHORIZATION_CODE\"] = \"authorization_code\";\n\tOAuth2GrantType[\"CLIENT_CREDENTIALS\"] = \"client_credentials\";\n\treturn OAuth2GrantType;\n}({});\nconst BOTH_CLIENT_CREDENTIALS_AND_AUTHORIZATION_CODE = \"both_client_credentials_and_authorization_code\";\n\n//#endregion\n//#region upstream/core-piece-types/lib/trigger.ts\nlet TriggerStrategy = /* @__PURE__ */ function(TriggerStrategy) {\n\tTriggerStrategy[\"POLLING\"] = \"POLLING\";\n\tTriggerStrategy[\"WEBHOOK\"] = \"WEBHOOK\";\n\tTriggerStrategy[\"APP_WEBHOOK\"] = \"APP_WEBHOOK\";\n\tTriggerStrategy[\"MANUAL\"] = \"MANUAL\";\n\treturn TriggerStrategy;\n}({});\nlet WebhookHandshakeStrategy = /* @__PURE__ */ function(WebhookHandshakeStrategy) {\n\tWebhookHandshakeStrategy[\"NONE\"] = \"NONE\";\n\tWebhookHandshakeStrategy[\"HEADER_PRESENT\"] = \"HEADER_PRESENT\";\n\tWebhookHandshakeStrategy[\"QUERY_PRESENT\"] = \"QUERY_PRESENT\";\n\tWebhookHandshakeStrategy[\"BODY_PARAM_PRESENT\"] = \"BODY_PARAM_PRESENT\";\n\tWebhookHandshakeStrategy[\"HEAD_REQUEST\"] = \"HEAD_REQUEST\";\n\treturn WebhookHandshakeStrategy;\n}({});\nconst WebhookHandshakeConfiguration = z.object({\n\tstrategy: z.enum(WebhookHandshakeStrategy),\n\tparamName: z.optional(z.string())\n});\nlet TriggerTestStrategy = /* @__PURE__ */ function(TriggerTestStrategy) {\n\tTriggerTestStrategy[\"SIMULATION\"] = \"SIMULATION\";\n\tTriggerTestStrategy[\"TEST_FUNCTION\"] = \"TEST_FUNCTION\";\n\treturn TriggerTestStrategy;\n}({});\nconst AUTHENTICATION_PROPERTY_NAME = \"auth\";\n\n//#endregion\n//#region upstream/core-utils/lib/object-utils.ts\nconst spreadIfDefined = (key, value) => {\n\tif (isNil(value)) return {};\n\treturn { [key]: value };\n};\nconst isObject = (obj) => {\n\treturn typeof obj === \"object\" && obj !== null && !Array.isArray(obj);\n};\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/common.ts\nconst BasePieceAuthSchema = z.object({\n\tdisplayName: z.string(),\n\tdescription: z.optional(z.string()),\n\thasConnectionIdentifier: z.optional(z.boolean())\n});\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/basic-auth-prop.ts\nconst BasicAuthPropertyValue = z.object({\n\tusername: z.string(),\n\tpassword: z.string()\n});\nconst BasicAuthProperty = z.object({\n\t...BasePieceAuthSchema.shape,\n\tusername: z.object({\n\t\tdisplayName: z.string(),\n\t\tdescription: z.optional(z.string())\n\t}),\n\tpassword: z.object({\n\t\tdisplayName: z.string(),\n\t\tdescription: z.optional(z.string())\n\t}),\n\t...TPropertyValue(BasicAuthPropertyValue, PropertyType.BASIC_AUTH).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/secret-text-property.ts\nconst SecretTextProperty = z.object({\n\t...BasePieceAuthSchema.shape,\n\t...TPropertyValue(z.object({ auth: z.string() }), PropertyType.SECRET_TEXT).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/custom-auth-prop.ts\nconst CustomAuthProps = z.record(z.string(), z.union([\n\tShortTextProperty,\n\tLongTextProperty,\n\tSecretTextProperty,\n\tNumberProperty,\n\tStaticDropdownProperty,\n\tCheckboxProperty,\n\tMarkDownProperty,\n\tStaticMultiSelectDropdownProperty\n]));\nconst CustomAuthProperty = z.object({\n\t...BasePieceAuthSchema.shape,\n\tprops: CustomAuthProps,\n\t...TPropertyValue(z.unknown(), PropertyType.CUSTOM_AUTH).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/oidc-prop.ts\nconst OIDCAuthProps = z.record(z.string(), z.union([\n\tShortTextProperty,\n\tLongTextProperty,\n\tSecretTextProperty,\n\tNumberProperty,\n\tCheckboxProperty,\n\tStaticDropdownProperty,\n\tStaticMultiSelectDropdownProperty,\n\tMarkDownProperty\n]));\nconst OIDCProperty = z.object({\n\t...BasePieceAuthSchema.shape,\n\tprops: OIDCAuthProps,\n\t...TPropertyValue(z.unknown(), PropertyType.OIDC).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/oauth2-prop.ts\nlet OAuth2AuthorizationMethod = /* @__PURE__ */ function(OAuth2AuthorizationMethod) {\n\tOAuth2AuthorizationMethod[\"HEADER\"] = \"HEADER\";\n\tOAuth2AuthorizationMethod[\"BODY\"] = \"BODY\";\n\treturn OAuth2AuthorizationMethod;\n}({});\nconst OAuthProp = z.union([\n\tShortTextProperty,\n\tSecretTextProperty,\n\tStaticDropdownProperty\n]);\nconst OAuth2Props = z.record(z.string(), OAuthProp);\nconst OAuth2ExtraProps = z.object({\n\tprops: z.optional(z.record(z.string(), OAuthProp)),\n\tauthUrl: z.string(),\n\ttokenUrl: z.string(),\n\tscope: z.array(z.string()),\n\tprompt: z.optional(z.union([\n\t\tz.literal(\"none\"),\n\t\tz.literal(\"consent\"),\n\t\tz.literal(\"login\"),\n\t\tz.literal(\"omit\")\n\t])),\n\tpkce: z.optional(z.boolean()),\n\tpkceMethod: z.optional(z.union([z.literal(\"plain\"), z.literal(\"S256\")])),\n\tauthorizationMethod: z.optional(z.enum(OAuth2AuthorizationMethod)),\n\tgrantType: z.optional(z.union([z.enum(OAuth2GrantType), z.literal(BOTH_CLIENT_CREDENTIALS_AND_AUTHORIZATION_CODE)])),\n\textra: z.optional(z.record(z.string(), z.string()))\n});\nconst OAuth2PropertyValue = z.object({\n\taccess_token: z.string(),\n\tprops: z.optional(OAuth2Props),\n\tdata: z.record(z.string(), z.any())\n});\nconst OAuth2Property = z.object({\n\t...BasePieceAuthSchema.shape,\n\t...OAuth2ExtraProps.shape,\n\t...TPropertyValue(OAuth2PropertyValue, PropertyType.OAUTH2).shape\n});\n\n//#endregion\n//#region upstream/framework/lib/property/authentication/index.ts\nconst PieceAuthProperty = z.union([\n\tBasicAuthProperty,\n\tCustomAuthProperty,\n\tOIDCProperty,\n\tOAuth2Property,\n\tSecretTextProperty\n]);\nconst DEFAULT_CONNECTION_DISPLAY_NAME = \"Connection\";\nconst PieceAuth = {\n\tSecretText(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.SECRET_TEXT\n\t\t};\n\t},\n\tOAuth2(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.OAUTH2,\n\t\t\tdisplayName: request.displayName || \"Connection\"\n\t\t};\n\t},\n\tBasicAuth(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.BASIC_AUTH,\n\t\t\tdisplayName: request.displayName || \"Connection\",\n\t\t\trequired: true\n\t\t};\n\t},\n\tCustomAuth(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.CUSTOM_AUTH,\n\t\t\tdisplayName: request.displayName || \"Connection\"\n\t\t};\n\t},\n\tOIDC(request) {\n\t\treturn {\n\t\t\t...request,\n\t\t\tvalueSchema: void 0,\n\t\t\ttype: PropertyType.OIDC,\n\t\t\tdisplayName: request.displayName || \"Connection\"\n\t\t};\n\t},\n\tNone() {}\n};\nfunction getAuthPropertyForValue({ authValueType, pieceAuth }) {\n\tif (!Array.isArray(pieceAuth) || isNil(pieceAuth)) return pieceAuth;\n\treturn pieceAuth.find((auth) => authConnectionTypeToPropertyType[authValueType] === auth.type) ?? pieceAuth.at(0);\n}\nconst authConnectionTypeToPropertyType = {\n\t[AppConnectionType.OAUTH2]: PropertyType.OAUTH2,\n\t[AppConnectionType.CLOUD_OAUTH2]: PropertyType.OAUTH2,\n\t[AppConnectionType.PLATFORM_OAUTH2]: PropertyType.OAUTH2,\n\t[AppConnectionType.BASIC_AUTH]: PropertyType.BASIC_AUTH,\n\t[AppConnectionType.CUSTOM_AUTH]: PropertyType.CUSTOM_AUTH,\n\t[AppConnectionType.OIDC]: PropertyType.OIDC,\n\t[AppConnectionType.SECRET_TEXT]: PropertyType.SECRET_TEXT,\n\t[AppConnectionType.NO_AUTH]: void 0\n};\n\n//#endregion\nexport { TriggerStrategy as _, OAuth2AuthorizationMethod as a, AppConnectionType as b, OAuth2Props as c, SecretTextProperty as d, BasicAuthProperty as f, AUTHENTICATION_PROPERTY_NAME as g, spreadIfDefined as h, getAuthPropertyForValue as i, OIDCProperty as l, isObject as m, PieceAuth as n, OAuth2Property as o, BasicAuthPropertyValue as p, PieceAuthProperty as r, OAuth2PropertyValue as s, DEFAULT_CONNECTION_DISPLAY_NAME as t, CustomAuthProperty as u, TriggerTestStrategy as v, OAuth2GrantType as x, WebhookHandshakeStrategy as y };\n//# sourceMappingURL=authentication-B7brX_It.js.map","import crypto from 'crypto'\n\nimport { urlAlphabet } from './url-alphabet/index.js'\n\nconst POOL_SIZE_MULTIPLIER = 128\nlet pool, poolOffset\n\nlet fillPool = bytes => {\n if (bytes < 0) throw new RangeError('Wrong ID size')\n try {\n if (!pool || pool.length < bytes) {\n pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER)\n crypto.randomFillSync(pool)\n poolOffset = 0\n } else if (poolOffset + bytes > pool.length) {\n crypto.randomFillSync(pool)\n poolOffset = 0\n }\n } catch (e) {\n pool = undefined\n throw e\n }\n poolOffset += bytes\n}\n\nlet random = bytes => {\n fillPool((bytes |= 0))\n return pool.subarray(poolOffset - bytes, poolOffset)\n}\n\nlet customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1\n\n\n let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length)\n\n return (size = defaultSize) => {\n if (size <= 0) return ''\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let i = step\n while (i--) {\n id += alphabet[bytes[i] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\n\nlet customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size, random)\n\nlet nanoid = (size = 21) => {\n fillPool((size |= 0))\n let id = ''\n for (let i = poolOffset - size; i < poolOffset; i++) {\n id += urlAlphabet[pool[i] & 63]\n }\n return id\n}\n\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","import { _ as ErrorHandlingOptionsParam, a as ObjectProperty, c as DynamicProp, d as ArrayProperty, f as ArraySubProps, g as MultiSelectDropdownProperty, h as DropdownProperty, i as RichTextProperty, l as DynamicProperties, m as JsonProperty, n as Property, o as assertNotNullOrUndefined, p as DateTimeProperty, r as CustomProperty, s as isNotUndefined, t as InputProperty, u as DynamicPropsValue, v as IAction, y as createAction } from \"./input-COuhC1I-.js\";\nimport { A as PropertyType, C as CheckboxProperty, D as DropdownState, E as DropdownOption, O as LongTextProperty, S as NumberProperty, T as StaticMultiSelectDropdownProperty, _ as DateRangeProperty, a as chunk, b as ApFile, c as isNil, f as pickBy, g as DateRangePreset, h as MarkdownVariant, i as camelCase, j as BasePropertySchema, k as ShortTextProperty, l as isString, m as unique, n as tryCatch, p as startCase, s as isEmpty, u as kebabCase, v as DateRangeValue, w as StaticDropdownProperty, x as FileProperty, y as dateRangeUtils } from \"./markdown-property-Df2l6_y_.js\";\nimport { _ as TriggerStrategy, a as OAuth2AuthorizationMethod, b as AppConnectionType, c as OAuth2Props, d as SecretTextProperty, f as BasicAuthProperty, g as AUTHENTICATION_PROPERTY_NAME, h as spreadIfDefined, i as getAuthPropertyForValue, l as OIDCProperty, n as PieceAuth, o as OAuth2Property, p as BasicAuthPropertyValue, r as PieceAuthProperty, s as OAuth2PropertyValue, t as DEFAULT_CONNECTION_DISPLAY_NAME, u as CustomAuthProperty, v as TriggerTestStrategy, x as OAuth2GrantType, y as WebhookHandshakeStrategy } from \"./authentication-B7brX_It.js\";\nimport * as z from \"zod/mini\";\nimport { customAlphabet } from \"nanoid\";\nimport path from \"node:path\";\nimport fs from \"node:fs/promises\";\n\n//#region upstream/core-piece-types/lib/piece.ts\nlet PackageType = /* @__PURE__ */ function(PackageType) {\n\tPackageType[\"ARCHIVE\"] = \"ARCHIVE\";\n\tPackageType[\"REGISTRY\"] = \"REGISTRY\";\n\treturn PackageType;\n}({});\nlet PieceType = /* @__PURE__ */ function(PieceType) {\n\tPieceType[\"CUSTOM\"] = \"CUSTOM\";\n\tPieceType[\"OFFICIAL\"] = \"OFFICIAL\";\n\treturn PieceType;\n}({});\nlet PieceCategory = /* @__PURE__ */ function(PieceCategory) {\n\tPieceCategory[\"ARTIFICIAL_INTELLIGENCE\"] = \"ARTIFICIAL_INTELLIGENCE\";\n\tPieceCategory[\"COMMUNICATION\"] = \"COMMUNICATION\";\n\tPieceCategory[\"COMMERCE\"] = \"COMMERCE\";\n\tPieceCategory[\"CORE\"] = \"CORE\";\n\tPieceCategory[\"UNIVERSAL_AI\"] = \"UNIVERSAL_AI\";\n\tPieceCategory[\"FLOW_CONTROL\"] = \"FLOW_CONTROL\";\n\tPieceCategory[\"BUSINESS_INTELLIGENCE\"] = \"BUSINESS_INTELLIGENCE\";\n\tPieceCategory[\"ACCOUNTING\"] = \"ACCOUNTING\";\n\tPieceCategory[\"PRODUCTIVITY\"] = \"PRODUCTIVITY\";\n\tPieceCategory[\"CONTENT_AND_FILES\"] = \"CONTENT_AND_FILES\";\n\tPieceCategory[\"DEVELOPER_TOOLS\"] = \"DEVELOPER_TOOLS\";\n\tPieceCategory[\"CUSTOMER_SUPPORT\"] = \"CUSTOMER_SUPPORT\";\n\tPieceCategory[\"FORMS_AND_SURVEYS\"] = \"FORMS_AND_SURVEYS\";\n\tPieceCategory[\"HUMAN_RESOURCES\"] = \"HUMAN_RESOURCES\";\n\tPieceCategory[\"PAYMENT_PROCESSING\"] = \"PAYMENT_PROCESSING\";\n\tPieceCategory[\"MARKETING\"] = \"MARKETING\";\n\tPieceCategory[\"SALES_AND_CRM\"] = \"SALES_AND_CRM\";\n\treturn PieceCategory;\n}({});\n\n//#endregion\n//#region upstream/core-piece-types/lib/execution.ts\nlet ExecutionType = /* @__PURE__ */ function(ExecutionType) {\n\tExecutionType[\"BEGIN\"] = \"BEGIN\";\n\tExecutionType[\"RESUME\"] = \"RESUME\";\n\treturn ExecutionType;\n}({});\nlet PauseType = /* @__PURE__ */ function(PauseType) {\n\tPauseType[\"DELAY\"] = \"DELAY\";\n\tPauseType[\"WEBHOOK\"] = \"WEBHOOK\";\n\treturn PauseType;\n}({});\nlet StreamStepProgress = /* @__PURE__ */ function(StreamStepProgress) {\n\tStreamStepProgress[\"WEBSOCKET\"] = \"WEBSOCKET\";\n\tStreamStepProgress[\"NONE\"] = \"NONE\";\n\treturn StreamStepProgress;\n}({});\nconst RespondResponse = z.object({\n\tstatus: z.optional(z.number()),\n\tbody: z.optional(z.unknown()),\n\theaders: z.optional(z.record(z.string(), z.string()))\n});\nconst DelayPauseMetadata = z.object({\n\ttype: z.literal(PauseType.DELAY),\n\tresumeDateTime: z.string(),\n\trequestIdToReply: z.optional(z.string()),\n\thandlerId: z.optional(z.string()),\n\tstreamStepProgress: z.optional(z.enum(StreamStepProgress))\n});\nconst WebhookPauseMetadata = z.object({\n\ttype: z.literal(PauseType.WEBHOOK),\n\trequestId: z.string(),\n\trequestIdToReply: z.optional(z.string()),\n\tresponse: RespondResponse,\n\thandlerId: z.optional(z.string()),\n\tstreamStepProgress: z.optional(z.enum(StreamStepProgress))\n});\nconst PauseMetadata = z.union([DelayPauseMetadata, WebhookPauseMetadata]);\n\n//#endregion\n//#region upstream/core-utils/lib/id-generator.ts\nconst ALPHABET = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\nconst ID_LENGTH = 21;\nconst ApId = z.string().check(z.regex(new RegExp(`^[0-9a-zA-Z]{${ID_LENGTH}}$`)));\nconst apId = customAlphabet(ALPHABET, ID_LENGTH);\n\n//#endregion\n//#region upstream/core-utils/lib/base-model.ts\nconst DateOrString = z.pipe(z.transform((val) => val instanceof Date ? val.toISOString() : val), z.string());\nconst BaseModelSchema = {\n\tid: z.string(),\n\tcreated: DateOrString,\n\tupdated: DateOrString\n};\nconst Nullable = (schema) => z.optional(z.nullable(schema));\nfunction NullableEnum(enumObj) {\n\treturn z.optional(z.nullable(z.enum(enumObj)));\n}\nconst OptionalBooleanFromQuery = z.pipe(z.transform((val) => val === \"true\" || val === true ? true : val === \"false\" || val === false ? false : void 0), z.optional(z.boolean()));\nconst OptionalArrayFromQuery = (schema) => z.pipe(z.transform((val) => Array.isArray(val) ? val : val !== void 0 ? [val] : void 0), z.optional(z.array(schema)));\n\n//#endregion\n//#region upstream/core-utils/lib/seek-page.ts\nconst SeekPage = (t) => z.object({\n\tdata: z.array(t),\n\tnext: Nullable(z.string()),\n\tprevious: Nullable(z.string())\n});\n\n//#endregion\n//#region upstream/core-utils/lib/locale.ts\nlet LocalesEnum = /* @__PURE__ */ function(LocalesEnum) {\n\tLocalesEnum[\"DUTCH\"] = \"nl\";\n\tLocalesEnum[\"ENGLISH\"] = \"en\";\n\tLocalesEnum[\"GERMAN\"] = \"de\";\n\tLocalesEnum[\"FRENCH\"] = \"fr\";\n\tLocalesEnum[\"SPANISH\"] = \"es\";\n\tLocalesEnum[\"JAPANESE\"] = \"ja\";\n\tLocalesEnum[\"CHINESE_SIMPLIFIED\"] = \"zh\";\n\tLocalesEnum[\"PORTUGUESE\"] = \"pt\";\n\tLocalesEnum[\"ARABIC\"] = \"ar\";\n\tLocalesEnum[\"CHINESE_TRADITIONAL\"] = \"zh-TW\";\n\treturn LocalesEnum;\n}({});\n\n//#endregion\n//#region upstream/core-utils/lib/permission.ts\nlet AIProviderName = /* @__PURE__ */ function(AIProviderName) {\n\tAIProviderName[\"OPENAI\"] = \"openai\";\n\tAIProviderName[\"OPENROUTER\"] = \"openrouter\";\n\tAIProviderName[\"ANTHROPIC\"] = \"anthropic\";\n\tAIProviderName[\"AZURE\"] = \"azure\";\n\tAIProviderName[\"GOOGLE\"] = \"google\";\n\tAIProviderName[\"ACTIVEPIECES\"] = \"activepieces\";\n\tAIProviderName[\"CLOUDFLARE_GATEWAY\"] = \"cloudflare-gateway\";\n\tAIProviderName[\"CUSTOM\"] = \"custom\";\n\tAIProviderName[\"BEDROCK\"] = \"bedrock\";\n\tAIProviderName[\"VERTEX\"] = \"vertex\";\n\tAIProviderName[\"MISTRAL\"] = \"mistral\";\n\tAIProviderName[\"XAI\"] = \"xai\";\n\tAIProviderName[\"DEEPSEEK\"] = \"deepseek\";\n\tAIProviderName[\"ZAI\"] = \"zai\";\n\tAIProviderName[\"QWEN\"] = \"qwen\";\n\tAIProviderName[\"MINIMAX\"] = \"minimax\";\n\tAIProviderName[\"MOONSHOT\"] = \"moonshot\";\n\treturn AIProviderName;\n}({});\n\n//#endregion\n//#region upstream/core-piece-types/lib/agents.ts\nconst TASK_COMPLETION_TOOL_NAME = \"updateTaskStatus\";\nlet AgentToolType = /* @__PURE__ */ function(AgentToolType) {\n\tAgentToolType[\"PIECE\"] = \"PIECE\";\n\tAgentToolType[\"FLOW\"] = \"FLOW\";\n\tAgentToolType[\"MCP\"] = \"MCP\";\n\tAgentToolType[\"KNOWLEDGE_BASE\"] = \"KNOWLEDGE_BASE\";\n\treturn AgentToolType;\n}({});\nlet FieldControlMode = /* @__PURE__ */ function(FieldControlMode) {\n\tFieldControlMode[\"AGENT_DECIDE\"] = \"agent-decide\";\n\tFieldControlMode[\"CHOOSE_YOURSELF\"] = \"choose-yourself\";\n\tFieldControlMode[\"LEAVE_EMPTY\"] = \"leave-empty\";\n\treturn FieldControlMode;\n}({});\nlet KnowledgeBaseSourceType = /* @__PURE__ */ function(KnowledgeBaseSourceType) {\n\tKnowledgeBaseSourceType[\"FILE\"] = \"FILE\";\n\tKnowledgeBaseSourceType[\"TABLE\"] = \"TABLE\";\n\treturn KnowledgeBaseSourceType;\n}({});\nlet McpProtocol = /* @__PURE__ */ function(McpProtocol) {\n\tMcpProtocol[\"SSE\"] = \"sse\";\n\tMcpProtocol[\"STREAMABLE_HTTP\"] = \"streamable-http\";\n\tMcpProtocol[\"SIMPLE_HTTP\"] = \"http\";\n\treturn McpProtocol;\n}({});\nlet McpAuthType = /* @__PURE__ */ function(McpAuthType) {\n\tMcpAuthType[\"NONE\"] = \"none\";\n\tMcpAuthType[\"ACCESS_TOKEN\"] = \"access_token\";\n\tMcpAuthType[\"API_KEY\"] = \"api_key\";\n\tMcpAuthType[\"HEADERS\"] = \"headers\";\n\treturn McpAuthType;\n}({});\nlet AgentOutputFieldType = /* @__PURE__ */ function(AgentOutputFieldType) {\n\tAgentOutputFieldType[\"TEXT\"] = \"text\";\n\tAgentOutputFieldType[\"NUMBER\"] = \"number\";\n\tAgentOutputFieldType[\"BOOLEAN\"] = \"boolean\";\n\treturn AgentOutputFieldType;\n}({});\nlet AgentTaskStatus = /* @__PURE__ */ function(AgentTaskStatus) {\n\tAgentTaskStatus[\"COMPLETED\"] = \"COMPLETED\";\n\tAgentTaskStatus[\"FAILED\"] = \"FAILED\";\n\tAgentTaskStatus[\"IN_PROGRESS\"] = \"IN_PROGRESS\";\n\treturn AgentTaskStatus;\n}({});\nlet ContentBlockType = /* @__PURE__ */ function(ContentBlockType) {\n\tContentBlockType[\"MARKDOWN\"] = \"MARKDOWN\";\n\tContentBlockType[\"TOOL_CALL\"] = \"TOOL_CALL\";\n\treturn ContentBlockType;\n}({});\nlet ToolCallStatus = /* @__PURE__ */ function(ToolCallStatus) {\n\tToolCallStatus[\"IN_PROGRESS\"] = \"in-progress\";\n\tToolCallStatus[\"COMPLETED\"] = \"completed\";\n\treturn ToolCallStatus;\n}({});\nlet ExecutionToolStatus = /* @__PURE__ */ function(ExecutionToolStatus) {\n\tExecutionToolStatus[\"SUCCESS\"] = \"SUCCESS\";\n\tExecutionToolStatus[\"FAILED\"] = \"FAILED\";\n\treturn ExecutionToolStatus;\n}({});\nlet ToolCallType = /* @__PURE__ */ function(ToolCallType) {\n\tToolCallType[\"PIECE\"] = \"PIECE\";\n\tToolCallType[\"FLOW\"] = \"FLOW\";\n\tToolCallType[\"MCP\"] = \"MCP\";\n\tToolCallType[\"KNOWLEDGE_BASE\"] = \"KNOWLEDGE_BASE\";\n\tToolCallType[\"UNKNOWN\"] = \"UNKNOWN\";\n\treturn ToolCallType;\n}({});\nlet AgentPieceProps = /* @__PURE__ */ function(AgentPieceProps) {\n\tAgentPieceProps[\"AGENT_ID\"] = \"agentId\";\n\tAgentPieceProps[\"AGENT_TOOLS\"] = \"agentTools\";\n\tAgentPieceProps[\"STRUCTURED_OUTPUT\"] = \"structuredOutput\";\n\tAgentPieceProps[\"PROMPT\"] = \"prompt\";\n\tAgentPieceProps[\"MAX_STEPS\"] = \"maxSteps\";\n\tAgentPieceProps[\"AI_PROVIDER_MODEL\"] = \"aiProviderModel\";\n\tAgentPieceProps[\"WEB_SEARCH\"] = \"webSearch\";\n\tAgentPieceProps[\"WEB_SEARCH_OPTIONS\"] = \"webSearchOptions\";\n\treturn AgentPieceProps;\n}({});\nconst PredefinedInputField = z.object({\n\tmode: z.enum(FieldControlMode),\n\tvalue: z.unknown()\n});\nconst PredefinedInputsStructure = z.object({\n\tauth: z.optional(z.string()),\n\tfields: z.record(z.string(), PredefinedInputField)\n});\nconst AgentPieceToolMetadata = z.object({\n\tpieceName: z.string(),\n\tpieceVersion: z.string(),\n\tactionName: z.string(),\n\tpredefinedInput: z.optional(PredefinedInputsStructure)\n});\nconst AgentPieceTool = z.object({\n\ttype: z.literal(AgentToolType.PIECE),\n\ttoolName: z.string().check(z.minLength(1)),\n\tpieceMetadata: AgentPieceToolMetadata\n});\nconst McpAuthNone = z.object({ type: z.literal(McpAuthType.NONE) });\nconst McpAuthAccessToken = z.object({\n\ttype: z.literal(McpAuthType.ACCESS_TOKEN),\n\taccessToken: z.string()\n});\nconst McpAuthApiKey = z.object({\n\ttype: z.literal(McpAuthType.API_KEY),\n\tapiKey: z.string(),\n\tapiKeyHeader: z.string()\n});\nconst McpAuthHeaders = z.object({\n\ttype: z.literal(McpAuthType.HEADERS),\n\theaders: z.record(z.string(), z.string())\n});\nconst McpAuthConfig = z.discriminatedUnion(\"type\", [\n\tMcpAuthNone,\n\tMcpAuthAccessToken,\n\tMcpAuthApiKey,\n\tMcpAuthHeaders\n]);\nconst AgentFlowTool = z.object({\n\ttype: z.literal(AgentToolType.FLOW),\n\ttoolName: z.string().check(z.minLength(1)),\n\texternalFlowId: z.string(),\n\tflowDisplayName: z.optional(z.string())\n});\nconst AgentMcpTool = z.object({\n\ttype: z.literal(AgentToolType.MCP),\n\ttoolName: z.string().check(z.minLength(1)),\n\tserverUrl: z.url(),\n\tprotocol: z.enum(McpProtocol),\n\tauth: McpAuthConfig\n});\nconst AgentKnowledgeBaseTool = z.object({\n\ttype: z.literal(AgentToolType.KNOWLEDGE_BASE),\n\ttoolName: z.string().check(z.minLength(1)),\n\tsourceType: z.enum(KnowledgeBaseSourceType),\n\tsourceId: z.string(),\n\tsourceName: z.string()\n});\nconst AgentTool = z.discriminatedUnion(\"type\", [\n\tAgentPieceTool,\n\tAgentFlowTool,\n\tAgentMcpTool,\n\tAgentKnowledgeBaseTool\n]);\nconst AgentOutputField = z.object({\n\tdisplayName: z.string(),\n\tdescription: z.optional(z.string()),\n\ttype: z.enum(AgentOutputFieldType)\n});\nconst MarkdownContentBlock = z.object({\n\ttype: z.literal(ContentBlockType.MARKDOWN),\n\tmarkdown: z.string()\n});\nconst toolCallBaseShape = {\n\ttype: z.literal(ContentBlockType.TOOL_CALL),\n\tinput: Nullable(z.record(z.string(), z.unknown())),\n\toutput: z.optional(z.unknown()),\n\ttoolName: z.string(),\n\tstatus: z.enum(ToolCallStatus),\n\ttoolCallId: z.string(),\n\tstartTime: z.string(),\n\tendTime: z.optional(z.string())\n};\nz.object(toolCallBaseShape);\nconst ToolCallContentBlock = z.discriminatedUnion(\"toolCallType\", [\n\tz.object({\n\t\t...toolCallBaseShape,\n\t\ttoolCallType: z.literal(ToolCallType.PIECE),\n\t\tpieceName: z.string(),\n\t\tpieceVersion: z.string(),\n\t\tactionName: z.string()\n\t}),\n\tz.object({\n\t\t...toolCallBaseShape,\n\t\ttoolCallType: z.literal(ToolCallType.FLOW),\n\t\tdisplayName: z.string(),\n\t\texternalFlowId: z.string()\n\t}),\n\tz.object({\n\t\t...toolCallBaseShape,\n\t\ttoolCallType: z.literal(ToolCallType.MCP),\n\t\tdisplayName: z.string(),\n\t\tserverUrl: z.string()\n\t}),\n\tz.object({\n\t\t...toolCallBaseShape,\n\t\ttoolCallType: z.literal(ToolCallType.KNOWLEDGE_BASE),\n\t\tdisplayName: z.string(),\n\t\tsourceType: z.string()\n\t}),\n\tz.object({\n\t\t...toolCallBaseShape,\n\t\ttoolCallType: z.literal(ToolCallType.UNKNOWN),\n\t\tdisplayName: z.string()\n\t})\n]);\nconst AgentStepBlock = z.union([MarkdownContentBlock, ToolCallContentBlock]);\nfunction buildAuthHeaders(authConfig) {\n\tlet headers = {};\n\tswitch (authConfig.type) {\n\t\tcase McpAuthType.NONE: break;\n\t\tcase McpAuthType.HEADERS:\n\t\t\theaders = authConfig.headers;\n\t\t\tbreak;\n\t\tcase McpAuthType.ACCESS_TOKEN:\n\t\t\theaders[\"Authorization\"] = `Bearer ${authConfig.accessToken}`;\n\t\t\tbreak;\n\t\tcase McpAuthType.API_KEY: {\n\t\t\tconst headerName = authConfig.apiKeyHeader;\n\t\t\theaders[headerName] = authConfig.apiKey;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn headers;\n}\nfunction shortHash(str) {\n\tlet h = 5381;\n\tfor (let i = 0; i < str.length; i++) h = (Math.imul(h, 33) ^ str.charCodeAt(i)) >>> 0;\n\treturn h.toString(36).padStart(6, \"0\").slice(-6);\n}\nfunction sanitizeToolName(name) {\n\treturn name.toLowerCase().replace(/[^a-z0-9_-]/g, \"_\").replace(/_+/g, \"_\").replace(/^_+|_+$/g, \"\");\n}\nfunction createToolName(name) {\n\tconst sanitized = sanitizeToolName(name);\n\treturn `${sanitized.slice(0, MAX_PREFIX_LENGTH)}_${shortHash(sanitized.length > 0 ? sanitized : name)}_mcp`;\n}\nfunction toValidToolName(name) {\n\tif (PROVIDER_TOOL_NAME_PATTERN.test(name)) return name;\n\tconst generated = createToolName(name);\n\treturn PROVIDER_TOOL_NAME_PATTERN.test(generated) ? generated : createToolName(`tool_${name}`);\n}\nfunction suggestToolName(sourceName) {\n\treturn toValidToolName(sanitizeToolName(sourceName));\n}\nfunction isProviderSafeIdentifier(name) {\n\treturn PROVIDER_TOOL_NAME_PATTERN.test(name);\n}\nfunction toProviderSafeIdentifier({ name, fallback }) {\n\tif (isProviderSafeIdentifier(name)) return name;\n\tconst sanitized = sanitizeToolName(name).slice(0, MAX_IDENTIFIER_LENGTH);\n\tif (sanitized.length === 0) return fallback;\n\tconst seeded = /^[a-z_]/.test(sanitized) ? sanitized : `_${sanitized}`;\n\treturn isProviderSafeIdentifier(seeded) ? seeded : fallback;\n}\nfunction createPieceToolName(pieceName, actionName) {\n\tconst idx = pieceName.indexOf(\"piece-\");\n\treturn createToolName(`${idx >= 0 ? pieceName.substring(idx + 6) : pieceName}-${actionName}`);\n}\nconst MAX_PREFIX_LENGTH = 53;\nconst MAX_IDENTIFIER_LENGTH = 64;\nconst PROVIDER_TOOL_NAME_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_-]{0,63}$/;\nconst mcpToolNameUtils = {\n\tcreateToolName,\n\tcreatePieceToolName,\n\ttoValidToolName,\n\tsuggestToolName,\n\tisProviderSafeIdentifier,\n\ttoProviderSafeIdentifier\n};\nconst AGENT_STEP_TIMEOUT_MS = 10800 * 1e3;\nconst AGENT_STEP_TEST_TIMEOUT_MS = 900 * 1e3;\n\n//#endregion\n//#region upstream/core-piece-types/lib/ai-providers.ts\nlet AIProviderModelType = /* @__PURE__ */ function(AIProviderModelType) {\n\tAIProviderModelType[\"IMAGE\"] = \"image\";\n\tAIProviderModelType[\"TEXT\"] = \"text\";\n\treturn AIProviderModelType;\n}({});\nconst BaseAIProviderAuthConfig = z.object({ apiKey: z.string() });\nconst AnthropicProviderAuthConfig = BaseAIProviderAuthConfig;\nconst ActivePiecesProviderAuthConfig = z.object({\n\tapiKey: z.string(),\n\tapiKeyHash: z.string()\n});\nconst OpenAICompatibleProviderAuthConfig = BaseAIProviderAuthConfig;\nconst CloudflareGatewayProviderAuthConfig = BaseAIProviderAuthConfig;\nconst AzureProviderAuthConfig = BaseAIProviderAuthConfig;\nconst GoogleProviderAuthConfig = BaseAIProviderAuthConfig;\nconst OpenAIProviderAuthConfig = BaseAIProviderAuthConfig;\nconst OpenRouterProviderAuthConfig = BaseAIProviderAuthConfig;\nconst MistralProviderAuthConfig = BaseAIProviderAuthConfig;\nconst VertexProviderAuthConfig = z.object({ serviceAccountJson: z.string().check(z.minLength(1)) });\nconst BedrockProviderAuthConfig = z.object({\n\taccessKeyId: z.string().check(z.minLength(1)),\n\tsecretAccessKey: z.string().check(z.minLength(1))\n});\nconst AnthropicProviderConfig = z.object({});\nconst ActivePiecesProviderConfig = z.object({});\nconst GoogleProviderConfig = z.object({});\nconst OpenAIProviderConfig = z.object({});\nconst OpenRouterProviderConfig = z.object({});\nconst MistralProviderConfig = z.object({});\nconst ProviderModelConfig = z.object({\n\tmodelId: z.string(),\n\tmodelName: z.string(),\n\tmodelType: z.enum(AIProviderModelType)\n});\nconst OpenAICompatibleProviderConfig = z.object({\n\tapiKeyHeader: z.string(),\n\tbaseUrl: z.string(),\n\tmodels: z.array(ProviderModelConfig),\n\tdefaultHeaders: z.optional(z.record(z.string(), z.string())),\n\tapiStyle: z.optional(z.enum([\"chat\", \"responses\"]))\n});\nconst CloudflareGatewayProviderConfig = z.object({\n\taccountId: z.string(),\n\tgatewayId: z.string(),\n\tmodels: z.array(ProviderModelConfig),\n\tvertexProject: z.optional(z.string()),\n\tvertexRegion: z.optional(z.string())\n});\nconst AzureProviderConfig = z.object({\n\tresourceName: z.string(),\n\tapiVersion: z.pipe(z.transform((v) => typeof v === \"string\" && v.trim().length === 0 ? void 0 : v), z.optional(z.string()))\n});\nconst BedrockProviderConfig = z.object({ region: z.string().check(z.minLength(1)) });\nconst VertexProviderConfig = z.object({\n\tproject: z.string().check(z.regex(/^[a-z0-9][a-z0-9-]{0,62}$/)),\n\tregion: z.string().check(z.regex(/^[a-z0-9][a-z0-9-]{0,62}$/)),\n\tmodels: z.array(ProviderModelConfig)\n});\nconst OpenAiCompatibleVendorConfig = z.object({});\nconst AIProviderAuthConfig = z.union([\n\tAnthropicProviderAuthConfig,\n\tAzureProviderAuthConfig,\n\tGoogleProviderAuthConfig,\n\tOpenAIProviderAuthConfig,\n\tOpenRouterProviderAuthConfig,\n\tCloudflareGatewayProviderAuthConfig,\n\tOpenAICompatibleProviderAuthConfig,\n\tActivePiecesProviderAuthConfig,\n\tBedrockProviderAuthConfig,\n\tVertexProviderAuthConfig,\n\tMistralProviderAuthConfig\n]);\nconst AIProviderConfig = z.union([\n\tOpenAICompatibleProviderConfig,\n\tCloudflareGatewayProviderConfig,\n\tAzureProviderConfig,\n\tVertexProviderConfig,\n\tBedrockProviderConfig,\n\tAnthropicProviderConfig,\n\tGoogleProviderConfig,\n\tOpenAIProviderConfig,\n\tOpenRouterProviderConfig,\n\tActivePiecesProviderConfig,\n\tMistralProviderConfig,\n\tOpenAiCompatibleVendorConfig\n]);\nconst AIProviderModel = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\ttype: z.enum(AIProviderModelType)\n});\nconst AIProviderWithoutSensitiveData = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tprovider: z.enum(AIProviderName),\n\tconfig: AIProviderConfig,\n\tenabledForChat: z.boolean()\n});\nconst ProjectAIProvider = z.object({\n\tprovider: z.enum(AIProviderName),\n\tname: z.string(),\n\tenabledForChat: z.boolean(),\n\tkeys: z.array(z.object({\n\t\tid: z.string(),\n\t\tname: z.string()\n\t}))\n});\nconst GetProviderConfigResponse = z.object({\n\tprovider: z.enum(AIProviderName),\n\tconfigId: z.string(),\n\tconfig: AIProviderConfig,\n\tauth: AIProviderAuthConfig,\n\tplatformId: z.string()\n});\nfunction splitCloudflareGatewayModelId(modelId) {\n\tconst slashIndex = modelId.indexOf(\"/\");\n\tif (slashIndex === -1) return {\n\t\tprovider: void 0,\n\t\tmodel: modelId,\n\t\tpublisher: void 0\n\t};\n\tconst provider = modelId.substring(0, slashIndex).trim().toLowerCase();\n\tconst rest = modelId.substring(slashIndex + 1);\n\tif (provider === \"google-vertex-ai\") {\n\t\tconst secondSlashIndex = rest.indexOf(\"/\");\n\t\tif (secondSlashIndex === -1) return {\n\t\t\tprovider: void 0,\n\t\t\tmodel: modelId,\n\t\t\tpublisher: void 0\n\t\t};\n\t\treturn {\n\t\t\tprovider: \"google-vertex-ai\",\n\t\t\tpublisher: rest.substring(0, secondSlashIndex),\n\t\t\tmodel: rest.substring(secondSlashIndex + 1)\n\t\t};\n\t}\n\treturn {\n\t\tprovider,\n\t\tmodel: rest,\n\t\tpublisher: void 0\n\t};\n}\nfunction getEffectiveProviderAndModel({ provider, model }) {\n\tif (provider !== AIProviderName.CLOUDFLARE_GATEWAY || !model) return {\n\t\tprovider,\n\t\tmodel\n\t};\n\tconst split = splitCloudflareGatewayModelId(model);\n\tconst mapped = CF_GATEWAY_SUBMODEL_TO_PROVIDER[(split.provider ?? \"\").trim().toLowerCase()];\n\tif (!mapped) return {\n\t\tprovider,\n\t\tmodel\n\t};\n\treturn {\n\t\tprovider: mapped,\n\t\tmodel: split.model\n\t};\n}\nconst CF_GATEWAY_SUBMODEL_TO_PROVIDER = {\n\topenai: AIProviderName.OPENAI,\n\tanthropic: AIProviderName.ANTHROPIC,\n\t\"google-ai-studio\": AIProviderName.GOOGLE,\n\t\"google-vertex-ai\": AIProviderName.GOOGLE\n};\nconst OPENAI_CHAT_MODELS = [\n\t\"gpt-5.5\",\n\t\"gpt-5.4-mini\",\n\t\"gpt-5.4-nano\",\n\t\"gpt-4.1\",\n\t\"gpt-4.1-mini\"\n];\nconst ANTHROPIC_CHAT_MODELS = [\n\t\"claude-sonnet-4-6\",\n\t\"claude-opus-4-7\",\n\t\"claude-haiku-4-5\"\n];\nconst ANTHROPIC_OPENROUTER_CHAT_MODELS = [\n\t\"claude-sonnet-4.6\",\n\t\"claude-opus-4.7\",\n\t\"claude-opus-4.8\",\n\t\"claude-haiku-4.5\"\n];\nconst GOOGLE_CHAT_MODELS = [\n\t\"gemini-2.5-pro\",\n\t\"gemini-2.5-flash\",\n\t\"gemini-3.7-flash\",\n\t\"gemini-3.1-pro-preview\",\n\t\"gemini-3-flash-preview\"\n];\nconst X_AI_OPENROUTER_CHAT_MODELS = [\"grok-4.20\"];\nconst REASONING_OPTIONAL_CHAT_MODELS = ANTHROPIC_OPENROUTER_CHAT_MODELS.map((model) => `${AIProviderName.ANTHROPIC}/${model}`);\nconst ALLOWED_CHAT_MODELS_BY_PROVIDER = {\n\t[AIProviderName.OPENAI]: OPENAI_CHAT_MODELS,\n\t[AIProviderName.ANTHROPIC]: ANTHROPIC_CHAT_MODELS,\n\t[AIProviderName.GOOGLE]: GOOGLE_CHAT_MODELS,\n\t[AIProviderName.VERTEX]: GOOGLE_CHAT_MODELS,\n\t[AIProviderName.ACTIVEPIECES]: [\n\t\t...ANTHROPIC_OPENROUTER_CHAT_MODELS.map((m) => `${AIProviderName.ANTHROPIC}/${m}`),\n\t\t...OPENAI_CHAT_MODELS.map((m) => `${AIProviderName.OPENAI}/${m}`),\n\t\t...GOOGLE_CHAT_MODELS.map((m) => `${AIProviderName.GOOGLE}/${m}`),\n\t\t...X_AI_OPENROUTER_CHAT_MODELS.map((m) => `x-ai/${m}`)\n\t]\n};\nconst DEFAULT_MAX_CONTEXT_TOKENS = 128e3;\nconst PROVIDER_MAX_CONTEXT_TOKENS = {\n\t[AIProviderName.OPENAI]: 128e3,\n\t[AIProviderName.ANTHROPIC]: 2e5,\n\t[AIProviderName.GOOGLE]: 1048576,\n\t[AIProviderName.BEDROCK]: 2e5,\n\t[AIProviderName.VERTEX]: 1048576,\n\t[AIProviderName.AZURE]: 128e3,\n\t[AIProviderName.OPENROUTER]: 128e3,\n\t[AIProviderName.ACTIVEPIECES]: 2e5,\n\t[AIProviderName.MISTRAL]: 128e3\n};\nfunction getMaxContextTokens({ provider }) {\n\tif (!provider) return DEFAULT_MAX_CONTEXT_TOKENS;\n\treturn PROVIDER_MAX_CONTEXT_TOKENS[provider] ?? DEFAULT_MAX_CONTEXT_TOKENS;\n}\nconst DEFAULT_EMBEDDING_MODELS = {\n\t[AIProviderName.OPENAI]: \"text-embedding-3-small\",\n\t[AIProviderName.GOOGLE]: \"text-embedding-004\",\n\t[AIProviderName.AZURE]: \"text-embedding-3-small\",\n\t[AIProviderName.ACTIVEPIECES]: \"text-embedding-3-small\",\n\t[AIProviderName.OPENROUTER]: \"openai/text-embedding-3-small\"\n};\nconst WEB_SEARCH_MODE_BY_PROVIDER = {\n\t[AIProviderName.ANTHROPIC]: \"native\",\n\t[AIProviderName.GOOGLE]: \"native\",\n\t[AIProviderName.OPENROUTER]: \"plugin\",\n\t[AIProviderName.ACTIVEPIECES]: \"plugin\"\n};\nconst NO_IMAGE_GENERATION_PROVIDERS = new Set([\n\tAIProviderName.ANTHROPIC,\n\tAIProviderName.MISTRAL,\n\tAIProviderName.XAI,\n\tAIProviderName.DEEPSEEK,\n\tAIProviderName.ZAI,\n\tAIProviderName.QWEN,\n\tAIProviderName.MINIMAX,\n\tAIProviderName.MOONSHOT\n]);\nconst OPENAI_COMPATIBLE_VENDOR_BASE_URLS = {\n\t[AIProviderName.XAI]: \"https://api.x.ai/v1\",\n\t[AIProviderName.DEEPSEEK]: \"https://api.deepseek.com/v1\",\n\t[AIProviderName.ZAI]: \"https://api.z.ai/api/paas/v4\",\n\t[AIProviderName.QWEN]: \"https://dashscope-intl.aliyuncs.com/compatible-mode/v1\",\n\t[AIProviderName.MINIMAX]: \"https://api.minimax.io/v1\",\n\t[AIProviderName.MOONSHOT]: \"https://api.moonshot.ai/v1\"\n};\nfunction buildProviderCapabilities(provider) {\n\treturn {\n\t\tchatModels: ALLOWED_CHAT_MODELS_BY_PROVIDER[provider],\n\t\tmaxContextTokens: getMaxContextTokens({ provider }),\n\t\tdefaultEmbeddingModel: DEFAULT_EMBEDDING_MODELS[provider],\n\t\tsupportsEmbedding: DEFAULT_EMBEDDING_MODELS[provider] !== void 0,\n\t\tsupportsImageGeneration: !NO_IMAGE_GENERATION_PROVIDERS.has(provider),\n\t\twebSearch: WEB_SEARCH_MODE_BY_PROVIDER[provider]\n\t};\n}\nconst ACTIVEPIECES_CHAT_TIERS = [\n\t{\n\t\tid: \"fast\",\n\t\tlabel: \"Fast\",\n\t\tmodelId: \"anthropic/claude-haiku-4.5\",\n\t\tnativeModelId: \"claude-haiku-4-5\",\n\t\tthinkingBudget: 5e3,\n\t\tcreditWeight: 2\n\t},\n\t{\n\t\tid: \"smart\",\n\t\tlabel: \"Expert\",\n\t\tmodelId: \"anthropic/claude-sonnet-4.6\",\n\t\tnativeModelId: \"claude-sonnet-4-6\",\n\t\tthinkingBudget: 1e4,\n\t\tcreditWeight: 10\n\t},\n\t{\n\t\tid: \"premium\",\n\t\tlabel: \"Heavy\",\n\t\tmodelId: \"anthropic/claude-opus-4.8\",\n\t\tnativeModelId: \"claude-opus-4-7\",\n\t\tthinkingBudget: 2e4,\n\t\tcreditWeight: 20\n\t}\n];\nconst DEFAULT_CHAT_TIER_ID = \"smart\";\nconst AI_PROVIDER_CAPABILITIES = {\n\t[AIProviderName.OPENAI]: buildProviderCapabilities(AIProviderName.OPENAI),\n\t[AIProviderName.ANTHROPIC]: buildProviderCapabilities(AIProviderName.ANTHROPIC),\n\t[AIProviderName.OPENROUTER]: buildProviderCapabilities(AIProviderName.OPENROUTER),\n\t[AIProviderName.AZURE]: buildProviderCapabilities(AIProviderName.AZURE),\n\t[AIProviderName.GOOGLE]: buildProviderCapabilities(AIProviderName.GOOGLE),\n\t[AIProviderName.CLOUDFLARE_GATEWAY]: buildProviderCapabilities(AIProviderName.CLOUDFLARE_GATEWAY),\n\t[AIProviderName.CUSTOM]: buildProviderCapabilities(AIProviderName.CUSTOM),\n\t[AIProviderName.BEDROCK]: buildProviderCapabilities(AIProviderName.BEDROCK),\n\t[AIProviderName.VERTEX]: buildProviderCapabilities(AIProviderName.VERTEX),\n\t[AIProviderName.MISTRAL]: buildProviderCapabilities(AIProviderName.MISTRAL),\n\t[AIProviderName.ACTIVEPIECES]: buildProviderCapabilities(AIProviderName.ACTIVEPIECES),\n\t[AIProviderName.XAI]: buildProviderCapabilities(AIProviderName.XAI),\n\t[AIProviderName.DEEPSEEK]: buildProviderCapabilities(AIProviderName.DEEPSEEK),\n\t[AIProviderName.ZAI]: buildProviderCapabilities(AIProviderName.ZAI),\n\t[AIProviderName.QWEN]: buildProviderCapabilities(AIProviderName.QWEN),\n\t[AIProviderName.MINIMAX]: buildProviderCapabilities(AIProviderName.MINIMAX),\n\t[AIProviderName.MOONSHOT]: buildProviderCapabilities(AIProviderName.MOONSHOT)\n};\n\n//#endregion\n//#region upstream/core-piece-types/lib/forms.ts\nconst FileResponseInterfaceV1 = z.object({\n\tbase64Url: z.string(),\n\tfileName: z.string(),\n\textension: z.optional(z.string())\n});\nconst FileResponseInterfaceV2 = z.object({\n\tmimeType: z.string(),\n\turl: z.string(),\n\tfileName: z.optional(z.string())\n});\nconst FileResponseInterface = z.union([FileResponseInterfaceV1, FileResponseInterfaceV2]);\nlet HumanInputFormResultTypes = /* @__PURE__ */ function(HumanInputFormResultTypes) {\n\tHumanInputFormResultTypes[\"FILE\"] = \"file\";\n\tHumanInputFormResultTypes[\"MARKDOWN\"] = \"markdown\";\n\treturn HumanInputFormResultTypes;\n}({});\nfunction createKeyForFormInput(displayName) {\n\t/**We do this because react form inputs must not contain quotes */\n\treturn displayName.toLowerCase().replace(/\\s+(\\w)/g, (_, letter) => letter.toUpperCase()).replace(/^(.)/, (letter) => letter.toLowerCase()).replaceAll(/[\\\\\"''\\n\\r\\t]/g, \"\");\n}\nconst HumanInputFormResult = z.union([z.object({\n\ttype: z.literal(HumanInputFormResultTypes.FILE),\n\tvalue: FileResponseInterface\n}), z.object({\n\ttype: z.literal(HumanInputFormResultTypes.MARKDOWN),\n\tvalue: z.string(),\n\tfiles: z.optional(z.array(FileResponseInterface))\n})]);\nconst ChatFormResponse = z.object({\n\tsessionId: z.string(),\n\tmessage: z.string(),\n\tfiles: z.optional(z.array(z.string()))\n});\n\n//#endregion\n//#region upstream/core-piece-types/lib/tables.ts\nlet FieldType = /* @__PURE__ */ function(FieldType) {\n\tFieldType[\"TEXT\"] = \"TEXT\";\n\tFieldType[\"NUMBER\"] = \"NUMBER\";\n\tFieldType[\"DATE\"] = \"DATE\";\n\tFieldType[\"DATETIME\"] = \"DATETIME\";\n\tFieldType[\"STATIC_DROPDOWN\"] = \"STATIC_DROPDOWN\";\n\treturn FieldType;\n}({});\nlet TableAutomationTrigger = /* @__PURE__ */ function(TableAutomationTrigger) {\n\tTableAutomationTrigger[\"ON_NEW_RECORD\"] = \"ON_NEW_RECORD\";\n\tTableAutomationTrigger[\"ON_UPDATE_RECORD\"] = \"ON_UPDATE_RECORD\";\n\treturn TableAutomationTrigger;\n}({});\nlet TableAutomationStatus = /* @__PURE__ */ function(TableAutomationStatus) {\n\tTableAutomationStatus[\"ENABLED\"] = \"ENABLED\";\n\tTableAutomationStatus[\"DISABLED\"] = \"DISABLED\";\n\treturn TableAutomationStatus;\n}({});\nlet TableWebhookEventType = /* @__PURE__ */ function(TableWebhookEventType) {\n\tTableWebhookEventType[\"RECORD_CREATED\"] = \"RECORD_CREATED\";\n\tTableWebhookEventType[\"RECORD_UPDATED\"] = \"RECORD_UPDATED\";\n\tTableWebhookEventType[\"RECORD_DELETED\"] = \"RECORD_DELETED\";\n\treturn TableWebhookEventType;\n}({});\nlet FilterOperator = /* @__PURE__ */ function(FilterOperator) {\n\tFilterOperator[\"EQ\"] = \"eq\";\n\tFilterOperator[\"NEQ\"] = \"neq\";\n\tFilterOperator[\"GT\"] = \"gt\";\n\tFilterOperator[\"GTE\"] = \"gte\";\n\tFilterOperator[\"LT\"] = \"lt\";\n\tFilterOperator[\"LTE\"] = \"lte\";\n\tFilterOperator[\"CO\"] = \"co\";\n\tFilterOperator[\"EXISTS\"] = \"exists\";\n\tFilterOperator[\"NOT_EXISTS\"] = \"not_exists\";\n\treturn FilterOperator;\n}({});\nconst Field = z.union([z.object({\n\t...BaseModelSchema,\n\tname: z.string(),\n\texternalId: z.string(),\n\ttype: z.literal(FieldType.STATIC_DROPDOWN),\n\ttableId: z.string(),\n\tprojectId: z.string(),\n\tdata: z.object({ options: z.array(z.object({ value: z.string() })) })\n}), z.object({\n\t...BaseModelSchema,\n\tname: z.string(),\n\texternalId: z.string(),\n\ttype: z.union([\n\t\tz.literal(FieldType.TEXT),\n\t\tz.literal(FieldType.NUMBER),\n\t\tz.literal(FieldType.DATE),\n\t\tz.literal(FieldType.DATETIME)\n\t]),\n\ttableId: z.string(),\n\tprojectId: z.string()\n})]);\nconst Table = z.object({\n\t...BaseModelSchema,\n\tname: z.string(),\n\tfolderId: Nullable(z.string()),\n\tprojectId: z.string(),\n\texternalId: z.string(),\n\tstatus: NullableEnum(TableAutomationStatus),\n\ttrigger: NullableEnum(TableAutomationTrigger)\n});\nconst PopulatedRecord = z.object({\n\t...BaseModelSchema,\n\ttableId: z.string(),\n\tprojectId: z.string(),\n\tcells: z.record(z.string(), z.object({\n\t\tupdated: z.string(),\n\t\tcreated: z.string(),\n\t\tvalue: z.unknown(),\n\t\tfieldName: z.string()\n\t}))\n});\nconst CreateTableWebhookRequest = z.object({\n\tevents: z.array(z.enum(TableWebhookEventType)),\n\twebhookUrl: z.string(),\n\tflowId: z.string()\n});\nconst ExportTableResponse = z.object({\n\tfields: z.array(z.object({\n\t\tid: z.string(),\n\t\tname: z.string()\n\t})),\n\trows: z.array(z.record(z.string(), z.string())),\n\tname: z.string()\n});\nconst ListTablesRequest = z.object({\n\tprojectId: z.string(),\n\tlimit: z.optional(z.coerce.number()),\n\tcursor: z.optional(z.string()),\n\tname: z.optional(z.string()),\n\texternalIds: OptionalArrayFromQuery(z.string()),\n\tfolderId: z.optional(z.string()),\n\tfolderIds: OptionalArrayFromQuery(z.string())\n});\nconst CreateRecordsRequest = z.object({\n\trecords: z.array(z.array(z.object({\n\t\tfieldId: z.string(),\n\t\tvalue: coerceToString()\n\t}))),\n\ttableId: z.string()\n});\nconst UpdateRecordRequest = z.object({\n\tcells: z.optional(z.array(z.object({\n\t\tfieldId: z.string(),\n\t\tvalue: coerceToString()\n\t}))),\n\ttableId: z.string(),\n\tagentUpdate: z.optional(z.boolean())\n});\nconst Filter = z.discriminatedUnion(\"operator\", [\n\tvalueFilter(FilterOperator.EQ),\n\tvalueFilter(FilterOperator.NEQ),\n\tvalueFilter(FilterOperator.GT),\n\tvalueFilter(FilterOperator.GTE),\n\tvalueFilter(FilterOperator.LT),\n\tvalueFilter(FilterOperator.LTE),\n\tvalueFilter(FilterOperator.CO),\n\texistenceFilter(FilterOperator.EXISTS),\n\texistenceFilter(FilterOperator.NOT_EXISTS)\n]);\nconst ListRecordsRequest = z.object({\n\ttableId: z.string(),\n\tlimit: z.optional(z.coerce.number()),\n\tcursor: z.optional(z.string()),\n\tfilters: OptionalArrayFromQuery(Filter)\n});\nconst StaticDropdownEmptyOption = {\n\tlabel: \"\",\n\tvalue: \"\"\n};\nfunction coerceToString() {\n\treturn z.pipe(z.transform((v) => v === null || v === void 0 ? v : String(v)), z.nullable(z.string()));\n}\nfunction valueFilter(op) {\n\treturn z.object({\n\t\tfieldId: z.string(),\n\t\toperator: z.literal(op),\n\t\tvalue: z.string()\n\t});\n}\nfunction existenceFilter(op) {\n\treturn z.object({\n\t\tfieldId: z.string(),\n\t\toperator: z.literal(op)\n\t});\n}\n\n//#endregion\n//#region upstream/core-piece-types/lib/flow-contracts.ts\nlet FlowStatus = /* @__PURE__ */ function(FlowStatus) {\n\tFlowStatus[\"ENABLED\"] = \"ENABLED\";\n\tFlowStatus[\"DISABLED\"] = \"DISABLED\";\n\treturn FlowStatus;\n}({});\nlet FlowTriggerType = /* @__PURE__ */ function(FlowTriggerType) {\n\tFlowTriggerType[\"EMPTY\"] = \"EMPTY\";\n\tFlowTriggerType[\"PIECE\"] = \"PIECE_TRIGGER\";\n\treturn FlowTriggerType;\n}({});\nconst StopResponse = z.object({\n\tstatus: z.optional(z.number()),\n\tbody: z.optional(z.unknown()),\n\theaders: z.optional(z.record(z.string(), z.string()))\n});\nconst Project = z.object({\n\t...BaseModelSchema,\n\tdeleted: Nullable(DateOrString),\n\townerId: z.string(),\n\tdisplayName: z.string(),\n\tplatformId: z.string(),\n\texternalId: Nullable(z.string())\n});\nconst USE_DRAFT_QUERY_PARAM_NAME = \"useDraft\";\nconst PARENT_RUN_ID_HEADER = \"ap-parent-run-id\";\nconst FAIL_PARENT_ON_FAILURE_HEADER = \"ap-fail-parent-on-failure\";\nconst RAW_PAYLOAD_HEADER = \"ap-raw-payload\";\n\n//#endregion\n//#region upstream/core-piece-types/lib/mcp-piece.ts\nlet McpPropertyType = /* @__PURE__ */ function(McpPropertyType) {\n\tMcpPropertyType[\"TEXT\"] = \"Text\";\n\tMcpPropertyType[\"BOOLEAN\"] = \"Boolean\";\n\tMcpPropertyType[\"DATE\"] = \"Date\";\n\tMcpPropertyType[\"NUMBER\"] = \"Number\";\n\tMcpPropertyType[\"ARRAY\"] = \"Array\";\n\tMcpPropertyType[\"OBJECT\"] = \"Object\";\n\treturn McpPropertyType;\n}({});\nconst McpProperty = z.object({\n\tname: z.string(),\n\tdescription: z.optional(z.string()),\n\ttype: z.string(),\n\trequired: z.boolean()\n});\nconst McpTrigger = z.object({\n\tpieceName: z.string(),\n\ttriggerName: z.string(),\n\tinput: z.object({\n\t\ttoolName: z.string(),\n\t\ttoolDescription: z.string(),\n\t\tinputSchema: z.array(McpProperty),\n\t\treturnsResponse: z.boolean()\n\t})\n});\n\n//#endregion\n//#region upstream/core-piece-types/lib/engine-tools.ts\nfunction normalizeToolOutputToExecuteResponse(raw) {\n\tif (raw === null || typeof raw !== \"object\") return {\n\t\tstatus: ExecutionToolStatus.FAILED,\n\t\toutput: raw,\n\t\tresolvedInput: {},\n\t\terrorMessage: \"Invalid tool output\"\n\t};\n\tconst o = raw;\n\tif (o[\"status\"] === ExecutionToolStatus.SUCCESS || o[\"status\"] === ExecutionToolStatus.FAILED) return {\n\t\tstatus: o[\"status\"],\n\t\toutput: o[\"output\"],\n\t\tresolvedInput: o[\"resolvedInput\"] ?? {},\n\t\terrorMessage: o[\"errorMessage\"]\n\t};\n\tconst isError = o[\"isError\"] === true;\n\tlet output = o[\"structuredContent\"];\n\tif (output === void 0 && Array.isArray(o[\"content\"])) {\n\t\tconst parts = o[\"content\"].map((c) => c?.text).filter(Boolean);\n\t\toutput = parts.length === 1 ? parts[0] : parts.length ? { text: parts.join(\"\") } : o[\"content\"];\n\t}\n\tif (output === void 0) output = o;\n\treturn {\n\t\tstatus: isError ? ExecutionToolStatus.FAILED : ExecutionToolStatus.SUCCESS,\n\t\toutput,\n\t\tresolvedInput: {},\n\t\terrorMessage: isError ? o[\"content\"]?.[0]?.text ?? o[\"message\"] ?? \"Tool failed\" : void 0\n\t};\n}\n\n//#endregion\n//#region upstream/framework/lib/property/util.ts\nfunction buildSchema(props, auth, requireAuth = true) {\n\tconst entries = Object.entries(props);\n\tconst propsSchema = {};\n\tfor (const [name, property] of entries) {\n\t\tswitch (property.type) {\n\t\t\tcase PropertyType.MARKDOWN:\n\t\t\t\tpropsSchema[name] = z.optional(z.union([\n\t\t\t\t\tz.null(),\n\t\t\t\t\tz.undefined(),\n\t\t\t\t\tz.never(),\n\t\t\t\t\tz.unknown()\n\t\t\t\t]));\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.DATE_TIME:\n\t\t\tcase PropertyType.SHORT_TEXT:\n\t\t\tcase PropertyType.LONG_TEXT:\n\t\t\tcase PropertyType.RICH_TEXT:\n\t\t\tcase PropertyType.COLOR:\n\t\t\tcase PropertyType.FILE:\n\t\t\t\tpropsSchema[name] = property.required ? z.string().check(z.minLength(1)) : z.string();\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.CHECKBOX:\n\t\t\t\tpropsSchema[name] = z.union([z.boolean(), z.string()]);\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.NUMBER:\n\t\t\t\tpropsSchema[name] = z.union([property.required ? z.string().check(z.minLength(1)) : z.string(), z.number()]);\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.STATIC_DROPDOWN:\n\t\t\tcase PropertyType.DROPDOWN:\n\t\t\t\tpropsSchema[name] = z.unknown().check(z.refine((val) => val !== null && val !== void 0, { error: \"Value must not be null or undefined\" }));\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.SECRET_TEXT:\n\t\t\t\tpropsSchema[name] = property.required ? z.string().check(z.minLength(1)) : z.string();\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.BASIC_AUTH:\n\t\t\tcase PropertyType.CUSTOM_AUTH:\n\t\t\tcase PropertyType.OAUTH2: break;\n\t\t\tcase PropertyType.ARRAY: {\n\t\t\t\tconst arrayItemSchema = isNil(property.properties) ? property.required ? z.string().check(z.minLength(1)) : z.string() : buildSchema(property.properties, void 0);\n\t\t\t\tpropsSchema[name] = z.union([\n\t\t\t\t\tproperty.required ? z.array(arrayItemSchema).check(z.minLength(1)) : z.array(arrayItemSchema),\n\t\t\t\t\tz.record(z.string(), z.unknown()),\n\t\t\t\t\tproperty.required ? z.string().check(z.minLength(1)) : z.string()\n\t\t\t\t]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase PropertyType.OBJECT:\n\t\t\t\tpropsSchema[name] = z.union([z.record(z.string(), z.any()), property.required ? z.string().check(z.minLength(1)) : z.string()]);\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.DATE_RANGE:\n\t\t\t\tpropsSchema[name] = z.union([z.record(z.string(), z.any()), z.string()]);\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.JSON:\n\t\t\t\tpropsSchema[name] = z.union([\n\t\t\t\t\tz.record(z.string(), z.any()),\n\t\t\t\t\tz.array(z.any()),\n\t\t\t\t\tproperty.required ? z.string().check(z.minLength(1)) : z.string()\n\t\t\t\t]);\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.MULTI_SELECT_DROPDOWN:\n\t\t\tcase PropertyType.STATIC_MULTI_SELECT_DROPDOWN:\n\t\t\t\tpropsSchema[name] = z.union([property.required ? z.array(z.any()).check(z.minLength(1)) : z.array(z.any()), property.required ? z.string().check(z.minLength(1)) : z.string()]);\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.DYNAMIC:\n\t\t\t\tpropsSchema[name] = z.record(z.string(), z.any());\n\t\t\t\tbreak;\n\t\t\tcase PropertyType.CUSTOM:\n\t\t\t\tpropsSchema[name] = z.unknown();\n\t\t\t\tbreak;\n\t\t}\n\t\tif (!property.required && property.type !== PropertyType.ARRAY) propsSchema[name] = z.optional(z.union(isEmpty(propsSchema[name]) ? [\n\t\t\tz.any(),\n\t\t\tz.null(),\n\t\t\tz.undefined()\n\t\t] : [\n\t\t\tpropsSchema[name],\n\t\t\tz.null(),\n\t\t\tz.undefined()\n\t\t]));\n\t}\n\tif (auth && requireAuth) propsSchema[AUTHENTICATION_PROPERTY_NAME] = z.string().check(z.minLength(1));\n\treturn z.object(propsSchema);\n}\nconst piecePropertiesUtils = { buildSchema };\n\n//#endregion\n//#region upstream/framework/lib/property/index.ts\nconst PieceProperty = z.union([InputProperty, PieceAuthProperty]);\nconst PiecePropertyMap = z.record(z.string(), PieceProperty);\nconst InputPropertyMap = z.record(z.string(), InputProperty);\n\n//#endregion\n//#region upstream/framework/lib/trigger/trigger.ts\nconst DEDUPE_KEY_PROPERTY = \"_dedupe_key\";\nlet WebhookRenewStrategy = /* @__PURE__ */ function(WebhookRenewStrategy) {\n\tWebhookRenewStrategy[\"CRON\"] = \"CRON\";\n\tWebhookRenewStrategy[\"NONE\"] = \"NONE\";\n\treturn WebhookRenewStrategy;\n}({});\nconst WebhookRenewConfiguration = z.union([z.object({\n\tstrategy: z.literal(WebhookRenewStrategy.CRON),\n\tcronExpression: z.string()\n}), z.object({ strategy: z.literal(WebhookRenewStrategy.NONE) })]);\nvar ITrigger = class {\n\tconstructor(name, displayName, description, requireAuth, props, type, handshakeConfiguration, onHandshake, renewConfiguration, onRenew, onEnable, onDisable, onStart, run, test, sampleData, testStrategy, outputSchema, aiMetadata, classification, propertyGroups) {\n\t\tthis.name = name;\n\t\tthis.displayName = displayName;\n\t\tthis.description = description;\n\t\tthis.requireAuth = requireAuth;\n\t\tthis.props = props;\n\t\tthis.type = type;\n\t\tthis.handshakeConfiguration = handshakeConfiguration;\n\t\tthis.onHandshake = onHandshake;\n\t\tthis.renewConfiguration = renewConfiguration;\n\t\tthis.onRenew = onRenew;\n\t\tthis.onEnable = onEnable;\n\t\tthis.onDisable = onDisable;\n\t\tthis.onStart = onStart;\n\t\tthis.run = run;\n\t\tthis.test = test;\n\t\tthis.sampleData = sampleData;\n\t\tthis.testStrategy = testStrategy;\n\t\tthis.outputSchema = outputSchema;\n\t\tthis.aiMetadata = aiMetadata;\n\t\tthis.classification = classification;\n\t\tthis.propertyGroups = propertyGroups;\n\t}\n};\nconst createTrigger = (params) => {\n\tswitch (params.type) {\n\t\tcase TriggerStrategy.WEBHOOK: return new ITrigger(params.name, params.displayName, params.description, params.requireAuth ?? true, params.props, params.type, params.handshakeConfiguration ?? { strategy: WebhookHandshakeStrategy.NONE }, params.onHandshake ?? (async () => ({ status: 200 })), params.renewConfiguration ?? { strategy: WebhookRenewStrategy.NONE }, params.onRenew ?? (async () => Promise.resolve()), params.onEnable, params.onDisable, params.onStart ?? (async () => Promise.resolve()), params.run, params.test ?? (() => Promise.resolve([params.sampleData])), params.sampleData, params.test ? TriggerTestStrategy.TEST_FUNCTION : TriggerTestStrategy.SIMULATION, params.outputSchema, params.aiMetadata, params.classification, params.propertyGroups);\n\t\tcase TriggerStrategy.POLLING: return new ITrigger(params.name, params.displayName, params.description, params.requireAuth ?? true, params.props, params.type, { strategy: WebhookHandshakeStrategy.NONE }, async () => ({ status: 200 }), { strategy: WebhookRenewStrategy.NONE }, async () => Promise.resolve(), params.onEnable, params.onDisable, params.onStart ?? (async () => Promise.resolve()), params.run, params.test ?? (() => Promise.resolve([params.sampleData])), params.sampleData, TriggerTestStrategy.TEST_FUNCTION, params.outputSchema, params.aiMetadata, params.classification, params.propertyGroups);\n\t\tcase TriggerStrategy.MANUAL: return new ITrigger(params.name, params.displayName, params.description, params.requireAuth ?? true, params.props, params.type, { strategy: WebhookHandshakeStrategy.NONE }, async () => ({ status: 200 }), { strategy: WebhookRenewStrategy.NONE }, async () => Promise.resolve(), params.onEnable, params.onDisable, params.onStart ?? (async () => Promise.resolve()), params.run, params.test ?? (() => Promise.resolve([params.sampleData])), params.sampleData, TriggerTestStrategy.TEST_FUNCTION, params.outputSchema, params.aiMetadata, params.classification, params.propertyGroups);\n\t\tcase TriggerStrategy.APP_WEBHOOK: return new ITrigger(params.name, params.displayName, params.description, params.requireAuth ?? true, params.props, params.type, { strategy: WebhookHandshakeStrategy.NONE }, async () => ({ status: 200 }), { strategy: WebhookRenewStrategy.NONE }, async () => Promise.resolve(), params.onEnable, params.onDisable, params.onStart ?? (async () => Promise.resolve()), params.run, params.test ?? (() => Promise.resolve([params.sampleData])), params.sampleData, isNil(params.sampleData) && isNil(params.test) ? TriggerTestStrategy.SIMULATION : TriggerTestStrategy.TEST_FUNCTION, params.outputSchema, params.aiMetadata, params.classification, params.propertyGroups);\n\t}\n};\n\n//#endregion\n//#region upstream/framework/lib/context/index.ts\nvar PieceServerContextError = class extends Error {\n\tconstructor(message) {\n\t\tsuper(message);\n\t\tthis.name = \"PieceServerContextError\";\n\t}\n};\nfunction isPieceServerContextError(error) {\n\treturn error instanceof Error && error.name === \"PieceServerContextError\";\n}\nlet StoreScope = /* @__PURE__ */ function(StoreScope) {\n\tStoreScope[\"PROJECT\"] = \"COLLECTION\";\n\tStoreScope[\"FLOW\"] = \"FLOW\";\n\treturn StoreScope;\n}({});\n\n//#endregion\n//#region upstream/framework/lib/context/versioning.ts\nlet ContextVersion = /* @__PURE__ */ function(ContextVersion) {\n\tContextVersion[\"V1\"] = \"1\";\n\tContextVersion[\"V2\"] = \"2\";\n\treturn ContextVersion;\n}({});\nconst LATEST_CONTEXT_VERSION = ContextVersion.V2;\nconst MINIMUM_SUPPORTED_RELEASE_AFTER_LATEST_CONTEXT_VERSION = \"0.82.0\";\nconst backwardCompatabilityContextUtils = { makeActionContextBackwardCompatible({ context, contextVersion }) {\n\tswitch (contextVersion) {\n\t\tcase ContextVersion.V2: return context;\n\t\tcase ContextVersion.V1: return addLegacyMethods({ context });\n\t\tcase void 0: return addLegacyMethodsAndServerUrl({ context });\n\t}\n} };\nfunction addLegacyMethods({ context }) {\n\treturn {\n\t\t...context,\n\t\tgenerateResumeUrl: buildLegacyGenerateResumeUrl({ context }),\n\t\trun: {\n\t\t\t...context.run,\n\t\t\tpause: buildLegacyPauseHook({ context })\n\t\t}\n\t};\n}\nfunction addLegacyMethodsAndServerUrl({ context }) {\n\treturn {\n\t\t...addLegacyMethods({ context }),\n\t\tserverUrl: context.server.publicUrl\n\t};\n}\n/**\n* @deprecated Since 2026-04-12. Remove after 2026-10-12 once all pieces migrate to createWaitpoint/waitForWaitpoint.\n*/\nfunction buildLegacyPauseHook({ context }) {\n\treturn (req) => {\n\t\tconst type = req.pauseMetadata.type === PauseType.DELAY ? \"DELAY\" : \"WEBHOOK\";\n\t\tconst responseToSend = req.pauseMetadata.type === PauseType.WEBHOOK ? req.pauseMetadata.response : void 0;\n\t\tconst resumeDateTime = req.pauseMetadata.type === PauseType.DELAY ? req.pauseMetadata.resumeDateTime : void 0;\n\t\tcontext.run.createWaitpoint({\n\t\t\ttype,\n\t\t\tversion: \"V0\",\n\t\t\tresumeDateTime,\n\t\t\tresponseToSend\n\t\t}).catch((e) => {\n\t\t\tconsole.error(\"[buildLegacyPauseHook] Failed to create waitpoint\", e);\n\t\t\tprocess.exit(1);\n\t\t});\n\t\tcontext.run.waitForWaitpoint(\"\");\n\t};\n}\n/**\n* @deprecated Since 2026-04-12. Remove after 2026-10-12 once all pieces migrate to createWaitpoint/waitForWaitpoint.\n*/\nfunction buildLegacyGenerateResumeUrl({ context }) {\n\treturn (params) => {\n\t\tconst randomId = Math.random().toString(36).substring(2);\n\t\tconst url = new URL(`${context.server.publicUrl}v1/flow-runs/${context.run.id}/requests/${randomId}${params.sync ? \"/sync\" : \"\"}`);\n\t\turl.search = new URLSearchParams(params.queryParams).toString();\n\t\treturn url.toString();\n\t};\n}\n\n//#endregion\n//#region upstream/framework/lib/piece.ts\nvar Piece = class {\n\t_actions = {};\n\t_triggers = {};\n\tgetContextInfo = () => ({ version: LATEST_CONTEXT_VERSION });\n\tconstructor(displayName, logoUrl, authors, events, actions, triggers, categories, auth, minimumSupportedRelease = MINIMUM_SUPPORTED_RELEASE_AFTER_LATEST_CONTEXT_VERSION, maximumSupportedRelease, description = \"\", deprecated) {\n\t\tthis.displayName = displayName;\n\t\tthis.logoUrl = logoUrl;\n\t\tthis.authors = authors;\n\t\tthis.events = events;\n\t\tthis.categories = categories;\n\t\tthis.auth = auth;\n\t\tthis.minimumSupportedRelease = minimumSupportedRelease;\n\t\tthis.maximumSupportedRelease = maximumSupportedRelease;\n\t\tthis.description = description;\n\t\tthis.deprecated = deprecated;\n\t\tif (!isValidSimpleSemver(minimumSupportedRelease) || isSemverLessThan(minimumSupportedRelease, \"0.82.0\")) this.minimumSupportedRelease = MINIMUM_SUPPORTED_RELEASE_AFTER_LATEST_CONTEXT_VERSION;\n\t\tactions.forEach((action) => this._actions[action.name] = action);\n\t\ttriggers.forEach((trigger) => this._triggers[trigger.name] = trigger);\n\t}\n\tmetadata() {\n\t\treturn {\n\t\t\tdisplayName: this.displayName,\n\t\t\tlogoUrl: this.logoUrl,\n\t\t\tactions: this._actions,\n\t\t\ttriggers: this._triggers,\n\t\t\tcategories: this.categories,\n\t\t\tdescription: this.description,\n\t\t\tauthors: this.authors,\n\t\t\tauth: withConnectionIdentifierFlag(this.auth),\n\t\t\tminimumSupportedRelease: this.minimumSupportedRelease,\n\t\t\tmaximumSupportedRelease: this.maximumSupportedRelease,\n\t\t\tdeprecated: this.deprecated,\n\t\t\tcontextInfo: this.getContextInfo?.()\n\t\t};\n\t}\n\tgetAction(actionName) {\n\t\treturn this._actions[actionName];\n\t}\n\tgetTrigger(triggerName) {\n\t\treturn this._triggers[triggerName];\n\t}\n\tactions() {\n\t\treturn this._actions;\n\t}\n\ttriggers() {\n\t\treturn this._triggers;\n\t}\n};\nconst createPiece = (params) => {\n\tif (params.auth && Array.isArray(params.auth)) {\n\t\tif (!params.auth.every((auth, index, self) => index === self.findIndex((t) => t.type === auth.type))) throw new Error(\"Auth properties must be unique by type\");\n\t}\n\treturn new Piece(params.displayName, params.logoUrl, params.authors ?? [], params.events, params.actions, params.triggers, params.categories ?? [], params.auth, params.minimumSupportedRelease, params.maximumSupportedRelease, params.description, params.deprecated);\n};\nfunction withConnectionIdentifierFlag(auth) {\n\tif (auth === void 0) return;\n\treturn Array.isArray(auth) ? auth.map(flagConnectionIdentifier) : flagConnectionIdentifier(auth);\n}\nfunction flagConnectionIdentifier(auth) {\n\treturn {\n\t\t...auth,\n\t\thasConnectionIdentifier: auth.getConnectionIdentifier !== void 0\n\t};\n}\nfunction isValidSimpleSemver(version) {\n\treturn /^\\d+\\.\\d+\\.\\d+$/.test(version);\n}\nfunction isSemverLessThan(a, b) {\n\tconst [a1, a2, a3] = a.split(\".\").map(Number);\n\tconst [b1, b2, b3] = b.split(\".\").map(Number);\n\tif (a1 !== b1) return a1 < b1;\n\tif (a2 !== b2) return a2 < b2;\n\treturn a3 < b3;\n}\n\n//#endregion\n//#region upstream/framework/lib/piece-metadata.ts\nconst I18nForPiece = z.optional(z.record(z.string(), z.record(z.string(), z.string())));\nconst PieceBase = z.object({\n\tid: z.optional(z.string()),\n\tname: z.string(),\n\tdisplayName: z.string(),\n\tlogoUrl: z.string(),\n\tdescription: z.string(),\n\tauthors: z.array(z.string()),\n\tplatformId: z.optional(z.string()),\n\tdirectoryPath: z.optional(z.string()),\n\tauth: z.optional(z.union([PieceAuthProperty, z.array(PieceAuthProperty)])),\n\tversion: z.string(),\n\tcategories: z.optional(z.array(z.enum(PieceCategory))),\n\tminimumSupportedRelease: z.optional(z.string()),\n\tmaximumSupportedRelease: z.optional(z.string()),\n\tdeprecated: z.optional(z.boolean()),\n\ti18n: I18nForPiece\n});\nconst Audience = z.enum([\n\t\"human\",\n\t\"ai\",\n\t\"both\"\n]);\nconst AiMetadata = z.object({\n\tdescription: z.optional(z.string()),\n\tidempotent: z.optional(z.boolean())\n});\nconst ActionClassification = z.enum([\n\t\"READ\",\n\t\"SEARCH\",\n\t\"WRITE\",\n\t\"DESTRUCTIVE\"\n]);\nconst READ_ONLY_CLASSIFICATIONS = [\"READ\", \"SEARCH\"];\nconst isReadOnlyClassification = (classification) => classification !== void 0 && READ_ONLY_CLASSIFICATIONS.includes(classification);\nconst PropertyGroupDisplay = z.enum([\n\t\"tabs\",\n\t\"section\",\n\t\"summary\",\n\t\"builder\",\n\t\"footer\"\n]);\nconst PropertyGroup = z.object({\n\tkey: z.string(),\n\tdisplay: PropertyGroupDisplay,\n\tlabel: z.optional(z.string()),\n\tdescription: z.optional(z.string()),\n\ticon: z.optional(z.string()),\n\tprops: z.array(z.string())\n});\nconst ActionBase = z.object({\n\tname: z.string(),\n\tdisplayName: z.string(),\n\tdescription: z.string(),\n\tprops: PiecePropertyMap,\n\tpropertyGroups: z.optional(z.array(PropertyGroup)),\n\trequireAuth: z.boolean(),\n\terrorHandlingOptions: z.optional(ErrorHandlingOptionsParam),\n\toutputSchema: z.optional(z.custom()),\n\taudience: z.optional(Audience),\n\taiMetadata: z.optional(AiMetadata),\n\tclassification: z.optional(ActionClassification)\n});\nconst TriggerBase = z.object({\n\tname: z.string(),\n\tdisplayName: z.string(),\n\tdescription: z.string(),\n\tprops: PiecePropertyMap,\n\tpropertyGroups: z.optional(z.array(PropertyGroup)),\n\terrorHandlingOptions: z.optional(ErrorHandlingOptionsParam),\n\ttype: z.enum(TriggerStrategy),\n\tsampleData: z.unknown(),\n\thandshakeConfiguration: z.optional(z.custom()),\n\trenewConfiguration: z.optional(WebhookRenewConfiguration),\n\ttestStrategy: z.enum(TriggerTestStrategy),\n\toutputSchema: z.optional(z.custom()),\n\taiMetadata: z.optional(AiMetadata),\n\tclassification: z.optional(ActionClassification)\n});\nconst PieceMetadata = z.object({\n\t...PieceBase.shape,\n\tactions: z.record(z.string(), ActionBase),\n\ttriggers: z.record(z.string(), TriggerBase)\n});\nconst PieceMetadataSummary = z.object({\n\t...PieceBase.shape,\n\tactions: z.number(),\n\ttriggers: z.number(),\n\tsuggestedActions: z.optional(z.array(ActionBase)),\n\tsuggestedTriggers: z.optional(z.array(TriggerBase))\n});\nconst PiecePackageMetadata = z.object({\n\tprojectUsage: z.number(),\n\tpieceType: z.enum(PieceType),\n\tpackageType: z.enum(PackageType),\n\tplatformId: z.optional(z.string()),\n\tarchiveId: z.optional(z.string())\n});\nconst PieceMetadataModel = z.object({\n\t...PieceMetadata.shape,\n\t...PiecePackageMetadata.shape\n});\nconst PieceMetadataModelSummary = z.object({\n\t...PieceMetadataSummary.shape,\n\t...PiecePackageMetadata.shape\n});\nconst PiecePackageInformation = z.object({\n\tname: z.string(),\n\tversion: z.string()\n});\n\n//#endregion\n//#region upstream/framework/lib/i18n.ts\nconst pieceTranslation = {\n\ttranslatePiece: (params) => {\n\t\tconst { piece, locale, mutate = false } = params;\n\t\tif (!locale) return piece;\n\t\ttry {\n\t\t\tconst target = piece.i18n?.[locale];\n\t\t\tif (!target) return piece;\n\t\t\tconst translatedPiece = mutate ? piece : JSON.parse(JSON.stringify(piece));\n\t\t\tpieceTranslation.pathsToValuesToTranslate.forEach((key) => {\n\t\t\t\ttranslateProperty(translatedPiece, key, target);\n\t\t\t});\n\t\t\treturn translatedPiece;\n\t\t} catch (err) {\n\t\t\tconsole.error(`error translating piece ${piece.name}:`, err);\n\t\t\treturn piece;\n\t\t}\n\t},\n\tinitializeI18n: async (pieceOutputPath) => {\n\t\ttry {\n\t\t\tconst locales = Object.values(LocalesEnum);\n\t\t\tconst i18n = {};\n\t\t\tfor (const locale of locales) {\n\t\t\t\tconst translations = await readLocaleFile(locale, pieceOutputPath);\n\t\t\t\tif (translations) i18n[locale] = translations;\n\t\t\t}\n\t\t\treturn Object.keys(i18n).length > 0 ? i18n : void 0;\n\t\t} catch (err) {\n\t\t\tconsole.log(`Error initializing i18n for ${pieceOutputPath}:`, err);\n\t\t\treturn;\n\t\t}\n\t},\n\tpathsToValuesToTranslate: [\n\t\t\"description\",\n\t\t\"auth.username.displayName\",\n\t\t\"auth.username.description\",\n\t\t\"auth.password.displayName\",\n\t\t\"auth.password.description\",\n\t\t\"auth.props.*.displayName\",\n\t\t\"auth.props.*.description\",\n\t\t\"auth.props.*.options.options.*.label\",\n\t\t\"auth.description\",\n\t\t\"actions.*.displayName\",\n\t\t\"actions.*.description\",\n\t\t\"actions.*.props.*.displayName\",\n\t\t\"actions.*.props.*.description\",\n\t\t\"actions.*.props.*.options.options.*.label\",\n\t\t\"triggers.*.displayName\",\n\t\t\"triggers.*.description\",\n\t\t\"triggers.*.props.*.displayName\",\n\t\t\"triggers.*.props.*.description\",\n\t\t\"triggers.*.props.*.options.options.*.label\"\n\t]\n};\n/**This function translates a property inside a piece, i.e description, displayName, etc...\n*\n* @param pieceModelOrProperty - The piece model or property to translate\n* @param path - The path to the property to translate, i.e auth.username.displayName\n* @param i18n - The i18n object\n*/\nfunction translateProperty(pieceModelOrProperty, path, i18n) {\n\tconst parsedKeys = path.split(\".\");\n\tif (parsedKeys[0] === \"*\") return Object.values(pieceModelOrProperty).forEach((item) => translateProperty(item, parsedKeys.slice(1).join(\".\"), i18n));\n\tconst nextObject = pieceModelOrProperty[parsedKeys[0]];\n\tif (!nextObject) return;\n\tif (parsedKeys.length > 1) return translateProperty(nextObject, parsedKeys.slice(1).join(\".\"), i18n);\n\tconst valueInI18n = i18n[pieceModelOrProperty[parsedKeys[0]].slice(0, 512)];\n\tif (valueInI18n) pieceModelOrProperty[parsedKeys[0]] = valueInI18n;\n}\nasync function fileExists(filePath) {\n\ttry {\n\t\tawait fs.access(filePath);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\nconst readLocaleFile = async (locale, pieceOutputPath) => {\n\tconst filePath = path.join(pieceOutputPath, \"src\", \"i18n\", `${locale}.json`);\n\tif (!await fileExists(filePath)) return null;\n\ttry {\n\t\tconst fileContent = await fs.readFile(filePath, \"utf8\");\n\t\tconst translations = JSON.parse(fileContent);\n\t\tif (typeof translations === \"object\" && translations !== null) return translations;\n\t\tthrow new Error(`Invalid i18n file format for ${locale} in piece ${pieceOutputPath}`);\n\t} catch (error) {\n\t\tconsole.error(`Error reading i18n file for ${locale} in piece ${pieceOutputPath}:`, error);\n\t\treturn null;\n\t}\n};\n\n//#endregion\n//#region upstream/framework/lib/test/index.ts\nfunction createMockActionContext(params) {\n\treturn {\n\t\texecutionType: ExecutionType.BEGIN,\n\t\tauth: void 0,\n\t\tpropsValue: params.propsValue,\n\t\tstore: {\n\t\t\tput: async (key, value) => value,\n\t\t\tget: async () => null,\n\t\t\tdelete: async () => {}\n\t\t},\n\t\tconnections: { get: async () => null },\n\t\ttags: { add: async () => {} },\n\t\tserver: {\n\t\t\tapiUrl: \"http://localhost:3000\",\n\t\t\tpublicUrl: \"http://localhost:4200\",\n\t\t\ttoken: \"test-token\"\n\t\t},\n\t\tfiles: { write: async () => \"test-file-url\" },\n\t\toutput: { update: async () => {} },\n\t\tagent: { tools: async () => ({}) },\n\t\trun: {\n\t\t\tid: \"test-run-id\",\n\t\t\tstop: () => {},\n\t\t\tpause: () => {},\n\t\t\trespond: () => {}\n\t\t},\n\t\tproject: {\n\t\t\tid: \"test-project-id\",\n\t\t\texternalId: async () => void 0\n\t\t},\n\t\tflows: {\n\t\t\tlist: async () => ({\n\t\t\t\tdata: [],\n\t\t\t\tnext: null,\n\t\t\t\tprevious: null\n\t\t\t}),\n\t\t\tcurrent: {\n\t\t\t\tid: \"test-flow-id\",\n\t\t\t\tversion: { id: \"test-flow-version-id\" }\n\t\t\t}\n\t\t},\n\t\tstep: { name: \"test-step\" },\n\t\tgenerateResumeUrl: () => \"http://localhost:3000/resume\"\n\t};\n}\nfunction createMockPollingTriggerContext(params) {\n\treturn {\n\t\t...createMockActionContext({ propsValue: params.propsValue }),\n\t\tsetSchedule: (schedule) => {\n\t\t\tparams.onSetSchedule?.(schedule);\n\t\t}\n\t};\n}\n\n//#endregion\n//#region src/powerhouse/context.ts\nfunction reactorOf(ctx) {\n\tconst reactor = ctx !== null && typeof ctx === \"object\" ? ctx.reactor : void 0;\n\tif (!reactor) throw new Error(\"ctx.reactor is not available: this piece is not running on a Powerhouse reactor\");\n\treturn reactor;\n}\n\n//#endregion\nexport { ACTIVEPIECES_CHAT_TIERS, AGENT_STEP_TEST_TIMEOUT_MS, AGENT_STEP_TIMEOUT_MS, AIProviderModel, AIProviderName, AIProviderWithoutSensitiveData, AI_PROVIDER_CAPABILITIES, ActionBase, ActionClassification, AgentFlowTool, AgentKnowledgeBaseTool, AgentMcpTool, AgentOutputField, AgentOutputFieldType, AgentPieceProps, AgentStepBlock, AgentTaskStatus, AgentTool, AgentToolType, AiMetadata, ApFile, AppConnectionType, ArrayProperty, ArraySubProps, Audience, AzureProviderConfig, BaseAIProviderAuthConfig, BasePropertySchema, BasicAuthProperty, BasicAuthPropertyValue, BedrockProviderAuthConfig, BedrockProviderConfig, ChatFormResponse, CheckboxProperty, CloudflareGatewayProviderConfig, ContentBlockType, ContextVersion, CreateRecordsRequest, CreateTableWebhookRequest, CustomAuthProperty, CustomProperty, DEDUPE_KEY_PROPERTY, DEFAULT_CHAT_TIER_ID, DEFAULT_CONNECTION_DISPLAY_NAME, DateRangePreset, DateRangeProperty, DateRangeValue, DateTimeProperty, DropdownOption, DropdownProperty, DropdownState, DynamicProp, DynamicProperties, DynamicPropsValue, ErrorHandlingOptionsParam, ExecutionToolStatus, ExecutionType, ExportTableResponse, FAIL_PARENT_ON_FAILURE_HEADER, Field, FieldType, FileProperty, FileResponseInterface, Filter, FilterOperator, FlowStatus, FlowTriggerType, GetProviderConfigResponse, HumanInputFormResult, HumanInputFormResultTypes, IAction, ITrigger, InputProperty, InputPropertyMap, JsonProperty, KnowledgeBaseSourceType, LATEST_CONTEXT_VERSION, ListRecordsRequest, ListTablesRequest, LongTextProperty, MINIMUM_SUPPORTED_RELEASE_AFTER_LATEST_CONTEXT_VERSION, MarkdownContentBlock, MarkdownVariant, McpAuthConfig, McpAuthType, McpProperty, McpPropertyType, McpProtocol, McpTrigger, MultiSelectDropdownProperty, NumberProperty, OAuth2AuthorizationMethod, OAuth2GrantType, OAuth2Property, OAuth2PropertyValue, OAuth2Props, OIDCProperty, OPENAI_COMPATIBLE_VENDOR_BASE_URLS, ObjectProperty, OpenAICompatibleProviderConfig, OpenAiCompatibleVendorConfig, PARENT_RUN_ID_HEADER, Piece, PieceAuth, PieceAuthProperty, PieceBase, PieceCategory, PieceMetadata, PieceMetadataModel, PieceMetadataModelSummary, PieceMetadataSummary, PiecePackageInformation, PieceProperty, PiecePropertyMap, PieceServerContextError, PopulatedRecord, Project, ProjectAIProvider, Property, PropertyGroup, PropertyGroupDisplay, PropertyType, RAW_PAYLOAD_HEADER, READ_ONLY_CLASSIFICATIONS, RichTextProperty, SecretTextProperty, SeekPage, ShortTextProperty, StaticDropdownEmptyOption, StaticDropdownProperty, StaticMultiSelectDropdownProperty, StopResponse, StoreScope, TASK_COMPLETION_TOOL_NAME, Table, TableWebhookEventType, ToolCallContentBlock, ToolCallStatus, ToolCallType, TriggerBase, TriggerStrategy, USE_DRAFT_QUERY_PARAM_NAME, UpdateRecordRequest, VertexProviderAuthConfig, VertexProviderConfig, WebhookHandshakeStrategy, WebhookRenewConfiguration, WebhookRenewStrategy, apId, assertNotNullOrUndefined, backwardCompatabilityContextUtils, buildAuthHeaders, camelCase, chunk, createAction, createKeyForFormInput, createMockActionContext, createMockPollingTriggerContext, createPiece, createTrigger, dateRangeUtils, getAuthPropertyForValue, getEffectiveProviderAndModel, isEmpty, isNil, isNotUndefined, isPieceServerContextError, isReadOnlyClassification, isString, kebabCase, mcpToolNameUtils, normalizeToolOutputToExecuteResponse, pickBy, piecePropertiesUtils, pieceTranslation, reactorOf, splitCloudflareGatewayModelId, spreadIfDefined, startCase, tryCatch, unique };\n//# sourceMappingURL=index.js.map","// The Powerhouse mark, from the logo powerhouse.inc serves (its first path,\n// which is the icon; the rest of that file is the wordmark).\n\n// The mark alone, not the app icon: the app icon insets it on a dark canvas,\n// and the editor frames every piece logo with padding of its own, so that\n// version would sit padded twice. Filled dark because the frame is white.\nexport const POWERHOUSE_LOGO =\n \"data:image/svg+xml;base64,\" +\n \"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMTQg\" +\n \"MTE0IiBmaWxsPSJub25lIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZl\" +\n \"bm9kZCIgZmlsbD0iIzE2MTYxNiIgZD0iTTcxLjI5MTkgMEwyNC4zNDE1IDM4Ljg3NzJDMTcuNDU0\" +\n \"OCA0NC41Nzk4IDE2Ljk1MzkgNTQuOTY1OSAyMy4yNiA2MS4zMDQ3TDM5LjUwMjggNzcuNjMxOEM0\" +\n \"NC4yNjg0IDgyLjQyMjEgNDUuMjk5NiA4OS43ODM0IDQyLjAzMzUgOTUuNjk4OEwzMS45MjkgMTE0\" +\n \"SDE1LjJDNi44MDUyNyAxMTQgMCAxMDcuMTk1IDAgOTguOFYxNS4yQzAgNi44MDUyNyA2LjgwNTI3\" +\n \"IDAgMTUuMiAwSDcxLjI5MTlaTTgwLjExMSAwTDcxLjM0MTIgMTUuOTc1OEM2OC4xMDc4IDIxLjg2\" +\n \"NiA2OS4xMjU1IDI5LjE4MDQgNzMuODQ0MSAzMy45NjQxTDkxLjA3NTEgNTEuNDMzMUM5Ny4zNjc0\" +\n \"IDU3LjgxMjQgOTYuODA0NCA2OC4yMjI3IDg5Ljg2MDcgNzMuODg2MUw0MC42NzgyIDExNEg5OC44\" +\n \"QzEwNy4xOTUgMTE0IDExNCAxMDcuMTk1IDExNCA5OC44VjE1LjJDMTE0IDYuODA1MjcgMTA3LjE5\" +\n \"NSAwIDk4LjggMEg4MC4xMTFaIi8+PC9zdmc+\";\n","// Config parsing shared by the document actions.\n\n// Every one of these accepts what a model step produces as readily as what an\n// author typed: fenced JSON, a bare object, a quoted id inside a sentence.\nexport interface ActionInputConfig {\n type: string;\n input?: unknown;\n scope?: string;\n}\n\nexport interface DispatchPayload {\n // Present when the payload object named its own target document.\n documentId?: string;\n actions: ActionInputConfig[];\n}\n\nexport interface CreatePayload {\n documentType?: string;\n name?: string;\n actions?: unknown;\n}\n\nfunction unfence(text: string): string {\n return text\n .trim()\n .replace(/^```(?:json)?\\s*/i, \"\")\n .replace(/```$/, \"\")\n .trim();\n}\n\n// Every top-level {...} or [...] in a string, in the order they appear.\n//\n// Scanned rather than matched with a regular expression because a brace inside\n// a string literal is not a brace: `{\"note\": \"a } here\"}` is one value, and a\n// regex that does not track quoting splits it.\nfunction jsonSpans(text: string): string[] {\n const spans: string[] = [];\n let depth = 0;\n let start = -1;\n let inString = false;\n let escaped = false;\n for (let index = 0; index < text.length; index++) {\n const character = text[index];\n if (inString) {\n if (escaped) escaped = false;\n else if (character === \"\\\\\") escaped = true;\n else if (character === '\"') inString = false;\n continue;\n }\n if (character === '\"') {\n inString = true;\n continue;\n }\n if (character === \"{\" || character === \"[\") {\n if (depth === 0) start = index;\n depth++;\n continue;\n }\n if (character === \"}\" || character === \"]\") {\n if (depth === 0) continue;\n depth--;\n if (depth === 0 && start >= 0) {\n spans.push(text.slice(start, index + 1));\n start = -1;\n }\n }\n }\n return spans;\n}\n\n// JSON out of whatever a model actually said.\n//\n// The prompt asks for JSON alone and a model may still reason out loud first:\n// a reasoning model answered this piece with two pages of deliberation and the\n// object on the last line, behind a leaked channel marker. Fences were already\n// tolerated here for the same reason — this is the same accommodation, one step\n// further.\n//\n// The LAST top-level value wins, because the pattern is deliberation first and\n// answer last; an example the model quoted from the prompt would otherwise be\n// preferred over the answer it worked out.\nexport function parseModelJson(text: string): unknown {\n const cleaned = unfence(text);\n try {\n return JSON.parse(cleaned);\n } catch {\n // Not JSON on its own; look for JSON inside it.\n }\n const spans = jsonSpans(cleaned);\n for (let index = spans.length - 1; index >= 0; index--) {\n try {\n return JSON.parse(spans[index]);\n } catch {\n // A span that does not parse is prose that happened to hold a brace.\n }\n }\n throw new SyntaxError(\"no JSON value found\");\n}\n\nexport function parseActions(\n value: unknown,\n blockName: string,\n): ActionInputConfig[] {\n return parseDispatchPayload(value, blockName).actions;\n}\n\n// Accepts an array, a single action object, or JSON text (typically an LLM's\n// output, possibly fenced); an object may also carry the target documentId.\nexport function parseDispatchPayload(\n value: unknown,\n blockName: string,\n): DispatchPayload {\n let documentId: string | undefined;\n if (typeof value === \"string\") {\n try {\n value = parseModelJson(value);\n } catch {\n throw new Error(`${blockName}: \"actions\" is a string but not valid JSON`);\n }\n }\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n const record = value as Record<string, unknown>;\n if (typeof record.documentId === \"string\") documentId = record.documentId;\n value = Array.isArray(record.actions) ? record.actions : [value];\n }\n if (!Array.isArray(value)) return { documentId, actions: [] };\n const actions = value.map((entry, index) => {\n const record = entry as Record<string, unknown> | null;\n if (!record || typeof record.type !== \"string\") {\n throw new Error(`${blockName}: actions[${index}] needs a string \"type\"`);\n }\n return {\n type: record.type,\n input: record.input,\n scope: typeof record.scope === \"string\" ? record.scope : undefined,\n };\n });\n return { documentId, actions };\n}\n\n// {documentType, name, actions?} as an object or as JSON text, possibly fenced.\nexport function parseCreatePayload(\n value: unknown,\n blockName: string,\n): CreatePayload {\n let record = value;\n if (typeof record === \"string\") {\n if (unfence(record) === \"\") return {};\n try {\n record = parseModelJson(record);\n } catch {\n throw new Error(`${blockName}: \"payload\" is a string but not valid JSON`);\n }\n }\n if (!record || typeof record !== \"object\" || Array.isArray(record)) return {};\n const entry = record as Record<string, unknown>;\n return {\n documentType:\n typeof entry.documentType === \"string\" ? entry.documentType : undefined,\n name: typeof entry.name === \"string\" ? entry.name : undefined,\n actions: entry.actions,\n };\n}\n\n// Whitelist for the dispatch action: a comma-separated string, a list of\n// names, or a document-schema actions array.\nexport function allowedActionTypes(value: unknown): string[] {\n const raw = typeof value === \"string\" ? value.split(\",\") : value;\n if (!Array.isArray(raw)) return [];\n return raw\n .map((entry) => {\n if (typeof entry === \"string\") return entry;\n const record = entry as { type?: unknown } | null;\n return typeof record?.type === \"string\" ? record.type : \"\";\n })\n .map((entry) => entry.trim())\n .filter(Boolean);\n}\n\nconst UUID = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i;\n\n// Ids fed by an AI step arrive quoted, fenced or wrapped in prose; documents\n// are addressed by uuid, so prefer one when the text contains it.\nexport function resolveDocumentId(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const text = value.trim();\n if (!text) return undefined;\n const uuid = UUID.exec(text);\n if (uuid) return uuid[0];\n // Slugs are valid identifiers too, so fall back to the bare text.\n return text.replace(/^[\"'`]+|[\"'`]+$/g, \"\").trim() || undefined;\n}\n\n// A design-time value that can actually be resolved: an expression cannot.\nexport function staticString(value: unknown): string | undefined {\n if (typeof value !== \"string\") return undefined;\n const trimmed = value.trim();\n if (!trimmed || trimmed.includes(\"{{\")) return undefined;\n return trimmed;\n}\n","// Reaching the reactor from piece code, and the props whose choices come\n// from it.\n\n// `ctx.reactor` is served by the host over the worker's call channel and only\n// to a piece an installed reactor package ships. Absent, reactorOf throws by\n// name, so a piece that ends up somewhere else fails legibly.\nimport {\n Property,\n reactorOf,\n type ReactorService,\n} from \"@powerhousedao/pieces-framework\";\nimport { staticString } from \"./parse.js\";\n\nconst DRIVE_DOCUMENT_TYPE = \"powerhouse/document-drive\";\n\ninterface OptionEntry {\n label: string;\n value: string;\n // actionType only: SDL of the operation's input type, which the editor's\n // action list turns into a starter input object.\n inputSchema?: string;\n}\n\ninterface OptionState {\n options: OptionEntry[];\n placeholder?: string;\n}\n\nconst SET_NAME: OptionEntry = {\n label: \"SET_NAME (base)\",\n value: \"SET_NAME\",\n inputSchema: \"input SetNameInput {\\n name: String!\\n}\",\n};\n\nasync function documentOptions(\n reactor: ReactorService,\n documentType: string | undefined,\n): Promise<OptionState> {\n const documents = await reactor.find(documentType ? { documentType } : {});\n return {\n options: documents.map((document) => ({\n label: `${document.name || document.slug || \"(unnamed)\"} — ${document.documentType}`,\n value: document.documentId,\n })),\n placeholder: documentType\n ? `Documents of type ${documentType}`\n : \"All documents on this reactor\",\n };\n}\n\n// The installed document models. Free text stays possible in this editor,\n// which is what an expression-fed step needs.\nexport const documentTypeProp = (\n displayName = \"Document type\",\n required = false,\n description?: string,\n) =>\n Property.Dropdown<string>({\n auth: undefined,\n displayName,\n description,\n required,\n refreshers: [],\n options: async (_propsValue, ctx) => {\n const models = await reactorOf(ctx).models();\n return {\n options: models\n .map((model) => ({\n label: model.name\n ? `${model.name} (${model.documentType})`\n : model.documentType,\n value: model.documentType,\n }))\n .sort((a, b) => a.value.localeCompare(b.value)),\n };\n },\n });\n\nexport const documentIdProp = (\n displayName = \"Document id\",\n required = false,\n description?: string,\n) =>\n Property.Dropdown<string>({\n auth: undefined,\n displayName,\n description,\n required,\n // Narrowed by the sibling type when one is set, which is why it refreshes.\n refreshers: [\"documentType\"],\n options: (propsValue, ctx) =>\n documentOptions(reactorOf(ctx), staticString(propsValue.documentType)),\n });\n\nexport const driveProp = (displayName: string, description?: string) =>\n Property.Dropdown<string>({\n auth: undefined,\n displayName,\n description,\n required: false,\n refreshers: [],\n options: (_propsValue, ctx) =>\n documentOptions(reactorOf(ctx), DRIVE_DOCUMENT_TYPE),\n });\n\n// The actions to dispatch: a JSON array of {type, input, scope?}. This editor\n// renders it as a list whose types come from actionTypeProp below; elsewhere\n// it is the JSON it says it is.\nexport const actionsProp = (displayName: string, required = false) =>\n Property.Json({\n displayName,\n description:\n 'e.g. [{ \"type\": \"SET_NAME\", \"input\": { \"name\": \"Invoice\" } }]',\n required,\n });\n\n// The target type's own actions, each carrying its input SDL, plus the base\n// actions every document accepts.\nexport const actionTypeProp = (\n displayName = \"Action type\",\n required = false,\n description?: string,\n) =>\n Property.Dropdown<string>({\n auth: undefined,\n displayName,\n description,\n required,\n refreshers: [\"documentType\", \"documentId\"],\n options: async (propsValue, ctx) => {\n const reactor = reactorOf(ctx);\n let documentType = staticString(propsValue.documentType);\n if (!documentType) {\n // A resolvable id names its own type, which is what a step that only\n // knows the document has to offer.\n const documentId = staticString(propsValue.documentId);\n if (documentId) {\n documentType = (await reactor.get({ documentId })).documentType;\n }\n }\n if (!documentType) {\n return {\n options: [SET_NAME],\n placeholder:\n \"Set a document type (or a resolvable document id) to list its actions\",\n };\n }\n const model = await reactor.model(documentType);\n return {\n options: [\n ...model.actions.map((action) => ({\n label: `${action.type} (${action.module})`,\n value: action.type,\n ...(action.inputSchema ? { inputSchema: action.inputSchema } : {}),\n })),\n ],\n placeholder: `Actions of ${documentType}`,\n };\n },\n });\n","import {\n createAction,\n Property,\n reactorOf,\n} from \"@powerhousedao/pieces-framework\";\nimport { parseActions, parseCreatePayload } from \"../parse.js\";\nimport {\n actionsProp,\n actionTypeProp,\n documentTypeProp,\n driveProp,\n} from \"../reactor.js\";\n\nconst BLOCK = \"document-create\";\n\nexport const documentCreateAction = createAction({\n name: BLOCK,\n displayName: \"Create document\",\n description: \"Creates a Powerhouse document.\",\n requireAuth: false,\n props: {\n documentType: documentTypeProp(),\n name: Property.ShortText({ displayName: \"Document name\", required: false }),\n parentId: driveProp(\"Parent drive/folder\"),\n actions: actionsProp(\"Initial actions\"),\n actionType: actionTypeProp(\n \"Action type\",\n false,\n \"Suggestions for the action list above\",\n ),\n payload: Property.ShortText({\n displayName: \"Payload\",\n description:\n \"JSON {documentType, name, actions?}, e.g. {{steps.draft.output}}\",\n required: false,\n }),\n },\n run: async (ctx) => {\n const reactor = reactorOf(ctx);\n const config = ctx.propsValue;\n // A payload (typically model output) can name the type and the document.\n const payload = parseCreatePayload(config.payload, BLOCK);\n const documentType =\n (typeof config.documentType === \"string\" && config.documentType) ||\n payload.documentType;\n if (!documentType) {\n throw new Error(\n `${BLOCK}: \"documentType\" is required, in the config or the payload`,\n );\n }\n const name =\n (typeof config.name === \"string\" && config.name) || payload.name;\n const created = await reactor.create({\n documentType,\n ...(name ? { name } : {}),\n ...(config.parentId ? { parentId: config.parentId } : {}),\n });\n\n // The name travelled with the create; only the author's own actions are\n // left to dispatch.\n const followUps = parseActions(config.actions ?? payload.actions, BLOCK);\n const document = followUps.length\n ? await reactor.execute({\n documentId: created.documentId,\n actions: followUps,\n })\n : created;\n\n return {\n documentId: document.documentId,\n documentType: document.documentType,\n name: document.name,\n state: document.state,\n };\n },\n});\n","import {\n createAction,\n Property,\n reactorOf,\n} from \"@powerhousedao/pieces-framework\";\nimport {\n allowedActionTypes,\n parseDispatchPayload,\n resolveDocumentId,\n} from \"../parse.js\";\nimport {\n actionsProp,\n actionTypeProp,\n documentIdProp,\n documentTypeProp,\n} from \"../reactor.js\";\n\nconst BLOCK = \"document-dispatch\";\n\nexport const documentDispatchAction = createAction({\n name: BLOCK,\n displayName: \"Dispatch actions\",\n description: \"Sends actions to a document.\",\n requireAuth: false,\n props: {\n documentId: documentIdProp(\n \"Document id\",\n true,\n \"e.g. {{steps.create.output.documentId}}\",\n ),\n documentType: documentTypeProp(\n \"Document type\",\n false,\n \"Design-time hint when the document id is an expression\",\n ),\n actions: actionsProp(\"Actions\", true),\n actionType: actionTypeProp(\n \"Action type\",\n false,\n \"Suggestions for the action list above\",\n ),\n allowedActions: Property.ShortText({\n displayName: \"Allowed action types\",\n description: \"Comma-separated whitelist; enforced when set\",\n required: false,\n }),\n branch: Property.ShortText({\n displayName: \"Branch\",\n description: 'Defaults to \"main\"',\n required: false,\n }),\n },\n run: async (ctx) => {\n const config = ctx.propsValue;\n const payload = parseDispatchPayload(config.actions, BLOCK);\n const documentId =\n resolveDocumentId(config.documentId) ??\n resolveDocumentId(payload.documentId);\n if (!documentId) {\n throw new Error(\n `${BLOCK}: \"documentId\" is required, in the config or the actions payload`,\n );\n }\n // Enforced, not merely suggested: the payload may come from an LLM.\n const allowed = allowedActionTypes(config.allowedActions);\n const rejected = allowed.length\n ? payload.actions.filter((entry) => !allowed.includes(entry.type))\n : [];\n if (rejected.length > 0) {\n throw new Error(\n `${BLOCK}: action(s) not allowed here: ${[\n ...new Set(rejected.map((entry) => entry.type)),\n ].join(\", \")}`,\n );\n }\n if (payload.actions.length === 0) {\n throw new Error(`${BLOCK}: \"actions\" must be a non-empty list`);\n }\n const document = await reactorOf(ctx).execute({\n documentId,\n ...(config.branch ? { branch: config.branch } : {}),\n actions: payload.actions,\n });\n return {\n documentId: document.documentId,\n documentType: document.documentType,\n name: document.name,\n state: document.state,\n };\n },\n});\n","import {\n createAction,\n Property,\n reactorOf,\n} from \"@powerhousedao/pieces-framework\";\nimport { documentTypeProp, driveProp } from \"../reactor.js\";\n\nconst DEFAULT_LIMIT = 25;\nconst MAX_LIMIT = 100;\n\nexport const documentFindAction = createAction({\n name: \"document-find\",\n displayName: \"Find documents\",\n description: \"Lists documents by type and name.\",\n requireAuth: false,\n props: {\n documentType: documentTypeProp(\"Document type\", false, \"Omit for any type\"),\n parentId: driveProp(\"In drive/folder\", \"Omit for the whole reactor\"),\n name: Property.ShortText({\n displayName: \"Name contains\",\n description: \"Case-insensitive match\",\n required: false,\n }),\n matchPath: Property.ShortText({\n displayName: \"State field\",\n description:\n 'Dotted path into the document\\'s state, e.g. \"orderId\" or \"settlement.status\". With a value below, only documents holding it are returned.',\n required: false,\n }),\n matchValue: Property.ShortText({\n displayName: \"State value\",\n description:\n \"Compared as text, e.g. {{trigger.payload.orderId}}. Documents missing the field never match.\",\n required: false,\n }),\n includeState: Property.Checkbox({\n displayName: \"Include state\",\n description:\n \"Returns each document's state as well as its id and name. Off by default: a page of documents carries a page of states.\",\n required: false,\n defaultValue: false,\n }),\n limit: Property.Number({\n displayName: \"Max results\",\n description: `Defaults to ${DEFAULT_LIMIT}`,\n required: false,\n }),\n },\n run: async (ctx) => {\n const {\n documentType,\n parentId,\n name,\n limit,\n matchPath,\n matchValue,\n includeState,\n } = ctx.propsValue;\n const capped = Math.min(\n Math.max(typeof limit === \"number\" ? limit : DEFAULT_LIMIT, 1),\n MAX_LIMIT,\n );\n // A state match names a field but not its value, or the other way round:\n // that is an unfinished step, and answering it as \"no filter\" would return\n // every document of the type to something that asked for one.\n const path = typeof matchPath === \"string\" ? matchPath.trim() : \"\";\n const wanted = typeof matchValue === \"string\" ? matchValue.trim() : \"\";\n if ((path === \"\") !== (wanted === \"\")) {\n throw new Error(\n 'document-find: \"State field\" and \"State value\" are set together or not at all',\n );\n }\n // Neither the name nor the state filter is an index query, so either one\n // has to see more rows than the step will keep; without one, ask for\n // exactly the page wanted rather than a default page per model.\n const needle = typeof name === \"string\" ? name.trim().toLowerCase() : \"\";\n const filtered = needle !== \"\" || path !== \"\";\n const found = await reactorOf(ctx).find({\n ...(documentType ? { documentType } : {}),\n ...(parentId ? { parentId } : {}),\n ...(filtered ? {} : { limit: capped }),\n ...(path ? { match: { path, value: wanted } } : {}),\n ...(includeState === true ? { withState: true } : {}),\n });\n const documents = found\n .filter(\n (document) => !needle || document.name.toLowerCase().includes(needle),\n )\n .slice(0, capped);\n return { count: documents.length, documents };\n },\n});\n","import { createAction, reactorOf } from \"@powerhousedao/pieces-framework\";\nimport { resolveDocumentId } from \"../parse.js\";\nimport { documentIdProp, documentTypeProp } from \"../reactor.js\";\n\nexport const documentGetAction = createAction({\n name: \"document-get\",\n displayName: \"Get document\",\n description: \"Reads a document's current state.\",\n requireAuth: false,\n props: {\n documentId: documentIdProp(\n \"Document id\",\n true,\n \"e.g. {{steps.find.output.documents.0.documentId}}\",\n ),\n documentType: documentTypeProp(\n \"Document type\",\n false,\n \"Design-time hint when the document id is an expression\",\n ),\n },\n run: async (ctx) => {\n const documentId = resolveDocumentId(ctx.propsValue.documentId);\n if (!documentId) {\n throw new Error('document-get: \"documentId\" is required');\n }\n return reactorOf(ctx).get({ documentId });\n },\n});\n","import { createAction, reactorOf } from \"@powerhousedao/pieces-framework\";\nimport { resolveDocumentId } from \"../parse.js\";\nimport {\n actionTypeProp,\n documentIdProp,\n documentTypeProp,\n} from \"../reactor.js\";\n\nexport const documentSchemaAction = createAction({\n name: \"document-schema\",\n displayName: \"Get document schema\",\n description: \"Action and state schemas of a document type.\",\n requireAuth: false,\n props: {\n documentType: documentTypeProp(\n \"Document type\",\n false,\n \"Required unless a document id is given\",\n ),\n documentId: documentIdProp(\n \"Document id\",\n false,\n \"Resolves the type from this document instead\",\n ),\n actionType: actionTypeProp(\n \"Only this action\",\n false,\n \"Omit to list every action\",\n ),\n },\n run: async (ctx) => {\n const reactor = reactorOf(ctx);\n const { actionType } = ctx.propsValue;\n let documentType =\n typeof ctx.propsValue.documentType === \"string\"\n ? ctx.propsValue.documentType\n : \"\";\n // A document id is accepted in place of a type, for expression-fed steps.\n const fromId = resolveDocumentId(ctx.propsValue.documentId);\n if (!documentType && fromId) {\n documentType = (await reactor.get({ documentId: fromId })).documentType;\n }\n if (!documentType) {\n throw new Error('document-schema: \"documentType\" is required');\n }\n const model = await reactor.model(documentType);\n return {\n documentType: model.documentType,\n name: model.name,\n stateSchema: model.stateSchema,\n actions: actionType\n ? model.actions.filter((action) => action.type === actionType)\n : model.actions,\n };\n },\n});\n","import { createAction, reactorOf } from \"@powerhousedao/pieces-framework\";\n\nexport const documentTypesAction = createAction({\n name: \"document-types\",\n displayName: \"List document types\",\n description: \"Document models installed on this reactor.\",\n requireAuth: false,\n props: {},\n run: async (ctx) => {\n const types = await reactorOf(ctx).models();\n return { count: types.length, types };\n },\n});\n","// The three document triggers the reactor feeds.\n\n// Their hooks are never called: matching an operation against a filter is the\n// host's, because the processor sees every operation in the reactor and an IPC\n// round trip per operation would sit on that path. The piece declares them so\n// the editor reads their props and payload shape from the same place it reads\n// every other block's.\nimport {\n createTrigger,\n TriggerStrategy,\n} from \"@powerhousedao/pieces-framework\";\nimport {\n actionTypeProp,\n documentIdProp,\n documentTypeProp,\n driveProp,\n} from \"../reactor.js\";\n\n// A hook that runs would mean the host stopped feeding this trigger, which is\n// a bug in the host rather than something a piece can answer.\nfunction hostFed(name: string): () => Promise<never> {\n return () =>\n Promise.reject(\n new Error(`The \"${name}\" trigger is fired by the reactor, not polled`),\n );\n}\n\nconst OPERATION_SAMPLE = {\n documentId: \"01234567-89ab-cdef-0123-456789abcdef\",\n documentType: \"powerhouse/workflow\",\n branch: \"main\",\n scope: \"global\",\n action: { type: \"SET_NAME\", input: { name: \"Invoice\" } },\n operation: { index: 7, timestampUtcMs: \"1757500000000\" },\n};\n\nconst LIFECYCLE_SAMPLE = {\n documentId: \"01234567-89ab-cdef-0123-456789abcdef\",\n documentType: \"powerhouse/workflow\",\n name: \"Invoice\",\n driveId: \"fedcba98-7654-3210-fedc-ba9876543210\",\n parentId: null,\n operation: { index: 0, timestampUtcMs: \"1757500000000\" },\n};\n\nexport const documentEventTrigger = createTrigger({\n name: \"document-event\",\n displayName: \"Document event\",\n description: \"Fires when a matching document operation lands.\",\n type: TriggerStrategy.POLLING,\n requireAuth: false,\n props: {\n documentType: documentTypeProp(\n \"Document type\",\n false,\n \"e.g. powerhouse/connection\",\n ),\n documentId: documentIdProp(\n \"Document id\",\n false,\n \"Omit to match any document\",\n ),\n actionType: actionTypeProp(\n \"Action type\",\n false,\n \"Omit to match any action\",\n ),\n },\n sampleData: OPERATION_SAMPLE,\n onEnable: hostFed(\"document-event\"),\n onDisable: hostFed(\"document-event\"),\n run: hostFed(\"document-event\"),\n});\n\nexport const documentCreatedTrigger = createTrigger({\n name: \"document-created\",\n displayName: \"Document created\",\n description: \"Fires when a document is added to a drive.\",\n type: TriggerStrategy.POLLING,\n requireAuth: false,\n props: {\n documentType: documentTypeProp(\n \"Document type\",\n false,\n \"Type of the created document; omit to match any\",\n ),\n driveId: driveProp(\n \"Drive\",\n \"Omit to match documents outside every drive too\",\n ),\n },\n sampleData: LIFECYCLE_SAMPLE,\n onEnable: hostFed(\"document-created\"),\n onDisable: hostFed(\"document-created\"),\n run: hostFed(\"document-created\"),\n});\n\nexport const documentDeletedTrigger = createTrigger({\n name: \"document-deleted\",\n displayName: \"Document deleted\",\n description: \"Fires when a document is removed from a drive.\",\n type: TriggerStrategy.POLLING,\n requireAuth: false,\n props: {\n documentType: documentTypeProp(\n \"Document type\",\n false,\n \"Type of the deleted document; omit to match any\",\n ),\n driveId: driveProp(\n \"Drive\",\n \"Omit to match documents outside every drive too\",\n ),\n },\n sampleData: LIFECYCLE_SAMPLE,\n onEnable: hostFed(\"document-deleted\"),\n onDisable: hostFed(\"document-deleted\"),\n run: hostFed(\"document-deleted\"),\n});\n","// The Powerhouse reactor piece: documents and document models as workflow\n// blocks, for the reactor the workflow itself runs in.\n\n// It reaches the reactor through ctx.reactor, which the host serves over the\n// worker's call channel — piece code never holds a reactor client, and a copy\n// of this piece fetched from a registry would find the member throwing.\nimport { createPiece } from \"@powerhousedao/pieces-framework\";\nimport { POWERHOUSE_LOGO } from \"./lib/logo.js\";\nimport { documentCreateAction } from \"./lib/actions/document-create.js\";\nimport { documentDispatchAction } from \"./lib/actions/document-dispatch.js\";\nimport { documentFindAction } from \"./lib/actions/document-find.js\";\nimport { documentGetAction } from \"./lib/actions/document-get.js\";\nimport { documentSchemaAction } from \"./lib/actions/document-schema.js\";\nimport { documentTypesAction } from \"./lib/actions/document-types.js\";\nimport {\n documentCreatedTrigger,\n documentDeletedTrigger,\n documentEventTrigger,\n} from \"./lib/triggers/document-event.js\";\n\nexport const reactor = createPiece({\n displayName: \"Powerhouse Reactor\",\n description:\n \"Read and write Powerhouse documents on the reactor this workflow runs in: create documents, dispatch actions, read state and schemas, and fire on document events.\",\n logoUrl: POWERHOUSE_LOGO,\n authors: [\"powerhouse\"],\n // The reactor is reached through the host, not over a connection.\n auth: undefined,\n actions: [\n documentCreateAction,\n documentDispatchAction,\n documentGetAction,\n documentFindAction,\n documentSchemaAction,\n documentTypesAction,\n ],\n triggers: [\n documentEventTrigger,\n documentCreatedTrigger,\n documentDeletedTrigger,\n ],\n});\n\nexport default reactor;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,15],"mappings":";AACqB,OAAO,OAAO,EAC/B,QAAQ,WACX,CAAC;AACF,SAAyC,aAAa,MAAM,aAAa,QA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