@closerepo/radar-contracts 5.0.0 → 6.0.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 CHANGED
@@ -5985,6 +5985,7 @@ declare const radarResetManagementOperationSchema: z.ZodEnum<{
5985
5985
  restore_preview: "restore_preview";
5986
5986
  set_auto_notification: "set_auto_notification";
5987
5987
  notify: "notify";
5988
+ confirm: "confirm";
5988
5989
  }>;
5989
5990
  /** Manual confirmation supplies execution time without rewriting the source post or claiming an official confirmation. */
5990
5991
  declare const radarResetManualDraftSchema: z.ZodObject<{
@@ -5994,6 +5995,7 @@ declare const radarResetManualDraftSchema: z.ZodObject<{
5994
5995
  restore_preview: "restore_preview";
5995
5996
  set_auto_notification: "set_auto_notification";
5996
5997
  notify: "notify";
5998
+ confirm: "confirm";
5997
5999
  }>;
5998
6000
  expectedRevision: z.ZodInt;
5999
6001
  copy: z.ZodNullable<z.ZodObject<{
@@ -6016,6 +6018,7 @@ declare const radarResetManualPreviewReqSchema: z.ZodObject<{
6016
6018
  restore_preview: "restore_preview";
6017
6019
  set_auto_notification: "set_auto_notification";
6018
6020
  notify: "notify";
6021
+ confirm: "confirm";
6019
6022
  }>;
6020
6023
  expectedRevision: z.ZodInt;
6021
6024
  copy: z.ZodNullable<z.ZodObject<{
@@ -6038,6 +6041,7 @@ declare const radarResetManualDraftSeedSchema: z.ZodObject<{
6038
6041
  restore_preview: "restore_preview";
6039
6042
  set_auto_notification: "set_auto_notification";
6040
6043
  notify: "notify";
6044
+ confirm: "confirm";
6041
6045
  }>;
6042
6046
  expectedRevision: z.ZodInt;
6043
6047
  copy: z.ZodNullable<z.ZodObject<{
@@ -6063,6 +6067,7 @@ declare const radarResetManualPreviewResSchema: z.ZodObject<{
6063
6067
  restore_preview: "restore_preview";
6064
6068
  set_auto_notification: "set_auto_notification";
6065
6069
  notify: "notify";
6070
+ confirm: "confirm";
6066
6071
  }>;
6067
6072
  expectedRevision: z.ZodInt;
6068
6073
  copy: z.ZodNullable<z.ZodObject<{
@@ -6091,6 +6096,7 @@ declare const radarResetManualApplyReqSchema: z.ZodObject<{
6091
6096
  restore_preview: "restore_preview";
6092
6097
  set_auto_notification: "set_auto_notification";
6093
6098
  notify: "notify";
6099
+ confirm: "confirm";
6094
6100
  }>;
6095
6101
  expectedRevision: z.ZodInt;
6096
6102
  copy: z.ZodNullable<z.ZodObject<{
@@ -6128,6 +6134,7 @@ declare const radarResetManagementActionSchema: z.ZodObject<{
6128
6134
  restore_preview: "restore_preview";
6129
6135
  set_auto_notification: "set_auto_notification";
6130
6136
  notify: "notify";
6137
+ confirm: "confirm";
6131
6138
  }>>;
6132
6139
  notificationOperationId: z.ZodNullable<z.ZodUUID>;
6133
6140
  }, z.core.$strict>;
@@ -6152,6 +6159,7 @@ declare const radarResetManagementResSchema: z.ZodObject<{
6152
6159
  restore_preview: "restore_preview";
6153
6160
  set_auto_notification: "set_auto_notification";
6154
6161
  notify: "notify";
6162
+ confirm: "confirm";
6155
6163
  }>>;
6156
6164
  notificationOperationId: z.ZodNullable<z.ZodUUID>;
6157
6165
  }, z.core.$strict>>;
@@ -6168,6 +6176,7 @@ declare const radarResetManualResultResSchema: z.ZodDiscriminatedUnion<[z.ZodObj
6168
6176
  restore_preview: "restore_preview";
6169
6177
  set_auto_notification: "set_auto_notification";
6170
6178
  notify: "notify";
6179
+ confirm: "confirm";
6171
6180
  }>;
6172
6181
  revision: z.ZodNumber;
6173
6182
  notification: z.ZodObject<{
package/dist/index.js CHANGED
@@ -4,4 +4,4 @@ X-Radar-Reset-Action-Id-B64: ${ln(A.encode(e.resetActionId))}\r\nX-Radar-Detail-
4
4
  `)){let t=e.indexOf(`:`);if(t<=0||e.slice(t+1,t+2)!==` `)return M(`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 M(`source_chunk_mismatch`,!1);n.set(i,a)}return n.size===r.size?n:M(`source_chunk_mismatch`,!1)}function _n(e,t,n){for(let r=n;r<=e.byteLength-t.byteLength;r+=1)if(j(e,t,r))return r;return-1}async function vn(e,t){let n=Mt.parse({contractVersion:2,revision:t.revision,chunks:t.chunks});if(e.status!==200)return M(`source_chunk_mismatch`,!1);let r=hn(e,`Content-Type`),i=/^multipart\/mixed; boundary=(radar-reset-v2-[0-9a-f]{48})$/u.exec(r);if(i===null)return M(`source_chunk_mismatch`,!1);let a=i[1];if(hn(e,`Cache-Control`)!==`no-store`)return M(`source_chunk_mismatch`,!1);O.parse(hn(e,`X-Radar-Correlation-Id`));let o=hn(e,`X-Radar-Part-Count`);if(!/^[1-9][0-9]*$/u.test(o)||Number(o)>32||Number(o)!==n.chunks.length)return M(`source_chunk_mismatch`,!1);let s;try{s=on.decode(un(hn(e,`X-Radar-Revision-B64`)))}catch(e){return M(`source_chunk_mismatch`,!1,e)}if(s!==n.revision)return M(`source_chunk_mismatch`,!1);let c=await mn(e),l=A.encode(`--${a}\r\n`),u=A.encode(`--${a}--\r\n`),d=A.encode(`\r
5
5
  \r
6
6
  `),f=A.encode(`\r
7
- `),ee=[],p=0;for(let e of n.chunks){if(!j(c,l,p))return M(`source_stream_incomplete`,!0);p+=l.byteLength;let t=_n(c,d,p);if(t<0)return M(`source_stream_incomplete`,!0);let n=gn(c.slice(p,t));if(p=t+d.byteLength,n.get(`content-type`)!==`application/octet-stream`)return M(`source_chunk_mismatch`,!1);let r;try{r=on.decode(un(n.get(`x-radar-reset-action-id-b64`)))}catch(e){return M(`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 M(`source_chunk_mismatch`,!1);if(p+e.byteSize+f.byteLength>c.byteLength)return M(`source_stream_incomplete`,!0);let i=c.slice(p,p+e.byteSize);if(p+=e.byteSize,!j(c,f,p)||(p+=f.byteLength,await dn(i)!==e.sha256))return M(`source_chunk_mismatch`,!1);ee.push({...e,bytes:i})}return!j(c,u,p)||p+u.byteLength!==c.byteLength?M(`source_stream_incomplete`,!0):ee}const yn=/authorization|cookie|token|secret|password|api[-_]?key/iu;function bn(e,t){let n=[...e].slice(0,1024),r=``;for(let e of n){let n=A.encode(e).byteLength;if(n>t.remaining)break;t.remaining-=n,r+=e}return r}function xn(e,t,n,r){if(e===null||typeof e==`boolean`)return e;if(typeof e==`string`)return bn(e,n);if(typeof e==`number`)return Number.isFinite(e)?e:String(e);if(typeof e==`bigint`||typeof e==`symbol`)return bn(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=>xn(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=bn(String(e),n);if(!(a.length===0||Object.hasOwn(i,a))&&(n.remaining-=Math.min(n.remaining,8),i[a]=yn.test(a)?`[REDACTED]`:xn(o,t+1,n,r),n.remaining<=0))break}return i}function Sn(e){let t=xn(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 Cn(e){return e===`source_temporarily_unavailable`||e===`source_rpc_transport_failure`||e===`source_stream_incomplete`}function wn(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 Tn(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:Cn(e.code),correlationId:e.correlationId,cause:Sn(e.cause)}};return qt.parse(t)}const En=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),Dn=e.iso.date(),N=e.strictObject({category:e.enum([`improvement`,`direct_reset`,`reset_card`]),deliveryState:e.enum([`preview`,`landed`]),description:En,dateBasis:e.enum([`occurrence`,`announcement`,`unresolved`]),sourceUrls:e.array(e.url({protocol:/^https?$/})).min(1)}),On=e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),text:En}),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:Dn,endDate:Dn,processing:e.strictObject({hasPending:e.boolean(),hasFailures:e.boolean()}),days:e.array(e.strictObject({date:Dn,dayNumber:e.number().int().min(1).max(28),outcome:e.enum([`unconfirmed`,`improvement`,`reset`,`both`]),entries:e.array(N),summary:On})).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 kn(e){return P.parse(e)}function An(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 jn=524288,Mn=P.shape,Nn=Mn.days.element,Pn=N.extend({date:Mn.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(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`})}),In=Nn.omit({date:!0,entries:!0}).extend({entries:e.array(Pn),lifecycle:Fn}),Ln=e.strictObject({contractVersion:e.literal(2),generatedAt:Mn.generatedAt,timeZone:Mn.timeZone,processing:Mn.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=An(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 Rn(e){return Ln.parse(e)}const zn=jn,F=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),Bn=N.extend({title:F}),Vn=Ln.shape,Hn=Vn.days.element,Un=Hn.shape.entries.element.safeExtend({title:F}),Wn=Hn.extend({title:F.nullable(),entries:e.array(Un)}).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`})}),Gn=e.strictObject({...Vn,contractVersion:e.literal(3),days:e.array(Wn),unassignedEntries:e.array(Un)}).superRefine((e,t)=>{let n=Ln.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 Kn(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 qn(e){return Gn.parse(e)}const Jn=zn,Yn=Ln.shape,Xn=Gn.shape.unassignedEntries,Zn=Yn.days.element.omit({summary:!0}).extend({entries:Xn}),Qn=e.strictObject({...Yn,contractVersion:e.literal(4),days:e.array(Zn).length(28),unassignedEntries:Xn}).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!==An(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function $n(e){return Qn.parse(e)}function er(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 tr(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 nr(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 rr(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 I=[`👍`,`😂`,`🤡`,`💀`,`😭`,`🔥`,`🎉`,`👀`,`🙏`,`🫠`],ir=e.enum(I),L=e.string().min(1).max(128),R=524288,ar=`https://data.radarultra.com/activity/v1/latest.json`,or=`https://data.radarultra.com/activity/v2/latest.json`,sr=N.extend({eventId:L}),cr=P.safeExtend({days:e.array(P.shape.days.element.extend({entries:e.array(sr)})).length(28),undatedEntries:e.array(sr)});function lr(e,t){er([...e.days.flatMap(e=>e.entries),...e.undatedEntries],t)}const ur=cr.superRefine(lr),dr=e.record(ir,e.number().int().nonnegative()),fr=e.strictObject({reactionCounts:dr,reactionTotal:e.number().int().nonnegative()});function pr(e,t){tr(e,t,I)}const mr=sr.extend(fr.shape).superRefine(pr),hr=cr.safeExtend({days:e.array(cr.shape.days.element.extend({entries:e.array(mr)})).length(28),undatedEntries:e.array(mr)}).superRefine(lr),z=e.strictObject({publishedAt:e.iso.datetime(),reactionIds:e.array(ir).length(I.length).refine(e=>new Set(e).size===I.length,`Every reaction must occur exactly once`),progress:hr}),gr=Gn.shape,_r=gr.unassignedEntries.element.safeExtend({eventId:L}),vr=e.strictObject({...gr,days:e.array(gr.days.element.safeExtend({entries:e.array(_r)})).length(28),unassignedEntries:e.array(_r)}),yr=vr.superRefine((e,t)=>{let n=({eventId:e,...t})=>t,r=Gn.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});er([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),br=_r.safeExtend(fr.shape).superRefine(pr),xr=vr.safeExtend({days:e.array(gr.days.element.safeExtend({entries:e.array(br)})).length(28),unassignedEntries:e.array(br)}).superRefine((e,t)=>{let n=({reactionCounts:e,reactionTotal:t,...n})=>n,r=yr.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})}),Sr=z.extend({progress:xr}),Cr=Qn.shape,wr=Cr.unassignedEntries.element.safeExtend({eventId:L}),Tr=Qn.safeExtend({days:e.array(Cr.days.element.safeExtend({entries:e.array(wr)})).length(28),unassignedEntries:e.array(wr)}).superRefine((e,t)=>{er([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),Er=wr.safeExtend(fr.shape).superRefine(pr),Dr=Tr.safeExtend({days:e.array(Cr.days.element.safeExtend({entries:e.array(Er)})).length(28),unassignedEntries:e.array(Er)}),Or=z.extend({progress:Dr});async function kr(e){return nr(e,z,R)}async function Ar(e){return nr(e,Sr,R)}async function jr(e){return nr(e,Or,R)}function Mr(e){return rr(e,z,R)}function Nr(e){return rr(e,Sr,R)}function Pr(e){return rr(e,Or,R)}const Fr=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()}),Ir=e.strictObject({contractVersion:e.literal(1),changes:e.array(Fr),nextCursor:e.string().min(1),hasMore:e.boolean()}),Lr=Fr.extend({dayNumber:P.shape.days.element.shape.dayNumber.nullable()}),Rr=Ir.extend({contractVersion:e.literal(2),changes:e.array(Lr)}),zr=e.int().min(0).max(2**53-1),Br=e.int().min(1).max(28),Vr=e.enum([`yes`,`no`]).nullable(),Hr=e.strictObject({choice:Vr}),Ur=e.strictObject({yes:zr,no:zr,total:zr}).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.`})}),Wr=e.strictObject({dayNumber:Br,state:e.enum([`unopened`,`open`,`closed`]),choice:Vr,outcome:e.enum([`unconfirmed`,`yes`,`no`]),personalResult:e.enum([`none`,`waiting`,`correct`,`incorrect`]),corrected:e.boolean(),counts:Ur}).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.`})}),Gr=e.strictObject({revision:zr,openDayNumber:Br.nullable(),days:e.array(Wr).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.`})}}),Kr=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.`})}),qr=e.strictObject({"zh-Hans":S.shape.noticeTimeline.element.shape.sourceTextZh,"zh-Hant":S.shape.noticeTimeline.element.shape.sourceTextZh,ja:S.shape.noticeTimeline.element.shape.sourceTextZh,ko:S.shape.noticeTimeline.element.shape.sourceTextZh}),Jr=S.shape.noticeTimeline.element.omit({sourceTextZh:!0}).extend({sourceTranslations:qr}).strict(),Yr=e.strictObject({...S.shape,contractVersion:e.literal(2),noticeTimeline:e.array(Jr).min(1).max(i.actionDetail.noticeTimeline)}),Xr=Jr.omit({phase:!0}).extend({kinds:C.shape.noticeTimeline.element.shape.kinds}).strict(),Zr=e.strictObject({...C.shape,noticeTimeline:e.array(Xr).min(1).max(i.actionDetail.noticeTimeline)}),Qr=e=>{let{sourceTranslations:t,...n}=e;return{...n,sourceTextZh:t[`zh-Hans`]}},$r=e=>({...e,contractVersion:1,noticeTimeline:e.noticeTimeline.map(Qr)}),ei=e=>({...e,noticeTimeline:e.noticeTimeline.map(Qr)}),ti=(e,t)=>{for(let n of e.error?.issues??[])t.addIssue({...n})},B=Yr.superRefine((e,t)=>{ti(S.safeParse($r(e)),t)}),V=Zr.superRefine((e,t)=>{ti(C.safeParse(ei(e)),t)}),H=e.strictObject({...Ve.shape,contractVersion:e.literal(2),actions:e.array(B).min(1).max(i.analysis.actions),pendingResetActions:e.array(V).max(i.analysis.actions)}).superRefine((e,t)=>{ti(Ve.safeParse({...e,contractVersion:1,actions:e.actions.map($r),pendingResetActions:e.pendingResetActions.map(ei)}),t),new TextEncoder().encode(JSON.stringify(e)).byteLength>i.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`export_utf8_size_limit_exceeded`,path:[]})}),ni=e=>B.parse(e),ri=e=>V.parse(e),ii=e=>H.parse(e);function ai(e){let t=ii(e);return Ve.parse({...t,contractVersion:1,actions:t.actions.map($r),pendingResetActions:t.pendingResetActions.map(ei)})}const oi=e.object(B.shape).omit({actionScope:!0,reasons:!0}).extend({contractVersion:e.literal(3)}).strict().superRefine((e,n)=>t(e,n,w)),si=H.shape.generatedAt,ci=e.strictObject({resetActionId:S.shape.resetActionId,effect:S.shape.resetEffects.options[0].shape.values.element.nullable(),at:si,basis:e.enum([`execution_confirmation`,`announcement`]),sourceUrl:S.shape.noticeTimeline.element.shape.sourceUrl}),li=e.number().int().nonnegative(),ui=e.number().finite().nonnegative();function U(e,t){try{return w(e,t)}catch{return}}function di(e,t){return e<t?-1:+(e>t)}const fi=e.strictObject({timeBasis:e.literal(`confirmation_priority`),startAt:si,total:li,hardResetCount:li,bankedResetCount:li,unknownCount:li,records:e.array(ci).max(i.analysis.actions*2),intervalSummary:e.strictObject({mean:ui,max:ui}).nullable()});function pi(e,t){let n=(e,n=[])=>t.addIssue({code:`custom`,message:e,path:n}),r={hard_reset:0,banked_reset:0,unknown:0},a=new Set,o=new Map,s=new Set,c=new Set;for(let[t,i]of e.records.entries()){r[i.effect??`unknown`]+=1;let l=JSON.stringify([i.resetActionId,i.effect]);a.has(l)&&n(`statistics_record_identity_duplicate`,[`records`,t]),a.add(l),i.effect===null?s.add(i.resetActionId):c.add(i.resetActionId),U(i.at,e.startAt)===-1&&n(`statistics_record_before_window`,[`records`,t,`at`]);let u=e.records.at(t-1);if(t>0&&u!==void 0){let e=U(u.at,i.at);e!==void 0&&(e>0||e===0&&(di(u.resetActionId,i.resetActionId)>0||u.resetActionId===i.resetActionId&&di(u.effect??``,i.effect??``)>0))&&n(`statistics_records_not_stably_sorted`,[`records`,t])}let d=o.get(i.resetActionId);(d===void 0||U(i.at,d)===-1)&&o.set(i.resetActionId,i.at)}o.size>i.analysis.actions&&n(`statistics_event_limit_exceeded`),[...s].some(e=>c.has(e))&&n(`statistics_event_effect_state_mismatch`),e.total!==e.records.length&&n(`statistics_total_mismatch`,[`total`]),e.hardResetCount!==r.hard_reset&&n(`statistics_hard_reset_count_mismatch`,[`hardResetCount`]),e.bankedResetCount!==r.banked_reset&&n(`statistics_banked_reset_count_mismatch`,[`bankedResetCount`]),e.unknownCount!==r.unknown&&n(`statistics_unknown_count_mismatch`,[`unknownCount`]);let l=[...o.values()].sort((e,t)=>U(e,t)??0),u=l.slice(1).map((e,t)=>Number(((Date.parse(e)-Date.parse(l.at(t)))/864e5).toFixed(6)));if(u.length===0)e.intervalSummary!==null&&n(`statistics_interval_summary_must_be_null`,[`intervalSummary`]);else if(u.every(Number.isFinite)){let t=Number((u.reduce((e,t)=>e+t,0)/u.length).toFixed(6)),r=Math.max(...u);(e.intervalSummary===null||Math.abs(e.intervalSummary.mean-t)>1e-9||Math.abs(e.intervalSummary.max-r)>1e-9)&&n(`statistics_interval_summary_mismatch`,[`intervalSummary`])}}const mi=fi.superRefine(pi),hi=e.object(H.shape).omit({analysis:!0}).extend({contractVersion:e.literal(3),statistics:mi,actions:e.array(oi).min(1).max(i.analysis.actions)}).strict().superRefine((e,t)=>{let n=(e,n=[])=>t.addIssue({code:`custom`,message:e,path:n});new TextEncoder().encode(JSON.stringify(e)).byteLength>i.exportUtf8Bytes&&n(`export_utf8_size_limit_exceeded`);let r=new Map(e.actions.map(e=>[e.resetActionId,e])),a=new Set(e.statistics.records.map(e=>e.resetActionId));r.size!==e.actions.length&&n(`export_action_identity_duplicate`,[`actions`]),new Set(e.pendingResetActions.map(e=>e.resetActionId)).size!==e.pendingResetActions.length&&n(`export_pending_action_identity_duplicate`,[`pendingResetActions`]);for(let[t,r]of e.actions.entries()){let i=e.actions.at(t-1);t>0&&i!==void 0&&si.safeParse(i.firstAnnouncedAt).success&&si.safeParse(r.firstAnnouncedAt).success&&T(i,r)>0&&n(`export_actions_not_stably_sorted`,[`actions`,t]),U(r.firstAnnouncedAt,e.generatedAt)===1&&n(`export_action_after_snapshot`,[`actions`,t,`firstAnnouncedAt`]);let o=U(r.firstAnnouncedAt,e.statistics.startAt);o!==void 0&&o>=0&&!a.has(r.resetActionId)&&n(`export_statistics_window_action_missing`,[`actions`,t,`resetActionId`])}for(let[t,i]of e.statistics.records.entries()){let a=[`statistics`,`records`,t],o=r.get(i.resetActionId);if(o===void 0){n(`export_statistics_action_missing`,a);continue}(o.resetEffects.state===`unknown`!=(i.effect===null)||i.effect!==null&&!o.resetEffects.values.some(e=>e===i.effect))&&n(`export_statistics_effect_mismatch`,[...a,`effect`]);let s=o.noticeTimeline.filter(e=>e.sourceUrl===i.sourceUrl&&U(e.authoredAt,i.at)===0);s.length===0&&n(`export_statistics_source_mismatch`,a),i.basis===`execution_confirmation`&&!s.some(e=>e.phase===`executed`)&&n(`export_statistics_confirmation_source_invalid`,a),i.basis===`announcement`&&U(i.at,o.firstAnnouncedAt)!==0&&n(`export_statistics_announcement_time_mismatch`,a),U(i.at,e.generatedAt)===1&&n(`export_statistics_record_after_snapshot`,[...a,`at`])}}),gi=e.strictObject({contractVersion:e.literal(1),data:e.strictObject({sourceWatermark:re.shape.sourceWatermark,statistics:mi}),meta:e.strictObject({observedAt:si})}),_i=e=>hi.parse(e);function vi(e,t){let n=H.parse(e);return _i({contractVersion:3,generatedAt:n.generatedAt,statistics:t,pendingResetActions:n.pendingResetActions,actions:n.actions.map(({actionScope:e,reasons:t,...n})=>({...n,contractVersion:3}))})}const yi=e=>oi.parse(e),bi=`/api/v1/codex-reset-public-records`,xi=e.array(Xr).min(1).max(i.actionDetail.noticeTimeline),Si=e.strictObject(B.shape).omit({contractVersion:!0,noticeCount:!0,noticeTimeline:!0}).extend({noticeTimeline:xi}).strict();function Ci(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 wi=e=>B.parse(Ci(e));function Ti(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=B.shape.firstAnnouncedAt;r>0&&a!==void 0&&o.safeParse(a.authoredAt).success&&o.safeParse(i.authoredAt).success&&w(a.authoredAt,i.authoredAt)>0&&t.addIssue({code:`custom`,message:`public_notice_timeline_not_ascending`,path:[`noticeTimeline`,r]})}}const Ei=Si.superRefine((e,t)=>{Ti(e.noticeTimeline,t);let n=B.safeParse(Ci(e));for(let e of n.error?.issues??[])t.addIssue({...e})}),Di=e.strictObject(V.shape).omit({state:!0,executedEffects:!0,pendingEffects:!0}).superRefine((e,t)=>{Ti(e.noticeTimeline,t)}),Oi=e.strictObject(B.shape).pick({resetActionId:!0}).extend({lastActiveFirstAnnouncedAt:B.shape.firstAnnouncedAt,withdrawnAt:B.shape.firstAnnouncedAt}).strict(),ki=i.analysis.actions,Ai=e.strictObject({contractVersion:e.literal(1),sourceWatermark:B.shape.resetActionId,generatedAt:B.shape.firstAnnouncedAt,actions:e.array(Ei).min(1).max(ki),pendingResetActions:e.array(V).max(ki),unexecutedResetActions:e.array(Di).max(ki),withdrawnResetActions:e.array(Oi).max(ki)}).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)Ti(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=B.shape.firstAnnouncedAt;n>0&&i!==void 0&&a.safeParse(i.firstAnnouncedAt).success&&a.safeParse(r.firstAnnouncedAt).success&&T(i,r)>=0&&t.addIssue({code:`custom`,message:`public_reset_actions_not_ascending`,path:[`actions`,n]})}new TextEncoder().encode(JSON.stringify(e)).byteLength>i.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`public_reset_records_utf8_size_limit_exceeded`})}),ji=B.shape,Mi=e.strictObject({title:e.string(),body:e.string()}),Ni=e.strictObject({zh:Mi,en:Mi}),Pi=e.enum([`end_preview`,`restore_preview`,`set_auto_notification`,`notify`]),Fi=e.strictObject({resetActionId:ji.resetActionId,operation:Pi,expectedRevision:e.int().nonnegative(),copy:Ni.nullable(),automaticNotification:e.boolean().nullable(),executedAt:D.nullable().optional()}).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`}),e.operation!==`notify`&&e.executedAt!=null&&t.addIssue({code:`custom`,path:[`executedAt`],message:`execution_time_operation_mismatch`})}),Ii=Fi.superRefine((e,t)=>{e.operation===`notify`&&e.executedAt==null&&t.addIssue({code:`custom`,path:[`executedAt`],message:`execution_time_required`})}),Li=Fi,Ri=e.strictObject({digest:e.string().regex(/^sha256:[a-f0-9]{64}$/),sourceWatermark:e.string().min(1),draft:Ii}),zi=e.strictObject({operationId:e.uuid(),preview:Ri}),Bi=e.strictObject({resetActionId:ji.resetActionId,revision:e.number().int().nonnegative(),state:e.enum([`preview`,`executed`,`cancelled`,`undetermined`]),firstAnnouncedAt:D.nullable(),officialConfirmed:e.boolean(),pendingPreview:e.boolean(),previewClosed:e.boolean(),automaticNotification:e.boolean(),sourceUrls:e.array(ji.noticeTimeline.element.shape.sourceUrl),availableOperations:e.array(Pi),notificationOperationId:e.uuid().nullable()}),Vi=e.strictObject({actions:e.array(Bi)}),Hi=e.discriminatedUnion(`status`,[e.strictObject({status:e.literal(`unknown`),operationId:e.uuid()}),e.strictObject({status:e.literal(`saved`),operationId:e.uuid(),resetActionId:ji.resetActionId,operation:Pi,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()})})]),Ui=S.shape.noticeTimeline.element.shape,Wi=e.enum([`initial`,`supplement`,`correction`]).nullable(),Gi=e.strictObject({authoredAt:Ui.authoredAt,role:Wi,sourceUrl:Ui.sourceUrl,sourceText:Ui.sourceText,sourceTextZh:Ui.sourceTextZh}),Ki=e.array(Gi).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),!Ui.authoredAt.safeParse(a.authoredAt).success){r=void 0;continue}if(r!==void 0){let e=w(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}}),qi=Jn,Ji=N.omit({description:!0}).extend({category:e.literal(`improvement`),title:F,posts:Ki}),Yi=N.extend({category:e.enum([`direct_reset`,`reset_card`]),title:F}),Xi=e.discriminatedUnion(`category`,[Ji,Yi]),Zi=Qn.shape,Qi=Zi.unassignedEntries.element.shape.date;function $i(e,t){e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}const ea=e.discriminatedUnion(`category`,[Ji.extend({date:Qi}).superRefine($i),Yi.extend({date:Qi}).superRefine($i)]),ta=e.strictObject({...Zi,contractVersion:e.literal(5),days:e.array(Zi.days.element.extend({entries:e.array(ea)})).length(28),unassignedEntries:e.array(ea)}).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!==An(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function na(e){return ta.parse(e)}const ra=`https://data.radarultra.com/activity/v3/latest.json`,ia=ta.shape,[aa,oa]=ia.unassignedEntries.element.options,sa=aa.safeExtend({eventId:L}),ca=oa.safeExtend({eventId:L}),la=e.discriminatedUnion(`category`,[sa,ca]),ua=ta.safeExtend({days:e.array(ia.days.element.extend({entries:e.array(la)})).length(28),unassignedEntries:e.array(la)}).superRefine((e,t)=>{er([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),da={reactionCounts:dr,reactionTotal:e.number().int().nonnegative()},fa=(e,t)=>tr(e,t,I),pa=e.discriminatedUnion(`category`,[sa.safeExtend(da).superRefine(fa),ca.safeExtend(da).superRefine(fa)]),ma=ua.safeExtend({days:e.array(ia.days.element.extend({entries:e.array(pa)})).length(28),unassignedEntries:e.array(pa)}),ha=z.extend({progress:ma});async function ga(e){return nr(e,ha,R)}function _a(e){return rr(e,ha,R)}const va=e.discriminatedUnion(`category`,[Ji,N.extend({category:e.enum([`direct_reset`,`reset_card`])})]),ya=Lr.extend({entry:va}),ba=Rr.extend({contractVersion:e.literal(3),changes:e.array(ya)});function xa(e){return ya.parse(e)}function Sa(e){return ba.parse(e)}const Ca=`https://radarultra.com`,wa=[`zh-Hans`,`zh-Hant`,`en`,`ja`,`ko`],Ta={"zh-Hans":`zh-hans`,"zh-Hant":`zh-hant`,en:`en`,ja:`ja`,ko:`ko`},Ea={"zh-Hans":`/${Ta[`zh-Hans`]}`,"zh-Hant":`/${Ta[`zh-Hant`]}`,en:``,ja:`/${Ta.ja}`,ko:`/${Ta.ko}`},Da=`/zh`,Oa={reset:`/codex`,improvement:`/codex/28-day-challenge`,changelog:`/codex/changelog`,models:`/codex/models`,community:`/codex/community`},ka=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}$/)})]),Aa=e.string().regex(/^(?!\.{1,2}$)[a-z0-9.-]+$/);function ja(e,t){return Ca+Ea[t]+Oa[e]}function Ma(e,t){let n=t===`zh-Hans`?`/zh`:Ea[t];return Ca+n+Oa[e]}function Na(e,t,n){let r=ka.parse({product:e,version:t});return`${ja(`changelog`,n)}/${r.product}/${r.version}`}function Pa(e,t){return`${ja(`models`,t)}/${Aa.parse(e)}`}const Fa=Object.freeze({timeZone:`America/Los_Angeles`,startDate:`2026-10-05`,endDate:`2026-11-01`}),Ia=Date.parse(`${Fa.startDate}T00:00:00Z`),La=(Date.parse(`${Fa.endDate}T00:00:00Z`)-Ia)/864e5+1,Ra=new Intl.DateTimeFormat(`en-CA`,{timeZone:Fa.timeZone,year:`numeric`,month:`2-digit`,day:`2-digit`});function za(e){let t=Ra.formatToParts(e),n=e=>Number(t.find(t=>t.type===e).value),r=(Date.UTC(n(`year`),n(`month`)-1,n(`day`))-Ia)/864e5,i=r<0?`before`:r>=La?`ended`:`live`,a=Math.min(La,Math.max(1,r+1));return{phase:i,today:a,ongoingDay:i===`live`?a:null}}const Ba=e.enum([`reset`,`improvement`]),Va=e.array(Ba).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),Ha=e=>new Set(wa.flatMap(t=>[ja(e,t),Ma(e,t)])),Ua={reset:Ha(`reset`),improvement:Ha(`improvement`)},Wa=t=>e.url().refine(e=>Ua[t].has(e),`notification_target_url_invalid`),Ga=e.url().refine(e=>Object.values(Ua).some(t=>t.has(e)),`notification_target_not_owned`),Ka=e.discriminatedUnion(`kind`,[e.object({kind:e.literal(`reset`),webUrl:Wa(`reset`),miniPath:e.literal(`pages/index/index`)}).strict(),e.object({kind:e.literal(`improvement`),webUrl:Wa(`improvement`),miniPath:e.literal(`pages/index/index?page=challenge`)}).strict()]),qa=e.object({topics:Va,target:Ka}).strict().refine(e=>e.topics.includes(e.target.kind),`notification_target_topic_mismatch`),Ja=e.enum([`reset`,`improvement`,`clue`]),Ya=e.object({topics:e.array(Ja).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),target:Ka}).strict().refine(e=>e.topics.some(t=>(t===`clue`?`reset`:t)===e.target.kind),`notification_target_topic_mismatch`);function Xa(e,t){let n=Za(e===`clue`?`reset`:e,t);return Ya.parse({...n,topics:[e],target:{...n.target,webUrl:Ma(n.target.kind,t)}})}function Za(e,t){return qa.parse({topics:[e],target:{kind:e,webUrl:ja(e,t),miniPath:e===`reset`?`pages/index/index`:`pages/index/index?page=challenge`}})}const Qa=e.object({notificationId:e.uuid(),eventId:e.uuid(),title:e.string().trim().min(1).max(512),createdAt:e.iso.datetime(),deliverBy:e.iso.datetime(),...qa.shape}).strict().superRefine((e,t)=>{e.topics.includes(e.target.kind)||t.addIssue({code:`custom`,message:`notification_target_topic_mismatch`}),w(e.deliverBy,e.createdAt)<=0&&t.addIssue({code:`custom`,message:`notification_task_deadline_invalid`})});function $a(e,t){return w(e.createdAt,t.createdAt)||(e.notificationId<t.notificationId?-1:+(e.notificationId>t.notificationId))}const eo=`/api/v1/notification-tasks`,to=100,no=e.string().min(1).max(8192),ro=e.object({cursor:no.optional()}).strict(),io=e.object({contractVersion:e.literal(1),roundCursor:no,notifications:e.array(Qa).max(100),nextCursor:no.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++)$a(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`})}),ao=`/api/browser-notifications`,oo=e.string().min(1).max(128),so=e.uuid(),co=e.enum(wa),lo=e.strictObject({reset:e.boolean(),improvement:e.boolean()}),uo=`[cdef][\\w-]{21}`,fo=e.strictObject({fid:e.string().regex(RegExp(`^${uo}$`))});function po(e){return e.replace(RegExp(`(^|[^\\w-])${uo}(?![\\w-])`,`g`),`$1[registration]`)}const W={operationId:so,expectedRevision:oo},mo=e.discriminatedUnion(`action`,[e.strictObject({...W,action:e.literal(`register`),topics:lo.refine(e=>e.reset||e.improvement,`subscription_topic_required`),locale:co,registration:fo}),e.strictObject({...W,action:e.literal(`set_topics`),topics:lo}),e.strictObject({...W,action:e.literal(`set_locale`),locale:co}),e.strictObject({...W,action:e.literal(`restore`),registration:fo}),e.strictObject({...W,action:e.literal(`retry`)}),e.strictObject({...W,action:e.literal(`cancel`)})]),ho=e.strictObject({operationId:so.optional(),expectedRevision:oo.optional()}).refine(e=>e.operationId===void 0==(e.expectedRevision===void 0),`subscription_operation_reference_incomplete`),go=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:so.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())}),_o=e.strictObject({id:so,state:e.enum([`pending`,`applied`,`rejected`,`unknown`,`superseded`,`not_found`]),error:go.optional()}),vo=e.strictObject({topicSettings:e.strictObject({state:e.enum([`initial`,`saved`]),revision:oo,topics:lo,locale:co.nullable()}),registrationState:e.enum([`none`,`ready`,`invalid`,`changing`]),registrationKey:e.string().regex(/^[a-f0-9]{64}$/).nullable(),manualRetryRequired:e.boolean(),operation:_o.nullable()});function yo(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 bo=e.strictObject({data:vo}),xo=e.strictObject({error:go});function So(e){return{topicSettings:{state:`initial`,revision:e,topics:{reset:!0,improvement:!1},locale:null},registrationState:`none`,registrationKey:null,manualRetryRequired:!1,operation:null}}const Co=lo.extend({clue:e.boolean().default(!1)}),[wo,To,...Eo]=mo.options,Do=e.discriminatedUnion(`action`,[wo.extend({topics:Co.refine(e=>Object.values(e).some(Boolean),`subscription_topic_required`)}),To.extend({topics:Co}),...Eo]),Oo=vo.extend({topicSettings:vo.shape.topicSettings.extend({topics:Co})}),ko=e.strictObject({data:Oo});function Ao(e){return Oo.parse(So(e))}function jo(e){let{clue:t,...n}=e.topicSettings.topics;return vo.parse({...e,topicSettings:{...e.topicSettings,topics:n}})}function Mo(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 No=20,Po=2*1024*1024,Fo=`/api/v1/improvements`,Io=e.string().min(1).max(1024),[Lo]=ua.shape.unassignedEntries.element.options,Ro=Lo.safeExtend({date:e.iso.date().refine(e=>e>Fa.endDate,`improvement_must_follow_campaign`)}),zo=e.strictObject({}),Bo=e.strictObject({challengeEnded:e.boolean(),observedAt:e.iso.datetime()}),Vo=e.strictObject({cursor:Io.nullable(),limit:e.literal(20)}),Ho=Bo.extend({entries:e.array(Ro).max(20),nextCursor:Io.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`})}),Uo=e.strictObject({eventIds:e.array(L).min(1).max(128)}),Wo=e.strictObject({eventIds:e.array(L).max(128)}),Go=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())})}),Ko=`/tibo-source/v1/latest.json`,qo=512*1024,Jo=e.iso.datetime({offset:!0}),Yo=S.shape.noticeTimeline.element,Xo=e.strictObject({contractVersion:e.literal(1),observedAt:Jo,check:e.strictObject({checkedAt:Jo,freshUntil:Jo,active:e.boolean()}).nullable(),latestPost:e.strictObject({authoredAt:Jo,sourceUrl:Yo.shape.sourceUrl,sourceText:e.string(),sourceTranslations:qr,resetRelevance:e.enum([`related`,`unrelated`,`unknown`])}).nullable()});async function Zo(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 Xo.parse(JSON.parse(o))}const Qo=`/reset-clue/v1/latest.json`,$o=4320*60*1e3,es=i.exportUtf8Bytes,ts=B.shape.noticeTimeline.element.pick({authoredAt:!0,sourceUrl:!0,sourceText:!0,sourceTranslations:!0,contentCompleteness:!0}).extend({plannedTiming:Le.nullable(),expiresAt:B.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`]})}),ns=e.strictObject({contractVersion:e.literal(1),clue:ts.nullable()}),rs=e=>ns.parse(e);function is(e,t){return e.clue!==null&&t.getTime()<Date.parse(e.clue.expiresAt)?e.clue:null}async function as(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>es)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 rs(JSON.parse(o))}const G=e.enum(wa),K=e.string().regex(/^\d{4}-(?:0[1-9]|1[0-2])$/),q=e.string().trim().min(1),os=e.url({protocol:/^https$/}),J=e.discriminatedUnion(`kind`,[e.strictObject({kind:e.literal(`instant`),at:e.iso.datetime()}),e.strictObject({kind:e.literal(`date`),date:e.iso.date()})]),ss=e.strictObject({operation:q,stage:q,cause:Gt});function cs(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:ss})])}function Y(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 X(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 ls=`/codex-releases/v2/directory.json`,us=128*1024,ds=128*1024,fs=256*1024,ps=J,ms={product:e.enum([`app`,`cli`]),version:q,published:J,month:K,revision:q},hs=e.strictObject(ms).superRefine(gs);function gs(e,t){let n=ka.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 _s(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 vs=Y(e.strictObject({contractVersion:e.literal(2),releases:e.array(hs),latest:e.strictObject({app:e.string().nullable(),cli:e.string().nullable()})}).superRefine((e,t)=>{_s(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`})}}),us),ys=e.strictObject({state:e.literal(`not_applicable`),reason:e.literal(`no_curated_notes`)}),bs=e.union([cs(e.strictObject({locale:G,points:e.array(q).min(1).max(5)})),ys]),xs=e.strictObject({...ms,source:e.strictObject({kind:e.enum([`github`,`official`]),url:os}),summary:bs,notesCount:e.number().int().nonnegative()}).superRefine((e,t)=>{gs(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`})}),Ss=Y(e.strictObject({contractVersion:e.literal(2),locale:G,month:K,releases:e.array(xs)}).superRefine((e,t)=>{_s(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`})}),ds),Cs=e.array(e.strictObject({title:q.nullable(),items:e.array(e.strictObject({text:q,refs:q.nullable()})).min(1)})).min(1),ws=Y(e.strictObject({contractVersion:e.literal(2),product:e.enum([`app`,`cli`]),version:q,revision:q,locale:G,original:e.array(Cs.element),translation:e.union([cs(Cs),ys]).nullable()}).superRefine((e,t)=>{let n=ka.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`})}}),fs),Ts=e=>vs.parse(e),Es=e=>Ss.parse(e),Ds=e=>ws.parse(e),Os=e=>X(e,`codex_release_directory`,us,vs),ks=e=>X(e,`codex_release_month`,ds,Ss),As=e=>X(e,`codex_release_notes`,fs,ws);function js(e,t){return`/codex-releases/v2/${G.parse(e)}/${K.parse(t)}.json`}function Ms(e,t,n){let r=ka.parse({product:t,version:n});return`/codex-releases/v2/${G.parse(e)}/notes/${r.product}/${r.version}.json`}const Ns=128*1024;function Z(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`known`),value:t,source:os}),e.strictObject({state:e.literal(`unavailable`),reason:e.enum([`not_announced`,`not_listed`]),source:os.nullable()})])}const Ps=e.strictObject({input:q,cached:q,output:q}),Fs=e.strictObject({modelId:Aa,name:q,group:e.enum([`current`,`retired`]),status:e.enum([`available`,`retiring`,`retired`]),launched:Z(J),chatgptRetirement:Z(J),apiRetirement:Z(J),credits:Z(Ps),apiPrice:Z(Ps),multiple:e.string().regex(/^(?:0|[1-9]\d*)(?:\.\d+)?$/).refine(e=>Number.isFinite(Number(e))&&Number(e)>0).nullable(),plans:Z(e.array(q).min(1)),surfaces:Z(e.array(q).min(1)),about:cs(e.strictObject({locale:G,paragraphs:e.array(q).min(1)})),sources:e.array(e.strictObject({label:q,url:os})).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`})}),Is=Y(e.strictObject({contractVersion:e.literal(1),locale:G,models:e.array(Fs),multipleBase:e.strictObject({modelId:Aa,name:q}).nullable(),upcomingRetirement:e.strictObject({names:q,modelIds:e.array(Aa).min(1),surface:e.enum([`api`,`chatgpt`]),at:J}).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`})}}}),Ns),Ls=e=>Is.parse(e),Rs=e=>X(e,`codex_models`,Ns,Is),zs=e=>`/codex-models/v1/${G.parse(e)}.json`,Bs=256*1024,Vs=512*1024,Hs=3600*1e3,Q=e.string().regex(/^[a-z][a-z0-9-]{0,63}$/),Us=e.enum([`x`,`hn`,`github`,`v2ex`,`reddit`,`linuxdo`]),Ws=e.enum([`debate`,`tip`,`showcase`,`comparison`,`news`]),$=e.string().trim().min(1),Gs=e.strictObject({id:$,topic:Q,platform:Us,kind:Ws,url:os,author:e.strictObject({name:$,handle:$.nullable()}),venue:$.nullable(),title:$.nullable(),summary:e.strictObject({zh:$.max(600),en:$.max(600)}),authoredAt:e.iso.datetime(),heat:e.strictObject({metrics:e.array(e.strictObject({kind:e.enum([`likes`,`points`,`comments`,`reactions`,`replies`]),value:e.number().int().nonnegative()})).min(1),ratio:e.number().finite().nonnegative()}).nullable()}).superRefine((e,t)=>{(!e.id.startsWith(`${e.platform}:`)||e.id.length<=e.platform.length+1)&&t.addIssue({code:`custom`,path:[`id`],message:`entry_platform_identity_mismatch`})});function Ks(e,t){let n=new Set,r=1/0;for(let[i,a]of e.entries.entries()){n.has(a.id)&&t.addIssue({code:`custom`,path:[`entries`,i],message:`duplicate_entry`}),n.add(a.id),a.topic!==e.topic&&t.addIssue({code:`custom`,path:[`entries`,i],message:`entry_topic_mismatch`});let o=Date.parse(a.authoredAt);o>r&&t.addIssue({code:`custom`,path:[`entries`,i],message:`entry_order_mismatch`}),r=o}}const qs=e.strictObject({id:$,platform:Us,label:$,lastSuccessAt:e.iso.datetime().nullable()}),Js=Y(e.strictObject({contractVersion:e.literal(1),topic:Q,generatedAt:e.iso.datetime(),overview:e.strictObject({weekCount:e.number().int().nonnegative(),debateCount:e.number().int().nonnegative(),hottestId:$.nullable()}),sources:e.array(qs),coverage:e.strictObject({from:e.iso.date(),months:e.array(K)}),entries:e.array(Gs)}).superRefine((e,t)=>{Ks(e,t);let n=Date.parse(e.generatedAt),r=e.entries.filter(e=>Date.parse(e.authoredAt)>=n-7*864e5),i=[...r].sort(nc).at(0)?.id??null;(e.overview.weekCount!==r.length||e.overview.debateCount!==r.filter(e=>e.kind===`debate`).length||e.overview.hottestId!==i)&&t.addIssue({code:`custom`,path:[`overview`],message:`overview_entries_mismatch`}),new Set(e.sources.map(e=>e.id)).size!==e.sources.length&&t.addIssue({code:`custom`,path:[`sources`],message:`duplicate_source`}),(new Set(e.coverage.months).size!==e.coverage.months.length||e.coverage.months.some((t,n)=>n>0&&t>=e.coverage.months.at(n-1)))&&t.addIssue({code:`custom`,path:[`coverage`],message:`coverage_order_mismatch`});for(let r of e.entries){let i=Date.parse(r.authoredAt);(i>n||i<n-30*864e5||!e.coverage.months.includes(r.authoredAt.slice(0,7))||r.authoredAt.slice(0,10)<e.coverage.from)&&t.addIssue({code:`custom`,path:[`entries`],message:`entry_coverage_mismatch`})}}),Bs),Ys=Y(e.strictObject({contractVersion:e.literal(1),topic:Q,month:K,entries:e.array(Gs)}).superRefine((e,t)=>{Ks(e,t),e.entries.some(t=>t.authoredAt.slice(0,7)!==e.month)&&t.addIssue({code:`custom`,path:[`entries`],message:`entry_month_mismatch`})}),Vs),Xs=e=>`/community-trending/v1/${Q.parse(e)}/latest.json`,Zs=(e,t)=>`/community-trending/v1/${Q.parse(e)}/${K.parse(t)}.json`,Qs=e=>Js.parse(e),$s=e=>Ys.parse(e),ec=e=>X(e,`community_trending_latest`,Bs,Js),tc=e=>X(e,`community_trending_month`,Vs,Ys);function nc(e,t){return e.heat===null&&t.heat!==null?1:e.heat!==null&&t.heat===null?-1:(t.heat?.ratio??0)-(e.heat?.ratio??0)||t.authoredAt.localeCompare(e.authoredAt)||e.id.localeCompare(t.id)}const rc=(e,t)=>e.summary[t===`zh-Hans`?`zh`:`en`],ic=e.object({revision:e.string().min(1).max(160),digest:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),ac=e.discriminatedUnion(`kind`,[e.object({publicationId:e.string().min(1).max(160),kind:e.literal(`content`),sources:e.object({"reset-v1":ic,"reset-v2":ic,"reset-v3":ic,"reset-v4":ic.optional()}).strict()}).strict(),e.object({publicationId:e.string().min(1).max(160),kind:e.literal(`reset-clue`),sources:e.object({"reset-clue":ic}).strict()}).strict()]),oc=e.object({resource:e.enum([`content-v1`,`content-v2`,`content-v3`,`content-v4`,`reset-clue`]),sourceRevision:e.string().min(1).max(160),sourceDigest:e.string().regex(/^[a-f0-9]{64}$/),targetVersion:e.iso.datetime().nullable(),targetDigest:e.string().regex(/^[a-f0-9]{64}$/).nullable(),outcome:e.enum([`published`,`unchanged`,`busy`,`superseded`,`failed`]),error:e.object({operation:e.string().min(1),stage:e.string().min(1),code:e.string().min(1),summary:e.string().min(1),correlationId:e.string().min(1),cause:e.unknown(),upstreamStatus:e.number().int().optional(),upstreamCode:e.string().optional()}).strict().optional()}).strict().superRefine((e,t)=>{(e.outcome===`published`||e.outcome===`unchanged`)&&(e.targetVersion===null||e.targetDigest===null)&&t.addIssue({code:`custom`,message:`completed publication requires a target receipt`}),e.outcome===`failed`&&e.error===void 0&&t.addIssue({code:`custom`,message:`failed publication requires a cause`})}),sc=e.object({publicationId:e.string().min(1).max(160),results:e.array(oc).min(1).max(4)}).strict().superRefine((e,t)=>{new Set(e.results.map(e=>e.resource)).size!==e.results.length&&t.addIssue({code:`custom`,message:`duplicate resource`})}),cc=`/api/v1/internal/publications/wechat/dispatch`,lc=`/__radar/wechat-publication/dispatch`,uc=hi.shape.generatedAt,dc=mi.shape.records.element,fc=e.strictObject({id:e.string().min(1),resetActionId:dc.shape.resetActionId,at:uc,effects:e.array(dc.shape.effect).min(1).max(2),source:e.discriminatedUnion(`kind`,[e.strictObject({kind:e.literal(`official_post`),sourceUrl:dc.shape.sourceUrl}),e.strictObject({kind:e.literal(`manual`),officialConfirmationMissing:e.boolean()})])}),pc=e.strictObject(mi.shape).extend({records:e.array(e.strictObject(dc.shape).extend({sourceUrl:dc.shape.sourceUrl.nullable(),confirmationId:e.string().min(1).nullable()})).max(i.analysis.actions*2)}).superRefine((e,t)=>{pi(e,t);for(let[n,r]of e.records.entries())r.basis===`execution_confirmation`!=(r.confirmationId!==null)&&t.addIssue({code:`custom`,message:`statistics_confirmation_identity_mismatch`,path:[`records`,n]}),r.basis===`announcement`&&r.sourceUrl===null&&t.addIssue({code:`custom`,message:`statistics_announcement_source_missing`,path:[`records`,n]})}),mc=e.strictObject({sourceWatermark:re.shape.sourceWatermark,confirmations:e.array(fc),statistics:pc}),hc=e.strictObject(hi.shape).extend({contractVersion:e.literal(4),statistics:pc,confirmations:e.array(fc)}).superRefine((e,t)=>{let n=e=>t.addIssue({code:`custom`,message:e});new TextEncoder().encode(JSON.stringify(e)).byteLength>i.exportUtf8Bytes&&n(`export_utf8_size_limit_exceeded`);let r=new Map(e.confirmations.map(e=>[e.id,e])),a=new Map(e.actions.map(e=>[e.resetActionId,e]));a.size!==e.actions.length&&n(`export_action_identity_duplicate`),new Set(e.pendingResetActions.map(e=>e.resetActionId)).size!==e.pendingResetActions.length&&n(`export_pending_action_identity_duplicate`);let o=new Set(e.statistics.records.map(e=>e.resetActionId));for(let[t,r]of e.actions.entries()){Date.parse(r.firstAnnouncedAt)>Date.parse(e.generatedAt)&&n(`export_action_after_snapshot`);let i=e.actions.at(t-1);t>0&&i!==void 0&&uc.safeParse(i.firstAnnouncedAt).success&&uc.safeParse(r.firstAnnouncedAt).success&&T(i,r)>0&&n(`export_actions_not_stably_sorted`),Date.parse(r.firstAnnouncedAt)>=Date.parse(e.statistics.startAt)&&!o.has(r.resetActionId)&&n(`export_statistics_window_action_missing`)}r.size!==e.confirmations.length&&t.addIssue({code:`custom`,message:`confirmation_identity_duplicate`});for(let r of e.confirmations){let i=a.get(r.resetActionId);(i===void 0||Date.parse(r.at)>Date.parse(e.generatedAt))&&t.addIssue({code:`custom`,message:`confirmation_action_or_time_invalid`}),(new Set(r.effects).size!==r.effects.length||r.effects.some(e=>i!==void 0&&(e===null!=(i.resetEffects.state===`unknown`)||e!==null&&!i.resetEffects.values.some(t=>t===e))))&&n(`confirmation_effect_mismatch`);let o=r.source;o.kind===`official_post`&&!i?.noticeTimeline.some(e=>e.phase===`executed`&&e.sourceUrl===o.sourceUrl&&e.authoredAt===r.at)&&t.addIssue({code:`custom`,message:`confirmation_official_source_invalid`})}for(let i of e.statistics.records){let o=a.get(i.resetActionId),s=i.confirmationId===null?void 0:r.get(i.confirmationId);Date.parse(i.at)>Date.parse(e.generatedAt)&&n(`export_statistics_record_after_snapshot`),o!==void 0&&(o.resetEffects.state===`unknown`!=(i.effect===null)||i.effect!==null&&!o.resetEffects.values.some(e=>e===i.effect))&&n(`export_statistics_effect_mismatch`),(o===void 0||i.confirmationId!==null&&(s===void 0||s.resetActionId!==i.resetActionId||s.at!==i.at||!s.effects.includes(i.effect)))&&t.addIssue({code:`custom`,message:`statistics_confirmation_missing_or_mismatched`}),s!==void 0&&i.sourceUrl!==(s.source.kind===`official_post`?s.source.sourceUrl:null)&&n(`statistics_confirmation_source_mismatch`),i.basis===`announcement`&&!o?.noticeTimeline.some(e=>e.sourceUrl===i.sourceUrl&&e.authoredAt===i.at&&o.firstAnnouncedAt===i.at)&&t.addIssue({code:`custom`,message:`statistics_announcement_source_invalid`})}}),gc=e=>hc.parse(e);export{an as RadarResetSourceContractErrorV2,is as activeRadarResetClue,nc as compareRadarCommunityTrendingEntries,$a as compareRadarNotificationTasks,T as compareRadarResetActionDetailsV1,w as compareRadarResetUtcTimestampsV1,Xa as createRadarBrowserNotificationProjection,za as createRadarCodexProgressCalendar,Za as createRadarNotificationProjection,Tn as createRadarResetSourceErrorEnvelopeV2,Mr as encodeRadarActivityFile,Pr as encodeRadarActivityFileV2,_a as encodeRadarActivityFileV3,pn as encodeRadarResetDetailMultipartV2,Nr as encodeRadarTitledActivityFile,st as formatRadarResetPositiveDecimalV2,ot as formatRadarResetUInt64DecimalV2,So as initialRadarBrowserSubscription,Ao as initialRadarBrowserSubscriptionV2,Ls as parseRadarCodexModels,xa as parseRadarCodexProgressChangeV3,Sa as parseRadarCodexProgressChangesV3,kn as parseRadarCodexProgressV1,Rn as parseRadarCodexProgressV2,qn as parseRadarCodexProgressV3,$n as parseRadarCodexProgressV4,na as parseRadarCodexProgressV5,Ts as parseRadarCodexReleaseDirectory,Es as parseRadarCodexReleaseMonth,Ds as parseRadarCodexReleaseNotes,Qs as parseRadarCommunityTrendingLatest,$s as parseRadarCommunityTrendingMonth,Ue as parseRadarResetActionDetailV1,ni as parseRadarResetActionDetailV2,yi as parseRadarResetActionDetailV3,bt as parseRadarResetActionSummaryV2,He as parseRadarResetAnalysisV1,rs as parseRadarResetClueSnapshot,vn as parseRadarResetDetailMultipartV2,We as parseRadarResetExportV1,ii as parseRadarResetExportV2,_i as parseRadarResetExportV3,gc as parseRadarResetExportV4,Ge as parseRadarResetPendingActionV1,ri as parseRadarResetPendingActionV2,it 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,ie as parseRadarResetSnapshotAvailableV1,nn as parseRadarResetSourceErrorEnvelopeV2,rt as parseRadarResetUInt64DecimalV2,yo as projectRadarBrowserSubscriptionSelection,jo as projectRadarBrowserSubscriptionV1,ai as projectRadarResetExportV1FromV2,vi as projectRadarResetExportV3FromV2,Ke as projectRadarResetPrimarySourceV1,wi as projectRadarResetPublicActionToV2,L as radarActivityEventIdSchema,z as radarActivityFileSchema,ar as radarActivityFileUrl,Or as radarActivityFileV2Schema,or as radarActivityFileV2Url,ha as radarActivityFileV3Schema,ra as radarActivityFileV3Url,R as radarActivityMaxBytes,ur as radarActivityProgressSchema,Tr as radarActivityProgressV2Schema,ua as radarActivityProgressV3Schema,dr as radarActivityReactionCountsSchema,ir as radarActivityReactionIdSchema,I as radarActivityReactionIds,Ma as radarBrowserNotificationPageUrl,Ya as radarBrowserNotificationProjectionSchema,Ga as radarBrowserNotificationTargetUrlSchema,Ja as radarBrowserNotificationTopicSchema,fo as radarBrowserRegistrationSchema,xo as radarBrowserSubscriptionErrorRes,go as radarBrowserSubscriptionFailureSchema,_o as radarBrowserSubscriptionOperationSchema,ho as radarBrowserSubscriptionReadReq,bo as radarBrowserSubscriptionRes,mo as radarBrowserSubscriptionSaveReq,Do as radarBrowserSubscriptionSaveV2Req,ko as radarBrowserSubscriptionV2Res,vo as radarBrowserSubscriptionViewSchema,Oo as radarBrowserSubscriptionViewV2Schema,ao as radarBrowserSubscriptionsPath,lo as radarBrowserTopicsSchema,Co as radarBrowserTopicsV2Schema,Vr as radarCodexGuessChoiceSchema,Kr as radarCodexGuessErrorSchema,Hr as radarCodexGuessSaveReqSchema,Gr as radarCodexGuessViewSchema,Aa as radarCodexModelIdSchema,Pa as radarCodexModelUrl,Ns as radarCodexModelsMaxBytes,zs as radarCodexModelsPath,Is as radarCodexModelsSchema,Fa as radarCodexProgressCalendar,Fr as radarCodexProgressChangeSchema,Lr as radarCodexProgressChangeV2Schema,ya as radarCodexProgressChangeV3Schema,Ir as radarCodexProgressChangesV1Schema,Rr as radarCodexProgressChangesV2Schema,ba as radarCodexProgressChangesV3Schema,N as radarCodexProgressEntrySchema,Bn as radarCodexProgressEntryV3Schema,Xi as radarCodexProgressEntryV5Schema,Ji as radarCodexProgressImprovementV5Schema,Wi as radarCodexProgressPostRoleV5Schema,Gi as radarCodexProgressPostV5Schema,Ki as radarCodexProgressPostsV5Schema,Yi as radarCodexProgressResetEntryV5Schema,Kn as radarCodexProgressScore,F as radarCodexProgressTitleV3Schema,P as radarCodexProgressV1Schema,jn as radarCodexProgressV2MaxBytes,Ln as radarCodexProgressV2Schema,zn as radarCodexProgressV3MaxBytes,Gn as radarCodexProgressV3Schema,Jn as radarCodexProgressV4MaxBytes,Qn as radarCodexProgressV4Schema,qi as radarCodexProgressV5MaxBytes,ta as radarCodexProgressV5Schema,us as radarCodexReleaseDirectoryMaxBytes,ls as radarCodexReleaseDirectoryPath,vs as radarCodexReleaseDirectorySchema,ka as radarCodexReleaseIdentitySchema,ds as radarCodexReleaseMonthMaxBytes,js as radarCodexReleaseMonthPath,Ss as radarCodexReleaseMonthSchema,fs as radarCodexReleaseNotesMaxBytes,Ms as radarCodexReleaseNotesPath,ws as radarCodexReleaseNotesSchema,Cs as radarCodexReleaseSectionsSchema,Na as radarCodexReleaseUrl,ps as radarCodexTimePointSchema,Gs as radarCommunityTrendingEntrySchema,Ws as radarCommunityTrendingKindSchema,Bs as radarCommunityTrendingLatestMaxBytes,Xs as radarCommunityTrendingLatestPath,Js as radarCommunityTrendingLatestSchema,Vs as radarCommunityTrendingMonthMaxBytes,Zs as radarCommunityTrendingMonthPath,Ys as radarCommunityTrendingMonthSchema,Us as radarCommunityTrendingPlatformSchema,qs as radarCommunityTrendingSourceSchema,Hs as radarCommunityTrendingSourceStaleMs,rc as radarCommunityTrendingSummary,Q as radarCommunityTrendingTopicSchema,Fo as radarImprovementColumnPath,Uo as radarImprovementEligibilityReq,Wo as radarImprovementEligibilityRes,Ro as radarImprovementEntrySchema,Go as radarImprovementErrorRes,zo as radarImprovementHeadReq,Bo as radarImprovementHeadRes,Po as radarImprovementPageMaxBytes,Vo as radarImprovementPageReq,Ho as radarImprovementPageRes,No as radarImprovementPageSize,qa as radarNotificationProjectionSchema,Ka as radarNotificationTargetSchema,to as radarNotificationTaskPageSize,Qa as radarNotificationTaskSchema,eo as radarNotificationTasksPath,ro as radarNotificationTasksReq,io as radarNotificationTasksRes,Ba as radarNotificationTopicSchema,Va as radarNotificationTopicsSchema,S as radarResetActionDetailV1Schema,B as radarResetActionDetailV2Schema,oi as radarResetActionDetailV3Schema,Dt as radarResetActionItemV2Schema,Xe as radarResetActionPageMaxBytesV2,Ye as radarResetActionPageMaxItemsV2,yt as radarResetActionSummaryV2Schema,Tt as radarResetActiveActionItemV2Schema,Me as radarResetAnalysisV1Schema,r as radarResetAnalyzerContractVersionV1,c as radarResetAudienceValues,Ft as radarResetChangeCoverageV2Schema,Qe as radarResetChangePageMaxBytesV2,Ze as radarResetChangePageMaxItemsV2,$o as radarResetClueLifetimeMs,es as radarResetClueMaxBytes,Qo as radarResetCluePath,ts as radarResetClueSchema,ns as radarResetClueSnapshotSchema,fc as radarResetConfirmationSchema,mc as radarResetConfirmationsResponseSchema,n as radarResetContractVersionV1,qe as radarResetContractVersionV2,et as radarResetDetailBatchMaxBytesV2,$e as radarResetDetailBatchMaxChunksV2,Ct as radarResetDetailChunkReferenceV2Schema,jt as radarResetDetailChunkRequestV2Schema,wt as radarResetDetailManifestV2Schema,o as radarResetEffectValues,Ve as radarResetExportV1Schema,H as radarResetExportV2Schema,hi as radarResetExportV3Schema,hc as radarResetExportV4Schema,Xr as radarResetKindNoticeV2Schema,Bi as radarResetManagementActionSchema,Pi as radarResetManagementOperationSchema,Vi as radarResetManagementResSchema,zi as radarResetManualApplyReqSchema,Ni as radarResetManualCopySchema,Fi as radarResetManualDraftSchema,Li as radarResetManualDraftSeedSchema,Ii as radarResetManualPreviewReqSchema,Ri as radarResetManualPreviewResSchema,Hi as radarResetManualResultResSchema,Ie as radarResetNoticeKindValues,C as radarResetPendingActionV1Schema,V as radarResetPendingActionV2Schema,l as radarResetPlanValues,E as radarResetPositiveDecimalV2Schema,s as radarResetProductValues,Ei as radarResetPublicActionV1Schema,i as radarResetPublicDataLimits,O as radarResetPublicIdV2Schema,bi as radarResetPublicRecordsCorePath,Ai as radarResetPublicRecordsV1Schema,xt as radarResetPublicationHomeFactsV2Schema,Jt as radarResetPublicationRevisionAvailableV2Schema,Le 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,d as radarResetReasonBasisValues,u as radarResetReasonCategoryValues,Gt as radarResetSafeCauseSnapshotV2Schema,a as radarResetSeriesValues,k as radarResetSha256V2Schema,re as radarResetSnapshotAvailableV1Schema,Pt as radarResetSourceChangeV2Schema,Ut as radarResetSourceErrorCodeValuesV2,qt as radarResetSourceErrorEnvelopeV2Schema,wn as radarResetSourceErrorHttpStatusV2,Cn as radarResetSourceErrorIsRetryableV2,Kt as radarResetSourceErrorV2Schema,Je as radarResetSourceMaxRpcCallsV2,qr as radarResetSourceTranslationsSchema,gi as radarResetStatisticsResponseV3Schema,mi as radarResetStatisticsV1Schema,pc as radarResetStatisticsV2Schema,nt as radarResetUInt64DecimalV2Schema,at as radarResetUInt64DecimalV2ToBigInt,Di as radarResetUnexecutedActionV1Schema,D as radarResetUtcTimestampV2Schema,Et as radarResetWithdrawnActionItemV2Schema,Oi as radarResetWithdrawnActionV1Schema,qo as radarTiboSourceStatusMaxBytes,Ko as radarTiboSourceStatusPath,Xo as radarTiboSourceStatusSchema,Sr as radarTitledActivityFileSchema,yr as radarTitledActivityProgressSchema,Da as radarWebsiteLegacyChinesePrefix,Ea as radarWebsiteLocalePrefixes,Ta as radarWebsiteLocaleSlugs,wa as radarWebsiteLocales,Ca as radarWebsiteOrigin,Oa as radarWebsitePagePaths,ja as radarWebsitePageUrl,cc as radarWechatDispatchPath,ac as radarWechatDispatchRequestSchema,sc as radarWechatDispatchResponseSchema,oc as radarWechatDispatchResultSchema,lc as radarWechatPrivateDispatchPath,kr as readRadarActivityFile,jr as readRadarActivityFileV2,ga as readRadarActivityFileV3,Rs as readRadarCodexModels,Os as readRadarCodexReleaseDirectory,ks as readRadarCodexReleaseMonth,As as readRadarCodexReleaseNotes,ec as readRadarCommunityTrendingLatest,tc as readRadarCommunityTrendingMonth,as as readRadarResetClueSnapshot,Zo as readRadarTiboSourceStatus,Ar as readRadarTitledActivityFile,po as redactRadarBrowserRegistrationReferences,pi as refineRadarResetStatistics,Sn as toSafeCauseSnapshotV2,Mo as upgradeRadarBrowserSubscriptionCommandV1};
7
+ `),ee=[],p=0;for(let e of n.chunks){if(!j(c,l,p))return M(`source_stream_incomplete`,!0);p+=l.byteLength;let t=_n(c,d,p);if(t<0)return M(`source_stream_incomplete`,!0);let n=gn(c.slice(p,t));if(p=t+d.byteLength,n.get(`content-type`)!==`application/octet-stream`)return M(`source_chunk_mismatch`,!1);let r;try{r=on.decode(un(n.get(`x-radar-reset-action-id-b64`)))}catch(e){return M(`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 M(`source_chunk_mismatch`,!1);if(p+e.byteSize+f.byteLength>c.byteLength)return M(`source_stream_incomplete`,!0);let i=c.slice(p,p+e.byteSize);if(p+=e.byteSize,!j(c,f,p)||(p+=f.byteLength,await dn(i)!==e.sha256))return M(`source_chunk_mismatch`,!1);ee.push({...e,bytes:i})}return!j(c,u,p)||p+u.byteLength!==c.byteLength?M(`source_stream_incomplete`,!0):ee}const yn=/authorization|cookie|token|secret|password|api[-_]?key/iu;function bn(e,t){let n=[...e].slice(0,1024),r=``;for(let e of n){let n=A.encode(e).byteLength;if(n>t.remaining)break;t.remaining-=n,r+=e}return r}function xn(e,t,n,r){if(e===null||typeof e==`boolean`)return e;if(typeof e==`string`)return bn(e,n);if(typeof e==`number`)return Number.isFinite(e)?e:String(e);if(typeof e==`bigint`||typeof e==`symbol`)return bn(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=>xn(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=bn(String(e),n);if(!(a.length===0||Object.hasOwn(i,a))&&(n.remaining-=Math.min(n.remaining,8),i[a]=yn.test(a)?`[REDACTED]`:xn(o,t+1,n,r),n.remaining<=0))break}return i}function Sn(e){let t=xn(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 Cn(e){return e===`source_temporarily_unavailable`||e===`source_rpc_transport_failure`||e===`source_stream_incomplete`}function wn(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 Tn(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:Cn(e.code),correlationId:e.correlationId,cause:Sn(e.cause)}};return qt.parse(t)}const En=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),Dn=e.iso.date(),N=e.strictObject({category:e.enum([`improvement`,`direct_reset`,`reset_card`]),deliveryState:e.enum([`preview`,`landed`]),description:En,dateBasis:e.enum([`occurrence`,`announcement`,`unresolved`]),sourceUrls:e.array(e.url({protocol:/^https?$/})).min(1)}),On=e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),text:En}),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:Dn,endDate:Dn,processing:e.strictObject({hasPending:e.boolean(),hasFailures:e.boolean()}),days:e.array(e.strictObject({date:Dn,dayNumber:e.number().int().min(1).max(28),outcome:e.enum([`unconfirmed`,`improvement`,`reset`,`both`]),entries:e.array(N),summary:On})).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 kn(e){return P.parse(e)}function An(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 jn=524288,Mn=P.shape,Nn=Mn.days.element,Pn=N.extend({date:Mn.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(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`})}),In=Nn.omit({date:!0,entries:!0}).extend({entries:e.array(Pn),lifecycle:Fn}),Ln=e.strictObject({contractVersion:e.literal(2),generatedAt:Mn.generatedAt,timeZone:Mn.timeZone,processing:Mn.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=An(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 Rn(e){return Ln.parse(e)}const zn=jn,F=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),Bn=N.extend({title:F}),Vn=Ln.shape,Hn=Vn.days.element,Un=Hn.shape.entries.element.safeExtend({title:F}),Wn=Hn.extend({title:F.nullable(),entries:e.array(Un)}).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`})}),Gn=e.strictObject({...Vn,contractVersion:e.literal(3),days:e.array(Wn),unassignedEntries:e.array(Un)}).superRefine((e,t)=>{let n=Ln.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 Kn(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 qn(e){return Gn.parse(e)}const Jn=zn,Yn=Ln.shape,Xn=Gn.shape.unassignedEntries,Zn=Yn.days.element.omit({summary:!0}).extend({entries:Xn}),Qn=e.strictObject({...Yn,contractVersion:e.literal(4),days:e.array(Zn).length(28),unassignedEntries:Xn}).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!==An(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function $n(e){return Qn.parse(e)}function er(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 tr(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 nr(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 rr(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 I=[`👍`,`😂`,`🤡`,`💀`,`😭`,`🔥`,`🎉`,`👀`,`🙏`,`🫠`],ir=e.enum(I),L=e.string().min(1).max(128),R=524288,ar=`https://data.radarultra.com/activity/v1/latest.json`,or=`https://data.radarultra.com/activity/v2/latest.json`,sr=N.extend({eventId:L}),cr=P.safeExtend({days:e.array(P.shape.days.element.extend({entries:e.array(sr)})).length(28),undatedEntries:e.array(sr)});function lr(e,t){er([...e.days.flatMap(e=>e.entries),...e.undatedEntries],t)}const ur=cr.superRefine(lr),dr=e.record(ir,e.number().int().nonnegative()),fr=e.strictObject({reactionCounts:dr,reactionTotal:e.number().int().nonnegative()});function pr(e,t){tr(e,t,I)}const mr=sr.extend(fr.shape).superRefine(pr),hr=cr.safeExtend({days:e.array(cr.shape.days.element.extend({entries:e.array(mr)})).length(28),undatedEntries:e.array(mr)}).superRefine(lr),z=e.strictObject({publishedAt:e.iso.datetime(),reactionIds:e.array(ir).length(I.length).refine(e=>new Set(e).size===I.length,`Every reaction must occur exactly once`),progress:hr}),gr=Gn.shape,_r=gr.unassignedEntries.element.safeExtend({eventId:L}),vr=e.strictObject({...gr,days:e.array(gr.days.element.safeExtend({entries:e.array(_r)})).length(28),unassignedEntries:e.array(_r)}),yr=vr.superRefine((e,t)=>{let n=({eventId:e,...t})=>t,r=Gn.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});er([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),br=_r.safeExtend(fr.shape).superRefine(pr),xr=vr.safeExtend({days:e.array(gr.days.element.safeExtend({entries:e.array(br)})).length(28),unassignedEntries:e.array(br)}).superRefine((e,t)=>{let n=({reactionCounts:e,reactionTotal:t,...n})=>n,r=yr.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})}),Sr=z.extend({progress:xr}),Cr=Qn.shape,wr=Cr.unassignedEntries.element.safeExtend({eventId:L}),Tr=Qn.safeExtend({days:e.array(Cr.days.element.safeExtend({entries:e.array(wr)})).length(28),unassignedEntries:e.array(wr)}).superRefine((e,t)=>{er([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),Er=wr.safeExtend(fr.shape).superRefine(pr),Dr=Tr.safeExtend({days:e.array(Cr.days.element.safeExtend({entries:e.array(Er)})).length(28),unassignedEntries:e.array(Er)}),Or=z.extend({progress:Dr});async function kr(e){return nr(e,z,R)}async function Ar(e){return nr(e,Sr,R)}async function jr(e){return nr(e,Or,R)}function Mr(e){return rr(e,z,R)}function Nr(e){return rr(e,Sr,R)}function Pr(e){return rr(e,Or,R)}const Fr=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()}),Ir=e.strictObject({contractVersion:e.literal(1),changes:e.array(Fr),nextCursor:e.string().min(1),hasMore:e.boolean()}),Lr=Fr.extend({dayNumber:P.shape.days.element.shape.dayNumber.nullable()}),Rr=Ir.extend({contractVersion:e.literal(2),changes:e.array(Lr)}),zr=e.int().min(0).max(2**53-1),Br=e.int().min(1).max(28),Vr=e.enum([`yes`,`no`]).nullable(),Hr=e.strictObject({choice:Vr}),Ur=e.strictObject({yes:zr,no:zr,total:zr}).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.`})}),Wr=e.strictObject({dayNumber:Br,state:e.enum([`unopened`,`open`,`closed`]),choice:Vr,outcome:e.enum([`unconfirmed`,`yes`,`no`]),personalResult:e.enum([`none`,`waiting`,`correct`,`incorrect`]),corrected:e.boolean(),counts:Ur}).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.`})}),Gr=e.strictObject({revision:zr,openDayNumber:Br.nullable(),days:e.array(Wr).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.`})}}),Kr=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.`})}),qr=e.strictObject({"zh-Hans":S.shape.noticeTimeline.element.shape.sourceTextZh,"zh-Hant":S.shape.noticeTimeline.element.shape.sourceTextZh,ja:S.shape.noticeTimeline.element.shape.sourceTextZh,ko:S.shape.noticeTimeline.element.shape.sourceTextZh}),Jr=S.shape.noticeTimeline.element.omit({sourceTextZh:!0}).extend({sourceTranslations:qr}).strict(),Yr=e.strictObject({...S.shape,contractVersion:e.literal(2),noticeTimeline:e.array(Jr).min(1).max(i.actionDetail.noticeTimeline)}),Xr=Jr.omit({phase:!0}).extend({kinds:C.shape.noticeTimeline.element.shape.kinds}).strict(),Zr=e.strictObject({...C.shape,noticeTimeline:e.array(Xr).min(1).max(i.actionDetail.noticeTimeline)}),Qr=e=>{let{sourceTranslations:t,...n}=e;return{...n,sourceTextZh:t[`zh-Hans`]}},$r=e=>({...e,contractVersion:1,noticeTimeline:e.noticeTimeline.map(Qr)}),ei=e=>({...e,noticeTimeline:e.noticeTimeline.map(Qr)}),ti=(e,t)=>{for(let n of e.error?.issues??[])t.addIssue({...n})},B=Yr.superRefine((e,t)=>{ti(S.safeParse($r(e)),t)}),V=Zr.superRefine((e,t)=>{ti(C.safeParse(ei(e)),t)}),H=e.strictObject({...Ve.shape,contractVersion:e.literal(2),actions:e.array(B).min(1).max(i.analysis.actions),pendingResetActions:e.array(V).max(i.analysis.actions)}).superRefine((e,t)=>{ti(Ve.safeParse({...e,contractVersion:1,actions:e.actions.map($r),pendingResetActions:e.pendingResetActions.map(ei)}),t),new TextEncoder().encode(JSON.stringify(e)).byteLength>i.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`export_utf8_size_limit_exceeded`,path:[]})}),ni=e=>B.parse(e),ri=e=>V.parse(e),ii=e=>H.parse(e);function ai(e){let t=ii(e);return Ve.parse({...t,contractVersion:1,actions:t.actions.map($r),pendingResetActions:t.pendingResetActions.map(ei)})}const oi=e.object(B.shape).omit({actionScope:!0,reasons:!0}).extend({contractVersion:e.literal(3)}).strict().superRefine((e,n)=>t(e,n,w)),si=H.shape.generatedAt,ci=e.strictObject({resetActionId:S.shape.resetActionId,effect:S.shape.resetEffects.options[0].shape.values.element.nullable(),at:si,basis:e.enum([`execution_confirmation`,`announcement`]),sourceUrl:S.shape.noticeTimeline.element.shape.sourceUrl}),li=e.number().int().nonnegative(),ui=e.number().finite().nonnegative();function U(e,t){try{return w(e,t)}catch{return}}function di(e,t){return e<t?-1:+(e>t)}const fi=e.strictObject({timeBasis:e.literal(`confirmation_priority`),startAt:si,total:li,hardResetCount:li,bankedResetCount:li,unknownCount:li,records:e.array(ci).max(i.analysis.actions*2),intervalSummary:e.strictObject({mean:ui,max:ui}).nullable()});function pi(e,t){let n=(e,n=[])=>t.addIssue({code:`custom`,message:e,path:n}),r={hard_reset:0,banked_reset:0,unknown:0},a=new Set,o=new Map,s=new Set,c=new Set;for(let[t,i]of e.records.entries()){r[i.effect??`unknown`]+=1;let l=JSON.stringify([i.resetActionId,i.effect]);a.has(l)&&n(`statistics_record_identity_duplicate`,[`records`,t]),a.add(l),i.effect===null?s.add(i.resetActionId):c.add(i.resetActionId),U(i.at,e.startAt)===-1&&n(`statistics_record_before_window`,[`records`,t,`at`]);let u=e.records.at(t-1);if(t>0&&u!==void 0){let e=U(u.at,i.at);e!==void 0&&(e>0||e===0&&(di(u.resetActionId,i.resetActionId)>0||u.resetActionId===i.resetActionId&&di(u.effect??``,i.effect??``)>0))&&n(`statistics_records_not_stably_sorted`,[`records`,t])}let d=o.get(i.resetActionId);(d===void 0||U(i.at,d)===-1)&&o.set(i.resetActionId,i.at)}o.size>i.analysis.actions&&n(`statistics_event_limit_exceeded`),[...s].some(e=>c.has(e))&&n(`statistics_event_effect_state_mismatch`),e.total!==e.records.length&&n(`statistics_total_mismatch`,[`total`]),e.hardResetCount!==r.hard_reset&&n(`statistics_hard_reset_count_mismatch`,[`hardResetCount`]),e.bankedResetCount!==r.banked_reset&&n(`statistics_banked_reset_count_mismatch`,[`bankedResetCount`]),e.unknownCount!==r.unknown&&n(`statistics_unknown_count_mismatch`,[`unknownCount`]);let l=[...o.values()].sort((e,t)=>U(e,t)??0),u=l.slice(1).map((e,t)=>Number(((Date.parse(e)-Date.parse(l.at(t)))/864e5).toFixed(6)));if(u.length===0)e.intervalSummary!==null&&n(`statistics_interval_summary_must_be_null`,[`intervalSummary`]);else if(u.every(Number.isFinite)){let t=Number((u.reduce((e,t)=>e+t,0)/u.length).toFixed(6)),r=Math.max(...u);(e.intervalSummary===null||Math.abs(e.intervalSummary.mean-t)>1e-9||Math.abs(e.intervalSummary.max-r)>1e-9)&&n(`statistics_interval_summary_mismatch`,[`intervalSummary`])}}const mi=fi.superRefine(pi),hi=e.object(H.shape).omit({analysis:!0}).extend({contractVersion:e.literal(3),statistics:mi,actions:e.array(oi).min(1).max(i.analysis.actions)}).strict().superRefine((e,t)=>{let n=(e,n=[])=>t.addIssue({code:`custom`,message:e,path:n});new TextEncoder().encode(JSON.stringify(e)).byteLength>i.exportUtf8Bytes&&n(`export_utf8_size_limit_exceeded`);let r=new Map(e.actions.map(e=>[e.resetActionId,e])),a=new Set(e.statistics.records.map(e=>e.resetActionId));r.size!==e.actions.length&&n(`export_action_identity_duplicate`,[`actions`]),new Set(e.pendingResetActions.map(e=>e.resetActionId)).size!==e.pendingResetActions.length&&n(`export_pending_action_identity_duplicate`,[`pendingResetActions`]);for(let[t,r]of e.actions.entries()){let i=e.actions.at(t-1);t>0&&i!==void 0&&si.safeParse(i.firstAnnouncedAt).success&&si.safeParse(r.firstAnnouncedAt).success&&T(i,r)>0&&n(`export_actions_not_stably_sorted`,[`actions`,t]),U(r.firstAnnouncedAt,e.generatedAt)===1&&n(`export_action_after_snapshot`,[`actions`,t,`firstAnnouncedAt`]);let o=U(r.firstAnnouncedAt,e.statistics.startAt);o!==void 0&&o>=0&&!a.has(r.resetActionId)&&n(`export_statistics_window_action_missing`,[`actions`,t,`resetActionId`])}for(let[t,i]of e.statistics.records.entries()){let a=[`statistics`,`records`,t],o=r.get(i.resetActionId);if(o===void 0){n(`export_statistics_action_missing`,a);continue}(o.resetEffects.state===`unknown`!=(i.effect===null)||i.effect!==null&&!o.resetEffects.values.some(e=>e===i.effect))&&n(`export_statistics_effect_mismatch`,[...a,`effect`]);let s=o.noticeTimeline.filter(e=>e.sourceUrl===i.sourceUrl&&U(e.authoredAt,i.at)===0);s.length===0&&n(`export_statistics_source_mismatch`,a),i.basis===`execution_confirmation`&&!s.some(e=>e.phase===`executed`)&&n(`export_statistics_confirmation_source_invalid`,a),i.basis===`announcement`&&U(i.at,o.firstAnnouncedAt)!==0&&n(`export_statistics_announcement_time_mismatch`,a),U(i.at,e.generatedAt)===1&&n(`export_statistics_record_after_snapshot`,[...a,`at`])}}),gi=e.strictObject({contractVersion:e.literal(1),data:e.strictObject({sourceWatermark:re.shape.sourceWatermark,statistics:mi}),meta:e.strictObject({observedAt:si})}),_i=e=>hi.parse(e);function vi(e,t){let n=H.parse(e);return _i({contractVersion:3,generatedAt:n.generatedAt,statistics:t,pendingResetActions:n.pendingResetActions,actions:n.actions.map(({actionScope:e,reasons:t,...n})=>({...n,contractVersion:3}))})}const yi=e=>oi.parse(e),bi=`/api/v1/codex-reset-public-records`,xi=e.array(Xr).min(1).max(i.actionDetail.noticeTimeline),Si=e.strictObject(B.shape).omit({contractVersion:!0,noticeCount:!0,noticeTimeline:!0}).extend({noticeTimeline:xi}).strict();function Ci(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 wi=e=>B.parse(Ci(e));function Ti(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=B.shape.firstAnnouncedAt;r>0&&a!==void 0&&o.safeParse(a.authoredAt).success&&o.safeParse(i.authoredAt).success&&w(a.authoredAt,i.authoredAt)>0&&t.addIssue({code:`custom`,message:`public_notice_timeline_not_ascending`,path:[`noticeTimeline`,r]})}}const Ei=Si.superRefine((e,t)=>{Ti(e.noticeTimeline,t);let n=B.safeParse(Ci(e));for(let e of n.error?.issues??[])t.addIssue({...e})}),Di=e.strictObject(V.shape).omit({state:!0,executedEffects:!0,pendingEffects:!0}).superRefine((e,t)=>{Ti(e.noticeTimeline,t)}),Oi=e.strictObject(B.shape).pick({resetActionId:!0}).extend({lastActiveFirstAnnouncedAt:B.shape.firstAnnouncedAt,withdrawnAt:B.shape.firstAnnouncedAt}).strict(),ki=i.analysis.actions,Ai=e.strictObject({contractVersion:e.literal(1),sourceWatermark:B.shape.resetActionId,generatedAt:B.shape.firstAnnouncedAt,actions:e.array(Ei).min(1).max(ki),pendingResetActions:e.array(V).max(ki),unexecutedResetActions:e.array(Di).max(ki),withdrawnResetActions:e.array(Oi).max(ki)}).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)Ti(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=B.shape.firstAnnouncedAt;n>0&&i!==void 0&&a.safeParse(i.firstAnnouncedAt).success&&a.safeParse(r.firstAnnouncedAt).success&&T(i,r)>=0&&t.addIssue({code:`custom`,message:`public_reset_actions_not_ascending`,path:[`actions`,n]})}new TextEncoder().encode(JSON.stringify(e)).byteLength>i.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`public_reset_records_utf8_size_limit_exceeded`})}),ji=B.shape,Mi=e.strictObject({title:e.string(),body:e.string()}),Ni=e.strictObject({zh:Mi,en:Mi}),Pi=e.enum([`end_preview`,`restore_preview`,`set_auto_notification`,`notify`,`confirm`]),Fi=e.strictObject({resetActionId:ji.resetActionId,operation:Pi,expectedRevision:e.int().nonnegative(),copy:Ni.nullable(),automaticNotification:e.boolean().nullable(),executedAt:D.nullable().optional()}).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`}),e.operation!==`notify`&&e.operation!==`confirm`&&e.executedAt!=null&&t.addIssue({code:`custom`,path:[`executedAt`],message:`execution_time_operation_mismatch`})}),Ii=Fi.superRefine((e,t)=>{(e.operation===`notify`||e.operation===`confirm`)&&e.executedAt==null&&t.addIssue({code:`custom`,path:[`executedAt`],message:`execution_time_required`})}),Li=Fi,Ri=e.strictObject({digest:e.string().regex(/^sha256:[a-f0-9]{64}$/),sourceWatermark:e.string().min(1),draft:Ii}),zi=e.strictObject({operationId:e.uuid(),preview:Ri}),Bi=e.strictObject({resetActionId:ji.resetActionId,revision:e.number().int().nonnegative(),state:e.enum([`preview`,`executed`,`cancelled`,`undetermined`]),firstAnnouncedAt:D.nullable(),officialConfirmed:e.boolean(),pendingPreview:e.boolean(),previewClosed:e.boolean(),automaticNotification:e.boolean(),sourceUrls:e.array(ji.noticeTimeline.element.shape.sourceUrl),availableOperations:e.array(Pi),notificationOperationId:e.uuid().nullable()}),Vi=e.strictObject({actions:e.array(Bi)}),Hi=e.discriminatedUnion(`status`,[e.strictObject({status:e.literal(`unknown`),operationId:e.uuid()}),e.strictObject({status:e.literal(`saved`),operationId:e.uuid(),resetActionId:ji.resetActionId,operation:Pi,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()})})]),Ui=S.shape.noticeTimeline.element.shape,Wi=e.enum([`initial`,`supplement`,`correction`]).nullable(),Gi=e.strictObject({authoredAt:Ui.authoredAt,role:Wi,sourceUrl:Ui.sourceUrl,sourceText:Ui.sourceText,sourceTextZh:Ui.sourceTextZh}),Ki=e.array(Gi).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),!Ui.authoredAt.safeParse(a.authoredAt).success){r=void 0;continue}if(r!==void 0){let e=w(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}}),qi=Jn,Ji=N.omit({description:!0}).extend({category:e.literal(`improvement`),title:F,posts:Ki}),Yi=N.extend({category:e.enum([`direct_reset`,`reset_card`]),title:F}),Xi=e.discriminatedUnion(`category`,[Ji,Yi]),Zi=Qn.shape,Qi=Zi.unassignedEntries.element.shape.date;function $i(e,t){e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}const ea=e.discriminatedUnion(`category`,[Ji.extend({date:Qi}).superRefine($i),Yi.extend({date:Qi}).superRefine($i)]),ta=e.strictObject({...Zi,contractVersion:e.literal(5),days:e.array(Zi.days.element.extend({entries:e.array(ea)})).length(28),unassignedEntries:e.array(ea)}).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!==An(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function na(e){return ta.parse(e)}const ra=`https://data.radarultra.com/activity/v3/latest.json`,ia=ta.shape,[aa,oa]=ia.unassignedEntries.element.options,sa=aa.safeExtend({eventId:L}),ca=oa.safeExtend({eventId:L}),la=e.discriminatedUnion(`category`,[sa,ca]),ua=ta.safeExtend({days:e.array(ia.days.element.extend({entries:e.array(la)})).length(28),unassignedEntries:e.array(la)}).superRefine((e,t)=>{er([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),da={reactionCounts:dr,reactionTotal:e.number().int().nonnegative()},fa=(e,t)=>tr(e,t,I),pa=e.discriminatedUnion(`category`,[sa.safeExtend(da).superRefine(fa),ca.safeExtend(da).superRefine(fa)]),ma=ua.safeExtend({days:e.array(ia.days.element.extend({entries:e.array(pa)})).length(28),unassignedEntries:e.array(pa)}),ha=z.extend({progress:ma});async function ga(e){return nr(e,ha,R)}function _a(e){return rr(e,ha,R)}const va=e.discriminatedUnion(`category`,[Ji,N.extend({category:e.enum([`direct_reset`,`reset_card`])})]),ya=Lr.extend({entry:va}),ba=Rr.extend({contractVersion:e.literal(3),changes:e.array(ya)});function xa(e){return ya.parse(e)}function Sa(e){return ba.parse(e)}const Ca=`https://radarultra.com`,wa=[`zh-Hans`,`zh-Hant`,`en`,`ja`,`ko`],Ta={"zh-Hans":`zh-hans`,"zh-Hant":`zh-hant`,en:`en`,ja:`ja`,ko:`ko`},Ea={"zh-Hans":`/${Ta[`zh-Hans`]}`,"zh-Hant":`/${Ta[`zh-Hant`]}`,en:``,ja:`/${Ta.ja}`,ko:`/${Ta.ko}`},Da=`/zh`,Oa={reset:`/codex`,improvement:`/codex/28-day-challenge`,changelog:`/codex/changelog`,models:`/codex/models`,community:`/codex/community`},ka=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}$/)})]),Aa=e.string().regex(/^(?!\.{1,2}$)[a-z0-9.-]+$/);function ja(e,t){return Ca+Ea[t]+Oa[e]}function Ma(e,t){let n=t===`zh-Hans`?`/zh`:Ea[t];return Ca+n+Oa[e]}function Na(e,t,n){let r=ka.parse({product:e,version:t});return`${ja(`changelog`,n)}/${r.product}/${r.version}`}function Pa(e,t){return`${ja(`models`,t)}/${Aa.parse(e)}`}const Fa=Object.freeze({timeZone:`America/Los_Angeles`,startDate:`2026-10-05`,endDate:`2026-11-01`}),Ia=Date.parse(`${Fa.startDate}T00:00:00Z`),La=(Date.parse(`${Fa.endDate}T00:00:00Z`)-Ia)/864e5+1,Ra=new Intl.DateTimeFormat(`en-CA`,{timeZone:Fa.timeZone,year:`numeric`,month:`2-digit`,day:`2-digit`});function za(e){let t=Ra.formatToParts(e),n=e=>Number(t.find(t=>t.type===e).value),r=(Date.UTC(n(`year`),n(`month`)-1,n(`day`))-Ia)/864e5,i=r<0?`before`:r>=La?`ended`:`live`,a=Math.min(La,Math.max(1,r+1));return{phase:i,today:a,ongoingDay:i===`live`?a:null}}const Ba=e.enum([`reset`,`improvement`]),Va=e.array(Ba).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),Ha=e=>new Set(wa.flatMap(t=>[ja(e,t),Ma(e,t)])),Ua={reset:Ha(`reset`),improvement:Ha(`improvement`)},Wa=t=>e.url().refine(e=>Ua[t].has(e),`notification_target_url_invalid`),Ga=e.url().refine(e=>Object.values(Ua).some(t=>t.has(e)),`notification_target_not_owned`),Ka=e.discriminatedUnion(`kind`,[e.object({kind:e.literal(`reset`),webUrl:Wa(`reset`),miniPath:e.literal(`pages/index/index`)}).strict(),e.object({kind:e.literal(`improvement`),webUrl:Wa(`improvement`),miniPath:e.literal(`pages/index/index?page=challenge`)}).strict()]),qa=e.object({topics:Va,target:Ka}).strict().refine(e=>e.topics.includes(e.target.kind),`notification_target_topic_mismatch`),Ja=e.enum([`reset`,`improvement`,`clue`]),Ya=e.object({topics:e.array(Ja).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),target:Ka}).strict().refine(e=>e.topics.some(t=>(t===`clue`?`reset`:t)===e.target.kind),`notification_target_topic_mismatch`);function Xa(e,t){let n=Za(e===`clue`?`reset`:e,t);return Ya.parse({...n,topics:[e],target:{...n.target,webUrl:Ma(n.target.kind,t)}})}function Za(e,t){return qa.parse({topics:[e],target:{kind:e,webUrl:ja(e,t),miniPath:e===`reset`?`pages/index/index`:`pages/index/index?page=challenge`}})}const Qa=e.object({notificationId:e.uuid(),eventId:e.uuid(),title:e.string().trim().min(1).max(512),createdAt:e.iso.datetime(),deliverBy:e.iso.datetime(),...qa.shape}).strict().superRefine((e,t)=>{e.topics.includes(e.target.kind)||t.addIssue({code:`custom`,message:`notification_target_topic_mismatch`}),w(e.deliverBy,e.createdAt)<=0&&t.addIssue({code:`custom`,message:`notification_task_deadline_invalid`})});function $a(e,t){return w(e.createdAt,t.createdAt)||(e.notificationId<t.notificationId?-1:+(e.notificationId>t.notificationId))}const eo=`/api/v1/notification-tasks`,to=100,no=e.string().min(1).max(8192),ro=e.object({cursor:no.optional()}).strict(),io=e.object({contractVersion:e.literal(1),roundCursor:no,notifications:e.array(Qa).max(100),nextCursor:no.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++)$a(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`})}),ao=`/api/browser-notifications`,oo=e.string().min(1).max(128),so=e.uuid(),co=e.enum(wa),lo=e.strictObject({reset:e.boolean(),improvement:e.boolean()}),uo=`[cdef][\\w-]{21}`,fo=e.strictObject({fid:e.string().regex(RegExp(`^${uo}$`))});function po(e){return e.replace(RegExp(`(^|[^\\w-])${uo}(?![\\w-])`,`g`),`$1[registration]`)}const W={operationId:so,expectedRevision:oo},mo=e.discriminatedUnion(`action`,[e.strictObject({...W,action:e.literal(`register`),topics:lo.refine(e=>e.reset||e.improvement,`subscription_topic_required`),locale:co,registration:fo}),e.strictObject({...W,action:e.literal(`set_topics`),topics:lo}),e.strictObject({...W,action:e.literal(`set_locale`),locale:co}),e.strictObject({...W,action:e.literal(`restore`),registration:fo}),e.strictObject({...W,action:e.literal(`retry`)}),e.strictObject({...W,action:e.literal(`cancel`)})]),ho=e.strictObject({operationId:so.optional(),expectedRevision:oo.optional()}).refine(e=>e.operationId===void 0==(e.expectedRevision===void 0),`subscription_operation_reference_incomplete`),go=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:so.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())}),_o=e.strictObject({id:so,state:e.enum([`pending`,`applied`,`rejected`,`unknown`,`superseded`,`not_found`]),error:go.optional()}),vo=e.strictObject({topicSettings:e.strictObject({state:e.enum([`initial`,`saved`]),revision:oo,topics:lo,locale:co.nullable()}),registrationState:e.enum([`none`,`ready`,`invalid`,`changing`]),registrationKey:e.string().regex(/^[a-f0-9]{64}$/).nullable(),manualRetryRequired:e.boolean(),operation:_o.nullable()});function yo(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 bo=e.strictObject({data:vo}),xo=e.strictObject({error:go});function So(e){return{topicSettings:{state:`initial`,revision:e,topics:{reset:!0,improvement:!1},locale:null},registrationState:`none`,registrationKey:null,manualRetryRequired:!1,operation:null}}const Co=lo.extend({clue:e.boolean().default(!1)}),[wo,To,...Eo]=mo.options,Do=e.discriminatedUnion(`action`,[wo.extend({topics:Co.refine(e=>Object.values(e).some(Boolean),`subscription_topic_required`)}),To.extend({topics:Co}),...Eo]),Oo=vo.extend({topicSettings:vo.shape.topicSettings.extend({topics:Co})}),ko=e.strictObject({data:Oo});function Ao(e){return Oo.parse(So(e))}function jo(e){let{clue:t,...n}=e.topicSettings.topics;return vo.parse({...e,topicSettings:{...e.topicSettings,topics:n}})}function Mo(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 No=20,Po=2*1024*1024,Fo=`/api/v1/improvements`,Io=e.string().min(1).max(1024),[Lo]=ua.shape.unassignedEntries.element.options,Ro=Lo.safeExtend({date:e.iso.date().refine(e=>e>Fa.endDate,`improvement_must_follow_campaign`)}),zo=e.strictObject({}),Bo=e.strictObject({challengeEnded:e.boolean(),observedAt:e.iso.datetime()}),Vo=e.strictObject({cursor:Io.nullable(),limit:e.literal(20)}),Ho=Bo.extend({entries:e.array(Ro).max(20),nextCursor:Io.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`})}),Uo=e.strictObject({eventIds:e.array(L).min(1).max(128)}),Wo=e.strictObject({eventIds:e.array(L).max(128)}),Go=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())})}),Ko=`/tibo-source/v1/latest.json`,qo=512*1024,Jo=e.iso.datetime({offset:!0}),Yo=S.shape.noticeTimeline.element,Xo=e.strictObject({contractVersion:e.literal(1),observedAt:Jo,check:e.strictObject({checkedAt:Jo,freshUntil:Jo,active:e.boolean()}).nullable(),latestPost:e.strictObject({authoredAt:Jo,sourceUrl:Yo.shape.sourceUrl,sourceText:e.string(),sourceTranslations:qr,resetRelevance:e.enum([`related`,`unrelated`,`unknown`])}).nullable()});async function Zo(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 Xo.parse(JSON.parse(o))}const Qo=`/reset-clue/v1/latest.json`,$o=4320*60*1e3,es=i.exportUtf8Bytes,ts=B.shape.noticeTimeline.element.pick({authoredAt:!0,sourceUrl:!0,sourceText:!0,sourceTranslations:!0,contentCompleteness:!0}).extend({plannedTiming:Le.nullable(),expiresAt:B.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`]})}),ns=e.strictObject({contractVersion:e.literal(1),clue:ts.nullable()}),rs=e=>ns.parse(e);function is(e,t){return e.clue!==null&&t.getTime()<Date.parse(e.clue.expiresAt)?e.clue:null}async function as(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>es)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 rs(JSON.parse(o))}const G=e.enum(wa),K=e.string().regex(/^\d{4}-(?:0[1-9]|1[0-2])$/),q=e.string().trim().min(1),os=e.url({protocol:/^https$/}),J=e.discriminatedUnion(`kind`,[e.strictObject({kind:e.literal(`instant`),at:e.iso.datetime()}),e.strictObject({kind:e.literal(`date`),date:e.iso.date()})]),ss=e.strictObject({operation:q,stage:q,cause:Gt});function cs(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:ss})])}function Y(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 X(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 ls=`/codex-releases/v2/directory.json`,us=128*1024,ds=128*1024,fs=256*1024,ps=J,ms={product:e.enum([`app`,`cli`]),version:q,published:J,month:K,revision:q},hs=e.strictObject(ms).superRefine(gs);function gs(e,t){let n=ka.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 _s(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 vs=Y(e.strictObject({contractVersion:e.literal(2),releases:e.array(hs),latest:e.strictObject({app:e.string().nullable(),cli:e.string().nullable()})}).superRefine((e,t)=>{_s(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`})}}),us),ys=e.strictObject({state:e.literal(`not_applicable`),reason:e.literal(`no_curated_notes`)}),bs=e.union([cs(e.strictObject({locale:G,points:e.array(q).min(1).max(5)})),ys]),xs=e.strictObject({...ms,source:e.strictObject({kind:e.enum([`github`,`official`]),url:os}),summary:bs,notesCount:e.number().int().nonnegative()}).superRefine((e,t)=>{gs(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`})}),Ss=Y(e.strictObject({contractVersion:e.literal(2),locale:G,month:K,releases:e.array(xs)}).superRefine((e,t)=>{_s(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`})}),ds),Cs=e.array(e.strictObject({title:q.nullable(),items:e.array(e.strictObject({text:q,refs:q.nullable()})).min(1)})).min(1),ws=Y(e.strictObject({contractVersion:e.literal(2),product:e.enum([`app`,`cli`]),version:q,revision:q,locale:G,original:e.array(Cs.element),translation:e.union([cs(Cs),ys]).nullable()}).superRefine((e,t)=>{let n=ka.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`})}}),fs),Ts=e=>vs.parse(e),Es=e=>Ss.parse(e),Ds=e=>ws.parse(e),Os=e=>X(e,`codex_release_directory`,us,vs),ks=e=>X(e,`codex_release_month`,ds,Ss),As=e=>X(e,`codex_release_notes`,fs,ws);function js(e,t){return`/codex-releases/v2/${G.parse(e)}/${K.parse(t)}.json`}function Ms(e,t,n){let r=ka.parse({product:t,version:n});return`/codex-releases/v2/${G.parse(e)}/notes/${r.product}/${r.version}.json`}const Ns=128*1024;function Z(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`known`),value:t,source:os}),e.strictObject({state:e.literal(`unavailable`),reason:e.enum([`not_announced`,`not_listed`]),source:os.nullable()})])}const Ps=e.strictObject({input:q,cached:q,output:q}),Fs=e.strictObject({modelId:Aa,name:q,group:e.enum([`current`,`retired`]),status:e.enum([`available`,`retiring`,`retired`]),launched:Z(J),chatgptRetirement:Z(J),apiRetirement:Z(J),credits:Z(Ps),apiPrice:Z(Ps),multiple:e.string().regex(/^(?:0|[1-9]\d*)(?:\.\d+)?$/).refine(e=>Number.isFinite(Number(e))&&Number(e)>0).nullable(),plans:Z(e.array(q).min(1)),surfaces:Z(e.array(q).min(1)),about:cs(e.strictObject({locale:G,paragraphs:e.array(q).min(1)})),sources:e.array(e.strictObject({label:q,url:os})).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`})}),Is=Y(e.strictObject({contractVersion:e.literal(1),locale:G,models:e.array(Fs),multipleBase:e.strictObject({modelId:Aa,name:q}).nullable(),upcomingRetirement:e.strictObject({names:q,modelIds:e.array(Aa).min(1),surface:e.enum([`api`,`chatgpt`]),at:J}).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`})}}}),Ns),Ls=e=>Is.parse(e),Rs=e=>X(e,`codex_models`,Ns,Is),zs=e=>`/codex-models/v1/${G.parse(e)}.json`,Bs=256*1024,Vs=512*1024,Hs=3600*1e3,Q=e.string().regex(/^[a-z][a-z0-9-]{0,63}$/),Us=e.enum([`x`,`hn`,`github`,`v2ex`,`reddit`,`linuxdo`]),Ws=e.enum([`debate`,`tip`,`showcase`,`comparison`,`news`]),$=e.string().trim().min(1),Gs=e.strictObject({id:$,topic:Q,platform:Us,kind:Ws,url:os,author:e.strictObject({name:$,handle:$.nullable()}),venue:$.nullable(),title:$.nullable(),summary:e.strictObject({zh:$.max(600),en:$.max(600)}),authoredAt:e.iso.datetime(),heat:e.strictObject({metrics:e.array(e.strictObject({kind:e.enum([`likes`,`points`,`comments`,`reactions`,`replies`]),value:e.number().int().nonnegative()})).min(1),ratio:e.number().finite().nonnegative()}).nullable()}).superRefine((e,t)=>{(!e.id.startsWith(`${e.platform}:`)||e.id.length<=e.platform.length+1)&&t.addIssue({code:`custom`,path:[`id`],message:`entry_platform_identity_mismatch`})});function Ks(e,t){let n=new Set,r=1/0;for(let[i,a]of e.entries.entries()){n.has(a.id)&&t.addIssue({code:`custom`,path:[`entries`,i],message:`duplicate_entry`}),n.add(a.id),a.topic!==e.topic&&t.addIssue({code:`custom`,path:[`entries`,i],message:`entry_topic_mismatch`});let o=Date.parse(a.authoredAt);o>r&&t.addIssue({code:`custom`,path:[`entries`,i],message:`entry_order_mismatch`}),r=o}}const qs=e.strictObject({id:$,platform:Us,label:$,lastSuccessAt:e.iso.datetime().nullable()}),Js=Y(e.strictObject({contractVersion:e.literal(1),topic:Q,generatedAt:e.iso.datetime(),overview:e.strictObject({weekCount:e.number().int().nonnegative(),debateCount:e.number().int().nonnegative(),hottestId:$.nullable()}),sources:e.array(qs),coverage:e.strictObject({from:e.iso.date(),months:e.array(K)}),entries:e.array(Gs)}).superRefine((e,t)=>{Ks(e,t);let n=Date.parse(e.generatedAt),r=e.entries.filter(e=>Date.parse(e.authoredAt)>=n-7*864e5),i=[...r].sort(nc).at(0)?.id??null;(e.overview.weekCount!==r.length||e.overview.debateCount!==r.filter(e=>e.kind===`debate`).length||e.overview.hottestId!==i)&&t.addIssue({code:`custom`,path:[`overview`],message:`overview_entries_mismatch`}),new Set(e.sources.map(e=>e.id)).size!==e.sources.length&&t.addIssue({code:`custom`,path:[`sources`],message:`duplicate_source`}),(new Set(e.coverage.months).size!==e.coverage.months.length||e.coverage.months.some((t,n)=>n>0&&t>=e.coverage.months.at(n-1)))&&t.addIssue({code:`custom`,path:[`coverage`],message:`coverage_order_mismatch`});for(let r of e.entries){let i=Date.parse(r.authoredAt);(i>n||i<n-30*864e5||!e.coverage.months.includes(r.authoredAt.slice(0,7))||r.authoredAt.slice(0,10)<e.coverage.from)&&t.addIssue({code:`custom`,path:[`entries`],message:`entry_coverage_mismatch`})}}),Bs),Ys=Y(e.strictObject({contractVersion:e.literal(1),topic:Q,month:K,entries:e.array(Gs)}).superRefine((e,t)=>{Ks(e,t),e.entries.some(t=>t.authoredAt.slice(0,7)!==e.month)&&t.addIssue({code:`custom`,path:[`entries`],message:`entry_month_mismatch`})}),Vs),Xs=e=>`/community-trending/v1/${Q.parse(e)}/latest.json`,Zs=(e,t)=>`/community-trending/v1/${Q.parse(e)}/${K.parse(t)}.json`,Qs=e=>Js.parse(e),$s=e=>Ys.parse(e),ec=e=>X(e,`community_trending_latest`,Bs,Js),tc=e=>X(e,`community_trending_month`,Vs,Ys);function nc(e,t){return e.heat===null&&t.heat!==null?1:e.heat!==null&&t.heat===null?-1:(t.heat?.ratio??0)-(e.heat?.ratio??0)||t.authoredAt.localeCompare(e.authoredAt)||e.id.localeCompare(t.id)}const rc=(e,t)=>e.summary[t===`zh-Hans`?`zh`:`en`],ic=e.object({revision:e.string().min(1).max(160),digest:e.string().regex(/^[a-f0-9]{64}$/)}).strict(),ac=e.discriminatedUnion(`kind`,[e.object({publicationId:e.string().min(1).max(160),kind:e.literal(`content`),sources:e.object({"reset-v1":ic,"reset-v2":ic,"reset-v3":ic,"reset-v4":ic.optional()}).strict()}).strict(),e.object({publicationId:e.string().min(1).max(160),kind:e.literal(`reset-clue`),sources:e.object({"reset-clue":ic}).strict()}).strict()]),oc=e.object({resource:e.enum([`content-v1`,`content-v2`,`content-v3`,`content-v4`,`reset-clue`]),sourceRevision:e.string().min(1).max(160),sourceDigest:e.string().regex(/^[a-f0-9]{64}$/),targetVersion:e.iso.datetime().nullable(),targetDigest:e.string().regex(/^[a-f0-9]{64}$/).nullable(),outcome:e.enum([`published`,`unchanged`,`busy`,`superseded`,`failed`]),error:e.object({operation:e.string().min(1),stage:e.string().min(1),code:e.string().min(1),summary:e.string().min(1),correlationId:e.string().min(1),cause:e.unknown(),upstreamStatus:e.number().int().optional(),upstreamCode:e.string().optional()}).strict().optional()}).strict().superRefine((e,t)=>{(e.outcome===`published`||e.outcome===`unchanged`)&&(e.targetVersion===null||e.targetDigest===null)&&t.addIssue({code:`custom`,message:`completed publication requires a target receipt`}),e.outcome===`failed`&&e.error===void 0&&t.addIssue({code:`custom`,message:`failed publication requires a cause`})}),sc=e.object({publicationId:e.string().min(1).max(160),results:e.array(oc).min(1).max(4)}).strict().superRefine((e,t)=>{new Set(e.results.map(e=>e.resource)).size!==e.results.length&&t.addIssue({code:`custom`,message:`duplicate resource`})}),cc=`/api/v1/internal/publications/wechat/dispatch`,lc=`/__radar/wechat-publication/dispatch`,uc=hi.shape.generatedAt,dc=mi.shape.records.element,fc=e.strictObject({id:e.string().min(1),resetActionId:dc.shape.resetActionId,at:uc,effects:e.array(dc.shape.effect).min(1).max(2),source:e.discriminatedUnion(`kind`,[e.strictObject({kind:e.literal(`official_post`),sourceUrl:dc.shape.sourceUrl}),e.strictObject({kind:e.literal(`manual`),officialConfirmationMissing:e.boolean()})])}),pc=e.strictObject(mi.shape).extend({records:e.array(e.strictObject(dc.shape).extend({sourceUrl:dc.shape.sourceUrl.nullable(),confirmationId:e.string().min(1).nullable()})).max(i.analysis.actions*2)}).superRefine((e,t)=>{pi(e,t);for(let[n,r]of e.records.entries())r.basis===`execution_confirmation`!=(r.confirmationId!==null)&&t.addIssue({code:`custom`,message:`statistics_confirmation_identity_mismatch`,path:[`records`,n]}),r.basis===`announcement`&&r.sourceUrl===null&&t.addIssue({code:`custom`,message:`statistics_announcement_source_missing`,path:[`records`,n]})}),mc=e.strictObject({sourceWatermark:re.shape.sourceWatermark,confirmations:e.array(fc),statistics:pc}),hc=e.strictObject(hi.shape).extend({contractVersion:e.literal(4),statistics:pc,confirmations:e.array(fc)}).superRefine((e,t)=>{let n=e=>t.addIssue({code:`custom`,message:e});new TextEncoder().encode(JSON.stringify(e)).byteLength>i.exportUtf8Bytes&&n(`export_utf8_size_limit_exceeded`);let r=new Map(e.confirmations.map(e=>[e.id,e])),a=new Map(e.actions.map(e=>[e.resetActionId,e]));a.size!==e.actions.length&&n(`export_action_identity_duplicate`),new Set(e.pendingResetActions.map(e=>e.resetActionId)).size!==e.pendingResetActions.length&&n(`export_pending_action_identity_duplicate`);let o=new Set(e.statistics.records.map(e=>e.resetActionId));for(let[t,r]of e.actions.entries()){Date.parse(r.firstAnnouncedAt)>Date.parse(e.generatedAt)&&n(`export_action_after_snapshot`);let i=e.actions.at(t-1);t>0&&i!==void 0&&uc.safeParse(i.firstAnnouncedAt).success&&uc.safeParse(r.firstAnnouncedAt).success&&T(i,r)>0&&n(`export_actions_not_stably_sorted`),Date.parse(r.firstAnnouncedAt)>=Date.parse(e.statistics.startAt)&&!o.has(r.resetActionId)&&n(`export_statistics_window_action_missing`)}r.size!==e.confirmations.length&&t.addIssue({code:`custom`,message:`confirmation_identity_duplicate`});for(let r of e.confirmations){let i=a.get(r.resetActionId);(i===void 0||Date.parse(r.at)>Date.parse(e.generatedAt))&&t.addIssue({code:`custom`,message:`confirmation_action_or_time_invalid`}),(new Set(r.effects).size!==r.effects.length||r.effects.some(e=>i!==void 0&&(e===null!=(i.resetEffects.state===`unknown`)||e!==null&&!i.resetEffects.values.some(t=>t===e))))&&n(`confirmation_effect_mismatch`);let o=r.source;o.kind===`official_post`&&!i?.noticeTimeline.some(e=>e.phase===`executed`&&e.sourceUrl===o.sourceUrl&&e.authoredAt===r.at)&&t.addIssue({code:`custom`,message:`confirmation_official_source_invalid`})}for(let i of e.statistics.records){let o=a.get(i.resetActionId),s=i.confirmationId===null?void 0:r.get(i.confirmationId);Date.parse(i.at)>Date.parse(e.generatedAt)&&n(`export_statistics_record_after_snapshot`),o!==void 0&&(o.resetEffects.state===`unknown`!=(i.effect===null)||i.effect!==null&&!o.resetEffects.values.some(e=>e===i.effect))&&n(`export_statistics_effect_mismatch`),(o===void 0||i.confirmationId!==null&&(s===void 0||s.resetActionId!==i.resetActionId||s.at!==i.at||!s.effects.includes(i.effect)))&&t.addIssue({code:`custom`,message:`statistics_confirmation_missing_or_mismatched`}),s!==void 0&&i.sourceUrl!==(s.source.kind===`official_post`?s.source.sourceUrl:null)&&n(`statistics_confirmation_source_mismatch`),i.basis===`announcement`&&!o?.noticeTimeline.some(e=>e.sourceUrl===i.sourceUrl&&e.authoredAt===i.at&&o.firstAnnouncedAt===i.at)&&t.addIssue({code:`custom`,message:`statistics_announcement_source_invalid`})}}),gc=e=>hc.parse(e);export{an as RadarResetSourceContractErrorV2,is as activeRadarResetClue,nc as compareRadarCommunityTrendingEntries,$a as compareRadarNotificationTasks,T as compareRadarResetActionDetailsV1,w as compareRadarResetUtcTimestampsV1,Xa as createRadarBrowserNotificationProjection,za as createRadarCodexProgressCalendar,Za as createRadarNotificationProjection,Tn as createRadarResetSourceErrorEnvelopeV2,Mr as encodeRadarActivityFile,Pr as encodeRadarActivityFileV2,_a as encodeRadarActivityFileV3,pn as encodeRadarResetDetailMultipartV2,Nr as encodeRadarTitledActivityFile,st as formatRadarResetPositiveDecimalV2,ot as formatRadarResetUInt64DecimalV2,So as initialRadarBrowserSubscription,Ao as initialRadarBrowserSubscriptionV2,Ls as parseRadarCodexModels,xa as parseRadarCodexProgressChangeV3,Sa as parseRadarCodexProgressChangesV3,kn as parseRadarCodexProgressV1,Rn as parseRadarCodexProgressV2,qn as parseRadarCodexProgressV3,$n as parseRadarCodexProgressV4,na as parseRadarCodexProgressV5,Ts as parseRadarCodexReleaseDirectory,Es as parseRadarCodexReleaseMonth,Ds as parseRadarCodexReleaseNotes,Qs as parseRadarCommunityTrendingLatest,$s as parseRadarCommunityTrendingMonth,Ue as parseRadarResetActionDetailV1,ni as parseRadarResetActionDetailV2,yi as parseRadarResetActionDetailV3,bt as parseRadarResetActionSummaryV2,He as parseRadarResetAnalysisV1,rs as parseRadarResetClueSnapshot,vn as parseRadarResetDetailMultipartV2,We as parseRadarResetExportV1,ii as parseRadarResetExportV2,_i as parseRadarResetExportV3,gc as parseRadarResetExportV4,Ge as parseRadarResetPendingActionV1,ri as parseRadarResetPendingActionV2,it 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,ie as parseRadarResetSnapshotAvailableV1,nn as parseRadarResetSourceErrorEnvelopeV2,rt as parseRadarResetUInt64DecimalV2,yo as projectRadarBrowserSubscriptionSelection,jo as projectRadarBrowserSubscriptionV1,ai as projectRadarResetExportV1FromV2,vi as projectRadarResetExportV3FromV2,Ke as projectRadarResetPrimarySourceV1,wi as projectRadarResetPublicActionToV2,L as radarActivityEventIdSchema,z as radarActivityFileSchema,ar as radarActivityFileUrl,Or as radarActivityFileV2Schema,or as radarActivityFileV2Url,ha as radarActivityFileV3Schema,ra as radarActivityFileV3Url,R as radarActivityMaxBytes,ur as radarActivityProgressSchema,Tr as radarActivityProgressV2Schema,ua as radarActivityProgressV3Schema,dr as radarActivityReactionCountsSchema,ir as radarActivityReactionIdSchema,I as radarActivityReactionIds,Ma as radarBrowserNotificationPageUrl,Ya as radarBrowserNotificationProjectionSchema,Ga as radarBrowserNotificationTargetUrlSchema,Ja as radarBrowserNotificationTopicSchema,fo as radarBrowserRegistrationSchema,xo as radarBrowserSubscriptionErrorRes,go as radarBrowserSubscriptionFailureSchema,_o as radarBrowserSubscriptionOperationSchema,ho as radarBrowserSubscriptionReadReq,bo as radarBrowserSubscriptionRes,mo as radarBrowserSubscriptionSaveReq,Do as radarBrowserSubscriptionSaveV2Req,ko as radarBrowserSubscriptionV2Res,vo as radarBrowserSubscriptionViewSchema,Oo as radarBrowserSubscriptionViewV2Schema,ao as radarBrowserSubscriptionsPath,lo as radarBrowserTopicsSchema,Co as radarBrowserTopicsV2Schema,Vr as radarCodexGuessChoiceSchema,Kr as radarCodexGuessErrorSchema,Hr as radarCodexGuessSaveReqSchema,Gr as radarCodexGuessViewSchema,Aa as radarCodexModelIdSchema,Pa as radarCodexModelUrl,Ns as radarCodexModelsMaxBytes,zs as radarCodexModelsPath,Is as radarCodexModelsSchema,Fa as radarCodexProgressCalendar,Fr as radarCodexProgressChangeSchema,Lr as radarCodexProgressChangeV2Schema,ya as radarCodexProgressChangeV3Schema,Ir as radarCodexProgressChangesV1Schema,Rr as radarCodexProgressChangesV2Schema,ba as radarCodexProgressChangesV3Schema,N as radarCodexProgressEntrySchema,Bn as radarCodexProgressEntryV3Schema,Xi as radarCodexProgressEntryV5Schema,Ji as radarCodexProgressImprovementV5Schema,Wi as radarCodexProgressPostRoleV5Schema,Gi as radarCodexProgressPostV5Schema,Ki as radarCodexProgressPostsV5Schema,Yi as radarCodexProgressResetEntryV5Schema,Kn as radarCodexProgressScore,F as radarCodexProgressTitleV3Schema,P as radarCodexProgressV1Schema,jn as radarCodexProgressV2MaxBytes,Ln as radarCodexProgressV2Schema,zn as radarCodexProgressV3MaxBytes,Gn as radarCodexProgressV3Schema,Jn as radarCodexProgressV4MaxBytes,Qn as radarCodexProgressV4Schema,qi as radarCodexProgressV5MaxBytes,ta as radarCodexProgressV5Schema,us as radarCodexReleaseDirectoryMaxBytes,ls as radarCodexReleaseDirectoryPath,vs as radarCodexReleaseDirectorySchema,ka as radarCodexReleaseIdentitySchema,ds as radarCodexReleaseMonthMaxBytes,js as radarCodexReleaseMonthPath,Ss as radarCodexReleaseMonthSchema,fs as radarCodexReleaseNotesMaxBytes,Ms as radarCodexReleaseNotesPath,ws as radarCodexReleaseNotesSchema,Cs as radarCodexReleaseSectionsSchema,Na as radarCodexReleaseUrl,ps as radarCodexTimePointSchema,Gs as radarCommunityTrendingEntrySchema,Ws as radarCommunityTrendingKindSchema,Bs as radarCommunityTrendingLatestMaxBytes,Xs as radarCommunityTrendingLatestPath,Js as radarCommunityTrendingLatestSchema,Vs as radarCommunityTrendingMonthMaxBytes,Zs as radarCommunityTrendingMonthPath,Ys as radarCommunityTrendingMonthSchema,Us as radarCommunityTrendingPlatformSchema,qs as radarCommunityTrendingSourceSchema,Hs as radarCommunityTrendingSourceStaleMs,rc as radarCommunityTrendingSummary,Q as radarCommunityTrendingTopicSchema,Fo as radarImprovementColumnPath,Uo as radarImprovementEligibilityReq,Wo as radarImprovementEligibilityRes,Ro as radarImprovementEntrySchema,Go as radarImprovementErrorRes,zo as radarImprovementHeadReq,Bo as radarImprovementHeadRes,Po as radarImprovementPageMaxBytes,Vo as radarImprovementPageReq,Ho as radarImprovementPageRes,No as radarImprovementPageSize,qa as radarNotificationProjectionSchema,Ka as radarNotificationTargetSchema,to as radarNotificationTaskPageSize,Qa as radarNotificationTaskSchema,eo as radarNotificationTasksPath,ro as radarNotificationTasksReq,io as radarNotificationTasksRes,Ba as radarNotificationTopicSchema,Va as radarNotificationTopicsSchema,S as radarResetActionDetailV1Schema,B as radarResetActionDetailV2Schema,oi as radarResetActionDetailV3Schema,Dt as radarResetActionItemV2Schema,Xe as radarResetActionPageMaxBytesV2,Ye as radarResetActionPageMaxItemsV2,yt as radarResetActionSummaryV2Schema,Tt as radarResetActiveActionItemV2Schema,Me as radarResetAnalysisV1Schema,r as radarResetAnalyzerContractVersionV1,c as radarResetAudienceValues,Ft as radarResetChangeCoverageV2Schema,Qe as radarResetChangePageMaxBytesV2,Ze as radarResetChangePageMaxItemsV2,$o as radarResetClueLifetimeMs,es as radarResetClueMaxBytes,Qo as radarResetCluePath,ts as radarResetClueSchema,ns as radarResetClueSnapshotSchema,fc as radarResetConfirmationSchema,mc as radarResetConfirmationsResponseSchema,n as radarResetContractVersionV1,qe as radarResetContractVersionV2,et as radarResetDetailBatchMaxBytesV2,$e as radarResetDetailBatchMaxChunksV2,Ct as radarResetDetailChunkReferenceV2Schema,jt as radarResetDetailChunkRequestV2Schema,wt as radarResetDetailManifestV2Schema,o as radarResetEffectValues,Ve as radarResetExportV1Schema,H as radarResetExportV2Schema,hi as radarResetExportV3Schema,hc as radarResetExportV4Schema,Xr as radarResetKindNoticeV2Schema,Bi as radarResetManagementActionSchema,Pi as radarResetManagementOperationSchema,Vi as radarResetManagementResSchema,zi as radarResetManualApplyReqSchema,Ni as radarResetManualCopySchema,Fi as radarResetManualDraftSchema,Li as radarResetManualDraftSeedSchema,Ii as radarResetManualPreviewReqSchema,Ri as radarResetManualPreviewResSchema,Hi as radarResetManualResultResSchema,Ie as radarResetNoticeKindValues,C as radarResetPendingActionV1Schema,V as radarResetPendingActionV2Schema,l as radarResetPlanValues,E as radarResetPositiveDecimalV2Schema,s as radarResetProductValues,Ei as radarResetPublicActionV1Schema,i as radarResetPublicDataLimits,O as radarResetPublicIdV2Schema,bi as radarResetPublicRecordsCorePath,Ai as radarResetPublicRecordsV1Schema,xt as radarResetPublicationHomeFactsV2Schema,Jt as radarResetPublicationRevisionAvailableV2Schema,Le 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,d as radarResetReasonBasisValues,u as radarResetReasonCategoryValues,Gt as radarResetSafeCauseSnapshotV2Schema,a as radarResetSeriesValues,k as radarResetSha256V2Schema,re as radarResetSnapshotAvailableV1Schema,Pt as radarResetSourceChangeV2Schema,Ut as radarResetSourceErrorCodeValuesV2,qt as radarResetSourceErrorEnvelopeV2Schema,wn as radarResetSourceErrorHttpStatusV2,Cn as radarResetSourceErrorIsRetryableV2,Kt as radarResetSourceErrorV2Schema,Je as radarResetSourceMaxRpcCallsV2,qr as radarResetSourceTranslationsSchema,gi as radarResetStatisticsResponseV3Schema,mi as radarResetStatisticsV1Schema,pc as radarResetStatisticsV2Schema,nt as radarResetUInt64DecimalV2Schema,at as radarResetUInt64DecimalV2ToBigInt,Di as radarResetUnexecutedActionV1Schema,D as radarResetUtcTimestampV2Schema,Et as radarResetWithdrawnActionItemV2Schema,Oi as radarResetWithdrawnActionV1Schema,qo as radarTiboSourceStatusMaxBytes,Ko as radarTiboSourceStatusPath,Xo as radarTiboSourceStatusSchema,Sr as radarTitledActivityFileSchema,yr as radarTitledActivityProgressSchema,Da as radarWebsiteLegacyChinesePrefix,Ea as radarWebsiteLocalePrefixes,Ta as radarWebsiteLocaleSlugs,wa as radarWebsiteLocales,Ca as radarWebsiteOrigin,Oa as radarWebsitePagePaths,ja as radarWebsitePageUrl,cc as radarWechatDispatchPath,ac as radarWechatDispatchRequestSchema,sc as radarWechatDispatchResponseSchema,oc as radarWechatDispatchResultSchema,lc as radarWechatPrivateDispatchPath,kr as readRadarActivityFile,jr as readRadarActivityFileV2,ga as readRadarActivityFileV3,Rs as readRadarCodexModels,Os as readRadarCodexReleaseDirectory,ks as readRadarCodexReleaseMonth,As as readRadarCodexReleaseNotes,ec as readRadarCommunityTrendingLatest,tc as readRadarCommunityTrendingMonth,as as readRadarResetClueSnapshot,Zo as readRadarTiboSourceStatus,Ar as readRadarTitledActivityFile,po as redactRadarBrowserRegistrationReferences,pi as refineRadarResetStatistics,Sn as toSafeCauseSnapshotV2,Mo as upgradeRadarBrowserSubscriptionCommandV1};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@closerepo/radar-contracts",
3
- "version": "5.0.0",
3
+ "version": "6.0.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {