@oomol-lab/open-flow 0.1.0-beta.90 → 0.1.0-beta.91

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.
Files changed (37) hide show
  1. package/dist/browser/{FlowCanvas-C4iuvVKB.js → FlowCanvas-CZEphIhX.js} +169 -2324
  2. package/dist/browser/{createResourceDialog-BstGO0m4.js → createResourceDialog-CJbZa2gA.js} +2 -2
  3. package/dist/browser/{dialog-Bi-MVTGj.js → dialog-E1WkapJU.js} +10 -2
  4. package/dist/browser/{exportPng-DMsB9ku_.js → exportPng-c4or5th8.js} +2 -2
  5. package/dist/browser/{flowChanges-SKYJBr6X.js → flowChanges-DsLZdENA.js} +20 -37
  6. package/dist/browser/{flowWorkspace-4UHRaHcz.js → flowWorkspace-CxLQWUdj.js} +54 -19
  7. package/dist/browser/{markdownContent-B75ojl0E.js → markdownContent-BsdTdwBU.js} +1 -1
  8. package/dist/browser/preview.js +231 -68
  9. package/dist/browser/workbench.js +6 -6
  10. package/dist/browser/{workbenchSelect-CHOeceKA.js → workbenchSelect-BfQfMWuY.js} +1 -1
  11. package/dist/browser/{wrapLayout-DU5HG1qH.js → wrapLayout-ZOG4AikN.js} +2493 -200
  12. package/dist/command/index.js +58 -55
  13. package/dist/common/control-api-conformance.js +896 -8
  14. package/dist/common/control-api.js +896 -8
  15. package/dist/common/control-requests.js +17 -6
  16. package/dist/common/decision.js +10 -2
  17. package/dist/common/flow-authoring.js +896 -8
  18. package/dist/common/flow-change.js +896 -8
  19. package/dist/common/flow-encoding.js +896 -8
  20. package/dist/common/flow-semantics.js +10 -2
  21. package/dist/common/integration-trigger.js +10 -2
  22. package/dist/common/licenses.md +2 -0
  23. package/dist/common/mcp.js +896 -8
  24. package/dist/common/openapi.js +10 -2
  25. package/dist/common/poll-trigger.js +10 -2
  26. package/dist/common/provider-triggers.js +1 -1
  27. package/dist/common/scheduler.js +10 -2
  28. package/dist/common/webhook-trigger.js +890 -2
  29. package/dist/common/workflow.js +14 -3
  30. package/dist/render/browser/runtime.js +966 -59
  31. package/dist/render/node/index.js +792 -4
  32. package/package.json +1 -1
  33. package/src/control/common/authoringTools.ts +4 -2
  34. package/src/flow/common/schemaComparer.ts +12 -2
  35. package/src/json-schema-subset/checker/equals.ts +3 -0
  36. package/src/trigger/providers/catalog.generated.json +9 -1
  37. package/src/workflow/common/workflow.ts +4 -3
@@ -954,7 +954,7 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
954
954
  };
955
955
  var COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
956
956
  var COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
957
- var validate = ((schema, value, _ctx) => {
957
+ var validate$1 = ((schema, value, _ctx) => {
958
958
  const validator = schema._zod.bag.validator;
959
959
  if (validator !== void 0) {
960
960
  if (validator(value) !== COMPILE_INVALID) return true;
@@ -1106,12 +1106,12 @@ var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][
1106
1106
  function anchor(source) {
1107
1107
  return new RegExp(`^${source}$`);
1108
1108
  }
1109
- var date = /*@__PURE__*/ anchor(dateSource);
1109
+ var date$1 = /*@__PURE__*/ anchor(dateSource);
1110
1110
  function timeSource(args) {
1111
1111
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
1112
1112
  return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : args.seconds ? `${hhmm}:[0-5]\\d(?:\\.\\d+)?` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
1113
1113
  }
1114
- function time(args) {
1114
+ function time$1(args) {
1115
1115
  return new RegExp(`^${timeSource(args)}$`);
1116
1116
  }
1117
1117
  function datetime$1(args) {
@@ -1769,11 +1769,11 @@ var $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def)
1769
1769
  $ZodStringFormat.init(inst, def);
1770
1770
  });
1771
1771
  var $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
1772
- def.pattern ?? (def.pattern = date);
1772
+ def.pattern ?? (def.pattern = date$1);
1773
1773
  $ZodStringFormat.init(inst, def);
1774
1774
  });
1775
1775
  var $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
1776
- def.pattern ?? (def.pattern = time(def));
1776
+ def.pattern ?? (def.pattern = time$1(def));
1777
1777
  $ZodStringFormat.init(inst, def);
1778
1778
  });
1779
1779
  var $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => {
@@ -4988,7 +4988,7 @@ var ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
4988
4988
  own(this, "spa", value);
4989
4989
  },
4990
4990
  validate(data, params) {
4991
- return validate(this, data, params);
4991
+ return validate$1(this, data, params);
4992
4992
  },
4993
4993
  validateAsync(data, params) {
4994
4994
  return validateAsync$1(this, data, params);
@@ -5876,6 +5876,886 @@ var flowStateValuesSchema = object({
5876
5876
  return response.values.reduce((bytes, item) => bytes + (item.value === null ? 0 : encoder.encode(JSON.stringify(item.value)).byteLength), 0) <= stateReadLimits.maxBytes;
5877
5877
  }, "State values exceed the 1 MiB read limit.");
5878
5878
  //#endregion
5879
+ //#region ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/deep-compare-strict.js
5880
+ function deepCompareStrict(a, b) {
5881
+ const typeofa = typeof a;
5882
+ if (typeofa !== typeof b) return false;
5883
+ if (Array.isArray(a)) {
5884
+ if (!Array.isArray(b)) return false;
5885
+ const length = a.length;
5886
+ if (length !== b.length) return false;
5887
+ for (let i = 0; i < length; i++) if (!deepCompareStrict(a[i], b[i])) return false;
5888
+ return true;
5889
+ }
5890
+ if (typeofa === "object") {
5891
+ if (!a || !b) return a === b;
5892
+ const aKeys = Object.keys(a);
5893
+ const bKeys = Object.keys(b);
5894
+ if (aKeys.length !== bKeys.length) return false;
5895
+ for (const k of aKeys) if (!deepCompareStrict(a[k], b[k])) return false;
5896
+ return true;
5897
+ }
5898
+ return a === b;
5899
+ }
5900
+ //#endregion
5901
+ //#region ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/pointer.js
5902
+ function encodePointer(p) {
5903
+ return encodeURI(escapePointer(p));
5904
+ }
5905
+ function escapePointer(p) {
5906
+ return p.replace(/~/g, "~0").replace(/\//g, "~1");
5907
+ }
5908
+ //#endregion
5909
+ //#region ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/dereference.js
5910
+ var schemaArrayKeyword = {
5911
+ prefixItems: true,
5912
+ items: true,
5913
+ allOf: true,
5914
+ anyOf: true,
5915
+ oneOf: true
5916
+ };
5917
+ var schemaMapKeyword = {
5918
+ $defs: true,
5919
+ definitions: true,
5920
+ properties: true,
5921
+ patternProperties: true,
5922
+ dependentSchemas: true
5923
+ };
5924
+ var ignoredKeyword = {
5925
+ id: true,
5926
+ $id: true,
5927
+ $ref: true,
5928
+ $schema: true,
5929
+ $anchor: true,
5930
+ $vocabulary: true,
5931
+ $comment: true,
5932
+ default: true,
5933
+ enum: true,
5934
+ const: true,
5935
+ required: true,
5936
+ type: true,
5937
+ maximum: true,
5938
+ minimum: true,
5939
+ exclusiveMaximum: true,
5940
+ exclusiveMinimum: true,
5941
+ multipleOf: true,
5942
+ maxLength: true,
5943
+ minLength: true,
5944
+ pattern: true,
5945
+ format: true,
5946
+ maxItems: true,
5947
+ minItems: true,
5948
+ uniqueItems: true,
5949
+ maxProperties: true,
5950
+ minProperties: true
5951
+ };
5952
+ var initialBaseURI = typeof self !== "undefined" && self.location && self.location.origin !== "null" ? new URL(self.location.origin + self.location.pathname + location.search) : new URL("https://github.com/cfworker");
5953
+ function dereference(schema, lookup = Object.create(null), baseURI = initialBaseURI, basePointer = "") {
5954
+ if (schema && typeof schema === "object" && !Array.isArray(schema)) {
5955
+ const id = schema.$id || schema.id;
5956
+ if (id) {
5957
+ const url = new URL(id, baseURI.href);
5958
+ if (url.hash.length > 1) lookup[url.href] = schema;
5959
+ else {
5960
+ url.hash = "";
5961
+ if (basePointer === "") baseURI = url;
5962
+ else dereference(schema, lookup, baseURI);
5963
+ }
5964
+ }
5965
+ } else if (schema !== true && schema !== false) return lookup;
5966
+ const schemaURI = baseURI.href + (basePointer ? "#" + basePointer : "");
5967
+ if (lookup[schemaURI] !== void 0) throw new Error(`Duplicate schema URI "${schemaURI}".`);
5968
+ lookup[schemaURI] = schema;
5969
+ if (schema === true || schema === false) return lookup;
5970
+ if (schema.__absolute_uri__ === void 0) Object.defineProperty(schema, "__absolute_uri__", {
5971
+ enumerable: false,
5972
+ value: schemaURI
5973
+ });
5974
+ if (schema.$ref && schema.__absolute_ref__ === void 0) {
5975
+ const url = new URL(schema.$ref, baseURI.href);
5976
+ url.hash = url.hash;
5977
+ Object.defineProperty(schema, "__absolute_ref__", {
5978
+ enumerable: false,
5979
+ value: url.href
5980
+ });
5981
+ }
5982
+ if (schema.$recursiveRef && schema.__absolute_recursive_ref__ === void 0) {
5983
+ const url = new URL(schema.$recursiveRef, baseURI.href);
5984
+ url.hash = url.hash;
5985
+ Object.defineProperty(schema, "__absolute_recursive_ref__", {
5986
+ enumerable: false,
5987
+ value: url.href
5988
+ });
5989
+ }
5990
+ if (schema.$anchor) {
5991
+ const url = new URL("#" + schema.$anchor, baseURI.href);
5992
+ lookup[url.href] = schema;
5993
+ }
5994
+ for (let key in schema) {
5995
+ if (ignoredKeyword[key]) continue;
5996
+ const keyBase = `${basePointer}/${encodePointer(key)}`;
5997
+ const subSchema = schema[key];
5998
+ if (Array.isArray(subSchema)) {
5999
+ if (schemaArrayKeyword[key]) {
6000
+ const length = subSchema.length;
6001
+ for (let i = 0; i < length; i++) dereference(subSchema[i], lookup, baseURI, `${keyBase}/${i}`);
6002
+ }
6003
+ } else if (schemaMapKeyword[key]) for (let subKey in subSchema) dereference(subSchema[subKey], lookup, baseURI, `${keyBase}/${encodePointer(subKey)}`);
6004
+ else dereference(subSchema, lookup, baseURI, keyBase);
6005
+ }
6006
+ return lookup;
6007
+ }
6008
+ //#endregion
6009
+ //#region ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/format.js
6010
+ var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
6011
+ var DAYS = [
6012
+ 0,
6013
+ 31,
6014
+ 28,
6015
+ 31,
6016
+ 30,
6017
+ 31,
6018
+ 30,
6019
+ 31,
6020
+ 31,
6021
+ 30,
6022
+ 31,
6023
+ 30,
6024
+ 31
6025
+ ];
6026
+ var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
6027
+ var HOSTNAME = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;
6028
+ var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
6029
+ var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;
6030
+ var URL_ = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;
6031
+ var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
6032
+ var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
6033
+ var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
6034
+ var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
6035
+ var EMAIL = (input) => {
6036
+ if (input[0] === "\"") return false;
6037
+ const [name, host, ...rest] = input.split("@");
6038
+ if (!name || !host || rest.length !== 0 || name.length > 64 || host.length > 253) return false;
6039
+ if (name[0] === "." || name.endsWith(".") || name.includes("..")) return false;
6040
+ if (!/^[a-z0-9.-]+$/i.test(host) || !/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(name)) return false;
6041
+ return host.split(".").every((part) => /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(part));
6042
+ };
6043
+ var IPV4 = /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/;
6044
+ var IPV6 = /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;
6045
+ var DURATION = (input) => input.length > 1 && input.length < 80 && (/^P\d+([.,]\d+)?W$/.test(input) || /^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(input) && /^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(input));
6046
+ function bind(r) {
6047
+ return r.test.bind(r);
6048
+ }
6049
+ var format = {
6050
+ date,
6051
+ time: time.bind(void 0, false),
6052
+ "date-time": date_time,
6053
+ duration: DURATION,
6054
+ uri,
6055
+ "uri-reference": bind(URIREF),
6056
+ "uri-template": bind(URITEMPLATE),
6057
+ url: bind(URL_),
6058
+ email: EMAIL,
6059
+ hostname: bind(HOSTNAME),
6060
+ ipv4: bind(IPV4),
6061
+ ipv6: bind(IPV6),
6062
+ regex,
6063
+ uuid: bind(UUID),
6064
+ "json-pointer": bind(JSON_POINTER),
6065
+ "json-pointer-uri-fragment": bind(JSON_POINTER_URI_FRAGMENT),
6066
+ "relative-json-pointer": bind(RELATIVE_JSON_POINTER)
6067
+ };
6068
+ function isLeapYear(year) {
6069
+ return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
6070
+ }
6071
+ function date(str) {
6072
+ const matches = str.match(DATE);
6073
+ if (!matches) return false;
6074
+ const year = +matches[1];
6075
+ const month = +matches[2];
6076
+ const day = +matches[3];
6077
+ return month >= 1 && month <= 12 && day >= 1 && day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]);
6078
+ }
6079
+ function time(full, str) {
6080
+ const matches = str.match(TIME);
6081
+ if (!matches) return false;
6082
+ const hour = +matches[1];
6083
+ const minute = +matches[2];
6084
+ const second = +matches[3];
6085
+ const timeZone = !!matches[5];
6086
+ return (hour <= 23 && minute <= 59 && second <= 59 || hour == 23 && minute == 59 && second == 60) && (!full || timeZone);
6087
+ }
6088
+ var DATE_TIME_SEPARATOR = /t|\s/i;
6089
+ function date_time(str) {
6090
+ const dateTime = str.split(DATE_TIME_SEPARATOR);
6091
+ return dateTime.length == 2 && date(dateTime[0]) && time(true, dateTime[1]);
6092
+ }
6093
+ var NOT_URI_FRAGMENT = /\/|:/;
6094
+ var URI_PATTERN = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
6095
+ function uri(str) {
6096
+ return NOT_URI_FRAGMENT.test(str) && URI_PATTERN.test(str);
6097
+ }
6098
+ var Z_ANCHOR = /[^\\]\\Z/;
6099
+ function regex(str) {
6100
+ if (Z_ANCHOR.test(str)) return false;
6101
+ try {
6102
+ new RegExp(str, "u");
6103
+ return true;
6104
+ } catch (e) {
6105
+ return false;
6106
+ }
6107
+ }
6108
+ //#endregion
6109
+ //#region ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/ucs2-length.js
6110
+ function ucs2length(s) {
6111
+ let result = 0;
6112
+ let length = s.length;
6113
+ let index = 0;
6114
+ let charCode;
6115
+ while (index < length) {
6116
+ result++;
6117
+ charCode = s.charCodeAt(index++);
6118
+ if (charCode >= 55296 && charCode <= 56319 && index < length) {
6119
+ charCode = s.charCodeAt(index);
6120
+ if ((charCode & 64512) == 56320) index++;
6121
+ }
6122
+ }
6123
+ return result;
6124
+ }
6125
+ //#endregion
6126
+ //#region ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/validate.js
6127
+ function validate(instance, schema, draft = "2019-09", lookup = dereference(schema), shortCircuit = true, recursiveAnchor = null, instanceLocation = "#", schemaLocation = "#", evaluated = Object.create(null)) {
6128
+ if (schema === true) return {
6129
+ valid: true,
6130
+ errors: []
6131
+ };
6132
+ if (schema === false) return {
6133
+ valid: false,
6134
+ errors: [{
6135
+ instanceLocation,
6136
+ keyword: "false",
6137
+ keywordLocation: instanceLocation,
6138
+ error: "False boolean schema."
6139
+ }]
6140
+ };
6141
+ const rawInstanceType = typeof instance;
6142
+ let instanceType;
6143
+ switch (rawInstanceType) {
6144
+ case "boolean":
6145
+ case "number":
6146
+ case "string":
6147
+ instanceType = rawInstanceType;
6148
+ break;
6149
+ case "object":
6150
+ if (instance === null) instanceType = "null";
6151
+ else if (Array.isArray(instance)) instanceType = "array";
6152
+ else instanceType = "object";
6153
+ break;
6154
+ default: throw new Error(`Instances of "${rawInstanceType}" type are not supported.`);
6155
+ }
6156
+ const { $ref, $recursiveRef, $recursiveAnchor, type: $type, const: $const, enum: $enum, required: $required, not: $not, anyOf: $anyOf, allOf: $allOf, oneOf: $oneOf, if: $if, then: $then, else: $else, format: $format, properties: $properties, patternProperties: $patternProperties, additionalProperties: $additionalProperties, unevaluatedProperties: $unevaluatedProperties, minProperties: $minProperties, maxProperties: $maxProperties, propertyNames: $propertyNames, dependentRequired: $dependentRequired, dependentSchemas: $dependentSchemas, dependencies: $dependencies, prefixItems: $prefixItems, items: $items, additionalItems: $additionalItems, unevaluatedItems: $unevaluatedItems, contains: $contains, minContains: $minContains, maxContains: $maxContains, minItems: $minItems, maxItems: $maxItems, uniqueItems: $uniqueItems, minimum: $minimum, maximum: $maximum, exclusiveMinimum: $exclusiveMinimum, exclusiveMaximum: $exclusiveMaximum, multipleOf: $multipleOf, minLength: $minLength, maxLength: $maxLength, pattern: $pattern, __absolute_ref__, __absolute_recursive_ref__ } = schema;
6157
+ const errors = [];
6158
+ if ($recursiveAnchor === true && recursiveAnchor === null) recursiveAnchor = schema;
6159
+ if ($recursiveRef === "#") {
6160
+ const refSchema = recursiveAnchor === null ? lookup[__absolute_recursive_ref__] : recursiveAnchor;
6161
+ const keywordLocation = `${schemaLocation}/$recursiveRef`;
6162
+ const result = validate(instance, recursiveAnchor === null ? schema : recursiveAnchor, draft, lookup, shortCircuit, refSchema, instanceLocation, keywordLocation, evaluated);
6163
+ if (!result.valid) errors.push({
6164
+ instanceLocation,
6165
+ keyword: "$recursiveRef",
6166
+ keywordLocation,
6167
+ error: "A subschema had errors."
6168
+ }, ...result.errors);
6169
+ }
6170
+ if ($ref !== void 0) {
6171
+ const refSchema = lookup[__absolute_ref__ || $ref];
6172
+ if (refSchema === void 0) {
6173
+ let message = `Unresolved $ref "${$ref}".`;
6174
+ if (__absolute_ref__ && __absolute_ref__ !== $ref) message += ` Absolute URI "${__absolute_ref__}".`;
6175
+ message += `\nKnown schemas:\n- ${Object.keys(lookup).join("\n- ")}`;
6176
+ throw new Error(message);
6177
+ }
6178
+ const keywordLocation = `${schemaLocation}/$ref`;
6179
+ const result = validate(instance, refSchema, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, keywordLocation, evaluated);
6180
+ if (!result.valid) errors.push({
6181
+ instanceLocation,
6182
+ keyword: "$ref",
6183
+ keywordLocation,
6184
+ error: "A subschema had errors."
6185
+ }, ...result.errors);
6186
+ if (draft === "4" || draft === "7") return {
6187
+ valid: errors.length === 0,
6188
+ errors
6189
+ };
6190
+ }
6191
+ if (Array.isArray($type)) {
6192
+ let length = $type.length;
6193
+ let valid = false;
6194
+ for (let i = 0; i < length; i++) if (instanceType === $type[i] || $type[i] === "integer" && instanceType === "number" && instance % 1 === 0 && instance === instance) {
6195
+ valid = true;
6196
+ break;
6197
+ }
6198
+ if (!valid) errors.push({
6199
+ instanceLocation,
6200
+ keyword: "type",
6201
+ keywordLocation: `${schemaLocation}/type`,
6202
+ error: `Instance type "${instanceType}" is invalid. Expected "${$type.join("\", \"")}".`
6203
+ });
6204
+ } else if ($type === "integer") {
6205
+ if (instanceType !== "number" || instance % 1 || instance !== instance) errors.push({
6206
+ instanceLocation,
6207
+ keyword: "type",
6208
+ keywordLocation: `${schemaLocation}/type`,
6209
+ error: `Instance type "${instanceType}" is invalid. Expected "${$type}".`
6210
+ });
6211
+ } else if ($type !== void 0 && instanceType !== $type) errors.push({
6212
+ instanceLocation,
6213
+ keyword: "type",
6214
+ keywordLocation: `${schemaLocation}/type`,
6215
+ error: `Instance type "${instanceType}" is invalid. Expected "${$type}".`
6216
+ });
6217
+ if ($const !== void 0) {
6218
+ if (instanceType === "object" || instanceType === "array") {
6219
+ if (!deepCompareStrict(instance, $const)) errors.push({
6220
+ instanceLocation,
6221
+ keyword: "const",
6222
+ keywordLocation: `${schemaLocation}/const`,
6223
+ error: `Instance does not match ${JSON.stringify($const)}.`
6224
+ });
6225
+ } else if (instance !== $const) errors.push({
6226
+ instanceLocation,
6227
+ keyword: "const",
6228
+ keywordLocation: `${schemaLocation}/const`,
6229
+ error: `Instance does not match ${JSON.stringify($const)}.`
6230
+ });
6231
+ }
6232
+ if ($enum !== void 0) {
6233
+ if (instanceType === "object" || instanceType === "array") {
6234
+ if (!$enum.some((value) => deepCompareStrict(instance, value))) errors.push({
6235
+ instanceLocation,
6236
+ keyword: "enum",
6237
+ keywordLocation: `${schemaLocation}/enum`,
6238
+ error: `Instance does not match any of ${JSON.stringify($enum)}.`
6239
+ });
6240
+ } else if (!$enum.some((value) => instance === value)) errors.push({
6241
+ instanceLocation,
6242
+ keyword: "enum",
6243
+ keywordLocation: `${schemaLocation}/enum`,
6244
+ error: `Instance does not match any of ${JSON.stringify($enum)}.`
6245
+ });
6246
+ }
6247
+ if ($not !== void 0) {
6248
+ const keywordLocation = `${schemaLocation}/not`;
6249
+ if (validate(instance, $not, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, keywordLocation).valid) errors.push({
6250
+ instanceLocation,
6251
+ keyword: "not",
6252
+ keywordLocation,
6253
+ error: "Instance matched \"not\" schema."
6254
+ });
6255
+ }
6256
+ let subEvaluateds = [];
6257
+ if ($anyOf !== void 0) {
6258
+ const keywordLocation = `${schemaLocation}/anyOf`;
6259
+ const errorsLength = errors.length;
6260
+ let anyValid = false;
6261
+ for (let i = 0; i < $anyOf.length; i++) {
6262
+ const subSchema = $anyOf[i];
6263
+ const subEvaluated = Object.create(evaluated);
6264
+ const result = validate(instance, subSchema, draft, lookup, shortCircuit, $recursiveAnchor === true ? recursiveAnchor : null, instanceLocation, `${keywordLocation}/${i}`, subEvaluated);
6265
+ errors.push(...result.errors);
6266
+ anyValid = anyValid || result.valid;
6267
+ if (result.valid) subEvaluateds.push(subEvaluated);
6268
+ }
6269
+ if (anyValid) errors.length = errorsLength;
6270
+ else errors.splice(errorsLength, 0, {
6271
+ instanceLocation,
6272
+ keyword: "anyOf",
6273
+ keywordLocation,
6274
+ error: "Instance does not match any subschemas."
6275
+ });
6276
+ }
6277
+ if ($allOf !== void 0) {
6278
+ const keywordLocation = `${schemaLocation}/allOf`;
6279
+ const errorsLength = errors.length;
6280
+ let allValid = true;
6281
+ for (let i = 0; i < $allOf.length; i++) {
6282
+ const subSchema = $allOf[i];
6283
+ const subEvaluated = Object.create(evaluated);
6284
+ const result = validate(instance, subSchema, draft, lookup, shortCircuit, $recursiveAnchor === true ? recursiveAnchor : null, instanceLocation, `${keywordLocation}/${i}`, subEvaluated);
6285
+ errors.push(...result.errors);
6286
+ allValid = allValid && result.valid;
6287
+ if (result.valid) subEvaluateds.push(subEvaluated);
6288
+ }
6289
+ if (allValid) errors.length = errorsLength;
6290
+ else errors.splice(errorsLength, 0, {
6291
+ instanceLocation,
6292
+ keyword: "allOf",
6293
+ keywordLocation,
6294
+ error: `Instance does not match every subschema.`
6295
+ });
6296
+ }
6297
+ if ($oneOf !== void 0) {
6298
+ const keywordLocation = `${schemaLocation}/oneOf`;
6299
+ const errorsLength = errors.length;
6300
+ const matches = $oneOf.filter((subSchema, i) => {
6301
+ const subEvaluated = Object.create(evaluated);
6302
+ const result = validate(instance, subSchema, draft, lookup, shortCircuit, $recursiveAnchor === true ? recursiveAnchor : null, instanceLocation, `${keywordLocation}/${i}`, subEvaluated);
6303
+ errors.push(...result.errors);
6304
+ if (result.valid) subEvaluateds.push(subEvaluated);
6305
+ return result.valid;
6306
+ }).length;
6307
+ if (matches === 1) errors.length = errorsLength;
6308
+ else errors.splice(errorsLength, 0, {
6309
+ instanceLocation,
6310
+ keyword: "oneOf",
6311
+ keywordLocation,
6312
+ error: `Instance does not match exactly one subschema (${matches} matches).`
6313
+ });
6314
+ }
6315
+ if (instanceType === "object" || instanceType === "array") Object.assign(evaluated, ...subEvaluateds);
6316
+ if ($if !== void 0) {
6317
+ const keywordLocation = `${schemaLocation}/if`;
6318
+ if (validate(instance, $if, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, keywordLocation, evaluated).valid) {
6319
+ if ($then !== void 0) {
6320
+ const thenResult = validate(instance, $then, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${schemaLocation}/then`, evaluated);
6321
+ if (!thenResult.valid) errors.push({
6322
+ instanceLocation,
6323
+ keyword: "if",
6324
+ keywordLocation,
6325
+ error: `Instance does not match "then" schema.`
6326
+ }, ...thenResult.errors);
6327
+ }
6328
+ } else if ($else !== void 0) {
6329
+ const elseResult = validate(instance, $else, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${schemaLocation}/else`, evaluated);
6330
+ if (!elseResult.valid) errors.push({
6331
+ instanceLocation,
6332
+ keyword: "if",
6333
+ keywordLocation,
6334
+ error: `Instance does not match "else" schema.`
6335
+ }, ...elseResult.errors);
6336
+ }
6337
+ }
6338
+ if (instanceType === "object") {
6339
+ if ($required !== void 0) {
6340
+ for (const key of $required) if (!(key in instance)) errors.push({
6341
+ instanceLocation,
6342
+ keyword: "required",
6343
+ keywordLocation: `${schemaLocation}/required`,
6344
+ error: `Instance does not have required property "${key}".`
6345
+ });
6346
+ }
6347
+ const keys = Object.keys(instance);
6348
+ if ($minProperties !== void 0 && keys.length < $minProperties) errors.push({
6349
+ instanceLocation,
6350
+ keyword: "minProperties",
6351
+ keywordLocation: `${schemaLocation}/minProperties`,
6352
+ error: `Instance does not have at least ${$minProperties} properties.`
6353
+ });
6354
+ if ($maxProperties !== void 0 && keys.length > $maxProperties) errors.push({
6355
+ instanceLocation,
6356
+ keyword: "maxProperties",
6357
+ keywordLocation: `${schemaLocation}/maxProperties`,
6358
+ error: `Instance does not have at least ${$maxProperties} properties.`
6359
+ });
6360
+ if ($propertyNames !== void 0) {
6361
+ const keywordLocation = `${schemaLocation}/propertyNames`;
6362
+ for (const key in instance) {
6363
+ const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
6364
+ const result = validate(key, $propertyNames, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, keywordLocation);
6365
+ if (!result.valid) errors.push({
6366
+ instanceLocation,
6367
+ keyword: "propertyNames",
6368
+ keywordLocation,
6369
+ error: `Property name "${key}" does not match schema.`
6370
+ }, ...result.errors);
6371
+ }
6372
+ }
6373
+ if ($dependentRequired !== void 0) {
6374
+ const keywordLocation = `${schemaLocation}/dependantRequired`;
6375
+ for (const key in $dependentRequired) if (key in instance) {
6376
+ const required = $dependentRequired[key];
6377
+ for (const dependantKey of required) if (!(dependantKey in instance)) errors.push({
6378
+ instanceLocation,
6379
+ keyword: "dependentRequired",
6380
+ keywordLocation,
6381
+ error: `Instance has "${key}" but does not have "${dependantKey}".`
6382
+ });
6383
+ }
6384
+ }
6385
+ if ($dependentSchemas !== void 0) for (const key in $dependentSchemas) {
6386
+ const keywordLocation = `${schemaLocation}/dependentSchemas`;
6387
+ if (key in instance) {
6388
+ const result = validate(instance, $dependentSchemas[key], draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${keywordLocation}/${encodePointer(key)}`, evaluated);
6389
+ if (!result.valid) errors.push({
6390
+ instanceLocation,
6391
+ keyword: "dependentSchemas",
6392
+ keywordLocation,
6393
+ error: `Instance has "${key}" but does not match dependant schema.`
6394
+ }, ...result.errors);
6395
+ }
6396
+ }
6397
+ if ($dependencies !== void 0) {
6398
+ const keywordLocation = `${schemaLocation}/dependencies`;
6399
+ for (const key in $dependencies) if (key in instance) {
6400
+ const propsOrSchema = $dependencies[key];
6401
+ if (Array.isArray(propsOrSchema)) {
6402
+ for (const dependantKey of propsOrSchema) if (!(dependantKey in instance)) errors.push({
6403
+ instanceLocation,
6404
+ keyword: "dependencies",
6405
+ keywordLocation,
6406
+ error: `Instance has "${key}" but does not have "${dependantKey}".`
6407
+ });
6408
+ } else {
6409
+ const result = validate(instance, propsOrSchema, draft, lookup, shortCircuit, recursiveAnchor, instanceLocation, `${keywordLocation}/${encodePointer(key)}`);
6410
+ if (!result.valid) errors.push({
6411
+ instanceLocation,
6412
+ keyword: "dependencies",
6413
+ keywordLocation,
6414
+ error: `Instance has "${key}" but does not match dependant schema.`
6415
+ }, ...result.errors);
6416
+ }
6417
+ }
6418
+ }
6419
+ const thisEvaluated = Object.create(null);
6420
+ let stop = false;
6421
+ if ($properties !== void 0) {
6422
+ const keywordLocation = `${schemaLocation}/properties`;
6423
+ for (const key in $properties) {
6424
+ if (!(key in instance)) continue;
6425
+ const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
6426
+ const result = validate(instance[key], $properties[key], draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, `${keywordLocation}/${encodePointer(key)}`);
6427
+ if (result.valid) evaluated[key] = thisEvaluated[key] = true;
6428
+ else {
6429
+ stop = shortCircuit;
6430
+ errors.push({
6431
+ instanceLocation,
6432
+ keyword: "properties",
6433
+ keywordLocation,
6434
+ error: `Property "${key}" does not match schema.`
6435
+ }, ...result.errors);
6436
+ if (stop) break;
6437
+ }
6438
+ }
6439
+ }
6440
+ if (!stop && $patternProperties !== void 0) {
6441
+ const keywordLocation = `${schemaLocation}/patternProperties`;
6442
+ for (const pattern in $patternProperties) {
6443
+ const regex = new RegExp(pattern, "u");
6444
+ const subSchema = $patternProperties[pattern];
6445
+ for (const key in instance) {
6446
+ if (!regex.test(key)) continue;
6447
+ const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
6448
+ const result = validate(instance[key], subSchema, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, `${keywordLocation}/${encodePointer(pattern)}`);
6449
+ if (result.valid) evaluated[key] = thisEvaluated[key] = true;
6450
+ else {
6451
+ stop = shortCircuit;
6452
+ errors.push({
6453
+ instanceLocation,
6454
+ keyword: "patternProperties",
6455
+ keywordLocation,
6456
+ error: `Property "${key}" matches pattern "${pattern}" but does not match associated schema.`
6457
+ }, ...result.errors);
6458
+ }
6459
+ }
6460
+ }
6461
+ }
6462
+ if (!stop && $additionalProperties !== void 0) {
6463
+ const keywordLocation = `${schemaLocation}/additionalProperties`;
6464
+ for (const key in instance) {
6465
+ if (thisEvaluated[key]) continue;
6466
+ const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
6467
+ const result = validate(instance[key], $additionalProperties, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, keywordLocation);
6468
+ if (result.valid) evaluated[key] = true;
6469
+ else {
6470
+ stop = shortCircuit;
6471
+ errors.push({
6472
+ instanceLocation,
6473
+ keyword: "additionalProperties",
6474
+ keywordLocation,
6475
+ error: `Property "${key}" does not match additional properties schema.`
6476
+ }, ...result.errors);
6477
+ }
6478
+ }
6479
+ } else if (!stop && $unevaluatedProperties !== void 0) {
6480
+ const keywordLocation = `${schemaLocation}/unevaluatedProperties`;
6481
+ for (const key in instance) if (!evaluated[key]) {
6482
+ const subInstancePointer = `${instanceLocation}/${encodePointer(key)}`;
6483
+ const result = validate(instance[key], $unevaluatedProperties, draft, lookup, shortCircuit, recursiveAnchor, subInstancePointer, keywordLocation);
6484
+ if (result.valid) evaluated[key] = true;
6485
+ else errors.push({
6486
+ instanceLocation,
6487
+ keyword: "unevaluatedProperties",
6488
+ keywordLocation,
6489
+ error: `Property "${key}" does not match unevaluated properties schema.`
6490
+ }, ...result.errors);
6491
+ }
6492
+ }
6493
+ } else if (instanceType === "array") {
6494
+ if ($maxItems !== void 0 && instance.length > $maxItems) errors.push({
6495
+ instanceLocation,
6496
+ keyword: "maxItems",
6497
+ keywordLocation: `${schemaLocation}/maxItems`,
6498
+ error: `Array has too many items (${instance.length} > ${$maxItems}).`
6499
+ });
6500
+ if ($minItems !== void 0 && instance.length < $minItems) errors.push({
6501
+ instanceLocation,
6502
+ keyword: "minItems",
6503
+ keywordLocation: `${schemaLocation}/minItems`,
6504
+ error: `Array has too few items (${instance.length} < ${$minItems}).`
6505
+ });
6506
+ const length = instance.length;
6507
+ let i = 0;
6508
+ let stop = false;
6509
+ if ($prefixItems !== void 0) {
6510
+ const keywordLocation = `${schemaLocation}/prefixItems`;
6511
+ const length2 = Math.min($prefixItems.length, length);
6512
+ for (; i < length2; i++) {
6513
+ const result = validate(instance[i], $prefixItems[i], draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, `${keywordLocation}/${i}`);
6514
+ evaluated[i] = true;
6515
+ if (!result.valid) {
6516
+ stop = shortCircuit;
6517
+ errors.push({
6518
+ instanceLocation,
6519
+ keyword: "prefixItems",
6520
+ keywordLocation,
6521
+ error: `Items did not match schema.`
6522
+ }, ...result.errors);
6523
+ if (stop) break;
6524
+ }
6525
+ }
6526
+ }
6527
+ if ($items !== void 0) {
6528
+ const keywordLocation = `${schemaLocation}/items`;
6529
+ if (Array.isArray($items)) {
6530
+ const length2 = Math.min($items.length, length);
6531
+ for (; i < length2; i++) {
6532
+ const result = validate(instance[i], $items[i], draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, `${keywordLocation}/${i}`);
6533
+ evaluated[i] = true;
6534
+ if (!result.valid) {
6535
+ stop = shortCircuit;
6536
+ errors.push({
6537
+ instanceLocation,
6538
+ keyword: "items",
6539
+ keywordLocation,
6540
+ error: `Items did not match schema.`
6541
+ }, ...result.errors);
6542
+ if (stop) break;
6543
+ }
6544
+ }
6545
+ } else for (; i < length; i++) {
6546
+ const result = validate(instance[i], $items, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation);
6547
+ evaluated[i] = true;
6548
+ if (!result.valid) {
6549
+ stop = shortCircuit;
6550
+ errors.push({
6551
+ instanceLocation,
6552
+ keyword: "items",
6553
+ keywordLocation,
6554
+ error: `Items did not match schema.`
6555
+ }, ...result.errors);
6556
+ if (stop) break;
6557
+ }
6558
+ }
6559
+ if (!stop && $additionalItems !== void 0) {
6560
+ const keywordLocation = `${schemaLocation}/additionalItems`;
6561
+ for (; i < length; i++) {
6562
+ const result = validate(instance[i], $additionalItems, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation);
6563
+ evaluated[i] = true;
6564
+ if (!result.valid) {
6565
+ stop = shortCircuit;
6566
+ errors.push({
6567
+ instanceLocation,
6568
+ keyword: "additionalItems",
6569
+ keywordLocation,
6570
+ error: `Items did not match additional items schema.`
6571
+ }, ...result.errors);
6572
+ }
6573
+ }
6574
+ }
6575
+ }
6576
+ if ($contains !== void 0) {
6577
+ if (length === 0 && $minContains === void 0) errors.push({
6578
+ instanceLocation,
6579
+ keyword: "contains",
6580
+ keywordLocation: `${schemaLocation}/contains`,
6581
+ error: `Array is empty. It must contain at least one item matching the schema.`
6582
+ });
6583
+ else if ($minContains !== void 0 && length < $minContains) errors.push({
6584
+ instanceLocation,
6585
+ keyword: "minContains",
6586
+ keywordLocation: `${schemaLocation}/minContains`,
6587
+ error: `Array has less items (${length}) than minContains (${$minContains}).`
6588
+ });
6589
+ else {
6590
+ const keywordLocation = `${schemaLocation}/contains`;
6591
+ const errorsLength = errors.length;
6592
+ let contained = 0;
6593
+ for (let j = 0; j < length; j++) {
6594
+ const result = validate(instance[j], $contains, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${j}`, keywordLocation);
6595
+ if (result.valid) {
6596
+ evaluated[j] = true;
6597
+ contained++;
6598
+ } else errors.push(...result.errors);
6599
+ }
6600
+ if (contained >= ($minContains || 0)) errors.length = errorsLength;
6601
+ if ($minContains === void 0 && $maxContains === void 0 && contained === 0) errors.splice(errorsLength, 0, {
6602
+ instanceLocation,
6603
+ keyword: "contains",
6604
+ keywordLocation,
6605
+ error: `Array does not contain item matching schema.`
6606
+ });
6607
+ else if ($minContains !== void 0 && contained < $minContains) errors.push({
6608
+ instanceLocation,
6609
+ keyword: "minContains",
6610
+ keywordLocation: `${schemaLocation}/minContains`,
6611
+ error: `Array must contain at least ${$minContains} items matching schema. Only ${contained} items were found.`
6612
+ });
6613
+ else if ($maxContains !== void 0 && contained > $maxContains) errors.push({
6614
+ instanceLocation,
6615
+ keyword: "maxContains",
6616
+ keywordLocation: `${schemaLocation}/maxContains`,
6617
+ error: `Array may contain at most ${$maxContains} items matching schema. ${contained} items were found.`
6618
+ });
6619
+ }
6620
+ }
6621
+ if (!stop && $unevaluatedItems !== void 0) {
6622
+ const keywordLocation = `${schemaLocation}/unevaluatedItems`;
6623
+ for (; i < length; i++) {
6624
+ if (evaluated[i]) continue;
6625
+ const result = validate(instance[i], $unevaluatedItems, draft, lookup, shortCircuit, recursiveAnchor, `${instanceLocation}/${i}`, keywordLocation);
6626
+ evaluated[i] = true;
6627
+ if (!result.valid) errors.push({
6628
+ instanceLocation,
6629
+ keyword: "unevaluatedItems",
6630
+ keywordLocation,
6631
+ error: `Items did not match unevaluated items schema.`
6632
+ }, ...result.errors);
6633
+ }
6634
+ }
6635
+ if ($uniqueItems) for (let j = 0; j < length; j++) {
6636
+ const a = instance[j];
6637
+ const ao = typeof a === "object" && a !== null;
6638
+ for (let k = 0; k < length; k++) {
6639
+ if (j === k) continue;
6640
+ const b = instance[k];
6641
+ if (a === b || ao && typeof b === "object" && b !== null && deepCompareStrict(a, b)) {
6642
+ errors.push({
6643
+ instanceLocation,
6644
+ keyword: "uniqueItems",
6645
+ keywordLocation: `${schemaLocation}/uniqueItems`,
6646
+ error: `Duplicate items at indexes ${j} and ${k}.`
6647
+ });
6648
+ j = Number.MAX_SAFE_INTEGER;
6649
+ k = Number.MAX_SAFE_INTEGER;
6650
+ }
6651
+ }
6652
+ }
6653
+ } else if (instanceType === "number") {
6654
+ if (draft === "4") {
6655
+ if ($minimum !== void 0 && ($exclusiveMinimum === true && instance <= $minimum || instance < $minimum)) errors.push({
6656
+ instanceLocation,
6657
+ keyword: "minimum",
6658
+ keywordLocation: `${schemaLocation}/minimum`,
6659
+ error: `${instance} is less than ${$exclusiveMinimum ? "or equal to " : ""} ${$minimum}.`
6660
+ });
6661
+ if ($maximum !== void 0 && ($exclusiveMaximum === true && instance >= $maximum || instance > $maximum)) errors.push({
6662
+ instanceLocation,
6663
+ keyword: "maximum",
6664
+ keywordLocation: `${schemaLocation}/maximum`,
6665
+ error: `${instance} is greater than ${$exclusiveMaximum ? "or equal to " : ""} ${$maximum}.`
6666
+ });
6667
+ } else {
6668
+ if ($minimum !== void 0 && instance < $minimum) errors.push({
6669
+ instanceLocation,
6670
+ keyword: "minimum",
6671
+ keywordLocation: `${schemaLocation}/minimum`,
6672
+ error: `${instance} is less than ${$minimum}.`
6673
+ });
6674
+ if ($maximum !== void 0 && instance > $maximum) errors.push({
6675
+ instanceLocation,
6676
+ keyword: "maximum",
6677
+ keywordLocation: `${schemaLocation}/maximum`,
6678
+ error: `${instance} is greater than ${$maximum}.`
6679
+ });
6680
+ if ($exclusiveMinimum !== void 0 && instance <= $exclusiveMinimum) errors.push({
6681
+ instanceLocation,
6682
+ keyword: "exclusiveMinimum",
6683
+ keywordLocation: `${schemaLocation}/exclusiveMinimum`,
6684
+ error: `${instance} is less than ${$exclusiveMinimum}.`
6685
+ });
6686
+ if ($exclusiveMaximum !== void 0 && instance >= $exclusiveMaximum) errors.push({
6687
+ instanceLocation,
6688
+ keyword: "exclusiveMaximum",
6689
+ keywordLocation: `${schemaLocation}/exclusiveMaximum`,
6690
+ error: `${instance} is greater than or equal to ${$exclusiveMaximum}.`
6691
+ });
6692
+ }
6693
+ if ($multipleOf !== void 0) {
6694
+ const remainder = instance % $multipleOf;
6695
+ if (Math.abs(0 - remainder) >= 1.1920929e-7 && Math.abs($multipleOf - remainder) >= 1.1920929e-7) errors.push({
6696
+ instanceLocation,
6697
+ keyword: "multipleOf",
6698
+ keywordLocation: `${schemaLocation}/multipleOf`,
6699
+ error: `${instance} is not a multiple of ${$multipleOf}.`
6700
+ });
6701
+ }
6702
+ } else if (instanceType === "string") {
6703
+ const length = $minLength === void 0 && $maxLength === void 0 ? 0 : ucs2length(instance);
6704
+ if ($minLength !== void 0 && length < $minLength) errors.push({
6705
+ instanceLocation,
6706
+ keyword: "minLength",
6707
+ keywordLocation: `${schemaLocation}/minLength`,
6708
+ error: `String is too short (${length} < ${$minLength}).`
6709
+ });
6710
+ if ($maxLength !== void 0 && length > $maxLength) errors.push({
6711
+ instanceLocation,
6712
+ keyword: "maxLength",
6713
+ keywordLocation: `${schemaLocation}/maxLength`,
6714
+ error: `String is too long (${length} > ${$maxLength}).`
6715
+ });
6716
+ if ($pattern !== void 0 && !new RegExp($pattern, "u").test(instance)) errors.push({
6717
+ instanceLocation,
6718
+ keyword: "pattern",
6719
+ keywordLocation: `${schemaLocation}/pattern`,
6720
+ error: `String does not match pattern.`
6721
+ });
6722
+ if ($format !== void 0 && format[$format] && !format[$format](instance)) errors.push({
6723
+ instanceLocation,
6724
+ keyword: "format",
6725
+ keywordLocation: `${schemaLocation}/format`,
6726
+ error: `String does not match format "${$format}".`
6727
+ });
6728
+ }
6729
+ return {
6730
+ valid: errors.length === 0,
6731
+ errors
6732
+ };
6733
+ }
6734
+ //#endregion
6735
+ //#region ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/validator.js
6736
+ var Validator = class {
6737
+ schema;
6738
+ draft;
6739
+ shortCircuit;
6740
+ lookup;
6741
+ constructor(schema, draft = "2019-09", shortCircuit = true) {
6742
+ this.schema = schema;
6743
+ this.draft = draft;
6744
+ this.shortCircuit = shortCircuit;
6745
+ this.lookup = dereference(schema);
6746
+ }
6747
+ validate(instance) {
6748
+ return validate(instance, this.schema, this.draft, this.lookup, this.shortCircuit);
6749
+ }
6750
+ addSchema(schema, id) {
6751
+ if (id) schema = {
6752
+ ...schema,
6753
+ $id: id
6754
+ };
6755
+ dereference(schema, this.lookup);
6756
+ }
6757
+ };
6758
+ //#endregion
5879
6759
  //#region src/json-schema-subset/utils.ts
5880
6760
  var nextId = 0;
5881
6761
  function createId() {
@@ -7829,6 +8709,7 @@ function schemaEqualsChecker(extendsContext) {
7829
8709
  if (value1 === null || value2 === null) return false;
7830
8710
  if (typeof value1 !== "object") return false;
7831
8711
  if (typeof value1 !== typeof value2) return false;
8712
+ if (extendsContext.isExtendsSchema(value1) || extendsContext.isExtendsSchema(value2)) return extendsContext.equals(value1, value2);
7832
8713
  if (isCompiledSchema(value1) && isCompiledSchema(value2)) return isCompiledSchemaEquals(value1, value2);
7833
8714
  return isObjectLikeEquals(value1, value2);
7834
8715
  }
@@ -8558,10 +9439,17 @@ var SingleSelectSchema = class SingleSelectSchema extends SpecialSchema {
8558
9439
  }
8559
9440
  constructor(id, value, context) {
8560
9441
  if (!SingleSelectSchema.isMatch(value)) throw new TypeError("Invalid single-select schema.");
8561
- super(id, value, context);
9442
+ const validator = new Validator(structuredClone(value), "7");
9443
+ super(id, { enum: value.enum.filter((item) => validator.validate(item).valid) }, context);
8562
9444
  }
8563
9445
  compareImpl(other) {
8564
- if (isStringLikeSchema(other)) return [ExpressionSingleResult.ContainedBy];
9446
+ if (this.value.enum.length == 0) return [(other instanceof SingleSelectSchema ? other.value.enum.length == 0 : isCompiledSchema(other) && getKind(other) === CompiledKind.Never) ? ExpressionSingleResult.Equals : ExpressionSingleResult.ContainedBy];
9447
+ if (isStringLikeSchema(other)) {
9448
+ const validator = new Validator(structuredClone(other), "7");
9449
+ const accepted = this.value.enum.filter((item) => validator.validate(item).valid).length;
9450
+ if (accepted == this.value.enum.length) return [ExpressionSingleResult.ContainedBy];
9451
+ return [accepted == 0 ? ExpressionSingleResult.Rejection : ExpressionSingleResult.Intersection];
9452
+ }
8565
9453
  if (other instanceof SingleSelectSchema) {
8566
9454
  const f = new Set(this.value.enum);
8567
9455
  let result = ExpressionSingleResult.Equals;