@relyio/sdk 0.17.0 → 0.18.0

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 (74) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/automations/index.cjs +70 -0
  3. package/dist/automations/index.d.cts +1309 -0
  4. package/dist/automations/index.d.ts +1309 -0
  5. package/dist/automations/index.js +5 -0
  6. package/dist/{chunk-RSHMA4KT.cjs → chunk-2SPPU2WG.cjs} +68 -68
  7. package/dist/chunk-7I3SC7SV.cjs +40 -0
  8. package/dist/chunk-DI6KFDBO.js +43 -0
  9. package/dist/chunk-EDE2H37D.js +686 -0
  10. package/dist/chunk-HDHBYYEY.js +36 -0
  11. package/dist/{chunk-6E22GYPB.cjs → chunk-IFKF72VJ.cjs} +705 -320
  12. package/dist/chunk-L6DXCKVQ.cjs +50 -0
  13. package/dist/chunk-LSI26ZN2.cjs +535 -0
  14. package/dist/{chunk-TZL374LS.cjs → chunk-M7MWNV3Q.cjs} +21 -21
  15. package/dist/{chunk-H6IBQSMM.js → chunk-NJQK5STK.js} +3 -3
  16. package/dist/chunk-R6E4HE7R.js +520 -0
  17. package/dist/chunk-SHSK7UUY.cjs +706 -0
  18. package/dist/{chunk-BBUB7C2Z.js → chunk-W2A4OTCI.js} +3 -3
  19. package/dist/chunk-W7JFHSFM.js +18718 -0
  20. package/dist/{chunk-5UMY6CS4.js → chunk-ZAKEY6DY.js} +3 -3
  21. package/dist/chunk-ZAMAR3X2.cjs +18759 -0
  22. package/dist/{chunk-VS2DEUTN.js → chunk-ZHTJ7GXH.js} +387 -8
  23. package/dist/{chunk-LSRPMNPT.cjs → chunk-ZO6QDYJG.cjs} +7 -7
  24. package/dist/client/index.cjs +8 -7
  25. package/dist/client/index.d.cts +4 -3
  26. package/dist/client/index.d.ts +4 -3
  27. package/dist/client/index.js +6 -5
  28. package/dist/{define-content-type-AuL9-oz6.d.cts → define-content-type-NEQDrvdq.d.cts} +3342 -805
  29. package/dist/{define-content-type-BGoQxqLf.d.ts → define-content-type-fb-WCD5e.d.ts} +3342 -805
  30. package/dist/{define-schema-DgCX9YB7.d.ts → define-schema-DZhtvLiK.d.cts} +157 -10
  31. package/dist/{define-schema-DkXwpp0I.d.cts → define-schema-Dlwh6l_J.d.ts} +157 -10
  32. package/dist/dev-handshake/index.cjs +9 -9
  33. package/dist/dev-handshake/index.js +2 -2
  34. package/dist/extensions/index.cjs +80 -0
  35. package/dist/extensions/index.d.cts +792 -0
  36. package/dist/extensions/index.d.ts +792 -0
  37. package/dist/extensions/index.js +76 -0
  38. package/dist/functions/index.cjs +68 -0
  39. package/dist/functions/index.d.cts +6 -0
  40. package/dist/functions/index.d.ts +6 -0
  41. package/dist/functions/index.js +59 -0
  42. package/dist/{index-DaMZ4FQ_.d.ts → index-C4LqrNd1.d.ts} +1 -1
  43. package/dist/{index-Bp4AiNT3.d.cts → index-Dnmt_UOo.d.cts} +1 -1
  44. package/dist/{index-DxRmKPrR.d.cts → index-DwHcL6x5.d.cts} +83 -428
  45. package/dist/{index-BBp8_tn9.d.ts → index-M3luH06A.d.ts} +83 -428
  46. package/dist/index.cjs +204 -185
  47. package/dist/index.d.cts +93 -13
  48. package/dist/index.d.ts +93 -13
  49. package/dist/index.js +11 -16
  50. package/dist/markdown/index.cjs +382 -382
  51. package/dist/markdown/index.js +1 -1
  52. package/dist/preview/index.cjs +11 -10
  53. package/dist/preview/index.js +3 -2
  54. package/dist/register-B53i97A9.d.ts +677 -0
  55. package/dist/register-BYCs0FpF.d.cts +677 -0
  56. package/dist/rich-text/index.cjs +12 -12
  57. package/dist/rich-text/index.d.cts +2 -2
  58. package/dist/rich-text/index.d.ts +2 -2
  59. package/dist/rich-text/index.js +2 -2
  60. package/dist/schema/index.cjs +62 -34
  61. package/dist/schema/index.d.cts +127 -5
  62. package/dist/schema/index.d.ts +127 -5
  63. package/dist/schema/index.js +2 -2
  64. package/dist/types/index.d.cts +1 -1
  65. package/dist/types/index.d.ts +1 -1
  66. package/dist/utils/index.cjs +20 -20
  67. package/dist/utils/index.js +2 -2
  68. package/package.json +23 -5
  69. package/dist/chunk-6PTRZP5U.cjs +0 -433
  70. package/dist/chunk-DIZY6CKM.js +0 -950
  71. package/dist/chunk-GHYB6IZK.cjs +0 -983
  72. package/dist/chunk-MWMSFIWN.cjs +0 -17
  73. package/dist/chunk-OVMIHAYK.js +0 -411
  74. package/dist/chunk-XQ4QHWZE.js +0 -13
@@ -0,0 +1,5 @@
1
+ export { and, anyEntry, automations, defineAutomation, entries, extensionTrigger, isAutomationFile, not, on, or, records, resolveAutomation, schedule, tpl } from '../chunk-R6E4HE7R.js';
2
+ export { fields } from '../chunk-W7JFHSFM.js';
3
+ import '../chunk-DI6KFDBO.js';
4
+ //# sourceMappingURL=index.js.map
5
+ //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkMWMSFIWN_cjs = require('./chunk-MWMSFIWN.cjs');
3
+ var chunkL6DXCKVQ_cjs = require('./chunk-L6DXCKVQ.cjs');
4
4
 
5
5
  /* RelyIO SDK - Built with ❤️ by the RelyIO Team */
6
6
 
@@ -8,11 +8,11 @@ var chunkMWMSFIWN_cjs = require('./chunk-MWMSFIWN.cjs');
8
8
  function richTextHeadingSlug(text) {
9
9
  return text.trim().toLowerCase().replace(/[^\p{L}\p{M}\p{N}\s_-]/gu, "").replace(/\s/gu, "-");
10
10
  }
11
- chunkMWMSFIWN_cjs.__name(richTextHeadingSlug, "richTextHeadingSlug");
11
+ chunkL6DXCKVQ_cjs.__name(richTextHeadingSlug, "richTextHeadingSlug");
12
12
  function isRecord(value) {
13
13
  return typeof value === "object" && value !== null && !Array.isArray(value);
14
14
  }
15
- chunkMWMSFIWN_cjs.__name(isRecord, "isRecord");
15
+ chunkL6DXCKVQ_cjs.__name(isRecord, "isRecord");
16
16
  var BUILT_IN_CONTAINERS = /* @__PURE__ */ new Set([
17
17
  "paragraph",
18
18
  "heading",
@@ -34,19 +34,19 @@ function headingText(heading) {
34
34
  }
35
35
  return text;
36
36
  }
37
- chunkMWMSFIWN_cjs.__name(headingText, "headingText");
37
+ chunkL6DXCKVQ_cjs.__name(headingText, "headingText");
38
38
  function richTextHeadingAnchors(value) {
39
39
  return anchorsAcross([value]);
40
40
  }
41
- chunkMWMSFIWN_cjs.__name(richTextHeadingAnchors, "richTextHeadingAnchors");
41
+ chunkL6DXCKVQ_cjs.__name(richTextHeadingAnchors, "richTextHeadingAnchors");
42
42
  function entryHeadingAnchors(entry) {
43
43
  return anchorsAcross(isRecord(entry) ? Object.values(entry) : []);
44
44
  }
45
- chunkMWMSFIWN_cjs.__name(entryHeadingAnchors, "entryHeadingAnchors");
45
+ chunkL6DXCKVQ_cjs.__name(entryHeadingAnchors, "entryHeadingAnchors");
46
46
  function anchorsAcross(values) {
47
47
  const anchors = /* @__PURE__ */ new Map();
48
48
  const taken = /* @__PURE__ */ new Map();
49
- const unique = /* @__PURE__ */ chunkMWMSFIWN_cjs.__name((slug) => {
49
+ const unique = /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((slug) => {
50
50
  let anchor = slug;
51
51
  const seen = taken.get(slug);
52
52
  if (seen !== void 0) {
@@ -60,7 +60,7 @@ function anchorsAcross(values) {
60
60
  taken.set(anchor, 0);
61
61
  return anchor;
62
62
  }, "unique");
63
- const visit = /* @__PURE__ */ chunkMWMSFIWN_cjs.__name((nodes) => {
63
+ const visit = /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((nodes) => {
64
64
  for (const node of nodes) {
65
65
  if (!isRecord(node) || typeof node._type !== "string") continue;
66
66
  if (node._type === "heading") {
@@ -78,7 +78,7 @@ function anchorsAcross(values) {
78
78
  }
79
79
  return anchors;
80
80
  }
81
- chunkMWMSFIWN_cjs.__name(anchorsAcross, "anchorsAcross");
81
+ chunkL6DXCKVQ_cjs.__name(anchorsAcross, "anchorsAcross");
82
82
 
83
83
  // src/binding/key-path.ts
84
84
  var ITEM_SELECTOR = "[_key==";
@@ -86,7 +86,7 @@ function formatKeyPath(listPath, key, field) {
86
86
  const item = `${listPath}${ITEM_SELECTOR}${JSON.stringify(key)}]`;
87
87
  return field === void 0 ? item : `${item}.${field}`;
88
88
  }
89
- chunkMWMSFIWN_cjs.__name(formatKeyPath, "formatKeyPath");
89
+ chunkL6DXCKVQ_cjs.__name(formatKeyPath, "formatKeyPath");
90
90
  function parseKeyPath(path) {
91
91
  const segments = [];
92
92
  let at = 0;
@@ -123,7 +123,7 @@ function parseKeyPath(path) {
123
123
  }
124
124
  return segments.length === 0 || expectField ? null : segments;
125
125
  }
126
- chunkMWMSFIWN_cjs.__name(parseKeyPath, "parseKeyPath");
126
+ chunkL6DXCKVQ_cjs.__name(parseKeyPath, "parseKeyPath");
127
127
  function readQuoted(path, start) {
128
128
  if (path[start] !== '"') return null;
129
129
  for (let end = start + 1; end < path.length; end += 1) {
@@ -141,7 +141,7 @@ function readQuoted(path, start) {
141
141
  }
142
142
  return null;
143
143
  }
144
- chunkMWMSFIWN_cjs.__name(readQuoted, "readQuoted");
144
+ chunkL6DXCKVQ_cjs.__name(readQuoted, "readQuoted");
145
145
 
146
146
  // src/binding/relyio-field.ts
147
147
  var BINDING_VERSION = "1";
@@ -160,11 +160,11 @@ function relyioField(subject, path) {
160
160
  requireKeyPath("entry", field, field);
161
161
  return attributes;
162
162
  }
163
- chunkMWMSFIWN_cjs.__name(relyioField, "relyioField");
163
+ chunkL6DXCKVQ_cjs.__name(relyioField, "relyioField");
164
164
  function isBindingShaped(value) {
165
165
  return "data-relyio-field" in value;
166
166
  }
167
- chunkMWMSFIWN_cjs.__name(isBindingShaped, "isBindingShaped");
167
+ chunkL6DXCKVQ_cjs.__name(isBindingShaped, "isBindingShaped");
168
168
  function continued(binding, path) {
169
169
  const spelled = typeof path === "string" ? path : `{ _key: ${JSON.stringify(path._key)} }`;
170
170
  const complete = binding["data-relyio-v"] === BINDING_VERSION && [
@@ -188,14 +188,14 @@ function continued(binding, path) {
188
188
  "data-relyio-v": BINDING_VERSION
189
189
  };
190
190
  }
191
- chunkMWMSFIWN_cjs.__name(continued, "continued");
191
+ chunkL6DXCKVQ_cjs.__name(continued, "continued");
192
192
  function requireKeyPath(form, given, field) {
193
193
  if (parseKeyPath(field) !== null) return;
194
194
  throw new TypeError(
195
195
  `relyioField(${form}, '${given}'): '${field}' is not a field or a key path. Name a field (\`title\`), or a value inside one by its items\u2019 keys (\`sections[_key=="k1"].heading\`).`
196
196
  );
197
197
  }
198
- chunkMWMSFIWN_cjs.__name(requireKeyPath, "requireKeyPath");
198
+ chunkL6DXCKVQ_cjs.__name(requireKeyPath, "requireKeyPath");
199
199
  function requireMetadata(metadata, key, field) {
200
200
  const value = metadata?.[key];
201
201
  if (typeof value !== "string" || value.length === 0) {
@@ -205,7 +205,7 @@ function requireMetadata(metadata, key, field) {
205
205
  }
206
206
  return value;
207
207
  }
208
- chunkMWMSFIWN_cjs.__name(requireMetadata, "requireMetadata");
208
+ chunkL6DXCKVQ_cjs.__name(requireMetadata, "requireMetadata");
209
209
 
210
210
  // src/rich-text/render.ts
211
211
  var RICH_TEXT_VOID_TAGS = /* @__PURE__ */ new Set([
@@ -233,7 +233,7 @@ function isDeclaredRichTextNode(node) {
233
233
  const type = node._type;
234
234
  return typeof type === "string" && type !== "" && !Object.prototype.hasOwnProperty.call(BUILT_IN_NODES, type);
235
235
  }
236
- chunkMWMSFIWN_cjs.__name(isDeclaredRichTextNode, "isDeclaredRichTextNode");
236
+ chunkL6DXCKVQ_cjs.__name(isDeclaredRichTextNode, "isDeclaredRichTextNode");
237
237
  var PLAIN = Object.freeze({ header: false });
238
238
  var HEADER = Object.freeze({ header: true });
239
239
  var headingAnchors = /* @__PURE__ */ new Map();
@@ -251,7 +251,7 @@ function renderRichText(value, target, options = {}) {
251
251
  headingAnchors = outer;
252
252
  }
253
253
  }
254
- chunkMWMSFIWN_cjs.__name(renderRichText, "renderRichText");
254
+ chunkL6DXCKVQ_cjs.__name(renderRichText, "renderRichText");
255
255
  function blocks(nodes, target) {
256
256
  const out = [];
257
257
  for (const node of nodes) {
@@ -260,7 +260,7 @@ function blocks(nodes, target) {
260
260
  }
261
261
  return out;
262
262
  }
263
- chunkMWMSFIWN_cjs.__name(blocks, "blocks");
263
+ chunkL6DXCKVQ_cjs.__name(blocks, "blocks");
264
264
  var HEADING_TAGS = {
265
265
  1: "h1",
266
266
  2: "h2",
@@ -334,7 +334,7 @@ function block(node, target) {
334
334
  }
335
335
  }
336
336
  }
337
- chunkMWMSFIWN_cjs.__name(block, "block");
337
+ chunkL6DXCKVQ_cjs.__name(block, "block");
338
338
  function list(node, target) {
339
339
  let tag;
340
340
  switch (node.style) {
@@ -364,7 +364,7 @@ function list(node, target) {
364
364
  PLAIN
365
365
  );
366
366
  }
367
- chunkMWMSFIWN_cjs.__name(list, "list");
367
+ chunkL6DXCKVQ_cjs.__name(list, "list");
368
368
  function listItem(item, task, target) {
369
369
  return target.node(
370
370
  item,
@@ -382,7 +382,7 @@ function listItem(item, task, target) {
382
382
  PLAIN
383
383
  );
384
384
  }
385
- chunkMWMSFIWN_cjs.__name(listItem, "listItem");
385
+ chunkL6DXCKVQ_cjs.__name(listItem, "listItem");
386
386
  function code(node, target) {
387
387
  const language = typeof node.language === "string" && node.language !== "" ? node.language : void 0;
388
388
  const caption = nonEmpty(node.filename) ?? nonEmpty(node.label);
@@ -390,7 +390,7 @@ function code(node, target) {
390
390
  node,
391
391
  [target.text(node.text)],
392
392
  (contents) => {
393
- const pre = /* @__PURE__ */ chunkMWMSFIWN_cjs.__name((key) => target.element(
393
+ const pre = /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((key) => target.element(
394
394
  "pre",
395
395
  void 0,
396
396
  [
@@ -417,11 +417,11 @@ function code(node, target) {
417
417
  PLAIN
418
418
  );
419
419
  }
420
- chunkMWMSFIWN_cjs.__name(code, "code");
420
+ chunkL6DXCKVQ_cjs.__name(code, "code");
421
421
  function nonEmpty(value) {
422
422
  return typeof value === "string" && value !== "" ? value : void 0;
423
423
  }
424
- chunkMWMSFIWN_cjs.__name(nonEmpty, "nonEmpty");
424
+ chunkL6DXCKVQ_cjs.__name(nonEmpty, "nonEmpty");
425
425
  function table(node, target) {
426
426
  const rows = node.children.filter((row) => row._type === "tableRow");
427
427
  const [first, ...rest] = rows;
@@ -448,7 +448,7 @@ function table(node, target) {
448
448
  PLAIN
449
449
  );
450
450
  }
451
- chunkMWMSFIWN_cjs.__name(table, "table");
451
+ chunkL6DXCKVQ_cjs.__name(table, "table");
452
452
  function tableRow(row, header, target) {
453
453
  const cells = [];
454
454
  for (const cell of row.children) {
@@ -461,7 +461,7 @@ function tableRow(row, header, target) {
461
461
  header ? HEADER : PLAIN
462
462
  );
463
463
  }
464
- chunkMWMSFIWN_cjs.__name(tableRow, "tableRow");
464
+ chunkL6DXCKVQ_cjs.__name(tableRow, "tableRow");
465
465
  function tableCell(cell, header, target) {
466
466
  let attributes;
467
467
  switch (cell.align) {
@@ -487,11 +487,11 @@ function tableCell(cell, header, target) {
487
487
  header ? HEADER : PLAIN
488
488
  );
489
489
  }
490
- chunkMWMSFIWN_cjs.__name(tableCell, "tableCell");
490
+ chunkL6DXCKVQ_cjs.__name(tableCell, "tableCell");
491
491
  function inline(nodes, target) {
492
492
  const out = [];
493
493
  let runs = [];
494
- const flush = /* @__PURE__ */ chunkMWMSFIWN_cjs.__name(() => {
494
+ const flush = /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name(() => {
495
495
  if (runs.length > 0) out.push(...marked(runs, target));
496
496
  runs = [];
497
497
  }, "flush");
@@ -520,7 +520,7 @@ function inline(nodes, target) {
520
520
  flush();
521
521
  return out;
522
522
  }
523
- chunkMWMSFIWN_cjs.__name(inline, "inline");
523
+ chunkL6DXCKVQ_cjs.__name(inline, "inline");
524
524
  function marked(runs, target) {
525
525
  const out = [];
526
526
  let index = 0;
@@ -543,11 +543,11 @@ function marked(runs, target) {
543
543
  }
544
544
  return out;
545
545
  }
546
- chunkMWMSFIWN_cjs.__name(marked, "marked");
546
+ chunkL6DXCKVQ_cjs.__name(marked, "marked");
547
547
  function nextMark(run) {
548
548
  return run.span.marks?.[run.drawn];
549
549
  }
550
- chunkMWMSFIWN_cjs.__name(nextMark, "nextMark");
550
+ chunkL6DXCKVQ_cjs.__name(nextMark, "nextMark");
551
551
  function sameMark(a, b) {
552
552
  if (a?._type !== b._type) return false;
553
553
  if (a._type === "link" && b._type === "link") return a.href === b.href;
@@ -556,7 +556,7 @@ function sameMark(a, b) {
556
556
  }
557
557
  return true;
558
558
  }
559
- chunkMWMSFIWN_cjs.__name(sameMark, "sameMark");
559
+ chunkL6DXCKVQ_cjs.__name(sameMark, "sameMark");
560
560
  function linkedEntryId(link) {
561
561
  const to = link.to;
562
562
  if (typeof to === "object" && to !== null && "_metadata" in to) {
@@ -565,7 +565,7 @@ function linkedEntryId(link) {
565
565
  }
566
566
  return to;
567
567
  }
568
- chunkMWMSFIWN_cjs.__name(linkedEntryId, "linkedEntryId");
568
+ chunkL6DXCKVQ_cjs.__name(linkedEntryId, "linkedEntryId");
569
569
  var MARK_TAGS = {
570
570
  bold: "strong",
571
571
  italic: "em",
@@ -606,7 +606,7 @@ function applyMark(mark, inner, target) {
606
606
  }
607
607
  }
608
608
  }
609
- chunkMWMSFIWN_cjs.__name(applyMark, "applyMark");
609
+ chunkL6DXCKVQ_cjs.__name(applyMark, "applyMark");
610
610
  var SAFE_SCHEMES = /* @__PURE__ */ new Set(["http", "https", "mailto", "tel"]);
611
611
  var SCHEME = /^([a-z][a-z\d+.-]*):/i;
612
612
  function safeRichTextHref(href) {
@@ -623,7 +623,7 @@ function safeRichTextHref(href) {
623
623
  if (scheme === null) return href;
624
624
  return SAFE_SCHEMES.has(scheme[1].toLowerCase()) ? href : void 0;
625
625
  }
626
- chunkMWMSFIWN_cjs.__name(safeRichTextHref, "safeRichTextHref");
626
+ chunkL6DXCKVQ_cjs.__name(safeRichTextHref, "safeRichTextHref");
627
627
  function trimControls(text) {
628
628
  let start = 0;
629
629
  let end = text.length;
@@ -631,13 +631,13 @@ function trimControls(text) {
631
631
  while (end > start && text.charCodeAt(end - 1) <= 32) end -= 1;
632
632
  return text.slice(start, end);
633
633
  }
634
- chunkMWMSFIWN_cjs.__name(trimControls, "trimControls");
634
+ chunkL6DXCKVQ_cjs.__name(trimControls, "trimControls");
635
635
 
636
636
  // src/rich-text/html.ts
637
637
  function escapeHtml(text) {
638
638
  return String(text).replace(/["&'<>]/g, (character) => HTML_ESCAPES[character] ?? character);
639
639
  }
640
- chunkMWMSFIWN_cjs.__name(escapeHtml, "escapeHtml");
640
+ chunkL6DXCKVQ_cjs.__name(escapeHtml, "escapeHtml");
641
641
  var HTML_ESCAPES = {
642
642
  '"': "&quot;",
643
643
  "&": "&amp;",
@@ -653,7 +653,7 @@ function attributesOf(attributes) {
653
653
  }
654
654
  return written;
655
655
  }
656
- chunkMWMSFIWN_cjs.__name(attributesOf, "attributesOf");
656
+ chunkL6DXCKVQ_cjs.__name(attributesOf, "attributesOf");
657
657
  var VOID_ELEMENTS = /* @__PURE__ */ new Set([
658
658
  "area",
659
659
  "base",
@@ -685,7 +685,7 @@ function tagEnd(html, start) {
685
685
  }
686
686
  return -1;
687
687
  }
688
- chunkMWMSFIWN_cjs.__name(tagEnd, "tagEnd");
688
+ chunkL6DXCKVQ_cjs.__name(tagEnd, "tagEnd");
689
689
  var TAG_NAME = /^<\/?([A-Za-z][\w:-]*)/;
690
690
  function soleElementStartTag(html) {
691
691
  const from = html.length - html.trimStart().length;
@@ -748,7 +748,7 @@ function soleElementStartTag(html) {
748
748
  }
749
749
  return depth === 0 ? startTag : void 0;
750
750
  }
751
- chunkMWMSFIWN_cjs.__name(soleElementStartTag, "soleElementStartTag");
751
+ chunkL6DXCKVQ_cjs.__name(soleElementStartTag, "soleElementStartTag");
752
752
  function stamped(html, binding) {
753
753
  if (binding === void 0) return html;
754
754
  const root = soleElementStartTag(html);
@@ -756,17 +756,17 @@ function stamped(html, binding) {
756
756
  if (BOUND.test(root.tag)) return html;
757
757
  return `${html.slice(0, root.insertAt)}${attributesOf(binding)}${html.slice(root.insertAt)}`;
758
758
  }
759
- chunkMWMSFIWN_cjs.__name(stamped, "stamped");
759
+ chunkL6DXCKVQ_cjs.__name(stamped, "stamped");
760
760
  function htmlTarget(declared2, entryLink, field) {
761
761
  return {
762
762
  element(tag, attributes, children) {
763
763
  return RICH_TEXT_VOID_TAGS.has(tag) ? `<${tag}${attributesOf(attributes)}/>` : `<${tag}${attributesOf(attributes)}>${children.join("")}</${tag}>`;
764
764
  },
765
765
  text: escapeHtml,
766
- node: /* @__PURE__ */ chunkMWMSFIWN_cjs.__name((_node, contents, draw) => draw(contents), "node"),
767
- mark: /* @__PURE__ */ chunkMWMSFIWN_cjs.__name((_mark, contents, draw) => draw(contents), "mark"),
766
+ node: /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((_node, contents, draw) => draw(contents), "node"),
767
+ mark: /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((_mark, contents, draw) => draw(contents), "mark"),
768
768
  // A value built by hand holding an entry link no writer draws: its text, with no anchor
769
- entryLink: /* @__PURE__ */ chunkMWMSFIWN_cjs.__name((link, contents) => entryLink === void 0 ? contents.join("") : entryLink(link, contents.join("")), "entryLink"),
769
+ entryLink: /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((link, contents) => entryLink === void 0 ? contents.join("") : entryLink(link, contents.join("")), "entryLink"),
770
770
  // A declared node's writer (REL-1807), handed the node's key path below the field's binding and
771
771
  // stamped with it (REL-2142); no binding asks the core nothing
772
772
  declared(node) {
@@ -777,7 +777,7 @@ function htmlTarget(declared2, entryLink, field) {
777
777
  }
778
778
  };
779
779
  }
780
- chunkMWMSFIWN_cjs.__name(htmlTarget, "htmlTarget");
780
+ chunkL6DXCKVQ_cjs.__name(htmlTarget, "htmlTarget");
781
781
  function richTextToHtml(value, ...[options]) {
782
782
  if (value === void 0) return "";
783
783
  const declared2 = options?.declared ?? {};
@@ -788,7 +788,7 @@ function richTextToHtml(value, ...[options]) {
788
788
  options?.anchors === void 0 ? {} : { anchors: options.anchors }
789
789
  ).join("");
790
790
  }
791
- chunkMWMSFIWN_cjs.__name(richTextToHtml, "richTextToHtml");
791
+ chunkL6DXCKVQ_cjs.__name(richTextToHtml, "richTextToHtml");
792
792
 
793
793
  // src/rich-text/markdown.ts
794
794
  var entryLinkWriter;
@@ -798,7 +798,7 @@ function declared(node) {
798
798
  const write = Object.prototype.hasOwnProperty.call(writers, type) ? writers[type] : void 0;
799
799
  return write === void 0 ? void 0 : write(node);
800
800
  }
801
- chunkMWMSFIWN_cjs.__name(declared, "declared");
801
+ chunkL6DXCKVQ_cjs.__name(declared, "declared");
802
802
  function richTextToMarkdown(value, ...[options]) {
803
803
  if (value === void 0) return "";
804
804
  const tree = value;
@@ -817,7 +817,7 @@ function richTextToMarkdown(value, ...[options]) {
817
817
  entryLinkWriter = outerLink;
818
818
  }
819
819
  }
820
- chunkMWMSFIWN_cjs.__name(richTextToMarkdown, "richTextToMarkdown");
820
+ chunkL6DXCKVQ_cjs.__name(richTextToMarkdown, "richTextToMarkdown");
821
821
  function blocks2(nodes) {
822
822
  const out = [];
823
823
  for (const node of nodes) {
@@ -826,7 +826,7 @@ function blocks2(nodes) {
826
826
  }
827
827
  return out;
828
828
  }
829
- chunkMWMSFIWN_cjs.__name(blocks2, "blocks");
829
+ chunkL6DXCKVQ_cjs.__name(blocks2, "blocks");
830
830
  function block2(node) {
831
831
  if (isDeclaredRichTextNode(node)) return declared(node);
832
832
  switch (node._type) {
@@ -865,7 +865,7 @@ function block2(node) {
865
865
  }
866
866
  }
867
867
  }
868
- chunkMWMSFIWN_cjs.__name(block2, "block");
868
+ chunkL6DXCKVQ_cjs.__name(block2, "block");
869
869
  function list2(node) {
870
870
  const items = node.children.filter((item) => item._type === "listItem");
871
871
  if (items.length === 0) return void 0;
@@ -902,12 +902,12 @@ function list2(node) {
902
902
  return `${marker} ${body.split("\n").map((line, at) => at === 0 || line === "" ? line : `${indent}${line}`).join("\n")}`;
903
903
  }).join("\n");
904
904
  }
905
- chunkMWMSFIWN_cjs.__name(list2, "list");
905
+ chunkL6DXCKVQ_cjs.__name(list2, "list");
906
906
  function interruptsParagraph(node) {
907
907
  if (node._type !== "list") return false;
908
908
  return node.style !== "numbered" || node.start === void 0 || node.start === 1;
909
909
  }
910
- chunkMWMSFIWN_cjs.__name(interruptsParagraph, "interruptsParagraph");
910
+ chunkL6DXCKVQ_cjs.__name(interruptsParagraph, "interruptsParagraph");
911
911
  function code2(node) {
912
912
  const text = typeof node.text === "string" ? node.text : "";
913
913
  const longest = Math.max(0, ...[...text.matchAll(/`+/g)].map((run) => run[0].length));
@@ -919,7 +919,7 @@ ${fence}` : `${fence}${info}
919
919
  ${text}
920
920
  ${fence}`;
921
921
  }
922
- chunkMWMSFIWN_cjs.__name(code2, "code");
922
+ chunkL6DXCKVQ_cjs.__name(code2, "code");
923
923
  function table2(node) {
924
924
  const rows = node.children.filter((row) => row._type === "tableRow").map((row) => row.children.filter((cell) => cell._type === "tableCell"));
925
925
  if (rows.length === 0) return void 0;
@@ -940,7 +940,7 @@ function table2(node) {
940
940
  { length: columns },
941
941
  (_, at) => Math.max(3, ...[header, ...body].map((cells) => cells[at].length))
942
942
  );
943
- const line = /* @__PURE__ */ chunkMWMSFIWN_cjs.__name((cells) => `| ${cells.map((cell, at) => cell.padEnd(widths[at])).join(" | ")} |`, "line");
943
+ const line = /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name((cells) => `| ${cells.map((cell, at) => cell.padEnd(widths[at])).join(" | ")} |`, "line");
944
944
  const delimiter = `| ${alignments.map((align, at) => {
945
945
  const width = widths[at];
946
946
  switch (align) {
@@ -963,11 +963,11 @@ function table2(node) {
963
963
  }).join(" | ")} |`;
964
964
  return [line(header), delimiter, ...body.map((cells) => line(cells))].join("\n");
965
965
  }
966
- chunkMWMSFIWN_cjs.__name(table2, "table");
966
+ chunkL6DXCKVQ_cjs.__name(table2, "table");
967
967
  function inline2(nodes, lineBreak) {
968
968
  let out = "";
969
969
  let runs = [];
970
- const flush = /* @__PURE__ */ chunkMWMSFIWN_cjs.__name(() => {
970
+ const flush = /* @__PURE__ */ chunkL6DXCKVQ_cjs.__name(() => {
971
971
  out += marked2(runs);
972
972
  runs = [];
973
973
  }, "flush");
@@ -995,7 +995,7 @@ function inline2(nodes, lineBreak) {
995
995
  flush();
996
996
  return out;
997
997
  }
998
- chunkMWMSFIWN_cjs.__name(inline2, "inline");
998
+ chunkL6DXCKVQ_cjs.__name(inline2, "inline");
999
999
  function marked2(runs) {
1000
1000
  let out = "";
1001
1001
  let index = 0;
@@ -1024,7 +1024,7 @@ function marked2(runs) {
1024
1024
  }
1025
1025
  return out;
1026
1026
  }
1027
- chunkMWMSFIWN_cjs.__name(marked2, "marked");
1027
+ chunkL6DXCKVQ_cjs.__name(marked2, "marked");
1028
1028
  function applyMark2(mark, inner) {
1029
1029
  switch (mark._type) {
1030
1030
  case "entryLink": {
@@ -1058,36 +1058,36 @@ function applyMark2(mark, inner) {
1058
1058
  }
1059
1059
  }
1060
1060
  }
1061
- chunkMWMSFIWN_cjs.__name(applyMark2, "applyMark");
1061
+ chunkL6DXCKVQ_cjs.__name(applyMark2, "applyMark");
1062
1062
  function delimit(delimiter, inner) {
1063
1063
  const match = /^(\s*)([\s\S]*?)(\s*)$/.exec(inner);
1064
1064
  const [, before = "", core = "", after = ""] = match;
1065
1065
  if (core === "") return inner;
1066
1066
  return `${before}${delimiter}${core}${delimiter}${after}`;
1067
1067
  }
1068
- chunkMWMSFIWN_cjs.__name(delimit, "delimit");
1068
+ chunkL6DXCKVQ_cjs.__name(delimit, "delimit");
1069
1069
  function codeSpan(text) {
1070
1070
  const longest = Math.max(0, ...[...text.matchAll(/`+/g)].map((run) => run[0].length));
1071
1071
  const fence = "`".repeat(longest + 1);
1072
1072
  const padded = /^`|`$/.test(text) || /^ .*[^ ].* $/.test(text) ? ` ${text} ` : text;
1073
1073
  return `${fence}${padded}${fence}`;
1074
1074
  }
1075
- chunkMWMSFIWN_cjs.__name(codeSpan, "codeSpan");
1075
+ chunkL6DXCKVQ_cjs.__name(codeSpan, "codeSpan");
1076
1076
  function destination(href) {
1077
1077
  if (!/[\s()<>]/.test(href)) return href;
1078
1078
  return `<${href.replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s/g, "%20")}>`;
1079
1079
  }
1080
- chunkMWMSFIWN_cjs.__name(destination, "destination");
1080
+ chunkL6DXCKVQ_cjs.__name(destination, "destination");
1081
1081
  function escapeText(text) {
1082
1082
  return String(text).replace(/[\\`*_[\]<>~]/g, "\\$&").replace(/&(?=#?[\da-z]+;)/gi, "\\&");
1083
1083
  }
1084
- chunkMWMSFIWN_cjs.__name(escapeText, "escapeText");
1084
+ chunkL6DXCKVQ_cjs.__name(escapeText, "escapeText");
1085
1085
  function escapeLineStarts(paragraph) {
1086
1086
  return paragraph.split("\n").map(
1087
1087
  (line) => line.replace(/^(#{1,6})(?=\s|$)/, "\\$1").replace(/^([+=-])/, "\\$1").replace(/^(\d+)([).])/, "$1\\$2")
1088
1088
  ).join("\n");
1089
1089
  }
1090
- chunkMWMSFIWN_cjs.__name(escapeLineStarts, "escapeLineStarts");
1090
+ chunkL6DXCKVQ_cjs.__name(escapeLineStarts, "escapeLineStarts");
1091
1091
 
1092
1092
  exports.RICH_TEXT_VOID_TAGS = RICH_TEXT_VOID_TAGS;
1093
1093
  exports.entryHeadingAnchors = entryHeadingAnchors;
@@ -1102,5 +1102,5 @@ exports.richTextHeadingSlug = richTextHeadingSlug;
1102
1102
  exports.richTextToHtml = richTextToHtml;
1103
1103
  exports.richTextToMarkdown = richTextToMarkdown;
1104
1104
  exports.safeRichTextHref = safeRichTextHref;
1105
- //# sourceMappingURL=chunk-RSHMA4KT.cjs.map
1106
- //# sourceMappingURL=chunk-RSHMA4KT.cjs.map
1105
+ //# sourceMappingURL=chunk-2SPPU2WG.cjs.map
1106
+ //# sourceMappingURL=chunk-2SPPU2WG.cjs.map
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ var chunkL6DXCKVQ_cjs = require('./chunk-L6DXCKVQ.cjs');
4
+
5
+ /* RelyIO SDK - Built with ❤️ by the RelyIO Team */
6
+
7
+ // src/preview/index.ts
8
+ var UNKNOWN_PREVIEW_RECHECK_MS = 6e4;
9
+ var NOT_PREVIEW = Object.freeze({ state: "not-preview" });
10
+ function previewAtRequest(env) {
11
+ return vercel(env) ?? NOT_PREVIEW;
12
+ }
13
+ chunkL6DXCKVQ_cjs.__name(previewAtRequest, "previewAtRequest");
14
+ function previewAtBuild(env) {
15
+ const fromVercel = vercel(env);
16
+ if (fromVercel !== void 0) return fromVercel;
17
+ if (env.CONTEXT !== void 0) {
18
+ if (env.CONTEXT !== "deploy-preview") return NOT_PREVIEW;
19
+ return hasValue(env.HEAD) ? { state: "preview", host: "netlify", branch: env.HEAD } : { state: "no-branch", host: "netlify" };
20
+ }
21
+ if (env.CF_PAGES !== void 0) return { state: "undecidable", host: "cloudflare-pages" };
22
+ return NOT_PREVIEW;
23
+ }
24
+ chunkL6DXCKVQ_cjs.__name(previewAtBuild, "previewAtBuild");
25
+ function vercel(env) {
26
+ if (env.VERCEL_ENV === void 0) return void 0;
27
+ if (env.VERCEL_ENV !== "preview") return NOT_PREVIEW;
28
+ return hasValue(env.VERCEL_GIT_COMMIT_REF) ? { state: "preview", host: "vercel", branch: env.VERCEL_GIT_COMMIT_REF } : { state: "no-branch", host: "vercel" };
29
+ }
30
+ chunkL6DXCKVQ_cjs.__name(vercel, "vercel");
31
+ function hasValue(value) {
32
+ return value !== void 0 && value !== "";
33
+ }
34
+ chunkL6DXCKVQ_cjs.__name(hasValue, "hasValue");
35
+
36
+ exports.UNKNOWN_PREVIEW_RECHECK_MS = UNKNOWN_PREVIEW_RECHECK_MS;
37
+ exports.previewAtBuild = previewAtBuild;
38
+ exports.previewAtRequest = previewAtRequest;
39
+ //# sourceMappingURL=chunk-7I3SC7SV.cjs.map
40
+ //# sourceMappingURL=chunk-7I3SC7SV.cjs.map
@@ -0,0 +1,43 @@
1
+ /* RelyIO SDK - Built with ❤️ by the RelyIO Team */
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
10
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
11
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
12
+ }) : x)(function(x) {
13
+ if (typeof require !== "undefined") return require.apply(this, arguments);
14
+ throw Error('Dynamic require of "' + x + '" is not supported');
15
+ });
16
+ var __commonJS = (cb, mod) => function __require2() {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ };
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, { get: all[name], enumerable: true });
22
+ };
23
+ var __copyProps = (to, from, except, desc) => {
24
+ if (from && typeof from === "object" || typeof from === "function") {
25
+ for (let key of __getOwnPropNames(from))
26
+ if (!__hasOwnProp.call(to, key) && key !== except)
27
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
28
+ }
29
+ return to;
30
+ };
31
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
32
+ // If the importer is in node compatibility mode or this is not an ESM
33
+ // file that has been converted to a CommonJS file using a Babel-
34
+ // compatible transform (i.e. "__esModule" has not been set), then set
35
+ // "default" to the CommonJS "module.exports" for node compatibility.
36
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
37
+ mod
38
+ ));
39
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
40
+
41
+ export { __commonJS, __export, __name, __publicField, __require, __toESM };
42
+ //# sourceMappingURL=chunk-DI6KFDBO.js.map
43
+ //# sourceMappingURL=chunk-DI6KFDBO.js.map