@preprio/toolkit 0.6.0-alpha.9 → 1.0.0-rc.1

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 (116) hide show
  1. package/README.md +111 -1363
  2. package/dist/astro/index.cjs +1555 -182
  3. package/dist/astro/index.d.cts +201 -1
  4. package/dist/astro/index.d.ts +201 -1
  5. package/dist/astro/index.js +1557 -29
  6. package/dist/{chunk-5QIWVDP2.js → chunk-33GWVTRJ.js} +1 -1
  7. package/dist/chunk-A2J7R4LR.js +256 -0
  8. package/dist/{chunk-WQBKQG4R.js → chunk-DSJ22P6J.js} +6 -1
  9. package/dist/chunk-KM2GME62.js +1255 -0
  10. package/dist/chunk-UTKH7DOI.js +58 -0
  11. package/dist/chunk-V7MCHPE7.js +85 -0
  12. package/dist/{chunk-J66UOCK6.js → chunk-WBMN4L7G.js} +1680 -579
  13. package/dist/chunk-Y7JWV7WV.js +374 -0
  14. package/dist/codegen/index.cjs +82 -0
  15. package/dist/codegen/index.d.cts +70 -0
  16. package/dist/codegen/index.d.ts +70 -0
  17. package/dist/codegen/index.js +64 -0
  18. package/dist/index.cjs +3729 -553
  19. package/dist/index.d.cts +403 -19
  20. package/dist/index.d.ts +403 -19
  21. package/dist/index.js +345 -24
  22. package/dist/live-preview-HCBNBC6C.js +19 -0
  23. package/dist/nextjs/components.cjs +1872 -754
  24. package/dist/nextjs/components.d.cts +5 -51
  25. package/dist/nextjs/components.d.ts +5 -51
  26. package/dist/nextjs/components.js +8 -299
  27. package/dist/nextjs/index.cjs +1228 -181
  28. package/dist/nextjs/index.d.cts +247 -92
  29. package/dist/nextjs/index.d.ts +247 -92
  30. package/dist/nextjs/index.js +1629 -111
  31. package/dist/nextjs/live-action.cjs +298 -0
  32. package/dist/nextjs/live-action.d.cts +12 -0
  33. package/dist/nextjs/live-action.d.ts +12 -0
  34. package/dist/nextjs/live-action.js +68 -0
  35. package/dist/nextjs/live.cjs +2010 -0
  36. package/dist/nextjs/live.d.cts +54 -0
  37. package/dist/nextjs/live.d.ts +54 -0
  38. package/dist/nextjs/live.js +287 -0
  39. package/dist/nuxt/chunk-5RBZPRQN.js +350 -0
  40. package/dist/nuxt/chunk-LUKVPOJ2.js +32 -0
  41. package/dist/nuxt/index.cjs +15 -16
  42. package/dist/nuxt/index.d.cts +167 -6
  43. package/dist/nuxt/index.d.ts +167 -6
  44. package/dist/nuxt/index.js +402 -15
  45. package/dist/nuxt/live-preview-KO4IKWTX.js +1234 -0
  46. package/dist/nuxt/live.cjs +1928 -0
  47. package/dist/nuxt/live.d.cts +45 -0
  48. package/dist/nuxt/live.d.ts +45 -0
  49. package/dist/nuxt/live.js +216 -0
  50. package/dist/{types-BYH9XqmN.d.cts → pixel-DqU7NvgW.d.cts} +102 -5
  51. package/dist/{types-BYH9XqmN.d.ts → pixel-DqU7NvgW.d.ts} +102 -5
  52. package/dist/react/components.cjs +1865 -480
  53. package/dist/react/components.d.cts +43 -8
  54. package/dist/react/components.d.ts +43 -8
  55. package/dist/react/components.js +1865 -480
  56. package/dist/sveltekit/chunk-5RBZPRQN.js +350 -0
  57. package/dist/sveltekit/chunk-LUKVPOJ2.js +32 -0
  58. package/dist/sveltekit/index.cjs +15 -16
  59. package/dist/sveltekit/index.d.cts +111 -10
  60. package/dist/sveltekit/index.d.ts +111 -10
  61. package/dist/sveltekit/index.js +398 -15
  62. package/dist/sveltekit/live-preview-KO4IKWTX.js +1234 -0
  63. package/dist/sveltekit/live.cjs +1940 -0
  64. package/dist/sveltekit/live.d.cts +61 -0
  65. package/dist/sveltekit/live.d.ts +61 -0
  66. package/dist/sveltekit/live.js +220 -0
  67. package/package.json +132 -71
  68. package/src/astro/PreprToolbar.astro +7 -1
  69. package/src/astro/PreprTrackingPixel.astro +2 -4
  70. package/src/nuxt/PreprToolbar.vue +12 -1
  71. package/src/nuxt/PreprTrackingPixel.vue +2 -4
  72. package/src/sveltekit/PreprToolbar.svelte +17 -2
  73. package/src/sveltekit/PreprTrackingPixel.svelte +2 -4
  74. package/dist/astro/chunk-UN4JADNU.js +0 -173
  75. package/dist/astro/graphql.cjs +0 -1078
  76. package/dist/astro/graphql.d.cts +0 -300
  77. package/dist/astro/graphql.d.ts +0 -300
  78. package/dist/astro/graphql.js +0 -984
  79. package/dist/astro/index-XT_z-RYT.d.cts +0 -130
  80. package/dist/astro/index-XT_z-RYT.d.ts +0 -130
  81. package/dist/chunk-3NCEVJJ3.js +0 -10
  82. package/dist/chunk-S5RWVMDJ.js +0 -148
  83. package/dist/chunk-XL4Y7FGW.js +0 -499
  84. package/dist/graphql/codegen.cjs +0 -557
  85. package/dist/graphql/codegen.d.cts +0 -23
  86. package/dist/graphql/codegen.d.ts +0 -23
  87. package/dist/graphql/codegen.js +0 -99
  88. package/dist/graphql.cjs +0 -1020
  89. package/dist/graphql.d.cts +0 -335
  90. package/dist/graphql.d.ts +0 -335
  91. package/dist/graphql.js +0 -448
  92. package/dist/nextjs/chunk-CMV6ZP6E.js +0 -549
  93. package/dist/nextjs/graphql.cjs +0 -1836
  94. package/dist/nextjs/graphql.d.cts +0 -498
  95. package/dist/nextjs/graphql.d.ts +0 -498
  96. package/dist/nextjs/graphql.js +0 -1422
  97. package/dist/nextjs/server-BL-sqZvu.d.cts +0 -156
  98. package/dist/nextjs/server-BL-sqZvu.d.ts +0 -156
  99. package/dist/nuxt/chunk-XWOABVMW.js +0 -417
  100. package/dist/nuxt/graphql.cjs +0 -1085
  101. package/dist/nuxt/graphql.d.cts +0 -297
  102. package/dist/nuxt/graphql.d.ts +0 -297
  103. package/dist/nuxt/graphql.js +0 -985
  104. package/dist/nuxt/server-8v6OHbsw.d.cts +0 -158
  105. package/dist/nuxt/server-8v6OHbsw.d.ts +0 -158
  106. package/dist/pixel-DwW7cXJm.d.cts +0 -49
  107. package/dist/pixel-DwW7cXJm.d.ts +0 -49
  108. package/dist/server-Brr1UgtW.d.ts +0 -59
  109. package/dist/server-DJuS3YU0.d.cts +0 -59
  110. package/dist/sveltekit/chunk-3S5RA6G5.js +0 -413
  111. package/dist/sveltekit/graphql.cjs +0 -1091
  112. package/dist/sveltekit/graphql.d.cts +0 -302
  113. package/dist/sveltekit/graphql.d.ts +0 -302
  114. package/dist/sveltekit/graphql.js +0 -991
  115. package/dist/sveltekit/server-CO847mEV.d.cts +0 -98
  116. package/dist/sveltekit/server-CO847mEV.d.ts +0 -98
@@ -0,0 +1,298 @@
1
+ "use strict";
2
+ "use server";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // src/nextjs/live-action.ts
32
+ var live_action_exports = {};
33
+ __export(live_action_exports, {
34
+ syncPreprLiveLog: () => syncPreprLiveLog
35
+ });
36
+ module.exports = __toCommonJS(live_action_exports);
37
+ var nextCache = __toESM(require("next/cache"), 1);
38
+ var import_headers = require("next/headers");
39
+
40
+ // src/core/live-preview/guards.ts
41
+ function isScalar(value) {
42
+ return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
43
+ }
44
+
45
+ // src/core/live-preview/validate.ts
46
+ var MAX_DEPTH = 3;
47
+ var MAX_ENTRIES = 50;
48
+ var FORBIDDEN_KEYS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
49
+ var SAFE_URL = /^https?:\/\//i;
50
+ var URL_KEY = /^(?:url|href|src|link)$|(?:_url|Url)$/;
51
+ var URL_IGNORED_ANYWHERE = /[\t\n\r]/g;
52
+ var SCRIPT_SCHEME = /^(?:javascript|vbscript|data):/i;
53
+ function isSafeLinkValue(value) {
54
+ const stripped = value.replace(URL_IGNORED_ANYWHERE, "");
55
+ let start = 0;
56
+ while (start < stripped.length && stripped.charCodeAt(start) <= 32) start++;
57
+ return !SCRIPT_SCHEME.test(stripped.slice(start));
58
+ }
59
+ function isUrlKey(key) {
60
+ return URL_KEY.test(key);
61
+ }
62
+ function isSafeKeyValue(key, value) {
63
+ if (typeof value !== "string") return true;
64
+ if (key === "url") return SAFE_URL.test(value);
65
+ return !isUrlKey(key) || isSafeLinkValue(value);
66
+ }
67
+ function isLiveValue(v, depth = 0) {
68
+ if (v === null || isScalar(v)) return true;
69
+ if (depth >= MAX_DEPTH) return false;
70
+ if (Array.isArray(v)) {
71
+ return depth === 0 && v.length <= MAX_ENTRIES && v.every((entry) => isPlainRecord(entry) && isLiveValue(entry, depth + 1));
72
+ }
73
+ if (!isPlainRecord(v)) return false;
74
+ const keys = Object.keys(v);
75
+ if (keys.length > MAX_ENTRIES) return false;
76
+ return keys.every((key) => {
77
+ if (FORBIDDEN_KEYS.has(key)) return false;
78
+ const value = v[key];
79
+ if (!isSafeKeyValue(key, value)) return false;
80
+ return !Array.isArray(value) && isLiveValue(value, depth + 1);
81
+ });
82
+ }
83
+ function isLiveFieldChange(field, value) {
84
+ if (!isLiveValue(value)) return false;
85
+ const name = field.slice(field.lastIndexOf(".") + 1);
86
+ return typeof value !== "string" || !isUrlKey(name) || isSafeLinkValue(value);
87
+ }
88
+ var MAX_LIST_ENTRIES = 200;
89
+ function parseListEntries(value) {
90
+ if (!Array.isArray(value) || value.length > MAX_LIST_ENTRIES) return null;
91
+ const list = [];
92
+ for (const raw of value) {
93
+ if (!isPlainRecord(raw) || typeof raw._id !== "string" || !raw._id) {
94
+ return null;
95
+ }
96
+ const entry = { _id: raw._id };
97
+ if (typeof raw.__typename === "string") entry.__typename = raw.__typename;
98
+ if (typeof raw.body === "string") entry.body = raw.body;
99
+ if (typeof raw.format === "string" || raw.format === null) {
100
+ entry.format = raw.format;
101
+ }
102
+ if (typeof raw.typeName === "string" && raw.typeName.length <= 200) {
103
+ entry.typeName = raw.typeName;
104
+ }
105
+ if (raw.fields !== void 0) {
106
+ if (!isPlainRecord(raw.fields) || !isFieldValue(raw.fields, 0)) {
107
+ return null;
108
+ }
109
+ entry.fields = raw.fields;
110
+ }
111
+ list.push(entry);
112
+ }
113
+ return list;
114
+ }
115
+ function isPlainRecord(v) {
116
+ return v !== null && typeof v === "object" && Object.getPrototypeOf(v) === Object.prototype;
117
+ }
118
+ var MAX_FIELD_DEPTH = 6;
119
+ var MAX_FIELD_KEYS = 100;
120
+ function isFieldValue(v, depth) {
121
+ if (v === null || isScalar(v)) return true;
122
+ if (depth >= MAX_FIELD_DEPTH) return false;
123
+ if (Array.isArray(v)) {
124
+ return v.length <= MAX_ENTRIES && v.every(
125
+ (entry) => isScalar(entry) || isPlainRecord(entry) && isFieldValue(entry, depth + 1)
126
+ );
127
+ }
128
+ if (!isPlainRecord(v)) return false;
129
+ const keys = Object.keys(v);
130
+ if (keys.length > MAX_FIELD_KEYS) return false;
131
+ return keys.every((key) => {
132
+ if (FORBIDDEN_KEYS.has(key)) return false;
133
+ const value = v[key];
134
+ if (!isSafeKeyValue(key, value)) return false;
135
+ return isFieldValue(value, depth + 1);
136
+ });
137
+ }
138
+ var MAX_EDIT_LENGTH = 1e3;
139
+ function parseEditTarget(raw) {
140
+ if (!isPlainRecord(raw)) return void 0;
141
+ const { item, field } = raw;
142
+ if (typeof item !== "string" || !item || item.length > MAX_EDIT_LENGTH) {
143
+ return void 0;
144
+ }
145
+ if (typeof field !== "string" || !field || field.length > MAX_EDIT_LENGTH) {
146
+ return void 0;
147
+ }
148
+ return { item, field };
149
+ }
150
+
151
+ // src/core/live-preview/patch-log.ts
152
+ var MAX_LOG_ENTRIES = 500;
153
+ var MAX_LOG_SOURCE_LENGTH = 1e6;
154
+ function parsePatchLog(raw) {
155
+ let value = raw;
156
+ if (typeof value === "string") {
157
+ if (!value || value.length > MAX_LOG_SOURCE_LENGTH) return [];
158
+ try {
159
+ value = JSON.parse(value);
160
+ } catch {
161
+ return [];
162
+ }
163
+ }
164
+ if (!Array.isArray(value)) return [];
165
+ const log = [];
166
+ for (const entry of value.slice(-MAX_LOG_ENTRIES)) {
167
+ if (!isPlainRecord(entry)) continue;
168
+ const { type, itemId, field } = entry;
169
+ if (typeof itemId !== "string" || !itemId) continue;
170
+ if (typeof field !== "string" || !field) continue;
171
+ if (type === "field" && isLiveFieldChange(field, entry.value)) {
172
+ const edit = parseEditTarget(entry.edit);
173
+ log.push(
174
+ edit ? { type, itemId, field, value: entry.value, edit } : { type, itemId, field, value: entry.value }
175
+ );
176
+ } else if (type === "list") {
177
+ const entries = parseListEntries(entry.entries);
178
+ if (entries) log.push({ type, itemId, field, entries });
179
+ }
180
+ }
181
+ return log;
182
+ }
183
+
184
+ // src/core/live-preview/normalize-query.ts
185
+ var import_stega = require("@vercel/stega");
186
+
187
+ // src/core/shared-state.ts
188
+ var KEY = /* @__PURE__ */ Symbol.for("@preprio/toolkit:shared-state");
189
+ function initialState() {
190
+ return {
191
+ trustedParentOrigin: null,
192
+ debugEnabled: void 0,
193
+ strictMode: false,
194
+ liveAnnouncedStrict: void 0
195
+ };
196
+ }
197
+ function sharedState() {
198
+ const scope = globalThis;
199
+ return scope[KEY] ?? (scope[KEY] = initialState());
200
+ }
201
+
202
+ // src/core/utils.ts
203
+ var DebugLogger = class {
204
+ constructor(options) {
205
+ this.options = {
206
+ prefix: "[Prepr]",
207
+ ...options
208
+ };
209
+ }
210
+ // A local `enabled` wins; otherwise defer to the shared flag so scoped
211
+ // loggers created before initDebugLogger() still pick up the setting.
212
+ isEnabled() {
213
+ if (this.options.enabled !== void 0) {
214
+ return this.options.enabled;
215
+ }
216
+ return sharedState().debugEnabled ?? false;
217
+ }
218
+ log(message, ...args) {
219
+ if (!this.isEnabled()) return;
220
+ const prefix = this.options.prefix;
221
+ console.log(`${prefix} ${message}`, ...args);
222
+ }
223
+ warn(message, ...args) {
224
+ if (!this.isEnabled()) return;
225
+ const prefix = this.options.prefix;
226
+ console.warn(`${prefix} ${message}`, ...args);
227
+ }
228
+ };
229
+ function createScopedLogger(scopeName) {
230
+ return new DebugLogger({
231
+ prefix: `[Prepr][${scopeName}]`
232
+ });
233
+ }
234
+
235
+ // src/core/live-preview/normalize-query.ts
236
+ var debug = createScopedLogger("live-preview:normalize");
237
+
238
+ // src/core/server.ts
239
+ var PREVIEW_PACKAGE_PART = /(?:^|;)\s*preview=true\s*(?:;|$)/;
240
+ function isPreviewFromHeaders(headers2) {
241
+ return PREVIEW_PACKAGE_PART.test(headers2.get("Prepr-Package") ?? "");
242
+ }
243
+
244
+ // src/nextjs/live-log.ts
245
+ var LIVE_LOG_COOKIE = "__prepr_live";
246
+ var TTL_MS = 15e3;
247
+ var MAX_SLOTS = 50;
248
+ var KEY2 = /* @__PURE__ */ Symbol.for("@preprio/toolkit/live-log");
249
+ function slots() {
250
+ const holder = globalThis;
251
+ let map = holder[KEY2];
252
+ if (!map) {
253
+ map = /* @__PURE__ */ new Map();
254
+ holder[KEY2] = map;
255
+ }
256
+ return map;
257
+ }
258
+ function prune(map, now) {
259
+ for (const [token, slot] of map) {
260
+ if (slot.expires <= now) map.delete(token);
261
+ }
262
+ while (map.size >= MAX_SLOTS) {
263
+ map.delete(map.keys().next().value);
264
+ }
265
+ }
266
+ function putLiveLog(log) {
267
+ const map = slots();
268
+ const now = Date.now();
269
+ prune(map, now);
270
+ const bytes = new Uint8Array(16);
271
+ globalThis.crypto.getRandomValues(bytes);
272
+ const token = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join(
273
+ ""
274
+ );
275
+ map.set(token, { log, expires: now + TTL_MS });
276
+ return token;
277
+ }
278
+
279
+ // src/nextjs/live-action.ts
280
+ async function syncPreprLiveLog(log) {
281
+ const refresh2 = nextCache.refresh;
282
+ if (typeof refresh2 !== "function") return;
283
+ if (!isPreviewFromHeaders(await (0, import_headers.headers)())) return;
284
+ const parsed = parsePatchLog(log);
285
+ if (!parsed.length) return;
286
+ (await (0, import_headers.cookies)()).set(LIVE_LOG_COOKIE, putLiveLog(parsed), {
287
+ // Expired on arrival: only the re-render of this request reads it.
288
+ maxAge: 0,
289
+ httpOnly: true,
290
+ sameSite: "strict",
291
+ path: "/"
292
+ });
293
+ refresh2();
294
+ }
295
+ // Annotate the CommonJS export names for ESM import in node:
296
+ 0 && (module.exports = {
297
+ syncPreprLiveLog
298
+ });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Server action that re-renders the current route with the editor's unsaved
3
+ * changes, for `normalizeQuery` to apply. Called by `PreprRefresh`.
4
+ *
5
+ * Anyone can call a server action on a production deployment, so it does
6
+ * nothing unless the Prepr middleware ran with `preview: true`, and the log
7
+ * is validated as hostile input. Requires Next.js 16 (`refresh`); on older
8
+ * versions it is a no-op and the page updates on save only.
9
+ */
10
+ declare function syncPreprLiveLog(log: unknown): Promise<void>;
11
+
12
+ export { syncPreprLiveLog };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Server action that re-renders the current route with the editor's unsaved
3
+ * changes, for `normalizeQuery` to apply. Called by `PreprRefresh`.
4
+ *
5
+ * Anyone can call a server action on a production deployment, so it does
6
+ * nothing unless the Prepr middleware ran with `preview: true`, and the log
7
+ * is validated as hostile input. Requires Next.js 16 (`refresh`); on older
8
+ * versions it is a no-op and the page updates on save only.
9
+ */
10
+ declare function syncPreprLiveLog(log: unknown): Promise<void>;
11
+
12
+ export { syncPreprLiveLog };
@@ -0,0 +1,68 @@
1
+ "use server";
2
+ import {
3
+ isPreviewFromHeaders
4
+ } from "../chunk-DSJ22P6J.js";
5
+ import "../chunk-33GWVTRJ.js";
6
+ import {
7
+ parsePatchLog
8
+ } from "../chunk-KM2GME62.js";
9
+ import "../chunk-V7MCHPE7.js";
10
+
11
+ // src/nextjs/live-action.ts
12
+ import * as nextCache from "next/cache";
13
+ import { cookies, headers } from "next/headers";
14
+
15
+ // src/nextjs/live-log.ts
16
+ var LIVE_LOG_COOKIE = "__prepr_live";
17
+ var TTL_MS = 15e3;
18
+ var MAX_SLOTS = 50;
19
+ var KEY = /* @__PURE__ */ Symbol.for("@preprio/toolkit/live-log");
20
+ function slots() {
21
+ const holder = globalThis;
22
+ let map = holder[KEY];
23
+ if (!map) {
24
+ map = /* @__PURE__ */ new Map();
25
+ holder[KEY] = map;
26
+ }
27
+ return map;
28
+ }
29
+ function prune(map, now) {
30
+ for (const [token, slot] of map) {
31
+ if (slot.expires <= now) map.delete(token);
32
+ }
33
+ while (map.size >= MAX_SLOTS) {
34
+ map.delete(map.keys().next().value);
35
+ }
36
+ }
37
+ function putLiveLog(log) {
38
+ const map = slots();
39
+ const now = Date.now();
40
+ prune(map, now);
41
+ const bytes = new Uint8Array(16);
42
+ globalThis.crypto.getRandomValues(bytes);
43
+ const token = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join(
44
+ ""
45
+ );
46
+ map.set(token, { log, expires: now + TTL_MS });
47
+ return token;
48
+ }
49
+
50
+ // src/nextjs/live-action.ts
51
+ async function syncPreprLiveLog(log) {
52
+ const refresh2 = nextCache.refresh;
53
+ if (typeof refresh2 !== "function") return;
54
+ if (!isPreviewFromHeaders(await headers())) return;
55
+ const parsed = parsePatchLog(log);
56
+ if (!parsed.length) return;
57
+ (await cookies()).set(LIVE_LOG_COOKIE, putLiveLog(parsed), {
58
+ // Expired on arrival: only the re-render of this request reads it.
59
+ maxAge: 0,
60
+ httpOnly: true,
61
+ sameSite: "strict",
62
+ path: "/"
63
+ });
64
+ refresh2();
65
+ }
66
+ export {
67
+ syncPreprLiveLog
68
+ };