@crvy/rprtr 0.0.5 → 0.0.8

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.
package/dist/index.js CHANGED
@@ -5554,280 +5554,6 @@ if (dev_fallback_default) {
5554
5554
  throw_rune_error("$bindable");
5555
5555
  }
5556
5556
 
5557
- // node_modules/svelte/src/version.js
5558
- var PUBLIC_VERSION = "5";
5559
-
5560
- // node_modules/svelte/src/internal/disclose-version.js
5561
- if (typeof window !== "undefined") {
5562
- ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(PUBLIC_VERSION);
5563
- }
5564
-
5565
- // src/types.ts
5566
- function isDefined(value) {
5567
- return value !== null && value !== void 0;
5568
- }
5569
- function isTest(x) {
5570
- if (x === null || typeof x !== "object") return false;
5571
- const hasId = "id" in x;
5572
- const hasTitlePath = "titlePath" in x;
5573
- return hasId && hasTitlePath && typeof x.id === "string" && Array.isArray(x.titlePath);
5574
- }
5575
- function getChildrenArray(children) {
5576
- if (children === void 0) return [];
5577
- return Object.values(children).filter(isDefined);
5578
- }
5579
- function getChildrenEntries(children) {
5580
- if (children === void 0) return [];
5581
- return Object.entries(children).filter((entry) => isDefined(entry[1]));
5582
- }
5583
- function getChildrenKeys(children) {
5584
- if (children === void 0) return [];
5585
- return Object.keys(children);
5586
- }
5587
-
5588
- // src/client/helpers/status.ts
5589
- var testStatuses = ["unknown", "pending", "running", "failed", "approved", "success", "retrying"];
5590
- function isTestStatus(value) {
5591
- return testStatuses.some((s) => s === value);
5592
- }
5593
- var statusUpdatesMap = /* @__PURE__ */ new Map([
5594
- [void 0, /(unknown|success|approved|failed|pending|running)/],
5595
- ["unknown", /(success|approved|failed|pending|running)/],
5596
- ["success", /(approved|failed|pending|running)/],
5597
- ["approved", /(failed|pending|running)/],
5598
- ["failed", /(pending|running)/],
5599
- ["pending", /running/]
5600
- ]);
5601
- function calcStatus(oldStatus, newStatus) {
5602
- return newStatus !== void 0 && statusUpdatesMap.get(oldStatus)?.test(newStatus) === true ? newStatus : oldStatus;
5603
- }
5604
- function countTestsStatus(suite) {
5605
- let successCount = 0;
5606
- let failedCount = 0;
5607
- let approvedCount = 0;
5608
- let pendingCount = 0;
5609
- const cases = getChildrenArray(suite.children);
5610
- let suiteOrTest;
5611
- while (suiteOrTest = cases.pop()) {
5612
- if (isTest(suiteOrTest)) {
5613
- if (!hasScreenshots(suiteOrTest)) continue;
5614
- if (suiteOrTest.status === "approved") approvedCount++;
5615
- if (suiteOrTest.status === "success") successCount++;
5616
- if (suiteOrTest.status === "failed") failedCount++;
5617
- if (suiteOrTest.status === "pending") pendingCount++;
5618
- } else {
5619
- cases.push(...getChildrenArray(suiteOrTest.children));
5620
- }
5621
- }
5622
- return { approvedCount, successCount, failedCount, pendingCount };
5623
- }
5624
- function getFailedTests(suite) {
5625
- return getChildrenArray(suite.children).flatMap((suiteOrTest) => {
5626
- if (isTest(suiteOrTest)) return suiteOrTest.status === "failed" ? suiteOrTest : [];
5627
- return getFailedTests(suiteOrTest);
5628
- });
5629
- }
5630
- function hasScreenshots(item) {
5631
- if (isTest(item)) {
5632
- return item.results?.some((r2) => r2.images !== void 0 && Object.keys(r2.images).length > 0) ?? false;
5633
- }
5634
- return getChildrenArray(item.children).some((child2) => hasScreenshots(child2));
5635
- }
5636
-
5637
- // src/client/helpers/path.ts
5638
- function getTestPath(test) {
5639
- return [...test.titlePath, test.title, test.browser].filter(isDefined);
5640
- }
5641
- function getSuiteByPath(suite, path) {
5642
- return path.reduce(
5643
- (suiteOrTest, pathToken) => isTest(suiteOrTest) ? suiteOrTest : suiteOrTest?.children?.[pathToken],
5644
- suite
5645
- );
5646
- }
5647
- function getTestByPath(suite, path) {
5648
- const test = getSuiteByPath(suite, path) ?? suite;
5649
- return isTest(test) ? test : null;
5650
- }
5651
- function setSearchParams(testPath) {
5652
- const params = new URLSearchParams();
5653
- testPath.forEach((p, i) => {
5654
- params.set(`testPath[${i}]`, p);
5655
- });
5656
- window.history.pushState({ testPath }, "", `?${params.toString()}`);
5657
- }
5658
- function getTestPathFromSearch() {
5659
- const params = new URLSearchParams(window.location.search);
5660
- const path = [];
5661
- let i = 0;
5662
- while (params.has(`testPath[${i}]`)) {
5663
- path.push(params.get(`testPath[${i}]`));
5664
- i++;
5665
- }
5666
- return path;
5667
- }
5668
- function parseFilterString(value) {
5669
- let status = null;
5670
- const subStrings = [];
5671
- value.split(" ").filter((s) => s !== "").map((word) => word.toLowerCase()).forEach((word) => {
5672
- const match = /^status:(failed|success|pending|approved)$/i.exec(word);
5673
- if (match !== null) {
5674
- const matchedStatus = match[1];
5675
- if (matchedStatus !== void 0 && isTestStatus(matchedStatus)) {
5676
- status = matchedStatus;
5677
- return;
5678
- }
5679
- }
5680
- subStrings.push(word);
5681
- });
5682
- return { status, subStrings };
5683
- }
5684
- function treeifyTests(testsById) {
5685
- const rootSuite = {
5686
- path: [],
5687
- skip: false,
5688
- opened: true,
5689
- checked: true,
5690
- indeterminate: false,
5691
- children: {}
5692
- };
5693
- Object.values(testsById).forEach((test) => {
5694
- if (test === void 0) return;
5695
- const titlePath = test.titlePath ?? [];
5696
- const browser = test.browser ?? "";
5697
- const title = test.title;
5698
- const pathParts = [...titlePath, title, browser].filter((p) => p !== void 0 && p !== "");
5699
- const [browserName, ...testPathParts] = pathParts.reverse();
5700
- if (browserName === void 0) return;
5701
- const lastSuite = testPathParts.reverse().reduce((suite, token) => {
5702
- suite.children = suite.children ?? {};
5703
- suite.children[token] ??= {
5704
- path: [...suite.path, token],
5705
- skip: false,
5706
- opened: false,
5707
- checked: true,
5708
- indeterminate: false,
5709
- children: {}
5710
- };
5711
- const subSuite = suite.children[token];
5712
- if (subSuite === void 0 || isTest(subSuite)) return suite;
5713
- subSuite.status = calcStatus(subSuite.status, test.status);
5714
- suite.status = calcStatus(suite.status, subSuite.status);
5715
- if (test.skip === false) subSuite.skip = false;
5716
- return subSuite;
5717
- }, rootSuite);
5718
- lastSuite.children = lastSuite.children ?? {};
5719
- lastSuite.children[browserName] = {
5720
- ...test,
5721
- checked: true
5722
- };
5723
- });
5724
- return rootSuite;
5725
- }
5726
- function mergeTreeState(target, source2) {
5727
- target.opened = source2.opened;
5728
- target.checked = source2.checked;
5729
- target.indeterminate = source2.indeterminate;
5730
- for (const [key2, targetChild] of getChildrenEntries(target.children)) {
5731
- const sourceChild = source2.children?.[key2];
5732
- if (targetChild === void 0 || sourceChild === void 0) continue;
5733
- if (!isTest(targetChild) && !isTest(sourceChild)) {
5734
- mergeTreeState(targetChild, sourceChild);
5735
- } else if (isTest(targetChild) && isTest(sourceChild)) {
5736
- targetChild.checked = sourceChild.checked;
5737
- }
5738
- }
5739
- }
5740
-
5741
- // src/client/helpers/suite.ts
5742
- function checkTests(suiteOrTest, checked) {
5743
- suiteOrTest.checked = checked;
5744
- if (!isTest(suiteOrTest)) {
5745
- suiteOrTest.indeterminate = false;
5746
- getChildrenArray(suiteOrTest.children).forEach((child2) => {
5747
- checkTests(child2, checked);
5748
- });
5749
- }
5750
- }
5751
- function updateChecked(suite) {
5752
- const children = getChildrenArray(suite.children).filter((child2) => child2.skip === false);
5753
- const checkedEvery = children.every((test) => test.checked);
5754
- const checkedSome = children.some((test) => test.checked);
5755
- const indeterminate = children.some((test) => isTest(test) ? false : test.indeterminate) || !checkedEvery && checkedSome;
5756
- const checked = indeterminate || suite.checked === checkedEvery ? suite.checked : checkedEvery;
5757
- suite.checked = checked;
5758
- suite.indeterminate = indeterminate;
5759
- }
5760
- function checkSuite(suite, path, checked) {
5761
- const subSuite = getSuiteByPath(suite, path);
5762
- if (subSuite) checkTests(subSuite, checked);
5763
- path.slice(0, -1).map((_, index2, tokens) => tokens.slice(0, tokens.length - index2)).forEach((parentPath) => {
5764
- const parentSuite = getSuiteByPath(suite, parentPath);
5765
- if (isTest(parentSuite)) return;
5766
- if (parentSuite) updateChecked(parentSuite);
5767
- });
5768
- updateChecked(suite);
5769
- }
5770
- function openSuite(suite, path, opened) {
5771
- const subSuite = path.reduce(
5772
- (suiteOrTest, pathToken) => {
5773
- if (suiteOrTest && !isTest(suiteOrTest)) {
5774
- if (opened) suiteOrTest.opened = opened;
5775
- return suiteOrTest.children?.[pathToken];
5776
- }
5777
- },
5778
- suite
5779
- );
5780
- if (subSuite && !isTest(subSuite)) subSuite.opened = opened;
5781
- }
5782
- function filterTests(suite, filter) {
5783
- const { status, subStrings } = filter;
5784
- if (!status && !subStrings.length) return suite;
5785
- const filteredSuite = { ...suite, children: {} };
5786
- getChildrenEntries(suite.children).forEach(([title, suiteOrTest]) => {
5787
- if (suiteOrTest.skip === true) return;
5788
- if (!status && subStrings.some((sub) => title.toLowerCase().includes(sub))) {
5789
- filteredSuite.children = filteredSuite.children ?? {};
5790
- filteredSuite.children[title] = suiteOrTest;
5791
- } else if (isTest(suiteOrTest)) {
5792
- if (status && suiteOrTest.status && ["pending", "running", status].includes(suiteOrTest.status)) {
5793
- filteredSuite.children = filteredSuite.children ?? {};
5794
- filteredSuite.children[title] = suiteOrTest;
5795
- }
5796
- } else {
5797
- const filteredSubSuite = filterTests(suiteOrTest, filter);
5798
- if (getChildrenKeys(filteredSubSuite.children).length === 0) return;
5799
- filteredSuite.children = filteredSuite.children ?? {};
5800
- filteredSuite.children[title] = filteredSubSuite;
5801
- }
5802
- });
5803
- return filteredSuite;
5804
- }
5805
- function flattenSuite(suite) {
5806
- if (!suite.opened) return [];
5807
- return getChildrenEntries(suite.children).flatMap(([title, subSuite]) => [
5808
- { title, suite: subSuite },
5809
- ...isTest(subSuite) ? [] : flattenSuite(subSuite)
5810
- ]);
5811
- }
5812
- function recalcSuiteStatuses(root10, testPath) {
5813
- const ancestorPaths = testPath.slice(0, -1).map((_, index2, tokens) => tokens.slice(0, tokens.length - index2));
5814
- for (const parentPath of ancestorPaths) {
5815
- const parentSuite = getSuiteByPath(root10, parentPath);
5816
- if (parentSuite && !isTest(parentSuite)) {
5817
- parentSuite.status = getChildrenArray(parentSuite.children).map(({ status }) => status).reduce(calcStatus);
5818
- }
5819
- }
5820
- root10.status = getChildrenArray(root10.children).map(({ status }) => status).reduce(calcStatus);
5821
- }
5822
- function recalcAllSuiteStatuses(suite) {
5823
- for (const child2 of getChildrenArray(suite.children)) {
5824
- if (!isTest(child2)) {
5825
- recalcAllSuiteStatuses(child2);
5826
- }
5827
- }
5828
- suite.status = getChildrenArray(suite.children).map(({ status }) => status).reduce(calcStatus);
5829
- }
5830
-
5831
5557
  // node_modules/zod/v4/classic/external.js
5832
5558
  var external_exports = {};
5833
5559
  __export(external_exports, {
@@ -19505,217 +19231,556 @@ function convertSchema(schema, ctx) {
19505
19231
  const anyOfUnion = z.union(options);
19506
19232
  baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;
19507
19233
  }
19508
- if (schema.oneOf && Array.isArray(schema.oneOf)) {
19509
- const options = schema.oneOf.map((s) => convertSchema(s, ctx));
19510
- const oneOfUnion = z.xor(options);
19511
- baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
19234
+ if (schema.oneOf && Array.isArray(schema.oneOf)) {
19235
+ const options = schema.oneOf.map((s) => convertSchema(s, ctx));
19236
+ const oneOfUnion = z.xor(options);
19237
+ baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;
19238
+ }
19239
+ if (schema.allOf && Array.isArray(schema.allOf)) {
19240
+ if (schema.allOf.length === 0) {
19241
+ baseSchema = hasExplicitType ? baseSchema : z.any();
19242
+ } else {
19243
+ let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
19244
+ const startIdx = hasExplicitType ? 0 : 1;
19245
+ for (let i = startIdx; i < schema.allOf.length; i++) {
19246
+ result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
19247
+ }
19248
+ baseSchema = result;
19249
+ }
19250
+ }
19251
+ if (schema.nullable === true && ctx.version === "openapi-3.0") {
19252
+ baseSchema = z.nullable(baseSchema);
19253
+ }
19254
+ if (schema.readOnly === true) {
19255
+ baseSchema = z.readonly(baseSchema);
19256
+ }
19257
+ const extraMeta = {};
19258
+ const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
19259
+ for (const key2 of coreMetadataKeys) {
19260
+ if (key2 in schema) {
19261
+ extraMeta[key2] = schema[key2];
19262
+ }
19263
+ }
19264
+ const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
19265
+ for (const key2 of contentMetadataKeys) {
19266
+ if (key2 in schema) {
19267
+ extraMeta[key2] = schema[key2];
19268
+ }
19269
+ }
19270
+ for (const key2 of Object.keys(schema)) {
19271
+ if (!RECOGNIZED_KEYS.has(key2)) {
19272
+ extraMeta[key2] = schema[key2];
19273
+ }
19274
+ }
19275
+ if (Object.keys(extraMeta).length > 0) {
19276
+ ctx.registry.add(baseSchema, extraMeta);
19277
+ }
19278
+ return baseSchema;
19279
+ }
19280
+ function fromJSONSchema(schema, params) {
19281
+ if (typeof schema === "boolean") {
19282
+ return schema ? z.any() : z.never();
19283
+ }
19284
+ const version2 = detectVersion(schema, params?.defaultTarget);
19285
+ const defs = schema.$defs || schema.definitions || {};
19286
+ const ctx = {
19287
+ version: version2,
19288
+ defs,
19289
+ refs: /* @__PURE__ */ new Map(),
19290
+ processing: /* @__PURE__ */ new Set(),
19291
+ rootSchema: schema,
19292
+ registry: params?.registry ?? globalRegistry
19293
+ };
19294
+ return convertSchema(schema, ctx);
19295
+ }
19296
+
19297
+ // node_modules/zod/v4/classic/coerce.js
19298
+ var coerce_exports = {};
19299
+ __export(coerce_exports, {
19300
+ bigint: () => bigint3,
19301
+ boolean: () => boolean3,
19302
+ date: () => date4,
19303
+ number: () => number3,
19304
+ string: () => string3
19305
+ });
19306
+ function string3(params) {
19307
+ return _coercedString(ZodString, params);
19308
+ }
19309
+ function number3(params) {
19310
+ return _coercedNumber(ZodNumber, params);
19311
+ }
19312
+ function boolean3(params) {
19313
+ return _coercedBoolean(ZodBoolean, params);
19314
+ }
19315
+ function bigint3(params) {
19316
+ return _coercedBigint(ZodBigInt, params);
19317
+ }
19318
+ function date4(params) {
19319
+ return _coercedDate(ZodDate, params);
19320
+ }
19321
+
19322
+ // node_modules/zod/v4/classic/external.js
19323
+ config(en_default());
19324
+
19325
+ // src/schemas.ts
19326
+ var LocationSchema = external_exports.object({
19327
+ file: external_exports.string(),
19328
+ line: external_exports.number()
19329
+ });
19330
+ var VisualSourceSchema = external_exports.enum(["comparison", "baseline-only", "declared-only"]);
19331
+ var ImagesSchema = external_exports.object({
19332
+ actual: external_exports.string().optional(),
19333
+ expect: external_exports.string().optional(),
19334
+ diff: external_exports.string().optional(),
19335
+ error: external_exports.string().optional(),
19336
+ source: VisualSourceSchema.optional()
19337
+ });
19338
+ var ScreenshotDeclarationSchema = external_exports.discriminatedUnion("kind", [
19339
+ external_exports.object({
19340
+ visualName: external_exports.string(),
19341
+ kind: external_exports.literal("named"),
19342
+ declaredName: external_exports.string(),
19343
+ snapshotBaseName: external_exports.string(),
19344
+ occurrenceIndex: external_exports.number()
19345
+ }),
19346
+ external_exports.object({
19347
+ visualName: external_exports.string(),
19348
+ kind: external_exports.literal("unnamed"),
19349
+ occurrenceIndex: external_exports.number()
19350
+ })
19351
+ ]);
19352
+ var AttachmentSchema = external_exports.object({
19353
+ name: external_exports.string(),
19354
+ path: external_exports.string(),
19355
+ contentType: external_exports.string()
19356
+ });
19357
+ var TestStatusSchema = external_exports.enum(["unknown", "pending", "running", "failed", "approved", "success", "retrying"]);
19358
+ var TestResultStatusSchema = external_exports.enum(["failed", "success", "pending"]);
19359
+ var TestResultSchema = external_exports.object({
19360
+ status: TestResultStatusSchema,
19361
+ retries: external_exports.number(),
19362
+ images: external_exports.record(external_exports.string(), ImagesSchema).optional(),
19363
+ visualDeclarations: external_exports.array(ScreenshotDeclarationSchema).optional(),
19364
+ error: external_exports.string().optional(),
19365
+ duration: external_exports.number().optional()
19366
+ });
19367
+ var TestDataSchema = external_exports.object({
19368
+ id: external_exports.string(),
19369
+ titlePath: external_exports.array(external_exports.string()),
19370
+ browser: external_exports.string(),
19371
+ title: external_exports.string(),
19372
+ skip: external_exports.union([external_exports.boolean(), external_exports.string()]).optional(),
19373
+ retries: external_exports.number().optional(),
19374
+ status: TestStatusSchema.optional(),
19375
+ results: external_exports.array(TestResultSchema).optional(),
19376
+ approved: external_exports.record(external_exports.string(), external_exports.number()).nullable().optional(),
19377
+ attachments: external_exports.array(AttachmentSchema).optional(),
19378
+ location: LocationSchema.optional()
19379
+ });
19380
+ var CrvyRprtrTestSchema = TestDataSchema.extend({
19381
+ checked: external_exports.boolean()
19382
+ });
19383
+ var CrvyRprtrSuiteSchema = external_exports.lazy(
19384
+ () => external_exports.object({
19385
+ path: external_exports.array(external_exports.string()),
19386
+ skip: external_exports.boolean(),
19387
+ status: TestStatusSchema.optional(),
19388
+ opened: external_exports.boolean(),
19389
+ checked: external_exports.boolean(),
19390
+ indeterminate: external_exports.boolean(),
19391
+ children: external_exports.record(external_exports.string(), external_exports.union([CrvyRprtrSuiteSchema, CrvyRprtrTestSchema])).optional()
19392
+ })
19393
+ );
19394
+ var WebSocketMessageSchema = external_exports.object({
19395
+ type: external_exports.enum(["test-begin", "test-end", "run-end", "approve", "sync"]),
19396
+ data: external_exports.unknown()
19397
+ });
19398
+ var TestBeginDataSchema = external_exports.object({
19399
+ id: external_exports.string(),
19400
+ title: external_exports.string(),
19401
+ titlePath: external_exports.array(external_exports.string()),
19402
+ browser: external_exports.string(),
19403
+ location: LocationSchema
19404
+ });
19405
+ var TestEndDataSchema = external_exports.object({
19406
+ id: external_exports.string(),
19407
+ status: external_exports.enum(["passed", "failed", "skipped"]),
19408
+ attachments: external_exports.array(AttachmentSchema),
19409
+ visualNames: external_exports.array(external_exports.string()).default([]),
19410
+ visualDeclarations: external_exports.preprocess(
19411
+ (value) => value === null ? void 0 : value,
19412
+ external_exports.array(ScreenshotDeclarationSchema).optional()
19413
+ ),
19414
+ error: external_exports.string().optional(),
19415
+ duration: external_exports.number().optional()
19416
+ });
19417
+ var ReportDataSchema = external_exports.object({
19418
+ isRunning: external_exports.boolean(),
19419
+ tests: external_exports.record(external_exports.string(), TestDataSchema),
19420
+ browsers: external_exports.array(external_exports.string()),
19421
+ isUpdateMode: external_exports.boolean(),
19422
+ screenshotDir: external_exports.string()
19423
+ });
19424
+ var LoadedReportDataSchema = external_exports.object({
19425
+ tests: external_exports.record(external_exports.string(), TestDataSchema).optional(),
19426
+ isUpdateMode: external_exports.boolean().optional()
19427
+ });
19428
+ var OfflineEventSchema = external_exports.object({
19429
+ type: external_exports.enum(["test-begin", "test-end", "run-end"]),
19430
+ data: external_exports.unknown(),
19431
+ timestamp: external_exports.number(),
19432
+ workerIndex: external_exports.number()
19433
+ });
19434
+ var OfflineReportSchema = external_exports.object({
19435
+ version: external_exports.number(),
19436
+ generatedAt: external_exports.string(),
19437
+ workers: external_exports.number(),
19438
+ events: external_exports.array(OfflineEventSchema)
19439
+ });
19440
+ var ApproveRequestBodySchema = external_exports.object({
19441
+ id: external_exports.string(),
19442
+ retry: external_exports.number(),
19443
+ image: external_exports.string()
19444
+ });
19445
+ var ReportApiResponseSchema = external_exports.object({
19446
+ tests: external_exports.record(external_exports.string(), TestDataSchema),
19447
+ isUpdateMode: external_exports.boolean().optional()
19448
+ });
19449
+ var ClientBootstrapDataSchema = external_exports.object({
19450
+ report: ReportApiResponseSchema.extend({
19451
+ isUpdateMode: external_exports.boolean()
19452
+ }),
19453
+ liveUpdates: external_exports.boolean(),
19454
+ approvalEnabled: external_exports.boolean(),
19455
+ approvalMessage: external_exports.string().optional()
19456
+ });
19457
+ var ImagesViewModeSchema = external_exports.enum(["side-by-side", "swap", "slide", "blend"]);
19458
+ function safeParse3(schema, data) {
19459
+ const result = schema.safeParse(data);
19460
+ if (result.success) {
19461
+ return result.data;
19462
+ }
19463
+ return null;
19464
+ }
19465
+
19466
+ // src/approval-api.ts
19467
+ var ApprovalResponseBodySchema = external_exports.object({
19468
+ success: external_exports.boolean(),
19469
+ error: external_exports.string().optional()
19470
+ });
19471
+ var BulkApprovalResponseBodySchema = external_exports.object({
19472
+ success: external_exports.boolean(),
19473
+ approved: external_exports.number(),
19474
+ unresolved: external_exports.number(),
19475
+ failed: external_exports.number()
19476
+ });
19477
+ var failedApprovalResult = { success: false };
19478
+ var failedBulkApprovalResult = {
19479
+ success: false,
19480
+ approved: 0,
19481
+ unresolved: 0,
19482
+ failed: 0
19483
+ };
19484
+ async function readJsonBody(response) {
19485
+ try {
19486
+ return await response.json();
19487
+ } catch {
19488
+ return null;
19489
+ }
19490
+ }
19491
+ async function readApproveResult(response) {
19492
+ const body = safeParse3(ApprovalResponseBodySchema, await readJsonBody(response));
19493
+ return body !== null && response.ok && body.success ? body : failedApprovalResult;
19494
+ }
19495
+ async function readApproveAllResult(response) {
19496
+ const body = safeParse3(BulkApprovalResponseBodySchema, await readJsonBody(response));
19497
+ if (body === null) {
19498
+ return failedBulkApprovalResult;
19512
19499
  }
19513
- if (schema.allOf && Array.isArray(schema.allOf)) {
19514
- if (schema.allOf.length === 0) {
19515
- baseSchema = hasExplicitType ? baseSchema : z.any();
19500
+ return {
19501
+ success: response.ok && body.success,
19502
+ approved: body.approved,
19503
+ unresolved: body.unresolved,
19504
+ failed: body.failed
19505
+ };
19506
+ }
19507
+ function isBulkApprovalOptimisticSafe(result) {
19508
+ return result.success && result.unresolved === 0 && result.failed === 0;
19509
+ }
19510
+
19511
+ // node_modules/svelte/src/version.js
19512
+ var PUBLIC_VERSION = "5";
19513
+
19514
+ // node_modules/svelte/src/internal/disclose-version.js
19515
+ if (typeof window !== "undefined") {
19516
+ ((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(PUBLIC_VERSION);
19517
+ }
19518
+
19519
+ // src/types.ts
19520
+ function isDefined(value) {
19521
+ return value !== null && value !== void 0;
19522
+ }
19523
+ function isTest(x) {
19524
+ if (x === null || typeof x !== "object") return false;
19525
+ const hasId = "id" in x;
19526
+ const hasTitlePath = "titlePath" in x;
19527
+ return hasId && hasTitlePath && typeof x.id === "string" && Array.isArray(x.titlePath);
19528
+ }
19529
+ function getChildrenArray(children) {
19530
+ if (children === void 0) return [];
19531
+ return Object.values(children).filter(isDefined);
19532
+ }
19533
+ function getChildrenEntries(children) {
19534
+ if (children === void 0) return [];
19535
+ return Object.entries(children).filter((entry) => isDefined(entry[1]));
19536
+ }
19537
+ function getChildrenKeys(children) {
19538
+ if (children === void 0) return [];
19539
+ return Object.keys(children);
19540
+ }
19541
+
19542
+ // src/client/helpers/status.ts
19543
+ var testStatuses = ["unknown", "pending", "running", "failed", "approved", "success", "retrying"];
19544
+ function isTestStatus(value) {
19545
+ return testStatuses.some((s) => s === value);
19546
+ }
19547
+ var statusUpdatesMap = /* @__PURE__ */ new Map([
19548
+ [void 0, /(unknown|success|approved|failed|pending|running)/],
19549
+ ["unknown", /(success|approved|failed|pending|running)/],
19550
+ ["success", /(approved|failed|pending|running)/],
19551
+ ["approved", /(failed|pending|running)/],
19552
+ ["failed", /(pending|running)/],
19553
+ ["pending", /running/],
19554
+ ["running", /(success|approved|failed|pending)/]
19555
+ ]);
19556
+ function calcStatus(oldStatus, newStatus) {
19557
+ return newStatus !== void 0 && statusUpdatesMap.get(oldStatus)?.test(newStatus) === true ? newStatus : oldStatus;
19558
+ }
19559
+ function countTestsStatus(suite) {
19560
+ let successCount = 0;
19561
+ let failedCount = 0;
19562
+ let approvedCount = 0;
19563
+ let pendingCount = 0;
19564
+ const cases = getChildrenArray(suite.children);
19565
+ let suiteOrTest;
19566
+ while (suiteOrTest = cases.pop()) {
19567
+ if (isTest(suiteOrTest)) {
19568
+ if (!hasScreenshots(suiteOrTest)) continue;
19569
+ if (suiteOrTest.status === "approved") approvedCount++;
19570
+ if (suiteOrTest.status === "success") successCount++;
19571
+ if (suiteOrTest.status === "failed") failedCount++;
19572
+ if (suiteOrTest.status === "pending") pendingCount++;
19516
19573
  } else {
19517
- let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);
19518
- const startIdx = hasExplicitType ? 0 : 1;
19519
- for (let i = startIdx; i < schema.allOf.length; i++) {
19520
- result = z.intersection(result, convertSchema(schema.allOf[i], ctx));
19521
- }
19522
- baseSchema = result;
19574
+ cases.push(...getChildrenArray(suiteOrTest.children));
19523
19575
  }
19524
19576
  }
19525
- if (schema.nullable === true && ctx.version === "openapi-3.0") {
19526
- baseSchema = z.nullable(baseSchema);
19527
- }
19528
- if (schema.readOnly === true) {
19529
- baseSchema = z.readonly(baseSchema);
19577
+ return { approvedCount, successCount, failedCount, pendingCount };
19578
+ }
19579
+ function getFailedTests(suite) {
19580
+ return getChildrenArray(suite.children).flatMap((suiteOrTest) => {
19581
+ if (isTest(suiteOrTest)) return suiteOrTest.status === "failed" ? suiteOrTest : [];
19582
+ return getFailedTests(suiteOrTest);
19583
+ });
19584
+ }
19585
+ function hasScreenshots(item) {
19586
+ if (isTest(item)) {
19587
+ return item.results?.some((r2) => r2.images !== void 0 && Object.keys(r2.images).length > 0) ?? false;
19530
19588
  }
19531
- const extraMeta = {};
19532
- const coreMetadataKeys = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
19533
- for (const key2 of coreMetadataKeys) {
19534
- if (key2 in schema) {
19535
- extraMeta[key2] = schema[key2];
19536
- }
19589
+ return getChildrenArray(item.children).some((child2) => hasScreenshots(child2));
19590
+ }
19591
+
19592
+ // src/client/helpers/path.ts
19593
+ function getTestPath(test) {
19594
+ return [...test.titlePath, test.title, test.browser].filter(isDefined);
19595
+ }
19596
+ function getSuiteByPath(suite, path) {
19597
+ return path.reduce(
19598
+ (suiteOrTest, pathToken) => isTest(suiteOrTest) ? suiteOrTest : suiteOrTest?.children?.[pathToken],
19599
+ suite
19600
+ );
19601
+ }
19602
+ function getTestByPath(suite, path) {
19603
+ const test = getSuiteByPath(suite, path) ?? suite;
19604
+ return isTest(test) ? test : null;
19605
+ }
19606
+ function setSearchParams(testPath) {
19607
+ const params = new URLSearchParams();
19608
+ testPath.forEach((p, i) => {
19609
+ params.set(`testPath[${i}]`, p);
19610
+ });
19611
+ window.history.pushState({ testPath }, "", `?${params.toString()}`);
19612
+ }
19613
+ function getTestPathFromSearch() {
19614
+ const params = new URLSearchParams(window.location.search);
19615
+ const path = [];
19616
+ let i = 0;
19617
+ while (params.has(`testPath[${i}]`)) {
19618
+ path.push(params.get(`testPath[${i}]`));
19619
+ i++;
19537
19620
  }
19538
- const contentMetadataKeys = ["contentEncoding", "contentMediaType", "contentSchema"];
19539
- for (const key2 of contentMetadataKeys) {
19540
- if (key2 in schema) {
19541
- extraMeta[key2] = schema[key2];
19621
+ return path;
19622
+ }
19623
+ function parseFilterString(value) {
19624
+ let status = null;
19625
+ const subStrings = [];
19626
+ value.split(" ").filter((s) => s !== "").map((word) => word.toLowerCase()).forEach((word) => {
19627
+ const match = /^status:(failed|success|pending|approved)$/i.exec(word);
19628
+ if (match !== null) {
19629
+ const matchedStatus = match[1];
19630
+ if (matchedStatus !== void 0 && isTestStatus(matchedStatus)) {
19631
+ status = matchedStatus;
19632
+ return;
19633
+ }
19542
19634
  }
19543
- }
19544
- for (const key2 of Object.keys(schema)) {
19545
- if (!RECOGNIZED_KEYS.has(key2)) {
19546
- extraMeta[key2] = schema[key2];
19635
+ subStrings.push(word);
19636
+ });
19637
+ return { status, subStrings };
19638
+ }
19639
+ function treeifyTests(testsById) {
19640
+ const rootSuite = {
19641
+ path: [],
19642
+ skip: false,
19643
+ opened: true,
19644
+ checked: true,
19645
+ indeterminate: false,
19646
+ children: {}
19647
+ };
19648
+ Object.values(testsById).forEach((test) => {
19649
+ if (test === void 0) return;
19650
+ const titlePath = test.titlePath ?? [];
19651
+ const browser = test.browser ?? "";
19652
+ const title = test.title;
19653
+ const pathParts = [...titlePath, title, browser].filter((p) => p !== void 0 && p !== "");
19654
+ const [browserName, ...testPathParts] = pathParts.reverse();
19655
+ if (browserName === void 0) return;
19656
+ const lastSuite = testPathParts.reverse().reduce((suite, token) => {
19657
+ suite.children = suite.children ?? {};
19658
+ suite.children[token] ??= {
19659
+ path: [...suite.path, token],
19660
+ skip: false,
19661
+ opened: false,
19662
+ checked: true,
19663
+ indeterminate: false,
19664
+ children: {}
19665
+ };
19666
+ const subSuite = suite.children[token];
19667
+ if (subSuite === void 0 || isTest(subSuite)) return suite;
19668
+ subSuite.status = calcStatus(subSuite.status, test.status);
19669
+ suite.status = calcStatus(suite.status, subSuite.status);
19670
+ if (test.skip === false) subSuite.skip = false;
19671
+ return subSuite;
19672
+ }, rootSuite);
19673
+ lastSuite.children = lastSuite.children ?? {};
19674
+ lastSuite.children[browserName] = {
19675
+ ...test,
19676
+ checked: true
19677
+ };
19678
+ });
19679
+ return rootSuite;
19680
+ }
19681
+ function mergeTreeState(target, source2) {
19682
+ target.opened = source2.opened;
19683
+ target.checked = source2.checked;
19684
+ target.indeterminate = source2.indeterminate;
19685
+ for (const [key2, targetChild] of getChildrenEntries(target.children)) {
19686
+ const sourceChild = source2.children?.[key2];
19687
+ if (targetChild === void 0 || sourceChild === void 0) continue;
19688
+ if (!isTest(targetChild) && !isTest(sourceChild)) {
19689
+ mergeTreeState(targetChild, sourceChild);
19690
+ } else if (isTest(targetChild) && isTest(sourceChild)) {
19691
+ targetChild.checked = sourceChild.checked;
19547
19692
  }
19548
19693
  }
19549
- if (Object.keys(extraMeta).length > 0) {
19550
- ctx.registry.add(baseSchema, extraMeta);
19551
- }
19552
- return baseSchema;
19553
19694
  }
19554
- function fromJSONSchema(schema, params) {
19555
- if (typeof schema === "boolean") {
19556
- return schema ? z.any() : z.never();
19695
+
19696
+ // src/client/helpers/suite.ts
19697
+ function checkTests(suiteOrTest, checked) {
19698
+ suiteOrTest.checked = checked;
19699
+ if (!isTest(suiteOrTest)) {
19700
+ suiteOrTest.indeterminate = false;
19701
+ getChildrenArray(suiteOrTest.children).forEach((child2) => {
19702
+ checkTests(child2, checked);
19703
+ });
19557
19704
  }
19558
- const version2 = detectVersion(schema, params?.defaultTarget);
19559
- const defs = schema.$defs || schema.definitions || {};
19560
- const ctx = {
19561
- version: version2,
19562
- defs,
19563
- refs: /* @__PURE__ */ new Map(),
19564
- processing: /* @__PURE__ */ new Set(),
19565
- rootSchema: schema,
19566
- registry: params?.registry ?? globalRegistry
19567
- };
19568
- return convertSchema(schema, ctx);
19569
19705
  }
19570
-
19571
- // node_modules/zod/v4/classic/coerce.js
19572
- var coerce_exports = {};
19573
- __export(coerce_exports, {
19574
- bigint: () => bigint3,
19575
- boolean: () => boolean3,
19576
- date: () => date4,
19577
- number: () => number3,
19578
- string: () => string3
19579
- });
19580
- function string3(params) {
19581
- return _coercedString(ZodString, params);
19706
+ function updateChecked(suite) {
19707
+ const children = getChildrenArray(suite.children).filter((child2) => child2.skip === false);
19708
+ const checkedEvery = children.every((test) => test.checked);
19709
+ const checkedSome = children.some((test) => test.checked);
19710
+ const indeterminate = children.some((test) => isTest(test) ? false : test.indeterminate) || !checkedEvery && checkedSome;
19711
+ const checked = indeterminate || suite.checked === checkedEvery ? suite.checked : checkedEvery;
19712
+ suite.checked = checked;
19713
+ suite.indeterminate = indeterminate;
19582
19714
  }
19583
- function number3(params) {
19584
- return _coercedNumber(ZodNumber, params);
19715
+ function checkSuite(suite, path, checked) {
19716
+ const subSuite = getSuiteByPath(suite, path);
19717
+ if (subSuite) checkTests(subSuite, checked);
19718
+ path.slice(0, -1).map((_, index2, tokens) => tokens.slice(0, tokens.length - index2)).forEach((parentPath) => {
19719
+ const parentSuite = getSuiteByPath(suite, parentPath);
19720
+ if (isTest(parentSuite)) return;
19721
+ if (parentSuite) updateChecked(parentSuite);
19722
+ });
19723
+ updateChecked(suite);
19585
19724
  }
19586
- function boolean3(params) {
19587
- return _coercedBoolean(ZodBoolean, params);
19725
+ function openSuite(suite, path, opened) {
19726
+ const subSuite = path.reduce(
19727
+ (suiteOrTest, pathToken) => {
19728
+ if (suiteOrTest && !isTest(suiteOrTest)) {
19729
+ if (opened) suiteOrTest.opened = opened;
19730
+ return suiteOrTest.children?.[pathToken];
19731
+ }
19732
+ },
19733
+ suite
19734
+ );
19735
+ if (subSuite && !isTest(subSuite)) subSuite.opened = opened;
19588
19736
  }
19589
- function bigint3(params) {
19590
- return _coercedBigint(ZodBigInt, params);
19737
+ function filterTests(suite, filter) {
19738
+ const { status, subStrings } = filter;
19739
+ if (!status && !subStrings.length) return suite;
19740
+ const filteredSuite = { ...suite, children: {} };
19741
+ getChildrenEntries(suite.children).forEach(([title, suiteOrTest]) => {
19742
+ if (suiteOrTest.skip === true) return;
19743
+ if (!status && subStrings.some((sub) => title.toLowerCase().includes(sub))) {
19744
+ filteredSuite.children = filteredSuite.children ?? {};
19745
+ filteredSuite.children[title] = suiteOrTest;
19746
+ } else if (isTest(suiteOrTest)) {
19747
+ if (status && suiteOrTest.status && ["pending", "running", status].includes(suiteOrTest.status)) {
19748
+ filteredSuite.children = filteredSuite.children ?? {};
19749
+ filteredSuite.children[title] = suiteOrTest;
19750
+ }
19751
+ } else {
19752
+ const filteredSubSuite = filterTests(suiteOrTest, filter);
19753
+ if (getChildrenKeys(filteredSubSuite.children).length === 0) return;
19754
+ filteredSuite.children = filteredSuite.children ?? {};
19755
+ filteredSuite.children[title] = filteredSubSuite;
19756
+ }
19757
+ });
19758
+ return filteredSuite;
19591
19759
  }
19592
- function date4(params) {
19593
- return _coercedDate(ZodDate, params);
19760
+ function flattenSuite(suite) {
19761
+ if (!suite.opened) return [];
19762
+ return getChildrenEntries(suite.children).flatMap(([title, subSuite]) => [
19763
+ { title, suite: subSuite },
19764
+ ...isTest(subSuite) ? [] : flattenSuite(subSuite)
19765
+ ]);
19594
19766
  }
19595
-
19596
- // node_modules/zod/v4/classic/external.js
19597
- config(en_default());
19598
-
19599
- // src/schemas.ts
19600
- var LocationSchema = external_exports.object({
19601
- file: external_exports.string(),
19602
- line: external_exports.number()
19603
- });
19604
- var VisualSourceSchema = external_exports.enum(["comparison", "baseline-only", "declared-only"]);
19605
- var ImagesSchema = external_exports.object({
19606
- actual: external_exports.string().optional(),
19607
- expect: external_exports.string().optional(),
19608
- diff: external_exports.string().optional(),
19609
- error: external_exports.string().optional(),
19610
- source: VisualSourceSchema.optional()
19611
- });
19612
- var AttachmentSchema = external_exports.object({
19613
- name: external_exports.string(),
19614
- path: external_exports.string(),
19615
- contentType: external_exports.string()
19616
- });
19617
- var TestStatusSchema = external_exports.enum(["unknown", "pending", "running", "failed", "approved", "success", "retrying"]);
19618
- var TestResultStatusSchema = external_exports.enum(["failed", "success", "pending"]);
19619
- var TestResultSchema = external_exports.object({
19620
- status: TestResultStatusSchema,
19621
- retries: external_exports.number(),
19622
- images: external_exports.record(external_exports.string(), ImagesSchema).optional(),
19623
- error: external_exports.string().optional(),
19624
- duration: external_exports.number().optional()
19625
- });
19626
- var TestDataSchema = external_exports.object({
19627
- id: external_exports.string(),
19628
- titlePath: external_exports.array(external_exports.string()),
19629
- browser: external_exports.string(),
19630
- title: external_exports.string(),
19631
- skip: external_exports.union([external_exports.boolean(), external_exports.string()]).optional(),
19632
- retries: external_exports.number().optional(),
19633
- status: TestStatusSchema.optional(),
19634
- results: external_exports.array(TestResultSchema).optional(),
19635
- approved: external_exports.record(external_exports.string(), external_exports.number()).nullable().optional(),
19636
- attachments: external_exports.array(AttachmentSchema).optional(),
19637
- location: LocationSchema.optional()
19638
- });
19639
- var CrvyRprtrTestSchema = TestDataSchema.extend({
19640
- checked: external_exports.boolean()
19641
- });
19642
- var CrvyRprtrSuiteSchema = external_exports.lazy(
19643
- () => external_exports.object({
19644
- path: external_exports.array(external_exports.string()),
19645
- skip: external_exports.boolean(),
19646
- status: TestStatusSchema.optional(),
19647
- opened: external_exports.boolean(),
19648
- checked: external_exports.boolean(),
19649
- indeterminate: external_exports.boolean(),
19650
- children: external_exports.record(external_exports.string(), external_exports.union([CrvyRprtrSuiteSchema, CrvyRprtrTestSchema])).optional()
19651
- })
19652
- );
19653
- var WebSocketMessageSchema = external_exports.object({
19654
- type: external_exports.enum(["test-begin", "test-end", "run-end", "approve", "sync"]),
19655
- data: external_exports.unknown()
19656
- });
19657
- var TestBeginDataSchema = external_exports.object({
19658
- id: external_exports.string(),
19659
- title: external_exports.string(),
19660
- titlePath: external_exports.array(external_exports.string()),
19661
- browser: external_exports.string(),
19662
- location: LocationSchema
19663
- });
19664
- var TestEndDataSchema = external_exports.object({
19665
- id: external_exports.string(),
19666
- status: external_exports.enum(["passed", "failed", "skipped"]),
19667
- attachments: external_exports.array(AttachmentSchema),
19668
- visualNames: external_exports.array(external_exports.string()).default([]),
19669
- error: external_exports.string().optional(),
19670
- duration: external_exports.number().optional()
19671
- });
19672
- var ReportDataSchema = external_exports.object({
19673
- isRunning: external_exports.boolean(),
19674
- tests: external_exports.record(external_exports.string(), TestDataSchema),
19675
- browsers: external_exports.array(external_exports.string()),
19676
- isUpdateMode: external_exports.boolean(),
19677
- screenshotDir: external_exports.string()
19678
- });
19679
- var LoadedReportDataSchema = external_exports.object({
19680
- tests: external_exports.record(external_exports.string(), TestDataSchema).optional(),
19681
- isUpdateMode: external_exports.boolean().optional()
19682
- });
19683
- var OfflineEventSchema = external_exports.object({
19684
- type: external_exports.enum(["test-begin", "test-end", "run-end"]),
19685
- data: external_exports.unknown(),
19686
- timestamp: external_exports.number(),
19687
- workerIndex: external_exports.number()
19688
- });
19689
- var OfflineReportSchema = external_exports.object({
19690
- version: external_exports.number(),
19691
- generatedAt: external_exports.string(),
19692
- workers: external_exports.number(),
19693
- events: external_exports.array(OfflineEventSchema)
19694
- });
19695
- var ApproveRequestBodySchema = external_exports.object({
19696
- id: external_exports.string(),
19697
- retry: external_exports.number(),
19698
- image: external_exports.string()
19699
- });
19700
- var ReportApiResponseSchema = external_exports.object({
19701
- tests: external_exports.record(external_exports.string(), TestDataSchema),
19702
- isUpdateMode: external_exports.boolean().optional()
19703
- });
19704
- var ClientBootstrapDataSchema = external_exports.object({
19705
- report: ReportApiResponseSchema.extend({
19706
- isUpdateMode: external_exports.boolean()
19707
- }),
19708
- liveUpdates: external_exports.boolean(),
19709
- approvalEnabled: external_exports.boolean(),
19710
- approvalMessage: external_exports.string().optional()
19711
- });
19712
- var ImagesViewModeSchema = external_exports.enum(["side-by-side", "swap", "slide", "blend"]);
19713
- function safeParse3(schema, data) {
19714
- const result = schema.safeParse(data);
19715
- if (result.success) {
19716
- return result.data;
19767
+ function recalcSuiteStatuses(root10, testPath) {
19768
+ const ancestorPaths = testPath.slice(0, -1).map((_, index2, tokens) => tokens.slice(0, tokens.length - index2));
19769
+ for (const parentPath of ancestorPaths) {
19770
+ const parentSuite = getSuiteByPath(root10, parentPath);
19771
+ if (parentSuite && !isTest(parentSuite)) {
19772
+ parentSuite.status = getChildrenArray(parentSuite.children).map(({ status }) => status).reduce(calcStatus);
19773
+ }
19717
19774
  }
19718
- return null;
19775
+ root10.status = getChildrenArray(root10.children).map(({ status }) => status).reduce(calcStatus);
19776
+ }
19777
+ function recalcAllSuiteStatuses(suite) {
19778
+ for (const child2 of getChildrenArray(suite.children)) {
19779
+ if (!isTest(child2)) {
19780
+ recalcAllSuiteStatuses(child2);
19781
+ }
19782
+ }
19783
+ suite.status = getChildrenArray(suite.children).map(({ status }) => status).reduce(calcStatus);
19719
19784
  }
19720
19785
 
19721
19786
  // src/client/viewMode.ts
@@ -20218,10 +20283,9 @@ function SlideView($$anchor, $$props) {
20218
20283
  delegate(["input"]);
20219
20284
 
20220
20285
  // src/client/components/SideBySideView.svelte
20221
- var root_24 = from_html(`<div class="px-3 py-2 text-xs text-fg-muted border-t border-edge/70">Copied from the snapshot on disk.</div>`);
20222
- var root_14 = from_html(`<div class="flex-1 flex flex-col bg-surface-panel rounded-md overflow-hidden min-w-0 border-2 border-green-500/60"><h3 class="m-0 px-3 py-2 text-xs font-bold bg-green-500/25 text-green-800 dark:text-green-200 uppercase tracking-wider"> </h3> <div class="flex items-center justify-center p-2"><img alt="Expected" class="w-auto max-w-full object-contain mx-auto" loading="lazy"/></div> <!></div>`);
20223
- var root_32 = from_html(`<div class="flex-1 flex flex-col bg-surface-panel rounded-md overflow-hidden min-w-0 border-2 border-yellow-500/60"><h3 class="m-0 px-3 py-2 text-xs font-bold bg-yellow-500/25 text-yellow-800 dark:text-yellow-200 uppercase tracking-wider">Diff</h3> <div class="flex items-center justify-center p-2"><img alt="Diff" class="w-auto max-w-full object-contain mx-auto" loading="lazy"/></div></div>`);
20224
- var root_42 = from_html(`<div class="flex-1 flex flex-col bg-surface-panel rounded-md overflow-hidden min-w-0 border-2 border-red-500/60"><h3 class="m-0 px-3 py-2 text-xs font-bold bg-red-500/25 text-red-800 dark:text-red-200 uppercase tracking-wider">Actual</h3> <div class="flex items-center justify-center p-2"><img alt="Actual" class="w-auto max-w-full object-contain mx-auto" loading="lazy"/></div></div>`);
20286
+ var root_14 = from_html(`<div class="flex-1 flex flex-col bg-surface-panel rounded-md overflow-hidden min-w-0 border-2 border-green-500/60"><h3 class="m-0 px-3 py-2 text-xs font-bold bg-green-500/25 text-green-800 dark:text-green-200 uppercase tracking-wider"> </h3> <div class="flex items-center justify-center p-2"><img alt="Expected" class="w-auto max-w-full object-contain mx-auto" loading="lazy"/></div></div>`);
20287
+ var root_24 = from_html(`<div class="flex-1 flex flex-col bg-surface-panel rounded-md overflow-hidden min-w-0 border-2 border-yellow-500/60"><h3 class="m-0 px-3 py-2 text-xs font-bold bg-yellow-500/25 text-yellow-800 dark:text-yellow-200 uppercase tracking-wider">Diff</h3> <div class="flex items-center justify-center p-2"><img alt="Diff" class="w-auto max-w-full object-contain mx-auto" loading="lazy"/></div></div>`);
20288
+ var root_32 = from_html(`<div class="flex-1 flex flex-col bg-surface-panel rounded-md overflow-hidden min-w-0 border-2 border-red-500/60"><h3 class="m-0 px-3 py-2 text-xs font-bold bg-red-500/25 text-red-800 dark:text-red-200 uppercase tracking-wider">Actual</h3> <div class="flex items-center justify-center p-2"><img alt="Actual" class="w-auto max-w-full object-contain mx-auto" loading="lazy"/></div></div>`);
20225
20289
  var root3 = from_html(`<div><!> <!> <!></div>`);
20226
20290
  function SideBySideView($$anchor, $$props) {
20227
20291
  push($$props, true);
@@ -20242,7 +20306,7 @@ function SideBySideView($$anchor, $$props) {
20242
20306
  let classes;
20243
20307
  var node = child(div);
20244
20308
  {
20245
- var consequent_1 = ($$anchor2) => {
20309
+ var consequent = ($$anchor2) => {
20246
20310
  var div_1 = root_14();
20247
20311
  var h3 = child(div_1);
20248
20312
  var text2 = child(h3, true);
@@ -20250,16 +20314,6 @@ function SideBySideView($$anchor, $$props) {
20250
20314
  var div_2 = sibling(h3, 2);
20251
20315
  var img_1 = child(div_2);
20252
20316
  reset(div_2);
20253
- var node_1 = sibling(div_2, 2);
20254
- {
20255
- var consequent = ($$anchor3) => {
20256
- var div_3 = root_24();
20257
- append($$anchor3, div_3);
20258
- };
20259
- if_block(node_1, ($$render) => {
20260
- if ($$props.image.source === "baseline-only" && !$$props.image.actual && !$$props.image.diff) $$render(consequent);
20261
- });
20262
- }
20263
20317
  reset(div_1);
20264
20318
  template_effect(() => {
20265
20319
  set_text(text2, get2(expectedLabel));
@@ -20268,37 +20322,37 @@ function SideBySideView($$anchor, $$props) {
20268
20322
  append($$anchor2, div_1);
20269
20323
  };
20270
20324
  if_block(node, ($$render) => {
20271
- if ($$props.image.expect) $$render(consequent_1);
20325
+ if ($$props.image.expect) $$render(consequent);
20272
20326
  });
20273
20327
  }
20274
- var node_2 = sibling(node, 2);
20328
+ var node_1 = sibling(node, 2);
20275
20329
  {
20276
- var consequent_2 = ($$anchor2) => {
20277
- var div_4 = root_32();
20278
- var div_5 = sibling(child(div_4), 2);
20279
- var img_2 = child(div_5);
20280
- reset(div_5);
20330
+ var consequent_1 = ($$anchor2) => {
20331
+ var div_3 = root_24();
20332
+ var div_4 = sibling(child(div_3), 2);
20333
+ var img_2 = child(div_4);
20281
20334
  reset(div_4);
20335
+ reset(div_3);
20282
20336
  template_effect(() => set_attribute2(img_2, "src", $$props.image.diff));
20283
- append($$anchor2, div_4);
20337
+ append($$anchor2, div_3);
20284
20338
  };
20285
- if_block(node_2, ($$render) => {
20286
- if ($$props.image.diff) $$render(consequent_2);
20339
+ if_block(node_1, ($$render) => {
20340
+ if ($$props.image.diff) $$render(consequent_1);
20287
20341
  });
20288
20342
  }
20289
- var node_3 = sibling(node_2, 2);
20343
+ var node_2 = sibling(node_1, 2);
20290
20344
  {
20291
- var consequent_3 = ($$anchor2) => {
20292
- var div_6 = root_42();
20293
- var div_7 = sibling(child(div_6), 2);
20294
- var img_3 = child(div_7);
20295
- reset(div_7);
20345
+ var consequent_2 = ($$anchor2) => {
20346
+ var div_5 = root_32();
20347
+ var div_6 = sibling(child(div_5), 2);
20348
+ var img_3 = child(div_6);
20296
20349
  reset(div_6);
20350
+ reset(div_5);
20297
20351
  template_effect(() => set_attribute2(img_3, "src", $$props.image.actual));
20298
- append($$anchor2, div_6);
20352
+ append($$anchor2, div_5);
20299
20353
  };
20300
- if_block(node_3, ($$render) => {
20301
- if ($$props.image.actual) $$render(consequent_3);
20354
+ if_block(node_2, ($$render) => {
20355
+ if ($$props.image.actual) $$render(consequent_2);
20302
20356
  });
20303
20357
  }
20304
20358
  reset(div);
@@ -20445,20 +20499,17 @@ function BlendView($$anchor, $$props) {
20445
20499
 
20446
20500
  // src/client/components/ResultsPage.svelte
20447
20501
  var root_27 = from_html(`<button> </button>`);
20448
- var root_43 = from_html(`<button> </button>`);
20502
+ var root_42 = from_html(`<button> </button>`);
20449
20503
  var root_34 = from_html(`<div class="flex gap-1 flex-wrap justify-center mt-1"></div>`);
20450
20504
  var root_52 = from_html(`<div class="flex-1 flex items-center justify-center text-fg-muted text-base">No image to display</div>`);
20451
20505
  var root_62 = from_html(`<div class="max-w-xl w-full rounded-md border border-edge bg-surface-panel px-5 py-6 text-center"><h3 class="m-0 text-sm font-semibold text-fg-bright uppercase tracking-wide">Passed Visual Assertion</h3> <p class="mt-3 text-sm leading-6 text-fg-muted">Playwright reported this screenshot assertion, but did not emit an actual, expected, or diff artifact for the passing comparison.</p></div>`);
20452
- var root_82 = from_html(`<div class="mx-auto max-w-2xl w-full rounded-md border border-info/40 bg-info/10 px-4 py-3 text-sm text-fg">Baseline copied from the stored snapshot. Playwright did not emit a passed actual image for this comparison.</div>`);
20453
- var root_7 = from_html(`<div class="w-full flex flex-col gap-3"><!> <!></div>`);
20454
- var root_112 = from_html(`<div class="mx-auto max-w-2xl w-full rounded-md border border-info/40 bg-info/10 px-4 py-3 text-sm text-fg">Baseline copied from the stored snapshot. Playwright did not emit a passed actual image for this comparison.</div>`);
20455
- var root_132 = from_html(`<div class="flex flex-col bg-surface-panel rounded-md overflow-hidden min-w-0 border-2 border-red-500/60"><h3 class="m-0 px-3 py-2 text-xs font-bold bg-red-500/25 text-red-800 dark:text-red-200 uppercase tracking-wider">Actual</h3> <div class="flex items-center justify-center p-2"><img alt="Actual" class="w-auto max-w-full object-contain mx-auto" loading="lazy"/></div></div>`);
20456
- var root_102 = from_html(`<div class="flex flex-col gap-3"><!> <!></div>`);
20457
- var root_152 = from_html(`<div class="mx-auto max-w-2xl w-full rounded-md border border-info/40 bg-info/10 px-4 py-3 text-sm text-fg">Baseline copied from the stored snapshot. Playwright did not emit a passed actual image for this comparison.</div>`);
20458
- var root_142 = from_html(`<div class="w-full flex flex-col gap-3"><!> <!></div>`);
20459
- var root_18 = from_html(`<button> </button>`);
20460
- var root_19 = from_html(`<span class="px-1 text-fg-muted text-xs"></span>`);
20461
- var root_162 = from_html(`<div class="py-2 px-5 bg-surface-alt border-t border-edge flex items-center justify-center gap-1 shrink-0"><button aria-label="Previous retry">&#8249;</button> <div class="flex gap-0.5 items-center"></div> <button aria-label="Next retry">&#8250;</button></div>`);
20506
+ var root_7 = from_html(`<div class="w-full flex flex-col gap-3"><!></div>`);
20507
+ var root_112 = from_html(`<div class="flex flex-col bg-surface-panel rounded-md overflow-hidden min-w-0 border-2 border-red-500/60"><h3 class="m-0 px-3 py-2 text-xs font-bold bg-red-500/25 text-red-800 dark:text-red-200 uppercase tracking-wider">Actual</h3> <div class="flex items-center justify-center p-2"><img alt="Actual" class="w-auto max-w-full object-contain mx-auto" loading="lazy"/></div></div>`);
20508
+ var root_92 = from_html(`<div class="flex flex-col gap-3"><!></div>`);
20509
+ var root_122 = from_html(`<div class="w-full flex flex-col gap-3"><!></div>`);
20510
+ var root_152 = from_html(`<button> </button>`);
20511
+ var root_162 = from_html(`<span class="px-1 text-fg-muted text-xs"></span>`);
20512
+ var root_132 = from_html(`<div class="py-2 px-5 bg-surface-alt border-t border-edge flex items-center justify-center gap-1 shrink-0"><button aria-label="Previous retry">&#8249;</button> <div class="flex gap-0.5 items-center"></div> <button aria-label="Next retry">&#8250;</button></div>`);
20462
20513
  var root6 = from_html(`<div class="flex flex-col h-full"><div class="py-3 px-5 max-md:px-3 bg-surface-alt border-b border-edge flex items-center gap-2 shrink-0"><div class="flex shrink-0 mr-3"><!></div> <div class="flex-1 flex flex-col items-center min-w-0 pr-10"><h2 class="text-base text-fg-bright m-0 font-medium whitespace-nowrap overflow-hidden text-ellipsis text-pretty max-w-full"> </h2> <!></div></div> <div class="flex-1 overflow-auto min-h-0"><div class="min-h-full p-4 max-md:p-2 flex justify-center items-center"><!></div></div> <!></div>`);
20463
20514
  function ResultsPage($$anchor, $$props) {
20464
20515
  push($$props, true);
@@ -20467,7 +20518,6 @@ function ResultsPage($$anchor, $$props) {
20467
20518
  let imageNames = user_derived(() => get2(result)?.images ? Object.keys(get2(result).images) : []);
20468
20519
  let totalRetries = user_derived(() => $$props.test.results?.length ?? 0);
20469
20520
  let hasDiffAndExpect = user_derived(() => Boolean(get2(image)?.diff && get2(image)?.expect));
20470
- let isBaselineOnly = user_derived(() => get2(image)?.source === "baseline-only");
20471
20521
  let isDeclaredOnly = user_derived(() => get2(image)?.source === "declared-only");
20472
20522
  let imagesWithError = user_derived(() => get2(result)?.images ? Object.keys(get2(result).images).filter((name) => get2(result).status !== "success" && $$props.test.approved?.[name] !== $$props.retry - 1 && get2(result).images?.[name]?.diff !== null) : []);
20473
20523
  let imagesApproved = user_derived(() => get2(result)?.images ? Object.keys(get2(result).images).filter((name) => $$props.test.approved?.[name] === $$props.retry - 1) : []);
@@ -20529,7 +20579,7 @@ function ResultsPage($$anchor, $$props) {
20529
20579
  var consequent_1 = ($$anchor2) => {
20530
20580
  var div_4 = root_34();
20531
20581
  each(div_4, 21, () => get2(imageNames), index, ($$anchor3, name) => {
20532
- var button_1 = root_43();
20582
+ var button_1 = root_42();
20533
20583
  var text_2 = child(button_1, true);
20534
20584
  reset(button_1);
20535
20585
  template_effect(
@@ -20565,20 +20615,10 @@ function ResultsPage($$anchor, $$props) {
20565
20615
  var div_8 = root_62();
20566
20616
  append($$anchor2, div_8);
20567
20617
  };
20568
- var consequent_5 = ($$anchor2) => {
20618
+ var consequent_4 = ($$anchor2) => {
20569
20619
  var div_9 = root_7();
20570
20620
  var node_4 = child(div_9);
20571
- {
20572
- var consequent_4 = ($$anchor3) => {
20573
- var div_10 = root_82();
20574
- append($$anchor3, div_10);
20575
- };
20576
- if_block(node_4, ($$render) => {
20577
- if (get2(isBaselineOnly)) $$render(consequent_4);
20578
- });
20579
- }
20580
- var node_5 = sibling(node_4, 2);
20581
- SideBySideView(node_5, {
20621
+ SideBySideView(node_4, {
20582
20622
  get image() {
20583
20623
  return get2(image);
20584
20624
  }
@@ -20586,28 +20626,18 @@ function ResultsPage($$anchor, $$props) {
20586
20626
  reset(div_9);
20587
20627
  append($$anchor2, div_9);
20588
20628
  };
20589
- var consequent_6 = ($$anchor2) => {
20629
+ var consequent_5 = ($$anchor2) => {
20590
20630
  SwapView($$anchor2, {
20591
20631
  get image() {
20592
20632
  return get2(image);
20593
20633
  }
20594
20634
  });
20595
20635
  };
20596
- var consequent_10 = ($$anchor2) => {
20597
- var div_11 = root_102();
20598
- var node_6 = child(div_11);
20599
- {
20600
- var consequent_7 = ($$anchor3) => {
20601
- var div_12 = root_112();
20602
- append($$anchor3, div_12);
20603
- };
20604
- if_block(node_6, ($$render) => {
20605
- if (get2(isBaselineOnly)) $$render(consequent_7);
20606
- });
20607
- }
20608
- var node_7 = sibling(node_6, 2);
20636
+ var consequent_8 = ($$anchor2) => {
20637
+ var div_10 = root_92();
20638
+ var node_5 = child(div_10);
20609
20639
  {
20610
- var consequent_8 = ($$anchor3) => {
20640
+ var consequent_6 = ($$anchor3) => {
20611
20641
  SlideView($$anchor3, {
20612
20642
  get actual() {
20613
20643
  return get2(image).actual;
@@ -20620,67 +20650,57 @@ function ResultsPage($$anchor, $$props) {
20620
20650
  }
20621
20651
  });
20622
20652
  };
20623
- var consequent_9 = ($$anchor3) => {
20624
- var div_13 = root_132();
20625
- var div_14 = sibling(child(div_13), 2);
20626
- var img = child(div_14);
20627
- reset(div_14);
20628
- reset(div_13);
20653
+ var consequent_7 = ($$anchor3) => {
20654
+ var div_11 = root_112();
20655
+ var div_12 = sibling(child(div_11), 2);
20656
+ var img = child(div_12);
20657
+ reset(div_12);
20658
+ reset(div_11);
20629
20659
  template_effect(() => set_attribute2(img, "src", get2(image).actual));
20630
- append($$anchor3, div_13);
20660
+ append($$anchor3, div_11);
20631
20661
  };
20632
- if_block(node_7, ($$render) => {
20633
- if (get2(image).actual && get2(image).expect && get2(image).diff) $$render(consequent_8);
20634
- else if (get2(image).actual) $$render(consequent_9, 1);
20662
+ if_block(node_5, ($$render) => {
20663
+ if (get2(image).actual && get2(image).expect && get2(image).diff) $$render(consequent_6);
20664
+ else if (get2(image).actual) $$render(consequent_7, 1);
20635
20665
  });
20636
20666
  }
20637
- reset(div_11);
20638
- append($$anchor2, div_11);
20667
+ reset(div_10);
20668
+ append($$anchor2, div_10);
20639
20669
  };
20640
- var consequent_12 = ($$anchor2) => {
20641
- var div_15 = root_142();
20642
- var node_8 = child(div_15);
20643
- {
20644
- var consequent_11 = ($$anchor3) => {
20645
- var div_16 = root_152();
20646
- append($$anchor3, div_16);
20647
- };
20648
- if_block(node_8, ($$render) => {
20649
- if (get2(isBaselineOnly)) $$render(consequent_11);
20650
- });
20651
- }
20652
- var node_9 = sibling(node_8, 2);
20653
- BlendView(node_9, {
20670
+ var consequent_9 = ($$anchor2) => {
20671
+ var div_13 = root_122();
20672
+ var node_6 = child(div_13);
20673
+ BlendView(node_6, {
20654
20674
  get image() {
20655
20675
  return get2(image);
20656
20676
  }
20657
20677
  });
20658
- reset(div_15);
20659
- append($$anchor2, div_15);
20678
+ reset(div_13);
20679
+ append($$anchor2, div_13);
20660
20680
  };
20661
20681
  if_block(node_3, ($$render) => {
20662
20682
  if (!get2(image)) $$render(consequent_2);
20663
20683
  else if (get2(isDeclaredOnly)) $$render(consequent_3, 1);
20664
- else if ($$props.viewMode === "side-by-side" || !get2(hasDiffAndExpect)) $$render(consequent_5, 2);
20665
- else if ($$props.viewMode === "swap") $$render(consequent_6, 3);
20666
- else if ($$props.viewMode === "slide") $$render(consequent_10, 4);
20667
- else if ($$props.viewMode === "blend") $$render(consequent_12, 5);
20684
+ else if ($$props.viewMode === "side-by-side" || !get2(hasDiffAndExpect)) $$render(consequent_4, 2);
20685
+ else if ($$props.viewMode === "swap") $$render(consequent_5, 3);
20686
+ else if ($$props.viewMode === "slide") $$render(consequent_8, 4);
20687
+ else if ($$props.viewMode === "blend") $$render(consequent_9, 5);
20668
20688
  });
20669
20689
  }
20670
20690
  reset(div_6);
20671
20691
  reset(div_5);
20672
- var node_10 = sibling(div_5, 2);
20692
+ var node_7 = sibling(div_5, 2);
20673
20693
  {
20674
- var consequent_15 = ($$anchor2) => {
20675
- var div_17 = root_162();
20676
- var button_2 = child(div_17);
20677
- var div_18 = sibling(button_2, 2);
20678
- each(div_18, 21, () => Array.from({ length: get2(totalRetries) }, (_, i) => i + 1), index, ($$anchor3, page) => {
20694
+ var consequent_12 = ($$anchor2) => {
20695
+ var div_14 = root_132();
20696
+ var button_2 = child(div_14);
20697
+ var div_15 = sibling(button_2, 2);
20698
+ each(div_15, 21, () => Array.from({ length: get2(totalRetries) }, (_, i) => i + 1), index, ($$anchor3, page) => {
20679
20699
  var fragment_3 = comment();
20680
- var node_11 = first_child(fragment_3);
20700
+ var node_8 = first_child(fragment_3);
20681
20701
  {
20682
- var consequent_13 = ($$anchor4) => {
20683
- var button_3 = root_18();
20702
+ var consequent_10 = ($$anchor4) => {
20703
+ var button_3 = root_152();
20684
20704
  var text_3 = child(button_3, true);
20685
20705
  reset(button_3);
20686
20706
  template_effect(
@@ -20696,21 +20716,21 @@ function ResultsPage($$anchor, $$props) {
20696
20716
  append($$anchor4, button_3);
20697
20717
  };
20698
20718
  var d = user_derived(() => get2(totalRetries) <= 7 || get2(page) === 1 || get2(page) === get2(totalRetries) || Math.abs(get2(page) - $$props.retry) <= 1);
20699
- var consequent_14 = ($$anchor4) => {
20700
- var span = root_19();
20719
+ var consequent_11 = ($$anchor4) => {
20720
+ var span = root_162();
20701
20721
  span.textContent = "\u2026";
20702
20722
  append($$anchor4, span);
20703
20723
  };
20704
- if_block(node_11, ($$render) => {
20705
- if (get2(d)) $$render(consequent_13);
20706
- else if (get2(page) === 2 || get2(page) === get2(totalRetries) - 1) $$render(consequent_14, 1);
20724
+ if_block(node_8, ($$render) => {
20725
+ if (get2(d)) $$render(consequent_10);
20726
+ else if (get2(page) === 2 || get2(page) === get2(totalRetries) - 1) $$render(consequent_11, 1);
20707
20727
  });
20708
20728
  }
20709
20729
  append($$anchor3, fragment_3);
20710
20730
  });
20711
- reset(div_18);
20712
- var button_4 = sibling(div_18, 2);
20713
- reset(div_17);
20731
+ reset(div_15);
20732
+ var button_4 = sibling(div_15, 2);
20733
+ reset(div_14);
20714
20734
  template_effect(
20715
20735
  ($0, $1) => {
20716
20736
  set_class(button_2, 1, $0);
@@ -20725,10 +20745,10 @@ function ResultsPage($$anchor, $$props) {
20725
20745
  );
20726
20746
  delegated("click", button_2, () => $$props.onRetryChange($$props.retry - 1));
20727
20747
  delegated("click", button_4, () => $$props.onRetryChange($$props.retry + 1));
20728
- append($$anchor2, div_17);
20748
+ append($$anchor2, div_14);
20729
20749
  };
20730
- if_block(node_10, ($$render) => {
20731
- if (get2(totalRetries) > 1) $$render(consequent_15);
20750
+ if_block(node_7, ($$render) => {
20751
+ if (get2(totalRetries) > 1) $$render(consequent_12);
20732
20752
  });
20733
20753
  }
20734
20754
  reset(div);
@@ -20935,8 +20955,9 @@ function App($$anchor, $$props) {
20935
20955
  }
20936
20956
  }
20937
20957
  async function handleImageApprove() {
20938
- if (!get2(openedTest)?.id || !get2(canApprove)) return;
20939
- await $$props.onApprove(get2(openedTest).id, get2(retry) - 1, get2(imageName));
20958
+ if (!get2(openedTest)?.id || !get2(canApprove)) return false;
20959
+ const approvalResult = await $$props.onApprove(get2(openedTest).id, get2(retry) - 1, get2(imageName));
20960
+ if (!approvalResult.success) return false;
20940
20961
  if (!get2(openedTest).approved) get2(openedTest).approved = {};
20941
20962
  get2(openedTest).approved[get2(imageName)] = get2(retry) - 1;
20942
20963
  const result = get2(openedTest).results?.[get2(retry) - 1];
@@ -20947,16 +20968,19 @@ function App($$anchor, $$props) {
20947
20968
  recalcSuiteStatuses(get2(tests), getTestPath(get2(openedTest)));
20948
20969
  }
20949
20970
  }
20971
+ return true;
20950
20972
  }
20951
20973
  async function handleApproveAndGoNext() {
20952
- await handleImageApprove();
20953
- handleGoToNextFailed();
20974
+ if (await handleImageApprove()) {
20975
+ handleGoToNextFailed();
20976
+ }
20954
20977
  }
20955
20978
  function getAllTests(suite) {
20956
20979
  return Object.values(suite.children).filter(isDefined).flatMap((child2) => isTest(child2) ? [child2] : getAllTests(child2));
20957
20980
  }
20958
20981
  async function handleApproveAllTests() {
20959
- await $$props.onApproveAll();
20982
+ const approvalResult = await $$props.onApproveAll();
20983
+ if (!isBulkApprovalOptimisticSafe(approvalResult)) return;
20960
20984
  getAllTests(get2(tests)).forEach((test) => {
20961
20985
  if (!test.results?.length) return;
20962
20986
  const lastIdx = test.results.length - 1;
@@ -21149,14 +21173,16 @@ async function loadReportData() {
21149
21173
  };
21150
21174
  }
21151
21175
  var handleApprove = async (id, retry, image) => {
21152
- await fetch("/api/approve", {
21176
+ const response = await fetch("/api/approve", {
21153
21177
  method: "POST",
21154
21178
  headers: { "Content-Type": "application/json" },
21155
21179
  body: JSON.stringify({ id, retry, image })
21156
21180
  });
21181
+ return readApproveResult(response);
21157
21182
  };
21158
21183
  var handleApproveAll = async () => {
21159
- await fetch("/api/approve-all", { method: "POST" });
21184
+ const response = await fetch("/api/approve-all", { method: "POST" });
21185
+ return readApproveAllResult(response);
21160
21186
  };
21161
21187
  var root9 = document.getElementById("root");
21162
21188
  root9.innerHTML = `<div style="display:flex;align-items:center;justify-content:center;height:100vh;color:#808080;font-size:14px">Loading\u2026</div>`;