@oomol-lab/open-flow 0.1.0-beta.30 → 0.1.0-beta.31

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.
@@ -3711,7 +3711,7 @@ function po(e) {
3711
3711
  external: e?.external ?? void 0
3712
3712
  };
3713
3713
  }
3714
- function k(e, t, n, r, i) {
3714
+ function mo(e, t, n, r, i) {
3715
3715
  let a = typeof t.unrepresentable == "function" ? t.unrepresentable({
3716
3716
  zodSchema: e,
3717
3717
  path: r.path,
@@ -3721,7 +3721,7 @@ function k(e, t, n, r, i) {
3721
3721
  if (a === void 0 || a === "throw") throw Error(i);
3722
3722
  return Object.assign(n, a), !0;
3723
3723
  }
3724
- function A(e, t, n = {
3724
+ function k(e, t, n = {
3725
3725
  path: [],
3726
3726
  schemaPath: []
3727
3727
  }) {
@@ -3750,15 +3750,15 @@ function A(e, t, n = {
3750
3750
  a(e, t, n, r);
3751
3751
  }
3752
3752
  let a = e._zod.parent;
3753
- a && (o.ref ||= a, A(a, t, r), t.seen.get(a).isParent = !0);
3753
+ a && (o.ref ||= a, k(a, t, r), t.seen.get(a).isParent = !0);
3754
3754
  }
3755
3755
  let c = t.metadataRegistry.get(e);
3756
- return c && fo(o.schema, c), t.io === "input" && j(e) && (delete o.schema.examples, delete o.schema.default), t.io === "input" && "_prefault" in o.schema && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema;
3756
+ return c && fo(o.schema, c), t.io === "input" && A(e) && (delete o.schema.examples, delete o.schema.default), t.io === "input" && "_prefault" in o.schema && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema;
3757
3757
  }
3758
- function mo(e) {
3758
+ function ho(e) {
3759
3759
  return e.replace(/~/g, "~0").replace(/\//g, "~1");
3760
3760
  }
3761
- function ho(e, t) {
3761
+ function go(e, t) {
3762
3762
  let n = e.seen.get(t);
3763
3763
  if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
3764
3764
  if (e.external && e.sharedDefsExtractedFor === e.external) return;
@@ -3779,7 +3779,7 @@ function ho(e, t) {
3779
3779
  let a = t[1].defId ?? t[1].schema.id ?? `schema${e.counter++}`;
3780
3780
  return t[1].defId = a, {
3781
3781
  defId: a,
3782
- ref: `${i("__shared")}#/${r}/${mo(a)}`
3782
+ ref: `${i("__shared")}#/${r}/${ho(a)}`
3783
3783
  };
3784
3784
  }
3785
3785
  let i = `#/${r}/`;
@@ -3787,7 +3787,7 @@ function ho(e, t) {
3787
3787
  let a = t[1].schema.id ?? `__schema${e.counter++}`;
3788
3788
  return {
3789
3789
  defId: a,
3790
- ref: i + mo(a)
3790
+ ref: i + ho(a)
3791
3791
  };
3792
3792
  }, a = (e) => {
3793
3793
  if (e[1].schema.$ref) return;
@@ -3831,13 +3831,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3831
3831
  }
3832
3832
  e.external && (e.sharedDefsExtractedFor = e.external);
3833
3833
  }
3834
- function go(e) {
3834
+ function _o(e) {
3835
3835
  let t = e.anyOf;
3836
3836
  if (!Array.isArray(t) || t.length === 0 || e.type !== void 0) return;
3837
3837
  let n = [];
3838
3838
  for (let e of t) {
3839
3839
  if (!e || typeof e != "object") return;
3840
- go(e);
3840
+ _o(e);
3841
3841
  let t = Object.keys(e);
3842
3842
  if (t.length !== 1 || t[0] !== "type") return;
3843
3843
  let r = e.type;
@@ -3848,21 +3848,21 @@ function go(e) {
3848
3848
  }
3849
3849
  delete e.anyOf, e.type = n.length === 1 ? n[0] : n;
3850
3850
  }
3851
- var _o = /* @__PURE__ */ new Set([
3851
+ var vo = /* @__PURE__ */ new Set([
3852
3852
  "type",
3853
3853
  "properties",
3854
3854
  "required",
3855
3855
  "additionalProperties"
3856
- ]), vo = ["oneOf", "anyOf"];
3857
- function yo(e) {
3856
+ ]), yo = ["oneOf", "anyOf"];
3857
+ function bo(e) {
3858
3858
  let t = e.additionalProperties;
3859
3859
  return t === void 0 || t === !1 || typeof t != "object" || !t ? null : Object.keys(t).length ? t : null;
3860
3860
  }
3861
- function bo(e) {
3861
+ function xo(e) {
3862
3862
  let t = [];
3863
3863
  for (let n of e) {
3864
3864
  if (typeof n != "object" || n.type !== "object") return null;
3865
- for (let e in n) if (!_o.has(e)) return null;
3865
+ for (let e in n) if (!vo.has(e)) return null;
3866
3866
  t.push(n);
3867
3867
  }
3868
3868
  let n = {}, r = /* @__PURE__ */ new Set();
@@ -3871,10 +3871,10 @@ function bo(e) {
3871
3871
  if (Object.prototype.hasOwnProperty.call(n, r)) continue;
3872
3872
  let e = [];
3873
3873
  for (let n of t) {
3874
- let t = n.properties?.[r] ?? yo(n);
3874
+ let t = n.properties?.[r] ?? bo(n);
3875
3875
  t != null && (e.some((e) => JSON.stringify(e) === JSON.stringify(t)) || e.push(t));
3876
3876
  }
3877
- _(n, r, e.length === 1 ? e[0] : bo(e) ?? { allOf: e });
3877
+ _(n, r, e.length === 1 ? e[0] : xo(e) ?? { allOf: e });
3878
3878
  }
3879
3879
  for (let t of e.required ?? []) r.add(t);
3880
3880
  }
@@ -3886,29 +3886,29 @@ function bo(e) {
3886
3886
  else {
3887
3887
  let e = [];
3888
3888
  for (let n of t) {
3889
- let t = yo(n);
3889
+ let t = bo(n);
3890
3890
  t && !e.some((e) => JSON.stringify(e) === JSON.stringify(t)) && e.push(t);
3891
3891
  }
3892
3892
  e.length === 1 ? i.additionalProperties = e[0] : e.length > 1 && (i.additionalProperties = { allOf: e });
3893
3893
  }
3894
3894
  return i;
3895
3895
  }
3896
- function xo(e) {
3896
+ function So(e) {
3897
3897
  let t = e.allOf;
3898
3898
  if (!Array.isArray(t) || t.length < 2) return;
3899
- for (let t of _o) if (t in e) return;
3900
- let n = t.filter((e) => vo.some((t) => Array.isArray(e[t]))), r = null;
3901
- if (!n.length) r = bo(t);
3899
+ for (let t of vo) if (t in e) return;
3900
+ let n = t.filter((e) => yo.some((t) => Array.isArray(e[t]))), r = null;
3901
+ if (!n.length) r = xo(t);
3902
3902
  else {
3903
- let e = n[0], i = vo.find((t) => Array.isArray(e[t]));
3903
+ let e = n[0], i = yo.find((t) => Array.isArray(e[t]));
3904
3904
  if (Object.keys(e).length !== 1) return;
3905
- let a = t.filter((t) => t !== e), o = e[i].map((e) => bo([...a, e]));
3905
+ let a = t.filter((t) => t !== e), o = e[i].map((e) => xo([...a, e]));
3906
3906
  if (o.some((e) => !e)) return;
3907
3907
  r = { [i]: o };
3908
3908
  }
3909
3909
  r && (delete e.allOf, fo(e, r));
3910
3910
  }
3911
- function So(e, t) {
3911
+ function Co(e, t) {
3912
3912
  let n = e.seen.get(t);
3913
3913
  if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
3914
3914
  let r = (t) => {
@@ -3935,7 +3935,7 @@ function So(e, t) {
3935
3935
  };
3936
3936
  if (!e.external || e.sharedEmitDoneFor !== e.external) {
3937
3937
  for (let t of [...e.seen.entries()].reverse()) r(t[0]);
3938
- if (e.target !== "openapi-3.0") for (let t of e.seen.entries()) go(t[1].def ?? t[1].schema);
3938
+ if (e.target !== "openapi-3.0") for (let t of e.seen.entries()) _o(t[1].def ?? t[1].schema);
3939
3939
  for (let t of e.deferred) t();
3940
3940
  if (e.intersections.length) {
3941
3941
  let t = /* @__PURE__ */ new Map();
@@ -3945,7 +3945,7 @@ function So(e, t) {
3945
3945
  let r = t.get(n);
3946
3946
  r ? r.push(e) : t.set(n, [e]);
3947
3947
  }
3948
- for (let n of e.intersections) for (let e of t.get(n) ?? []) xo(e);
3948
+ for (let n of e.intersections) for (let e of t.get(n) ?? []) So(e);
3949
3949
  }
3950
3950
  }
3951
3951
  let i = {};
@@ -3969,8 +3969,8 @@ function So(e, t) {
3969
3969
  value: {
3970
3970
  ...t["~standard"],
3971
3971
  jsonSchema: {
3972
- input: wo(t, "input", e.processors),
3973
- output: wo(t, "output", e.processors)
3972
+ input: To(t, "input", e.processors),
3973
+ output: To(t, "output", e.processors)
3974
3974
  }
3975
3975
  },
3976
3976
  enumerable: !1,
@@ -3980,83 +3980,83 @@ function So(e, t) {
3980
3980
  throw Error("Error converting schema to JSON.");
3981
3981
  }
3982
3982
  }
3983
- function j(e, t) {
3983
+ function A(e, t) {
3984
3984
  let n = t ?? { seen: /* @__PURE__ */ new Set() };
3985
3985
  if (n.seen.has(e)) return !1;
3986
3986
  n.seen.add(e);
3987
3987
  let r = e._zod.def;
3988
3988
  if (r.type === "transform") return !0;
3989
- if (r.type === "array") return j(r.element, n);
3990
- if (r.type === "set") return j(r.valueType, n);
3991
- if (r.type === "lazy") return j(r.getter(), n);
3992
- if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault" || r.type === "catch") return j(r.innerType, n);
3993
- if (r.type === "intersection") return j(r.left, n) || j(r.right, n);
3994
- if (r.type === "record" || r.type === "map") return j(r.keyType, n) || j(r.valueType, n);
3995
- if (r.type === "pipe") return e._zod.traits.has("$ZodCodec") ? !0 : j(r.in, n) || j(r.out, n);
3989
+ if (r.type === "array") return A(r.element, n);
3990
+ if (r.type === "set") return A(r.valueType, n);
3991
+ if (r.type === "lazy") return A(r.getter(), n);
3992
+ if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault" || r.type === "catch") return A(r.innerType, n);
3993
+ if (r.type === "intersection") return A(r.left, n) || A(r.right, n);
3994
+ if (r.type === "record" || r.type === "map") return A(r.keyType, n) || A(r.valueType, n);
3995
+ if (r.type === "pipe") return e._zod.traits.has("$ZodCodec") ? !0 : A(r.in, n) || A(r.out, n);
3996
3996
  if (r.type === "object") {
3997
- for (let e in r.shape) if (j(r.shape[e], n)) return !0;
3997
+ for (let e in r.shape) if (A(r.shape[e], n)) return !0;
3998
3998
  return !1;
3999
3999
  }
4000
4000
  if (r.type === "union") {
4001
- for (let e of r.options) if (j(e, n)) return !0;
4001
+ for (let e of r.options) if (A(e, n)) return !0;
4002
4002
  return !1;
4003
4003
  }
4004
4004
  if (r.type === "tuple") {
4005
- for (let e of r.items) if (j(e, n)) return !0;
4006
- return !!(r.rest && j(r.rest, n));
4005
+ for (let e of r.items) if (A(e, n)) return !0;
4006
+ return !!(r.rest && A(r.rest, n));
4007
4007
  }
4008
4008
  return !1;
4009
4009
  }
4010
- var Co = (e, t = {}) => (n) => {
4010
+ var wo = (e, t = {}) => (n) => {
4011
4011
  let r = po({
4012
4012
  ...n,
4013
4013
  processors: t
4014
4014
  });
4015
- return A(e, r), ho(r, e), So(r, e);
4016
- }, wo = (e, t, n = {}) => (r) => {
4015
+ return k(e, r), go(r, e), Co(r, e);
4016
+ }, To = (e, t, n = {}) => (r) => {
4017
4017
  let { libraryOptions: i, target: a } = r ?? {}, o = po({
4018
4018
  ...i ?? {},
4019
4019
  target: a,
4020
4020
  io: t,
4021
4021
  processors: n
4022
4022
  });
4023
- return A(e, o), ho(o, e), So(o, e);
4024
- }, To = {
4023
+ return k(e, o), go(o, e), Co(o, e);
4024
+ }, Eo = {
4025
4025
  guid: "uuid",
4026
4026
  url: "uri",
4027
4027
  datetime: "date-time",
4028
4028
  json_string: "json-string",
4029
4029
  regex: ""
4030
- }, Eo = (e, t, n, r) => {
4030
+ }, Do = (e, t, n, r) => {
4031
4031
  let i = n;
4032
4032
  i.type = "string";
4033
4033
  let { minimum: a, maximum: o, format: s, patterns: c, contentEncoding: l, laxFormat: u } = e._zod.bag;
4034
- if (typeof a == "number" && (i.minLength = a), typeof o == "number" && (i.maxLength = o), s && (i.format = To[s] ?? s, i.format === "" && delete i.format, (s === "time" || u) && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) {
4034
+ if (typeof a == "number" && (i.minLength = a), typeof o == "number" && (i.maxLength = o), s && (i.format = Eo[s] ?? s, i.format === "" && delete i.format, (s === "time" || u) && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) {
4035
4035
  let e = [...c];
4036
4036
  e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({
4037
4037
  ...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
4038
4038
  pattern: e.source
4039
4039
  }))]);
4040
4040
  }
4041
- }, Do = (e, t, n, r) => {
4041
+ }, Oo = (e, t, n, r) => {
4042
4042
  let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag;
4043
4043
  i.type = typeof s == "string" && s.includes("int") ? "integer" : "number";
4044
4044
  let d = typeof u == "number" && u >= (a ?? -Infinity), f = typeof l == "number" && l <= (o ?? Infinity), p = t.target === "draft-04" || t.target === "openapi-3.0";
4045
- d ? p ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u : typeof a == "number" && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof o == "number" && (i.maximum = o), typeof c == "number" && (Number.isFinite(c) && c !== 0 ? i.multipleOf = Math.abs(c) : k(e, t, i, r, `A multipleOf divisor of ${c} cannot be represented in JSON Schema`));
4046
- }, Oo = (e, t, n, r) => {
4047
- n.type = "boolean";
4045
+ d ? p ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u : typeof a == "number" && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof o == "number" && (i.maximum = o), typeof c == "number" && (Number.isFinite(c) && c !== 0 ? i.multipleOf = Math.abs(c) : mo(e, t, i, r, `A multipleOf divisor of ${c} cannot be represented in JSON Schema`));
4048
4046
  }, ko = (e, t, n, r) => {
4049
- t.target === "openapi-3.0" ? (n.type = "string", n.nullable = !0, n.enum = [null]) : n.type = "null";
4047
+ n.type = "boolean";
4050
4048
  }, Ao = (e, t, n, r) => {
4051
- n.not = {};
4049
+ t.target === "openapi-3.0" ? (n.type = "string", n.nullable = !0, n.enum = [null]) : n.type = "null";
4052
4050
  }, jo = (e, t, n, r) => {
4051
+ n.not = {};
4052
+ }, Mo = (e, t, n, r) => {
4053
4053
  let i = e._zod.def, a = Ge(i.entries);
4054
4054
  if (a.length === 0) {
4055
4055
  n.not = {};
4056
4056
  return;
4057
4057
  }
4058
4058
  a.every((e) => typeof e == "number") && (n.type = "number"), a.every((e) => typeof e == "string") && (n.type = "string"), n.enum = a;
4059
- }, Mo = (e, t, n, r) => {
4059
+ }, No = (e, t, n, r) => {
4060
4060
  let i = e._zod.def;
4061
4061
  if (i.values.length === 0) {
4062
4062
  n.not = {};
@@ -4064,9 +4064,9 @@ var Co = (e, t = {}) => (n) => {
4064
4064
  }
4065
4065
  let a = [];
4066
4066
  for (let o of i.values) if (o === void 0) {
4067
- if (k(e, t, n, r, "Literal `undefined` cannot be represented in JSON Schema")) return;
4067
+ if (mo(e, t, n, r, "Literal `undefined` cannot be represented in JSON Schema")) return;
4068
4068
  } else if (typeof o == "bigint") {
4069
- if (k(e, t, n, r, "BigInt literals cannot be represented in JSON Schema")) return;
4069
+ if (mo(e, t, n, r, "BigInt literals cannot be represented in JSON Schema")) return;
4070
4070
  a.push(Number(o));
4071
4071
  } else a.push(o);
4072
4072
  if (a.length !== 0) {
@@ -4075,26 +4075,26 @@ var Co = (e, t = {}) => (n) => {
4075
4075
  n.type = e === null ? "null" : typeof e, t.target === "draft-04" || t.target === "openapi-3.0" ? n.enum = [e] : n.const = e;
4076
4076
  } else a.every((e) => typeof e == "number") && (n.type = "number"), a.every((e) => typeof e == "string") && (n.type = "string"), a.every((e) => typeof e == "boolean") && (n.type = "boolean"), a.every((e) => e === null) && (n.type = "null"), n.enum = a;
4077
4077
  }
4078
- }, No = (e, t, n, r) => {
4079
- k(e, t, n, r, "Custom types cannot be represented in JSON Schema");
4080
4078
  }, Po = (e, t, n, r) => {
4081
- k(e, t, n, r, "Transforms cannot be represented in JSON Schema");
4079
+ mo(e, t, n, r, "Custom types cannot be represented in JSON Schema");
4082
4080
  }, Fo = (e, t, n, r) => {
4081
+ mo(e, t, n, r, "Transforms cannot be represented in JSON Schema");
4082
+ }, Io = (e, t, n, r) => {
4083
4083
  let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag;
4084
- typeof o == "number" && (i.minItems = o), typeof s == "number" && (i.maxItems = s), i.type = "array", i.items = A(a.element, t, {
4084
+ typeof o == "number" && (i.minItems = o), typeof s == "number" && (i.maxItems = s), i.type = "array", i.items = k(a.element, t, {
4085
4085
  ...r,
4086
4086
  path: [...r.path, "items"]
4087
4087
  });
4088
4088
  };
4089
- function Io(e) {
4089
+ function Lo(e) {
4090
4090
  let t = e._zod.def;
4091
- return t.type === "pipe" && t.in._zod.traits.has("$ZodTransform") ? Io(t.out) : t.type === "catch" ? Io(t.innerType) : e._zod.optin;
4091
+ return t.type === "pipe" && t.in._zod.traits.has("$ZodTransform") ? Lo(t.out) : t.type === "catch" ? Lo(t.innerType) : e._zod.optin;
4092
4092
  }
4093
- var Lo = (e, t, n, r) => {
4093
+ var Ro = (e, t, n, r) => {
4094
4094
  let i = n, a = e._zod.def, o = a.shape;
4095
- if (Object.getOwnPropertySymbols(o).length && k(e, t, i, r, "Symbol keys cannot be represented in JSON Schema")) return;
4095
+ if (Object.getOwnPropertySymbols(o).length && mo(e, t, i, r, "Symbol keys cannot be represented in JSON Schema")) return;
4096
4096
  i.type = "object", i.properties = {};
4097
- for (let e in o) _(i.properties, e, A(o[e], t, {
4097
+ for (let e in o) _(i.properties, e, k(o[e], t, {
4098
4098
  ...r,
4099
4099
  path: [
4100
4100
  ...r.path,
@@ -4104,14 +4104,14 @@ var Lo = (e, t, n, r) => {
4104
4104
  }));
4105
4105
  let s = new Set(Object.keys(o)), c = new Set([...s].filter((e) => {
4106
4106
  let n = a.shape[e];
4107
- return t.io === "input" ? Io(n) === void 0 : n._zod.optout === void 0;
4107
+ return t.io === "input" ? Lo(n) === void 0 : n._zod.optout === void 0;
4108
4108
  }));
4109
- c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = A(a.catchall, t, {
4109
+ c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = k(a.catchall, t, {
4110
4110
  ...r,
4111
4111
  path: [...r.path, "additionalProperties"]
4112
4112
  })) : t.io === "output" && (i.additionalProperties = !1);
4113
- }, Ro = (e, t, n, r) => {
4114
- let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => A(e, t, {
4113
+ }, zo = (e, t, n, r) => {
4114
+ let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => k(e, t, {
4115
4115
  ...r,
4116
4116
  path: [
4117
4117
  ...r.path,
@@ -4120,15 +4120,15 @@ var Lo = (e, t, n, r) => {
4120
4120
  ]
4121
4121
  }));
4122
4122
  a ? n.oneOf = o : n.anyOf = o;
4123
- }, zo = (e, t, n, r) => {
4124
- let i = e._zod.def, a = A(i.left, t, {
4123
+ }, Bo = (e, t, n, r) => {
4124
+ let i = e._zod.def, a = k(i.left, t, {
4125
4125
  ...r,
4126
4126
  path: [
4127
4127
  ...r.path,
4128
4128
  "allOf",
4129
4129
  0
4130
4130
  ]
4131
- }), o = A(i.right, t, {
4131
+ }), o = k(i.right, t, {
4132
4132
  ...r,
4133
4133
  path: [
4134
4134
  ...r.path,
@@ -4138,19 +4138,19 @@ var Lo = (e, t, n, r) => {
4138
4138
  }), s = (e) => "allOf" in e && Object.keys(e).length === 1, c = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]];
4139
4139
  n.allOf = c, t.intersections.push(c);
4140
4140
  };
4141
- function Bo(e, t, n) {
4141
+ function Vo(e, t, n) {
4142
4142
  if (t.$ref) {
4143
4143
  if (n.has(t)) return t;
4144
4144
  n.add(t);
4145
4145
  let r = e.get(t)?.def;
4146
4146
  if (!r) return t;
4147
- let i = Bo(e, r, n);
4147
+ let i = Vo(e, r, n);
4148
4148
  return i === r ? t : i;
4149
4149
  }
4150
4150
  for (let r of ["anyOf", "oneOf"]) {
4151
4151
  let i = t[r];
4152
4152
  if (!Array.isArray(i)) continue;
4153
- let a = i.map((t) => Bo(e, t, n));
4153
+ let a = i.map((t) => Vo(e, t, n));
4154
4154
  a.some((e, t) => e !== i[t]) && (t = {
4155
4155
  ...t,
4156
4156
  [r]: a
@@ -4161,15 +4161,15 @@ function Bo(e, t, n) {
4161
4161
  let { minimum: o, maximum: s, exclusiveMinimum: c, exclusiveMaximum: l, multipleOf: u, format: d, id: f, ...p } = t;
4162
4162
  return p.enum ? p.enum = p.enum.map((e) => typeof e == "number" ? String(e) : e) : typeof p.const == "number" && (p.const = String(p.const)), i ? (p.type = "string", a || (p.pattern = (r.includes("number") ? Yn : Jn).source), p) : p;
4163
4163
  }
4164
- var Vo = /* @__PURE__ */ new WeakMap();
4165
- function Ho(e) {
4164
+ var Ho = /* @__PURE__ */ new WeakMap();
4165
+ function Uo(e) {
4166
4166
  let t = /* @__PURE__ */ new Map();
4167
4167
  for (let n of e.seen.values()) n.def && !t.has(n.schema) && t.set(n.schema, n);
4168
4168
  let n = /* @__PURE__ */ new Map();
4169
- for (let r of Vo.get(e) ?? []) {
4169
+ for (let r of Ho.get(e) ?? []) {
4170
4170
  let i = e.seen.get(r), a = (i?.def ?? i?.schema)?.propertyNames;
4171
4171
  if (!a || a === !0 || n.has(a)) continue;
4172
- let o = Bo(t, a, /* @__PURE__ */ new Set());
4172
+ let o = Vo(t, a, /* @__PURE__ */ new Set());
4173
4173
  o !== a && n.set(a, o);
4174
4174
  }
4175
4175
  if (n.size) for (let t of e.seen.values()) for (let e of [t.schema, t.def]) {
@@ -4177,12 +4177,12 @@ function Ho(e) {
4177
4177
  t && (e.propertyNames = t);
4178
4178
  }
4179
4179
  }
4180
- var Uo = (e, t, n, r) => {
4180
+ var Wo = (e, t, n, r) => {
4181
4181
  let i = n, a = e._zod.def;
4182
4182
  i.type = "object";
4183
4183
  let o = a.keyType, s = o._zod.bag?.patterns;
4184
4184
  if (a.mode === "loose" && s && s.size > 0) {
4185
- let e = A(a.valueType, t, {
4185
+ let e = k(a.valueType, t, {
4186
4186
  ...r,
4187
4187
  path: [
4188
4188
  ...r.path,
@@ -4194,85 +4194,85 @@ var Uo = (e, t, n, r) => {
4194
4194
  for (let t of s) _(i.patternProperties, t.source, e);
4195
4195
  } else {
4196
4196
  if (t.target === "draft-07" || t.target === "draft-2020-12") {
4197
- i.propertyNames = A(a.keyType, t, {
4197
+ i.propertyNames = k(a.keyType, t, {
4198
4198
  ...r,
4199
4199
  path: [...r.path, "propertyNames"]
4200
4200
  });
4201
- let n = Vo.get(t);
4202
- n || (n = [], Vo.set(t, n), t.deferred.push(() => Ho(t))), n.push(e);
4201
+ let n = Ho.get(t);
4202
+ n || (n = [], Ho.set(t, n), t.deferred.push(() => Uo(t))), n.push(e);
4203
4203
  }
4204
- i.additionalProperties = A(a.valueType, t, {
4204
+ i.additionalProperties = k(a.valueType, t, {
4205
4205
  ...r,
4206
4206
  path: [...r.path, "additionalProperties"]
4207
4207
  });
4208
4208
  }
4209
- let c = o._zod.values, l = t.io === "input" && Io(a.valueType) !== void 0;
4209
+ let c = o._zod.values, l = t.io === "input" && Lo(a.valueType) !== void 0;
4210
4210
  if (c && !a.partial && !l) {
4211
4211
  let e = [...c].filter((e) => typeof e == "string" || typeof e == "number");
4212
4212
  e.length > 0 && (i.required = e.map(String));
4213
4213
  }
4214
- }, Wo = (e, t, n, r) => {
4215
- let i = e._zod.def, a = A(i.innerType, t, r), o = t.seen.get(e);
4216
- t.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: "null" }];
4217
4214
  }, Go = (e, t, n, r) => {
4215
+ let i = e._zod.def, a = k(i.innerType, t, r), o = t.seen.get(e);
4216
+ t.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: "null" }];
4217
+ }, Ko = (e, t, n, r) => {
4218
4218
  let i = e._zod.def;
4219
- A(i.innerType, t, r);
4219
+ k(i.innerType, t, r);
4220
4220
  let a = t.seen.get(e);
4221
4221
  a.ref = i.innerType;
4222
- }, Ko = Symbol();
4223
- function qo(e, t, n, r, i) {
4222
+ }, qo = Symbol();
4223
+ function Jo(e, t, n, r, i) {
4224
4224
  let a = !1, o = JSON.stringify(e, (e, t) => typeof t == "bigint" ? (a = !0, null) : t);
4225
- return a ? (k(t, n, r, i, "BigInt defaults cannot be represented in JSON Schema"), Ko) : JSON.parse(o);
4225
+ return a ? (mo(t, n, r, i, "BigInt defaults cannot be represented in JSON Schema"), qo) : JSON.parse(o);
4226
4226
  }
4227
- var Jo = (e, t, n, r) => {
4227
+ var Yo = (e, t, n, r) => {
4228
4228
  let i = e._zod.def;
4229
- A(i.innerType, t, r);
4229
+ k(i.innerType, t, r);
4230
4230
  let a = t.seen.get(e);
4231
4231
  a.ref = i.innerType;
4232
- let o = qo(i.defaultValue, e, t, n, r);
4233
- o !== Ko && (n.default = o);
4234
- }, Yo = (e, t, n, r) => {
4232
+ let o = Jo(i.defaultValue, e, t, n, r);
4233
+ o !== qo && (n.default = o);
4234
+ }, Xo = (e, t, n, r) => {
4235
4235
  let i = e._zod.def;
4236
- A(i.innerType, t, r);
4236
+ k(i.innerType, t, r);
4237
4237
  let a = t.seen.get(e);
4238
4238
  if (a.ref = i.innerType, t.io !== "input") return;
4239
- let o = qo(i.defaultValue, e, t, n, r);
4240
- o !== Ko && (n._prefault = o);
4241
- }, Xo = (e, t, n, r) => {
4239
+ let o = Jo(i.defaultValue, e, t, n, r);
4240
+ o !== qo && (n._prefault = o);
4241
+ }, Zo = (e, t, n, r) => {
4242
4242
  let i = e._zod.def;
4243
- A(i.innerType, t, r);
4243
+ k(i.innerType, t, r);
4244
4244
  let a = t.seen.get(e);
4245
4245
  a.ref = i.innerType;
4246
4246
  let o;
4247
4247
  try {
4248
4248
  o = i.catchValue(void 0);
4249
4249
  } catch {
4250
- k(e, t, n, r, "Dynamic catch values are not supported in JSON Schema");
4250
+ mo(e, t, n, r, "Dynamic catch values are not supported in JSON Schema");
4251
4251
  return;
4252
4252
  }
4253
4253
  n.default = o;
4254
- }, Zo = (e, t, n, r) => {
4254
+ }, Qo = (e, t, n, r) => {
4255
4255
  let i = e._zod.def, a = i.in._zod.traits.has("$ZodTransform"), o = t.io === "input" ? a ? i.out : i.in : i.out;
4256
- A(o, t, r);
4256
+ k(o, t, r);
4257
4257
  let s = t.seen.get(e);
4258
4258
  s.ref = o;
4259
- }, Qo = (e, t, n, r) => {
4259
+ }, $o = (e, t, n, r) => {
4260
4260
  let i = e._zod.def;
4261
- A(i.innerType, t, r);
4261
+ k(i.innerType, t, r);
4262
4262
  let a = t.seen.get(e);
4263
4263
  a.ref = i.innerType, n.readOnly = !0;
4264
- }, $o = (e, t, n, r) => {
4264
+ }, es = (e, t, n, r) => {
4265
4265
  let i = e._zod.def;
4266
- A(i.innerType, t, r);
4266
+ k(i.innerType, t, r);
4267
4267
  let a = t.seen.get(e);
4268
4268
  a.ref = i.innerType;
4269
- }, es = (e, t, n, r) => {
4269
+ }, ts = (e, t, n, r) => {
4270
4270
  let i = e._zod.innerType;
4271
- A(i, t, r);
4271
+ k(i, t, r);
4272
4272
  let a = t.seen.get(e);
4273
4273
  a.ref = i;
4274
- }, ts = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
4275
- function ns(e, t, n) {
4274
+ }, ns = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
4275
+ function rs(e, t, n) {
4276
4276
  Object.defineProperty(e, t, {
4277
4277
  configurable: !0,
4278
4278
  enumerable: !1,
@@ -4293,12 +4293,12 @@ function ns(e, t, n) {
4293
4293
  }
4294
4294
  });
4295
4295
  }
4296
- var M = /*@__PURE__*/ C("ZodError", (e, t) => {
4296
+ var j = /*@__PURE__*/ C("ZodError", (e, t) => {
4297
4297
  $t.init(e, t), e.name = "ZodError";
4298
4298
  let n = Object.getPrototypeOf(e);
4299
- ts.has(n) || (ts.add(n), ns(n, "format", (e) => (t) => rn(e, t)), ns(n, "flatten", (e) => (t) => nn(e, t)), ns(n, "addIssue", (e) => (t) => {
4299
+ ns.has(n) || (ns.add(n), rs(n, "format", (e) => (t) => rn(e, t)), rs(n, "flatten", (e) => (t) => nn(e, t)), rs(n, "addIssue", (e) => (t) => {
4300
4300
  e.issues.push(t), e.message = JSON.stringify(e.issues, qe, 2);
4301
- }), ns(n, "addIssues", (e) => (t) => {
4301
+ }), rs(n, "addIssues", (e) => (t) => {
4302
4302
  e.issues.push(...t), e.message = JSON.stringify(e.issues, qe, 2);
4303
4303
  }), Object.defineProperty(n, "isEmpty", {
4304
4304
  configurable: !0,
@@ -4307,16 +4307,16 @@ var M = /*@__PURE__*/ C("ZodError", (e, t) => {
4307
4307
  return this.issues.length === 0;
4308
4308
  }
4309
4309
  }));
4310
- }, void 0, { Parent: Error }), rs = /* @__PURE__ */ on(M), is = /* @__PURE__ */ sn(M), as = /* @__PURE__ */ cn(M), os = /* @__PURE__ */ un(M), ss = /* @__PURE__ */ fn(M), cs = /* @__PURE__ */ pn(M), ls = /* @__PURE__ */ mn(M), us = /* @__PURE__ */ hn(M), ds = /* @__PURE__ */ gn(M), fs = /* @__PURE__ */ _n(M), ps = /* @__PURE__ */ vn(M), ms = /* @__PURE__ */ yn(M);
4310
+ }, void 0, { Parent: Error }), is = /* @__PURE__ */ on(j), as = /* @__PURE__ */ sn(j), os = /* @__PURE__ */ cn(j), ss = /* @__PURE__ */ un(j), cs = /* @__PURE__ */ fn(j), ls = /* @__PURE__ */ pn(j), us = /* @__PURE__ */ mn(j), ds = /* @__PURE__ */ hn(j), fs = /* @__PURE__ */ gn(j), ps = /* @__PURE__ */ _n(j), ms = /* @__PURE__ */ vn(j), hs = /* @__PURE__ */ yn(j);
4311
4311
  //#endregion
4312
4312
  //#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/schemas.js
4313
- function hs() {
4313
+ function gs() {
4314
4314
  w.localeError || T(ra());
4315
4315
  }
4316
- function gs() {
4316
+ function _s() {
4317
4317
  w.memoizer || T({ memoizer: ea() });
4318
4318
  }
4319
- var N = /*@__PURE__*/ C("ZodType", (e, t) => (hs(), D.init(e, t), e.def = t, e.type = t.type, e), {
4319
+ var M = /*@__PURE__*/ C("ZodType", (e, t) => (gs(), D.init(e, t), e.def = t, e.type = t.type, e), {
4320
4320
  check(...e) {
4321
4321
  let t = this.def;
4322
4322
  return this.clone(v(t, { checks: [...t.checks ?? [], ...e.map((e) => typeof e == "function" ? { _zod: {
@@ -4338,55 +4338,55 @@ var N = /*@__PURE__*/ C("ZodType", (e, t) => (hs(), D.init(e, t), e.def = t, e.t
4338
4338
  return e.add(this, t), this;
4339
4339
  },
4340
4340
  refine(e, t) {
4341
- return this.check(kc(e, t));
4341
+ return this.check(Ac(e, t));
4342
4342
  },
4343
4343
  superRefine(e, t) {
4344
- return this.check(Ac(e, t));
4344
+ return this.check(jc(e, t));
4345
4345
  },
4346
4346
  overwrite(e) {
4347
4347
  return this.check(/* @__PURE__ */ to(e));
4348
4348
  },
4349
4349
  optional() {
4350
- return lc(this);
4350
+ return uc(this);
4351
4351
  },
4352
4352
  exactOptional() {
4353
- return dc(this);
4353
+ return fc(this);
4354
4354
  },
4355
4355
  nullable() {
4356
- return pc(this);
4356
+ return mc(this);
4357
4357
  },
4358
4358
  nullish() {
4359
- return lc(pc(this));
4359
+ return uc(mc(this));
4360
4360
  },
4361
4361
  nonoptional(e) {
4362
- return yc(this, e);
4362
+ return bc(this, e);
4363
4363
  },
4364
4364
  array() {
4365
- return z(this);
4365
+ return R(this);
4366
4366
  },
4367
4367
  or(e) {
4368
- return V([this, e]);
4368
+ return B([this, e]);
4369
4369
  },
4370
4370
  and(e) {
4371
- return nc(this, e);
4371
+ return rc(this, e);
4372
4372
  },
4373
4373
  transform(e) {
4374
- return Cc(this, sc(e));
4374
+ return wc(this, cc(e));
4375
4375
  },
4376
4376
  default(e) {
4377
- return hc(this, e);
4377
+ return gc(this, e);
4378
4378
  },
4379
4379
  prefault(e) {
4380
- return _c(this, e);
4380
+ return vc(this, e);
4381
4381
  },
4382
4382
  catch(e) {
4383
- return xc(this, e);
4383
+ return Sc(this, e);
4384
4384
  },
4385
4385
  pipe(e) {
4386
- return Cc(this, e);
4386
+ return wc(this, e);
4387
4387
  },
4388
4388
  readonly() {
4389
- return Tc(this);
4389
+ return Ec(this);
4390
4390
  },
4391
4391
  describe(e) {
4392
4392
  let t = this.clone();
@@ -4410,8 +4410,8 @@ var N = /*@__PURE__*/ C("ZodType", (e, t) => (hs(), D.init(e, t), e.def = t, e.t
4410
4410
  return jt(this, "~standard", {
4411
4411
  ...br(this),
4412
4412
  jsonSchema: {
4413
- input: wo(this, "input"),
4414
- output: wo(this, "output")
4413
+ input: To(this, "input"),
4414
+ output: To(this, "output")
4415
4415
  }
4416
4416
  });
4417
4417
  },
@@ -4419,16 +4419,16 @@ var N = /*@__PURE__*/ C("ZodType", (e, t) => (hs(), D.init(e, t), e.def = t, e.t
4419
4419
  At(this, "~standard", e);
4420
4420
  },
4421
4421
  parse: function e(t, n) {
4422
- return rs(this, t, n, { callee: e });
4422
+ return is(this, t, n, { callee: e });
4423
4423
  },
4424
4424
  parseAsync: async function e(t, n) {
4425
- return await is(this, t, n, { callee: e });
4425
+ return await as(this, t, n, { callee: e });
4426
4426
  },
4427
4427
  safeParse(e, t) {
4428
- return as(this, e, t);
4428
+ return os(this, e, t);
4429
4429
  },
4430
4430
  async safeParseAsync(e, t) {
4431
- return os(this, e, t);
4431
+ return ss(this, e, t);
4432
4432
  },
4433
4433
  get spa() {
4434
4434
  return this?.safeParseAsync;
@@ -4437,31 +4437,31 @@ var N = /*@__PURE__*/ C("ZodType", (e, t) => (hs(), D.init(e, t), e.def = t, e.t
4437
4437
  At(this, "spa", e);
4438
4438
  },
4439
4439
  encode: function e(t, n) {
4440
- return ss(this, t, n, { callee: e });
4440
+ return cs(this, t, n, { callee: e });
4441
4441
  },
4442
4442
  decode: function e(t, n) {
4443
- return cs(this, t, n, { callee: e });
4443
+ return ls(this, t, n, { callee: e });
4444
4444
  },
4445
4445
  encodeAsync: async function e(t, n) {
4446
- return await ls(this, t, n, { callee: e });
4446
+ return await us(this, t, n, { callee: e });
4447
4447
  },
4448
4448
  decodeAsync: async function e(t, n) {
4449
- return await us(this, t, n, { callee: e });
4449
+ return await ds(this, t, n, { callee: e });
4450
4450
  },
4451
4451
  safeEncode(e, t) {
4452
- return ds(this, e, t);
4452
+ return fs(this, e, t);
4453
4453
  },
4454
4454
  safeDecode(e, t) {
4455
- return fs(this, e, t);
4455
+ return ps(this, e, t);
4456
4456
  },
4457
4457
  async safeEncodeAsync(e, t) {
4458
- return ps(this, e, t);
4458
+ return ms(this, e, t);
4459
4459
  },
4460
4460
  async safeDecodeAsync(e, t) {
4461
- return ms(this, e, t);
4461
+ return hs(this, e, t);
4462
4462
  },
4463
4463
  toJSONSchema(e) {
4464
- return Co(this, {})(e);
4464
+ return wo(this, {})(e);
4465
4465
  },
4466
4466
  get description() {
4467
4467
  return sa.get(this)?.description;
@@ -4469,8 +4469,8 @@ var N = /*@__PURE__*/ C("ZodType", (e, t) => (hs(), D.init(e, t), e.def = t, e.t
4469
4469
  get _def() {
4470
4470
  return this._zod.def;
4471
4471
  }
4472
- }), _s = /*@__PURE__*/ C("_ZodString", (e, t) => {
4473
- xr.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Eo(e, t, n, r);
4472
+ }), vs = /*@__PURE__*/ C("_ZodString", (e, t) => {
4473
+ xr.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Do(e, t, n, r);
4474
4474
  let n = e._zod.bag;
4475
4475
  e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null;
4476
4476
  }, {
@@ -4519,141 +4519,141 @@ var N = /*@__PURE__*/ C("ZodType", (e, t) => (hs(), D.init(e, t), e.def = t, e.t
4519
4519
  slugify() {
4520
4520
  return this.check(/* @__PURE__ */ oo());
4521
4521
  }
4522
- }), vs = /*@__PURE__*/ C("ZodString", (e, t) => {
4523
- xr.init(e, t), _s.init(e, t);
4522
+ }), ys = /*@__PURE__*/ C("ZodString", (e, t) => {
4523
+ xr.init(e, t), vs.init(e, t);
4524
4524
  }, {
4525
4525
  email(e) {
4526
- return this.check(/* @__PURE__ */ la(Cs, e));
4526
+ return this.check(/* @__PURE__ */ la(ws, e));
4527
4527
  },
4528
4528
  url(e) {
4529
- return this.check(/* @__PURE__ */ ha(Es, e));
4529
+ return this.check(/* @__PURE__ */ ha(Ds, e));
4530
4530
  },
4531
4531
  jwt(e) {
4532
- return this.check(/* @__PURE__ */ Aa(Vs, e));
4532
+ return this.check(/* @__PURE__ */ Aa(Hs, e));
4533
4533
  },
4534
4534
  emoji(e) {
4535
- return this.check(/* @__PURE__ */ ga(Ds, e));
4535
+ return this.check(/* @__PURE__ */ ga(Os, e));
4536
4536
  },
4537
4537
  guid(e) {
4538
- return this.check(/* @__PURE__ */ ua(ws, e));
4538
+ return this.check(/* @__PURE__ */ ua(Ts, e));
4539
4539
  },
4540
4540
  uuid(e) {
4541
- return this.check(/* @__PURE__ */ da(Ts, e));
4541
+ return this.check(/* @__PURE__ */ da(Es, e));
4542
4542
  },
4543
4543
  uuidv4(e) {
4544
- return this.check(/* @__PURE__ */ fa(Ts, e));
4544
+ return this.check(/* @__PURE__ */ fa(Es, e));
4545
4545
  },
4546
4546
  uuidv6(e) {
4547
- return this.check(/* @__PURE__ */ pa(Ts, e));
4547
+ return this.check(/* @__PURE__ */ pa(Es, e));
4548
4548
  },
4549
4549
  uuidv7(e) {
4550
- return this.check(/* @__PURE__ */ ma(Ts, e));
4550
+ return this.check(/* @__PURE__ */ ma(Es, e));
4551
4551
  },
4552
4552
  nanoid(e) {
4553
- return this.check(/* @__PURE__ */ _a(Os, e));
4553
+ return this.check(/* @__PURE__ */ _a(ks, e));
4554
4554
  },
4555
4555
  cuid(e) {
4556
- return this.check(/* @__PURE__ */ va(ks, e));
4556
+ return this.check(/* @__PURE__ */ va(As, e));
4557
4557
  },
4558
4558
  cuid2(e) {
4559
- return this.check(/* @__PURE__ */ ya(As, e));
4559
+ return this.check(/* @__PURE__ */ ya(js, e));
4560
4560
  },
4561
4561
  ulid(e) {
4562
- return this.check(/* @__PURE__ */ ba(js, e));
4562
+ return this.check(/* @__PURE__ */ ba(Ms, e));
4563
4563
  },
4564
4564
  base64(e) {
4565
- return this.check(/* @__PURE__ */ Da(Rs, e));
4565
+ return this.check(/* @__PURE__ */ Da(zs, e));
4566
4566
  },
4567
4567
  base64url(e) {
4568
- return this.check(/* @__PURE__ */ Oa(zs, e));
4568
+ return this.check(/* @__PURE__ */ Oa(Bs, e));
4569
4569
  },
4570
4570
  xid(e) {
4571
- return this.check(/* @__PURE__ */ xa(Ms, e));
4571
+ return this.check(/* @__PURE__ */ xa(Ns, e));
4572
4572
  },
4573
4573
  ksuid(e) {
4574
- return this.check(/* @__PURE__ */ Sa(Ns, e));
4574
+ return this.check(/* @__PURE__ */ Sa(Ps, e));
4575
4575
  },
4576
4576
  ipv4(e) {
4577
- return this.check(/* @__PURE__ */ Ca(Ps, e));
4577
+ return this.check(/* @__PURE__ */ Ca(Fs, e));
4578
4578
  },
4579
4579
  ipv6(e) {
4580
- return this.check(/* @__PURE__ */ wa(Fs, e));
4580
+ return this.check(/* @__PURE__ */ wa(Is, e));
4581
4581
  },
4582
4582
  cidrv4(e) {
4583
- return this.check(/* @__PURE__ */ Ta(Is, e));
4583
+ return this.check(/* @__PURE__ */ Ta(Ls, e));
4584
4584
  },
4585
4585
  cidrv6(e) {
4586
- return this.check(/* @__PURE__ */ Ea(Ls, e));
4586
+ return this.check(/* @__PURE__ */ Ea(Rs, e));
4587
4587
  },
4588
4588
  e164(e) {
4589
- return this.check(/* @__PURE__ */ ka(Bs, e));
4589
+ return this.check(/* @__PURE__ */ ka(Vs, e));
4590
4590
  },
4591
4591
  datetime(e) {
4592
- return this.check(/* @__PURE__ */ ja(ys, e));
4592
+ return this.check(/* @__PURE__ */ ja(bs, e));
4593
4593
  },
4594
4594
  date(e) {
4595
- return this.check(/* @__PURE__ */ Ma(bs, e));
4595
+ return this.check(/* @__PURE__ */ Ma(xs, e));
4596
4596
  },
4597
4597
  time(e) {
4598
- return this.check(/* @__PURE__ */ Na(xs, e));
4598
+ return this.check(/* @__PURE__ */ Na(Ss, e));
4599
4599
  },
4600
4600
  duration(e) {
4601
- return this.check(/* @__PURE__ */ Pa(Ss, e));
4601
+ return this.check(/* @__PURE__ */ Pa(Cs, e));
4602
4602
  }
4603
4603
  });
4604
- function P(e) {
4605
- return /* @__PURE__ */ ca(vs, e);
4606
- }
4607
- var F = /*@__PURE__*/ C("ZodStringFormat", (e, t) => {
4608
- O.init(e, t), _s.init(e, t);
4609
- }), ys = /*@__PURE__*/ C("ZodISODateTime", (e, t) => {
4610
- Rr.init(e, t), F.init(e, t);
4611
- }), bs = /*@__PURE__*/ C("ZodISODate", (e, t) => {
4612
- zr.init(e, t), F.init(e, t);
4613
- }), xs = /*@__PURE__*/ C("ZodISOTime", (e, t) => {
4614
- Br.init(e, t), F.init(e, t);
4615
- }), Ss = /*@__PURE__*/ C("ZodISODuration", (e, t) => {
4616
- Vr.init(e, t), F.init(e, t);
4617
- }), Cs = /*@__PURE__*/ C("ZodEmail", (e, t) => {
4618
- wr.init(e, t), F.init(e, t);
4619
- }), ws = /*@__PURE__*/ C("ZodGUID", (e, t) => {
4620
- Sr.init(e, t), F.init(e, t);
4621
- }), Ts = /*@__PURE__*/ C("ZodUUID", (e, t) => {
4622
- Cr.init(e, t), F.init(e, t);
4623
- }), Es = /*@__PURE__*/ C("ZodURL", (e, t) => {
4624
- Ar.init(e, t), F.init(e, t);
4625
- }), Ds = /*@__PURE__*/ C("ZodEmoji", (e, t) => {
4626
- jr.init(e, t), F.init(e, t);
4627
- }), Os = /*@__PURE__*/ C("ZodNanoID", (e, t) => {
4628
- Mr.init(e, t), F.init(e, t);
4629
- }), ks = /*@__PURE__*/ C("ZodCUID", (e, t) => {
4630
- Nr.init(e, t), F.init(e, t);
4631
- }), As = /*@__PURE__*/ C("ZodCUID2", (e, t) => {
4632
- Pr.init(e, t), F.init(e, t);
4633
- }), js = /*@__PURE__*/ C("ZodULID", (e, t) => {
4634
- Fr.init(e, t), F.init(e, t);
4635
- }), Ms = /*@__PURE__*/ C("ZodXID", (e, t) => {
4636
- Ir.init(e, t), F.init(e, t);
4637
- }), Ns = /*@__PURE__*/ C("ZodKSUID", (e, t) => {
4638
- Lr.init(e, t), F.init(e, t);
4639
- }), Ps = /*@__PURE__*/ C("ZodIPv4", (e, t) => {
4640
- Hr.init(e, t), F.init(e, t);
4641
- }), Fs = /*@__PURE__*/ C("ZodIPv6", (e, t) => {
4642
- Gr.init(e, t), F.init(e, t);
4643
- }), Is = /*@__PURE__*/ C("ZodCIDRv4", (e, t) => {
4644
- Kr.init(e, t), F.init(e, t);
4645
- }), Ls = /*@__PURE__*/ C("ZodCIDRv6", (e, t) => {
4646
- Jr.init(e, t), F.init(e, t);
4647
- }), Rs = /*@__PURE__*/ C("ZodBase64", (e, t) => {
4648
- Xr.init(e, t), F.init(e, t);
4649
- }), zs = /*@__PURE__*/ C("ZodBase64URL", (e, t) => {
4650
- Qr.init(e, t), F.init(e, t);
4651
- }), Bs = /*@__PURE__*/ C("ZodE164", (e, t) => {
4652
- $r.init(e, t), F.init(e, t);
4653
- }), Vs = /*@__PURE__*/ C("ZodJWT", (e, t) => {
4654
- ti.init(e, t), F.init(e, t);
4655
- }), Hs = /*@__PURE__*/ C("ZodNumber", (e, t) => {
4656
- ni.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Do(e, t, n, r);
4604
+ function N(e) {
4605
+ return /* @__PURE__ */ ca(ys, e);
4606
+ }
4607
+ var P = /*@__PURE__*/ C("ZodStringFormat", (e, t) => {
4608
+ O.init(e, t), vs.init(e, t);
4609
+ }), bs = /*@__PURE__*/ C("ZodISODateTime", (e, t) => {
4610
+ Rr.init(e, t), P.init(e, t);
4611
+ }), xs = /*@__PURE__*/ C("ZodISODate", (e, t) => {
4612
+ zr.init(e, t), P.init(e, t);
4613
+ }), Ss = /*@__PURE__*/ C("ZodISOTime", (e, t) => {
4614
+ Br.init(e, t), P.init(e, t);
4615
+ }), Cs = /*@__PURE__*/ C("ZodISODuration", (e, t) => {
4616
+ Vr.init(e, t), P.init(e, t);
4617
+ }), ws = /*@__PURE__*/ C("ZodEmail", (e, t) => {
4618
+ wr.init(e, t), P.init(e, t);
4619
+ }), Ts = /*@__PURE__*/ C("ZodGUID", (e, t) => {
4620
+ Sr.init(e, t), P.init(e, t);
4621
+ }), Es = /*@__PURE__*/ C("ZodUUID", (e, t) => {
4622
+ Cr.init(e, t), P.init(e, t);
4623
+ }), Ds = /*@__PURE__*/ C("ZodURL", (e, t) => {
4624
+ Ar.init(e, t), P.init(e, t);
4625
+ }), Os = /*@__PURE__*/ C("ZodEmoji", (e, t) => {
4626
+ jr.init(e, t), P.init(e, t);
4627
+ }), ks = /*@__PURE__*/ C("ZodNanoID", (e, t) => {
4628
+ Mr.init(e, t), P.init(e, t);
4629
+ }), As = /*@__PURE__*/ C("ZodCUID", (e, t) => {
4630
+ Nr.init(e, t), P.init(e, t);
4631
+ }), js = /*@__PURE__*/ C("ZodCUID2", (e, t) => {
4632
+ Pr.init(e, t), P.init(e, t);
4633
+ }), Ms = /*@__PURE__*/ C("ZodULID", (e, t) => {
4634
+ Fr.init(e, t), P.init(e, t);
4635
+ }), Ns = /*@__PURE__*/ C("ZodXID", (e, t) => {
4636
+ Ir.init(e, t), P.init(e, t);
4637
+ }), Ps = /*@__PURE__*/ C("ZodKSUID", (e, t) => {
4638
+ Lr.init(e, t), P.init(e, t);
4639
+ }), Fs = /*@__PURE__*/ C("ZodIPv4", (e, t) => {
4640
+ Hr.init(e, t), P.init(e, t);
4641
+ }), Is = /*@__PURE__*/ C("ZodIPv6", (e, t) => {
4642
+ Gr.init(e, t), P.init(e, t);
4643
+ }), Ls = /*@__PURE__*/ C("ZodCIDRv4", (e, t) => {
4644
+ Kr.init(e, t), P.init(e, t);
4645
+ }), Rs = /*@__PURE__*/ C("ZodCIDRv6", (e, t) => {
4646
+ Jr.init(e, t), P.init(e, t);
4647
+ }), zs = /*@__PURE__*/ C("ZodBase64", (e, t) => {
4648
+ Xr.init(e, t), P.init(e, t);
4649
+ }), Bs = /*@__PURE__*/ C("ZodBase64URL", (e, t) => {
4650
+ Qr.init(e, t), P.init(e, t);
4651
+ }), Vs = /*@__PURE__*/ C("ZodE164", (e, t) => {
4652
+ $r.init(e, t), P.init(e, t);
4653
+ }), Hs = /*@__PURE__*/ C("ZodJWT", (e, t) => {
4654
+ ti.init(e, t), P.init(e, t);
4655
+ }), Us = /*@__PURE__*/ C("ZodNumber", (e, t) => {
4656
+ ni.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Oo(e, t, n, r);
4657
4657
  let n = e._zod.bag;
4658
4658
  e.minValue = Math.max(n.minimum ?? -Infinity, n.exclusiveMinimum ?? -Infinity) ?? null, e.maxValue = Math.min(n.maximum ?? Infinity, n.exclusiveMaximum ?? Infinity) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? .5), e.isFinite = !0, e.format = n.format ?? null;
4659
4659
  }, {
@@ -4676,10 +4676,10 @@ var F = /*@__PURE__*/ C("ZodStringFormat", (e, t) => {
4676
4676
  return this.check(/* @__PURE__ */ Ha(e, t));
4677
4677
  },
4678
4678
  int(e) {
4679
- return this.check(Ws(e));
4679
+ return this.check(Gs(e));
4680
4680
  },
4681
4681
  safe(e) {
4682
- return this.check(Ws(e));
4682
+ return this.check(Gs(e));
4683
4683
  },
4684
4684
  positive(e) {
4685
4685
  return this.check(/* @__PURE__ */ Ua(0, e));
@@ -4703,41 +4703,41 @@ var F = /*@__PURE__*/ C("ZodStringFormat", (e, t) => {
4703
4703
  return this;
4704
4704
  }
4705
4705
  });
4706
- function I(e) {
4707
- return /* @__PURE__ */ Fa(Hs, e);
4706
+ function F(e) {
4707
+ return /* @__PURE__ */ Fa(Us, e);
4708
4708
  }
4709
- var Us = /*@__PURE__*/ C("ZodNumberFormat", (e, t) => {
4710
- ri.init(e, t), Hs.init(e, t);
4709
+ var Ws = /*@__PURE__*/ C("ZodNumberFormat", (e, t) => {
4710
+ ri.init(e, t), Us.init(e, t);
4711
4711
  });
4712
- function Ws(e) {
4713
- return /* @__PURE__ */ Ia(Us, e);
4712
+ function Gs(e) {
4713
+ return /* @__PURE__ */ Ia(Ws, e);
4714
4714
  }
4715
- var Gs = /*@__PURE__*/ C("ZodBoolean", (e, t) => {
4716
- ii.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Oo(e, t, n, r);
4715
+ var Ks = /*@__PURE__*/ C("ZodBoolean", (e, t) => {
4716
+ ii.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => ko(e, t, n, r);
4717
4717
  });
4718
- function L(e) {
4719
- return /* @__PURE__ */ La(Gs, e);
4718
+ function I(e) {
4719
+ return /* @__PURE__ */ La(Ks, e);
4720
4720
  }
4721
- var Ks = /*@__PURE__*/ C("ZodNull", (e, t) => {
4722
- ai.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => ko(e, t, n, r);
4721
+ var qs = /*@__PURE__*/ C("ZodNull", (e, t) => {
4722
+ ai.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ao(e, t, n, r);
4723
4723
  });
4724
- function qs(e) {
4725
- return /* @__PURE__ */ Ra(Ks, e);
4724
+ function Js(e) {
4725
+ return /* @__PURE__ */ Ra(qs, e);
4726
4726
  }
4727
- var Js = /*@__PURE__*/ C("ZodUnknown", (e, t) => {
4728
- oi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0;
4727
+ var Ys = /*@__PURE__*/ C("ZodUnknown", (e, t) => {
4728
+ oi.init(e, t), M.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0;
4729
4729
  });
4730
- function R() {
4731
- return /* @__PURE__ */ za(Js);
4730
+ function L() {
4731
+ return /* @__PURE__ */ za(Ys);
4732
4732
  }
4733
- var Ys = /*@__PURE__*/ C("ZodNever", (e, t) => {
4734
- si.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ao(e, t, n, r);
4733
+ var Xs = /*@__PURE__*/ C("ZodNever", (e, t) => {
4734
+ si.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => jo(e, t, n, r);
4735
4735
  });
4736
- function Xs(e) {
4737
- return /* @__PURE__ */ Ba(Ys, e);
4736
+ function Zs(e) {
4737
+ return /* @__PURE__ */ Ba(Xs, e);
4738
4738
  }
4739
- var Zs = /*@__PURE__*/ C("ZodArray", (e, t) => {
4740
- gs(), li.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Fo(e, t, n, r), e.element = t.element;
4739
+ var Qs = /*@__PURE__*/ C("ZodArray", (e, t) => {
4740
+ _s(), li.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Io(e, t, n, r), e.element = t.element;
4741
4741
  }, {
4742
4742
  min(e, t) {
4743
4743
  return this.check(/* @__PURE__ */ qa(e, t));
@@ -4755,14 +4755,14 @@ var Zs = /*@__PURE__*/ C("ZodArray", (e, t) => {
4755
4755
  return this.element;
4756
4756
  }
4757
4757
  });
4758
- function z(e, t) {
4759
- return /* @__PURE__ */ so(Zs, e, t);
4758
+ function R(e, t) {
4759
+ return /* @__PURE__ */ so(Qs, e, t);
4760
4760
  }
4761
- var Qs = /*@__PURE__*/ C("ZodObject", (e, t) => {
4762
- gs(), gi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Lo(e, t, n, r), Lt(e, "shape", (e) => e._zod.def.shape, !1);
4761
+ var $s = /*@__PURE__*/ C("ZodObject", (e, t) => {
4762
+ _s(), gi.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ro(e, t, n, r), Lt(e, "shape", (e) => e._zod.def.shape, !1);
4763
4763
  }, {
4764
4764
  keyof() {
4765
- return U(Object.keys(this._zod.def.shape));
4765
+ return H(Object.keys(this._zod.def.shape));
4766
4766
  },
4767
4767
  catchall(e) {
4768
4768
  return this.clone({
@@ -4773,19 +4773,19 @@ var Qs = /*@__PURE__*/ C("ZodObject", (e, t) => {
4773
4773
  passthrough() {
4774
4774
  return this.clone({
4775
4775
  ...this._zod.def,
4776
- catchall: R()
4776
+ catchall: L()
4777
4777
  });
4778
4778
  },
4779
4779
  loose() {
4780
4780
  return this.clone({
4781
4781
  ...this._zod.def,
4782
- catchall: R()
4782
+ catchall: L()
4783
4783
  });
4784
4784
  },
4785
4785
  strict() {
4786
4786
  return this.clone({
4787
4787
  ...this._zod.def,
4788
- catchall: Xs()
4788
+ catchall: Zs()
4789
4789
  });
4790
4790
  },
4791
4791
  strip() {
@@ -4810,74 +4810,74 @@ var Qs = /*@__PURE__*/ C("ZodObject", (e, t) => {
4810
4810
  return pt(this, e);
4811
4811
  },
4812
4812
  partial(...e) {
4813
- return _t(cc, this, e[0]);
4813
+ return _t(lc, this, e[0]);
4814
4814
  },
4815
4815
  exactPartial(...e) {
4816
- return _t(uc, this, e[0], "exactPartial");
4816
+ return _t(dc, this, e[0], "exactPartial");
4817
4817
  },
4818
4818
  required(...e) {
4819
- return vt(vc, this, e[0]);
4819
+ return vt(yc, this, e[0]);
4820
4820
  }
4821
4821
  });
4822
- function B(e, t) {
4823
- return new Qs({
4822
+ function z(e, t) {
4823
+ return new $s({
4824
4824
  type: "object",
4825
4825
  shape: e ?? {},
4826
4826
  ...b(t)
4827
4827
  });
4828
4828
  }
4829
- function $s(e, t) {
4830
- return new Qs({
4829
+ function ec(e, t) {
4830
+ return new $s({
4831
4831
  type: "object",
4832
4832
  shape: e,
4833
- catchall: Xs(),
4833
+ catchall: Zs(),
4834
4834
  ...b(t)
4835
4835
  });
4836
4836
  }
4837
- var ec = /*@__PURE__*/ C("ZodUnion", (e, t) => {
4838
- vi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ro(e, t, n, r), e.options = t.options;
4837
+ var tc = /*@__PURE__*/ C("ZodUnion", (e, t) => {
4838
+ vi.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => zo(e, t, n, r), e.options = t.options;
4839
4839
  });
4840
- function V(e, t) {
4841
- return new ec({
4840
+ function B(e, t) {
4841
+ return new tc({
4842
4842
  type: "union",
4843
4843
  options: e,
4844
4844
  ...b(t)
4845
4845
  });
4846
4846
  }
4847
- var tc = /*@__PURE__*/ C("ZodIntersection", (e, t) => {
4848
- yi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => zo(e, t, n, r);
4847
+ var nc = /*@__PURE__*/ C("ZodIntersection", (e, t) => {
4848
+ yi.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Bo(e, t, n, r);
4849
4849
  });
4850
- function nc(e, t) {
4851
- return new tc({
4850
+ function rc(e, t) {
4851
+ return new nc({
4852
4852
  type: "intersection",
4853
4853
  left: e,
4854
4854
  right: t
4855
4855
  });
4856
4856
  }
4857
- var rc = /*@__PURE__*/ C("ZodRecord", (e, t) => {
4858
- gs(), Si.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Uo(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType;
4857
+ var ic = /*@__PURE__*/ C("ZodRecord", (e, t) => {
4858
+ _s(), Si.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Wo(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType;
4859
4859
  });
4860
- function H(e, t, n) {
4861
- return !t || !t._zod ? new rc({
4860
+ function V(e, t, n) {
4861
+ return !t || !t._zod ? new ic({
4862
4862
  type: "record",
4863
- keyType: P(),
4863
+ keyType: N(),
4864
4864
  valueType: e,
4865
4865
  ...b(t)
4866
- }) : new rc({
4866
+ }) : new ic({
4867
4867
  type: "record",
4868
4868
  keyType: e,
4869
4869
  valueType: t,
4870
4870
  ...b(n)
4871
4871
  });
4872
4872
  }
4873
- var ic = /*@__PURE__*/ C("ZodEnum", (e, t) => {
4874
- Ci.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => jo(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
4873
+ var ac = /*@__PURE__*/ C("ZodEnum", (e, t) => {
4874
+ Ci.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Mo(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
4875
4875
  let n = new Set(Object.keys(t.entries));
4876
4876
  e.extract = (e, r) => {
4877
4877
  let i = {};
4878
4878
  for (let r of e) if (n.has(r)) i[r] = t.entries[r];
4879
4879
  else throw Error(`Key ${r} not found in enum`);
4880
- return new ic({
4880
+ return new ac({
4881
4881
  ...t,
4882
4882
  checks: [],
4883
4883
  ...b(r),
@@ -4887,7 +4887,7 @@ var ic = /*@__PURE__*/ C("ZodEnum", (e, t) => {
4887
4887
  let i = { ...t.entries };
4888
4888
  for (let t of e) if (n.has(t)) delete i[t];
4889
4889
  else throw Error(`Key ${t} not found in enum`);
4890
- return new ic({
4890
+ return new ac({
4891
4891
  ...t,
4892
4892
  checks: [],
4893
4893
  ...b(r),
@@ -4895,28 +4895,28 @@ var ic = /*@__PURE__*/ C("ZodEnum", (e, t) => {
4895
4895
  });
4896
4896
  };
4897
4897
  });
4898
- function U(e, t) {
4899
- return new ic({
4898
+ function H(e, t) {
4899
+ return new ac({
4900
4900
  type: "enum",
4901
4901
  entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
4902
4902
  ...b(t)
4903
4903
  });
4904
4904
  }
4905
- var ac = /*@__PURE__*/ C("ZodLiteral", (e, t) => {
4906
- wi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Mo(e, t, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", { get() {
4905
+ var oc = /*@__PURE__*/ C("ZodLiteral", (e, t) => {
4906
+ wi.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => No(e, t, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", { get() {
4907
4907
  if (t.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead.");
4908
4908
  return t.values[0];
4909
4909
  } });
4910
4910
  });
4911
- function W(e, t) {
4912
- return new ac({
4911
+ function U(e, t) {
4912
+ return new oc({
4913
4913
  type: "literal",
4914
4914
  values: Array.isArray(e) ? e : [e],
4915
4915
  ...b(t)
4916
4916
  });
4917
4917
  }
4918
- var oc = /*@__PURE__*/ C("ZodTransform", (e, t) => {
4919
- gs(), Ti.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Po(e, t, n, r), e._zod.parse = (n, r) => {
4918
+ var sc = /*@__PURE__*/ C("ZodTransform", (e, t) => {
4919
+ _s(), Ti.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Fo(e, t, n, r), e._zod.parse = (n, r) => {
4920
4920
  if (r.direction === "backward") throw new Gt(e.constructor.name);
4921
4921
  n.addIssue = (r) => {
4922
4922
  if (typeof r == "string") n.issues.push(Ot(r, n.value, t));
@@ -4929,44 +4929,44 @@ var oc = /*@__PURE__*/ C("ZodTransform", (e, t) => {
4929
4929
  return i instanceof Promise ? i.then((e) => (n.value = e, n)) : (n.value = i, n);
4930
4930
  };
4931
4931
  });
4932
- function sc(e) {
4933
- return new oc({
4932
+ function cc(e) {
4933
+ return new sc({
4934
4934
  type: "transform",
4935
4935
  transform: e
4936
4936
  });
4937
4937
  }
4938
- var cc = /*@__PURE__*/ C("ZodOptional", (e, t) => {
4939
- Di.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => $o(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4938
+ var lc = /*@__PURE__*/ C("ZodOptional", (e, t) => {
4939
+ Di.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => es(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4940
4940
  });
4941
- function lc(e) {
4942
- return new cc({
4941
+ function uc(e) {
4942
+ return new lc({
4943
4943
  type: "optional",
4944
4944
  innerType: e
4945
4945
  });
4946
4946
  }
4947
- var uc = /*@__PURE__*/ C("ZodExactOptional", (e, t) => {
4948
- Oi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => $o(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4947
+ var dc = /*@__PURE__*/ C("ZodExactOptional", (e, t) => {
4948
+ Oi.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => es(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4949
4949
  });
4950
- function dc(e) {
4951
- return new uc({
4950
+ function fc(e) {
4951
+ return new dc({
4952
4952
  type: "optional",
4953
4953
  innerType: e
4954
4954
  });
4955
4955
  }
4956
- var fc = /*@__PURE__*/ C("ZodNullable", (e, t) => {
4957
- ki.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Wo(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4956
+ var pc = /*@__PURE__*/ C("ZodNullable", (e, t) => {
4957
+ ki.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Go(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4958
4958
  });
4959
- function pc(e) {
4960
- return new fc({
4959
+ function mc(e) {
4960
+ return new pc({
4961
4961
  type: "nullable",
4962
4962
  innerType: e
4963
4963
  });
4964
4964
  }
4965
- var mc = /*@__PURE__*/ C("ZodDefault", (e, t) => {
4966
- Ai.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Jo(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
4965
+ var hc = /*@__PURE__*/ C("ZodDefault", (e, t) => {
4966
+ Ai.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Yo(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
4967
4967
  });
4968
- function hc(e, t) {
4969
- return new mc({
4968
+ function gc(e, t) {
4969
+ return new hc({
4970
4970
  type: "default",
4971
4971
  innerType: e,
4972
4972
  get defaultValue() {
@@ -4974,11 +4974,11 @@ function hc(e, t) {
4974
4974
  }
4975
4975
  });
4976
4976
  }
4977
- var gc = /*@__PURE__*/ C("ZodPrefault", (e, t) => {
4978
- Mi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Yo(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4977
+ var _c = /*@__PURE__*/ C("ZodPrefault", (e, t) => {
4978
+ Mi.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Xo(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4979
4979
  });
4980
- function _c(e, t) {
4981
- return new gc({
4980
+ function vc(e, t) {
4981
+ return new _c({
4982
4982
  type: "prefault",
4983
4983
  innerType: e,
4984
4984
  get defaultValue() {
@@ -4986,184 +4986,184 @@ function _c(e, t) {
4986
4986
  }
4987
4987
  });
4988
4988
  }
4989
- var vc = /*@__PURE__*/ C("ZodNonOptional", (e, t) => {
4990
- Ni.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Go(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4989
+ var yc = /*@__PURE__*/ C("ZodNonOptional", (e, t) => {
4990
+ Ni.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ko(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4991
4991
  });
4992
- function yc(e, t) {
4993
- return new vc({
4992
+ function bc(e, t) {
4993
+ return new yc({
4994
4994
  type: "nonoptional",
4995
4995
  innerType: e,
4996
4996
  ...b(t)
4997
4997
  });
4998
4998
  }
4999
- var bc = /*@__PURE__*/ C("ZodCatch", (e, t) => {
5000
- Ii.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Xo(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
4999
+ var xc = /*@__PURE__*/ C("ZodCatch", (e, t) => {
5000
+ Ii.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Zo(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
5001
5001
  });
5002
- function xc(e, t) {
5003
- return new bc({
5002
+ function Sc(e, t) {
5003
+ return new xc({
5004
5004
  type: "catch",
5005
5005
  innerType: e,
5006
5006
  catchValue: typeof t == "function" ? t : zt(t)
5007
5007
  });
5008
5008
  }
5009
- var Sc = /*@__PURE__*/ C("ZodPipe", (e, t) => {
5010
- Li.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Zo(e, t, n, r), e.in = t.in, e.out = t.out;
5009
+ var Cc = /*@__PURE__*/ C("ZodPipe", (e, t) => {
5010
+ Li.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Qo(e, t, n, r), e.in = t.in, e.out = t.out;
5011
5011
  });
5012
- function Cc(e, t) {
5013
- return new Sc({
5012
+ function wc(e, t) {
5013
+ return new Cc({
5014
5014
  type: "pipe",
5015
5015
  in: e,
5016
5016
  out: t
5017
5017
  });
5018
5018
  }
5019
- var wc = /*@__PURE__*/ C("ZodReadonly", (e, t) => {
5020
- zi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => Qo(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
5019
+ var Tc = /*@__PURE__*/ C("ZodReadonly", (e, t) => {
5020
+ zi.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => $o(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
5021
5021
  });
5022
- function Tc(e) {
5023
- return new wc({
5022
+ function Ec(e) {
5023
+ return new Tc({
5024
5024
  type: "readonly",
5025
5025
  innerType: e
5026
5026
  });
5027
5027
  }
5028
- var Ec = /*@__PURE__*/ C("ZodLazy", (e, t) => {
5029
- Vi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => es(e, t, n, r), e.unwrap = () => e._zod.def.getter();
5028
+ var Dc = /*@__PURE__*/ C("ZodLazy", (e, t) => {
5029
+ Vi.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => ts(e, t, n, r), e.unwrap = () => e._zod.def.getter();
5030
5030
  });
5031
- function Dc(e) {
5032
- return new Ec({
5031
+ function Oc(e) {
5032
+ return new Dc({
5033
5033
  type: "lazy",
5034
5034
  getter: e
5035
5035
  });
5036
5036
  }
5037
- var Oc = /*@__PURE__*/ C("ZodCustom", (e, t) => {
5038
- Hi.init(e, t), N.init(e, t), e._zod.processJSONSchema = (t, n, r) => No(e, t, n, r);
5037
+ var kc = /*@__PURE__*/ C("ZodCustom", (e, t) => {
5038
+ Hi.init(e, t), M.init(e, t), e._zod.processJSONSchema = (t, n, r) => Po(e, t, n, r);
5039
5039
  });
5040
- function kc(e, t = {}) {
5041
- return /* @__PURE__ */ co(Oc, e, t);
5040
+ function Ac(e, t = {}) {
5041
+ return /* @__PURE__ */ co(kc, e, t);
5042
5042
  }
5043
- function Ac(e, t) {
5043
+ function jc(e, t) {
5044
5044
  return /* @__PURE__ */ lo(e, t);
5045
5045
  }
5046
- function jc(e) {
5047
- let t = Dc(() => V([
5048
- P(e),
5046
+ function Mc(e) {
5047
+ let t = Oc(() => B([
5048
+ N(e),
5049
+ F(),
5049
5050
  I(),
5050
- L(),
5051
- qs(),
5052
- z(t),
5053
- H(P(), t)
5051
+ Js(),
5052
+ R(t),
5053
+ V(N(), t)
5054
5054
  ]));
5055
5055
  return t;
5056
5056
  }
5057
5057
  //#endregion
5058
5058
  //#region src/flow/common/triggerScheduleSchema.ts
5059
- var Mc = z(V([B({
5060
- type: W("cron"),
5061
- expression: P(),
5062
- timezone: P()
5063
- }), B({
5064
- type: W("every"),
5065
- unit: U([
5059
+ var Nc = R(B([z({
5060
+ type: U("cron"),
5061
+ expression: N(),
5062
+ timezone: N()
5063
+ }), z({
5064
+ type: U("every"),
5065
+ unit: H([
5066
5066
  "day",
5067
5067
  "hour",
5068
5068
  "minute",
5069
5069
  "month",
5070
5070
  "week"
5071
5071
  ]),
5072
- value: I()
5073
- })])), G = P(), K = jc(), Nc = z(G), Pc = B({
5074
- description: G.optional(),
5075
- jsonSchema: K,
5076
- nullable: L(),
5077
- handle: G
5078
- }), q = Pc.extend({ value: K.optional() }), Fc = B({
5079
- collapsed: L().optional(),
5080
- group: G
5081
- }), Ic = B({
5082
- kind: W("node"),
5083
- nodeId: G,
5084
- output: G
5085
- }), Lc = B({
5086
- kind: W("flow"),
5087
- input: G
5088
- }), Rc = V([
5089
- Ic,
5072
+ value: F()
5073
+ })])), W = N(), G = Mc(), Pc = R(W), Fc = z({
5074
+ description: W.optional(),
5075
+ jsonSchema: G,
5076
+ nullable: I(),
5077
+ handle: W
5078
+ }), K = Fc.extend({ value: G.optional() }), Ic = z({
5079
+ collapsed: I().optional(),
5080
+ group: W
5081
+ }), Lc = z({
5082
+ kind: U("node"),
5083
+ nodeId: W,
5084
+ output: W
5085
+ }), Rc = z({
5086
+ kind: U("flow"),
5087
+ input: W
5088
+ }), zc = B([
5090
5089
  Lc,
5091
- B({
5092
- kind: W("binding"),
5093
- bindingId: G
5090
+ Rc,
5091
+ z({
5092
+ kind: U("binding"),
5093
+ bindingId: W
5094
5094
  })
5095
- ]), zc = V([B({
5096
- kind: W("value"),
5097
- value: K
5098
- }), B({
5099
- kind: W("sources"),
5100
- sources: z(Rc)
5101
- })]), Bc = H(G, zc), Vc = {
5102
- inputs: z(V([q, Fc])),
5103
- outputs: z(V([Pc, Fc]))
5104
- }, Hc = B({
5105
- kind: W("connector"),
5106
- action: G,
5107
- connectionId: G.optional(),
5108
- connections: z(B({
5109
- connectionId: G,
5110
- alias: G.optional()
5095
+ ]), Bc = B([z({
5096
+ kind: U("value"),
5097
+ value: G
5098
+ }), z({
5099
+ kind: U("sources"),
5100
+ sources: R(zc)
5101
+ })]), Vc = V(W, Bc), Hc = {
5102
+ inputs: R(B([K, Ic])),
5103
+ outputs: R(B([Fc, Ic]))
5104
+ }, Uc = z({
5105
+ kind: U("connector"),
5106
+ action: W,
5107
+ connectionId: W.optional(),
5108
+ connections: R(z({
5109
+ connectionId: W,
5110
+ alias: W.optional()
5111
5111
  }))
5112
- }), Uc = B({
5113
- ...Vc,
5114
- name: G,
5115
- moduleId: G,
5116
- capabilities: z(Hc).optional()
5117
- }), Wc = V([B({
5118
- kind: W("value"),
5119
- value: K
5120
- }), B({
5121
- kind: W("input"),
5122
- input: G
5123
- })]), Gc = V([Wc, B({ kind: W("model") })]), Kc = B({
5124
- ...Vc,
5125
- name: G,
5126
- executor: V([
5127
- B({
5128
- kind: W("connector"),
5129
- action: G,
5130
- connectionId: G.optional()
5112
+ }), Wc = z({
5113
+ ...Hc,
5114
+ name: W,
5115
+ moduleId: W,
5116
+ capabilities: R(Uc).optional()
5117
+ }), Gc = B([z({
5118
+ kind: U("value"),
5119
+ value: G
5120
+ }), z({
5121
+ kind: U("input"),
5122
+ input: W
5123
+ })]), Kc = B([Gc, z({ kind: U("model") })]), qc = z({
5124
+ ...Hc,
5125
+ name: W,
5126
+ executor: B([
5127
+ z({
5128
+ kind: U("connector"),
5129
+ action: W,
5130
+ connectionId: W.optional()
5131
5131
  }),
5132
- B({
5133
- kind: W("llm"),
5134
- mode: U(["chat", "json"])
5132
+ z({
5133
+ kind: U("llm"),
5134
+ mode: H(["chat", "json"])
5135
5135
  }),
5136
- B({
5137
- kind: W("agent"),
5138
- code: L().optional(),
5139
- model: G,
5140
- prompt: Wc,
5141
- system: G,
5142
- maxRounds: I(),
5143
- tools: z(B({
5144
- id: G,
5145
- name: G,
5146
- description: G,
5147
- action: G,
5148
- connectionId: G.optional(),
5149
- approval: L(),
5150
- inputs: z(q.extend({ source: Gc }))
5136
+ z({
5137
+ kind: U("agent"),
5138
+ code: I().optional(),
5139
+ model: W,
5140
+ prompt: Gc,
5141
+ system: W,
5142
+ maxRounds: F(),
5143
+ tools: R(z({
5144
+ id: W,
5145
+ name: W,
5146
+ description: W,
5147
+ action: W,
5148
+ connectionId: W.optional(),
5149
+ approval: I(),
5150
+ inputs: R(K.extend({ source: Kc }))
5151
5151
  })),
5152
- notification: B({
5153
- taskId: G,
5154
- messageHandle: G,
5155
- inputs: H(G, Wc)
5152
+ notification: z({
5153
+ taskId: W,
5154
+ messageHandle: W,
5155
+ inputs: V(W, Gc)
5156
5156
  }).optional()
5157
5157
  })
5158
5158
  ])
5159
- }), qc = {
5160
- input: q,
5161
- cases: z(B({
5162
- output: G,
5163
- relation: U(["all", "any"]),
5164
- expressions: z(B({
5165
- input: G,
5166
- operator: U([
5159
+ }), Jc = {
5160
+ input: K,
5161
+ cases: R(z({
5162
+ output: W,
5163
+ relation: H(["all", "any"]),
5164
+ expressions: R(z({
5165
+ input: W,
5166
+ operator: H([
5167
5167
  "!=",
5168
5168
  "<",
5169
5169
  "<=",
@@ -5185,41 +5185,44 @@ var Mc = z(V([B({
5185
5185
  "notHasValue",
5186
5186
  "startsWith"
5187
5187
  ]),
5188
- value: K.optional()
5188
+ value: G.optional()
5189
5189
  }))
5190
5190
  })),
5191
- defaultOutput: G.optional()
5192
- }, Jc = { prompt: G }, Yc = {
5193
- bodyFields: z(q),
5194
- options: B({
5195
- allowedMethods: Nc.optional(),
5196
- allowedOrigins: Nc.optional(),
5197
- noResponseBody: L().optional(),
5198
- responseData: G.optional(),
5199
- responseHeaders: H(G, G).optional(),
5200
- responseStatusCode: I().optional()
5201
- }).optional()
5191
+ defaultOutput: W.optional()
5192
+ }, Yc = {
5193
+ inputDefinitions: R(K),
5194
+ prompt: W
5202
5195
  }, Xc = {
5203
- configSchema: K,
5204
- definitionVersion: W(2),
5205
- description: G,
5206
- displayName: G,
5207
- key: G,
5208
- name: G,
5209
- outputs: z(Pc).refine((e) => new Set(e.map((e) => e.handle)).size === e.length, "Duplicate Trigger output handle."),
5210
- provider: G
5211
- }, Zc = B({
5212
- body: B({
5213
- allowArray: L(),
5214
- allowEmpty: L(),
5215
- formats: z(U([
5196
+ bodyFields: R(K),
5197
+ options: z({
5198
+ allowedMethods: Pc.optional(),
5199
+ allowedOrigins: Pc.optional(),
5200
+ noResponseBody: I().optional(),
5201
+ responseData: W.optional(),
5202
+ responseHeaders: V(W, W).optional(),
5203
+ responseStatusCode: F().optional()
5204
+ }).optional()
5205
+ }, Zc = {
5206
+ configSchema: G,
5207
+ definitionVersion: U(2),
5208
+ description: W,
5209
+ displayName: W,
5210
+ key: W,
5211
+ name: W,
5212
+ outputs: R(Fc).refine((e) => new Set(e.map((e) => e.handle)).size === e.length, "Duplicate Trigger output handle."),
5213
+ provider: W
5214
+ }, Qc = z({
5215
+ body: z({
5216
+ allowArray: I(),
5217
+ allowEmpty: I(),
5218
+ formats: R(H([
5216
5219
  "form",
5217
5220
  "json",
5218
5221
  "multipart",
5219
5222
  "text"
5220
5223
  ]))
5221
5224
  }),
5222
- methods: z(U([
5225
+ methods: R(H([
5223
5226
  "DELETE",
5224
5227
  "GET",
5225
5228
  "HEAD",
@@ -5227,298 +5230,296 @@ var Mc = z(V([B({
5227
5230
  "POST",
5228
5231
  "PUT"
5229
5232
  ])),
5230
- successStatus: I()
5231
- }), Qc = {
5232
- name: G,
5233
- description: G.optional(),
5234
- icon: G.optional()
5235
- }, $c = {
5236
- maxExecutions: I().int().positive().max(2 ** 53 - 1).optional(),
5237
- inputs: Bc,
5238
- name: G.optional(),
5239
- description: G.optional(),
5240
- icon: G.optional(),
5241
- timeoutMs: I().optional()
5242
- }, el = V([
5243
- B({
5244
- ...$c,
5245
- kind: W("condition"),
5246
- ...qc
5233
+ successStatus: F()
5234
+ }), $c = {
5235
+ name: W,
5236
+ description: W.optional(),
5237
+ icon: W.optional()
5238
+ }, el = {
5239
+ maxExecutions: F().int().positive().max(2 ** 53 - 1).optional(),
5240
+ inputs: Vc,
5241
+ name: W.optional(),
5242
+ description: W.optional(),
5243
+ icon: W.optional(),
5244
+ timeoutMs: F().optional()
5245
+ }, tl = B([
5246
+ z({
5247
+ ...el,
5248
+ kind: U("condition"),
5249
+ ...Jc
5247
5250
  }),
5248
- B({
5249
- ...$c,
5250
- inputs: R().transform(() => ({})).default({}),
5251
- kind: W("value"),
5252
- values: z(q)
5251
+ z({
5252
+ ...el,
5253
+ inputs: L().transform(() => ({})).default({}),
5254
+ kind: U("value"),
5255
+ values: R(K)
5253
5256
  }),
5254
- B({
5255
- ...$c,
5256
- kind: W("subflow"),
5257
- subflowId: G
5257
+ z({
5258
+ ...el,
5259
+ kind: U("subflow"),
5260
+ subflowId: W
5258
5261
  }),
5259
- B({
5260
- ...$c,
5261
- kind: W("task"),
5262
- task: Uc,
5263
- additionalInputs: z(q).optional()
5262
+ z({
5263
+ ...el,
5264
+ kind: U("task"),
5265
+ task: Wc,
5266
+ additionalInputs: R(K).optional()
5264
5267
  }),
5265
- B({
5266
- ...$c,
5267
- kind: W("task"),
5268
- taskId: G,
5269
- additionalInputs: z(q).optional()
5268
+ z({
5269
+ ...el,
5270
+ kind: U("task"),
5271
+ taskId: W,
5272
+ additionalInputs: R(K).optional()
5270
5273
  }),
5271
- $s({
5272
- ...$c,
5273
- kind: W("approval"),
5274
- input: q,
5275
- ...Jc
5274
+ ec({
5275
+ ...el,
5276
+ kind: U("approval"),
5277
+ ...Yc
5276
5278
  }).omit({ timeoutMs: !0 }),
5277
- $s({
5278
- ...$c,
5279
- kind: W("wait"),
5280
- input: q,
5281
- ...Jc
5279
+ ec({
5280
+ ...el,
5281
+ kind: U("wait"),
5282
+ ...Yc
5282
5283
  }).omit({ timeoutMs: !0 }),
5283
- B({
5284
- ...Qc,
5285
- kind: W("manual")
5284
+ z({
5285
+ ...$c,
5286
+ kind: U("manual")
5286
5287
  }),
5287
- B({
5288
- ...Qc,
5289
- kind: W("webhook"),
5290
- ...Yc
5288
+ z({
5289
+ ...$c,
5290
+ kind: U("webhook"),
5291
+ ...Xc
5291
5292
  }),
5292
- B({
5293
- ...Qc,
5294
- kind: W("cron"),
5295
- cronTimes: Mc
5293
+ z({
5294
+ ...$c,
5295
+ kind: U("cron"),
5296
+ cronTimes: Nc
5296
5297
  }),
5297
- B({
5298
- ...Qc,
5299
- kind: W("poll"),
5300
- bindingId: G,
5301
- config: H(G, K),
5302
- definition: B({
5303
- ...Xc,
5304
- type: W("poll")
5298
+ z({
5299
+ ...$c,
5300
+ kind: U("poll"),
5301
+ bindingId: W,
5302
+ config: V(W, G),
5303
+ definition: z({
5304
+ ...Zc,
5305
+ type: U("poll")
5305
5306
  }),
5306
- pollTimes: Mc
5307
+ pollTimes: Nc
5307
5308
  }),
5308
- B({
5309
- ...Qc,
5310
- kind: W("integration"),
5311
- bindingId: G,
5312
- config: H(G, K),
5313
- definition: B({
5314
- ...Xc,
5315
- type: W("integration"),
5316
- endpoint: Zc
5309
+ z({
5310
+ ...$c,
5311
+ kind: U("integration"),
5312
+ bindingId: W,
5313
+ config: V(W, G),
5314
+ definition: z({
5315
+ ...Zc,
5316
+ type: U("integration"),
5317
+ endpoint: Qc
5317
5318
  })
5318
5319
  })
5319
- ]), tl = V([B({ kind: W("flow") }), B({
5320
- kind: W("subflow"),
5321
- id: G
5322
- })]), nl = B({
5323
- source: G,
5324
- target: G,
5325
- sourceHandle: G.optional()
5326
- }), J = {
5327
- nodeId: G,
5328
- target: tl
5329
- }, rl = B({
5330
- name: G,
5331
- inputs: z(q),
5332
- outputs: z(Pc.extend({ sources: z(V([Ic, Lc])) }))
5333
- }), il = B({
5334
- nodes: H(G, el),
5335
- edges: z(nl).default([])
5336
- }), al = B({
5337
- kind: U(["connection", "variable"]),
5338
- target: G
5339
- }), ol = B({
5340
- name: G,
5341
- imports: Nc,
5342
- source: G
5343
- }), sl = B({
5344
- bindings: H(G, al),
5345
- graph: il,
5346
- subflows: H(G, rl.extend({ graph: il })),
5347
- tasks: H(G, Kc)
5348
- }), cl = B({
5349
- modelVersion: V([W(2), W(3)]),
5350
- document: sl,
5351
- modules: H(G, ol)
5320
+ ]), nl = B([z({ kind: U("flow") }), z({
5321
+ kind: U("subflow"),
5322
+ id: W
5323
+ })]), rl = z({
5324
+ source: W,
5325
+ target: W,
5326
+ sourceHandle: W.optional()
5327
+ }), q = {
5328
+ nodeId: W,
5329
+ target: nl
5330
+ }, il = z({
5331
+ name: W,
5332
+ inputs: R(K),
5333
+ outputs: R(Fc.extend({ sources: R(B([Lc, Rc])) }))
5334
+ }), al = z({
5335
+ nodes: V(W, tl),
5336
+ edges: R(rl).default([])
5337
+ }), ol = z({
5338
+ kind: H(["connection", "variable"]),
5339
+ target: W
5340
+ }), sl = z({
5341
+ name: W,
5342
+ imports: Pc,
5343
+ source: W
5344
+ }), cl = z({
5345
+ bindings: V(W, ol),
5346
+ graph: al,
5347
+ subflows: V(W, il.extend({ graph: al })),
5348
+ tasks: V(W, qc)
5352
5349
  });
5353
- cl.extend({ modelVersion: W(3) }), cl.extend({
5354
- kind: W("open-flow-flow-revision"),
5355
- version: W(1)
5350
+ z({
5351
+ modelVersion: B([U(2), U(3)]),
5352
+ document: cl,
5353
+ modules: V(W, sl)
5354
+ }).extend({
5355
+ kind: U("open-flow-flow-revision"),
5356
+ version: U(1)
5356
5357
  });
5357
5358
  var ll = {
5358
5359
  "binding.create": {
5359
- bindingId: G,
5360
- binding: al
5360
+ bindingId: W,
5361
+ binding: ol
5361
5362
  },
5362
- "binding.delete": { bindingId: G },
5363
+ "binding.delete": { bindingId: W },
5363
5364
  "binding.target.set": {
5364
- bindingId: G,
5365
- before: G,
5366
- value: G
5365
+ bindingId: W,
5366
+ before: W,
5367
+ value: W
5367
5368
  },
5368
5369
  "graph.edge.connect": {
5369
- target: tl,
5370
- edge: nl
5370
+ target: nl,
5371
+ edge: rl
5371
5372
  },
5372
5373
  "graph.edge.disconnect": {
5373
- target: tl,
5374
- edge: nl
5374
+ target: nl,
5375
+ edge: rl
5375
5376
  },
5376
5377
  "graph.node.create": {
5377
- ...J,
5378
- node: el
5379
- },
5380
- "graph.node.delete": J,
5381
- "graph.node.field.set": V([
5382
- B({
5383
- ...J,
5384
- kind: W("graph.node.field.set"),
5385
- field: U([
5378
+ ...q,
5379
+ node: tl
5380
+ },
5381
+ "graph.node.delete": q,
5382
+ "graph.node.field.set": B([
5383
+ z({
5384
+ ...q,
5385
+ kind: U("graph.node.field.set"),
5386
+ field: H([
5386
5387
  "description",
5387
5388
  "icon",
5388
5389
  "name"
5389
5390
  ]),
5390
- before: G.optional(),
5391
- value: G.optional()
5391
+ before: W.optional(),
5392
+ value: W.optional()
5392
5393
  }),
5393
- B({
5394
- ...J,
5395
- kind: W("graph.node.field.set"),
5396
- field: W("maxExecutions"),
5397
- before: I().int().positive().max(2 ** 53 - 1).optional(),
5398
- value: I().int().positive().max(2 ** 53 - 1).optional()
5394
+ z({
5395
+ ...q,
5396
+ kind: U("graph.node.field.set"),
5397
+ field: U("maxExecutions"),
5398
+ before: F().int().positive().max(2 ** 53 - 1).optional(),
5399
+ value: F().int().positive().max(2 ** 53 - 1).optional()
5399
5400
  }),
5400
- B({
5401
- ...J,
5402
- kind: W("graph.node.field.set"),
5403
- field: W("timeoutMs"),
5404
- before: I().optional(),
5405
- value: I().optional()
5401
+ z({
5402
+ ...q,
5403
+ kind: U("graph.node.field.set"),
5404
+ field: U("timeoutMs"),
5405
+ before: F().optional(),
5406
+ value: F().optional()
5406
5407
  })
5407
5408
  ]),
5408
5409
  "graph.node.input.set": {
5409
- ...J,
5410
- handle: G,
5411
- before: zc.optional(),
5412
- value: zc.optional()
5410
+ ...q,
5411
+ handle: W,
5412
+ before: Bc.optional(),
5413
+ value: Bc.optional()
5413
5414
  },
5414
5415
  "graph.node.additional-inputs.set": {
5415
- ...J,
5416
- before: z(q).optional(),
5417
- value: z(q).optional()
5416
+ ...q,
5417
+ before: R(K).optional(),
5418
+ value: R(K).optional()
5418
5419
  },
5419
5420
  "graph.node.condition.set": {
5420
- ...J,
5421
- before: B(qc),
5422
- value: B(qc)
5421
+ ...q,
5422
+ before: z(Jc),
5423
+ value: z(Jc)
5423
5424
  },
5424
5425
  "graph.node.values.set": {
5425
- ...J,
5426
- before: z(q),
5427
- value: z(q)
5426
+ ...q,
5427
+ before: R(K),
5428
+ value: R(K)
5428
5429
  },
5429
5430
  "graph.node.resolution.set": {
5430
- ...J,
5431
- target: B({ kind: W("flow") }),
5432
- before: B(Jc),
5433
- value: B(Jc)
5431
+ ...q,
5432
+ target: z({ kind: U("flow") }),
5433
+ before: z(Yc),
5434
+ value: z(Yc)
5434
5435
  },
5435
5436
  "graph.node.webhook.set": {
5436
- ...J,
5437
- target: B({ kind: W("flow") }),
5438
- before: B(Yc),
5439
- value: B(Yc)
5437
+ ...q,
5438
+ target: z({ kind: U("flow") }),
5439
+ before: z(Xc),
5440
+ value: z(Xc)
5440
5441
  },
5441
5442
  "graph.node.task.ports.set": {
5442
- ...J,
5443
- before: B(Vc),
5444
- value: B(Vc)
5443
+ ...q,
5444
+ before: z(Hc),
5445
+ value: z(Hc)
5445
5446
  },
5446
5447
  "graph.node.task.name.set": {
5447
- ...J,
5448
- before: G,
5449
- value: G
5448
+ ...q,
5449
+ before: W,
5450
+ value: W
5450
5451
  },
5451
5452
  "graph.node.task.capabilities.set": {
5452
- ...J,
5453
- before: z(Hc).optional(),
5454
- value: z(Hc).optional()
5453
+ ...q,
5454
+ before: R(Uc).optional(),
5455
+ value: R(Uc).optional()
5455
5456
  },
5456
5457
  "graph.trigger.config.set": {
5457
- nodeId: G,
5458
- name: G,
5459
- before: K.optional(),
5460
- value: K.optional()
5458
+ nodeId: W,
5459
+ name: W,
5460
+ before: G.optional(),
5461
+ value: G.optional()
5461
5462
  },
5462
5463
  "graph.trigger.schedule.set": {
5463
- nodeId: G,
5464
- before: Mc,
5465
- value: Mc
5464
+ nodeId: W,
5465
+ before: Nc,
5466
+ value: Nc
5466
5467
  },
5467
5468
  "module.create": {
5468
- moduleId: G,
5469
- module: ol
5469
+ moduleId: W,
5470
+ module: sl
5470
5471
  },
5471
- "module.delete": { moduleId: G },
5472
+ "module.delete": { moduleId: W },
5472
5473
  "module.rename": {
5473
- moduleId: G,
5474
- before: G,
5475
- name: G
5474
+ moduleId: W,
5475
+ before: W,
5476
+ name: W
5476
5477
  },
5477
5478
  "module.source.replace": {
5478
- moduleId: G,
5479
- beforeImports: Nc,
5480
- beforeSource: G,
5481
- imports: Nc,
5482
- source: G
5479
+ moduleId: W,
5480
+ beforeImports: Pc,
5481
+ beforeSource: W,
5482
+ imports: Pc,
5483
+ source: W
5483
5484
  },
5484
5485
  "subflow.create": {
5485
- subflowId: G,
5486
- subflow: rl.extend({ graph: il })
5486
+ subflowId: W,
5487
+ subflow: il.extend({ graph: al })
5487
5488
  },
5488
5489
  "subflow.definition.set": {
5489
- subflowId: G,
5490
- before: rl,
5491
- definition: rl
5490
+ subflowId: W,
5491
+ before: il,
5492
+ definition: il
5492
5493
  },
5493
- "subflow.delete": { subflowId: G },
5494
+ "subflow.delete": { subflowId: W },
5494
5495
  "task.create": {
5495
- taskId: G,
5496
- task: Kc
5496
+ taskId: W,
5497
+ task: qc
5497
5498
  },
5498
- "task.delete": { taskId: G },
5499
+ "task.delete": { taskId: W },
5499
5500
  "task.connector.connection.set": {
5500
- taskId: G,
5501
- before: G.optional(),
5502
- value: G.optional()
5501
+ taskId: W,
5502
+ before: W.optional(),
5503
+ value: W.optional()
5503
5504
  },
5504
5505
  "task.agent.set": {
5505
- taskId: G,
5506
- before: Kc,
5507
- value: Kc
5506
+ taskId: W,
5507
+ before: qc,
5508
+ value: qc
5508
5509
  },
5509
5510
  "task.llm.mode.set": {
5510
- taskId: G,
5511
- before: U(["chat", "json"]),
5512
- value: U(["chat", "json"])
5511
+ taskId: W,
5512
+ before: H(["chat", "json"]),
5513
+ value: H(["chat", "json"])
5513
5514
  },
5514
5515
  "task.name.set": {
5515
- taskId: G,
5516
- before: G,
5517
- value: G
5516
+ taskId: W,
5517
+ before: W,
5518
+ value: W
5518
5519
  }
5519
5520
  };
5520
- z(V([...new Map(Object.entries(ll).map(([e, t]) => [e, t instanceof N ? t : B({
5521
- kind: W(e),
5521
+ R(B([...new Map(Object.entries(ll).map(([e, t]) => [e, t instanceof M ? t : z({
5522
+ kind: U(e),
5522
5523
  ...t
5523
5524
  })])).values()])).min(1);
5524
5525
  //#endregion
@@ -5537,61 +5538,61 @@ async function pl(e) {
5537
5538
  let t = new Uint8Array(e.byteLength);
5538
5539
  return t.set(e), `sha256:${[...new Uint8Array(await crypto.subtle.digest("SHA-256", t))].map((e) => e.toString(16).padStart(2, "0")).join("")}`;
5539
5540
  }
5540
- var ml = H(P(), R()), hl = B({
5541
- jsonSchema: R(),
5542
- nullable: L(),
5543
- value: R().optional(),
5544
- description: P().optional()
5545
- }).strict(), gl = H(P(), hl), _l = V([B({
5546
- kind: W("value"),
5547
- value: R()
5548
- }).strict(), B({
5549
- kind: W("sources"),
5550
- sources: z(B({
5551
- kind: W("node"),
5552
- nodeId: P(),
5553
- output: P()
5541
+ var ml = V(N(), L()), hl = z({
5542
+ jsonSchema: L(),
5543
+ nullable: I(),
5544
+ value: L().optional(),
5545
+ description: N().optional()
5546
+ }).strict(), gl = V(N(), hl), _l = B([z({
5547
+ kind: U("value"),
5548
+ value: L()
5549
+ }).strict(), z({
5550
+ kind: U("sources"),
5551
+ sources: R(z({
5552
+ kind: U("node"),
5553
+ nodeId: N(),
5554
+ output: N()
5554
5555
  }).strict())
5555
5556
  }).strict()]), vl = {
5556
- name: P().optional(),
5557
- description: P().optional(),
5558
- icon: P().optional()
5559
- }, yl = V([
5560
- B({
5557
+ name: N().optional(),
5558
+ description: N().optional(),
5559
+ icon: N().optional()
5560
+ }, yl = B([
5561
+ z({
5561
5562
  ...vl,
5562
- kind: W("cron"),
5563
- cronTimes: z(R())
5563
+ kind: U("cron"),
5564
+ cronTimes: R(L())
5564
5565
  }).strict(),
5565
- B({
5566
+ z({
5566
5567
  ...vl,
5567
- kind: W("manual")
5568
+ kind: U("manual")
5568
5569
  }).strict(),
5569
- B({
5570
+ z({
5570
5571
  ...vl,
5571
- kind: W("task"),
5572
- concurrency: W(1).optional(),
5573
- inputs: H(P(), _l),
5574
- task: B({
5575
- name: P(),
5576
- moduleId: P(),
5572
+ kind: U("task"),
5573
+ concurrency: U(1).optional(),
5574
+ inputs: V(N(), _l),
5575
+ task: z({
5576
+ name: N(),
5577
+ moduleId: N(),
5577
5578
  inputs: gl,
5578
- outputs: H(P(), hl.omit({ value: !0 }))
5579
+ outputs: V(N(), hl.omit({ value: !0 }))
5579
5580
  }).strict()
5580
5581
  }).strict()
5581
5582
  ]);
5582
- B({
5583
- name: P(),
5584
- graph: B({ nodes: H(P(), yl) }).strict()
5585
- }).strict(), B({
5586
- kind: W("open-flow-project-revision"),
5587
- version: W(1),
5588
- modelVersion: V([W(1), W(2)]),
5589
- modules: H(P(), B({
5590
- name: P(),
5591
- source: P(),
5592
- imports: z(P())
5583
+ z({
5584
+ name: N(),
5585
+ graph: z({ nodes: V(N(), yl) }).strict()
5586
+ }).strict(), z({
5587
+ kind: U("open-flow-project-revision"),
5588
+ version: U(1),
5589
+ modelVersion: B([U(1), U(2)]),
5590
+ modules: V(N(), z({
5591
+ name: N(),
5592
+ source: N(),
5593
+ imports: R(N())
5593
5594
  }).strict()),
5594
- document: B({
5595
+ document: z({
5595
5596
  bindings: ml,
5596
5597
  flows: ml,
5597
5598
  subflows: ml,
@@ -6175,12 +6176,12 @@ function Hl(e) {
6175
6176
  async function Ul(e) {
6176
6177
  let t = await $l(e, "/users/me/profile");
6177
6178
  eu(t, "profile fetch");
6178
- let n = Y(t.data)?.historyId;
6179
+ let n = J(t.data)?.historyId;
6179
6180
  if (typeof n != "string" || n.length == 0) throw new a("Gmail profile historyId is missing.");
6180
6181
  return n;
6181
6182
  }
6182
6183
  function Wl(e) {
6183
- let t = Y(e);
6184
+ let t = J(e);
6184
6185
  if (typeof t?.historyId != "string" || t.historyId.length == 0) throw new r("Gmail checkpoint historyId is missing; recreate the Trigger.");
6185
6186
  return {
6186
6187
  historyId: t.historyId,
@@ -6191,9 +6192,9 @@ async function Gl(e, t) {
6191
6192
  if (t.length == 0) return [];
6192
6193
  let n = await $l(e, "/users/me/labels");
6193
6194
  eu(n, "labels list");
6194
- let i = Y(n.data)?.labels, a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
6195
+ let i = J(n.data)?.labels, a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
6195
6196
  if (Array.isArray(i)) for (let e of i) {
6196
- let t = Y(e);
6197
+ let t = J(e);
6197
6198
  typeof t?.id == "string" && t.id.length != 0 && (a.add(t.id), typeof t.name == "string" && t.name.length > 0 && o.set(t.name.toLowerCase(), t.id));
6198
6199
  }
6199
6200
  return [...new Set(t.map((e) => {
@@ -6213,7 +6214,7 @@ async function Kl(e, t, n, i) {
6213
6214
  startHistoryId: t.historyId
6214
6215
  });
6215
6216
  if (c.status == 404) throw new r("Gmail history checkpoint expired; recreate the Trigger.");
6216
- eu(c, "history list"), s = Y(c.data) ?? {};
6217
+ eu(c, "history list"), s = J(c.data) ?? {};
6217
6218
  for (let e of s.history ?? []) for (let t of e.messagesAdded ?? []) {
6218
6219
  let e = t.message?.id;
6219
6220
  e != null && e.length > 0 && !a.has(e) && a.set(e, { id: e });
@@ -6241,7 +6242,7 @@ function ql(e, t) {
6241
6242
  }
6242
6243
  async function Jl(e, t) {
6243
6244
  let n = await $l(e, `/users/me/messages/${encodeURIComponent(t)}`, { format: "metadata" });
6244
- return n.status == 404 ? null : (eu(n, "message metadata fetch"), Y(n.data) ?? null);
6245
+ return n.status == 404 ? null : (eu(n, "message metadata fetch"), J(n.data) ?? null);
6245
6246
  }
6246
6247
  async function Yl(e, t, n, r) {
6247
6248
  let i = t.labelIds ?? [];
@@ -6261,8 +6262,8 @@ async function Zl(e, t, n, r) {
6261
6262
  q: `${n} rfc822msgid:${i}`
6262
6263
  });
6263
6264
  eu(a, "query match");
6264
- let o = Y(a.data)?.messages;
6265
- return Array.isArray(o) && o.some((e) => Y(e)?.id === t.id);
6265
+ let o = J(a.data)?.messages;
6266
+ return Array.isArray(o) && o.some((e) => J(e)?.id === t.id);
6266
6267
  }
6267
6268
  function Ql(e) {
6268
6269
  let t = e.payload?.headers ?? [];
@@ -6306,7 +6307,7 @@ function nu(e, t) {
6306
6307
  let r = Date.parse(t);
6307
6308
  return Number.isNaN(r) ? "" : new Date(r).toISOString();
6308
6309
  }
6309
- function Y(e) {
6310
+ function J(e) {
6310
6311
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
6311
6312
  }
6312
6313
  //#endregion
@@ -6443,7 +6444,7 @@ function ou(e) {
6443
6444
  };
6444
6445
  }
6445
6446
  function su(e) {
6446
- let t = X(e), n = typeof t?.pageToken == "string" ? t.pageToken : void 0, i = typeof t?.calendarId == "string" ? t.calendarId : void 0;
6447
+ let t = Y(e), n = typeof t?.pageToken == "string" ? t.pageToken : void 0, i = typeof t?.calendarId == "string" ? t.calendarId : void 0;
6447
6448
  if (typeof t?.syncToken == "string" && t.syncToken.length > 0) return {
6448
6449
  calendarId: i,
6449
6450
  ...n == null ? {} : { pageToken: n },
@@ -6474,7 +6475,7 @@ async function cu(e, t, n, r) {
6474
6475
  events: []
6475
6476
  };
6476
6477
  mu(e, r, "seed full sync");
6477
- let o = X(r.data) ?? {};
6478
+ let o = Y(r.data) ?? {};
6478
6479
  if (o.nextSyncToken) return {
6479
6480
  checkpoint: {
6480
6481
  calendarId: t.calendarId,
@@ -6514,7 +6515,7 @@ async function lu(e, t, n) {
6514
6515
  filtered: i
6515
6516
  };
6516
6517
  mu(e, s, "incremental sync");
6517
- let c = X(s.data) ?? {};
6518
+ let c = Y(s.data) ?? {};
6518
6519
  for (let e of c.items ?? []) {
6519
6520
  if (e.id == null || e.id.length == 0) continue;
6520
6521
  let n = uu(e);
@@ -6605,15 +6606,15 @@ function hu(e) {
6605
6606
  return e.status == 400 && !_u(e.data);
6606
6607
  }
6607
6608
  function gu(e) {
6608
- let t = X(X(e)?.error)?.errors;
6609
+ let t = Y(Y(e)?.error)?.errors;
6609
6610
  return Array.isArray(t) ? t.flatMap((e) => {
6610
- let t = X(e)?.reason;
6611
+ let t = Y(e)?.reason;
6611
6612
  return typeof t == "string" ? [t] : [];
6612
6613
  }) : [];
6613
6614
  }
6614
6615
  function _u(e) {
6615
6616
  if (gu(e).includes("fullSyncRequired")) return !0;
6616
- let t = X(X(e)?.error)?.message;
6617
+ let t = Y(Y(e)?.error)?.message;
6617
6618
  return typeof t == "string" && t.includes("fullSyncRequired");
6618
6619
  }
6619
6620
  function vu(e) {
@@ -6626,7 +6627,7 @@ function yu(e) {
6626
6627
  let t = Date.parse(e);
6627
6628
  return Number.isNaN(t) ? null : Math.floor(t / 1e3);
6628
6629
  }
6629
- function X(e) {
6630
+ function Y(e) {
6630
6631
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
6631
6632
  }
6632
6633
  //#endregion
@@ -6751,7 +6752,7 @@ var bu = 6012e5, xu = 36e5, Su = 6e4, Cu = 6e4, wu = 2, Tu = 100, Eu = new TextE
6751
6752
  },
6752
6753
  snapshot: Ou,
6753
6754
  async receive(e) {
6754
- let t = await Xu(e);
6755
+ let t = await Yu(e);
6755
6756
  if (t.outcome != "wake") return t;
6756
6757
  let n = Au(e.state), r = e.header("x-goog-resource-state");
6757
6758
  if (!e.admit) return e.current ? {
@@ -6789,19 +6790,19 @@ var bu = 6012e5, xu = 36e5, Su = 6e4, Cu = 6e4, wu = 2, Tu = 100, Eu = new TextE
6789
6790
  },
6790
6791
  async reconcile(e) {
6791
6792
  let t = Au(e.state), n = Nu(t), r = e.now.getTime(), i = n.filter((e) => Date.parse(e.expiration) > r);
6792
- if (i.length != n.length && (n = i, await Z(t, n, e.now)), !e.active) return await Fu(e, n);
6793
+ if (i.length != n.length && (n = i, await X(t, n, e.now)), !e.active) return await Fu(e, n);
6793
6794
  let a = n.filter((e) => e.state == "creating" && e.resourceId != null).toSorted((e, t) => Date.parse(t.createdAt) - Date.parse(e.createdAt))[0];
6794
6795
  a != null && (n = n.map((e) => ({
6795
6796
  ...e,
6796
6797
  state: e.id == a.id ? "active" : "retiring"
6797
- })), await Z(t, n, e.now));
6798
+ })), await X(t, n, e.now));
6798
6799
  let o = n.find((e) => e.state == "active"), s = n.filter((e) => e.state == "creating").filter((e) => Date.parse(e.createdAt) + Su <= r);
6799
6800
  if (s.length > 0) {
6800
6801
  let r = new Set(s.map((e) => e.id));
6801
6802
  n = n.map((e) => r.has(e.id) ? {
6802
6803
  ...e,
6803
6804
  state: "retiring"
6804
- } : e), await Z(t, n, e.now);
6805
+ } : e), await X(t, n, e.now);
6805
6806
  }
6806
6807
  if (o = n.find((e) => e.state == "active"), o != null) {
6807
6808
  try {
@@ -6809,9 +6810,9 @@ var bu = 6012e5, xu = 36e5, Su = 6e4, Cu = 6e4, wu = 2, Tu = 100, Eu = new TextE
6809
6810
  } catch {
6810
6811
  return { outcome: "ready" };
6811
6812
  }
6812
- if (o = n.find((e) => e.state == "active"), o != null && Date.parse(o.expiration) - xu > r) return await Z(t, n, Gu(n, e.now)), { outcome: "ready" };
6813
+ if (o = n.find((e) => e.state == "active"), o != null && Date.parse(o.expiration) - xu > r) return await X(t, n, Gu(n, e.now)), { outcome: "ready" };
6813
6814
  }
6814
- return n.some((e) => e.state == "creating") || n.filter((e) => e.resourceId == null).length >= wu ? (await Z(t, n, Gu(n, e.now)), { outcome: o == null ? "pending" : "ready" }) : await Pu(e, n);
6815
+ return n.some((e) => e.state == "creating") || n.filter((e) => e.resourceId == null).length >= wu ? (await X(t, n, Gu(n, e.now)), { outcome: o == null ? "pending" : "ready" }) : await Pu(e, n);
6815
6816
  }
6816
6817
  };
6817
6818
  function Au(e) {
@@ -6829,7 +6830,7 @@ function ju(e) {
6829
6830
  };
6830
6831
  }
6831
6832
  function Mu(e) {
6832
- let n = Yu(e) ? Q(e.pageToken) : void 0;
6833
+ let n = Q(e) ? Z(e.pageToken) : void 0;
6833
6834
  if (n == null) throw new t("Google Drive checkpoint pageToken is missing.");
6834
6835
  return n;
6835
6836
  }
@@ -6865,7 +6866,7 @@ async function Pu(r, i) {
6865
6866
  id: crypto.randomUUID(),
6866
6867
  state: "creating"
6867
6868
  };
6868
- i = [...i, c], await Z(a, i, new Date(r.now.getTime() + Su));
6869
+ i = [...i, c], await X(a, i, new Date(r.now.getTime() + Su));
6869
6870
  let l;
6870
6871
  try {
6871
6872
  l = await Bu(r, {
@@ -6887,9 +6888,9 @@ async function Pu(r, i) {
6887
6888
  }
6888
6889
  }, "changes.watch");
6889
6890
  } catch (n) {
6890
- throw (n instanceof e || n instanceof t) && await Z(a, i.filter((e) => e.id != c.id), r.now), n;
6891
+ throw (n instanceof e || n instanceof t) && await X(a, i.filter((e) => e.id != c.id), r.now), n;
6891
6892
  }
6892
- let u = Q(l.resourceId);
6893
+ let u = Z(l.resourceId);
6893
6894
  if (u == null) throw new n("Google Drive changes.watch response is missing resourceId.");
6894
6895
  let d = Ju(l.expiration) ?? c.expiration;
6895
6896
  i = i.map((e) => e.id == c.id ? {
@@ -6900,20 +6901,20 @@ async function Pu(r, i) {
6900
6901
  } : e.state == "active" ? {
6901
6902
  ...e,
6902
6903
  state: "retiring"
6903
- } : e), await Z(a, i, Gu(i, r.now));
6904
+ } : e), await X(a, i, Gu(i, r.now));
6904
6905
  try {
6905
6906
  i = await Iu(r, i);
6906
6907
  } catch {
6907
6908
  return { outcome: "ready" };
6908
6909
  }
6909
- return await Z(a, i, Gu(i, r.now)), { outcome: "ready" };
6910
+ return await X(a, i, Gu(i, r.now)), { outcome: "ready" };
6910
6911
  }
6911
6912
  async function Fu(e, t) {
6912
6913
  let n = Au(e.state);
6913
6914
  return t.some((e) => e.state == "active" || e.state == "creating") && (t = t.map((e) => ({
6914
6915
  ...e,
6915
6916
  state: "retiring"
6916
- })), await Z(n, t, e.now)), t = await Iu(e, t), t.length == 0 ? { outcome: "ready" } : (await Z(n, t, Gu(t, e.now)), { outcome: "pending" });
6917
+ })), await X(n, t, e.now)), t = await Iu(e, t), t.length == 0 ? { outcome: "ready" } : (await X(n, t, Gu(t, e.now)), { outcome: "pending" });
6917
6918
  }
6918
6919
  async function Iu(e, t) {
6919
6920
  let n = Au(e.state);
@@ -6923,7 +6924,7 @@ async function Iu(e, t) {
6923
6924
  ...e,
6924
6925
  state: "stopping"
6925
6926
  } : e);
6926
- await Z(n, i, new Date(e.now.getTime() + Cu)), await zu(e, r), t = i.filter((e) => e.id != r.id), await Z(n, t, e.now);
6927
+ await X(n, i, new Date(e.now.getTime() + Cu)), await zu(e, r), t = i.filter((e) => e.id != r.id), await X(n, t, e.now);
6927
6928
  }
6928
6929
  return t;
6929
6930
  }
@@ -6935,7 +6936,7 @@ async function Lu(e) {
6935
6936
  ...t.driveId == null ? {} : { driveId: t.driveId },
6936
6937
  supportsAllDrives: !0
6937
6938
  }
6938
- }, "changes.getStartPageToken"), i = Yu(r) ? Q(r.startPageToken) : void 0;
6939
+ }, "changes.getStartPageToken"), i = Q(r) ? Z(r.startPageToken) : void 0;
6939
6940
  if (i == null) throw new n("Google Drive startPageToken response is invalid.");
6940
6941
  return i;
6941
6942
  }
@@ -6955,10 +6956,10 @@ async function Ru(e, t) {
6955
6956
  supportsAllDrives: !0
6956
6957
  }
6957
6958
  }, "changes.list");
6958
- for (let e of ["nextPageToken", "newStartPageToken"]) if (a[e] !== void 0 && Q(a[e]) == null) throw new n(`Google Drive changes response contains an invalid ${e}.`);
6959
- let o = Q(a.nextPageToken), s = o ?? Q(a.newStartPageToken);
6959
+ for (let e of ["nextPageToken", "newStartPageToken"]) if (a[e] !== void 0 && Z(a[e]) == null) throw new n(`Google Drive changes response contains an invalid ${e}.`);
6960
+ let o = Z(a.nextPageToken), s = o ?? Z(a.newStartPageToken);
6960
6961
  if (s == null) throw new n("Google Drive changes response is missing its next checkpoint.");
6961
- if (a.changes != null && (!Array.isArray(a.changes) || !a.changes.every(Yu))) throw new n("Google Drive changes response contains invalid changes.");
6962
+ if (a.changes != null && (!Array.isArray(a.changes) || !a.changes.every(Q))) throw new n("Google Drive changes response contains invalid changes.");
6962
6963
  if (o === i) throw new n("Google Drive changes continuation did not advance.");
6963
6964
  return {
6964
6965
  changes: a.changes ?? [],
@@ -6980,7 +6981,7 @@ async function zu(e, t) {
6980
6981
  }
6981
6982
  async function Bu(e, t, n) {
6982
6983
  let r = await Vu(e, t);
6983
- if (r.status >= 200 && r.status < 300 && Yu(r.data)) return r.data;
6984
+ if (r.status >= 200 && r.status < 300 && Q(r.data)) return r.data;
6984
6985
  Hu(r, n);
6985
6986
  }
6986
6987
  async function Vu(t, r) {
@@ -6995,12 +6996,12 @@ function Hu(r, i) {
6995
6996
  throw r.status == 401 || r.status == 403 && !a.toLowerCase().includes("ratelimit") ? new e(`Google Drive ${i} requires Connection reauthorization.`) : r.status == 408 || r.status == 429 || r.status >= 500 ? new n(`Google Drive ${i} is temporarily unavailable.`) : new t(`Google Drive ${i} rejected the subscription${a == "" ? "." : ` with ${a}.`}`);
6996
6997
  }
6997
6998
  function Uu(e) {
6998
- if (!Yu(e) || !Yu(e.error)) return "";
6999
+ if (!Q(e) || !Q(e.error)) return "";
6999
7000
  let t = e.error.errors;
7000
- return Array.isArray(t) && Yu(t[0]) && typeof t[0].reason == "string" ? t[0].reason : typeof e.error.status == "string" ? e.error.status : "";
7001
+ return Array.isArray(t) && Q(t[0]) && typeof t[0].reason == "string" ? t[0].reason : typeof e.error.status == "string" ? e.error.status : "";
7001
7002
  }
7002
7003
  function Wu(e, t) {
7003
- let n = Q(e.driveId), r = Q(e.fileId), i = Q(e.time), a = Q(e.changeType), o = e.removed === !0;
7004
+ let n = Z(e.driveId), r = Z(e.fileId), i = Z(e.time), a = Z(e.changeType), o = e.removed === !0;
7004
7005
  return {
7005
7006
  changeId: [
7006
7007
  n ?? "my-drive",
@@ -7011,14 +7012,14 @@ function Wu(e, t) {
7011
7012
  ].join(":"),
7012
7013
  changeType: a ?? null,
7013
7014
  driveId: n ?? null,
7014
- file: Yu(e.file) ? e.file : null,
7015
+ file: Q(e.file) ? e.file : null,
7015
7016
  fileId: r ?? null,
7016
7017
  notification: t,
7017
7018
  removed: o,
7018
7019
  time: i ?? null
7019
7020
  };
7020
7021
  }
7021
- async function Z(e, t, n) {
7022
+ async function X(e, t, n) {
7022
7023
  await e.saveSubscription({ channels: t }, n);
7023
7024
  }
7024
7025
  function Gu(e, t) {
@@ -7042,13 +7043,13 @@ function Ju(e) {
7042
7043
  let t = typeof e == "string" || typeof e == "number" ? Number(e) : NaN;
7043
7044
  return Number.isFinite(t) && t > 0 ? new Date(t).toISOString() : void 0;
7044
7045
  }
7045
- function Q(e) {
7046
+ function Z(e) {
7046
7047
  return typeof e == "string" && e.length > 0 ? e : void 0;
7047
7048
  }
7048
- function Yu(e) {
7049
+ function Q(e) {
7049
7050
  return typeof e == "object" && !!e && !Array.isArray(e);
7050
7051
  }
7051
- async function Xu(e) {
7052
+ async function Yu(e) {
7052
7053
  let t = Au(e.state), n = e.header("x-goog-channel-id"), r = e.header("x-goog-resource-id"), i = e.header("x-goog-resource-state"), a = e.header("x-goog-channel-token");
7053
7054
  if (n == null || r == null || i == null || a == null) return {
7054
7055
  body: "",
@@ -7065,15 +7066,15 @@ async function Xu(e) {
7065
7066
  } : (s.resourceId ?? (o = o.map((e) => e.id == n ? {
7066
7067
  ...e,
7067
7068
  resourceId: r
7068
- } : e), await Z(t, o, e.now)), i != "sync" && i != "change" ? {
7069
+ } : e), await X(t, o, e.now)), i != "sync" && i != "change" ? {
7069
7070
  outcome: "ignored",
7070
7071
  reason: "Google Drive notification state is not actionable."
7071
7072
  } : { outcome: "wake" });
7072
7073
  }
7073
- var Zu = {
7074
+ var Xu = {
7074
7075
  initialState: ku.initialState,
7075
7076
  reconcile: ku.reconcile,
7076
- receive: Xu,
7077
+ receive: Yu,
7077
7078
  listener: {
7078
7079
  intervalMs: 3e5,
7079
7080
  async read(e) {
@@ -7110,12 +7111,12 @@ var Zu = {
7110
7111
  nullable: !1
7111
7112
  }]
7112
7113
  }
7113
- }, Qu = "application/vnd.google-apps.folder", $u = "nextPageToken,incompleteSearch,files(id,name,mimeType,createdTime,modifiedTime,parents,trashed,webViewLink,driveId,size,version,lastModifyingUser(displayName,emailAddress))", ed = /* @__PURE__ */ new Set([
7114
+ }, Zu = "application/vnd.google-apps.folder", Qu = "nextPageToken,incompleteSearch,files(id,name,mimeType,createdTime,modifiedTime,parents,trashed,webViewLink,driveId,size,version,lastModifyingUser(displayName,emailAddress))", $u = /* @__PURE__ */ new Set([
7114
7115
  "rateLimitExceeded",
7115
7116
  "userRateLimitExceeded",
7116
7117
  "dailyLimitExceeded",
7117
7118
  "sharingRateLimitExceeded"
7118
- ]), td = /* @__PURE__ */ new Set(["insufficientFilePermissions", "appNotAuthorizedToFile"]), nd = {
7119
+ ]), ed = /* @__PURE__ */ new Set(["insufficientFilePermissions", "appNotAuthorizedToFile"]), td = {
7119
7120
  buildOutputs: o,
7120
7121
  snapshot: {
7121
7122
  configSchema: {
@@ -7234,16 +7235,16 @@ var Zu = {
7234
7235
  type: "poll"
7235
7236
  },
7236
7237
  async poll(e) {
7237
- let t = rd(e.config);
7238
- if (e.checkpoint === null) return ad(e, t);
7239
- let n = id(e.checkpoint);
7240
- return n.changeType === t.changeType ? sd(e, t, n) : {
7241
- checkpoint: od(e.now, t.changeType),
7238
+ let t = nd(e.config);
7239
+ if (e.checkpoint === null) return id(e, t);
7240
+ let n = rd(e.checkpoint);
7241
+ return n.changeType === t.changeType ? od(e, t, n) : {
7242
+ checkpoint: ad(e.now, t.changeType),
7242
7243
  events: []
7243
7244
  };
7244
7245
  }
7245
7246
  };
7246
- function rd(e) {
7247
+ function nd(e) {
7247
7248
  return {
7248
7249
  changeType: e.changeType,
7249
7250
  driveId: e.driveId ?? "",
@@ -7254,7 +7255,7 @@ function rd(e) {
7254
7255
  namePrefix: e.namePrefix ?? ""
7255
7256
  };
7256
7257
  }
7257
- function id(e) {
7258
+ function rd(e) {
7258
7259
  let t = $(e);
7259
7260
  if (typeof t?.since != "string" || Number.isNaN(Date.parse(t.since))) throw new r("Google Drive checkpoint is invalid; recreate the Trigger.");
7260
7261
  let n = t.boundaryKeys;
@@ -7268,23 +7269,23 @@ function id(e) {
7268
7269
  ...Array.isArray(n) ? { boundaryKeys: n.filter((e) => typeof e == "string") } : {}
7269
7270
  };
7270
7271
  }
7271
- async function ad(e, t) {
7272
- let n = await hd(e, `/drive/v3/files/${encodeURIComponent(t.folderId)}`, {
7272
+ async function id(e, t) {
7273
+ let n = await md(e, `/drive/v3/files/${encodeURIComponent(t.folderId)}`, {
7273
7274
  fields: "id,name,mimeType,driveId,trashed",
7274
7275
  supportsAllDrives: "true"
7275
7276
  });
7276
- gd(n, "folder probe");
7277
+ hd(n, "folder probe");
7277
7278
  let i = $(n.data);
7278
7279
  if (i == null) throw new a("Google Drive folder probe returned no payload.");
7279
- if (i.mimeType !== Qu) throw new r("Google Drive folderId does not point to a folder.");
7280
+ if (i.mimeType !== Zu) throw new r("Google Drive folderId does not point to a folder.");
7280
7281
  if (i.trashed === !0) throw new r("The Google Drive folder is in the trash.");
7281
7282
  if (t.driveId.length > 0 && (i.driveId ?? "") !== t.driveId) throw new r("The configured Google Drive shared drive does not contain this folder.");
7282
7283
  return {
7283
- checkpoint: od(e.now, t.changeType),
7284
+ checkpoint: ad(e.now, t.changeType),
7284
7285
  events: []
7285
7286
  };
7286
7287
  }
7287
- function od(e, t) {
7288
+ function ad(e, t) {
7288
7289
  let n = e.toISOString();
7289
7290
  return {
7290
7291
  changeType: t,
@@ -7292,11 +7293,11 @@ function od(e, t) {
7292
7293
  since: n
7293
7294
  };
7294
7295
  }
7295
- async function sd(e, t, n) {
7296
- let r = ud(t, n.since, n.floor), i = `${t.driveId}|${r}`, a = n.pageQuery == i ? n.pageToken : void 0, o = await hd(e, "/drive/v3/files", {
7296
+ async function od(e, t, n) {
7297
+ let r = ld(t, n.since, n.floor), i = `${t.driveId}|${r}`, a = n.pageQuery == i ? n.pageToken : void 0, o = await md(e, "/drive/v3/files", {
7297
7298
  corpora: t.driveId.length == 0 ? "allDrives" : "drive",
7298
7299
  driveId: t.driveId.length == 0 ? void 0 : t.driveId,
7299
- fields: $u,
7300
+ fields: Qu,
7300
7301
  includeItemsFromAllDrives: "true",
7301
7302
  pageSize: t.maxFilesPerPoll,
7302
7303
  pageToken: a,
@@ -7304,74 +7305,74 @@ async function sd(e, t, n) {
7304
7305
  spaces: "drive",
7305
7306
  supportsAllDrives: "true"
7306
7307
  });
7307
- gd(o, "files list");
7308
+ hd(o, "files list");
7308
7309
  let s = $(o.data) ?? {}, c = new Set(n.boundaryKeys ?? []), l = [], u = [], d = a == null ? void 0 : n.maxSeen;
7309
7310
  for (let e of s.files ?? []) {
7310
7311
  if (e.id == null || e.id.length == 0) continue;
7311
- let n = pd(e, t.changeType);
7312
+ let n = fd(e, t.changeType);
7312
7313
  if (n == null) continue;
7313
- let r = md(e, e.id, n, t.changeType);
7314
- u.push(r.dedupeKey), bd(n, d) && (d = n), c.has(r.dedupeKey) || l.push(r);
7314
+ let r = pd(e, e.id, n, t.changeType);
7315
+ u.push(r.dedupeKey), yd(n, d) && (d = n), c.has(r.dedupeKey) || l.push(r);
7315
7316
  }
7316
7317
  if (s.incompleteSearch === !0) {
7317
- let e = a == null ? {} : cd(a, i, d);
7318
+ let e = a == null ? {} : sd(a, i, d);
7318
7319
  return {
7319
- checkpoint: ld(n, t.changeType, n.since, u, e),
7320
+ checkpoint: cd(n, t.changeType, n.since, u, e),
7320
7321
  events: l
7321
7322
  };
7322
7323
  }
7323
7324
  if (s.nextPageToken) return {
7324
- checkpoint: ld(n, t.changeType, n.since, u, cd(s.nextPageToken, i, d)),
7325
+ checkpoint: cd(n, t.changeType, n.since, u, sd(s.nextPageToken, i, d)),
7325
7326
  events: l,
7326
7327
  hasMore: !0
7327
7328
  };
7328
7329
  let f = d ?? n.since;
7329
7330
  return {
7330
- checkpoint: ld(n, t.changeType, f, u),
7331
+ checkpoint: cd(n, t.changeType, f, u),
7331
7332
  events: l
7332
7333
  };
7333
7334
  }
7334
- function cd(e, t, n) {
7335
+ function sd(e, t, n) {
7335
7336
  return {
7336
7337
  pageQuery: t,
7337
7338
  pageToken: e,
7338
7339
  ...n == null ? {} : { maxSeen: n }
7339
7340
  };
7340
7341
  }
7341
- function ld(e, t, n, r, i = {}) {
7342
+ function cd(e, t, n, r, i = {}) {
7342
7343
  let a = [.../* @__PURE__ */ new Set([...e.boundaryKeys ?? [], ...r])].map((e) => ({
7343
7344
  at: Date.parse(e.slice(e.indexOf(":") + 1)),
7344
7345
  key: e
7345
- })).filter(({ at: t }) => t >= dd(n, e.floor)).toSorted((e, t) => t.at - e.at).slice(0, 200).map(({ key: e }) => e);
7346
+ })).filter(({ at: t }) => t >= ud(n, e.floor)).toSorted((e, t) => t.at - e.at).slice(0, 200).map(({ key: e }) => e);
7346
7347
  return {
7347
7348
  changeType: t,
7348
7349
  since: n,
7349
- ...fd(e.floor, n),
7350
+ ...dd(e.floor, n),
7350
7351
  ...i,
7351
7352
  ...a.length == 0 ? {} : { boundaryKeys: a }
7352
7353
  };
7353
7354
  }
7354
- function ud(e, t, n) {
7355
+ function ld(e, t, n) {
7355
7356
  let r = e.changeType == "created" ? "createdTime" : "modifiedTime", i = [
7356
- `'${yd(e.folderId)}' in parents`,
7357
+ `'${vd(e.folderId)}' in parents`,
7357
7358
  "trashed = false",
7358
- `${r} >= '${new Date(dd(t, n)).toISOString()}'`
7359
+ `${r} >= '${new Date(ud(t, n)).toISOString()}'`
7359
7360
  ];
7360
- return e.itemTypes.has("folder") ? e.itemTypes.has("file") || i.push(`mimeType = '${Qu}'`) : i.push(`mimeType != '${Qu}'`), e.mimeTypes.length > 0 && i.push(`(${e.mimeTypes.map((e) => `mimeType = '${yd(e)}'`).join(" or ")})`), e.namePrefix.length > 0 && i.push(`name contains '${yd(e.namePrefix)}'`), i.join(" and ");
7361
+ return e.itemTypes.has("folder") ? e.itemTypes.has("file") || i.push(`mimeType = '${Zu}'`) : i.push(`mimeType != '${Zu}'`), e.mimeTypes.length > 0 && i.push(`(${e.mimeTypes.map((e) => `mimeType = '${vd(e)}'`).join(" or ")})`), e.namePrefix.length > 0 && i.push(`name contains '${vd(e.namePrefix)}'`), i.join(" and ");
7361
7362
  }
7362
- function dd(e, t) {
7363
+ function ud(e, t) {
7363
7364
  let n = Date.parse(e) - 6e4, r = t == null ? NaN : Date.parse(t);
7364
7365
  return Number.isNaN(r) ? n : Math.max(n, r);
7365
7366
  }
7366
- function fd(e, t) {
7367
+ function dd(e, t) {
7367
7368
  return e == null || Number.isNaN(Date.parse(e)) || Date.parse(t) - 6e4 >= Date.parse(e) ? {} : { floor: e };
7368
7369
  }
7369
- function pd(e, t) {
7370
+ function fd(e, t) {
7370
7371
  let n = t == "created" ? e.createdTime : e.modifiedTime;
7371
7372
  return n == null || n.length == 0 || Number.isNaN(Date.parse(n)) ? void 0 : n;
7372
7373
  }
7373
- function md(e, t, n, r) {
7374
- let i = e.mimeType == Qu ? "folder" : "file", a = e.lastModifyingUser;
7374
+ function pd(e, t, n, r) {
7375
+ let i = e.mimeType == Zu ? "folder" : "file", a = e.lastModifyingUser;
7375
7376
  return {
7376
7377
  dedupeKey: `${t}:${n}`,
7377
7378
  payload: {
@@ -7393,7 +7394,7 @@ function md(e, t, n, r) {
7393
7394
  }
7394
7395
  };
7395
7396
  }
7396
- async function hd(e, t, n) {
7397
+ async function md(e, t, n) {
7397
7398
  try {
7398
7399
  return await e.connector.execute({
7399
7400
  endpoint: t,
@@ -7404,32 +7405,32 @@ async function hd(e, t, n) {
7404
7405
  throw new a(`Google Drive proxy request to ${t} failed.`, { cause: e });
7405
7406
  }
7406
7407
  }
7407
- function gd(e, t) {
7408
+ function hd(e, t) {
7408
7409
  if (!(e.status >= 200 && e.status < 300)) {
7409
7410
  if (e.status == 400 || e.status == 404) throw new r(`Google Drive ${t} rejected the configuration.`);
7410
7411
  if (e.status == 401) throw new i(`Google Drive ${t} rejected the Connection.`);
7411
7412
  if (e.status == 403) {
7412
- let n = _d(e.data);
7413
- if (n.some((e) => ed.has(e))) throw new a(`Google Drive ${t} was rate limited.`);
7414
- if (n.some((e) => td.has(e))) throw new r(`Google Drive ${t} was rejected by an ACL.`);
7415
- if (vd(e.data)) throw new i(`Google Drive ${t} needs additional scopes.`);
7413
+ let n = gd(e.data);
7414
+ if (n.some((e) => $u.has(e))) throw new a(`Google Drive ${t} was rate limited.`);
7415
+ if (n.some((e) => ed.has(e))) throw new r(`Google Drive ${t} was rejected by an ACL.`);
7416
+ if (_d(e.data)) throw new i(`Google Drive ${t} needs additional scopes.`);
7416
7417
  }
7417
7418
  throw new a(`Google Drive ${t} failed with status ${e.status}.`);
7418
7419
  }
7419
7420
  }
7420
- function _d(e) {
7421
+ function gd(e) {
7421
7422
  let t = $($(e)?.error);
7422
7423
  return [...[t?.errors, t?.details].flatMap((e) => Array.isArray(e) ? e : []).map((e) => $(e)?.reason), t?.status].filter((e) => typeof e == "string");
7423
7424
  }
7424
- function vd(e) {
7425
- if (_d(e).includes("ACCESS_TOKEN_SCOPE_INSUFFICIENT")) return !0;
7425
+ function _d(e) {
7426
+ if (gd(e).includes("ACCESS_TOKEN_SCOPE_INSUFFICIENT")) return !0;
7426
7427
  let t = $($(e)?.error)?.message;
7427
7428
  return typeof t == "string" && t.toLowerCase().includes("insufficient authentication scopes");
7428
7429
  }
7429
- function yd(e) {
7430
+ function vd(e) {
7430
7431
  return e.replaceAll("\\", "\\\\").replaceAll("'", "\\'");
7431
7432
  }
7432
- function bd(e, t) {
7433
+ function yd(e, t) {
7433
7434
  let n = Date.parse(e);
7434
7435
  return Number.isNaN(n) ? !1 : t == null || Number.isNaN(Date.parse(t)) || n > Date.parse(t);
7435
7436
  }
@@ -7438,14 +7439,14 @@ function $(e) {
7438
7439
  }
7439
7440
  //#endregion
7440
7441
  //#region src/trigger/providers/google-sheets/on-row-added.ts
7441
- var xd = [
7442
+ var bd = [
7442
7443
  "permission_denied",
7443
7444
  "accessnotconfigured",
7444
7445
  "insufficientfilepermissions",
7445
7446
  "appnotauthorizedtofile",
7446
7447
  "the caller does not have permission",
7447
7448
  "has not been used in project"
7448
- ], Sd = ["ratelimitexceeded", "dailylimitexceeded"], Cd = {
7449
+ ], xd = ["ratelimitexceeded", "dailylimitexceeded"], Sd = {
7449
7450
  buildOutputs: o,
7450
7451
  snapshot: {
7451
7452
  configSchema: {
@@ -7544,19 +7545,19 @@ var xd = [
7544
7545
  type: "poll"
7545
7546
  },
7546
7547
  async poll(e) {
7547
- let t = wd(e.config);
7548
+ let t = Cd(e.config);
7548
7549
  if (e.checkpoint === null) return {
7549
- checkpoint: await Dd(e, t, await Ed(e, t)),
7550
+ checkpoint: await Ed(e, t, await Td(e, t)),
7550
7551
  events: []
7551
7552
  };
7552
- let n = Td(e.checkpoint), r = await Ed(e, t);
7553
+ let n = wd(e.checkpoint), r = await Td(e, t);
7553
7554
  if (n.spreadsheetId !== t.spreadsheetId || n.sheetId !== r.sheetId || n.lastRowNumber > r.rowCount) return {
7554
- checkpoint: await Dd(e, t, r),
7555
+ checkpoint: await Ed(e, t, r),
7555
7556
  events: []
7556
7557
  };
7557
- let i = await kd(e, t, r), a = Math.min(Math.max(t.firstDataRow, n.lastRowNumber), r.rowCount), o = Math.min(a + t.maxRowsPerPoll, r.rowCount), s = await Ad(e, t, r, a, o, "row window fetch");
7558
+ let i = await Od(e, t, r), a = Math.min(Math.max(t.firstDataRow, n.lastRowNumber), r.rowCount), o = Math.min(a + t.maxRowsPerPoll, r.rowCount), s = await kd(e, t, r, a, o, "row window fetch");
7558
7559
  if (s.length == 0 && n.lastRowNumber >= t.firstDataRow) return {
7559
- checkpoint: await Dd(e, t, r),
7560
+ checkpoint: await Ed(e, t, r),
7560
7561
  events: []
7561
7562
  };
7562
7563
  let c = a + s.length - 1;
@@ -7568,11 +7569,11 @@ var xd = [
7568
7569
  for (let [e, o] of s.entries()) {
7569
7570
  let s = a + e;
7570
7571
  if (!(s <= n.lastRowNumber)) {
7571
- if (s == t.headerRow || Md(o)) {
7572
+ if (s == t.headerRow || jd(o)) {
7572
7573
  u += 1;
7573
7574
  continue;
7574
7575
  }
7575
- l.push(await Nd(t, r, s, o, i));
7576
+ l.push(await Md(t, r, s, o, i));
7576
7577
  }
7577
7578
  }
7578
7579
  let d = c == o && o < r.rowCount;
@@ -7588,7 +7589,7 @@ var xd = [
7588
7589
  };
7589
7590
  }
7590
7591
  };
7591
- function wd(e) {
7592
+ function Cd(e) {
7592
7593
  let t = (e.columnRange ?? "A:ZZZ").trim(), n = t.indexOf(":"), r = n < 0 ? t : t.slice(0, n), i = n < 0 ? t : t.slice(n + 1), a = e.spreadsheetId.trim();
7593
7594
  return {
7594
7595
  colEnd: i,
@@ -7602,8 +7603,8 @@ function wd(e) {
7602
7603
  valueRender: e.valueRender ?? "UNFORMATTED_VALUE"
7603
7604
  };
7604
7605
  }
7605
- function Td(e) {
7606
- let t = zd(e);
7606
+ function wd(e) {
7607
+ let t = Rd(e);
7607
7608
  if (typeof t?.spreadsheetId != "string" || !Number.isInteger(t.sheetId) || !Number.isInteger(t.lastRowNumber)) throw new r("Google Sheets checkpoint is invalid; recreate the Trigger.");
7608
7609
  return {
7609
7610
  lastRowNumber: t.lastRowNumber,
@@ -7611,11 +7612,11 @@ function Td(e) {
7611
7612
  spreadsheetId: t.spreadsheetId
7612
7613
  };
7613
7614
  }
7614
- async function Ed(e, t) {
7615
- let n = await Fd(e, `/spreadsheets/${encodeURIComponent(t.spreadsheetId)}`, { fields: "sheets.properties(sheetId,title,sheetType,gridProperties)" });
7615
+ async function Td(e, t) {
7616
+ let n = await Pd(e, `/spreadsheets/${encodeURIComponent(t.spreadsheetId)}`, { fields: "sheets.properties(sheetId,title,sheetType,gridProperties)" });
7616
7617
  if (n.status == 404) throw new r("The Google Sheets spreadsheet was not found.");
7617
- Id(n, "spreadsheet metadata fetch");
7618
- let i = zd(n.data)?.sheets, o = (Array.isArray(i) ? i.map((e) => zd(zd(e)?.properties)) : []).filter((e) => e != null), s = (/^\d+$/.test(t.sheet) ? o.find(({ sheetId: e }) => e === Number(t.sheet)) : void 0) ?? o.find(({ title: e }) => e === t.sheet);
7618
+ Fd(n, "spreadsheet metadata fetch");
7619
+ let i = Rd(n.data)?.sheets, o = (Array.isArray(i) ? i.map((e) => Rd(Rd(e)?.properties)) : []).filter((e) => e != null), s = (/^\d+$/.test(t.sheet) ? o.find(({ sheetId: e }) => e === Number(t.sheet)) : void 0) ?? o.find(({ title: e }) => e === t.sheet);
7619
7620
  if (s == null) throw new r(`Google Sheets tab "${t.sheet}" does not exist.`);
7620
7621
  if (s.sheetType != null && s.sheetType !== "GRID") throw new r("The Google Sheets tab is not a grid sheet.");
7621
7622
  let c = s.gridProperties?.rowCount;
@@ -7626,45 +7627,45 @@ async function Ed(e, t) {
7626
7627
  title: s.title
7627
7628
  };
7628
7629
  }
7629
- async function Dd(e, t, n) {
7630
+ async function Ed(e, t, n) {
7630
7631
  return {
7631
- lastRowNumber: await Od(e, t, n),
7632
+ lastRowNumber: await Dd(e, t, n),
7632
7633
  sheetId: n.sheetId,
7633
7634
  spreadsheetId: t.spreadsheetId
7634
7635
  };
7635
7636
  }
7636
- async function Od(e, t, n) {
7637
+ async function Dd(e, t, n) {
7637
7638
  if (n.rowCount < t.firstDataRow) return t.firstDataRow - 1;
7638
- let r = await Ad(e, t, n, t.firstDataRow, n.rowCount, "full-range scan");
7639
+ let r = await kd(e, t, n, t.firstDataRow, n.rowCount, "full-range scan");
7639
7640
  return r.length == 0 ? t.firstDataRow - 1 : t.firstDataRow + r.length - 1;
7640
7641
  }
7641
- async function kd(e, t, n) {
7642
- let r = await Fd(e, Pd(t, n, t.headerRow, t.headerRow), {
7642
+ async function Od(e, t, n) {
7643
+ let r = await Pd(e, Nd(t, n, t.headerRow, t.headerRow), {
7643
7644
  majorDimension: "ROWS",
7644
7645
  valueRenderOption: "FORMATTED_VALUE"
7645
7646
  });
7646
- return Id(r, "header row fetch"), jd(r.data)[0] ?? [];
7647
+ return Fd(r, "header row fetch"), Ad(r.data)[0] ?? [];
7647
7648
  }
7648
- async function Ad(e, t, n, r, i, a) {
7649
- let o = await Fd(e, Pd(t, n, r, i), {
7649
+ async function kd(e, t, n, r, i, a) {
7650
+ let o = await Pd(e, Nd(t, n, r, i), {
7650
7651
  dateTimeRenderOption: t.dateTimeRender,
7651
7652
  majorDimension: "ROWS",
7652
7653
  valueRenderOption: t.valueRender
7653
7654
  });
7654
- return Id(o, a), jd(o.data);
7655
+ return Fd(o, a), Ad(o.data);
7655
7656
  }
7656
- function jd(e) {
7657
- let t = zd(e)?.values;
7657
+ function Ad(e) {
7658
+ let t = Rd(e)?.values;
7658
7659
  return Array.isArray(t) ? t : [];
7659
7660
  }
7660
- function Md(e) {
7661
+ function jd(e) {
7661
7662
  return e.every((e) => e === "" || e == null);
7662
7663
  }
7663
- async function Nd(e, t, n, r, i) {
7664
- let a = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(r))), o = [...new Uint8Array(a)].slice(0, 8).map((e) => e.toString(16).padStart(2, "0")).join(""), s = {}, c = Ld(e.colStart);
7664
+ async function Md(e, t, n, r, i) {
7665
+ let a = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(JSON.stringify(r))), o = [...new Uint8Array(a)].slice(0, 8).map((e) => e.toString(16).padStart(2, "0")).join(""), s = {}, c = Id(e.colStart);
7665
7666
  for (let [e, t] of r.entries()) {
7666
7667
  let n = i[e];
7667
- s[typeof n == "string" && n.length > 0 ? n : Rd(c + e)] = t;
7668
+ s[typeof n == "string" && n.length > 0 ? n : Ld(c + e)] = t;
7668
7669
  }
7669
7670
  return {
7670
7671
  dedupeKey: `${t.sheetId}:${n}:${o}`,
@@ -7678,11 +7679,11 @@ async function Nd(e, t, n, r, i) {
7678
7679
  }
7679
7680
  };
7680
7681
  }
7681
- function Pd(e, t, n, r) {
7682
+ function Nd(e, t, n, r) {
7682
7683
  let i = encodeURIComponent(`'${t.title.replaceAll("'", "''")}'`);
7683
7684
  return `/spreadsheets/${encodeURIComponent(e.spreadsheetId)}/values/${i}!${e.colStart}${n}:${e.colEnd}${r}`;
7684
7685
  }
7685
- async function Fd(e, t, n) {
7686
+ async function Pd(e, t, n) {
7686
7687
  try {
7687
7688
  return await e.connector.execute({
7688
7689
  endpoint: t,
@@ -7693,32 +7694,32 @@ async function Fd(e, t, n) {
7693
7694
  throw new a(`Google Sheets proxy request to ${t} failed.`, { cause: e });
7694
7695
  }
7695
7696
  }
7696
- function Id(e, t) {
7697
+ function Fd(e, t) {
7697
7698
  if (e.status >= 200 && e.status < 300) return;
7698
7699
  if (e.status == 401) throw new i(`Google Sheets ${t} rejected the Connection.`);
7699
7700
  let n = JSON.stringify(e.data ?? null).toLowerCase();
7700
7701
  if (e.status == 403) {
7701
- if (Sd.some((e) => n.includes(e))) throw new a(`Google Sheets ${t} was rate limited.`);
7702
- if (xd.some((e) => n.includes(e))) throw new i(`Google Sheets ${t} rejected the Connection.`);
7702
+ if (xd.some((e) => n.includes(e))) throw new a(`Google Sheets ${t} was rate limited.`);
7703
+ if (bd.some((e) => n.includes(e))) throw new i(`Google Sheets ${t} rejected the Connection.`);
7703
7704
  }
7704
7705
  throw e.status == 400 && n.includes("unable to parse range") ? new r("Google Sheets rejected the configured range.") : e.status == 413 ? new r("Google Sheets response is too large; narrow columnRange.") : new a(`Google Sheets ${t} failed with status ${e.status}.`);
7705
7706
  }
7706
- function Ld(e) {
7707
+ function Id(e) {
7707
7708
  let t = 0;
7708
7709
  for (let n of e.toUpperCase()) t = t * 26 + n.charCodeAt(0) - 64;
7709
7710
  return t;
7710
7711
  }
7711
- function Rd(e) {
7712
+ function Ld(e) {
7712
7713
  let t = "";
7713
7714
  for (let n = e; n > 0; n = Math.floor((n - 1) / 26)) t = String.fromCharCode(65 + (n - 1) % 26) + t;
7714
7715
  return t;
7715
7716
  }
7716
- function zd(e) {
7717
+ function Rd(e) {
7717
7718
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
7718
7719
  }
7719
7720
  //#endregion
7720
7721
  //#region src/trigger/providers/linear/on-issue-changed.ts
7721
- var Bd = "^[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}$", Vd = new RegExp(Bd), Hd = 6e4, Ud = 50, Wd = {
7722
+ var zd = "^[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}$", Bd = new RegExp(zd), Vd = 6e4, Hd = 50, Ud = {
7722
7723
  buildOutputs: o,
7723
7724
  snapshot: {
7724
7725
  configSchema: {
@@ -7729,7 +7730,7 @@ var Bd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-
7729
7730
  title: "Team ID",
7730
7731
  description: "Linear Team UUID. Use Copy model UUID in Linear to find it.",
7731
7732
  type: "string",
7732
- pattern: Bd
7733
+ pattern: zd
7733
7734
  },
7734
7735
  stateIds: {
7735
7736
  title: "Issue statuses",
@@ -7737,7 +7738,7 @@ var Bd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-
7737
7738
  type: "array",
7738
7739
  items: {
7739
7740
  type: "string",
7740
- pattern: Bd
7741
+ pattern: zd
7741
7742
  },
7742
7743
  uniqueItems: !0,
7743
7744
  maxItems: 50,
@@ -7804,12 +7805,12 @@ var Bd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-
7804
7805
  provider: "linear",
7805
7806
  type: "poll"
7806
7807
  },
7807
- configOptions: Yd,
7808
+ configOptions: Jd,
7808
7809
  async poll(e) {
7809
7810
  let t = typeof e.config.teamId == "string" ? e.config.teamId.toLowerCase() : e.config.teamId, n = e.config.stateIds ?? [];
7810
- if (typeof t != "string" || !Vd.test(t) || !Array.isArray(n) || n.length > 50 || n.some((e) => typeof e != "string" || !Vd.test(e))) throw new r("Linear Issue configuration is invalid.");
7811
+ if (typeof t != "string" || !Bd.test(t) || !Array.isArray(n) || n.length > 50 || n.some((e) => typeof e != "string" || !Bd.test(e))) throw new r("Linear Issue configuration is invalid.");
7811
7812
  if (e.checkpoint == null) {
7812
- qd((await Jd(e, "query LinearTeam($teamId: String!) { team(id: $teamId) { id } }", { teamId: t })).team, t);
7813
+ Kd((await qd(e, "query LinearTeam($teamId: String!) { team(id: $teamId) { id } }", { teamId: t })).team, t);
7813
7814
  let n = e.now.toISOString();
7814
7815
  return {
7815
7816
  checkpoint: {
@@ -7819,10 +7820,10 @@ var Bd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-
7819
7820
  events: []
7820
7821
  };
7821
7822
  }
7822
- let i = Gd(e.checkpoint), o = i.until ?? new Date(Math.max(e.now.getTime(), Date.parse(i.since))).toISOString(), s = new Date(Math.max(Date.parse(i.startedAt), Date.parse(i.since) - Hd)).toISOString(), l = qd((await Jd(e, `query LinearIssueChanges($teamId: String!, $filter: IssueFilter!, $after: String) {
7823
+ let i = Wd(e.checkpoint), o = i.until ?? new Date(Math.max(e.now.getTime(), Date.parse(i.since))).toISOString(), s = new Date(Math.max(Date.parse(i.startedAt), Date.parse(i.since) - Vd)).toISOString(), l = Kd((await qd(e, `query LinearIssueChanges($teamId: String!, $filter: IssueFilter!, $after: String) {
7823
7824
  team(id: $teamId) {
7824
7825
  id
7825
- issues(first: ${Ud}, after: $after, orderBy: updatedAt, includeArchived: true, filter: $filter) {
7826
+ issues(first: ${Hd}, after: $after, orderBy: updatedAt, includeArchived: true, filter: $filter) {
7826
7827
  nodes { id identifier title url createdAt updatedAt state { id name type } }
7827
7828
  pageInfo { hasNextPage endCursor }
7828
7829
  }
@@ -7838,11 +7839,11 @@ var Bd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-
7838
7839
  ...n.length == 0 ? {} : { state: { id: { in: n } } }
7839
7840
  }
7840
7841
  })).team, t).issues;
7841
- if (!c(l) || !Array.isArray(l.nodes) || l.nodes.length > Ud || !c(l.pageInfo) || typeof l.pageInfo.hasNextPage != "boolean") throw new a("Linear returned an invalid Issue page.");
7842
+ if (!c(l) || !Array.isArray(l.nodes) || l.nodes.length > Hd || !c(l.pageInfo) || typeof l.pageInfo.hasNextPage != "boolean") throw new a("Linear returned an invalid Issue page.");
7842
7843
  let { hasNextPage: u, endCursor: d } = l.pageInfo;
7843
7844
  if (u && (typeof d != "string" || d.length == 0 || d.length > 4096 || d == i.after || l.nodes.length == 0)) throw new a("Linear returned an invalid continuation cursor.");
7844
7845
  let f = l.nodes.map((e) => {
7845
- if (!c(e) || typeof e.id != "string" || !Vd.test(e.id) || typeof e.identifier != "string" || e.identifier.length == 0 || typeof e.title != "string" || typeof e.url != "string" || !Kd(e.createdAt) || !Kd(e.updatedAt) || Date.parse(e.createdAt) > Date.parse(e.updatedAt) || Date.parse(e.updatedAt) < Date.parse(s) || Date.parse(e.updatedAt) > Date.parse(o) || !c(e.state) || typeof e.state.id != "string" || !Vd.test(e.state.id) || typeof e.state.name != "string" || typeof e.state.type != "string" || n.length > 0 && !n.includes(e.state.id)) throw new a("Linear returned an invalid Issue.");
7846
+ if (!c(e) || typeof e.id != "string" || !Bd.test(e.id) || typeof e.identifier != "string" || e.identifier.length == 0 || typeof e.title != "string" || typeof e.url != "string" || !Gd(e.createdAt) || !Gd(e.updatedAt) || Date.parse(e.createdAt) > Date.parse(e.updatedAt) || Date.parse(e.updatedAt) < Date.parse(s) || Date.parse(e.updatedAt) > Date.parse(o) || !c(e.state) || typeof e.state.id != "string" || !Bd.test(e.state.id) || typeof e.state.name != "string" || typeof e.state.type != "string" || n.length > 0 && !n.includes(e.state.id)) throw new a("Linear returned an invalid Issue.");
7846
7847
  return {
7847
7848
  dedupeKey: `${e.id}:${e.updatedAt}`,
7848
7849
  payload: {
@@ -7875,8 +7876,8 @@ var Bd = "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-
7875
7876
  };
7876
7877
  }
7877
7878
  };
7878
- function Gd(e) {
7879
- if (!c(e) || !Kd(e.startedAt) || !Kd(e.since) || Date.parse(e.since) < Date.parse(e.startedAt) || e.until != null && (!Kd(e.until) || Date.parse(e.until) < Date.parse(e.since)) || e.after != null && (typeof e.after != "string" || e.after.length == 0 || e.after.length > 4096 || e.until == null)) throw new r("Linear Issue checkpoint is invalid.");
7879
+ function Wd(e) {
7880
+ if (!c(e) || !Gd(e.startedAt) || !Gd(e.since) || Date.parse(e.since) < Date.parse(e.startedAt) || e.until != null && (!Gd(e.until) || Date.parse(e.until) < Date.parse(e.since)) || e.after != null && (typeof e.after != "string" || e.after.length == 0 || e.after.length > 4096 || e.until == null)) throw new r("Linear Issue checkpoint is invalid.");
7880
7881
  return {
7881
7882
  startedAt: e.startedAt,
7882
7883
  since: e.since,
@@ -7884,15 +7885,15 @@ function Gd(e) {
7884
7885
  ...typeof e.after == "string" ? { after: e.after } : {}
7885
7886
  };
7886
7887
  }
7887
- function Kd(e) {
7888
+ function Gd(e) {
7888
7889
  return typeof e == "string" && e.length <= 40 && /^\d{4}-\d{2}-\d{2}T/.test(e) && Number.isFinite(Date.parse(e));
7889
7890
  }
7890
- function qd(e, t) {
7891
+ function Kd(e, t) {
7891
7892
  if (e === null) throw new r("The Linear team is unavailable or not accessible to this Connection.");
7892
7893
  if (!c(e) || e.id !== t) throw new a("Linear returned an invalid Team.");
7893
7894
  return e;
7894
7895
  }
7895
- async function Jd(e, t, n) {
7896
+ async function qd(e, t, n) {
7896
7897
  e.signal?.throwIfAborted();
7897
7898
  let o = await e.connector.execute({
7898
7899
  endpoint: "/graphql",
@@ -7912,19 +7913,19 @@ async function Jd(e, t, n) {
7912
7913
  if (o.status != 200 || !c(s) || !c(s.data) || s.errors != null && !Array.isArray(s.errors)) throw new a(`Linear returned an invalid query response (HTTP ${o.status}).`);
7913
7914
  return s.data;
7914
7915
  }
7915
- async function Yd(e) {
7916
+ async function Jd(e) {
7916
7917
  let { field: t, config: n } = e;
7917
7918
  if (t != "teamId" && t != "stateIds") throw new r("Unknown Linear configuration field.");
7918
- if (t == "stateIds" && (typeof n.teamId != "string" || !Vd.test(n.teamId))) throw new r("Select a Linear Team first.");
7919
+ if (t == "stateIds" && (typeof n.teamId != "string" || !Bd.test(n.teamId))) throw new r("Select a Linear Team first.");
7919
7920
  let i = [], o = /* @__PURE__ */ new Set(), s = null;
7920
7921
  for (let r = 0; r < 10; r++) {
7921
- let r = await Jd(e, t == "teamId" ? "query LinearTeams($after: String) { teams(first: 100, after: $after) { nodes { id name key } pageInfo { hasNextPage endCursor } } }" : "query LinearStates($teamId: String!, $after: String) { team(id: $teamId) { id states(first: 100, after: $after) { nodes { id name color position } pageInfo { hasNextPage endCursor } } } }", {
7922
+ let r = await qd(e, t == "teamId" ? "query LinearTeams($after: String) { teams(first: 100, after: $after) { nodes { id name key } pageInfo { hasNextPage endCursor } } }" : "query LinearStates($teamId: String!, $after: String) { team(id: $teamId) { id states(first: 100, after: $after) { nodes { id name color position } pageInfo { hasNextPage endCursor } } } }", {
7922
7923
  after: s,
7923
7924
  ...t == "teamId" ? {} : { teamId: n.teamId }
7924
- }), l = t == "teamId" ? r.teams : qd(r.team, String(n.teamId)).states;
7925
+ }), l = t == "teamId" ? r.teams : Kd(r.team, String(n.teamId)).states;
7925
7926
  if (!c(l) || !Array.isArray(l.nodes) || l.nodes.length > 100 || !c(l.pageInfo) || typeof l.pageInfo.hasNextPage != "boolean") throw new a("Linear returned invalid configuration options.");
7926
7927
  for (let e of l.nodes) {
7927
- if (!c(e) || typeof e.id != "string" || !Vd.test(e.id) || typeof e.name != "string" || e.name.length == 0 || (t == "teamId" ? typeof e.key != "string" : typeof e.color != "string" || !/^#[0-9a-fA-F]{6}$/.test(e.color))) throw new a("Linear returned an invalid configuration option.");
7928
+ if (!c(e) || typeof e.id != "string" || !Bd.test(e.id) || typeof e.name != "string" || e.name.length == 0 || (t == "teamId" ? typeof e.key != "string" : typeof e.color != "string" || !/^#[0-9a-fA-F]{6}$/.test(e.color))) throw new a("Linear returned an invalid configuration option.");
7928
7929
  i.push({
7929
7930
  value: e.id,
7930
7931
  label: t == "teamId" ? `${e.name} (${e.key})` : e.name,
@@ -7938,7 +7939,7 @@ async function Yd(e) {
7938
7939
  }
7939
7940
  throw new r("The Linear options list exceeds the supported limit of 1000 entries.");
7940
7941
  }
7941
- var Xd = {
7942
+ var Yd = {
7942
7943
  buildOutputs: o,
7943
7944
  snapshot: {
7944
7945
  configSchema: {
@@ -8032,13 +8033,13 @@ var Xd = {
8032
8033
  type: "poll"
8033
8034
  },
8034
8035
  async poll(e) {
8035
- let t = Zd(e.config);
8036
- if (e.checkpoint === null) return Qd(e, t);
8037
- let n = ef(e.checkpoint);
8038
- return n.target === pf(t) ? rf(e, t, nf(n, tf(t.events))) : Qd(e, t);
8036
+ let t = Xd(e.config);
8037
+ if (e.checkpoint === null) return Zd(e, t);
8038
+ let n = $d(e.checkpoint);
8039
+ return n.target === ff(t) ? nf(e, t, tf(n, ef(t.events))) : Zd(e, t);
8039
8040
  }
8040
8041
  };
8041
- function Zd(e) {
8042
+ function Xd(e) {
8042
8043
  return {
8043
8044
  dataSourceId: e.dataSourceId ?? "",
8044
8045
  databaseId: e.databaseId,
@@ -8047,9 +8048,9 @@ function Zd(e) {
8047
8048
  maxItemsPerPoll: e.maxItemsPerPoll ?? 25
8048
8049
  };
8049
8050
  }
8050
- async function Qd(e, t) {
8051
- let n = await $d(e, t), r = tf(t.events);
8052
- return ff(await df(e, {
8051
+ async function Zd(e, t) {
8052
+ let n = await Qd(e, t), r = ef(t.events);
8053
+ return df(await uf(e, {
8053
8054
  body: {
8054
8055
  page_size: 1,
8055
8056
  sorts: [{
@@ -8064,31 +8065,31 @@ async function Qd(e, t) {
8064
8065
  cursorField: r,
8065
8066
  dataSourceId: n,
8066
8067
  since: (/* @__PURE__ */ new Date(Math.ceil(e.now.getTime() / 6e4) * 6e4)).toISOString(),
8067
- target: pf(t)
8068
+ target: ff(t)
8068
8069
  },
8069
8070
  events: []
8070
8071
  };
8071
8072
  }
8072
- async function $d(e, t) {
8073
- let n = await df(e, {
8073
+ async function Qd(e, t) {
8074
+ let n = await uf(e, {
8074
8075
  endpoint: `/databases/${encodeURIComponent(t.databaseId)}`,
8075
8076
  method: "GET"
8076
8077
  });
8077
- ff(n, "database resolve");
8078
- let i = yf(n.data)?.data_sources, a = Array.isArray(i) ? i.flatMap((e) => {
8079
- let t = yf(e)?.id;
8078
+ df(n, "database resolve");
8079
+ let i = vf(n.data)?.data_sources, a = Array.isArray(i) ? i.flatMap((e) => {
8080
+ let t = vf(e)?.id;
8080
8081
  return typeof t == "string" && t.length > 0 ? [t] : [];
8081
8082
  }) : [];
8082
8083
  if (t.dataSourceId.length > 0) {
8083
- let e = mf(t.dataSourceId), n = a.find((t) => mf(t) == e);
8084
+ let e = pf(t.dataSourceId), n = a.find((t) => pf(t) == e);
8084
8085
  if (n == null) throw new r("The Notion data source does not belong to the configured database.");
8085
8086
  return n;
8086
8087
  }
8087
8088
  if (a.length == 1) return a[0];
8088
8089
  throw a.length == 0 ? new r("The Notion database has no data sources.") : new r("The Notion database has multiple data sources; configure dataSourceId.");
8089
8090
  }
8090
- function ef(e) {
8091
- let t = yf(e), n = t?.cursorField;
8091
+ function $d(e) {
8092
+ let t = vf(e), n = t?.cursorField;
8092
8093
  if (typeof t?.dataSourceId != "string" || t.dataSourceId.length == 0 || n !== "created_time" && n !== "last_edited_time" || typeof t.since != "string" || t.since.length == 0) throw new r("Notion checkpoint is invalid; recreate the Trigger.");
8093
8094
  return {
8094
8095
  cursorField: n,
@@ -8100,10 +8101,10 @@ function ef(e) {
8100
8101
  ...t.sinceOnly === !0 ? { sinceOnly: !0 } : {}
8101
8102
  };
8102
8103
  }
8103
- function tf(e) {
8104
+ function ef(e) {
8104
8105
  return e.length == 1 && e[0] == "page_added" ? "created_time" : "last_edited_time";
8105
8106
  }
8106
- function nf(e, t) {
8107
+ function tf(e, t) {
8107
8108
  return e.cursorField == t ? e : {
8108
8109
  cursorField: t,
8109
8110
  dataSourceId: e.dataSourceId,
@@ -8111,11 +8112,11 @@ function nf(e, t) {
8111
8112
  target: e.target
8112
8113
  };
8113
8114
  }
8114
- async function rf(e, t, n) {
8115
+ async function nf(e, t, n) {
8115
8116
  let r = [], i = 0, a = 0, o = null, s = n.startCursor, c = null;
8116
8117
  for (let l = 0; l < 5; l += 1) {
8117
- let l = await df(e, {
8118
- body: sf(n, t.maxItemsPerPoll - a, s),
8118
+ let l = await uf(e, {
8119
+ body: of(n, t.maxItemsPerPoll - a, s),
8119
8120
  endpoint: `/data_sources/${encodeURIComponent(n.dataSourceId)}/query`,
8120
8121
  method: "POST"
8121
8122
  });
@@ -8123,14 +8124,14 @@ async function rf(e, t, n) {
8123
8124
  c = "restarted";
8124
8125
  break;
8125
8126
  }
8126
- ff(l, "data source query");
8127
- let u = yf(l.data) ?? {};
8127
+ df(l, "data source query");
8128
+ let u = vf(l.data) ?? {};
8128
8129
  for (let e of u.results ?? []) {
8129
8130
  a += 1;
8130
8131
  let s = n.cursorField == "created_time" ? e.created_time : e.last_edited_time;
8131
- s != null && s.length > 0 && (o = gf(o, s));
8132
- let c = cf(e);
8133
- t.events.includes(c) ? r.push(lf(e, c, t, n)) : i += 1;
8132
+ s != null && s.length > 0 && (o = hf(o, s));
8133
+ let c = sf(e);
8134
+ t.events.includes(c) ? r.push(cf(e, c, t, n)) : i += 1;
8134
8135
  }
8135
8136
  if (u.request_status?.type == "incomplete") {
8136
8137
  c = "truncated";
@@ -8156,36 +8157,36 @@ async function rf(e, t, n) {
8156
8157
  ...l,
8157
8158
  since: n.since,
8158
8159
  startCursor: c.nextCursor,
8159
- ...of(n)
8160
+ ...af(n)
8160
8161
  } : {
8161
8162
  ...l,
8162
- ...af(n, c, o, e.now)
8163
+ ...rf(n, c, o, e.now)
8163
8164
  },
8164
8165
  events: r,
8165
8166
  filtered: i,
8166
8167
  ...c == "complete" ? {} : { hasMore: !0 }
8167
8168
  };
8168
8169
  }
8169
- function af(e, t, n, r) {
8170
+ function rf(e, t, n, r) {
8170
8171
  let i = {
8171
8172
  since: e.since,
8172
- ...of(e)
8173
+ ...af(e)
8173
8174
  }, a = Date.parse(e.since) + 6e4 <= r.getTime() ? {
8174
8175
  since: e.since,
8175
8176
  sinceExclusive: !0
8176
8177
  } : i;
8177
- return n != null && _f(n, e.since) ? { since: n } : t == "restarted" ? i : t == "complete" ? e.sinceOnly === !0 || n != null ? a : i : n == null ? i : e.sinceOnly === !0 ? a : {
8178
+ return n != null && gf(n, e.since) ? { since: n } : t == "restarted" ? i : t == "complete" ? e.sinceOnly === !0 || n != null ? a : i : n == null ? i : e.sinceOnly === !0 ? a : {
8178
8179
  since: e.since,
8179
8180
  sinceOnly: !0
8180
8181
  };
8181
8182
  }
8182
- function of(e) {
8183
+ function af(e) {
8183
8184
  return {
8184
8185
  ...e.sinceExclusive === !0 ? { sinceExclusive: !0 } : {},
8185
8186
  ...e.sinceOnly === !0 ? { sinceOnly: !0 } : {}
8186
8187
  };
8187
8188
  }
8188
- function sf(e, t, n) {
8189
+ function of(e, t, n) {
8189
8190
  let r = e.cursorField;
8190
8191
  return {
8191
8192
  filter: e.sinceOnly === !0 ? { and: [{
@@ -8206,70 +8207,70 @@ function sf(e, t, n) {
8206
8207
  ...n == null ? {} : { start_cursor: n }
8207
8208
  };
8208
8209
  }
8209
- function cf(e) {
8210
- return vf(e.created_time) === vf(e.last_edited_time) ? "page_added" : "page_updated";
8210
+ function sf(e) {
8211
+ return _f(e.created_time) === _f(e.last_edited_time) ? "page_added" : "page_updated";
8211
8212
  }
8212
- function lf(e, t, n, r) {
8213
+ function cf(e, t, n, r) {
8213
8214
  return {
8214
- dedupeKey: t == "page_added" ? `added:${e.id}` : `updated:${e.id}:${vf(e.last_edited_time) ?? e.last_edited_time ?? ""}`,
8215
+ dedupeKey: t == "page_added" ? `added:${e.id}` : `updated:${e.id}:${_f(e.last_edited_time) ?? e.last_edited_time ?? ""}`,
8215
8216
  payload: {
8216
8217
  createdBy: { id: e.created_by?.id ?? "" },
8217
8218
  createdTime: e.created_time ?? "",
8218
8219
  dataSourceId: r.dataSourceId,
8219
- databaseId: hf(n.databaseId),
8220
+ databaseId: mf(n.databaseId),
8220
8221
  event: t,
8221
8222
  lastEditedBy: { id: e.last_edited_by?.id ?? "" },
8222
8223
  lastEditedTime: e.last_edited_time ?? "",
8223
8224
  pageId: e.id,
8224
8225
  ...n.includeProperties ? { properties: e.properties ?? {} } : {},
8225
- title: uf(e.properties ?? {}),
8226
+ title: lf(e.properties ?? {}),
8226
8227
  url: e.url ?? ""
8227
8228
  }
8228
8229
  };
8229
8230
  }
8230
- function uf(e) {
8231
+ function lf(e) {
8231
8232
  for (let t of Object.values(e)) {
8232
- let e = yf(t);
8233
- if (!(e?.type !== "title" || !Array.isArray(e.title))) return e.title.map((e) => typeof yf(e)?.plain_text == "string" ? yf(e).plain_text : "").join("");
8233
+ let e = vf(t);
8234
+ if (!(e?.type !== "title" || !Array.isArray(e.title))) return e.title.map((e) => typeof vf(e)?.plain_text == "string" ? vf(e).plain_text : "").join("");
8234
8235
  }
8235
8236
  return "";
8236
8237
  }
8237
- async function df(e, t) {
8238
+ async function uf(e, t) {
8238
8239
  try {
8239
8240
  return await e.connector.execute(t, e.signal);
8240
8241
  } catch (e) {
8241
8242
  throw new a(`Notion proxy request to ${t.endpoint} failed.`, { cause: e });
8242
8243
  }
8243
8244
  }
8244
- function ff(e, t) {
8245
+ function df(e, t) {
8245
8246
  if (!(e.status >= 200 && e.status < 300)) throw e.status == 401 || e.status == 403 ? new i(`Notion ${t} rejected the Connection.`) : e.status == 404 ? new r("The Notion target was not found or is not shared with the Connection.") : e.status == 400 ? new r(`Notion ${t} rejected the configuration.`) : new a(`Notion ${t} failed with status ${e.status}.`);
8246
8247
  }
8247
- function pf(e) {
8248
+ function ff(e) {
8248
8249
  return `${e.databaseId}|${e.dataSourceId}`;
8249
8250
  }
8250
- function mf(e) {
8251
+ function pf(e) {
8251
8252
  return e.replaceAll("-", "").toLowerCase();
8252
8253
  }
8253
- function hf(e) {
8254
- let t = mf(e);
8254
+ function mf(e) {
8255
+ let t = pf(e);
8255
8256
  return `${t.slice(0, 8)}-${t.slice(8, 12)}-${t.slice(12, 16)}-${t.slice(16, 20)}-${t.slice(20)}`;
8256
8257
  }
8257
- function gf(e, t) {
8258
+ function hf(e, t) {
8258
8259
  let n = Date.parse(t);
8259
8260
  return Number.isNaN(n) || e != null && n < Date.parse(e) ? e : t;
8260
8261
  }
8261
- function _f(e, t) {
8262
+ function gf(e, t) {
8262
8263
  return !Number.isNaN(Date.parse(e)) && !Number.isNaN(Date.parse(t)) && Date.parse(e) > Date.parse(t);
8263
8264
  }
8264
- function vf(e) {
8265
+ function _f(e) {
8265
8266
  if (e == null || e.length == 0) return null;
8266
8267
  let t = Date.parse(e);
8267
8268
  return Number.isNaN(t) ? null : new Date(t).toISOString();
8268
8269
  }
8269
- function yf(e) {
8270
+ function vf(e) {
8270
8271
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
8271
8272
  }
8272
- var bf = {
8273
+ var yf = {
8273
8274
  buildOutputs: o,
8274
8275
  snapshot: {
8275
8276
  configSchema: {
@@ -8381,14 +8382,14 @@ var bf = {
8381
8382
  type: "poll"
8382
8383
  },
8383
8384
  async poll(e) {
8384
- let t = xf(e.config);
8385
+ let t = bf(e.config);
8385
8386
  if (e.checkpoint === null) return {
8386
- checkpoint: await Sf(e, t),
8387
+ checkpoint: await xf(e, t),
8387
8388
  events: []
8388
8389
  };
8389
- let n = wf(e.checkpoint), { items: r, next: i } = await Tf(e, n, t.maxItemsPerPoll), a = [], o = 0;
8390
+ let n = Cf(e.checkpoint), { items: r, next: i } = await wf(e, n, t.maxItemsPerPoll), a = [], o = 0;
8390
8391
  for (let [e, i] of r) {
8391
- let r = await Ef(e, i, t, n);
8392
+ let r = await Tf(e, i, t, n);
8392
8393
  r != "structural" && (r == "filtered" ? o += 1 : a.push(r));
8393
8394
  }
8394
8395
  return {
@@ -8399,7 +8400,7 @@ var bf = {
8399
8400
  };
8400
8401
  }
8401
8402
  };
8402
- function xf(e) {
8403
+ function bf(e) {
8403
8404
  return {
8404
8405
  events: e.events ?? ["created", "updated"],
8405
8406
  itemId: (e.itemId ?? "").trim(),
@@ -8408,25 +8409,25 @@ function xf(e) {
8408
8409
  parentFolderId: (e.parentFolderId ?? "").trim()
8409
8410
  };
8410
8411
  }
8411
- async function Sf(e, t) {
8412
- let n = await kf(e, "/me/drive/root/delta", { token: "latest" });
8412
+ async function xf(e, t) {
8413
+ let n = await Of(e, "/me/drive/root/delta", { token: "latest" });
8413
8414
  if (n.status == 404) throw new r("OneDrive is not provisioned for this account.");
8414
- jf(n, "delta seeding");
8415
- let i = If(n.data)?.["@odata.deltaLink"], o = i == null ? null : Pf(i);
8415
+ Af(n, "delta seeding");
8416
+ let i = Ff(n.data)?.["@odata.deltaLink"], o = i == null ? null : Nf(i);
8416
8417
  if (o == null) throw new a("OneDrive delta seeding response has no delta token.");
8417
- return await Cf(e, "parentFolderId", t.parentFolderId), await Cf(e, "itemId", t.itemId), {
8418
+ return await Sf(e, "parentFolderId", t.parentFolderId), await Sf(e, "itemId", t.itemId), {
8418
8419
  deltaToken: o,
8419
8420
  lastPolledAt: e.now.toISOString()
8420
8421
  };
8421
8422
  }
8422
- async function Cf(e, t, n) {
8423
+ async function Sf(e, t, n) {
8423
8424
  if (n.length == 0) return;
8424
- let i = await kf(e, `/me/drive/items/${encodeURIComponent(n)}`, {});
8425
+ let i = await Of(e, `/me/drive/items/${encodeURIComponent(n)}`, {});
8425
8426
  if (i.status == 400 || i.status == 404) throw new r(`OneDrive ${t} does not identify an item in this drive.`);
8426
- jf(i, `${t} validation`);
8427
+ Af(i, `${t} validation`);
8427
8428
  }
8428
- function wf(e) {
8429
- let t = If(e);
8429
+ function Cf(e) {
8430
+ let t = Ff(e);
8430
8431
  if (typeof t?.deltaToken != "string" || t.deltaToken.length == 0 || typeof t.lastPolledAt != "string" || Number.isNaN(Date.parse(t.lastPolledAt))) throw new r("OneDrive checkpoint is invalid; recreate the Trigger.");
8431
8432
  return {
8432
8433
  deltaToken: t.deltaToken,
@@ -8434,28 +8435,28 @@ function wf(e) {
8434
8435
  ...typeof t.pageToken == "string" && t.pageToken.length > 0 ? { pageToken: t.pageToken } : {}
8435
8436
  };
8436
8437
  }
8437
- async function Tf(e, t, n) {
8438
+ async function wf(e, t, n) {
8438
8439
  let r = /* @__PURE__ */ new Map(), i = t.pageToken ?? t.deltaToken;
8439
8440
  for (let t = 0; t < 5; t += 1) {
8440
- let t = await kf(e, "/me/drive/root/delta", {
8441
+ let t = await Of(e, "/me/drive/root/delta", {
8441
8442
  $top: n,
8442
8443
  token: i
8443
8444
  });
8444
- Af(t);
8445
- let o = If(t.data) ?? {};
8445
+ kf(t);
8446
+ let o = Ff(t.data) ?? {};
8446
8447
  for (let e of o.value ?? []) e.id != null && e.id.length > 0 && r.set(e.id, e);
8447
8448
  if (o["@odata.deltaLink"]) return {
8448
8449
  items: r,
8449
8450
  next: {
8450
8451
  checkpoint: {
8451
- deltaToken: Nf(o["@odata.deltaLink"]),
8452
+ deltaToken: Mf(o["@odata.deltaLink"]),
8452
8453
  lastPolledAt: e.now.toISOString()
8453
8454
  },
8454
8455
  hasMore: !1
8455
8456
  }
8456
8457
  };
8457
8458
  if (!o["@odata.nextLink"]) throw new a("OneDrive delta response has no continuation link.");
8458
- i = Nf(o["@odata.nextLink"]);
8459
+ i = Mf(o["@odata.nextLink"]);
8459
8460
  }
8460
8461
  return {
8461
8462
  items: r,
@@ -8469,17 +8470,17 @@ async function Tf(e, t, n) {
8469
8470
  }
8470
8471
  };
8471
8472
  }
8472
- async function Ef(e, t, n, r) {
8473
+ async function Tf(e, t, n, r) {
8473
8474
  if (t.root != null) return "structural";
8474
- let i = Df(t);
8475
+ let i = Ef(t);
8475
8476
  if (i == null) return "structural";
8476
- let a = t.deleted == null ? Ff(t.createdDateTime, new Date(r.lastPolledAt)) ? "created" : "updated" : "deleted";
8477
- return !n.events.includes(a) || !n.itemTypes.includes(i) || n.parentFolderId.length > 0 && t.parentReference?.id !== n.parentFolderId || n.itemId.length > 0 && e !== n.itemId ? "filtered" : await Of(e, t, a, i, r.deltaToken);
8477
+ let a = t.deleted == null ? Pf(t.createdDateTime, new Date(r.lastPolledAt)) ? "created" : "updated" : "deleted";
8478
+ return !n.events.includes(a) || !n.itemTypes.includes(i) || n.parentFolderId.length > 0 && t.parentReference?.id !== n.parentFolderId || n.itemId.length > 0 && e !== n.itemId ? "filtered" : await Df(e, t, a, i, r.deltaToken);
8478
8479
  }
8479
- function Df(e) {
8480
+ function Ef(e) {
8480
8481
  return e.file == null ? e.folder == null ? e.deleted == null ? null : "file" : "folder" : "file";
8481
8482
  }
8482
- async function Of(e, t, n, r, i) {
8483
+ async function Df(e, t, n, r, i) {
8483
8484
  return {
8484
8485
  dedupeKey: t.deleted == null ? `${e}:${t.eTag ?? t.lastModifiedDateTime}` : await pl(fl([
8485
8486
  "one-drive-deleted",
@@ -8502,7 +8503,7 @@ async function Of(e, t, n, r, i) {
8502
8503
  }
8503
8504
  };
8504
8505
  }
8505
- async function kf(e, t, n) {
8506
+ async function Of(e, t, n) {
8506
8507
  try {
8507
8508
  return await e.connector.execute({
8508
8509
  endpoint: t,
@@ -8513,31 +8514,31 @@ async function kf(e, t, n) {
8513
8514
  throw new a(`OneDrive proxy request to ${t} failed.`, { cause: e });
8514
8515
  }
8515
8516
  }
8516
- function Af(e) {
8517
- if (e.status == 410 && Mf(e.data)) throw new r("OneDrive delta token expired; recreate the Trigger.");
8517
+ function kf(e) {
8518
+ if (e.status == 410 && jf(e.data)) throw new r("OneDrive delta token expired; recreate the Trigger.");
8518
8519
  if (e.status == 404) throw new r("OneDrive is not provisioned for this account.");
8519
8520
  if (e.status == 400) throw new r("OneDrive rejected the delta token; recreate the Trigger.");
8520
- jf(e, "delta list");
8521
+ Af(e, "delta list");
8521
8522
  }
8522
- function jf(e, t) {
8523
+ function Af(e, t) {
8523
8524
  if (!(e.status >= 200 && e.status < 300)) throw e.status == 401 || e.status == 403 ? new i(`OneDrive ${t} rejected the Connection.`) : new a(`OneDrive ${t} failed with status ${e.status}.`);
8524
8525
  }
8525
- function Mf(e) {
8526
- let t = If(e)?.error;
8526
+ function jf(e) {
8527
+ let t = Ff(e)?.error;
8527
8528
  for (; t != null;) {
8528
- let e = If(t);
8529
+ let e = Ff(t);
8529
8530
  if (e == null) break;
8530
8531
  if (e.code == "resyncChangesApplyDifferences" || e.code == "resyncChangesUploadDifferences") return !0;
8531
8532
  t = e.innerError ?? e.innererror;
8532
8533
  }
8533
8534
  return !1;
8534
8535
  }
8535
- function Nf(e) {
8536
- let t = Pf(e);
8536
+ function Mf(e) {
8537
+ let t = Nf(e);
8537
8538
  if (t == null) throw new a("OneDrive delta link has no token.");
8538
8539
  return t;
8539
8540
  }
8540
- function Pf(e) {
8541
+ function Nf(e) {
8541
8542
  let t = /[?&]token=([^&#]+)/.exec(e)?.[1] ?? /\(token='([^']+)'\)/.exec(e)?.[1];
8542
8543
  if (t == null) return null;
8543
8544
  try {
@@ -8546,17 +8547,17 @@ function Pf(e) {
8546
8547
  return t;
8547
8548
  }
8548
8549
  }
8549
- function Ff(e, t) {
8550
+ function Pf(e, t) {
8550
8551
  if (e == null || e.length == 0) return !1;
8551
8552
  let n = new Date(e);
8552
8553
  return !Number.isNaN(n.getTime()) && n >= t;
8553
8554
  }
8554
- function If(e) {
8555
+ function Ff(e) {
8555
8556
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
8556
8557
  }
8557
8558
  //#endregion
8558
8559
  //#region src/trigger/providers/outlook/on-message-received.ts
8559
- var Lf = "inbox", Rf = 25, zf = 100, Bf = "1970-01-01T00:00:00Z", Vf = "id,internetMessageId,conversationId,subject,bodyPreview,from,toRecipients,receivedDateTime,hasAttachments,isRead,isDraft,importance,categories,parentFolderId,webLink", Hf = {
8560
+ var If = "inbox", Lf = 25, Rf = 100, zf = "1970-01-01T00:00:00Z", Bf = "id,internetMessageId,conversationId,subject,bodyPreview,from,toRecipients,receivedDateTime,hasAttachments,isRead,isDraft,importance,categories,parentFolderId,webLink", Vf = {
8560
8561
  buildOutputs: o,
8561
8562
  snapshot: {
8562
8563
  configSchema: {
@@ -8564,7 +8565,7 @@ var Lf = "inbox", Rf = 25, zf = 100, Bf = "1970-01-01T00:00:00Z", Vf = "id,inter
8564
8565
  description: "Configuration for outlook.on_message_received. Every configured matching field must match.",
8565
8566
  properties: {
8566
8567
  folder: {
8567
- default: Lf,
8568
+ default: If,
8568
8569
  description: "A well-known mail folder name, folder ID, or an empty string for the whole mailbox.",
8569
8570
  pattern: "^[A-Za-z0-9_=-]*$",
8570
8571
  type: "string"
@@ -8574,7 +8575,7 @@ var Lf = "inbox", Rf = 25, zf = 100, Bf = "1970-01-01T00:00:00Z", Vf = "id,inter
8574
8575
  type: "boolean"
8575
8576
  },
8576
8577
  maxMessagesPerPoll: {
8577
- default: Rf,
8578
+ default: Lf,
8578
8579
  maximum: 100,
8579
8580
  minimum: 1,
8580
8581
  type: "integer"
@@ -8674,37 +8675,37 @@ var Lf = "inbox", Rf = 25, zf = 100, Bf = "1970-01-01T00:00:00Z", Vf = "id,inter
8674
8675
  type: "poll"
8675
8676
  },
8676
8677
  async poll(e) {
8677
- let t = Uf(e.config);
8678
+ let t = Hf(e.config);
8678
8679
  if (e.checkpoint === null) return {
8679
- checkpoint: await Wf(e, t),
8680
+ checkpoint: await Uf(e, t),
8680
8681
  events: []
8681
8682
  };
8682
- let n = Gf(e.checkpoint), i = await Xf(e, Kf(t.folder), {
8683
- $filter: qf(t, n.lastReceivedDateTime),
8683
+ let n = Wf(e.checkpoint), i = await Yf(e, Gf(t.folder), {
8684
+ $filter: Kf(t, n.lastReceivedDateTime),
8684
8685
  $orderby: "receivedDateTime asc",
8685
- $select: Vf,
8686
+ $select: Bf,
8686
8687
  $top: t.maxMessagesPerPoll
8687
8688
  });
8688
- Zf(i, "message list");
8689
- let a = $f(i.data);
8689
+ Xf(i, "message list");
8690
+ let a = Qf(i.data);
8690
8691
  if (a.length == 0) return {
8691
8692
  checkpoint: n,
8692
8693
  events: []
8693
8694
  };
8694
8695
  let o = Date.parse(n.lastReceivedDateTime), s = o, c = n.lastReceivedDateTime;
8695
8696
  for (let e of a) {
8696
- let t = tp(e.receivedDateTime);
8697
+ let t = ep(e.receivedDateTime);
8697
8698
  e.receivedDateTime != null && t != null && t > s && (s = t, c = e.receivedDateTime);
8698
8699
  }
8699
8700
  let l = s > o, u = new Set(n.boundaryMessageIds), d = a.length >= t.maxMessagesPerPoll;
8700
8701
  if (d && !l && a.every((e) => typeof e.id == "string" && u.has(e.id))) throw new r("Outlook cursor is stuck on a full timestamp boundary; increase maxMessagesPerPoll and resume the Trigger.");
8701
8702
  let f = new Set(l ? [] : n.boundaryMessageIds), p = [], m = 0;
8702
- for (let e of a) if (e.id != null && e.id.length != 0 && (tp(e.receivedDateTime) == s && f.add(e.id), !u.has(e.id))) {
8703
- if (!Jf(e, t)) {
8703
+ for (let e of a) if (e.id != null && e.id.length != 0 && (ep(e.receivedDateTime) == s && f.add(e.id), !u.has(e.id))) {
8704
+ if (!qf(e, t)) {
8704
8705
  m += 1;
8705
8706
  continue;
8706
8707
  }
8707
- p.push(Yf(e, e.id));
8708
+ p.push(Jf(e, e.id));
8708
8709
  }
8709
8710
  let ee = d && (l || p.length > 0);
8710
8711
  return {
@@ -8718,34 +8719,34 @@ var Lf = "inbox", Rf = 25, zf = 100, Bf = "1970-01-01T00:00:00Z", Vf = "id,inter
8718
8719
  };
8719
8720
  }
8720
8721
  };
8721
- function Uf(e) {
8722
+ function Hf(e) {
8722
8723
  return {
8723
- folder: e.folder ?? Lf,
8724
+ folder: e.folder ?? If,
8724
8725
  includeDrafts: e.includeDrafts ?? !1,
8725
- maxMessagesPerPoll: e.maxMessagesPerPoll ?? Rf,
8726
+ maxMessagesPerPoll: e.maxMessagesPerPoll ?? Lf,
8726
8727
  readStatus: e.readStatus ?? "All",
8727
8728
  senderAddress: (e.senderAddress ?? "").trim(),
8728
8729
  subjectContains: (e.subjectContains ?? "").trim(),
8729
8730
  withAttachmentsOnly: e.withAttachmentsOnly ?? !1
8730
8731
  };
8731
8732
  }
8732
- async function Wf(e, t) {
8733
- let n = await Xf(e, Kf(t.folder), {
8733
+ async function Uf(e, t) {
8734
+ let n = await Yf(e, Gf(t.folder), {
8734
8735
  $orderby: "receivedDateTime desc",
8735
8736
  $select: "id,receivedDateTime",
8736
- $top: zf
8737
+ $top: Rf
8737
8738
  });
8738
- Zf(n, "seed marker fetch"), Zf(await Xf(e, Kf(t.folder), {
8739
- $filter: qf(t, Bf),
8739
+ Xf(n, "seed marker fetch"), Xf(await Yf(e, Gf(t.folder), {
8740
+ $filter: Kf(t, zf),
8740
8741
  $orderby: "receivedDateTime desc",
8741
8742
  $top: 1
8742
8743
  }), "seed filter shape check");
8743
- let r = ep($f(n.data));
8744
+ let r = $f(Qf(n.data));
8744
8745
  if (r == null) return {
8745
8746
  boundaryMessageIds: [],
8746
8747
  lastReceivedDateTime: e.now.toISOString()
8747
8748
  };
8748
- let i = $f(n.data).filter((e) => tp(e.receivedDateTime) == r.ms);
8749
+ let i = Qf(n.data).filter((e) => ep(e.receivedDateTime) == r.ms);
8749
8750
  return i.length >= t.maxMessagesPerPoll ? {
8750
8751
  boundaryMessageIds: [],
8751
8752
  lastReceivedDateTime: new Date(r.ms + 1e3).toISOString()
@@ -8754,26 +8755,26 @@ async function Wf(e, t) {
8754
8755
  lastReceivedDateTime: r.iso
8755
8756
  };
8756
8757
  }
8757
- function Gf(e) {
8758
- let t = np(e), n = t?.lastReceivedDateTime;
8759
- if (typeof n != "string" || tp(n) == null) throw new r("Outlook checkpoint is invalid; recreate the Trigger.");
8758
+ function Wf(e) {
8759
+ let t = tp(e), n = t?.lastReceivedDateTime;
8760
+ if (typeof n != "string" || ep(n) == null) throw new r("Outlook checkpoint is invalid; recreate the Trigger.");
8760
8761
  let i = t?.boundaryMessageIds;
8761
8762
  return {
8762
8763
  boundaryMessageIds: Array.isArray(i) ? i.filter((e) => typeof e == "string" && e.length > 0) : [],
8763
8764
  lastReceivedDateTime: n
8764
8765
  };
8765
8766
  }
8766
- function Kf(e) {
8767
+ function Gf(e) {
8767
8768
  return e.length == 0 ? "/me/messages" : `/me/mailFolders/${encodeURIComponent(e)}/messages`;
8768
8769
  }
8769
- function qf(e, t) {
8770
+ function Kf(e, t) {
8770
8771
  let n = [`receivedDateTime ge ${t}`];
8771
8772
  return e.readStatus == "Unread" && n.push("isRead eq false"), e.readStatus == "Read" && n.push("isRead eq true"), e.withAttachmentsOnly && n.push("hasAttachments eq true"), e.senderAddress.length > 0 && n.push(`from/emailAddress/address eq '${e.senderAddress.replaceAll("'", "''")}'`), n.join(" and ");
8772
8773
  }
8773
- function Jf(e, t) {
8774
+ function qf(e, t) {
8774
8775
  return e.isDraft === !0 && !t.includeDrafts ? !1 : t.subjectContains.length == 0 || (e.subject ?? "").toLowerCase().includes(t.subjectContains.toLowerCase());
8775
8776
  }
8776
- function Yf(e, t) {
8777
+ function Jf(e, t) {
8777
8778
  return {
8778
8779
  dedupeKey: t,
8779
8780
  payload: {
@@ -8796,7 +8797,7 @@ function Yf(e, t) {
8796
8797
  }
8797
8798
  };
8798
8799
  }
8799
- async function Xf(e, t, n) {
8800
+ async function Yf(e, t, n) {
8800
8801
  try {
8801
8802
  return await e.connector.execute({
8802
8803
  endpoint: t,
@@ -8808,28 +8809,28 @@ async function Xf(e, t, n) {
8808
8809
  throw new a(`Outlook proxy request to ${t} failed.`, { cause: e });
8809
8810
  }
8810
8811
  }
8811
- function Zf(e, t) {
8812
+ function Xf(e, t) {
8812
8813
  if (e.status >= 200 && e.status < 300) return;
8813
- let n = Qf(e.data);
8814
+ let n = Zf(e.data);
8814
8815
  throw e.status == 401 ? new i(`Outlook ${t} rejected the Connection.`) : e.status == 403 && n.has("mailboxnotenabledforrestapi") ? new r("The Outlook mailbox is not reachable through the Graph mail APIs.") : e.status == 403 && (n.has("accessdenied") || n.has("erroraccessdenied")) ? new i(`Outlook ${t} rejected the Connection.`) : e.status == 404 && (n.has("erroritemnotfound") || n.has("itemnotfound")) ? new r("The configured Outlook folder does not exist.") : e.status == 400 && (n.has("errorinvalididmalformed") || n.has("inefficientfilter")) ? new r("Outlook rejected the configured folder or filters.") : new a(`Outlook ${t} failed with status ${e.status}.`);
8815
8816
  }
8816
- function Qf(e) {
8817
- let t = /* @__PURE__ */ new Set(), n = np(e)?.error;
8817
+ function Zf(e) {
8818
+ let t = /* @__PURE__ */ new Set(), n = tp(e)?.error;
8818
8819
  for (let e = 0; e < 4; e += 1) {
8819
- let e = np(n);
8820
+ let e = tp(n);
8820
8821
  if (e == null) break;
8821
8822
  typeof e.code == "string" && e.code.length > 0 && t.add(e.code.toLowerCase()), n = e.innerError ?? e.innererror;
8822
8823
  }
8823
8824
  return t;
8824
8825
  }
8825
- function $f(e) {
8826
- let t = np(e)?.value;
8826
+ function Qf(e) {
8827
+ let t = tp(e)?.value;
8827
8828
  return Array.isArray(t) ? t : [];
8828
8829
  }
8829
- function ep(e) {
8830
+ function $f(e) {
8830
8831
  let t = null;
8831
8832
  for (let n of e) {
8832
- let e = tp(n.receivedDateTime);
8833
+ let e = ep(n.receivedDateTime);
8833
8834
  n.receivedDateTime != null && e != null && (t == null || e > t.ms) && (t = {
8834
8835
  iso: n.receivedDateTime,
8835
8836
  ms: e
@@ -8837,15 +8838,15 @@ function ep(e) {
8837
8838
  }
8838
8839
  return t;
8839
8840
  }
8840
- function tp(e) {
8841
+ function ep(e) {
8841
8842
  if (e == null || e.length == 0) return null;
8842
8843
  let t = Date.parse(e);
8843
8844
  return Number.isNaN(t) ? null : t;
8844
8845
  }
8845
- function np(e) {
8846
+ function tp(e) {
8846
8847
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
8847
8848
  }
8848
- var rp = {
8849
+ var np = {
8849
8850
  initialState: {
8850
8851
  checkpoint: null,
8851
8852
  subscription: {}
@@ -8923,7 +8924,7 @@ var rp = {
8923
8924
  outcome: "ignored",
8924
8925
  reason: "Shopify topic header is missing."
8925
8926
  };
8926
- if (!ip(e.config).includes(t)) return {
8927
+ if (!rp(e.config).includes(t)) return {
8927
8928
  outcome: "ignored",
8928
8929
  reason: "Shopify topic is not subscribed."
8929
8930
  };
@@ -8943,39 +8944,39 @@ var rp = {
8943
8944
  };
8944
8945
  },
8945
8946
  async reconcile(e) {
8946
- let n = fp(e.state), r = await op(e);
8947
+ let n = dp(e.state), r = await ap(e);
8947
8948
  if (r == null) {
8948
8949
  if (!e.active) return { outcome: "ready" };
8949
8950
  throw new t("The Shopify store or webhook resource is unavailable.");
8950
8951
  }
8951
8952
  if (!e.active) {
8952
- for (let t of r.values()) await cp(e, t);
8953
- return await n.saveSubscription({}, pp(e.now)), { outcome: "ready" };
8953
+ for (let t of r.values()) await sp(e, t);
8954
+ return await n.saveSubscription({}, fp(e.now)), { outcome: "ready" };
8954
8955
  }
8955
- let i = ip(e.config), a = [], o = [];
8956
+ let i = rp(e.config), a = [], o = [];
8956
8957
  try {
8957
8958
  for (let t of i) {
8958
8959
  let n = r.get(t);
8959
8960
  if (n != null) a.push(n);
8960
8961
  else {
8961
- let n = await ap(e, t);
8962
+ let n = await ip(e, t);
8962
8963
  a.push(n.id), n.created && o.push(n.id);
8963
8964
  }
8964
8965
  }
8965
8966
  } catch (t) {
8966
- throw await Promise.allSettled(o.map((t) => cp(e, t))), t;
8967
+ throw await Promise.allSettled(o.map((t) => sp(e, t))), t;
8967
8968
  }
8968
- for (let [t, n] of r) i.includes(t) || await cp(e, n);
8969
- return await n.saveSubscription({ webhookIds: a }, pp(e.now)), { outcome: "ready" };
8969
+ for (let [t, n] of r) i.includes(t) || await sp(e, n);
8970
+ return await n.saveSubscription({ webhookIds: a }, fp(e.now)), { outcome: "ready" };
8970
8971
  }
8971
8972
  };
8972
- function ip(e) {
8973
+ function rp(e) {
8973
8974
  return [...new Set(e.topics)];
8974
8975
  }
8975
- async function ap(e, t) {
8976
- let r = await lp(e, "subscription create", {
8976
+ async function ip(e, t) {
8977
+ let r = await cp(e, "subscription create", {
8977
8978
  body: { webhook: {
8978
- address: sp(e),
8979
+ address: op(e),
8979
8980
  format: "json",
8980
8981
  topic: t
8981
8982
  } },
@@ -8983,22 +8984,22 @@ async function ap(e, t) {
8983
8984
  method: "POST"
8984
8985
  });
8985
8986
  if (r.status == 422) {
8986
- let n = (await op(e))?.get(t);
8987
+ let n = (await ap(e))?.get(t);
8987
8988
  if (n != null) return {
8988
8989
  created: !1,
8989
8990
  id: n
8990
8991
  };
8991
8992
  }
8992
- up(r, "subscription create");
8993
- let i = dp(mp(mp(r.data)?.webhook)?.id);
8993
+ lp(r, "subscription create");
8994
+ let i = up(pp(pp(r.data)?.webhook)?.id);
8994
8995
  if (i == null) throw new n("Shopify subscription response is missing its ID.");
8995
8996
  return {
8996
8997
  created: !0,
8997
8998
  id: i
8998
8999
  };
8999
9000
  }
9000
- async function op(e) {
9001
- let t = sp(e), n = await lp(e, "subscription list", {
9001
+ async function ap(e) {
9002
+ let t = op(e), n = await cp(e, "subscription list", {
9002
9003
  endpoint: "/webhooks.json",
9003
9004
  method: "GET",
9004
9005
  query: {
@@ -9007,34 +9008,34 @@ async function op(e) {
9007
9008
  }
9008
9009
  });
9009
9010
  if (n.status == 404) return null;
9010
- up(n, "subscription list");
9011
- let r = mp(n.data)?.webhooks, i = /* @__PURE__ */ new Map();
9011
+ lp(n, "subscription list");
9012
+ let r = pp(n.data)?.webhooks, i = /* @__PURE__ */ new Map();
9012
9013
  if (!Array.isArray(r)) return i;
9013
9014
  for (let e of r) {
9014
- let n = mp(e), r = dp(n?.id);
9015
+ let n = pp(e), r = up(n?.id);
9015
9016
  n?.address === t && typeof n.topic == "string" && r != null && i.set(n.topic, r);
9016
9017
  }
9017
9018
  return i;
9018
9019
  }
9019
- function sp(e) {
9020
+ function op(e) {
9020
9021
  let t = new URL(e.endpointUrl);
9021
9022
  return t.searchParams.set("open_flow_callback", e.callbackSecret), t.href;
9022
9023
  }
9023
- async function cp(e, t) {
9024
- let n = await lp(e, "subscription delete", {
9024
+ async function sp(e, t) {
9025
+ let n = await cp(e, "subscription delete", {
9025
9026
  endpoint: `/webhooks/${encodeURIComponent(t)}.json`,
9026
9027
  method: "DELETE"
9027
9028
  });
9028
- n.status != 404 && up(n, "subscription delete");
9029
+ n.status != 404 && lp(n, "subscription delete");
9029
9030
  }
9030
- async function lp(t, r, i) {
9031
+ async function cp(t, r, i) {
9031
9032
  try {
9032
9033
  return await t.connector.execute(i, t.signal);
9033
9034
  } catch (t) {
9034
9035
  throw t instanceof e ? t : new n(`Shopify ${r} request failed.`, { cause: t });
9035
9036
  }
9036
9037
  }
9037
- function up(r, i) {
9038
+ function lp(r, i) {
9038
9039
  if (!(r.status >= 200 && r.status < 300)) throw r.status == 401 || r.status == 403 ? new e(`Shopify ${i} rejected the Connection.`) : [
9039
9040
  402,
9040
9041
  404,
@@ -9043,34 +9044,34 @@ function up(r, i) {
9043
9044
  501
9044
9045
  ].includes(r.status) ? new t(`Shopify ${i} rejected the subscription.`) : new n(`Shopify ${i} failed with status ${r.status}.`);
9045
9046
  }
9046
- function dp(e) {
9047
+ function up(e) {
9047
9048
  return typeof e == "string" ? e.trim().length == 0 ? null : e : typeof e == "number" && Number.isFinite(e) ? String(e) : null;
9048
9049
  }
9049
- function fp(e) {
9050
+ function dp(e) {
9050
9051
  if (e == null) throw new t("Shopify Integration state is missing.");
9051
9052
  return e;
9052
9053
  }
9053
- function pp(e) {
9054
+ function fp(e) {
9054
9055
  return new Date(e.getTime() + 2592e6);
9055
9056
  }
9056
- function mp(e) {
9057
+ function pp(e) {
9057
9058
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
9058
9059
  }
9059
9060
  //#endregion
9060
9061
  //#region src/trigger/providers/slack/on-message-posted.ts
9061
- var hp = 15, gp = 6e4, _p = /* @__PURE__ */ new Set([
9062
+ var mp = 15, hp = 6e4, gp = /* @__PURE__ */ new Set([
9062
9063
  "file_share",
9063
9064
  "thread_broadcast",
9064
9065
  "me_message",
9065
9066
  "bot_message"
9066
- ]), vp = /* @__PURE__ */ new Set([
9067
+ ]), _p = /* @__PURE__ */ new Set([
9067
9068
  "invalid_auth",
9068
9069
  "not_authed",
9069
9070
  "token_revoked",
9070
9071
  "token_expired",
9071
9072
  "account_inactive",
9072
9073
  "two_factor_setup_required"
9073
- ]), yp = /* @__PURE__ */ new Set([
9074
+ ]), vp = /* @__PURE__ */ new Set([
9074
9075
  "channel_not_found",
9075
9076
  "not_in_channel",
9076
9077
  "missing_scope",
@@ -9086,7 +9087,7 @@ var hp = 15, gp = 6e4, _p = /* @__PURE__ */ new Set([
9086
9087
  "method_deprecated",
9087
9088
  "deprecated_endpoint",
9088
9089
  "accesslimited"
9089
- ]), bp = {
9090
+ ]), yp = {
9090
9091
  buildOutputs: o,
9091
9092
  snapshot: {
9092
9093
  configSchema: {
@@ -9127,7 +9128,7 @@ var hp = 15, gp = 6e4, _p = /* @__PURE__ */ new Set([
9127
9128
  type: "boolean"
9128
9129
  },
9129
9130
  maxMessagesPerPoll: {
9130
- default: hp,
9131
+ default: mp,
9131
9132
  description: "Maximum number of messages processed per poll.",
9132
9133
  maximum: 100,
9133
9134
  minimum: 1,
@@ -9205,47 +9206,47 @@ var hp = 15, gp = 6e4, _p = /* @__PURE__ */ new Set([
9205
9206
  type: "poll"
9206
9207
  },
9207
9208
  async poll(e) {
9208
- let t = xp(e.config);
9209
+ let t = bp(e.config);
9209
9210
  if (e.checkpoint === null) return {
9210
- checkpoint: { lastTs: await Sp(e, t.channelId) },
9211
+ checkpoint: { lastTs: await xp(e, t.channelId) },
9211
9212
  events: []
9212
9213
  };
9213
- let n = Cp(e.checkpoint), r = await wp(e, t, n), i = Dp(r), a = [], o = 0;
9214
+ let n = Sp(e.checkpoint), r = await Cp(e, t, n), i = Ep(r), a = [], o = 0;
9214
9215
  for (let e of i.toReversed()) {
9215
- if (!kp(e.message, t)) {
9216
+ if (!Op(e.message, t)) {
9216
9217
  o += 1;
9217
9218
  continue;
9218
9219
  }
9219
- a.push(Ap(e, t.channelId));
9220
+ a.push(kp(e, t.channelId));
9220
9221
  }
9221
9222
  return {
9222
- checkpoint: Op(n, r, i),
9223
+ checkpoint: Dp(n, r, i),
9223
9224
  events: a,
9224
9225
  filtered: o
9225
9226
  };
9226
9227
  }
9227
9228
  };
9228
- function xp(e) {
9229
+ function bp(e) {
9229
9230
  return {
9230
9231
  channelId: e.channelId,
9231
9232
  fromUserIds: e.fromUserIds ?? [],
9232
9233
  ignoreUserIds: e.ignoreUserIds ?? [],
9233
9234
  includeBotMessages: e.includeBotMessages ?? !1,
9234
9235
  includeSystemMessages: e.includeSystemMessages ?? !1,
9235
- maxMessagesPerPoll: e.maxMessagesPerPoll ?? hp,
9236
+ maxMessagesPerPoll: e.maxMessagesPerPoll ?? mp,
9236
9237
  textContains: e.textContains ?? ""
9237
9238
  };
9238
9239
  }
9239
- async function Sp(e, t) {
9240
- let n = await Tp(e, {
9240
+ async function xp(e, t) {
9241
+ let n = await wp(e, {
9241
9242
  channel: t,
9242
9243
  limit: 1
9243
9244
  });
9244
- Ep(n, "baseline history fetch");
9245
+ Tp(n, "baseline history fetch");
9245
9246
  let r = n.data.messages?.[0]?.ts;
9246
- return r != null && jp(r) ? r : `${Math.floor((e.now.getTime() - gp) / 1e3)}.000000`;
9247
+ return r != null && Ap(r) ? r : `${Math.floor((e.now.getTime() - hp) / 1e3)}.000000`;
9247
9248
  }
9248
- function Cp(e) {
9249
+ function Sp(e) {
9249
9250
  let t = e;
9250
9251
  if (typeof t.lastTs != "string" || t.lastTs.length == 0) throw new r("Slack checkpoint lastTs is missing.");
9251
9252
  let n = t.drainLatest, i = t.pendingHighTs;
@@ -9257,17 +9258,17 @@ function Cp(e) {
9257
9258
  pendingHighTs: i
9258
9259
  };
9259
9260
  }
9260
- async function wp(e, t, n) {
9261
- let r = await Tp(e, {
9261
+ async function Cp(e, t, n) {
9262
+ let r = await wp(e, {
9262
9263
  channel: t.channelId,
9263
9264
  inclusive: "false",
9264
9265
  latest: n.drainLatest,
9265
9266
  limit: t.maxMessagesPerPoll,
9266
9267
  oldest: n.lastTs
9267
9268
  });
9268
- return Ep(r, "history list"), r.data;
9269
+ return Tp(r, "history list"), r.data;
9269
9270
  }
9270
- async function Tp(e, t) {
9271
+ async function wp(e, t) {
9271
9272
  try {
9272
9273
  return await e.connector.execute({
9273
9274
  endpoint: "/conversations.history",
@@ -9278,19 +9279,19 @@ async function Tp(e, t) {
9278
9279
  throw new a("Slack proxy request failed.", { cause: e });
9279
9280
  }
9280
9281
  }
9281
- function Ep(e, t) {
9282
+ function Tp(e, t) {
9282
9283
  let n = e.data;
9283
9284
  if (e.status >= 200 && e.status < 300 && n.ok === !0) return;
9284
9285
  let o = typeof n.error == "string" ? n.error : "";
9285
- throw vp.has(o) ? new i(`Slack ${t} rejected with ${o}.`) : yp.has(o) ? new r(`Slack ${t} rejected with ${o}.`) : new a(`Slack ${t} failed with ${o || `status ${e.status}`}.`);
9286
+ throw _p.has(o) ? new i(`Slack ${t} rejected with ${o}.`) : vp.has(o) ? new r(`Slack ${t} rejected with ${o}.`) : new a(`Slack ${t} failed with ${o || `status ${e.status}`}.`);
9286
9287
  }
9287
- function Dp(e) {
9288
- return (e.messages ?? []).flatMap((e) => e.ts != null && jp(e.ts) ? [{
9288
+ function Ep(e) {
9289
+ return (e.messages ?? []).flatMap((e) => e.ts != null && Ap(e.ts) ? [{
9289
9290
  message: e,
9290
9291
  ts: e.ts
9291
9292
  }] : []);
9292
9293
  }
9293
- function Op(e, t, n) {
9294
+ function Dp(e, t, n) {
9294
9295
  let r = n[0]?.ts, i = n.at(-1)?.ts;
9295
9296
  if (t.has_more === !0) {
9296
9297
  if (r == null || i == null) throw new a("Slack history reports has_more without a usable timestamp.");
@@ -9302,10 +9303,10 @@ function Op(e, t, n) {
9302
9303
  }
9303
9304
  return e.pendingHighTs == null ? { lastTs: r ?? e.lastTs } : { lastTs: e.pendingHighTs };
9304
9305
  }
9305
- function kp(e, t) {
9306
- return !t.includeBotMessages && (e.bot_id != null || e.subtype == "bot_message") || !t.includeSystemMessages && e.subtype != null && !_p.has(e.subtype) || t.fromUserIds.length > 0 && (e.user == null || !t.fromUserIds.includes(e.user)) || e.user != null && t.ignoreUserIds.includes(e.user) ? !1 : t.textContains.length == 0 || (e.text ?? "").toLowerCase().includes(t.textContains.toLowerCase());
9306
+ function Op(e, t) {
9307
+ return !t.includeBotMessages && (e.bot_id != null || e.subtype == "bot_message") || !t.includeSystemMessages && e.subtype != null && !gp.has(e.subtype) || t.fromUserIds.length > 0 && (e.user == null || !t.fromUserIds.includes(e.user)) || e.user != null && t.ignoreUserIds.includes(e.user) ? !1 : t.textContains.length == 0 || (e.text ?? "").toLowerCase().includes(t.textContains.toLowerCase());
9307
9308
  }
9308
- function Ap(e, t) {
9309
+ function kp(e, t) {
9309
9310
  return {
9310
9311
  dedupeKey: `${t}:${e.ts}`,
9311
9312
  payload: {
@@ -9324,12 +9325,12 @@ function Ap(e, t) {
9324
9325
  }
9325
9326
  };
9326
9327
  }
9327
- function jp(e) {
9328
+ function Ap(e) {
9328
9329
  return /^\d+(?:\.\d+)?$/.test(e) && !Number.isNaN(new Date(Math.round(Number(e) * 1e3)).getTime());
9329
9330
  }
9330
9331
  //#endregion
9331
9332
  //#region src/trigger/providers/stripe/on-event.ts
9332
- var Mp = 300, Np = "/v1/webhook_endpoints", Pp = { "Content-Type": "application/x-www-form-urlencoded" }, Fp = {
9333
+ var jp = 300, Mp = "/v1/webhook_endpoints", Np = { "Content-Type": "application/x-www-form-urlencoded" }, Pp = {
9333
9334
  initialState: {
9334
9335
  checkpoint: null,
9335
9336
  subscription: {}
@@ -9401,8 +9402,8 @@ var Mp = 300, Np = "/v1/webhook_endpoints", Pp = { "Content-Type": "application/
9401
9402
  type: "integration"
9402
9403
  },
9403
9404
  async receive(e) {
9404
- let t = Gp(e.state);
9405
- if (t == null || !await Kp(e.header("stripe-signature"), t, e.rawBody, e.now)) return {
9405
+ let t = Wp(e.state);
9406
+ if (t == null || !await Gp(e.header("stripe-signature"), t, e.rawBody, e.now)) return {
9406
9407
  body: "",
9407
9408
  contentType: "text/plain",
9408
9409
  outcome: "respond",
@@ -9417,7 +9418,7 @@ var Mp = 300, Np = "/v1/webhook_endpoints", Pp = { "Content-Type": "application/
9417
9418
  outcome: "ignored",
9418
9419
  reason: "Stripe event identity is missing."
9419
9420
  };
9420
- let a = Ip(e.config);
9421
+ let a = Fp(e.config);
9421
9422
  return !a.events.includes("*") && !a.events.includes(r) ? {
9422
9423
  outcome: "ignored",
9423
9424
  reason: "Stripe event is not subscribed."
@@ -9433,156 +9434,156 @@ var Mp = 300, Np = "/v1/webhook_endpoints", Pp = { "Content-Type": "application/
9433
9434
  };
9434
9435
  },
9435
9436
  async reconcile(e) {
9436
- let t = Up(e.state), n = Ip(e.config), r = Wp(t), i = Gp(t);
9437
+ let t = Hp(e.state), n = Fp(e.config), r = Up(t), i = Wp(t);
9437
9438
  if (!e.active) {
9438
- if (r ??= await zp(e), r != null) {
9439
- let t = await Bp(e, "endpoint delete", {
9440
- endpoint: `${Np}/${r}`,
9439
+ if (r ??= await Rp(e), r != null) {
9440
+ let t = await zp(e, "endpoint delete", {
9441
+ endpoint: `${Mp}/${r}`,
9441
9442
  method: "DELETE"
9442
9443
  });
9443
- t.status != 404 && Vp(t, "endpoint delete");
9444
+ t.status != 404 && Bp(t, "endpoint delete");
9444
9445
  }
9445
- return await t.saveSubscription({}, qp(e.now)), { outcome: "ready" };
9446
+ return await t.saveSubscription({}, Kp(e.now)), { outcome: "ready" };
9446
9447
  }
9447
- if (r ??= await zp(e), r != null && i == null) {
9448
- let t = await Bp(e, "endpoint delete", {
9449
- endpoint: `${Np}/${r}`,
9448
+ if (r ??= await Rp(e), r != null && i == null) {
9449
+ let t = await zp(e, "endpoint delete", {
9450
+ endpoint: `${Mp}/${r}`,
9450
9451
  method: "DELETE"
9451
9452
  });
9452
- t.status != 404 && Vp(t, "endpoint delete"), r = null;
9453
+ t.status != 404 && Bp(t, "endpoint delete"), r = null;
9453
9454
  }
9454
9455
  if (r == null) {
9455
- let t = await Bp(e, "endpoint create", {
9456
- body: Lp(e.endpointUrl, n),
9457
- endpoint: Np,
9456
+ let t = await zp(e, "endpoint create", {
9457
+ body: Ip(e.endpointUrl, n),
9458
+ endpoint: Mp,
9458
9459
  headers: {
9459
- ...Pp,
9460
+ ...Np,
9460
9461
  "Idempotency-Key": e.idempotencyKey
9461
9462
  },
9462
9463
  method: "POST"
9463
9464
  });
9464
- Vp(t, "endpoint create");
9465
- let a = Hp(t.data);
9465
+ Bp(t, "endpoint create");
9466
+ let a = Vp(t.data);
9466
9467
  r = a.id, i = a.secret;
9467
9468
  }
9468
- let a = await Bp(e, "endpoint update", {
9469
- body: Rp([
9469
+ let a = await zp(e, "endpoint update", {
9470
+ body: Lp([
9470
9471
  ...n.events.map((e, t) => [`enabled_events[${t}]`, e]),
9471
9472
  ["disabled", "false"],
9472
9473
  ["description", "Managed by Open Flow."]
9473
9474
  ]),
9474
- endpoint: `${Np}/${r}`,
9475
- headers: Pp,
9475
+ endpoint: `${Mp}/${r}`,
9476
+ headers: Np,
9476
9477
  method: "POST"
9477
9478
  });
9478
- return a.status == 404 ? (await t.saveSubscription({}, e.now), { outcome: "pending" }) : (Vp(a, "endpoint update"), await t.saveSubscription({
9479
+ return a.status == 404 ? (await t.saveSubscription({}, e.now), { outcome: "pending" }) : (Bp(a, "endpoint update"), await t.saveSubscription({
9479
9480
  endpointId: r,
9480
9481
  signingSecret: i
9481
- }, qp(e.now)), { outcome: "ready" });
9482
+ }, Kp(e.now)), { outcome: "ready" });
9482
9483
  }
9483
9484
  };
9484
- function Ip(e) {
9485
+ function Fp(e) {
9485
9486
  return {
9486
9487
  apiVersion: e.apiVersion ?? "",
9487
9488
  events: [...new Set(e.events)],
9488
9489
  includeConnectedAccounts: e.includeConnectedAccounts ?? !1
9489
9490
  };
9490
9491
  }
9491
- function Lp(e, t) {
9492
+ function Ip(e, t) {
9492
9493
  let n = [
9493
9494
  ["url", e],
9494
9495
  ...t.events.map((e, t) => [`enabled_events[${t}]`, e]),
9495
9496
  ["description", "Managed by Open Flow."]
9496
9497
  ];
9497
- return t.includeConnectedAccounts && n.push(["connect", "true"]), t.apiVersion.length > 0 && n.push(["api_version", t.apiVersion]), Rp(n);
9498
+ return t.includeConnectedAccounts && n.push(["connect", "true"]), t.apiVersion.length > 0 && n.push(["api_version", t.apiVersion]), Lp(n);
9498
9499
  }
9499
- function Rp(e) {
9500
+ function Lp(e) {
9500
9501
  let t = new URLSearchParams();
9501
9502
  for (let [n, r] of e) t.append(n, r);
9502
9503
  return t.toString();
9503
9504
  }
9504
- async function zp(e) {
9505
+ async function Rp(e) {
9505
9506
  let t;
9506
9507
  for (let n = 0; n < 10; n += 1) {
9507
- let n = await Bp(e, "endpoint list", {
9508
- endpoint: Np,
9508
+ let n = await zp(e, "endpoint list", {
9509
+ endpoint: Mp,
9509
9510
  method: "GET",
9510
9511
  query: {
9511
9512
  limit: 100,
9512
9513
  ...t == null ? {} : { starting_after: t }
9513
9514
  }
9514
9515
  });
9515
- Vp(n, "endpoint list");
9516
- let r = Jp(n.data), i = Array.isArray(r?.data) ? r.data : [];
9516
+ Bp(n, "endpoint list");
9517
+ let r = qp(n.data), i = Array.isArray(r?.data) ? r.data : [];
9517
9518
  for (let t of i) {
9518
- let n = Jp(t);
9519
+ let n = qp(t);
9519
9520
  if (n?.url === e.endpointUrl && typeof n.id == "string") return n.id;
9520
9521
  }
9521
- let a = Jp(i.at(-1))?.id;
9522
+ let a = qp(i.at(-1))?.id;
9522
9523
  if (r?.has_more !== !0 || typeof a != "string") return null;
9523
9524
  t = a;
9524
9525
  }
9525
9526
  return null;
9526
9527
  }
9527
- async function Bp(t, r, i) {
9528
+ async function zp(t, r, i) {
9528
9529
  try {
9529
9530
  return await t.connector.execute(i, t.signal);
9530
9531
  } catch (t) {
9531
9532
  throw t instanceof e ? t : new n(`Stripe ${r} request failed.`, { cause: t });
9532
9533
  }
9533
9534
  }
9534
- function Vp(r, i) {
9535
+ function Bp(r, i) {
9535
9536
  if (!(r.status >= 200 && r.status < 300)) {
9536
9537
  if (r.status == 401 || r.status == 403) throw new e(`Stripe ${i} rejected the Connection.`);
9537
9538
  if (r.status == 400 || r.status == 404) {
9538
- let e = Jp(Jp(r.data)?.error)?.message;
9539
+ let e = qp(qp(r.data)?.error)?.message;
9539
9540
  throw new t(`Stripe ${i} rejected the subscription${typeof e == "string" ? `: ${e}` : "."}`);
9540
9541
  }
9541
9542
  throw new n(`Stripe ${i} failed with status ${r.status}.`);
9542
9543
  }
9543
9544
  }
9544
- function Hp(e) {
9545
- let t = Jp(e);
9545
+ function Vp(e) {
9546
+ let t = qp(e);
9546
9547
  if (typeof t?.id != "string" || typeof t.secret != "string" || t.secret.length == 0) throw new n("Stripe endpoint response is missing its ID or signing secret.");
9547
9548
  return {
9548
9549
  id: t.id,
9549
9550
  secret: t.secret
9550
9551
  };
9551
9552
  }
9552
- function Up(e) {
9553
+ function Hp(e) {
9553
9554
  if (e == null) throw new t("Stripe Integration state is missing.");
9554
9555
  return e;
9555
9556
  }
9556
- function Wp(e) {
9557
+ function Up(e) {
9557
9558
  let t = e.subscription.endpointId;
9558
9559
  return typeof t == "string" && t.length > 0 ? t : null;
9559
9560
  }
9560
- function Gp(e) {
9561
+ function Wp(e) {
9561
9562
  let t = e?.subscription.signingSecret;
9562
9563
  return typeof t == "string" && t.length > 0 ? t : null;
9563
9564
  }
9564
- async function Kp(e, t, n, r) {
9565
+ async function Gp(e, t, n, r) {
9565
9566
  if (e == null) return !1;
9566
9567
  let i = e.split(",").map((e) => e.trim().split("=", 2)), a = i.find(([e]) => e == "t")?.[1];
9567
9568
  if (a == null || !/^\d+$/.test(a)) return !1;
9568
9569
  let o = Number(a);
9569
- if (!Number.isSafeInteger(o) || Math.abs(Math.floor(r.getTime() / 1e3) - o) > Mp) return !1;
9570
+ if (!Number.isSafeInteger(o) || Math.abs(Math.floor(r.getTime() / 1e3) - o) > jp) return !1;
9570
9571
  let s = i.filter(([e, t]) => e == "v1" && t != null).map(([, e]) => e), c = [Te(`${a}.`), n];
9571
9572
  return (await Promise.all(s.map((e) => Oe(t, c, e)))).some(Boolean);
9572
9573
  }
9573
- function qp(e) {
9574
+ function Kp(e) {
9574
9575
  return new Date(e.getTime() + 2592e6);
9575
9576
  }
9576
- function Jp(e) {
9577
+ function qp(e) {
9577
9578
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
9578
9579
  }
9579
9580
  //#endregion
9580
9581
  //#region src/trigger/providers/telegram/on-update.ts
9581
- var Yp = /* @__PURE__ */ new Set([
9582
+ var Jp = /* @__PURE__ */ new Set([
9582
9583
  "chat_member",
9583
9584
  "message_reaction",
9584
9585
  "message_reaction_count"
9585
- ]), Xp = /* @__PURE__ */ "*.message.edited_message.channel_post.edited_channel_post.business_connection.business_message.edited_business_message.deleted_business_messages.guest_message.message_reaction.message_reaction_count.inline_query.chosen_inline_result.callback_query.shipping_query.pre_checkout_query.purchased_paid_media.poll.poll_answer.my_chat_member.chat_member.chat_join_request.chat_boost.removed_chat_boost.managed_bot.subscription".split("."), Zp = Xp.filter((e) => e != "*" && !Yp.has(e)), Qp = {
9586
+ ]), Yp = /* @__PURE__ */ "*.message.edited_message.channel_post.edited_channel_post.business_connection.business_message.edited_business_message.deleted_business_messages.guest_message.message_reaction.message_reaction_count.inline_query.chosen_inline_result.callback_query.shipping_query.pre_checkout_query.purchased_paid_media.poll.poll_answer.my_chat_member.chat_member.chat_join_request.chat_boost.removed_chat_boost.managed_bot.subscription".split("."), Xp = Yp.filter((e) => e != "*" && !Jp.has(e)), Zp = {
9586
9587
  snapshot: {
9587
9588
  configSchema: {
9588
9589
  additionalProperties: !1,
@@ -9606,7 +9607,7 @@ var Yp = /* @__PURE__ */ new Set([
9606
9607
  },
9607
9608
  updates: {
9608
9609
  description: "Telegram update types that trigger a Run. Use * for the Telegram default set.",
9609
- items: { enum: Xp },
9610
+ items: { enum: Yp },
9610
9611
  minItems: 1,
9611
9612
  type: "array",
9612
9613
  uniqueItems: !0
@@ -9664,13 +9665,13 @@ var Yp = /* @__PURE__ */ new Set([
9664
9665
  type: "integration"
9665
9666
  },
9666
9667
  receive(e) {
9667
- if (!tm(e.header("x-telegram-bot-api-secret-token"), e.callbackSecret)) return {
9668
+ if (!em(e.header("x-telegram-bot-api-secret-token"), e.callbackSecret)) return {
9668
9669
  body: "",
9669
9670
  contentType: "text/plain",
9670
9671
  outcome: "respond",
9671
9672
  status: 404
9672
9673
  };
9673
- if (!nm(e.payload) || !Number.isSafeInteger(e.payload.update_id)) return {
9674
+ if (!tm(e.payload) || !Number.isSafeInteger(e.payload.update_id)) return {
9674
9675
  outcome: "ignored",
9675
9676
  reason: "Telegram update_id is missing."
9676
9677
  };
@@ -9679,21 +9680,21 @@ var Yp = /* @__PURE__ */ new Set([
9679
9680
  outcome: "ignored",
9680
9681
  reason: "Telegram update body is missing."
9681
9682
  };
9682
- let n = $p(e.config);
9683
- if (!(em(n) ?? Zp).includes(t)) return {
9683
+ let n = Qp(e.config);
9684
+ if (!($p(n) ?? Xp).includes(t)) return {
9684
9685
  outcome: "ignored",
9685
9686
  reason: "Telegram update type is not subscribed."
9686
9687
  };
9687
9688
  let r = e.payload[t];
9688
9689
  if (n.chatIds.length > 0) {
9689
- let e = im(r);
9690
+ let e = rm(r);
9690
9691
  if (e == null || !n.chatIds.includes(e)) return {
9691
9692
  outcome: "ignored",
9692
9693
  reason: "Telegram chat does not match."
9693
9694
  };
9694
9695
  }
9695
9696
  if (n.userIds.length > 0) {
9696
- let e = am(r);
9697
+ let e = im(r);
9697
9698
  if (e == null || !n.userIds.includes(e)) return {
9698
9699
  outcome: "ignored",
9699
9700
  reason: "Telegram user does not match."
@@ -9711,19 +9712,19 @@ var Yp = /* @__PURE__ */ new Set([
9711
9712
  };
9712
9713
  },
9713
9714
  async reconcile(e) {
9714
- let n = await om(e);
9715
- if (!e.active) return n == e.endpointUrl && await sm(e), { outcome: "ready" };
9716
- if (n != "" && n != e.endpointUrl) throw new t(`The Telegram bot already sends updates to ${lm(n)}.`);
9717
- let r = $p(e.config);
9718
- return await cm(e, "setWebhook", {
9719
- allowed_updates: em(r) ?? [],
9715
+ let n = await am(e);
9716
+ if (!e.active) return n == e.endpointUrl && await om(e), { outcome: "ready" };
9717
+ if (n != "" && n != e.endpointUrl) throw new t(`The Telegram bot already sends updates to ${cm(n)}.`);
9718
+ let r = Qp(e.config);
9719
+ return await sm(e, "setWebhook", {
9720
+ allowed_updates: $p(r) ?? [],
9720
9721
  drop_pending_updates: n == "" && r.dropPendingUpdates,
9721
9722
  secret_token: e.callbackSecret,
9722
9723
  url: e.endpointUrl
9723
9724
  }), { outcome: "ready" };
9724
9725
  }
9725
9726
  };
9726
- function $p(e) {
9727
+ function Qp(e) {
9727
9728
  return {
9728
9729
  chatIds: e.chatIds ?? [],
9729
9730
  dropPendingUpdates: e.dropPendingUpdates ?? !0,
@@ -9731,38 +9732,38 @@ function $p(e) {
9731
9732
  userIds: e.userIds ?? []
9732
9733
  };
9733
9734
  }
9734
- function em(e) {
9735
+ function $p(e) {
9735
9736
  if (!e.updates.includes("*")) return e.updates;
9736
9737
  let t = e.updates.filter((e) => e != "*");
9737
- return t.length == 0 ? null : [.../* @__PURE__ */ new Set([...Zp, ...t])];
9738
+ return t.length == 0 ? null : [.../* @__PURE__ */ new Set([...Xp, ...t])];
9738
9739
  }
9739
- function tm(e, t) {
9740
+ function em(e, t) {
9740
9741
  if (e == null || e.length != t.length) return !1;
9741
9742
  let n = 0;
9742
9743
  for (let r = 0; r < t.length; r += 1) n |= e.charCodeAt(r) ^ t.charCodeAt(r);
9743
9744
  return n == 0;
9744
9745
  }
9745
- function nm(e) {
9746
+ function tm(e) {
9746
9747
  return typeof e == "object" && !!e && !Array.isArray(e);
9747
9748
  }
9749
+ function nm(e) {
9750
+ if (tm(e)) return typeof e.id == "string" || typeof e.id == "number" ? String(e.id) : void 0;
9751
+ }
9748
9752
  function rm(e) {
9749
- if (nm(e)) return typeof e.id == "string" || typeof e.id == "number" ? String(e.id) : void 0;
9753
+ if (tm(e)) return nm(e.chat) ?? (tm(e.message) ? nm(e.message.chat) : void 0);
9750
9754
  }
9751
9755
  function im(e) {
9752
- if (nm(e)) return rm(e.chat) ?? (nm(e.message) ? rm(e.message.chat) : void 0);
9753
- }
9754
- function am(e) {
9755
- if (nm(e)) return rm(e.from) ?? rm(e.user);
9756
+ if (tm(e)) return nm(e.from) ?? nm(e.user);
9756
9757
  }
9757
- async function om(e) {
9758
- let t = await cm(e, "getWebhookInfo"), r = nm(t.result) ? t.result.url : void 0;
9758
+ async function am(e) {
9759
+ let t = await sm(e, "getWebhookInfo"), r = tm(t.result) ? t.result.url : void 0;
9759
9760
  if (typeof r != "string") throw new n("Telegram getWebhookInfo response is missing result.url.");
9760
9761
  return r;
9761
9762
  }
9762
- async function sm(e) {
9763
- await cm(e, "deleteWebhook", { drop_pending_updates: !1 });
9763
+ async function om(e) {
9764
+ await sm(e, "deleteWebhook", { drop_pending_updates: !1 });
9764
9765
  }
9765
- async function cm(r, i, a) {
9766
+ async function sm(r, i, a) {
9766
9767
  let o;
9767
9768
  try {
9768
9769
  o = await r.connector.execute({
@@ -9773,19 +9774,19 @@ async function cm(r, i, a) {
9773
9774
  } catch (t) {
9774
9775
  throw t instanceof e ? t : new n(`Telegram ${i} request failed.`, { cause: t });
9775
9776
  }
9776
- let s = nm(o.data) ? o.data : {};
9777
+ let s = tm(o.data) ? o.data : {};
9777
9778
  if (o.status >= 200 && o.status < 300 && s.ok === !0) return s;
9778
9779
  let c = typeof s.description == "string" ? s.description : `HTTP ${o.status}`;
9779
9780
  throw o.status == 401 || o.status == 403 ? new e(`Telegram ${i} rejected the Connection.`) : o.status >= 400 && o.status < 500 && o.status != 429 ? new t(`Telegram ${i} rejected the subscription: ${c}`) : new n(`Telegram ${i} failed: ${c}`);
9780
9781
  }
9781
- function lm(e) {
9782
+ function cm(e) {
9782
9783
  try {
9783
9784
  return new URL(e).host;
9784
9785
  } catch {
9785
9786
  return "an invalid URL";
9786
9787
  }
9787
9788
  }
9788
- var um = {
9789
+ var lm = {
9789
9790
  initialState: {
9790
9791
  checkpoint: null,
9791
9792
  subscription: {}
@@ -9888,7 +9889,7 @@ var um = {
9888
9889
  outcome: "ignored",
9889
9890
  reason: "WooCommerce topic header is missing."
9890
9891
  };
9891
- if (!dm(e.config).events.includes(t)) return {
9892
+ if (!um(e.config).events.includes(t)) return {
9892
9893
  outcome: "ignored",
9893
9894
  reason: "WooCommerce topic is not subscribed."
9894
9895
  };
@@ -9908,31 +9909,31 @@ var um = {
9908
9909
  };
9909
9910
  },
9910
9911
  async reconcile(e) {
9911
- let t = Sm(e.state), n = dm(e.config), r = await mm(e);
9912
+ let t = xm(e.state), n = um(e.config), r = await pm(e);
9912
9913
  if (!e.active) {
9913
- for (let t of r) await hm(e, t.id);
9914
- return await t.saveSubscription({}, Cm(e.now)), { outcome: "ready" };
9914
+ for (let t of r) await mm(e, t.id);
9915
+ return await t.saveSubscription({}, Sm(e.now)), { outcome: "ready" };
9915
9916
  }
9916
9917
  let i = /* @__PURE__ */ new Map();
9917
9918
  for (let e of r) n.events.includes(e.topic) && !i.has(e.topic) && i.set(e.topic, e.id);
9918
9919
  let a = new Set(i.values());
9919
- for (let t of r) a.has(t.id) || await hm(e, t.id);
9920
+ for (let t of r) a.has(t.id) || await mm(e, t.id);
9920
9921
  let o = [];
9921
9922
  for (let t of n.events) {
9922
9923
  let r = i.get(t);
9923
- o.push(r == null ? await fm(e, n, t) : await pm(e, r, t));
9924
+ o.push(r == null ? await dm(e, n, t) : await fm(e, r, t));
9924
9925
  }
9925
- return await t.saveSubscription({ webhookIds: o }, Cm(e.now)), { outcome: "ready" };
9926
+ return await t.saveSubscription({ webhookIds: o }, Sm(e.now)), { outcome: "ready" };
9926
9927
  }
9927
9928
  };
9928
- function dm(e) {
9929
+ function um(e) {
9929
9930
  return {
9930
9931
  events: [...new Set(e.events)],
9931
9932
  webhookName: e.webhookName ?? "OOMOL Trigger"
9932
9933
  };
9933
9934
  }
9934
- async function fm(e, t, n) {
9935
- let r = await gm(e, `webhook create (${n})`, {
9935
+ async function dm(e, t, n) {
9936
+ let r = await hm(e, `webhook create (${n})`, {
9936
9937
  body: {
9937
9938
  delivery_url: e.endpointUrl,
9938
9939
  name: `${t.webhookName} - ${n}`,
@@ -9942,10 +9943,10 @@ async function fm(e, t, n) {
9942
9943
  endpoint: "/webhooks",
9943
9944
  method: "POST"
9944
9945
  });
9945
- return _m(r, `webhook create (${n})`), bm(r.data);
9946
+ return gm(r, `webhook create (${n})`), ym(r.data);
9946
9947
  }
9947
- async function pm(e, t, n) {
9948
- let r = await gm(e, `webhook update (${n})`, {
9948
+ async function fm(e, t, n) {
9949
+ let r = await hm(e, `webhook update (${n})`, {
9949
9950
  body: {
9950
9951
  delivery_url: e.endpointUrl,
9951
9952
  secret: e.callbackSecret,
@@ -9955,12 +9956,12 @@ async function pm(e, t, n) {
9955
9956
  endpoint: `/webhooks/${t}`,
9956
9957
  method: "PUT"
9957
9958
  });
9958
- return vm(r) ? fm(e, dm(e.config), n) : (_m(r, `webhook update (${n})`), t);
9959
+ return _m(r) ? dm(e, um(e.config), n) : (gm(r, `webhook update (${n})`), t);
9959
9960
  }
9960
- async function mm(e) {
9961
+ async function pm(e) {
9961
9962
  let t = [];
9962
9963
  for (let n = 1; n <= 10; n += 1) {
9963
- let r = await gm(e, "webhook list", {
9964
+ let r = await hm(e, "webhook list", {
9964
9965
  endpoint: "/webhooks",
9965
9966
  method: "GET",
9966
9967
  query: {
@@ -9970,12 +9971,12 @@ async function mm(e) {
9970
9971
  status: "all"
9971
9972
  }
9972
9973
  });
9973
- _m(r, "webhook list");
9974
+ gm(r, "webhook list");
9974
9975
  let i = Array.isArray(r.data) ? r.data : [];
9975
9976
  for (let n of i) {
9976
- let r = wm(n);
9977
+ let r = Cm(n);
9977
9978
  if (r?.delivery_url !== e.endpointUrl || typeof r.topic != "string") continue;
9978
- let i = xm(r.id);
9979
+ let i = bm(r.id);
9979
9980
  i != null && t.push({
9980
9981
  id: i,
9981
9982
  topic: r.topic
@@ -9985,54 +9986,54 @@ async function mm(e) {
9985
9986
  }
9986
9987
  throw new n("WooCommerce webhook list did not finish within ten pages.");
9987
9988
  }
9988
- async function hm(e, t) {
9989
- let n = await gm(e, "webhook delete", {
9989
+ async function mm(e, t) {
9990
+ let n = await hm(e, "webhook delete", {
9990
9991
  endpoint: `/webhooks/${t}`,
9991
9992
  method: "DELETE",
9992
9993
  query: { force: "true" }
9993
9994
  });
9994
- n.status != 404 && _m(n, "webhook delete");
9995
+ n.status != 404 && gm(n, "webhook delete");
9995
9996
  }
9996
- async function gm(t, r, i) {
9997
+ async function hm(t, r, i) {
9997
9998
  try {
9998
9999
  return await t.connector.execute(i, t.signal);
9999
10000
  } catch (t) {
10000
10001
  throw t instanceof e ? t : new n(`WooCommerce ${r} request failed.`, { cause: t });
10001
10002
  }
10002
10003
  }
10003
- function _m(r, i) {
10004
+ function gm(r, i) {
10004
10005
  if (r.status >= 200 && r.status < 300) return;
10005
- let a = ym(r.data);
10006
+ let a = vm(r.data);
10006
10007
  throw r.status == 401 || r.status == 403 ? new e(`WooCommerce ${i} rejected the Connection.`) : r.status == 404 || r.status == 400 && (a.endsWith("_invalid_topic") || a.endsWith("_invalid_delivery_url")) || r.status == 501 && a == "woocommerce_rest_trash_not_supported" ? new t(`WooCommerce ${i} rejected the subscription.`) : new n(`WooCommerce ${i} failed with status ${r.status}.`);
10007
10008
  }
10008
- function vm(e) {
10009
- return e.status == 400 && ym(e.data) == "woocommerce_rest_webhook_invalid_id";
10009
+ function _m(e) {
10010
+ return e.status == 400 && vm(e.data) == "woocommerce_rest_webhook_invalid_id";
10010
10011
  }
10011
- function ym(e) {
10012
- let t = wm(e)?.code;
10012
+ function vm(e) {
10013
+ let t = Cm(e)?.code;
10013
10014
  return typeof t == "string" ? t : "";
10014
10015
  }
10015
- function bm(e) {
10016
- let t = xm(wm(e)?.id);
10016
+ function ym(e) {
10017
+ let t = bm(Cm(e)?.id);
10017
10018
  if (t == null) throw new n("WooCommerce webhook response is missing its ID.");
10018
10019
  return t;
10019
10020
  }
10020
- function xm(e) {
10021
+ function bm(e) {
10021
10022
  return typeof e == "string" && e.length > 0 ? e : typeof e == "number" && Number.isFinite(e) ? String(e) : null;
10022
10023
  }
10023
- function Sm(e) {
10024
+ function xm(e) {
10024
10025
  if (e == null) throw new t("WooCommerce Integration state is missing.");
10025
10026
  return e;
10026
10027
  }
10027
- function Cm(e) {
10028
+ function Sm(e) {
10028
10029
  return new Date(e.getTime() + 2592e6);
10029
10030
  }
10030
- function wm(e) {
10031
+ function Cm(e) {
10031
10032
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
10032
10033
  }
10033
10034
  //#endregion
10034
10035
  //#region src/trigger/providers/zendesk/on-event.ts
10035
- var Tm = 3e5, Em = /* @__PURE__ */ "zen:event-type:ticket.agent_assignment_changed,zen:event-type:ticket.attachment_linked_to_comment,zen:event-type:ticket.attachment_redacted_from_comment,zen:event-type:ticket.brand_changed,zen:event-type:ticket.comment_added,zen:event-type:ticket.comment_made_private,zen:event-type:ticket.comment_redacted,zen:event-type:ticket.created,zen:event-type:ticket.csat_received,zen:event-type:ticket.csat_requested,zen:event-type:ticket.custom_field_changed,zen:event-type:ticket.custom_status_changed,zen:event-type:ticket.description_changed,zen:event-type:ticket.email_ccs_changed,zen:event-type:ticket.external_id_changed,zen:event-type:ticket.followers_changed,zen:event-type:ticket.form_changed,zen:event-type:ticket.group_assignment_changed,zen:event-type:ticket.marked_as_spam,zen:event-type:ticket.merged,zen:event-type:ticket.next_sla_breach_changed,zen:event-type:ticket.ola_policy_changed,zen:event-type:ticket.organization_changed,zen:event-type:ticket.permanently_deleted,zen:event-type:ticket.priority_changed,zen:event-type:ticket.problem_link_changed,zen:event-type:ticket.requester_changed,zen:event-type:ticket.schedule_changed,zen:event-type:ticket.sla_policy_changed,zen:event-type:ticket.soft_deleted,zen:event-type:ticket.status_changed,zen:event-type:ticket.subject_changed,zen:event-type:ticket.submitter_changed,zen:event-type:ticket.tags_changed,zen:event-type:ticket.task_due_at_changed,zen:event-type:ticket.type_changed,zen:event-type:ticket.undeleted,zen:event-type:organization.created,zen:event-type:organization.custom_field_changed,zen:event-type:organization.deleted,zen:event-type:organization.external_id_changed,zen:event-type:organization.name_changed,zen:event-type:organization.tags_changed,zen:event-type:user.active_changed,zen:event-type:user.alias_changed,zen:event-type:user.created,zen:event-type:user.custom_field_changed,zen:event-type:user.custom_role_changed,zen:event-type:user.default_group_changed,zen:event-type:user.deleted,zen:event-type:user.details_changed,zen:event-type:user.external_id_changed,zen:event-type:user.group_membership_created,zen:event-type:user.group_membership_deleted,zen:event-type:user.identity_changed,zen:event-type:user.identity_created,zen:event-type:user.identity_deleted,zen:event-type:user.last_login_changed,zen:event-type:user.merged,zen:event-type:user.name_changed,zen:event-type:user.notes_changed,zen:event-type:user.only_private_comments_changed,zen:event-type:user.organization_membership_created,zen:event-type:user.organization_membership_deleted,zen:event-type:user.password_changed,zen:event-type:user.photo_changed,zen:event-type:user.role_changed,zen:event-type:user.suspended_changed,zen:event-type:user.tags_changed,zen:event-type:user.time_zone_changed".split(","), Dm = "/api/v2/webhooks", Om = {
10036
+ var wm = 3e5, Tm = /* @__PURE__ */ "zen:event-type:ticket.agent_assignment_changed,zen:event-type:ticket.attachment_linked_to_comment,zen:event-type:ticket.attachment_redacted_from_comment,zen:event-type:ticket.brand_changed,zen:event-type:ticket.comment_added,zen:event-type:ticket.comment_made_private,zen:event-type:ticket.comment_redacted,zen:event-type:ticket.created,zen:event-type:ticket.csat_received,zen:event-type:ticket.csat_requested,zen:event-type:ticket.custom_field_changed,zen:event-type:ticket.custom_status_changed,zen:event-type:ticket.description_changed,zen:event-type:ticket.email_ccs_changed,zen:event-type:ticket.external_id_changed,zen:event-type:ticket.followers_changed,zen:event-type:ticket.form_changed,zen:event-type:ticket.group_assignment_changed,zen:event-type:ticket.marked_as_spam,zen:event-type:ticket.merged,zen:event-type:ticket.next_sla_breach_changed,zen:event-type:ticket.ola_policy_changed,zen:event-type:ticket.organization_changed,zen:event-type:ticket.permanently_deleted,zen:event-type:ticket.priority_changed,zen:event-type:ticket.problem_link_changed,zen:event-type:ticket.requester_changed,zen:event-type:ticket.schedule_changed,zen:event-type:ticket.sla_policy_changed,zen:event-type:ticket.soft_deleted,zen:event-type:ticket.status_changed,zen:event-type:ticket.subject_changed,zen:event-type:ticket.submitter_changed,zen:event-type:ticket.tags_changed,zen:event-type:ticket.task_due_at_changed,zen:event-type:ticket.type_changed,zen:event-type:ticket.undeleted,zen:event-type:organization.created,zen:event-type:organization.custom_field_changed,zen:event-type:organization.deleted,zen:event-type:organization.external_id_changed,zen:event-type:organization.name_changed,zen:event-type:organization.tags_changed,zen:event-type:user.active_changed,zen:event-type:user.alias_changed,zen:event-type:user.created,zen:event-type:user.custom_field_changed,zen:event-type:user.custom_role_changed,zen:event-type:user.default_group_changed,zen:event-type:user.deleted,zen:event-type:user.details_changed,zen:event-type:user.external_id_changed,zen:event-type:user.group_membership_created,zen:event-type:user.group_membership_deleted,zen:event-type:user.identity_changed,zen:event-type:user.identity_created,zen:event-type:user.identity_deleted,zen:event-type:user.last_login_changed,zen:event-type:user.merged,zen:event-type:user.name_changed,zen:event-type:user.notes_changed,zen:event-type:user.only_private_comments_changed,zen:event-type:user.organization_membership_created,zen:event-type:user.organization_membership_deleted,zen:event-type:user.password_changed,zen:event-type:user.photo_changed,zen:event-type:user.role_changed,zen:event-type:user.suspended_changed,zen:event-type:user.tags_changed,zen:event-type:user.time_zone_changed".split(","), Em = "/api/v2/webhooks", Dm = {
10036
10037
  initialState: {
10037
10038
  checkpoint: null,
10038
10039
  subscription: {}
@@ -10042,7 +10043,7 @@ var Tm = 3e5, Em = /* @__PURE__ */ "zen:event-type:ticket.agent_assignment_chang
10042
10043
  additionalProperties: !1,
10043
10044
  properties: { events: {
10044
10045
  items: {
10045
- enum: Em,
10046
+ enum: Tm,
10046
10047
  type: "string"
10047
10048
  },
10048
10049
  minItems: 1,
@@ -10091,8 +10092,8 @@ var Tm = 3e5, Em = /* @__PURE__ */ "zen:event-type:ticket.agent_assignment_chang
10091
10092
  type: "integration"
10092
10093
  },
10093
10094
  async receive(e) {
10094
- let t = Rm(e.state), n = e.header("x-zendesk-webhook-signature-timestamp"), r = n == null ? NaN : Date.parse(n);
10095
- if (t == null || n == null || !Number.isFinite(r) || Math.abs(e.now.getTime() - r) > Tm || !await De(t, [Te(n), e.rawBody], e.header("x-zendesk-webhook-signature"))) return {
10095
+ let t = Lm(e.state), n = e.header("x-zendesk-webhook-signature-timestamp"), r = n == null ? NaN : Date.parse(n);
10096
+ if (t == null || n == null || !Number.isFinite(r) || Math.abs(e.now.getTime() - r) > wm || !await De(t, [Te(n), e.rawBody], e.header("x-zendesk-webhook-signature"))) return {
10096
10097
  body: "",
10097
10098
  contentType: "text/plain",
10098
10099
  outcome: "respond",
@@ -10124,148 +10125,148 @@ var Tm = 3e5, Em = /* @__PURE__ */ "zen:event-type:ticket.agent_assignment_chang
10124
10125
  };
10125
10126
  },
10126
10127
  async reconcile(e) {
10127
- let t = Im(e.state), n = await Am(e), r = Lm(t);
10128
+ let t = Fm(e.state), n = await km(e), r = Im(t);
10128
10129
  if (!e.active) {
10129
- for (let t of r == null ? n : [.../* @__PURE__ */ new Set([r, ...n])]) await jm(e, t);
10130
- return await t.saveSubscription({}, Bm(e.now)), { outcome: "ready" };
10130
+ for (let t of r == null ? n : [.../* @__PURE__ */ new Set([r, ...n])]) await Am(e, t);
10131
+ return await t.saveSubscription({}, zm(e.now)), { outcome: "ready" };
10131
10132
  }
10132
10133
  let i = r ?? n[0];
10133
10134
  if (i == null) {
10134
- let t = await Mm(e, "webhook create", {
10135
- body: km(e),
10136
- endpoint: Dm,
10135
+ let t = await jm(e, "webhook create", {
10136
+ body: Om(e),
10137
+ endpoint: Em,
10137
10138
  method: "POST"
10138
10139
  });
10139
- Nm(t, "webhook create"), i = Fm(Vm(t.data)?.webhook);
10140
+ Mm(t, "webhook create"), i = Pm(Bm(t.data)?.webhook);
10140
10141
  } else {
10141
- let n = await Mm(e, "webhook update", {
10142
- body: km(e),
10143
- endpoint: `${Dm}/${i}`,
10142
+ let n = await jm(e, "webhook update", {
10143
+ body: Om(e),
10144
+ endpoint: `${Em}/${i}`,
10144
10145
  method: "PUT"
10145
10146
  });
10146
10147
  if (n.status == 404) return await t.saveSubscription({}, e.now), { outcome: "pending" };
10147
- Nm(n, "webhook update");
10148
+ Mm(n, "webhook update");
10148
10149
  }
10149
- for (let t of n.filter((e) => e != i)) await jm(e, t);
10150
+ for (let t of n.filter((e) => e != i)) await Am(e, t);
10150
10151
  return await t.saveSubscription({
10151
- signingSecret: await zm(e, i),
10152
+ signingSecret: await Rm(e, i),
10152
10153
  webhookId: i
10153
- }, Bm(e.now)), { outcome: "ready" };
10154
+ }, zm(e.now)), { outcome: "ready" };
10154
10155
  }
10155
10156
  };
10156
- function km(e) {
10157
+ function Om(e) {
10157
10158
  return { webhook: {
10158
10159
  description: "Managed by Open Flow. Do not edit.",
10159
10160
  endpoint: e.endpointUrl,
10160
10161
  http_method: "POST",
10161
- name: Pm(e.endpointUrl),
10162
+ name: Nm(e.endpointUrl),
10162
10163
  request_format: "json",
10163
10164
  status: "active",
10164
10165
  subscriptions: [...new Set(e.config.events)]
10165
10166
  } };
10166
10167
  }
10167
- async function Am(e) {
10168
+ async function km(e) {
10168
10169
  let t = [], n;
10169
10170
  for (let r = 0; r < 10; r += 1) {
10170
- let r = await Mm(e, "webhook list", {
10171
- endpoint: Dm,
10171
+ let r = await jm(e, "webhook list", {
10172
+ endpoint: Em,
10172
10173
  method: "GET",
10173
10174
  query: {
10174
- "filter[name_contains]": Pm(e.endpointUrl),
10175
+ "filter[name_contains]": Nm(e.endpointUrl),
10175
10176
  "page[size]": "100",
10176
10177
  ...n == null ? {} : { "page[after]": n }
10177
10178
  }
10178
10179
  });
10179
- Nm(r, "webhook list");
10180
- let i = Vm(r.data), a = Array.isArray(i?.webhooks) ? i.webhooks : [];
10180
+ Mm(r, "webhook list");
10181
+ let i = Bm(r.data), a = Array.isArray(i?.webhooks) ? i.webhooks : [];
10181
10182
  for (let n of a) {
10182
- let r = Vm(n);
10183
+ let r = Bm(n);
10183
10184
  r?.endpoint === e.endpointUrl && typeof r.id == "string" && t.push(r.id);
10184
10185
  }
10185
- let o = Vm(i?.meta);
10186
+ let o = Bm(i?.meta);
10186
10187
  if (o?.has_more !== !0 || typeof o.after_cursor != "string") return t;
10187
10188
  n = o.after_cursor;
10188
10189
  }
10189
10190
  return t;
10190
10191
  }
10191
- async function jm(e, t) {
10192
- let n = await Mm(e, "webhook delete", {
10193
- endpoint: `${Dm}/${t}`,
10192
+ async function Am(e, t) {
10193
+ let n = await jm(e, "webhook delete", {
10194
+ endpoint: `${Em}/${t}`,
10194
10195
  method: "DELETE"
10195
10196
  });
10196
- n.status != 404 && Nm(n, "webhook delete");
10197
+ n.status != 404 && Mm(n, "webhook delete");
10197
10198
  }
10198
- async function Mm(t, r, i) {
10199
+ async function jm(t, r, i) {
10199
10200
  try {
10200
10201
  return await t.connector.execute(i, t.signal);
10201
10202
  } catch (t) {
10202
10203
  throw t instanceof e ? t : new n(`Zendesk ${r} request failed.`, { cause: t });
10203
10204
  }
10204
10205
  }
10205
- function Nm(r, i) {
10206
+ function Mm(r, i) {
10206
10207
  if (!(r.status >= 200 && r.status < 300)) throw r.status == 401 || r.status == 403 ? new e(`Zendesk ${i} rejected the Connection.`) : [
10207
10208
  400,
10208
10209
  404,
10209
10210
  422
10210
10211
  ].includes(r.status) ? new t(`Zendesk ${i} rejected the subscription.`) : new n(`Zendesk ${i} failed with status ${r.status}.`);
10211
10212
  }
10212
- function Pm(e) {
10213
+ function Nm(e) {
10213
10214
  return `open-flow-${e.slice(e.lastIndexOf("/") + 1)}`;
10214
10215
  }
10215
- function Fm(e) {
10216
- let t = Vm(e)?.id;
10216
+ function Pm(e) {
10217
+ let t = Bm(e)?.id;
10217
10218
  if (typeof t != "string") throw new n("Zendesk webhook response is missing its ID.");
10218
10219
  return t;
10219
10220
  }
10220
- function Im(e) {
10221
+ function Fm(e) {
10221
10222
  if (e == null) throw new t("Zendesk Integration state is missing.");
10222
10223
  return e;
10223
10224
  }
10224
- function Lm(e) {
10225
+ function Im(e) {
10225
10226
  let t = e.subscription.webhookId;
10226
10227
  return typeof t == "string" && t.length > 0 ? t : null;
10227
10228
  }
10228
- function Rm(e) {
10229
+ function Lm(e) {
10229
10230
  let t = e?.subscription.signingSecret;
10230
10231
  return typeof t == "string" && t.length > 0 ? t : null;
10231
10232
  }
10232
- async function zm(e, t) {
10233
- let r = await Mm(e, "webhook signing secret", {
10234
- endpoint: `${Dm}/${t}/signing_secret`,
10233
+ async function Rm(e, t) {
10234
+ let r = await jm(e, "webhook signing secret", {
10235
+ endpoint: `${Em}/${t}/signing_secret`,
10235
10236
  method: "GET"
10236
10237
  });
10237
- Nm(r, "webhook signing secret");
10238
- let i = Vm(Vm(r.data)?.signing_secret)?.secret;
10238
+ Mm(r, "webhook signing secret");
10239
+ let i = Bm(Bm(r.data)?.signing_secret)?.secret;
10239
10240
  if (typeof i != "string" || i.length == 0) throw new n("Zendesk webhook signing secret response is invalid.");
10240
10241
  return i;
10241
10242
  }
10242
- function Bm(e) {
10243
+ function zm(e) {
10243
10244
  return new Date(e.getTime() + 2592e6);
10244
10245
  }
10245
- function Vm(e) {
10246
+ function Bm(e) {
10246
10247
  return typeof e == "object" && e && !Array.isArray(e) ? e : void 0;
10247
10248
  }
10248
10249
  //#endregion
10249
10250
  //#region src/trigger/providers/localization.ts
10250
- var Hm = {
10251
+ var Vm = {
10251
10252
  "zh-CN": () => import("./zh-CN-ByQ6nYam.js"),
10252
10253
  "zh-TW": () => import("./zh-TW-QjIarvX9.js"),
10253
10254
  ja: () => import("./ja-Bq-ZDOD4.js"),
10254
10255
  ko: () => import("./ko-Z-k9R2c6.js"),
10255
10256
  ru: () => import("./ru-B4gFecYZ.js"),
10256
10257
  fr: () => import("./fr-iv1541dF.js")
10257
- }, Um = /* @__PURE__ */ new Map(), Wm = Promise.resolve({});
10258
- function Gm(e) {
10259
- if (e == "en") return Wm;
10260
- let t = Um.get(e);
10258
+ }, Hm = /* @__PURE__ */ new Map(), Um = Promise.resolve({});
10259
+ function Wm(e) {
10260
+ if (e == "en") return Um;
10261
+ let t = Hm.get(e);
10261
10262
  if (t != null) return t;
10262
- let n = Hm[e]().then((e) => e.default);
10263
- return Um.set(e, n), n.catch(() => {
10264
- Um.get(e) == n && Um.delete(e);
10263
+ let n = Vm[e]().then((e) => e.default);
10264
+ return Hm.set(e, n), n.catch(() => {
10265
+ Hm.get(e) == n && Hm.delete(e);
10265
10266
  }), n;
10266
10267
  }
10267
- async function Km(e, t) {
10268
- let n = (await Gm(t))[e.key];
10268
+ async function Gm(e, t) {
10269
+ let n = (await Wm(t))[e.key];
10269
10270
  return {
10270
10271
  displayName: n?.displayName ?? e.displayName,
10271
10272
  description: n?.description ?? e.description
@@ -10273,7 +10274,7 @@ async function Km(e, t) {
10273
10274
  }
10274
10275
  //#endregion
10275
10276
  //#region src/trigger/providers/definitions.ts
10276
- var qm = [
10277
+ var Km = [
10277
10278
  ...f,
10278
10279
  h,
10279
10280
  Vl,
@@ -10282,19 +10283,19 @@ var qm = [
10282
10283
  El,
10283
10284
  au,
10284
10285
  ku,
10285
- Zu,
10286
- nd,
10287
- Cd,
10288
- Wd,
10289
- Xd,
10290
- bf,
10291
- Hf,
10292
- rp,
10293
- bp,
10294
- Fp,
10295
- Qp,
10296
- um,
10297
- Om
10298
- ], Jm = qm.filter((e) => e.snapshot.type == "poll"), Ym = qm.filter((e) => e.snapshot.type == "integration");
10286
+ Xu,
10287
+ td,
10288
+ Sd,
10289
+ Ud,
10290
+ Yd,
10291
+ yf,
10292
+ Vf,
10293
+ np,
10294
+ yp,
10295
+ Pp,
10296
+ Zp,
10297
+ lm,
10298
+ Dm
10299
+ ], qm = Km.filter((e) => e.snapshot.type == "poll"), Jm = Km.filter((e) => e.snapshot.type == "integration");
10299
10300
  //#endregion
10300
- export { d as feishuResponse, u as feishuSubscriptions, Ym as integrationDefinitions, Km as localizeTrigger, ne as matchesFeishuEvent, Jm as pollDefinitions, ee as receiveFeishuEvent, qm as triggerDefinitions };
10301
+ export { d as feishuResponse, u as feishuSubscriptions, Jm as integrationDefinitions, Gm as localizeTrigger, ne as matchesFeishuEvent, qm as pollDefinitions, ee as receiveFeishuEvent, Km as triggerDefinitions };