@closerepo/radar-contracts 2.2.0 → 2.3.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.
- package/dist/index.d.ts +554 -1
- package/dist/index.js +6 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3705,6 +3705,36 @@ declare const radarResetSourceTranslationsSchema: z.ZodObject<{
|
|
|
3705
3705
|
ja: z.ZodNullable<z.ZodString>;
|
|
3706
3706
|
ko: z.ZodNullable<z.ZodString>;
|
|
3707
3707
|
}, z.core.$strict>;
|
|
3708
|
+
/** Full official-post evidence shared by previews and the internal feed records. */
|
|
3709
|
+
declare const radarResetKindNoticeV2Schema: z.ZodObject<{
|
|
3710
|
+
sourceUrl: z.ZodString;
|
|
3711
|
+
authoredAt: z.ZodISODateTime;
|
|
3712
|
+
sourceText: z.ZodString;
|
|
3713
|
+
contentCompleteness: z.ZodEnum<{
|
|
3714
|
+
verified_full_text: "verified_full_text";
|
|
3715
|
+
verified_excerpt: "verified_excerpt";
|
|
3716
|
+
}>;
|
|
3717
|
+
sourceAccount: z.ZodObject<{
|
|
3718
|
+
displayName: z.ZodString;
|
|
3719
|
+
}, z.core.$strict>;
|
|
3720
|
+
sourceTranslations: z.ZodObject<{
|
|
3721
|
+
"zh-Hans": z.ZodNullable<z.ZodString>;
|
|
3722
|
+
"zh-Hant": z.ZodNullable<z.ZodString>;
|
|
3723
|
+
ja: z.ZodNullable<z.ZodString>;
|
|
3724
|
+
ko: z.ZodNullable<z.ZodString>;
|
|
3725
|
+
}, z.core.$strict>;
|
|
3726
|
+
kinds: z.ZodArray<z.ZodEnum<{
|
|
3727
|
+
preview: "preview";
|
|
3728
|
+
executed: "executed";
|
|
3729
|
+
schedule_change: "schedule_change";
|
|
3730
|
+
scope_change: "scope_change";
|
|
3731
|
+
cancel_preview: "cancel_preview";
|
|
3732
|
+
delivery_issue: "delivery_issue";
|
|
3733
|
+
make_up: "make_up";
|
|
3734
|
+
repair: "repair";
|
|
3735
|
+
update: "update";
|
|
3736
|
+
}>>;
|
|
3737
|
+
}, z.core.$strict>;
|
|
3708
3738
|
declare const radarResetActionDetailV2Schema: z.ZodObject<{
|
|
3709
3739
|
contractVersion: z.ZodLiteral<2>;
|
|
3710
3740
|
noticeTimeline: z.ZodArray<z.ZodObject<{
|
|
@@ -5126,6 +5156,529 @@ declare function projectRadarResetExportV1FromV2(value: RadarResetExportV2): {
|
|
|
5126
5156
|
}[];
|
|
5127
5157
|
};
|
|
5128
5158
|
//#endregion
|
|
5159
|
+
//#region src/reset-public-records.d.ts
|
|
5160
|
+
/** Internal Core-to-publisher endpoint; the public subscription surface is Atom only. */
|
|
5161
|
+
declare const radarResetPublicRecordsCorePath = "/api/v1/codex-reset-public-records";
|
|
5162
|
+
declare const actionShape: z.ZodObject<{
|
|
5163
|
+
reasons: z.ZodArray<z.ZodObject<{
|
|
5164
|
+
category: z.ZodEnum<{
|
|
5165
|
+
incident_compensation: "incident_compensation";
|
|
5166
|
+
user_milestone: "user_milestone";
|
|
5167
|
+
celebration: "celebration";
|
|
5168
|
+
}>;
|
|
5169
|
+
summary: z.ZodString;
|
|
5170
|
+
basis: z.ZodEnum<{
|
|
5171
|
+
unknown: "unknown";
|
|
5172
|
+
explicit_in_reset_post: "explicit_in_reset_post";
|
|
5173
|
+
explicit_in_related_source: "explicit_in_related_source";
|
|
5174
|
+
contextual_inference: "contextual_inference";
|
|
5175
|
+
}>;
|
|
5176
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
5177
|
+
excerpt: z.ZodString;
|
|
5178
|
+
sourceUrl: z.ZodString;
|
|
5179
|
+
}, z.core.$strict>>;
|
|
5180
|
+
}, z.core.$strict>>;
|
|
5181
|
+
firstAnnouncedAt: z.ZodISODateTime;
|
|
5182
|
+
resetActionId: z.ZodString;
|
|
5183
|
+
resetEffects: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5184
|
+
state: z.ZodLiteral<"known">;
|
|
5185
|
+
values: z.ZodArray<z.ZodEnum<{
|
|
5186
|
+
hard_reset: "hard_reset";
|
|
5187
|
+
banked_reset: "banked_reset";
|
|
5188
|
+
}>>;
|
|
5189
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
5190
|
+
state: z.ZodLiteral<"unknown">;
|
|
5191
|
+
values: z.ZodTuple<[], null>;
|
|
5192
|
+
}, z.core.$strict>], "state">;
|
|
5193
|
+
actionScope: z.ZodObject<{
|
|
5194
|
+
products: z.ZodArray<z.ZodEnum<{
|
|
5195
|
+
codex: "codex";
|
|
5196
|
+
chatgpt_work: "chatgpt_work";
|
|
5197
|
+
}>>;
|
|
5198
|
+
audienceClaims: z.ZodArray<z.ZodObject<{
|
|
5199
|
+
audience: z.ZodEnum<{
|
|
5200
|
+
all_users: "all_users";
|
|
5201
|
+
paid_users: "paid_users";
|
|
5202
|
+
named_plans: "named_plans";
|
|
5203
|
+
affected_subset: "affected_subset";
|
|
5204
|
+
}>;
|
|
5205
|
+
plans: z.ZodArray<z.ZodEnum<{
|
|
5206
|
+
plus: "plus";
|
|
5207
|
+
pro: "pro";
|
|
5208
|
+
}>>;
|
|
5209
|
+
subsetSummary: z.ZodNullable<z.ZodString>;
|
|
5210
|
+
}, z.core.$strict>>;
|
|
5211
|
+
}, z.core.$strict>;
|
|
5212
|
+
effectiveAt: z.ZodNullable<z.ZodISODateTime>;
|
|
5213
|
+
noticeTimeline: z.ZodArray<z.ZodObject<{
|
|
5214
|
+
sourceUrl: z.ZodString;
|
|
5215
|
+
authoredAt: z.ZodISODateTime;
|
|
5216
|
+
sourceText: z.ZodString;
|
|
5217
|
+
contentCompleteness: z.ZodEnum<{
|
|
5218
|
+
verified_full_text: "verified_full_text";
|
|
5219
|
+
verified_excerpt: "verified_excerpt";
|
|
5220
|
+
}>;
|
|
5221
|
+
sourceAccount: z.ZodObject<{
|
|
5222
|
+
displayName: z.ZodString;
|
|
5223
|
+
}, z.core.$strict>;
|
|
5224
|
+
sourceTranslations: z.ZodObject<{
|
|
5225
|
+
"zh-Hans": z.ZodNullable<z.ZodString>;
|
|
5226
|
+
"zh-Hant": z.ZodNullable<z.ZodString>;
|
|
5227
|
+
ja: z.ZodNullable<z.ZodString>;
|
|
5228
|
+
ko: z.ZodNullable<z.ZodString>;
|
|
5229
|
+
}, z.core.$strict>;
|
|
5230
|
+
kinds: z.ZodArray<z.ZodEnum<{
|
|
5231
|
+
preview: "preview";
|
|
5232
|
+
executed: "executed";
|
|
5233
|
+
schedule_change: "schedule_change";
|
|
5234
|
+
scope_change: "scope_change";
|
|
5235
|
+
cancel_preview: "cancel_preview";
|
|
5236
|
+
delivery_issue: "delivery_issue";
|
|
5237
|
+
make_up: "make_up";
|
|
5238
|
+
repair: "repair";
|
|
5239
|
+
update: "update";
|
|
5240
|
+
}>>;
|
|
5241
|
+
}, z.core.$strict>>;
|
|
5242
|
+
}, z.core.$strict>;
|
|
5243
|
+
/** Project the same announcement evidence consumed by the existing website contract. */
|
|
5244
|
+
declare const projectRadarResetPublicActionToV2: (action: z.infer<typeof actionShape>) => {
|
|
5245
|
+
contractVersion: 2;
|
|
5246
|
+
noticeTimeline: {
|
|
5247
|
+
sourceUrl: string;
|
|
5248
|
+
authoredAt: string;
|
|
5249
|
+
sourceText: string;
|
|
5250
|
+
phase: "preview" | "executed";
|
|
5251
|
+
contentCompleteness: "verified_full_text" | "verified_excerpt";
|
|
5252
|
+
sourceAccount: {
|
|
5253
|
+
displayName: string;
|
|
5254
|
+
};
|
|
5255
|
+
sourceTranslations: {
|
|
5256
|
+
"zh-Hans": string | null;
|
|
5257
|
+
"zh-Hant": string | null;
|
|
5258
|
+
ja: string | null;
|
|
5259
|
+
ko: string | null;
|
|
5260
|
+
};
|
|
5261
|
+
}[];
|
|
5262
|
+
resetActionId: string;
|
|
5263
|
+
firstAnnouncedAt: string;
|
|
5264
|
+
effectiveAt: string | null;
|
|
5265
|
+
resetEffects: {
|
|
5266
|
+
state: "known";
|
|
5267
|
+
values: ("hard_reset" | "banked_reset")[];
|
|
5268
|
+
} | {
|
|
5269
|
+
state: "unknown";
|
|
5270
|
+
values: [];
|
|
5271
|
+
};
|
|
5272
|
+
actionScope: {
|
|
5273
|
+
products: ("codex" | "chatgpt_work")[];
|
|
5274
|
+
audienceClaims: {
|
|
5275
|
+
audience: "all_users" | "paid_users" | "named_plans" | "affected_subset";
|
|
5276
|
+
plans: ("plus" | "pro")[];
|
|
5277
|
+
subsetSummary: string | null;
|
|
5278
|
+
}[];
|
|
5279
|
+
};
|
|
5280
|
+
noticeCount: number;
|
|
5281
|
+
reasons: {
|
|
5282
|
+
category: "incident_compensation" | "user_milestone" | "celebration";
|
|
5283
|
+
summary: string;
|
|
5284
|
+
basis: "unknown" | "explicit_in_reset_post" | "explicit_in_related_source" | "contextual_inference";
|
|
5285
|
+
evidence: {
|
|
5286
|
+
excerpt: string;
|
|
5287
|
+
sourceUrl: string;
|
|
5288
|
+
}[];
|
|
5289
|
+
}[];
|
|
5290
|
+
};
|
|
5291
|
+
declare const radarResetPublicActionV1Schema: z.ZodObject<{
|
|
5292
|
+
reasons: z.ZodArray<z.ZodObject<{
|
|
5293
|
+
category: z.ZodEnum<{
|
|
5294
|
+
incident_compensation: "incident_compensation";
|
|
5295
|
+
user_milestone: "user_milestone";
|
|
5296
|
+
celebration: "celebration";
|
|
5297
|
+
}>;
|
|
5298
|
+
summary: z.ZodString;
|
|
5299
|
+
basis: z.ZodEnum<{
|
|
5300
|
+
unknown: "unknown";
|
|
5301
|
+
explicit_in_reset_post: "explicit_in_reset_post";
|
|
5302
|
+
explicit_in_related_source: "explicit_in_related_source";
|
|
5303
|
+
contextual_inference: "contextual_inference";
|
|
5304
|
+
}>;
|
|
5305
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
5306
|
+
excerpt: z.ZodString;
|
|
5307
|
+
sourceUrl: z.ZodString;
|
|
5308
|
+
}, z.core.$strict>>;
|
|
5309
|
+
}, z.core.$strict>>;
|
|
5310
|
+
firstAnnouncedAt: z.ZodISODateTime;
|
|
5311
|
+
resetActionId: z.ZodString;
|
|
5312
|
+
resetEffects: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5313
|
+
state: z.ZodLiteral<"known">;
|
|
5314
|
+
values: z.ZodArray<z.ZodEnum<{
|
|
5315
|
+
hard_reset: "hard_reset";
|
|
5316
|
+
banked_reset: "banked_reset";
|
|
5317
|
+
}>>;
|
|
5318
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
5319
|
+
state: z.ZodLiteral<"unknown">;
|
|
5320
|
+
values: z.ZodTuple<[], null>;
|
|
5321
|
+
}, z.core.$strict>], "state">;
|
|
5322
|
+
actionScope: z.ZodObject<{
|
|
5323
|
+
products: z.ZodArray<z.ZodEnum<{
|
|
5324
|
+
codex: "codex";
|
|
5325
|
+
chatgpt_work: "chatgpt_work";
|
|
5326
|
+
}>>;
|
|
5327
|
+
audienceClaims: z.ZodArray<z.ZodObject<{
|
|
5328
|
+
audience: z.ZodEnum<{
|
|
5329
|
+
all_users: "all_users";
|
|
5330
|
+
paid_users: "paid_users";
|
|
5331
|
+
named_plans: "named_plans";
|
|
5332
|
+
affected_subset: "affected_subset";
|
|
5333
|
+
}>;
|
|
5334
|
+
plans: z.ZodArray<z.ZodEnum<{
|
|
5335
|
+
plus: "plus";
|
|
5336
|
+
pro: "pro";
|
|
5337
|
+
}>>;
|
|
5338
|
+
subsetSummary: z.ZodNullable<z.ZodString>;
|
|
5339
|
+
}, z.core.$strict>>;
|
|
5340
|
+
}, z.core.$strict>;
|
|
5341
|
+
effectiveAt: z.ZodNullable<z.ZodISODateTime>;
|
|
5342
|
+
noticeTimeline: z.ZodArray<z.ZodObject<{
|
|
5343
|
+
sourceUrl: z.ZodString;
|
|
5344
|
+
authoredAt: z.ZodISODateTime;
|
|
5345
|
+
sourceText: z.ZodString;
|
|
5346
|
+
contentCompleteness: z.ZodEnum<{
|
|
5347
|
+
verified_full_text: "verified_full_text";
|
|
5348
|
+
verified_excerpt: "verified_excerpt";
|
|
5349
|
+
}>;
|
|
5350
|
+
sourceAccount: z.ZodObject<{
|
|
5351
|
+
displayName: z.ZodString;
|
|
5352
|
+
}, z.core.$strict>;
|
|
5353
|
+
sourceTranslations: z.ZodObject<{
|
|
5354
|
+
"zh-Hans": z.ZodNullable<z.ZodString>;
|
|
5355
|
+
"zh-Hant": z.ZodNullable<z.ZodString>;
|
|
5356
|
+
ja: z.ZodNullable<z.ZodString>;
|
|
5357
|
+
ko: z.ZodNullable<z.ZodString>;
|
|
5358
|
+
}, z.core.$strict>;
|
|
5359
|
+
kinds: z.ZodArray<z.ZodEnum<{
|
|
5360
|
+
preview: "preview";
|
|
5361
|
+
executed: "executed";
|
|
5362
|
+
schedule_change: "schedule_change";
|
|
5363
|
+
scope_change: "scope_change";
|
|
5364
|
+
cancel_preview: "cancel_preview";
|
|
5365
|
+
delivery_issue: "delivery_issue";
|
|
5366
|
+
make_up: "make_up";
|
|
5367
|
+
repair: "repair";
|
|
5368
|
+
update: "update";
|
|
5369
|
+
}>>;
|
|
5370
|
+
}, z.core.$strict>>;
|
|
5371
|
+
}, z.core.$strict>;
|
|
5372
|
+
/** Official history survives website display controls; cancellation is not required. */
|
|
5373
|
+
declare const radarResetUnexecutedActionV1Schema: z.ZodObject<{
|
|
5374
|
+
noticeTimeline: z.ZodArray<z.ZodObject<{
|
|
5375
|
+
sourceUrl: z.ZodString;
|
|
5376
|
+
authoredAt: z.ZodISODateTime;
|
|
5377
|
+
sourceText: z.ZodString;
|
|
5378
|
+
contentCompleteness: z.ZodEnum<{
|
|
5379
|
+
verified_full_text: "verified_full_text";
|
|
5380
|
+
verified_excerpt: "verified_excerpt";
|
|
5381
|
+
}>;
|
|
5382
|
+
sourceAccount: z.ZodObject<{
|
|
5383
|
+
displayName: z.ZodString;
|
|
5384
|
+
}, z.core.$strict>;
|
|
5385
|
+
sourceTranslations: z.ZodObject<{
|
|
5386
|
+
"zh-Hans": z.ZodNullable<z.ZodString>;
|
|
5387
|
+
"zh-Hant": z.ZodNullable<z.ZodString>;
|
|
5388
|
+
ja: z.ZodNullable<z.ZodString>;
|
|
5389
|
+
ko: z.ZodNullable<z.ZodString>;
|
|
5390
|
+
}, z.core.$strict>;
|
|
5391
|
+
kinds: z.ZodArray<z.ZodEnum<{
|
|
5392
|
+
preview: "preview";
|
|
5393
|
+
executed: "executed";
|
|
5394
|
+
schedule_change: "schedule_change";
|
|
5395
|
+
scope_change: "scope_change";
|
|
5396
|
+
cancel_preview: "cancel_preview";
|
|
5397
|
+
delivery_issue: "delivery_issue";
|
|
5398
|
+
make_up: "make_up";
|
|
5399
|
+
repair: "repair";
|
|
5400
|
+
update: "update";
|
|
5401
|
+
}>>;
|
|
5402
|
+
}, z.core.$strict>>;
|
|
5403
|
+
resetActionId: z.ZodString;
|
|
5404
|
+
resetEffects: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5405
|
+
state: z.ZodLiteral<"known">;
|
|
5406
|
+
values: z.ZodArray<z.ZodEnum<{
|
|
5407
|
+
hard_reset: "hard_reset";
|
|
5408
|
+
banked_reset: "banked_reset";
|
|
5409
|
+
}>>;
|
|
5410
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
5411
|
+
state: z.ZodLiteral<"unknown">;
|
|
5412
|
+
values: z.ZodTuple<[], null>;
|
|
5413
|
+
}, z.core.$strict>], "state">;
|
|
5414
|
+
plannedTiming: z.ZodNullable<z.ZodObject<{
|
|
5415
|
+
resolution: z.ZodEnum<{
|
|
5416
|
+
resolved: "resolved";
|
|
5417
|
+
unbounded: "unbounded";
|
|
5418
|
+
unresolved: "unresolved";
|
|
5419
|
+
}>;
|
|
5420
|
+
evidence: z.ZodNullable<z.ZodString>;
|
|
5421
|
+
precision: z.ZodNullable<z.ZodEnum<{
|
|
5422
|
+
exact: "exact";
|
|
5423
|
+
approximate: "approximate";
|
|
5424
|
+
range: "range";
|
|
5425
|
+
}>>;
|
|
5426
|
+
relation: z.ZodNullable<z.ZodEnum<{
|
|
5427
|
+
instant: "instant";
|
|
5428
|
+
unbounded: "unbounded";
|
|
5429
|
+
interval: "interval";
|
|
5430
|
+
deadline: "deadline";
|
|
5431
|
+
not_before: "not_before";
|
|
5432
|
+
}>>;
|
|
5433
|
+
effectiveWindow: z.ZodNullable<z.ZodObject<{
|
|
5434
|
+
earliestAt: z.ZodISODateTime;
|
|
5435
|
+
latestAt: z.ZodISODateTime;
|
|
5436
|
+
}, z.core.$strict>>;
|
|
5437
|
+
}, z.core.$strict>>;
|
|
5438
|
+
}, z.core.$strict>;
|
|
5439
|
+
declare const radarResetWithdrawnActionV1Schema: z.ZodObject<{
|
|
5440
|
+
resetActionId: z.ZodString;
|
|
5441
|
+
lastActiveFirstAnnouncedAt: z.ZodISODateTime;
|
|
5442
|
+
withdrawnAt: z.ZodISODateTime;
|
|
5443
|
+
}, z.core.$strict>;
|
|
5444
|
+
declare const radarResetPublicRecordsV1Schema: z.ZodObject<{
|
|
5445
|
+
contractVersion: z.ZodLiteral<1>;
|
|
5446
|
+
sourceWatermark: z.ZodString;
|
|
5447
|
+
generatedAt: z.ZodISODateTime;
|
|
5448
|
+
actions: z.ZodArray<z.ZodObject<{
|
|
5449
|
+
reasons: z.ZodArray<z.ZodObject<{
|
|
5450
|
+
category: z.ZodEnum<{
|
|
5451
|
+
incident_compensation: "incident_compensation";
|
|
5452
|
+
user_milestone: "user_milestone";
|
|
5453
|
+
celebration: "celebration";
|
|
5454
|
+
}>;
|
|
5455
|
+
summary: z.ZodString;
|
|
5456
|
+
basis: z.ZodEnum<{
|
|
5457
|
+
unknown: "unknown";
|
|
5458
|
+
explicit_in_reset_post: "explicit_in_reset_post";
|
|
5459
|
+
explicit_in_related_source: "explicit_in_related_source";
|
|
5460
|
+
contextual_inference: "contextual_inference";
|
|
5461
|
+
}>;
|
|
5462
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
5463
|
+
excerpt: z.ZodString;
|
|
5464
|
+
sourceUrl: z.ZodString;
|
|
5465
|
+
}, z.core.$strict>>;
|
|
5466
|
+
}, z.core.$strict>>;
|
|
5467
|
+
firstAnnouncedAt: z.ZodISODateTime;
|
|
5468
|
+
resetActionId: z.ZodString;
|
|
5469
|
+
resetEffects: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5470
|
+
state: z.ZodLiteral<"known">;
|
|
5471
|
+
values: z.ZodArray<z.ZodEnum<{
|
|
5472
|
+
hard_reset: "hard_reset";
|
|
5473
|
+
banked_reset: "banked_reset";
|
|
5474
|
+
}>>;
|
|
5475
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
5476
|
+
state: z.ZodLiteral<"unknown">;
|
|
5477
|
+
values: z.ZodTuple<[], null>;
|
|
5478
|
+
}, z.core.$strict>], "state">;
|
|
5479
|
+
actionScope: z.ZodObject<{
|
|
5480
|
+
products: z.ZodArray<z.ZodEnum<{
|
|
5481
|
+
codex: "codex";
|
|
5482
|
+
chatgpt_work: "chatgpt_work";
|
|
5483
|
+
}>>;
|
|
5484
|
+
audienceClaims: z.ZodArray<z.ZodObject<{
|
|
5485
|
+
audience: z.ZodEnum<{
|
|
5486
|
+
all_users: "all_users";
|
|
5487
|
+
paid_users: "paid_users";
|
|
5488
|
+
named_plans: "named_plans";
|
|
5489
|
+
affected_subset: "affected_subset";
|
|
5490
|
+
}>;
|
|
5491
|
+
plans: z.ZodArray<z.ZodEnum<{
|
|
5492
|
+
plus: "plus";
|
|
5493
|
+
pro: "pro";
|
|
5494
|
+
}>>;
|
|
5495
|
+
subsetSummary: z.ZodNullable<z.ZodString>;
|
|
5496
|
+
}, z.core.$strict>>;
|
|
5497
|
+
}, z.core.$strict>;
|
|
5498
|
+
effectiveAt: z.ZodNullable<z.ZodISODateTime>;
|
|
5499
|
+
noticeTimeline: z.ZodArray<z.ZodObject<{
|
|
5500
|
+
sourceUrl: z.ZodString;
|
|
5501
|
+
authoredAt: z.ZodISODateTime;
|
|
5502
|
+
sourceText: z.ZodString;
|
|
5503
|
+
contentCompleteness: z.ZodEnum<{
|
|
5504
|
+
verified_full_text: "verified_full_text";
|
|
5505
|
+
verified_excerpt: "verified_excerpt";
|
|
5506
|
+
}>;
|
|
5507
|
+
sourceAccount: z.ZodObject<{
|
|
5508
|
+
displayName: z.ZodString;
|
|
5509
|
+
}, z.core.$strict>;
|
|
5510
|
+
sourceTranslations: z.ZodObject<{
|
|
5511
|
+
"zh-Hans": z.ZodNullable<z.ZodString>;
|
|
5512
|
+
"zh-Hant": z.ZodNullable<z.ZodString>;
|
|
5513
|
+
ja: z.ZodNullable<z.ZodString>;
|
|
5514
|
+
ko: z.ZodNullable<z.ZodString>;
|
|
5515
|
+
}, z.core.$strict>;
|
|
5516
|
+
kinds: z.ZodArray<z.ZodEnum<{
|
|
5517
|
+
preview: "preview";
|
|
5518
|
+
executed: "executed";
|
|
5519
|
+
schedule_change: "schedule_change";
|
|
5520
|
+
scope_change: "scope_change";
|
|
5521
|
+
cancel_preview: "cancel_preview";
|
|
5522
|
+
delivery_issue: "delivery_issue";
|
|
5523
|
+
make_up: "make_up";
|
|
5524
|
+
repair: "repair";
|
|
5525
|
+
update: "update";
|
|
5526
|
+
}>>;
|
|
5527
|
+
}, z.core.$strict>>;
|
|
5528
|
+
}, z.core.$strict>>;
|
|
5529
|
+
pendingResetActions: z.ZodArray<z.ZodObject<{
|
|
5530
|
+
noticeTimeline: z.ZodArray<z.ZodObject<{
|
|
5531
|
+
sourceUrl: z.ZodString;
|
|
5532
|
+
authoredAt: z.ZodISODateTime;
|
|
5533
|
+
sourceText: z.ZodString;
|
|
5534
|
+
contentCompleteness: z.ZodEnum<{
|
|
5535
|
+
verified_full_text: "verified_full_text";
|
|
5536
|
+
verified_excerpt: "verified_excerpt";
|
|
5537
|
+
}>;
|
|
5538
|
+
sourceAccount: z.ZodObject<{
|
|
5539
|
+
displayName: z.ZodString;
|
|
5540
|
+
}, z.core.$strict>;
|
|
5541
|
+
sourceTranslations: z.ZodObject<{
|
|
5542
|
+
"zh-Hans": z.ZodNullable<z.ZodString>;
|
|
5543
|
+
"zh-Hant": z.ZodNullable<z.ZodString>;
|
|
5544
|
+
ja: z.ZodNullable<z.ZodString>;
|
|
5545
|
+
ko: z.ZodNullable<z.ZodString>;
|
|
5546
|
+
}, z.core.$strict>;
|
|
5547
|
+
kinds: z.ZodArray<z.ZodEnum<{
|
|
5548
|
+
preview: "preview";
|
|
5549
|
+
executed: "executed";
|
|
5550
|
+
schedule_change: "schedule_change";
|
|
5551
|
+
scope_change: "scope_change";
|
|
5552
|
+
cancel_preview: "cancel_preview";
|
|
5553
|
+
delivery_issue: "delivery_issue";
|
|
5554
|
+
make_up: "make_up";
|
|
5555
|
+
repair: "repair";
|
|
5556
|
+
update: "update";
|
|
5557
|
+
}>>;
|
|
5558
|
+
}, z.core.$strict>>;
|
|
5559
|
+
resetActionId: z.ZodString;
|
|
5560
|
+
state: z.ZodEnum<{
|
|
5561
|
+
preview: "preview";
|
|
5562
|
+
executed: "executed";
|
|
5563
|
+
}>;
|
|
5564
|
+
resetEffects: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5565
|
+
state: z.ZodLiteral<"known">;
|
|
5566
|
+
values: z.ZodArray<z.ZodEnum<{
|
|
5567
|
+
hard_reset: "hard_reset";
|
|
5568
|
+
banked_reset: "banked_reset";
|
|
5569
|
+
}>>;
|
|
5570
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
5571
|
+
state: z.ZodLiteral<"unknown">;
|
|
5572
|
+
values: z.ZodTuple<[], null>;
|
|
5573
|
+
}, z.core.$strict>], "state">;
|
|
5574
|
+
executedEffects: z.ZodArray<z.ZodEnum<{
|
|
5575
|
+
hard_reset: "hard_reset";
|
|
5576
|
+
banked_reset: "banked_reset";
|
|
5577
|
+
}>>;
|
|
5578
|
+
pendingEffects: z.ZodArray<z.ZodEnum<{
|
|
5579
|
+
hard_reset: "hard_reset";
|
|
5580
|
+
banked_reset: "banked_reset";
|
|
5581
|
+
}>>;
|
|
5582
|
+
plannedTiming: z.ZodNullable<z.ZodObject<{
|
|
5583
|
+
resolution: z.ZodEnum<{
|
|
5584
|
+
resolved: "resolved";
|
|
5585
|
+
unbounded: "unbounded";
|
|
5586
|
+
unresolved: "unresolved";
|
|
5587
|
+
}>;
|
|
5588
|
+
evidence: z.ZodNullable<z.ZodString>;
|
|
5589
|
+
precision: z.ZodNullable<z.ZodEnum<{
|
|
5590
|
+
exact: "exact";
|
|
5591
|
+
approximate: "approximate";
|
|
5592
|
+
range: "range";
|
|
5593
|
+
}>>;
|
|
5594
|
+
relation: z.ZodNullable<z.ZodEnum<{
|
|
5595
|
+
instant: "instant";
|
|
5596
|
+
unbounded: "unbounded";
|
|
5597
|
+
interval: "interval";
|
|
5598
|
+
deadline: "deadline";
|
|
5599
|
+
not_before: "not_before";
|
|
5600
|
+
}>>;
|
|
5601
|
+
effectiveWindow: z.ZodNullable<z.ZodObject<{
|
|
5602
|
+
earliestAt: z.ZodISODateTime;
|
|
5603
|
+
latestAt: z.ZodISODateTime;
|
|
5604
|
+
}, z.core.$strict>>;
|
|
5605
|
+
}, z.core.$strict>>;
|
|
5606
|
+
}, z.core.$strict>>;
|
|
5607
|
+
unexecutedResetActions: z.ZodArray<z.ZodObject<{
|
|
5608
|
+
noticeTimeline: z.ZodArray<z.ZodObject<{
|
|
5609
|
+
sourceUrl: z.ZodString;
|
|
5610
|
+
authoredAt: z.ZodISODateTime;
|
|
5611
|
+
sourceText: z.ZodString;
|
|
5612
|
+
contentCompleteness: z.ZodEnum<{
|
|
5613
|
+
verified_full_text: "verified_full_text";
|
|
5614
|
+
verified_excerpt: "verified_excerpt";
|
|
5615
|
+
}>;
|
|
5616
|
+
sourceAccount: z.ZodObject<{
|
|
5617
|
+
displayName: z.ZodString;
|
|
5618
|
+
}, z.core.$strict>;
|
|
5619
|
+
sourceTranslations: z.ZodObject<{
|
|
5620
|
+
"zh-Hans": z.ZodNullable<z.ZodString>;
|
|
5621
|
+
"zh-Hant": z.ZodNullable<z.ZodString>;
|
|
5622
|
+
ja: z.ZodNullable<z.ZodString>;
|
|
5623
|
+
ko: z.ZodNullable<z.ZodString>;
|
|
5624
|
+
}, z.core.$strict>;
|
|
5625
|
+
kinds: z.ZodArray<z.ZodEnum<{
|
|
5626
|
+
preview: "preview";
|
|
5627
|
+
executed: "executed";
|
|
5628
|
+
schedule_change: "schedule_change";
|
|
5629
|
+
scope_change: "scope_change";
|
|
5630
|
+
cancel_preview: "cancel_preview";
|
|
5631
|
+
delivery_issue: "delivery_issue";
|
|
5632
|
+
make_up: "make_up";
|
|
5633
|
+
repair: "repair";
|
|
5634
|
+
update: "update";
|
|
5635
|
+
}>>;
|
|
5636
|
+
}, z.core.$strict>>;
|
|
5637
|
+
resetActionId: z.ZodString;
|
|
5638
|
+
resetEffects: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5639
|
+
state: z.ZodLiteral<"known">;
|
|
5640
|
+
values: z.ZodArray<z.ZodEnum<{
|
|
5641
|
+
hard_reset: "hard_reset";
|
|
5642
|
+
banked_reset: "banked_reset";
|
|
5643
|
+
}>>;
|
|
5644
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
5645
|
+
state: z.ZodLiteral<"unknown">;
|
|
5646
|
+
values: z.ZodTuple<[], null>;
|
|
5647
|
+
}, z.core.$strict>], "state">;
|
|
5648
|
+
plannedTiming: z.ZodNullable<z.ZodObject<{
|
|
5649
|
+
resolution: z.ZodEnum<{
|
|
5650
|
+
resolved: "resolved";
|
|
5651
|
+
unbounded: "unbounded";
|
|
5652
|
+
unresolved: "unresolved";
|
|
5653
|
+
}>;
|
|
5654
|
+
evidence: z.ZodNullable<z.ZodString>;
|
|
5655
|
+
precision: z.ZodNullable<z.ZodEnum<{
|
|
5656
|
+
exact: "exact";
|
|
5657
|
+
approximate: "approximate";
|
|
5658
|
+
range: "range";
|
|
5659
|
+
}>>;
|
|
5660
|
+
relation: z.ZodNullable<z.ZodEnum<{
|
|
5661
|
+
instant: "instant";
|
|
5662
|
+
unbounded: "unbounded";
|
|
5663
|
+
interval: "interval";
|
|
5664
|
+
deadline: "deadline";
|
|
5665
|
+
not_before: "not_before";
|
|
5666
|
+
}>>;
|
|
5667
|
+
effectiveWindow: z.ZodNullable<z.ZodObject<{
|
|
5668
|
+
earliestAt: z.ZodISODateTime;
|
|
5669
|
+
latestAt: z.ZodISODateTime;
|
|
5670
|
+
}, z.core.$strict>>;
|
|
5671
|
+
}, z.core.$strict>>;
|
|
5672
|
+
}, z.core.$strict>>;
|
|
5673
|
+
withdrawnResetActions: z.ZodArray<z.ZodObject<{
|
|
5674
|
+
resetActionId: z.ZodString;
|
|
5675
|
+
lastActiveFirstAnnouncedAt: z.ZodISODateTime;
|
|
5676
|
+
withdrawnAt: z.ZodISODateTime;
|
|
5677
|
+
}, z.core.$strict>>;
|
|
5678
|
+
}, z.core.$strict>;
|
|
5679
|
+
type RadarResetPublicActionV1 = z.infer<typeof radarResetPublicActionV1Schema>;
|
|
5680
|
+
type RadarResetPublicRecordsV1 = z.infer<typeof radarResetPublicRecordsV1Schema>;
|
|
5681
|
+
//#endregion
|
|
5129
5682
|
//#region src/reset-management.d.ts
|
|
5130
5683
|
declare const radarResetManualCopySchema: z.ZodObject<{
|
|
5131
5684
|
zh: z.ZodObject<{
|
|
@@ -7730,4 +8283,4 @@ declare const readRadarCodexModels: (response: Response) => Promise<{
|
|
|
7730
8283
|
/** Fixed model-catalog locator for one supported website language. */
|
|
7731
8284
|
declare const radarCodexModelsPath: (locale: RadarWebsiteLocale) => string;
|
|
7732
8285
|
//#endregion
|
|
7733
|
-
export { CreateRadarResetSourceErrorEnvelopeInputV2, RadarActivityFile, RadarActivityFileV2, RadarActivityFileV3, RadarActivityProgress, RadarActivityProgressV2, RadarActivityProgressV3, RadarActivityReactionId, RadarBrowserNotificationProjection, RadarBrowserSubscriptionFailure, RadarBrowserSubscriptionRead, RadarBrowserSubscriptionSave, RadarBrowserSubscriptionSaveV2, RadarBrowserSubscriptionView, RadarBrowserSubscriptionViewV2, RadarBrowserTopics, RadarBrowserTopicsV2, RadarCodexGuessChoice, RadarCodexGuessError, RadarCodexGuessSaveReq, RadarCodexGuessView, RadarCodexModel, RadarCodexModels, RadarCodexProgressChange, RadarCodexProgressChangeV2, RadarCodexProgressChangeV3, RadarCodexProgressChangesV1, RadarCodexProgressChangesV2, RadarCodexProgressChangesV3, RadarCodexProgressEntryV3, RadarCodexProgressEntryV5, RadarCodexProgressImprovementV5, RadarCodexProgressPostRoleV5, RadarCodexProgressPostV5, RadarCodexProgressResetEntryV5, RadarCodexProgressTitleV3, RadarCodexProgressV1, RadarCodexProgressV2, RadarCodexProgressV3, RadarCodexProgressV4, RadarCodexProgressV5, RadarCodexReleaseDirectory, RadarCodexReleaseMonth, RadarCodexReleaseNotes, RadarCodexTimePoint, RadarImprovementEntry, RadarImprovementHead, RadarImprovementPage, RadarNotificationProjection, RadarNotificationTarget, RadarNotificationTask, RadarNotificationTasks, RadarNotificationTopic, RadarResetActionDetailV1, RadarResetActionDetailV2, RadarResetActionItemV2, RadarResetActionSummaryV2, RadarResetActiveActionItemV2, RadarResetAnalysisV1, RadarResetClue, RadarResetClueSnapshot, RadarResetDetailChunkReferenceV2, RadarResetDetailChunkRequestV2, RadarResetDetailManifestV2, RadarResetDetailMultipartEncodeInputV2, RadarResetDetailMultipartParseInputV2, RadarResetDetailMultipartPartV2, RadarResetExportV1, RadarResetExportV2, RadarResetManagement, RadarResetPendingActionV1, RadarResetPendingActionV2, RadarResetPositiveDecimalV2, RadarResetPrimarySourceV1, RadarResetPublicIdV2, RadarResetPublicationHomeFactsV2, RadarResetPublicationRevisionAvailableV2, RadarResetPublicationTiming, RadarResetReadActionsRequestV2, RadarResetReadActionsSuccessV2, RadarResetReadChangesRequestV2, RadarResetReadChangesSuccessV2, RadarResetReadDetailBatchRequestV2, RadarResetReadHeadRequestV2, RadarResetReadHeadSuccessV2, RadarResetSafeCauseSnapshotV2, RadarResetSafeCauseValueV2, RadarResetSha256V2, RadarResetSnapshotAvailableV1, RadarResetSourceContractErrorInputV2, RadarResetSourceContractErrorV2, RadarResetSourceErrorCodeV2, RadarResetSourceErrorEnvelopeV2, RadarResetSourceErrorV2, RadarResetSourceTranslations, RadarResetUInt64DecimalV2, RadarResetUtcTimestampV2, RadarTiboSourceStatus, RadarTitledActivityFile, RadarTitledActivityProgress, RadarWebsiteLocale, activeRadarResetClue, compareRadarNotificationTasks, compareRadarResetActionDetailsV1, compareRadarResetUtcTimestampsV1, createRadarBrowserNotificationProjection, createRadarCodexProgressCalendar, createRadarNotificationProjection, createRadarResetSourceErrorEnvelopeV2, encodeRadarActivityFile, encodeRadarActivityFileV2, encodeRadarActivityFileV3, encodeRadarResetDetailMultipartV2, encodeRadarTitledActivityFile, formatRadarResetPositiveDecimalV2, formatRadarResetUInt64DecimalV2, initialRadarBrowserSubscription, initialRadarBrowserSubscriptionV2, parseRadarCodexModels, parseRadarCodexProgressChangeV3, parseRadarCodexProgressChangesV3, parseRadarCodexProgressV1, parseRadarCodexProgressV2, parseRadarCodexProgressV3, parseRadarCodexProgressV4, parseRadarCodexProgressV5, parseRadarCodexReleaseDirectory, parseRadarCodexReleaseMonth, parseRadarCodexReleaseNotes, parseRadarResetActionDetailV1, parseRadarResetActionDetailV2, parseRadarResetActionSummaryV2, parseRadarResetAnalysisV1, parseRadarResetClueSnapshot, parseRadarResetDetailMultipartV2, parseRadarResetExportV1, parseRadarResetExportV2, parseRadarResetPendingActionV1, parseRadarResetPendingActionV2, parseRadarResetPositiveDecimalV2, parseRadarResetPublicationHomeFactsV2, parseRadarResetPublicationRevisionAvailableV2, parseRadarResetReadActionsRequestV2, parseRadarResetReadActionsSuccessV2, parseRadarResetReadChangesRequestV2, parseRadarResetReadChangesSuccessV2, parseRadarResetReadDetailBatchRequestV2, parseRadarResetReadHeadRequestV2, parseRadarResetReadHeadSuccessV2, parseRadarResetSnapshotAvailableV1, parseRadarResetSourceErrorEnvelopeV2, parseRadarResetUInt64DecimalV2, projectRadarBrowserSubscriptionSelection, projectRadarBrowserSubscriptionV1, projectRadarResetExportV1FromV2, projectRadarResetPrimarySourceV1, radarActivityEventIdSchema, radarActivityFileSchema, radarActivityFileUrl, radarActivityFileV2Schema, radarActivityFileV2Url, radarActivityFileV3Schema, radarActivityFileV3Url, radarActivityMaxBytes, radarActivityProgressSchema, radarActivityProgressV2Schema, radarActivityProgressV3Schema, radarActivityReactionCountsSchema, radarActivityReactionIdSchema, radarActivityReactionIds, radarBrowserNotificationProjectionSchema, radarBrowserNotificationTopicSchema, radarBrowserRegistrationSchema, radarBrowserSubscriptionErrorRes, radarBrowserSubscriptionFailureSchema, radarBrowserSubscriptionOperationSchema, radarBrowserSubscriptionReadReq, radarBrowserSubscriptionRes, radarBrowserSubscriptionSaveReq, radarBrowserSubscriptionSaveV2Req, radarBrowserSubscriptionV2Res, radarBrowserSubscriptionViewSchema, radarBrowserSubscriptionViewV2Schema, radarBrowserSubscriptionsPath, radarBrowserTopicsSchema, radarBrowserTopicsV2Schema, radarCodexGuessChoiceSchema, radarCodexGuessErrorSchema, radarCodexGuessSaveReqSchema, radarCodexGuessViewSchema, radarCodexModelIdSchema, radarCodexModelUrl, radarCodexModelsMaxBytes, radarCodexModelsPath, radarCodexModelsSchema, radarCodexProgressCalendar, radarCodexProgressChangeSchema, radarCodexProgressChangeV2Schema, radarCodexProgressChangeV3Schema, radarCodexProgressChangesV1Schema, radarCodexProgressChangesV2Schema, radarCodexProgressChangesV3Schema, radarCodexProgressEntrySchema, radarCodexProgressEntryV3Schema, radarCodexProgressEntryV5Schema, radarCodexProgressImprovementV5Schema, radarCodexProgressPostRoleV5Schema, radarCodexProgressPostV5Schema, radarCodexProgressPostsV5Schema, radarCodexProgressResetEntryV5Schema, radarCodexProgressScore, radarCodexProgressTitleV3Schema, radarCodexProgressV1Schema, radarCodexProgressV2MaxBytes, radarCodexProgressV2Schema, radarCodexProgressV3MaxBytes, radarCodexProgressV3Schema, radarCodexProgressV4MaxBytes, radarCodexProgressV4Schema, radarCodexProgressV5MaxBytes, radarCodexProgressV5Schema, radarCodexReleaseDirectoryMaxBytes, radarCodexReleaseDirectoryPath, radarCodexReleaseDirectorySchema, radarCodexReleaseIdentitySchema, radarCodexReleaseMonthMaxBytes, radarCodexReleaseMonthPath, radarCodexReleaseMonthSchema, radarCodexReleaseNotesMaxBytes, radarCodexReleaseNotesPath, radarCodexReleaseNotesSchema, radarCodexReleaseSectionsSchema, radarCodexReleaseUrl, radarCodexTimePointSchema, radarImprovementColumnPath, radarImprovementEligibilityReq, radarImprovementEligibilityRes, radarImprovementEntrySchema, radarImprovementErrorRes, radarImprovementHeadReq, radarImprovementHeadRes, radarImprovementPageMaxBytes, radarImprovementPageReq, radarImprovementPageRes, radarImprovementPageSize, radarNotificationProjectionSchema, radarNotificationTargetSchema, radarNotificationTaskPageSize, radarNotificationTaskSchema, radarNotificationTasksPath, radarNotificationTasksReq, radarNotificationTasksRes, radarNotificationTopicSchema, radarNotificationTopicsSchema, radarResetActionDetailV1Schema, radarResetActionDetailV2Schema, radarResetActionItemV2Schema, radarResetActionPageMaxBytesV2, radarResetActionPageMaxItemsV2, radarResetActionSummaryV2Schema, radarResetActiveActionItemV2Schema, radarResetAnalysisV1Schema, radarResetAnalyzerContractVersionV1, radarResetAudienceValues, radarResetChangeCoverageV2Schema, radarResetChangePageMaxBytesV2, radarResetChangePageMaxItemsV2, radarResetClueLifetimeMs, radarResetClueMaxBytes, radarResetCluePath, radarResetClueSchema, radarResetClueSnapshotSchema, radarResetContractVersionV1, radarResetContractVersionV2, radarResetDetailBatchMaxBytesV2, radarResetDetailBatchMaxChunksV2, radarResetDetailChunkReferenceV2Schema, radarResetDetailChunkRequestV2Schema, radarResetDetailManifestV2Schema, radarResetEffectValues, radarResetExportV1Schema, radarResetExportV2Schema, radarResetManagementActionSchema, radarResetManagementOperationSchema, radarResetManagementResSchema, radarResetManualApplyReqSchema, radarResetManualCopySchema, radarResetManualDraftSchema, radarResetManualDraftSeedSchema, radarResetManualPreviewReqSchema, radarResetManualPreviewResSchema, radarResetManualResultResSchema, radarResetNoticeKindValues, radarResetPendingActionV1Schema, radarResetPendingActionV2Schema, radarResetPlanValues, radarResetPositiveDecimalV2Schema, radarResetProductValues, radarResetPublicDataLimits, radarResetPublicIdV2Schema, radarResetPublicationHomeFactsV2Schema, radarResetPublicationRevisionAvailableV2Schema, radarResetPublicationTimingSchema, radarResetReadActionsDataV2Schema, radarResetReadActionsRequestV2Schema, radarResetReadActionsSuccessV2Schema, radarResetReadChangesDataV2Schema, radarResetReadChangesRequestV2Schema, radarResetReadChangesSuccessV2Schema, radarResetReadDetailBatchRequestV2Schema, radarResetReadHeadDataV2Schema, radarResetReadHeadRequestV2Schema, radarResetReadHeadSuccessV2Schema, radarResetReasonBasisValues, radarResetReasonCategoryValues, radarResetSafeCauseSnapshotV2Schema, radarResetSeriesValues, radarResetSha256V2Schema, radarResetSnapshotAvailableV1Schema, radarResetSourceChangeV2Schema, radarResetSourceErrorCodeValuesV2, radarResetSourceErrorEnvelopeV2Schema, radarResetSourceErrorHttpStatusV2, radarResetSourceErrorIsRetryableV2, radarResetSourceErrorV2Schema, radarResetSourceMaxRpcCallsV2, radarResetSourceTranslationsSchema, radarResetUInt64DecimalV2Schema, radarResetUInt64DecimalV2ToBigInt, radarResetUtcTimestampV2Schema, radarResetWithdrawnActionItemV2Schema, radarTiboSourceStatusMaxBytes, radarTiboSourceStatusPath, radarTiboSourceStatusSchema, radarTitledActivityFileSchema, radarTitledActivityProgressSchema, radarWebsiteLocalePrefixes, radarWebsiteLocales, radarWebsiteOrigin, radarWebsitePagePaths, radarWebsitePageUrl, readRadarActivityFile, readRadarActivityFileV2, readRadarActivityFileV3, readRadarCodexModels, readRadarCodexReleaseDirectory, readRadarCodexReleaseMonth, readRadarCodexReleaseNotes, readRadarResetClueSnapshot, readRadarTiboSourceStatus, readRadarTitledActivityFile, redactRadarBrowserRegistrationReferences, toSafeCauseSnapshotV2, upgradeRadarBrowserSubscriptionCommandV1 };
|
|
8286
|
+
export { CreateRadarResetSourceErrorEnvelopeInputV2, RadarActivityFile, RadarActivityFileV2, RadarActivityFileV3, RadarActivityProgress, RadarActivityProgressV2, RadarActivityProgressV3, RadarActivityReactionId, RadarBrowserNotificationProjection, RadarBrowserSubscriptionFailure, RadarBrowserSubscriptionRead, RadarBrowserSubscriptionSave, RadarBrowserSubscriptionSaveV2, RadarBrowserSubscriptionView, RadarBrowserSubscriptionViewV2, RadarBrowserTopics, RadarBrowserTopicsV2, RadarCodexGuessChoice, RadarCodexGuessError, RadarCodexGuessSaveReq, RadarCodexGuessView, RadarCodexModel, RadarCodexModels, RadarCodexProgressChange, RadarCodexProgressChangeV2, RadarCodexProgressChangeV3, RadarCodexProgressChangesV1, RadarCodexProgressChangesV2, RadarCodexProgressChangesV3, RadarCodexProgressEntryV3, RadarCodexProgressEntryV5, RadarCodexProgressImprovementV5, RadarCodexProgressPostRoleV5, RadarCodexProgressPostV5, RadarCodexProgressResetEntryV5, RadarCodexProgressTitleV3, RadarCodexProgressV1, RadarCodexProgressV2, RadarCodexProgressV3, RadarCodexProgressV4, RadarCodexProgressV5, RadarCodexReleaseDirectory, RadarCodexReleaseMonth, RadarCodexReleaseNotes, RadarCodexTimePoint, RadarImprovementEntry, RadarImprovementHead, RadarImprovementPage, RadarNotificationProjection, RadarNotificationTarget, RadarNotificationTask, RadarNotificationTasks, RadarNotificationTopic, RadarResetActionDetailV1, RadarResetActionDetailV2, RadarResetActionItemV2, RadarResetActionSummaryV2, RadarResetActiveActionItemV2, RadarResetAnalysisV1, RadarResetClue, RadarResetClueSnapshot, RadarResetDetailChunkReferenceV2, RadarResetDetailChunkRequestV2, RadarResetDetailManifestV2, RadarResetDetailMultipartEncodeInputV2, RadarResetDetailMultipartParseInputV2, RadarResetDetailMultipartPartV2, RadarResetExportV1, RadarResetExportV2, RadarResetManagement, RadarResetPendingActionV1, RadarResetPendingActionV2, RadarResetPositiveDecimalV2, RadarResetPrimarySourceV1, RadarResetPublicActionV1, RadarResetPublicIdV2, RadarResetPublicRecordsV1, RadarResetPublicationHomeFactsV2, RadarResetPublicationRevisionAvailableV2, RadarResetPublicationTiming, RadarResetReadActionsRequestV2, RadarResetReadActionsSuccessV2, RadarResetReadChangesRequestV2, RadarResetReadChangesSuccessV2, RadarResetReadDetailBatchRequestV2, RadarResetReadHeadRequestV2, RadarResetReadHeadSuccessV2, RadarResetSafeCauseSnapshotV2, RadarResetSafeCauseValueV2, RadarResetSha256V2, RadarResetSnapshotAvailableV1, RadarResetSourceContractErrorInputV2, RadarResetSourceContractErrorV2, RadarResetSourceErrorCodeV2, RadarResetSourceErrorEnvelopeV2, RadarResetSourceErrorV2, RadarResetSourceTranslations, RadarResetUInt64DecimalV2, RadarResetUtcTimestampV2, RadarTiboSourceStatus, RadarTitledActivityFile, RadarTitledActivityProgress, RadarWebsiteLocale, activeRadarResetClue, compareRadarNotificationTasks, compareRadarResetActionDetailsV1, compareRadarResetUtcTimestampsV1, createRadarBrowserNotificationProjection, createRadarCodexProgressCalendar, createRadarNotificationProjection, createRadarResetSourceErrorEnvelopeV2, encodeRadarActivityFile, encodeRadarActivityFileV2, encodeRadarActivityFileV3, encodeRadarResetDetailMultipartV2, encodeRadarTitledActivityFile, formatRadarResetPositiveDecimalV2, formatRadarResetUInt64DecimalV2, initialRadarBrowserSubscription, initialRadarBrowserSubscriptionV2, parseRadarCodexModels, parseRadarCodexProgressChangeV3, parseRadarCodexProgressChangesV3, parseRadarCodexProgressV1, parseRadarCodexProgressV2, parseRadarCodexProgressV3, parseRadarCodexProgressV4, parseRadarCodexProgressV5, parseRadarCodexReleaseDirectory, parseRadarCodexReleaseMonth, parseRadarCodexReleaseNotes, parseRadarResetActionDetailV1, parseRadarResetActionDetailV2, parseRadarResetActionSummaryV2, parseRadarResetAnalysisV1, parseRadarResetClueSnapshot, parseRadarResetDetailMultipartV2, parseRadarResetExportV1, parseRadarResetExportV2, parseRadarResetPendingActionV1, parseRadarResetPendingActionV2, parseRadarResetPositiveDecimalV2, parseRadarResetPublicationHomeFactsV2, parseRadarResetPublicationRevisionAvailableV2, parseRadarResetReadActionsRequestV2, parseRadarResetReadActionsSuccessV2, parseRadarResetReadChangesRequestV2, parseRadarResetReadChangesSuccessV2, parseRadarResetReadDetailBatchRequestV2, parseRadarResetReadHeadRequestV2, parseRadarResetReadHeadSuccessV2, parseRadarResetSnapshotAvailableV1, parseRadarResetSourceErrorEnvelopeV2, parseRadarResetUInt64DecimalV2, projectRadarBrowserSubscriptionSelection, projectRadarBrowserSubscriptionV1, projectRadarResetExportV1FromV2, projectRadarResetPrimarySourceV1, projectRadarResetPublicActionToV2, radarActivityEventIdSchema, radarActivityFileSchema, radarActivityFileUrl, radarActivityFileV2Schema, radarActivityFileV2Url, radarActivityFileV3Schema, radarActivityFileV3Url, radarActivityMaxBytes, radarActivityProgressSchema, radarActivityProgressV2Schema, radarActivityProgressV3Schema, radarActivityReactionCountsSchema, radarActivityReactionIdSchema, radarActivityReactionIds, radarBrowserNotificationProjectionSchema, radarBrowserNotificationTopicSchema, radarBrowserRegistrationSchema, radarBrowserSubscriptionErrorRes, radarBrowserSubscriptionFailureSchema, radarBrowserSubscriptionOperationSchema, radarBrowserSubscriptionReadReq, radarBrowserSubscriptionRes, radarBrowserSubscriptionSaveReq, radarBrowserSubscriptionSaveV2Req, radarBrowserSubscriptionV2Res, radarBrowserSubscriptionViewSchema, radarBrowserSubscriptionViewV2Schema, radarBrowserSubscriptionsPath, radarBrowserTopicsSchema, radarBrowserTopicsV2Schema, radarCodexGuessChoiceSchema, radarCodexGuessErrorSchema, radarCodexGuessSaveReqSchema, radarCodexGuessViewSchema, radarCodexModelIdSchema, radarCodexModelUrl, radarCodexModelsMaxBytes, radarCodexModelsPath, radarCodexModelsSchema, radarCodexProgressCalendar, radarCodexProgressChangeSchema, radarCodexProgressChangeV2Schema, radarCodexProgressChangeV3Schema, radarCodexProgressChangesV1Schema, radarCodexProgressChangesV2Schema, radarCodexProgressChangesV3Schema, radarCodexProgressEntrySchema, radarCodexProgressEntryV3Schema, radarCodexProgressEntryV5Schema, radarCodexProgressImprovementV5Schema, radarCodexProgressPostRoleV5Schema, radarCodexProgressPostV5Schema, radarCodexProgressPostsV5Schema, radarCodexProgressResetEntryV5Schema, radarCodexProgressScore, radarCodexProgressTitleV3Schema, radarCodexProgressV1Schema, radarCodexProgressV2MaxBytes, radarCodexProgressV2Schema, radarCodexProgressV3MaxBytes, radarCodexProgressV3Schema, radarCodexProgressV4MaxBytes, radarCodexProgressV4Schema, radarCodexProgressV5MaxBytes, radarCodexProgressV5Schema, radarCodexReleaseDirectoryMaxBytes, radarCodexReleaseDirectoryPath, radarCodexReleaseDirectorySchema, radarCodexReleaseIdentitySchema, radarCodexReleaseMonthMaxBytes, radarCodexReleaseMonthPath, radarCodexReleaseMonthSchema, radarCodexReleaseNotesMaxBytes, radarCodexReleaseNotesPath, radarCodexReleaseNotesSchema, radarCodexReleaseSectionsSchema, radarCodexReleaseUrl, radarCodexTimePointSchema, radarImprovementColumnPath, radarImprovementEligibilityReq, radarImprovementEligibilityRes, radarImprovementEntrySchema, radarImprovementErrorRes, radarImprovementHeadReq, radarImprovementHeadRes, radarImprovementPageMaxBytes, radarImprovementPageReq, radarImprovementPageRes, radarImprovementPageSize, radarNotificationProjectionSchema, radarNotificationTargetSchema, radarNotificationTaskPageSize, radarNotificationTaskSchema, radarNotificationTasksPath, radarNotificationTasksReq, radarNotificationTasksRes, radarNotificationTopicSchema, radarNotificationTopicsSchema, radarResetActionDetailV1Schema, radarResetActionDetailV2Schema, radarResetActionItemV2Schema, radarResetActionPageMaxBytesV2, radarResetActionPageMaxItemsV2, radarResetActionSummaryV2Schema, radarResetActiveActionItemV2Schema, radarResetAnalysisV1Schema, radarResetAnalyzerContractVersionV1, radarResetAudienceValues, radarResetChangeCoverageV2Schema, radarResetChangePageMaxBytesV2, radarResetChangePageMaxItemsV2, radarResetClueLifetimeMs, radarResetClueMaxBytes, radarResetCluePath, radarResetClueSchema, radarResetClueSnapshotSchema, radarResetContractVersionV1, radarResetContractVersionV2, radarResetDetailBatchMaxBytesV2, radarResetDetailBatchMaxChunksV2, radarResetDetailChunkReferenceV2Schema, radarResetDetailChunkRequestV2Schema, radarResetDetailManifestV2Schema, radarResetEffectValues, radarResetExportV1Schema, radarResetExportV2Schema, radarResetKindNoticeV2Schema, radarResetManagementActionSchema, radarResetManagementOperationSchema, radarResetManagementResSchema, radarResetManualApplyReqSchema, radarResetManualCopySchema, radarResetManualDraftSchema, radarResetManualDraftSeedSchema, radarResetManualPreviewReqSchema, radarResetManualPreviewResSchema, radarResetManualResultResSchema, radarResetNoticeKindValues, radarResetPendingActionV1Schema, radarResetPendingActionV2Schema, radarResetPlanValues, radarResetPositiveDecimalV2Schema, radarResetProductValues, radarResetPublicActionV1Schema, radarResetPublicDataLimits, radarResetPublicIdV2Schema, radarResetPublicRecordsCorePath, radarResetPublicRecordsV1Schema, radarResetPublicationHomeFactsV2Schema, radarResetPublicationRevisionAvailableV2Schema, radarResetPublicationTimingSchema, radarResetReadActionsDataV2Schema, radarResetReadActionsRequestV2Schema, radarResetReadActionsSuccessV2Schema, radarResetReadChangesDataV2Schema, radarResetReadChangesRequestV2Schema, radarResetReadChangesSuccessV2Schema, radarResetReadDetailBatchRequestV2Schema, radarResetReadHeadDataV2Schema, radarResetReadHeadRequestV2Schema, radarResetReadHeadSuccessV2Schema, radarResetReasonBasisValues, radarResetReasonCategoryValues, radarResetSafeCauseSnapshotV2Schema, radarResetSeriesValues, radarResetSha256V2Schema, radarResetSnapshotAvailableV1Schema, radarResetSourceChangeV2Schema, radarResetSourceErrorCodeValuesV2, radarResetSourceErrorEnvelopeV2Schema, radarResetSourceErrorHttpStatusV2, radarResetSourceErrorIsRetryableV2, radarResetSourceErrorV2Schema, radarResetSourceMaxRpcCallsV2, radarResetSourceTranslationsSchema, radarResetUInt64DecimalV2Schema, radarResetUInt64DecimalV2ToBigInt, radarResetUnexecutedActionV1Schema, radarResetUtcTimestampV2Schema, radarResetWithdrawnActionItemV2Schema, radarResetWithdrawnActionV1Schema, radarTiboSourceStatusMaxBytes, radarTiboSourceStatusPath, radarTiboSourceStatusSchema, radarTitledActivityFileSchema, radarTitledActivityProgressSchema, radarWebsiteLocalePrefixes, radarWebsiteLocales, radarWebsiteOrigin, radarWebsitePagePaths, radarWebsitePageUrl, readRadarActivityFile, readRadarActivityFileV2, readRadarActivityFileV3, readRadarCodexModels, readRadarCodexReleaseDirectory, readRadarCodexReleaseMonth, readRadarCodexReleaseNotes, readRadarResetClueSnapshot, readRadarTiboSourceStatus, readRadarTitledActivityFile, redactRadarBrowserRegistrationReferences, toSafeCauseSnapshotV2, upgradeRadarBrowserSubscriptionCommandV1 };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{z as e}from"zod";const t=1,n=4,r=Object.freeze({exportUtf8Bytes:2*1024*1024,analysis:Object.freeze({actions:512,intervals:511}),actionDetail:Object.freeze({noticeTimeline:64,reasons:128}),text:Object.freeze({publicTextCodePoints:500,evidenceExcerptCodePoints:500,urlCodePoints:2048})}),i=[`all`,`hard_reset`,`banked_reset`],a=[`hard_reset`,`banked_reset`],o=[`codex`,`chatgpt_work`],s=[`all_users`,`paid_users`,`named_plans`,`affected_subset`],c=[`plus`,`pro`],l=[`incident_compensation`,`user_milestone`,`celebration`],ee=[`explicit_in_reset_post`,`explicit_in_related_source`,`contextual_inference`,`unknown`],te=[`weekday`,`weekday_group`,`hour`,`six_hour_block`,`month`,`day_of_month`,`week_of_month`,`weekday_hour`,`minute_of_hour`,`five_minute_bucket`,`half_hour_slot`,`time_of_day_minute`],ne=[`month`,`weekday`,`hour`,`six_hour_block`],u=e.number().finite(),d=u.min(0),f=e.number().int().min(0),p=e.number().int().positive(),m=u.min(0).max(1),h=e.iso.datetime({offset:!0}).refine(e=>e.endsWith(`Z`),{message:`utc_timestamp_required`}).refine(e=>/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(e),{message:`utc_timestamp_seconds_required`}),g=e.string().min(1).max(128).refine(e=>e===e.trim()&&!/[\p{Cc}\p{Cf}]/u.test(e),{message:`public_id_invalid`}),_=e.enum(i),re=e.enum(l),ie=e.enum(ee),ae=e.object({contractVersion:e.literal(1),eventId:g,eventType:e.literal(`reset_analysis_snapshot_available`),analysisSnapshotId:g,sourceWatermark:g,occurredAt:h}).strict();function oe(e){return ae.parse(e)}function se(e){return[...e].length}function ce(e){return new TextEncoder().encode(JSON.stringify(e)).byteLength}const le=e.string().refine(e=>se(e)<=r.text.evidenceExcerptCodePoints,{message:`evidence_excerpt_too_long`}),ue=e.string().refine(e=>e.trim().length>0,{message:`source_text_empty`}),de=e.string().refine(e=>se(e)<=r.text.publicTextCodePoints,{message:`public_text_too_long`}),fe=e.string().refine(e=>e.trim().length>0,{message:`source_account_display_name_blank`}).refine(e=>se(e)<=r.text.publicTextCodePoints,{message:`source_account_display_name_too_long`}),pe=e.string().refine(e=>se(e)<=r.text.urlCodePoints,{message:`source_url_too_long`}).refine(e=>{if([...e].some(e=>{let t=e.codePointAt(0);return t===void 0||t<=31||t===127}))return!1;try{let t=new URL(e);return t.protocol===`https:`&&t.username.length===0&&t.password.length===0}catch{return!1}},{message:`https_url_required`});function v(e){return new Set(e).size===e.length}const me=e.discriminatedUnion(`state`,[e.object({state:e.literal(`known`),values:e.array(e.enum(a)).min(1).refine(v,{message:`reset_effects_must_be_unique`})}).strict(),e.object({state:e.literal(`unknown`),values:e.tuple([])}).strict()]),he=e.object({products:e.array(e.enum(o)).refine(v,{message:`products_must_be_unique`}),audienceClaims:e.array(e.object({audience:e.enum(s),plans:e.array(e.enum(c)).refine(v,{message:`plans_must_be_unique`}),subsetSummary:de.nullable()}).strict())}).strict(),ge=e.object({resetActionId:g,firstAnnouncedAt:h,effectiveAt:h.nullable(),resetEffects:me,actionScope:he,reasonCategories:e.array(re).refine(v,{message:`reason_categories_must_be_unique`}),noticeCount:p,previousAllActionDays:d.nullable(),previousHardResetActionDays:d.nullable(),previousBankedResetActionDays:d.nullable()}).strict(),_e=e.object({series:_,previousActionId:g,actionId:g,fromFirstAnnouncedAt:h,toFirstAnnouncedAt:h,days:d}).strict(),ve=e.object({count:p,min:d,max:d,mean:d,median:d,percentile25:d,percentile75:d,percentile90:d,standardDeviation:d,coefficientOfVariation:d.nullable(),interquartileRange:d}).strict(),ye=e.object({lower:d,upper:d}).strict(),be=e.object({iterations:p,seed:e.number().int(),mean95:ye,median95:ye}).strict(),xe=e.object({bucket:e.string().min(1),lowerInclusive:d,upperExclusive:d.nullable(),count:f,share:m}).strict(),Se=e.object({endingIndex:f,windowSize:p,mean:d,median:d}).strict(),Ce=e.object({firstHalf:ve.nullable(),secondHalf:ve.nullable(),meanChangeDays:u.nullable(),meanChangePercent:u.nullable()}).strict(),we=e.object({series:_,actionCount:f,completedIntervalCount:f,intervalSummary:ve.nullable(),bootstrap95:be.nullable(),intervalHistogram:e.array(xe),shortestIntervals:e.array(_e),longestIntervals:e.array(_e),rolling3:e.array(Se),rolling5:e.array(Se),linearSlopeDaysPerInterval:u.nullable(),halfComparison:Ce,survivalCurve:e.array(e.object({elapsedDays:d,survivalProbability:m}).strict())}).strict(),Te=e.object({series:_,elapsedDays:d,horizonDays:d,sampleAtRisk:f,eventsWithinWindow:f,probability:m.nullable()}).strict(),Ee=e.object({key:e.string(),count:f,share:m,timeZone:e.string().min(1),series:_,dimension:e.enum(te)}).strict(),De=e.object({timeZone:e.string().min(1),series:_,dimension:e.enum(te),categoryCount:p,nonZeroCategoryCount:f,maxShare:m,herfindahlIndex:m,normalizedEntropy:m}).strict(),Oe=e.object({startMinute:e.number().int().min(0).max(1439),endMinute:e.number().int().min(0).max(1439),wrapsMidnight:e.boolean(),eventCount:f,share:m}).strict(),ke=e.object({timeZone:e.string().min(1),series:_,eventCount:p,slotMinutes:p,fixedWindows:e.array(e.object({durationMinutes:p,bestWindows:e.array(Oe)}).strict()),coverageWindows:e.array(e.object({targetShare:m,requiredEventCount:p,durationMinutes:p,bestWindows:e.array(Oe)}).strict())}).strict(),Ae=e.object({series:_,thresholdDays:d,clusterCount:f,multiEventClusterCount:f,largestClusterSize:f,eventsInMultiEventClusters:f,eventShareInMultiEventClusters:m}).strict(),je=e.object({category:re,actionCount:f,actionShare:m,hardResetActionCount:f,bankedResetActionCount:f,explicitInResetPostCount:f,explicitInRelatedSourceCount:f,contextualInferenceCount:f,unknownCount:f}).strict(),Me=e.object({category:re,series:_,timeZone:e.string().min(1),dimension:e.enum(ne),key:e.string(),eventCount:f,reasonEventCount:f,binEventCount:f,seriesEventCount:f,shareWithinReason:m.nullable(),shareWithinBin:m.nullable(),shareOfSeries:m.nullable()}).strict(),Ne=e.object({overview:e.object({actionCount:p,hardResetActionCount:f,bankedResetActionCount:f,firstAnnouncedAt:h,lastAnnouncedAt:h,coverageDays:d,sourceNoticeCount:p}).strict(),actions:e.array(ge).min(1).max(r.analysis.actions),intervals:e.array(_e).max(r.analysis.intervals),series:e.object({all:we,hard_reset:we,banked_reset:we}).strict(),historicalConditionalFrequencies:e.array(Te),calendars:e.array(Ee),calendarConcentrations:e.array(De),intradayRanges:e.array(ke),clusters:e.array(Ae),reasons:e.object({summary:e.array(je),crossTabs:e.array(Me)}).strict(),caveats:e.array(de.min(1))}).strict(),Pe=e.object({contractVersion:e.literal(1),analyzerContractVersion:e.literal(4),generatedAt:h,analysisWindow:e.object({startAt:h,startInclusive:e.boolean(),timeBasis:e.literal(`first_announcement`),throughFirstAnnouncedAt:h}).strict(),result:Ne}).strict().superRefine((e,t)=>{let n=e.result.actions,r=e.result.overview;n.length!==r.actionCount&&t.addIssue({code:`custom`,message:`analysis_action_count_mismatch`,path:[`result`,`actions`]});let a=new Set;for(let e=0;e<n.length;e+=1){let r=n[e];a.has(r.resetActionId)&&t.addIssue({code:`custom`,message:`analysis_action_identity_duplicate`,path:[`result`,`actions`,e,`resetActionId`]}),a.add(r.resetActionId);let i=n[e-1];i!==void 0&&(i.firstAnnouncedAt>r.firstAnnouncedAt||i.firstAnnouncedAt===r.firstAnnouncedAt&&i.resetActionId>r.resetActionId)&&t.addIssue({code:`custom`,message:`analysis_actions_not_stably_sorted`,path:[`result`,`actions`,e]})}let o=(e,r,i)=>{i!==void 0&&e.series!==i&&t.addIssue({code:`custom`,message:`analysis_interval_series_mismatch`,path:[...r,`series`]});let a=i??e.series,o=a===`all`?n:n.filter(e=>e.resetEffects.state===`known`&&e.resetEffects.values.includes(a)),s=o.findIndex(t=>t.resetActionId===e.actionId),c=o[s];if(c===void 0){t.addIssue({code:`custom`,message:`analysis_interval_action_mismatch`,path:[...r,`actionId`]});return}let l=o[s-1];(l===void 0||e.previousActionId!==l.resetActionId)&&t.addIssue({code:`custom`,message:`analysis_interval_previous_action_mismatch`,path:[...r,`previousActionId`]}),l!==void 0&&e.fromFirstAnnouncedAt!==l.firstAnnouncedAt&&t.addIssue({code:`custom`,message:`analysis_interval_from_first_announcement_mismatch`,path:[...r,`fromFirstAnnouncedAt`]}),e.toFirstAnnouncedAt!==c.firstAnnouncedAt&&t.addIssue({code:`custom`,message:`analysis_interval_to_first_announcement_mismatch`,path:[...r,`toFirstAnnouncedAt`]})};e.result.intervals.forEach((e,t)=>o(e,[`result`,`intervals`,t]));for(let t of i){let n=e.result.series[t];for(let e of[`shortestIntervals`,`longestIntervals`])n[e].forEach((n,r)=>o(n,[`result`,`series`,t,e,r],t))}n[0]?.firstAnnouncedAt!==r.firstAnnouncedAt&&t.addIssue({code:`custom`,message:`analysis_first_action_mismatch`,path:[`result`,`overview`,`firstAnnouncedAt`]}),(n.at(-1)?.firstAnnouncedAt!==r.lastAnnouncedAt||e.analysisWindow.throughFirstAnnouncedAt!==r.lastAnnouncedAt)&&t.addIssue({code:`custom`,message:`analysis_last_action_mismatch`,path:[`result`,`overview`,`lastAnnouncedAt`]});for(let[n,r]of Object.entries({all:`all`,hard_reset:`hard_reset`,banked_reset:`banked_reset`}))e.result.series[n].series!==r&&t.addIssue({code:`custom`,message:`analysis_series_identity_mismatch`,path:[`result`,`series`,n,`series`]})}),Fe=e.object({excerpt:le,sourceUrl:pe}).strict();function Ie(e,t){try{return He(e,t)}catch{return}}function y(e,t){try{return C(e,t)}catch{return}}const b=e.object({contractVersion:e.literal(1),resetActionId:g,firstAnnouncedAt:h,effectiveAt:h.nullable(),resetEffects:me,actionScope:he,noticeCount:p,reasons:e.array(e.object({category:re,summary:de.min(1),basis:ie,evidence:e.array(Fe).min(1)}).strict()).max(r.actionDetail.reasons),noticeTimeline:e.array(e.object({phase:e.enum([`preview`,`executed`]),authoredAt:h,contentCompleteness:e.enum([`verified_full_text`,`verified_excerpt`]),sourceText:ue,sourceTextZh:ue.nullable(),sourceUrl:pe,sourceAccount:e.object({displayName:fe}).strict()}).strict()).min(1).max(r.actionDetail.noticeTimeline)}).strict().superRefine((e,t)=>{e.noticeCount!==e.noticeTimeline.length&&t.addIssue({code:`custom`,message:`action_notice_count_mismatch`,path:[`noticeCount`]});for(let n=0;n<e.noticeTimeline.length;n+=1){let r=e.noticeTimeline[n];if(n===0){let n=y(r.authoredAt,e.firstAnnouncedAt);n!==void 0&&n!==0&&t.addIssue({code:`custom`,message:`notice_timeline_first_announcement_mismatch`,path:[`noticeTimeline`,0,`authoredAt`]});continue}let i=e.noticeTimeline[n-1],a=y(i.authoredAt,r.authoredAt);a!==void 0&&a>0&&t.addIssue({code:`custom`,message:`notice_timeline_not_ascending`,path:[`noticeTimeline`,n,`authoredAt`]})}}),Le=[`preview`,`executed`,`schedule_change`,`scope_change`,`cancel_preview`,`delivery_issue`,`make_up`,`repair`,`update`],Re=e.object({resolution:e.enum([`resolved`,`unbounded`,`unresolved`]),evidence:e.string().trim().min(1).max(300).nullable(),precision:e.enum([`exact`,`approximate`,`range`]).nullable(),relation:e.enum([`instant`,`interval`,`deadline`,`not_before`,`unbounded`]).nullable(),effectiveWindow:e.object({earliestAt:e.iso.datetime(),latestAt:e.iso.datetime()}).strict().refine(e=>Date.parse(e.earliestAt)<=Date.parse(e.latestAt),{message:`publication_timing_window_inverted`}).nullable()}).strict().superRefine((e,t)=>{let n=e=>t.addIssue({code:`custom`,message:e});e.resolution===`resolved`!=(e.effectiveWindow!==null)&&n(`publication_timing_resolution_window_mismatch`),e.resolution===`unbounded`&&e.relation!==`unbounded`&&n(`publication_timing_unbounded_relation_required`);let r=e.effectiveWindow;e.resolution===`resolved`&&((e.relation===null||e.relation===`unbounded`)&&n(`publication_timing_bounded_relation_required`),r!==null&&e.relation===`interval`==(r.earliestAt===r.latestAt)&&n(`publication_timing_relation_window_mismatch`))}),x=e.object({resetActionId:g,state:e.enum([`preview`,`executed`]),resetEffects:me,executedEffects:e.array(e.enum(a)).refine(v),pendingEffects:e.array(e.enum(a)).refine(v),plannedTiming:Re.nullable(),noticeTimeline:e.array(b.shape.noticeTimeline.element.omit({phase:!0}).extend({kinds:e.array(e.enum(Le)).min(1).refine(v)}).strict()).min(1).max(r.actionDetail.noticeTimeline)}).strict().superRefine((e,t)=>{e.state===`preview`&&e.executedEffects.length>0&&t.addIssue({code:`custom`,message:`pending_preview_has_executed_effects`}),e.state===`executed`&&e.pendingEffects.length===0&&t.addIssue({code:`custom`,message:`pending_executed_action_has_no_pending_effects`});for(let n of[...e.executedEffects,...e.pendingEffects])new Set(e.resetEffects.values).has(n)||t.addIssue({code:`custom`,message:`pending_effect_not_declared`});e.executedEffects.some(t=>e.pendingEffects.includes(t))&&t.addIssue({code:`custom`,message:`pending_effect_already_executed`});for(let n=1;n<e.noticeTimeline.length;n+=1){let r=e.noticeTimeline[n-1],i=e.noticeTimeline[n],a=y(r.authoredAt,i.authoredAt);a!==void 0&&a>0&&t.addIssue({code:`custom`,message:`pending_notice_timeline_not_ascending`,path:[`noticeTimeline`,n]})}}),ze=e.object({contractVersion:e.literal(1),generatedAt:h,analysis:Pe,actions:e.array(b).min(1).max(r.analysis.actions),pendingResetActions:e.array(x).max(r.analysis.actions)}).strict();function Be(e,t){ce(e)>r.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`export_utf8_size_limit_exceeded`,path:[]});let n=y(e.generatedAt,e.analysis.generatedAt);n!==void 0&&n<0&&t.addIssue({code:`custom`,message:`export_generated_at_before_analysis`,path:[`generatedAt`]})}function Ve(e,t,n,r){(e.resetActionId!==t.resetActionId||e.firstAnnouncedAt!==t.firstAnnouncedAt||e.effectiveAt!==t.effectiveAt||e.noticeCount!==t.noticeCount||JSON.stringify(e.resetEffects)!==JSON.stringify(t.resetEffects)||JSON.stringify(e.actionScope)!==JSON.stringify(t.actionScope))&&r.addIssue({code:`custom`,message:`export_action_summary_mismatch`,path:[`actions`,n]});let i=[...new Set(e.reasons.map(e=>e.category))].sort();JSON.stringify(i)!==JSON.stringify([...t.reasonCategories].sort())&&r.addIssue({code:`custom`,message:`export_action_reason_categories_mismatch`,path:[`actions`,n,`reasons`]})}const S=ze.superRefine((e,t)=>{Be(e,t),v(e.pendingResetActions.map(e=>e.resetActionId))||t.addIssue({code:`custom`,message:`export_pending_action_identity_duplicate`,path:[`pendingResetActions`]});let n=new Map,r=new Set(e.analysis.result.actions.map(e=>e.resetActionId));for(let i=0;i<e.actions.length;i+=1){let a=e.actions[i];n.has(a.resetActionId)?t.addIssue({code:`custom`,message:`export_action_identity_duplicate`,path:[`actions`,i,`resetActionId`]}):n.set(a.resetActionId,i);let o=e.actions[i-1],s=o===void 0?void 0:Ie(o,a);s!==void 0&&s>0&&t.addIssue({code:`custom`,message:`export_actions_not_stably_sorted`,path:[`actions`,i]});let c=y(a.firstAnnouncedAt,e.analysis.analysisWindow.throughFirstAnnouncedAt);c!==void 0&&c>0&&t.addIssue({code:`custom`,message:`export_action_after_analysis_snapshot`,path:[`actions`,i,`firstAnnouncedAt`]});let l=y(a.firstAnnouncedAt,e.analysis.analysisWindow.startAt);l!==void 0&&(e.analysis.analysisWindow.startInclusive?l>=0:l>0)&&!r.has(a.resetActionId)&&t.addIssue({code:`custom`,message:`export_window_action_not_in_analysis`,path:[`actions`,i,`resetActionId`]})}for(let r of e.analysis.result.actions){let i=n.get(r.resetActionId);if(i===void 0){t.addIssue({code:`custom`,message:`export_analysis_action_missing`,path:[`actions`]});continue}Ve(e.actions[i],r,i,t)}});function C(e,t){let n=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d+))?Z$/,r=n.exec(e),i=n.exec(t);if(r===null||i===null)throw Error(`radar_reset_v1_timestamp_invalid`);let a=r[1],o=i[1];if(a<o)return-1;if(a>o)return 1;let s=r[2]??``,c=i[2]??``,l=Math.max(s.length,c.length);for(let e=0;e<l;e+=1){let t=s.charCodeAt(e)||48,n=c.charCodeAt(e)||48;if(t<n)return-1;if(t>n)return 1}return 0}function He(e,t){let n=C(e.firstAnnouncedAt,t.firstAnnouncedAt);return n===0?e.resetActionId<t.resetActionId?-1:+(e.resetActionId>t.resetActionId):n}function Ue(e){return Pe.parse(e)}function We(e){return b.parse(e)}function Ge(e){return S.parse(e)}function Ke(e){return x.parse(e)}function qe(e){let t;try{t=We(e)}catch(e){throw Error(`radar_reset_primary_source_action_invalid`,{cause:e})}let n=t.noticeTimeline[0];if(n===void 0)throw Error(`radar_reset_primary_source_notice_missing`);return Object.freeze({displayName:n.sourceAccount.displayName,sourceUrl:n.sourceUrl,excerpt:[...n.sourceText.trim()].slice(0,r.text.publicTextCodePoints).join(``)})}const Je=2,Ye=30,Xe=256,Ze=512*1024,Qe=256,$e=256*1024,et=32,tt=2*1024*1024,nt=9223372036854775807n,rt=e.string().regex(/^(?:0|[1-9][0-9]{0,18})$/,`uint64_decimal_noncanonical`).refine(e=>BigInt(e)<=nt,`uint64_decimal_out_of_range`),w=e.string().regex(/^[1-9][0-9]{0,18}$/,`positive_decimal_noncanonical`).refine(e=>BigInt(e)<=nt,`positive_decimal_out_of_range`);function it(e){return rt.parse(e)}function at(e){return w.parse(e)}function ot(e){return BigInt(it(e))}function st(e){if(e<0n||e>nt)throw RangeError(`uint64_decimal_out_of_range`);return e.toString()}function ct(e){if(e<1n||e>nt)throw RangeError(`positive_decimal_out_of_range`);return e.toString()}const T=e.iso.datetime({offset:!0}).refine(e=>e.endsWith(`Z`),`utc_timestamp_required`).refine(e=>/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(e),`utc_timestamp_seconds_required`),E=e.string().min(1).max(128).refine(e=>e===e.trim()&&!/[\p{Cc}\p{Cf}]/u.test(e),`public_id_invalid`),D=e.string().regex(/^sha256:[0-9a-f]{64}$/,`sha256_noncanonical`);function lt(e){return new Set(e).size===e.length}const ut=t=>e.array(t).refine(lt,`array_values_must_be_unique`),dt=t=>e.string().refine(e=>[...e].length<=t,`string_exceeds_${t}_code_points`),ft=e.number().finite().min(0),pt=e.number().int().min(0).max(2**53-1),O=e.number().int().positive().max(2**53-1),mt=e.enum([`hard_reset`,`banked_reset`]),ht=e.enum([`codex`,`chatgpt_work`]),gt=e.enum([`all_users`,`paid_users`,`named_plans`,`affected_subset`]),_t=e.enum([`plus`,`pro`]),vt=e.enum([`incident_compensation`,`user_milestone`,`celebration`]),yt=e.object({resetActionId:E,firstAnnouncedAt:T,effectiveAt:T.nullable(),resetEffects:e.union([e.object({state:e.literal(`known`),values:ut(mt).nonempty()}).strict(),e.object({state:e.literal(`unknown`),values:e.tuple([])}).strict()]),actionScope:e.object({products:ut(ht),audienceClaims:e.array(e.object({audience:gt,plans:ut(_t),subsetSummary:dt(500).nullable()}).strict())}).strict(),reasonCategories:ut(vt),noticeCount:O,previousAllActionDays:ft.nullable(),previousHardResetActionDays:ft.nullable(),previousBankedResetActionDays:ft.nullable()}).strict();function bt(e){return yt.parse(e)}const xt=e.object({generatedAt:T,availableRange:e.object({firstAnnouncedAt:T,lastAnnouncedAt:T}).strict().nullable(),current:e.object({summary:yt,status:e.object({phase:e.enum([`preview`,`executed`]),statusAt:T}).strict()}).strict().nullable()}).strict().superRefine((e,t)=>{if(e.availableRange===null!=(e.current===null)){t.addIssue({code:`custom`,message:`home_empty_state_inconsistent`});return}e.availableRange!==null&&e.current!==null&&e.current.summary.firstAnnouncedAt!==e.availableRange.lastAnnouncedAt&&t.addIssue({code:`custom`,message:`home_current_range_inconsistent`})});function St(e){return xt.parse(e)}const Ct=e.object({ordinal:pt,sha256:D,byteSize:O}).strict(),wt=e.object({sha256:D,byteSize:O,chunkCount:O,chunks:e.array(Ct).min(1)}).strict().superRefine((e,t)=>{e.chunkCount!==e.chunks.length&&t.addIssue({code:`custom`,message:`chunk_count_mismatch`});let n=0;for(let[r,i]of e.chunks.entries())i.ordinal!==r&&t.addIssue({code:`custom`,message:`chunk_ordinal_invalid`}),n+=i.byteSize;n!==e.byteSize&&t.addIssue({code:`custom`,message:`detail_byte_size_mismatch`})}),Tt=e.object({lifecycleState:e.literal(`active`),actionOrdinal:w,summary:yt,detailManifest:wt}).strict(),Et=e.object({lifecycleState:e.literal(`withdrawn`),actionOrdinal:w,resetActionId:E,lastActiveFirstAnnouncedAt:T}).strict(),Dt=e.discriminatedUnion(`lifecycleState`,[Tt,Et]),Ot=e.object({contractVersion:e.literal(2)}).strict(),kt=e.object({contractVersion:e.literal(2),revision:E,cursor:w.nullable()}).strict(),At=e.object({contractVersion:e.literal(2),revision:E,afterSequence:rt}).strict(),jt=e.object({resetActionId:E,ordinal:pt,sha256:D,byteSize:O}).strict(),Mt=e.object({contractVersion:e.literal(2),revision:E,chunks:e.array(jt).min(1).max(32)}).strict().superRefine((e,t)=>{e.chunks.reduce((e,t)=>e+t.byteSize,0)>2097152&&t.addIssue({code:`custom`,message:`detail_batch_too_large`}),lt(e.chunks.map(e=>`${e.resetActionId}\u0000${e.ordinal}`))||t.addIssue({code:`custom`,message:`detail_chunk_duplicate`})}),Nt=e.object({lifecycleState:e.enum([`active`,`withdrawn`]),firstAnnouncedAt:T.nullable(),contentSha256:D.nullable()}).strict().superRefine((e,t)=>{e.lifecycleState===`active`&&(e.firstAnnouncedAt===null||e.contentSha256===null)&&t.addIssue({code:`custom`,message:`active_change_state_incomplete`})}),Pt=e.object({sourceChangeSequence:w,introducedByRevision:E,resetActionId:E,kind:e.enum([`create`,`upsert`,`withdraw`]),activationKind:e.enum([`initial`,`restored`]).nullable(),activationOrdinal:w.nullable(),before:Nt.nullable(),after:Nt.nullable()}).strict().superRefine((e,t)=>{e.activationKind===null!=(e.activationOrdinal===null)&&t.addIssue({code:`custom`,message:`activation_pair_invalid`}),e.kind===`create`&&(e.activationKind!==`initial`||e.before!==null||e.after?.lifecycleState!==`active`)&&t.addIssue({code:`custom`,message:`create_change_invalid`}),e.kind===`withdraw`&&(e.activationKind!==null||e.before?.lifecycleState!==`active`||e.after?.lifecycleState!==`withdrawn`)&&t.addIssue({code:`custom`,message:`withdraw_change_invalid`}),e.kind===`upsert`&&e.activationKind===`initial`&&t.addIssue({code:`custom`,message:`upsert_activation_invalid`})}),Ft=e.object({minSequence:e.literal(`1`),maxSequence:w}).strict(),It=e.object({revision:E,projectionFingerprint:D,actionCount:pt,activeActionCount:pt,changeCoverage:Ft.nullable(),home:xt}).strict().superRefine((e,t)=>{e.activeActionCount>e.actionCount&&t.addIssue({code:`custom`,message:`active_action_count_invalid`}),e.activeActionCount===0!=(e.home.availableRange===null)&&t.addIssue({code:`custom`,message:`head_home_count_inconsistent`})}),Lt=e.object({revision:E,items:e.array(Dt).max(256),nextCursor:w.nullable()}).strict().superRefine((e,t)=>{for(let n=1;n<e.items.length;n+=1){let r=e.items.at(n-1),i=e.items.at(n);if(r!==void 0&&i!==void 0&&BigInt(r.actionOrdinal)>=BigInt(i.actionOrdinal)){t.addIssue({code:`custom`,message:`action_ordinal_order_invalid`});break}}let n=e.items.at(-1);e.nextCursor!==null&&n?.actionOrdinal!==e.nextCursor&&t.addIssue({code:`custom`,message:`action_cursor_invalid`})}),Rt=e.object({revision:E,coverage:Ft.nullable(),items:e.array(Pt).max(256),nextAfterSequence:w.nullable()}).strict().superRefine((e,t)=>{for(let n=1;n<e.items.length;n+=1){let r=e.items.at(n-1),i=e.items.at(n);if(r!==void 0&&i!==void 0&&BigInt(r.sourceChangeSequence)+1n!==BigInt(i.sourceChangeSequence)){t.addIssue({code:`custom`,message:`change_sequence_gap`});break}}let n=e.items.at(-1);e.nextAfterSequence!==null&&n?.sourceChangeSequence!==e.nextAfterSequence&&t.addIssue({code:`custom`,message:`change_cursor_invalid`})}),zt=t=>e.object({contractVersion:e.literal(2),ok:e.literal(!0),data:t}).strict(),Bt=zt(It),Vt=zt(Lt),Ht=zt(Rt),Ut=[`source_invalid_request`,`source_revision_unknown`,`source_cursor_invalid`,`source_chunk_mismatch`,`source_response_over_capacity`,`source_integrity_conflict`,`source_revision_identity_conflict`,`source_sequence_exhausted`,`source_temporarily_unavailable`,`source_rpc_transport_failure`,`source_stream_incomplete`];function Wt(e,t=0,n=new Set){if(t>4)return!1;if(e===null||typeof e==`boolean`)return!0;if(typeof e==`string`)return[...e].length<=1024;if(typeof e==`number`)return Number.isFinite(e);if(typeof e!=`object`||n.has(e))return!1;if(n.add(e),Array.isArray(e))return e.length>16?!1:e.every(e=>Wt(e,t+1,n));let r=Object.entries(e);return r.length>16?!1:r.every(([,e])=>Wt(e,t+1,n))}const Gt=e.record(e.string(),e.unknown()).refine(e=>Wt(e),`safe_cause_invalid`).refine(e=>new TextEncoder().encode(JSON.stringify(e)).byteLength<=8192,`safe_cause_too_large`),Kt=e.object({code:e.enum(Ut),operation:E,stage:E,revision:E.optional(),retryable:e.boolean(),correlationId:E,cause:Gt}).strict(),qt=e.object({contractVersion:e.literal(2),ok:e.literal(!1),error:Kt}).strict(),Jt=e.object({contractVersion:e.literal(2),eventType:e.literal(`reset_publication_revision_available`),eventId:e.string().regex(/^reset_pub_v2_[0-9a-f]{64}$/),revision:E,changeHighWater:rt,projectionFingerprint:D,occurredAt:T}).strict();function Yt(e){return Ot.parse(e)}function Xt(e){return kt.parse(e)}function Zt(e){return At.parse(e)}function Qt(e){return Mt.parse(e)}function $t(e){return Bt.parse(e)}function en(e){return Vt.parse(e)}function tn(e){return Ht.parse(e)}function nn(e){return qt.parse(e)}function rn(e){return Jt.parse(e)}var an=class extends Error{code;operation;stage;retryable;constructor(e){super(`${e.code}:${e.stage}`,{cause:e.cause}),this.name=`RadarResetSourceContractErrorV2`,this.code=e.code,this.operation=e.operation,this.stage=e.stage,this.retryable=e.retryable}};const k=new TextEncoder,on=new TextDecoder(`utf-8`,{fatal:!0});function A(e,t,n){if(n+t.byteLength>e.byteLength)return!1;for(let r=0;r<t.byteLength;r+=1)if(e.at(n+r)!==t.at(r))return!1;return!0}function sn(e,t){if(t.byteLength===0)return!0;for(let n=0;n<=e.byteLength-t.byteLength;n+=1)if(A(e,t,n))return!0;return!1}function cn(e){let t=e.reduce((e,t)=>e+t.byteLength,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;return n}function ln(e){let t=``;for(let n=0;n<e.byteLength;n+=32768)t+=String.fromCharCode(...e.slice(n,n+32768));return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/u,``)}function un(e){if(!/^[A-Za-z0-9_-]+$/u.test(e))throw Error(`base64url_noncanonical`);let t=(4-e.length%4)%4,n=`${e.replaceAll(`-`,`+`).replaceAll(`_`,`/`)}${`=`.repeat(t)}`,r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));if(ln(i)!==e)throw Error(`base64url_noncanonical`);return i}async function dn(e){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return`sha256:${[...new Uint8Array(await crypto.subtle.digest(`SHA-256`,t))].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function fn(e){for(let t=0;t<64;t+=1){let t=`radar-reset-v2-${[...crypto.getRandomValues(new Uint8Array(24))].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`,n=k.encode(`--${t}`);if(!e.some(e=>sn(e,n)))return t}throw Error(`multipart_boundary_generation_failed`)}async function pn(e){let t=E.parse(e.revision),n=E.parse(e.correlationId),r=Mt.parse({contractVersion:2,revision:t,chunks:e.parts.map(({bytes:e,...t})=>t)}),i=e.parts.map((e,t)=>({...r.chunks[t],bytes:new Uint8Array(e.bytes)}));for(let e of i)if(e.bytes.byteLength!==e.byteSize||await dn(e.bytes)!==e.sha256)throw new an({code:`source_chunk_mismatch`,operation:`readDetailBatch`,stage:`detail_encode`,retryable:!1});let a=fn(i.map(e=>e.bytes)),o=[];for(let e of i)o.push(k.encode(`--${a}\r\nContent-Type: application/octet-stream\r
|
|
2
|
-
X-Radar-Reset-Action-Id-B64: ${
|
|
3
|
-
`));o.push(
|
|
4
|
-
`)){let t=e.indexOf(`:`);if(t<=0||e.slice(t+1,t+2)!==` `)return
|
|
1
|
+
import{z as e}from"zod";const t=1,n=4,r=Object.freeze({exportUtf8Bytes:2*1024*1024,analysis:Object.freeze({actions:512,intervals:511}),actionDetail:Object.freeze({noticeTimeline:64,reasons:128}),text:Object.freeze({publicTextCodePoints:500,evidenceExcerptCodePoints:500,urlCodePoints:2048})}),i=[`all`,`hard_reset`,`banked_reset`],a=[`hard_reset`,`banked_reset`],o=[`codex`,`chatgpt_work`],s=[`all_users`,`paid_users`,`named_plans`,`affected_subset`],c=[`plus`,`pro`],l=[`incident_compensation`,`user_milestone`,`celebration`],ee=[`explicit_in_reset_post`,`explicit_in_related_source`,`contextual_inference`,`unknown`],te=[`weekday`,`weekday_group`,`hour`,`six_hour_block`,`month`,`day_of_month`,`week_of_month`,`weekday_hour`,`minute_of_hour`,`five_minute_bucket`,`half_hour_slot`,`time_of_day_minute`],ne=[`month`,`weekday`,`hour`,`six_hour_block`],u=e.number().finite(),d=u.min(0),f=e.number().int().min(0),p=e.number().int().positive(),m=u.min(0).max(1),h=e.iso.datetime({offset:!0}).refine(e=>e.endsWith(`Z`),{message:`utc_timestamp_required`}).refine(e=>/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(e),{message:`utc_timestamp_seconds_required`}),g=e.string().min(1).max(128).refine(e=>e===e.trim()&&!/[\p{Cc}\p{Cf}]/u.test(e),{message:`public_id_invalid`}),_=e.enum(i),re=e.enum(l),ie=e.enum(ee),ae=e.object({contractVersion:e.literal(1),eventId:g,eventType:e.literal(`reset_analysis_snapshot_available`),analysisSnapshotId:g,sourceWatermark:g,occurredAt:h}).strict();function oe(e){return ae.parse(e)}function se(e){return[...e].length}function ce(e){return new TextEncoder().encode(JSON.stringify(e)).byteLength}const le=e.string().refine(e=>se(e)<=r.text.evidenceExcerptCodePoints,{message:`evidence_excerpt_too_long`}),ue=e.string().refine(e=>e.trim().length>0,{message:`source_text_empty`}),de=e.string().refine(e=>se(e)<=r.text.publicTextCodePoints,{message:`public_text_too_long`}),fe=e.string().refine(e=>e.trim().length>0,{message:`source_account_display_name_blank`}).refine(e=>se(e)<=r.text.publicTextCodePoints,{message:`source_account_display_name_too_long`}),pe=e.string().refine(e=>se(e)<=r.text.urlCodePoints,{message:`source_url_too_long`}).refine(e=>{if([...e].some(e=>{let t=e.codePointAt(0);return t===void 0||t<=31||t===127}))return!1;try{let t=new URL(e);return t.protocol===`https:`&&t.username.length===0&&t.password.length===0}catch{return!1}},{message:`https_url_required`});function v(e){return new Set(e).size===e.length}const me=e.discriminatedUnion(`state`,[e.object({state:e.literal(`known`),values:e.array(e.enum(a)).min(1).refine(v,{message:`reset_effects_must_be_unique`})}).strict(),e.object({state:e.literal(`unknown`),values:e.tuple([])}).strict()]),he=e.object({products:e.array(e.enum(o)).refine(v,{message:`products_must_be_unique`}),audienceClaims:e.array(e.object({audience:e.enum(s),plans:e.array(e.enum(c)).refine(v,{message:`plans_must_be_unique`}),subsetSummary:de.nullable()}).strict())}).strict(),ge=e.object({resetActionId:g,firstAnnouncedAt:h,effectiveAt:h.nullable(),resetEffects:me,actionScope:he,reasonCategories:e.array(re).refine(v,{message:`reason_categories_must_be_unique`}),noticeCount:p,previousAllActionDays:d.nullable(),previousHardResetActionDays:d.nullable(),previousBankedResetActionDays:d.nullable()}).strict(),_e=e.object({series:_,previousActionId:g,actionId:g,fromFirstAnnouncedAt:h,toFirstAnnouncedAt:h,days:d}).strict(),ve=e.object({count:p,min:d,max:d,mean:d,median:d,percentile25:d,percentile75:d,percentile90:d,standardDeviation:d,coefficientOfVariation:d.nullable(),interquartileRange:d}).strict(),ye=e.object({lower:d,upper:d}).strict(),be=e.object({iterations:p,seed:e.number().int(),mean95:ye,median95:ye}).strict(),xe=e.object({bucket:e.string().min(1),lowerInclusive:d,upperExclusive:d.nullable(),count:f,share:m}).strict(),Se=e.object({endingIndex:f,windowSize:p,mean:d,median:d}).strict(),Ce=e.object({firstHalf:ve.nullable(),secondHalf:ve.nullable(),meanChangeDays:u.nullable(),meanChangePercent:u.nullable()}).strict(),we=e.object({series:_,actionCount:f,completedIntervalCount:f,intervalSummary:ve.nullable(),bootstrap95:be.nullable(),intervalHistogram:e.array(xe),shortestIntervals:e.array(_e),longestIntervals:e.array(_e),rolling3:e.array(Se),rolling5:e.array(Se),linearSlopeDaysPerInterval:u.nullable(),halfComparison:Ce,survivalCurve:e.array(e.object({elapsedDays:d,survivalProbability:m}).strict())}).strict(),Te=e.object({series:_,elapsedDays:d,horizonDays:d,sampleAtRisk:f,eventsWithinWindow:f,probability:m.nullable()}).strict(),Ee=e.object({key:e.string(),count:f,share:m,timeZone:e.string().min(1),series:_,dimension:e.enum(te)}).strict(),De=e.object({timeZone:e.string().min(1),series:_,dimension:e.enum(te),categoryCount:p,nonZeroCategoryCount:f,maxShare:m,herfindahlIndex:m,normalizedEntropy:m}).strict(),Oe=e.object({startMinute:e.number().int().min(0).max(1439),endMinute:e.number().int().min(0).max(1439),wrapsMidnight:e.boolean(),eventCount:f,share:m}).strict(),ke=e.object({timeZone:e.string().min(1),series:_,eventCount:p,slotMinutes:p,fixedWindows:e.array(e.object({durationMinutes:p,bestWindows:e.array(Oe)}).strict()),coverageWindows:e.array(e.object({targetShare:m,requiredEventCount:p,durationMinutes:p,bestWindows:e.array(Oe)}).strict())}).strict(),Ae=e.object({series:_,thresholdDays:d,clusterCount:f,multiEventClusterCount:f,largestClusterSize:f,eventsInMultiEventClusters:f,eventShareInMultiEventClusters:m}).strict(),je=e.object({category:re,actionCount:f,actionShare:m,hardResetActionCount:f,bankedResetActionCount:f,explicitInResetPostCount:f,explicitInRelatedSourceCount:f,contextualInferenceCount:f,unknownCount:f}).strict(),Me=e.object({category:re,series:_,timeZone:e.string().min(1),dimension:e.enum(ne),key:e.string(),eventCount:f,reasonEventCount:f,binEventCount:f,seriesEventCount:f,shareWithinReason:m.nullable(),shareWithinBin:m.nullable(),shareOfSeries:m.nullable()}).strict(),Ne=e.object({overview:e.object({actionCount:p,hardResetActionCount:f,bankedResetActionCount:f,firstAnnouncedAt:h,lastAnnouncedAt:h,coverageDays:d,sourceNoticeCount:p}).strict(),actions:e.array(ge).min(1).max(r.analysis.actions),intervals:e.array(_e).max(r.analysis.intervals),series:e.object({all:we,hard_reset:we,banked_reset:we}).strict(),historicalConditionalFrequencies:e.array(Te),calendars:e.array(Ee),calendarConcentrations:e.array(De),intradayRanges:e.array(ke),clusters:e.array(Ae),reasons:e.object({summary:e.array(je),crossTabs:e.array(Me)}).strict(),caveats:e.array(de.min(1))}).strict(),Pe=e.object({contractVersion:e.literal(1),analyzerContractVersion:e.literal(4),generatedAt:h,analysisWindow:e.object({startAt:h,startInclusive:e.boolean(),timeBasis:e.literal(`first_announcement`),throughFirstAnnouncedAt:h}).strict(),result:Ne}).strict().superRefine((e,t)=>{let n=e.result.actions,r=e.result.overview;n.length!==r.actionCount&&t.addIssue({code:`custom`,message:`analysis_action_count_mismatch`,path:[`result`,`actions`]});let a=new Set;for(let e=0;e<n.length;e+=1){let r=n[e];a.has(r.resetActionId)&&t.addIssue({code:`custom`,message:`analysis_action_identity_duplicate`,path:[`result`,`actions`,e,`resetActionId`]}),a.add(r.resetActionId);let i=n[e-1];i!==void 0&&(i.firstAnnouncedAt>r.firstAnnouncedAt||i.firstAnnouncedAt===r.firstAnnouncedAt&&i.resetActionId>r.resetActionId)&&t.addIssue({code:`custom`,message:`analysis_actions_not_stably_sorted`,path:[`result`,`actions`,e]})}let o=(e,r,i)=>{i!==void 0&&e.series!==i&&t.addIssue({code:`custom`,message:`analysis_interval_series_mismatch`,path:[...r,`series`]});let a=i??e.series,o=a===`all`?n:n.filter(e=>e.resetEffects.state===`known`&&e.resetEffects.values.includes(a)),s=o.findIndex(t=>t.resetActionId===e.actionId),c=o[s];if(c===void 0){t.addIssue({code:`custom`,message:`analysis_interval_action_mismatch`,path:[...r,`actionId`]});return}let l=o[s-1];(l===void 0||e.previousActionId!==l.resetActionId)&&t.addIssue({code:`custom`,message:`analysis_interval_previous_action_mismatch`,path:[...r,`previousActionId`]}),l!==void 0&&e.fromFirstAnnouncedAt!==l.firstAnnouncedAt&&t.addIssue({code:`custom`,message:`analysis_interval_from_first_announcement_mismatch`,path:[...r,`fromFirstAnnouncedAt`]}),e.toFirstAnnouncedAt!==c.firstAnnouncedAt&&t.addIssue({code:`custom`,message:`analysis_interval_to_first_announcement_mismatch`,path:[...r,`toFirstAnnouncedAt`]})};e.result.intervals.forEach((e,t)=>o(e,[`result`,`intervals`,t]));for(let t of i){let n=e.result.series[t];for(let e of[`shortestIntervals`,`longestIntervals`])n[e].forEach((n,r)=>o(n,[`result`,`series`,t,e,r],t))}n[0]?.firstAnnouncedAt!==r.firstAnnouncedAt&&t.addIssue({code:`custom`,message:`analysis_first_action_mismatch`,path:[`result`,`overview`,`firstAnnouncedAt`]}),(n.at(-1)?.firstAnnouncedAt!==r.lastAnnouncedAt||e.analysisWindow.throughFirstAnnouncedAt!==r.lastAnnouncedAt)&&t.addIssue({code:`custom`,message:`analysis_last_action_mismatch`,path:[`result`,`overview`,`lastAnnouncedAt`]});for(let[n,r]of Object.entries({all:`all`,hard_reset:`hard_reset`,banked_reset:`banked_reset`}))e.result.series[n].series!==r&&t.addIssue({code:`custom`,message:`analysis_series_identity_mismatch`,path:[`result`,`series`,n,`series`]})}),Fe=e.object({excerpt:le,sourceUrl:pe}).strict();function Ie(e,t){try{return Ue(e,t)}catch{return}}function y(e,t){try{return S(e,t)}catch{return}}const b=e.object({contractVersion:e.literal(1),resetActionId:g,firstAnnouncedAt:h,effectiveAt:h.nullable(),resetEffects:me,actionScope:he,noticeCount:p,reasons:e.array(e.object({category:re,summary:de.min(1),basis:ie,evidence:e.array(Fe).min(1)}).strict()).max(r.actionDetail.reasons),noticeTimeline:e.array(e.object({phase:e.enum([`preview`,`executed`]),authoredAt:h,contentCompleteness:e.enum([`verified_full_text`,`verified_excerpt`]),sourceText:ue,sourceTextZh:ue.nullable(),sourceUrl:pe,sourceAccount:e.object({displayName:fe}).strict()}).strict()).min(1).max(r.actionDetail.noticeTimeline)}).strict().superRefine((e,t)=>{e.noticeCount!==e.noticeTimeline.length&&t.addIssue({code:`custom`,message:`action_notice_count_mismatch`,path:[`noticeCount`]});for(let n=0;n<e.noticeTimeline.length;n+=1){let r=e.noticeTimeline[n];if(n===0){let n=y(r.authoredAt,e.firstAnnouncedAt);n!==void 0&&n!==0&&t.addIssue({code:`custom`,message:`notice_timeline_first_announcement_mismatch`,path:[`noticeTimeline`,0,`authoredAt`]});continue}let i=e.noticeTimeline[n-1],a=y(i.authoredAt,r.authoredAt);a!==void 0&&a>0&&t.addIssue({code:`custom`,message:`notice_timeline_not_ascending`,path:[`noticeTimeline`,n,`authoredAt`]})}}),Le=[`preview`,`executed`,`schedule_change`,`scope_change`,`cancel_preview`,`delivery_issue`,`make_up`,`repair`,`update`],Re=e.object({resolution:e.enum([`resolved`,`unbounded`,`unresolved`]),evidence:e.string().trim().min(1).max(300).nullable(),precision:e.enum([`exact`,`approximate`,`range`]).nullable(),relation:e.enum([`instant`,`interval`,`deadline`,`not_before`,`unbounded`]).nullable(),effectiveWindow:e.object({earliestAt:e.iso.datetime(),latestAt:e.iso.datetime()}).strict().refine(e=>Date.parse(e.earliestAt)<=Date.parse(e.latestAt),{message:`publication_timing_window_inverted`}).nullable()}).strict().superRefine((e,t)=>{let n=e=>t.addIssue({code:`custom`,message:e});e.resolution===`resolved`!=(e.effectiveWindow!==null)&&n(`publication_timing_resolution_window_mismatch`),e.resolution===`unbounded`&&e.relation!==`unbounded`&&n(`publication_timing_unbounded_relation_required`);let r=e.effectiveWindow;e.resolution===`resolved`&&((e.relation===null||e.relation===`unbounded`)&&n(`publication_timing_bounded_relation_required`),r!==null&&e.relation===`interval`==(r.earliestAt===r.latestAt)&&n(`publication_timing_relation_window_mismatch`))}),x=e.object({resetActionId:g,state:e.enum([`preview`,`executed`]),resetEffects:me,executedEffects:e.array(e.enum(a)).refine(v),pendingEffects:e.array(e.enum(a)).refine(v),plannedTiming:Re.nullable(),noticeTimeline:e.array(b.shape.noticeTimeline.element.omit({phase:!0}).extend({kinds:e.array(e.enum(Le)).min(1).refine(v)}).strict()).min(1).max(r.actionDetail.noticeTimeline)}).strict().superRefine((e,t)=>{e.state===`preview`&&e.executedEffects.length>0&&t.addIssue({code:`custom`,message:`pending_preview_has_executed_effects`}),e.state===`executed`&&e.pendingEffects.length===0&&t.addIssue({code:`custom`,message:`pending_executed_action_has_no_pending_effects`});for(let n of[...e.executedEffects,...e.pendingEffects])new Set(e.resetEffects.values).has(n)||t.addIssue({code:`custom`,message:`pending_effect_not_declared`});e.executedEffects.some(t=>e.pendingEffects.includes(t))&&t.addIssue({code:`custom`,message:`pending_effect_already_executed`});for(let n=1;n<e.noticeTimeline.length;n+=1){let r=e.noticeTimeline[n-1],i=e.noticeTimeline[n],a=y(r.authoredAt,i.authoredAt);a!==void 0&&a>0&&t.addIssue({code:`custom`,message:`pending_notice_timeline_not_ascending`,path:[`noticeTimeline`,n]})}}),ze=e.object({contractVersion:e.literal(1),generatedAt:h,analysis:Pe,actions:e.array(b).min(1).max(r.analysis.actions),pendingResetActions:e.array(x).max(r.analysis.actions)}).strict();function Be(e,t){ce(e)>r.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`export_utf8_size_limit_exceeded`,path:[]});let n=y(e.generatedAt,e.analysis.generatedAt);n!==void 0&&n<0&&t.addIssue({code:`custom`,message:`export_generated_at_before_analysis`,path:[`generatedAt`]})}function Ve(e,t,n,r){(e.resetActionId!==t.resetActionId||e.firstAnnouncedAt!==t.firstAnnouncedAt||e.effectiveAt!==t.effectiveAt||e.noticeCount!==t.noticeCount||JSON.stringify(e.resetEffects)!==JSON.stringify(t.resetEffects)||JSON.stringify(e.actionScope)!==JSON.stringify(t.actionScope))&&r.addIssue({code:`custom`,message:`export_action_summary_mismatch`,path:[`actions`,n]});let i=[...new Set(e.reasons.map(e=>e.category))].sort();JSON.stringify(i)!==JSON.stringify([...t.reasonCategories].sort())&&r.addIssue({code:`custom`,message:`export_action_reason_categories_mismatch`,path:[`actions`,n,`reasons`]})}const He=ze.superRefine((e,t)=>{Be(e,t),v(e.pendingResetActions.map(e=>e.resetActionId))||t.addIssue({code:`custom`,message:`export_pending_action_identity_duplicate`,path:[`pendingResetActions`]});let n=new Map,r=new Set(e.analysis.result.actions.map(e=>e.resetActionId));for(let i=0;i<e.actions.length;i+=1){let a=e.actions[i];n.has(a.resetActionId)?t.addIssue({code:`custom`,message:`export_action_identity_duplicate`,path:[`actions`,i,`resetActionId`]}):n.set(a.resetActionId,i);let o=e.actions[i-1],s=o===void 0?void 0:Ie(o,a);s!==void 0&&s>0&&t.addIssue({code:`custom`,message:`export_actions_not_stably_sorted`,path:[`actions`,i]});let c=y(a.firstAnnouncedAt,e.analysis.analysisWindow.throughFirstAnnouncedAt);c!==void 0&&c>0&&t.addIssue({code:`custom`,message:`export_action_after_analysis_snapshot`,path:[`actions`,i,`firstAnnouncedAt`]});let l=y(a.firstAnnouncedAt,e.analysis.analysisWindow.startAt);l!==void 0&&(e.analysis.analysisWindow.startInclusive?l>=0:l>0)&&!r.has(a.resetActionId)&&t.addIssue({code:`custom`,message:`export_window_action_not_in_analysis`,path:[`actions`,i,`resetActionId`]})}for(let r of e.analysis.result.actions){let i=n.get(r.resetActionId);if(i===void 0){t.addIssue({code:`custom`,message:`export_analysis_action_missing`,path:[`actions`]});continue}Ve(e.actions[i],r,i,t)}});function S(e,t){let n=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d+))?Z$/,r=n.exec(e),i=n.exec(t);if(r===null||i===null)throw Error(`radar_reset_v1_timestamp_invalid`);let a=r[1],o=i[1];if(a<o)return-1;if(a>o)return 1;let s=r[2]??``,c=i[2]??``,l=Math.max(s.length,c.length);for(let e=0;e<l;e+=1){let t=s.charCodeAt(e)||48,n=c.charCodeAt(e)||48;if(t<n)return-1;if(t>n)return 1}return 0}function Ue(e,t){let n=S(e.firstAnnouncedAt,t.firstAnnouncedAt);return n===0?e.resetActionId<t.resetActionId?-1:+(e.resetActionId>t.resetActionId):n}function We(e){return Pe.parse(e)}function Ge(e){return b.parse(e)}function Ke(e){return He.parse(e)}function qe(e){return x.parse(e)}function Je(e){let t;try{t=Ge(e)}catch(e){throw Error(`radar_reset_primary_source_action_invalid`,{cause:e})}let n=t.noticeTimeline[0];if(n===void 0)throw Error(`radar_reset_primary_source_notice_missing`);return Object.freeze({displayName:n.sourceAccount.displayName,sourceUrl:n.sourceUrl,excerpt:[...n.sourceText.trim()].slice(0,r.text.publicTextCodePoints).join(``)})}const Ye=2,Xe=30,Ze=256,Qe=512*1024,$e=256,et=256*1024,tt=32,nt=2*1024*1024,rt=9223372036854775807n,it=e.string().regex(/^(?:0|[1-9][0-9]{0,18})$/,`uint64_decimal_noncanonical`).refine(e=>BigInt(e)<=rt,`uint64_decimal_out_of_range`),C=e.string().regex(/^[1-9][0-9]{0,18}$/,`positive_decimal_noncanonical`).refine(e=>BigInt(e)<=rt,`positive_decimal_out_of_range`);function at(e){return it.parse(e)}function ot(e){return C.parse(e)}function st(e){return BigInt(at(e))}function ct(e){if(e<0n||e>rt)throw RangeError(`uint64_decimal_out_of_range`);return e.toString()}function lt(e){if(e<1n||e>rt)throw RangeError(`positive_decimal_out_of_range`);return e.toString()}const w=e.iso.datetime({offset:!0}).refine(e=>e.endsWith(`Z`),`utc_timestamp_required`).refine(e=>/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(e),`utc_timestamp_seconds_required`),T=e.string().min(1).max(128).refine(e=>e===e.trim()&&!/[\p{Cc}\p{Cf}]/u.test(e),`public_id_invalid`),E=e.string().regex(/^sha256:[0-9a-f]{64}$/,`sha256_noncanonical`);function ut(e){return new Set(e).size===e.length}const dt=t=>e.array(t).refine(ut,`array_values_must_be_unique`),ft=t=>e.string().refine(e=>[...e].length<=t,`string_exceeds_${t}_code_points`),pt=e.number().finite().min(0),mt=e.number().int().min(0).max(2**53-1),D=e.number().int().positive().max(2**53-1),ht=e.enum([`hard_reset`,`banked_reset`]),gt=e.enum([`codex`,`chatgpt_work`]),_t=e.enum([`all_users`,`paid_users`,`named_plans`,`affected_subset`]),vt=e.enum([`plus`,`pro`]),yt=e.enum([`incident_compensation`,`user_milestone`,`celebration`]),bt=e.object({resetActionId:T,firstAnnouncedAt:w,effectiveAt:w.nullable(),resetEffects:e.union([e.object({state:e.literal(`known`),values:dt(ht).nonempty()}).strict(),e.object({state:e.literal(`unknown`),values:e.tuple([])}).strict()]),actionScope:e.object({products:dt(gt),audienceClaims:e.array(e.object({audience:_t,plans:dt(vt),subsetSummary:ft(500).nullable()}).strict())}).strict(),reasonCategories:dt(yt),noticeCount:D,previousAllActionDays:pt.nullable(),previousHardResetActionDays:pt.nullable(),previousBankedResetActionDays:pt.nullable()}).strict();function xt(e){return bt.parse(e)}const St=e.object({generatedAt:w,availableRange:e.object({firstAnnouncedAt:w,lastAnnouncedAt:w}).strict().nullable(),current:e.object({summary:bt,status:e.object({phase:e.enum([`preview`,`executed`]),statusAt:w}).strict()}).strict().nullable()}).strict().superRefine((e,t)=>{if(e.availableRange===null!=(e.current===null)){t.addIssue({code:`custom`,message:`home_empty_state_inconsistent`});return}e.availableRange!==null&&e.current!==null&&e.current.summary.firstAnnouncedAt!==e.availableRange.lastAnnouncedAt&&t.addIssue({code:`custom`,message:`home_current_range_inconsistent`})});function Ct(e){return St.parse(e)}const wt=e.object({ordinal:mt,sha256:E,byteSize:D}).strict(),Tt=e.object({sha256:E,byteSize:D,chunkCount:D,chunks:e.array(wt).min(1)}).strict().superRefine((e,t)=>{e.chunkCount!==e.chunks.length&&t.addIssue({code:`custom`,message:`chunk_count_mismatch`});let n=0;for(let[r,i]of e.chunks.entries())i.ordinal!==r&&t.addIssue({code:`custom`,message:`chunk_ordinal_invalid`}),n+=i.byteSize;n!==e.byteSize&&t.addIssue({code:`custom`,message:`detail_byte_size_mismatch`})}),Et=e.object({lifecycleState:e.literal(`active`),actionOrdinal:C,summary:bt,detailManifest:Tt}).strict(),Dt=e.object({lifecycleState:e.literal(`withdrawn`),actionOrdinal:C,resetActionId:T,lastActiveFirstAnnouncedAt:w}).strict(),Ot=e.discriminatedUnion(`lifecycleState`,[Et,Dt]),kt=e.object({contractVersion:e.literal(2)}).strict(),At=e.object({contractVersion:e.literal(2),revision:T,cursor:C.nullable()}).strict(),jt=e.object({contractVersion:e.literal(2),revision:T,afterSequence:it}).strict(),Mt=e.object({resetActionId:T,ordinal:mt,sha256:E,byteSize:D}).strict(),Nt=e.object({contractVersion:e.literal(2),revision:T,chunks:e.array(Mt).min(1).max(32)}).strict().superRefine((e,t)=>{e.chunks.reduce((e,t)=>e+t.byteSize,0)>2097152&&t.addIssue({code:`custom`,message:`detail_batch_too_large`}),ut(e.chunks.map(e=>`${e.resetActionId}\u0000${e.ordinal}`))||t.addIssue({code:`custom`,message:`detail_chunk_duplicate`})}),Pt=e.object({lifecycleState:e.enum([`active`,`withdrawn`]),firstAnnouncedAt:w.nullable(),contentSha256:E.nullable()}).strict().superRefine((e,t)=>{e.lifecycleState===`active`&&(e.firstAnnouncedAt===null||e.contentSha256===null)&&t.addIssue({code:`custom`,message:`active_change_state_incomplete`})}),Ft=e.object({sourceChangeSequence:C,introducedByRevision:T,resetActionId:T,kind:e.enum([`create`,`upsert`,`withdraw`]),activationKind:e.enum([`initial`,`restored`]).nullable(),activationOrdinal:C.nullable(),before:Pt.nullable(),after:Pt.nullable()}).strict().superRefine((e,t)=>{e.activationKind===null!=(e.activationOrdinal===null)&&t.addIssue({code:`custom`,message:`activation_pair_invalid`}),e.kind===`create`&&(e.activationKind!==`initial`||e.before!==null||e.after?.lifecycleState!==`active`)&&t.addIssue({code:`custom`,message:`create_change_invalid`}),e.kind===`withdraw`&&(e.activationKind!==null||e.before?.lifecycleState!==`active`||e.after?.lifecycleState!==`withdrawn`)&&t.addIssue({code:`custom`,message:`withdraw_change_invalid`}),e.kind===`upsert`&&e.activationKind===`initial`&&t.addIssue({code:`custom`,message:`upsert_activation_invalid`})}),It=e.object({minSequence:e.literal(`1`),maxSequence:C}).strict(),Lt=e.object({revision:T,projectionFingerprint:E,actionCount:mt,activeActionCount:mt,changeCoverage:It.nullable(),home:St}).strict().superRefine((e,t)=>{e.activeActionCount>e.actionCount&&t.addIssue({code:`custom`,message:`active_action_count_invalid`}),e.activeActionCount===0!=(e.home.availableRange===null)&&t.addIssue({code:`custom`,message:`head_home_count_inconsistent`})}),Rt=e.object({revision:T,items:e.array(Ot).max(256),nextCursor:C.nullable()}).strict().superRefine((e,t)=>{for(let n=1;n<e.items.length;n+=1){let r=e.items.at(n-1),i=e.items.at(n);if(r!==void 0&&i!==void 0&&BigInt(r.actionOrdinal)>=BigInt(i.actionOrdinal)){t.addIssue({code:`custom`,message:`action_ordinal_order_invalid`});break}}let n=e.items.at(-1);e.nextCursor!==null&&n?.actionOrdinal!==e.nextCursor&&t.addIssue({code:`custom`,message:`action_cursor_invalid`})}),zt=e.object({revision:T,coverage:It.nullable(),items:e.array(Ft).max(256),nextAfterSequence:C.nullable()}).strict().superRefine((e,t)=>{for(let n=1;n<e.items.length;n+=1){let r=e.items.at(n-1),i=e.items.at(n);if(r!==void 0&&i!==void 0&&BigInt(r.sourceChangeSequence)+1n!==BigInt(i.sourceChangeSequence)){t.addIssue({code:`custom`,message:`change_sequence_gap`});break}}let n=e.items.at(-1);e.nextAfterSequence!==null&&n?.sourceChangeSequence!==e.nextAfterSequence&&t.addIssue({code:`custom`,message:`change_cursor_invalid`})}),Bt=t=>e.object({contractVersion:e.literal(2),ok:e.literal(!0),data:t}).strict(),Vt=Bt(Lt),Ht=Bt(Rt),Ut=Bt(zt),Wt=[`source_invalid_request`,`source_revision_unknown`,`source_cursor_invalid`,`source_chunk_mismatch`,`source_response_over_capacity`,`source_integrity_conflict`,`source_revision_identity_conflict`,`source_sequence_exhausted`,`source_temporarily_unavailable`,`source_rpc_transport_failure`,`source_stream_incomplete`];function Gt(e,t=0,n=new Set){if(t>4)return!1;if(e===null||typeof e==`boolean`)return!0;if(typeof e==`string`)return[...e].length<=1024;if(typeof e==`number`)return Number.isFinite(e);if(typeof e!=`object`||n.has(e))return!1;if(n.add(e),Array.isArray(e))return e.length>16?!1:e.every(e=>Gt(e,t+1,n));let r=Object.entries(e);return r.length>16?!1:r.every(([,e])=>Gt(e,t+1,n))}const Kt=e.record(e.string(),e.unknown()).refine(e=>Gt(e),`safe_cause_invalid`).refine(e=>new TextEncoder().encode(JSON.stringify(e)).byteLength<=8192,`safe_cause_too_large`),qt=e.object({code:e.enum(Wt),operation:T,stage:T,revision:T.optional(),retryable:e.boolean(),correlationId:T,cause:Kt}).strict(),Jt=e.object({contractVersion:e.literal(2),ok:e.literal(!1),error:qt}).strict(),Yt=e.object({contractVersion:e.literal(2),eventType:e.literal(`reset_publication_revision_available`),eventId:e.string().regex(/^reset_pub_v2_[0-9a-f]{64}$/),revision:T,changeHighWater:it,projectionFingerprint:E,occurredAt:w}).strict();function Xt(e){return kt.parse(e)}function Zt(e){return At.parse(e)}function Qt(e){return jt.parse(e)}function $t(e){return Nt.parse(e)}function en(e){return Vt.parse(e)}function tn(e){return Ht.parse(e)}function nn(e){return Ut.parse(e)}function rn(e){return Jt.parse(e)}function an(e){return Yt.parse(e)}var on=class extends Error{code;operation;stage;retryable;constructor(e){super(`${e.code}:${e.stage}`,{cause:e.cause}),this.name=`RadarResetSourceContractErrorV2`,this.code=e.code,this.operation=e.operation,this.stage=e.stage,this.retryable=e.retryable}};const O=new TextEncoder,sn=new TextDecoder(`utf-8`,{fatal:!0});function cn(e,t,n){if(n+t.byteLength>e.byteLength)return!1;for(let r=0;r<t.byteLength;r+=1)if(e.at(n+r)!==t.at(r))return!1;return!0}function ln(e,t){if(t.byteLength===0)return!0;for(let n=0;n<=e.byteLength-t.byteLength;n+=1)if(cn(e,t,n))return!0;return!1}function un(e){let t=e.reduce((e,t)=>e+t.byteLength,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;return n}function dn(e){let t=``;for(let n=0;n<e.byteLength;n+=32768)t+=String.fromCharCode(...e.slice(n,n+32768));return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/u,``)}function fn(e){if(!/^[A-Za-z0-9_-]+$/u.test(e))throw Error(`base64url_noncanonical`);let t=(4-e.length%4)%4,n=`${e.replaceAll(`-`,`+`).replaceAll(`_`,`/`)}${`=`.repeat(t)}`,r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));if(dn(i)!==e)throw Error(`base64url_noncanonical`);return i}async function pn(e){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return`sha256:${[...new Uint8Array(await crypto.subtle.digest(`SHA-256`,t))].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function mn(e){for(let t=0;t<64;t+=1){let t=`radar-reset-v2-${[...crypto.getRandomValues(new Uint8Array(24))].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`,n=O.encode(`--${t}`);if(!e.some(e=>ln(e,n)))return t}throw Error(`multipart_boundary_generation_failed`)}async function hn(e){let t=T.parse(e.revision),n=T.parse(e.correlationId),r=Nt.parse({contractVersion:2,revision:t,chunks:e.parts.map(({bytes:e,...t})=>t)}),i=e.parts.map((e,t)=>({...r.chunks[t],bytes:new Uint8Array(e.bytes)}));for(let e of i)if(e.bytes.byteLength!==e.byteSize||await pn(e.bytes)!==e.sha256)throw new on({code:`source_chunk_mismatch`,operation:`readDetailBatch`,stage:`detail_encode`,retryable:!1});let a=mn(i.map(e=>e.bytes)),o=[];for(let e of i)o.push(O.encode(`--${a}\r\nContent-Type: application/octet-stream\r
|
|
2
|
+
X-Radar-Reset-Action-Id-B64: ${dn(O.encode(e.resetActionId))}\r\nX-Radar-Detail-Ordinal: ${e.ordinal}\r\nX-Radar-Byte-Size: ${e.byteSize}\r\nX-Radar-SHA-256: ${e.sha256}\r\n\r\n`)),o.push(e.bytes,O.encode(`\r
|
|
3
|
+
`));o.push(O.encode(`--${a}--\r\n`));let s=un(o),c=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return new Response(c,{status:200,headers:{"Cache-Control":`no-store`,"Content-Type":`multipart/mixed; boundary=${a}`,"X-Radar-Correlation-Id":n,"X-Radar-Part-Count":String(i.length),"X-Radar-Revision-B64":dn(O.encode(t))}})}function k(e,t,n){throw new on({code:e,operation:`readDetailBatch`,stage:`detail_stream`,retryable:t,cause:n})}async function gn(e){if(e.body===null)return k(`source_stream_incomplete`,!0);let t=e.body.getReader(),n=[],r=0;try{for(;;){let e=await t.read();if(e.done)break;if(r+=e.value.byteLength,r>2162688){try{await t.cancel()}catch{}return k(`source_response_over_capacity`,!1)}n.push(e.value)}}catch(e){return k(`source_stream_incomplete`,!0,e)}finally{t.releaseLock()}return un(n)}function A(e,t){let n=e.headers.get(t);return n===null||n.includes(`,`)?k(`source_chunk_mismatch`,!1):n}function _n(e){if([...e].some(e=>e>127))return k(`source_chunk_mismatch`,!1);let t=String.fromCharCode(...e),n=new Map,r=new Set([`content-type`,`x-radar-reset-action-id-b64`,`x-radar-detail-ordinal`,`x-radar-byte-size`,`x-radar-sha-256`]);for(let e of t.split(`\r
|
|
4
|
+
`)){let t=e.indexOf(`:`);if(t<=0||e.slice(t+1,t+2)!==` `)return k(`source_chunk_mismatch`,!1);let i=e.slice(0,t).toLowerCase(),a=e.slice(t+2);if(!r.has(i)||n.has(i)||a.length===0)return k(`source_chunk_mismatch`,!1);n.set(i,a)}return n.size===r.size?n:k(`source_chunk_mismatch`,!1)}function vn(e,t,n){for(let r=n;r<=e.byteLength-t.byteLength;r+=1)if(cn(e,t,r))return r;return-1}async function yn(e,t){let n=Nt.parse({contractVersion:2,revision:t.revision,chunks:t.chunks});if(e.status!==200)return k(`source_chunk_mismatch`,!1);let r=A(e,`Content-Type`),i=/^multipart\/mixed; boundary=(radar-reset-v2-[0-9a-f]{48})$/u.exec(r);if(i===null)return k(`source_chunk_mismatch`,!1);let a=i[1];if(A(e,`Cache-Control`)!==`no-store`)return k(`source_chunk_mismatch`,!1);T.parse(A(e,`X-Radar-Correlation-Id`));let o=A(e,`X-Radar-Part-Count`);if(!/^[1-9][0-9]*$/u.test(o)||Number(o)>32||Number(o)!==n.chunks.length)return k(`source_chunk_mismatch`,!1);let s;try{s=sn.decode(fn(A(e,`X-Radar-Revision-B64`)))}catch(e){return k(`source_chunk_mismatch`,!1,e)}if(s!==n.revision)return k(`source_chunk_mismatch`,!1);let c=await gn(e),l=O.encode(`--${a}\r\n`),ee=O.encode(`--${a}--\r\n`),te=O.encode(`\r
|
|
5
5
|
\r
|
|
6
|
-
`),ne=
|
|
7
|
-
`),u=[],d=0;for(let e of n.chunks){if(!A(c,l,d))return j(`source_stream_incomplete`,!0);d+=l.byteLength;let t=gn(c,te,d);if(t<0)return j(`source_stream_incomplete`,!0);let n=hn(c.slice(d,t));if(d=t+te.byteLength,n.get(`content-type`)!==`application/octet-stream`)return j(`source_chunk_mismatch`,!1);let r;try{r=on.decode(un(n.get(`x-radar-reset-action-id-b64`)))}catch(e){return j(`source_chunk_mismatch`,!1,e)}if(r!==e.resetActionId||n.get(`x-radar-detail-ordinal`)!==String(e.ordinal)||n.get(`x-radar-byte-size`)!==String(e.byteSize)||n.get(`x-radar-sha-256`)!==e.sha256)return j(`source_chunk_mismatch`,!1);if(d+e.byteSize+ne.byteLength>c.byteLength)return j(`source_stream_incomplete`,!0);let i=c.slice(d,d+e.byteSize);if(d+=e.byteSize,!A(c,ne,d)||(d+=ne.byteLength,await dn(i)!==e.sha256))return j(`source_chunk_mismatch`,!1);u.push({...e,bytes:i})}return!A(c,ee,d)||d+ee.byteLength!==c.byteLength?j(`source_stream_incomplete`,!0):u}const vn=/authorization|cookie|token|secret|password|api[-_]?key/iu;function yn(e,t){let n=[...e].slice(0,1024),r=``;for(let e of n){let n=k.encode(e).byteLength;if(n>t.remaining)break;t.remaining-=n,r+=e}return r}function bn(e,t,n,r){if(e===null||typeof e==`boolean`)return e;if(typeof e==`string`)return yn(e,n);if(typeof e==`number`)return Number.isFinite(e)?e:String(e);if(typeof e==`bigint`||typeof e==`symbol`)return yn(String(e),n);if(e===void 0)return`undefined`;if(typeof e==`function`)return`[Function ${e.name||`anonymous`}]`;if(r.has(e))return`[Circular]`;if(t>=4)return`[DepthLimit]`;if(r.add(e),Array.isArray(e))return e.slice(0,16).map(e=>bn(e,t+1,n,r));let i={},a=e instanceof Error?[[`type`,e.constructor.name],[`name`,e.name],[`message`,e.message],...e.cause===void 0?[]:[[`cause`,e.cause]],...Object.entries(e)]:Object.entries(e);for(let[e,o]of a.slice(0,16)){let a=yn(String(e),n);if(!(a.length===0||Object.hasOwn(i,a))&&(n.remaining-=Math.min(n.remaining,8),i[a]=vn.test(a)?`[REDACTED]`:bn(o,t+1,n,r),n.remaining<=0))break}return i}function xn(e){let t=bn(e,0,{remaining:7e3},new Set),n=typeof t==`object`&&t&&!Array.isArray(t)?t:{type:e===null?`null`:typeof e,message:t};return Gt.parse(n),n}function Sn(e){return e===`source_temporarily_unavailable`||e===`source_rpc_transport_failure`||e===`source_stream_incomplete`}function Cn(e){switch(e){case`source_invalid_request`:return 400;case`source_revision_unknown`:return 404;case`source_cursor_invalid`:case`source_chunk_mismatch`:return 409;case`source_response_over_capacity`:return 413;case`source_temporarily_unavailable`:case`source_rpc_transport_failure`:case`source_stream_incomplete`:return 503;case`source_integrity_conflict`:case`source_revision_identity_conflict`:case`source_sequence_exhausted`:return 500}}function wn(e){let t={contractVersion:2,ok:!1,error:{code:e.code,operation:e.operation,stage:e.stage,...e.revision===void 0?{}:{revision:e.revision},retryable:Sn(e.code),correlationId:e.correlationId,cause:xn(e.cause)}};return qt.parse(t)}const Tn=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),En=e.iso.date(),N=e.strictObject({category:e.enum([`improvement`,`direct_reset`,`reset_card`]),deliveryState:e.enum([`preview`,`landed`]),description:Tn,dateBasis:e.enum([`occurrence`,`announcement`,`unresolved`]),sourceUrls:e.array(e.url({protocol:/^https?$/})).min(1)}),Dn=e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),text:Tn}),e.strictObject({state:e.enum([`pending`,`failed`,`not_applicable`]),text:e.null()})]),P=e.strictObject({contractVersion:e.literal(1),generatedAt:e.iso.datetime(),timeZone:e.string().refine(e=>{try{return new Intl.DateTimeFormat(`en`,{timeZone:e}),!0}catch{return!1}},`Invalid source time zone`),startDate:En,endDate:En,processing:e.strictObject({hasPending:e.boolean(),hasFailures:e.boolean()}),days:e.array(e.strictObject({date:En,dayNumber:e.number().int().min(1).max(28),outcome:e.enum([`unconfirmed`,`improvement`,`reset`,`both`]),entries:e.array(N),summary:Dn})).length(28),undatedEntries:e.array(N)}).superRefine((e,t)=>{let n=Date.parse(`${e.startDate}T00:00:00Z`);for(let[r,i]of e.days.entries()){let e=new Date(n+r*864e5).toISOString().slice(0,10);(i.date!==e||i.dayNumber!==r+1)&&t.addIssue({code:`custom`,path:[`days`,r],message:`Days must be contiguous and numbered in order`}),i.entries.some(e=>e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`days`,r,`entries`],message:`Unresolved dates belong in undatedEntries`});let a=i.entries.filter(e=>e.deliveryState===`landed`),o=a.some(e=>e.category===`improvement`),s=a.some(e=>e.category!==`improvement`),c=o?s?`both`:`improvement`:s?`reset`:`unconfirmed`;(i.outcome!==c||a.length===0!=(i.summary.state===`not_applicable`))&&t.addIssue({code:`custom`,path:[`days`,r],message:`Outcome and summary must reflect landed evidence`})}e.days.at(-1)?.date!==e.endDate&&t.addIssue({code:`custom`,path:[`endDate`],message:`End must match the last activity day`}),e.undatedEntries.some(e=>e.dateBasis!==`unresolved`)&&t.addIssue({code:`custom`,path:[`undatedEntries`],message:`Undated entries must have unresolved dates`})});function On(e){return P.parse(e)}function kn(e){let t=e.filter(e=>e.deliveryState===`landed`),n=t.some(e=>e.category===`improvement`),r=t.some(e=>e.category!==`improvement`);return n?r?`both`:`improvement`:r?`reset`:`unconfirmed`}const An=524288,F=P.shape,jn=F.days.element,Mn=N.extend({date:F.startDate.nullable()}).superRefine((e,t)=>{e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}),Nn=e.strictObject({state:e.enum([`unconfirmed`,`ongoing`,`ended`]),sourceUrls:e.array(N.shape.sourceUrls.element)}).superRefine((e,t)=>{e.state!==`unconfirmed`&&e.sourceUrls.length===0&&t.addIssue({code:`custom`,path:[`sourceUrls`],message:`Confirmed lifecycle states require source evidence`})}),Pn=jn.omit({date:!0,entries:!0}).extend({entries:e.array(Mn),lifecycle:Nn}),I=e.strictObject({contractVersion:e.literal(2),generatedAt:F.generatedAt,timeZone:F.timeZone,processing:F.processing,days:e.array(Pn).length(28),unassignedEntries:e.array(Mn)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries()){r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`});let e=r.entries.filter(e=>e.deliveryState===`landed`),i=kn(r.entries);(r.outcome!==i||e.length===0!=(r.summary.state===`not_applicable`))&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome and summary must reflect landed evidence`})}});function Fn(e){return I.parse(e)}const In=An,L=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),Ln=N.extend({title:L}),Rn=I.shape,zn=Rn.days.element,Bn=zn.shape.entries.element.safeExtend({title:L}),Vn=zn.extend({title:L.nullable(),entries:e.array(Bn)}).superRefine((e,t)=>{e.title!==null!=(e.summary.state===`ready`)&&t.addIssue({code:`custom`,path:[`title`],message:`A daily title is available exactly when its summary is ready`})}),R=e.strictObject({...Rn,contractVersion:e.literal(3),days:e.array(Vn),unassignedEntries:e.array(Bn)}).superRefine((e,t)=>{let n=I.safeParse({contractVersion:2,generatedAt:e.generatedAt,timeZone:e.timeZone,processing:e.processing,days:e.days.map(({title:e,...t})=>({...t,entries:t.entries.map(({title:e,...t})=>t)})),unassignedEntries:e.unassignedEntries.map(({title:e,...t})=>t)});if(!n.success)for(let e of n.error.issues)t.addIssue({...e})});function Hn(e){return{improvementDays:e.days.filter(e=>e.outcome===`improvement`||e.outcome===`both`).length,resetDays:e.days.filter(e=>e.outcome===`reset`||e.outcome===`both`).length}}function Un(e){return R.parse(e)}const Wn=In,Gn=I.shape,Kn=R.shape.unassignedEntries,qn=Gn.days.element.omit({summary:!0}).extend({entries:Kn}),z=e.strictObject({...Gn,contractVersion:e.literal(4),days:e.array(qn).length(28),unassignedEntries:Kn}).superRefine((e,t)=>{for(let[n,r]of e.days.entries())r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`}),r.outcome!==kn(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function Jn(e){return z.parse(e)}function Yn(e,t){let n=new Set;for(let r of e)n.has(r.eventId)&&t.addIssue({code:`custom`,message:`Duplicate activity eventId`}),n.add(r.eventId)}function Xn(e,t,n){let r=n.reduce((t,n)=>t+e.reactionCounts[n],0);(!Number.isSafeInteger(r)||r!==e.reactionTotal)&&t.addIssue({code:`custom`,path:[`reactionTotal`],message:`Total must equal all reaction counts`})}async function Zn(e,t,n){if(e.status!==200){let t={status:e.status,statusText:e.statusText};try{await e.body?.cancel()}catch(e){throw Error(`activity_file_http_error`,{cause:{...t,cancellationCause:e}})}throw Error(`activity_file_http_error`,{cause:t})}if(e.body===null)throw Error(`activity_file_body_missing`);let r=e.body.getReader(),i=[],a=0;try{for(;;){let e=await r.read();if(e.done)break;if(a+=e.value.byteLength,a>n)throw Error(`activity_file_too_large`,{cause:{maxBytes:n,observedBytes:a}});i.push(e.value)}let e=new Uint8Array(a),o=0;for(let t of i)e.set(t,o),o+=t.byteLength;return t.parse(JSON.parse(new TextDecoder(`utf-8`,{fatal:!0}).decode(e)))}catch(e){try{await r.cancel()}catch{}throw Error(`activity_file_read_failed`,{cause:e})}finally{r.releaseLock()}}function Qn(e,t,n){let r=new TextEncoder().encode(JSON.stringify(t.parse(e)));if(r.byteLength>n)throw Error(`activity_file_too_large`,{cause:{byteLength:r.byteLength}});return r}const B=[`👍`,`😂`,`🤡`,`💀`,`😭`,`🔥`,`🎉`,`👀`,`🙏`,`🫠`],$n=e.enum(B),V=e.string().min(1).max(128),H=524288,er=`https://data.radarultra.com/activity/v1/latest.json`,tr=`https://data.radarultra.com/activity/v2/latest.json`,nr=N.extend({eventId:V}),rr=P.safeExtend({days:e.array(P.shape.days.element.extend({entries:e.array(nr)})).length(28),undatedEntries:e.array(nr)});function ir(e,t){Yn([...e.days.flatMap(e=>e.entries),...e.undatedEntries],t)}const ar=rr.superRefine(ir),or=e.record($n,e.number().int().nonnegative()),sr=e.strictObject({reactionCounts:or,reactionTotal:e.number().int().nonnegative()});function cr(e,t){Xn(e,t,B)}const lr=nr.extend(sr.shape).superRefine(cr),ur=rr.safeExtend({days:e.array(rr.shape.days.element.extend({entries:e.array(lr)})).length(28),undatedEntries:e.array(lr)}).superRefine(ir),U=e.strictObject({publishedAt:e.iso.datetime(),reactionIds:e.array($n).length(B.length).refine(e=>new Set(e).size===B.length,`Every reaction must occur exactly once`),progress:ur}),dr=R.shape,fr=dr.unassignedEntries.element.safeExtend({eventId:V}),pr=e.strictObject({...dr,days:e.array(dr.days.element.safeExtend({entries:e.array(fr)})).length(28),unassignedEntries:e.array(fr)}),mr=pr.superRefine((e,t)=>{let n=({eventId:e,...t})=>t,r=R.safeParse({...e,days:e.days.map(e=>({...e,entries:e.entries.map(n)})),unassignedEntries:e.unassignedEntries.map(n)});if(!r.success)for(let e of r.error.issues)t.addIssue({...e});Yn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),hr=fr.safeExtend(sr.shape).superRefine(cr),gr=pr.safeExtend({days:e.array(dr.days.element.safeExtend({entries:e.array(hr)})).length(28),unassignedEntries:e.array(hr)}).superRefine((e,t)=>{let n=({reactionCounts:e,reactionTotal:t,...n})=>n,r=mr.safeParse({...e,days:e.days.map(e=>({...e,entries:e.entries.map(n)})),unassignedEntries:e.unassignedEntries.map(n)});if(!r.success)for(let e of r.error.issues)t.addIssue({...e})}),_r=U.extend({progress:gr}),vr=z.shape,yr=vr.unassignedEntries.element.safeExtend({eventId:V}),br=z.safeExtend({days:e.array(vr.days.element.safeExtend({entries:e.array(yr)})).length(28),unassignedEntries:e.array(yr)}).superRefine((e,t)=>{Yn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),xr=yr.safeExtend(sr.shape).superRefine(cr),Sr=br.safeExtend({days:e.array(vr.days.element.safeExtend({entries:e.array(xr)})).length(28),unassignedEntries:e.array(xr)}),Cr=U.extend({progress:Sr});async function wr(e){return Zn(e,U,H)}async function Tr(e){return Zn(e,_r,H)}async function Er(e){return Zn(e,Cr,H)}function Dr(e){return Qn(e,U,H)}function Or(e){return Qn(e,_r,H)}function kr(e){return Qn(e,Cr,H)}const Ar=e.strictObject({changeId:e.string().min(1).max(128),eventId:e.string().min(1).max(128),revision:e.int().positive(),kind:e.enum([`created`,`updated`,`withdrawn`]),date:e.iso.date().nullable(),entry:N,receivedAt:e.iso.datetime().nullable(),acceptedAt:e.iso.datetime()}),jr=e.strictObject({contractVersion:e.literal(1),changes:e.array(Ar),nextCursor:e.string().min(1),hasMore:e.boolean()}),Mr=Ar.extend({dayNumber:P.shape.days.element.shape.dayNumber.nullable()}),Nr=jr.extend({contractVersion:e.literal(2),changes:e.array(Mr)}),Pr=e.int().min(0).max(2**53-1),Fr=e.int().min(1).max(28),Ir=e.enum([`yes`,`no`]).nullable(),Lr=e.strictObject({choice:Ir}),Rr=e.strictObject({yes:Pr,no:Pr,total:Pr}).superRefine((e,t)=>{(!Number.isSafeInteger(e.yes+e.no)||e.total!==e.yes+e.no)&&t.addIssue({code:`custom`,path:[`total`],message:`Total must equal the effective choices.`})}),zr=e.strictObject({dayNumber:Fr,state:e.enum([`unopened`,`open`,`closed`]),choice:Ir,outcome:e.enum([`unconfirmed`,`yes`,`no`]),personalResult:e.enum([`none`,`waiting`,`correct`,`incorrect`]),corrected:e.boolean(),counts:Rr}).superRefine((e,t)=>{let n=e.choice===null?`none`:e.outcome===`unconfirmed`?`waiting`:e.choice===e.outcome?`correct`:`incorrect`;e.personalResult!==n&&t.addIssue({code:`custom`,path:[`personalResult`],message:`Personal result must match the confirmed outcome and choice.`}),e.state!==`closed`&&e.outcome!==`unconfirmed`&&t.addIssue({code:`custom`,path:[`outcome`],message:`An open or unopened day cannot have a confirmed result.`}),e.state===`unopened`&&(e.choice!==null||e.counts.total!==0)&&t.addIssue({code:`custom`,path:[`state`],message:`An unopened day cannot have choices.`})}),Br=e.strictObject({revision:Pr,openDayNumber:Fr.nullable(),days:e.array(zr).length(28)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries()){r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Every official day must occur once, in order.`});let i=e.openDayNumber===null||r.dayNumber<e.openDayNumber?`closed`:r.dayNumber===e.openDayNumber?`open`:`unopened`;r.state!==i&&t.addIssue({code:`custom`,path:[`days`,n,`state`],message:`Only the next official day may be open.`})}}),Vr=e.strictObject({error:e.strictObject({code:e.enum([`invalid_request`,`payload_too_large`,`unsupported_media_type`,`origin_not_allowed`,`rate_limited`,`dependency_unavailable`,`internal_error`,`day_closed`,`identity_unavailable`]),message:e.string().min(1).max(2048),requestId:e.string().min(1).max(128),operation:e.enum([`get_guesses`,`set_guess`]),stage:e.string().min(1).max(128),cause:e.record(e.string(),e.unknown()),saveOutcome:e.enum([`not_saved`,`unknown`]).optional()})}).superRefine(({error:e},t)=>{e.operation===`set_guess`!=(e.saveOutcome!==void 0)&&t.addIssue({code:`custom`,path:[`error`,`saveOutcome`],message:`Only save failures must include a save outcome.`})}),Hr=e.strictObject({"zh-Hans":b.shape.noticeTimeline.element.shape.sourceTextZh,"zh-Hant":b.shape.noticeTimeline.element.shape.sourceTextZh,ja:b.shape.noticeTimeline.element.shape.sourceTextZh,ko:b.shape.noticeTimeline.element.shape.sourceTextZh}),Ur=b.shape.noticeTimeline.element.omit({sourceTextZh:!0}).extend({sourceTranslations:Hr}).strict(),Wr=e.strictObject({...b.shape,contractVersion:e.literal(2),noticeTimeline:e.array(Ur).min(1).max(r.actionDetail.noticeTimeline)}),Gr=e.strictObject({...x.shape,noticeTimeline:e.array(Ur.omit({phase:!0}).extend({kinds:x.shape.noticeTimeline.element.shape.kinds}).strict()).min(1).max(r.actionDetail.noticeTimeline)}),Kr=e=>{let{sourceTranslations:t,...n}=e;return{...n,sourceTextZh:t[`zh-Hans`]}},qr=e=>({...e,contractVersion:1,noticeTimeline:e.noticeTimeline.map(Kr)}),Jr=e=>({...e,noticeTimeline:e.noticeTimeline.map(Kr)}),Yr=(e,t)=>{for(let n of e.error?.issues??[])t.addIssue({...n})},W=Wr.superRefine((e,t)=>{Yr(b.safeParse(qr(e)),t)}),Xr=Gr.superRefine((e,t)=>{Yr(x.safeParse(Jr(e)),t)}),Zr=e.strictObject({...S.shape,contractVersion:e.literal(2),actions:e.array(W).min(1).max(r.analysis.actions),pendingResetActions:e.array(Xr).max(r.analysis.actions)}).superRefine((e,t)=>{Yr(S.safeParse({...e,contractVersion:1,actions:e.actions.map(qr),pendingResetActions:e.pendingResetActions.map(Jr)}),t),new TextEncoder().encode(JSON.stringify(e)).byteLength>r.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`export_utf8_size_limit_exceeded`,path:[]})}),Qr=e=>W.parse(e),$r=e=>Xr.parse(e),ei=e=>Zr.parse(e);function ti(e){let t=ei(e);return S.parse({...t,contractVersion:1,actions:t.actions.map(qr),pendingResetActions:t.pendingResetActions.map(Jr)})}const ni=W.shape,ri=e.strictObject({title:e.string(),body:e.string()}),ii=e.strictObject({zh:ri,en:ri}),ai=e.enum([`end_preview`,`restore_preview`,`set_auto_notification`,`notify`]),oi=e.strictObject({resetActionId:ni.resetActionId,operation:ai,expectedRevision:e.int().nonnegative(),copy:ii.nullable(),automaticNotification:e.boolean().nullable()}).superRefine((e,t)=>{e.operation===`notify`!=(e.copy!==null)&&t.addIssue({code:`custom`,path:[`copy`],message:`notification_copy_operation_mismatch`}),e.operation===`set_auto_notification`!=(e.automaticNotification!==null)&&t.addIssue({code:`custom`,path:[`automaticNotification`],message:`notification_policy_operation_mismatch`})}),si=oi,ci=oi,li=e.strictObject({digest:e.string().regex(/^sha256:[a-f0-9]{64}$/),sourceWatermark:e.string().min(1),draft:oi}),ui=e.strictObject({operationId:e.uuid(),preview:li}),di=e.strictObject({resetActionId:ni.resetActionId,revision:e.number().int().nonnegative(),state:e.enum([`preview`,`executed`,`cancelled`,`undetermined`]),firstAnnouncedAt:T.nullable(),officialConfirmed:e.boolean(),pendingPreview:e.boolean(),previewClosed:e.boolean(),automaticNotification:e.boolean(),sourceUrls:e.array(ni.noticeTimeline.element.shape.sourceUrl),availableOperations:e.array(ai),notificationOperationId:e.uuid().nullable()}),fi=e.strictObject({actions:e.array(di)}),pi=e.discriminatedUnion(`status`,[e.strictObject({status:e.literal(`unknown`),operationId:e.uuid()}),e.strictObject({status:e.literal(`saved`),operationId:e.uuid(),resetActionId:ni.resetActionId,operation:ai,revision:e.number().int().positive(),notification:e.strictObject({state:e.enum([`disabled`,`pending`,`claimed`,`retry_wait`,`accepted`,`rejected`,`expired`]),resultCode:e.string().nullable(),diagnostic:e.record(e.string(),e.unknown()).nullable()})})]),G=b.shape.noticeTimeline.element.shape,mi=e.enum([`initial`,`supplement`,`correction`]).nullable(),hi=e.strictObject({authoredAt:G.authoredAt,role:mi,sourceUrl:G.sourceUrl,sourceText:G.sourceText,sourceTextZh:G.sourceTextZh}),gi=e.array(hi).min(1).superRefine((e,t)=>{let n=new Set,r;for(let[i,a]of e.entries()){if(n.has(a.sourceUrl)&&t.addIssue({code:`custom`,path:[i,`sourceUrl`],message:`An original post may appear only once per improvement`}),n.add(a.sourceUrl),!G.authoredAt.safeParse(a.authoredAt).success){r=void 0;continue}if(r!==void 0){let e=C(r.authoredAt,a.authoredAt);(e>0||e===0&&r.sourceUrl>a.sourceUrl)&&t.addIssue({code:`custom`,path:[i],message:`Posts must be ordered by authoredAt and sourceUrl`})}r=a}}),_i=Wn,vi=N.omit({description:!0}).extend({category:e.literal(`improvement`),title:L,posts:gi}),yi=N.extend({category:e.enum([`direct_reset`,`reset_card`]),title:L}),bi=e.discriminatedUnion(`category`,[vi,yi]),xi=z.shape,Si=xi.unassignedEntries.element.shape.date;function Ci(e,t){e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}const wi=e.discriminatedUnion(`category`,[vi.extend({date:Si}).superRefine(Ci),yi.extend({date:Si}).superRefine(Ci)]),Ti=e.strictObject({...xi,contractVersion:e.literal(5),days:e.array(xi.days.element.extend({entries:e.array(wi)})).length(28),unassignedEntries:e.array(wi)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries())r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`}),r.outcome!==kn(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function Ei(e){return Ti.parse(e)}const Di=`https://data.radarultra.com/activity/v3/latest.json`,Oi=Ti.shape,[ki,Ai]=Oi.unassignedEntries.element.options,ji=ki.safeExtend({eventId:V}),Mi=Ai.safeExtend({eventId:V}),Ni=e.discriminatedUnion(`category`,[ji,Mi]),Pi=Ti.safeExtend({days:e.array(Oi.days.element.extend({entries:e.array(Ni)})).length(28),unassignedEntries:e.array(Ni)}).superRefine((e,t)=>{Yn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),Fi={reactionCounts:or,reactionTotal:e.number().int().nonnegative()},Ii=(e,t)=>Xn(e,t,B),Li=e.discriminatedUnion(`category`,[ji.safeExtend(Fi).superRefine(Ii),Mi.safeExtend(Fi).superRefine(Ii)]),Ri=Pi.safeExtend({days:e.array(Oi.days.element.extend({entries:e.array(Li)})).length(28),unassignedEntries:e.array(Li)}),zi=U.extend({progress:Ri});async function Bi(e){return Zn(e,zi,H)}function Vi(e){return Qn(e,zi,H)}const Hi=e.discriminatedUnion(`category`,[vi,N.extend({category:e.enum([`direct_reset`,`reset_card`])})]),Ui=Mr.extend({entry:Hi}),Wi=Nr.extend({contractVersion:e.literal(3),changes:e.array(Ui)});function Gi(e){return Ui.parse(e)}function Ki(e){return Wi.parse(e)}const qi=`https://radarultra.com`,Ji=[`zh-Hans`,`zh-Hant`,`en`,`ja`,`ko`],Yi={"zh-Hans":`/zh`,"zh-Hant":`/zh-hant`,en:``,ja:`/ja`,ko:`/ko`},Xi={reset:`/codex`,improvement:`/codex/28-day-challenge`,changelog:`/codex/changelog`,models:`/codex/models`},K=e.discriminatedUnion(`product`,[e.strictObject({product:e.literal(`cli`),version:e.string().regex(/^\d+\.\d+\.\d+$/)}),e.strictObject({product:e.literal(`app`),version:e.string().regex(/^\d{2}\.\d{3,4}$/)})]),q=e.string().regex(/^(?!\.{1,2}$)[a-z0-9.-]+$/);function J(e,t){return qi+Yi[t]+Xi[e]}function Zi(e,t,n){let r=K.parse({product:e,version:t});return`${J(`changelog`,n)}/${r.product}/${r.version}`}function Qi(e,t){return`${J(`models`,t)}/${q.parse(e)}`}const $i=Object.freeze({timeZone:`America/Los_Angeles`,startDate:`2026-10-05`,endDate:`2026-11-01`}),ea=Date.parse(`${$i.startDate}T00:00:00Z`),ta=(Date.parse(`${$i.endDate}T00:00:00Z`)-ea)/864e5+1,na=new Intl.DateTimeFormat(`en-CA`,{timeZone:$i.timeZone,year:`numeric`,month:`2-digit`,day:`2-digit`});function ra(e){let t=na.formatToParts(e),n=e=>Number(t.find(t=>t.type===e).value),r=(Date.UTC(n(`year`),n(`month`)-1,n(`day`))-ea)/864e5,i=r<0?`before`:r>=ta?`ended`:`live`,a=Math.min(ta,Math.max(1,r+1));return{phase:i,today:a,ongoingDay:i===`live`?a:null}}const ia=e.enum([`reset`,`improvement`]),aa=e.array(ia).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),oa=t=>e.url().refine(e=>Ji.some(n=>e===J(t,n)),`notification_target_url_invalid`),sa=e.discriminatedUnion(`kind`,[e.object({kind:e.literal(`reset`),webUrl:oa(`reset`),miniPath:e.literal(`pages/index/index`)}).strict(),e.object({kind:e.literal(`improvement`),webUrl:oa(`improvement`),miniPath:e.literal(`pages/index/index?page=challenge`)}).strict()]),ca=e.object({topics:aa,target:sa}).strict().refine(e=>e.topics.includes(e.target.kind),`notification_target_topic_mismatch`),la=e.enum([`reset`,`improvement`,`clue`]),ua=e.object({topics:e.array(la).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),target:sa}).strict().refine(e=>e.topics.some(t=>(t===`clue`?`reset`:t)===e.target.kind),`notification_target_topic_mismatch`);function da(e,t){let n=fa(e===`clue`?`reset`:e,t);return ua.parse({...n,topics:[e]})}function fa(e,t){return ca.parse({topics:[e],target:{kind:e,webUrl:J(e,t),miniPath:e===`reset`?`pages/index/index`:`pages/index/index?page=challenge`}})}const pa=e.object({notificationId:e.uuid(),eventId:e.uuid(),title:e.string().trim().min(1).max(512),createdAt:e.iso.datetime(),deliverBy:e.iso.datetime(),...ca.shape}).strict().superRefine((e,t)=>{e.topics.includes(e.target.kind)||t.addIssue({code:`custom`,message:`notification_target_topic_mismatch`}),C(e.deliverBy,e.createdAt)<=0&&t.addIssue({code:`custom`,message:`notification_task_deadline_invalid`})});function ma(e,t){return C(e.createdAt,t.createdAt)||(e.notificationId<t.notificationId?-1:+(e.notificationId>t.notificationId))}const ha=`/api/v1/notification-tasks`,ga=100,_a=e.string().min(1).max(8192),va=e.object({cursor:_a.optional()}).strict(),ya=e.object({contractVersion:e.literal(1),roundCursor:_a,notifications:e.array(pa).max(100),nextCursor:_a.nullable()}).strict().superRefine((e,t)=>{new Set(e.notifications.map(e=>e.notificationId)).size!==e.notifications.length&&t.addIssue({code:`custom`,message:`notification_task_duplicate`});for(let n=1;n<e.notifications.length;n++)ma(e.notifications.at(n-1),e.notifications.at(n))>=0&&t.addIssue({code:`custom`,message:`notification_task_order_invalid`});e.nextCursor!==null&&e.notifications.length===0&&t.addIssue({code:`custom`,message:`notification_task_empty_continuation`})}),ba=`/api/browser-notifications`,xa=e.string().min(1).max(128),Sa=e.uuid(),Ca=e.enum(Ji),wa=e.strictObject({reset:e.boolean(),improvement:e.boolean()}),Ta=`[cdef][\\w-]{21}`,Ea=e.strictObject({fid:e.string().regex(RegExp(`^${Ta}$`))});function Da(e){return e.replace(RegExp(`(^|[^\\w-])${Ta}(?![\\w-])`,`g`),`$1[registration]`)}const Y={operationId:Sa,expectedRevision:xa},Oa=e.discriminatedUnion(`action`,[e.strictObject({...Y,action:e.literal(`register`),topics:wa.refine(e=>e.reset||e.improvement,`subscription_topic_required`),locale:Ca,registration:Ea}),e.strictObject({...Y,action:e.literal(`set_topics`),topics:wa}),e.strictObject({...Y,action:e.literal(`set_locale`),locale:Ca}),e.strictObject({...Y,action:e.literal(`restore`),registration:Ea}),e.strictObject({...Y,action:e.literal(`retry`)}),e.strictObject({...Y,action:e.literal(`cancel`)})]),ka=e.strictObject({operationId:Sa.optional(),expectedRevision:xa.optional()}).refine(e=>e.operationId===void 0==(e.expectedRevision===void 0),`subscription_operation_reference_incomplete`),Aa=e.strictObject({code:e.enum([`invalid_request`,`identity_unavailable`,`origin_not_allowed`,`rate_limited`,`revision_conflict`,`operation_conflict`,`registration_conflict`,`dependency_unavailable`,`provider_rejected`,`provider_rate_limited`,`provider_unavailable`,`provider_timeout`,`internal_error`]),operationId:Sa.optional(),correlationId:e.uuid(),stage:e.string().min(1).max(128),saveOutcome:e.enum([`not_saved`,`unknown`]),reasonSummary:e.string().min(1).max(2048),retryable:e.boolean(),cause:e.record(e.string(),e.unknown())}),ja=e.strictObject({id:Sa,state:e.enum([`pending`,`applied`,`rejected`,`unknown`,`superseded`,`not_found`]),error:Aa.optional()}),Ma=e.strictObject({topicSettings:e.strictObject({state:e.enum([`initial`,`saved`]),revision:xa,topics:wa,locale:Ca.nullable()}),registrationState:e.enum([`none`,`ready`,`invalid`,`changing`]),registrationKey:e.string().regex(/^[a-f0-9]{64}$/).nullable(),manualRetryRequired:e.boolean(),operation:ja.nullable()});function Na(e,t){return{topics:t.action===`register`||t.action===`set_topics`?t.topics:e.topics,locale:t.action===`register`||t.action===`set_locale`?t.locale:e.locale}}const Pa=e.strictObject({data:Ma}),Fa=e.strictObject({error:Aa});function Ia(e){return{topicSettings:{state:`initial`,revision:e,topics:{reset:!0,improvement:!1},locale:null},registrationState:`none`,registrationKey:null,manualRetryRequired:!1,operation:null}}const La=wa.extend({clue:e.boolean().default(!1)}),[Ra,za,...Ba]=Oa.options,Va=e.discriminatedUnion(`action`,[Ra.extend({topics:La.refine(e=>Object.values(e).some(Boolean),`subscription_topic_required`)}),za.extend({topics:La}),...Ba]),Ha=Ma.extend({topicSettings:Ma.shape.topicSettings.extend({topics:La})}),Ua=e.strictObject({data:Ha});function Wa(e){return Ha.parse(Ia(e))}function Ga(e){let{clue:t,...n}=e.topicSettings.topics;return Ma.parse({...e,topicSettings:{...e.topicSettings,topics:n}})}function Ka(e,t){return e.action!==`register`&&e.action!==`set_topics`?e:{...e,topics:{...e.topics,clue:e.action!==`register`&&(e.topics.reset||e.topics.improvement)&&t.clue}}}const qa=20,Ja=2*1024*1024,Ya=`/api/v1/improvements`,Xa=e.string().min(1).max(1024),[Za]=Pi.shape.unassignedEntries.element.options,Qa=Za.safeExtend({date:e.iso.date().refine(e=>e>$i.endDate,`improvement_must_follow_campaign`)}),$a=e.strictObject({}),eo=e.strictObject({challengeEnded:e.boolean(),observedAt:e.iso.datetime()}),to=e.strictObject({cursor:Xa.nullable(),limit:e.literal(20)}),no=eo.extend({entries:e.array(Qa).max(20),nextCursor:Xa.nullable()}).superRefine((e,t)=>{new Set(e.entries.map(e=>e.eventId)).size!==e.entries.length&&t.addIssue({code:`custom`,path:[`entries`],message:`Duplicate improvement identity`})}),ro=e.strictObject({eventIds:e.array(V).min(1).max(128)}),io=e.strictObject({eventIds:e.array(V).max(128)}),ao=e.strictObject({error:e.strictObject({code:e.enum([`invalid_request`,`dependency_unavailable`,`internal_error`]),message:e.string(),requestId:e.uuid(),operation:e.string(),stage:e.string(),cause:e.record(e.string(),e.unknown())})}),oo=`/tibo-source/v1/latest.json`,so=512*1024,co=e.iso.datetime({offset:!0}),lo=b.shape.noticeTimeline.element,uo=e.strictObject({contractVersion:e.literal(1),observedAt:co,check:e.strictObject({checkedAt:co,freshUntil:co,active:e.boolean()}).nullable(),latestPost:e.strictObject({authoredAt:co,sourceUrl:lo.shape.sourceUrl,sourceText:e.string(),sourceTranslations:Hr,resetRelevance:e.enum([`related`,`unrelated`,`unknown`])}).nullable()});async function fo(e){let t=e.body?.getReader();if(t===void 0)throw Error(`tibo_source_status_body_missing`,{cause:{status:e.status}});let n=[],r=0;try{for(;;){let i=await t.read();if(i.done)break;if(r+=i.value.byteLength,r>524288)throw Error(`tibo_source_status_too_large`,{cause:{status:e.status,bytes:r}});n.push(i.value)}}finally{try{await t.cancel()}catch{}t.releaseLock()}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;let o=new TextDecoder(`utf-8`,{fatal:!0}).decode(i);if(!e.ok)throw Error(`tibo_source_status_http_error`,{cause:{status:e.status,upstream:o.slice(0,4e3)}});return uo.parse(JSON.parse(o))}const po=`/reset-clue/v1/latest.json`,mo=4320*60*1e3,ho=r.exportUtf8Bytes,go=W.shape.noticeTimeline.element.pick({authoredAt:!0,sourceUrl:!0,sourceText:!0,sourceTranslations:!0,contentCompleteness:!0}).extend({plannedTiming:Re.nullable(),expiresAt:W.shape.noticeTimeline.element.shape.authoredAt}).strict().superRefine((e,t)=>{Date.parse(e.expiresAt)!==Date.parse(e.authoredAt)+2592e5&&t.addIssue({code:`custom`,message:`reset_clue_expiry_mismatch`,path:[`expiresAt`]})}),_o=e.strictObject({contractVersion:e.literal(1),clue:go.nullable()}),vo=e=>_o.parse(e);function yo(e,t){return e.clue!==null&&t.getTime()<Date.parse(e.clue.expiresAt)?e.clue:null}async function bo(e){let t=e.body?.getReader();if(t===void 0)throw Error(`reset_clue_body_missing`,{cause:{status:e.status}});let n=[],r=0;try{for(;;){let i=await t.read();if(i.done)break;if(r+=i.value.byteLength,r>ho)throw Error(`reset_clue_too_large`,{cause:{status:e.status,bytes:r}});n.push(i.value)}}finally{try{await t.cancel()}catch{}t.releaseLock()}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;let o=new TextDecoder(`utf-8`,{fatal:!0}).decode(i);if(!e.ok)throw Error(`reset_clue_http_error`,{cause:{status:e.status,upstream:o.slice(0,4e3)}});return vo(JSON.parse(o))}const X=e.enum(Ji),xo=e.string().regex(/^\d{4}-(?:0[1-9]|1[0-2])$/),Z=e.string().trim().min(1),So=e.url({protocol:/^https$/}),Q=e.discriminatedUnion(`kind`,[e.strictObject({kind:e.literal(`instant`),at:e.iso.datetime()}),e.strictObject({kind:e.literal(`date`),date:e.iso.date()})]),Co=e.strictObject({operation:Z,stage:Z,cause:Gt});function wo(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),value:t}),e.strictObject({state:e.literal(`pending`)}),e.strictObject({state:e.literal(`failed`),failure:Co})])}function To(e,t){return e.superRefine((e,n)=>{new TextEncoder().encode(JSON.stringify(e)).byteLength>t&&n.addIssue({code:`custom`,message:`publication_utf8_size_limit_exceeded`})})}async function Eo(e,t,n,r){let i=e.body?.getReader();if(i===void 0)throw Error(`${t}_body_missing`,{cause:{operation:t,stage:`read`,status:e.status}});let a=[],o=0;try{for(;;){let e=await i.read();if(e.done)break;if(o+=e.value.byteLength,o>n)throw Error(`publication_utf8_size_limit_exceeded`);a.push(e.value)}}catch(n){throw Error(`${t}_read_failed`,{cause:{operation:t,stage:`read`,status:e.status,bytes:o,cause:n}})}finally{try{await i.cancel()}catch{}i.releaseLock()}let s=new Uint8Array(o),c=0;for(let e of a)s.set(e,c),c+=e.byteLength;let l;try{l=new TextDecoder(`utf-8`,{fatal:!0}).decode(s)}catch(n){throw Error(`${t}_decode_failed`,{cause:{operation:t,stage:`decode`,status:e.status,cause:n}})}if(!e.ok)throw Error(`${t}_http_error`,{cause:{operation:t,stage:`http`,status:e.status,upstream:l.slice(0,4e3)}});try{return r.parse(JSON.parse(l))}catch(n){throw Error(`${t}_parse_failed`,{cause:{operation:t,stage:`parse`,status:e.status,cause:n}})}}const Do=`/codex-releases/v2/directory.json`,Oo=128*1024,ko=128*1024,Ao=256*1024,jo=Q,Mo={product:e.enum([`app`,`cli`]),version:Z,published:Q,month:xo,revision:Z},No=e.strictObject(Mo).superRefine(Po);function Po(e,t){let n=K.safeParse({product:e.product,version:e.version});if(!n.success)for(let e of n.error.issues)t.addIssue({...e});e.product===`cli`!=(e.published.kind===`instant`)&&t.addIssue({code:`custom`,path:[`published`],message:`product_date_precision_mismatch`}),(e.published.kind===`instant`?e.published.at:e.published.date).slice(0,7)!==e.month&&t.addIssue({code:`custom`,path:[`month`],message:`published_month_mismatch`})}function Fo(e,t){let n=new Set,r=1/0;for(let[i,a]of e.entries()){let e=`${a.product}/${a.version}`;n.has(e)&&t.addIssue({code:`custom`,path:[`releases`,i],message:`duplicate_release_identity`}),n.add(e);let o=Date.parse(a.published.kind===`instant`?a.published.at:`${a.published.date}T00:00:00Z`);o>r&&t.addIssue({code:`custom`,path:[`releases`,i],message:`release_order_mismatch`}),r=o}}const Io=To(e.strictObject({contractVersion:e.literal(2),releases:e.array(No),latest:e.strictObject({app:e.string().nullable(),cli:e.string().nullable()})}).superRefine((e,t)=>{Fo(e.releases,t);for(let n of[`app`,`cli`]){let r=e.releases.find(e=>e.product===n)?.version??null;e.latest[n]!==r&&t.addIssue({code:`custom`,path:[`latest`,n],message:`latest_release_mismatch`})}}),Oo),Lo=e.strictObject({state:e.literal(`not_applicable`),reason:e.literal(`no_curated_notes`)}),Ro=e.union([wo(e.strictObject({locale:X,points:e.array(Z).min(1).max(5)})),Lo]),zo=e.strictObject({...Mo,source:e.strictObject({kind:e.enum([`github`,`official`]),url:So}),summary:Ro,notesCount:e.number().int().nonnegative()}).superRefine((e,t)=>{Po(e,t),e.product===`cli`!=(e.source.kind===`github`)&&t.addIssue({code:`custom`,path:[`source`,`kind`],message:`product_source_mismatch`}),e.notesCount===0!=(e.summary.state===`not_applicable`)&&t.addIssue({code:`custom`,path:[`summary`],message:`curated_notes_summary_state_mismatch`})}),Bo=To(e.strictObject({contractVersion:e.literal(2),locale:X,month:xo,releases:e.array(zo)}).superRefine((e,t)=>{Fo(e.releases,t);for(let[n,r]of e.releases.entries())r.month!==e.month&&t.addIssue({code:`custom`,path:[`releases`,n,`month`],message:`file_month_mismatch`}),r.summary.state===`ready`&&r.summary.value.locale!==e.locale&&r.summary.value.locale!==`en`&&t.addIssue({code:`custom`,path:[`releases`,n,`summary`,`value`,`locale`],message:`summary_locale_mismatch`})}),ko),Vo=e.array(e.strictObject({title:Z.nullable(),items:e.array(e.strictObject({text:Z,refs:Z.nullable()})).min(1)})).min(1),Ho=To(e.strictObject({contractVersion:e.literal(2),product:e.enum([`app`,`cli`]),version:Z,revision:Z,locale:X,original:e.array(Vo.element),translation:e.union([wo(Vo),Lo]).nullable()}).superRefine((e,t)=>{let n=K.safeParse({product:e.product,version:e.version});if(!n.success)for(let e of n.error.issues)t.addIssue({...e});if(e.locale===`en`!=(e.translation===null)&&t.addIssue({code:`custom`,path:[`translation`],message:`translation_locale_mismatch`}),e.locale!==`en`&&e.original.length===0!=(e.translation?.state===`not_applicable`)&&t.addIssue({code:`custom`,path:[`translation`],message:`curated_notes_translation_state_mismatch`}),e.translation?.state===`ready`){let n=e.translation.value;(n.length!==e.original.length||e.original.some((e,t)=>{let r=n.at(t);return r===void 0||e.title===null!=(r.title===null)||e.items.length!==r.items.length||e.items.some((e,t)=>e.refs!==r.items.at(t)?.refs)}))&&t.addIssue({code:`custom`,path:[`translation`],message:`translation_structure_mismatch`})}}),Ao),Uo=e=>Io.parse(e),Wo=e=>Bo.parse(e),Go=e=>Ho.parse(e),Ko=e=>Eo(e,`codex_release_directory`,Oo,Io),qo=e=>Eo(e,`codex_release_month`,ko,Bo),Jo=e=>Eo(e,`codex_release_notes`,Ao,Ho);function Yo(e,t){return`/codex-releases/v2/${X.parse(e)}/${xo.parse(t)}.json`}function Xo(e,t,n){let r=K.parse({product:t,version:n});return`/codex-releases/v2/${X.parse(e)}/notes/${r.product}/${r.version}.json`}const Zo=128*1024;function $(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`known`),value:t,source:So}),e.strictObject({state:e.literal(`unavailable`),reason:e.enum([`not_announced`,`not_listed`]),source:So.nullable()})])}const Qo=e.strictObject({input:Z,cached:Z,output:Z}),$o=e.strictObject({modelId:q,name:Z,group:e.enum([`current`,`retired`]),status:e.enum([`available`,`retiring`,`retired`]),launched:$(Q),chatgptRetirement:$(Q),apiRetirement:$(Q),credits:$(Qo),apiPrice:$(Qo),multiple:e.string().regex(/^(?:0|[1-9]\d*)(?:\.\d+)?$/).refine(e=>Number.isFinite(Number(e))&&Number(e)>0).nullable(),plans:$(e.array(Z).min(1)),surfaces:$(e.array(Z).min(1)),about:wo(e.strictObject({locale:X,paragraphs:e.array(Z).min(1)})),sources:e.array(e.strictObject({label:Z,url:So})).min(1)}).superRefine((e,t)=>{e.status===`retired`!=(e.group===`retired`)&&t.addIssue({code:`custom`,path:[`group`],message:`model_group_status_mismatch`}),e.status===`retiring`&&e.chatgptRetirement.state!==`known`&&t.addIssue({code:`custom`,path:[`chatgptRetirement`],message:`retiring_model_requires_announced_date`})}),es=To(e.strictObject({contractVersion:e.literal(1),locale:X,models:e.array($o),multipleBase:e.strictObject({modelId:q,name:Z}).nullable(),upcomingRetirement:e.strictObject({names:Z,modelIds:e.array(q).min(1),surface:e.enum([`api`,`chatgpt`]),at:Q}).nullable()}).superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.models.entries())n.has(i.modelId)&&t.addIssue({code:`custom`,path:[`models`,r,`modelId`],message:`duplicate_model_identity`}),n.add(i.modelId),i.about.state===`ready`&&i.about.value.locale!==e.locale&&i.about.value.locale!==`en`&&t.addIssue({code:`custom`,path:[`models`,r,`about`,`value`,`locale`],message:`model_description_locale_mismatch`}),i.multiple!==null&&(e.multipleBase===null||i.credits.state!==`known`)&&t.addIssue({code:`custom`,path:[`models`,r,`multiple`],message:`multiple_requires_base_and_credits`});if(e.multipleBase!==null){let n=e.models.find(t=>t.modelId===e.multipleBase?.modelId);(n===void 0||n.group!==`current`||n.credits.state!==`known`||n.multiple!==`1`||n.name!==e.multipleBase.name)&&t.addIssue({code:`custom`,path:[`multipleBase`],message:`multiple_base_mismatch`})}let r=e.upcomingRetirement;if(r!==null){new Set(r.modelIds).size!==r.modelIds.length&&t.addIssue({code:`custom`,path:[`upcomingRetirement`,`modelIds`],message:`duplicate_retirement_model`});for(let n of r.modelIds){let i=e.models.find(e=>e.modelId===n),a=r.surface===`api`?i?.apiRetirement:i?.chatgptRetirement;(a?.state!==`known`||JSON.stringify(a.value)!==JSON.stringify(r.at))&&t.addIssue({code:`custom`,path:[`upcomingRetirement`],message:`retirement_model_date_mismatch`})}}}),Zo),ts=e=>es.parse(e),ns=e=>Eo(e,`codex_models`,Zo,es),rs=e=>`/codex-models/v1/${X.parse(e)}.json`;export{an as RadarResetSourceContractErrorV2,yo as activeRadarResetClue,ma as compareRadarNotificationTasks,He as compareRadarResetActionDetailsV1,C as compareRadarResetUtcTimestampsV1,da as createRadarBrowserNotificationProjection,ra as createRadarCodexProgressCalendar,fa as createRadarNotificationProjection,wn as createRadarResetSourceErrorEnvelopeV2,Dr as encodeRadarActivityFile,kr as encodeRadarActivityFileV2,Vi as encodeRadarActivityFileV3,pn as encodeRadarResetDetailMultipartV2,Or as encodeRadarTitledActivityFile,ct as formatRadarResetPositiveDecimalV2,st as formatRadarResetUInt64DecimalV2,Ia as initialRadarBrowserSubscription,Wa as initialRadarBrowserSubscriptionV2,ts as parseRadarCodexModels,Gi as parseRadarCodexProgressChangeV3,Ki as parseRadarCodexProgressChangesV3,On as parseRadarCodexProgressV1,Fn as parseRadarCodexProgressV2,Un as parseRadarCodexProgressV3,Jn as parseRadarCodexProgressV4,Ei as parseRadarCodexProgressV5,Uo as parseRadarCodexReleaseDirectory,Wo as parseRadarCodexReleaseMonth,Go as parseRadarCodexReleaseNotes,We as parseRadarResetActionDetailV1,Qr as parseRadarResetActionDetailV2,bt as parseRadarResetActionSummaryV2,Ue as parseRadarResetAnalysisV1,vo as parseRadarResetClueSnapshot,_n as parseRadarResetDetailMultipartV2,Ge as parseRadarResetExportV1,ei as parseRadarResetExportV2,Ke as parseRadarResetPendingActionV1,$r as parseRadarResetPendingActionV2,at as parseRadarResetPositiveDecimalV2,St as parseRadarResetPublicationHomeFactsV2,rn as parseRadarResetPublicationRevisionAvailableV2,Xt as parseRadarResetReadActionsRequestV2,en as parseRadarResetReadActionsSuccessV2,Zt as parseRadarResetReadChangesRequestV2,tn as parseRadarResetReadChangesSuccessV2,Qt as parseRadarResetReadDetailBatchRequestV2,Yt as parseRadarResetReadHeadRequestV2,$t as parseRadarResetReadHeadSuccessV2,oe as parseRadarResetSnapshotAvailableV1,nn as parseRadarResetSourceErrorEnvelopeV2,it as parseRadarResetUInt64DecimalV2,Na as projectRadarBrowserSubscriptionSelection,Ga as projectRadarBrowserSubscriptionV1,ti as projectRadarResetExportV1FromV2,qe as projectRadarResetPrimarySourceV1,V as radarActivityEventIdSchema,U as radarActivityFileSchema,er as radarActivityFileUrl,Cr as radarActivityFileV2Schema,tr as radarActivityFileV2Url,zi as radarActivityFileV3Schema,Di as radarActivityFileV3Url,H as radarActivityMaxBytes,ar as radarActivityProgressSchema,br as radarActivityProgressV2Schema,Pi as radarActivityProgressV3Schema,or as radarActivityReactionCountsSchema,$n as radarActivityReactionIdSchema,B as radarActivityReactionIds,ua as radarBrowserNotificationProjectionSchema,la as radarBrowserNotificationTopicSchema,Ea as radarBrowserRegistrationSchema,Fa as radarBrowserSubscriptionErrorRes,Aa as radarBrowserSubscriptionFailureSchema,ja as radarBrowserSubscriptionOperationSchema,ka as radarBrowserSubscriptionReadReq,Pa as radarBrowserSubscriptionRes,Oa as radarBrowserSubscriptionSaveReq,Va as radarBrowserSubscriptionSaveV2Req,Ua as radarBrowserSubscriptionV2Res,Ma as radarBrowserSubscriptionViewSchema,Ha as radarBrowserSubscriptionViewV2Schema,ba as radarBrowserSubscriptionsPath,wa as radarBrowserTopicsSchema,La as radarBrowserTopicsV2Schema,Ir as radarCodexGuessChoiceSchema,Vr as radarCodexGuessErrorSchema,Lr as radarCodexGuessSaveReqSchema,Br as radarCodexGuessViewSchema,q as radarCodexModelIdSchema,Qi as radarCodexModelUrl,Zo as radarCodexModelsMaxBytes,rs as radarCodexModelsPath,es as radarCodexModelsSchema,$i as radarCodexProgressCalendar,Ar as radarCodexProgressChangeSchema,Mr as radarCodexProgressChangeV2Schema,Ui as radarCodexProgressChangeV3Schema,jr as radarCodexProgressChangesV1Schema,Nr as radarCodexProgressChangesV2Schema,Wi as radarCodexProgressChangesV3Schema,N as radarCodexProgressEntrySchema,Ln as radarCodexProgressEntryV3Schema,bi as radarCodexProgressEntryV5Schema,vi as radarCodexProgressImprovementV5Schema,mi as radarCodexProgressPostRoleV5Schema,hi as radarCodexProgressPostV5Schema,gi as radarCodexProgressPostsV5Schema,yi as radarCodexProgressResetEntryV5Schema,Hn as radarCodexProgressScore,L as radarCodexProgressTitleV3Schema,P as radarCodexProgressV1Schema,An as radarCodexProgressV2MaxBytes,I as radarCodexProgressV2Schema,In as radarCodexProgressV3MaxBytes,R as radarCodexProgressV3Schema,Wn as radarCodexProgressV4MaxBytes,z as radarCodexProgressV4Schema,_i as radarCodexProgressV5MaxBytes,Ti as radarCodexProgressV5Schema,Oo as radarCodexReleaseDirectoryMaxBytes,Do as radarCodexReleaseDirectoryPath,Io as radarCodexReleaseDirectorySchema,K as radarCodexReleaseIdentitySchema,ko as radarCodexReleaseMonthMaxBytes,Yo as radarCodexReleaseMonthPath,Bo as radarCodexReleaseMonthSchema,Ao as radarCodexReleaseNotesMaxBytes,Xo as radarCodexReleaseNotesPath,Ho as radarCodexReleaseNotesSchema,Vo as radarCodexReleaseSectionsSchema,Zi as radarCodexReleaseUrl,jo as radarCodexTimePointSchema,Ya as radarImprovementColumnPath,ro as radarImprovementEligibilityReq,io as radarImprovementEligibilityRes,Qa as radarImprovementEntrySchema,ao as radarImprovementErrorRes,$a as radarImprovementHeadReq,eo as radarImprovementHeadRes,Ja as radarImprovementPageMaxBytes,to as radarImprovementPageReq,no as radarImprovementPageRes,qa as radarImprovementPageSize,ca as radarNotificationProjectionSchema,sa as radarNotificationTargetSchema,ga as radarNotificationTaskPageSize,pa as radarNotificationTaskSchema,ha as radarNotificationTasksPath,va as radarNotificationTasksReq,ya as radarNotificationTasksRes,ia as radarNotificationTopicSchema,aa as radarNotificationTopicsSchema,b as radarResetActionDetailV1Schema,W as radarResetActionDetailV2Schema,Dt as radarResetActionItemV2Schema,Ze as radarResetActionPageMaxBytesV2,Xe as radarResetActionPageMaxItemsV2,yt as radarResetActionSummaryV2Schema,Tt as radarResetActiveActionItemV2Schema,Pe as radarResetAnalysisV1Schema,n as radarResetAnalyzerContractVersionV1,s as radarResetAudienceValues,Ft as radarResetChangeCoverageV2Schema,$e as radarResetChangePageMaxBytesV2,Qe as radarResetChangePageMaxItemsV2,mo as radarResetClueLifetimeMs,ho as radarResetClueMaxBytes,po as radarResetCluePath,go as radarResetClueSchema,_o as radarResetClueSnapshotSchema,t as radarResetContractVersionV1,Je as radarResetContractVersionV2,tt as radarResetDetailBatchMaxBytesV2,et as radarResetDetailBatchMaxChunksV2,Ct as radarResetDetailChunkReferenceV2Schema,jt as radarResetDetailChunkRequestV2Schema,wt as radarResetDetailManifestV2Schema,a as radarResetEffectValues,S as radarResetExportV1Schema,Zr as radarResetExportV2Schema,di as radarResetManagementActionSchema,ai as radarResetManagementOperationSchema,fi as radarResetManagementResSchema,ui as radarResetManualApplyReqSchema,ii as radarResetManualCopySchema,oi as radarResetManualDraftSchema,ci as radarResetManualDraftSeedSchema,si as radarResetManualPreviewReqSchema,li as radarResetManualPreviewResSchema,pi as radarResetManualResultResSchema,Le as radarResetNoticeKindValues,x as radarResetPendingActionV1Schema,Xr as radarResetPendingActionV2Schema,c as radarResetPlanValues,w as radarResetPositiveDecimalV2Schema,o as radarResetProductValues,r as radarResetPublicDataLimits,E as radarResetPublicIdV2Schema,xt as radarResetPublicationHomeFactsV2Schema,Jt as radarResetPublicationRevisionAvailableV2Schema,Re as radarResetPublicationTimingSchema,Lt as radarResetReadActionsDataV2Schema,kt as radarResetReadActionsRequestV2Schema,Vt as radarResetReadActionsSuccessV2Schema,Rt as radarResetReadChangesDataV2Schema,At as radarResetReadChangesRequestV2Schema,Ht as radarResetReadChangesSuccessV2Schema,Mt as radarResetReadDetailBatchRequestV2Schema,It as radarResetReadHeadDataV2Schema,Ot as radarResetReadHeadRequestV2Schema,Bt as radarResetReadHeadSuccessV2Schema,ee as radarResetReasonBasisValues,l as radarResetReasonCategoryValues,Gt as radarResetSafeCauseSnapshotV2Schema,i as radarResetSeriesValues,D as radarResetSha256V2Schema,ae as radarResetSnapshotAvailableV1Schema,Pt as radarResetSourceChangeV2Schema,Ut as radarResetSourceErrorCodeValuesV2,qt as radarResetSourceErrorEnvelopeV2Schema,Cn as radarResetSourceErrorHttpStatusV2,Sn as radarResetSourceErrorIsRetryableV2,Kt as radarResetSourceErrorV2Schema,Ye as radarResetSourceMaxRpcCallsV2,Hr as radarResetSourceTranslationsSchema,rt as radarResetUInt64DecimalV2Schema,ot as radarResetUInt64DecimalV2ToBigInt,T as radarResetUtcTimestampV2Schema,Et as radarResetWithdrawnActionItemV2Schema,so as radarTiboSourceStatusMaxBytes,oo as radarTiboSourceStatusPath,uo as radarTiboSourceStatusSchema,_r as radarTitledActivityFileSchema,mr as radarTitledActivityProgressSchema,Yi as radarWebsiteLocalePrefixes,Ji as radarWebsiteLocales,qi as radarWebsiteOrigin,Xi as radarWebsitePagePaths,J as radarWebsitePageUrl,wr as readRadarActivityFile,Er as readRadarActivityFileV2,Bi as readRadarActivityFileV3,ns as readRadarCodexModels,Ko as readRadarCodexReleaseDirectory,qo as readRadarCodexReleaseMonth,Jo as readRadarCodexReleaseNotes,bo as readRadarResetClueSnapshot,fo as readRadarTiboSourceStatus,Tr as readRadarTitledActivityFile,Da as redactRadarBrowserRegistrationReferences,xn as toSafeCauseSnapshotV2,Ka as upgradeRadarBrowserSubscriptionCommandV1};
|
|
6
|
+
`),ne=O.encode(`\r
|
|
7
|
+
`),u=[],d=0;for(let e of n.chunks){if(!cn(c,l,d))return k(`source_stream_incomplete`,!0);d+=l.byteLength;let t=vn(c,te,d);if(t<0)return k(`source_stream_incomplete`,!0);let n=_n(c.slice(d,t));if(d=t+te.byteLength,n.get(`content-type`)!==`application/octet-stream`)return k(`source_chunk_mismatch`,!1);let r;try{r=sn.decode(fn(n.get(`x-radar-reset-action-id-b64`)))}catch(e){return k(`source_chunk_mismatch`,!1,e)}if(r!==e.resetActionId||n.get(`x-radar-detail-ordinal`)!==String(e.ordinal)||n.get(`x-radar-byte-size`)!==String(e.byteSize)||n.get(`x-radar-sha-256`)!==e.sha256)return k(`source_chunk_mismatch`,!1);if(d+e.byteSize+ne.byteLength>c.byteLength)return k(`source_stream_incomplete`,!0);let i=c.slice(d,d+e.byteSize);if(d+=e.byteSize,!cn(c,ne,d)||(d+=ne.byteLength,await pn(i)!==e.sha256))return k(`source_chunk_mismatch`,!1);u.push({...e,bytes:i})}return!cn(c,ee,d)||d+ee.byteLength!==c.byteLength?k(`source_stream_incomplete`,!0):u}const bn=/authorization|cookie|token|secret|password|api[-_]?key/iu;function xn(e,t){let n=[...e].slice(0,1024),r=``;for(let e of n){let n=O.encode(e).byteLength;if(n>t.remaining)break;t.remaining-=n,r+=e}return r}function Sn(e,t,n,r){if(e===null||typeof e==`boolean`)return e;if(typeof e==`string`)return xn(e,n);if(typeof e==`number`)return Number.isFinite(e)?e:String(e);if(typeof e==`bigint`||typeof e==`symbol`)return xn(String(e),n);if(e===void 0)return`undefined`;if(typeof e==`function`)return`[Function ${e.name||`anonymous`}]`;if(r.has(e))return`[Circular]`;if(t>=4)return`[DepthLimit]`;if(r.add(e),Array.isArray(e))return e.slice(0,16).map(e=>Sn(e,t+1,n,r));let i={},a=e instanceof Error?[[`type`,e.constructor.name],[`name`,e.name],[`message`,e.message],...e.cause===void 0?[]:[[`cause`,e.cause]],...Object.entries(e)]:Object.entries(e);for(let[e,o]of a.slice(0,16)){let a=xn(String(e),n);if(!(a.length===0||Object.hasOwn(i,a))&&(n.remaining-=Math.min(n.remaining,8),i[a]=bn.test(a)?`[REDACTED]`:Sn(o,t+1,n,r),n.remaining<=0))break}return i}function Cn(e){let t=Sn(e,0,{remaining:7e3},new Set),n=typeof t==`object`&&t&&!Array.isArray(t)?t:{type:e===null?`null`:typeof e,message:t};return Kt.parse(n),n}function wn(e){return e===`source_temporarily_unavailable`||e===`source_rpc_transport_failure`||e===`source_stream_incomplete`}function Tn(e){switch(e){case`source_invalid_request`:return 400;case`source_revision_unknown`:return 404;case`source_cursor_invalid`:case`source_chunk_mismatch`:return 409;case`source_response_over_capacity`:return 413;case`source_temporarily_unavailable`:case`source_rpc_transport_failure`:case`source_stream_incomplete`:return 503;case`source_integrity_conflict`:case`source_revision_identity_conflict`:case`source_sequence_exhausted`:return 500}}function En(e){let t={contractVersion:2,ok:!1,error:{code:e.code,operation:e.operation,stage:e.stage,...e.revision===void 0?{}:{revision:e.revision},retryable:wn(e.code),correlationId:e.correlationId,cause:Cn(e.cause)}};return Jt.parse(t)}const Dn=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),On=e.iso.date(),j=e.strictObject({category:e.enum([`improvement`,`direct_reset`,`reset_card`]),deliveryState:e.enum([`preview`,`landed`]),description:Dn,dateBasis:e.enum([`occurrence`,`announcement`,`unresolved`]),sourceUrls:e.array(e.url({protocol:/^https?$/})).min(1)}),kn=e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),text:Dn}),e.strictObject({state:e.enum([`pending`,`failed`,`not_applicable`]),text:e.null()})]),M=e.strictObject({contractVersion:e.literal(1),generatedAt:e.iso.datetime(),timeZone:e.string().refine(e=>{try{return new Intl.DateTimeFormat(`en`,{timeZone:e}),!0}catch{return!1}},`Invalid source time zone`),startDate:On,endDate:On,processing:e.strictObject({hasPending:e.boolean(),hasFailures:e.boolean()}),days:e.array(e.strictObject({date:On,dayNumber:e.number().int().min(1).max(28),outcome:e.enum([`unconfirmed`,`improvement`,`reset`,`both`]),entries:e.array(j),summary:kn})).length(28),undatedEntries:e.array(j)}).superRefine((e,t)=>{let n=Date.parse(`${e.startDate}T00:00:00Z`);for(let[r,i]of e.days.entries()){let e=new Date(n+r*864e5).toISOString().slice(0,10);(i.date!==e||i.dayNumber!==r+1)&&t.addIssue({code:`custom`,path:[`days`,r],message:`Days must be contiguous and numbered in order`}),i.entries.some(e=>e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`days`,r,`entries`],message:`Unresolved dates belong in undatedEntries`});let a=i.entries.filter(e=>e.deliveryState===`landed`),o=a.some(e=>e.category===`improvement`),s=a.some(e=>e.category!==`improvement`),c=o?s?`both`:`improvement`:s?`reset`:`unconfirmed`;(i.outcome!==c||a.length===0!=(i.summary.state===`not_applicable`))&&t.addIssue({code:`custom`,path:[`days`,r],message:`Outcome and summary must reflect landed evidence`})}e.days.at(-1)?.date!==e.endDate&&t.addIssue({code:`custom`,path:[`endDate`],message:`End must match the last activity day`}),e.undatedEntries.some(e=>e.dateBasis!==`unresolved`)&&t.addIssue({code:`custom`,path:[`undatedEntries`],message:`Undated entries must have unresolved dates`})});function An(e){return M.parse(e)}function jn(e){let t=e.filter(e=>e.deliveryState===`landed`),n=t.some(e=>e.category===`improvement`),r=t.some(e=>e.category!==`improvement`);return n?r?`both`:`improvement`:r?`reset`:`unconfirmed`}const Mn=524288,N=M.shape,Nn=N.days.element,Pn=j.extend({date:N.startDate.nullable()}).superRefine((e,t)=>{e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}),Fn=e.strictObject({state:e.enum([`unconfirmed`,`ongoing`,`ended`]),sourceUrls:e.array(j.shape.sourceUrls.element)}).superRefine((e,t)=>{e.state!==`unconfirmed`&&e.sourceUrls.length===0&&t.addIssue({code:`custom`,path:[`sourceUrls`],message:`Confirmed lifecycle states require source evidence`})}),In=Nn.omit({date:!0,entries:!0}).extend({entries:e.array(Pn),lifecycle:Fn}),P=e.strictObject({contractVersion:e.literal(2),generatedAt:N.generatedAt,timeZone:N.timeZone,processing:N.processing,days:e.array(In).length(28),unassignedEntries:e.array(Pn)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries()){r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`});let e=r.entries.filter(e=>e.deliveryState===`landed`),i=jn(r.entries);(r.outcome!==i||e.length===0!=(r.summary.state===`not_applicable`))&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome and summary must reflect landed evidence`})}});function Ln(e){return P.parse(e)}const Rn=Mn,F=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),zn=j.extend({title:F}),Bn=P.shape,Vn=Bn.days.element,Hn=Vn.shape.entries.element.safeExtend({title:F}),Un=Vn.extend({title:F.nullable(),entries:e.array(Hn)}).superRefine((e,t)=>{e.title!==null!=(e.summary.state===`ready`)&&t.addIssue({code:`custom`,path:[`title`],message:`A daily title is available exactly when its summary is ready`})}),I=e.strictObject({...Bn,contractVersion:e.literal(3),days:e.array(Un),unassignedEntries:e.array(Hn)}).superRefine((e,t)=>{let n=P.safeParse({contractVersion:2,generatedAt:e.generatedAt,timeZone:e.timeZone,processing:e.processing,days:e.days.map(({title:e,...t})=>({...t,entries:t.entries.map(({title:e,...t})=>t)})),unassignedEntries:e.unassignedEntries.map(({title:e,...t})=>t)});if(!n.success)for(let e of n.error.issues)t.addIssue({...e})});function Wn(e){return{improvementDays:e.days.filter(e=>e.outcome===`improvement`||e.outcome===`both`).length,resetDays:e.days.filter(e=>e.outcome===`reset`||e.outcome===`both`).length}}function Gn(e){return I.parse(e)}const Kn=Rn,qn=P.shape,Jn=I.shape.unassignedEntries,Yn=qn.days.element.omit({summary:!0}).extend({entries:Jn}),L=e.strictObject({...qn,contractVersion:e.literal(4),days:e.array(Yn).length(28),unassignedEntries:Jn}).superRefine((e,t)=>{for(let[n,r]of e.days.entries())r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`}),r.outcome!==jn(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function Xn(e){return L.parse(e)}function Zn(e,t){let n=new Set;for(let r of e)n.has(r.eventId)&&t.addIssue({code:`custom`,message:`Duplicate activity eventId`}),n.add(r.eventId)}function Qn(e,t,n){let r=n.reduce((t,n)=>t+e.reactionCounts[n],0);(!Number.isSafeInteger(r)||r!==e.reactionTotal)&&t.addIssue({code:`custom`,path:[`reactionTotal`],message:`Total must equal all reaction counts`})}async function $n(e,t,n){if(e.status!==200){let t={status:e.status,statusText:e.statusText};try{await e.body?.cancel()}catch(e){throw Error(`activity_file_http_error`,{cause:{...t,cancellationCause:e}})}throw Error(`activity_file_http_error`,{cause:t})}if(e.body===null)throw Error(`activity_file_body_missing`);let r=e.body.getReader(),i=[],a=0;try{for(;;){let e=await r.read();if(e.done)break;if(a+=e.value.byteLength,a>n)throw Error(`activity_file_too_large`,{cause:{maxBytes:n,observedBytes:a}});i.push(e.value)}let e=new Uint8Array(a),o=0;for(let t of i)e.set(t,o),o+=t.byteLength;return t.parse(JSON.parse(new TextDecoder(`utf-8`,{fatal:!0}).decode(e)))}catch(e){try{await r.cancel()}catch{}throw Error(`activity_file_read_failed`,{cause:e})}finally{r.releaseLock()}}function er(e,t,n){let r=new TextEncoder().encode(JSON.stringify(t.parse(e)));if(r.byteLength>n)throw Error(`activity_file_too_large`,{cause:{byteLength:r.byteLength}});return r}const R=[`👍`,`😂`,`🤡`,`💀`,`😭`,`🔥`,`🎉`,`👀`,`🙏`,`🫠`],tr=e.enum(R),z=e.string().min(1).max(128),B=524288,nr=`https://data.radarultra.com/activity/v1/latest.json`,rr=`https://data.radarultra.com/activity/v2/latest.json`,ir=j.extend({eventId:z}),ar=M.safeExtend({days:e.array(M.shape.days.element.extend({entries:e.array(ir)})).length(28),undatedEntries:e.array(ir)});function or(e,t){Zn([...e.days.flatMap(e=>e.entries),...e.undatedEntries],t)}const sr=ar.superRefine(or),cr=e.record(tr,e.number().int().nonnegative()),lr=e.strictObject({reactionCounts:cr,reactionTotal:e.number().int().nonnegative()});function ur(e,t){Qn(e,t,R)}const dr=ir.extend(lr.shape).superRefine(ur),fr=ar.safeExtend({days:e.array(ar.shape.days.element.extend({entries:e.array(dr)})).length(28),undatedEntries:e.array(dr)}).superRefine(or),V=e.strictObject({publishedAt:e.iso.datetime(),reactionIds:e.array(tr).length(R.length).refine(e=>new Set(e).size===R.length,`Every reaction must occur exactly once`),progress:fr}),pr=I.shape,mr=pr.unassignedEntries.element.safeExtend({eventId:z}),hr=e.strictObject({...pr,days:e.array(pr.days.element.safeExtend({entries:e.array(mr)})).length(28),unassignedEntries:e.array(mr)}),gr=hr.superRefine((e,t)=>{let n=({eventId:e,...t})=>t,r=I.safeParse({...e,days:e.days.map(e=>({...e,entries:e.entries.map(n)})),unassignedEntries:e.unassignedEntries.map(n)});if(!r.success)for(let e of r.error.issues)t.addIssue({...e});Zn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),_r=mr.safeExtend(lr.shape).superRefine(ur),vr=hr.safeExtend({days:e.array(pr.days.element.safeExtend({entries:e.array(_r)})).length(28),unassignedEntries:e.array(_r)}).superRefine((e,t)=>{let n=({reactionCounts:e,reactionTotal:t,...n})=>n,r=gr.safeParse({...e,days:e.days.map(e=>({...e,entries:e.entries.map(n)})),unassignedEntries:e.unassignedEntries.map(n)});if(!r.success)for(let e of r.error.issues)t.addIssue({...e})}),yr=V.extend({progress:vr}),br=L.shape,xr=br.unassignedEntries.element.safeExtend({eventId:z}),Sr=L.safeExtend({days:e.array(br.days.element.safeExtend({entries:e.array(xr)})).length(28),unassignedEntries:e.array(xr)}).superRefine((e,t)=>{Zn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),Cr=xr.safeExtend(lr.shape).superRefine(ur),wr=Sr.safeExtend({days:e.array(br.days.element.safeExtend({entries:e.array(Cr)})).length(28),unassignedEntries:e.array(Cr)}),Tr=V.extend({progress:wr});async function Er(e){return $n(e,V,B)}async function Dr(e){return $n(e,yr,B)}async function Or(e){return $n(e,Tr,B)}function kr(e){return er(e,V,B)}function Ar(e){return er(e,yr,B)}function jr(e){return er(e,Tr,B)}const Mr=e.strictObject({changeId:e.string().min(1).max(128),eventId:e.string().min(1).max(128),revision:e.int().positive(),kind:e.enum([`created`,`updated`,`withdrawn`]),date:e.iso.date().nullable(),entry:j,receivedAt:e.iso.datetime().nullable(),acceptedAt:e.iso.datetime()}),Nr=e.strictObject({contractVersion:e.literal(1),changes:e.array(Mr),nextCursor:e.string().min(1),hasMore:e.boolean()}),Pr=Mr.extend({dayNumber:M.shape.days.element.shape.dayNumber.nullable()}),Fr=Nr.extend({contractVersion:e.literal(2),changes:e.array(Pr)}),Ir=e.int().min(0).max(2**53-1),Lr=e.int().min(1).max(28),Rr=e.enum([`yes`,`no`]).nullable(),zr=e.strictObject({choice:Rr}),Br=e.strictObject({yes:Ir,no:Ir,total:Ir}).superRefine((e,t)=>{(!Number.isSafeInteger(e.yes+e.no)||e.total!==e.yes+e.no)&&t.addIssue({code:`custom`,path:[`total`],message:`Total must equal the effective choices.`})}),Vr=e.strictObject({dayNumber:Lr,state:e.enum([`unopened`,`open`,`closed`]),choice:Rr,outcome:e.enum([`unconfirmed`,`yes`,`no`]),personalResult:e.enum([`none`,`waiting`,`correct`,`incorrect`]),corrected:e.boolean(),counts:Br}).superRefine((e,t)=>{let n=e.choice===null?`none`:e.outcome===`unconfirmed`?`waiting`:e.choice===e.outcome?`correct`:`incorrect`;e.personalResult!==n&&t.addIssue({code:`custom`,path:[`personalResult`],message:`Personal result must match the confirmed outcome and choice.`}),e.state!==`closed`&&e.outcome!==`unconfirmed`&&t.addIssue({code:`custom`,path:[`outcome`],message:`An open or unopened day cannot have a confirmed result.`}),e.state===`unopened`&&(e.choice!==null||e.counts.total!==0)&&t.addIssue({code:`custom`,path:[`state`],message:`An unopened day cannot have choices.`})}),Hr=e.strictObject({revision:Ir,openDayNumber:Lr.nullable(),days:e.array(Vr).length(28)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries()){r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Every official day must occur once, in order.`});let i=e.openDayNumber===null||r.dayNumber<e.openDayNumber?`closed`:r.dayNumber===e.openDayNumber?`open`:`unopened`;r.state!==i&&t.addIssue({code:`custom`,path:[`days`,n,`state`],message:`Only the next official day may be open.`})}}),Ur=e.strictObject({error:e.strictObject({code:e.enum([`invalid_request`,`payload_too_large`,`unsupported_media_type`,`origin_not_allowed`,`rate_limited`,`dependency_unavailable`,`internal_error`,`day_closed`,`identity_unavailable`]),message:e.string().min(1).max(2048),requestId:e.string().min(1).max(128),operation:e.enum([`get_guesses`,`set_guess`]),stage:e.string().min(1).max(128),cause:e.record(e.string(),e.unknown()),saveOutcome:e.enum([`not_saved`,`unknown`]).optional()})}).superRefine(({error:e},t)=>{e.operation===`set_guess`!=(e.saveOutcome!==void 0)&&t.addIssue({code:`custom`,path:[`error`,`saveOutcome`],message:`Only save failures must include a save outcome.`})}),Wr=e.strictObject({"zh-Hans":b.shape.noticeTimeline.element.shape.sourceTextZh,"zh-Hant":b.shape.noticeTimeline.element.shape.sourceTextZh,ja:b.shape.noticeTimeline.element.shape.sourceTextZh,ko:b.shape.noticeTimeline.element.shape.sourceTextZh}),Gr=b.shape.noticeTimeline.element.omit({sourceTextZh:!0}).extend({sourceTranslations:Wr}).strict(),Kr=e.strictObject({...b.shape,contractVersion:e.literal(2),noticeTimeline:e.array(Gr).min(1).max(r.actionDetail.noticeTimeline)}),qr=Gr.omit({phase:!0}).extend({kinds:x.shape.noticeTimeline.element.shape.kinds}).strict(),Jr=e.strictObject({...x.shape,noticeTimeline:e.array(qr).min(1).max(r.actionDetail.noticeTimeline)}),Yr=e=>{let{sourceTranslations:t,...n}=e;return{...n,sourceTextZh:t[`zh-Hans`]}},Xr=e=>({...e,contractVersion:1,noticeTimeline:e.noticeTimeline.map(Yr)}),Zr=e=>({...e,noticeTimeline:e.noticeTimeline.map(Yr)}),Qr=(e,t)=>{for(let n of e.error?.issues??[])t.addIssue({...n})},H=Kr.superRefine((e,t)=>{Qr(b.safeParse(Xr(e)),t)}),U=Jr.superRefine((e,t)=>{Qr(x.safeParse(Zr(e)),t)}),$r=e.strictObject({...He.shape,contractVersion:e.literal(2),actions:e.array(H).min(1).max(r.analysis.actions),pendingResetActions:e.array(U).max(r.analysis.actions)}).superRefine((e,t)=>{Qr(He.safeParse({...e,contractVersion:1,actions:e.actions.map(Xr),pendingResetActions:e.pendingResetActions.map(Zr)}),t),new TextEncoder().encode(JSON.stringify(e)).byteLength>r.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`export_utf8_size_limit_exceeded`,path:[]})}),ei=e=>H.parse(e),ti=e=>U.parse(e),ni=e=>$r.parse(e);function ri(e){let t=ni(e);return He.parse({...t,contractVersion:1,actions:t.actions.map(Xr),pendingResetActions:t.pendingResetActions.map(Zr)})}const ii=`/api/v1/codex-reset-public-records`,ai=e.array(qr).min(1).max(r.actionDetail.noticeTimeline),oi=e.strictObject(H.shape).omit({contractVersion:!0,noticeCount:!0,noticeTimeline:!0}).extend({noticeTimeline:ai}).strict();function si(e){let t=e.noticeTimeline.filter(e=>e.kinds.includes(`executed`)||e.kinds.includes(`preview`)).map(({kinds:e,...t})=>({...t,phase:e.includes(`executed`)?`executed`:`preview`}));return{...e,contractVersion:2,noticeCount:t.length,noticeTimeline:t}}const ci=e=>H.parse(si(e));function li(e,t){let n=new Set;for(let[r,i]of e.entries()){n.has(i.sourceUrl)&&t.addIssue({code:`custom`,message:`public_notice_source_duplicate`,path:[`noticeTimeline`,r]}),n.add(i.sourceUrl);let a=e.at(r-1),o=H.shape.firstAnnouncedAt;r>0&&a!==void 0&&o.safeParse(a.authoredAt).success&&o.safeParse(i.authoredAt).success&&S(a.authoredAt,i.authoredAt)>0&&t.addIssue({code:`custom`,message:`public_notice_timeline_not_ascending`,path:[`noticeTimeline`,r]})}}const ui=oi.superRefine((e,t)=>{li(e.noticeTimeline,t);let n=H.safeParse(si(e));for(let e of n.error?.issues??[])t.addIssue({...e})}),di=e.strictObject(U.shape).omit({state:!0,executedEffects:!0,pendingEffects:!0}).superRefine((e,t)=>{li(e.noticeTimeline,t)}),fi=e.strictObject(H.shape).pick({resetActionId:!0}).extend({lastActiveFirstAnnouncedAt:H.shape.firstAnnouncedAt,withdrawnAt:H.shape.firstAnnouncedAt}).strict(),pi=r.analysis.actions,mi=e.strictObject({contractVersion:e.literal(1),sourceWatermark:H.shape.resetActionId,generatedAt:H.shape.firstAnnouncedAt,actions:e.array(ui).min(1).max(pi),pendingResetActions:e.array(U).max(pi),unexecutedResetActions:e.array(di).max(pi),withdrawnResetActions:e.array(fi).max(pi)}).superRefine((e,t)=>{for(let n of[`actions`,`pendingResetActions`,`unexecutedResetActions`,`withdrawnResetActions`])new Set(e[n].map(e=>e.resetActionId)).size!==e[n].length&&t.addIssue({code:`custom`,message:`public_reset_identity_duplicate`,path:[n]});let n=new Set(e.actions.map(e=>e.resetActionId));for(let n of e.pendingResetActions)li(n.noticeTimeline,t);(e.unexecutedResetActions.some(e=>n.has(e.resetActionId))||e.withdrawnResetActions.some(e=>n.has(e.resetActionId)))&&t.addIssue({code:`custom`,message:`public_reset_lifecycle_conflict`});for(let[n,r]of e.actions.entries()){let i=e.actions.at(n-1),a=H.shape.firstAnnouncedAt;n>0&&i!==void 0&&a.safeParse(i.firstAnnouncedAt).success&&a.safeParse(r.firstAnnouncedAt).success&&Ue(i,r)>=0&&t.addIssue({code:`custom`,message:`public_reset_actions_not_ascending`,path:[`actions`,n]})}new TextEncoder().encode(JSON.stringify(e)).byteLength>r.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`public_reset_records_utf8_size_limit_exceeded`})}),hi=H.shape,gi=e.strictObject({title:e.string(),body:e.string()}),_i=e.strictObject({zh:gi,en:gi}),vi=e.enum([`end_preview`,`restore_preview`,`set_auto_notification`,`notify`]),yi=e.strictObject({resetActionId:hi.resetActionId,operation:vi,expectedRevision:e.int().nonnegative(),copy:_i.nullable(),automaticNotification:e.boolean().nullable()}).superRefine((e,t)=>{e.operation===`notify`!=(e.copy!==null)&&t.addIssue({code:`custom`,path:[`copy`],message:`notification_copy_operation_mismatch`}),e.operation===`set_auto_notification`!=(e.automaticNotification!==null)&&t.addIssue({code:`custom`,path:[`automaticNotification`],message:`notification_policy_operation_mismatch`})}),bi=yi,xi=yi,Si=e.strictObject({digest:e.string().regex(/^sha256:[a-f0-9]{64}$/),sourceWatermark:e.string().min(1),draft:yi}),Ci=e.strictObject({operationId:e.uuid(),preview:Si}),wi=e.strictObject({resetActionId:hi.resetActionId,revision:e.number().int().nonnegative(),state:e.enum([`preview`,`executed`,`cancelled`,`undetermined`]),firstAnnouncedAt:w.nullable(),officialConfirmed:e.boolean(),pendingPreview:e.boolean(),previewClosed:e.boolean(),automaticNotification:e.boolean(),sourceUrls:e.array(hi.noticeTimeline.element.shape.sourceUrl),availableOperations:e.array(vi),notificationOperationId:e.uuid().nullable()}),Ti=e.strictObject({actions:e.array(wi)}),Ei=e.discriminatedUnion(`status`,[e.strictObject({status:e.literal(`unknown`),operationId:e.uuid()}),e.strictObject({status:e.literal(`saved`),operationId:e.uuid(),resetActionId:hi.resetActionId,operation:vi,revision:e.number().int().positive(),notification:e.strictObject({state:e.enum([`disabled`,`pending`,`claimed`,`retry_wait`,`accepted`,`rejected`,`expired`]),resultCode:e.string().nullable(),diagnostic:e.record(e.string(),e.unknown()).nullable()})})]),W=b.shape.noticeTimeline.element.shape,Di=e.enum([`initial`,`supplement`,`correction`]).nullable(),Oi=e.strictObject({authoredAt:W.authoredAt,role:Di,sourceUrl:W.sourceUrl,sourceText:W.sourceText,sourceTextZh:W.sourceTextZh}),ki=e.array(Oi).min(1).superRefine((e,t)=>{let n=new Set,r;for(let[i,a]of e.entries()){if(n.has(a.sourceUrl)&&t.addIssue({code:`custom`,path:[i,`sourceUrl`],message:`An original post may appear only once per improvement`}),n.add(a.sourceUrl),!W.authoredAt.safeParse(a.authoredAt).success){r=void 0;continue}if(r!==void 0){let e=S(r.authoredAt,a.authoredAt);(e>0||e===0&&r.sourceUrl>a.sourceUrl)&&t.addIssue({code:`custom`,path:[i],message:`Posts must be ordered by authoredAt and sourceUrl`})}r=a}}),Ai=Kn,ji=j.omit({description:!0}).extend({category:e.literal(`improvement`),title:F,posts:ki}),Mi=j.extend({category:e.enum([`direct_reset`,`reset_card`]),title:F}),Ni=e.discriminatedUnion(`category`,[ji,Mi]),Pi=L.shape,Fi=Pi.unassignedEntries.element.shape.date;function Ii(e,t){e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}const Li=e.discriminatedUnion(`category`,[ji.extend({date:Fi}).superRefine(Ii),Mi.extend({date:Fi}).superRefine(Ii)]),Ri=e.strictObject({...Pi,contractVersion:e.literal(5),days:e.array(Pi.days.element.extend({entries:e.array(Li)})).length(28),unassignedEntries:e.array(Li)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries())r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`}),r.outcome!==jn(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function zi(e){return Ri.parse(e)}const Bi=`https://data.radarultra.com/activity/v3/latest.json`,Vi=Ri.shape,[Hi,Ui]=Vi.unassignedEntries.element.options,Wi=Hi.safeExtend({eventId:z}),Gi=Ui.safeExtend({eventId:z}),Ki=e.discriminatedUnion(`category`,[Wi,Gi]),qi=Ri.safeExtend({days:e.array(Vi.days.element.extend({entries:e.array(Ki)})).length(28),unassignedEntries:e.array(Ki)}).superRefine((e,t)=>{Zn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),Ji={reactionCounts:cr,reactionTotal:e.number().int().nonnegative()},Yi=(e,t)=>Qn(e,t,R),Xi=e.discriminatedUnion(`category`,[Wi.safeExtend(Ji).superRefine(Yi),Gi.safeExtend(Ji).superRefine(Yi)]),Zi=qi.safeExtend({days:e.array(Vi.days.element.extend({entries:e.array(Xi)})).length(28),unassignedEntries:e.array(Xi)}),Qi=V.extend({progress:Zi});async function $i(e){return $n(e,Qi,B)}function ea(e){return er(e,Qi,B)}const ta=e.discriminatedUnion(`category`,[ji,j.extend({category:e.enum([`direct_reset`,`reset_card`])})]),na=Pr.extend({entry:ta}),ra=Fr.extend({contractVersion:e.literal(3),changes:e.array(na)});function ia(e){return na.parse(e)}function aa(e){return ra.parse(e)}const oa=`https://radarultra.com`,sa=[`zh-Hans`,`zh-Hant`,`en`,`ja`,`ko`],ca={"zh-Hans":`/zh`,"zh-Hant":`/zh-hant`,en:``,ja:`/ja`,ko:`/ko`},la={reset:`/codex`,improvement:`/codex/28-day-challenge`,changelog:`/codex/changelog`,models:`/codex/models`},G=e.discriminatedUnion(`product`,[e.strictObject({product:e.literal(`cli`),version:e.string().regex(/^\d+\.\d+\.\d+$/)}),e.strictObject({product:e.literal(`app`),version:e.string().regex(/^\d{2}\.\d{3,4}$/)})]),K=e.string().regex(/^(?!\.{1,2}$)[a-z0-9.-]+$/);function q(e,t){return oa+ca[t]+la[e]}function ua(e,t,n){let r=G.parse({product:e,version:t});return`${q(`changelog`,n)}/${r.product}/${r.version}`}function da(e,t){return`${q(`models`,t)}/${K.parse(e)}`}const fa=Object.freeze({timeZone:`America/Los_Angeles`,startDate:`2026-10-05`,endDate:`2026-11-01`}),pa=Date.parse(`${fa.startDate}T00:00:00Z`),ma=(Date.parse(`${fa.endDate}T00:00:00Z`)-pa)/864e5+1,ha=new Intl.DateTimeFormat(`en-CA`,{timeZone:fa.timeZone,year:`numeric`,month:`2-digit`,day:`2-digit`});function ga(e){let t=ha.formatToParts(e),n=e=>Number(t.find(t=>t.type===e).value),r=(Date.UTC(n(`year`),n(`month`)-1,n(`day`))-pa)/864e5,i=r<0?`before`:r>=ma?`ended`:`live`,a=Math.min(ma,Math.max(1,r+1));return{phase:i,today:a,ongoingDay:i===`live`?a:null}}const _a=e.enum([`reset`,`improvement`]),va=e.array(_a).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),ya=t=>e.url().refine(e=>sa.some(n=>e===q(t,n)),`notification_target_url_invalid`),ba=e.discriminatedUnion(`kind`,[e.object({kind:e.literal(`reset`),webUrl:ya(`reset`),miniPath:e.literal(`pages/index/index`)}).strict(),e.object({kind:e.literal(`improvement`),webUrl:ya(`improvement`),miniPath:e.literal(`pages/index/index?page=challenge`)}).strict()]),xa=e.object({topics:va,target:ba}).strict().refine(e=>e.topics.includes(e.target.kind),`notification_target_topic_mismatch`),Sa=e.enum([`reset`,`improvement`,`clue`]),Ca=e.object({topics:e.array(Sa).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),target:ba}).strict().refine(e=>e.topics.some(t=>(t===`clue`?`reset`:t)===e.target.kind),`notification_target_topic_mismatch`);function wa(e,t){let n=Ta(e===`clue`?`reset`:e,t);return Ca.parse({...n,topics:[e]})}function Ta(e,t){return xa.parse({topics:[e],target:{kind:e,webUrl:q(e,t),miniPath:e===`reset`?`pages/index/index`:`pages/index/index?page=challenge`}})}const Ea=e.object({notificationId:e.uuid(),eventId:e.uuid(),title:e.string().trim().min(1).max(512),createdAt:e.iso.datetime(),deliverBy:e.iso.datetime(),...xa.shape}).strict().superRefine((e,t)=>{e.topics.includes(e.target.kind)||t.addIssue({code:`custom`,message:`notification_target_topic_mismatch`}),S(e.deliverBy,e.createdAt)<=0&&t.addIssue({code:`custom`,message:`notification_task_deadline_invalid`})});function Da(e,t){return S(e.createdAt,t.createdAt)||(e.notificationId<t.notificationId?-1:+(e.notificationId>t.notificationId))}const Oa=`/api/v1/notification-tasks`,ka=100,Aa=e.string().min(1).max(8192),ja=e.object({cursor:Aa.optional()}).strict(),Ma=e.object({contractVersion:e.literal(1),roundCursor:Aa,notifications:e.array(Ea).max(100),nextCursor:Aa.nullable()}).strict().superRefine((e,t)=>{new Set(e.notifications.map(e=>e.notificationId)).size!==e.notifications.length&&t.addIssue({code:`custom`,message:`notification_task_duplicate`});for(let n=1;n<e.notifications.length;n++)Da(e.notifications.at(n-1),e.notifications.at(n))>=0&&t.addIssue({code:`custom`,message:`notification_task_order_invalid`});e.nextCursor!==null&&e.notifications.length===0&&t.addIssue({code:`custom`,message:`notification_task_empty_continuation`})}),Na=`/api/browser-notifications`,Pa=e.string().min(1).max(128),Fa=e.uuid(),Ia=e.enum(sa),La=e.strictObject({reset:e.boolean(),improvement:e.boolean()}),Ra=`[cdef][\\w-]{21}`,za=e.strictObject({fid:e.string().regex(RegExp(`^${Ra}$`))});function Ba(e){return e.replace(RegExp(`(^|[^\\w-])${Ra}(?![\\w-])`,`g`),`$1[registration]`)}const J={operationId:Fa,expectedRevision:Pa},Va=e.discriminatedUnion(`action`,[e.strictObject({...J,action:e.literal(`register`),topics:La.refine(e=>e.reset||e.improvement,`subscription_topic_required`),locale:Ia,registration:za}),e.strictObject({...J,action:e.literal(`set_topics`),topics:La}),e.strictObject({...J,action:e.literal(`set_locale`),locale:Ia}),e.strictObject({...J,action:e.literal(`restore`),registration:za}),e.strictObject({...J,action:e.literal(`retry`)}),e.strictObject({...J,action:e.literal(`cancel`)})]),Ha=e.strictObject({operationId:Fa.optional(),expectedRevision:Pa.optional()}).refine(e=>e.operationId===void 0==(e.expectedRevision===void 0),`subscription_operation_reference_incomplete`),Ua=e.strictObject({code:e.enum([`invalid_request`,`identity_unavailable`,`origin_not_allowed`,`rate_limited`,`revision_conflict`,`operation_conflict`,`registration_conflict`,`dependency_unavailable`,`provider_rejected`,`provider_rate_limited`,`provider_unavailable`,`provider_timeout`,`internal_error`]),operationId:Fa.optional(),correlationId:e.uuid(),stage:e.string().min(1).max(128),saveOutcome:e.enum([`not_saved`,`unknown`]),reasonSummary:e.string().min(1).max(2048),retryable:e.boolean(),cause:e.record(e.string(),e.unknown())}),Wa=e.strictObject({id:Fa,state:e.enum([`pending`,`applied`,`rejected`,`unknown`,`superseded`,`not_found`]),error:Ua.optional()}),Y=e.strictObject({topicSettings:e.strictObject({state:e.enum([`initial`,`saved`]),revision:Pa,topics:La,locale:Ia.nullable()}),registrationState:e.enum([`none`,`ready`,`invalid`,`changing`]),registrationKey:e.string().regex(/^[a-f0-9]{64}$/).nullable(),manualRetryRequired:e.boolean(),operation:Wa.nullable()});function Ga(e,t){return{topics:t.action===`register`||t.action===`set_topics`?t.topics:e.topics,locale:t.action===`register`||t.action===`set_locale`?t.locale:e.locale}}const Ka=e.strictObject({data:Y}),qa=e.strictObject({error:Ua});function Ja(e){return{topicSettings:{state:`initial`,revision:e,topics:{reset:!0,improvement:!1},locale:null},registrationState:`none`,registrationKey:null,manualRetryRequired:!1,operation:null}}const Ya=La.extend({clue:e.boolean().default(!1)}),[Xa,Za,...Qa]=Va.options,$a=e.discriminatedUnion(`action`,[Xa.extend({topics:Ya.refine(e=>Object.values(e).some(Boolean),`subscription_topic_required`)}),Za.extend({topics:Ya}),...Qa]),eo=Y.extend({topicSettings:Y.shape.topicSettings.extend({topics:Ya})}),to=e.strictObject({data:eo});function no(e){return eo.parse(Ja(e))}function ro(e){let{clue:t,...n}=e.topicSettings.topics;return Y.parse({...e,topicSettings:{...e.topicSettings,topics:n}})}function io(e,t){return e.action!==`register`&&e.action!==`set_topics`?e:{...e,topics:{...e.topics,clue:e.action!==`register`&&(e.topics.reset||e.topics.improvement)&&t.clue}}}const ao=20,oo=2*1024*1024,so=`/api/v1/improvements`,co=e.string().min(1).max(1024),[lo]=qi.shape.unassignedEntries.element.options,uo=lo.safeExtend({date:e.iso.date().refine(e=>e>fa.endDate,`improvement_must_follow_campaign`)}),fo=e.strictObject({}),po=e.strictObject({challengeEnded:e.boolean(),observedAt:e.iso.datetime()}),mo=e.strictObject({cursor:co.nullable(),limit:e.literal(20)}),ho=po.extend({entries:e.array(uo).max(20),nextCursor:co.nullable()}).superRefine((e,t)=>{new Set(e.entries.map(e=>e.eventId)).size!==e.entries.length&&t.addIssue({code:`custom`,path:[`entries`],message:`Duplicate improvement identity`})}),go=e.strictObject({eventIds:e.array(z).min(1).max(128)}),_o=e.strictObject({eventIds:e.array(z).max(128)}),vo=e.strictObject({error:e.strictObject({code:e.enum([`invalid_request`,`dependency_unavailable`,`internal_error`]),message:e.string(),requestId:e.uuid(),operation:e.string(),stage:e.string(),cause:e.record(e.string(),e.unknown())})}),yo=`/tibo-source/v1/latest.json`,bo=512*1024,xo=e.iso.datetime({offset:!0}),So=b.shape.noticeTimeline.element,Co=e.strictObject({contractVersion:e.literal(1),observedAt:xo,check:e.strictObject({checkedAt:xo,freshUntil:xo,active:e.boolean()}).nullable(),latestPost:e.strictObject({authoredAt:xo,sourceUrl:So.shape.sourceUrl,sourceText:e.string(),sourceTranslations:Wr,resetRelevance:e.enum([`related`,`unrelated`,`unknown`])}).nullable()});async function wo(e){let t=e.body?.getReader();if(t===void 0)throw Error(`tibo_source_status_body_missing`,{cause:{status:e.status}});let n=[],r=0;try{for(;;){let i=await t.read();if(i.done)break;if(r+=i.value.byteLength,r>524288)throw Error(`tibo_source_status_too_large`,{cause:{status:e.status,bytes:r}});n.push(i.value)}}finally{try{await t.cancel()}catch{}t.releaseLock()}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;let o=new TextDecoder(`utf-8`,{fatal:!0}).decode(i);if(!e.ok)throw Error(`tibo_source_status_http_error`,{cause:{status:e.status,upstream:o.slice(0,4e3)}});return Co.parse(JSON.parse(o))}const To=`/reset-clue/v1/latest.json`,Eo=4320*60*1e3,Do=r.exportUtf8Bytes,Oo=H.shape.noticeTimeline.element.pick({authoredAt:!0,sourceUrl:!0,sourceText:!0,sourceTranslations:!0,contentCompleteness:!0}).extend({plannedTiming:Re.nullable(),expiresAt:H.shape.noticeTimeline.element.shape.authoredAt}).strict().superRefine((e,t)=>{Date.parse(e.expiresAt)!==Date.parse(e.authoredAt)+2592e5&&t.addIssue({code:`custom`,message:`reset_clue_expiry_mismatch`,path:[`expiresAt`]})}),ko=e.strictObject({contractVersion:e.literal(1),clue:Oo.nullable()}),Ao=e=>ko.parse(e);function jo(e,t){return e.clue!==null&&t.getTime()<Date.parse(e.clue.expiresAt)?e.clue:null}async function Mo(e){let t=e.body?.getReader();if(t===void 0)throw Error(`reset_clue_body_missing`,{cause:{status:e.status}});let n=[],r=0;try{for(;;){let i=await t.read();if(i.done)break;if(r+=i.value.byteLength,r>Do)throw Error(`reset_clue_too_large`,{cause:{status:e.status,bytes:r}});n.push(i.value)}}finally{try{await t.cancel()}catch{}t.releaseLock()}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;let o=new TextDecoder(`utf-8`,{fatal:!0}).decode(i);if(!e.ok)throw Error(`reset_clue_http_error`,{cause:{status:e.status,upstream:o.slice(0,4e3)}});return Ao(JSON.parse(o))}const X=e.enum(sa),No=e.string().regex(/^\d{4}-(?:0[1-9]|1[0-2])$/),Z=e.string().trim().min(1),Po=e.url({protocol:/^https$/}),Q=e.discriminatedUnion(`kind`,[e.strictObject({kind:e.literal(`instant`),at:e.iso.datetime()}),e.strictObject({kind:e.literal(`date`),date:e.iso.date()})]),Fo=e.strictObject({operation:Z,stage:Z,cause:Kt});function Io(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),value:t}),e.strictObject({state:e.literal(`pending`)}),e.strictObject({state:e.literal(`failed`),failure:Fo})])}function Lo(e,t){return e.superRefine((e,n)=>{new TextEncoder().encode(JSON.stringify(e)).byteLength>t&&n.addIssue({code:`custom`,message:`publication_utf8_size_limit_exceeded`})})}async function Ro(e,t,n,r){let i=e.body?.getReader();if(i===void 0)throw Error(`${t}_body_missing`,{cause:{operation:t,stage:`read`,status:e.status}});let a=[],o=0;try{for(;;){let e=await i.read();if(e.done)break;if(o+=e.value.byteLength,o>n)throw Error(`publication_utf8_size_limit_exceeded`);a.push(e.value)}}catch(n){throw Error(`${t}_read_failed`,{cause:{operation:t,stage:`read`,status:e.status,bytes:o,cause:n}})}finally{try{await i.cancel()}catch{}i.releaseLock()}let s=new Uint8Array(o),c=0;for(let e of a)s.set(e,c),c+=e.byteLength;let l;try{l=new TextDecoder(`utf-8`,{fatal:!0}).decode(s)}catch(n){throw Error(`${t}_decode_failed`,{cause:{operation:t,stage:`decode`,status:e.status,cause:n}})}if(!e.ok)throw Error(`${t}_http_error`,{cause:{operation:t,stage:`http`,status:e.status,upstream:l.slice(0,4e3)}});try{return r.parse(JSON.parse(l))}catch(n){throw Error(`${t}_parse_failed`,{cause:{operation:t,stage:`parse`,status:e.status,cause:n}})}}const zo=`/codex-releases/v2/directory.json`,Bo=128*1024,Vo=128*1024,Ho=256*1024,Uo=Q,Wo={product:e.enum([`app`,`cli`]),version:Z,published:Q,month:No,revision:Z},Go=e.strictObject(Wo).superRefine(Ko);function Ko(e,t){let n=G.safeParse({product:e.product,version:e.version});if(!n.success)for(let e of n.error.issues)t.addIssue({...e});e.product===`cli`!=(e.published.kind===`instant`)&&t.addIssue({code:`custom`,path:[`published`],message:`product_date_precision_mismatch`}),(e.published.kind===`instant`?e.published.at:e.published.date).slice(0,7)!==e.month&&t.addIssue({code:`custom`,path:[`month`],message:`published_month_mismatch`})}function qo(e,t){let n=new Set,r=1/0;for(let[i,a]of e.entries()){let e=`${a.product}/${a.version}`;n.has(e)&&t.addIssue({code:`custom`,path:[`releases`,i],message:`duplicate_release_identity`}),n.add(e);let o=Date.parse(a.published.kind===`instant`?a.published.at:`${a.published.date}T00:00:00Z`);o>r&&t.addIssue({code:`custom`,path:[`releases`,i],message:`release_order_mismatch`}),r=o}}const Jo=Lo(e.strictObject({contractVersion:e.literal(2),releases:e.array(Go),latest:e.strictObject({app:e.string().nullable(),cli:e.string().nullable()})}).superRefine((e,t)=>{qo(e.releases,t);for(let n of[`app`,`cli`]){let r=e.releases.find(e=>e.product===n)?.version??null;e.latest[n]!==r&&t.addIssue({code:`custom`,path:[`latest`,n],message:`latest_release_mismatch`})}}),Bo),Yo=e.strictObject({state:e.literal(`not_applicable`),reason:e.literal(`no_curated_notes`)}),Xo=e.union([Io(e.strictObject({locale:X,points:e.array(Z).min(1).max(5)})),Yo]),Zo=e.strictObject({...Wo,source:e.strictObject({kind:e.enum([`github`,`official`]),url:Po}),summary:Xo,notesCount:e.number().int().nonnegative()}).superRefine((e,t)=>{Ko(e,t),e.product===`cli`!=(e.source.kind===`github`)&&t.addIssue({code:`custom`,path:[`source`,`kind`],message:`product_source_mismatch`}),e.notesCount===0!=(e.summary.state===`not_applicable`)&&t.addIssue({code:`custom`,path:[`summary`],message:`curated_notes_summary_state_mismatch`})}),Qo=Lo(e.strictObject({contractVersion:e.literal(2),locale:X,month:No,releases:e.array(Zo)}).superRefine((e,t)=>{qo(e.releases,t);for(let[n,r]of e.releases.entries())r.month!==e.month&&t.addIssue({code:`custom`,path:[`releases`,n,`month`],message:`file_month_mismatch`}),r.summary.state===`ready`&&r.summary.value.locale!==e.locale&&r.summary.value.locale!==`en`&&t.addIssue({code:`custom`,path:[`releases`,n,`summary`,`value`,`locale`],message:`summary_locale_mismatch`})}),Vo),$o=e.array(e.strictObject({title:Z.nullable(),items:e.array(e.strictObject({text:Z,refs:Z.nullable()})).min(1)})).min(1),es=Lo(e.strictObject({contractVersion:e.literal(2),product:e.enum([`app`,`cli`]),version:Z,revision:Z,locale:X,original:e.array($o.element),translation:e.union([Io($o),Yo]).nullable()}).superRefine((e,t)=>{let n=G.safeParse({product:e.product,version:e.version});if(!n.success)for(let e of n.error.issues)t.addIssue({...e});if(e.locale===`en`!=(e.translation===null)&&t.addIssue({code:`custom`,path:[`translation`],message:`translation_locale_mismatch`}),e.locale!==`en`&&e.original.length===0!=(e.translation?.state===`not_applicable`)&&t.addIssue({code:`custom`,path:[`translation`],message:`curated_notes_translation_state_mismatch`}),e.translation?.state===`ready`){let n=e.translation.value;(n.length!==e.original.length||e.original.some((e,t)=>{let r=n.at(t);return r===void 0||e.title===null!=(r.title===null)||e.items.length!==r.items.length||e.items.some((e,t)=>e.refs!==r.items.at(t)?.refs)}))&&t.addIssue({code:`custom`,path:[`translation`],message:`translation_structure_mismatch`})}}),Ho),ts=e=>Jo.parse(e),ns=e=>Qo.parse(e),rs=e=>es.parse(e),is=e=>Ro(e,`codex_release_directory`,Bo,Jo),as=e=>Ro(e,`codex_release_month`,Vo,Qo),os=e=>Ro(e,`codex_release_notes`,Ho,es);function ss(e,t){return`/codex-releases/v2/${X.parse(e)}/${No.parse(t)}.json`}function cs(e,t,n){let r=G.parse({product:t,version:n});return`/codex-releases/v2/${X.parse(e)}/notes/${r.product}/${r.version}.json`}const ls=128*1024;function $(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`known`),value:t,source:Po}),e.strictObject({state:e.literal(`unavailable`),reason:e.enum([`not_announced`,`not_listed`]),source:Po.nullable()})])}const us=e.strictObject({input:Z,cached:Z,output:Z}),ds=e.strictObject({modelId:K,name:Z,group:e.enum([`current`,`retired`]),status:e.enum([`available`,`retiring`,`retired`]),launched:$(Q),chatgptRetirement:$(Q),apiRetirement:$(Q),credits:$(us),apiPrice:$(us),multiple:e.string().regex(/^(?:0|[1-9]\d*)(?:\.\d+)?$/).refine(e=>Number.isFinite(Number(e))&&Number(e)>0).nullable(),plans:$(e.array(Z).min(1)),surfaces:$(e.array(Z).min(1)),about:Io(e.strictObject({locale:X,paragraphs:e.array(Z).min(1)})),sources:e.array(e.strictObject({label:Z,url:Po})).min(1)}).superRefine((e,t)=>{e.status===`retired`!=(e.group===`retired`)&&t.addIssue({code:`custom`,path:[`group`],message:`model_group_status_mismatch`}),e.status===`retiring`&&e.chatgptRetirement.state!==`known`&&t.addIssue({code:`custom`,path:[`chatgptRetirement`],message:`retiring_model_requires_announced_date`})}),fs=Lo(e.strictObject({contractVersion:e.literal(1),locale:X,models:e.array(ds),multipleBase:e.strictObject({modelId:K,name:Z}).nullable(),upcomingRetirement:e.strictObject({names:Z,modelIds:e.array(K).min(1),surface:e.enum([`api`,`chatgpt`]),at:Q}).nullable()}).superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.models.entries())n.has(i.modelId)&&t.addIssue({code:`custom`,path:[`models`,r,`modelId`],message:`duplicate_model_identity`}),n.add(i.modelId),i.about.state===`ready`&&i.about.value.locale!==e.locale&&i.about.value.locale!==`en`&&t.addIssue({code:`custom`,path:[`models`,r,`about`,`value`,`locale`],message:`model_description_locale_mismatch`}),i.multiple!==null&&(e.multipleBase===null||i.credits.state!==`known`)&&t.addIssue({code:`custom`,path:[`models`,r,`multiple`],message:`multiple_requires_base_and_credits`});if(e.multipleBase!==null){let n=e.models.find(t=>t.modelId===e.multipleBase?.modelId);(n===void 0||n.group!==`current`||n.credits.state!==`known`||n.multiple!==`1`||n.name!==e.multipleBase.name)&&t.addIssue({code:`custom`,path:[`multipleBase`],message:`multiple_base_mismatch`})}let r=e.upcomingRetirement;if(r!==null){new Set(r.modelIds).size!==r.modelIds.length&&t.addIssue({code:`custom`,path:[`upcomingRetirement`,`modelIds`],message:`duplicate_retirement_model`});for(let n of r.modelIds){let i=e.models.find(e=>e.modelId===n),a=r.surface===`api`?i?.apiRetirement:i?.chatgptRetirement;(a?.state!==`known`||JSON.stringify(a.value)!==JSON.stringify(r.at))&&t.addIssue({code:`custom`,path:[`upcomingRetirement`],message:`retirement_model_date_mismatch`})}}}),ls),ps=e=>fs.parse(e),ms=e=>Ro(e,`codex_models`,ls,fs),hs=e=>`/codex-models/v1/${X.parse(e)}.json`;export{on as RadarResetSourceContractErrorV2,jo as activeRadarResetClue,Da as compareRadarNotificationTasks,Ue as compareRadarResetActionDetailsV1,S as compareRadarResetUtcTimestampsV1,wa as createRadarBrowserNotificationProjection,ga as createRadarCodexProgressCalendar,Ta as createRadarNotificationProjection,En as createRadarResetSourceErrorEnvelopeV2,kr as encodeRadarActivityFile,jr as encodeRadarActivityFileV2,ea as encodeRadarActivityFileV3,hn as encodeRadarResetDetailMultipartV2,Ar as encodeRadarTitledActivityFile,lt as formatRadarResetPositiveDecimalV2,ct as formatRadarResetUInt64DecimalV2,Ja as initialRadarBrowserSubscription,no as initialRadarBrowserSubscriptionV2,ps as parseRadarCodexModels,ia as parseRadarCodexProgressChangeV3,aa as parseRadarCodexProgressChangesV3,An as parseRadarCodexProgressV1,Ln as parseRadarCodexProgressV2,Gn as parseRadarCodexProgressV3,Xn as parseRadarCodexProgressV4,zi as parseRadarCodexProgressV5,ts as parseRadarCodexReleaseDirectory,ns as parseRadarCodexReleaseMonth,rs as parseRadarCodexReleaseNotes,Ge as parseRadarResetActionDetailV1,ei as parseRadarResetActionDetailV2,xt as parseRadarResetActionSummaryV2,We as parseRadarResetAnalysisV1,Ao as parseRadarResetClueSnapshot,yn as parseRadarResetDetailMultipartV2,Ke as parseRadarResetExportV1,ni as parseRadarResetExportV2,qe as parseRadarResetPendingActionV1,ti as parseRadarResetPendingActionV2,ot as parseRadarResetPositiveDecimalV2,Ct as parseRadarResetPublicationHomeFactsV2,an as parseRadarResetPublicationRevisionAvailableV2,Zt as parseRadarResetReadActionsRequestV2,tn as parseRadarResetReadActionsSuccessV2,Qt as parseRadarResetReadChangesRequestV2,nn as parseRadarResetReadChangesSuccessV2,$t as parseRadarResetReadDetailBatchRequestV2,Xt as parseRadarResetReadHeadRequestV2,en as parseRadarResetReadHeadSuccessV2,oe as parseRadarResetSnapshotAvailableV1,rn as parseRadarResetSourceErrorEnvelopeV2,at as parseRadarResetUInt64DecimalV2,Ga as projectRadarBrowserSubscriptionSelection,ro as projectRadarBrowserSubscriptionV1,ri as projectRadarResetExportV1FromV2,Je as projectRadarResetPrimarySourceV1,ci as projectRadarResetPublicActionToV2,z as radarActivityEventIdSchema,V as radarActivityFileSchema,nr as radarActivityFileUrl,Tr as radarActivityFileV2Schema,rr as radarActivityFileV2Url,Qi as radarActivityFileV3Schema,Bi as radarActivityFileV3Url,B as radarActivityMaxBytes,sr as radarActivityProgressSchema,Sr as radarActivityProgressV2Schema,qi as radarActivityProgressV3Schema,cr as radarActivityReactionCountsSchema,tr as radarActivityReactionIdSchema,R as radarActivityReactionIds,Ca as radarBrowserNotificationProjectionSchema,Sa as radarBrowserNotificationTopicSchema,za as radarBrowserRegistrationSchema,qa as radarBrowserSubscriptionErrorRes,Ua as radarBrowserSubscriptionFailureSchema,Wa as radarBrowserSubscriptionOperationSchema,Ha as radarBrowserSubscriptionReadReq,Ka as radarBrowserSubscriptionRes,Va as radarBrowserSubscriptionSaveReq,$a as radarBrowserSubscriptionSaveV2Req,to as radarBrowserSubscriptionV2Res,Y as radarBrowserSubscriptionViewSchema,eo as radarBrowserSubscriptionViewV2Schema,Na as radarBrowserSubscriptionsPath,La as radarBrowserTopicsSchema,Ya as radarBrowserTopicsV2Schema,Rr as radarCodexGuessChoiceSchema,Ur as radarCodexGuessErrorSchema,zr as radarCodexGuessSaveReqSchema,Hr as radarCodexGuessViewSchema,K as radarCodexModelIdSchema,da as radarCodexModelUrl,ls as radarCodexModelsMaxBytes,hs as radarCodexModelsPath,fs as radarCodexModelsSchema,fa as radarCodexProgressCalendar,Mr as radarCodexProgressChangeSchema,Pr as radarCodexProgressChangeV2Schema,na as radarCodexProgressChangeV3Schema,Nr as radarCodexProgressChangesV1Schema,Fr as radarCodexProgressChangesV2Schema,ra as radarCodexProgressChangesV3Schema,j as radarCodexProgressEntrySchema,zn as radarCodexProgressEntryV3Schema,Ni as radarCodexProgressEntryV5Schema,ji as radarCodexProgressImprovementV5Schema,Di as radarCodexProgressPostRoleV5Schema,Oi as radarCodexProgressPostV5Schema,ki as radarCodexProgressPostsV5Schema,Mi as radarCodexProgressResetEntryV5Schema,Wn as radarCodexProgressScore,F as radarCodexProgressTitleV3Schema,M as radarCodexProgressV1Schema,Mn as radarCodexProgressV2MaxBytes,P as radarCodexProgressV2Schema,Rn as radarCodexProgressV3MaxBytes,I as radarCodexProgressV3Schema,Kn as radarCodexProgressV4MaxBytes,L as radarCodexProgressV4Schema,Ai as radarCodexProgressV5MaxBytes,Ri as radarCodexProgressV5Schema,Bo as radarCodexReleaseDirectoryMaxBytes,zo as radarCodexReleaseDirectoryPath,Jo as radarCodexReleaseDirectorySchema,G as radarCodexReleaseIdentitySchema,Vo as radarCodexReleaseMonthMaxBytes,ss as radarCodexReleaseMonthPath,Qo as radarCodexReleaseMonthSchema,Ho as radarCodexReleaseNotesMaxBytes,cs as radarCodexReleaseNotesPath,es as radarCodexReleaseNotesSchema,$o as radarCodexReleaseSectionsSchema,ua as radarCodexReleaseUrl,Uo as radarCodexTimePointSchema,so as radarImprovementColumnPath,go as radarImprovementEligibilityReq,_o as radarImprovementEligibilityRes,uo as radarImprovementEntrySchema,vo as radarImprovementErrorRes,fo as radarImprovementHeadReq,po as radarImprovementHeadRes,oo as radarImprovementPageMaxBytes,mo as radarImprovementPageReq,ho as radarImprovementPageRes,ao as radarImprovementPageSize,xa as radarNotificationProjectionSchema,ba as radarNotificationTargetSchema,ka as radarNotificationTaskPageSize,Ea as radarNotificationTaskSchema,Oa as radarNotificationTasksPath,ja as radarNotificationTasksReq,Ma as radarNotificationTasksRes,_a as radarNotificationTopicSchema,va as radarNotificationTopicsSchema,b as radarResetActionDetailV1Schema,H as radarResetActionDetailV2Schema,Ot as radarResetActionItemV2Schema,Qe as radarResetActionPageMaxBytesV2,Ze as radarResetActionPageMaxItemsV2,bt as radarResetActionSummaryV2Schema,Et as radarResetActiveActionItemV2Schema,Pe as radarResetAnalysisV1Schema,n as radarResetAnalyzerContractVersionV1,s as radarResetAudienceValues,It as radarResetChangeCoverageV2Schema,et as radarResetChangePageMaxBytesV2,$e as radarResetChangePageMaxItemsV2,Eo as radarResetClueLifetimeMs,Do as radarResetClueMaxBytes,To as radarResetCluePath,Oo as radarResetClueSchema,ko as radarResetClueSnapshotSchema,t as radarResetContractVersionV1,Ye as radarResetContractVersionV2,nt as radarResetDetailBatchMaxBytesV2,tt as radarResetDetailBatchMaxChunksV2,wt as radarResetDetailChunkReferenceV2Schema,Mt as radarResetDetailChunkRequestV2Schema,Tt as radarResetDetailManifestV2Schema,a as radarResetEffectValues,He as radarResetExportV1Schema,$r as radarResetExportV2Schema,qr as radarResetKindNoticeV2Schema,wi as radarResetManagementActionSchema,vi as radarResetManagementOperationSchema,Ti as radarResetManagementResSchema,Ci as radarResetManualApplyReqSchema,_i as radarResetManualCopySchema,yi as radarResetManualDraftSchema,xi as radarResetManualDraftSeedSchema,bi as radarResetManualPreviewReqSchema,Si as radarResetManualPreviewResSchema,Ei as radarResetManualResultResSchema,Le as radarResetNoticeKindValues,x as radarResetPendingActionV1Schema,U as radarResetPendingActionV2Schema,c as radarResetPlanValues,C as radarResetPositiveDecimalV2Schema,o as radarResetProductValues,ui as radarResetPublicActionV1Schema,r as radarResetPublicDataLimits,T as radarResetPublicIdV2Schema,ii as radarResetPublicRecordsCorePath,mi as radarResetPublicRecordsV1Schema,St as radarResetPublicationHomeFactsV2Schema,Yt as radarResetPublicationRevisionAvailableV2Schema,Re as radarResetPublicationTimingSchema,Rt as radarResetReadActionsDataV2Schema,At as radarResetReadActionsRequestV2Schema,Ht as radarResetReadActionsSuccessV2Schema,zt as radarResetReadChangesDataV2Schema,jt as radarResetReadChangesRequestV2Schema,Ut as radarResetReadChangesSuccessV2Schema,Nt as radarResetReadDetailBatchRequestV2Schema,Lt as radarResetReadHeadDataV2Schema,kt as radarResetReadHeadRequestV2Schema,Vt as radarResetReadHeadSuccessV2Schema,ee as radarResetReasonBasisValues,l as radarResetReasonCategoryValues,Kt as radarResetSafeCauseSnapshotV2Schema,i as radarResetSeriesValues,E as radarResetSha256V2Schema,ae as radarResetSnapshotAvailableV1Schema,Ft as radarResetSourceChangeV2Schema,Wt as radarResetSourceErrorCodeValuesV2,Jt as radarResetSourceErrorEnvelopeV2Schema,Tn as radarResetSourceErrorHttpStatusV2,wn as radarResetSourceErrorIsRetryableV2,qt as radarResetSourceErrorV2Schema,Xe as radarResetSourceMaxRpcCallsV2,Wr as radarResetSourceTranslationsSchema,it as radarResetUInt64DecimalV2Schema,st as radarResetUInt64DecimalV2ToBigInt,di as radarResetUnexecutedActionV1Schema,w as radarResetUtcTimestampV2Schema,Dt as radarResetWithdrawnActionItemV2Schema,fi as radarResetWithdrawnActionV1Schema,bo as radarTiboSourceStatusMaxBytes,yo as radarTiboSourceStatusPath,Co as radarTiboSourceStatusSchema,yr as radarTitledActivityFileSchema,gr as radarTitledActivityProgressSchema,ca as radarWebsiteLocalePrefixes,sa as radarWebsiteLocales,oa as radarWebsiteOrigin,la as radarWebsitePagePaths,q as radarWebsitePageUrl,Er as readRadarActivityFile,Or as readRadarActivityFileV2,$i as readRadarActivityFileV3,ms as readRadarCodexModels,is as readRadarCodexReleaseDirectory,as as readRadarCodexReleaseMonth,os as readRadarCodexReleaseNotes,Mo as readRadarResetClueSnapshot,wo as readRadarTiboSourceStatus,Dr as readRadarTitledActivityFile,Ba as redactRadarBrowserRegistrationReferences,Cn as toSafeCauseSnapshotV2,io as upgradeRadarBrowserSubscriptionCommandV1};
|