cueframe 0.1.2 → 0.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/analyze-4EZTZEAG.js +2 -0
- package/dist/chunk-3QSA3EBY.js +2 -0
- package/dist/chunk-4FMFWW74.js +12 -0
- package/dist/cueframe.js +46 -39
- package/dist/supportedAgents.js +2 -0
- package/package.json +4 -3
- package/skills/add-music-bed/SKILL.md +103 -0
- package/skills/brand-reel/SKILL.md +103 -0
- package/skills/clip-a-talking-head/SKILL.md +95 -0
- package/skills/composing-video/SKILL.md +666 -0
- package/skills/cueframe-brand-demo/SKILL.md +9 -6
- package/skills/cueframe-cli/SKILL.md +1 -1
- package/skills/cueframe-component-authoring/SKILL.md +3 -3
- package/skills/cueframe-compose-loop/SKILL.md +3 -0
- package/skills/cueframe-storyboard/SKILL.md +99 -0
- package/skills/every-format-from-one-edit/SKILL.md +91 -0
- package/skills/extracting-brand-kits/SKILL.md +156 -0
- package/skills/launch-video/SKILL.md +95 -0
- package/skills/make-a-social-reel/SKILL.md +103 -0
- package/skills/rebrand-a-video/SKILL.md +99 -0
- package/skills/video-craft-standards/SKILL.md +119 -0
- package/dist/analyze-CN3MXICA.js +0 -2
- package/dist/chunk-ZBD4U6PD.js +0 -12
package/dist/chunk-ZBD4U6PD.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
var lt=Object.defineProperty;var ee=(n,o)=>{for(var s in o)lt(n,s,{get:o[s],enumerable:!0})};var N=class extends Error{status;code;details;requestId;constructor(o,s,i){super(s.message),this.name="ApiError",this.status=o,this.code=s.code,this.details=s.details,this.requestId=i}},$={baseUrl:""};function We(n){return $={timeoutMs:3e4,...n},$}function Ke(){return $}function ut(n,o){return/^https?:\/\//.test(o)?o:n.replace(/\/$/,"")+(o.startsWith("/")?o:`/${o}`)}async function Qe(n,o={}){if(!$.baseUrl)throw new Error("@cueframe/sdk: createClient({baseUrl}) must be called before issuing requests.");let s=$.fetch??fetch,i=ut($.baseUrl,n),a=new Headers({accept:"application/json"});for(let[M,W]of Object.entries($.headers??{}))a.set(M,W);o.headers&&new Headers(o.headers).forEach((M,W)=>a.set(W,M)),$.apiKey&&!a.has("authorization")&&a.set("authorization",`Bearer ${$.apiKey}`);let d=new AbortController,l=setTimeout(()=>d.abort(),$.timeoutMs??3e4),u=o.signal??d.signal,z;try{z=await s(i,{...o,headers:a,signal:u})}finally{clearTimeout(l)}let b={};z.headers.forEach((M,W)=>{b[W.toLowerCase()]=M});let R=null;if(z.status!==204)if((z.headers.get("content-type")??"").includes("application/json"))try{R=await z.json()}catch{R=null}else R=await z.text();return{status:z.status,statusText:z.statusText,headers:b,body:R,requestId:b["x-request-id"]}}async function O(n,o={}){let s=await Qe(n,o);if(s.status>=400){let i;throw s.body&&typeof s.body=="object"&&"error"in s.body?i=s.body.error??{code:"unknown",message:s.statusText}:i={code:"unknown",message:s.statusText},new N(s.status,i,s.requestId)}if(s.status!==204)return s.body}var ft={media_not_ready:"Media is still processing. Wait for the `media.transcribed` webhook or retry after ~30s.",suggestions_already_complete:"Suggestions already exist for this media item. To re-run, call DELETE /v1/media/:id/suggestions first to reset state.",precondition_required:"Fetch the resource with GET first to obtain its ETag, then resend the write with `If-Match: <etag>`. `cueframe composition get` returns one for you.",stale_etag:"Resource was modified since your last GET \u2014 `details.currentEtag` is the value to thread next. Re-GET (or run `cueframe composition get`) and rebase your edits before retrying.",conflict:"ETag mismatch \u2014 the resource was modified since your last GET. Re-fetch and merge before retrying.",media_in_use:"Media is referenced by other resources. See `details.projectIds` and `details.sessionIds` \u2014 remove those references before deleting.",session_in_use:"Session is referenced by a composition. See `details.projectIds` \u2014 remove those references before deleting.",render_not_cancellable:"Render is already in a terminal state (complete / error / cancelled) and cannot be cancelled.",rate_limited:"Rate limit exceeded. Back off using the `retry-after` response header.",invalid_composition:"Composition violates an invariant (see `details`). Common ones: clip_source_track_kind_mismatch, track_clips_overlap, transition_no_predecessor.",clip_not_found:"The clip suggestion publicId doesn't exist in this org. Run `cueframe clips <mediaItemId>` to enumerate valid sug_* ids.",service_unavailable:"Upstream pipeline is unavailable. Retry shortly; if persistent, the worker is down \u2014 check status / ops dashboards.",payment_required:"The request exceeds a billing limit. For generation, the estimated cost is over the per-call ceiling (see `details.estimateUsd` / `details.ceilingUsd`) \u2014 lower the requested duration or raise the ceiling."};function Le(n){return n instanceof N?ft[n.code]??null:null}async function*gt(n,o,s){let i=Ke();if(!i?.baseUrl)throw new Error(`@cueframe/sdk: createClient({baseUrl}) must be called before ${o}.`);let a=i.baseUrl.replace(/\/$/,"")+n,d=new Headers({accept:"text/event-stream",...i.headers??{}});i.apiKey&&!d.has("authorization")&&d.set("authorization",`Bearer ${i.apiKey}`);let u=await(i.fetch??fetch)(a,{method:"GET",headers:d,signal:s.signal});if(!u.ok){let M;try{M=(await u.json()).error??{code:"unknown",message:u.statusText}}catch{M={code:"unknown",message:u.statusText}}throw new N(u.status,M,u.headers.get("x-request-id")??void 0)}if(!u.body)throw new Error("SSE response has no body");let z=u.body.getReader(),b=new TextDecoder("utf-8"),R="";try{for(;;){let{value:M,done:W}=await z.read();if(W)break;R+=b.decode(M,{stream:!0});let Q=R.indexOf(`
|
|
3
|
-
|
|
4
|
-
`);for(;Q!==-1;){let mt=R.slice(0,Q);R=R.slice(Q+2);let Xe=ht(mt);Xe&&(yield Xe),Q=R.indexOf(`
|
|
5
|
-
|
|
6
|
-
`)}}}finally{try{z.releaseLock()}catch{}}}function ht(n){if(!n.trim())return null;let o=null,s=[];for(let i of n.split(`
|
|
7
|
-
`)){if(!i||i.startsWith(":"))continue;let a=i.indexOf(":");if(a===-1)continue;let d=i.slice(0,a),l=i.slice(a+1).replace(/^ /,"");d==="event"?o=l:d==="data"&&s.push(l)}return!o||s.length===0?null:{event:o,data:s.join(`
|
|
8
|
-
`)}}async function*yt(n,o,s={}){let i=`/v1/projects/${encodeURIComponent(n)}/renders/${encodeURIComponent(o)}/stream`;for await(let a of gt(i,"iterRenderEvents",s)){let d=zt(a);d&&(yield d)}}function zt(n){let{event:o,data:s}=n;if(s===null||o!=="progress"&&o!=="complete"&&o!=="error")return null;let i;try{i=JSON.parse(s)}catch{return null}return{event:o,data:i}}var mo={};ee(mo,{createMediaUpload:()=>bt,deleteMedia:()=>Ot,generateMedia:()=>St,getCreateMediaUploadUrl:()=>eo,getDeleteMediaUrl:()=>ro,getGenerateMediaUrl:()=>to,getGetMediaContextUrl:()=>ao,getGetMediaPerformanceUrl:()=>co,getGetMediaTranscriptUrl:()=>io,getGetMediaUrl:()=>so,getImportMediaUrl:()=>no,getListMediaUrl:()=>oo,getMedia:()=>It,getMediaContext:()=>kt,getMediaPerformance:()=>wt,getMediaTranscript:()=>Rt,getTriggerSubjectDetectionUrl:()=>po,importMedia:()=>vt,listMedia:()=>Ct,triggerSubjectDetection:()=>Tt});var eo=()=>"/v1/media",bt=async(n,o)=>O(eo(),{...o,method:"POST",headers:{"Content-Type":"application/json",...o?.headers},body:JSON.stringify(n)}),oo=()=>"/v1/media",Ct=async n=>O(oo(),{...n,method:"GET"}),to=()=>"/v1/media/generate",St=async(n,o)=>O(to(),{...o,method:"POST",headers:{"Content-Type":"application/json",...o?.headers},body:JSON.stringify(n)}),no=()=>"/v1/media/import",vt=async(n,o)=>O(no(),{...o,method:"POST",headers:{"Content-Type":"application/json",...o?.headers},body:JSON.stringify(n)}),ro=n=>`/v1/media/${n}`,Ot=async(n,o)=>O(ro(n),{...o,method:"DELETE"}),so=n=>`/v1/media/${n}`,It=async(n,o)=>O(so(n),{...o,method:"GET"}),io=n=>`/v1/media/${n}/transcript`,Rt=async(n,o)=>O(io(n),{...o,method:"GET"}),ao=n=>`/v1/media/${n}/context`,kt=async(n,o)=>O(ao(n),{...o,method:"GET"}),po=n=>`/v1/media/${n}/detect-subjects`,Tt=async(n,o)=>O(po(n),{...o,method:"POST"}),co=n=>`/v1/media/${n}/performance`,wt=async(n,o)=>O(co(n),{...o,method:"GET"});var yo={};ee(yo,{createProject:()=>Mt,deleteProject:()=>Bt,getCreateProjectUrl:()=>uo,getDeleteProjectUrl:()=>ho,getGetProjectUrl:()=>fo,getListProjectsUrl:()=>lo,getPatchProjectUrl:()=>go,getProject:()=>_t,listProjects:()=>jt,patchProject:()=>Pt});var lo=()=>"/v1/projects",jt=async n=>O(lo(),{...n,method:"GET"}),uo=()=>"/v1/projects",Mt=async(n,o)=>O(uo(),{...o,method:"POST",headers:{"Content-Type":"application/json",...o?.headers},body:JSON.stringify(n)}),fo=n=>`/v1/projects/${n}`,_t=async(n,o)=>O(fo(n),{...o,method:"GET"}),go=n=>`/v1/projects/${n}`,Pt=async(n,o,s)=>O(go(n),{...s,method:"PATCH",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(o)}),ho=n=>`/v1/projects/${n}`,Bt=async(n,o)=>O(ho(n),{...o,method:"DELETE"});var Io={};ee(Io,{cancelRender:()=>Nt,createRender:()=>Et,getCancelRenderUrl:()=>Co,getCreateRenderUrl:()=>zo,getGetRenderUrl:()=>bo,getListProjectRendersUrl:()=>xo,getRefreshRenderUrlUrl:()=>vo,getRender:()=>Ft,getRetryRenderUrl:()=>So,getStreamRenderUrl:()=>Oo,listProjectRenders:()=>At,refreshRenderUrl:()=>Ut,retryRender:()=>qt,streamRender:()=>Dt});var zo=n=>`/v1/projects/${n}/renders`,Et=async(n,o,s)=>O(zo(n),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(o)}),xo=n=>`/v1/projects/${n}/renders`,At=async(n,o)=>O(xo(n),{...o,method:"GET"}),bo=(n,o)=>`/v1/projects/${n}/renders/${o}`,Ft=async(n,o,s)=>O(bo(n,o),{...s,method:"GET"}),Co=(n,o)=>`/v1/projects/${n}/renders/${o}/cancel`,Nt=async(n,o,s)=>O(Co(n,o),{...s,method:"POST"}),So=(n,o)=>`/v1/projects/${n}/renders/${o}/retry`,qt=async(n,o,s)=>O(So(n,o),{...s,method:"POST"}),vo=(n,o)=>`/v1/projects/${n}/renders/${o}/refresh-url`,Ut=async(n,o,s)=>O(vo(n,o),{...s,method:"POST"}),Oo=(n,o)=>`/v1/projects/${n}/renders/${o}/stream`,Dt=async(n,o,s)=>O(Oo(n,o),{...s,method:"GET"});var wo={};ee(wo,{createFcpxmlExport:()=>Wt,createPremiereExport:()=>Kt,getCreateFcpxmlExportUrl:()=>Ro,getCreatePremiereExportUrl:()=>ko,getExport:()=>Lt,getGetExportUrl:()=>To});var Ro=n=>`/v1/projects/${n}/exports/fcpxml`,Wt=async(n,o,s)=>O(Ro(n),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(o)}),ko=n=>`/v1/projects/${n}/exports/premiere`,Kt=async(n,o,s)=>O(ko(n),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(o)}),To=(n,o)=>`/v1/projects/${n}/exports/${o}`,Lt=async(n,o,s)=>O(To(n,o),{...s,method:"GET"});var Ao={};ee(Ao,{createSession:()=>Vt,deleteSession:()=>Jt,getCreateSessionUrl:()=>Mo,getDeleteSessionUrl:()=>Po,getGetMuxJobUrl:()=>Eo,getGetSessionUrl:()=>_o,getListSessionsUrl:()=>jo,getMuxJob:()=>Xt,getSession:()=>Ht,getTriggerMuxJobUrl:()=>Bo,listSessions:()=>Zt,triggerMuxJob:()=>Yt});var jo=()=>"/v1/sessions",Zt=async n=>O(jo(),{...n,method:"GET"}),Mo=()=>"/v1/sessions",Vt=async(n,o)=>O(Mo(),{...o,method:"POST",headers:{"Content-Type":"application/json",...o?.headers},body:JSON.stringify(n)}),_o=n=>`/v1/sessions/${n}`,Ht=async(n,o)=>O(_o(n),{...o,method:"GET"}),Po=n=>`/v1/sessions/${n}`,Jt=async(n,o)=>O(Po(n),{...o,method:"DELETE"}),Bo=n=>`/v1/sessions/${n}/mux-job`,Yt=async(n,o)=>O(Bo(n),{...o,method:"POST"}),Eo=n=>`/v1/sessions/${n}/mux-job`,Xt=async(n,o)=>O(Eo(n),{...o,method:"GET"});var Wo={};ee(Wo,{createComponent:()=>en,getComponent:()=>tn,getComponentSource:()=>nn,getCreateComponentUrl:()=>No,getGetComponentSourceUrl:()=>Do,getGetComponentUrl:()=>Uo,getListComponentsUrl:()=>Fo,getUpdateComponentUrl:()=>qo,listComponents:()=>Qt,updateComponent:()=>on});var Fo=n=>{let o=new URLSearchParams;Object.entries(n||{}).forEach(([i,a])=>{a!==void 0&&o.append(i,a===null?"null":a.toString())});let s=o.toString();return s.length>0?`/v1/components?${s}`:"/v1/components"},Qt=async(n,o)=>O(Fo(n),{...o,method:"GET"}),No=()=>"/v1/components",en=async(n,o)=>O(No(),{...o,method:"POST",headers:{"Content-Type":"application/json",...o?.headers},body:JSON.stringify(n)}),qo=n=>`/v1/components/${n}`,on=async(n,o,s)=>O(qo(n),{...s,method:"PUT",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(o)}),Uo=n=>`/v1/components/${n}`,tn=async(n,o)=>O(Uo(n),{...o,method:"GET"}),Do=n=>`/v1/components/${n}/source`,nn=async(n,o)=>O(Do(n),{...o,method:"GET"});var Me={};ee(Me,{composeFromSuggestion:()=>dn,getComposeFromSuggestionUrl:()=>Ko,getListMediaSuggestionsUrl:()=>Lo,getResetMediaSuggestionsUrl:()=>Go,getTriggerMediaSuggestionsUrl:()=>$o,listMediaSuggestions:()=>pn,resetMediaSuggestions:()=>mn,triggerMediaSuggestions:()=>cn});var Ko=n=>`/v1/projects/${n}/composition/from-suggestion`,dn=async(n,o,s)=>O(Ko(n),{...s,method:"POST",headers:{"Content-Type":"application/json",...s?.headers},body:JSON.stringify(o)}),Lo=n=>`/v1/media/${n}/suggestions`,pn=async(n,o)=>O(Lo(n),{...o,method:"GET"}),$o=n=>`/v1/media/${n}/suggestions`,cn=async(n,o)=>O($o(n),{...o,method:"POST"}),Go=n=>`/v1/media/${n}/suggestions`,mn=async(n,o)=>O(Go(n),{...o,method:"DELETE"});var ot={};ee(ot,{BRAND:()=>Kn,DIRTY:()=>se,EMPTY_PATH:()=>Cn,INVALID:()=>I,NEVER:()=>xr,OK:()=>B,ParseStatus:()=>P,Schema:()=>w,ZodAny:()=>ne,ZodArray:()=>X,ZodBigInt:()=>ae,ZodBoolean:()=>de,ZodBranded:()=>Pe,ZodCatch:()=>xe,ZodDate:()=>pe,ZodDefault:()=>ze,ZodDiscriminatedUnion:()=>qe,ZodEffects:()=>D,ZodEnum:()=>he,ZodError:()=>E,ZodFirstPartyTypeKind:()=>k,ZodFunction:()=>De,ZodIntersection:()=>ue,ZodIssueCode:()=>g,ZodLazy:()=>fe,ZodLiteral:()=>ge,ZodMap:()=>Re,ZodNaN:()=>Te,ZodNativeEnum:()=>ye,ZodNever:()=>K,ZodNull:()=>me,ZodNullable:()=>V,ZodNumber:()=>ie,ZodObject:()=>A,ZodOptional:()=>q,ZodParsedType:()=>S,ZodPipeline:()=>Be,ZodPromise:()=>re,ZodReadonly:()=>be,ZodRecord:()=>Ue,ZodSchema:()=>w,ZodSet:()=>ke,ZodString:()=>te,ZodSymbol:()=>Oe,ZodTransformer:()=>D,ZodTuple:()=>Z,ZodType:()=>w,ZodUndefined:()=>ce,ZodUnion:()=>le,ZodUnknown:()=>Y,ZodVoid:()=>Ie,addIssueToContext:()=>x,any:()=>Yn,array:()=>c,bigint:()=>Zn,boolean:()=>h,coerce:()=>zr,custom:()=>et,date:()=>Vn,datetimeRegex:()=>Xo,defaultErrorMap:()=>H,discriminatedUnion:()=>or,effect:()=>cr,enum:()=>p,function:()=>ir,getErrorMap:()=>Ce,getParsedType:()=>G,instanceof:()=>$n,intersection:()=>tr,isAborted:()=>Fe,isAsync:()=>Se,isDirty:()=>Ne,isValid:()=>oe,late:()=>Ln,lazy:()=>ar,literal:()=>m,makeIssue:()=>_e,map:()=>rr,nan:()=>Gn,nativeEnum:()=>dr,never:()=>Xn,null:()=>L,nullable:()=>lr,number:()=>t,object:()=>r,objectUtil:()=>$e,oboolean:()=>yr,onumber:()=>hr,optional:()=>mr,ostring:()=>gr,pipeline:()=>fr,preprocess:()=>ur,promise:()=>pr,quotelessJson:()=>zn,record:()=>f,set:()=>sr,setErrorMap:()=>bn,strictObject:()=>er,string:()=>e,symbol:()=>Hn,transformer:()=>cr,tuple:()=>nr,undefined:()=>Jn,union:()=>C,unknown:()=>y,util:()=>j,void:()=>Qn});var j;(function(n){n.assertEqual=a=>{};function o(a){}n.assertIs=o;function s(a){throw new Error}n.assertNever=s,n.arrayToEnum=a=>{let d={};for(let l of a)d[l]=l;return d},n.getValidEnumValues=a=>{let d=n.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),l={};for(let u of d)l[u]=a[u];return n.objectValues(l)},n.objectValues=a=>n.objectKeys(a).map(function(d){return a[d]}),n.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let d=[];for(let l in a)Object.prototype.hasOwnProperty.call(a,l)&&d.push(l);return d},n.find=(a,d)=>{for(let l of a)if(d(l))return l},n.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function i(a,d=" | "){return a.map(l=>typeof l=="string"?`'${l}'`:l).join(d)}n.joinValues=i,n.jsonStringifyReplacer=(a,d)=>typeof d=="bigint"?d.toString():d})(j||(j={}));var $e;(function(n){n.mergeShapes=(o,s)=>({...o,...s})})($e||($e={}));var S=j.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),G=n=>{switch(typeof n){case"undefined":return S.undefined;case"string":return S.string;case"number":return Number.isNaN(n)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(n)?S.array:n===null?S.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?S.promise:typeof Map<"u"&&n instanceof Map?S.map:typeof Set<"u"&&n instanceof Set?S.set:typeof Date<"u"&&n instanceof Date?S.date:S.object;default:return S.unknown}};var g=j.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),zn=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),E=class n extends Error{get errors(){return this.issues}constructor(o){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=o}format(o){let s=o||function(d){return d.message},i={_errors:[]},a=d=>{for(let l of d.issues)if(l.code==="invalid_union")l.unionErrors.map(a);else if(l.code==="invalid_return_type")a(l.returnTypeError);else if(l.code==="invalid_arguments")a(l.argumentsError);else if(l.path.length===0)i._errors.push(s(l));else{let u=i,z=0;for(;z<l.path.length;){let b=l.path[z];z===l.path.length-1?(u[b]=u[b]||{_errors:[]},u[b]._errors.push(s(l))):u[b]=u[b]||{_errors:[]},u=u[b],z++}}};return a(this),i}static assert(o){if(!(o instanceof n))throw new Error(`Not a ZodError: ${o}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,j.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(o=s=>s.message){let s={},i=[];for(let a of this.issues)if(a.path.length>0){let d=a.path[0];s[d]=s[d]||[],s[d].push(o(a))}else i.push(o(a));return{formErrors:i,fieldErrors:s}}get formErrors(){return this.flatten()}};E.create=n=>new E(n);var xn=(n,o)=>{let s;switch(n.code){case g.invalid_type:n.received===S.undefined?s="Required":s=`Expected ${n.expected}, received ${n.received}`;break;case g.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(n.expected,j.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:s=`Unrecognized key(s) in object: ${j.joinValues(n.keys,", ")}`;break;case g.invalid_union:s="Invalid input";break;case g.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${j.joinValues(n.options)}`;break;case g.invalid_enum_value:s=`Invalid enum value. Expected ${j.joinValues(n.options)}, received '${n.received}'`;break;case g.invalid_arguments:s="Invalid function arguments";break;case g.invalid_return_type:s="Invalid function return type";break;case g.invalid_date:s="Invalid date";break;case g.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(s=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?s=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?s=`Invalid input: must end with "${n.validation.endsWith}"`:j.assertNever(n.validation):n.validation!=="regex"?s=`Invalid ${n.validation}`:s="Invalid";break;case g.too_small:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:s="Invalid input";break;case g.too_big:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?s=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:s="Invalid input";break;case g.custom:s="Invalid input";break;case g.invalid_intersection_types:s="Intersection results could not be merged";break;case g.not_multiple_of:s=`Number must be a multiple of ${n.multipleOf}`;break;case g.not_finite:s="Number must be finite";break;default:s=o.defaultError,j.assertNever(n)}return{message:s}},H=xn;var Zo=H;function bn(n){Zo=n}function Ce(){return Zo}var _e=n=>{let{data:o,path:s,errorMaps:i,issueData:a}=n,d=[...s,...a.path||[]],l={...a,path:d};if(a.message!==void 0)return{...a,path:d,message:a.message};let u="",z=i.filter(b=>!!b).slice().reverse();for(let b of z)u=b(l,{data:o,defaultError:u}).message;return{...a,path:d,message:u}},Cn=[];function x(n,o){let s=Ce(),i=_e({issueData:o,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s,s===H?void 0:H].filter(a=>!!a)});n.common.issues.push(i)}var P=class n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(o,s){let i=[];for(let a of s){if(a.status==="aborted")return I;a.status==="dirty"&&o.dirty(),i.push(a.value)}return{status:o.value,value:i}}static async mergeObjectAsync(o,s){let i=[];for(let a of s){let d=await a.key,l=await a.value;i.push({key:d,value:l})}return n.mergeObjectSync(o,i)}static mergeObjectSync(o,s){let i={};for(let a of s){let{key:d,value:l}=a;if(d.status==="aborted"||l.status==="aborted")return I;d.status==="dirty"&&o.dirty(),l.status==="dirty"&&o.dirty(),d.value!=="__proto__"&&(typeof l.value<"u"||a.alwaysSet)&&(i[d.value]=l.value)}return{status:o.value,value:i}}},I=Object.freeze({status:"aborted"}),se=n=>({status:"dirty",value:n}),B=n=>({status:"valid",value:n}),Fe=n=>n.status==="aborted",Ne=n=>n.status==="dirty",oe=n=>n.status==="valid",Se=n=>typeof Promise<"u"&&n instanceof Promise;var v;(function(n){n.errToObj=o=>typeof o=="string"?{message:o}:o||{},n.toString=o=>typeof o=="string"?o:o?.message})(v||(v={}));var U=class{constructor(o,s,i,a){this._cachedPath=[],this.parent=o,this.data=s,this._path=i,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Vo=(n,o)=>{if(oe(o))return{success:!0,data:o.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let s=new E(n.common.issues);return this._error=s,this._error}}};function T(n){if(!n)return{};let{errorMap:o,invalid_type_error:s,required_error:i,description:a}=n;if(o&&(s||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return o?{errorMap:o,description:a}:{errorMap:(l,u)=>{let{message:z}=n;return l.code==="invalid_enum_value"?{message:z??u.defaultError}:typeof u.data>"u"?{message:z??i??u.defaultError}:l.code!=="invalid_type"?{message:u.defaultError}:{message:z??s??u.defaultError}},description:a}}var w=class{get description(){return this._def.description}_getType(o){return G(o.data)}_getOrReturnCtx(o,s){return s||{common:o.parent.common,data:o.data,parsedType:G(o.data),schemaErrorMap:this._def.errorMap,path:o.path,parent:o.parent}}_processInputParams(o){return{status:new P,ctx:{common:o.parent.common,data:o.data,parsedType:G(o.data),schemaErrorMap:this._def.errorMap,path:o.path,parent:o.parent}}}_parseSync(o){let s=this._parse(o);if(Se(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(o){let s=this._parse(o);return Promise.resolve(s)}parse(o,s){let i=this.safeParse(o,s);if(i.success)return i.data;throw i.error}safeParse(o,s){let i={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:o,parsedType:G(o)},a=this._parseSync({data:o,path:i.path,parent:i});return Vo(i,a)}"~validate"(o){let s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:o,parsedType:G(o)};if(!this["~standard"].async)try{let i=this._parseSync({data:o,path:[],parent:s});return oe(i)?{value:i.value}:{issues:s.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:o,path:[],parent:s}).then(i=>oe(i)?{value:i.value}:{issues:s.common.issues})}async parseAsync(o,s){let i=await this.safeParseAsync(o,s);if(i.success)return i.data;throw i.error}async safeParseAsync(o,s){let i={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:o,parsedType:G(o)},a=this._parse({data:o,path:i.path,parent:i}),d=await(Se(a)?a:Promise.resolve(a));return Vo(i,d)}refine(o,s){let i=a=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(a):s;return this._refinement((a,d)=>{let l=o(a),u=()=>d.addIssue({code:g.custom,...i(a)});return typeof Promise<"u"&&l instanceof Promise?l.then(z=>z?!0:(u(),!1)):l?!0:(u(),!1)})}refinement(o,s){return this._refinement((i,a)=>o(i)?!0:(a.addIssue(typeof s=="function"?s(i,a):s),!1))}_refinement(o){return new D({schema:this,typeName:k.ZodEffects,effect:{type:"refinement",refinement:o}})}superRefine(o){return this._refinement(o)}constructor(o){this.spa=this.safeParseAsync,this._def=o,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return q.create(this,this._def)}nullable(){return V.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return X.create(this)}promise(){return re.create(this,this._def)}or(o){return le.create([this,o],this._def)}and(o){return ue.create(this,o,this._def)}transform(o){return new D({...T(this._def),schema:this,typeName:k.ZodEffects,effect:{type:"transform",transform:o}})}default(o){let s=typeof o=="function"?o:()=>o;return new ze({...T(this._def),innerType:this,defaultValue:s,typeName:k.ZodDefault})}brand(){return new Pe({typeName:k.ZodBranded,type:this,...T(this._def)})}catch(o){let s=typeof o=="function"?o:()=>o;return new xe({...T(this._def),innerType:this,catchValue:s,typeName:k.ZodCatch})}describe(o){let s=this.constructor;return new s({...this._def,description:o})}pipe(o){return Be.create(this,o)}readonly(){return be.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Sn=/^c[^\s-]{8,}$/i,vn=/^[0-9a-z]+$/,On=/^[0-9A-HJKMNP-TV-Z]{26}$/i,In=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Rn=/^[a-z0-9_-]{21}$/i,kn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Tn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ge,Mn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_n=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Pn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Bn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,En=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,An=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jo="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Fn=new RegExp(`^${Jo}$`);function Yo(n){let o="[0-5]\\d";n.precision?o=`${o}\\.\\d{${n.precision}}`:n.precision==null&&(o=`${o}(\\.\\d+)?`);let s=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${o})${s}`}function Nn(n){return new RegExp(`^${Yo(n)}$`)}function Xo(n){let o=`${Jo}T${Yo(n)}`,s=[];return s.push(n.local?"Z?":"Z"),n.offset&&s.push("([+-]\\d{2}:?\\d{2})"),o=`${o}(${s.join("|")})`,new RegExp(`^${o}$`)}function qn(n,o){return!!((o==="v4"||!o)&&Mn.test(n)||(o==="v6"||!o)&&Pn.test(n))}function Un(n,o){if(!kn.test(n))return!1;try{let[s]=n.split(".");if(!s)return!1;let i=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),a=JSON.parse(atob(i));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||o&&a.alg!==o)}catch{return!1}}function Dn(n,o){return!!((o==="v4"||!o)&&_n.test(n)||(o==="v6"||!o)&&Bn.test(n))}var te=class n extends w{_parse(o){if(this._def.coerce&&(o.data=String(o.data)),this._getType(o)!==S.string){let d=this._getOrReturnCtx(o);return x(d,{code:g.invalid_type,expected:S.string,received:d.parsedType}),I}let i=new P,a;for(let d of this._def.checks)if(d.kind==="min")o.data.length<d.value&&(a=this._getOrReturnCtx(o,a),x(a,{code:g.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),i.dirty());else if(d.kind==="max")o.data.length>d.value&&(a=this._getOrReturnCtx(o,a),x(a,{code:g.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),i.dirty());else if(d.kind==="length"){let l=o.data.length>d.value,u=o.data.length<d.value;(l||u)&&(a=this._getOrReturnCtx(o,a),l?x(a,{code:g.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}):u&&x(a,{code:g.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}),i.dirty())}else if(d.kind==="email")wn.test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"email",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="emoji")Ge||(Ge=new RegExp(jn,"u")),Ge.test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"emoji",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="uuid")In.test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"uuid",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="nanoid")Rn.test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"nanoid",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="cuid")Sn.test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"cuid",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="cuid2")vn.test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"cuid2",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="ulid")On.test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"ulid",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="url")try{new URL(o.data)}catch{a=this._getOrReturnCtx(o,a),x(a,{validation:"url",code:g.invalid_string,message:d.message}),i.dirty()}else d.kind==="regex"?(d.regex.lastIndex=0,d.regex.test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"regex",code:g.invalid_string,message:d.message}),i.dirty())):d.kind==="trim"?o.data=o.data.trim():d.kind==="includes"?o.data.includes(d.value,d.position)||(a=this._getOrReturnCtx(o,a),x(a,{code:g.invalid_string,validation:{includes:d.value,position:d.position},message:d.message}),i.dirty()):d.kind==="toLowerCase"?o.data=o.data.toLowerCase():d.kind==="toUpperCase"?o.data=o.data.toUpperCase():d.kind==="startsWith"?o.data.startsWith(d.value)||(a=this._getOrReturnCtx(o,a),x(a,{code:g.invalid_string,validation:{startsWith:d.value},message:d.message}),i.dirty()):d.kind==="endsWith"?o.data.endsWith(d.value)||(a=this._getOrReturnCtx(o,a),x(a,{code:g.invalid_string,validation:{endsWith:d.value},message:d.message}),i.dirty()):d.kind==="datetime"?Xo(d).test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{code:g.invalid_string,validation:"datetime",message:d.message}),i.dirty()):d.kind==="date"?Fn.test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{code:g.invalid_string,validation:"date",message:d.message}),i.dirty()):d.kind==="time"?Nn(d).test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{code:g.invalid_string,validation:"time",message:d.message}),i.dirty()):d.kind==="duration"?Tn.test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"duration",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="ip"?qn(o.data,d.version)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"ip",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="jwt"?Un(o.data,d.alg)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"jwt",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="cidr"?Dn(o.data,d.version)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"cidr",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="base64"?En.test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"base64",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="base64url"?An.test(o.data)||(a=this._getOrReturnCtx(o,a),x(a,{validation:"base64url",code:g.invalid_string,message:d.message}),i.dirty()):j.assertNever(d);return{status:i.value,value:o.data}}_regex(o,s,i){return this.refinement(a=>o.test(a),{validation:s,code:g.invalid_string,...v.errToObj(i)})}_addCheck(o){return new n({...this._def,checks:[...this._def.checks,o]})}email(o){return this._addCheck({kind:"email",...v.errToObj(o)})}url(o){return this._addCheck({kind:"url",...v.errToObj(o)})}emoji(o){return this._addCheck({kind:"emoji",...v.errToObj(o)})}uuid(o){return this._addCheck({kind:"uuid",...v.errToObj(o)})}nanoid(o){return this._addCheck({kind:"nanoid",...v.errToObj(o)})}cuid(o){return this._addCheck({kind:"cuid",...v.errToObj(o)})}cuid2(o){return this._addCheck({kind:"cuid2",...v.errToObj(o)})}ulid(o){return this._addCheck({kind:"ulid",...v.errToObj(o)})}base64(o){return this._addCheck({kind:"base64",...v.errToObj(o)})}base64url(o){return this._addCheck({kind:"base64url",...v.errToObj(o)})}jwt(o){return this._addCheck({kind:"jwt",...v.errToObj(o)})}ip(o){return this._addCheck({kind:"ip",...v.errToObj(o)})}cidr(o){return this._addCheck({kind:"cidr",...v.errToObj(o)})}datetime(o){return typeof o=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:o}):this._addCheck({kind:"datetime",precision:typeof o?.precision>"u"?null:o?.precision,offset:o?.offset??!1,local:o?.local??!1,...v.errToObj(o?.message)})}date(o){return this._addCheck({kind:"date",message:o})}time(o){return typeof o=="string"?this._addCheck({kind:"time",precision:null,message:o}):this._addCheck({kind:"time",precision:typeof o?.precision>"u"?null:o?.precision,...v.errToObj(o?.message)})}duration(o){return this._addCheck({kind:"duration",...v.errToObj(o)})}regex(o,s){return this._addCheck({kind:"regex",regex:o,...v.errToObj(s)})}includes(o,s){return this._addCheck({kind:"includes",value:o,position:s?.position,...v.errToObj(s?.message)})}startsWith(o,s){return this._addCheck({kind:"startsWith",value:o,...v.errToObj(s)})}endsWith(o,s){return this._addCheck({kind:"endsWith",value:o,...v.errToObj(s)})}min(o,s){return this._addCheck({kind:"min",value:o,...v.errToObj(s)})}max(o,s){return this._addCheck({kind:"max",value:o,...v.errToObj(s)})}length(o,s){return this._addCheck({kind:"length",value:o,...v.errToObj(s)})}nonempty(o){return this.min(1,v.errToObj(o))}trim(){return new n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(o=>o.kind==="datetime")}get isDate(){return!!this._def.checks.find(o=>o.kind==="date")}get isTime(){return!!this._def.checks.find(o=>o.kind==="time")}get isDuration(){return!!this._def.checks.find(o=>o.kind==="duration")}get isEmail(){return!!this._def.checks.find(o=>o.kind==="email")}get isURL(){return!!this._def.checks.find(o=>o.kind==="url")}get isEmoji(){return!!this._def.checks.find(o=>o.kind==="emoji")}get isUUID(){return!!this._def.checks.find(o=>o.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(o=>o.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(o=>o.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(o=>o.kind==="cuid2")}get isULID(){return!!this._def.checks.find(o=>o.kind==="ulid")}get isIP(){return!!this._def.checks.find(o=>o.kind==="ip")}get isCIDR(){return!!this._def.checks.find(o=>o.kind==="cidr")}get isBase64(){return!!this._def.checks.find(o=>o.kind==="base64")}get isBase64url(){return!!this._def.checks.find(o=>o.kind==="base64url")}get minLength(){let o=null;for(let s of this._def.checks)s.kind==="min"&&(o===null||s.value>o)&&(o=s.value);return o}get maxLength(){let o=null;for(let s of this._def.checks)s.kind==="max"&&(o===null||s.value<o)&&(o=s.value);return o}};te.create=n=>new te({checks:[],typeName:k.ZodString,coerce:n?.coerce??!1,...T(n)});function Wn(n,o){let s=(n.toString().split(".")[1]||"").length,i=(o.toString().split(".")[1]||"").length,a=s>i?s:i,d=Number.parseInt(n.toFixed(a).replace(".","")),l=Number.parseInt(o.toFixed(a).replace(".",""));return d%l/10**a}var ie=class n extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(o){if(this._def.coerce&&(o.data=Number(o.data)),this._getType(o)!==S.number){let d=this._getOrReturnCtx(o);return x(d,{code:g.invalid_type,expected:S.number,received:d.parsedType}),I}let i,a=new P;for(let d of this._def.checks)d.kind==="int"?j.isInteger(o.data)||(i=this._getOrReturnCtx(o,i),x(i,{code:g.invalid_type,expected:"integer",received:"float",message:d.message}),a.dirty()):d.kind==="min"?(d.inclusive?o.data<d.value:o.data<=d.value)&&(i=this._getOrReturnCtx(o,i),x(i,{code:g.too_small,minimum:d.value,type:"number",inclusive:d.inclusive,exact:!1,message:d.message}),a.dirty()):d.kind==="max"?(d.inclusive?o.data>d.value:o.data>=d.value)&&(i=this._getOrReturnCtx(o,i),x(i,{code:g.too_big,maximum:d.value,type:"number",inclusive:d.inclusive,exact:!1,message:d.message}),a.dirty()):d.kind==="multipleOf"?Wn(o.data,d.value)!==0&&(i=this._getOrReturnCtx(o,i),x(i,{code:g.not_multiple_of,multipleOf:d.value,message:d.message}),a.dirty()):d.kind==="finite"?Number.isFinite(o.data)||(i=this._getOrReturnCtx(o,i),x(i,{code:g.not_finite,message:d.message}),a.dirty()):j.assertNever(d);return{status:a.value,value:o.data}}gte(o,s){return this.setLimit("min",o,!0,v.toString(s))}gt(o,s){return this.setLimit("min",o,!1,v.toString(s))}lte(o,s){return this.setLimit("max",o,!0,v.toString(s))}lt(o,s){return this.setLimit("max",o,!1,v.toString(s))}setLimit(o,s,i,a){return new n({...this._def,checks:[...this._def.checks,{kind:o,value:s,inclusive:i,message:v.toString(a)}]})}_addCheck(o){return new n({...this._def,checks:[...this._def.checks,o]})}int(o){return this._addCheck({kind:"int",message:v.toString(o)})}positive(o){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(o)})}negative(o){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(o)})}nonpositive(o){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(o)})}nonnegative(o){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(o)})}multipleOf(o,s){return this._addCheck({kind:"multipleOf",value:o,message:v.toString(s)})}finite(o){return this._addCheck({kind:"finite",message:v.toString(o)})}safe(o){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(o)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(o)})}get minValue(){let o=null;for(let s of this._def.checks)s.kind==="min"&&(o===null||s.value>o)&&(o=s.value);return o}get maxValue(){let o=null;for(let s of this._def.checks)s.kind==="max"&&(o===null||s.value<o)&&(o=s.value);return o}get isInt(){return!!this._def.checks.find(o=>o.kind==="int"||o.kind==="multipleOf"&&j.isInteger(o.value))}get isFinite(){let o=null,s=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(s===null||i.value>s)&&(s=i.value):i.kind==="max"&&(o===null||i.value<o)&&(o=i.value)}return Number.isFinite(s)&&Number.isFinite(o)}};ie.create=n=>new ie({checks:[],typeName:k.ZodNumber,coerce:n?.coerce||!1,...T(n)});var ae=class n extends w{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(o){if(this._def.coerce)try{o.data=BigInt(o.data)}catch{return this._getInvalidInput(o)}if(this._getType(o)!==S.bigint)return this._getInvalidInput(o);let i,a=new P;for(let d of this._def.checks)d.kind==="min"?(d.inclusive?o.data<d.value:o.data<=d.value)&&(i=this._getOrReturnCtx(o,i),x(i,{code:g.too_small,type:"bigint",minimum:d.value,inclusive:d.inclusive,message:d.message}),a.dirty()):d.kind==="max"?(d.inclusive?o.data>d.value:o.data>=d.value)&&(i=this._getOrReturnCtx(o,i),x(i,{code:g.too_big,type:"bigint",maximum:d.value,inclusive:d.inclusive,message:d.message}),a.dirty()):d.kind==="multipleOf"?o.data%d.value!==BigInt(0)&&(i=this._getOrReturnCtx(o,i),x(i,{code:g.not_multiple_of,multipleOf:d.value,message:d.message}),a.dirty()):j.assertNever(d);return{status:a.value,value:o.data}}_getInvalidInput(o){let s=this._getOrReturnCtx(o);return x(s,{code:g.invalid_type,expected:S.bigint,received:s.parsedType}),I}gte(o,s){return this.setLimit("min",o,!0,v.toString(s))}gt(o,s){return this.setLimit("min",o,!1,v.toString(s))}lte(o,s){return this.setLimit("max",o,!0,v.toString(s))}lt(o,s){return this.setLimit("max",o,!1,v.toString(s))}setLimit(o,s,i,a){return new n({...this._def,checks:[...this._def.checks,{kind:o,value:s,inclusive:i,message:v.toString(a)}]})}_addCheck(o){return new n({...this._def,checks:[...this._def.checks,o]})}positive(o){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(o)})}negative(o){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(o)})}nonpositive(o){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(o)})}nonnegative(o){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(o)})}multipleOf(o,s){return this._addCheck({kind:"multipleOf",value:o,message:v.toString(s)})}get minValue(){let o=null;for(let s of this._def.checks)s.kind==="min"&&(o===null||s.value>o)&&(o=s.value);return o}get maxValue(){let o=null;for(let s of this._def.checks)s.kind==="max"&&(o===null||s.value<o)&&(o=s.value);return o}};ae.create=n=>new ae({checks:[],typeName:k.ZodBigInt,coerce:n?.coerce??!1,...T(n)});var de=class extends w{_parse(o){if(this._def.coerce&&(o.data=!!o.data),this._getType(o)!==S.boolean){let i=this._getOrReturnCtx(o);return x(i,{code:g.invalid_type,expected:S.boolean,received:i.parsedType}),I}return B(o.data)}};de.create=n=>new de({typeName:k.ZodBoolean,coerce:n?.coerce||!1,...T(n)});var pe=class n extends w{_parse(o){if(this._def.coerce&&(o.data=new Date(o.data)),this._getType(o)!==S.date){let d=this._getOrReturnCtx(o);return x(d,{code:g.invalid_type,expected:S.date,received:d.parsedType}),I}if(Number.isNaN(o.data.getTime())){let d=this._getOrReturnCtx(o);return x(d,{code:g.invalid_date}),I}let i=new P,a;for(let d of this._def.checks)d.kind==="min"?o.data.getTime()<d.value&&(a=this._getOrReturnCtx(o,a),x(a,{code:g.too_small,message:d.message,inclusive:!0,exact:!1,minimum:d.value,type:"date"}),i.dirty()):d.kind==="max"?o.data.getTime()>d.value&&(a=this._getOrReturnCtx(o,a),x(a,{code:g.too_big,message:d.message,inclusive:!0,exact:!1,maximum:d.value,type:"date"}),i.dirty()):j.assertNever(d);return{status:i.value,value:new Date(o.data.getTime())}}_addCheck(o){return new n({...this._def,checks:[...this._def.checks,o]})}min(o,s){return this._addCheck({kind:"min",value:o.getTime(),message:v.toString(s)})}max(o,s){return this._addCheck({kind:"max",value:o.getTime(),message:v.toString(s)})}get minDate(){let o=null;for(let s of this._def.checks)s.kind==="min"&&(o===null||s.value>o)&&(o=s.value);return o!=null?new Date(o):null}get maxDate(){let o=null;for(let s of this._def.checks)s.kind==="max"&&(o===null||s.value<o)&&(o=s.value);return o!=null?new Date(o):null}};pe.create=n=>new pe({checks:[],coerce:n?.coerce||!1,typeName:k.ZodDate,...T(n)});var Oe=class extends w{_parse(o){if(this._getType(o)!==S.symbol){let i=this._getOrReturnCtx(o);return x(i,{code:g.invalid_type,expected:S.symbol,received:i.parsedType}),I}return B(o.data)}};Oe.create=n=>new Oe({typeName:k.ZodSymbol,...T(n)});var ce=class extends w{_parse(o){if(this._getType(o)!==S.undefined){let i=this._getOrReturnCtx(o);return x(i,{code:g.invalid_type,expected:S.undefined,received:i.parsedType}),I}return B(o.data)}};ce.create=n=>new ce({typeName:k.ZodUndefined,...T(n)});var me=class extends w{_parse(o){if(this._getType(o)!==S.null){let i=this._getOrReturnCtx(o);return x(i,{code:g.invalid_type,expected:S.null,received:i.parsedType}),I}return B(o.data)}};me.create=n=>new me({typeName:k.ZodNull,...T(n)});var ne=class extends w{constructor(){super(...arguments),this._any=!0}_parse(o){return B(o.data)}};ne.create=n=>new ne({typeName:k.ZodAny,...T(n)});var Y=class extends w{constructor(){super(...arguments),this._unknown=!0}_parse(o){return B(o.data)}};Y.create=n=>new Y({typeName:k.ZodUnknown,...T(n)});var K=class extends w{_parse(o){let s=this._getOrReturnCtx(o);return x(s,{code:g.invalid_type,expected:S.never,received:s.parsedType}),I}};K.create=n=>new K({typeName:k.ZodNever,...T(n)});var Ie=class extends w{_parse(o){if(this._getType(o)!==S.undefined){let i=this._getOrReturnCtx(o);return x(i,{code:g.invalid_type,expected:S.void,received:i.parsedType}),I}return B(o.data)}};Ie.create=n=>new Ie({typeName:k.ZodVoid,...T(n)});var X=class n extends w{_parse(o){let{ctx:s,status:i}=this._processInputParams(o),a=this._def;if(s.parsedType!==S.array)return x(s,{code:g.invalid_type,expected:S.array,received:s.parsedType}),I;if(a.exactLength!==null){let l=s.data.length>a.exactLength.value,u=s.data.length<a.exactLength.value;(l||u)&&(x(s,{code:l?g.too_big:g.too_small,minimum:u?a.exactLength.value:void 0,maximum:l?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),i.dirty())}if(a.minLength!==null&&s.data.length<a.minLength.value&&(x(s,{code:g.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),i.dirty()),a.maxLength!==null&&s.data.length>a.maxLength.value&&(x(s,{code:g.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),i.dirty()),s.common.async)return Promise.all([...s.data].map((l,u)=>a.type._parseAsync(new U(s,l,s.path,u)))).then(l=>P.mergeArray(i,l));let d=[...s.data].map((l,u)=>a.type._parseSync(new U(s,l,s.path,u)));return P.mergeArray(i,d)}get element(){return this._def.type}min(o,s){return new n({...this._def,minLength:{value:o,message:v.toString(s)}})}max(o,s){return new n({...this._def,maxLength:{value:o,message:v.toString(s)}})}length(o,s){return new n({...this._def,exactLength:{value:o,message:v.toString(s)}})}nonempty(o){return this.min(1,o)}};X.create=(n,o)=>new X({type:n,minLength:null,maxLength:null,exactLength:null,typeName:k.ZodArray,...T(o)});function ve(n){if(n instanceof A){let o={};for(let s in n.shape){let i=n.shape[s];o[s]=q.create(ve(i))}return new A({...n._def,shape:()=>o})}else return n instanceof X?new X({...n._def,type:ve(n.element)}):n instanceof q?q.create(ve(n.unwrap())):n instanceof V?V.create(ve(n.unwrap())):n instanceof Z?Z.create(n.items.map(o=>ve(o))):n}var A=class n extends w{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let o=this._def.shape(),s=j.objectKeys(o);return this._cached={shape:o,keys:s},this._cached}_parse(o){if(this._getType(o)!==S.object){let b=this._getOrReturnCtx(o);return x(b,{code:g.invalid_type,expected:S.object,received:b.parsedType}),I}let{status:i,ctx:a}=this._processInputParams(o),{shape:d,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof K&&this._def.unknownKeys==="strip"))for(let b in a.data)l.includes(b)||u.push(b);let z=[];for(let b of l){let R=d[b],M=a.data[b];z.push({key:{status:"valid",value:b},value:R._parse(new U(a,M,a.path,b)),alwaysSet:b in a.data})}if(this._def.catchall instanceof K){let b=this._def.unknownKeys;if(b==="passthrough")for(let R of u)z.push({key:{status:"valid",value:R},value:{status:"valid",value:a.data[R]}});else if(b==="strict")u.length>0&&(x(a,{code:g.unrecognized_keys,keys:u}),i.dirty());else if(b!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let b=this._def.catchall;for(let R of u){let M=a.data[R];z.push({key:{status:"valid",value:R},value:b._parse(new U(a,M,a.path,R)),alwaysSet:R in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let b=[];for(let R of z){let M=await R.key,W=await R.value;b.push({key:M,value:W,alwaysSet:R.alwaysSet})}return b}).then(b=>P.mergeObjectSync(i,b)):P.mergeObjectSync(i,z)}get shape(){return this._def.shape()}strict(o){return v.errToObj,new n({...this._def,unknownKeys:"strict",...o!==void 0?{errorMap:(s,i)=>{let a=this._def.errorMap?.(s,i).message??i.defaultError;return s.code==="unrecognized_keys"?{message:v.errToObj(o).message??a}:{message:a}}}:{}})}strip(){return new n({...this._def,unknownKeys:"strip"})}passthrough(){return new n({...this._def,unknownKeys:"passthrough"})}extend(o){return new n({...this._def,shape:()=>({...this._def.shape(),...o})})}merge(o){return new n({unknownKeys:o._def.unknownKeys,catchall:o._def.catchall,shape:()=>({...this._def.shape(),...o._def.shape()}),typeName:k.ZodObject})}setKey(o,s){return this.augment({[o]:s})}catchall(o){return new n({...this._def,catchall:o})}pick(o){let s={};for(let i of j.objectKeys(o))o[i]&&this.shape[i]&&(s[i]=this.shape[i]);return new n({...this._def,shape:()=>s})}omit(o){let s={};for(let i of j.objectKeys(this.shape))o[i]||(s[i]=this.shape[i]);return new n({...this._def,shape:()=>s})}deepPartial(){return ve(this)}partial(o){let s={};for(let i of j.objectKeys(this.shape)){let a=this.shape[i];o&&!o[i]?s[i]=a:s[i]=a.optional()}return new n({...this._def,shape:()=>s})}required(o){let s={};for(let i of j.objectKeys(this.shape))if(o&&!o[i])s[i]=this.shape[i];else{let d=this.shape[i];for(;d instanceof q;)d=d._def.innerType;s[i]=d}return new n({...this._def,shape:()=>s})}keyof(){return Qo(j.objectKeys(this.shape))}};A.create=(n,o)=>new A({shape:()=>n,unknownKeys:"strip",catchall:K.create(),typeName:k.ZodObject,...T(o)});A.strictCreate=(n,o)=>new A({shape:()=>n,unknownKeys:"strict",catchall:K.create(),typeName:k.ZodObject,...T(o)});A.lazycreate=(n,o)=>new A({shape:n,unknownKeys:"strip",catchall:K.create(),typeName:k.ZodObject,...T(o)});var le=class extends w{_parse(o){let{ctx:s}=this._processInputParams(o),i=this._def.options;function a(d){for(let u of d)if(u.result.status==="valid")return u.result;for(let u of d)if(u.result.status==="dirty")return s.common.issues.push(...u.ctx.common.issues),u.result;let l=d.map(u=>new E(u.ctx.common.issues));return x(s,{code:g.invalid_union,unionErrors:l}),I}if(s.common.async)return Promise.all(i.map(async d=>{let l={...s,common:{...s.common,issues:[]},parent:null};return{result:await d._parseAsync({data:s.data,path:s.path,parent:l}),ctx:l}})).then(a);{let d,l=[];for(let z of i){let b={...s,common:{...s.common,issues:[]},parent:null},R=z._parseSync({data:s.data,path:s.path,parent:b});if(R.status==="valid")return R;R.status==="dirty"&&!d&&(d={result:R,ctx:b}),b.common.issues.length&&l.push(b.common.issues)}if(d)return s.common.issues.push(...d.ctx.common.issues),d.result;let u=l.map(z=>new E(z));return x(s,{code:g.invalid_union,unionErrors:u}),I}}get options(){return this._def.options}};le.create=(n,o)=>new le({options:n,typeName:k.ZodUnion,...T(o)});var J=n=>n instanceof fe?J(n.schema):n instanceof D?J(n.innerType()):n instanceof ge?[n.value]:n instanceof he?n.options:n instanceof ye?j.objectValues(n.enum):n instanceof ze?J(n._def.innerType):n instanceof ce?[void 0]:n instanceof me?[null]:n instanceof q?[void 0,...J(n.unwrap())]:n instanceof V?[null,...J(n.unwrap())]:n instanceof Pe||n instanceof be?J(n.unwrap()):n instanceof xe?J(n._def.innerType):[],qe=class n extends w{_parse(o){let{ctx:s}=this._processInputParams(o);if(s.parsedType!==S.object)return x(s,{code:g.invalid_type,expected:S.object,received:s.parsedType}),I;let i=this.discriminator,a=s.data[i],d=this.optionsMap.get(a);return d?s.common.async?d._parseAsync({data:s.data,path:s.path,parent:s}):d._parseSync({data:s.data,path:s.path,parent:s}):(x(s,{code:g.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),I)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(o,s,i){let a=new Map;for(let d of s){let l=J(d.shape[o]);if(!l.length)throw new Error(`A discriminator value for key \`${o}\` could not be extracted from all schema options`);for(let u of l){if(a.has(u))throw new Error(`Discriminator property ${String(o)} has duplicate value ${String(u)}`);a.set(u,d)}}return new n({typeName:k.ZodDiscriminatedUnion,discriminator:o,options:s,optionsMap:a,...T(i)})}};function Ze(n,o){let s=G(n),i=G(o);if(n===o)return{valid:!0,data:n};if(s===S.object&&i===S.object){let a=j.objectKeys(o),d=j.objectKeys(n).filter(u=>a.indexOf(u)!==-1),l={...n,...o};for(let u of d){let z=Ze(n[u],o[u]);if(!z.valid)return{valid:!1};l[u]=z.data}return{valid:!0,data:l}}else if(s===S.array&&i===S.array){if(n.length!==o.length)return{valid:!1};let a=[];for(let d=0;d<n.length;d++){let l=n[d],u=o[d],z=Ze(l,u);if(!z.valid)return{valid:!1};a.push(z.data)}return{valid:!0,data:a}}else return s===S.date&&i===S.date&&+n==+o?{valid:!0,data:n}:{valid:!1}}var ue=class extends w{_parse(o){let{status:s,ctx:i}=this._processInputParams(o),a=(d,l)=>{if(Fe(d)||Fe(l))return I;let u=Ze(d.value,l.value);return u.valid?((Ne(d)||Ne(l))&&s.dirty(),{status:s.value,value:u.data}):(x(i,{code:g.invalid_intersection_types}),I)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([d,l])=>a(d,l)):a(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};ue.create=(n,o,s)=>new ue({left:n,right:o,typeName:k.ZodIntersection,...T(s)});var Z=class n extends w{_parse(o){let{status:s,ctx:i}=this._processInputParams(o);if(i.parsedType!==S.array)return x(i,{code:g.invalid_type,expected:S.array,received:i.parsedType}),I;if(i.data.length<this._def.items.length)return x(i,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),I;!this._def.rest&&i.data.length>this._def.items.length&&(x(i,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let d=[...i.data].map((l,u)=>{let z=this._def.items[u]||this._def.rest;return z?z._parse(new U(i,l,i.path,u)):null}).filter(l=>!!l);return i.common.async?Promise.all(d).then(l=>P.mergeArray(s,l)):P.mergeArray(s,d)}get items(){return this._def.items}rest(o){return new n({...this._def,rest:o})}};Z.create=(n,o)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Z({items:n,typeName:k.ZodTuple,rest:null,...T(o)})};var Ue=class n extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(o){let{status:s,ctx:i}=this._processInputParams(o);if(i.parsedType!==S.object)return x(i,{code:g.invalid_type,expected:S.object,received:i.parsedType}),I;let a=[],d=this._def.keyType,l=this._def.valueType;for(let u in i.data)a.push({key:d._parse(new U(i,u,i.path,u)),value:l._parse(new U(i,i.data[u],i.path,u)),alwaysSet:u in i.data});return i.common.async?P.mergeObjectAsync(s,a):P.mergeObjectSync(s,a)}get element(){return this._def.valueType}static create(o,s,i){return s instanceof w?new n({keyType:o,valueType:s,typeName:k.ZodRecord,...T(i)}):new n({keyType:te.create(),valueType:o,typeName:k.ZodRecord,...T(s)})}},Re=class extends w{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(o){let{status:s,ctx:i}=this._processInputParams(o);if(i.parsedType!==S.map)return x(i,{code:g.invalid_type,expected:S.map,received:i.parsedType}),I;let a=this._def.keyType,d=this._def.valueType,l=[...i.data.entries()].map(([u,z],b)=>({key:a._parse(new U(i,u,i.path,[b,"key"])),value:d._parse(new U(i,z,i.path,[b,"value"]))}));if(i.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let z of l){let b=await z.key,R=await z.value;if(b.status==="aborted"||R.status==="aborted")return I;(b.status==="dirty"||R.status==="dirty")&&s.dirty(),u.set(b.value,R.value)}return{status:s.value,value:u}})}else{let u=new Map;for(let z of l){let b=z.key,R=z.value;if(b.status==="aborted"||R.status==="aborted")return I;(b.status==="dirty"||R.status==="dirty")&&s.dirty(),u.set(b.value,R.value)}return{status:s.value,value:u}}}};Re.create=(n,o,s)=>new Re({valueType:o,keyType:n,typeName:k.ZodMap,...T(s)});var ke=class n extends w{_parse(o){let{status:s,ctx:i}=this._processInputParams(o);if(i.parsedType!==S.set)return x(i,{code:g.invalid_type,expected:S.set,received:i.parsedType}),I;let a=this._def;a.minSize!==null&&i.data.size<a.minSize.value&&(x(i,{code:g.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),s.dirty()),a.maxSize!==null&&i.data.size>a.maxSize.value&&(x(i,{code:g.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),s.dirty());let d=this._def.valueType;function l(z){let b=new Set;for(let R of z){if(R.status==="aborted")return I;R.status==="dirty"&&s.dirty(),b.add(R.value)}return{status:s.value,value:b}}let u=[...i.data.values()].map((z,b)=>d._parse(new U(i,z,i.path,b)));return i.common.async?Promise.all(u).then(z=>l(z)):l(u)}min(o,s){return new n({...this._def,minSize:{value:o,message:v.toString(s)}})}max(o,s){return new n({...this._def,maxSize:{value:o,message:v.toString(s)}})}size(o,s){return this.min(o,s).max(o,s)}nonempty(o){return this.min(1,o)}};ke.create=(n,o)=>new ke({valueType:n,minSize:null,maxSize:null,typeName:k.ZodSet,...T(o)});var De=class n extends w{constructor(){super(...arguments),this.validate=this.implement}_parse(o){let{ctx:s}=this._processInputParams(o);if(s.parsedType!==S.function)return x(s,{code:g.invalid_type,expected:S.function,received:s.parsedType}),I;function i(u,z){return _e({data:u,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Ce(),H].filter(b=>!!b),issueData:{code:g.invalid_arguments,argumentsError:z}})}function a(u,z){return _e({data:u,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Ce(),H].filter(b=>!!b),issueData:{code:g.invalid_return_type,returnTypeError:z}})}let d={errorMap:s.common.contextualErrorMap},l=s.data;if(this._def.returns instanceof re){let u=this;return B(async function(...z){let b=new E([]),R=await u._def.args.parseAsync(z,d).catch(Q=>{throw b.addIssue(i(z,Q)),b}),M=await Reflect.apply(l,this,R);return await u._def.returns._def.type.parseAsync(M,d).catch(Q=>{throw b.addIssue(a(M,Q)),b})})}else{let u=this;return B(function(...z){let b=u._def.args.safeParse(z,d);if(!b.success)throw new E([i(z,b.error)]);let R=Reflect.apply(l,this,b.data),M=u._def.returns.safeParse(R,d);if(!M.success)throw new E([a(R,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...o){return new n({...this._def,args:Z.create(o).rest(Y.create())})}returns(o){return new n({...this._def,returns:o})}implement(o){return this.parse(o)}strictImplement(o){return this.parse(o)}static create(o,s,i){return new n({args:o||Z.create([]).rest(Y.create()),returns:s||Y.create(),typeName:k.ZodFunction,...T(i)})}},fe=class extends w{get schema(){return this._def.getter()}_parse(o){let{ctx:s}=this._processInputParams(o);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};fe.create=(n,o)=>new fe({getter:n,typeName:k.ZodLazy,...T(o)});var ge=class extends w{_parse(o){if(o.data!==this._def.value){let s=this._getOrReturnCtx(o);return x(s,{received:s.data,code:g.invalid_literal,expected:this._def.value}),I}return{status:"valid",value:o.data}}get value(){return this._def.value}};ge.create=(n,o)=>new ge({value:n,typeName:k.ZodLiteral,...T(o)});function Qo(n,o){return new he({values:n,typeName:k.ZodEnum,...T(o)})}var he=class n extends w{_parse(o){if(typeof o.data!="string"){let s=this._getOrReturnCtx(o),i=this._def.values;return x(s,{expected:j.joinValues(i),received:s.parsedType,code:g.invalid_type}),I}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(o.data)){let s=this._getOrReturnCtx(o),i=this._def.values;return x(s,{received:s.data,code:g.invalid_enum_value,options:i}),I}return B(o.data)}get options(){return this._def.values}get enum(){let o={};for(let s of this._def.values)o[s]=s;return o}get Values(){let o={};for(let s of this._def.values)o[s]=s;return o}get Enum(){let o={};for(let s of this._def.values)o[s]=s;return o}extract(o,s=this._def){return n.create(o,{...this._def,...s})}exclude(o,s=this._def){return n.create(this.options.filter(i=>!o.includes(i)),{...this._def,...s})}};he.create=Qo;var ye=class extends w{_parse(o){let s=j.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(o);if(i.parsedType!==S.string&&i.parsedType!==S.number){let a=j.objectValues(s);return x(i,{expected:j.joinValues(a),received:i.parsedType,code:g.invalid_type}),I}if(this._cache||(this._cache=new Set(j.getValidEnumValues(this._def.values))),!this._cache.has(o.data)){let a=j.objectValues(s);return x(i,{received:i.data,code:g.invalid_enum_value,options:a}),I}return B(o.data)}get enum(){return this._def.values}};ye.create=(n,o)=>new ye({values:n,typeName:k.ZodNativeEnum,...T(o)});var re=class extends w{unwrap(){return this._def.type}_parse(o){let{ctx:s}=this._processInputParams(o);if(s.parsedType!==S.promise&&s.common.async===!1)return x(s,{code:g.invalid_type,expected:S.promise,received:s.parsedType}),I;let i=s.parsedType===S.promise?s.data:Promise.resolve(s.data);return B(i.then(a=>this._def.type.parseAsync(a,{path:s.path,errorMap:s.common.contextualErrorMap})))}};re.create=(n,o)=>new re({type:n,typeName:k.ZodPromise,...T(o)});var D=class extends w{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===k.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(o){let{status:s,ctx:i}=this._processInputParams(o),a=this._def.effect||null,d={addIssue:l=>{x(i,l),l.fatal?s.abort():s.dirty()},get path(){return i.path}};if(d.addIssue=d.addIssue.bind(d),a.type==="preprocess"){let l=a.transform(i.data,d);if(i.common.async)return Promise.resolve(l).then(async u=>{if(s.value==="aborted")return I;let z=await this._def.schema._parseAsync({data:u,path:i.path,parent:i});return z.status==="aborted"?I:z.status==="dirty"?se(z.value):s.value==="dirty"?se(z.value):z});{if(s.value==="aborted")return I;let u=this._def.schema._parseSync({data:l,path:i.path,parent:i});return u.status==="aborted"?I:u.status==="dirty"?se(u.value):s.value==="dirty"?se(u.value):u}}if(a.type==="refinement"){let l=u=>{let z=a.refinement(u,d);if(i.common.async)return Promise.resolve(z);if(z instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(i.common.async===!1){let u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status==="aborted"?I:(u.status==="dirty"&&s.dirty(),l(u.value),{status:s.value,value:u.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(u=>u.status==="aborted"?I:(u.status==="dirty"&&s.dirty(),l(u.value).then(()=>({status:s.value,value:u.value}))))}if(a.type==="transform")if(i.common.async===!1){let l=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!oe(l))return I;let u=a.transform(l.value,d);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:u}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(l=>oe(l)?Promise.resolve(a.transform(l.value,d)).then(u=>({status:s.value,value:u})):I);j.assertNever(a)}};D.create=(n,o,s)=>new D({schema:n,typeName:k.ZodEffects,effect:o,...T(s)});D.createWithPreprocess=(n,o,s)=>new D({schema:o,effect:{type:"preprocess",transform:n},typeName:k.ZodEffects,...T(s)});var q=class extends w{_parse(o){return this._getType(o)===S.undefined?B(void 0):this._def.innerType._parse(o)}unwrap(){return this._def.innerType}};q.create=(n,o)=>new q({innerType:n,typeName:k.ZodOptional,...T(o)});var V=class extends w{_parse(o){return this._getType(o)===S.null?B(null):this._def.innerType._parse(o)}unwrap(){return this._def.innerType}};V.create=(n,o)=>new V({innerType:n,typeName:k.ZodNullable,...T(o)});var ze=class extends w{_parse(o){let{ctx:s}=this._processInputParams(o),i=s.data;return s.parsedType===S.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};ze.create=(n,o)=>new ze({innerType:n,typeName:k.ZodDefault,defaultValue:typeof o.default=="function"?o.default:()=>o.default,...T(o)});var xe=class extends w{_parse(o){let{ctx:s}=this._processInputParams(o),i={...s,common:{...s.common,issues:[]}},a=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Se(a)?a.then(d=>({status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new E(i.common.issues)},input:i.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new E(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};xe.create=(n,o)=>new xe({innerType:n,typeName:k.ZodCatch,catchValue:typeof o.catch=="function"?o.catch:()=>o.catch,...T(o)});var Te=class extends w{_parse(o){if(this._getType(o)!==S.nan){let i=this._getOrReturnCtx(o);return x(i,{code:g.invalid_type,expected:S.nan,received:i.parsedType}),I}return{status:"valid",value:o.data}}};Te.create=n=>new Te({typeName:k.ZodNaN,...T(n)});var Kn=Symbol("zod_brand"),Pe=class extends w{_parse(o){let{ctx:s}=this._processInputParams(o),i=s.data;return this._def.type._parse({data:i,path:s.path,parent:s})}unwrap(){return this._def.type}},Be=class n extends w{_parse(o){let{status:s,ctx:i}=this._processInputParams(o);if(i.common.async)return(async()=>{let d=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return d.status==="aborted"?I:d.status==="dirty"?(s.dirty(),se(d.value)):this._def.out._parseAsync({data:d.value,path:i.path,parent:i})})();{let a=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?I:a.status==="dirty"?(s.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:i.path,parent:i})}}static create(o,s){return new n({in:o,out:s,typeName:k.ZodPipeline})}},be=class extends w{_parse(o){let s=this._def.innerType._parse(o),i=a=>(oe(a)&&(a.value=Object.freeze(a.value)),a);return Se(s)?s.then(a=>i(a)):i(s)}unwrap(){return this._def.innerType}};be.create=(n,o)=>new be({innerType:n,typeName:k.ZodReadonly,...T(o)});function Ho(n,o){let s=typeof n=="function"?n(o):typeof n=="string"?{message:n}:n;return typeof s=="string"?{message:s}:s}function et(n,o={},s){return n?ne.create().superRefine((i,a)=>{let d=n(i);if(d instanceof Promise)return d.then(l=>{if(!l){let u=Ho(o,i),z=u.fatal??s??!0;a.addIssue({code:"custom",...u,fatal:z})}});if(!d){let l=Ho(o,i),u=l.fatal??s??!0;a.addIssue({code:"custom",...l,fatal:u})}}):ne.create()}var Ln={object:A.lazycreate},k;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(k||(k={}));var $n=(n,o={message:`Input not instance of ${n.name}`})=>et(s=>s instanceof n,o),e=te.create,t=ie.create,Gn=Te.create,Zn=ae.create,h=de.create,Vn=pe.create,Hn=Oe.create,Jn=ce.create,L=me.create,Yn=ne.create,y=Y.create,Xn=K.create,Qn=Ie.create,c=X.create,r=A.create,er=A.strictCreate,C=le.create,or=qe.create,tr=ue.create,nr=Z.create,f=Ue.create,rr=Re.create,sr=ke.create,ir=De.create,ar=fe.create,m=ge.create,p=he.create,dr=ye.create,pr=re.create,cr=D.create,mr=q.create,lr=V.create,ur=D.createWithPreprocess,fr=Be.create,gr=()=>e().optional(),hr=()=>t().optional(),yr=()=>h().optional(),zr={string:(n=>te.create({...n,coerce:!0})),number:(n=>ie.create({...n,coerce:!0})),boolean:(n=>de.create({...n,coerce:!0})),bigint:(n=>ae.create({...n,coerce:!0})),date:(n=>pe.create({...n,coerce:!0}))};var xr=I;var Tf=r({name:e().min(1),permissions:r({media:c(p(["read","write"])).min(1).optional(),sessions:c(p(["read","write"])).min(1).optional(),projects:c(p(["read","write"])).min(1).optional(),renders:c(p(["read","write"])).min(1).optional(),webhooks:c(p(["read","write"])).min(1).optional()}).describe("Resource \u2192 actions grant. Resources: media, sessions, projects, renders, webhooks. Actions: read, write. Least-privilege \u2014 grant only what's needed."),expiresIn:t().optional().describe("Lifetime in seconds; omit for no expiry.")});var jf=r({data:c(r({id:e(),name:e(),description:e().nullable(),tagline:e().nullable(),colors:f(e(),e()),extraColors:c(r({name:e(),value:e()})).optional(),fonts:r({heading:r({family:e(),weight:C([t(),e()]).optional()}).nullable(),body:r({family:e(),weight:C([t(),e()]).optional()}).nullable()}),voiceGuidelines:e().nullable(),captions:r({sync:h(),profile:f(e(),y()).nullable()}),motion:r({duration:t().optional(),easing:C([p(["linear","ease","ease-in","ease-out","ease-in-out"]),r({kind:m("cubic-bezier"),x1:t(),y1:t(),x2:t(),y2:t()})]).optional(),entrance:p(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:t().optional(),exitMs:t().optional()}).optional(),logo:r({src:e(),alt:e().optional(),placement:p(["tl","tr","bl","br"]).optional(),sizePct:t().optional()}).optional(),intro:r({kind:p(["card","video"]),src:e().optional(),title:e().optional(),subtitle:e().optional(),durationMs:t().optional()}).optional(),outro:r({kind:p(["card","video"]),src:e().optional(),title:e().optional(),subtitle:e().optional(),durationMs:t().optional()}).optional(),watermark:r({src:e(),opacity:t().optional(),placement:p(["tl","tr","bl","br"]).optional()}).optional(),spacing:r({base:t().optional(),lg:t().optional(),sm:t().optional()}).optional(),sizing:r({fontSizeHeading:t().optional(),fontSizeBody:t().optional(),fontSizeLabel:t().optional(),borderRadius:t().optional()}).optional(),createdAt:e(),updatedAt:e()}).describe("Brand kit response per \xA7Brand Kits.")),pagination:r({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),br=200,Cr=200,Sr=2e3,vr=500,Or=500,Ir=5e3,Rr=0,kr=1,Mf=r({kitId:e().min(1).max(br),name:e().min(1).max(Cr),description:e().max(Sr).optional(),tagline:e().max(vr).optional(),secondaryTagline:e().max(Or).optional(),colors:r({primary:e().min(1),secondary:e().min(1),accent:e().min(1),background:e().min(1),text:e().min(1)}),extraColors:c(r({hex:e().min(1),label:e().min(1),usage:e().optional()})).optional(),headingFont:r({fontFamily:e().min(1),fontWeight:t()}),bodyFont:r({fontFamily:e().min(1),fontWeight:t()}),voiceGuidelines:e().max(Ir).optional(),syncCaptions:h().optional(),captionProfile:r({fontFamily:e().optional(),fontSize:t().optional(),fontWeight:t().optional(),color:e().optional(),highlightColor:e().optional(),backgroundColor:e().optional(),position:p(["top","center","bottom"]).optional(),textTransform:p(["none","uppercase"]).optional(),emphasisColor:e().optional(),emphasisScale:t().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:t().optional(),emphasisTextTransform:p(["none","uppercase"]).optional(),emphasisLetterSpacing:t().optional()}).optional(),motion:r({duration:t().optional(),easing:C([p(["linear","ease","ease-in","ease-out","ease-in-out"]),r({kind:m("cubic-bezier"),x1:t(),y1:t(),x2:t(),y2:t()})]).optional(),entrance:p(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:t().optional(),exitMs:t().optional()}).optional(),logo:r({src:e().min(1),alt:e().optional(),placement:p(["tl","tr","bl","br"]).optional(),sizePct:t().optional()}).optional(),intro:r({kind:p(["card","video"]),src:e().min(1).optional(),title:e().optional(),subtitle:e().optional(),durationMs:t().optional()}).optional(),outro:r({kind:p(["card","video"]),src:e().min(1).optional(),title:e().optional(),subtitle:e().optional(),durationMs:t().optional()}).optional(),watermark:r({src:e().min(1),opacity:t().min(Rr).max(kr).optional(),placement:p(["tl","tr","bl","br"]).optional()}).optional(),spacing:r({base:t().optional(),lg:t().optional(),sm:t().optional()}).optional(),sizing:r({fontSizeHeading:t().optional(),fontSizeBody:t().optional(),fontSizeLabel:t().optional(),borderRadius:t().optional()}).optional()}).describe("POST /brand-kits body. Org/user are server-resolved; never accepted from the body."),_f=r({id:e()}),Pf=r({id:e(),name:e(),description:e().nullable(),tagline:e().nullable(),colors:f(e(),e()),extraColors:c(r({name:e(),value:e()})).optional(),fonts:r({heading:r({family:e(),weight:C([t(),e()]).optional()}).nullable(),body:r({family:e(),weight:C([t(),e()]).optional()}).nullable()}),voiceGuidelines:e().nullable(),captions:r({sync:h(),profile:f(e(),y()).nullable()}),motion:r({duration:t().optional(),easing:C([p(["linear","ease","ease-in","ease-out","ease-in-out"]),r({kind:m("cubic-bezier"),x1:t(),y1:t(),x2:t(),y2:t()})]).optional(),entrance:p(["none","fade","word-pop","stagger-up"]).optional(),staggerMs:t().optional(),exitMs:t().optional()}).optional(),logo:r({src:e(),alt:e().optional(),placement:p(["tl","tr","bl","br"]).optional(),sizePct:t().optional()}).optional(),intro:r({kind:p(["card","video"]),src:e().optional(),title:e().optional(),subtitle:e().optional(),durationMs:t().optional()}).optional(),outro:r({kind:p(["card","video"]),src:e().optional(),title:e().optional(),subtitle:e().optional(),durationMs:t().optional()}).optional(),watermark:r({src:e(),opacity:t().optional(),placement:p(["tl","tr","bl","br"]).optional()}).optional(),spacing:r({base:t().optional(),lg:t().optional(),sm:t().optional()}).optional(),sizing:r({fontSizeHeading:t().optional(),fontSizeBody:t().optional(),fontSizeLabel:t().optional(),borderRadius:t().optional()}).optional(),createdAt:e(),updatedAt:e()}).describe("Brand kit response per \xA7Brand Kits.");var Ef=r({id:e()}),Af=r({suggestionId:e().min(1),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional(),platform:e().optional()}).optional()}),Ff=r({id:e()}),Nf=r({status:p(["idle","generating","completed","failed"]),createdAt:e().nullable(),analyzedAt:e().nullable(),jobId:e().nullable(),topics:c(e()),suggestions:c(r({id:e(),rank:t(),trim:r({start:t(),end:t()}),score:t(),title:e(),reason:e(),topic:e(),hook:e(),platforms:c(e()),format:e(),caption:e(),hashtags:c(e()),textOverlays:c(e()),editingNotes:e(),motionStyle:r({textAnimation:e(),transitions:e(),colorMood:e(),captionStyle:e()}),visualTreatment:c(r({time:C([t(),e()]),visual:e()})),brollSuggestions:c(r({moment:e(),searchTerms:c(e()),rationale:e()})),thumbnailConcept:e()}).describe("Single ranked clip suggestion.")),pagination:r({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}).describe("GET /media/:id/suggestions envelope."),qf=r({id:e()}),Uf=r({id:e()});var Tr=100,Wf=r({category:p(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional().describe("Filter to one category bucket (text|effects|transitions|layouts|backgrounds|ui-blocks|scenes)."),kind:p(["component","transition","scene"]).optional().describe("Filter by render kind (component|transition|scene)."),tier:p(["recommended","standard","niche"]).optional().describe("Filter by curation tier (recommended|standard|niche)."),useCase:p(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"]).optional().describe("Filter to entries whose useCase includes this edit role (e.g. intro, title-over-footage, grade)."),mood:e().optional().describe("Filter to entries whose mood tags include this value (e.g. cinematic, minimal)."),q:e().optional().describe("Free-text match across id/name/description/intent/useWhen/tags/mood. Recommend-orders results."),intent:e().optional().describe("Alias of `q` framed as recommend-by-intent (e.g. intent=intro). Recommend-orders results."),limit:t().min(1).max(Tr).optional().describe("Page size (1..100). Omit to return the whole filtered catalog in one page."),after:e().optional().describe("Opaque cursor from a previous page's nextCursor (forward-only).")}),Kf=r({data:c(r({id:e(),name:e(),description:e(),source:p(["default","installed"]).describe("'default' = built-in primitive (place by primitiveId); 'installed' = org-authored component (place by componentId)."),category:p(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),kind:p(["component","transition","scene"]).describe("RENDER kind (component | transition | scene). NOT the ClipSource variant \u2014 see `placement` for how to author it on the timeline."),version:e(),propSchema:f(e(),y()),propDefaults:f(e(),y()).optional(),textParam:e().nullish().describe("The param field that carries this primitive's primary text; null = no single text slot."),subtextParam:e().nullish().describe("The param field for secondary text (subtitle/byline); null = none."),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).optional(),durationInFrames:t().optional(),intent:e().optional().describe("Selection signal: a verb naming what this primitive accomplishes (e.g. 'product-trailer'). Match it to the beat you are authoring."),useWhen:e().optional().describe("When to use this \u2014 AND when not to. The negative guidance is load-bearing; read it before picking."),pairsWith:c(e()).optional().describe("Authoring guidance: ids of primitives that COMPOSE well with this one in the same edit."),avoidWith:c(e()).optional().describe("Authoring guidance: ids of primitives that CONFLICT with this one \u2014 do not place together."),tags:c(e()).optional().describe("Free-text search keywords."),mood:c(e()).optional().describe("Vibe/tone tags (e.g. 'cinematic', 'minimal'). Filter to match the edit's mood."),tier:p(["recommended","standard","niche"]).optional().describe("Quality/applicability RANKING (a preference, not a flag). Prefer 'recommended'; reach for 'niche' only when its specific use-case is exactly the beat."),useCase:c(p(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"])).optional().describe("The edit ROLE(s) this primitive fills \u2014 the dimension to filter by for a beat (e.g. 'intro', 'title-over-footage', 'grade')."),examples:c(r({name:e(),mood:c(e()).optional(),params:f(e(),y()).optional(),description:e().optional()})).optional(),fixedCopy:c(e()).optional().describe("On-screen strings this primitive BAKES \u2014 the read-side counterpart to propSchema. These literals render REGARDLESS of params (no param can change them); fork the source via get_component_source to edit them. Use this to see at author time what fixed copy (someone-else's marketing text, faux-code, faux-data) will appear before you render."),brandBindings:c(r({param:e(),brandToken:e()})).optional().describe("Params that can follow the project brand kit. Each {param, brandToken} says: set `param` to `brandToken` (a `$brand:` ref, e.g. '$brand:colors.accent') to track the brand instead of a literal. See the list response's `brandTokens` for the full ref vocabulary. Omitted when nothing is brand-bound."),placement:r({clipSourceKind:p(["overlay","effect","component"]).describe("The ClipSource `kind` to author this entry as: 'overlay' (built-in text/ui/scene/background/layout), 'effect' (built-in effect/transition), or 'component' (an org-INSTALLED custom component)."),refField:p(["primitiveId","componentId"]).describe("Which id field keys the ClipSource: 'primitiveId' for built-ins (source:'default'), 'componentId' for installed components (source:'installed'). Using the wrong field will NOT resolve at render.")})}).describe("Component catalog entry per \xA7Components.")),pagination:r({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata."),brandTokens:c(e()).optional().describe("Catalog-level reference: the valid `$brand:` token refs a param value may carry (e.g. accentColor: \"$brand:colors.accent\"). Colors + fonts are the common bindings; the full design-token vocabulary is listed. Derived from the brand kit resolver so it can't drift. See each entry's `brandBindings` for which params are brand-bound by default.")}),wr=200,jr=200,Mr=2e3,_r=200,Lf=r({componentId:e().min(1).max(wr),tsxSource:e().min(1),name:e().min(1).max(jr),description:e().max(Mr),category:p(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),propSchema:f(e(),y()).optional(),origin:p(["repo-owned","server-native"]).optional(),ejectedFrom:e().max(_r).optional(),tokens:f(e(),y()).optional(),examples:c(f(e(),y())).optional(),durationInFrames:t().optional()}).describe("POST /components body. Org/user are server-resolved; never accepted from the body."),$f=r({id:e()}),Pr=200,Br=2e3,Er=200,Gf=r({tsxSource:e().min(1).optional(),name:e().min(1).max(Pr).optional(),description:e().max(Br).optional(),category:p(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]).optional(),propSchema:f(e(),y()).optional(),origin:p(["repo-owned","server-native"]).optional(),ejectedFrom:e().max(Er).optional(),tokens:f(e(),y()).optional(),examples:c(f(e(),y())).optional(),durationInFrames:t().optional()}).describe("PUT /components/:id body. Org/user are server-resolved; never accepted from the body."),Zf=r({id:e(),name:e(),description:e(),source:p(["default","installed"]).describe("'default' = built-in primitive (place by primitiveId); 'installed' = org-authored component (place by componentId)."),category:p(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),kind:p(["component","transition","scene"]).describe("RENDER kind (component | transition | scene). NOT the ClipSource variant \u2014 see `placement` for how to author it on the timeline."),version:e(),propSchema:f(e(),y()),propDefaults:f(e(),y()).optional(),textParam:e().nullish().describe("The param field that carries this primitive's primary text; null = no single text slot."),subtextParam:e().nullish().describe("The param field for secondary text (subtitle/byline); null = none."),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).optional(),durationInFrames:t().optional(),intent:e().optional().describe("Selection signal: a verb naming what this primitive accomplishes (e.g. 'product-trailer'). Match it to the beat you are authoring."),useWhen:e().optional().describe("When to use this \u2014 AND when not to. The negative guidance is load-bearing; read it before picking."),pairsWith:c(e()).optional().describe("Authoring guidance: ids of primitives that COMPOSE well with this one in the same edit."),avoidWith:c(e()).optional().describe("Authoring guidance: ids of primitives that CONFLICT with this one \u2014 do not place together."),tags:c(e()).optional().describe("Free-text search keywords."),mood:c(e()).optional().describe("Vibe/tone tags (e.g. 'cinematic', 'minimal'). Filter to match the edit's mood."),tier:p(["recommended","standard","niche"]).optional().describe("Quality/applicability RANKING (a preference, not a flag). Prefer 'recommended'; reach for 'niche' only when its specific use-case is exactly the beat."),useCase:c(p(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"])).optional().describe("The edit ROLE(s) this primitive fills \u2014 the dimension to filter by for a beat (e.g. 'intro', 'title-over-footage', 'grade')."),examples:c(r({name:e(),mood:c(e()).optional(),params:f(e(),y()).optional(),description:e().optional()})).optional(),fixedCopy:c(e()).optional().describe("On-screen strings this primitive BAKES \u2014 the read-side counterpart to propSchema. These literals render REGARDLESS of params (no param can change them); fork the source via get_component_source to edit them. Use this to see at author time what fixed copy (someone-else's marketing text, faux-code, faux-data) will appear before you render."),brandBindings:c(r({param:e(),brandToken:e()})).optional().describe("Params that can follow the project brand kit. Each {param, brandToken} says: set `param` to `brandToken` (a `$brand:` ref, e.g. '$brand:colors.accent') to track the brand instead of a literal. See the list response's `brandTokens` for the full ref vocabulary. Omitted when nothing is brand-bound."),placement:r({clipSourceKind:p(["overlay","effect","component"]).describe("The ClipSource `kind` to author this entry as: 'overlay' (built-in text/ui/scene/background/layout), 'effect' (built-in effect/transition), or 'component' (an org-INSTALLED custom component)."),refField:p(["primitiveId","componentId"]).describe("Which id field keys the ClipSource: 'primitiveId' for built-ins (source:'default'), 'componentId' for installed components (source:'installed'). Using the wrong field will NOT resolve at render.")})}).describe("Component catalog entry per \xA7Components."),Vf=r({id:e()}),Hf=r({id:e(),name:e(),description:e(),source:p(["default","installed"]).describe("'default' = built-in primitive (place by primitiveId); 'installed' = org-authored component (place by componentId)."),category:p(["text","effects","transitions","layouts","backgrounds","ui-blocks","scenes"]),kind:p(["component","transition","scene"]).describe("RENDER kind (component | transition | scene). NOT the ClipSource variant \u2014 see `placement` for how to author it on the timeline."),version:e(),propSchema:f(e(),y()),propDefaults:f(e(),y()).optional(),textParam:e().nullish().describe("The param field that carries this primitive's primary text; null = no single text slot."),subtextParam:e().nullish().describe("The param field for secondary text (subtitle/byline); null = none."),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).optional(),durationInFrames:t().optional(),intent:e().optional().describe("Selection signal: a verb naming what this primitive accomplishes (e.g. 'product-trailer'). Match it to the beat you are authoring."),useWhen:e().optional().describe("When to use this \u2014 AND when not to. The negative guidance is load-bearing; read it before picking."),pairsWith:c(e()).optional().describe("Authoring guidance: ids of primitives that COMPOSE well with this one in the same edit."),avoidWith:c(e()).optional().describe("Authoring guidance: ids of primitives that CONFLICT with this one \u2014 do not place together."),tags:c(e()).optional().describe("Free-text search keywords."),mood:c(e()).optional().describe("Vibe/tone tags (e.g. 'cinematic', 'minimal'). Filter to match the edit's mood."),tier:p(["recommended","standard","niche"]).optional().describe("Quality/applicability RANKING (a preference, not a flag). Prefer 'recommended'; reach for 'niche' only when its specific use-case is exactly the beat."),useCase:c(p(["intro","outro","full-scene","title-over-footage","transition","background","grade","emphasis","explainer","social-cut"])).optional().describe("The edit ROLE(s) this primitive fills \u2014 the dimension to filter by for a beat (e.g. 'intro', 'title-over-footage', 'grade')."),examples:c(r({name:e(),mood:c(e()).optional(),params:f(e(),y()).optional(),description:e().optional()})).optional(),fixedCopy:c(e()).optional().describe("On-screen strings this primitive BAKES \u2014 the read-side counterpart to propSchema. These literals render REGARDLESS of params (no param can change them); fork the source via get_component_source to edit them. Use this to see at author time what fixed copy (someone-else's marketing text, faux-code, faux-data) will appear before you render."),brandBindings:c(r({param:e(),brandToken:e()})).optional().describe("Params that can follow the project brand kit. Each {param, brandToken} says: set `param` to `brandToken` (a `$brand:` ref, e.g. '$brand:colors.accent') to track the brand instead of a literal. See the list response's `brandTokens` for the full ref vocabulary. Omitted when nothing is brand-bound."),placement:r({clipSourceKind:p(["overlay","effect","component"]).describe("The ClipSource `kind` to author this entry as: 'overlay' (built-in text/ui/scene/background/layout), 'effect' (built-in effect/transition), or 'component' (an org-INSTALLED custom component)."),refField:p(["primitiveId","componentId"]).describe("Which id field keys the ClipSource: 'primitiveId' for built-ins (source:'default'), 'componentId' for installed components (source:'installed'). Using the wrong field will NOT resolve at render.")})}).describe("Component catalog entry per \xA7Components."),Jf=r({id:e()}),Yf=r({id:e(),name:e(),description:e(),source:p(["default","installed"]),tsxSource:e(),propSchema:f(e(),y()),origin:p(["repo-owned","server-native"]).optional(),ejectedFrom:e().optional(),tokens:f(e(),y()).optional(),examples:c(f(e(),y())).optional(),durationInFrames:t().optional()}).describe("Installed component SOURCE (TSX) + ownership provenance per \xA7Components.");var Qf=r({id:e()}),Ar=2e3,Fr=5,Nr=0,qr=10,Ur=64,eg=r({suggestionId:e().min(1).optional(),fromComposition:h().optional().describe("Reuse the project's current composition as the compose starting point (critique-retry path). Set when iterating on an existing composition."),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),scope:y().optional().describe("RequestScope discriminated union (per compose-api-contract.md). Editor-only scopes (captions/overlay-track/broll/overlay-instance/segment) require an editor-session token; API tokens get 403 on those."),critique:e().max(Ar).optional().describe("Structured critique block (per compose-api-contract.md decision #11). Capped at 2KB total; per-criterion blocks capped at 500 chars."),parentJobId:e().optional().describe("Pointer to the prior compose job this run iterates on. Surfaced on the resulting composeJobs row as baselineComposeJobId."),maxCandidates:t().min(1).max(Fr).optional().describe("Ensemble size. Server default per contract; clamp [1, 5]."),budgetUsd:t().optional().describe("Per-job budget cap (USD). Clamped at the route against the org's composeMaxBudgetUsdPerJob setting."),qualityThreshold:t().min(Nr).max(qr).optional().describe("Composite-score accept threshold. Server default per contract."),seed:t().optional().describe("Deterministic seed for replay. Threaded into the workflow id."),clientNonce:e().max(Ur).optional().describe("Opaque caller token that disambiguates intentional same-critique retries. Without it, identical (project, sug, seed, critique) tuples deduplicate at Temporal; with it, retries fire fresh workflows.")}).describe("POST /projects/:id/compose body."),og=r({id:e(),composeJobId:e()}),tg=r({id:e(),composeJobId:e()}),Dr=0,ng=r({candidateIndex:t().min(Dr),selectStrategy:p(["agent-authoritative","editor-merge","editor-replace"]),ifMatch:e().optional()}).describe("POST /projects/:id/compose/jobs/:jobId/select body."),Wr=0,rg=r({newCompositionEtag:e(),mergeResult:r({replayedEdits:t().min(Wr),droppedEdits:c(r({trackId:e(),clipId:e().optional(),wordStartMs:t().optional(),reason:p(["target_removed","conflict"])}))}).optional()}).describe("POST /projects/:id/compose/jobs/:jobId/select response."),sg=r({id:e()}),ig=r({jobs:c(r({composeJobId:e(),projectId:e(),status:p(["queued","running","complete","failed","cancelled"]),suggestionId:e().optional(),createdAt:t(),completedAt:t().nullable()}))}),ag=r({id:e(),composeJobId:e()}),Kr=0,Lr=0,$r=0,Gr=0,Zr=0,Vr=0,dg=r({composeJobId:e(),projectId:e(),status:p(["queued","running","complete","failed","cancelled"]),request:r({suggestionId:e().optional(),fromComposition:h().optional(),scope:y().optional(),critique:e().optional(),parentJobId:e().optional(),maxCandidates:t().optional(),budgetUsd:t().optional(),qualityThreshold:t().optional()}),candidates:c(y()),winner:r({candidateIndex:t().min(Kr),compositionRunId:e()}).nullable(),cost:r({llmUsd:t().min(Lr),visionUsd:t().min($r),modalUsd:t().min(Gr),totalUsd:t().min(Zr)}).nullable(),startedAt:t(),completedAt:t().nullable(),advisoryResult:r({mode:p(["advise","amend","explore"]),assessment:r({editorial:r({score:t(),grounding:p(["measured","judged"]),abstained:h(),reliability:t().optional()}),spatial:r({score:t(),grounding:p(["measured","judged"]),abstained:h(),reliability:t().optional()}),brand:r({score:t(),grounding:p(["measured","judged"]),abstained:h(),reliability:t().optional()}),caption:r({score:t(),grounding:p(["measured","judged"]),abstained:h(),reliability:t().optional()})}).optional().describe("Grounded critique of the CURRENT composition. Omitted for mode=advise."),proposals:c(r({label:e(),candidateIndex:t().min(Vr).describe("Adopt via POST /compose/jobs/:jobId/select with this candidateIndex."),changeSummary:c(e()).describe("Human-legible edit-pattern labels."),boundToEtag:e().optional().describe("The composition etag this proposal was computed against."),expectedDelta:f(e(),e()).optional().describe("Advisory per-criterion score lift; NOT authoritative pre-recalibration.")})),principles:c(e()).describe("Reusable, grounded lessons for the client's next authoring.")}).optional().describe("The advisory envelope returned by a completed consult job (on ComposeJobDetailResponse.advisoryResult).")});var cg=r({id:e()}),mg=r({sessionId:e()}),lg=r({id:e(),sessionId:e()}),ug=r({sessionId:e(),ready:h(),sandboxId:e().optional(),status:e()}),fg=r({id:e(),sessionId:e()}),gg=r({ok:h()}),hg=r({id:e(),sessionId:e()}),yg=r({composition:y().optional(),timestamps:c(t()).min(1)}),zg=y(),xg=r({id:e(),sessionId:e()}),bg=r({composition:y().optional(),editorialIntent:e().optional(),brandContext:e().optional()}),Cg=r({perCriterion:r({editorial:r({score:t(),critique:e().optional()}),spatial:r({score:t(),critique:e().optional()}),brand:r({score:t(),critique:e().optional()}),caption:r({score:t(),critique:e().optional()})}),composite:t(),critique:e(),beats:c(t())}),Sg=r({id:e(),sessionId:e()}),vg=r({componentId:e().min(1),params:f(e(),y()).optional(),width:t().optional(),height:t().optional()}),Og=r({url:e()});var Rg=r({id:e()}),Hr=2e3,kg=r({intent:e().min(1).max(Hr).describe("Plain-English goal \u2014 what you're trying to achieve with this edit."),mode:p(["advise","amend","explore"]).optional().describe("advise = proposer-only (no render/judge, no grounded assessment); amend (default) = grade the current composition + author the fix for the weakest criterion; explore = ranked slate of diverse directions. All modes are async \u2014 poll the returned job."),focus:p(["editorial","spatial","brand","caption"]).optional().describe("Optional criterion to concentrate the advice on."),ifMatch:e().optional().describe("Etag of the composition the advice is computed against. Proposals are bound to it; apply a proposal BEFORE any other edit or it will 409.")}).describe("POST /projects/:id/consult body.");var wg=r({id:e()}),Jr=0,Yr=0,Xr=0,Qr=0,es=0,os=0,ts=4,ns=0,rs=0,ss=0,is=0,as=1,ds=0,ps=1;var cs=.1,ms=1,ls=0,us=0,fs=-.3,gs=.3,hs=-.3,ys=.3,zs=0,xs=1,bs=0,Cs=1,Ss=-.3,vs=.3,Os=0,Is=1,Rs=0,ks=1,Ts=0,ws=1,js=1,Ms=1,_s=0,Ps=0,Bs=0,Es=0,As=0,Fs=100,Ns=900,qs=100,Us=900,Ds=0,Ws=0,Ks=0,Ls=0,jg=r({v:t(),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional(),platform:e().optional()}),tracks:c(r({id:e().min(1),kind:p(["video","audio","image","overlay","effect"]),name:e().optional(),enabled:h().optional(),contents:c(C([r({id:e().min(1),startTime:t().min(Jr),duration:t(),source:C([r({kind:m("media"),mediaId:e().min(1),trim:r({start:t().min(Yr),end:t().min(Xr)}).optional(),excludedRanges:c(r({start:t().min(Qr),end:t().min(es),reason:e().optional()})).optional(),volume:t().min(os).max(ts).optional(),muted:h().optional(),playbackRate:t().optional(),sync:p(["video","independent"]).optional(),kenBurns:p(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:t().optional(),fadeInMs:t().min(ns).optional(),fadeOutMs:t().min(rs).optional(),loop:h().optional(),reframe:r({segments:c(r({startSec:t().min(ss).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:t().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:C([r({mode:m("frame-center")}),r({mode:m("point"),x:t().min(is).max(as),y:t().min(ds).max(ps)}),r({mode:m("face"),faceId:e().min(1),shotScale:p(["close","standard","wide"]).optional()}),r({mode:m("all-faces")}),r({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:t().min(cs).max(ms).describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Default 1."),ease:r({in:t().min(ls).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:t().min(us).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:r({x:t().min(fs).max(gs).describe("Horizontal nudge, source-normalized (+ = right)."),y:t().min(hs).max(ys).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),r({kind:m("component"),componentId:e().min(1),props:f(e(),y())}),r({kind:m("overlay"),primitiveId:e().min(1),params:f(e(),y()),zPlane:p(["front","behind-subject"]).optional(),anchor:r({space:m("scene"),x:t().min(zs).max(xs),y:t().min(bs).max(Cs)}).optional(),parallax:t().min(Ss).max(vs).optional()}),r({kind:m("effect"),primitiveId:e().min(1),params:f(e(),y()).optional()})]),kind:p(["video","audio","image","overlay","effect"]).optional(),opacity:t().min(Os).max(Is).optional(),scale:t().optional(),rotation:t().optional(),position:r({x:t(),y:t()}).optional(),region:r({x:t().min(Rs).max(ks),y:t().min(Ts).max(ws),w:t().max(js),h:t().max(Ms)}).optional(),fit:p(["cover","contain"]).optional(),effects:c(r({primitiveId:e().min(1),params:f(e(),y()).optional()})).optional(),transitionIn:r({type:e().min(1),duration:t()}).optional()}),r({id:e().min(1),startTime:t().min(_s),duration:t()})]))})),markers:c(r({id:e().min(1),startTime:t().min(Ps),endTime:t().min(Bs).optional(),kind:e().min(1),name:e().optional(),metadata:f(e(),y()).optional()})).optional(),captions:r({segments:c(r({words:c(r({text:e().min(1),startMs:t().min(Es),endMs:t().min(As),emphasis:h().optional(),annotate:p(["circle","underline"]).optional()}))})),style:r({fontFamily:e().min(1).optional(),fontSize:t().optional(),fontWeight:t().min(Fs).max(Ns).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),position:p(["top","center","bottom"]).optional(),textTransform:p(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:t().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:t().min(qs).max(Us).optional(),emphasisTextTransform:p(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:t().optional(),emphasisFontStyle:p(["normal","italic"]).optional(),entrance:p(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:t().min(Ds).optional(),entranceStaggerMs:t().min(Ws).optional(),exitMs:t().min(Ks).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:t().min(Ls).optional(),emphasisPlatePadX:t().optional(),emphasisPlatePadY:t().optional(),annotationColor:e().optional(),maxWidthPercent:t().optional()}).optional()}).optional(),license:r({type:e().min(1),source:e().optional(),notes:e().optional()}).optional(),accessibility:r({audioDescriptionTrackId:e().optional(),captionsTrackId:e().optional(),signLanguageTrackId:e().optional(),notes:e().optional()}).optional()}).describe("Canonical composition wire shape (multi-track; carries reframe, captions, markers)."),Mg=r({id:e()}),$s=0,Gs=0,Zs=0,Vs=0,Hs=0,Js=0,Ys=4,Xs=0,Qs=0,ei=0,oi=0,ti=1,ni=0,ri=1;var si=.1,ii=1,ai=0,di=0,pi=-.3,ci=.3,mi=-.3,li=.3,ui=0,fi=1,gi=0,hi=1,yi=-.3,zi=.3,xi=0,bi=1,Ci=0,Si=1,vi=0,Oi=1,Ii=1,Ri=1,ki=0,Ti=0,wi=0,ji=0,Mi=0,_i=100,Pi=900,Bi=100,Ei=900,Ai=0,Fi=0,Ni=0,qi=0,_g=r({v:t(),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional(),platform:e().optional()}),tracks:c(r({id:e().min(1),kind:p(["video","audio","image","overlay","effect"]),name:e().optional(),enabled:h().optional(),contents:c(C([r({id:e().min(1),startTime:t().min($s),duration:t(),source:C([r({kind:m("media"),mediaId:e().min(1),trim:r({start:t().min(Gs),end:t().min(Zs)}).optional(),excludedRanges:c(r({start:t().min(Vs),end:t().min(Hs),reason:e().optional()})).optional(),volume:t().min(Js).max(Ys).optional(),muted:h().optional(),playbackRate:t().optional(),sync:p(["video","independent"]).optional(),kenBurns:p(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:t().optional(),fadeInMs:t().min(Xs).optional(),fadeOutMs:t().min(Qs).optional(),loop:h().optional(),reframe:r({segments:c(r({startSec:t().min(ei).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:t().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:C([r({mode:m("frame-center")}),r({mode:m("point"),x:t().min(oi).max(ti),y:t().min(ni).max(ri)}),r({mode:m("face"),faceId:e().min(1),shotScale:p(["close","standard","wide"]).optional()}),r({mode:m("all-faces")}),r({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:t().min(si).max(ii).describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Default 1."),ease:r({in:t().min(ai).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:t().min(di).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:r({x:t().min(pi).max(ci).describe("Horizontal nudge, source-normalized (+ = right)."),y:t().min(mi).max(li).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),r({kind:m("component"),componentId:e().min(1),props:f(e(),y())}),r({kind:m("overlay"),primitiveId:e().min(1),params:f(e(),y()),zPlane:p(["front","behind-subject"]).optional(),anchor:r({space:m("scene"),x:t().min(ui).max(fi),y:t().min(gi).max(hi)}).optional(),parallax:t().min(yi).max(zi).optional()}),r({kind:m("effect"),primitiveId:e().min(1),params:f(e(),y()).optional()})]),kind:p(["video","audio","image","overlay","effect"]).optional(),opacity:t().min(xi).max(bi).optional(),scale:t().optional(),rotation:t().optional(),position:r({x:t(),y:t()}).optional(),region:r({x:t().min(Ci).max(Si),y:t().min(vi).max(Oi),w:t().max(Ii),h:t().max(Ri)}).optional(),fit:p(["cover","contain"]).optional(),effects:c(r({primitiveId:e().min(1),params:f(e(),y()).optional()})).optional(),transitionIn:r({type:e().min(1),duration:t()}).optional()}),r({id:e().min(1),startTime:t().min(ki),duration:t()})]))})),markers:c(r({id:e().min(1),startTime:t().min(Ti),endTime:t().min(wi).optional(),kind:e().min(1),name:e().optional(),metadata:f(e(),y()).optional()})).optional(),captions:r({segments:c(r({words:c(r({text:e().min(1),startMs:t().min(ji),endMs:t().min(Mi),emphasis:h().optional(),annotate:p(["circle","underline"]).optional()}))})),style:r({fontFamily:e().min(1).optional(),fontSize:t().optional(),fontWeight:t().min(_i).max(Pi).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),position:p(["top","center","bottom"]).optional(),textTransform:p(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:t().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:t().min(Bi).max(Ei).optional(),emphasisTextTransform:p(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:t().optional(),emphasisFontStyle:p(["normal","italic"]).optional(),entrance:p(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:t().min(Ai).optional(),entranceStaggerMs:t().min(Fi).optional(),exitMs:t().min(Ni).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:t().min(qi).optional(),emphasisPlatePadX:t().optional(),emphasisPlatePadY:t().optional(),annotationColor:e().optional(),maxWidthPercent:t().optional()}).optional()}).optional(),license:r({type:e().min(1),source:e().optional(),notes:e().optional()}).optional(),accessibility:r({audioDescriptionTrackId:e().optional(),captionsTrackId:e().optional(),signLanguageTrackId:e().optional(),notes:e().optional()}).optional()}).describe("Canonical composition wire shape (multi-track; carries reframe, captions, markers)."),Pg=r({id:e()}),Ui=200,Bg=r({name:e().min(1).max(Ui).optional(),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format.")}).describe("POST /projects/:id/compositions body \u2014 create a new video (composition) in the project. `format` defaults to the project's compositionFormat when omitted."),Eg=r({id:e()}),Di=0,Ag=r({data:c(r({compositionId:e(),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format."),etag:e(),isActive:h(),updatedAt:t(),sceneCount:t().min(Di)}).describe("A composition in a project, flagging the active one."))}).describe("GET /projects/:id/compositions response."),Fg=r({id:e()}),Wi=0,Ki=0,Li=0,$i=0,Gi=0,Zi=0,Vi=4,Hi=0,Ji=0,Yi=0,Xi=0,Qi=1,ea=0,oa=1;var ta=.1,na=1,ra=0,sa=0,ia=-.3,aa=.3,da=-.3,pa=.3,ca=0,ma=1,la=0,ua=1,fa=-.3,ga=.3,ha=0,ya=1,za=0,xa=1,ba=0,Ca=1,Sa=1,va=1,Oa=0,Ia=0,Ra=0,ka=0,Ta=0,wa=0,ja=4,Ma=0,_a=0,Pa=0,Ba=0,Ea=1,Aa=0,Fa=1;var Na=.1,qa=1,Ua=0,Da=0,Wa=-.3,Ka=.3,La=-.3,$a=.3,Ga=0,Za=1,Va=0,Ha=1,Ja=-.3,Ya=.3,Xa=0,Qa=1,ed=0,od=1,td=0,nd=1,rd=1,sd=1,id=0,ad=0,dd=0,pd=0,cd=0,md=0,ld=4,ud=0,fd=0,gd=0,hd=0,yd=1,zd=0,xd=1;var bd=.1,Cd=1,Sd=0,vd=0,Od=-.3,Id=.3,Rd=-.3,kd=.3,Td=0,wd=1,jd=0,Md=1,_d=-.3,Pd=.3,Bd=0,Ed=1,Ad=0,Fd=1,Nd=0,qd=1,Ud=1,Dd=1,Wd=0,Kd=0,Ld=0,$d=0,Gd=0,Zd=0,Vd=1,Hd=0,Jd=1;var Yd=.1,Xd=1,Qd=0,ep=0,op=-.3,tp=.3,np=-.3,rp=.3,sp=100,ip=900,ap=100,dp=900,pp=0,cp=0,mp=0,lp=0,Ng=C([r({type:m("clip.add"),clip:r({id:e().min(1),startTime:t().min(Wi),duration:t(),source:C([r({kind:m("media"),mediaId:e().min(1),trim:r({start:t().min(Ki),end:t().min(Li)}).optional(),excludedRanges:c(r({start:t().min($i),end:t().min(Gi),reason:e().optional()})).optional(),volume:t().min(Zi).max(Vi).optional(),muted:h().optional(),playbackRate:t().optional(),sync:p(["video","independent"]).optional(),kenBurns:p(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:t().optional(),fadeInMs:t().min(Hi).optional(),fadeOutMs:t().min(Ji).optional(),loop:h().optional(),reframe:r({segments:c(r({startSec:t().min(Yi).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:t().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:C([r({mode:m("frame-center")}),r({mode:m("point"),x:t().min(Xi).max(Qi),y:t().min(ea).max(oa)}),r({mode:m("face"),faceId:e().min(1),shotScale:p(["close","standard","wide"]).optional()}),r({mode:m("all-faces")}),r({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:t().min(ta).max(na).describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Default 1."),ease:r({in:t().min(ra).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:t().min(sa).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:r({x:t().min(ia).max(aa).describe("Horizontal nudge, source-normalized (+ = right)."),y:t().min(da).max(pa).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),r({kind:m("component"),componentId:e().min(1),props:f(e(),y())}),r({kind:m("overlay"),primitiveId:e().min(1),params:f(e(),y()),zPlane:p(["front","behind-subject"]).optional(),anchor:r({space:m("scene"),x:t().min(ca).max(ma),y:t().min(la).max(ua)}).optional(),parallax:t().min(fa).max(ga).optional()}),r({kind:m("effect"),primitiveId:e().min(1),params:f(e(),y()).optional()})]),kind:p(["video","audio","image","overlay","effect"]).optional(),opacity:t().min(ha).max(ya).optional(),scale:t().optional(),rotation:t().optional(),position:r({x:t(),y:t()}).optional(),region:r({x:t().min(za).max(xa),y:t().min(ba).max(Ca),w:t().max(Sa),h:t().max(va)}).optional(),fit:p(["cover","contain"]).optional(),effects:c(r({primitiveId:e().min(1),params:f(e(),y()).optional()})).optional(),transitionIn:r({type:e().min(1),duration:t()}).optional()}),trackId:e().optional(),newTrack:h().optional(),newTrackId:e().optional()}).describe("Add a clip to the timeline. The clip self-routes to a track by FAMILY (`clip.kind`, else derived from `source.kind`, else the target track) \u2014 a `media` clip MUST carry `kind` (video|audio|image) or a `trackId`, else it is rejected as ambiguous. `trackId` targets an existing SAME-family track; `newTrack:true` (with optional pinned `newTrackId`) creates a fresh track of that family."),r({type:m("clip.remove"),clipId:e()}).describe("Remove a clip by id (located across every track)."),r({type:m("clip.update"),clipId:e(),patch:r({id:e().min(1).optional(),startTime:t().min(Oa).optional(),duration:t().optional(),source:C([r({kind:m("media"),mediaId:e().min(1),trim:r({start:t().min(Ia),end:t().min(Ra)}).optional(),excludedRanges:c(r({start:t().min(ka),end:t().min(Ta),reason:e().optional()})).optional(),volume:t().min(wa).max(ja).optional(),muted:h().optional(),playbackRate:t().optional(),sync:p(["video","independent"]).optional(),kenBurns:p(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:t().optional(),fadeInMs:t().min(Ma).optional(),fadeOutMs:t().min(_a).optional(),loop:h().optional(),reframe:r({segments:c(r({startSec:t().min(Pa).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:t().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:C([r({mode:m("frame-center")}),r({mode:m("point"),x:t().min(Ba).max(Ea),y:t().min(Aa).max(Fa)}),r({mode:m("face"),faceId:e().min(1),shotScale:p(["close","standard","wide"]).optional()}),r({mode:m("all-faces")}),r({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:t().min(Na).max(qa).describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Default 1."),ease:r({in:t().min(Ua).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:t().min(Da).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:r({x:t().min(Wa).max(Ka).describe("Horizontal nudge, source-normalized (+ = right)."),y:t().min(La).max($a).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),r({kind:m("component"),componentId:e().min(1),props:f(e(),y())}),r({kind:m("overlay"),primitiveId:e().min(1),params:f(e(),y()),zPlane:p(["front","behind-subject"]).optional(),anchor:r({space:m("scene"),x:t().min(Ga).max(Za),y:t().min(Va).max(Ha)}).optional(),parallax:t().min(Ja).max(Ya).optional()}),r({kind:m("effect"),primitiveId:e().min(1),params:f(e(),y()).optional()})]).optional(),kind:p(["video","audio","image","overlay","effect"]).optional(),opacity:t().min(Xa).max(Qa).optional(),scale:t().optional(),rotation:t().optional(),position:r({x:t(),y:t()}).optional(),region:r({x:t().min(ed).max(od),y:t().min(td).max(nd),w:t().max(rd),h:t().max(sd)}).optional(),fit:p(["cover","contain"]).optional(),effects:c(r({primitiveId:e().min(1),params:f(e(),y()).optional()})).optional(),transitionIn:r({type:e().min(1),duration:t()}).optional()})}).describe("Patch an existing clip by id (cross-family). The patch is a partial TimelineClip. NOTE: `source` is REPLACED wholesale \u2014 the patch merges at the top level only, so a partial `source` WIPES the source fields you omit. Patch the whole source object when changing it. (To change reframe/excluded ranges, prefer setCropIntents / addExcludedRange, not a source patch.)"),r({type:m("removeClipsByMediaId"),mediaId:e()}).describe("Remove EVERY clip sourced from a given mediaId (e.g. after deleting that media)."),r({type:m("loadOverlays"),clips:c(r({id:e().min(1),startTime:t().min(id),duration:t(),source:C([r({kind:m("media"),mediaId:e().min(1),trim:r({start:t().min(ad),end:t().min(dd)}).optional(),excludedRanges:c(r({start:t().min(pd),end:t().min(cd),reason:e().optional()})).optional(),volume:t().min(md).max(ld).optional(),muted:h().optional(),playbackRate:t().optional(),sync:p(["video","independent"]).optional(),kenBurns:p(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:t().optional(),fadeInMs:t().min(ud).optional(),fadeOutMs:t().min(fd).optional(),loop:h().optional(),reframe:r({segments:c(r({startSec:t().min(gd).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:t().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:C([r({mode:m("frame-center")}),r({mode:m("point"),x:t().min(hd).max(yd),y:t().min(zd).max(xd)}),r({mode:m("face"),faceId:e().min(1),shotScale:p(["close","standard","wide"]).optional()}),r({mode:m("all-faces")}),r({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:t().min(bd).max(Cd).describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Default 1."),ease:r({in:t().min(Sd).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:t().min(vd).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:r({x:t().min(Od).max(Id).describe("Horizontal nudge, source-normalized (+ = right)."),y:t().min(Rd).max(kd).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),r({kind:m("component"),componentId:e().min(1),props:f(e(),y())}),r({kind:m("overlay"),primitiveId:e().min(1),params:f(e(),y()),zPlane:p(["front","behind-subject"]).optional(),anchor:r({space:m("scene"),x:t().min(Td).max(wd),y:t().min(jd).max(Md)}).optional(),parallax:t().min(_d).max(Pd).optional()}),r({kind:m("effect"),primitiveId:e().min(1),params:f(e(),y()).optional()})]),kind:p(["video","audio","image","overlay","effect"]).optional(),opacity:t().min(Bd).max(Ed).optional(),scale:t().optional(),rotation:t().optional(),position:r({x:t(),y:t()}).optional(),region:r({x:t().min(Ad).max(Fd),y:t().min(Nd).max(qd),w:t().max(Ud),h:t().max(Dd)}).optional(),fit:p(["cover","contain"]).optional(),effects:c(r({primitiveId:e().min(1),params:f(e(),y()).optional()})).optional(),transitionIn:r({type:e().min(1),duration:t()}).optional()}))}).describe("Replace the overlay channel wholesale with the given clips (bulk set, not a merge)."),r({type:m("addMarker"),marker:r({id:e().min(1),startTime:t().min(Wd),endTime:t().min(Kd).optional(),kind:e().min(1),name:e().optional(),metadata:f(e(),y()).optional()})}).describe("Add a timeline marker (a named time point/range; carry extensions in `metadata`)."),r({type:m("removeMarker"),markerId:e()}).describe("Remove a marker by id."),r({type:m("updateMarker"),markerId:e(),updates:r({id:e().min(1).optional(),startTime:t().min(Ld).optional(),endTime:t().min($d).optional(),kind:e().min(1).optional(),name:e().optional(),metadata:f(e(),y()).optional()})}).describe("Patch a marker's fields by id (partial merge)."),r({type:m("setCropIntents"),clipId:e(),segments:c(r({startSec:t().min(Gd).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:t().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:C([r({mode:m("frame-center")}),r({mode:m("point"),x:t().min(Zd).max(Vd),y:t().min(Hd).max(Jd)}),r({mode:m("face"),faceId:e().min(1),shotScale:p(["close","standard","wide"]).optional()}),r({mode:m("all-faces")}),r({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:t().min(Yd).max(Xd).describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Default 1."),ease:r({in:t().min(Qd).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:t().min(ep).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:r({x:t().min(op).max(tp).describe("Horizontal nudge, source-normalized (+ = right)."),y:t().min(np).max(rp).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).nullable()}).describe("Set (or CLEAR, with `segments: null`) the camera/reframe channel on a MEDIA clip \u2014 the time-aligned source\u2192output viewport (focus, zoom, ease, bias). This is the PREFERRED way to author reframing; do NOT reframe via a whole-source `clip.update` patch. Segments tile the clip's duration."),r({type:m("setCaptionStyle"),style:r({fontFamily:e().min(1).optional(),fontSize:t().optional(),fontWeight:t().min(sp).max(ip).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),position:p(["top","center","bottom"]).optional(),textTransform:p(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:t().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:t().min(ap).max(dp).optional(),emphasisTextTransform:p(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:t().optional(),emphasisFontStyle:p(["normal","italic"]).optional(),entrance:p(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:t().min(pp).optional(),entranceStaggerMs:t().min(cp).optional(),exitMs:t().min(mp).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:t().min(lp).optional(),emphasisPlatePadX:t().optional(),emphasisPlatePadY:t().optional(),annotationColor:e().optional(),maxWidthPercent:t().optional()})}).describe("Merge style overrides (font/color/position/emphasis) onto the composition's caption layer. Partial \u2014 omitted fields keep their current value; creates the caption container if absent."),r({type:m("setFormat"),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()})}).describe("Set the output format \u2014 `aspectRatio` (16:9|9:16|1:1|4:5) plus optional `fps` and `resolution`. Merges: an omitted field keeps the current value."),r({type:m("addTrack"),kind:p(["video","audio","image","overlay","effect"]),name:e().optional(),id:e().optional()}).describe("Add an EMPTY track of a given family (video|audio|image|overlay|effect). Optional pinned `id`."),r({type:m("removeTrack"),trackId:e()}).describe("Remove a track AND all its clips by id."),r({type:m("updateTrack"),trackId:e(),updates:r({name:e().optional(),enabled:h().optional()})}).describe("Patch a track's `name` / `enabled` by id."),r({type:m("reorderTracks"),fromIndex:t(),toIndex:t()}).describe("Move a track from one index to another (changes layer/compositing order)."),r({type:m("moveClipToTrack"),clipId:e(),targetTrackId:e(),newStartTime:t().optional()}).describe("Move a clip to another SAME-family track, optionally at a new `newStartTime`."),r({type:m("duplicateClip"),clipId:e(),newClipId:e().optional()}).describe("Duplicate a clip by id. Pin `newClipId` to make the copy's id deterministic (required for a clean undo/inverse)."),r({type:m("cutAndRipple"),start:t(),end:t()}).describe("Server-authoritative: delete the [start,end] time window and ripple every downstream clip/marker/caption earlier to close the gap."),r({type:m("ripple"),time:t(),amount:t()}).describe("Server-authoritative: shift everything at/after `time` by `amount` seconds (+ opens a gap, \u2212 closes one)."),r({type:m("addExcludedRange"),clipId:e(),sourceStart:t(),sourceEnd:t(),reason:e().optional()}).describe("Server-authoritative: exclude a [sourceStart,sourceEnd] span of a clip's SOURCE (an internal trim) and ripple downstream \u2014 the preferred way to drop a sub-range vs a source patch."),r({type:m("removeExcludedRange"),clipId:e(),rangeIdx:t()}).describe("Server-authoritative: remove a clip's previously-added excluded range by index (re-includes that span, ripples downstream).")]).describe("One scoped composition operation. Discriminated by `type` \u2014 `clip.add` / `clip.remove` / `clip.update` patch clips across any family; the rest cover markers, reframe, captions, format, tracks, and the server-authoritative ripple recomputes. Validated strictly server-side against the runtime CompositionOp vocabulary."),qg=r({id:e()}),up=0,fp=0,gp=0,hp=0,yp=0,zp=0,xp=4,bp=0,Cp=0,Sp=0,vp=0,Op=1,Ip=0,Rp=1;var kp=.1,Tp=1,wp=0,jp=0,Mp=-.3,_p=.3,Pp=-.3,Bp=.3,Ep=0,Ap=1,Fp=0,Np=1,qp=-.3,Up=.3,Dp=0,Wp=1,Kp=0,Lp=1,$p=0,Gp=1,Zp=1,Vp=1,Hp=0,Jp=0,Yp=0,Xp=0,Qp=0,ec=0,oc=4,tc=0,nc=0,rc=0,sc=0,ic=1,ac=0,dc=1;var pc=.1,cc=1,mc=0,lc=0,uc=-.3,fc=.3,gc=-.3,hc=.3,yc=0,zc=1,xc=0,bc=1,Cc=-.3,Sc=.3,vc=0,Oc=1,Ic=0,Rc=1,kc=0,Tc=1,wc=1,jc=1,Mc=0,_c=0,Pc=0,Bc=0,Ec=0,Ac=0,Fc=4,Nc=0,qc=0,Uc=0,Dc=0,Wc=1,Kc=0,Lc=1;var $c=.1,Gc=1,Zc=0,Vc=0,Hc=-.3,Jc=.3,Yc=-.3,Xc=.3,Qc=0,em=1,om=0,tm=1,nm=-.3,rm=.3,sm=0,im=1,am=0,dm=1,pm=0,cm=1,mm=1,lm=1,um=0,fm=0,gm=0,hm=0,ym=0,zm=0,xm=1,bm=0,Cm=1;var Sm=.1,vm=1,Om=0,Im=0,Rm=-.3,km=.3,Tm=-.3,wm=.3,jm=100,Mm=900,_m=100,Pm=900,Bm=0,Em=0,Am=0,Fm=0,Ug=r({ops:c(C([r({type:m("clip.add"),clip:r({id:e().min(1),startTime:t().min(up),duration:t(),source:C([r({kind:m("media"),mediaId:e().min(1),trim:r({start:t().min(fp),end:t().min(gp)}).optional(),excludedRanges:c(r({start:t().min(hp),end:t().min(yp),reason:e().optional()})).optional(),volume:t().min(zp).max(xp).optional(),muted:h().optional(),playbackRate:t().optional(),sync:p(["video","independent"]).optional(),kenBurns:p(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:t().optional(),fadeInMs:t().min(bp).optional(),fadeOutMs:t().min(Cp).optional(),loop:h().optional(),reframe:r({segments:c(r({startSec:t().min(Sp).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:t().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:C([r({mode:m("frame-center")}),r({mode:m("point"),x:t().min(vp).max(Op),y:t().min(Ip).max(Rp)}),r({mode:m("face"),faceId:e().min(1),shotScale:p(["close","standard","wide"]).optional()}),r({mode:m("all-faces")}),r({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:t().min(kp).max(Tp).describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Default 1."),ease:r({in:t().min(wp).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:t().min(jp).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:r({x:t().min(Mp).max(_p).describe("Horizontal nudge, source-normalized (+ = right)."),y:t().min(Pp).max(Bp).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),r({kind:m("component"),componentId:e().min(1),props:f(e(),y())}),r({kind:m("overlay"),primitiveId:e().min(1),params:f(e(),y()),zPlane:p(["front","behind-subject"]).optional(),anchor:r({space:m("scene"),x:t().min(Ep).max(Ap),y:t().min(Fp).max(Np)}).optional(),parallax:t().min(qp).max(Up).optional()}),r({kind:m("effect"),primitiveId:e().min(1),params:f(e(),y()).optional()})]),kind:p(["video","audio","image","overlay","effect"]).optional(),opacity:t().min(Dp).max(Wp).optional(),scale:t().optional(),rotation:t().optional(),position:r({x:t(),y:t()}).optional(),region:r({x:t().min(Kp).max(Lp),y:t().min($p).max(Gp),w:t().max(Zp),h:t().max(Vp)}).optional(),fit:p(["cover","contain"]).optional(),effects:c(r({primitiveId:e().min(1),params:f(e(),y()).optional()})).optional(),transitionIn:r({type:e().min(1),duration:t()}).optional()}),trackId:e().optional(),newTrack:h().optional(),newTrackId:e().optional()}).describe("Add a clip to the timeline. The clip self-routes to a track by FAMILY (`clip.kind`, else derived from `source.kind`, else the target track) \u2014 a `media` clip MUST carry `kind` (video|audio|image) or a `trackId`, else it is rejected as ambiguous. `trackId` targets an existing SAME-family track; `newTrack:true` (with optional pinned `newTrackId`) creates a fresh track of that family."),r({type:m("clip.remove"),clipId:e()}).describe("Remove a clip by id (located across every track)."),r({type:m("clip.update"),clipId:e(),patch:r({id:e().min(1).optional(),startTime:t().min(Hp).optional(),duration:t().optional(),source:C([r({kind:m("media"),mediaId:e().min(1),trim:r({start:t().min(Jp),end:t().min(Yp)}).optional(),excludedRanges:c(r({start:t().min(Xp),end:t().min(Qp),reason:e().optional()})).optional(),volume:t().min(ec).max(oc).optional(),muted:h().optional(),playbackRate:t().optional(),sync:p(["video","independent"]).optional(),kenBurns:p(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:t().optional(),fadeInMs:t().min(tc).optional(),fadeOutMs:t().min(nc).optional(),loop:h().optional(),reframe:r({segments:c(r({startSec:t().min(rc).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:t().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:C([r({mode:m("frame-center")}),r({mode:m("point"),x:t().min(sc).max(ic),y:t().min(ac).max(dc)}),r({mode:m("face"),faceId:e().min(1),shotScale:p(["close","standard","wide"]).optional()}),r({mode:m("all-faces")}),r({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:t().min(pc).max(cc).describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Default 1."),ease:r({in:t().min(mc).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:t().min(lc).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:r({x:t().min(uc).max(fc).describe("Horizontal nudge, source-normalized (+ = right)."),y:t().min(gc).max(hc).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),r({kind:m("component"),componentId:e().min(1),props:f(e(),y())}),r({kind:m("overlay"),primitiveId:e().min(1),params:f(e(),y()),zPlane:p(["front","behind-subject"]).optional(),anchor:r({space:m("scene"),x:t().min(yc).max(zc),y:t().min(xc).max(bc)}).optional(),parallax:t().min(Cc).max(Sc).optional()}),r({kind:m("effect"),primitiveId:e().min(1),params:f(e(),y()).optional()})]).optional(),kind:p(["video","audio","image","overlay","effect"]).optional(),opacity:t().min(vc).max(Oc).optional(),scale:t().optional(),rotation:t().optional(),position:r({x:t(),y:t()}).optional(),region:r({x:t().min(Ic).max(Rc),y:t().min(kc).max(Tc),w:t().max(wc),h:t().max(jc)}).optional(),fit:p(["cover","contain"]).optional(),effects:c(r({primitiveId:e().min(1),params:f(e(),y()).optional()})).optional(),transitionIn:r({type:e().min(1),duration:t()}).optional()})}).describe("Patch an existing clip by id (cross-family). The patch is a partial TimelineClip. NOTE: `source` is REPLACED wholesale \u2014 the patch merges at the top level only, so a partial `source` WIPES the source fields you omit. Patch the whole source object when changing it. (To change reframe/excluded ranges, prefer setCropIntents / addExcludedRange, not a source patch.)"),r({type:m("removeClipsByMediaId"),mediaId:e()}).describe("Remove EVERY clip sourced from a given mediaId (e.g. after deleting that media)."),r({type:m("loadOverlays"),clips:c(r({id:e().min(1),startTime:t().min(Mc),duration:t(),source:C([r({kind:m("media"),mediaId:e().min(1),trim:r({start:t().min(_c),end:t().min(Pc)}).optional(),excludedRanges:c(r({start:t().min(Bc),end:t().min(Ec),reason:e().optional()})).optional(),volume:t().min(Ac).max(Fc).optional(),muted:h().optional(),playbackRate:t().optional(),sync:p(["video","independent"]).optional(),kenBurns:p(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:t().optional(),fadeInMs:t().min(Nc).optional(),fadeOutMs:t().min(qc).optional(),loop:h().optional(),reframe:r({segments:c(r({startSec:t().min(Uc).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:t().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:C([r({mode:m("frame-center")}),r({mode:m("point"),x:t().min(Dc).max(Wc),y:t().min(Kc).max(Lc)}),r({mode:m("face"),faceId:e().min(1),shotScale:p(["close","standard","wide"]).optional()}),r({mode:m("all-faces")}),r({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:t().min($c).max(Gc).describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Default 1."),ease:r({in:t().min(Zc).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:t().min(Vc).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:r({x:t().min(Hc).max(Jc).describe("Horizontal nudge, source-normalized (+ = right)."),y:t().min(Yc).max(Xc).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),r({kind:m("component"),componentId:e().min(1),props:f(e(),y())}),r({kind:m("overlay"),primitiveId:e().min(1),params:f(e(),y()),zPlane:p(["front","behind-subject"]).optional(),anchor:r({space:m("scene"),x:t().min(Qc).max(em),y:t().min(om).max(tm)}).optional(),parallax:t().min(nm).max(rm).optional()}),r({kind:m("effect"),primitiveId:e().min(1),params:f(e(),y()).optional()})]),kind:p(["video","audio","image","overlay","effect"]).optional(),opacity:t().min(sm).max(im).optional(),scale:t().optional(),rotation:t().optional(),position:r({x:t(),y:t()}).optional(),region:r({x:t().min(am).max(dm),y:t().min(pm).max(cm),w:t().max(mm),h:t().max(lm)}).optional(),fit:p(["cover","contain"]).optional(),effects:c(r({primitiveId:e().min(1),params:f(e(),y()).optional()})).optional(),transitionIn:r({type:e().min(1),duration:t()}).optional()}))}).describe("Replace the overlay channel wholesale with the given clips (bulk set, not a merge)."),r({type:m("addMarker"),marker:r({id:e().min(1),startTime:t().min(um),endTime:t().min(fm).optional(),kind:e().min(1),name:e().optional(),metadata:f(e(),y()).optional()})}).describe("Add a timeline marker (a named time point/range; carry extensions in `metadata`)."),r({type:m("removeMarker"),markerId:e()}).describe("Remove a marker by id."),r({type:m("updateMarker"),markerId:e(),updates:r({id:e().min(1).optional(),startTime:t().min(gm).optional(),endTime:t().min(hm).optional(),kind:e().min(1).optional(),name:e().optional(),metadata:f(e(),y()).optional()})}).describe("Patch a marker's fields by id (partial merge)."),r({type:m("setCropIntents"),clipId:e(),segments:c(r({startSec:t().min(ym).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:t().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:C([r({mode:m("frame-center")}),r({mode:m("point"),x:t().min(zm).max(xm),y:t().min(bm).max(Cm)}),r({mode:m("face"),faceId:e().min(1),shotScale:p(["close","standard","wide"]).optional()}),r({mode:m("all-faces")}),r({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:t().min(Sm).max(vm).describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Default 1."),ease:r({in:t().min(Om).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:t().min(Im).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:r({x:t().min(Rm).max(km).describe("Horizontal nudge, source-normalized (+ = right)."),y:t().min(Tm).max(wm).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).nullable()}).describe("Set (or CLEAR, with `segments: null`) the camera/reframe channel on a MEDIA clip \u2014 the time-aligned source\u2192output viewport (focus, zoom, ease, bias). This is the PREFERRED way to author reframing; do NOT reframe via a whole-source `clip.update` patch. Segments tile the clip's duration."),r({type:m("setCaptionStyle"),style:r({fontFamily:e().min(1).optional(),fontSize:t().optional(),fontWeight:t().min(jm).max(Mm).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),position:p(["top","center","bottom"]).optional(),textTransform:p(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:t().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:t().min(_m).max(Pm).optional(),emphasisTextTransform:p(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:t().optional(),emphasisFontStyle:p(["normal","italic"]).optional(),entrance:p(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:t().min(Bm).optional(),entranceStaggerMs:t().min(Em).optional(),exitMs:t().min(Am).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:t().min(Fm).optional(),emphasisPlatePadX:t().optional(),emphasisPlatePadY:t().optional(),annotationColor:e().optional(),maxWidthPercent:t().optional()})}).describe("Merge style overrides (font/color/position/emphasis) onto the composition's caption layer. Partial \u2014 omitted fields keep their current value; creates the caption container if absent."),r({type:m("setFormat"),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()})}).describe("Set the output format \u2014 `aspectRatio` (16:9|9:16|1:1|4:5) plus optional `fps` and `resolution`. Merges: an omitted field keeps the current value."),r({type:m("addTrack"),kind:p(["video","audio","image","overlay","effect"]),name:e().optional(),id:e().optional()}).describe("Add an EMPTY track of a given family (video|audio|image|overlay|effect). Optional pinned `id`."),r({type:m("removeTrack"),trackId:e()}).describe("Remove a track AND all its clips by id."),r({type:m("updateTrack"),trackId:e(),updates:r({name:e().optional(),enabled:h().optional()})}).describe("Patch a track's `name` / `enabled` by id."),r({type:m("reorderTracks"),fromIndex:t(),toIndex:t()}).describe("Move a track from one index to another (changes layer/compositing order)."),r({type:m("moveClipToTrack"),clipId:e(),targetTrackId:e(),newStartTime:t().optional()}).describe("Move a clip to another SAME-family track, optionally at a new `newStartTime`."),r({type:m("duplicateClip"),clipId:e(),newClipId:e().optional()}).describe("Duplicate a clip by id. Pin `newClipId` to make the copy's id deterministic (required for a clean undo/inverse)."),r({type:m("cutAndRipple"),start:t(),end:t()}).describe("Server-authoritative: delete the [start,end] time window and ripple every downstream clip/marker/caption earlier to close the gap."),r({type:m("ripple"),time:t(),amount:t()}).describe("Server-authoritative: shift everything at/after `time` by `amount` seconds (+ opens a gap, \u2212 closes one)."),r({type:m("addExcludedRange"),clipId:e(),sourceStart:t(),sourceEnd:t(),reason:e().optional()}).describe("Server-authoritative: exclude a [sourceStart,sourceEnd] span of a clip's SOURCE (an internal trim) and ripple downstream \u2014 the preferred way to drop a sub-range vs a source patch."),r({type:m("removeExcludedRange"),clipId:e(),rangeIdx:t()}).describe("Server-authoritative: remove a clip's previously-added excluded range by index (re-includes that span, ripples downstream).")]).describe("One scoped composition operation. Discriminated by `type` \u2014 `clip.add` / `clip.remove` / `clip.update` patch clips across any family; the rest cover markers, reframe, captions, format, tracks, and the server-authoritative ripple recomputes. Validated strictly server-side against the runtime CompositionOp vocabulary.")).min(1),if_match:e().optional().describe('Optional OCC precondition \u2014 the strong etag (`"<hex>"`) the caller last saw. On mismatch the batch is rejected (409 stale_etag) before any op applies.'),dry_run:h().optional().describe("When true, validate the batch (apply + projection accept/reject guards) WITHOUT persisting. Returns `{ valid, errors }` instead of applying.")}).describe("POST /projects/:id/composition/apply body \u2014 a batch of CompositionOps."),Dg=r({id:e()}),Wg=r({fromCompositionId:e().min(1).describe("Source composition to reframe a sibling from."),targetFormat:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format.")}).describe("Derive a reframed sibling composition for a new aspect (Auto-Reframe / Magic-Resize, agent-native)."),Kg=r({compositionId:e().describe("The new sibling composition's id.")}).describe("POST /projects/:id/compositions/derive response."),Nm=0,qm=0,Um=0,Dm=0,Wm=0,Km=0,Lm=4,$m=0,Gm=0,Zm=0,Vm=0,Hm=1,Jm=0,Ym=1;var Xm=.1,Qm=1,el=0,ol=0,tl=-.3,nl=.3,rl=-.3,sl=.3,il=0,al=1,dl=0,pl=1,cl=-.3,ml=.3,ll=0,ul=1,fl=0,gl=1,hl=0,yl=1,zl=1,xl=1,bl=0,Cl=0,Sl=0,vl=0,Ol=0,Il=100,Rl=900,kl=100,Tl=900,wl=0,jl=0,Ml=0,_l=0,Lg=r({v:t(),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional(),platform:e().optional()}),tracks:c(r({id:e().min(1),kind:p(["video","audio","image","overlay","effect"]),name:e().optional(),enabled:h().optional(),contents:c(C([r({id:e().min(1),startTime:t().min(Nm),duration:t(),source:C([r({kind:m("media"),mediaId:e().min(1),trim:r({start:t().min(qm),end:t().min(Um)}).optional(),excludedRanges:c(r({start:t().min(Dm),end:t().min(Wm),reason:e().optional()})).optional(),volume:t().min(Km).max(Lm).optional(),muted:h().optional(),playbackRate:t().optional(),sync:p(["video","independent"]).optional(),kenBurns:p(["in","out","pan-l","pan-r","none"]).optional(),volumeDb:t().optional(),fadeInMs:t().min($m).optional(),fadeOutMs:t().min(Gm).optional(),loop:h().optional(),reframe:r({segments:c(r({startSec:t().min(Zm).describe("Segment START in seconds, clip-relative. Segments tile the clip's duration in order."),endSec:t().describe("Segment END in seconds, clip-relative. The span (endSec \u2212 startSec) is this segment's duration \u2014 the window `ease` ramps over."),focus:C([r({mode:m("frame-center")}),r({mode:m("point"),x:t().min(Vm).max(Hm),y:t().min(Jm).max(Ym)}),r({mode:m("face"),faceId:e().min(1),shotScale:p(["close","standard","wide"]).optional()}),r({mode:m("all-faces")}),r({mode:m("active-speaker")})]).describe("WHO/WHAT the camera tracks this segment (the reframe center), selected by `mode`: `frame-center` = no tracking, hold the geometric center (static/graphic footage, or a pure zoom); `point` = lock to a fixed source-normalized {x,y} (a non-moving on-screen element); `face` = track a detected face by `faceId` (from get_media_context), with optional `shotScale` close|standard|wide for tightness; `all-faces` = frame the bounding box of every detected face (group/ensemble shots); `active-speaker` = follow whoever is speaking (diarized talking-head / podcast). Pick by what the beat is about; pair with `zoom` for how tight."),intent:e().optional().describe("Optional editorial LABEL for diff/log readability (e.g. 'speaker-tight', 'wide-context'). Cosmetic \u2014 NOT honored by the derive math and excluded from the variant cache key."),zoom:t().min(Xm).max(Qm).describe("How TIGHT the framing is \u2014 the fraction of the source the output viewport shows. <1 punches IN (a smaller source fraction, magnified to fill the frame); 1 = the full frame (no crop). ~0.6\u20130.8 is a moderate push-in, ~0.5 a tight close-up, 0.1 the maximum zoom. There is NO zoom-OUT past the full frame (max 1). Default 1."),ease:r({in:t().min(el).describe("Ease-IN ramp DURATION in seconds at the segment START."),out:t().min(ol).describe("Ease-OUT ramp DURATION in seconds at the segment END.")}).optional().describe("Zoom/center ramp DURATIONS in SECONDS at this segment's edges \u2014 NOT a unitless 0\u20131 curve. ~0.3\u20130.6s reads as a snappy push; >1s reads sluggish. Keep `in` + `out` \u2264 the segment's duration (endSec \u2212 startSec): the two edges share the span, so to ramp across the WHOLE segment set one edge to the full duration and the other to 0. Omit for an instant cut to this framing."),bias:r({x:t().min(tl).max(nl).describe("Horizontal nudge, source-normalized (+ = right)."),y:t().min(rl).max(sl).describe("Vertical nudge, source-normalized (+ = down).")}).optional().describe("Optional FINE framing nudge off the focus center, source-normalized in [\u22120.3, 0.3]. A small correction (headroom, rule-of-thirds), NOT a reframe \u2014 use `focus`/`zoom` for the actual shot. Omit (treated as 0) to sit dead-center on the focus.")})).min(1)}).optional()}),r({kind:m("component"),componentId:e().min(1),props:f(e(),y())}),r({kind:m("overlay"),primitiveId:e().min(1),params:f(e(),y()),zPlane:p(["front","behind-subject"]).optional(),anchor:r({space:m("scene"),x:t().min(il).max(al),y:t().min(dl).max(pl)}).optional(),parallax:t().min(cl).max(ml).optional()}),r({kind:m("effect"),primitiveId:e().min(1),params:f(e(),y()).optional()})]),kind:p(["video","audio","image","overlay","effect"]).optional(),opacity:t().min(ll).max(ul).optional(),scale:t().optional(),rotation:t().optional(),position:r({x:t(),y:t()}).optional(),region:r({x:t().min(fl).max(gl),y:t().min(hl).max(yl),w:t().max(zl),h:t().max(xl)}).optional(),fit:p(["cover","contain"]).optional(),effects:c(r({primitiveId:e().min(1),params:f(e(),y()).optional()})).optional(),transitionIn:r({type:e().min(1),duration:t()}).optional()}),r({id:e().min(1),startTime:t().min(bl),duration:t()})]))})),markers:c(r({id:e().min(1),startTime:t().min(Cl),endTime:t().min(Sl).optional(),kind:e().min(1),name:e().optional(),metadata:f(e(),y()).optional()})).optional(),captions:r({segments:c(r({words:c(r({text:e().min(1),startMs:t().min(vl),endMs:t().min(Ol),emphasis:h().optional(),annotate:p(["circle","underline"]).optional()}))})),style:r({fontFamily:e().min(1).optional(),fontSize:t().optional(),fontWeight:t().min(Il).max(Rl).optional(),color:e().min(1).optional(),highlightColor:e().min(1).optional(),backgroundColor:e().optional(),position:p(["top","center","bottom"]).optional(),textTransform:p(["none","uppercase","capitalize"]).optional(),emphasisColor:e().optional(),emphasisGradient:e().optional(),emphasisScale:t().optional(),emphasisFontFamily:e().optional(),emphasisFontWeight:t().min(kl).max(Tl).optional(),emphasisTextTransform:p(["none","uppercase","capitalize"]).optional(),emphasisLetterSpacing:t().optional(),emphasisFontStyle:p(["normal","italic"]).optional(),entrance:p(["none","fade","word-pop","stagger-up"]).optional(),entranceMs:t().min(wl).optional(),entranceStaggerMs:t().min(jl).optional(),exitMs:t().min(Ml).optional(),emphasisPlate:h().optional(),emphasisPlateColor:e().optional(),emphasisPlateTextColor:e().optional(),emphasisPlateAltColor:e().optional(),emphasisPlateAltTextColor:e().optional(),emphasisPlateRadius:t().min(_l).optional(),emphasisPlatePadX:t().optional(),emphasisPlatePadY:t().optional(),annotationColor:e().optional(),maxWidthPercent:t().optional()}).optional()}).optional(),license:r({type:e().min(1),source:e().optional(),notes:e().optional()}).optional(),accessibility:r({audioDescriptionTrackId:e().optional(),captionsTrackId:e().optional(),signLanguageTrackId:e().optional(),notes:e().optional()}).optional()}).describe("Canonical composition wire shape (multi-track; carries reframe, captions, markers)."),$g=r({valid:h(),errors:c(r({code:e(),stage:e(),category:e(),retryable:h(),message:e(),fix:f(e(),y()).optional()}))});var Zg=r({id:e()}),Vg=r({clipSuggestionId:e().min(1)}).describe("POST /projects/:id/exports/{fcpxml,premiere} body."),Hg=r({id:e()}),Jg=r({clipSuggestionId:e().min(1)}).describe("POST /projects/:id/exports/{fcpxml,premiere} body."),Yg=r({id:e(),exportId:e()}),Pl=0,Bl=1,Xg=r({id:e(),format:p(["fcpxml","premiere"]),status:p(["queued","trimming","building","uploading","complete","error","cancelled"]),progress:t().min(Pl).max(Bl).describe("Fractional progress 0..1 across the trim/build/upload pipeline. Reaches 1 only on `complete`."),outputUrl:e().nullable(),outputExpiresAt:e().nullable(),outputSizeBytes:t().nullable(),outputDurationSec:t().nullable(),error:C([r({phase:p(["trim","build","upload","trigger"]),message:e(),detail:e().optional(),retryable:h()}),L()]).describe("Set when status is `error`; null otherwise. The phase field localizes the failure to trim / build / upload / trigger."),trimCacheHit:h().nullable(),clipSuggestionId:e().nullable(),createdAt:e(),updatedAt:e()}).describe("NLE export job response.");var eh=r({status:p(["ok","degraded"]),version:e(),checks:f(e(),r({ok:h(),detail:e().optional()})).optional()}).describe("Health probe response."),oh=r({orgId:e(),permissions:f(e(),c(e())),keyId:e(),keyName:e()}).describe("Whoami response."),th=r({});var El=500,Al=10737418240,rh=r({filename:e().min(1).max(El),contentType:p(["video/mp4","video/quicktime","video/x-matroska","video/webm","audio/mpeg","audio/wav","audio/x-wav","audio/mp4","audio/aac","image/png","image/jpeg","image/webp","image/gif","image/svg+xml","application/json","font/ttf","font/otf","font/woff","font/woff2"]),size:t().max(Al)}).describe("POST /media upload initiation body."),sh=r({data:c(r({id:e(),status:e(),source:p(["upload","generated"]),name:e(),mimeType:e(),fileSize:t(),duration:t().nullable(),width:t().nullable(),height:t().nullable(),frameRate:t().nullable(),progress:r({phase:e(),percent:t().nullable()}).nullable(),analysis:f(e(),y()).nullable(),thumbnailUrl:e().nullable(),previewUrl:e().nullable(),kind:e().nullable(),tags:c(e()).nullable(),attribution:r({provider:p(["pexels","pixabay","freesound","klipy"]),externalId:e().nullable(),assetUrl:e().nullable(),license:e().nullable()}).nullable(),processingStatus:C([r({phase:p(["idle","pending_import","pending_upload","uploading","extracting","loading_model","transcribing","proxy","embedding","analyzing","indexing","generating","rendering","processing","complete","error","cancelled"]),percent:t().nullish(),message:e().nullish(),error:e().nullish()}),L()]),createdAt:e(),updatedAt:e()}).describe("Media item response per \xA7Media.")),pagination:r({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),Fl=1e4,ih=r({generator:p(["manim","text-to-video","text-to-image","image-to-video","auto"]),prompt:e().min(1).max(Fl),style:f(e(),y()).optional(),refs:r({firstFrameMediaId:e().optional(),lastFrameMediaId:e().optional(),imageMediaIds:c(e()).optional()}).optional()}).describe("POST /media/generate body."),Nl=2048,ql=500,Ul=10737418240,ah=r({url:e().url().max(Nl),filename:e().min(1).max(ql),contentType:p(["video/mp4","video/quicktime","video/x-matroska","video/webm","audio/mpeg","audio/wav","audio/x-wav","audio/mp4","audio/aac","image/png","image/jpeg","image/webp","image/gif","image/svg+xml","application/json","font/ttf","font/otf","font/woff","font/woff2"]),size:t().max(Ul).optional()}).describe("POST /media/import body."),dh=r({id:e()}),ph=r({id:e()}),ch=r({id:e(),status:e(),source:p(["upload","generated"]),name:e(),mimeType:e(),fileSize:t(),duration:t().nullable(),width:t().nullable(),height:t().nullable(),frameRate:t().nullable(),progress:r({phase:e(),percent:t().nullable()}).nullable(),analysis:f(e(),y()).nullable(),thumbnailUrl:e().nullable(),previewUrl:e().nullable(),kind:e().nullable(),tags:c(e()).nullable(),attribution:r({provider:p(["pexels","pixabay","freesound","klipy"]),externalId:e().nullable(),assetUrl:e().nullable(),license:e().nullable()}).nullable(),processingStatus:C([r({phase:p(["idle","pending_import","pending_upload","uploading","extracting","loading_model","transcribing","proxy","embedding","analyzing","indexing","generating","rendering","processing","complete","error","cancelled"]),percent:t().nullish(),message:e().nullish(),error:e().nullish()}),L()]),createdAt:e(),updatedAt:e()}).describe("Media item response per \xA7Media."),mh=r({id:e()}),lh=r({mediaItemId:e(),language:e().nullable(),model:e().nullable(),fullText:e(),utterances:c(f(e(),y())),data:c(f(e(),y())).optional(),pagination:r({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).optional().describe("Cursor pagination metadata.")}).describe("Transcript response."),uh=r({id:e()}),fh=r({mediaId:e(),durationSec:t().nullable(),width:t().nullable(),height:t().nullable(),faces:r({status:p(["ready","not_detected"]),windows:c(r({window:r({startSec:t(),endSec:t()}),faces:c(r({faceId:e(),bbox:r({x:t(),y:t(),width:t(),height:t()}),speakingShare:t().optional()}))}))}),transcript:r({status:p(["ready","not_transcribed","unavailable"]),data:C([r({mediaItemId:e(),language:e().nullable(),model:e().nullable(),fullText:e(),utterances:c(f(e(),y())),data:c(f(e(),y())).optional(),pagination:r({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).optional().describe("Cursor pagination metadata.")}).describe("Transcript response."),L()])})}).describe("Read-only authoring context for a source media item: detected face roster + transcript."),gh=r({id:e()}),hh=r({id:e()}),yh=r({media:r({id:e(),name:e(),createdAt:e(),fileSize:t(),duration:t().nullable(),status:e()}),window:r({startIso:e(),endIso:e()}),workflowCount:t(),workflows:c(r({name:e(),startedAt:e(),durationMs:t(),activities:c(r({name:e(),startedAt:e(),durationMs:t(),service:e()}))}))}).describe("Per-media performance breakdown: every Temporal workflow + activity span (plus Modal sub-spans) that ran for the requested media item, grouped under its owning workflow by time-range containment. Backed by Axiom proxy \u2014 see the `cueframe stats` CLI subcommand.");var Dl=0,xh=r({data:c(r({id:e(),name:e(),description:e().nullable(),format:C([r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format."),L()]),brandKitId:e().nullable(),activeCompositionId:e().nullable(),composition:r({hasComposition:h(),sceneCount:t().min(Dl),duration:t().nullable(),updatedAt:e().nullable()}).describe("Summary of a project's stored composition."),lastRender:r({id:e(),status:e(),createdAt:e(),outputUrl:e().nullable(),outputExpiresAt:e().nullable()}).nullable().describe("Most recent render for a project, if any."),createdAt:e()}).describe("Project response per \xA7Projects.")),pagination:r({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),Wl=200,bh=r({name:e().min(1).max(Wl),description:e().optional(),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),brandKitId:e().min(1).optional(),width:t().optional(),height:t().optional()}).describe("POST /projects body."),Ch=r({id:e()}),Kl=0,Sh=r({id:e(),name:e(),description:e().nullable(),format:C([r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format."),L()]),brandKitId:e().nullable(),activeCompositionId:e().nullable(),composition:r({hasComposition:h(),sceneCount:t().min(Kl),duration:t().nullable(),updatedAt:e().nullable()}).describe("Summary of a project's stored composition."),lastRender:r({id:e(),status:e(),createdAt:e(),outputUrl:e().nullable(),outputExpiresAt:e().nullable()}).nullable().describe("Most recent render for a project, if any."),createdAt:e()}).describe("Project response per \xA7Projects."),vh=r({id:e()}),Ll=200,Oh=r({name:e().min(1).max(Ll).optional(),description:e().optional(),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),brandKitId:e().min(1).optional()}).describe("PATCH /projects/:id body."),$l=0,Ih=r({id:e(),name:e(),description:e().nullable(),format:C([r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).describe("Output-format spec per \xA7Format."),L()]),brandKitId:e().nullable(),activeCompositionId:e().nullable(),composition:r({hasComposition:h(),sceneCount:t().min($l),duration:t().nullable(),updatedAt:e().nullable()}).describe("Summary of a project's stored composition."),lastRender:r({id:e(),status:e(),createdAt:e(),outputUrl:e().nullable(),outputExpiresAt:e().nullable()}).nullable().describe("Most recent render for a project, if any."),createdAt:e()}).describe("Project response per \xA7Projects."),Rh=r({id:e()});var Th=r({id:e()}),wh=r({clipSuggestionId:e().min(1).optional(),compositionId:e().min(1).optional().describe("Target a specific composition in the project; defaults to the project's active composition."),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format."),priority:p(["interactive","standard","background"]).optional(),intent:p(["preview","final"]).optional(),brandKitId:e().min(1).nullish()}).describe("POST /projects/:id/renders body."),jh=r({id:e()}),Gl=0,Zl=0,Mh=r({data:c(r({id:e(),status:p(["queued","pending","rendering","complete","error","cancelled"]),progress:r({phase:p(["queued","validating","presigning","collecting-artifacts","resolving","detecting","baking-matte","translating","spawning","encoding","uploading"]),percent:t(),scenesCompleted:t().min(Gl).optional(),scenesTotal:t().min(Zl).optional()}).optional().describe("Non-terminal render progress; phase is one of the worker's emitted stages."),outputUrl:e().nullable(),outputExpiresAt:e().nullable(),error:e().nullable().describe("Human-readable failure message. Pair with `errorCode` for a stable, machine-readable code an agent runner can branch on."),errorCode:e().nullable().describe("Stable error code per docs/api-design-2026-04-14.md \xA7Error Model (e.g. `render_pipeline_unavailable`, `render_route_missing`, `render_pipeline_failed`). Null when status is not `error`, or for legacy rows that predate this field."),errorDetails:f(e(),y()).nullable().describe("Structured failure context \u2014 `{ targetUrl?, upstreamStatus?, upstreamCode?, attemptedAt? }`. Surfaced so agent runners can distinguish operator-config issues from upstream-down vs route-missing without parsing `error`."),category:C([m("authoring"),m("transient"),m("internal"),m(null)]).nullable().describe("Failure taxonomy when status is `error`; null otherwise. `authoring` = deterministic defect in YOUR composition/request \u2014 fix it, retrying is futile; `transient` = temporary pipeline/infra failure \u2014 safe to retry_render; `internal` = unexpected server fault \u2014 retry once then escalate. Mirrors the render.failed webhook's `category`."),retryable:h().nullable().describe("Whether re-attempting the SAME render can succeed (status `error`); null otherwise. true \u2192 call retry_render. false \u2192 deterministic (category authoring/internal); fix the composition first \u2014 retry_render alone reproduces it. Mirrors the render.failed webhook's `retryable`."),createdAt:e(),updatedAt:e().describe("ISO-8601 timestamp of the most recent write to this render row. For a non-terminal render (queued/pending/rendering) every status, progress, and phase patch bumps it, so it IS the last-progress heartbeat: compute staleness = now \u2212 updatedAt to tell a WEDGED render (percent frozen AND updatedAt far in the past) from a merely SLOW one (percent frozen but updatedAt recent). Use it to decide wait vs cancel vs retry."),warnings:c(e()).optional().describe("Non-fatal advisories surfaced at render-CREATE (omitted when none, and on GET \u2014 create-time only).")}).describe("Render job response per \xA7Renders.")),pagination:r({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),_h=r({id:e(),renderId:e()}),Vl=0,Hl=0,Ph=r({id:e(),status:p(["queued","pending","rendering","complete","error","cancelled"]),progress:r({phase:p(["queued","validating","presigning","collecting-artifacts","resolving","detecting","baking-matte","translating","spawning","encoding","uploading"]),percent:t(),scenesCompleted:t().min(Vl).optional(),scenesTotal:t().min(Hl).optional()}).optional().describe("Non-terminal render progress; phase is one of the worker's emitted stages."),outputUrl:e().nullable(),outputExpiresAt:e().nullable(),error:e().nullable().describe("Human-readable failure message. Pair with `errorCode` for a stable, machine-readable code an agent runner can branch on."),errorCode:e().nullable().describe("Stable error code per docs/api-design-2026-04-14.md \xA7Error Model (e.g. `render_pipeline_unavailable`, `render_route_missing`, `render_pipeline_failed`). Null when status is not `error`, or for legacy rows that predate this field."),errorDetails:f(e(),y()).nullable().describe("Structured failure context \u2014 `{ targetUrl?, upstreamStatus?, upstreamCode?, attemptedAt? }`. Surfaced so agent runners can distinguish operator-config issues from upstream-down vs route-missing without parsing `error`."),category:C([m("authoring"),m("transient"),m("internal"),m(null)]).nullable().describe("Failure taxonomy when status is `error`; null otherwise. `authoring` = deterministic defect in YOUR composition/request \u2014 fix it, retrying is futile; `transient` = temporary pipeline/infra failure \u2014 safe to retry_render; `internal` = unexpected server fault \u2014 retry once then escalate. Mirrors the render.failed webhook's `category`."),retryable:h().nullable().describe("Whether re-attempting the SAME render can succeed (status `error`); null otherwise. true \u2192 call retry_render. false \u2192 deterministic (category authoring/internal); fix the composition first \u2014 retry_render alone reproduces it. Mirrors the render.failed webhook's `retryable`."),createdAt:e(),updatedAt:e().describe("ISO-8601 timestamp of the most recent write to this render row. For a non-terminal render (queued/pending/rendering) every status, progress, and phase patch bumps it, so it IS the last-progress heartbeat: compute staleness = now \u2212 updatedAt to tell a WEDGED render (percent frozen AND updatedAt far in the past) from a merely SLOW one (percent frozen but updatedAt recent). Use it to decide wait vs cancel vs retry."),warnings:c(e()).optional().describe("Non-fatal advisories surfaced at render-CREATE (omitted when none, and on GET \u2014 create-time only).")}).describe("Render job response per \xA7Renders."),Bh=r({id:e(),renderId:e()}),Jl=0,Yl=0,Eh=r({id:e(),status:p(["queued","pending","rendering","complete","error","cancelled"]),progress:r({phase:p(["queued","validating","presigning","collecting-artifacts","resolving","detecting","baking-matte","translating","spawning","encoding","uploading"]),percent:t(),scenesCompleted:t().min(Jl).optional(),scenesTotal:t().min(Yl).optional()}).optional().describe("Non-terminal render progress; phase is one of the worker's emitted stages."),outputUrl:e().nullable(),outputExpiresAt:e().nullable(),error:e().nullable().describe("Human-readable failure message. Pair with `errorCode` for a stable, machine-readable code an agent runner can branch on."),errorCode:e().nullable().describe("Stable error code per docs/api-design-2026-04-14.md \xA7Error Model (e.g. `render_pipeline_unavailable`, `render_route_missing`, `render_pipeline_failed`). Null when status is not `error`, or for legacy rows that predate this field."),errorDetails:f(e(),y()).nullable().describe("Structured failure context \u2014 `{ targetUrl?, upstreamStatus?, upstreamCode?, attemptedAt? }`. Surfaced so agent runners can distinguish operator-config issues from upstream-down vs route-missing without parsing `error`."),category:C([m("authoring"),m("transient"),m("internal"),m(null)]).nullable().describe("Failure taxonomy when status is `error`; null otherwise. `authoring` = deterministic defect in YOUR composition/request \u2014 fix it, retrying is futile; `transient` = temporary pipeline/infra failure \u2014 safe to retry_render; `internal` = unexpected server fault \u2014 retry once then escalate. Mirrors the render.failed webhook's `category`."),retryable:h().nullable().describe("Whether re-attempting the SAME render can succeed (status `error`); null otherwise. true \u2192 call retry_render. false \u2192 deterministic (category authoring/internal); fix the composition first \u2014 retry_render alone reproduces it. Mirrors the render.failed webhook's `retryable`."),createdAt:e(),updatedAt:e().describe("ISO-8601 timestamp of the most recent write to this render row. For a non-terminal render (queued/pending/rendering) every status, progress, and phase patch bumps it, so it IS the last-progress heartbeat: compute staleness = now \u2212 updatedAt to tell a WEDGED render (percent frozen AND updatedAt far in the past) from a merely SLOW one (percent frozen but updatedAt recent). Use it to decide wait vs cancel vs retry."),warnings:c(e()).optional().describe("Non-fatal advisories surfaced at render-CREATE (omitted when none, and on GET \u2014 create-time only).")}).describe("Render job response per \xA7Renders."),Ah=r({id:e(),renderId:e()}),Fh=r({id:e(),renderId:e()}),Nh=r({outputUrl:e(),outputExpiresAt:e()}).describe("POST /refresh-url response."),qh=r({id:e(),renderId:e()});var Xl=200,Ql=50,Dh=r({query:e().min(1).max(Xl),kind:p(["video","photo","sfx","gif"]).optional(),provider:p(["pexels","pixabay","freesound","klipy"]).optional(),limit:t().max(Ql).optional()}).describe("POST /resources/search body."),Wh=r({provider:p(["pexels","pixabay","freesound","klipy"]),kind:p(["video","photo","sfx","gif"]),candidates:c(r({candidateId:e(),provider:p(["pexels","pixabay","freesound","klipy"]),kind:p(["video","photo","sfx","gif"]),thumbnail:e(),previewUrl:e(),duration:t().optional(),width:t().optional(),height:t().optional(),author:e(),authorUrl:e().optional(),assetUrl:e().optional(),license:e().optional()}).describe("A stock resource search candidate."))}).describe("POST /resources/search response."),Kh=r({projectId:e().min(1),candidateId:e().min(1)}).describe("POST /resources/import body.");var $h=r({id:e()}),Gh=r({projectId:e(),groupId:e(),selectorVersion:e(),signalVersions:f(e(),e()),moments:c(r({startSec:t().describe("Span start (output seconds)."),endSec:t().describe("Span end (output seconds)."),chosen:e().describe('The recommended candidateId, or "__hold__" (abstain).'),pacingNote:e().nullish().describe("Which mechanism produced the pick (argmax / hysteresis / override / hold \u2026)."),candidates:c(r({candidateId:e().describe("Stable angle/source id. An unknown id is rejected, never remapped."),role:e().nullish().describe('Agent-declared semantic tag (e.g. "wide", "webcam").'),score:t().describe("The weighted prominence score (\u03A3 weights\xB7signal)."),contributions:f(e(),t()).describe("signalKey \u2192 weighted contribution (the agent reweights from this)."),reasons:c(e())}))})),recommendation:r({cutSchedule:c(r({startSec:t(),endSec:t(),candidateId:e(),sourceInSec:t().describe("Chosen source window start (declared-offset resolved)."),sourceOutSec:t(),reasons:c(e())})),audioBed:c(r({startSec:t(),endSec:t(),candidateId:e().describe("The chosen audio source (the clearest mic) for this span \u2192 programAudioSourceId."),reasons:c(e())})).describe("Best-audio bed (instance #3): the clearest mic per span."),suppressedSwitches:c(r({atSec:t(),wouldHaveBeenCandidateId:e(),byScore:t(),blockedBy:e(),releaseAtSec:t().nullable()})).describe("Switches the stabilizer suppressed (the anti-ping-pong audit).")}),divergesFromComposition:h().optional()}).describe("Selector (switch) candidates + recommendation for a synced-angle group. Every candidate carries score + contributions + reasons so the agent reweights from evidence; the recommendation is the lowered cut schedule + best-audio bed."),Zh=r({id:e()}),eu=0,ou=0,tu=0,Vh=r({groupId:e().min(1),weights:f(e(),t()).optional().describe("Sparse prominence weights (the taste knob, non-negative). Default = DOMINANCE_WEIGHTS."),minHoldSec:t().optional(),enterSec:t().min(eu).optional(),switchMargin:t().min(ou).optional(),cooldownSec:t().min(tu).optional(),maxHoldSec:t().optional(),lockSourceId:e().optional().describe("Pin a camera/angle for the whole timeline."),overrides:c(r({startSec:t(),endSec:t(),candidateId:e()})).optional()}),Hh=r({projectId:e(),groupId:e(),selectorVersion:e(),signalVersions:f(e(),e()),moments:c(r({startSec:t().describe("Span start (output seconds)."),endSec:t().describe("Span end (output seconds)."),chosen:e().describe('The recommended candidateId, or "__hold__" (abstain).'),pacingNote:e().nullish().describe("Which mechanism produced the pick (argmax / hysteresis / override / hold \u2026)."),candidates:c(r({candidateId:e().describe("Stable angle/source id. An unknown id is rejected, never remapped."),role:e().nullish().describe('Agent-declared semantic tag (e.g. "wide", "webcam").'),score:t().describe("The weighted prominence score (\u03A3 weights\xB7signal)."),contributions:f(e(),t()).describe("signalKey \u2192 weighted contribution (the agent reweights from this)."),reasons:c(e())}))})),recommendation:r({cutSchedule:c(r({startSec:t(),endSec:t(),candidateId:e(),sourceInSec:t().describe("Chosen source window start (declared-offset resolved)."),sourceOutSec:t(),reasons:c(e())})),audioBed:c(r({startSec:t(),endSec:t(),candidateId:e().describe("The chosen audio source (the clearest mic) for this span \u2192 programAudioSourceId."),reasons:c(e())})).describe("Best-audio bed (instance #3): the clearest mic per span."),suppressedSwitches:c(r({atSec:t(),wouldHaveBeenCandidateId:e(),byScore:t(),blockedBy:e(),releaseAtSec:t().nullable()})).describe("Switches the stabilizer suppressed (the anti-ping-pong audit).")}),divergesFromComposition:h().optional()}).describe("Selector (switch) candidates + recommendation for a synced-angle group. Every candidate carries score + contributions + reasons so the agent reweights from evidence; the recommendation is the lowered cut schedule + best-audio bed.");var nu=0,Yh=r({data:c(r({id:e(),name:e(),fileCount:t().min(nu),muxStatus:e().nullable(),createdAt:e()}).describe("Session list summary (per list endpoint).")),pagination:r({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),ru=200,su=50,iu=20,Xh=r({name:e().min(1).max(ru),files:c(r({mediaId:e().min(1),role:e().min(1).max(su)})).min(1).max(iu)}).describe("POST /sessions body."),Qh=r({id:e()}),ey=r({id:e(),name:e(),files:c(r({mediaId:e(),role:e(),status:e().nullable()}).describe("One file member of a session, with optional role + status.")),mux:r({status:e().nullable(),jobId:e().nullable(),muxedItems:f(e(),e()).nullable(),error:e().nullable(),startedAt:e().nullable(),completedAt:e().nullable()}),createdAt:e()}).describe("Session response per \xA7Sessions."),oy=r({id:e()}),ty=r({id:e()}),ny=r({id:e()}),ry=r({jobId:e(),status:e(),workflowId:e().optional(),muxedItems:f(e(),e()).nullish(),error:e().nullish(),startedAt:e().nullish(),completedAt:e().nullish()}).describe("Mux job response.");var iy=r({skills:c(r({name:e(),title:e(),description:e()}).describe("A CueFrame agent skill (metadata)."))}).describe("GET /skills response \u2014 the available agent skills."),ay=r({name:e()});var au=0,du=0,py=r({data:c(r({id:e(),url:e().url(),events:c(p(["media.transcribed","media.ready","media.failed","media.suggestions_ready","session.mux.complete","session.mux.failed","render.complete","render.failed","render.cancelled","compose.complete","compose.failed","compose.cancelled","project.updated","composition.updated","webhook.test"])),settleMs:t().min(au),enabled:h(),createdAt:e(),lastDeliveredAt:e().nullable(),lastFailedAt:e().nullable(),consecutiveFailures:t().min(du)}).describe("Webhook endpoint record (secret omitted after create).")),pagination:r({hasMore:h(),nextCursor:e().nullable(),prevCursor:e().nullable()}).describe("Cursor pagination metadata.")}),pu=0,cu=6e4,cy=r({url:e().min(1),events:c(p(["media.transcribed","media.ready","media.failed","media.suggestions_ready","session.mux.complete","session.mux.failed","render.complete","render.failed","render.cancelled","compose.complete","compose.failed","compose.cancelled","project.updated","composition.updated","webhook.test"])).min(1),settleMs:t().min(pu).max(cu).optional()}).describe("POST /webhooks body."),my=r({id:e()}),mu=0,lu=0,ly=r({id:e(),url:e().url(),events:c(p(["media.transcribed","media.ready","media.failed","media.suggestions_ready","session.mux.complete","session.mux.failed","render.complete","render.failed","render.cancelled","compose.complete","compose.failed","compose.cancelled","project.updated","composition.updated","webhook.test"])),settleMs:t().min(mu),enabled:h(),createdAt:e(),lastDeliveredAt:e().nullable(),lastFailedAt:e().nullable(),consecutiveFailures:t().min(lu)}).describe("Webhook endpoint record (secret omitted after create)."),uy=r({id:e()}),uu=0,fu=6e4,fy=r({url:e().min(1).optional(),events:c(p(["media.transcribed","media.ready","media.failed","media.suggestions_ready","session.mux.complete","session.mux.failed","render.complete","render.failed","render.cancelled","compose.complete","compose.failed","compose.cancelled","project.updated","composition.updated","webhook.test"])).min(1).optional(),settleMs:t().min(uu).max(fu).optional(),enabled:h().optional()}).describe("PATCH /webhooks/:id body."),gu=0,hu=0,gy=r({id:e(),url:e().url(),events:c(p(["media.transcribed","media.ready","media.failed","media.suggestions_ready","session.mux.complete","session.mux.failed","render.complete","render.failed","render.cancelled","compose.complete","compose.failed","compose.cancelled","project.updated","composition.updated","webhook.test"])),settleMs:t().min(gu),enabled:h(),createdAt:e(),lastDeliveredAt:e().nullable(),lastFailedAt:e().nullable(),consecutiveFailures:t().min(hu)}).describe("Webhook endpoint record (secret omitted after create)."),hy=r({id:e()}),yy=r({id:e()});var yu=2048,xy=r({videoUrl:e().url().max(yu),format:r({aspectRatio:p(["16:9","9:16","1:1","4:5"]),fps:C([t(),t(),t()]).optional(),resolution:p(["hd","fhd","4k"]).optional()}).optional().describe("Output-format spec per \xA7Format.")});import{readFileSync as xu,writeFileSync as bu,mkdirSync as Cu,existsSync as Su}from"fs";import{join as tt}from"path";import{homedir as vu}from"os";var nt=tt(vu(),".cueframe"),Ve=tt(nt,"auth.json"),we={local:"http://127.0.0.1:3211",dev:"https://api-dev.cueframe.ai",prod:"https://api.cueframe.ai"},Ou="prod";function ZM(n=Ou){return process.env.CUEFRAME_API_URL??we[n]??we.prod}function rt(){return Su(Ve)?JSON.parse(xu(Ve,"utf-8")):{targets:{}}}function Iu(n){Cu(nt,{recursive:!0}),bu(Ve,JSON.stringify(n,null,2))}function VM(n,o="prod",s){let i=rt(),a=we[o]??we.prod;i.targets[o]={apiKey:n,apiUrl:s??a},Iu(i)}function st(n="prod"){let o=process.env.CUEFRAME_API_KEY,s=process.env.CUEFRAME_API_URL;if(o)return{apiKey:o,apiUrl:s??we[n]??we.prod};let a=rt().targets[n];return a||(console.error(`No auth configured for target "${n}". Run: cueframe auth <api-key> --target ${n}`),process.exit(1)),a}function it(n){let{apiKey:o,apiUrl:s}=st(n);We({baseUrl:s,apiKey:o})}function at(n){let o=n instanceof N?`${n.message} (${n.code}${n.status?`, ${n.status}`:""})`:n instanceof Error?n.message:String(n),s=Le(n);return s?`${o}
|
|
9
|
-
\u2192 ${s}`:o}var F={Success:0,UserError:2,ApiClientError:3,ApiServerError:4,NetworkError:5,PaymentRequired:6};function He(n){if(n instanceof N){if(n.status===402)return F.PaymentRequired;if(n.status>=500)return F.ApiServerError;if(n.status>=400)return F.ApiClientError}return F.NetworkError}function e0(n){return n===402?F.PaymentRequired:n>=500?F.ApiServerError:n>=400?F.ApiClientError:F.Success}function Ee(n){process.exit(n)}import Ru from"ora";import ku from"pino";var Tu="v1",dt=ku({level:"trace",base:{schemaVersion:Tu},messageKey:"event",timestamp:()=>`,"ts":${Date.now()}`,formatters:{level:()=>({_:0})}});function Je(n,o){return Ru({text:n,isSilent:!!o}).start()}function je(n,o,s={}){n.json&&dt.info(s,o)}function r0(n,o,s){if(n.json){console.log(JSON.stringify(o,null,2));return}s()}function Ae(n,o,s,i){let a=s instanceof Error?s.message:String(s),d=typeof s?.code=="string"?s.code:void 0,l=s?.status;n.json?dt.info({phase:o,message:a,...d?{code:d}:{},...typeof l=="number"?{status:l}:{},exitCode:i},"error"):process.stderr.write(`\u2716 ${o}: ${a}
|
|
10
|
-
`)}function s0(n,o){o.json||console.log(n)}function wu(n){for(let o=0;o<n.length;o++){let s=n.charCodeAt(o);if(s<=31||s===127)return!0}return!1}function ct(n,o,s){n.length===0&&pt(`${o} is empty.`,s),wu(n)&&pt(`${o} contains a control character (newline, tab, or null byte). Identifiers must be plain text \u2014 check for a stray copy-paste artifact.`,s)}function pt(n,o){Ae(o,"preflight",new Error(n),F.UserError),Ee(F.UserError)}var ju=5e3,Ye=300*1e3;async function g0(n,o){if(ct(n,"mediaItemId",o),o.dryRun){je(o,"analyze_dry_run",{mediaItemId:n,target:o.target,wait:!!o.wait,wouldCall:"POST /v1/media/:id/suggestions"}),o.json||console.log(`[dry-run] Would trigger clip analysis for ${n} on ${o.target}.`);return}it(o.target),je(o,"analyze_prepare",{mediaItemId:n,target:o.target,wait:!!o.wait});let s=Je("Triggering clip analysis\u2026",o.json),i;try{i=await Me.triggerMediaSuggestions(n),s.succeed(i.workflowId?`Analysis started (workflow: ${i.workflowId})`:`Analysis ${i.alreadyRunning?"already running":"started"}`)}catch(l){s.fail(`Failed to start analysis: ${at(l)}`),Ae(o,"analyze_prepare",l,He(l)),Ee(He(l))}if(je(o,"analyze_ready",{mediaItemId:n,workflowId:i.workflowId,alreadyRunning:!!i.alreadyRunning}),!o.wait){o.json||console.log(`
|
|
11
|
-
Run \`cueframe clips ${n}\` to check results.`);return}let a=Je("Waiting for analysis to complete\u2026",o.json),d=Date.now();for(;;){await new Promise(l=>setTimeout(l,ju)),Date.now()-d>Ye&&(a.fail(`Timed out after ${Math.round(Ye/1e3)}s. Run \`cueframe clips ${n}\` to check later.`),Ae(o,"analyze_progress",new Error(`Analysis did not complete within ${Math.round(Ye/1e3)}s`),F.UserError),Ee(F.UserError));try{let l=await Me.listMediaSuggestions(n);if(l.suggestions.length>0){a.succeed(`Analysis complete \u2014 ${l.suggestions.length} clips found`),je(o,"analyze_complete",{mediaItemId:n,durationMs:Date.now()-d,suggestionCount:l.suggestions.length,suggestions:l.suggestions}),o.json||l.suggestions.forEach((z,b)=>{let R=(z.trim.end-z.trim.start).toFixed(1);console.log(`
|
|
12
|
-
${b+1}. ${z.title} (${z.id})`),console.log(` ${z.trim.start.toFixed(1)}s \u2013 ${z.trim.end.toFixed(1)}s (${R}s) score: ${z.score}`),console.log(` ${z.reason}`)});return}let u=Math.round((Date.now()-d)/1e3);a.text=`Waiting for analysis\u2026 (${u}s)`,je(o,"analyze_progress",{mediaItemId:n,elapsedSec:u})}catch{}}}export{Je as a,je as b,r0 as c,Ae as d,s0 as e,N as f,We as g,Ke as h,Qe as i,O as j,Le as k,yt as l,mo as m,yo as n,Io as o,wo as p,Ao as q,Wo as r,Me as s,ot as t,F as u,He as v,e0 as w,Ee as x,ct as y,ZM as z,VM as A,it as B,at as C,g0 as D};
|