react-semaphor 0.1.319 → 0.1.320

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/briefings/index.cjs +1 -1
  2. package/dist/briefings/index.js +567 -207
  3. package/dist/chunks/{calendar-preferences-dialog-DPaVsZlk.js → calendar-preferences-dialog-B7Z8OnuZ.js} +1 -1
  4. package/dist/chunks/{calendar-preferences-dialog-DLKB05SY.js → calendar-preferences-dialog-CFXQBJ4A.js} +1 -1
  5. package/dist/chunks/{dashboard-briefing-launcher-DR_i0anv.js → dashboard-briefing-launcher-DB16djcj.js} +2142 -2065
  6. package/dist/chunks/dashboard-briefing-launcher-DjDpGyD7.js +106 -0
  7. package/dist/chunks/{dashboard-controls-BNAIucBl.js → dashboard-controls-BisfskDD.js} +1 -1
  8. package/dist/chunks/{dashboard-controls-8J06Ot-K.js → dashboard-controls-DPStW1kd.js} +3 -3
  9. package/dist/chunks/{dashboard-json-B_Li7wO5.js → dashboard-json-2nyFJ_-w.js} +1 -1
  10. package/dist/chunks/{dashboard-json-DIsACFCO.js → dashboard-json-C8-kkiyT.js} +1 -1
  11. package/dist/chunks/{edit-dashboard-visual-2CBS2I52.js → edit-dashboard-visual-BP77bJFI.js} +1 -1
  12. package/dist/chunks/{edit-dashboard-visual-BGnC2DH7.js → edit-dashboard-visual-D6oiTlXr.js} +3 -3
  13. package/dist/chunks/{index-DYycYzpZ.js → index-Clw0hJzi.js} +4 -4
  14. package/dist/chunks/{index-cxoegFH9.js → index-D8eouWYC.js} +1 -1
  15. package/dist/chunks/{resource-management-panel-BwNGxqrB.js → resource-management-panel-DTvY5OIq.js} +1 -1
  16. package/dist/chunks/{resource-management-panel-YtbKp2kW.js → resource-management-panel-HcRJRZHO.js} +2 -2
  17. package/dist/chunks/{use-create-flow-overlay-state-Qnd7FF6L.js → use-create-flow-overlay-state-75l5mrVp.js} +2 -2
  18. package/dist/chunks/{use-create-flow-overlay-state-DQZneUXL.js → use-create-flow-overlay-state-CdCldE6J.js} +1 -1
  19. package/dist/chunks/{use-visual-utils-t73RlvjS.js → use-visual-utils-Bd4Cf9_B.js} +1 -1
  20. package/dist/chunks/{use-visual-utils-BdMhr0YR.js → use-visual-utils-CMdEUnM5.js} +1 -1
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +5 -5
  25. package/dist/style.css +1 -1
  26. package/dist/surfboard/index.cjs +1 -1
  27. package/dist/surfboard/index.js +2 -2
  28. package/dist/types/briefings.d.ts +96 -0
  29. package/package.json +1 -1
  30. package/dist/chunks/dashboard-briefing-launcher-F3qKyuGr.js +0 -106
@@ -1,43 +1,72 @@
1
- var K = Object.defineProperty;
2
- var G = (n, t, e) => t in n ? K(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var D = (n, t, e) => G(n, typeof t != "symbol" ? t + "" : t, e);
4
- const A = "BRIEFING", q = ["markdown", "html"], S = ["markdown"], Ie = 20, l = {
1
+ var G = Object.defineProperty;
2
+ var U = (n, t, e) => t in n ? G(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var z = (n, t, e) => U(n, typeof t != "symbol" ? t + "" : t, e);
4
+ const S = "BRIEFING", H = ["markdown", "html"], k = ["markdown"], Le = 20, l = {
5
5
  name: 500,
6
6
  description: 2e3,
7
7
  instruction: 5e4,
8
8
  customMessage: 5e4,
9
+ contentTitle: 500,
10
+ contentSummary: 2e4,
11
+ contentText: 5e3,
12
+ contentItem: 2e3,
13
+ contentCell: 500,
9
14
  attachmentTitle: 500,
10
15
  presentationAudience: 1e3,
11
16
  presentationTone: 500,
12
17
  presentationFormat: 2e3,
13
18
  id: 500
14
- }, z = new Set(q), H = /* @__PURE__ */ new Set([
19
+ }, g = {
20
+ maxBlocks: 50,
21
+ maxTableRows: 100,
22
+ maxTableColumns: 20,
23
+ maxTableCellCharacters: l.contentCell,
24
+ maxParagraphCharacters: l.contentText,
25
+ maxFindingCharacters: l.contentText,
26
+ maxListItems: 100
27
+ }, D = new Set(H), X = /* @__PURE__ */ new Set([
15
28
  "EMAIL",
16
29
  "WEBHOOK",
17
30
  "SLACK",
18
31
  "IN_APP",
19
32
  "TELEGRAM"
20
- ]), C = {
33
+ ]), T = {
21
34
  maxToolCalls: { min: 1, max: 100 },
22
35
  maxRows: { min: 1, max: 1e5 },
23
36
  timeoutMs: { min: 1e3, max: 30 * 6e4 }
24
- }, U = /* @__PURE__ */ new Set([
37
+ }, J = /* @__PURE__ */ new Set([
25
38
  "letter",
26
39
  "legal",
27
40
  "a4",
28
41
  "a3",
29
42
  "tabloid"
30
- ]), X = /* @__PURE__ */ new Set([
43
+ ]), W = /* @__PURE__ */ new Set([
31
44
  "portrait",
32
45
  "landscape"
33
- ]), J = /* @__PURE__ */ new Set([",", ";", " "]), W = /* @__PURE__ */ new Set([
46
+ ]), Y = /* @__PURE__ */ new Set([",", ";", " "]), Z = /* @__PURE__ */ new Set([
34
47
  "current",
35
48
  "all"
36
- ]), Y = /* @__PURE__ */ new Set([
49
+ ]), Q = /* @__PURE__ */ new Set([
37
50
  "concise",
38
51
  "balanced",
39
52
  "detailed"
40
- ]), Z = [
53
+ ]), ee = /* @__PURE__ */ new Set([
54
+ "info",
55
+ "positive",
56
+ "warning",
57
+ "critical"
58
+ ]), te = /* @__PURE__ */ new Set([
59
+ "text",
60
+ "number",
61
+ "currency",
62
+ "percent",
63
+ "date",
64
+ "boolean"
65
+ ]), ne = /* @__PURE__ */ new Set([
66
+ "left",
67
+ "center",
68
+ "right"
69
+ ]), re = [
41
70
  "pageSize",
42
71
  "orientation",
43
72
  "includeFilters",
@@ -62,23 +91,23 @@ const A = "BRIEFING", q = ["markdown", "html"], S = ["markdown"], Ie = 20, l = {
62
91
  "cardType",
63
92
  "theme"
64
93
  ];
65
- class T extends Error {
94
+ class A extends Error {
66
95
  constructor(e) {
67
96
  super(e.map((r) => `${r.field}: ${r.message}`).join("; "));
68
- D(this, "issues");
97
+ z(this, "issues");
69
98
  this.name = "BriefingContractError", this.issues = e;
70
99
  }
71
100
  }
72
- function x(n) {
101
+ function N(n) {
73
102
  return typeof n == "object" && n !== null && !Array.isArray(n);
74
103
  }
75
104
  function c(n, t, e) {
76
105
  n.push({ field: t, message: e });
77
106
  }
78
107
  function h(n, t, e) {
79
- return x(n) ? n : (c(e, t, "Expected an object."), {});
108
+ return N(n) ? n : (c(e, t, "Expected an object."), {});
80
109
  }
81
- function s(n, t, e, r) {
110
+ function f(n, t, e, r) {
82
111
  const o = new Set(e);
83
112
  Object.keys(n).forEach((i) => {
84
113
  o.has(i) || c(
@@ -94,7 +123,7 @@ function u(n, t, e, r) {
94
123
  const o = n.trim();
95
124
  return o ? (o.length > e && c(r, t, `Must be ${e} characters or fewer.`), o) : (c(r, t, "Required value cannot be empty."), "");
96
125
  }
97
- function p(n, t, e, r) {
126
+ function y(n, t, e, r) {
98
127
  if (n == null)
99
128
  return;
100
129
  if (typeof n != "string") {
@@ -105,20 +134,45 @@ function p(n, t, e, r) {
105
134
  if (o)
106
135
  return o.length > e && c(r, t, `Must be ${e} characters or fewer.`), o;
107
136
  }
108
- function g(n, t, e, r) {
137
+ function oe(n, t, e) {
138
+ if (n != null) {
139
+ if (!Number.isInteger(n) || Number(n) < 0) {
140
+ c(e, t, "Expected a non-negative integer.");
141
+ return;
142
+ }
143
+ return Number(n);
144
+ }
145
+ }
146
+ function b(n, t, e, r = {}) {
147
+ if (n == null)
148
+ return r.required ? (c(e, t, "Expected at least one evidence id."), []) : void 0;
149
+ if (!Array.isArray(n))
150
+ return c(e, t, "Expected an array."), r.required ? [] : void 0;
151
+ const o = [];
152
+ return n.forEach((i, a) => {
153
+ const d = u(
154
+ i,
155
+ `${t}.${a}`,
156
+ l.id,
157
+ e
158
+ );
159
+ d && !o.includes(d) && o.push(d);
160
+ }), r.required && o.length === 0 && c(e, t, "Expected at least one evidence id."), o.length > 0 || r.required ? o : void 0;
161
+ }
162
+ function $(n, t, e, r) {
109
163
  return n == null ? t : typeof n != "boolean" ? (c(r, e, "Expected a boolean."), t) : n;
110
164
  }
111
- function Q(n, t) {
165
+ function ie(n, t) {
112
166
  return n == null ? "ACTIVE" : n === "ACTIVE" || n === "PAUSED" || n === "DISABLED" ? n : (c(t, "status", "Expected ACTIVE, PAUSED, or DISABLED."), "ACTIVE");
113
167
  }
114
- function ee(n) {
168
+ function ae(n) {
115
169
  return n.includes("@") && n.includes(".") && !n.includes(" ");
116
170
  }
117
- function B(n, t) {
171
+ function O(n, t) {
118
172
  if (n == null)
119
173
  return { type: "project" };
120
174
  const e = h(n, "source", t), r = e.type;
121
- return r === "project" ? (s(e, "source", ["type"], t), { type: "project" }) : r === "dashboard" ? (s(e, "source", ["type", "dashboardId"], t), {
175
+ return r === "project" ? (f(e, "source", ["type"], t), { type: "project" }) : r === "dashboard" ? (f(e, "source", ["type", "dashboardId"], t), {
122
176
  type: "dashboard",
123
177
  dashboardId: u(
124
178
  e.dashboardId,
@@ -128,9 +182,9 @@ function B(n, t) {
128
182
  )
129
183
  }) : (c(t, "source.type", "Expected project or dashboard."), { type: "project" });
130
184
  }
131
- function F(n, t) {
185
+ function R(n, t) {
132
186
  const e = h(n, "body", t), r = e.type;
133
- return r === "generated_analysis" ? (s(e, "body", ["type", "instruction"], t), {
187
+ return r === "generated_analysis" ? (f(e, "body", ["type", "instruction"], t), {
134
188
  type: "generated_analysis",
135
189
  instruction: u(
136
190
  e.instruction,
@@ -138,7 +192,7 @@ function F(n, t) {
138
192
  l.instruction,
139
193
  t
140
194
  )
141
- }) : r === "custom_message" ? (s(e, "body", ["type", "message"], t), {
195
+ }) : r === "custom_message" ? (f(e, "body", ["type", "message"], t), {
142
196
  type: "custom_message",
143
197
  message: u(
144
198
  e.message,
@@ -146,17 +200,17 @@ function F(n, t) {
146
200
  l.customMessage,
147
201
  t
148
202
  )
149
- }) : r === "none" ? (s(e, "body", ["type"], t), { type: "none" }) : (c(
203
+ }) : r === "none" ? (f(e, "body", ["type"], t), { type: "none" }) : (c(
150
204
  t,
151
205
  "body.type",
152
206
  "Expected generated_analysis, custom_message, or none."
153
207
  ), { type: "none" });
154
208
  }
155
- function te(n, t) {
209
+ function ce(n, t) {
156
210
  if (n == null)
157
- return [...S];
211
+ return [...k];
158
212
  if (!Array.isArray(n))
159
- return c(t, "presentation.artifactFormats", "Expected an array."), [...S];
213
+ return c(t, "presentation.artifactFormats", "Expected an array."), [...k];
160
214
  if (n.length === 0)
161
215
  return c(
162
216
  t,
@@ -165,7 +219,7 @@ function te(n, t) {
165
219
  ), [];
166
220
  const e = [];
167
221
  return n.forEach((r, o) => {
168
- if (typeof r != "string" || !z.has(r)) {
222
+ if (typeof r != "string" || !D.has(r)) {
169
223
  c(
170
224
  t,
171
225
  `presentation.artifactFormats.${o}`,
@@ -176,45 +230,45 @@ function te(n, t) {
176
230
  e.includes(r) || e.push(r);
177
231
  }), e;
178
232
  }
179
- function O(n, t) {
233
+ function F(n, t) {
180
234
  if (n == null)
181
235
  return {
182
- artifactFormats: [...S],
236
+ artifactFormats: [...k],
183
237
  includeEvidence: !0,
184
238
  includeSql: !0
185
239
  };
186
240
  const e = h(n, "presentation", t);
187
- s(
241
+ f(
188
242
  e,
189
243
  "presentation",
190
244
  ["artifactFormats", "includeEvidence", "includeSql", "audience", "tone", "format"],
191
245
  t
192
246
  );
193
247
  const r = {
194
- artifactFormats: te(e.artifactFormats, t),
195
- includeEvidence: g(
248
+ artifactFormats: ce(e.artifactFormats, t),
249
+ includeEvidence: $(
196
250
  e.includeEvidence,
197
251
  !0,
198
252
  "presentation.includeEvidence",
199
253
  t
200
254
  ),
201
- includeSql: g(
255
+ includeSql: $(
202
256
  e.includeSql,
203
257
  !0,
204
258
  "presentation.includeSql",
205
259
  t
206
260
  )
207
- }, o = p(
261
+ }, o = y(
208
262
  e.audience,
209
263
  "presentation.audience",
210
264
  l.presentationAudience,
211
265
  t
212
- ), i = p(
266
+ ), i = y(
213
267
  e.tone,
214
268
  "presentation.tone",
215
269
  l.presentationTone,
216
270
  t
217
- ), a = p(
271
+ ), a = y(
218
272
  e.format,
219
273
  "presentation.format",
220
274
  l.presentationFormat,
@@ -222,17 +276,320 @@ function O(n, t) {
222
276
  );
223
277
  return o && (r.audience = o), i && (r.tone = i), a && (r.format = a), r;
224
278
  }
225
- function I(n, t, e, r) {
279
+ function de(n, t, e) {
280
+ return Array.isArray(n) ? (n.length === 0 && c(e, t, "Expected at least one item."), n.length > g.maxListItems && c(
281
+ e,
282
+ t,
283
+ `Must have ${g.maxListItems} items or fewer.`
284
+ ), n.slice(0, g.maxListItems).map(
285
+ (r, o) => u(
286
+ r,
287
+ `${t}.${o}`,
288
+ l.contentItem,
289
+ e
290
+ )
291
+ ).filter(Boolean)) : (c(e, t, "Expected an array."), []);
292
+ }
293
+ function le(n, t, e) {
294
+ return n === null || typeof n == "string" || typeof n == "number" || typeof n == "boolean" ? typeof n == "string" && n.length > l.contentCell ? (c(
295
+ e,
296
+ t,
297
+ `Must be ${l.contentCell} characters or fewer.`
298
+ ), n.slice(0, l.contentCell)) : typeof n == "number" && !Number.isFinite(n) ? (c(e, t, "Expected a finite number."), null) : n : (c(e, t, "Expected a string, number, boolean, or null."), null);
299
+ }
300
+ function se(n, t, e) {
301
+ if (!Array.isArray(n))
302
+ return c(e, t, "Expected an array."), [];
303
+ n.length === 0 && c(e, t, "Expected at least one column."), n.length > g.maxTableColumns && c(
304
+ e,
305
+ t,
306
+ `Must have ${g.maxTableColumns} columns or fewer.`
307
+ );
308
+ const r = /* @__PURE__ */ new Set();
309
+ return n.slice(0, g.maxTableColumns).map((o, i) => {
310
+ const a = `${t}.${i}`, d = h(o, a, e);
311
+ f(d, a, ["key", "label", "kind", "align"], e);
312
+ const m = u(
313
+ d.key,
314
+ `${a}.key`,
315
+ l.id,
316
+ e
317
+ );
318
+ m && (r.has(m) && c(e, `${a}.key`, "Column key must be unique."), r.add(m));
319
+ const s = u(
320
+ d.label,
321
+ `${a}.label`,
322
+ l.contentTitle,
323
+ e
324
+ ), p = I(
325
+ d.kind,
326
+ `${a}.kind`,
327
+ te,
328
+ "text, number, currency, percent, date, or boolean",
329
+ e
330
+ ), v = I(
331
+ d.align,
332
+ `${a}.align`,
333
+ ne,
334
+ "left, center, or right",
335
+ e
336
+ );
337
+ return {
338
+ key: m,
339
+ label: s,
340
+ ...p ? { kind: p } : {},
341
+ ...v ? { align: v } : {}
342
+ };
343
+ });
344
+ }
345
+ function fe(n, t, e, r) {
346
+ if (!Array.isArray(n))
347
+ return c(r, t, "Expected an array."), [];
348
+ n.length > g.maxTableRows && c(
349
+ r,
350
+ t,
351
+ `Must have ${g.maxTableRows} rows or fewer.`
352
+ );
353
+ const o = new Set(e.map((i) => i.key).filter(Boolean));
354
+ return n.slice(0, g.maxTableRows).map((i, a) => {
355
+ const d = `${t}.${a}`, m = h(i, d, r);
356
+ return Object.keys(m).forEach((s) => {
357
+ o.has(s) || c(r, `${d}.${s}`, `Unexpected table cell "${s}".`);
358
+ }), Object.fromEntries(
359
+ e.map((s) => [
360
+ s.key,
361
+ le(m[s.key] ?? null, `${d}.${s.key}`, r)
362
+ ])
363
+ );
364
+ });
365
+ }
366
+ function me(n, t, e) {
367
+ const r = `content.blocks.${t}`, o = h(n, r, e), i = o.type;
368
+ if (i === "heading") {
369
+ f(o, r, ["type", "text", "level", "evidenceIds"], e);
370
+ const a = o.level === void 0 || o.level === null ? void 0 : o.level === 2 || o.level === 3 ? o.level : void 0;
371
+ o.level !== void 0 && o.level !== null && a === void 0 && c(e, `${r}.level`, "Expected 2 or 3.");
372
+ const d = b(o.evidenceIds, `${r}.evidenceIds`, e);
373
+ return {
374
+ type: "heading",
375
+ text: u(
376
+ o.text,
377
+ `${r}.text`,
378
+ l.contentTitle,
379
+ e
380
+ ),
381
+ ...a ? { level: a } : {},
382
+ ...d ? { evidenceIds: d } : {}
383
+ };
384
+ }
385
+ if (i === "paragraph") {
386
+ f(o, r, ["type", "text", "evidenceIds"], e);
387
+ const a = b(o.evidenceIds, `${r}.evidenceIds`, e);
388
+ return {
389
+ type: "paragraph",
390
+ text: u(
391
+ o.text,
392
+ `${r}.text`,
393
+ l.contentText,
394
+ e
395
+ ),
396
+ ...a ? { evidenceIds: a } : {}
397
+ };
398
+ }
399
+ if (i === "finding") {
400
+ f(o, r, ["type", "title", "text", "severity", "evidenceIds"], e);
401
+ const a = y(
402
+ o.title,
403
+ `${r}.title`,
404
+ l.contentTitle,
405
+ e
406
+ ), d = I(
407
+ o.severity,
408
+ `${r}.severity`,
409
+ ee,
410
+ "info, positive, warning, or critical",
411
+ e
412
+ );
413
+ return {
414
+ type: "finding",
415
+ ...a ? { title: a } : {},
416
+ text: u(
417
+ o.text,
418
+ `${r}.text`,
419
+ l.contentText,
420
+ e
421
+ ),
422
+ ...d ? { severity: d } : {},
423
+ evidenceIds: b(o.evidenceIds, `${r}.evidenceIds`, e, {
424
+ required: !0
425
+ }) ?? []
426
+ };
427
+ }
428
+ if (i === "bullets" || i === "actions" || i === "limitations") {
429
+ f(o, r, ["type", "title", "items", "evidenceIds"], e);
430
+ const a = y(
431
+ o.title,
432
+ `${r}.title`,
433
+ l.contentTitle,
434
+ e
435
+ ), d = b(o.evidenceIds, `${r}.evidenceIds`, e);
436
+ return {
437
+ type: i,
438
+ ...a ? { title: a } : {},
439
+ items: de(o.items, `${r}.items`, e),
440
+ ...d ? { evidenceIds: d } : {}
441
+ };
442
+ }
443
+ if (i === "metric") {
444
+ f(
445
+ o,
446
+ r,
447
+ ["type", "label", "value", "previousValue", "delta", "unit", "evidenceIds"],
448
+ e
449
+ );
450
+ const a = typeof o.value == "string" || typeof o.value == "number" ? o.value : "";
451
+ a === "" && c(e, `${r}.value`, "Expected a string or number.");
452
+ const d = o.previousValue === void 0 || o.previousValue === null || typeof o.previousValue == "string" || typeof o.previousValue == "number" ? o.previousValue : void 0;
453
+ o.previousValue !== void 0 && o.previousValue !== null && d === void 0 && c(e, `${r}.previousValue`, "Expected a string, number, or null.");
454
+ const m = o.delta === void 0 || o.delta === null || typeof o.delta == "string" || typeof o.delta == "number" ? o.delta : void 0;
455
+ o.delta !== void 0 && o.delta !== null && m === void 0 && c(e, `${r}.delta`, "Expected a string, number, or null.");
456
+ const s = y(
457
+ o.unit,
458
+ `${r}.unit`,
459
+ l.contentTitle,
460
+ e
461
+ ), p = b(o.evidenceIds, `${r}.evidenceIds`, e);
462
+ return {
463
+ type: "metric",
464
+ label: u(
465
+ o.label,
466
+ `${r}.label`,
467
+ l.contentTitle,
468
+ e
469
+ ),
470
+ value: a,
471
+ ...d !== void 0 ? { previousValue: d } : {},
472
+ ...m !== void 0 ? { delta: m } : {},
473
+ ...s ? { unit: s } : {},
474
+ ...p ? { evidenceIds: p } : {}
475
+ };
476
+ }
477
+ if (i === "table") {
478
+ f(
479
+ o,
480
+ r,
481
+ ["type", "id", "title", "columns", "rows", "caption", "totalRows", "evidenceIds"],
482
+ e
483
+ );
484
+ const a = se(o.columns, `${r}.columns`, e), d = y(
485
+ o.title,
486
+ `${r}.title`,
487
+ l.contentTitle,
488
+ e
489
+ ), m = y(
490
+ o.id,
491
+ `${r}.id`,
492
+ l.id,
493
+ e
494
+ ), s = y(
495
+ o.caption,
496
+ `${r}.caption`,
497
+ l.contentItem,
498
+ e
499
+ ), p = oe(
500
+ o.totalRows,
501
+ `${r}.totalRows`,
502
+ e
503
+ ), v = b(o.evidenceIds, `${r}.evidenceIds`, e);
504
+ return {
505
+ type: "table",
506
+ ...m ? { id: m } : {},
507
+ ...d ? { title: d } : {},
508
+ columns: a,
509
+ rows: fe(o.rows, `${r}.rows`, a, e),
510
+ ...s ? { caption: s } : {},
511
+ ...p !== void 0 ? { totalRows: p } : {},
512
+ ...v ? { evidenceIds: v } : {}
513
+ };
514
+ }
515
+ if (i === "evidence_appendix") {
516
+ f(o, r, ["type", "title", "evidenceIds"], e);
517
+ const a = y(
518
+ o.title,
519
+ `${r}.title`,
520
+ l.contentTitle,
521
+ e
522
+ );
523
+ return {
524
+ type: "evidence_appendix",
525
+ ...a ? { title: a } : {},
526
+ evidenceIds: b(o.evidenceIds, `${r}.evidenceIds`, e, {
527
+ required: !0
528
+ }) ?? []
529
+ };
530
+ }
531
+ return c(
532
+ e,
533
+ `${r}.type`,
534
+ "Expected heading, paragraph, finding, bullets, metric, table, actions, limitations, or evidence_appendix."
535
+ ), {
536
+ type: "paragraph",
537
+ text: ""
538
+ };
539
+ }
540
+ function pe(n) {
541
+ const t = [], e = h(n, "content", t);
542
+ f(e, "content", ["version", "title", "summary", "blocks"], t), e.version !== 1 && c(t, "content.version", "Expected version 1.");
543
+ const r = y(
544
+ e.title,
545
+ "content.title",
546
+ l.contentTitle,
547
+ t
548
+ ), o = y(
549
+ e.summary,
550
+ "content.summary",
551
+ l.contentSummary,
552
+ t
553
+ );
554
+ Array.isArray(e.blocks) || c(t, "content.blocks", "Expected an array.");
555
+ const i = Array.isArray(e.blocks) ? e.blocks : [];
556
+ i.length === 0 && c(t, "content.blocks", "Expected at least one block."), i.length > g.maxBlocks && c(
557
+ t,
558
+ "content.blocks",
559
+ `Must have ${g.maxBlocks} blocks or fewer.`
560
+ );
561
+ const a = i.slice(0, g.maxBlocks).map((d, m) => me(d, m, t));
562
+ return _(t), {
563
+ version: 1,
564
+ ...r ? { title: r } : {},
565
+ ...o ? { summary: o } : {},
566
+ blocks: a
567
+ };
568
+ }
569
+ function we(n) {
570
+ try {
571
+ return {
572
+ valid: !0,
573
+ value: pe(n),
574
+ issues: []
575
+ };
576
+ } catch (t) {
577
+ if (t instanceof A)
578
+ return { valid: !1, issues: t.issues };
579
+ throw t;
580
+ }
581
+ }
582
+ function E(n, t, e, r) {
226
583
  return typeof n == "string" && e.includes(n) ? n : (c(r, t, `Expected ${e.join(" or ")}.`), e[0]);
227
584
  }
228
- function b(n, t, e, r, o) {
585
+ function I(n, t, e, r, o) {
229
586
  if (n != null) {
230
587
  if (typeof n == "string" && e.has(n))
231
588
  return n;
232
589
  c(o, t, `Expected ${r}.`);
233
590
  }
234
591
  }
235
- function ne(n, t, e) {
592
+ function ue(n, t, e) {
236
593
  if (n != null) {
237
594
  if (!Array.isArray(n)) {
238
595
  c(e, t, "Expected an array.");
@@ -241,60 +598,60 @@ function ne(n, t, e) {
241
598
  return n;
242
599
  }
243
600
  }
244
- function re(n, t, e) {
601
+ function ye(n, t, e) {
245
602
  if (n != null) {
246
- if (!x(n)) {
603
+ if (!N(n)) {
247
604
  c(e, t, "Expected an object.");
248
605
  return;
249
606
  }
250
607
  return n;
251
608
  }
252
609
  }
253
- function oe(n, t, e) {
610
+ function he(n, t, e) {
254
611
  if (n == null)
255
612
  return;
256
613
  const r = h(n, t, e);
257
- s(r, t, Z, e);
258
- const o = {}, i = b(
614
+ f(r, t, re, e);
615
+ const o = {}, i = I(
259
616
  r.pageSize,
260
617
  `${t}.pageSize`,
261
- U,
618
+ J,
262
619
  "letter, legal, a4, a3, or tabloid",
263
620
  e
264
- ), a = b(
621
+ ), a = I(
265
622
  r.orientation,
266
623
  `${t}.orientation`,
267
- X,
624
+ W,
268
625
  "portrait or landscape",
269
626
  e
270
- ), f = b(
627
+ ), d = I(
271
628
  r.delimiter,
272
629
  `${t}.delimiter`,
273
- J,
630
+ Y,
274
631
  "comma, semicolon, or tab",
275
632
  e
276
- ), y = b(
633
+ ), m = I(
277
634
  r.sheetSelection,
278
635
  `${t}.sheetSelection`,
279
- W,
636
+ Z,
280
637
  "current or all",
281
638
  e
282
639
  );
283
- i && (o.pageSize = i), a && (o.orientation = a), f && (o.delimiter = f), y && (o.sheetSelection = y);
284
- for (const d of [
640
+ i && (o.pageSize = i), a && (o.orientation = a), d && (o.delimiter = d), m && (o.sheetSelection = m);
641
+ for (const s of [
285
642
  "includeFilters",
286
643
  "includeTimestamp",
287
644
  "includeHeaders",
288
645
  "useFormattedValues"
289
646
  ])
290
- if (!(r[d] === void 0 || r[d] === null)) {
291
- if (typeof r[d] != "boolean") {
292
- c(e, `${t}.${d}`, "Expected a boolean.");
647
+ if (!(r[s] === void 0 || r[s] === null)) {
648
+ if (typeof r[s] != "boolean") {
649
+ c(e, `${t}.${s}`, "Expected a boolean.");
293
650
  continue;
294
651
  }
295
- o[d] = r[d];
652
+ o[s] = r[s];
296
653
  }
297
- for (const d of [
654
+ for (const s of [
298
655
  "currentSheetId",
299
656
  "currentSheetName",
300
657
  "filterLine",
@@ -302,15 +659,15 @@ function oe(n, t, e) {
302
659
  "cardType",
303
660
  "theme"
304
661
  ]) {
305
- const m = p(
306
- r[d],
307
- `${t}.${d}`,
662
+ const p = y(
663
+ r[s],
664
+ `${t}.${s}`,
308
665
  l.id,
309
666
  e
310
667
  );
311
- m && (o[d] = m);
668
+ p && (o[s] = p);
312
669
  }
313
- for (const d of [
670
+ for (const s of [
314
671
  "filterValues",
315
672
  "inlineFilterValues",
316
673
  "sheetFilterValues",
@@ -318,21 +675,21 @@ function oe(n, t, e) {
318
675
  "cardControlDefinitions",
319
676
  "controlBindings"
320
677
  ]) {
321
- const m = ne(r[d], `${t}.${d}`, e);
322
- m && (o[d] = m);
678
+ const p = ue(r[s], `${t}.${s}`, e);
679
+ p && (o[s] = p);
323
680
  }
324
- for (const d of [
681
+ for (const s of [
325
682
  "controlValues",
326
683
  "tablePreferences",
327
684
  "dashboardInputExecutionSnapshot"
328
685
  ]) {
329
- const m = re(r[d], `${t}.${d}`, e);
330
- m && (o[d] = m);
686
+ const p = ye(r[s], `${t}.${s}`, e);
687
+ p && (o[s] = p);
331
688
  }
332
689
  return Object.keys(o).length > 0 ? o : void 0;
333
690
  }
334
- function E(n, t, e, r) {
335
- const o = p(
691
+ function C(n, t, e, r) {
692
+ const o = y(
336
693
  t,
337
694
  e,
338
695
  l.attachmentTitle,
@@ -340,20 +697,20 @@ function E(n, t, e, r) {
340
697
  );
341
698
  return o && (n.title = o), n;
342
699
  }
343
- function $(n, t, e, r) {
344
- const o = oe(t, e, r);
700
+ function x(n, t, e, r) {
701
+ const o = he(t, e, r);
345
702
  return o && (n.settings = o), n;
346
703
  }
347
- function ie(n, t, e) {
704
+ function ge(n, t, e) {
348
705
  const r = `attachments.${t}`, o = h(n, r, e), i = o.type;
349
706
  if (i === "dashboard") {
350
- s(
707
+ f(
351
708
  o,
352
709
  r,
353
710
  ["type", "dashboardId", "format", "title", "settings"],
354
711
  e
355
712
  );
356
- const a = E(
713
+ const a = C(
357
714
  {
358
715
  type: "dashboard",
359
716
  dashboardId: u(
@@ -362,22 +719,22 @@ function ie(n, t, e) {
362
719
  l.id,
363
720
  e
364
721
  ),
365
- format: I(o.format, `${r}.format`, ["pdf"], e)
722
+ format: E(o.format, `${r}.format`, ["pdf"], e)
366
723
  },
367
724
  o.title,
368
725
  `${r}.title`,
369
726
  e
370
727
  );
371
- return $(a, o.settings, `${r}.settings`, e);
728
+ return x(a, o.settings, `${r}.settings`, e);
372
729
  }
373
730
  if (i === "dashboard_sheet" || i === "document_sheet") {
374
- s(
731
+ f(
375
732
  o,
376
733
  r,
377
734
  ["type", "dashboardId", "sheetId", "format", "title", "settings"],
378
735
  e
379
736
  );
380
- const a = E(
737
+ const a = C(
381
738
  {
382
739
  type: i,
383
740
  dashboardId: u(
@@ -392,22 +749,22 @@ function ie(n, t, e) {
392
749
  l.id,
393
750
  e
394
751
  ),
395
- format: I(o.format, `${r}.format`, ["pdf"], e)
752
+ format: E(o.format, `${r}.format`, ["pdf"], e)
396
753
  },
397
754
  o.title,
398
755
  `${r}.title`,
399
756
  e
400
757
  );
401
- return $(a, o.settings, `${r}.settings`, e);
758
+ return x(a, o.settings, `${r}.settings`, e);
402
759
  }
403
760
  if (i === "visual") {
404
- s(
761
+ f(
405
762
  o,
406
763
  r,
407
764
  ["type", "dashboardId", "visualId", "format", "title", "settings"],
408
765
  e
409
766
  );
410
- const a = E(
767
+ const a = C(
411
768
  {
412
769
  type: "visual",
413
770
  dashboardId: u(
@@ -422,7 +779,7 @@ function ie(n, t, e) {
422
779
  l.id,
423
780
  e
424
781
  ),
425
- format: I(
782
+ format: E(
426
783
  o.format,
427
784
  `${r}.format`,
428
785
  ["pdf", "png"],
@@ -433,16 +790,16 @@ function ie(n, t, e) {
433
790
  `${r}.title`,
434
791
  e
435
792
  );
436
- return $(a, o.settings, `${r}.settings`, e);
793
+ return x(a, o.settings, `${r}.settings`, e);
437
794
  }
438
795
  if (i === "card") {
439
- s(
796
+ f(
440
797
  o,
441
798
  r,
442
799
  ["type", "dashboardId", "cardId", "format", "title", "settings"],
443
800
  e
444
801
  );
445
- const a = E(
802
+ const a = C(
446
803
  {
447
804
  type: "card",
448
805
  dashboardId: u(
@@ -457,7 +814,7 @@ function ie(n, t, e) {
457
814
  l.id,
458
815
  e
459
816
  ),
460
- format: I(
817
+ format: E(
461
818
  o.format,
462
819
  `${r}.format`,
463
820
  ["csv", "pdf", "png"],
@@ -468,7 +825,7 @@ function ie(n, t, e) {
468
825
  `${r}.title`,
469
826
  e
470
827
  );
471
- return $(a, o.settings, `${r}.settings`, e);
828
+ return x(a, o.settings, `${r}.settings`, e);
472
829
  }
473
830
  return c(
474
831
  e,
@@ -476,7 +833,7 @@ function ie(n, t, e) {
476
833
  "Expected dashboard, dashboard_sheet, document_sheet, visual, or card."
477
834
  ), { type: "dashboard", dashboardId: "", format: "pdf" };
478
835
  }
479
- function ae(n) {
836
+ function ve(n) {
480
837
  switch (n.type) {
481
838
  case "dashboard":
482
839
  return `${n.type}:${n.dashboardId}:${n.format}`;
@@ -489,7 +846,7 @@ function ae(n) {
489
846
  return `${n.type}:${n.dashboardId}:${n.cardId}:${n.format}`;
490
847
  }
491
848
  }
492
- function R(n, t) {
849
+ function V(n, t) {
493
850
  if (n == null)
494
851
  return [];
495
852
  if (!Array.isArray(n))
@@ -499,9 +856,9 @@ function R(n, t) {
499
856
  "attachments",
500
857
  "Choose 20 attachments or fewer."
501
858
  );
502
- const e = n.slice(0, 20).map((o, i) => ie(o, i, t)), r = /* @__PURE__ */ new Set();
859
+ const e = n.slice(0, 20).map((o, i) => ge(o, i, t)), r = /* @__PURE__ */ new Set();
503
860
  return e.forEach((o, i) => {
504
- const a = ae(o);
861
+ const a = ve(o);
505
862
  r.has(a) && c(t, `attachments.${i}`, "Duplicate attachment."), r.add(a);
506
863
  }), e;
507
864
  }
@@ -509,13 +866,13 @@ function M(n, t) {
509
866
  if (n == null)
510
867
  return;
511
868
  const e = h(n, "limits", t);
512
- s(e, "limits", Object.keys(C), t);
869
+ f(e, "limits", Object.keys(T), t);
513
870
  const r = {};
514
- return Object.keys(C).forEach((o) => {
871
+ return Object.keys(T).forEach((o) => {
515
872
  const i = e[o];
516
873
  if (i == null)
517
874
  return;
518
- const a = C[o];
875
+ const a = T[o];
519
876
  if (typeof i != "number" || !Number.isInteger(i) || i < a.min || i > a.max) {
520
877
  c(
521
878
  t,
@@ -527,63 +884,63 @@ function M(n, t) {
527
884
  r[o] = i;
528
885
  }), Object.keys(r).length > 0 ? r : void 0;
529
886
  }
530
- function N(n) {
887
+ function _(n) {
531
888
  if (n.length > 0)
532
- throw new T(n);
889
+ throw new A(n);
533
890
  }
534
- function V(n, t, e) {
891
+ function P(n, t, e) {
535
892
  n.type === "none" && t.length === 0 && c(
536
893
  e,
537
894
  "body",
538
895
  "Add briefing instructions, a custom message, or at least one attachment."
539
896
  );
540
897
  }
541
- function P(n) {
898
+ function j(n) {
542
899
  const t = [], e = h(n, "jobConfig", t);
543
- s(
900
+ f(
544
901
  e,
545
902
  "jobConfig",
546
903
  ["kind", "source", "body", "attachments", "presentation", "limits"],
547
904
  t
548
- ), e.kind !== A && c(t, "kind", "Expected BRIEFING.");
549
- const r = B(e.source, t), o = F(e.body, t), i = R(e.attachments, t), a = O(e.presentation, t), f = M(e.limits, t);
550
- return V(o, i, t), N(t), {
551
- kind: A,
905
+ ), e.kind !== S && c(t, "kind", "Expected BRIEFING.");
906
+ const r = O(e.source, t), o = R(e.body, t), i = V(e.attachments, t), a = F(e.presentation, t), d = M(e.limits, t);
907
+ return P(o, i, t), _(t), {
908
+ kind: S,
552
909
  source: r,
553
910
  body: o,
554
911
  attachments: i,
555
912
  presentation: a,
556
- ...f ? { limits: f } : {}
913
+ ...d ? { limits: d } : {}
557
914
  };
558
915
  }
559
- function be(n) {
560
- return P({
916
+ function Be(n) {
917
+ return j({
561
918
  ...n,
562
- kind: A
919
+ kind: S
563
920
  });
564
921
  }
565
- function _(n, t, e, r = "deliveryConfig.recipients") {
922
+ function L(n, t, e, r = "deliveryConfig.recipients") {
566
923
  const o = `${r}.${t}`, i = h(n, o, e), a = i.type;
567
924
  if (a === "email") {
568
- s(i, o, ["type", "address", "name"], e);
569
- const f = u(
925
+ f(i, o, ["type", "address", "name"], e);
926
+ const d = u(
570
927
  i.address,
571
928
  `${o}.address`,
572
929
  l.id,
573
930
  e
574
- ), y = p(
931
+ ), m = y(
575
932
  i.name,
576
933
  `${o}.name`,
577
934
  l.attachmentTitle,
578
935
  e
579
936
  );
580
- return f && !ee(f) && c(e, `${o}.address`, "Email address is invalid."), {
937
+ return d && !ae(d) && c(e, `${o}.address`, "Email address is invalid."), {
581
938
  type: "email",
582
- address: f,
583
- ...y ? { name: y } : {}
939
+ address: d,
940
+ ...m ? { name: m } : {}
584
941
  };
585
942
  }
586
- return a === "user" ? (s(i, o, ["type", "userId"], e), {
943
+ return a === "user" ? (f(i, o, ["type", "userId"], e), {
587
944
  type: "user",
588
945
  userId: u(
589
946
  i.userId,
@@ -591,7 +948,7 @@ function _(n, t, e, r = "deliveryConfig.recipients") {
591
948
  l.id,
592
949
  e
593
950
  )
594
- }) : a === "tenant_user" ? (s(i, o, ["type", "tenantUserId"], e), {
951
+ }) : a === "tenant_user" ? (f(i, o, ["type", "tenantUserId"], e), {
595
952
  type: "tenant_user",
596
953
  tenantUserId: u(
597
954
  i.tenantUserId,
@@ -599,7 +956,7 @@ function _(n, t, e, r = "deliveryConfig.recipients") {
599
956
  l.id,
600
957
  e
601
958
  )
602
- }) : a === "group" ? (s(i, o, ["type", "groupId"], e), {
959
+ }) : a === "group" ? (f(i, o, ["type", "groupId"], e), {
603
960
  type: "group",
604
961
  groupId: u(
605
962
  i.groupId,
@@ -613,17 +970,17 @@ function _(n, t, e, r = "deliveryConfig.recipients") {
613
970
  "Expected email, user, tenant_user, or group."
614
971
  ), { type: "email", address: "" });
615
972
  }
616
- function ce(n, t) {
973
+ function Ie(n, t) {
617
974
  return n == null ? [] : Array.isArray(n) ? n.map(
618
- (e, r) => _(e, r, t)
975
+ (e, r) => L(e, r, t)
619
976
  ) : (c(t, "deliveryConfig.recipients", "Expected an array."), []);
620
977
  }
621
- function de(n, t) {
978
+ function be(n, t) {
622
979
  if (!Array.isArray(n))
623
980
  return c(t, "deliveryConfig.channels", "Expected an array."), [];
624
981
  const e = [];
625
982
  return n.forEach((r, o) => {
626
- if (!w(r)) {
983
+ if (!q(r)) {
627
984
  c(
628
985
  t,
629
986
  `deliveryConfig.channels.${o}`,
@@ -634,7 +991,7 @@ function de(n, t) {
634
991
  e.includes(r) || e.push(r);
635
992
  }), e;
636
993
  }
637
- function le(n, t, e) {
994
+ function $e(n, t, e) {
638
995
  if (n == null)
639
996
  return;
640
997
  const r = h(n, t, e), o = {};
@@ -646,17 +1003,17 @@ function le(n, t, e) {
646
1003
  o[i] = a.trim();
647
1004
  }), Object.keys(o).length > 0 ? o : void 0;
648
1005
  }
649
- function se(n, t, e) {
1006
+ function Ee(n, t, e) {
650
1007
  if (n == null)
651
1008
  return;
652
1009
  const r = h(n, t, e);
653
- s(
1010
+ f(
654
1011
  r,
655
1012
  t,
656
1013
  ["url", "method", "headers", "secretEncrypted"],
657
1014
  e
658
1015
  );
659
- const o = r.method === void 0 || r.method === null ? void 0 : I(r.method, `${t}.method`, ["POST", "PUT"], e), i = le(r.headers, `${t}.headers`, e), a = p(
1016
+ const o = r.method === void 0 || r.method === null ? void 0 : E(r.method, `${t}.method`, ["POST", "PUT"], e), i = $e(r.headers, `${t}.headers`, e), a = y(
660
1017
  r.secretEncrypted,
661
1018
  `${t}.secretEncrypted`,
662
1019
  2e3,
@@ -669,21 +1026,21 @@ function se(n, t, e) {
669
1026
  ...a ? { secretEncrypted: a } : {}
670
1027
  };
671
1028
  }
672
- function fe(n, t, e) {
1029
+ function Ce(n, t, e) {
673
1030
  const r = h(n, t, e), o = r.type;
674
1031
  if (o === "channel") {
675
- s(
1032
+ f(
676
1033
  r,
677
1034
  t,
678
1035
  ["type", "channelId", "channelName", "isPrivate"],
679
1036
  e
680
1037
  );
681
- const i = p(
1038
+ const i = y(
682
1039
  r.channelName,
683
1040
  `${t}.channelName`,
684
1041
  l.attachmentTitle,
685
1042
  e
686
- ), a = r.isPrivate === void 0 || r.isPrivate === null ? void 0 : g(
1043
+ ), a = r.isPrivate === void 0 || r.isPrivate === null ? void 0 : $(
687
1044
  r.isPrivate,
688
1045
  !1,
689
1046
  `${t}.isPrivate`,
@@ -701,16 +1058,16 @@ function fe(n, t, e) {
701
1058
  ...a !== void 0 ? { isPrivate: a } : {}
702
1059
  };
703
1060
  }
704
- return o === "dm" ? (s(r, t, ["type", "recipient"], e), c(
1061
+ return o === "dm" ? (f(r, t, ["type", "recipient"], e), c(
705
1062
  e,
706
1063
  `${t}.type`,
707
1064
  "Slack DM delivery is not supported in V1."
708
1065
  ), {
709
1066
  type: "dm",
710
- recipient: _(r.recipient, 0, e, `${t}.recipient`)
1067
+ recipient: L(r.recipient, 0, e, `${t}.recipient`)
711
1068
  }) : (c(e, `${t}.type`, "Expected channel."), { type: "channel", channelId: "" });
712
1069
  }
713
- function me(n, t, e) {
1070
+ function xe(n, t, e) {
714
1071
  if (n == null)
715
1072
  return;
716
1073
  if (!Array.isArray(n)) {
@@ -718,15 +1075,15 @@ function me(n, t, e) {
718
1075
  return;
719
1076
  }
720
1077
  const r = n.map(
721
- (o, i) => _(o, i, e, t)
1078
+ (o, i) => L(o, i, e, t)
722
1079
  );
723
1080
  return r.length > 0 ? r : void 0;
724
1081
  }
725
- function ue(n, t, e) {
1082
+ function Ae(n, t, e) {
726
1083
  if (n == null)
727
1084
  return;
728
1085
  const r = h(n, t, e);
729
- s(
1086
+ f(
730
1087
  r,
731
1088
  t,
732
1089
  [
@@ -738,28 +1095,28 @@ function ue(n, t, e) {
738
1095
  ],
739
1096
  e
740
1097
  );
741
- const o = me(
1098
+ const o = xe(
742
1099
  r.threadMentions,
743
1100
  `${t}.threadMentions`,
744
1101
  e
745
- ), i = g(
1102
+ ), i = $(
746
1103
  r.postThreadDetail,
747
1104
  !0,
748
1105
  `${t}.postThreadDetail`,
749
1106
  e
750
- ), a = g(
1107
+ ), a = $(
751
1108
  r.includeDashboardLink,
752
1109
  !0,
753
1110
  `${t}.includeDashboardLink`,
754
1111
  e
755
- ), f = g(
1112
+ ), d = $(
756
1113
  r.includeBriefingLink,
757
1114
  !0,
758
1115
  `${t}.includeBriefingLink`,
759
1116
  e
760
1117
  );
761
1118
  return {
762
- destination: fe(
1119
+ destination: Ce(
763
1120
  r.destination,
764
1121
  `${t}.destination`,
765
1122
  e
@@ -767,12 +1124,12 @@ function ue(n, t, e) {
767
1124
  ...o ? { threadMentions: o } : {},
768
1125
  ...r.postThreadDetail !== void 0 ? { postThreadDetail: i } : {},
769
1126
  ...r.includeDashboardLink !== void 0 ? { includeDashboardLink: a } : {},
770
- ...r.includeBriefingLink !== void 0 ? { includeBriefingLink: f } : {}
1127
+ ...r.includeBriefingLink !== void 0 ? { includeBriefingLink: d } : {}
771
1128
  };
772
1129
  }
773
- function he(n, t, e) {
1130
+ function Te(n, t, e) {
774
1131
  const r = h(n, t, e);
775
- s(
1132
+ f(
776
1133
  r,
777
1134
  t,
778
1135
  [
@@ -786,37 +1143,37 @@ function he(n, t, e) {
786
1143
  ],
787
1144
  e
788
1145
  );
789
- const o = b(
1146
+ const o = I(
790
1147
  r.formatProfile,
791
1148
  `${t}.formatProfile`,
792
- Y,
1149
+ Q,
793
1150
  "concise, balanced, or detailed",
794
1151
  e
795
- ), i = p(
1152
+ ), i = y(
796
1153
  r.subjectOverride,
797
1154
  `${t}.subjectOverride`,
798
1155
  500,
799
1156
  e
800
- ), a = p(
1157
+ ), a = y(
801
1158
  r.titleOverride,
802
1159
  `${t}.titleOverride`,
803
1160
  500,
804
1161
  e
805
- ), f = p(
1162
+ ), d = y(
806
1163
  r.summaryOverride,
807
1164
  `${t}.summaryOverride`,
808
1165
  2e3,
809
1166
  e
810
- ), y = g(
1167
+ ), m = $(
811
1168
  r.actionBlockVisible,
812
1169
  !0,
813
1170
  `${t}.actionBlockVisible`,
814
1171
  e
815
- ), d = se(
1172
+ ), s = Ee(
816
1173
  r.webhookConfig,
817
1174
  `${t}.webhookConfig`,
818
1175
  e
819
- ), m = ue(
1176
+ ), p = Ae(
820
1177
  r.slackConfig,
821
1178
  `${t}.slackConfig`,
822
1179
  e
@@ -825,18 +1182,18 @@ function he(n, t, e) {
825
1182
  ...o ? { formatProfile: o } : {},
826
1183
  ...i ? { subjectOverride: i } : {},
827
1184
  ...a ? { titleOverride: a } : {},
828
- ...f ? { summaryOverride: f } : {},
829
- ...r.actionBlockVisible !== void 0 ? { actionBlockVisible: y } : {},
830
- ...m ? { slackConfig: m } : {},
831
- ...d ? { webhookConfig: d } : {}
1185
+ ...d ? { summaryOverride: d } : {},
1186
+ ...r.actionBlockVisible !== void 0 ? { actionBlockVisible: m } : {},
1187
+ ...p ? { slackConfig: p } : {},
1188
+ ...s ? { webhookConfig: s } : {}
832
1189
  };
833
1190
  }
834
- function pe(n, t) {
1191
+ function Se(n, t) {
835
1192
  if (n == null)
836
1193
  return;
837
1194
  const e = h(n, "deliveryConfig.channelConfigs", t), r = {};
838
1195
  return Object.entries(e).forEach(([o, i]) => {
839
- if (!w(o)) {
1196
+ if (!q(o)) {
840
1197
  c(
841
1198
  t,
842
1199
  `deliveryConfig.channelConfigs.${o}`,
@@ -844,25 +1201,25 @@ function pe(n, t) {
844
1201
  );
845
1202
  return;
846
1203
  }
847
- r[o] = he(
1204
+ r[o] = Te(
848
1205
  i,
849
1206
  `deliveryConfig.channelConfigs.${o}`,
850
1207
  t
851
1208
  );
852
1209
  }), Object.keys(r).length > 0 ? r : void 0;
853
1210
  }
854
- function ye(n, t) {
855
- var y, d, m;
1211
+ function ke(n, t) {
1212
+ var m, s, p;
856
1213
  if (n == null)
857
1214
  return null;
858
1215
  const e = h(n, "deliveryConfig", t);
859
- s(
1216
+ f(
860
1217
  e,
861
1218
  "deliveryConfig",
862
1219
  ["recipients", "channels", "channelConfigs"],
863
1220
  t
864
1221
  );
865
- const r = pe(e.channelConfigs, t), o = ce(e.recipients, t), i = de(e.channels, t), a = ((d = (y = r == null ? void 0 : r.SLACK) == null ? void 0 : y.slackConfig) == null ? void 0 : d.destination.type) === "channel" && !!r.SLACK.slackConfig.destination.channelId.trim();
1222
+ const r = Se(e.channelConfigs, t), o = Ie(e.recipients, t), i = be(e.channels, t), a = ((s = (m = r == null ? void 0 : r.SLACK) == null ? void 0 : m.slackConfig) == null ? void 0 : s.destination.type) === "channel" && !!r.SLACK.slackConfig.destination.channelId.trim();
866
1223
  return i.some(
867
1224
  (v) => v !== "SLACK"
868
1225
  ) && o.length === 0 && c(
@@ -877,7 +1234,7 @@ function ye(n, t) {
877
1234
  t,
878
1235
  "deliveryConfig.channelConfigs.SLACK.slackConfig.destination.channelId",
879
1236
  "Choose a Slack channel destination."
880
- ), !i.includes("SLACK") && ((m = r == null ? void 0 : r.SLACK) != null && m.slackConfig) && c(
1237
+ ), !i.includes("SLACK") && ((p = r == null ? void 0 : r.SLACK) != null && p.slackConfig) && c(
881
1238
  t,
882
1239
  "deliveryConfig.channelConfigs.SLACK",
883
1240
  "Slack config requires SLACK in deliveryConfig.channels."
@@ -887,9 +1244,9 @@ function ye(n, t) {
887
1244
  ...r ? { channelConfigs: r } : {}
888
1245
  };
889
1246
  }
890
- function k(n) {
1247
+ function w(n) {
891
1248
  const t = [], e = h(n, "draft", t);
892
- s(
1249
+ f(
893
1250
  e,
894
1251
  "draft",
895
1252
  [
@@ -912,70 +1269,73 @@ function k(n) {
912
1269
  "name",
913
1270
  l.name,
914
1271
  t
915
- ), o = p(
1272
+ ), o = y(
916
1273
  e.description,
917
1274
  "description",
918
1275
  l.description,
919
1276
  t
920
- ) ?? null, i = p(e.scheduleExpr, "scheduleExpr", 500, t) ?? null, a = p(e.timezone, "timezone", 200, t) ?? "UTC", f = Q(e.status, t), y = B(e.source, t), d = F(e.body, t), m = R(e.attachments, t), v = O(e.presentation, t), L = M(e.limits, t), j = ye(e.deliveryConfig, t);
921
- return V(d, m, t), N(t), {
1277
+ ) ?? null, i = y(e.scheduleExpr, "scheduleExpr", 500, t) ?? null, a = y(e.timezone, "timezone", 200, t) ?? "UTC", d = ie(e.status, t), m = O(e.source, t), s = R(e.body, t), p = V(e.attachments, t), v = F(e.presentation, t), B = M(e.limits, t), K = ke(e.deliveryConfig, t);
1278
+ return P(s, p, t), _(t), {
922
1279
  name: r,
923
1280
  description: o,
924
- status: f,
1281
+ status: d,
925
1282
  scheduleExpr: i,
926
1283
  timezone: a,
927
- source: y,
928
- body: d,
929
- attachments: m,
1284
+ source: m,
1285
+ body: s,
1286
+ attachments: p,
930
1287
  presentation: v,
931
- ...L ? { limits: L } : {},
932
- deliveryConfig: j
1288
+ ...B ? { limits: B } : {},
1289
+ deliveryConfig: K
933
1290
  };
934
1291
  }
935
- function Ee(n) {
936
- return k(n);
1292
+ function ze(n) {
1293
+ return w(n);
937
1294
  }
938
- function $e(n) {
939
- return k(n);
1295
+ function De(n) {
1296
+ return w(n);
940
1297
  }
941
- function ve(n) {
1298
+ function Ne(n) {
942
1299
  try {
943
- return { valid: !0, value: k(n), issues: [] };
1300
+ return { valid: !0, value: w(n), issues: [] };
944
1301
  } catch (t) {
945
- if (t instanceof T)
1302
+ if (t instanceof A)
946
1303
  return { valid: !1, issues: t.issues };
947
1304
  throw t;
948
1305
  }
949
1306
  }
950
- function Ce(n) {
1307
+ function Oe(n) {
951
1308
  try {
952
- return { valid: !0, value: P(n), issues: [] };
1309
+ return { valid: !0, value: j(n), issues: [] };
953
1310
  } catch (t) {
954
- if (t instanceof T)
1311
+ if (t instanceof A)
955
1312
  return { valid: !1, issues: t.issues };
956
1313
  throw t;
957
1314
  }
958
1315
  }
959
- function Ae(n) {
960
- return typeof n == "string" && z.has(n);
1316
+ function Re(n) {
1317
+ return typeof n == "string" && D.has(n);
961
1318
  }
962
- function w(n) {
963
- return typeof n == "string" && H.has(n);
1319
+ function q(n) {
1320
+ return typeof n == "string" && X.has(n);
964
1321
  }
965
1322
  export {
966
- q as BRIEFING_ARTIFACT_FORMATS,
967
- A as BRIEFING_KIND,
1323
+ H as BRIEFING_ARTIFACT_FORMATS,
1324
+ g as BRIEFING_CONTENT_LIMITS,
1325
+ S as BRIEFING_KIND,
968
1326
  l as BRIEFING_TEXT_LIMITS,
969
- T as BriefingContractError,
970
- S as DEFAULT_BRIEFING_ARTIFACT_FORMATS,
971
- Ie as MAX_BRIEFING_ATTACHMENTS,
972
- be as buildBriefingJobConfig,
973
- Ee as buildCreateBriefingRequest,
974
- $e as buildUpdateBriefingRequest,
975
- Ae as isBriefingArtifactFormat,
976
- w as isBriefingDeliveryChannel,
977
- k as normalizeBriefingDraft,
978
- P as normalizeBriefingJobConfig,
979
- ve as validateBriefingDraft,
980
- Ce as validateBriefingJobConfig
1327
+ A as BriefingContractError,
1328
+ k as DEFAULT_BRIEFING_ARTIFACT_FORMATS,
1329
+ Le as MAX_BRIEFING_ATTACHMENTS,
1330
+ Be as buildBriefingJobConfig,
1331
+ ze as buildCreateBriefingRequest,
1332
+ De as buildUpdateBriefingRequest,
1333
+ Re as isBriefingArtifactFormat,
1334
+ q as isBriefingDeliveryChannel,
1335
+ pe as normalizeBriefingContentDocument,
1336
+ w as normalizeBriefingDraft,
1337
+ j as normalizeBriefingJobConfig,
1338
+ we as validateBriefingContentDocument,
1339
+ Ne as validateBriefingDraft,
1340
+ Oe as validateBriefingJobConfig
981
1341
  };