@closerepo/radar-contracts 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import{z as e}from"zod";const t=1,n=4,r=Object.freeze({exportUtf8Bytes:2*1024*1024,analysis:Object.freeze({actions:512,intervals:511}),actionDetail:Object.freeze({noticeTimeline:64,reasons:128}),text:Object.freeze({publicTextCodePoints:500,evidenceExcerptCodePoints:500,urlCodePoints:2048})}),i=[`all`,`hard_reset`,`banked_reset`],a=[`hard_reset`,`banked_reset`],o=[`codex`,`chatgpt_work`],s=[`all_users`,`paid_users`,`named_plans`,`affected_subset`],c=[`plus`,`pro`],l=[`incident_compensation`,`user_milestone`,`celebration`],ee=[`explicit_in_reset_post`,`explicit_in_related_source`,`contextual_inference`,`unknown`],te=[`weekday`,`weekday_group`,`hour`,`six_hour_block`,`month`,`day_of_month`,`week_of_month`,`weekday_hour`,`minute_of_hour`,`five_minute_bucket`,`half_hour_slot`,`time_of_day_minute`],ne=[`month`,`weekday`,`hour`,`six_hour_block`],u=e.number().finite(),d=u.min(0),f=e.number().int().min(0),p=e.number().int().positive(),m=u.min(0).max(1),h=e.iso.datetime({offset:!0}).refine(e=>e.endsWith(`Z`),{message:`utc_timestamp_required`}).refine(e=>/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(e),{message:`utc_timestamp_seconds_required`}),g=e.string().min(1).max(128).refine(e=>e===e.trim()&&!/[\p{Cc}\p{Cf}]/u.test(e),{message:`public_id_invalid`}),_=e.enum(i),re=e.enum(l),ie=e.enum(ee),ae=e.object({contractVersion:e.literal(1),eventId:g,eventType:e.literal(`reset_analysis_snapshot_available`),analysisSnapshotId:g,sourceWatermark:g,occurredAt:h}).strict();function oe(e){return ae.parse(e)}function se(e){return[...e].length}function ce(e){return new TextEncoder().encode(JSON.stringify(e)).byteLength}const le=e.string().refine(e=>se(e)<=r.text.evidenceExcerptCodePoints,{message:`evidence_excerpt_too_long`}),ue=e.string().refine(e=>e.trim().length>0,{message:`source_text_empty`}),de=e.string().refine(e=>se(e)<=r.text.publicTextCodePoints,{message:`public_text_too_long`}),fe=e.string().refine(e=>e.trim().length>0,{message:`source_account_display_name_blank`}).refine(e=>se(e)<=r.text.publicTextCodePoints,{message:`source_account_display_name_too_long`}),pe=e.string().refine(e=>se(e)<=r.text.urlCodePoints,{message:`source_url_too_long`}).refine(e=>{if([...e].some(e=>{let t=e.codePointAt(0);return t===void 0||t<=31||t===127}))return!1;try{let t=new URL(e);return t.protocol===`https:`&&t.username.length===0&&t.password.length===0}catch{return!1}},{message:`https_url_required`});function v(e){return new Set(e).size===e.length}const me=e.discriminatedUnion(`state`,[e.object({state:e.literal(`known`),values:e.array(e.enum(a)).min(1).refine(v,{message:`reset_effects_must_be_unique`})}).strict(),e.object({state:e.literal(`unknown`),values:e.tuple([])}).strict()]),he=e.object({products:e.array(e.enum(o)).refine(v,{message:`products_must_be_unique`}),audienceClaims:e.array(e.object({audience:e.enum(s),plans:e.array(e.enum(c)).refine(v,{message:`plans_must_be_unique`}),subsetSummary:de.nullable()}).strict())}).strict(),ge=e.object({resetActionId:g,firstAnnouncedAt:h,effectiveAt:h.nullable(),resetEffects:me,actionScope:he,reasonCategories:e.array(re).refine(v,{message:`reason_categories_must_be_unique`}),noticeCount:p,previousAllActionDays:d.nullable(),previousHardResetActionDays:d.nullable(),previousBankedResetActionDays:d.nullable()}).strict(),_e=e.object({series:_,previousActionId:g,actionId:g,fromFirstAnnouncedAt:h,toFirstAnnouncedAt:h,days:d}).strict(),ve=e.object({count:p,min:d,max:d,mean:d,median:d,percentile25:d,percentile75:d,percentile90:d,standardDeviation:d,coefficientOfVariation:d.nullable(),interquartileRange:d}).strict(),ye=e.object({lower:d,upper:d}).strict(),be=e.object({iterations:p,seed:e.number().int(),mean95:ye,median95:ye}).strict(),xe=e.object({bucket:e.string().min(1),lowerInclusive:d,upperExclusive:d.nullable(),count:f,share:m}).strict(),Se=e.object({endingIndex:f,windowSize:p,mean:d,median:d}).strict(),Ce=e.object({firstHalf:ve.nullable(),secondHalf:ve.nullable(),meanChangeDays:u.nullable(),meanChangePercent:u.nullable()}).strict(),we=e.object({series:_,actionCount:f,completedIntervalCount:f,intervalSummary:ve.nullable(),bootstrap95:be.nullable(),intervalHistogram:e.array(xe),shortestIntervals:e.array(_e),longestIntervals:e.array(_e),rolling3:e.array(Se),rolling5:e.array(Se),linearSlopeDaysPerInterval:u.nullable(),halfComparison:Ce,survivalCurve:e.array(e.object({elapsedDays:d,survivalProbability:m}).strict())}).strict(),Te=e.object({series:_,elapsedDays:d,horizonDays:d,sampleAtRisk:f,eventsWithinWindow:f,probability:m.nullable()}).strict(),Ee=e.object({key:e.string(),count:f,share:m,timeZone:e.string().min(1),series:_,dimension:e.enum(te)}).strict(),De=e.object({timeZone:e.string().min(1),series:_,dimension:e.enum(te),categoryCount:p,nonZeroCategoryCount:f,maxShare:m,herfindahlIndex:m,normalizedEntropy:m}).strict(),Oe=e.object({startMinute:e.number().int().min(0).max(1439),endMinute:e.number().int().min(0).max(1439),wrapsMidnight:e.boolean(),eventCount:f,share:m}).strict(),ke=e.object({timeZone:e.string().min(1),series:_,eventCount:p,slotMinutes:p,fixedWindows:e.array(e.object({durationMinutes:p,bestWindows:e.array(Oe)}).strict()),coverageWindows:e.array(e.object({targetShare:m,requiredEventCount:p,durationMinutes:p,bestWindows:e.array(Oe)}).strict())}).strict(),Ae=e.object({series:_,thresholdDays:d,clusterCount:f,multiEventClusterCount:f,largestClusterSize:f,eventsInMultiEventClusters:f,eventShareInMultiEventClusters:m}).strict(),je=e.object({category:re,actionCount:f,actionShare:m,hardResetActionCount:f,bankedResetActionCount:f,explicitInResetPostCount:f,explicitInRelatedSourceCount:f,contextualInferenceCount:f,unknownCount:f}).strict(),Me=e.object({category:re,series:_,timeZone:e.string().min(1),dimension:e.enum(ne),key:e.string(),eventCount:f,reasonEventCount:f,binEventCount:f,seriesEventCount:f,shareWithinReason:m.nullable(),shareWithinBin:m.nullable(),shareOfSeries:m.nullable()}).strict(),Ne=e.object({overview:e.object({actionCount:p,hardResetActionCount:f,bankedResetActionCount:f,firstAnnouncedAt:h,lastAnnouncedAt:h,coverageDays:d,sourceNoticeCount:p}).strict(),actions:e.array(ge).min(1).max(r.analysis.actions),intervals:e.array(_e).max(r.analysis.intervals),series:e.object({all:we,hard_reset:we,banked_reset:we}).strict(),historicalConditionalFrequencies:e.array(Te),calendars:e.array(Ee),calendarConcentrations:e.array(De),intradayRanges:e.array(ke),clusters:e.array(Ae),reasons:e.object({summary:e.array(je),crossTabs:e.array(Me)}).strict(),caveats:e.array(de.min(1))}).strict(),Pe=e.object({contractVersion:e.literal(1),analyzerContractVersion:e.literal(4),generatedAt:h,analysisWindow:e.object({startAt:h,startInclusive:e.boolean(),timeBasis:e.literal(`first_announcement`),throughFirstAnnouncedAt:h}).strict(),result:Ne}).strict().superRefine((e,t)=>{let n=e.result.actions,r=e.result.overview;n.length!==r.actionCount&&t.addIssue({code:`custom`,message:`analysis_action_count_mismatch`,path:[`result`,`actions`]});let a=new Set;for(let e=0;e<n.length;e+=1){let r=n[e];a.has(r.resetActionId)&&t.addIssue({code:`custom`,message:`analysis_action_identity_duplicate`,path:[`result`,`actions`,e,`resetActionId`]}),a.add(r.resetActionId);let i=n[e-1];i!==void 0&&(i.firstAnnouncedAt>r.firstAnnouncedAt||i.firstAnnouncedAt===r.firstAnnouncedAt&&i.resetActionId>r.resetActionId)&&t.addIssue({code:`custom`,message:`analysis_actions_not_stably_sorted`,path:[`result`,`actions`,e]})}let o=(e,r,i)=>{i!==void 0&&e.series!==i&&t.addIssue({code:`custom`,message:`analysis_interval_series_mismatch`,path:[...r,`series`]});let a=i??e.series,o=a===`all`?n:n.filter(e=>e.resetEffects.state===`known`&&e.resetEffects.values.includes(a)),s=o.findIndex(t=>t.resetActionId===e.actionId),c=o[s];if(c===void 0){t.addIssue({code:`custom`,message:`analysis_interval_action_mismatch`,path:[...r,`actionId`]});return}let l=o[s-1];(l===void 0||e.previousActionId!==l.resetActionId)&&t.addIssue({code:`custom`,message:`analysis_interval_previous_action_mismatch`,path:[...r,`previousActionId`]}),l!==void 0&&e.fromFirstAnnouncedAt!==l.firstAnnouncedAt&&t.addIssue({code:`custom`,message:`analysis_interval_from_first_announcement_mismatch`,path:[...r,`fromFirstAnnouncedAt`]}),e.toFirstAnnouncedAt!==c.firstAnnouncedAt&&t.addIssue({code:`custom`,message:`analysis_interval_to_first_announcement_mismatch`,path:[...r,`toFirstAnnouncedAt`]})};e.result.intervals.forEach((e,t)=>o(e,[`result`,`intervals`,t]));for(let t of i){let n=e.result.series[t];for(let e of[`shortestIntervals`,`longestIntervals`])n[e].forEach((n,r)=>o(n,[`result`,`series`,t,e,r],t))}n[0]?.firstAnnouncedAt!==r.firstAnnouncedAt&&t.addIssue({code:`custom`,message:`analysis_first_action_mismatch`,path:[`result`,`overview`,`firstAnnouncedAt`]}),(n.at(-1)?.firstAnnouncedAt!==r.lastAnnouncedAt||e.analysisWindow.throughFirstAnnouncedAt!==r.lastAnnouncedAt)&&t.addIssue({code:`custom`,message:`analysis_last_action_mismatch`,path:[`result`,`overview`,`lastAnnouncedAt`]});for(let[n,r]of Object.entries({all:`all`,hard_reset:`hard_reset`,banked_reset:`banked_reset`}))e.result.series[n].series!==r&&t.addIssue({code:`custom`,message:`analysis_series_identity_mismatch`,path:[`result`,`series`,n,`series`]})}),Fe=e.object({excerpt:le,sourceUrl:pe}).strict();function Ie(e,t){try{return He(e,t)}catch{return}}function y(e,t){try{return C(e,t)}catch{return}}const b=e.object({contractVersion:e.literal(1),resetActionId:g,firstAnnouncedAt:h,effectiveAt:h.nullable(),resetEffects:me,actionScope:he,noticeCount:p,reasons:e.array(e.object({category:re,summary:de.min(1),basis:ie,evidence:e.array(Fe).min(1)}).strict()).max(r.actionDetail.reasons),noticeTimeline:e.array(e.object({phase:e.enum([`preview`,`executed`]),authoredAt:h,contentCompleteness:e.enum([`verified_full_text`,`verified_excerpt`]),sourceText:ue,sourceTextZh:ue.nullable(),sourceUrl:pe,sourceAccount:e.object({displayName:fe}).strict()}).strict()).min(1).max(r.actionDetail.noticeTimeline)}).strict().superRefine((e,t)=>{e.noticeCount!==e.noticeTimeline.length&&t.addIssue({code:`custom`,message:`action_notice_count_mismatch`,path:[`noticeCount`]});for(let n=0;n<e.noticeTimeline.length;n+=1){let r=e.noticeTimeline[n];if(n===0){let n=y(r.authoredAt,e.firstAnnouncedAt);n!==void 0&&n!==0&&t.addIssue({code:`custom`,message:`notice_timeline_first_announcement_mismatch`,path:[`noticeTimeline`,0,`authoredAt`]});continue}let i=e.noticeTimeline[n-1],a=y(i.authoredAt,r.authoredAt);a!==void 0&&a>0&&t.addIssue({code:`custom`,message:`notice_timeline_not_ascending`,path:[`noticeTimeline`,n,`authoredAt`]})}}),Le=[`preview`,`executed`,`schedule_change`,`scope_change`,`cancel_preview`,`delivery_issue`,`make_up`,`repair`,`update`],Re=e.object({resolution:e.enum([`resolved`,`unbounded`,`unresolved`]),evidence:e.string().trim().min(1).max(300).nullable(),precision:e.enum([`exact`,`approximate`,`range`]).nullable(),relation:e.enum([`instant`,`interval`,`deadline`,`not_before`,`unbounded`]).nullable(),effectiveWindow:e.object({earliestAt:e.iso.datetime(),latestAt:e.iso.datetime()}).strict().refine(e=>Date.parse(e.earliestAt)<=Date.parse(e.latestAt),{message:`publication_timing_window_inverted`}).nullable()}).strict().superRefine((e,t)=>{let n=e=>t.addIssue({code:`custom`,message:e});e.resolution===`resolved`!=(e.effectiveWindow!==null)&&n(`publication_timing_resolution_window_mismatch`),e.resolution===`unbounded`&&e.relation!==`unbounded`&&n(`publication_timing_unbounded_relation_required`);let r=e.effectiveWindow;e.resolution===`resolved`&&((e.relation===null||e.relation===`unbounded`)&&n(`publication_timing_bounded_relation_required`),r!==null&&e.relation===`interval`==(r.earliestAt===r.latestAt)&&n(`publication_timing_relation_window_mismatch`))}),x=e.object({resetActionId:g,state:e.enum([`preview`,`executed`]),resetEffects:me,executedEffects:e.array(e.enum(a)).refine(v),pendingEffects:e.array(e.enum(a)).refine(v),plannedTiming:Re.nullable(),noticeTimeline:e.array(b.shape.noticeTimeline.element.omit({phase:!0}).extend({kinds:e.array(e.enum(Le)).min(1).refine(v)}).strict()).min(1).max(r.actionDetail.noticeTimeline)}).strict().superRefine((e,t)=>{e.state===`preview`&&e.executedEffects.length>0&&t.addIssue({code:`custom`,message:`pending_preview_has_executed_effects`}),e.state===`executed`&&e.pendingEffects.length===0&&t.addIssue({code:`custom`,message:`pending_executed_action_has_no_pending_effects`});for(let n of[...e.executedEffects,...e.pendingEffects])new Set(e.resetEffects.values).has(n)||t.addIssue({code:`custom`,message:`pending_effect_not_declared`});e.executedEffects.some(t=>e.pendingEffects.includes(t))&&t.addIssue({code:`custom`,message:`pending_effect_already_executed`});for(let n=1;n<e.noticeTimeline.length;n+=1){let r=e.noticeTimeline[n-1],i=e.noticeTimeline[n],a=y(r.authoredAt,i.authoredAt);a!==void 0&&a>0&&t.addIssue({code:`custom`,message:`pending_notice_timeline_not_ascending`,path:[`noticeTimeline`,n]})}}),ze=e.object({contractVersion:e.literal(1),generatedAt:h,analysis:Pe,actions:e.array(b).min(1).max(r.analysis.actions),pendingResetActions:e.array(x).max(r.analysis.actions)}).strict();function Be(e,t){ce(e)>r.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`export_utf8_size_limit_exceeded`,path:[]});let n=y(e.generatedAt,e.analysis.generatedAt);n!==void 0&&n<0&&t.addIssue({code:`custom`,message:`export_generated_at_before_analysis`,path:[`generatedAt`]})}function Ve(e,t,n,r){(e.resetActionId!==t.resetActionId||e.firstAnnouncedAt!==t.firstAnnouncedAt||e.effectiveAt!==t.effectiveAt||e.noticeCount!==t.noticeCount||JSON.stringify(e.resetEffects)!==JSON.stringify(t.resetEffects)||JSON.stringify(e.actionScope)!==JSON.stringify(t.actionScope))&&r.addIssue({code:`custom`,message:`export_action_summary_mismatch`,path:[`actions`,n]});let i=[...new Set(e.reasons.map(e=>e.category))].sort();JSON.stringify(i)!==JSON.stringify([...t.reasonCategories].sort())&&r.addIssue({code:`custom`,message:`export_action_reason_categories_mismatch`,path:[`actions`,n,`reasons`]})}const S=ze.superRefine((e,t)=>{Be(e,t),v(e.pendingResetActions.map(e=>e.resetActionId))||t.addIssue({code:`custom`,message:`export_pending_action_identity_duplicate`,path:[`pendingResetActions`]});let n=new Map,r=new Set(e.analysis.result.actions.map(e=>e.resetActionId));for(let i=0;i<e.actions.length;i+=1){let a=e.actions[i];n.has(a.resetActionId)?t.addIssue({code:`custom`,message:`export_action_identity_duplicate`,path:[`actions`,i,`resetActionId`]}):n.set(a.resetActionId,i);let o=e.actions[i-1],s=o===void 0?void 0:Ie(o,a);s!==void 0&&s>0&&t.addIssue({code:`custom`,message:`export_actions_not_stably_sorted`,path:[`actions`,i]});let c=y(a.firstAnnouncedAt,e.analysis.analysisWindow.throughFirstAnnouncedAt);c!==void 0&&c>0&&t.addIssue({code:`custom`,message:`export_action_after_analysis_snapshot`,path:[`actions`,i,`firstAnnouncedAt`]});let l=y(a.firstAnnouncedAt,e.analysis.analysisWindow.startAt);l!==void 0&&(e.analysis.analysisWindow.startInclusive?l>=0:l>0)&&!r.has(a.resetActionId)&&t.addIssue({code:`custom`,message:`export_window_action_not_in_analysis`,path:[`actions`,i,`resetActionId`]})}for(let r of e.analysis.result.actions){let i=n.get(r.resetActionId);if(i===void 0){t.addIssue({code:`custom`,message:`export_analysis_action_missing`,path:[`actions`]});continue}Ve(e.actions[i],r,i,t)}});function C(e,t){let n=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d+))?Z$/,r=n.exec(e),i=n.exec(t);if(r===null||i===null)throw Error(`radar_reset_v1_timestamp_invalid`);let a=r[1],o=i[1];if(a<o)return-1;if(a>o)return 1;let s=r[2]??``,c=i[2]??``,l=Math.max(s.length,c.length);for(let e=0;e<l;e+=1){let t=s.charCodeAt(e)||48,n=c.charCodeAt(e)||48;if(t<n)return-1;if(t>n)return 1}return 0}function He(e,t){let n=C(e.firstAnnouncedAt,t.firstAnnouncedAt);return n===0?e.resetActionId<t.resetActionId?-1:+(e.resetActionId>t.resetActionId):n}function Ue(e){return Pe.parse(e)}function We(e){return b.parse(e)}function Ge(e){return S.parse(e)}function Ke(e){return x.parse(e)}function qe(e){let t;try{t=We(e)}catch(e){throw Error(`radar_reset_primary_source_action_invalid`,{cause:e})}let n=t.noticeTimeline[0];if(n===void 0)throw Error(`radar_reset_primary_source_notice_missing`);return Object.freeze({displayName:n.sourceAccount.displayName,sourceUrl:n.sourceUrl,excerpt:[...n.sourceText.trim()].slice(0,r.text.publicTextCodePoints).join(``)})}const Je=2,Ye=30,Xe=256,Ze=512*1024,Qe=256,$e=256*1024,et=32,tt=2*1024*1024,nt=9223372036854775807n,rt=e.string().regex(/^(?:0|[1-9][0-9]{0,18})$/,`uint64_decimal_noncanonical`).refine(e=>BigInt(e)<=nt,`uint64_decimal_out_of_range`),w=e.string().regex(/^[1-9][0-9]{0,18}$/,`positive_decimal_noncanonical`).refine(e=>BigInt(e)<=nt,`positive_decimal_out_of_range`);function it(e){return rt.parse(e)}function at(e){return w.parse(e)}function ot(e){return BigInt(it(e))}function st(e){if(e<0n||e>nt)throw RangeError(`uint64_decimal_out_of_range`);return e.toString()}function ct(e){if(e<1n||e>nt)throw RangeError(`positive_decimal_out_of_range`);return e.toString()}const T=e.iso.datetime({offset:!0}).refine(e=>e.endsWith(`Z`),`utc_timestamp_required`).refine(e=>/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(e),`utc_timestamp_seconds_required`),E=e.string().min(1).max(128).refine(e=>e===e.trim()&&!/[\p{Cc}\p{Cf}]/u.test(e),`public_id_invalid`),D=e.string().regex(/^sha256:[0-9a-f]{64}$/,`sha256_noncanonical`);function lt(e){return new Set(e).size===e.length}const ut=t=>e.array(t).refine(lt,`array_values_must_be_unique`),dt=t=>e.string().refine(e=>[...e].length<=t,`string_exceeds_${t}_code_points`),ft=e.number().finite().min(0),pt=e.number().int().min(0).max(2**53-1),O=e.number().int().positive().max(2**53-1),mt=e.enum([`hard_reset`,`banked_reset`]),ht=e.enum([`codex`,`chatgpt_work`]),gt=e.enum([`all_users`,`paid_users`,`named_plans`,`affected_subset`]),_t=e.enum([`plus`,`pro`]),vt=e.enum([`incident_compensation`,`user_milestone`,`celebration`]),yt=e.object({resetActionId:E,firstAnnouncedAt:T,effectiveAt:T.nullable(),resetEffects:e.union([e.object({state:e.literal(`known`),values:ut(mt).nonempty()}).strict(),e.object({state:e.literal(`unknown`),values:e.tuple([])}).strict()]),actionScope:e.object({products:ut(ht),audienceClaims:e.array(e.object({audience:gt,plans:ut(_t),subsetSummary:dt(500).nullable()}).strict())}).strict(),reasonCategories:ut(vt),noticeCount:O,previousAllActionDays:ft.nullable(),previousHardResetActionDays:ft.nullable(),previousBankedResetActionDays:ft.nullable()}).strict();function bt(e){return yt.parse(e)}const xt=e.object({generatedAt:T,availableRange:e.object({firstAnnouncedAt:T,lastAnnouncedAt:T}).strict().nullable(),current:e.object({summary:yt,status:e.object({phase:e.enum([`preview`,`executed`]),statusAt:T}).strict()}).strict().nullable()}).strict().superRefine((e,t)=>{if(e.availableRange===null!=(e.current===null)){t.addIssue({code:`custom`,message:`home_empty_state_inconsistent`});return}e.availableRange!==null&&e.current!==null&&e.current.summary.firstAnnouncedAt!==e.availableRange.lastAnnouncedAt&&t.addIssue({code:`custom`,message:`home_current_range_inconsistent`})});function St(e){return xt.parse(e)}const Ct=e.object({ordinal:pt,sha256:D,byteSize:O}).strict(),wt=e.object({sha256:D,byteSize:O,chunkCount:O,chunks:e.array(Ct).min(1)}).strict().superRefine((e,t)=>{e.chunkCount!==e.chunks.length&&t.addIssue({code:`custom`,message:`chunk_count_mismatch`});let n=0;for(let[r,i]of e.chunks.entries())i.ordinal!==r&&t.addIssue({code:`custom`,message:`chunk_ordinal_invalid`}),n+=i.byteSize;n!==e.byteSize&&t.addIssue({code:`custom`,message:`detail_byte_size_mismatch`})}),Tt=e.object({lifecycleState:e.literal(`active`),actionOrdinal:w,summary:yt,detailManifest:wt}).strict(),Et=e.object({lifecycleState:e.literal(`withdrawn`),actionOrdinal:w,resetActionId:E,lastActiveFirstAnnouncedAt:T}).strict(),Dt=e.discriminatedUnion(`lifecycleState`,[Tt,Et]),Ot=e.object({contractVersion:e.literal(2)}).strict(),kt=e.object({contractVersion:e.literal(2),revision:E,cursor:w.nullable()}).strict(),At=e.object({contractVersion:e.literal(2),revision:E,afterSequence:rt}).strict(),jt=e.object({resetActionId:E,ordinal:pt,sha256:D,byteSize:O}).strict(),Mt=e.object({contractVersion:e.literal(2),revision:E,chunks:e.array(jt).min(1).max(32)}).strict().superRefine((e,t)=>{e.chunks.reduce((e,t)=>e+t.byteSize,0)>2097152&&t.addIssue({code:`custom`,message:`detail_batch_too_large`}),lt(e.chunks.map(e=>`${e.resetActionId}\u0000${e.ordinal}`))||t.addIssue({code:`custom`,message:`detail_chunk_duplicate`})}),Nt=e.object({lifecycleState:e.enum([`active`,`withdrawn`]),firstAnnouncedAt:T.nullable(),contentSha256:D.nullable()}).strict().superRefine((e,t)=>{e.lifecycleState===`active`&&(e.firstAnnouncedAt===null||e.contentSha256===null)&&t.addIssue({code:`custom`,message:`active_change_state_incomplete`})}),Pt=e.object({sourceChangeSequence:w,introducedByRevision:E,resetActionId:E,kind:e.enum([`create`,`upsert`,`withdraw`]),activationKind:e.enum([`initial`,`restored`]).nullable(),activationOrdinal:w.nullable(),before:Nt.nullable(),after:Nt.nullable()}).strict().superRefine((e,t)=>{e.activationKind===null!=(e.activationOrdinal===null)&&t.addIssue({code:`custom`,message:`activation_pair_invalid`}),e.kind===`create`&&(e.activationKind!==`initial`||e.before!==null||e.after?.lifecycleState!==`active`)&&t.addIssue({code:`custom`,message:`create_change_invalid`}),e.kind===`withdraw`&&(e.activationKind!==null||e.before?.lifecycleState!==`active`||e.after?.lifecycleState!==`withdrawn`)&&t.addIssue({code:`custom`,message:`withdraw_change_invalid`}),e.kind===`upsert`&&e.activationKind===`initial`&&t.addIssue({code:`custom`,message:`upsert_activation_invalid`})}),Ft=e.object({minSequence:e.literal(`1`),maxSequence:w}).strict(),It=e.object({revision:E,projectionFingerprint:D,actionCount:pt,activeActionCount:pt,changeCoverage:Ft.nullable(),home:xt}).strict().superRefine((e,t)=>{e.activeActionCount>e.actionCount&&t.addIssue({code:`custom`,message:`active_action_count_invalid`}),e.activeActionCount===0!=(e.home.availableRange===null)&&t.addIssue({code:`custom`,message:`head_home_count_inconsistent`})}),Lt=e.object({revision:E,items:e.array(Dt).max(256),nextCursor:w.nullable()}).strict().superRefine((e,t)=>{for(let n=1;n<e.items.length;n+=1){let r=e.items.at(n-1),i=e.items.at(n);if(r!==void 0&&i!==void 0&&BigInt(r.actionOrdinal)>=BigInt(i.actionOrdinal)){t.addIssue({code:`custom`,message:`action_ordinal_order_invalid`});break}}let n=e.items.at(-1);e.nextCursor!==null&&n?.actionOrdinal!==e.nextCursor&&t.addIssue({code:`custom`,message:`action_cursor_invalid`})}),Rt=e.object({revision:E,coverage:Ft.nullable(),items:e.array(Pt).max(256),nextAfterSequence:w.nullable()}).strict().superRefine((e,t)=>{for(let n=1;n<e.items.length;n+=1){let r=e.items.at(n-1),i=e.items.at(n);if(r!==void 0&&i!==void 0&&BigInt(r.sourceChangeSequence)+1n!==BigInt(i.sourceChangeSequence)){t.addIssue({code:`custom`,message:`change_sequence_gap`});break}}let n=e.items.at(-1);e.nextAfterSequence!==null&&n?.sourceChangeSequence!==e.nextAfterSequence&&t.addIssue({code:`custom`,message:`change_cursor_invalid`})}),zt=t=>e.object({contractVersion:e.literal(2),ok:e.literal(!0),data:t}).strict(),Bt=zt(It),Vt=zt(Lt),Ht=zt(Rt),Ut=[`source_invalid_request`,`source_revision_unknown`,`source_cursor_invalid`,`source_chunk_mismatch`,`source_response_over_capacity`,`source_integrity_conflict`,`source_revision_identity_conflict`,`source_sequence_exhausted`,`source_temporarily_unavailable`,`source_rpc_transport_failure`,`source_stream_incomplete`];function Wt(e,t=0,n=new Set){if(t>4)return!1;if(e===null||typeof e==`boolean`)return!0;if(typeof e==`string`)return[...e].length<=1024;if(typeof e==`number`)return Number.isFinite(e);if(typeof e!=`object`||n.has(e))return!1;if(n.add(e),Array.isArray(e))return e.length>16?!1:e.every(e=>Wt(e,t+1,n));let r=Object.entries(e);return r.length>16?!1:r.every(([,e])=>Wt(e,t+1,n))}const Gt=e.record(e.string(),e.unknown()).refine(e=>Wt(e),`safe_cause_invalid`).refine(e=>new TextEncoder().encode(JSON.stringify(e)).byteLength<=8192,`safe_cause_too_large`),Kt=e.object({code:e.enum(Ut),operation:E,stage:E,revision:E.optional(),retryable:e.boolean(),correlationId:E,cause:Gt}).strict(),qt=e.object({contractVersion:e.literal(2),ok:e.literal(!1),error:Kt}).strict(),Jt=e.object({contractVersion:e.literal(2),eventType:e.literal(`reset_publication_revision_available`),eventId:e.string().regex(/^reset_pub_v2_[0-9a-f]{64}$/),revision:E,changeHighWater:rt,projectionFingerprint:D,occurredAt:T}).strict();function Yt(e){return Ot.parse(e)}function Xt(e){return kt.parse(e)}function Zt(e){return At.parse(e)}function Qt(e){return Mt.parse(e)}function $t(e){return Bt.parse(e)}function en(e){return Vt.parse(e)}function tn(e){return Ht.parse(e)}function nn(e){return qt.parse(e)}function rn(e){return Jt.parse(e)}var an=class extends Error{code;operation;stage;retryable;constructor(e){super(`${e.code}:${e.stage}`,{cause:e.cause}),this.name=`RadarResetSourceContractErrorV2`,this.code=e.code,this.operation=e.operation,this.stage=e.stage,this.retryable=e.retryable}};const k=new TextEncoder,on=new TextDecoder(`utf-8`,{fatal:!0});function A(e,t,n){if(n+t.byteLength>e.byteLength)return!1;for(let r=0;r<t.byteLength;r+=1)if(e.at(n+r)!==t.at(r))return!1;return!0}function sn(e,t){if(t.byteLength===0)return!0;for(let n=0;n<=e.byteLength-t.byteLength;n+=1)if(A(e,t,n))return!0;return!1}function cn(e){let t=e.reduce((e,t)=>e+t.byteLength,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;return n}function ln(e){let t=``;for(let n=0;n<e.byteLength;n+=32768)t+=String.fromCharCode(...e.slice(n,n+32768));return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/u,``)}function un(e){if(!/^[A-Za-z0-9_-]+$/u.test(e))throw Error(`base64url_noncanonical`);let t=(4-e.length%4)%4,n=`${e.replaceAll(`-`,`+`).replaceAll(`_`,`/`)}${`=`.repeat(t)}`,r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));if(ln(i)!==e)throw Error(`base64url_noncanonical`);return i}async function dn(e){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return`sha256:${[...new Uint8Array(await crypto.subtle.digest(`SHA-256`,t))].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function fn(e){for(let t=0;t<64;t+=1){let t=`radar-reset-v2-${[...crypto.getRandomValues(new Uint8Array(24))].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`,n=k.encode(`--${t}`);if(!e.some(e=>sn(e,n)))return t}throw Error(`multipart_boundary_generation_failed`)}async function pn(e){let t=E.parse(e.revision),n=E.parse(e.correlationId),r=Mt.parse({contractVersion:2,revision:t,chunks:e.parts.map(({bytes:e,...t})=>t)}),i=e.parts.map((e,t)=>({...r.chunks[t],bytes:new Uint8Array(e.bytes)}));for(let e of i)if(e.bytes.byteLength!==e.byteSize||await dn(e.bytes)!==e.sha256)throw new an({code:`source_chunk_mismatch`,operation:`readDetailBatch`,stage:`detail_encode`,retryable:!1});let a=fn(i.map(e=>e.bytes)),o=[];for(let e of i)o.push(k.encode(`--${a}\r\nContent-Type: application/octet-stream\r
2
- X-Radar-Reset-Action-Id-B64: ${ln(k.encode(e.resetActionId))}\r\nX-Radar-Detail-Ordinal: ${e.ordinal}\r\nX-Radar-Byte-Size: ${e.byteSize}\r\nX-Radar-SHA-256: ${e.sha256}\r\n\r\n`)),o.push(e.bytes,k.encode(`\r
3
- `));o.push(k.encode(`--${a}--\r\n`));let s=cn(o),c=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return new Response(c,{status:200,headers:{"Cache-Control":`no-store`,"Content-Type":`multipart/mixed; boundary=${a}`,"X-Radar-Correlation-Id":n,"X-Radar-Part-Count":String(i.length),"X-Radar-Revision-B64":ln(k.encode(t))}})}function j(e,t,n){throw new an({code:e,operation:`readDetailBatch`,stage:`detail_stream`,retryable:t,cause:n})}async function mn(e){if(e.body===null)return j(`source_stream_incomplete`,!0);let t=e.body.getReader(),n=[],r=0;try{for(;;){let e=await t.read();if(e.done)break;if(r+=e.value.byteLength,r>2162688){try{await t.cancel()}catch{}return j(`source_response_over_capacity`,!1)}n.push(e.value)}}catch(e){return j(`source_stream_incomplete`,!0,e)}finally{t.releaseLock()}return cn(n)}function M(e,t){let n=e.headers.get(t);return n===null||n.includes(`,`)?j(`source_chunk_mismatch`,!1):n}function hn(e){if([...e].some(e=>e>127))return j(`source_chunk_mismatch`,!1);let t=String.fromCharCode(...e),n=new Map,r=new Set([`content-type`,`x-radar-reset-action-id-b64`,`x-radar-detail-ordinal`,`x-radar-byte-size`,`x-radar-sha-256`]);for(let e of t.split(`\r
4
- `)){let t=e.indexOf(`:`);if(t<=0||e.slice(t+1,t+2)!==` `)return j(`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 j(`source_chunk_mismatch`,!1);n.set(i,a)}return n.size===r.size?n:j(`source_chunk_mismatch`,!1)}function gn(e,t,n){for(let r=n;r<=e.byteLength-t.byteLength;r+=1)if(A(e,t,r))return r;return-1}async function _n(e,t){let n=Mt.parse({contractVersion:2,revision:t.revision,chunks:t.chunks});if(e.status!==200)return j(`source_chunk_mismatch`,!1);let r=M(e,`Content-Type`),i=/^multipart\/mixed; boundary=(radar-reset-v2-[0-9a-f]{48})$/u.exec(r);if(i===null)return j(`source_chunk_mismatch`,!1);let a=i[1];if(M(e,`Cache-Control`)!==`no-store`)return j(`source_chunk_mismatch`,!1);E.parse(M(e,`X-Radar-Correlation-Id`));let o=M(e,`X-Radar-Part-Count`);if(!/^[1-9][0-9]*$/u.test(o)||Number(o)>32||Number(o)!==n.chunks.length)return j(`source_chunk_mismatch`,!1);let s;try{s=on.decode(un(M(e,`X-Radar-Revision-B64`)))}catch(e){return j(`source_chunk_mismatch`,!1,e)}if(s!==n.revision)return j(`source_chunk_mismatch`,!1);let c=await mn(e),l=k.encode(`--${a}\r\n`),ee=k.encode(`--${a}--\r\n`),te=k.encode(`\r
1
+ import{z as e}from"zod";const t=1,n=4,r=Object.freeze({exportUtf8Bytes:2*1024*1024,analysis:Object.freeze({actions:512,intervals:511}),actionDetail:Object.freeze({noticeTimeline:64,reasons:128}),text:Object.freeze({publicTextCodePoints:500,evidenceExcerptCodePoints:500,urlCodePoints:2048})}),i=[`all`,`hard_reset`,`banked_reset`],a=[`hard_reset`,`banked_reset`],o=[`codex`,`chatgpt_work`],s=[`all_users`,`paid_users`,`named_plans`,`affected_subset`],c=[`plus`,`pro`],l=[`incident_compensation`,`user_milestone`,`celebration`],ee=[`explicit_in_reset_post`,`explicit_in_related_source`,`contextual_inference`,`unknown`],te=[`weekday`,`weekday_group`,`hour`,`six_hour_block`,`month`,`day_of_month`,`week_of_month`,`weekday_hour`,`minute_of_hour`,`five_minute_bucket`,`half_hour_slot`,`time_of_day_minute`],ne=[`month`,`weekday`,`hour`,`six_hour_block`],u=e.number().finite(),d=u.min(0),f=e.number().int().min(0),p=e.number().int().positive(),m=u.min(0).max(1),h=e.iso.datetime({offset:!0}).refine(e=>e.endsWith(`Z`),{message:`utc_timestamp_required`}).refine(e=>/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(e),{message:`utc_timestamp_seconds_required`}),g=e.string().min(1).max(128).refine(e=>e===e.trim()&&!/[\p{Cc}\p{Cf}]/u.test(e),{message:`public_id_invalid`}),_=e.enum(i),re=e.enum(l),ie=e.enum(ee),ae=e.object({contractVersion:e.literal(1),eventId:g,eventType:e.literal(`reset_analysis_snapshot_available`),analysisSnapshotId:g,sourceWatermark:g,occurredAt:h}).strict();function oe(e){return ae.parse(e)}function se(e){return[...e].length}function ce(e){return new TextEncoder().encode(JSON.stringify(e)).byteLength}const le=e.string().refine(e=>se(e)<=r.text.evidenceExcerptCodePoints,{message:`evidence_excerpt_too_long`}),ue=e.string().refine(e=>e.trim().length>0,{message:`source_text_empty`}),de=e.string().refine(e=>se(e)<=r.text.publicTextCodePoints,{message:`public_text_too_long`}),fe=e.string().refine(e=>e.trim().length>0,{message:`source_account_display_name_blank`}).refine(e=>se(e)<=r.text.publicTextCodePoints,{message:`source_account_display_name_too_long`}),pe=e.string().refine(e=>se(e)<=r.text.urlCodePoints,{message:`source_url_too_long`}).refine(e=>{if([...e].some(e=>{let t=e.codePointAt(0);return t===void 0||t<=31||t===127}))return!1;try{let t=new URL(e);return t.protocol===`https:`&&t.username.length===0&&t.password.length===0}catch{return!1}},{message:`https_url_required`});function v(e){return new Set(e).size===e.length}const me=e.discriminatedUnion(`state`,[e.object({state:e.literal(`known`),values:e.array(e.enum(a)).min(1).refine(v,{message:`reset_effects_must_be_unique`})}).strict(),e.object({state:e.literal(`unknown`),values:e.tuple([])}).strict()]),he=e.object({products:e.array(e.enum(o)).refine(v,{message:`products_must_be_unique`}),audienceClaims:e.array(e.object({audience:e.enum(s),plans:e.array(e.enum(c)).refine(v,{message:`plans_must_be_unique`}),subsetSummary:de.nullable()}).strict())}).strict(),ge=e.object({resetActionId:g,firstAnnouncedAt:h,effectiveAt:h.nullable(),resetEffects:me,actionScope:he,reasonCategories:e.array(re).refine(v,{message:`reason_categories_must_be_unique`}),noticeCount:p,previousAllActionDays:d.nullable(),previousHardResetActionDays:d.nullable(),previousBankedResetActionDays:d.nullable()}).strict(),_e=e.object({series:_,previousActionId:g,actionId:g,fromFirstAnnouncedAt:h,toFirstAnnouncedAt:h,days:d}).strict(),ve=e.object({count:p,min:d,max:d,mean:d,median:d,percentile25:d,percentile75:d,percentile90:d,standardDeviation:d,coefficientOfVariation:d.nullable(),interquartileRange:d}).strict(),ye=e.object({lower:d,upper:d}).strict(),be=e.object({iterations:p,seed:e.number().int(),mean95:ye,median95:ye}).strict(),xe=e.object({bucket:e.string().min(1),lowerInclusive:d,upperExclusive:d.nullable(),count:f,share:m}).strict(),Se=e.object({endingIndex:f,windowSize:p,mean:d,median:d}).strict(),Ce=e.object({firstHalf:ve.nullable(),secondHalf:ve.nullable(),meanChangeDays:u.nullable(),meanChangePercent:u.nullable()}).strict(),we=e.object({series:_,actionCount:f,completedIntervalCount:f,intervalSummary:ve.nullable(),bootstrap95:be.nullable(),intervalHistogram:e.array(xe),shortestIntervals:e.array(_e),longestIntervals:e.array(_e),rolling3:e.array(Se),rolling5:e.array(Se),linearSlopeDaysPerInterval:u.nullable(),halfComparison:Ce,survivalCurve:e.array(e.object({elapsedDays:d,survivalProbability:m}).strict())}).strict(),Te=e.object({series:_,elapsedDays:d,horizonDays:d,sampleAtRisk:f,eventsWithinWindow:f,probability:m.nullable()}).strict(),Ee=e.object({key:e.string(),count:f,share:m,timeZone:e.string().min(1),series:_,dimension:e.enum(te)}).strict(),De=e.object({timeZone:e.string().min(1),series:_,dimension:e.enum(te),categoryCount:p,nonZeroCategoryCount:f,maxShare:m,herfindahlIndex:m,normalizedEntropy:m}).strict(),Oe=e.object({startMinute:e.number().int().min(0).max(1439),endMinute:e.number().int().min(0).max(1439),wrapsMidnight:e.boolean(),eventCount:f,share:m}).strict(),ke=e.object({timeZone:e.string().min(1),series:_,eventCount:p,slotMinutes:p,fixedWindows:e.array(e.object({durationMinutes:p,bestWindows:e.array(Oe)}).strict()),coverageWindows:e.array(e.object({targetShare:m,requiredEventCount:p,durationMinutes:p,bestWindows:e.array(Oe)}).strict())}).strict(),Ae=e.object({series:_,thresholdDays:d,clusterCount:f,multiEventClusterCount:f,largestClusterSize:f,eventsInMultiEventClusters:f,eventShareInMultiEventClusters:m}).strict(),je=e.object({category:re,actionCount:f,actionShare:m,hardResetActionCount:f,bankedResetActionCount:f,explicitInResetPostCount:f,explicitInRelatedSourceCount:f,contextualInferenceCount:f,unknownCount:f}).strict(),Me=e.object({category:re,series:_,timeZone:e.string().min(1),dimension:e.enum(ne),key:e.string(),eventCount:f,reasonEventCount:f,binEventCount:f,seriesEventCount:f,shareWithinReason:m.nullable(),shareWithinBin:m.nullable(),shareOfSeries:m.nullable()}).strict(),Ne=e.object({overview:e.object({actionCount:p,hardResetActionCount:f,bankedResetActionCount:f,firstAnnouncedAt:h,lastAnnouncedAt:h,coverageDays:d,sourceNoticeCount:p}).strict(),actions:e.array(ge).min(1).max(r.analysis.actions),intervals:e.array(_e).max(r.analysis.intervals),series:e.object({all:we,hard_reset:we,banked_reset:we}).strict(),historicalConditionalFrequencies:e.array(Te),calendars:e.array(Ee),calendarConcentrations:e.array(De),intradayRanges:e.array(ke),clusters:e.array(Ae),reasons:e.object({summary:e.array(je),crossTabs:e.array(Me)}).strict(),caveats:e.array(de.min(1))}).strict(),Pe=e.object({contractVersion:e.literal(1),analyzerContractVersion:e.literal(4),generatedAt:h,analysisWindow:e.object({startAt:h,startInclusive:e.boolean(),timeBasis:e.literal(`first_announcement`),throughFirstAnnouncedAt:h}).strict(),result:Ne}).strict().superRefine((e,t)=>{let n=e.result.actions,r=e.result.overview;n.length!==r.actionCount&&t.addIssue({code:`custom`,message:`analysis_action_count_mismatch`,path:[`result`,`actions`]});let a=new Set;for(let e=0;e<n.length;e+=1){let r=n[e];a.has(r.resetActionId)&&t.addIssue({code:`custom`,message:`analysis_action_identity_duplicate`,path:[`result`,`actions`,e,`resetActionId`]}),a.add(r.resetActionId);let i=n[e-1];i!==void 0&&(i.firstAnnouncedAt>r.firstAnnouncedAt||i.firstAnnouncedAt===r.firstAnnouncedAt&&i.resetActionId>r.resetActionId)&&t.addIssue({code:`custom`,message:`analysis_actions_not_stably_sorted`,path:[`result`,`actions`,e]})}let o=(e,r,i)=>{i!==void 0&&e.series!==i&&t.addIssue({code:`custom`,message:`analysis_interval_series_mismatch`,path:[...r,`series`]});let a=i??e.series,o=a===`all`?n:n.filter(e=>e.resetEffects.state===`known`&&e.resetEffects.values.includes(a)),s=o.findIndex(t=>t.resetActionId===e.actionId),c=o[s];if(c===void 0){t.addIssue({code:`custom`,message:`analysis_interval_action_mismatch`,path:[...r,`actionId`]});return}let l=o[s-1];(l===void 0||e.previousActionId!==l.resetActionId)&&t.addIssue({code:`custom`,message:`analysis_interval_previous_action_mismatch`,path:[...r,`previousActionId`]}),l!==void 0&&e.fromFirstAnnouncedAt!==l.firstAnnouncedAt&&t.addIssue({code:`custom`,message:`analysis_interval_from_first_announcement_mismatch`,path:[...r,`fromFirstAnnouncedAt`]}),e.toFirstAnnouncedAt!==c.firstAnnouncedAt&&t.addIssue({code:`custom`,message:`analysis_interval_to_first_announcement_mismatch`,path:[...r,`toFirstAnnouncedAt`]})};e.result.intervals.forEach((e,t)=>o(e,[`result`,`intervals`,t]));for(let t of i){let n=e.result.series[t];for(let e of[`shortestIntervals`,`longestIntervals`])n[e].forEach((n,r)=>o(n,[`result`,`series`,t,e,r],t))}n[0]?.firstAnnouncedAt!==r.firstAnnouncedAt&&t.addIssue({code:`custom`,message:`analysis_first_action_mismatch`,path:[`result`,`overview`,`firstAnnouncedAt`]}),(n.at(-1)?.firstAnnouncedAt!==r.lastAnnouncedAt||e.analysisWindow.throughFirstAnnouncedAt!==r.lastAnnouncedAt)&&t.addIssue({code:`custom`,message:`analysis_last_action_mismatch`,path:[`result`,`overview`,`lastAnnouncedAt`]});for(let[n,r]of Object.entries({all:`all`,hard_reset:`hard_reset`,banked_reset:`banked_reset`}))e.result.series[n].series!==r&&t.addIssue({code:`custom`,message:`analysis_series_identity_mismatch`,path:[`result`,`series`,n,`series`]})}),Fe=e.object({excerpt:le,sourceUrl:pe}).strict();function Ie(e,t){try{return Ue(e,t)}catch{return}}function y(e,t){try{return S(e,t)}catch{return}}const b=e.object({contractVersion:e.literal(1),resetActionId:g,firstAnnouncedAt:h,effectiveAt:h.nullable(),resetEffects:me,actionScope:he,noticeCount:p,reasons:e.array(e.object({category:re,summary:de.min(1),basis:ie,evidence:e.array(Fe).min(1)}).strict()).max(r.actionDetail.reasons),noticeTimeline:e.array(e.object({phase:e.enum([`preview`,`executed`]),authoredAt:h,contentCompleteness:e.enum([`verified_full_text`,`verified_excerpt`]),sourceText:ue,sourceTextZh:ue.nullable(),sourceUrl:pe,sourceAccount:e.object({displayName:fe}).strict()}).strict()).min(1).max(r.actionDetail.noticeTimeline)}).strict().superRefine((e,t)=>{e.noticeCount!==e.noticeTimeline.length&&t.addIssue({code:`custom`,message:`action_notice_count_mismatch`,path:[`noticeCount`]});for(let n=0;n<e.noticeTimeline.length;n+=1){let r=e.noticeTimeline[n];if(n===0){let n=y(r.authoredAt,e.firstAnnouncedAt);n!==void 0&&n!==0&&t.addIssue({code:`custom`,message:`notice_timeline_first_announcement_mismatch`,path:[`noticeTimeline`,0,`authoredAt`]});continue}let i=e.noticeTimeline[n-1],a=y(i.authoredAt,r.authoredAt);a!==void 0&&a>0&&t.addIssue({code:`custom`,message:`notice_timeline_not_ascending`,path:[`noticeTimeline`,n,`authoredAt`]})}}),Le=[`preview`,`executed`,`schedule_change`,`scope_change`,`cancel_preview`,`delivery_issue`,`make_up`,`repair`,`update`],Re=e.object({resolution:e.enum([`resolved`,`unbounded`,`unresolved`]),evidence:e.string().trim().min(1).max(300).nullable(),precision:e.enum([`exact`,`approximate`,`range`]).nullable(),relation:e.enum([`instant`,`interval`,`deadline`,`not_before`,`unbounded`]).nullable(),effectiveWindow:e.object({earliestAt:e.iso.datetime(),latestAt:e.iso.datetime()}).strict().refine(e=>Date.parse(e.earliestAt)<=Date.parse(e.latestAt),{message:`publication_timing_window_inverted`}).nullable()}).strict().superRefine((e,t)=>{let n=e=>t.addIssue({code:`custom`,message:e});e.resolution===`resolved`!=(e.effectiveWindow!==null)&&n(`publication_timing_resolution_window_mismatch`),e.resolution===`unbounded`&&e.relation!==`unbounded`&&n(`publication_timing_unbounded_relation_required`);let r=e.effectiveWindow;e.resolution===`resolved`&&((e.relation===null||e.relation===`unbounded`)&&n(`publication_timing_bounded_relation_required`),r!==null&&e.relation===`interval`==(r.earliestAt===r.latestAt)&&n(`publication_timing_relation_window_mismatch`))}),x=e.object({resetActionId:g,state:e.enum([`preview`,`executed`]),resetEffects:me,executedEffects:e.array(e.enum(a)).refine(v),pendingEffects:e.array(e.enum(a)).refine(v),plannedTiming:Re.nullable(),noticeTimeline:e.array(b.shape.noticeTimeline.element.omit({phase:!0}).extend({kinds:e.array(e.enum(Le)).min(1).refine(v)}).strict()).min(1).max(r.actionDetail.noticeTimeline)}).strict().superRefine((e,t)=>{e.state===`preview`&&e.executedEffects.length>0&&t.addIssue({code:`custom`,message:`pending_preview_has_executed_effects`}),e.state===`executed`&&e.pendingEffects.length===0&&t.addIssue({code:`custom`,message:`pending_executed_action_has_no_pending_effects`});for(let n of[...e.executedEffects,...e.pendingEffects])new Set(e.resetEffects.values).has(n)||t.addIssue({code:`custom`,message:`pending_effect_not_declared`});e.executedEffects.some(t=>e.pendingEffects.includes(t))&&t.addIssue({code:`custom`,message:`pending_effect_already_executed`});for(let n=1;n<e.noticeTimeline.length;n+=1){let r=e.noticeTimeline[n-1],i=e.noticeTimeline[n],a=y(r.authoredAt,i.authoredAt);a!==void 0&&a>0&&t.addIssue({code:`custom`,message:`pending_notice_timeline_not_ascending`,path:[`noticeTimeline`,n]})}}),ze=e.object({contractVersion:e.literal(1),generatedAt:h,analysis:Pe,actions:e.array(b).min(1).max(r.analysis.actions),pendingResetActions:e.array(x).max(r.analysis.actions)}).strict();function Be(e,t){ce(e)>r.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`export_utf8_size_limit_exceeded`,path:[]});let n=y(e.generatedAt,e.analysis.generatedAt);n!==void 0&&n<0&&t.addIssue({code:`custom`,message:`export_generated_at_before_analysis`,path:[`generatedAt`]})}function Ve(e,t,n,r){(e.resetActionId!==t.resetActionId||e.firstAnnouncedAt!==t.firstAnnouncedAt||e.effectiveAt!==t.effectiveAt||e.noticeCount!==t.noticeCount||JSON.stringify(e.resetEffects)!==JSON.stringify(t.resetEffects)||JSON.stringify(e.actionScope)!==JSON.stringify(t.actionScope))&&r.addIssue({code:`custom`,message:`export_action_summary_mismatch`,path:[`actions`,n]});let i=[...new Set(e.reasons.map(e=>e.category))].sort();JSON.stringify(i)!==JSON.stringify([...t.reasonCategories].sort())&&r.addIssue({code:`custom`,message:`export_action_reason_categories_mismatch`,path:[`actions`,n,`reasons`]})}const He=ze.superRefine((e,t)=>{Be(e,t),v(e.pendingResetActions.map(e=>e.resetActionId))||t.addIssue({code:`custom`,message:`export_pending_action_identity_duplicate`,path:[`pendingResetActions`]});let n=new Map,r=new Set(e.analysis.result.actions.map(e=>e.resetActionId));for(let i=0;i<e.actions.length;i+=1){let a=e.actions[i];n.has(a.resetActionId)?t.addIssue({code:`custom`,message:`export_action_identity_duplicate`,path:[`actions`,i,`resetActionId`]}):n.set(a.resetActionId,i);let o=e.actions[i-1],s=o===void 0?void 0:Ie(o,a);s!==void 0&&s>0&&t.addIssue({code:`custom`,message:`export_actions_not_stably_sorted`,path:[`actions`,i]});let c=y(a.firstAnnouncedAt,e.analysis.analysisWindow.throughFirstAnnouncedAt);c!==void 0&&c>0&&t.addIssue({code:`custom`,message:`export_action_after_analysis_snapshot`,path:[`actions`,i,`firstAnnouncedAt`]});let l=y(a.firstAnnouncedAt,e.analysis.analysisWindow.startAt);l!==void 0&&(e.analysis.analysisWindow.startInclusive?l>=0:l>0)&&!r.has(a.resetActionId)&&t.addIssue({code:`custom`,message:`export_window_action_not_in_analysis`,path:[`actions`,i,`resetActionId`]})}for(let r of e.analysis.result.actions){let i=n.get(r.resetActionId);if(i===void 0){t.addIssue({code:`custom`,message:`export_analysis_action_missing`,path:[`actions`]});continue}Ve(e.actions[i],r,i,t)}});function S(e,t){let n=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2})(?:\.(\d+))?Z$/,r=n.exec(e),i=n.exec(t);if(r===null||i===null)throw Error(`radar_reset_v1_timestamp_invalid`);let a=r[1],o=i[1];if(a<o)return-1;if(a>o)return 1;let s=r[2]??``,c=i[2]??``,l=Math.max(s.length,c.length);for(let e=0;e<l;e+=1){let t=s.charCodeAt(e)||48,n=c.charCodeAt(e)||48;if(t<n)return-1;if(t>n)return 1}return 0}function Ue(e,t){let n=S(e.firstAnnouncedAt,t.firstAnnouncedAt);return n===0?e.resetActionId<t.resetActionId?-1:+(e.resetActionId>t.resetActionId):n}function We(e){return Pe.parse(e)}function Ge(e){return b.parse(e)}function Ke(e){return He.parse(e)}function qe(e){return x.parse(e)}function Je(e){let t;try{t=Ge(e)}catch(e){throw Error(`radar_reset_primary_source_action_invalid`,{cause:e})}let n=t.noticeTimeline[0];if(n===void 0)throw Error(`radar_reset_primary_source_notice_missing`);return Object.freeze({displayName:n.sourceAccount.displayName,sourceUrl:n.sourceUrl,excerpt:[...n.sourceText.trim()].slice(0,r.text.publicTextCodePoints).join(``)})}const Ye=2,Xe=30,Ze=256,Qe=512*1024,$e=256,et=256*1024,tt=32,nt=2*1024*1024,rt=9223372036854775807n,it=e.string().regex(/^(?:0|[1-9][0-9]{0,18})$/,`uint64_decimal_noncanonical`).refine(e=>BigInt(e)<=rt,`uint64_decimal_out_of_range`),C=e.string().regex(/^[1-9][0-9]{0,18}$/,`positive_decimal_noncanonical`).refine(e=>BigInt(e)<=rt,`positive_decimal_out_of_range`);function at(e){return it.parse(e)}function ot(e){return C.parse(e)}function st(e){return BigInt(at(e))}function ct(e){if(e<0n||e>rt)throw RangeError(`uint64_decimal_out_of_range`);return e.toString()}function lt(e){if(e<1n||e>rt)throw RangeError(`positive_decimal_out_of_range`);return e.toString()}const w=e.iso.datetime({offset:!0}).refine(e=>e.endsWith(`Z`),`utc_timestamp_required`).refine(e=>/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(e),`utc_timestamp_seconds_required`),T=e.string().min(1).max(128).refine(e=>e===e.trim()&&!/[\p{Cc}\p{Cf}]/u.test(e),`public_id_invalid`),E=e.string().regex(/^sha256:[0-9a-f]{64}$/,`sha256_noncanonical`);function ut(e){return new Set(e).size===e.length}const dt=t=>e.array(t).refine(ut,`array_values_must_be_unique`),ft=t=>e.string().refine(e=>[...e].length<=t,`string_exceeds_${t}_code_points`),pt=e.number().finite().min(0),mt=e.number().int().min(0).max(2**53-1),D=e.number().int().positive().max(2**53-1),ht=e.enum([`hard_reset`,`banked_reset`]),gt=e.enum([`codex`,`chatgpt_work`]),_t=e.enum([`all_users`,`paid_users`,`named_plans`,`affected_subset`]),vt=e.enum([`plus`,`pro`]),yt=e.enum([`incident_compensation`,`user_milestone`,`celebration`]),bt=e.object({resetActionId:T,firstAnnouncedAt:w,effectiveAt:w.nullable(),resetEffects:e.union([e.object({state:e.literal(`known`),values:dt(ht).nonempty()}).strict(),e.object({state:e.literal(`unknown`),values:e.tuple([])}).strict()]),actionScope:e.object({products:dt(gt),audienceClaims:e.array(e.object({audience:_t,plans:dt(vt),subsetSummary:ft(500).nullable()}).strict())}).strict(),reasonCategories:dt(yt),noticeCount:D,previousAllActionDays:pt.nullable(),previousHardResetActionDays:pt.nullable(),previousBankedResetActionDays:pt.nullable()}).strict();function xt(e){return bt.parse(e)}const St=e.object({generatedAt:w,availableRange:e.object({firstAnnouncedAt:w,lastAnnouncedAt:w}).strict().nullable(),current:e.object({summary:bt,status:e.object({phase:e.enum([`preview`,`executed`]),statusAt:w}).strict()}).strict().nullable()}).strict().superRefine((e,t)=>{if(e.availableRange===null!=(e.current===null)){t.addIssue({code:`custom`,message:`home_empty_state_inconsistent`});return}e.availableRange!==null&&e.current!==null&&e.current.summary.firstAnnouncedAt!==e.availableRange.lastAnnouncedAt&&t.addIssue({code:`custom`,message:`home_current_range_inconsistent`})});function Ct(e){return St.parse(e)}const wt=e.object({ordinal:mt,sha256:E,byteSize:D}).strict(),Tt=e.object({sha256:E,byteSize:D,chunkCount:D,chunks:e.array(wt).min(1)}).strict().superRefine((e,t)=>{e.chunkCount!==e.chunks.length&&t.addIssue({code:`custom`,message:`chunk_count_mismatch`});let n=0;for(let[r,i]of e.chunks.entries())i.ordinal!==r&&t.addIssue({code:`custom`,message:`chunk_ordinal_invalid`}),n+=i.byteSize;n!==e.byteSize&&t.addIssue({code:`custom`,message:`detail_byte_size_mismatch`})}),Et=e.object({lifecycleState:e.literal(`active`),actionOrdinal:C,summary:bt,detailManifest:Tt}).strict(),Dt=e.object({lifecycleState:e.literal(`withdrawn`),actionOrdinal:C,resetActionId:T,lastActiveFirstAnnouncedAt:w}).strict(),Ot=e.discriminatedUnion(`lifecycleState`,[Et,Dt]),kt=e.object({contractVersion:e.literal(2)}).strict(),At=e.object({contractVersion:e.literal(2),revision:T,cursor:C.nullable()}).strict(),jt=e.object({contractVersion:e.literal(2),revision:T,afterSequence:it}).strict(),Mt=e.object({resetActionId:T,ordinal:mt,sha256:E,byteSize:D}).strict(),Nt=e.object({contractVersion:e.literal(2),revision:T,chunks:e.array(Mt).min(1).max(32)}).strict().superRefine((e,t)=>{e.chunks.reduce((e,t)=>e+t.byteSize,0)>2097152&&t.addIssue({code:`custom`,message:`detail_batch_too_large`}),ut(e.chunks.map(e=>`${e.resetActionId}\u0000${e.ordinal}`))||t.addIssue({code:`custom`,message:`detail_chunk_duplicate`})}),Pt=e.object({lifecycleState:e.enum([`active`,`withdrawn`]),firstAnnouncedAt:w.nullable(),contentSha256:E.nullable()}).strict().superRefine((e,t)=>{e.lifecycleState===`active`&&(e.firstAnnouncedAt===null||e.contentSha256===null)&&t.addIssue({code:`custom`,message:`active_change_state_incomplete`})}),Ft=e.object({sourceChangeSequence:C,introducedByRevision:T,resetActionId:T,kind:e.enum([`create`,`upsert`,`withdraw`]),activationKind:e.enum([`initial`,`restored`]).nullable(),activationOrdinal:C.nullable(),before:Pt.nullable(),after:Pt.nullable()}).strict().superRefine((e,t)=>{e.activationKind===null!=(e.activationOrdinal===null)&&t.addIssue({code:`custom`,message:`activation_pair_invalid`}),e.kind===`create`&&(e.activationKind!==`initial`||e.before!==null||e.after?.lifecycleState!==`active`)&&t.addIssue({code:`custom`,message:`create_change_invalid`}),e.kind===`withdraw`&&(e.activationKind!==null||e.before?.lifecycleState!==`active`||e.after?.lifecycleState!==`withdrawn`)&&t.addIssue({code:`custom`,message:`withdraw_change_invalid`}),e.kind===`upsert`&&e.activationKind===`initial`&&t.addIssue({code:`custom`,message:`upsert_activation_invalid`})}),It=e.object({minSequence:e.literal(`1`),maxSequence:C}).strict(),Lt=e.object({revision:T,projectionFingerprint:E,actionCount:mt,activeActionCount:mt,changeCoverage:It.nullable(),home:St}).strict().superRefine((e,t)=>{e.activeActionCount>e.actionCount&&t.addIssue({code:`custom`,message:`active_action_count_invalid`}),e.activeActionCount===0!=(e.home.availableRange===null)&&t.addIssue({code:`custom`,message:`head_home_count_inconsistent`})}),Rt=e.object({revision:T,items:e.array(Ot).max(256),nextCursor:C.nullable()}).strict().superRefine((e,t)=>{for(let n=1;n<e.items.length;n+=1){let r=e.items.at(n-1),i=e.items.at(n);if(r!==void 0&&i!==void 0&&BigInt(r.actionOrdinal)>=BigInt(i.actionOrdinal)){t.addIssue({code:`custom`,message:`action_ordinal_order_invalid`});break}}let n=e.items.at(-1);e.nextCursor!==null&&n?.actionOrdinal!==e.nextCursor&&t.addIssue({code:`custom`,message:`action_cursor_invalid`})}),zt=e.object({revision:T,coverage:It.nullable(),items:e.array(Ft).max(256),nextAfterSequence:C.nullable()}).strict().superRefine((e,t)=>{for(let n=1;n<e.items.length;n+=1){let r=e.items.at(n-1),i=e.items.at(n);if(r!==void 0&&i!==void 0&&BigInt(r.sourceChangeSequence)+1n!==BigInt(i.sourceChangeSequence)){t.addIssue({code:`custom`,message:`change_sequence_gap`});break}}let n=e.items.at(-1);e.nextAfterSequence!==null&&n?.sourceChangeSequence!==e.nextAfterSequence&&t.addIssue({code:`custom`,message:`change_cursor_invalid`})}),Bt=t=>e.object({contractVersion:e.literal(2),ok:e.literal(!0),data:t}).strict(),Vt=Bt(Lt),Ht=Bt(Rt),Ut=Bt(zt),Wt=[`source_invalid_request`,`source_revision_unknown`,`source_cursor_invalid`,`source_chunk_mismatch`,`source_response_over_capacity`,`source_integrity_conflict`,`source_revision_identity_conflict`,`source_sequence_exhausted`,`source_temporarily_unavailable`,`source_rpc_transport_failure`,`source_stream_incomplete`];function Gt(e,t=0,n=new Set){if(t>4)return!1;if(e===null||typeof e==`boolean`)return!0;if(typeof e==`string`)return[...e].length<=1024;if(typeof e==`number`)return Number.isFinite(e);if(typeof e!=`object`||n.has(e))return!1;if(n.add(e),Array.isArray(e))return e.length>16?!1:e.every(e=>Gt(e,t+1,n));let r=Object.entries(e);return r.length>16?!1:r.every(([,e])=>Gt(e,t+1,n))}const Kt=e.record(e.string(),e.unknown()).refine(e=>Gt(e),`safe_cause_invalid`).refine(e=>new TextEncoder().encode(JSON.stringify(e)).byteLength<=8192,`safe_cause_too_large`),qt=e.object({code:e.enum(Wt),operation:T,stage:T,revision:T.optional(),retryable:e.boolean(),correlationId:T,cause:Kt}).strict(),Jt=e.object({contractVersion:e.literal(2),ok:e.literal(!1),error:qt}).strict(),Yt=e.object({contractVersion:e.literal(2),eventType:e.literal(`reset_publication_revision_available`),eventId:e.string().regex(/^reset_pub_v2_[0-9a-f]{64}$/),revision:T,changeHighWater:it,projectionFingerprint:E,occurredAt:w}).strict();function Xt(e){return kt.parse(e)}function Zt(e){return At.parse(e)}function Qt(e){return jt.parse(e)}function $t(e){return Nt.parse(e)}function en(e){return Vt.parse(e)}function tn(e){return Ht.parse(e)}function nn(e){return Ut.parse(e)}function rn(e){return Jt.parse(e)}function an(e){return Yt.parse(e)}var on=class extends Error{code;operation;stage;retryable;constructor(e){super(`${e.code}:${e.stage}`,{cause:e.cause}),this.name=`RadarResetSourceContractErrorV2`,this.code=e.code,this.operation=e.operation,this.stage=e.stage,this.retryable=e.retryable}};const O=new TextEncoder,sn=new TextDecoder(`utf-8`,{fatal:!0});function cn(e,t,n){if(n+t.byteLength>e.byteLength)return!1;for(let r=0;r<t.byteLength;r+=1)if(e.at(n+r)!==t.at(r))return!1;return!0}function ln(e,t){if(t.byteLength===0)return!0;for(let n=0;n<=e.byteLength-t.byteLength;n+=1)if(cn(e,t,n))return!0;return!1}function un(e){let t=e.reduce((e,t)=>e+t.byteLength,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;return n}function dn(e){let t=``;for(let n=0;n<e.byteLength;n+=32768)t+=String.fromCharCode(...e.slice(n,n+32768));return btoa(t).replaceAll(`+`,`-`).replaceAll(`/`,`_`).replace(/=+$/u,``)}function fn(e){if(!/^[A-Za-z0-9_-]+$/u.test(e))throw Error(`base64url_noncanonical`);let t=(4-e.length%4)%4,n=`${e.replaceAll(`-`,`+`).replaceAll(`_`,`/`)}${`=`.repeat(t)}`,r=atob(n),i=Uint8Array.from(r,e=>e.charCodeAt(0));if(dn(i)!==e)throw Error(`base64url_noncanonical`);return i}async function pn(e){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return`sha256:${[...new Uint8Array(await crypto.subtle.digest(`SHA-256`,t))].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`}function mn(e){for(let t=0;t<64;t+=1){let t=`radar-reset-v2-${[...crypto.getRandomValues(new Uint8Array(24))].map(e=>e.toString(16).padStart(2,`0`)).join(``)}`,n=O.encode(`--${t}`);if(!e.some(e=>ln(e,n)))return t}throw Error(`multipart_boundary_generation_failed`)}async function hn(e){let t=T.parse(e.revision),n=T.parse(e.correlationId),r=Nt.parse({contractVersion:2,revision:t,chunks:e.parts.map(({bytes:e,...t})=>t)}),i=e.parts.map((e,t)=>({...r.chunks[t],bytes:new Uint8Array(e.bytes)}));for(let e of i)if(e.bytes.byteLength!==e.byteSize||await pn(e.bytes)!==e.sha256)throw new on({code:`source_chunk_mismatch`,operation:`readDetailBatch`,stage:`detail_encode`,retryable:!1});let a=mn(i.map(e=>e.bytes)),o=[];for(let e of i)o.push(O.encode(`--${a}\r\nContent-Type: application/octet-stream\r
2
+ X-Radar-Reset-Action-Id-B64: ${dn(O.encode(e.resetActionId))}\r\nX-Radar-Detail-Ordinal: ${e.ordinal}\r\nX-Radar-Byte-Size: ${e.byteSize}\r\nX-Radar-SHA-256: ${e.sha256}\r\n\r\n`)),o.push(e.bytes,O.encode(`\r
3
+ `));o.push(O.encode(`--${a}--\r\n`));let s=un(o),c=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);return new Response(c,{status:200,headers:{"Cache-Control":`no-store`,"Content-Type":`multipart/mixed; boundary=${a}`,"X-Radar-Correlation-Id":n,"X-Radar-Part-Count":String(i.length),"X-Radar-Revision-B64":dn(O.encode(t))}})}function k(e,t,n){throw new on({code:e,operation:`readDetailBatch`,stage:`detail_stream`,retryable:t,cause:n})}async function gn(e){if(e.body===null)return k(`source_stream_incomplete`,!0);let t=e.body.getReader(),n=[],r=0;try{for(;;){let e=await t.read();if(e.done)break;if(r+=e.value.byteLength,r>2162688){try{await t.cancel()}catch{}return k(`source_response_over_capacity`,!1)}n.push(e.value)}}catch(e){return k(`source_stream_incomplete`,!0,e)}finally{t.releaseLock()}return un(n)}function A(e,t){let n=e.headers.get(t);return n===null||n.includes(`,`)?k(`source_chunk_mismatch`,!1):n}function _n(e){if([...e].some(e=>e>127))return k(`source_chunk_mismatch`,!1);let t=String.fromCharCode(...e),n=new Map,r=new Set([`content-type`,`x-radar-reset-action-id-b64`,`x-radar-detail-ordinal`,`x-radar-byte-size`,`x-radar-sha-256`]);for(let e of t.split(`\r
4
+ `)){let t=e.indexOf(`:`);if(t<=0||e.slice(t+1,t+2)!==` `)return k(`source_chunk_mismatch`,!1);let i=e.slice(0,t).toLowerCase(),a=e.slice(t+2);if(!r.has(i)||n.has(i)||a.length===0)return k(`source_chunk_mismatch`,!1);n.set(i,a)}return n.size===r.size?n:k(`source_chunk_mismatch`,!1)}function vn(e,t,n){for(let r=n;r<=e.byteLength-t.byteLength;r+=1)if(cn(e,t,r))return r;return-1}async function yn(e,t){let n=Nt.parse({contractVersion:2,revision:t.revision,chunks:t.chunks});if(e.status!==200)return k(`source_chunk_mismatch`,!1);let r=A(e,`Content-Type`),i=/^multipart\/mixed; boundary=(radar-reset-v2-[0-9a-f]{48})$/u.exec(r);if(i===null)return k(`source_chunk_mismatch`,!1);let a=i[1];if(A(e,`Cache-Control`)!==`no-store`)return k(`source_chunk_mismatch`,!1);T.parse(A(e,`X-Radar-Correlation-Id`));let o=A(e,`X-Radar-Part-Count`);if(!/^[1-9][0-9]*$/u.test(o)||Number(o)>32||Number(o)!==n.chunks.length)return k(`source_chunk_mismatch`,!1);let s;try{s=sn.decode(fn(A(e,`X-Radar-Revision-B64`)))}catch(e){return k(`source_chunk_mismatch`,!1,e)}if(s!==n.revision)return k(`source_chunk_mismatch`,!1);let c=await gn(e),l=O.encode(`--${a}\r\n`),ee=O.encode(`--${a}--\r\n`),te=O.encode(`\r
5
5
  \r
6
- `),ne=k.encode(`\r
7
- `),u=[],d=0;for(let e of n.chunks){if(!A(c,l,d))return j(`source_stream_incomplete`,!0);d+=l.byteLength;let t=gn(c,te,d);if(t<0)return j(`source_stream_incomplete`,!0);let n=hn(c.slice(d,t));if(d=t+te.byteLength,n.get(`content-type`)!==`application/octet-stream`)return j(`source_chunk_mismatch`,!1);let r;try{r=on.decode(un(n.get(`x-radar-reset-action-id-b64`)))}catch(e){return j(`source_chunk_mismatch`,!1,e)}if(r!==e.resetActionId||n.get(`x-radar-detail-ordinal`)!==String(e.ordinal)||n.get(`x-radar-byte-size`)!==String(e.byteSize)||n.get(`x-radar-sha-256`)!==e.sha256)return j(`source_chunk_mismatch`,!1);if(d+e.byteSize+ne.byteLength>c.byteLength)return j(`source_stream_incomplete`,!0);let i=c.slice(d,d+e.byteSize);if(d+=e.byteSize,!A(c,ne,d)||(d+=ne.byteLength,await dn(i)!==e.sha256))return j(`source_chunk_mismatch`,!1);u.push({...e,bytes:i})}return!A(c,ee,d)||d+ee.byteLength!==c.byteLength?j(`source_stream_incomplete`,!0):u}const vn=/authorization|cookie|token|secret|password|api[-_]?key/iu;function yn(e,t){let n=[...e].slice(0,1024),r=``;for(let e of n){let n=k.encode(e).byteLength;if(n>t.remaining)break;t.remaining-=n,r+=e}return r}function bn(e,t,n,r){if(e===null||typeof e==`boolean`)return e;if(typeof e==`string`)return yn(e,n);if(typeof e==`number`)return Number.isFinite(e)?e:String(e);if(typeof e==`bigint`||typeof e==`symbol`)return yn(String(e),n);if(e===void 0)return`undefined`;if(typeof e==`function`)return`[Function ${e.name||`anonymous`}]`;if(r.has(e))return`[Circular]`;if(t>=4)return`[DepthLimit]`;if(r.add(e),Array.isArray(e))return e.slice(0,16).map(e=>bn(e,t+1,n,r));let i={},a=e instanceof Error?[[`type`,e.constructor.name],[`name`,e.name],[`message`,e.message],...e.cause===void 0?[]:[[`cause`,e.cause]],...Object.entries(e)]:Object.entries(e);for(let[e,o]of a.slice(0,16)){let a=yn(String(e),n);if(!(a.length===0||Object.hasOwn(i,a))&&(n.remaining-=Math.min(n.remaining,8),i[a]=vn.test(a)?`[REDACTED]`:bn(o,t+1,n,r),n.remaining<=0))break}return i}function xn(e){let t=bn(e,0,{remaining:7e3},new Set),n=typeof t==`object`&&t&&!Array.isArray(t)?t:{type:e===null?`null`:typeof e,message:t};return Gt.parse(n),n}function Sn(e){return e===`source_temporarily_unavailable`||e===`source_rpc_transport_failure`||e===`source_stream_incomplete`}function Cn(e){switch(e){case`source_invalid_request`:return 400;case`source_revision_unknown`:return 404;case`source_cursor_invalid`:case`source_chunk_mismatch`:return 409;case`source_response_over_capacity`:return 413;case`source_temporarily_unavailable`:case`source_rpc_transport_failure`:case`source_stream_incomplete`:return 503;case`source_integrity_conflict`:case`source_revision_identity_conflict`:case`source_sequence_exhausted`:return 500}}function wn(e){let t={contractVersion:2,ok:!1,error:{code:e.code,operation:e.operation,stage:e.stage,...e.revision===void 0?{}:{revision:e.revision},retryable:Sn(e.code),correlationId:e.correlationId,cause:xn(e.cause)}};return qt.parse(t)}const Tn=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),En=e.iso.date(),N=e.strictObject({category:e.enum([`improvement`,`direct_reset`,`reset_card`]),deliveryState:e.enum([`preview`,`landed`]),description:Tn,dateBasis:e.enum([`occurrence`,`announcement`,`unresolved`]),sourceUrls:e.array(e.url({protocol:/^https?$/})).min(1)}),Dn=e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),text:Tn}),e.strictObject({state:e.enum([`pending`,`failed`,`not_applicable`]),text:e.null()})]),P=e.strictObject({contractVersion:e.literal(1),generatedAt:e.iso.datetime(),timeZone:e.string().refine(e=>{try{return new Intl.DateTimeFormat(`en`,{timeZone:e}),!0}catch{return!1}},`Invalid source time zone`),startDate:En,endDate:En,processing:e.strictObject({hasPending:e.boolean(),hasFailures:e.boolean()}),days:e.array(e.strictObject({date:En,dayNumber:e.number().int().min(1).max(28),outcome:e.enum([`unconfirmed`,`improvement`,`reset`,`both`]),entries:e.array(N),summary:Dn})).length(28),undatedEntries:e.array(N)}).superRefine((e,t)=>{let n=Date.parse(`${e.startDate}T00:00:00Z`);for(let[r,i]of e.days.entries()){let e=new Date(n+r*864e5).toISOString().slice(0,10);(i.date!==e||i.dayNumber!==r+1)&&t.addIssue({code:`custom`,path:[`days`,r],message:`Days must be contiguous and numbered in order`}),i.entries.some(e=>e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`days`,r,`entries`],message:`Unresolved dates belong in undatedEntries`});let a=i.entries.filter(e=>e.deliveryState===`landed`),o=a.some(e=>e.category===`improvement`),s=a.some(e=>e.category!==`improvement`),c=o?s?`both`:`improvement`:s?`reset`:`unconfirmed`;(i.outcome!==c||a.length===0!=(i.summary.state===`not_applicable`))&&t.addIssue({code:`custom`,path:[`days`,r],message:`Outcome and summary must reflect landed evidence`})}e.days.at(-1)?.date!==e.endDate&&t.addIssue({code:`custom`,path:[`endDate`],message:`End must match the last activity day`}),e.undatedEntries.some(e=>e.dateBasis!==`unresolved`)&&t.addIssue({code:`custom`,path:[`undatedEntries`],message:`Undated entries must have unresolved dates`})});function On(e){return P.parse(e)}function kn(e){let t=e.filter(e=>e.deliveryState===`landed`),n=t.some(e=>e.category===`improvement`),r=t.some(e=>e.category!==`improvement`);return n?r?`both`:`improvement`:r?`reset`:`unconfirmed`}const An=524288,F=P.shape,jn=F.days.element,Mn=N.extend({date:F.startDate.nullable()}).superRefine((e,t)=>{e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}),Nn=e.strictObject({state:e.enum([`unconfirmed`,`ongoing`,`ended`]),sourceUrls:e.array(N.shape.sourceUrls.element)}).superRefine((e,t)=>{e.state!==`unconfirmed`&&e.sourceUrls.length===0&&t.addIssue({code:`custom`,path:[`sourceUrls`],message:`Confirmed lifecycle states require source evidence`})}),Pn=jn.omit({date:!0,entries:!0}).extend({entries:e.array(Mn),lifecycle:Nn}),I=e.strictObject({contractVersion:e.literal(2),generatedAt:F.generatedAt,timeZone:F.timeZone,processing:F.processing,days:e.array(Pn).length(28),unassignedEntries:e.array(Mn)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries()){r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`});let e=r.entries.filter(e=>e.deliveryState===`landed`),i=kn(r.entries);(r.outcome!==i||e.length===0!=(r.summary.state===`not_applicable`))&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome and summary must reflect landed evidence`})}});function Fn(e){return I.parse(e)}const In=An,L=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),Ln=N.extend({title:L}),Rn=I.shape,zn=Rn.days.element,Bn=zn.shape.entries.element.safeExtend({title:L}),Vn=zn.extend({title:L.nullable(),entries:e.array(Bn)}).superRefine((e,t)=>{e.title!==null!=(e.summary.state===`ready`)&&t.addIssue({code:`custom`,path:[`title`],message:`A daily title is available exactly when its summary is ready`})}),R=e.strictObject({...Rn,contractVersion:e.literal(3),days:e.array(Vn),unassignedEntries:e.array(Bn)}).superRefine((e,t)=>{let n=I.safeParse({contractVersion:2,generatedAt:e.generatedAt,timeZone:e.timeZone,processing:e.processing,days:e.days.map(({title:e,...t})=>({...t,entries:t.entries.map(({title:e,...t})=>t)})),unassignedEntries:e.unassignedEntries.map(({title:e,...t})=>t)});if(!n.success)for(let e of n.error.issues)t.addIssue({...e})});function Hn(e){return{improvementDays:e.days.filter(e=>e.outcome===`improvement`||e.outcome===`both`).length,resetDays:e.days.filter(e=>e.outcome===`reset`||e.outcome===`both`).length}}function Un(e){return R.parse(e)}const Wn=In,Gn=I.shape,Kn=R.shape.unassignedEntries,qn=Gn.days.element.omit({summary:!0}).extend({entries:Kn}),z=e.strictObject({...Gn,contractVersion:e.literal(4),days:e.array(qn).length(28),unassignedEntries:Kn}).superRefine((e,t)=>{for(let[n,r]of e.days.entries())r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`}),r.outcome!==kn(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function Jn(e){return z.parse(e)}function Yn(e,t){let n=new Set;for(let r of e)n.has(r.eventId)&&t.addIssue({code:`custom`,message:`Duplicate activity eventId`}),n.add(r.eventId)}function Xn(e,t,n){let r=n.reduce((t,n)=>t+e.reactionCounts[n],0);(!Number.isSafeInteger(r)||r!==e.reactionTotal)&&t.addIssue({code:`custom`,path:[`reactionTotal`],message:`Total must equal all reaction counts`})}async function Zn(e,t,n){if(e.status!==200){let t={status:e.status,statusText:e.statusText};try{await e.body?.cancel()}catch(e){throw Error(`activity_file_http_error`,{cause:{...t,cancellationCause:e}})}throw Error(`activity_file_http_error`,{cause:t})}if(e.body===null)throw Error(`activity_file_body_missing`);let r=e.body.getReader(),i=[],a=0;try{for(;;){let e=await r.read();if(e.done)break;if(a+=e.value.byteLength,a>n)throw Error(`activity_file_too_large`,{cause:{maxBytes:n,observedBytes:a}});i.push(e.value)}let e=new Uint8Array(a),o=0;for(let t of i)e.set(t,o),o+=t.byteLength;return t.parse(JSON.parse(new TextDecoder(`utf-8`,{fatal:!0}).decode(e)))}catch(e){try{await r.cancel()}catch{}throw Error(`activity_file_read_failed`,{cause:e})}finally{r.releaseLock()}}function Qn(e,t,n){let r=new TextEncoder().encode(JSON.stringify(t.parse(e)));if(r.byteLength>n)throw Error(`activity_file_too_large`,{cause:{byteLength:r.byteLength}});return r}const B=[`👍`,`😂`,`🤡`,`💀`,`😭`,`🔥`,`🎉`,`👀`,`🙏`,`🫠`],$n=e.enum(B),V=e.string().min(1).max(128),H=524288,er=`https://data.radarultra.com/activity/v1/latest.json`,tr=`https://data.radarultra.com/activity/v2/latest.json`,nr=N.extend({eventId:V}),rr=P.safeExtend({days:e.array(P.shape.days.element.extend({entries:e.array(nr)})).length(28),undatedEntries:e.array(nr)});function ir(e,t){Yn([...e.days.flatMap(e=>e.entries),...e.undatedEntries],t)}const ar=rr.superRefine(ir),or=e.record($n,e.number().int().nonnegative()),sr=e.strictObject({reactionCounts:or,reactionTotal:e.number().int().nonnegative()});function cr(e,t){Xn(e,t,B)}const lr=nr.extend(sr.shape).superRefine(cr),ur=rr.safeExtend({days:e.array(rr.shape.days.element.extend({entries:e.array(lr)})).length(28),undatedEntries:e.array(lr)}).superRefine(ir),U=e.strictObject({publishedAt:e.iso.datetime(),reactionIds:e.array($n).length(B.length).refine(e=>new Set(e).size===B.length,`Every reaction must occur exactly once`),progress:ur}),dr=R.shape,fr=dr.unassignedEntries.element.safeExtend({eventId:V}),pr=e.strictObject({...dr,days:e.array(dr.days.element.safeExtend({entries:e.array(fr)})).length(28),unassignedEntries:e.array(fr)}),mr=pr.superRefine((e,t)=>{let n=({eventId:e,...t})=>t,r=R.safeParse({...e,days:e.days.map(e=>({...e,entries:e.entries.map(n)})),unassignedEntries:e.unassignedEntries.map(n)});if(!r.success)for(let e of r.error.issues)t.addIssue({...e});Yn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),hr=fr.safeExtend(sr.shape).superRefine(cr),gr=pr.safeExtend({days:e.array(dr.days.element.safeExtend({entries:e.array(hr)})).length(28),unassignedEntries:e.array(hr)}).superRefine((e,t)=>{let n=({reactionCounts:e,reactionTotal:t,...n})=>n,r=mr.safeParse({...e,days:e.days.map(e=>({...e,entries:e.entries.map(n)})),unassignedEntries:e.unassignedEntries.map(n)});if(!r.success)for(let e of r.error.issues)t.addIssue({...e})}),_r=U.extend({progress:gr}),vr=z.shape,yr=vr.unassignedEntries.element.safeExtend({eventId:V}),br=z.safeExtend({days:e.array(vr.days.element.safeExtend({entries:e.array(yr)})).length(28),unassignedEntries:e.array(yr)}).superRefine((e,t)=>{Yn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),xr=yr.safeExtend(sr.shape).superRefine(cr),Sr=br.safeExtend({days:e.array(vr.days.element.safeExtend({entries:e.array(xr)})).length(28),unassignedEntries:e.array(xr)}),Cr=U.extend({progress:Sr});async function wr(e){return Zn(e,U,H)}async function Tr(e){return Zn(e,_r,H)}async function Er(e){return Zn(e,Cr,H)}function Dr(e){return Qn(e,U,H)}function Or(e){return Qn(e,_r,H)}function kr(e){return Qn(e,Cr,H)}const Ar=e.strictObject({changeId:e.string().min(1).max(128),eventId:e.string().min(1).max(128),revision:e.int().positive(),kind:e.enum([`created`,`updated`,`withdrawn`]),date:e.iso.date().nullable(),entry:N,receivedAt:e.iso.datetime().nullable(),acceptedAt:e.iso.datetime()}),jr=e.strictObject({contractVersion:e.literal(1),changes:e.array(Ar),nextCursor:e.string().min(1),hasMore:e.boolean()}),Mr=Ar.extend({dayNumber:P.shape.days.element.shape.dayNumber.nullable()}),Nr=jr.extend({contractVersion:e.literal(2),changes:e.array(Mr)}),Pr=e.int().min(0).max(2**53-1),Fr=e.int().min(1).max(28),Ir=e.enum([`yes`,`no`]).nullable(),Lr=e.strictObject({choice:Ir}),Rr=e.strictObject({yes:Pr,no:Pr,total:Pr}).superRefine((e,t)=>{(!Number.isSafeInteger(e.yes+e.no)||e.total!==e.yes+e.no)&&t.addIssue({code:`custom`,path:[`total`],message:`Total must equal the effective choices.`})}),zr=e.strictObject({dayNumber:Fr,state:e.enum([`unopened`,`open`,`closed`]),choice:Ir,outcome:e.enum([`unconfirmed`,`yes`,`no`]),personalResult:e.enum([`none`,`waiting`,`correct`,`incorrect`]),corrected:e.boolean(),counts:Rr}).superRefine((e,t)=>{let n=e.choice===null?`none`:e.outcome===`unconfirmed`?`waiting`:e.choice===e.outcome?`correct`:`incorrect`;e.personalResult!==n&&t.addIssue({code:`custom`,path:[`personalResult`],message:`Personal result must match the confirmed outcome and choice.`}),e.state!==`closed`&&e.outcome!==`unconfirmed`&&t.addIssue({code:`custom`,path:[`outcome`],message:`An open or unopened day cannot have a confirmed result.`}),e.state===`unopened`&&(e.choice!==null||e.counts.total!==0)&&t.addIssue({code:`custom`,path:[`state`],message:`An unopened day cannot have choices.`})}),Br=e.strictObject({revision:Pr,openDayNumber:Fr.nullable(),days:e.array(zr).length(28)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries()){r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Every official day must occur once, in order.`});let i=e.openDayNumber===null||r.dayNumber<e.openDayNumber?`closed`:r.dayNumber===e.openDayNumber?`open`:`unopened`;r.state!==i&&t.addIssue({code:`custom`,path:[`days`,n,`state`],message:`Only the next official day may be open.`})}}),Vr=e.strictObject({error:e.strictObject({code:e.enum([`invalid_request`,`payload_too_large`,`unsupported_media_type`,`origin_not_allowed`,`rate_limited`,`dependency_unavailable`,`internal_error`,`day_closed`,`identity_unavailable`]),message:e.string().min(1).max(2048),requestId:e.string().min(1).max(128),operation:e.enum([`get_guesses`,`set_guess`]),stage:e.string().min(1).max(128),cause:e.record(e.string(),e.unknown()),saveOutcome:e.enum([`not_saved`,`unknown`]).optional()})}).superRefine(({error:e},t)=>{e.operation===`set_guess`!=(e.saveOutcome!==void 0)&&t.addIssue({code:`custom`,path:[`error`,`saveOutcome`],message:`Only save failures must include a save outcome.`})}),Hr=e.strictObject({"zh-Hans":b.shape.noticeTimeline.element.shape.sourceTextZh,"zh-Hant":b.shape.noticeTimeline.element.shape.sourceTextZh,ja:b.shape.noticeTimeline.element.shape.sourceTextZh,ko:b.shape.noticeTimeline.element.shape.sourceTextZh}),Ur=b.shape.noticeTimeline.element.omit({sourceTextZh:!0}).extend({sourceTranslations:Hr}).strict(),Wr=e.strictObject({...b.shape,contractVersion:e.literal(2),noticeTimeline:e.array(Ur).min(1).max(r.actionDetail.noticeTimeline)}),Gr=e.strictObject({...x.shape,noticeTimeline:e.array(Ur.omit({phase:!0}).extend({kinds:x.shape.noticeTimeline.element.shape.kinds}).strict()).min(1).max(r.actionDetail.noticeTimeline)}),Kr=e=>{let{sourceTranslations:t,...n}=e;return{...n,sourceTextZh:t[`zh-Hans`]}},qr=e=>({...e,contractVersion:1,noticeTimeline:e.noticeTimeline.map(Kr)}),Jr=e=>({...e,noticeTimeline:e.noticeTimeline.map(Kr)}),Yr=(e,t)=>{for(let n of e.error?.issues??[])t.addIssue({...n})},W=Wr.superRefine((e,t)=>{Yr(b.safeParse(qr(e)),t)}),Xr=Gr.superRefine((e,t)=>{Yr(x.safeParse(Jr(e)),t)}),Zr=e.strictObject({...S.shape,contractVersion:e.literal(2),actions:e.array(W).min(1).max(r.analysis.actions),pendingResetActions:e.array(Xr).max(r.analysis.actions)}).superRefine((e,t)=>{Yr(S.safeParse({...e,contractVersion:1,actions:e.actions.map(qr),pendingResetActions:e.pendingResetActions.map(Jr)}),t),new TextEncoder().encode(JSON.stringify(e)).byteLength>r.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`export_utf8_size_limit_exceeded`,path:[]})}),Qr=e=>W.parse(e),$r=e=>Xr.parse(e),ei=e=>Zr.parse(e);function ti(e){let t=ei(e);return S.parse({...t,contractVersion:1,actions:t.actions.map(qr),pendingResetActions:t.pendingResetActions.map(Jr)})}const G=b.shape.noticeTimeline.element.shape,ni=e.enum([`initial`,`supplement`,`correction`]).nullable(),ri=e.strictObject({authoredAt:G.authoredAt,role:ni,sourceUrl:G.sourceUrl,sourceText:G.sourceText,sourceTextZh:G.sourceTextZh}),ii=e.array(ri).min(1).superRefine((e,t)=>{let n=new Set,r;for(let[i,a]of e.entries()){if(n.has(a.sourceUrl)&&t.addIssue({code:`custom`,path:[i,`sourceUrl`],message:`An original post may appear only once per improvement`}),n.add(a.sourceUrl),!G.authoredAt.safeParse(a.authoredAt).success){r=void 0;continue}if(r!==void 0){let e=C(r.authoredAt,a.authoredAt);(e>0||e===0&&r.sourceUrl>a.sourceUrl)&&t.addIssue({code:`custom`,path:[i],message:`Posts must be ordered by authoredAt and sourceUrl`})}r=a}}),ai=Wn,oi=N.omit({description:!0}).extend({category:e.literal(`improvement`),title:L,posts:ii}),si=N.extend({category:e.enum([`direct_reset`,`reset_card`]),title:L}),ci=e.discriminatedUnion(`category`,[oi,si]),li=z.shape,ui=li.unassignedEntries.element.shape.date;function di(e,t){e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}const fi=e.discriminatedUnion(`category`,[oi.extend({date:ui}).superRefine(di),si.extend({date:ui}).superRefine(di)]),pi=e.strictObject({...li,contractVersion:e.literal(5),days:e.array(li.days.element.extend({entries:e.array(fi)})).length(28),unassignedEntries:e.array(fi)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries())r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`}),r.outcome!==kn(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function mi(e){return pi.parse(e)}const hi=`https://data.radarultra.com/activity/v3/latest.json`,gi=pi.shape,[_i,vi]=gi.unassignedEntries.element.options,yi=_i.safeExtend({eventId:V}),bi=vi.safeExtend({eventId:V}),xi=e.discriminatedUnion(`category`,[yi,bi]),Si=pi.safeExtend({days:e.array(gi.days.element.extend({entries:e.array(xi)})).length(28),unassignedEntries:e.array(xi)}).superRefine((e,t)=>{Yn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),Ci={reactionCounts:or,reactionTotal:e.number().int().nonnegative()},wi=(e,t)=>Xn(e,t,B),Ti=e.discriminatedUnion(`category`,[yi.safeExtend(Ci).superRefine(wi),bi.safeExtend(Ci).superRefine(wi)]),Ei=Si.safeExtend({days:e.array(gi.days.element.extend({entries:e.array(Ti)})).length(28),unassignedEntries:e.array(Ti)}),Di=U.extend({progress:Ei});async function Oi(e){return Zn(e,Di,H)}function ki(e){return Qn(e,Di,H)}const Ai=e.discriminatedUnion(`category`,[oi,N.extend({category:e.enum([`direct_reset`,`reset_card`])})]),ji=Mr.extend({entry:Ai}),Mi=Nr.extend({contractVersion:e.literal(3),changes:e.array(ji)});function Ni(e){return ji.parse(e)}function Pi(e){return Mi.parse(e)}const Fi=`https://radarultra.com`,Ii=[`zh-Hans`,`zh-Hant`,`en`,`ja`,`ko`],Li={"zh-Hans":`/zh`,"zh-Hant":`/zh-hant`,en:``,ja:`/ja`,ko:`/ko`},Ri={reset:`/codex`,improvement:`/codex/28-day-challenge`,changelog:`/codex/changelog`,models:`/codex/models`},K=e.discriminatedUnion(`product`,[e.strictObject({product:e.literal(`cli`),version:e.string().regex(/^\d+\.\d+\.\d+$/)}),e.strictObject({product:e.literal(`app`),version:e.string().regex(/^\d{2}\.\d{3,4}$/)})]),q=e.string().regex(/^(?!\.{1,2}$)[a-z0-9.-]+$/);function J(e,t){return Fi+Li[t]+Ri[e]}function zi(e,t,n){let r=K.parse({product:e,version:t});return`${J(`changelog`,n)}/${r.product}/${r.version}`}function Bi(e,t){return`${J(`models`,t)}/${q.parse(e)}`}const Vi=Object.freeze({timeZone:`America/Los_Angeles`,startDate:`2026-10-05`,endDate:`2026-11-01`}),Hi=Date.parse(`${Vi.startDate}T00:00:00Z`),Ui=(Date.parse(`${Vi.endDate}T00:00:00Z`)-Hi)/864e5+1,Wi=new Intl.DateTimeFormat(`en-CA`,{timeZone:Vi.timeZone,year:`numeric`,month:`2-digit`,day:`2-digit`});function Gi(e){let t=Wi.formatToParts(e),n=e=>Number(t.find(t=>t.type===e).value),r=(Date.UTC(n(`year`),n(`month`)-1,n(`day`))-Hi)/864e5,i=r<0?`before`:r>=Ui?`ended`:`live`,a=Math.min(Ui,Math.max(1,r+1));return{phase:i,today:a,ongoingDay:i===`live`?a:null}}const Ki=e.enum([`reset`,`improvement`]),qi=e.array(Ki).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),Ji=t=>e.url().refine(e=>Ii.some(n=>e===J(t,n)),`notification_target_url_invalid`),Yi=e.discriminatedUnion(`kind`,[e.object({kind:e.literal(`reset`),webUrl:Ji(`reset`),miniPath:e.literal(`pages/index/index`)}).strict(),e.object({kind:e.literal(`improvement`),webUrl:Ji(`improvement`),miniPath:e.literal(`pages/index/index?page=challenge`)}).strict()]),Xi=e.object({topics:qi,target:Yi}).strict().refine(e=>e.topics.includes(e.target.kind),`notification_target_topic_mismatch`),Zi=e.enum([`reset`,`improvement`,`clue`]),Qi=e.object({topics:e.array(Zi).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),target:Yi}).strict().refine(e=>e.topics.some(t=>(t===`clue`?`reset`:t)===e.target.kind),`notification_target_topic_mismatch`);function $i(e,t){let n=ea(e===`clue`?`reset`:e,t);return Qi.parse({...n,topics:[e]})}function ea(e,t){return Xi.parse({topics:[e],target:{kind:e,webUrl:J(e,t),miniPath:e===`reset`?`pages/index/index`:`pages/index/index?page=challenge`}})}const ta=e.object({notificationId:e.uuid(),eventId:e.uuid(),title:e.string().trim().min(1).max(512),createdAt:e.iso.datetime(),deliverBy:e.iso.datetime(),...Xi.shape}).strict().superRefine((e,t)=>{e.topics.includes(e.target.kind)||t.addIssue({code:`custom`,message:`notification_target_topic_mismatch`}),C(e.deliverBy,e.createdAt)<=0&&t.addIssue({code:`custom`,message:`notification_task_deadline_invalid`})});function na(e,t){return C(e.createdAt,t.createdAt)||(e.notificationId<t.notificationId?-1:+(e.notificationId>t.notificationId))}const ra=`/api/v1/notification-tasks`,ia=100,aa=e.string().min(1).max(8192),oa=e.object({cursor:aa.optional()}).strict(),sa=e.object({contractVersion:e.literal(1),roundCursor:aa,notifications:e.array(ta).max(100),nextCursor:aa.nullable()}).strict().superRefine((e,t)=>{new Set(e.notifications.map(e=>e.notificationId)).size!==e.notifications.length&&t.addIssue({code:`custom`,message:`notification_task_duplicate`});for(let n=1;n<e.notifications.length;n++)na(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`})}),ca=`/api/browser-notifications`,la=e.string().min(1).max(128),ua=e.uuid(),da=e.enum(Ii),fa=e.strictObject({reset:e.boolean(),improvement:e.boolean()}),pa=`[cdef][\\w-]{21}`,ma=e.strictObject({fid:e.string().regex(RegExp(`^${pa}$`))});function ha(e){return e.replace(RegExp(`(^|[^\\w-])${pa}(?![\\w-])`,`g`),`$1[registration]`)}const Y={operationId:ua,expectedRevision:la},ga=e.discriminatedUnion(`action`,[e.strictObject({...Y,action:e.literal(`register`),topics:fa.refine(e=>e.reset||e.improvement,`subscription_topic_required`),locale:da,registration:ma}),e.strictObject({...Y,action:e.literal(`set_topics`),topics:fa}),e.strictObject({...Y,action:e.literal(`set_locale`),locale:da}),e.strictObject({...Y,action:e.literal(`restore`),registration:ma}),e.strictObject({...Y,action:e.literal(`retry`)}),e.strictObject({...Y,action:e.literal(`cancel`)})]),_a=e.strictObject({operationId:ua.optional(),expectedRevision:la.optional()}).refine(e=>e.operationId===void 0==(e.expectedRevision===void 0),`subscription_operation_reference_incomplete`),va=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:ua.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())}),ya=e.strictObject({id:ua,state:e.enum([`pending`,`applied`,`rejected`,`unknown`,`superseded`,`not_found`]),error:va.optional()}),ba=e.strictObject({topicSettings:e.strictObject({state:e.enum([`initial`,`saved`]),revision:la,topics:fa,locale:da.nullable()}),registrationState:e.enum([`none`,`ready`,`invalid`,`changing`]),registrationKey:e.string().regex(/^[a-f0-9]{64}$/).nullable(),manualRetryRequired:e.boolean(),operation:ya.nullable()});function xa(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 Sa=e.strictObject({data:ba}),Ca=e.strictObject({error:va});function wa(e){return{topicSettings:{state:`initial`,revision:e,topics:{reset:!0,improvement:!1},locale:null},registrationState:`none`,registrationKey:null,manualRetryRequired:!1,operation:null}}const Ta=fa.extend({clue:e.boolean().default(!1)}),[Ea,Da,...Oa]=ga.options,ka=e.discriminatedUnion(`action`,[Ea.extend({topics:Ta.refine(e=>Object.values(e).some(Boolean),`subscription_topic_required`)}),Da.extend({topics:Ta}),...Oa]),Aa=ba.extend({topicSettings:ba.shape.topicSettings.extend({topics:Ta})}),ja=e.strictObject({data:Aa});function Ma(e){return Aa.parse(wa(e))}function Na(e){let{clue:t,...n}=e.topicSettings.topics;return ba.parse({...e,topicSettings:{...e.topicSettings,topics:n}})}function Pa(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 Fa=20,Ia=2*1024*1024,La=`/api/v1/improvements`,Ra=e.string().min(1).max(1024),[za]=Si.shape.unassignedEntries.element.options,Ba=za.safeExtend({date:e.iso.date().refine(e=>e>Vi.endDate,`improvement_must_follow_campaign`)}),Va=e.strictObject({}),Ha=e.strictObject({challengeEnded:e.boolean(),observedAt:e.iso.datetime()}),Ua=e.strictObject({cursor:Ra.nullable(),limit:e.literal(20)}),Wa=Ha.extend({entries:e.array(Ba).max(20),nextCursor:Ra.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`})}),Ga=e.strictObject({eventIds:e.array(V).min(1).max(128)}),Ka=e.strictObject({eventIds:e.array(V).max(128)}),qa=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())})}),Ja=`/tibo-source/v1/latest.json`,Ya=512*1024,Xa=e.iso.datetime({offset:!0}),Za=b.shape.noticeTimeline.element,Qa=e.strictObject({contractVersion:e.literal(1),observedAt:Xa,check:e.strictObject({checkedAt:Xa,freshUntil:Xa,active:e.boolean()}).nullable(),latestPost:e.strictObject({authoredAt:Xa,sourceUrl:Za.shape.sourceUrl,sourceText:e.string(),sourceTranslations:Hr,resetRelevance:e.enum([`related`,`unrelated`,`unknown`])}).nullable()});async function $a(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 Qa.parse(JSON.parse(o))}const eo=`/reset-clue/v1/latest.json`,to=4320*60*1e3,no=r.exportUtf8Bytes,ro=W.shape.noticeTimeline.element.pick({authoredAt:!0,sourceUrl:!0,sourceText:!0,sourceTranslations:!0,contentCompleteness:!0}).extend({plannedTiming:Re.nullable(),expiresAt:W.shape.noticeTimeline.element.shape.authoredAt}).strict().superRefine((e,t)=>{Date.parse(e.expiresAt)!==Date.parse(e.authoredAt)+2592e5&&t.addIssue({code:`custom`,message:`reset_clue_expiry_mismatch`,path:[`expiresAt`]})}),io=e.strictObject({contractVersion:e.literal(1),clue:ro.nullable()}),ao=e=>io.parse(e);function oo(e,t){return e.clue!==null&&t.getTime()<Date.parse(e.clue.expiresAt)?e.clue:null}async function so(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>no)throw Error(`reset_clue_too_large`,{cause:{status:e.status,bytes:r}});n.push(i.value)}}finally{try{await t.cancel()}catch{}t.releaseLock()}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;let o=new TextDecoder(`utf-8`,{fatal:!0}).decode(i);if(!e.ok)throw Error(`reset_clue_http_error`,{cause:{status:e.status,upstream:o.slice(0,4e3)}});return ao(JSON.parse(o))}const X=e.enum(Ii),co=e.string().regex(/^\d{4}-(?:0[1-9]|1[0-2])$/),Z=e.string().trim().min(1),lo=e.url({protocol:/^https$/}),Q=e.discriminatedUnion(`kind`,[e.strictObject({kind:e.literal(`instant`),at:e.iso.datetime()}),e.strictObject({kind:e.literal(`date`),date:e.iso.date()})]),uo=e.strictObject({operation:Z,stage:Z,cause:Gt});function fo(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:uo})])}function po(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 mo(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 ho=`/codex-releases/v2/directory.json`,go=128*1024,_o=128*1024,vo=256*1024,yo=Q,bo={product:e.enum([`app`,`cli`]),version:Z,published:Q,month:co,revision:Z},xo=e.strictObject(bo).superRefine(So);function So(e,t){let n=K.safeParse({product:e.product,version:e.version});if(!n.success)for(let e of n.error.issues)t.addIssue({...e});e.product===`cli`!=(e.published.kind===`instant`)&&t.addIssue({code:`custom`,path:[`published`],message:`product_date_precision_mismatch`}),(e.published.kind===`instant`?e.published.at:e.published.date).slice(0,7)!==e.month&&t.addIssue({code:`custom`,path:[`month`],message:`published_month_mismatch`})}function Co(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 wo=po(e.strictObject({contractVersion:e.literal(2),releases:e.array(xo),latest:e.strictObject({app:e.string().nullable(),cli:e.string().nullable()})}).superRefine((e,t)=>{Co(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`})}}),go),To=e.strictObject({state:e.literal(`not_applicable`),reason:e.literal(`no_curated_notes`)}),Eo=e.union([fo(e.strictObject({locale:X,points:e.array(Z).min(1).max(5)})),To]),Do=e.strictObject({...bo,source:e.strictObject({kind:e.enum([`github`,`official`]),url:lo}),summary:Eo,notesCount:e.number().int().nonnegative()}).superRefine((e,t)=>{So(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`})}),Oo=po(e.strictObject({contractVersion:e.literal(2),locale:X,month:co,releases:e.array(Do)}).superRefine((e,t)=>{Co(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`})}),_o),ko=e.array(e.strictObject({title:Z.nullable(),items:e.array(e.strictObject({text:Z,refs:Z.nullable()})).min(1)})).min(1),Ao=po(e.strictObject({contractVersion:e.literal(2),product:e.enum([`app`,`cli`]),version:Z,revision:Z,locale:X,original:e.array(ko.element),translation:e.union([fo(ko),To]).nullable()}).superRefine((e,t)=>{let n=K.safeParse({product:e.product,version:e.version});if(!n.success)for(let e of n.error.issues)t.addIssue({...e});if(e.locale===`en`!=(e.translation===null)&&t.addIssue({code:`custom`,path:[`translation`],message:`translation_locale_mismatch`}),e.locale!==`en`&&e.original.length===0!=(e.translation?.state===`not_applicable`)&&t.addIssue({code:`custom`,path:[`translation`],message:`curated_notes_translation_state_mismatch`}),e.translation?.state===`ready`){let n=e.translation.value;(n.length!==e.original.length||e.original.some((e,t)=>{let r=n.at(t);return r===void 0||e.title===null!=(r.title===null)||e.items.length!==r.items.length||e.items.some((e,t)=>e.refs!==r.items.at(t)?.refs)}))&&t.addIssue({code:`custom`,path:[`translation`],message:`translation_structure_mismatch`})}}),vo),jo=e=>wo.parse(e),Mo=e=>Oo.parse(e),No=e=>Ao.parse(e),Po=e=>mo(e,`codex_release_directory`,go,wo),Fo=e=>mo(e,`codex_release_month`,_o,Oo),Io=e=>mo(e,`codex_release_notes`,vo,Ao);function Lo(e,t){return`/codex-releases/v2/${X.parse(e)}/${co.parse(t)}.json`}function Ro(e,t,n){let r=K.parse({product:t,version:n});return`/codex-releases/v2/${X.parse(e)}/notes/${r.product}/${r.version}.json`}const zo=128*1024;function $(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`known`),value:t,source:lo}),e.strictObject({state:e.literal(`unavailable`),reason:e.enum([`not_announced`,`not_listed`]),source:lo.nullable()})])}const Bo=e.strictObject({input:Z,cached:Z,output:Z}),Vo=e.strictObject({modelId:q,name:Z,group:e.enum([`current`,`retired`]),status:e.enum([`available`,`retiring`,`retired`]),launched:$(Q),chatgptRetirement:$(Q),apiRetirement:$(Q),credits:$(Bo),apiPrice:$(Bo),multiple:e.string().regex(/^(?:0|[1-9]\d*)(?:\.\d+)?$/).refine(e=>Number.isFinite(Number(e))&&Number(e)>0).nullable(),plans:$(e.array(Z).min(1)),surfaces:$(e.array(Z).min(1)),about:fo(e.strictObject({locale:X,paragraphs:e.array(Z).min(1)})),sources:e.array(e.strictObject({label:Z,url:lo})).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`})}),Ho=po(e.strictObject({contractVersion:e.literal(1),locale:X,models:e.array(Vo),multipleBase:e.strictObject({modelId:q,name:Z}).nullable(),upcomingRetirement:e.strictObject({names:Z,modelIds:e.array(q).min(1),surface:e.enum([`api`,`chatgpt`]),at:Q}).nullable()}).superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.models.entries())n.has(i.modelId)&&t.addIssue({code:`custom`,path:[`models`,r,`modelId`],message:`duplicate_model_identity`}),n.add(i.modelId),i.about.state===`ready`&&i.about.value.locale!==e.locale&&i.about.value.locale!==`en`&&t.addIssue({code:`custom`,path:[`models`,r,`about`,`value`,`locale`],message:`model_description_locale_mismatch`}),i.multiple!==null&&(e.multipleBase===null||i.credits.state!==`known`)&&t.addIssue({code:`custom`,path:[`models`,r,`multiple`],message:`multiple_requires_base_and_credits`});if(e.multipleBase!==null){let n=e.models.find(t=>t.modelId===e.multipleBase?.modelId);(n===void 0||n.group!==`current`||n.credits.state!==`known`||n.multiple!==`1`||n.name!==e.multipleBase.name)&&t.addIssue({code:`custom`,path:[`multipleBase`],message:`multiple_base_mismatch`})}let r=e.upcomingRetirement;if(r!==null){new Set(r.modelIds).size!==r.modelIds.length&&t.addIssue({code:`custom`,path:[`upcomingRetirement`,`modelIds`],message:`duplicate_retirement_model`});for(let n of r.modelIds){let i=e.models.find(e=>e.modelId===n),a=r.surface===`api`?i?.apiRetirement:i?.chatgptRetirement;(a?.state!==`known`||JSON.stringify(a.value)!==JSON.stringify(r.at))&&t.addIssue({code:`custom`,path:[`upcomingRetirement`],message:`retirement_model_date_mismatch`})}}}),zo),Uo=e=>Ho.parse(e),Wo=e=>mo(e,`codex_models`,zo,Ho),Go=e=>`/codex-models/v1/${X.parse(e)}.json`;export{an as RadarResetSourceContractErrorV2,oo as activeRadarResetClue,na as compareRadarNotificationTasks,He as compareRadarResetActionDetailsV1,C as compareRadarResetUtcTimestampsV1,$i as createRadarBrowserNotificationProjection,Gi as createRadarCodexProgressCalendar,ea as createRadarNotificationProjection,wn as createRadarResetSourceErrorEnvelopeV2,Dr as encodeRadarActivityFile,kr as encodeRadarActivityFileV2,ki as encodeRadarActivityFileV3,pn as encodeRadarResetDetailMultipartV2,Or as encodeRadarTitledActivityFile,ct as formatRadarResetPositiveDecimalV2,st as formatRadarResetUInt64DecimalV2,wa as initialRadarBrowserSubscription,Ma as initialRadarBrowserSubscriptionV2,Uo as parseRadarCodexModels,Ni as parseRadarCodexProgressChangeV3,Pi as parseRadarCodexProgressChangesV3,On as parseRadarCodexProgressV1,Fn as parseRadarCodexProgressV2,Un as parseRadarCodexProgressV3,Jn as parseRadarCodexProgressV4,mi as parseRadarCodexProgressV5,jo as parseRadarCodexReleaseDirectory,Mo as parseRadarCodexReleaseMonth,No as parseRadarCodexReleaseNotes,We as parseRadarResetActionDetailV1,Qr as parseRadarResetActionDetailV2,bt as parseRadarResetActionSummaryV2,Ue as parseRadarResetAnalysisV1,ao as parseRadarResetClueSnapshot,_n as parseRadarResetDetailMultipartV2,Ge as parseRadarResetExportV1,ei as parseRadarResetExportV2,Ke as parseRadarResetPendingActionV1,$r as parseRadarResetPendingActionV2,at as parseRadarResetPositiveDecimalV2,St as parseRadarResetPublicationHomeFactsV2,rn as parseRadarResetPublicationRevisionAvailableV2,Xt as parseRadarResetReadActionsRequestV2,en as parseRadarResetReadActionsSuccessV2,Zt as parseRadarResetReadChangesRequestV2,tn as parseRadarResetReadChangesSuccessV2,Qt as parseRadarResetReadDetailBatchRequestV2,Yt as parseRadarResetReadHeadRequestV2,$t as parseRadarResetReadHeadSuccessV2,oe as parseRadarResetSnapshotAvailableV1,nn as parseRadarResetSourceErrorEnvelopeV2,it as parseRadarResetUInt64DecimalV2,xa as projectRadarBrowserSubscriptionSelection,Na as projectRadarBrowserSubscriptionV1,ti as projectRadarResetExportV1FromV2,qe as projectRadarResetPrimarySourceV1,V as radarActivityEventIdSchema,U as radarActivityFileSchema,er as radarActivityFileUrl,Cr as radarActivityFileV2Schema,tr as radarActivityFileV2Url,Di as radarActivityFileV3Schema,hi as radarActivityFileV3Url,H as radarActivityMaxBytes,ar as radarActivityProgressSchema,br as radarActivityProgressV2Schema,Si as radarActivityProgressV3Schema,or as radarActivityReactionCountsSchema,$n as radarActivityReactionIdSchema,B as radarActivityReactionIds,Qi as radarBrowserNotificationProjectionSchema,Zi as radarBrowserNotificationTopicSchema,ma as radarBrowserRegistrationSchema,Ca as radarBrowserSubscriptionErrorRes,va as radarBrowserSubscriptionFailureSchema,ya as radarBrowserSubscriptionOperationSchema,_a as radarBrowserSubscriptionReadReq,Sa as radarBrowserSubscriptionRes,ga as radarBrowserSubscriptionSaveReq,ka as radarBrowserSubscriptionSaveV2Req,ja as radarBrowserSubscriptionV2Res,ba as radarBrowserSubscriptionViewSchema,Aa as radarBrowserSubscriptionViewV2Schema,ca as radarBrowserSubscriptionsPath,fa as radarBrowserTopicsSchema,Ta as radarBrowserTopicsV2Schema,Ir as radarCodexGuessChoiceSchema,Vr as radarCodexGuessErrorSchema,Lr as radarCodexGuessSaveReqSchema,Br as radarCodexGuessViewSchema,q as radarCodexModelIdSchema,Bi as radarCodexModelUrl,zo as radarCodexModelsMaxBytes,Go as radarCodexModelsPath,Ho as radarCodexModelsSchema,Vi as radarCodexProgressCalendar,Ar as radarCodexProgressChangeSchema,Mr as radarCodexProgressChangeV2Schema,ji as radarCodexProgressChangeV3Schema,jr as radarCodexProgressChangesV1Schema,Nr as radarCodexProgressChangesV2Schema,Mi as radarCodexProgressChangesV3Schema,N as radarCodexProgressEntrySchema,Ln as radarCodexProgressEntryV3Schema,ci as radarCodexProgressEntryV5Schema,oi as radarCodexProgressImprovementV5Schema,ni as radarCodexProgressPostRoleV5Schema,ri as radarCodexProgressPostV5Schema,ii as radarCodexProgressPostsV5Schema,si as radarCodexProgressResetEntryV5Schema,Hn as radarCodexProgressScore,L as radarCodexProgressTitleV3Schema,P as radarCodexProgressV1Schema,An as radarCodexProgressV2MaxBytes,I as radarCodexProgressV2Schema,In as radarCodexProgressV3MaxBytes,R as radarCodexProgressV3Schema,Wn as radarCodexProgressV4MaxBytes,z as radarCodexProgressV4Schema,ai as radarCodexProgressV5MaxBytes,pi as radarCodexProgressV5Schema,go as radarCodexReleaseDirectoryMaxBytes,ho as radarCodexReleaseDirectoryPath,wo as radarCodexReleaseDirectorySchema,K as radarCodexReleaseIdentitySchema,_o as radarCodexReleaseMonthMaxBytes,Lo as radarCodexReleaseMonthPath,Oo as radarCodexReleaseMonthSchema,vo as radarCodexReleaseNotesMaxBytes,Ro as radarCodexReleaseNotesPath,Ao as radarCodexReleaseNotesSchema,ko as radarCodexReleaseSectionsSchema,zi as radarCodexReleaseUrl,yo as radarCodexTimePointSchema,La as radarImprovementColumnPath,Ga as radarImprovementEligibilityReq,Ka as radarImprovementEligibilityRes,Ba as radarImprovementEntrySchema,qa as radarImprovementErrorRes,Va as radarImprovementHeadReq,Ha as radarImprovementHeadRes,Ia as radarImprovementPageMaxBytes,Ua as radarImprovementPageReq,Wa as radarImprovementPageRes,Fa as radarImprovementPageSize,Xi as radarNotificationProjectionSchema,Yi as radarNotificationTargetSchema,ia as radarNotificationTaskPageSize,ta as radarNotificationTaskSchema,ra as radarNotificationTasksPath,oa as radarNotificationTasksReq,sa as radarNotificationTasksRes,Ki as radarNotificationTopicSchema,qi as radarNotificationTopicsSchema,b as radarResetActionDetailV1Schema,W as radarResetActionDetailV2Schema,Dt as radarResetActionItemV2Schema,Ze as radarResetActionPageMaxBytesV2,Xe as radarResetActionPageMaxItemsV2,yt as radarResetActionSummaryV2Schema,Tt as radarResetActiveActionItemV2Schema,Pe as radarResetAnalysisV1Schema,n as radarResetAnalyzerContractVersionV1,s as radarResetAudienceValues,Ft as radarResetChangeCoverageV2Schema,$e as radarResetChangePageMaxBytesV2,Qe as radarResetChangePageMaxItemsV2,to as radarResetClueLifetimeMs,no as radarResetClueMaxBytes,eo as radarResetCluePath,ro as radarResetClueSchema,io as radarResetClueSnapshotSchema,t as radarResetContractVersionV1,Je as radarResetContractVersionV2,tt as radarResetDetailBatchMaxBytesV2,et as radarResetDetailBatchMaxChunksV2,Ct as radarResetDetailChunkReferenceV2Schema,jt as radarResetDetailChunkRequestV2Schema,wt as radarResetDetailManifestV2Schema,a as radarResetEffectValues,S as radarResetExportV1Schema,Zr as radarResetExportV2Schema,Le as radarResetNoticeKindValues,x as radarResetPendingActionV1Schema,Xr as radarResetPendingActionV2Schema,c as radarResetPlanValues,w as radarResetPositiveDecimalV2Schema,o as radarResetProductValues,r as radarResetPublicDataLimits,E as radarResetPublicIdV2Schema,xt as radarResetPublicationHomeFactsV2Schema,Jt as radarResetPublicationRevisionAvailableV2Schema,Re as radarResetPublicationTimingSchema,Lt as radarResetReadActionsDataV2Schema,kt as radarResetReadActionsRequestV2Schema,Vt as radarResetReadActionsSuccessV2Schema,Rt as radarResetReadChangesDataV2Schema,At as radarResetReadChangesRequestV2Schema,Ht as radarResetReadChangesSuccessV2Schema,Mt as radarResetReadDetailBatchRequestV2Schema,It as radarResetReadHeadDataV2Schema,Ot as radarResetReadHeadRequestV2Schema,Bt as radarResetReadHeadSuccessV2Schema,ee as radarResetReasonBasisValues,l as radarResetReasonCategoryValues,Gt as radarResetSafeCauseSnapshotV2Schema,i as radarResetSeriesValues,D as radarResetSha256V2Schema,ae as radarResetSnapshotAvailableV1Schema,Pt as radarResetSourceChangeV2Schema,Ut as radarResetSourceErrorCodeValuesV2,qt as radarResetSourceErrorEnvelopeV2Schema,Cn as radarResetSourceErrorHttpStatusV2,Sn as radarResetSourceErrorIsRetryableV2,Kt as radarResetSourceErrorV2Schema,Ye as radarResetSourceMaxRpcCallsV2,Hr as radarResetSourceTranslationsSchema,rt as radarResetUInt64DecimalV2Schema,ot as radarResetUInt64DecimalV2ToBigInt,T as radarResetUtcTimestampV2Schema,Et as radarResetWithdrawnActionItemV2Schema,Ya as radarTiboSourceStatusMaxBytes,Ja as radarTiboSourceStatusPath,Qa as radarTiboSourceStatusSchema,_r as radarTitledActivityFileSchema,mr as radarTitledActivityProgressSchema,Li as radarWebsiteLocalePrefixes,Ii as radarWebsiteLocales,Fi as radarWebsiteOrigin,Ri as radarWebsitePagePaths,J as radarWebsitePageUrl,wr as readRadarActivityFile,Er as readRadarActivityFileV2,Oi as readRadarActivityFileV3,Wo as readRadarCodexModels,Po as readRadarCodexReleaseDirectory,Fo as readRadarCodexReleaseMonth,Io as readRadarCodexReleaseNotes,so as readRadarResetClueSnapshot,$a as readRadarTiboSourceStatus,Tr as readRadarTitledActivityFile,ha as redactRadarBrowserRegistrationReferences,xn as toSafeCauseSnapshotV2,Pa as upgradeRadarBrowserSubscriptionCommandV1};
6
+ `),ne=O.encode(`\r
7
+ `),u=[],d=0;for(let e of n.chunks){if(!cn(c,l,d))return k(`source_stream_incomplete`,!0);d+=l.byteLength;let t=vn(c,te,d);if(t<0)return k(`source_stream_incomplete`,!0);let n=_n(c.slice(d,t));if(d=t+te.byteLength,n.get(`content-type`)!==`application/octet-stream`)return k(`source_chunk_mismatch`,!1);let r;try{r=sn.decode(fn(n.get(`x-radar-reset-action-id-b64`)))}catch(e){return k(`source_chunk_mismatch`,!1,e)}if(r!==e.resetActionId||n.get(`x-radar-detail-ordinal`)!==String(e.ordinal)||n.get(`x-radar-byte-size`)!==String(e.byteSize)||n.get(`x-radar-sha-256`)!==e.sha256)return k(`source_chunk_mismatch`,!1);if(d+e.byteSize+ne.byteLength>c.byteLength)return k(`source_stream_incomplete`,!0);let i=c.slice(d,d+e.byteSize);if(d+=e.byteSize,!cn(c,ne,d)||(d+=ne.byteLength,await pn(i)!==e.sha256))return k(`source_chunk_mismatch`,!1);u.push({...e,bytes:i})}return!cn(c,ee,d)||d+ee.byteLength!==c.byteLength?k(`source_stream_incomplete`,!0):u}const bn=/authorization|cookie|token|secret|password|api[-_]?key/iu;function xn(e,t){let n=[...e].slice(0,1024),r=``;for(let e of n){let n=O.encode(e).byteLength;if(n>t.remaining)break;t.remaining-=n,r+=e}return r}function Sn(e,t,n,r){if(e===null||typeof e==`boolean`)return e;if(typeof e==`string`)return xn(e,n);if(typeof e==`number`)return Number.isFinite(e)?e:String(e);if(typeof e==`bigint`||typeof e==`symbol`)return xn(String(e),n);if(e===void 0)return`undefined`;if(typeof e==`function`)return`[Function ${e.name||`anonymous`}]`;if(r.has(e))return`[Circular]`;if(t>=4)return`[DepthLimit]`;if(r.add(e),Array.isArray(e))return e.slice(0,16).map(e=>Sn(e,t+1,n,r));let i={},a=e instanceof Error?[[`type`,e.constructor.name],[`name`,e.name],[`message`,e.message],...e.cause===void 0?[]:[[`cause`,e.cause]],...Object.entries(e)]:Object.entries(e);for(let[e,o]of a.slice(0,16)){let a=xn(String(e),n);if(!(a.length===0||Object.hasOwn(i,a))&&(n.remaining-=Math.min(n.remaining,8),i[a]=bn.test(a)?`[REDACTED]`:Sn(o,t+1,n,r),n.remaining<=0))break}return i}function Cn(e){let t=Sn(e,0,{remaining:7e3},new Set),n=typeof t==`object`&&t&&!Array.isArray(t)?t:{type:e===null?`null`:typeof e,message:t};return Kt.parse(n),n}function wn(e){return e===`source_temporarily_unavailable`||e===`source_rpc_transport_failure`||e===`source_stream_incomplete`}function Tn(e){switch(e){case`source_invalid_request`:return 400;case`source_revision_unknown`:return 404;case`source_cursor_invalid`:case`source_chunk_mismatch`:return 409;case`source_response_over_capacity`:return 413;case`source_temporarily_unavailable`:case`source_rpc_transport_failure`:case`source_stream_incomplete`:return 503;case`source_integrity_conflict`:case`source_revision_identity_conflict`:case`source_sequence_exhausted`:return 500}}function En(e){let t={contractVersion:2,ok:!1,error:{code:e.code,operation:e.operation,stage:e.stage,...e.revision===void 0?{}:{revision:e.revision},retryable:wn(e.code),correlationId:e.correlationId,cause:Cn(e.cause)}};return Jt.parse(t)}const Dn=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),On=e.iso.date(),j=e.strictObject({category:e.enum([`improvement`,`direct_reset`,`reset_card`]),deliveryState:e.enum([`preview`,`landed`]),description:Dn,dateBasis:e.enum([`occurrence`,`announcement`,`unresolved`]),sourceUrls:e.array(e.url({protocol:/^https?$/})).min(1)}),kn=e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),text:Dn}),e.strictObject({state:e.enum([`pending`,`failed`,`not_applicable`]),text:e.null()})]),M=e.strictObject({contractVersion:e.literal(1),generatedAt:e.iso.datetime(),timeZone:e.string().refine(e=>{try{return new Intl.DateTimeFormat(`en`,{timeZone:e}),!0}catch{return!1}},`Invalid source time zone`),startDate:On,endDate:On,processing:e.strictObject({hasPending:e.boolean(),hasFailures:e.boolean()}),days:e.array(e.strictObject({date:On,dayNumber:e.number().int().min(1).max(28),outcome:e.enum([`unconfirmed`,`improvement`,`reset`,`both`]),entries:e.array(j),summary:kn})).length(28),undatedEntries:e.array(j)}).superRefine((e,t)=>{let n=Date.parse(`${e.startDate}T00:00:00Z`);for(let[r,i]of e.days.entries()){let e=new Date(n+r*864e5).toISOString().slice(0,10);(i.date!==e||i.dayNumber!==r+1)&&t.addIssue({code:`custom`,path:[`days`,r],message:`Days must be contiguous and numbered in order`}),i.entries.some(e=>e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`days`,r,`entries`],message:`Unresolved dates belong in undatedEntries`});let a=i.entries.filter(e=>e.deliveryState===`landed`),o=a.some(e=>e.category===`improvement`),s=a.some(e=>e.category!==`improvement`),c=o?s?`both`:`improvement`:s?`reset`:`unconfirmed`;(i.outcome!==c||a.length===0!=(i.summary.state===`not_applicable`))&&t.addIssue({code:`custom`,path:[`days`,r],message:`Outcome and summary must reflect landed evidence`})}e.days.at(-1)?.date!==e.endDate&&t.addIssue({code:`custom`,path:[`endDate`],message:`End must match the last activity day`}),e.undatedEntries.some(e=>e.dateBasis!==`unresolved`)&&t.addIssue({code:`custom`,path:[`undatedEntries`],message:`Undated entries must have unresolved dates`})});function An(e){return M.parse(e)}function jn(e){let t=e.filter(e=>e.deliveryState===`landed`),n=t.some(e=>e.category===`improvement`),r=t.some(e=>e.category!==`improvement`);return n?r?`both`:`improvement`:r?`reset`:`unconfirmed`}const Mn=524288,N=M.shape,Nn=N.days.element,Pn=j.extend({date:N.startDate.nullable()}).superRefine((e,t)=>{e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}),Fn=e.strictObject({state:e.enum([`unconfirmed`,`ongoing`,`ended`]),sourceUrls:e.array(j.shape.sourceUrls.element)}).superRefine((e,t)=>{e.state!==`unconfirmed`&&e.sourceUrls.length===0&&t.addIssue({code:`custom`,path:[`sourceUrls`],message:`Confirmed lifecycle states require source evidence`})}),In=Nn.omit({date:!0,entries:!0}).extend({entries:e.array(Pn),lifecycle:Fn}),P=e.strictObject({contractVersion:e.literal(2),generatedAt:N.generatedAt,timeZone:N.timeZone,processing:N.processing,days:e.array(In).length(28),unassignedEntries:e.array(Pn)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries()){r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`});let e=r.entries.filter(e=>e.deliveryState===`landed`),i=jn(r.entries);(r.outcome!==i||e.length===0!=(r.summary.state===`not_applicable`))&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome and summary must reflect landed evidence`})}});function Ln(e){return P.parse(e)}const Rn=Mn,F=e.strictObject({en:e.string().trim().min(1),zh:e.string().trim().min(1)}),zn=j.extend({title:F}),Bn=P.shape,Vn=Bn.days.element,Hn=Vn.shape.entries.element.safeExtend({title:F}),Un=Vn.extend({title:F.nullable(),entries:e.array(Hn)}).superRefine((e,t)=>{e.title!==null!=(e.summary.state===`ready`)&&t.addIssue({code:`custom`,path:[`title`],message:`A daily title is available exactly when its summary is ready`})}),I=e.strictObject({...Bn,contractVersion:e.literal(3),days:e.array(Un),unassignedEntries:e.array(Hn)}).superRefine((e,t)=>{let n=P.safeParse({contractVersion:2,generatedAt:e.generatedAt,timeZone:e.timeZone,processing:e.processing,days:e.days.map(({title:e,...t})=>({...t,entries:t.entries.map(({title:e,...t})=>t)})),unassignedEntries:e.unassignedEntries.map(({title:e,...t})=>t)});if(!n.success)for(let e of n.error.issues)t.addIssue({...e})});function Wn(e){return{improvementDays:e.days.filter(e=>e.outcome===`improvement`||e.outcome===`both`).length,resetDays:e.days.filter(e=>e.outcome===`reset`||e.outcome===`both`).length}}function Gn(e){return I.parse(e)}const Kn=Rn,qn=P.shape,Jn=I.shape.unassignedEntries,Yn=qn.days.element.omit({summary:!0}).extend({entries:Jn}),L=e.strictObject({...qn,contractVersion:e.literal(4),days:e.array(Yn).length(28),unassignedEntries:Jn}).superRefine((e,t)=>{for(let[n,r]of e.days.entries())r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`}),r.outcome!==jn(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function Xn(e){return L.parse(e)}function Zn(e,t){let n=new Set;for(let r of e)n.has(r.eventId)&&t.addIssue({code:`custom`,message:`Duplicate activity eventId`}),n.add(r.eventId)}function Qn(e,t,n){let r=n.reduce((t,n)=>t+e.reactionCounts[n],0);(!Number.isSafeInteger(r)||r!==e.reactionTotal)&&t.addIssue({code:`custom`,path:[`reactionTotal`],message:`Total must equal all reaction counts`})}async function $n(e,t,n){if(e.status!==200){let t={status:e.status,statusText:e.statusText};try{await e.body?.cancel()}catch(e){throw Error(`activity_file_http_error`,{cause:{...t,cancellationCause:e}})}throw Error(`activity_file_http_error`,{cause:t})}if(e.body===null)throw Error(`activity_file_body_missing`);let r=e.body.getReader(),i=[],a=0;try{for(;;){let e=await r.read();if(e.done)break;if(a+=e.value.byteLength,a>n)throw Error(`activity_file_too_large`,{cause:{maxBytes:n,observedBytes:a}});i.push(e.value)}let e=new Uint8Array(a),o=0;for(let t of i)e.set(t,o),o+=t.byteLength;return t.parse(JSON.parse(new TextDecoder(`utf-8`,{fatal:!0}).decode(e)))}catch(e){try{await r.cancel()}catch{}throw Error(`activity_file_read_failed`,{cause:e})}finally{r.releaseLock()}}function er(e,t,n){let r=new TextEncoder().encode(JSON.stringify(t.parse(e)));if(r.byteLength>n)throw Error(`activity_file_too_large`,{cause:{byteLength:r.byteLength}});return r}const R=[`👍`,`😂`,`🤡`,`💀`,`😭`,`🔥`,`🎉`,`👀`,`🙏`,`🫠`],tr=e.enum(R),z=e.string().min(1).max(128),B=524288,nr=`https://data.radarultra.com/activity/v1/latest.json`,rr=`https://data.radarultra.com/activity/v2/latest.json`,ir=j.extend({eventId:z}),ar=M.safeExtend({days:e.array(M.shape.days.element.extend({entries:e.array(ir)})).length(28),undatedEntries:e.array(ir)});function or(e,t){Zn([...e.days.flatMap(e=>e.entries),...e.undatedEntries],t)}const sr=ar.superRefine(or),cr=e.record(tr,e.number().int().nonnegative()),lr=e.strictObject({reactionCounts:cr,reactionTotal:e.number().int().nonnegative()});function ur(e,t){Qn(e,t,R)}const dr=ir.extend(lr.shape).superRefine(ur),fr=ar.safeExtend({days:e.array(ar.shape.days.element.extend({entries:e.array(dr)})).length(28),undatedEntries:e.array(dr)}).superRefine(or),V=e.strictObject({publishedAt:e.iso.datetime(),reactionIds:e.array(tr).length(R.length).refine(e=>new Set(e).size===R.length,`Every reaction must occur exactly once`),progress:fr}),pr=I.shape,mr=pr.unassignedEntries.element.safeExtend({eventId:z}),hr=e.strictObject({...pr,days:e.array(pr.days.element.safeExtend({entries:e.array(mr)})).length(28),unassignedEntries:e.array(mr)}),gr=hr.superRefine((e,t)=>{let n=({eventId:e,...t})=>t,r=I.safeParse({...e,days:e.days.map(e=>({...e,entries:e.entries.map(n)})),unassignedEntries:e.unassignedEntries.map(n)});if(!r.success)for(let e of r.error.issues)t.addIssue({...e});Zn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),_r=mr.safeExtend(lr.shape).superRefine(ur),vr=hr.safeExtend({days:e.array(pr.days.element.safeExtend({entries:e.array(_r)})).length(28),unassignedEntries:e.array(_r)}).superRefine((e,t)=>{let n=({reactionCounts:e,reactionTotal:t,...n})=>n,r=gr.safeParse({...e,days:e.days.map(e=>({...e,entries:e.entries.map(n)})),unassignedEntries:e.unassignedEntries.map(n)});if(!r.success)for(let e of r.error.issues)t.addIssue({...e})}),yr=V.extend({progress:vr}),br=L.shape,xr=br.unassignedEntries.element.safeExtend({eventId:z}),Sr=L.safeExtend({days:e.array(br.days.element.safeExtend({entries:e.array(xr)})).length(28),unassignedEntries:e.array(xr)}).superRefine((e,t)=>{Zn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),Cr=xr.safeExtend(lr.shape).superRefine(ur),wr=Sr.safeExtend({days:e.array(br.days.element.safeExtend({entries:e.array(Cr)})).length(28),unassignedEntries:e.array(Cr)}),Tr=V.extend({progress:wr});async function Er(e){return $n(e,V,B)}async function Dr(e){return $n(e,yr,B)}async function Or(e){return $n(e,Tr,B)}function kr(e){return er(e,V,B)}function Ar(e){return er(e,yr,B)}function jr(e){return er(e,Tr,B)}const Mr=e.strictObject({changeId:e.string().min(1).max(128),eventId:e.string().min(1).max(128),revision:e.int().positive(),kind:e.enum([`created`,`updated`,`withdrawn`]),date:e.iso.date().nullable(),entry:j,receivedAt:e.iso.datetime().nullable(),acceptedAt:e.iso.datetime()}),Nr=e.strictObject({contractVersion:e.literal(1),changes:e.array(Mr),nextCursor:e.string().min(1),hasMore:e.boolean()}),Pr=Mr.extend({dayNumber:M.shape.days.element.shape.dayNumber.nullable()}),Fr=Nr.extend({contractVersion:e.literal(2),changes:e.array(Pr)}),Ir=e.int().min(0).max(2**53-1),Lr=e.int().min(1).max(28),Rr=e.enum([`yes`,`no`]).nullable(),zr=e.strictObject({choice:Rr}),Br=e.strictObject({yes:Ir,no:Ir,total:Ir}).superRefine((e,t)=>{(!Number.isSafeInteger(e.yes+e.no)||e.total!==e.yes+e.no)&&t.addIssue({code:`custom`,path:[`total`],message:`Total must equal the effective choices.`})}),Vr=e.strictObject({dayNumber:Lr,state:e.enum([`unopened`,`open`,`closed`]),choice:Rr,outcome:e.enum([`unconfirmed`,`yes`,`no`]),personalResult:e.enum([`none`,`waiting`,`correct`,`incorrect`]),corrected:e.boolean(),counts:Br}).superRefine((e,t)=>{let n=e.choice===null?`none`:e.outcome===`unconfirmed`?`waiting`:e.choice===e.outcome?`correct`:`incorrect`;e.personalResult!==n&&t.addIssue({code:`custom`,path:[`personalResult`],message:`Personal result must match the confirmed outcome and choice.`}),e.state!==`closed`&&e.outcome!==`unconfirmed`&&t.addIssue({code:`custom`,path:[`outcome`],message:`An open or unopened day cannot have a confirmed result.`}),e.state===`unopened`&&(e.choice!==null||e.counts.total!==0)&&t.addIssue({code:`custom`,path:[`state`],message:`An unopened day cannot have choices.`})}),Hr=e.strictObject({revision:Ir,openDayNumber:Lr.nullable(),days:e.array(Vr).length(28)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries()){r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Every official day must occur once, in order.`});let i=e.openDayNumber===null||r.dayNumber<e.openDayNumber?`closed`:r.dayNumber===e.openDayNumber?`open`:`unopened`;r.state!==i&&t.addIssue({code:`custom`,path:[`days`,n,`state`],message:`Only the next official day may be open.`})}}),Ur=e.strictObject({error:e.strictObject({code:e.enum([`invalid_request`,`payload_too_large`,`unsupported_media_type`,`origin_not_allowed`,`rate_limited`,`dependency_unavailable`,`internal_error`,`day_closed`,`identity_unavailable`]),message:e.string().min(1).max(2048),requestId:e.string().min(1).max(128),operation:e.enum([`get_guesses`,`set_guess`]),stage:e.string().min(1).max(128),cause:e.record(e.string(),e.unknown()),saveOutcome:e.enum([`not_saved`,`unknown`]).optional()})}).superRefine(({error:e},t)=>{e.operation===`set_guess`!=(e.saveOutcome!==void 0)&&t.addIssue({code:`custom`,path:[`error`,`saveOutcome`],message:`Only save failures must include a save outcome.`})}),Wr=e.strictObject({"zh-Hans":b.shape.noticeTimeline.element.shape.sourceTextZh,"zh-Hant":b.shape.noticeTimeline.element.shape.sourceTextZh,ja:b.shape.noticeTimeline.element.shape.sourceTextZh,ko:b.shape.noticeTimeline.element.shape.sourceTextZh}),Gr=b.shape.noticeTimeline.element.omit({sourceTextZh:!0}).extend({sourceTranslations:Wr}).strict(),Kr=e.strictObject({...b.shape,contractVersion:e.literal(2),noticeTimeline:e.array(Gr).min(1).max(r.actionDetail.noticeTimeline)}),qr=Gr.omit({phase:!0}).extend({kinds:x.shape.noticeTimeline.element.shape.kinds}).strict(),Jr=e.strictObject({...x.shape,noticeTimeline:e.array(qr).min(1).max(r.actionDetail.noticeTimeline)}),Yr=e=>{let{sourceTranslations:t,...n}=e;return{...n,sourceTextZh:t[`zh-Hans`]}},Xr=e=>({...e,contractVersion:1,noticeTimeline:e.noticeTimeline.map(Yr)}),Zr=e=>({...e,noticeTimeline:e.noticeTimeline.map(Yr)}),Qr=(e,t)=>{for(let n of e.error?.issues??[])t.addIssue({...n})},H=Kr.superRefine((e,t)=>{Qr(b.safeParse(Xr(e)),t)}),U=Jr.superRefine((e,t)=>{Qr(x.safeParse(Zr(e)),t)}),$r=e.strictObject({...He.shape,contractVersion:e.literal(2),actions:e.array(H).min(1).max(r.analysis.actions),pendingResetActions:e.array(U).max(r.analysis.actions)}).superRefine((e,t)=>{Qr(He.safeParse({...e,contractVersion:1,actions:e.actions.map(Xr),pendingResetActions:e.pendingResetActions.map(Zr)}),t),new TextEncoder().encode(JSON.stringify(e)).byteLength>r.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`export_utf8_size_limit_exceeded`,path:[]})}),ei=e=>H.parse(e),ti=e=>U.parse(e),ni=e=>$r.parse(e);function ri(e){let t=ni(e);return He.parse({...t,contractVersion:1,actions:t.actions.map(Xr),pendingResetActions:t.pendingResetActions.map(Zr)})}const ii=`/api/v1/codex-reset-public-records`,ai=e.array(qr).min(1).max(r.actionDetail.noticeTimeline),oi=e.strictObject(H.shape).omit({contractVersion:!0,noticeCount:!0,noticeTimeline:!0}).extend({noticeTimeline:ai}).strict();function si(e){let t=e.noticeTimeline.filter(e=>e.kinds.includes(`executed`)||e.kinds.includes(`preview`)).map(({kinds:e,...t})=>({...t,phase:e.includes(`executed`)?`executed`:`preview`}));return{...e,contractVersion:2,noticeCount:t.length,noticeTimeline:t}}const ci=e=>H.parse(si(e));function li(e,t){let n=new Set;for(let[r,i]of e.entries()){n.has(i.sourceUrl)&&t.addIssue({code:`custom`,message:`public_notice_source_duplicate`,path:[`noticeTimeline`,r]}),n.add(i.sourceUrl);let a=e.at(r-1),o=H.shape.firstAnnouncedAt;r>0&&a!==void 0&&o.safeParse(a.authoredAt).success&&o.safeParse(i.authoredAt).success&&S(a.authoredAt,i.authoredAt)>0&&t.addIssue({code:`custom`,message:`public_notice_timeline_not_ascending`,path:[`noticeTimeline`,r]})}}const ui=oi.superRefine((e,t)=>{li(e.noticeTimeline,t);let n=H.safeParse(si(e));for(let e of n.error?.issues??[])t.addIssue({...e})}),di=e.strictObject(U.shape).omit({state:!0,executedEffects:!0,pendingEffects:!0}).superRefine((e,t)=>{li(e.noticeTimeline,t)}),fi=e.strictObject(H.shape).pick({resetActionId:!0}).extend({lastActiveFirstAnnouncedAt:H.shape.firstAnnouncedAt,withdrawnAt:H.shape.firstAnnouncedAt}).strict(),pi=r.analysis.actions,mi=e.strictObject({contractVersion:e.literal(1),sourceWatermark:H.shape.resetActionId,generatedAt:H.shape.firstAnnouncedAt,actions:e.array(ui).min(1).max(pi),pendingResetActions:e.array(U).max(pi),unexecutedResetActions:e.array(di).max(pi),withdrawnResetActions:e.array(fi).max(pi)}).superRefine((e,t)=>{for(let n of[`actions`,`pendingResetActions`,`unexecutedResetActions`,`withdrawnResetActions`])new Set(e[n].map(e=>e.resetActionId)).size!==e[n].length&&t.addIssue({code:`custom`,message:`public_reset_identity_duplicate`,path:[n]});let n=new Set(e.actions.map(e=>e.resetActionId));for(let n of e.pendingResetActions)li(n.noticeTimeline,t);(e.unexecutedResetActions.some(e=>n.has(e.resetActionId))||e.withdrawnResetActions.some(e=>n.has(e.resetActionId)))&&t.addIssue({code:`custom`,message:`public_reset_lifecycle_conflict`});for(let[n,r]of e.actions.entries()){let i=e.actions.at(n-1),a=H.shape.firstAnnouncedAt;n>0&&i!==void 0&&a.safeParse(i.firstAnnouncedAt).success&&a.safeParse(r.firstAnnouncedAt).success&&Ue(i,r)>=0&&t.addIssue({code:`custom`,message:`public_reset_actions_not_ascending`,path:[`actions`,n]})}new TextEncoder().encode(JSON.stringify(e)).byteLength>r.exportUtf8Bytes&&t.addIssue({code:`custom`,message:`public_reset_records_utf8_size_limit_exceeded`})}),hi=H.shape,gi=e.strictObject({title:e.string(),body:e.string()}),_i=e.strictObject({zh:gi,en:gi}),vi=e.enum([`end_preview`,`restore_preview`,`set_auto_notification`,`notify`]),yi=e.strictObject({resetActionId:hi.resetActionId,operation:vi,expectedRevision:e.int().nonnegative(),copy:_i.nullable(),automaticNotification:e.boolean().nullable()}).superRefine((e,t)=>{e.operation===`notify`!=(e.copy!==null)&&t.addIssue({code:`custom`,path:[`copy`],message:`notification_copy_operation_mismatch`}),e.operation===`set_auto_notification`!=(e.automaticNotification!==null)&&t.addIssue({code:`custom`,path:[`automaticNotification`],message:`notification_policy_operation_mismatch`})}),bi=yi,xi=yi,Si=e.strictObject({digest:e.string().regex(/^sha256:[a-f0-9]{64}$/),sourceWatermark:e.string().min(1),draft:yi}),Ci=e.strictObject({operationId:e.uuid(),preview:Si}),wi=e.strictObject({resetActionId:hi.resetActionId,revision:e.number().int().nonnegative(),state:e.enum([`preview`,`executed`,`cancelled`,`undetermined`]),firstAnnouncedAt:w.nullable(),officialConfirmed:e.boolean(),pendingPreview:e.boolean(),previewClosed:e.boolean(),automaticNotification:e.boolean(),sourceUrls:e.array(hi.noticeTimeline.element.shape.sourceUrl),availableOperations:e.array(vi),notificationOperationId:e.uuid().nullable()}),Ti=e.strictObject({actions:e.array(wi)}),Ei=e.discriminatedUnion(`status`,[e.strictObject({status:e.literal(`unknown`),operationId:e.uuid()}),e.strictObject({status:e.literal(`saved`),operationId:e.uuid(),resetActionId:hi.resetActionId,operation:vi,revision:e.number().int().positive(),notification:e.strictObject({state:e.enum([`disabled`,`pending`,`claimed`,`retry_wait`,`accepted`,`rejected`,`expired`]),resultCode:e.string().nullable(),diagnostic:e.record(e.string(),e.unknown()).nullable()})})]),W=b.shape.noticeTimeline.element.shape,Di=e.enum([`initial`,`supplement`,`correction`]).nullable(),Oi=e.strictObject({authoredAt:W.authoredAt,role:Di,sourceUrl:W.sourceUrl,sourceText:W.sourceText,sourceTextZh:W.sourceTextZh}),ki=e.array(Oi).min(1).superRefine((e,t)=>{let n=new Set,r;for(let[i,a]of e.entries()){if(n.has(a.sourceUrl)&&t.addIssue({code:`custom`,path:[i,`sourceUrl`],message:`An original post may appear only once per improvement`}),n.add(a.sourceUrl),!W.authoredAt.safeParse(a.authoredAt).success){r=void 0;continue}if(r!==void 0){let e=S(r.authoredAt,a.authoredAt);(e>0||e===0&&r.sourceUrl>a.sourceUrl)&&t.addIssue({code:`custom`,path:[i],message:`Posts must be ordered by authoredAt and sourceUrl`})}r=a}}),Ai=Kn,ji=j.omit({description:!0}).extend({category:e.literal(`improvement`),title:F,posts:ki}),Mi=j.extend({category:e.enum([`direct_reset`,`reset_card`]),title:F}),Ni=e.discriminatedUnion(`category`,[ji,Mi]),Pi=L.shape,Fi=Pi.unassignedEntries.element.shape.date;function Ii(e,t){e.date===null!=(e.dateBasis===`unresolved`)&&t.addIssue({code:`custom`,path:[`date`],message:`Date must agree with its evidence basis`})}const Li=e.discriminatedUnion(`category`,[ji.extend({date:Fi}).superRefine(Ii),Mi.extend({date:Fi}).superRefine(Ii)]),Ri=e.strictObject({...Pi,contractVersion:e.literal(5),days:e.array(Pi.days.element.extend({entries:e.array(Li)})).length(28),unassignedEntries:e.array(Li)}).superRefine((e,t)=>{for(let[n,r]of e.days.entries())r.dayNumber!==n+1&&t.addIssue({code:`custom`,path:[`days`,n,`dayNumber`],message:`Official days must be numbered in order`}),r.outcome!==jn(r.entries)&&t.addIssue({code:`custom`,path:[`days`,n],message:`Outcome must reflect landed evidence`})});function zi(e){return Ri.parse(e)}const Bi=`https://data.radarultra.com/activity/v3/latest.json`,Vi=Ri.shape,[Hi,Ui]=Vi.unassignedEntries.element.options,Wi=Hi.safeExtend({eventId:z}),Gi=Ui.safeExtend({eventId:z}),Ki=e.discriminatedUnion(`category`,[Wi,Gi]),qi=Ri.safeExtend({days:e.array(Vi.days.element.extend({entries:e.array(Ki)})).length(28),unassignedEntries:e.array(Ki)}).superRefine((e,t)=>{Zn([...e.days.flatMap(e=>e.entries),...e.unassignedEntries],t)}),Ji={reactionCounts:cr,reactionTotal:e.number().int().nonnegative()},Yi=(e,t)=>Qn(e,t,R),Xi=e.discriminatedUnion(`category`,[Wi.safeExtend(Ji).superRefine(Yi),Gi.safeExtend(Ji).superRefine(Yi)]),Zi=qi.safeExtend({days:e.array(Vi.days.element.extend({entries:e.array(Xi)})).length(28),unassignedEntries:e.array(Xi)}),Qi=V.extend({progress:Zi});async function $i(e){return $n(e,Qi,B)}function ea(e){return er(e,Qi,B)}const ta=e.discriminatedUnion(`category`,[ji,j.extend({category:e.enum([`direct_reset`,`reset_card`])})]),na=Pr.extend({entry:ta}),ra=Fr.extend({contractVersion:e.literal(3),changes:e.array(na)});function ia(e){return na.parse(e)}function aa(e){return ra.parse(e)}const oa=`https://radarultra.com`,sa=[`zh-Hans`,`zh-Hant`,`en`,`ja`,`ko`],ca={"zh-Hans":`/zh`,"zh-Hant":`/zh-hant`,en:``,ja:`/ja`,ko:`/ko`},la={reset:`/codex`,improvement:`/codex/28-day-challenge`,changelog:`/codex/changelog`,models:`/codex/models`},G=e.discriminatedUnion(`product`,[e.strictObject({product:e.literal(`cli`),version:e.string().regex(/^\d+\.\d+\.\d+$/)}),e.strictObject({product:e.literal(`app`),version:e.string().regex(/^\d{2}\.\d{3,4}$/)})]),K=e.string().regex(/^(?!\.{1,2}$)[a-z0-9.-]+$/);function q(e,t){return oa+ca[t]+la[e]}function ua(e,t,n){let r=G.parse({product:e,version:t});return`${q(`changelog`,n)}/${r.product}/${r.version}`}function da(e,t){return`${q(`models`,t)}/${K.parse(e)}`}const fa=Object.freeze({timeZone:`America/Los_Angeles`,startDate:`2026-10-05`,endDate:`2026-11-01`}),pa=Date.parse(`${fa.startDate}T00:00:00Z`),ma=(Date.parse(`${fa.endDate}T00:00:00Z`)-pa)/864e5+1,ha=new Intl.DateTimeFormat(`en-CA`,{timeZone:fa.timeZone,year:`numeric`,month:`2-digit`,day:`2-digit`});function ga(e){let t=ha.formatToParts(e),n=e=>Number(t.find(t=>t.type===e).value),r=(Date.UTC(n(`year`),n(`month`)-1,n(`day`))-pa)/864e5,i=r<0?`before`:r>=ma?`ended`:`live`,a=Math.min(ma,Math.max(1,r+1));return{phase:i,today:a,ongoingDay:i===`live`?a:null}}const _a=e.enum([`reset`,`improvement`]),va=e.array(_a).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),ya=t=>e.url().refine(e=>sa.some(n=>e===q(t,n)),`notification_target_url_invalid`),ba=e.discriminatedUnion(`kind`,[e.object({kind:e.literal(`reset`),webUrl:ya(`reset`),miniPath:e.literal(`pages/index/index`)}).strict(),e.object({kind:e.literal(`improvement`),webUrl:ya(`improvement`),miniPath:e.literal(`pages/index/index?page=challenge`)}).strict()]),xa=e.object({topics:va,target:ba}).strict().refine(e=>e.topics.includes(e.target.kind),`notification_target_topic_mismatch`),Sa=e.enum([`reset`,`improvement`,`clue`]),Ca=e.object({topics:e.array(Sa).min(1).max(2).refine(e=>new Set(e).size===e.length,`notification_topic_duplicate`),target:ba}).strict().refine(e=>e.topics.some(t=>(t===`clue`?`reset`:t)===e.target.kind),`notification_target_topic_mismatch`);function wa(e,t){let n=Ta(e===`clue`?`reset`:e,t);return Ca.parse({...n,topics:[e]})}function Ta(e,t){return xa.parse({topics:[e],target:{kind:e,webUrl:q(e,t),miniPath:e===`reset`?`pages/index/index`:`pages/index/index?page=challenge`}})}const Ea=e.object({notificationId:e.uuid(),eventId:e.uuid(),title:e.string().trim().min(1).max(512),createdAt:e.iso.datetime(),deliverBy:e.iso.datetime(),...xa.shape}).strict().superRefine((e,t)=>{e.topics.includes(e.target.kind)||t.addIssue({code:`custom`,message:`notification_target_topic_mismatch`}),S(e.deliverBy,e.createdAt)<=0&&t.addIssue({code:`custom`,message:`notification_task_deadline_invalid`})});function Da(e,t){return S(e.createdAt,t.createdAt)||(e.notificationId<t.notificationId?-1:+(e.notificationId>t.notificationId))}const Oa=`/api/v1/notification-tasks`,ka=100,Aa=e.string().min(1).max(8192),ja=e.object({cursor:Aa.optional()}).strict(),Ma=e.object({contractVersion:e.literal(1),roundCursor:Aa,notifications:e.array(Ea).max(100),nextCursor:Aa.nullable()}).strict().superRefine((e,t)=>{new Set(e.notifications.map(e=>e.notificationId)).size!==e.notifications.length&&t.addIssue({code:`custom`,message:`notification_task_duplicate`});for(let n=1;n<e.notifications.length;n++)Da(e.notifications.at(n-1),e.notifications.at(n))>=0&&t.addIssue({code:`custom`,message:`notification_task_order_invalid`});e.nextCursor!==null&&e.notifications.length===0&&t.addIssue({code:`custom`,message:`notification_task_empty_continuation`})}),Na=`/api/browser-notifications`,Pa=e.string().min(1).max(128),Fa=e.uuid(),Ia=e.enum(sa),La=e.strictObject({reset:e.boolean(),improvement:e.boolean()}),Ra=`[cdef][\\w-]{21}`,za=e.strictObject({fid:e.string().regex(RegExp(`^${Ra}$`))});function Ba(e){return e.replace(RegExp(`(^|[^\\w-])${Ra}(?![\\w-])`,`g`),`$1[registration]`)}const J={operationId:Fa,expectedRevision:Pa},Va=e.discriminatedUnion(`action`,[e.strictObject({...J,action:e.literal(`register`),topics:La.refine(e=>e.reset||e.improvement,`subscription_topic_required`),locale:Ia,registration:za}),e.strictObject({...J,action:e.literal(`set_topics`),topics:La}),e.strictObject({...J,action:e.literal(`set_locale`),locale:Ia}),e.strictObject({...J,action:e.literal(`restore`),registration:za}),e.strictObject({...J,action:e.literal(`retry`)}),e.strictObject({...J,action:e.literal(`cancel`)})]),Ha=e.strictObject({operationId:Fa.optional(),expectedRevision:Pa.optional()}).refine(e=>e.operationId===void 0==(e.expectedRevision===void 0),`subscription_operation_reference_incomplete`),Ua=e.strictObject({code:e.enum([`invalid_request`,`identity_unavailable`,`origin_not_allowed`,`rate_limited`,`revision_conflict`,`operation_conflict`,`registration_conflict`,`dependency_unavailable`,`provider_rejected`,`provider_rate_limited`,`provider_unavailable`,`provider_timeout`,`internal_error`]),operationId:Fa.optional(),correlationId:e.uuid(),stage:e.string().min(1).max(128),saveOutcome:e.enum([`not_saved`,`unknown`]),reasonSummary:e.string().min(1).max(2048),retryable:e.boolean(),cause:e.record(e.string(),e.unknown())}),Wa=e.strictObject({id:Fa,state:e.enum([`pending`,`applied`,`rejected`,`unknown`,`superseded`,`not_found`]),error:Ua.optional()}),Y=e.strictObject({topicSettings:e.strictObject({state:e.enum([`initial`,`saved`]),revision:Pa,topics:La,locale:Ia.nullable()}),registrationState:e.enum([`none`,`ready`,`invalid`,`changing`]),registrationKey:e.string().regex(/^[a-f0-9]{64}$/).nullable(),manualRetryRequired:e.boolean(),operation:Wa.nullable()});function Ga(e,t){return{topics:t.action===`register`||t.action===`set_topics`?t.topics:e.topics,locale:t.action===`register`||t.action===`set_locale`?t.locale:e.locale}}const Ka=e.strictObject({data:Y}),qa=e.strictObject({error:Ua});function Ja(e){return{topicSettings:{state:`initial`,revision:e,topics:{reset:!0,improvement:!1},locale:null},registrationState:`none`,registrationKey:null,manualRetryRequired:!1,operation:null}}const Ya=La.extend({clue:e.boolean().default(!1)}),[Xa,Za,...Qa]=Va.options,$a=e.discriminatedUnion(`action`,[Xa.extend({topics:Ya.refine(e=>Object.values(e).some(Boolean),`subscription_topic_required`)}),Za.extend({topics:Ya}),...Qa]),eo=Y.extend({topicSettings:Y.shape.topicSettings.extend({topics:Ya})}),to=e.strictObject({data:eo});function no(e){return eo.parse(Ja(e))}function ro(e){let{clue:t,...n}=e.topicSettings.topics;return Y.parse({...e,topicSettings:{...e.topicSettings,topics:n}})}function io(e,t){return e.action!==`register`&&e.action!==`set_topics`?e:{...e,topics:{...e.topics,clue:e.action!==`register`&&(e.topics.reset||e.topics.improvement)&&t.clue}}}const ao=20,oo=2*1024*1024,so=`/api/v1/improvements`,co=e.string().min(1).max(1024),[lo]=qi.shape.unassignedEntries.element.options,uo=lo.safeExtend({date:e.iso.date().refine(e=>e>fa.endDate,`improvement_must_follow_campaign`)}),fo=e.strictObject({}),po=e.strictObject({challengeEnded:e.boolean(),observedAt:e.iso.datetime()}),mo=e.strictObject({cursor:co.nullable(),limit:e.literal(20)}),ho=po.extend({entries:e.array(uo).max(20),nextCursor:co.nullable()}).superRefine((e,t)=>{new Set(e.entries.map(e=>e.eventId)).size!==e.entries.length&&t.addIssue({code:`custom`,path:[`entries`],message:`Duplicate improvement identity`})}),go=e.strictObject({eventIds:e.array(z).min(1).max(128)}),_o=e.strictObject({eventIds:e.array(z).max(128)}),vo=e.strictObject({error:e.strictObject({code:e.enum([`invalid_request`,`dependency_unavailable`,`internal_error`]),message:e.string(),requestId:e.uuid(),operation:e.string(),stage:e.string(),cause:e.record(e.string(),e.unknown())})}),yo=`/tibo-source/v1/latest.json`,bo=512*1024,xo=e.iso.datetime({offset:!0}),So=b.shape.noticeTimeline.element,Co=e.strictObject({contractVersion:e.literal(1),observedAt:xo,check:e.strictObject({checkedAt:xo,freshUntil:xo,active:e.boolean()}).nullable(),latestPost:e.strictObject({authoredAt:xo,sourceUrl:So.shape.sourceUrl,sourceText:e.string(),sourceTranslations:Wr,resetRelevance:e.enum([`related`,`unrelated`,`unknown`])}).nullable()});async function wo(e){let t=e.body?.getReader();if(t===void 0)throw Error(`tibo_source_status_body_missing`,{cause:{status:e.status}});let n=[],r=0;try{for(;;){let i=await t.read();if(i.done)break;if(r+=i.value.byteLength,r>524288)throw Error(`tibo_source_status_too_large`,{cause:{status:e.status,bytes:r}});n.push(i.value)}}finally{try{await t.cancel()}catch{}t.releaseLock()}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;let o=new TextDecoder(`utf-8`,{fatal:!0}).decode(i);if(!e.ok)throw Error(`tibo_source_status_http_error`,{cause:{status:e.status,upstream:o.slice(0,4e3)}});return Co.parse(JSON.parse(o))}const To=`/reset-clue/v1/latest.json`,Eo=4320*60*1e3,Do=r.exportUtf8Bytes,Oo=H.shape.noticeTimeline.element.pick({authoredAt:!0,sourceUrl:!0,sourceText:!0,sourceTranslations:!0,contentCompleteness:!0}).extend({plannedTiming:Re.nullable(),expiresAt:H.shape.noticeTimeline.element.shape.authoredAt}).strict().superRefine((e,t)=>{Date.parse(e.expiresAt)!==Date.parse(e.authoredAt)+2592e5&&t.addIssue({code:`custom`,message:`reset_clue_expiry_mismatch`,path:[`expiresAt`]})}),ko=e.strictObject({contractVersion:e.literal(1),clue:Oo.nullable()}),Ao=e=>ko.parse(e);function jo(e,t){return e.clue!==null&&t.getTime()<Date.parse(e.clue.expiresAt)?e.clue:null}async function Mo(e){let t=e.body?.getReader();if(t===void 0)throw Error(`reset_clue_body_missing`,{cause:{status:e.status}});let n=[],r=0;try{for(;;){let i=await t.read();if(i.done)break;if(r+=i.value.byteLength,r>Do)throw Error(`reset_clue_too_large`,{cause:{status:e.status,bytes:r}});n.push(i.value)}}finally{try{await t.cancel()}catch{}t.releaseLock()}let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.byteLength;let o=new TextDecoder(`utf-8`,{fatal:!0}).decode(i);if(!e.ok)throw Error(`reset_clue_http_error`,{cause:{status:e.status,upstream:o.slice(0,4e3)}});return Ao(JSON.parse(o))}const X=e.enum(sa),No=e.string().regex(/^\d{4}-(?:0[1-9]|1[0-2])$/),Z=e.string().trim().min(1),Po=e.url({protocol:/^https$/}),Q=e.discriminatedUnion(`kind`,[e.strictObject({kind:e.literal(`instant`),at:e.iso.datetime()}),e.strictObject({kind:e.literal(`date`),date:e.iso.date()})]),Fo=e.strictObject({operation:Z,stage:Z,cause:Kt});function Io(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`ready`),value:t}),e.strictObject({state:e.literal(`pending`)}),e.strictObject({state:e.literal(`failed`),failure:Fo})])}function Lo(e,t){return e.superRefine((e,n)=>{new TextEncoder().encode(JSON.stringify(e)).byteLength>t&&n.addIssue({code:`custom`,message:`publication_utf8_size_limit_exceeded`})})}async function Ro(e,t,n,r){let i=e.body?.getReader();if(i===void 0)throw Error(`${t}_body_missing`,{cause:{operation:t,stage:`read`,status:e.status}});let a=[],o=0;try{for(;;){let e=await i.read();if(e.done)break;if(o+=e.value.byteLength,o>n)throw Error(`publication_utf8_size_limit_exceeded`);a.push(e.value)}}catch(n){throw Error(`${t}_read_failed`,{cause:{operation:t,stage:`read`,status:e.status,bytes:o,cause:n}})}finally{try{await i.cancel()}catch{}i.releaseLock()}let s=new Uint8Array(o),c=0;for(let e of a)s.set(e,c),c+=e.byteLength;let l;try{l=new TextDecoder(`utf-8`,{fatal:!0}).decode(s)}catch(n){throw Error(`${t}_decode_failed`,{cause:{operation:t,stage:`decode`,status:e.status,cause:n}})}if(!e.ok)throw Error(`${t}_http_error`,{cause:{operation:t,stage:`http`,status:e.status,upstream:l.slice(0,4e3)}});try{return r.parse(JSON.parse(l))}catch(n){throw Error(`${t}_parse_failed`,{cause:{operation:t,stage:`parse`,status:e.status,cause:n}})}}const zo=`/codex-releases/v2/directory.json`,Bo=128*1024,Vo=128*1024,Ho=256*1024,Uo=Q,Wo={product:e.enum([`app`,`cli`]),version:Z,published:Q,month:No,revision:Z},Go=e.strictObject(Wo).superRefine(Ko);function Ko(e,t){let n=G.safeParse({product:e.product,version:e.version});if(!n.success)for(let e of n.error.issues)t.addIssue({...e});e.product===`cli`!=(e.published.kind===`instant`)&&t.addIssue({code:`custom`,path:[`published`],message:`product_date_precision_mismatch`}),(e.published.kind===`instant`?e.published.at:e.published.date).slice(0,7)!==e.month&&t.addIssue({code:`custom`,path:[`month`],message:`published_month_mismatch`})}function qo(e,t){let n=new Set,r=1/0;for(let[i,a]of e.entries()){let e=`${a.product}/${a.version}`;n.has(e)&&t.addIssue({code:`custom`,path:[`releases`,i],message:`duplicate_release_identity`}),n.add(e);let o=Date.parse(a.published.kind===`instant`?a.published.at:`${a.published.date}T00:00:00Z`);o>r&&t.addIssue({code:`custom`,path:[`releases`,i],message:`release_order_mismatch`}),r=o}}const Jo=Lo(e.strictObject({contractVersion:e.literal(2),releases:e.array(Go),latest:e.strictObject({app:e.string().nullable(),cli:e.string().nullable()})}).superRefine((e,t)=>{qo(e.releases,t);for(let n of[`app`,`cli`]){let r=e.releases.find(e=>e.product===n)?.version??null;e.latest[n]!==r&&t.addIssue({code:`custom`,path:[`latest`,n],message:`latest_release_mismatch`})}}),Bo),Yo=e.strictObject({state:e.literal(`not_applicable`),reason:e.literal(`no_curated_notes`)}),Xo=e.union([Io(e.strictObject({locale:X,points:e.array(Z).min(1).max(5)})),Yo]),Zo=e.strictObject({...Wo,source:e.strictObject({kind:e.enum([`github`,`official`]),url:Po}),summary:Xo,notesCount:e.number().int().nonnegative()}).superRefine((e,t)=>{Ko(e,t),e.product===`cli`!=(e.source.kind===`github`)&&t.addIssue({code:`custom`,path:[`source`,`kind`],message:`product_source_mismatch`}),e.notesCount===0!=(e.summary.state===`not_applicable`)&&t.addIssue({code:`custom`,path:[`summary`],message:`curated_notes_summary_state_mismatch`})}),Qo=Lo(e.strictObject({contractVersion:e.literal(2),locale:X,month:No,releases:e.array(Zo)}).superRefine((e,t)=>{qo(e.releases,t);for(let[n,r]of e.releases.entries())r.month!==e.month&&t.addIssue({code:`custom`,path:[`releases`,n,`month`],message:`file_month_mismatch`}),r.summary.state===`ready`&&r.summary.value.locale!==e.locale&&r.summary.value.locale!==`en`&&t.addIssue({code:`custom`,path:[`releases`,n,`summary`,`value`,`locale`],message:`summary_locale_mismatch`})}),Vo),$o=e.array(e.strictObject({title:Z.nullable(),items:e.array(e.strictObject({text:Z,refs:Z.nullable()})).min(1)})).min(1),es=Lo(e.strictObject({contractVersion:e.literal(2),product:e.enum([`app`,`cli`]),version:Z,revision:Z,locale:X,original:e.array($o.element),translation:e.union([Io($o),Yo]).nullable()}).superRefine((e,t)=>{let n=G.safeParse({product:e.product,version:e.version});if(!n.success)for(let e of n.error.issues)t.addIssue({...e});if(e.locale===`en`!=(e.translation===null)&&t.addIssue({code:`custom`,path:[`translation`],message:`translation_locale_mismatch`}),e.locale!==`en`&&e.original.length===0!=(e.translation?.state===`not_applicable`)&&t.addIssue({code:`custom`,path:[`translation`],message:`curated_notes_translation_state_mismatch`}),e.translation?.state===`ready`){let n=e.translation.value;(n.length!==e.original.length||e.original.some((e,t)=>{let r=n.at(t);return r===void 0||e.title===null!=(r.title===null)||e.items.length!==r.items.length||e.items.some((e,t)=>e.refs!==r.items.at(t)?.refs)}))&&t.addIssue({code:`custom`,path:[`translation`],message:`translation_structure_mismatch`})}}),Ho),ts=e=>Jo.parse(e),ns=e=>Qo.parse(e),rs=e=>es.parse(e),is=e=>Ro(e,`codex_release_directory`,Bo,Jo),as=e=>Ro(e,`codex_release_month`,Vo,Qo),os=e=>Ro(e,`codex_release_notes`,Ho,es);function ss(e,t){return`/codex-releases/v2/${X.parse(e)}/${No.parse(t)}.json`}function cs(e,t,n){let r=G.parse({product:t,version:n});return`/codex-releases/v2/${X.parse(e)}/notes/${r.product}/${r.version}.json`}const ls=128*1024;function $(t){return e.discriminatedUnion(`state`,[e.strictObject({state:e.literal(`known`),value:t,source:Po}),e.strictObject({state:e.literal(`unavailable`),reason:e.enum([`not_announced`,`not_listed`]),source:Po.nullable()})])}const us=e.strictObject({input:Z,cached:Z,output:Z}),ds=e.strictObject({modelId:K,name:Z,group:e.enum([`current`,`retired`]),status:e.enum([`available`,`retiring`,`retired`]),launched:$(Q),chatgptRetirement:$(Q),apiRetirement:$(Q),credits:$(us),apiPrice:$(us),multiple:e.string().regex(/^(?:0|[1-9]\d*)(?:\.\d+)?$/).refine(e=>Number.isFinite(Number(e))&&Number(e)>0).nullable(),plans:$(e.array(Z).min(1)),surfaces:$(e.array(Z).min(1)),about:Io(e.strictObject({locale:X,paragraphs:e.array(Z).min(1)})),sources:e.array(e.strictObject({label:Z,url:Po})).min(1)}).superRefine((e,t)=>{e.status===`retired`!=(e.group===`retired`)&&t.addIssue({code:`custom`,path:[`group`],message:`model_group_status_mismatch`}),e.status===`retiring`&&e.chatgptRetirement.state!==`known`&&t.addIssue({code:`custom`,path:[`chatgptRetirement`],message:`retiring_model_requires_announced_date`})}),fs=Lo(e.strictObject({contractVersion:e.literal(1),locale:X,models:e.array(ds),multipleBase:e.strictObject({modelId:K,name:Z}).nullable(),upcomingRetirement:e.strictObject({names:Z,modelIds:e.array(K).min(1),surface:e.enum([`api`,`chatgpt`]),at:Q}).nullable()}).superRefine((e,t)=>{let n=new Set;for(let[r,i]of e.models.entries())n.has(i.modelId)&&t.addIssue({code:`custom`,path:[`models`,r,`modelId`],message:`duplicate_model_identity`}),n.add(i.modelId),i.about.state===`ready`&&i.about.value.locale!==e.locale&&i.about.value.locale!==`en`&&t.addIssue({code:`custom`,path:[`models`,r,`about`,`value`,`locale`],message:`model_description_locale_mismatch`}),i.multiple!==null&&(e.multipleBase===null||i.credits.state!==`known`)&&t.addIssue({code:`custom`,path:[`models`,r,`multiple`],message:`multiple_requires_base_and_credits`});if(e.multipleBase!==null){let n=e.models.find(t=>t.modelId===e.multipleBase?.modelId);(n===void 0||n.group!==`current`||n.credits.state!==`known`||n.multiple!==`1`||n.name!==e.multipleBase.name)&&t.addIssue({code:`custom`,path:[`multipleBase`],message:`multiple_base_mismatch`})}let r=e.upcomingRetirement;if(r!==null){new Set(r.modelIds).size!==r.modelIds.length&&t.addIssue({code:`custom`,path:[`upcomingRetirement`,`modelIds`],message:`duplicate_retirement_model`});for(let n of r.modelIds){let i=e.models.find(e=>e.modelId===n),a=r.surface===`api`?i?.apiRetirement:i?.chatgptRetirement;(a?.state!==`known`||JSON.stringify(a.value)!==JSON.stringify(r.at))&&t.addIssue({code:`custom`,path:[`upcomingRetirement`],message:`retirement_model_date_mismatch`})}}}),ls),ps=e=>fs.parse(e),ms=e=>Ro(e,`codex_models`,ls,fs),hs=e=>`/codex-models/v1/${X.parse(e)}.json`;export{on as RadarResetSourceContractErrorV2,jo as activeRadarResetClue,Da as compareRadarNotificationTasks,Ue as compareRadarResetActionDetailsV1,S as compareRadarResetUtcTimestampsV1,wa as createRadarBrowserNotificationProjection,ga as createRadarCodexProgressCalendar,Ta as createRadarNotificationProjection,En as createRadarResetSourceErrorEnvelopeV2,kr as encodeRadarActivityFile,jr as encodeRadarActivityFileV2,ea as encodeRadarActivityFileV3,hn as encodeRadarResetDetailMultipartV2,Ar as encodeRadarTitledActivityFile,lt as formatRadarResetPositiveDecimalV2,ct as formatRadarResetUInt64DecimalV2,Ja as initialRadarBrowserSubscription,no as initialRadarBrowserSubscriptionV2,ps as parseRadarCodexModels,ia as parseRadarCodexProgressChangeV3,aa as parseRadarCodexProgressChangesV3,An as parseRadarCodexProgressV1,Ln as parseRadarCodexProgressV2,Gn as parseRadarCodexProgressV3,Xn as parseRadarCodexProgressV4,zi as parseRadarCodexProgressV5,ts as parseRadarCodexReleaseDirectory,ns as parseRadarCodexReleaseMonth,rs as parseRadarCodexReleaseNotes,Ge as parseRadarResetActionDetailV1,ei as parseRadarResetActionDetailV2,xt as parseRadarResetActionSummaryV2,We as parseRadarResetAnalysisV1,Ao as parseRadarResetClueSnapshot,yn as parseRadarResetDetailMultipartV2,Ke as parseRadarResetExportV1,ni as parseRadarResetExportV2,qe as parseRadarResetPendingActionV1,ti as parseRadarResetPendingActionV2,ot as parseRadarResetPositiveDecimalV2,Ct as parseRadarResetPublicationHomeFactsV2,an as parseRadarResetPublicationRevisionAvailableV2,Zt as parseRadarResetReadActionsRequestV2,tn as parseRadarResetReadActionsSuccessV2,Qt as parseRadarResetReadChangesRequestV2,nn as parseRadarResetReadChangesSuccessV2,$t as parseRadarResetReadDetailBatchRequestV2,Xt as parseRadarResetReadHeadRequestV2,en as parseRadarResetReadHeadSuccessV2,oe as parseRadarResetSnapshotAvailableV1,rn as parseRadarResetSourceErrorEnvelopeV2,at as parseRadarResetUInt64DecimalV2,Ga as projectRadarBrowserSubscriptionSelection,ro as projectRadarBrowserSubscriptionV1,ri as projectRadarResetExportV1FromV2,Je as projectRadarResetPrimarySourceV1,ci as projectRadarResetPublicActionToV2,z as radarActivityEventIdSchema,V as radarActivityFileSchema,nr as radarActivityFileUrl,Tr as radarActivityFileV2Schema,rr as radarActivityFileV2Url,Qi as radarActivityFileV3Schema,Bi as radarActivityFileV3Url,B as radarActivityMaxBytes,sr as radarActivityProgressSchema,Sr as radarActivityProgressV2Schema,qi as radarActivityProgressV3Schema,cr as radarActivityReactionCountsSchema,tr as radarActivityReactionIdSchema,R as radarActivityReactionIds,Ca as radarBrowserNotificationProjectionSchema,Sa as radarBrowserNotificationTopicSchema,za as radarBrowserRegistrationSchema,qa as radarBrowserSubscriptionErrorRes,Ua as radarBrowserSubscriptionFailureSchema,Wa as radarBrowserSubscriptionOperationSchema,Ha as radarBrowserSubscriptionReadReq,Ka as radarBrowserSubscriptionRes,Va as radarBrowserSubscriptionSaveReq,$a as radarBrowserSubscriptionSaveV2Req,to as radarBrowserSubscriptionV2Res,Y as radarBrowserSubscriptionViewSchema,eo as radarBrowserSubscriptionViewV2Schema,Na as radarBrowserSubscriptionsPath,La as radarBrowserTopicsSchema,Ya as radarBrowserTopicsV2Schema,Rr as radarCodexGuessChoiceSchema,Ur as radarCodexGuessErrorSchema,zr as radarCodexGuessSaveReqSchema,Hr as radarCodexGuessViewSchema,K as radarCodexModelIdSchema,da as radarCodexModelUrl,ls as radarCodexModelsMaxBytes,hs as radarCodexModelsPath,fs as radarCodexModelsSchema,fa as radarCodexProgressCalendar,Mr as radarCodexProgressChangeSchema,Pr as radarCodexProgressChangeV2Schema,na as radarCodexProgressChangeV3Schema,Nr as radarCodexProgressChangesV1Schema,Fr as radarCodexProgressChangesV2Schema,ra as radarCodexProgressChangesV3Schema,j as radarCodexProgressEntrySchema,zn as radarCodexProgressEntryV3Schema,Ni as radarCodexProgressEntryV5Schema,ji as radarCodexProgressImprovementV5Schema,Di as radarCodexProgressPostRoleV5Schema,Oi as radarCodexProgressPostV5Schema,ki as radarCodexProgressPostsV5Schema,Mi as radarCodexProgressResetEntryV5Schema,Wn as radarCodexProgressScore,F as radarCodexProgressTitleV3Schema,M as radarCodexProgressV1Schema,Mn as radarCodexProgressV2MaxBytes,P as radarCodexProgressV2Schema,Rn as radarCodexProgressV3MaxBytes,I as radarCodexProgressV3Schema,Kn as radarCodexProgressV4MaxBytes,L as radarCodexProgressV4Schema,Ai as radarCodexProgressV5MaxBytes,Ri as radarCodexProgressV5Schema,Bo as radarCodexReleaseDirectoryMaxBytes,zo as radarCodexReleaseDirectoryPath,Jo as radarCodexReleaseDirectorySchema,G as radarCodexReleaseIdentitySchema,Vo as radarCodexReleaseMonthMaxBytes,ss as radarCodexReleaseMonthPath,Qo as radarCodexReleaseMonthSchema,Ho as radarCodexReleaseNotesMaxBytes,cs as radarCodexReleaseNotesPath,es as radarCodexReleaseNotesSchema,$o as radarCodexReleaseSectionsSchema,ua as radarCodexReleaseUrl,Uo as radarCodexTimePointSchema,so as radarImprovementColumnPath,go as radarImprovementEligibilityReq,_o as radarImprovementEligibilityRes,uo as radarImprovementEntrySchema,vo as radarImprovementErrorRes,fo as radarImprovementHeadReq,po as radarImprovementHeadRes,oo as radarImprovementPageMaxBytes,mo as radarImprovementPageReq,ho as radarImprovementPageRes,ao as radarImprovementPageSize,xa as radarNotificationProjectionSchema,ba as radarNotificationTargetSchema,ka as radarNotificationTaskPageSize,Ea as radarNotificationTaskSchema,Oa as radarNotificationTasksPath,ja as radarNotificationTasksReq,Ma as radarNotificationTasksRes,_a as radarNotificationTopicSchema,va as radarNotificationTopicsSchema,b as radarResetActionDetailV1Schema,H as radarResetActionDetailV2Schema,Ot as radarResetActionItemV2Schema,Qe as radarResetActionPageMaxBytesV2,Ze as radarResetActionPageMaxItemsV2,bt as radarResetActionSummaryV2Schema,Et as radarResetActiveActionItemV2Schema,Pe as radarResetAnalysisV1Schema,n as radarResetAnalyzerContractVersionV1,s as radarResetAudienceValues,It as radarResetChangeCoverageV2Schema,et as radarResetChangePageMaxBytesV2,$e as radarResetChangePageMaxItemsV2,Eo as radarResetClueLifetimeMs,Do as radarResetClueMaxBytes,To as radarResetCluePath,Oo as radarResetClueSchema,ko as radarResetClueSnapshotSchema,t as radarResetContractVersionV1,Ye as radarResetContractVersionV2,nt as radarResetDetailBatchMaxBytesV2,tt as radarResetDetailBatchMaxChunksV2,wt as radarResetDetailChunkReferenceV2Schema,Mt as radarResetDetailChunkRequestV2Schema,Tt as radarResetDetailManifestV2Schema,a as radarResetEffectValues,He as radarResetExportV1Schema,$r as radarResetExportV2Schema,qr as radarResetKindNoticeV2Schema,wi as radarResetManagementActionSchema,vi as radarResetManagementOperationSchema,Ti as radarResetManagementResSchema,Ci as radarResetManualApplyReqSchema,_i as radarResetManualCopySchema,yi as radarResetManualDraftSchema,xi as radarResetManualDraftSeedSchema,bi as radarResetManualPreviewReqSchema,Si as radarResetManualPreviewResSchema,Ei as radarResetManualResultResSchema,Le as radarResetNoticeKindValues,x as radarResetPendingActionV1Schema,U as radarResetPendingActionV2Schema,c as radarResetPlanValues,C as radarResetPositiveDecimalV2Schema,o as radarResetProductValues,ui as radarResetPublicActionV1Schema,r as radarResetPublicDataLimits,T as radarResetPublicIdV2Schema,ii as radarResetPublicRecordsCorePath,mi as radarResetPublicRecordsV1Schema,St as radarResetPublicationHomeFactsV2Schema,Yt as radarResetPublicationRevisionAvailableV2Schema,Re as radarResetPublicationTimingSchema,Rt as radarResetReadActionsDataV2Schema,At as radarResetReadActionsRequestV2Schema,Ht as radarResetReadActionsSuccessV2Schema,zt as radarResetReadChangesDataV2Schema,jt as radarResetReadChangesRequestV2Schema,Ut as radarResetReadChangesSuccessV2Schema,Nt as radarResetReadDetailBatchRequestV2Schema,Lt as radarResetReadHeadDataV2Schema,kt as radarResetReadHeadRequestV2Schema,Vt as radarResetReadHeadSuccessV2Schema,ee as radarResetReasonBasisValues,l as radarResetReasonCategoryValues,Kt as radarResetSafeCauseSnapshotV2Schema,i as radarResetSeriesValues,E as radarResetSha256V2Schema,ae as radarResetSnapshotAvailableV1Schema,Ft as radarResetSourceChangeV2Schema,Wt as radarResetSourceErrorCodeValuesV2,Jt as radarResetSourceErrorEnvelopeV2Schema,Tn as radarResetSourceErrorHttpStatusV2,wn as radarResetSourceErrorIsRetryableV2,qt as radarResetSourceErrorV2Schema,Xe as radarResetSourceMaxRpcCallsV2,Wr as radarResetSourceTranslationsSchema,it as radarResetUInt64DecimalV2Schema,st as radarResetUInt64DecimalV2ToBigInt,di as radarResetUnexecutedActionV1Schema,w as radarResetUtcTimestampV2Schema,Dt as radarResetWithdrawnActionItemV2Schema,fi as radarResetWithdrawnActionV1Schema,bo as radarTiboSourceStatusMaxBytes,yo as radarTiboSourceStatusPath,Co as radarTiboSourceStatusSchema,yr as radarTitledActivityFileSchema,gr as radarTitledActivityProgressSchema,ca as radarWebsiteLocalePrefixes,sa as radarWebsiteLocales,oa as radarWebsiteOrigin,la as radarWebsitePagePaths,q as radarWebsitePageUrl,Er as readRadarActivityFile,Or as readRadarActivityFileV2,$i as readRadarActivityFileV3,ms as readRadarCodexModels,is as readRadarCodexReleaseDirectory,as as readRadarCodexReleaseMonth,os as readRadarCodexReleaseNotes,Mo as readRadarResetClueSnapshot,wo as readRadarTiboSourceStatus,Dr as readRadarTitledActivityFile,Ba as redactRadarBrowserRegistrationReferences,Cn as toSafeCauseSnapshotV2,io as upgradeRadarBrowserSubscriptionCommandV1};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@closerepo/radar-contracts",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {