@shotstack/cli 0.7.0 → 0.7.1

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/shotstack.js CHANGED
@@ -20,7 +20,7 @@ Expecting one of '${t.join("', '")}'`);if(this._lifeCycleHooks[r])this._lifeCycl
20
20
  `),this.outputHelp({error:!0});let t=i||{},o=t.exitCode||1,n=t.code||"commander.error";this._exit(o,n,r)}_parseOptionsEnv(){this.options.forEach((r)=>{if(r.envVar&&r.envVar in Q.env){let i=r.attributeName();if(this.getOptionValue(i)===void 0||["default","config","env"].includes(this.getOptionValueSource(i)))if(r.required||r.optional)this.emit(`optionEnv:${r.name()}`,Q.env[r.envVar]);else this.emit(`optionEnv:${r.name()}`)}})}_parseOptionsImplied(){let r=new uU(this.options),i=(t)=>{return this.getOptionValue(t)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(t))};this.options.filter((t)=>t.implied!==void 0&&i(t.attributeName())&&r.valueFromOption(this.getOptionValue(t.attributeName()),t)).forEach((t)=>{Object.keys(t.implied).filter((o)=>!i(o)).forEach((o)=>{this.setOptionValueWithSource(o,t.implied[o],"implied")})})}missingArgument(r){let i=`error: missing required argument '${r}'`;this.error(i,{code:"commander.missingArgument"})}optionMissingArgument(r){let i=`error: option '${r.flags}' argument missing`;this.error(i,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(r){let i=`error: required option '${r.flags}' not specified`;this.error(i,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(r,i){let t=($)=>{let g=$.attributeName(),I=this.getOptionValue(g),c=this.options.find((b)=>b.negate&&g===b.attributeName()),_=this.options.find((b)=>!b.negate&&g===b.attributeName());if(c&&(c.presetArg===void 0&&I===!1||c.presetArg!==void 0&&I===c.presetArg))return c;return _||$},o=($)=>{let g=t($),I=g.attributeName();if(this.getOptionValueSource(I)==="env")return`environment variable '${g.envVar}'`;return`option '${g.flags}'`},n=`error: ${o(r)} cannot be used with ${o(i)}`;this.error(n,{code:"commander.conflictingOption"})}unknownOption(r){if(this._allowUnknownOption)return;let i="";if(r.startsWith("--")&&this._showSuggestionAfterError){let o=[],n=this;do{let $=n.createHelp().visibleOptions(n).filter((g)=>g.long).map((g)=>g.long);o=o.concat($),n=n.parent}while(n&&!n._enablePositionalOptions);i=N6(r,o)}let t=`error: unknown option '${r}'${i}`;this.error(t,{code:"commander.unknownOption"})}_excessArguments(r){if(this._allowExcessArguments)return;let i=this.registeredArguments.length,t=i===1?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${i} argument${t} but got ${r.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){let r=this.args[0],i="";if(this._showSuggestionAfterError){let o=[];this.createHelp().visibleCommands(this).forEach((n)=>{if(o.push(n.name()),n.alias())o.push(n.alias())}),i=N6(r,o)}let t=`error: unknown command '${r}'${i}`;this.error(t,{code:"commander.unknownCommand"})}version(r,i,t){if(r===void 0)return this._version;this._version=r,i=i||"-V, --version",t=t||"output the version number";let o=this.createOption(i,t);return this._versionOptionName=o.attributeName(),this._registerOption(o),this.on("option:"+o.name(),()=>{this._outputConfiguration.writeOut(`${r}
21
21
  `),this._exit(0,"commander.version",r)}),this}description(r,i){if(r===void 0&&i===void 0)return this._description;if(this._description=r,i)this._argsDescription=i;return this}summary(r){if(r===void 0)return this._summary;return this._summary=r,this}alias(r){if(r===void 0)return this._aliases[0];let i=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)i=this.commands[this.commands.length-1];if(r===i._name)throw Error("Command alias can't be the same as its name");let t=this.parent?._findCommand(r);if(t){let o=[t.name()].concat(t.aliases()).join("|");throw Error(`cannot add alias '${r}' to command '${this.name()}' as already have command '${o}'`)}return i._aliases.push(r),this}aliases(r){if(r===void 0)return this._aliases;return r.forEach((i)=>this.alias(i)),this}usage(r){if(r===void 0){if(this._usage)return this._usage;let i=this.registeredArguments.map((t)=>{return tU(t)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?i:[]).join(" ")}return this._usage=r,this}name(r){if(r===void 0)return this._name;return this._name=r,this}nameFromFilename(r){return this._name=Ur.basename(r,Ur.extname(r)),this}executableDir(r){if(r===void 0)return this._executableDir;return this._executableDir=r,this}helpInformation(r){let i=this.createHelp();if(i.helpWidth===void 0)i.helpWidth=r&&r.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth();return i.formatHelp(this,i)}_getHelpContext(r){r=r||{};let i={error:!!r.error},t;if(i.error)t=(o)=>this._outputConfiguration.writeErr(o);else t=(o)=>this._outputConfiguration.writeOut(o);return i.write=r.write||t,i.command=this,i}outputHelp(r){let i;if(typeof r==="function")i=r,r=void 0;let t=this._getHelpContext(r);this._getCommandAndAncestors().reverse().forEach((n)=>n.emit("beforeAllHelp",t)),this.emit("beforeHelp",t);let o=this.helpInformation(t);if(i){if(o=i(o),typeof o!=="string"&&!Buffer.isBuffer(o))throw Error("outputHelp callback must return a string or a Buffer")}if(t.write(o),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",t),this._getCommandAndAncestors().forEach((n)=>n.emit("afterAllHelp",t))}helpOption(r,i){if(typeof r==="boolean"){if(r)this._helpOption=this._helpOption??void 0;else this._helpOption=null;return this}return r=r??"-h, --help",i=i??"display help for command",this._helpOption=this.createOption(r,i),this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(r){return this._helpOption=r,this}help(r){this.outputHelp(r);let i=Q.exitCode||0;if(i===0&&r&&typeof r!=="function"&&r.error)i=1;this._exit(i,"commander.help","(outputHelp)")}addHelpText(r,i){let t=["beforeAll","before","after","afterAll"];if(!t.includes(r))throw Error(`Unexpected value for position to addHelpText.
22
22
  Expecting one of '${t.join("', '")}'`);let o=`${r}Help`;return this.on(o,(n)=>{let $;if(typeof i==="function")$=i({error:n.error,command:n.command});else $=i;if($)n.write(`${$}
23
- `)}),this}_outputHelpIfRequested(r){let i=this._getHelpOption();if(i&&r.find((o)=>i.is(o)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function j6(r){return r.map((i)=>{if(!i.startsWith("--inspect"))return i;let t,o="127.0.0.1",n="9229",$;if(($=i.match(/^(--inspect(-brk)?)$/))!==null)t=$[1];else if(($=i.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(t=$[1],/^\d+$/.test($[3]))n=$[3];else o=$[3];else if(($=i.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)t=$[1],o=$[3],n=$[4];if(t&&n!=="0")return`${t}=${o}:${parseInt(n)+1}`;return i})}oU.Command=st});var O6=Or((_U)=>{var{Argument:J6}=Ii(),{Command:r$}=P6(),{CommanderError:IU,InvalidArgumentError:L6}=Jn(),{Help:cU}=dt(),{Option:E6}=ht();_U.program=new r$;_U.createCommand=(r)=>new r$(r);_U.createOption=(r,i)=>new E6(r,i);_U.createArgument=(r,i)=>new J6(r,i);_U.Command=r$;_U.Option=E6;_U.Argument=J6;_U.Help=cU;_U.CommanderError=IU;_U.InvalidArgumentError=L6;_U.InvalidOptionArgumentError=L6});var G6=qb(O6(),1),{program:MS,createCommand:RS,createArgument:xS,createOption:fS,CommanderError:ZS,InvalidArgumentError:CS,InvalidOptionArgumentError:mS,Command:K,Argument:yS,Option:dS,Help:hS}=G6.default;import{readFile as Aw}from"node:fs/promises";import{resolve as Fw}from"node:path";var X6={name:"@shotstack/cli",version:"0.7.0",description:"Command-line interface for the Shotstack video rendering API.",license:"Apache-2.0",homepage:"https://github.com/shotstack/shotstack-cli",repository:{type:"git",url:"git+https://github.com/shotstack/shotstack-cli.git"},bugs:{url:"https://github.com/shotstack/shotstack-cli/issues"},type:"module",bin:{shotstack:"dist/shotstack.js"},files:["dist/shotstack.js","skills"],scripts:{start:"bun run src/index.ts",build:"bun build src/index.ts --target=node --minify --outfile=dist/shotstack.js --banner='#!/usr/bin/env node' && chmod +x dist/shotstack.js",prepack:"bun run build",typecheck:"tsc --noEmit",test:"bun test"},dependencies:{"@shotstack/schemas":"^1.12.2",commander:"^12.1.0",zod:"^4.4.3"},devDependencies:{"@types/bun":"latest",typescript:"^5.6.0"}};var Ln=X6.version,W6=`shotstack-cli/${Ln} (${process.platform}-${process.arch})`;class lr extends Error{status;body;constructor(r,i,t){super(t);this.status=r;this.body=i;this.name="ApiError"}get isTransient(){return this.status>=500||this.status===429}}function rr(r){let i=r.env.baseUrl.replace(/\/$/,"");async function t(o,n,$){let g=await fetch(`${i}${n}`,{method:o,headers:{"x-api-key":r.apiKey,"x-shotstack-origin":"cli","x-shotstack-environment":r.env.name,"user-agent":W6,...$!==void 0?{"content-type":"application/json"}:{}},body:$!==void 0?JSON.stringify($):void 0}),I=await g.text(),c=I?JU(I):void 0;if(!g.ok)throw new lr(g.status,c??I,`${o} ${n} → ${g.status} ${g.statusText}`);return c}return{post:(o,n)=>t("POST",o,n),get:(o)=>t("GET",o),del:(o)=>t("DELETE",o)}}function JU(r){try{return JSON.parse(r)}catch{return r}}import{mkdir as LU,writeFile as EU,chmod as OU}from"node:fs/promises";import{readFileSync as GU}from"node:fs";import{join as n$,dirname as XU}from"node:path";import{homedir as q6}from"node:os";function Mr(){if(process.platform==="win32"){let r=process.env.APPDATA??n$(q6(),"AppData","Roaming");return n$(r,"shotstack","credentials.json")}return n$(q6(),".shotstack","credentials.json")}function i$(r){try{let i=JSON.parse(GU(r,"utf8"));if(i&&typeof i==="object"&&!Array.isArray(i))return i}catch{}return{}}function Y6(r,i=Mr()){return i$(i)[r]?.trim()||void 0}async function T6(r,i,t=Mr()){let o=i$(t);o[r]=i.trim(),await t$(t,o)}async function Q6(r,i=Mr()){let t=i$(i);if(!(r in t))return!1;return delete t[r],await t$(i,t),!0}async function V6(r=Mr()){await t$(r,{})}async function t$(r,i){await LU(XU(r),{recursive:!0,mode:448}),await EU(r,JSON.stringify(i,null,2)+`
23
+ `)}),this}_outputHelpIfRequested(r){let i=this._getHelpOption();if(i&&r.find((o)=>i.is(o)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function j6(r){return r.map((i)=>{if(!i.startsWith("--inspect"))return i;let t,o="127.0.0.1",n="9229",$;if(($=i.match(/^(--inspect(-brk)?)$/))!==null)t=$[1];else if(($=i.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(t=$[1],/^\d+$/.test($[3]))n=$[3];else o=$[3];else if(($=i.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)t=$[1],o=$[3],n=$[4];if(t&&n!=="0")return`${t}=${o}:${parseInt(n)+1}`;return i})}oU.Command=st});var O6=Or((_U)=>{var{Argument:J6}=Ii(),{Command:r$}=P6(),{CommanderError:IU,InvalidArgumentError:L6}=Jn(),{Help:cU}=dt(),{Option:E6}=ht();_U.program=new r$;_U.createCommand=(r)=>new r$(r);_U.createOption=(r,i)=>new E6(r,i);_U.createArgument=(r,i)=>new J6(r,i);_U.Command=r$;_U.Option=E6;_U.Argument=J6;_U.Help=cU;_U.CommanderError=IU;_U.InvalidArgumentError=L6;_U.InvalidOptionArgumentError=L6});var G6=qb(O6(),1),{program:MS,createCommand:RS,createArgument:xS,createOption:fS,CommanderError:ZS,InvalidArgumentError:CS,InvalidOptionArgumentError:mS,Command:K,Argument:yS,Option:dS,Help:hS}=G6.default;import{readFile as Aw}from"node:fs/promises";import{resolve as Fw}from"node:path";var X6={name:"@shotstack/cli",version:"0.7.1",description:"Command-line interface for the Shotstack video rendering API.",license:"Apache-2.0",homepage:"https://github.com/shotstack/shotstack-cli",repository:{type:"git",url:"git+https://github.com/shotstack/shotstack-cli.git"},bugs:{url:"https://github.com/shotstack/shotstack-cli/issues"},type:"module",bin:{shotstack:"dist/shotstack.js"},files:["dist/shotstack.js","skills"],scripts:{start:"bun run src/index.ts",build:"bun build src/index.ts --target=node --minify --outfile=dist/shotstack.js --banner='#!/usr/bin/env node' && chmod +x dist/shotstack.js",prepack:"bun run build",typecheck:"tsc --noEmit",test:"bun test"},dependencies:{"@shotstack/schemas":"^1.12.2",commander:"^12.1.0",zod:"^4.4.3"},devDependencies:{"@types/bun":"latest",typescript:"^5.6.0"}};var Ln=X6.version,W6=`shotstack-cli/${Ln} (${process.platform}-${process.arch})`;class lr extends Error{status;body;constructor(r,i,t){super(t);this.status=r;this.body=i;this.name="ApiError"}get isTransient(){return this.status>=500||this.status===429}}function rr(r){let i=r.env.baseUrl.replace(/\/$/,"");async function t(o,n,$){let g=await fetch(`${i}${n}`,{method:o,headers:{"x-api-key":r.apiKey,"x-shotstack-origin":"cli","x-shotstack-environment":r.env.name,"user-agent":W6,...$!==void 0?{"content-type":"application/json"}:{}},body:$!==void 0?JSON.stringify($):void 0}),I=await g.text(),c=I?JU(I):void 0;if(!g.ok)throw new lr(g.status,c??I,`${o} ${n} → ${g.status} ${g.statusText}`);return c}return{post:(o,n)=>t("POST",o,n),get:(o)=>t("GET",o),del:(o)=>t("DELETE",o)}}function JU(r){try{return JSON.parse(r)}catch{return r}}import{mkdir as LU,writeFile as EU,chmod as OU}from"node:fs/promises";import{readFileSync as GU}from"node:fs";import{join as n$,dirname as XU}from"node:path";import{homedir as q6}from"node:os";function Mr(){if(process.platform==="win32"){let r=process.env.APPDATA??n$(q6(),"AppData","Roaming");return n$(r,"shotstack","credentials.json")}return n$(q6(),".shotstack","credentials.json")}function i$(r){try{let i=JSON.parse(GU(r,"utf8"));if(i&&typeof i==="object"&&!Array.isArray(i))return i}catch{}return{}}function Y6(r,i=Mr()){return i$(i)[r]?.trim()||void 0}async function T6(r,i,t=Mr()){let o=i$(t);o[r]=i.trim(),await t$(t,o)}async function Q6(r,i=Mr()){let t=i$(i);if(!(r in t))return!1;return delete t[r],await t$(i,t),!0}async function V6(r=Mr()){await t$(r,{})}async function t$(r,i){await LU(XU(r),{recursive:!0,mode:448}),await EU(r,JSON.stringify(i,null,2)+`
24
24
  `,{mode:384}),await OU(r,384).catch(()=>{})}class Rr extends Error{constructor(r){let i=r?` for env "${r}"`:"",t=r?`shotstack login --env ${r}`:"shotstack login";super(`No Shotstack API key found${i}. Run \`${t}\` to save one, or set SHOTSTACK_API_KEY. Get a key at https://shotstack.io.`);this.name="MissingApiKeyError"}}function nr(r,i){let t=process.env.SHOTSTACK_API_KEY?.trim();if(t)return t;let o=Y6(r,i);if(o)return o;throw new Rr(r)}var M=["dev","stage","v1"];class xr extends Error{constructor(r){super(`Invalid environment "${r}". Use one of: ${M.join(", ")}.`);this.name="InvalidEnvError"}}function ci(r){let i=r??process.env.SHOTSTACK_ENV?.trim()??"v1";if(!qU(i))throw new xr(i);return i}function ir(r,i="edit"){let t=WU(i);if(t)return{name:"custom",baseUrl:t};let o=ci(r);return{name:o,baseUrl:`https://api.shotstack.io/${i}/${o}`}}function WU(r){return(r==="ingest"?process.env.SHOTSTACK_INGEST_BASE_URL:process.env.SHOTSTACK_API_BASE_URL)?.trim()||void 0}function qU(r){return M.includes(r)}function B(r){if(r==="json")return"json";return"text"}function R(r,i,t){if(r==="json")console.log(JSON.stringify(i));else console.log(t)}import{mkdir as YU,appendFile as TU,stat as A6,readFile as QU,writeFile as F6}from"node:fs/promises";import{join as $$,dirname as VU}from"node:path";import{homedir as H6}from"node:os";var HU=1e6,KU=500000,K6=2000;function _i(){if(process.platform==="win32"){let r=process.env.APPDATA??$$(H6(),"AppData","Roaming");return $$(r,"shotstack","log.jsonl")}return $$(H6(),".shotstack","log.jsonl")}function BU(r,i=new Date){let t={ts:i.toISOString(),cmd:r.cmd,args:r.args.map(ZU),exit:r.exit,durationMs:r.durationMs};if(r.renderId)t.renderId=r.renderId;if(r.response!==void 0)t.response=mU(u$(r.response));if(r.error)t.error=AU(r.error);return t}function AU(r){return{name:r.name,message:typeof r.message==="string"?o$(r.message):String(r.message)}}function FU(r){if(r instanceof Error)return{name:r.name,message:r.message};if(r===void 0||r===null)return;return{name:"Unknown",message:String(r)}}async function B6(r,i=_i()){let t=BU(r),o=JSON.stringify(t)+`
25
25
  `;if(await YU(VU(i),{recursive:!0,mode:448}),!await MU(i))await F6(i,"",{mode:384});await TU(i,o),await RU(i)}async function MU(r){try{return await A6(r),!0}catch{return!1}}async function RU(r){let i=await A6(r).catch(()=>null);if(!i||i.size<=HU)return;let t=await QU(r),o=t.subarray(Math.max(0,t.length-KU)),n=o.indexOf(10),$=n>=0?o.subarray(n+1):o;await F6(r,$,{mode:384})}var xU=/^https?:\/\//i,fU=/(https?:\/\/[^\s'"<>?]+)\?[^\s'"<>]*?(?:Signature|X-Amz-[A-Za-z0-9-]+|x-amz-security-token)=[^\s'"<>]*/gi;function o$(r){return r.replace(fU,"$1?[redacted-signed]")}function ZU(r){if(typeof r!=="string")return r;if(r.startsWith("-"))return r;if(xU.test(r))return o$(r);if(/[\/\\]/.test(r))return CU(r);return r}function CU(r){let i=r.split(/[\/\\]/);return i[i.length-1]||r}function u$(r){if(typeof r==="string")return o$(r);if(Array.isArray(r))return r.map(u$);if(r&&typeof r==="object"){let i={};for(let[t,o]of Object.entries(r))i[t]=u$(o);return i}return r}function mU(r){let i=JSON.stringify(r);if(i===void 0||i.length<=K6)return r;return i.slice(0,K6)+"...[truncated]"}async function tr(r,i,t){let o=Date.now();try{let n=await t(),$=n.exitCode??0;if(await B6({cmd:r,args:i,exit:$,durationMs:Date.now()-o,renderId:n.renderId,response:n.response}).catch(()=>{}),$!==0)process.exit($)}catch(n){let $=yU(n),g=n instanceof lr?n.body:void 0;throw await B6({cmd:r,args:i,exit:$,durationMs:Date.now()-o,response:g,error:FU(n)}).catch(()=>{}),n}}function yU(r){if(r instanceof lr)return r.isTransient?2:1;if(r instanceof Rr||r instanceof xr)return 1;if(r instanceof Error&&r.code==="ENOENT")return 1;return 2}function $r(r){let i=process.argv.slice(2),t=i.indexOf(r);return t>=0?i.slice(t+1):i}var dU=new Set(["done","failed"]),hU=3000,M6=new K("status").description("Poll the status of a Shotstack render").argument("<id>","Render ID returned by `shotstack render`").option("--watch","Poll continuously until the render reaches a terminal state").option("--env <name>",`Environment: ${M.join(" | ")}`).option("--output <format>","Output format: text | json","text").action(async(r,i)=>{await tr("status",$r("status"),async()=>{let t=B(i.output),o=ir(i.env),n=nr(o.name),$=rr({apiKey:n,env:o}),g=await g$($,r,t,i.watch===!0),I=g.status==="failed"?1:0;return{renderId:g.id,response:g,exitCode:I}})});async function g$(r,i,t,o){while(!0){let $=(await r.get(`/render/${encodeURIComponent(i)}`)).response;if(R(t,$,vU($)),!o||dU.has($.status))return $;await aU(hU)}}function vU(r){let i=[r.status];if(r.url)i.push(r.url);if(r.error)i.push(`error: ${r.error}`);return i.join(" ")}function aU(r){return new Promise((i)=>setTimeout(i,r))}var u={};br(u,{xor:()=>S_,xid:()=>Rc,void:()=>U_,uuidv7:()=>Qc,uuidv6:()=>Tc,uuidv4:()=>Yc,uuid:()=>qc,util:()=>z,url:()=>Vc,uppercase:()=>rn,unknown:()=>Hr,union:()=>At,undefined:()=>__,ulid:()=>Mc,uint64:()=>I_,uint32:()=>u_,tuple:()=>q4,trim:()=>gn,treeifyError:()=>N$,transform:()=>Mt,toUpperCase:()=>cn,toLowerCase:()=>In,toJSONSchema:()=>bt,templateLiteral:()=>T_,symbol:()=>c_,superRefine:()=>$6,success:()=>X_,stringbool:()=>M_,stringFormat:()=>pc,string:()=>dn,strictObject:()=>D_,startsWith:()=>tn,slugify:()=>_n,size:()=>Tr,setErrorMap:()=>Yk,set:()=>J_,safeParseAsync:()=>$4,safeParse:()=>t4,safeEncodeAsync:()=>b4,safeEncode:()=>c4,safeDecodeAsync:()=>U4,safeDecode:()=>_4,registry:()=>Ki,regexes:()=>h,regex:()=>pr,refine:()=>t6,record:()=>Y4,readonly:()=>a4,property:()=>gt,promise:()=>Q_,prettifyError:()=>j$,preprocess:()=>x_,prefault:()=>f4,positive:()=>tt,pipe:()=>St,partialRecord:()=>N_,parseAsync:()=>i4,parse:()=>n4,overwrite:()=>p,optional:()=>vn,object:()=>k_,number:()=>e4,nullish:()=>G_,nullable:()=>an,null:()=>z4,normalize:()=>on,nonpositive:()=>ut,nonoptional:()=>Z4,nonnegative:()=>ot,never:()=>Bt,negative:()=>$t,nativeEnum:()=>L_,nanoid:()=>Bc,nan:()=>W_,multipleOf:()=>jr,minSize:()=>Ir,minLength:()=>kr,mime:()=>un,meta:()=>A_,maxSize:()=>Pr,maxLength:()=>Qr,map:()=>P_,mac:()=>Zc,lte:()=>v,lt:()=>or,lowercase:()=>sr,looseRecord:()=>j_,looseObject:()=>w_,locales:()=>Zn,literal:()=>E_,length:()=>Vr,lazy:()=>r6,ksuid:()=>xc,keyof:()=>e_,jwt:()=>ac,json:()=>R_,iso:()=>ln,ipv6:()=>Cc,ipv4:()=>fc,invertCodec:()=>Y_,intersection:()=>X4,int64:()=>g_,int32:()=>$_,int:()=>wt,instanceof:()=>F_,includes:()=>nn,httpUrl:()=>Hc,hostname:()=>sc,hex:()=>r_,hash:()=>n_,guid:()=>Wc,gte:()=>Z,gt:()=>gr,globalRegistry:()=>A,getErrorMap:()=>Tk,function:()=>V_,fromJSONSchema:()=>Z_,formatError:()=>Qn,float64:()=>t_,float32:()=>i_,flattenError:()=>Tn,file:()=>O_,exactOptional:()=>A4,enum:()=>Ft,endsWith:()=>$n,encodeAsync:()=>g4,encode:()=>u4,emoji:()=>Kc,email:()=>Xc,e164:()=>vc,discriminatedUnion:()=>z_,describe:()=>B_,decodeAsync:()=>I4,decode:()=>o4,date:()=>l_,custom:()=>K_,cuid2:()=>Fc,cuid:()=>Ac,core:()=>Dr,config:()=>V,coerce:()=>o6,codec:()=>q_,clone:()=>x,cidrv6:()=>yc,cidrv4:()=>mc,check:()=>H_,catch:()=>y4,boolean:()=>k4,bigint:()=>o_,base64url:()=>hc,base64:()=>dc,array:()=>ni,any:()=>b_,_function:()=>V_,_default:()=>R4,_ZodString:()=>zt,ZodXor:()=>E4,ZodXID:()=>Ot,ZodVoid:()=>J4,ZodUnknown:()=>j4,ZodUnion:()=>ti,ZodUndefined:()=>w4,ZodUUID:()=>cr,ZodURL:()=>sn,ZodULID:()=>Et,ZodType:()=>L,ZodTuple:()=>W4,ZodTransform:()=>K4,ZodTemplateLiteral:()=>p4,ZodSymbol:()=>D4,ZodSuccess:()=>C4,ZodStringFormat:()=>q,ZodString:()=>Dn,ZodSet:()=>Q4,ZodRecord:()=>en,ZodRealError:()=>d,ZodReadonly:()=>v4,ZodPromise:()=>n6,ZodPreprocess:()=>h4,ZodPrefault:()=>x4,ZodPipe:()=>$i,ZodOptional:()=>Rt,ZodObject:()=>ii,ZodNumberFormat:()=>Kr,ZodNumber:()=>Sn,ZodNullable:()=>F4,ZodNull:()=>S4,ZodNonOptional:()=>xt,ZodNever:()=>P4,ZodNanoID:()=>Pt,ZodNaN:()=>d4,ZodMap:()=>T4,ZodMAC:()=>l4,ZodLiteral:()=>V4,ZodLazy:()=>s4,ZodKSUID:()=>Gt,ZodJWT:()=>Ht,ZodIssueCode:()=>qk,ZodIntersection:()=>G4,ZodISOTime:()=>kt,ZodISODuration:()=>Dt,ZodISODateTime:()=>lt,ZodISODate:()=>et,ZodIPv6:()=>Wt,ZodIPv4:()=>Xt,ZodGUID:()=>hn,ZodFunction:()=>i6,ZodFirstPartyTypeKind:()=>u6,ZodFile:()=>H4,ZodExactOptional:()=>B4,ZodError:()=>Xk,ZodEnum:()=>kn,ZodEmoji:()=>jt,ZodEmail:()=>Nt,ZodE164:()=>Vt,ZodDiscriminatedUnion:()=>O4,ZodDefault:()=>M4,ZodDate:()=>ri,ZodCustomStringFormat:()=>wn,ZodCustom:()=>oi,ZodCodec:()=>ui,ZodCatch:()=>m4,ZodCUID2:()=>Lt,ZodCUID:()=>Jt,ZodCIDRv6:()=>Yt,ZodCIDRv4:()=>qt,ZodBoolean:()=>zn,ZodBigIntFormat:()=>Kt,ZodBigInt:()=>Nn,ZodBase64URL:()=>Qt,ZodBase64:()=>Tt,ZodArray:()=>L4,ZodAny:()=>N4,TimePrecision:()=>qg,NEVER:()=>I$,$output:()=>Lg,$input:()=>Eg,$brand:()=>c$});var Dr={};br(Dr,{version:()=>wu,util:()=>z,treeifyError:()=>N$,toJSONSchema:()=>bt,toDotPath:()=>y6,safeParseAsync:()=>J$,safeParse:()=>P$,safeEncodeAsync:()=>ql,safeEncode:()=>Xl,safeDecodeAsync:()=>Yl,safeDecode:()=>Wl,registry:()=>Ki,regexes:()=>h,process:()=>X,prettifyError:()=>j$,parseAsync:()=>ei,parse:()=>li,meta:()=>_I,locales:()=>Zn,isValidJWT:()=>kc,isValidBase64URL:()=>ec,isValidBase64:()=>Fu,initializeContext:()=>Jr,globalRegistry:()=>A,globalConfig:()=>Gr,formatError:()=>Qn,flattenError:()=>Tn,finalize:()=>Er,extractDefs:()=>Lr,encodeAsync:()=>Ol,encode:()=>Ll,describe:()=>cI,decodeAsync:()=>Gl,decode:()=>El,createToJSONSchemaMethod:()=>UI,createStandardJSONSchemaMethod:()=>Un,config:()=>V,clone:()=>x,_xor:()=>$k,_xid:()=>yi,_void:()=>rI,_uuidv7:()=>Ri,_uuidv6:()=>Mi,_uuidv4:()=>Fi,_uuid:()=>Ai,_url:()=>mn,_uppercase:()=>rn,_unknown:()=>pg,_union:()=>tk,_undefined:()=>hg,_ulid:()=>mi,_uint64:()=>yg,_uint32:()=>Rg,_tuple:()=>gk,_trim:()=>gn,_transform:()=>ek,_toUpperCase:()=>cn,_toLowerCase:()=>In,_templateLiteral:()=>Jk,_symbol:()=>dg,_superRefine:()=>II,_success:()=>zk,_stringbool:()=>bI,_stringFormat:()=>bn,_string:()=>Gg,_startsWith:()=>tn,_slugify:()=>_n,_size:()=>Tr,_set:()=>_k,_safeParseAsync:()=>hr,_safeParse:()=>dr,_safeEncodeAsync:()=>ji,_safeEncode:()=>zi,_safeDecodeAsync:()=>Pi,_safeDecode:()=>Ni,_regex:()=>pr,_refine:()=>gI,_record:()=>Ik,_readonly:()=>Pk,_property:()=>gt,_promise:()=>Ek,_positive:()=>tt,_pipe:()=>jk,_parseAsync:()=>yr,_parse:()=>mr,_overwrite:()=>p,_optional:()=>kk,_number:()=>Hg,_nullable:()=>Dk,_null:()=>vg,_normalize:()=>on,_nonpositive:()=>ut,_nonoptional:()=>Sk,_nonnegative:()=>ot,_never:()=>sg,_negative:()=>$t,_nativeEnum:()=>Uk,_nanoid:()=>fi,_nan:()=>tI,_multipleOf:()=>jr,_minSize:()=>Ir,_minLength:()=>kr,_min:()=>Z,_mime:()=>un,_maxSize:()=>Pr,_maxLength:()=>Qr,_max:()=>v,_map:()=>ck,_mac:()=>Wg,_lte:()=>v,_lt:()=>or,_lowercase:()=>sr,_literal:()=>lk,_length:()=>Vr,_lazy:()=>Lk,_ksuid:()=>di,_jwt:()=>it,_isoTime:()=>Qg,_isoDuration:()=>Vg,_isoDateTime:()=>Yg,_isoDate:()=>Tg,_ipv6:()=>vi,_ipv4:()=>hi,_intersection:()=>ok,_int64:()=>mg,_int32:()=>Mg,_int:()=>Bg,_includes:()=>nn,_guid:()=>Cn,_gte:()=>Z,_gt:()=>gr,_float64:()=>Fg,_float32:()=>Ag,_file:()=>uI,_enum:()=>bk,_endsWith:()=>$n,_encodeAsync:()=>wi,_encode:()=>ki,_emoji:()=>xi,_email:()=>Bi,_e164:()=>nt,_discriminatedUnion:()=>uk,_default:()=>wk,_decodeAsync:()=>Si,_decode:()=>Di,_date:()=>nI,_custom:()=>oI,_cuid2:()=>Ci,_cuid:()=>Zi,_coercedString:()=>Xg,_coercedNumber:()=>Kg,_coercedDate:()=>iI,_coercedBoolean:()=>fg,_coercedBigint:()=>Cg,_cidrv6:()=>pi,_cidrv4:()=>ai,_check:()=>Lc,_catch:()=>Nk,_boolean:()=>xg,_bigint:()=>Zg,_base64url:()=>rt,_base64:()=>si,_array:()=>$I,_any:()=>ag,TimePrecision:()=>qg,NEVER:()=>I$,JSONSchemaGenerator:()=>vI,JSONSchema:()=>Ec,Doc:()=>Oi,$output:()=>Lg,$input:()=>Eg,$constructor:()=>U,$brand:()=>c$,$ZodXor:()=>to,$ZodXID:()=>Xu,$ZodVoid:()=>su,$ZodUnknown:()=>au,$ZodUnion:()=>An,$ZodUndefined:()=>du,$ZodUUID:()=>Nu,$ZodURL:()=>Pu,$ZodULID:()=>Gu,$ZodType:()=>J,$ZodTuple:()=>Qi,$ZodTransform:()=>Uo,$ZodTemplateLiteral:()=>Jo,$ZodSymbol:()=>yu,$ZodSuccess:()=>So,$ZodStringFormat:()=>W,$ZodString:()=>Yr,$ZodSet:()=>Io,$ZodRegistry:()=>Og,$ZodRecord:()=>oo,$ZodRealError:()=>y,$ZodReadonly:()=>Po,$ZodPromise:()=>Eo,$ZodPreprocess:()=>jo,$ZodPrefault:()=>Do,$ZodPipe:()=>Hi,$ZodOptional:()=>Vi,$ZodObjectJIT:()=>io,$ZodObject:()=>Sc,$ZodNumberFormat:()=>Cu,$ZodNumber:()=>Yi,$ZodNullable:()=>eo,$ZodNull:()=>hu,$ZodNonOptional:()=>wo,$ZodNever:()=>pu,$ZodNanoID:()=>Lu,$ZodNaN:()=>No,$ZodMap:()=>go,$ZodMAC:()=>Ku,$ZodLiteral:()=>_o,$ZodLazy:()=>Oo,$ZodKSUID:()=>Wu,$ZodJWT:()=>fu,$ZodIntersection:()=>uo,$ZodISOTime:()=>Tu,$ZodISODuration:()=>Qu,$ZodISODateTime:()=>qu,$ZodISODate:()=>Yu,$ZodIPv6:()=>Hu,$ZodIPv4:()=>Vu,$ZodGUID:()=>zu,$ZodFunction:()=>Lo,$ZodFile:()=>bo,$ZodExactOptional:()=>lo,$ZodError:()=>Yn,$ZodEnum:()=>co,$ZodEncodeError:()=>Xr,$ZodEmoji:()=>Ju,$ZodEmail:()=>ju,$ZodE164:()=>xu,$ZodDiscriminatedUnion:()=>$o,$ZodDefault:()=>ko,$ZodDate:()=>ro,$ZodCustomStringFormat:()=>Zu,$ZodCustom:()=>Go,$ZodCodec:()=>Fn,$ZodCheckUpperCase:()=>_u,$ZodCheckStringFormat:()=>vr,$ZodCheckStartsWith:()=>Uu,$ZodCheckSizeEquals:()=>$u,$ZodCheckRegex:()=>Iu,$ZodCheckProperty:()=>eu,$ZodCheckOverwrite:()=>Du,$ZodCheckNumberFormat:()=>ru,$ZodCheckMultipleOf:()=>s$,$ZodCheckMinSize:()=>tu,$ZodCheckMinLength:()=>ou,$ZodCheckMimeType:()=>ku,$ZodCheckMaxSize:()=>iu,$ZodCheckMaxLength:()=>uu,$ZodCheckLowerCase:()=>cu,$ZodCheckLessThan:()=>Li,$ZodCheckLengthEquals:()=>gu,$ZodCheckIncludes:()=>bu,$ZodCheckGreaterThan:()=>Ei,$ZodCheckEndsWith:()=>lu,$ZodCheckBigIntFormat:()=>nu,$ZodCheck:()=>Y,$ZodCatch:()=>zo,$ZodCUID2:()=>Ou,$ZodCUID:()=>Eu,$ZodCIDRv6:()=>Au,$ZodCIDRv4:()=>Bu,$ZodBoolean:()=>Bn,$ZodBigIntFormat:()=>mu,$ZodBigInt:()=>Ti,$ZodBase64URL:()=>Ru,$ZodBase64:()=>Mu,$ZodAsyncError:()=>ur,$ZodArray:()=>no,$ZodAny:()=>vu});var R6,I$=Object.freeze({status:"aborted"});function U(r,i,t){function o(I,c){if(!I._zod)Object.defineProperty(I,"_zod",{value:{def:c,constr:g,traits:new Set},enumerable:!1});if(I._zod.traits.has(r))return;I._zod.traits.add(r),i(I,c);let _=g.prototype,b=Object.keys(_);for(let e=0;e<b.length;e++){let D=b[e];if(!(D in I))I[D]=_[D].bind(I)}}let n=t?.Parent??Object;class $ extends n{}Object.defineProperty($,"name",{value:r});function g(I){var c;let _=t?.Parent?new $:this;o(_,I),(c=_._zod).deferred??(c.deferred=[]);for(let b of _._zod.deferred)b();return _}return Object.defineProperty(g,"init",{value:o}),Object.defineProperty(g,Symbol.hasInstance,{value:(I)=>{if(t?.Parent&&I instanceof t.Parent)return!0;return I?._zod?.traits?.has(r)}}),Object.defineProperty(g,"name",{value:r}),g}var c$=Symbol("zod_brand");class ur extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Xr extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`);this.name="ZodEncodeError"}}(R6=globalThis).__zod_globalConfig??(R6.__zod_globalConfig={});var Gr=globalThis.__zod_globalConfig;function V(r){if(r)Object.assign(Gr,r);return Gr}var z={};br(z,{unwrapMessage:()=>En,uint8ArrayToHex:()=>Pl,uint8ArrayToBase64url:()=>Nl,uint8ArrayToBase64:()=>Z6,stringifyPrimitive:()=>w,slugify:()=>U$,shallowClone:()=>e$,safeExtend:()=>el,required:()=>wl,randomString:()=>gl,propertyKeyTypes:()=>Xn,promiseAllObject:()=>ol,primitiveTypes:()=>k$,prefixIssues:()=>m,pick:()=>bl,partial:()=>Dl,parsedType:()=>S,optionalKeys:()=>D$,omit:()=>Ul,objectClone:()=>tl,numKeys:()=>Il,nullish:()=>wr,normalizeParams:()=>N,mergeDefs:()=>er,merge:()=>kl,jsonStringifyReplacer:()=>fr,joinValues:()=>l,issue:()=>Cr,isPlainObject:()=>zr,isObject:()=>Wr,hexToUint8Array:()=>jl,getSizableOrigin:()=>Wn,getParsedType:()=>cl,getLengthableOrigin:()=>qn,getEnumValues:()=>On,getElementAtPath:()=>ul,floatSafeRemainder:()=>b$,finalizeIssue:()=>f,extend:()=>ll,explicitlyAborted:()=>z$,escapeRegex:()=>a,esc:()=>bi,defineLazy:()=>E,createTransparentProxy:()=>_l,cloneDef:()=>$l,clone:()=>x,cleanRegex:()=>Gn,cleanEnum:()=>Sl,captureStackTrace:()=>Ui,cached:()=>Zr,base64urlToUint8Array:()=>zl,base64ToUint8Array:()=>f6,assignProp:()=>Sr,assertNotEqual:()=>sU,assertNever:()=>nl,assertIs:()=>rl,assertEqual:()=>pU,assert:()=>il,allowsEval:()=>l$,aborted:()=>Nr,NUMBER_FORMAT_RANGES:()=>w$,Class:()=>C6,BIGINT_FORMAT_RANGES:()=>S$});function pU(r){return r}function sU(r){return r}function rl(r){}function nl(r){throw Error("Unexpected value in exhaustive check")}function il(r){}function On(r){let i=Object.values(r).filter((o)=>typeof o==="number");return Object.entries(r).filter(([o,n])=>i.indexOf(+o)===-1).map(([o,n])=>n)}function l(r,i="|"){return r.map((t)=>w(t)).join(i)}function fr(r,i){if(typeof i==="bigint")return i.toString();return i}function Zr(r){return{get value(){{let t=r();return Object.defineProperty(this,"value",{value:t}),t}throw Error("cached value already set")}}}function wr(r){return r===null||r===void 0}function Gn(r){let i=r.startsWith("^")?1:0,t=r.endsWith("$")?r.length-1:r.length;return r.slice(i,t)}function b$(r,i){let t=r/i,o=Math.round(t),n=Number.EPSILON*Math.max(Math.abs(t),1);if(Math.abs(t-o)<n)return 0;return t-o}var x6=Symbol("evaluating");function E(r,i,t){let o=void 0;Object.defineProperty(r,i,{get(){if(o===x6)return;if(o===void 0)o=x6,o=t();return o},set(n){Object.defineProperty(r,i,{value:n})},configurable:!0})}function tl(r){return Object.create(Object.getPrototypeOf(r),Object.getOwnPropertyDescriptors(r))}function Sr(r,i,t){Object.defineProperty(r,i,{value:t,writable:!0,enumerable:!0,configurable:!0})}function er(...r){let i={};for(let t of r){let o=Object.getOwnPropertyDescriptors(t);Object.assign(i,o)}return Object.defineProperties({},i)}function $l(r){return er(r._zod.def)}function ul(r,i){if(!i)return r;return i.reduce((t,o)=>t?.[o],r)}function ol(r){let i=Object.keys(r),t=i.map((o)=>r[o]);return Promise.all(t).then((o)=>{let n={};for(let $=0;$<i.length;$++)n[i[$]]=o[$];return n})}function gl(r=10){let t="";for(let o=0;o<r;o++)t+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return t}function bi(r){return JSON.stringify(r)}function U$(r){return r.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ui="captureStackTrace"in Error?Error.captureStackTrace:(...r)=>{};function Wr(r){return typeof r==="object"&&r!==null&&!Array.isArray(r)}var l$=Zr(()=>{if(Gr.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(r){return!1}});function zr(r){if(Wr(r)===!1)return!1;let i=r.constructor;if(i===void 0)return!0;if(typeof i!=="function")return!0;let t=i.prototype;if(Wr(t)===!1)return!1;if(Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")===!1)return!1;return!0}function e$(r){if(zr(r))return{...r};if(Array.isArray(r))return[...r];if(r instanceof Map)return new Map(r);if(r instanceof Set)return new Set(r);return r}function Il(r){let i=0;for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t))i++;return i}var cl=(r)=>{let i=typeof r;switch(i){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(r)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(r))return"array";if(r===null)return"null";if(r.then&&typeof r.then==="function"&&r.catch&&typeof r.catch==="function")return"promise";if(typeof Map<"u"&&r instanceof Map)return"map";if(typeof Set<"u"&&r instanceof Set)return"set";if(typeof Date<"u"&&r instanceof Date)return"date";if(typeof File<"u"&&r instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${i}`)}},Xn=new Set(["string","number","symbol"]),k$=new Set(["string","number","bigint","boolean","symbol","undefined"]);function a(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function x(r,i,t){let o=new r._zod.constr(i??r._zod.def);if(!i||t?.parent)o._zod.parent=r;return o}function N(r){let i=r;if(!i)return{};if(typeof i==="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");i.error=i.message}if(delete i.message,typeof i.error==="string")return{...i,error:()=>i.error};return i}function _l(r){let i;return new Proxy({},{get(t,o,n){return i??(i=r()),Reflect.get(i,o,n)},set(t,o,n,$){return i??(i=r()),Reflect.set(i,o,n,$)},has(t,o){return i??(i=r()),Reflect.has(i,o)},deleteProperty(t,o){return i??(i=r()),Reflect.deleteProperty(i,o)},ownKeys(t){return i??(i=r()),Reflect.ownKeys(i)},getOwnPropertyDescriptor(t,o){return i??(i=r()),Reflect.getOwnPropertyDescriptor(i,o)},defineProperty(t,o,n){return i??(i=r()),Reflect.defineProperty(i,o,n)}})}function w(r){if(typeof r==="bigint")return r.toString()+"n";if(typeof r==="string")return`"${r}"`;return`${r}`}function D$(r){return Object.keys(r).filter((i)=>{return r[i]._zod.optin==="optional"&&r[i]._zod.optout==="optional"})}var w$={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},S$={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function bl(r,i){let t=r._zod.def,o=t.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let $=er(r._zod.def,{get shape(){let g={};for(let I in i){if(!(I in t.shape))throw Error(`Unrecognized key: "${I}"`);if(!i[I])continue;g[I]=t.shape[I]}return Sr(this,"shape",g),g},checks:[]});return x(r,$)}function Ul(r,i){let t=r._zod.def,o=t.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let $=er(r._zod.def,{get shape(){let g={...r._zod.def.shape};for(let I in i){if(!(I in t.shape))throw Error(`Unrecognized key: "${I}"`);if(!i[I])continue;delete g[I]}return Sr(this,"shape",g),g},checks:[]});return x(r,$)}function ll(r,i){if(!zr(i))throw Error("Invalid input to extend: expected a plain object");let t=r._zod.def.checks;if(t&&t.length>0){let $=r._zod.def.shape;for(let g in i)if(Object.getOwnPropertyDescriptor($,g)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=er(r._zod.def,{get shape(){let $={...r._zod.def.shape,...i};return Sr(this,"shape",$),$}});return x(r,n)}function el(r,i){if(!zr(i))throw Error("Invalid input to safeExtend: expected a plain object");let t=er(r._zod.def,{get shape(){let o={...r._zod.def.shape,...i};return Sr(this,"shape",o),o}});return x(r,t)}function kl(r,i){if(r._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let t=er(r._zod.def,{get shape(){let o={...r._zod.def.shape,...i._zod.def.shape};return Sr(this,"shape",o),o},get catchall(){return i._zod.def.catchall},checks:i._zod.def.checks??[]});return x(r,t)}function Dl(r,i,t){let n=i._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let g=er(i._zod.def,{get shape(){let I=i._zod.def.shape,c={...I};if(t)for(let _ in t){if(!(_ in I))throw Error(`Unrecognized key: "${_}"`);if(!t[_])continue;c[_]=r?new r({type:"optional",innerType:I[_]}):I[_]}else for(let _ in I)c[_]=r?new r({type:"optional",innerType:I[_]}):I[_];return Sr(this,"shape",c),c},checks:[]});return x(i,g)}function wl(r,i,t){let o=er(i._zod.def,{get shape(){let n=i._zod.def.shape,$={...n};if(t)for(let g in t){if(!(g in $))throw Error(`Unrecognized key: "${g}"`);if(!t[g])continue;$[g]=new r({type:"nonoptional",innerType:n[g]})}else for(let g in n)$[g]=new r({type:"nonoptional",innerType:n[g]});return Sr(this,"shape",$),$}});return x(i,o)}function Nr(r,i=0){if(r.aborted===!0)return!0;for(let t=i;t<r.issues.length;t++)if(r.issues[t]?.continue!==!0)return!0;return!1}function z$(r,i=0){if(r.aborted===!0)return!0;for(let t=i;t<r.issues.length;t++)if(r.issues[t]?.continue===!1)return!0;return!1}function m(r,i){return i.map((t)=>{var o;return(o=t).path??(o.path=[]),t.path.unshift(r),t})}function En(r){return typeof r==="string"?r:r?.message}function f(r,i,t){let o=r.message?r.message:En(r.inst?._zod.def?.error?.(r))??En(i?.error?.(r))??En(t.customError?.(r))??En(t.localeError?.(r))??"Invalid input",{inst:n,continue:$,input:g,...I}=r;if(I.path??(I.path=[]),I.message=o,i?.reportInput)I.input=g;return I}function Wn(r){if(r instanceof Set)return"set";if(r instanceof Map)return"map";if(r instanceof File)return"file";return"unknown"}function qn(r){if(Array.isArray(r))return"array";if(typeof r==="string")return"string";return"unknown"}function S(r){let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"nan":"number";case"object":{if(r===null)return"null";if(Array.isArray(r))return"array";let t=r;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return i}function Cr(...r){let[i,t,o]=r;if(typeof i==="string")return{message:i,code:"custom",input:t,inst:o};return{...i}}function Sl(r){return Object.entries(r).filter(([i,t])=>{return Number.isNaN(Number.parseInt(i,10))}).map((i)=>i[1])}function f6(r){let i=atob(r),t=new Uint8Array(i.length);for(let o=0;o<i.length;o++)t[o]=i.charCodeAt(o);return t}function Z6(r){let i="";for(let t=0;t<r.length;t++)i+=String.fromCharCode(r[t]);return btoa(i)}function zl(r){let i=r.replace(/-/g,"+").replace(/_/g,"/"),t="=".repeat((4-i.length%4)%4);return f6(i+t)}function Nl(r){return Z6(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function jl(r){let i=r.replace(/^0x/,"");if(i.length%2!==0)throw Error("Invalid hex string length");let t=new Uint8Array(i.length/2);for(let o=0;o<i.length;o+=2)t[o/2]=Number.parseInt(i.slice(o,o+2),16);return t}function Pl(r){return Array.from(r).map((i)=>i.toString(16).padStart(2,"0")).join("")}class C6{constructor(...r){}}var m6=(r,i)=>{r.name="$ZodError",Object.defineProperty(r,"_zod",{value:r._zod,enumerable:!1}),Object.defineProperty(r,"issues",{value:i,enumerable:!1}),r.message=JSON.stringify(i,fr,2),Object.defineProperty(r,"toString",{value:()=>r.message,enumerable:!1})},Yn=U("$ZodError",m6),y=U("$ZodError",m6,{Parent:Error});function Tn(r,i=(t)=>t.message){let t={},o=[];for(let n of r.issues)if(n.path.length>0)t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(i(n));else o.push(i(n));return{formErrors:o,fieldErrors:t}}function Qn(r,i=(t)=>t.message){let t={_errors:[]},o=(n,$=[])=>{for(let g of n.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map((I)=>o({issues:I},[...$,...g.path]));else if(g.code==="invalid_key")o({issues:g.issues},[...$,...g.path]);else if(g.code==="invalid_element")o({issues:g.issues},[...$,...g.path]);else{let I=[...$,...g.path];if(I.length===0)t._errors.push(i(g));else{let c=t,_=0;while(_<I.length){let b=I[_];if(_!==I.length-1)c[b]=c[b]||{_errors:[]};else c[b]=c[b]||{_errors:[]},c[b]._errors.push(i(g));c=c[b],_++}}}};return o(r),t}function N$(r,i=(t)=>t.message){let t={errors:[]},o=(n,$=[])=>{var g,I;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map((_)=>o({issues:_},[...$,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...$,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...$,...c.path]);else{let _=[...$,...c.path];if(_.length===0){t.errors.push(i(c));continue}let b=t,e=0;while(e<_.length){let D=_[e],k=e===_.length-1;if(typeof D==="string")b.properties??(b.properties={}),(g=b.properties)[D]??(g[D]={errors:[]}),b=b.properties[D];else b.items??(b.items=[]),(I=b.items)[D]??(I[D]={errors:[]}),b=b.items[D];if(k)b.errors.push(i(c));e++}}};return o(r),t}function y6(r){let i=[],t=r.map((o)=>typeof o==="object"?o.key:o);for(let o of t)if(typeof o==="number")i.push(`[${o}]`);else if(typeof o==="symbol")i.push(`[${JSON.stringify(String(o))}]`);else if(/[^\w$]/.test(o))i.push(`[${JSON.stringify(o)}]`);else{if(i.length)i.push(".");i.push(o)}return i.join("")}function j$(r){let i=[],t=[...r.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of t)if(i.push(`✖ ${o.message}`),o.path?.length)i.push(` → at ${y6(o.path)}`);return i.join(`
26
26
  `)}var mr=(r)=>(i,t,o,n)=>{let $=o?{...o,async:!1}:{async:!1},g=i._zod.run({value:t,issues:[]},$);if(g instanceof Promise)throw new ur;if(g.issues.length){let I=new(n?.Err??r)(g.issues.map((c)=>f(c,$,V())));throw Ui(I,n?.callee),I}return g.value},li=mr(y),yr=(r)=>async(i,t,o,n)=>{let $=o?{...o,async:!0}:{async:!0},g=i._zod.run({value:t,issues:[]},$);if(g instanceof Promise)g=await g;if(g.issues.length){let I=new(n?.Err??r)(g.issues.map((c)=>f(c,$,V())));throw Ui(I,n?.callee),I}return g.value},ei=yr(y),dr=(r)=>(i,t,o)=>{let n=o?{...o,async:!1}:{async:!1},$=i._zod.run({value:t,issues:[]},n);if($ instanceof Promise)throw new ur;return $.issues.length?{success:!1,error:new(r??Yn)($.issues.map((g)=>f(g,n,V())))}:{success:!0,data:$.value}},P$=dr(y),hr=(r)=>async(i,t,o)=>{let n=o?{...o,async:!0}:{async:!0},$=i._zod.run({value:t,issues:[]},n);if($ instanceof Promise)$=await $;return $.issues.length?{success:!1,error:new r($.issues.map((g)=>f(g,n,V())))}:{success:!0,data:$.value}},J$=hr(y),ki=(r)=>(i,t,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return mr(r)(i,t,n)},Ll=ki(y),Di=(r)=>(i,t,o)=>{return mr(r)(i,t,o)},El=Di(y),wi=(r)=>async(i,t,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return yr(r)(i,t,n)},Ol=wi(y),Si=(r)=>async(i,t,o)=>{return yr(r)(i,t,o)},Gl=Si(y),zi=(r)=>(i,t,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return dr(r)(i,t,n)},Xl=zi(y),Ni=(r)=>(i,t,o)=>{return dr(r)(i,t,o)},Wl=Ni(y),ji=(r)=>async(i,t,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return hr(r)(i,t,n)},ql=ji(y),Pi=(r)=>async(i,t,o)=>{return hr(r)(i,t,o)},Yl=Pi(y);var h={};br(h,{xid:()=>G$,uuid7:()=>Hl,uuid6:()=>Vl,uuid4:()=>Ql,uuid:()=>qr,uppercase:()=>p$,unicodeEmail:()=>d6,undefined:()=>v$,ulid:()=>O$,time:()=>f$,string:()=>C$,sha512_hex:()=>ie,sha512_base64url:()=>$e,sha512_base64:()=>te,sha384_hex:()=>sl,sha384_base64url:()=>ne,sha384_base64:()=>re,sha256_hex:()=>vl,sha256_base64url:()=>pl,sha256_base64:()=>al,sha1_hex:()=>yl,sha1_base64url:()=>hl,sha1_base64:()=>dl,rfc5322Email:()=>Bl,number:()=>Vn,null:()=>h$,nanoid:()=>W$,md5_hex:()=>Zl,md5_base64url:()=>ml,md5_base64:()=>Cl,mac:()=>K$,lowercase:()=>a$,ksuid:()=>X$,ipv6:()=>H$,ipv4:()=>V$,integer:()=>y$,idnEmail:()=>Al,httpProtocol:()=>M$,html5Email:()=>Kl,hostname:()=>Rl,hex:()=>fl,guid:()=>Y$,extendedDuration:()=>Tl,emoji:()=>Q$,email:()=>T$,e164:()=>R$,duration:()=>q$,domain:()=>xl,datetime:()=>Z$,date:()=>x$,cuid2:()=>E$,cuid:()=>L$,cidrv6:()=>A$,cidrv4:()=>B$,browserEmail:()=>Fl,boolean:()=>d$,bigint:()=>m$,base64url:()=>Ji,base64:()=>F$});var L$=/^[cC][0-9a-z]{6,}$/,E$=/^[0-9a-z]+$/,O$=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,G$=/^[0-9a-vA-V]{20}$/,X$=/^[A-Za-z0-9]{27}$/,W$=/^[a-zA-Z0-9_-]{21}$/,q$=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Tl=/^[-+]?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)?)??$/,Y$=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qr=(r)=>{if(!r)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${r}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},Ql=qr(4),Vl=qr(6),Hl=qr(7),T$=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kl=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Bl=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,d6=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Al=d6,Fl=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ml="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Q$(){return new RegExp(Ml,"u")}var V$=/^(?:(?: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])$/,H$=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,K$=(r)=>{let i=a(r??":");return new RegExp(`^(?:[0-9A-F]{2}${i}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${i}){5}[0-9a-f]{2}$`)},B$=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,A$=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,F$=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ji=/^[A-Za-z0-9_-]*$/,Rl=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,xl=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,M$=/^https?$/,R$=/^\+[1-9]\d{6,14}$/,h6="(?:(?:\\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])))",x$=new RegExp(`^${h6}$`);function v6(r){return typeof r.precision==="number"?r.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":r.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${r.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function f$(r){return new RegExp(`^${v6(r)}$`)}function Z$(r){let i=v6({precision:r.precision}),t=["Z"];if(r.local)t.push("");if(r.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${i}(?:${t.join("|")})`;return new RegExp(`^${h6}T(?:${o})$`)}var C$=(r)=>{let i=r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${i}$`)},m$=/^-?\d+n?$/,y$=/^-?\d+$/,Vn=/^-?\d+(?:\.\d+)?$/,d$=/^(?:true|false)$/i,h$=/^null$/i;var v$=/^undefined$/i;var a$=/^[^A-Z]*$/,p$=/^[^a-z]*$/,fl=/^[0-9a-fA-F]*$/;function Hn(r,i){return new RegExp(`^[A-Za-z0-9+/]{${r}}${i}$`)}function Kn(r){return new RegExp(`^[A-Za-z0-9_-]{${r}}$`)}var Zl=/^[0-9a-fA-F]{32}$/,Cl=Hn(22,"=="),ml=Kn(22),yl=/^[0-9a-fA-F]{40}$/,dl=Hn(27,"="),hl=Kn(27),vl=/^[0-9a-fA-F]{64}$/,al=Hn(43,"="),pl=Kn(43),sl=/^[0-9a-fA-F]{96}$/,re=Hn(64,""),ne=Kn(64),ie=/^[0-9a-fA-F]{128}$/,te=Hn(86,"=="),$e=Kn(86);var Y=U("$ZodCheck",(r,i)=>{var t;r._zod??(r._zod={}),r._zod.def=i,(t=r._zod).onattach??(t.onattach=[])}),p6={number:"number",bigint:"bigint",object:"date"},Li=U("$ZodCheckLessThan",(r,i)=>{Y.init(r,i);let t=p6[typeof i.value];r._zod.onattach.push((o)=>{let n=o._zod.bag,$=(i.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(i.value<$)if(i.inclusive)n.maximum=i.value;else n.exclusiveMaximum=i.value}),r._zod.check=(o)=>{if(i.inclusive?o.value<=i.value:o.value<i.value)return;o.issues.push({origin:t,code:"too_big",maximum:typeof i.value==="object"?i.value.getTime():i.value,input:o.value,inclusive:i.inclusive,inst:r,continue:!i.abort})}}),Ei=U("$ZodCheckGreaterThan",(r,i)=>{Y.init(r,i);let t=p6[typeof i.value];r._zod.onattach.push((o)=>{let n=o._zod.bag,$=(i.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(i.value>$)if(i.inclusive)n.minimum=i.value;else n.exclusiveMinimum=i.value}),r._zod.check=(o)=>{if(i.inclusive?o.value>=i.value:o.value>i.value)return;o.issues.push({origin:t,code:"too_small",minimum:typeof i.value==="object"?i.value.getTime():i.value,input:o.value,inclusive:i.inclusive,inst:r,continue:!i.abort})}}),s$=U("$ZodCheckMultipleOf",(r,i)=>{Y.init(r,i),r._zod.onattach.push((t)=>{var o;(o=t._zod.bag).multipleOf??(o.multipleOf=i.value)}),r._zod.check=(t)=>{if(typeof t.value!==typeof i.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof t.value==="bigint"?t.value%i.value===BigInt(0):b$(t.value,i.value)===0)return;t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:i.value,input:t.value,inst:r,continue:!i.abort})}}),ru=U("$ZodCheckNumberFormat",(r,i)=>{Y.init(r,i),i.format=i.format||"float64";let t=i.format?.includes("int"),o=t?"int":"number",[n,$]=w$[i.format];r._zod.onattach.push((g)=>{let I=g._zod.bag;if(I.format=i.format,I.minimum=n,I.maximum=$,t)I.pattern=y$}),r._zod.check=(g)=>{let I=g.value;if(t){if(!Number.isInteger(I)){g.issues.push({expected:o,format:i.format,code:"invalid_type",continue:!1,input:I,inst:r});return}if(!Number.isSafeInteger(I)){if(I>0)g.issues.push({input:I,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:o,inclusive:!0,continue:!i.abort});else g.issues.push({input:I,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:r,origin:o,inclusive:!0,continue:!i.abort});return}}if(I<n)g.issues.push({origin:"number",input:I,code:"too_small",minimum:n,inclusive:!0,inst:r,continue:!i.abort});if(I>$)g.issues.push({origin:"number",input:I,code:"too_big",maximum:$,inclusive:!0,inst:r,continue:!i.abort})}}),nu=U("$ZodCheckBigIntFormat",(r,i)=>{Y.init(r,i);let[t,o]=S$[i.format];r._zod.onattach.push((n)=>{let $=n._zod.bag;$.format=i.format,$.minimum=t,$.maximum=o}),r._zod.check=(n)=>{let $=n.value;if($<t)n.issues.push({origin:"bigint",input:$,code:"too_small",minimum:t,inclusive:!0,inst:r,continue:!i.abort});if($>o)n.issues.push({origin:"bigint",input:$,code:"too_big",maximum:o,inclusive:!0,inst:r,continue:!i.abort})}}),iu=U("$ZodCheckMaxSize",(r,i)=>{var t;Y.init(r,i),(t=r._zod.def).when??(t.when=(o)=>{let n=o.value;return!wr(n)&&n.size!==void 0}),r._zod.onattach.push((o)=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(i.maximum<n)o._zod.bag.maximum=i.maximum}),r._zod.check=(o)=>{let n=o.value;if(n.size<=i.maximum)return;o.issues.push({origin:Wn(n),code:"too_big",maximum:i.maximum,inclusive:!0,input:n,inst:r,continue:!i.abort})}}),tu=U("$ZodCheckMinSize",(r,i)=>{var t;Y.init(r,i),(t=r._zod.def).when??(t.when=(o)=>{let n=o.value;return!wr(n)&&n.size!==void 0}),r._zod.onattach.push((o)=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(i.minimum>n)o._zod.bag.minimum=i.minimum}),r._zod.check=(o)=>{let n=o.value;if(n.size>=i.minimum)return;o.issues.push({origin:Wn(n),code:"too_small",minimum:i.minimum,inclusive:!0,input:n,inst:r,continue:!i.abort})}}),$u=U("$ZodCheckSizeEquals",(r,i)=>{var t;Y.init(r,i),(t=r._zod.def).when??(t.when=(o)=>{let n=o.value;return!wr(n)&&n.size!==void 0}),r._zod.onattach.push((o)=>{let n=o._zod.bag;n.minimum=i.size,n.maximum=i.size,n.size=i.size}),r._zod.check=(o)=>{let n=o.value,$=n.size;if($===i.size)return;let g=$>i.size;o.issues.push({origin:Wn(n),...g?{code:"too_big",maximum:i.size}:{code:"too_small",minimum:i.size},inclusive:!0,exact:!0,input:o.value,inst:r,continue:!i.abort})}}),uu=U("$ZodCheckMaxLength",(r,i)=>{var t;Y.init(r,i),(t=r._zod.def).when??(t.when=(o)=>{let n=o.value;return!wr(n)&&n.length!==void 0}),r._zod.onattach.push((o)=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(i.maximum<n)o._zod.bag.maximum=i.maximum}),r._zod.check=(o)=>{let n=o.value;if(n.length<=i.maximum)return;let g=qn(n);o.issues.push({origin:g,code:"too_big",maximum:i.maximum,inclusive:!0,input:n,inst:r,continue:!i.abort})}}),ou=U("$ZodCheckMinLength",(r,i)=>{var t;Y.init(r,i),(t=r._zod.def).when??(t.when=(o)=>{let n=o.value;return!wr(n)&&n.length!==void 0}),r._zod.onattach.push((o)=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(i.minimum>n)o._zod.bag.minimum=i.minimum}),r._zod.check=(o)=>{let n=o.value;if(n.length>=i.minimum)return;let g=qn(n);o.issues.push({origin:g,code:"too_small",minimum:i.minimum,inclusive:!0,input:n,inst:r,continue:!i.abort})}}),gu=U("$ZodCheckLengthEquals",(r,i)=>{var t;Y.init(r,i),(t=r._zod.def).when??(t.when=(o)=>{let n=o.value;return!wr(n)&&n.length!==void 0}),r._zod.onattach.push((o)=>{let n=o._zod.bag;n.minimum=i.length,n.maximum=i.length,n.length=i.length}),r._zod.check=(o)=>{let n=o.value,$=n.length;if($===i.length)return;let g=qn(n),I=$>i.length;o.issues.push({origin:g,...I?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},inclusive:!0,exact:!0,input:o.value,inst:r,continue:!i.abort})}}),vr=U("$ZodCheckStringFormat",(r,i)=>{var t,o;if(Y.init(r,i),r._zod.onattach.push((n)=>{let $=n._zod.bag;if($.format=i.format,i.pattern)$.patterns??($.patterns=new Set),$.patterns.add(i.pattern)}),i.pattern)(t=r._zod).check??(t.check=(n)=>{if(i.pattern.lastIndex=0,i.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:i.format,input:n.value,...i.pattern?{pattern:i.pattern.toString()}:{},inst:r,continue:!i.abort})});else(o=r._zod).check??(o.check=()=>{})}),Iu=U("$ZodCheckRegex",(r,i)=>{vr.init(r,i),r._zod.check=(t)=>{if(i.pattern.lastIndex=0,i.pattern.test(t.value))return;t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:i.pattern.toString(),inst:r,continue:!i.abort})}}),cu=U("$ZodCheckLowerCase",(r,i)=>{i.pattern??(i.pattern=a$),vr.init(r,i)}),_u=U("$ZodCheckUpperCase",(r,i)=>{i.pattern??(i.pattern=p$),vr.init(r,i)}),bu=U("$ZodCheckIncludes",(r,i)=>{Y.init(r,i);let t=a(i.includes),o=new RegExp(typeof i.position==="number"?`^.{${i.position}}${t}`:t);i.pattern=o,r._zod.onattach.push((n)=>{let $=n._zod.bag;$.patterns??($.patterns=new Set),$.patterns.add(o)}),r._zod.check=(n)=>{if(n.value.includes(i.includes,i.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:i.includes,input:n.value,inst:r,continue:!i.abort})}}),Uu=U("$ZodCheckStartsWith",(r,i)=>{Y.init(r,i);let t=new RegExp(`^${a(i.prefix)}.*`);i.pattern??(i.pattern=t),r._zod.onattach.push((o)=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),r._zod.check=(o)=>{if(o.value.startsWith(i.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:i.prefix,input:o.value,inst:r,continue:!i.abort})}}),lu=U("$ZodCheckEndsWith",(r,i)=>{Y.init(r,i);let t=new RegExp(`.*${a(i.suffix)}$`);i.pattern??(i.pattern=t),r._zod.onattach.push((o)=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(t)}),r._zod.check=(o)=>{if(o.value.endsWith(i.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:i.suffix,input:o.value,inst:r,continue:!i.abort})}});function a6(r,i,t){if(r.issues.length)i.issues.push(...m(t,r.issues))}var eu=U("$ZodCheckProperty",(r,i)=>{Y.init(r,i),r._zod.check=(t)=>{let o=i.schema._zod.run({value:t.value[i.property],issues:[]},{});if(o instanceof Promise)return o.then((n)=>a6(n,t,i.property));a6(o,t,i.property);return}}),ku=U("$ZodCheckMimeType",(r,i)=>{Y.init(r,i);let t=new Set(i.mime);r._zod.onattach.push((o)=>{o._zod.bag.mime=i.mime}),r._zod.check=(o)=>{if(t.has(o.value.type))return;o.issues.push({code:"invalid_value",values:i.mime,input:o.value.type,inst:r,continue:!i.abort})}}),Du=U("$ZodCheckOverwrite",(r,i)=>{Y.init(r,i),r._zod.check=(t)=>{t.value=i.tx(t.value)}});class Oi{constructor(r=[]){if(this.content=[],this.indent=0,this)this.args=r}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r==="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}let t=r.split(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotstack/cli",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Command-line interface for the Shotstack video rendering API.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/shotstack/shotstack-cli",
@@ -21,6 +21,7 @@ Read [`html5.md`](html5.md) for the rules these obey. The non-negotiables:
21
21
  - **No `<canvas>`** — Studio capture serialises the DOM; canvas bitmaps come through empty. Use SVG or positioned DOM.
22
22
  - **No network.** gsap/anime/d3/lottie are preloaded; external `<script src>`, `fetch`, remote `<img>`, and remote fonts are all CSP-blocked — inline everything as `data:` URIs.
23
23
  - **Fonts:** `timeline.fonts[]` does **not** reach `html5` and remote `@font-face` is blocked. These snippets name a display font first but render in the `system-ui` fallback unless you inline the font as a `data:` `@font-face`.
24
+ - **Use unique element IDs for GSAP targets, not `:nth-child` or compound CSS selectors.** Studio preview doesn't resolve `.parent:nth-child(n) .child` patterns; `#id` works everywhere. When animating repeated elements (list rows, bars, cards), generate a unique ID per item (`id="row0"`, `id="bar0"`) rather than relying on structural selectors.
24
25
 
25
26
  Coordinates below assume a **1080×1920 vertical** canvas; adjust `offset` for other sizes.
26
27
 
@@ -13,6 +13,7 @@ Common errors and the fix for each. **Catch most of them before rendering:** `sh
13
13
  - Timeline renders but layers are wrong
14
14
  - "Invalid asset URL"
15
15
  - html5 clip is blank but render succeeded
16
+ - html5 clip animates in the rendered MP4 but not in Studio preview
16
17
  - "Render failed" with no other detail
17
18
  - Render takes much longer than expected
18
19
  - Credits exhausted on stage environment
@@ -95,6 +96,17 @@ Two causes:
95
96
 
96
97
  A third variant: values stuck at `$0` or their initial state. This happens when `onUpdate` callbacks are used to mutate `textContent` — the seek harness doesn't fire `onUpdate`, so the DOM never updates. Bake final values into the HTML and animate opacity/transform instead. See `references/html5.md` → "The browser harness".
97
98
 
99
+ ## html5 clip animates in the rendered MP4 but not in Studio preview
100
+
101
+ Studio preview and the cloud render use different capture mechanisms. The cloud render (puppeteer) properly handles all GSAP properties; Studio's client-side preview does not. This is a parity gap, not a render bug — the MP4 is the ground truth.
102
+
103
+ Known differences:
104
+
105
+ - **`:nth-child` and compound CSS selectors** as GSAP targets don't resolve in Studio preview. `.brow:nth-child(1) .bar` silently matches nothing; rows and bars stay in their initial state. Use unique element IDs (`#row0`, `#bar0`) instead — they work in both.
106
+ - **`scale` / `scaleX` / `scaleY` transforms** don't animate in Studio preview. Elements starting at `scale(0)` or `scaleX(0)` stay invisible. Use `width` (for bars), `opacity`, or `y` transitions instead.
107
+
108
+ If a clip looks wrong in Studio but the rendered MP4 is correct, don't waste credits re-rendering — check whether the JS uses structural selectors or scale transforms, and swap for ID-based targets and width/opacity animations.
109
+
98
110
  ## "Render failed" with no other detail
99
111
 
100
112
  `shotstack status <id> --output json` returns the full response including the error message. The `--watch` text view truncates.