conformtools 0.5.1 → 0.6.2

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.
Files changed (93) hide show
  1. package/README.md +69 -6
  2. package/dist/browser/timeline_core_bg.wasm +0 -0
  3. package/dist/chunk-6TM32YIJ.js +7 -0
  4. package/dist/chunk-BTXLTVNK.js +3 -0
  5. package/dist/{chunk-AHNDJFQR.js → chunk-BUEIRRNY.js} +1 -1
  6. package/dist/chunk-BXFVYGFW.js +3 -0
  7. package/dist/chunk-CX3USH6A.js +318 -0
  8. package/dist/chunk-D5DEQ467.js +3 -0
  9. package/dist/{chunk-YPRTUS5W.js → chunk-FNGHTZ5F.js} +1 -1
  10. package/dist/chunk-GXEVALBL.js +3 -0
  11. package/dist/chunk-JH3OLTR6.js +3 -0
  12. package/dist/chunk-KP4C2MFM.js +3 -0
  13. package/dist/chunk-PIEH7J6J.js +3 -0
  14. package/dist/chunk-RUBNBRUK.js +3 -0
  15. package/dist/chunk-RULUDOB7.js +3 -0
  16. package/dist/chunk-Y2BEEOPB.js +3 -0
  17. package/dist/claude-setup-XSNTKEU7.js +5 -0
  18. package/dist/cli.js +11 -5
  19. package/dist/conformtools-decode +0 -0
  20. package/dist/cr3-wasm-YTMVBAFM.js +3 -0
  21. package/dist/dng-wasm-WUUQB7M2.js +3 -0
  22. package/dist/dpx-wasm-XBKO4V4W.js +3 -0
  23. package/dist/exr-wasm-VE2W6MFW.js +3 -0
  24. package/dist/{h264-JHQCJTWP.js → h264-HD7BY5J5.js} +1 -1
  25. package/dist/{h264-mxf-4M63NBQK.js → h264-mxf-6OOODSAK.js} +1 -1
  26. package/dist/http.js +2 -2
  27. package/dist/{inspect-6OM4FTVW.js → inspect-TDZCNXVW.js} +2 -2
  28. package/dist/isobmff-57HSD6O2.js +3 -0
  29. package/dist/mcp.js +10 -9
  30. package/dist/media_core-R5PPN3AY.js +9 -0
  31. package/dist/{media_core_bg-XIM7Y4R3.js → media_core_bg-YBW45HJ2.js} +1 -1
  32. package/dist/mxf-FAXEK4WR.js +3 -0
  33. package/dist/{ops-7HVBBXUQ.js → ops-UPPAG2TI.js} +1 -1
  34. package/dist/premiere-uxp/icons/panel.png +0 -0
  35. package/dist/premiere-uxp/icons/panel@2x.png +0 -0
  36. package/dist/premiere-uxp/icons/plugin.png +0 -0
  37. package/dist/premiere-uxp/icons/plugin@2x.png +0 -0
  38. package/dist/premiere-uxp/index.html +38 -0
  39. package/dist/premiere-uxp/index.js +93 -0
  40. package/dist/premiere-uxp/lib/clipmeta.js +170 -0
  41. package/dist/premiere-uxp/lib/ctx.js +62 -0
  42. package/dist/premiere-uxp/lib/handles.js +57 -0
  43. package/dist/premiere-uxp/lib/markers.js +198 -0
  44. package/dist/premiere-uxp/lib/pairing.js +58 -0
  45. package/dist/premiere-uxp/lib/premiere.js +82 -0
  46. package/dist/premiere-uxp/lib/probe.js +139 -0
  47. package/dist/premiere-uxp/lib/protocol.js +165 -0
  48. package/dist/premiere-uxp/lib/render.js +38 -0
  49. package/dist/premiere-uxp/lib/session.js +85 -0
  50. package/dist/premiere-uxp/lib/sizing.js +312 -0
  51. package/dist/premiere-uxp/lib/time.js +82 -0
  52. package/dist/premiere-uxp/lib/timeline.js +336 -0
  53. package/dist/premiere-uxp/lib/verbs.js +20 -0
  54. package/dist/premiere-uxp/lib/write.js +97 -0
  55. package/dist/premiere-uxp/manifest.json +102 -0
  56. package/dist/{r3d-AT6NNIY3.js → r3d-EY6FEFKM.js} +1 -1
  57. package/dist/r3d-KJVC7T2C.js +3 -0
  58. package/dist/resolve-bridge.py +974 -0
  59. package/dist/resolve-presets/conform.tools.xml +127 -0
  60. package/dist/sscd-embed-DHFTEIOC.js +3 -0
  61. package/dist/sscd-sweep-OYS4XAID.js +3 -0
  62. package/dist/statusline-GMMCFMOA.js +4 -0
  63. package/dist/statusline.js +3 -0
  64. package/dist/{still-E4HLCCST.js → still-WY7MUR7A.js} +1 -1
  65. package/dist/tiff-wasm-T2V2ICZT.js +3 -0
  66. package/dist/wasm/media_core_bg.wasm +0 -0
  67. package/dist/wasm/udf_bg.wasm +0 -0
  68. package/dist/wasm-threads/media_core_bg.wasm +0 -0
  69. package/dist/{wav-DXF73Y56.js → wav-LFS6OZHJ.js} +1 -1
  70. package/package.json +1 -1
  71. package/dist/chunk-35U7WGES.js +0 -3
  72. package/dist/chunk-3XTUTEKJ.js +0 -102
  73. package/dist/chunk-HJXRLQOI.js +0 -3
  74. package/dist/chunk-IDDQR56R.js +0 -7
  75. package/dist/chunk-UUMHVA7R.js +0 -3
  76. package/dist/chunk-WWGQFOB2.js +0 -64
  77. package/dist/cr3-wasm-X6Q4YMUU.js +0 -3
  78. package/dist/dng-wasm-EAB24KDN.js +0 -3
  79. package/dist/dpx-wasm-OX2D24ZB.js +0 -3
  80. package/dist/exr-wasm-Z6BBPJSN.js +0 -3
  81. package/dist/isobmff-XL33CVJR.js +0 -3
  82. package/dist/media_core-VSTO6CS4.js +0 -9
  83. package/dist/mxf-VIANACTI.js +0 -3
  84. package/dist/r3d-2QCFX7UX.js +0 -3
  85. package/dist/sscd-sweep-IXM4OD7O.js +0 -3
  86. package/dist/tiff-wasm-XYTQNL2F.js +0 -3
  87. package/dist/zod-IPSV75LP.js +0 -3
  88. /package/dist/{arriraw-Y5VXHXNX.js → arriraw-BEZILZY3.js} +0 -0
  89. /package/dist/{chunk-NYB4ISL3.js → chunk-NP53ITN6.js} +0 -0
  90. /package/dist/{media_core_bg-BKXQLNFA.js → media_core_bg-5UIQAP7I.js} +0 -0
  91. /package/dist/{prores-TQEZ3KFH.js → prores-BNALPJPS.js} +0 -0
  92. /package/dist/{timeline_core_bg-QEOVAIWP.js → timeline_core_bg-XYT26ZTU.js} +0 -0
  93. /package/dist/{udf_bg-UTQ6BVXX.js → udf_bg-R3JEZJAT.js} +0 -0
package/README.md CHANGED
@@ -15,8 +15,8 @@ language, or from a terminal.
15
15
  ## 1. Sign in
16
16
 
17
17
  ```sh
18
- npx -y conformtools login # opens your browser: sign in with the Google account you use on conform.tools
19
- npx -y conformtools whoami # shows the account and plan it found
18
+ npx -y conformtools@latest login # opens your browser: sign in with the Google account you use on conform.tools
19
+ npx -y conformtools@latest whoami # shows the account and plan it found
20
20
  ```
21
21
 
22
22
  ## 2a. Use it from Claude
@@ -24,7 +24,7 @@ npx -y conformtools whoami # shows the account and plan it found
24
24
  **Claude Code**
25
25
 
26
26
  ```sh
27
- claude mcp add -s user conformtools -- npx -y conformtools mcp
27
+ claude mcp add -s user conformtools -- npx -y conformtools@latest mcp
28
28
  ```
29
29
 
30
30
  **Claude Desktop** — Settings → Developer → Edit Config, then add:
@@ -32,12 +32,12 @@ claude mcp add -s user conformtools -- npx -y conformtools mcp
32
32
  ```json
33
33
  {
34
34
  "mcpServers": {
35
- "conformtools": { "command": "npx", "args": ["-y", "conformtools", "mcp"] }
35
+ "conformtools": { "command": "npx", "args": ["-y", "conformtools@latest", "mcp"] }
36
36
  }
37
37
  }
38
38
  ```
39
39
 
40
- Cursor, Codex and other MCP clients take the same command: `npx -y conformtools mcp`.
40
+ Cursor, Codex and other MCP clients take the same command: `npx -y conformtools@latest mcp`.
41
41
 
42
42
  Then just ask:
43
43
 
@@ -46,6 +46,27 @@ Then just ask:
46
46
  - "Relink this cut to the media in /Volumes/OCF."
47
47
  - "Trim A001C003.mov from 01:00:10:00 to 01:00:14:12 with 12 frames of handles."
48
48
  - "Consolidate the media for this cut into ~/Deliver with 24 frame handles."
49
+ - "Which clips in this cut are retimed?" · "What media in this project is unused?" · "Export the red markers as CSV."
50
+ - "What do I have open in Resolve?" · "Bring this turnover into my Resolve project." · "Render 01:00:10:00 to 01:00:20:00 of Reel 2 with my ProRes Master preset."
51
+ - "Make a 30-shot test cut from /Volumes/OCF with every hard case, seed 7." (`timeline_generate`: a seeded random edit — short shots, jump cuts, look-alike takes, punch-ins, off-rate, retimes, PiP, gaps — each shot tagged with what it tests, so a conform of its render can be scored per case)
52
+ - "Check Reel 2 for black edges." · "QC the master before it goes out." (DaVinci Resolve Studio with the conform.tools renderplugin: every frame is measured after grading; findings land as markers)
53
+
54
+ Working with a running DaVinci Resolve Studio needs Preferences > System > General > External
55
+ scripting using: **Local**. Imports always land as a new timeline in a conform.tools folder; renders
56
+ run only their own job and put your Deliver settings, timeline and page back.
57
+
58
+ **Playbooks come with your account.** Once you are signed in, the agent gets the
59
+ CONFORM.TOOLS playbooks, so it learns how a conform artist uses the tools, not just
60
+ what they do:
61
+
62
+ - **conform**: turnover checks, relink, write, check and report what did not carry,
63
+ with notes per host (Resolve, Premiere, Avid, Flame, Final Cut, Baselight, Pro Tools).
64
+ - **deliver**: consolidate, package (folder or ISO) and QC a delivery before it leaves.
65
+
66
+ The agent loads the playbook for its task with the `conform_learn` tool. Hosts that
67
+ support the MCP Skills Extension (`io.modelcontextprotocol/skills`) also see them as
68
+ `skill://conform-artist` and `skill://delivery-qc`. The playbooks come from
69
+ conform.tools, so they stay current without updating the package.
49
70
 
50
71
  ## 2b. Or use it from a terminal
51
72
 
@@ -53,9 +74,15 @@ Then just ask:
53
74
  npm i -g conformtools
54
75
  conformtools --list # every tool, with a one-line description
55
76
  conformtools timeline_read '{"path":"~/Desktop/cut.aaf"}'
56
- conformtools timeline_write '{"session_id":"…","target":"drt"}'
77
+ conformtools timeline_write '{"session_id":"…","target":"resolve"}' # .drt + XML for Resolve + README, in "DaVinci Resolve/"
78
+ conformtools timeline_write '{"session_id":"…","target":"drt"}' # just the .drt
57
79
  ```
58
80
 
81
+ A **destination** (`resolve`, `premiere`, `avid`, `flame`, `finalcut`, `baselight`, `protools`)
82
+ writes the host's native file and the fallback to use if the host refuses it, in one folder named
83
+ for the host, with a README saying which to open first and what each file could not carry.
84
+ `GET /v1/destinations` lists them.
85
+
59
86
  ## 2c. Or call it from your own code (local HTTP API)
60
87
 
61
88
  ```sh
@@ -81,6 +108,42 @@ writing timelines use conform.tools, exactly as the website does: the engine sen
81
108
  edit's structure and gets the finished timeline back. Tools that do this are marked
82
109
  "(on conform.tools)" in `conformtools --list`, and need an internet connection.
83
110
 
111
+ ## Feedback and privacy
112
+
113
+ When you tell Claude (or any AI app) that a result is wrong, it can send us a report with the
114
+ `report_issue` tool, and it tells you when it has, with a report id. A report contains:
115
+
116
+ - the words the AI wrote: a one-line summary, what happened, what you expected, and the
117
+ session, tool and job it was about
118
+ - the conformtools version and whether timelines were read on this machine or on conform.tools
119
+ - your OS and Node.js version, and the signed-in account
120
+ - the last 20 lines of the engine's own log for that session or job (which tool ran, how long
121
+ it took, whether it failed and the error), with every folder path cut down to the file name:
122
+ `/Volumes/CLIENT/secret/A001.mov` is sent as `A001.mov`
123
+
124
+ When the AI does a post-production task with something other than conformtools (ffprobe, a
125
+ script, steps it asks you to do in your editing app), or finds that conformtools can't do it,
126
+ it sends a short `report_gap` saying what the task was, what it used instead and why, so we
127
+ know which tool to build next. File names at most, never folder paths.
128
+
129
+ Neither report ever sends media, file contents or timeline files. A copy of each report,
130
+ exactly as sent, is kept in `~/.conform-mcp/reports/`.
131
+
132
+ **Outcome telemetry is off unless you turn it on.**
133
+
134
+ ```sh
135
+ conformtools telemetry on # or off, or status
136
+ ```
137
+
138
+ When it is on it records, for each tool run: the tool's name, whether it worked (or the error
139
+ code), how long it took, the conformtools version, local or conform.tools, and counts such as
140
+ the number of clips, files, or matched and unmatched references (numbers only). For a call
141
+ the AI got wrong (missing or invalid arguments) it records the tool's name and the names of
142
+ the arguments, never their values. It never records paths, file or clip names, timeline
143
+ contents or media. Events are sent in batches at most every 15 minutes, a failed send never
144
+ slows a tool down, and turning it off deletes anything not yet sent. `CONFORM_TELEMETRY=off`
145
+ forces it off on a machine.
146
+
84
147
  ## Account
85
148
 
86
149
  Every tool except sign-in needs a signed-in account with an active trial or subscription. If you go
Binary file
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ var Me=Symbol("Let zodToJsonSchema decide on which parser to use");var $e={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},ze=r=>typeof r=="string"?{...$e,name:r}:{...$e,...r};var x;(function(r){r.assertEqual=n=>{};function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{let s={};for(let i of n)s[i]=i;return s},r.getValidEnumValues=n=>{let s=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(let o of s)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(s){return n[s]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let s=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&s.push(i);return s},r.find=(n,s)=>{for(let i of n)if(s(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function a(n,s=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}r.joinValues=a,r.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(x||(x={}));var Le;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Le||(Le={}));var f=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),E=r=>{switch(typeof r){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(r)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(r)?f.array:r===null?f.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?f.promise:typeof Map<"u"&&r instanceof Map?f.map:typeof Set<"u"&&r instanceof Set?f.set:typeof Date<"u"&&r instanceof Date?f.date:f.object;default:return f.unknown}};var u=x.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"]);var O=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(s){return s.message},a={_errors:[]},n=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)a._errors.push(t(i));else{let o=a,c=0;for(;c<i.path.length;){let p=i.path[c],g=c===i.path.length-1;if(p==="_errors"){g&&o._errors.push(t(i)),c++;continue}Object.prototype.hasOwnProperty.call(o,p)||(p==="__proto__"?Object.defineProperty(o,p,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):o[p]={_errors:[]}),o=o[p],g&&o._errors.push(t(i)),c++}}};return n(this),a}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t=Object.create(null),a=[];for(let n of this.issues)if(n.path.length>0){let s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}};O.create=r=>new O(r);var xt=(r,e)=>{let t;switch(r.code){case u.invalid_type:r.received===f.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case u.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,x.jsonStringifyReplacer)}`;break;case u.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(r.keys,", ")}`;break;case u.invalid_union:t="Invalid input";break;case u.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(r.options)}`;break;case u.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;break;case u.invalid_arguments:t="Invalid function arguments";break;case u.invalid_return_type:t="Invalid function return type";break;case u.invalid_date:t="Invalid date";break;case u.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:x.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case u.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case u.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case u.custom:t="Invalid input";break;case u.invalid_intersection_types:t="Intersection results could not be merged";break;case u.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case u.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(r)}return{message:t}},z=xt;var bt=z;function ne(){return bt}var ge=r=>{let{data:e,path:t,errorMaps:a,issueData:n}=r,s=[...t,...n.path||[]],i={...n,path:s};if(n.message!==void 0)return{...n,path:s,message:n.message};let o="",c=a.filter(p=>!!p).slice().reverse();for(let p of c)o=p(i,{data:e,defaultError:o}).message;return{...n,path:s,message:o}};function l(r,e){let t=ne(),a=ge({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===z?void 0:z].filter(n=>!!n)});r.common.issues.push(a)}var w=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let a=[];for(let n of t){if(n.status==="aborted")return h;n.status==="dirty"&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){let a=[];for(let n of t){let s=await n.key,i=await n.value;a.push({key:s,value:i})}return r.mergeObjectSync(e,a)}static mergeObjectSync(e,t){let a={};for(let n of t){let{key:s,value:i}=n;if(s.status==="aborted"||i.status==="aborted")return h;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(a[s.value]=i.value)}return{status:e.value,value:a}}},h=Object.freeze({status:"aborted"}),B=r=>({status:"dirty",value:r}),A=r=>({status:"valid",value:r}),Te=r=>r.status==="aborted",Oe=r=>r.status==="dirty",F=r=>r.status==="valid",se=r=>typeof Promise<"u"&&r instanceof Promise;var m;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(m||(m={}));var j=class{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=n}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}},Ve=(r,e)=>{if(F(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new O(r.common.issues);return this._error=t,this._error}}};function _(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:a,description:n}=r;if(e&&(t||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{let{message:c}=r;return i.code==="invalid_enum_value"?{message:c??o.defaultError}:typeof o.data>"u"?{message:c??a??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:c??t??o.defaultError}},description:n}}var v=class{get description(){return this._def.description}_getType(e){return E(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:E(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new w,ctx:{common:e.parent.common,data:e.data,parsedType:E(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(se(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){let a={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:E(e)},n=this._parseSync({data:e,path:a.path,parent:a});return Ve(a,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:E(e)};if(!this["~standard"].async)try{let a=this._parseSync({data:e,path:[],parent:t});return F(a)?{value:a.value}:{issues:t.common.issues}}catch(a){a?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>F(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){let a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){let a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:E(e)},n=this._parse({data:e,path:a.path,parent:a}),s=await(se(n)?n:Promise.resolve(n));return Ve(a,s)}refine(e,t){let a=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,s)=>{let i=e(n),o=()=>s.addIssue({code:u.custom,...a(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((a,n)=>e(a)?!0:(n.addIssue(typeof t=="function"?t(a,n):t),!1))}_refinement(e){return new C({schema:this,typeName:d.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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:t=>this["~validate"](t)}}optional(){return N.create(this,this._def)}nullable(){return M.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return V.create(this)}promise(){return U.create(this,this._def)}or(e){return Y.create([this,e],this._def)}and(e){return K.create(this,e,this._def)}transform(e){return new C({..._(this._def),schema:this,typeName:d.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new te({..._(this._def),innerType:this,defaultValue:t,typeName:d.ZodDefault})}brand(){return new _e({typeName:d.ZodBranded,type:this,..._(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new re({..._(this._def),innerType:this,catchValue:t,typeName:d.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ve.create(this,e)}readonly(){return ae.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},kt=/^c[^\s-]{8,}$/i,wt=/^[0-9a-z]+$/,At=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Tt=/^[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,Ot=/^[a-z0-9_-]{21}$/i,St=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Pt=/^[-+]?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)?)??$/,jt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Nt="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",Se,Ct=/^(?:(?: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])$/,Zt=/^(?:(?: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])$/,Dt=/^(([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]))$/,Rt=/^(([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])$/,Et=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,It=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fe="((\\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])))",$t=new RegExp(`^${Fe}$`);function Ue(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Mt(r){return new RegExp(`^${Ue(r)}$`)}function zt(r){let e=`${Fe}T${Ue(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Lt(r,e){return!!((e==="v4"||!e)&&Ct.test(r)||(e==="v6"||!e)&&Dt.test(r))}function Vt(r,e){if(!St.test(r))return!1;try{let[t]=r.split(".");if(!t)return!1;let a=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(a));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function Ft(r,e){return!!((e==="v4"||!e)&&Zt.test(r)||(e==="v6"||!e)&&Rt.test(r))}var q=class r extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){let s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.string,received:s.parsedType}),h}let a=new w,n;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:u.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:u.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),a.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?l(n,{code:u.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&l(n,{code:u.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),a.dirty())}else if(s.kind==="email")jt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"email",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="emoji")Se||(Se=new RegExp(Nt,"u")),Se.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"emoji",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="uuid")Tt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"uuid",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="nanoid")Ot.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"nanoid",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid")kt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="cuid2")wt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cuid2",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="ulid")At.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ulid",code:u.invalid_string,message:s.message}),a.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),l(n,{validation:"url",code:u.invalid_string,message:s.message}),a.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"regex",code:u.invalid_string,message:s.message}),a.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),l(n,{code:u.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),a.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:u.invalid_string,validation:{startsWith:s.value},message:s.message}),a.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),l(n,{code:u.invalid_string,validation:{endsWith:s.value},message:s.message}),a.dirty()):s.kind==="datetime"?zt(s).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:u.invalid_string,validation:"datetime",message:s.message}),a.dirty()):s.kind==="date"?$t.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:u.invalid_string,validation:"date",message:s.message}),a.dirty()):s.kind==="time"?Mt(s).test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:u.invalid_string,validation:"time",message:s.message}),a.dirty()):s.kind==="duration"?Pt.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"duration",code:u.invalid_string,message:s.message}),a.dirty()):s.kind==="ip"?Lt(e.data,s.version)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"ip",code:u.invalid_string,message:s.message}),a.dirty()):s.kind==="jwt"?Vt(e.data,s.alg)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"jwt",code:u.invalid_string,message:s.message}),a.dirty()):s.kind==="cidr"?Ft(e.data,s.version)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"cidr",code:u.invalid_string,message:s.message}),a.dirty()):s.kind==="base64"?Et.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"base64",code:u.invalid_string,message:s.message}),a.dirty()):s.kind==="base64url"?It.test(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{validation:"base64url",code:u.invalid_string,message:s.message}),a.dirty()):x.assertNever(s);return{status:a.value,value:e.data}}_regex(e,t,a){return this.refinement(n=>e.test(n),{validation:t,code:u.invalid_string,...m.errToObj(a)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...m.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...m.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...m.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...m.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...m.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...m.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...m.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...m.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...m.errToObj(t)})}nonempty(e){return this.min(1,m.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};q.create=r=>new q({checks:[],typeName:d.ZodString,coerce:r?.coerce??!1,..._(r)});function Ut(r,e){let t=(r.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,n=t>a?t:a,s=Number.parseInt(r.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return s%i/10**n}var ie=class r extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){let s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.number,received:s.parsedType}),h}let a,n=new w;for(let s of this._def.checks)s.kind==="int"?x.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{code:u.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),l(a,{code:u.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),l(a,{code:u.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?Ut(e.data,s.value)!==0&&(a=this._getOrReturnCtx(e,a),l(a,{code:u.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),l(a,{code:u.not_finite,message:s.message}),n.dirty()):x.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,a,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:m.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:m.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:m.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&x.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}};ie.create=r=>new ie({checks:[],typeName:d.ZodNumber,coerce:r?.coerce||!1,..._(r)});var oe=class r extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let a,n=new w;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(a=this._getOrReturnCtx(e,a),l(a,{code:u.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(a=this._getOrReturnCtx(e,a),l(a,{code:u.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),l(a,{code:u.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):x.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return l(t,{code:u.invalid_type,expected:f.bigint,received:t.parsedType}),h}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,a,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:m.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:m.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};oe.create=r=>new oe({checks:[],typeName:d.ZodBigInt,coerce:r?.coerce??!1,..._(r)});var ce=class extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){let a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.boolean,received:a.parsedType}),h}return A(e.data)}};ce.create=r=>new ce({typeName:d.ZodBoolean,coerce:r?.coerce||!1,..._(r)});var ue=class r extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){let s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_type,expected:f.date,received:s.parsedType}),h}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return l(s,{code:u.invalid_date}),h}let a=new w,n;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:u.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),a.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),l(n,{code:u.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),a.dirty()):x.assertNever(s);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:m.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};ue.create=r=>new ue({checks:[],coerce:r?.coerce||!1,typeName:d.ZodDate,..._(r)});var de=class extends v{_parse(e){if(this._getType(e)!==f.symbol){let a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.symbol,received:a.parsedType}),h}return A(e.data)}};de.create=r=>new de({typeName:d.ZodSymbol,..._(r)});var J=class extends v{_parse(e){if(this._getType(e)!==f.undefined){let a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.undefined,received:a.parsedType}),h}return A(e.data)}};J.create=r=>new J({typeName:d.ZodUndefined,..._(r)});var H=class extends v{_parse(e){if(this._getType(e)!==f.null){let a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.null,received:a.parsedType}),h}return A(e.data)}};H.create=r=>new H({typeName:d.ZodNull,..._(r)});var le=class extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return A(e.data)}};le.create=r=>new le({typeName:d.ZodAny,..._(r)});var L=class extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return A(e.data)}};L.create=r=>new L({typeName:d.ZodUnknown,..._(r)});var R=class extends v{_parse(e){let t=this._getOrReturnCtx(e);return l(t,{code:u.invalid_type,expected:f.never,received:t.parsedType}),h}};R.create=r=>new R({typeName:d.ZodNever,..._(r)});var pe=class extends v{_parse(e){if(this._getType(e)!==f.undefined){let a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.void,received:a.parsedType}),h}return A(e.data)}};pe.create=r=>new pe({typeName:d.ZodVoid,..._(r)});var V=class r extends v{_parse(e){let{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==f.array)return l(t,{code:u.invalid_type,expected:f.array,received:t.parsedType}),h;if(n.exactLength!==null){let i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(l(t,{code:i?u.too_big:u.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(l(t,{code:u.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(l(t,{code:u.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new j(t,i,t.path,o)))).then(i=>w.mergeArray(a,i));let s=[...t.data].map((i,o)=>n.type._parseSync(new j(t,i,t.path,o)));return w.mergeArray(a,s)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:m.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:m.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:m.toString(t)}})}nonempty(e){return this.min(1,e)}};V.create=(r,e)=>new V({type:r,minLength:null,maxLength:null,exactLength:null,typeName:d.ZodArray,..._(e)});function W(r){if(r instanceof S){let e={};for(let t in r.shape){let a=r.shape[t];e[t]=N.create(W(a))}return new S({...r._def,shape:()=>e})}else return r instanceof V?new V({...r._def,type:W(r.element)}):r instanceof N?N.create(W(r.unwrap())):r instanceof M?M.create(W(r.unwrap())):r instanceof $?$.create(r.items.map(e=>W(e))):r}var S=class r extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=x.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){let p=this._getOrReturnCtx(e);return l(p,{code:u.invalid_type,expected:f.object,received:p.parsedType}),h}let{status:a,ctx:n}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof R&&this._def.unknownKeys==="strip"))for(let p in n.data)i.includes(p)||o.push(p);let c=[];for(let p of i){let g=s[p],P=n.data[p];c.push({key:{status:"valid",value:p},value:g._parse(new j(n,P,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof R){let p=this._def.unknownKeys;if(p==="passthrough")for(let g of o)c.push({key:{status:"valid",value:g},value:{status:"valid",value:n.data[g]}});else if(p==="strict")o.length>0&&(l(n,{code:u.unrecognized_keys,keys:o}),a.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let g of o){let P=n.data[g];c.push({key:{status:"valid",value:g},value:p._parse(new j(n,P,n.path,g)),alwaysSet:g in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let p=[];for(let g of c){let P=await g.key,Ie=await g.value;p.push({key:P,value:Ie,alwaysSet:g.alwaysSet})}return p}).then(p=>w.mergeObjectSync(a,p)):w.mergeObjectSync(a,c)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{let n=this._def.errorMap?.(t,a).message??a.defaultError;return t.code==="unrecognized_keys"?{message:m.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:d.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};for(let a of x.objectKeys(e))e[a]&&this.shape[a]&&(t[a]=this.shape[a]);return new r({...this._def,shape:()=>t})}omit(e){let t={};for(let a of x.objectKeys(this.shape))e[a]||(t[a]=this.shape[a]);return new r({...this._def,shape:()=>t})}deepPartial(){return W(this)}partial(e){let t={};for(let a of x.objectKeys(this.shape)){let n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()}return new r({...this._def,shape:()=>t})}required(e){let t={};for(let a of x.objectKeys(this.shape))if(e&&!e[a])t[a]=this.shape[a];else{let s=this.shape[a];for(;s instanceof N;)s=s._def.innerType;t[a]=s}return new r({...this._def,shape:()=>t})}keyof(){return Be(x.objectKeys(this.shape))}};S.create=(r,e)=>new S({shape:()=>r,unknownKeys:"strip",catchall:R.create(),typeName:d.ZodObject,..._(e)});S.strictCreate=(r,e)=>new S({shape:()=>r,unknownKeys:"strict",catchall:R.create(),typeName:d.ZodObject,..._(e)});S.lazycreate=(r,e)=>new S({shape:r,unknownKeys:"strip",catchall:R.create(),typeName:d.ZodObject,..._(e)});var Y=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),a=this._def.options;function n(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map(o=>new O(o.ctx.common.issues));return l(t,{code:u.invalid_union,unionErrors:i}),h}if(t.common.async)return Promise.all(a.map(async s=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let s,i=[];for(let c of a){let p={...t,common:{...t.common,issues:[]},parent:null},g=c._parseSync({data:t.data,path:t.path,parent:p});if(g.status==="valid")return g;g.status==="dirty"&&!s&&(s={result:g,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let o=i.map(c=>new O(c));return l(t,{code:u.invalid_union,unionErrors:o}),h}}get options(){return this._def.options}};Y.create=(r,e)=>new Y({options:r,typeName:d.ZodUnion,..._(e)});var I=r=>r instanceof G?I(r.schema):r instanceof C?I(r.innerType()):r instanceof Q?[r.value]:r instanceof X?r.options:r instanceof ee?x.objectValues(r.enum):r instanceof te?I(r._def.innerType):r instanceof J?[void 0]:r instanceof H?[null]:r instanceof N?[void 0,...I(r.unwrap())]:r instanceof M?[null,...I(r.unwrap())]:r instanceof _e||r instanceof ae?I(r.unwrap()):r instanceof re?I(r._def.innerType):[],Pe=class r extends v{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return l(t,{code:u.invalid_type,expected:f.object,received:t.parsedType}),h;let a=this.discriminator,n=t.data[a],s=this.optionsMap.get(n);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:u.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),h)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){let n=new Map;for(let s of t){let i=I(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,s)}}return new r({typeName:d.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,..._(a)})}};function je(r,e){let t=E(r),a=E(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&a===f.object){let n=x.objectKeys(e),s=x.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__;for(let o of s){if(o==="__proto__")continue;let c=je(r[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(t===f.array&&a===f.array){if(r.length!==e.length)return{valid:!1};let n=[];for(let s=0;s<r.length;s++){let i=r[s],o=e[s],c=je(i,o);if(!c.valid)return{valid:!1};n.push(c.data)}return{valid:!0,data:n}}else return t===f.date&&a===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var K=class extends v{_parse(e){let{status:t,ctx:a}=this._processInputParams(e),n=(s,i)=>{if(Te(s)||Te(i))return h;let o=je(s.value,i.value);return o.valid?((Oe(s)||Oe(i))&&t.dirty(),{status:t.value,value:o.data}):(l(a,{code:u.invalid_intersection_types}),h)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([s,i])=>n(s,i)):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};K.create=(r,e,t)=>new K({left:r,right:e,typeName:d.ZodIntersection,..._(t)});var $=class r extends v{_parse(e){let{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==f.array)return l(a,{code:u.invalid_type,expected:f.array,received:a.parsedType}),h;if(a.data.length<this._def.items.length)return l(a,{code:u.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),h;!this._def.rest&&a.data.length>this._def.items.length&&(l(a,{code:u.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let s=[...a.data].map((i,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new j(a,i,a.path,o)):null}).filter(i=>!!i);return a.common.async?Promise.all(s).then(i=>w.mergeArray(t,i)):w.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};$.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $({items:r,typeName:d.ZodTuple,rest:null,..._(e)})};var Ne=class r extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==f.object)return l(a,{code:u.invalid_type,expected:f.object,received:a.parsedType}),h;let n=[],s=this._def.keyType,i=this._def.valueType;for(let o in a.data)n.push({key:s._parse(new j(a,o,a.path,o)),value:i._parse(new j(a,a.data[o],a.path,o)),alwaysSet:o in a.data});return a.common.async?w.mergeObjectAsync(t,n):w.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,a){return t instanceof v?new r({keyType:e,valueType:t,typeName:d.ZodRecord,..._(a)}):new r({keyType:q.create(),valueType:e,typeName:d.ZodRecord,..._(t)})}},fe=class extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==f.map)return l(a,{code:u.invalid_type,expected:f.map,received:a.parsedType}),h;let n=this._def.keyType,s=this._def.valueType,i=[...a.data.entries()].map(([o,c],p)=>({key:n._parse(new j(a,o,a.path,[p,"key"])),value:s._parse(new j(a,c,a.path,[p,"value"]))}));if(a.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of i){let p=await c.key,g=await c.value;if(p.status==="aborted"||g.status==="aborted")return h;(p.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(p.value,g.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let c of i){let p=c.key,g=c.value;if(p.status==="aborted"||g.status==="aborted")return h;(p.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(p.value,g.value)}return{status:t.value,value:o}}}};fe.create=(r,e,t)=>new fe({valueType:e,keyType:r,typeName:d.ZodMap,..._(t)});var me=class r extends v{_parse(e){let{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==f.set)return l(a,{code:u.invalid_type,expected:f.set,received:a.parsedType}),h;let n=this._def;n.minSize!==null&&a.data.size<n.minSize.value&&(l(a,{code:u.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&a.data.size>n.maxSize.value&&(l(a,{code:u.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let s=this._def.valueType;function i(c){let p=new Set;for(let g of c){if(g.status==="aborted")return h;g.status==="dirty"&&t.dirty(),p.add(g.value)}return{status:t.value,value:p}}let o=[...a.data.values()].map((c,p)=>s._parse(new j(a,c,a.path,p)));return a.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,t){return new r({...this._def,minSize:{value:e,message:m.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:m.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};me.create=(r,e)=>new me({valueType:r,minSize:null,maxSize:null,typeName:d.ZodSet,..._(e)});var Ce=class r extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return l(t,{code:u.invalid_type,expected:f.function,received:t.parsedType}),h;function a(o,c){return ge({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ne(),z].filter(p=>!!p),issueData:{code:u.invalid_arguments,argumentsError:c}})}function n(o,c){return ge({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ne(),z].filter(p=>!!p),issueData:{code:u.invalid_return_type,returnTypeError:c}})}let s={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof U){let o=this;return A(async function(...c){let p=new O([]),g=await o._def.args.parseAsync(c,s).catch(Ae=>{throw p.addIssue(a(c,Ae)),p}),P=await Reflect.apply(i,this,g);return await o._def.returns._def.type.parseAsync(P,s).catch(Ae=>{throw p.addIssue(n(P,Ae)),p})})}else{let o=this;return A(function(...c){let p=o._def.args.safeParse(c,s);if(!p.success)throw new O([a(c,p.error)]);let g=Reflect.apply(i,this,p.data),P=o._def.returns.safeParse(g,s);if(!P.success)throw new O([n(g,P.error)]);return P.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:$.create(e).rest(L.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new r({args:e||$.create([]).rest(L.create()),returns:t||L.create(),typeName:d.ZodFunction,..._(a)})}},G=class extends v{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};G.create=(r,e)=>new G({getter:r,typeName:d.ZodLazy,..._(e)});var Q=class extends v{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:u.invalid_literal,expected:this._def.value}),h}return{status:"valid",value:e.data}}get value(){return this._def.value}};Q.create=(r,e)=>new Q({value:r,typeName:d.ZodLiteral,..._(e)});function Be(r,e){return new X({values:r,typeName:d.ZodEnum,..._(e)})}var X=class r extends v{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),a=this._def.values;return l(t,{expected:x.joinValues(a),received:t.parsedType,code:u.invalid_type}),h}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),a=this._def.values;return l(t,{received:t.data,code:u.invalid_enum_value,options:a}),h}return A(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,{...this._def,...t})}exclude(e,t=this._def){return r.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}};X.create=Be;var ee=class extends v{_parse(e){let t=x.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==f.string&&a.parsedType!==f.number){let n=x.objectValues(t);return l(a,{expected:x.joinValues(n),received:a.parsedType,code:u.invalid_type}),h}if(this._cache||(this._cache=new Set(x.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let n=x.objectValues(t);return l(a,{received:a.data,code:u.invalid_enum_value,options:n}),h}return A(e.data)}get enum(){return this._def.values}};ee.create=(r,e)=>new ee({values:r,typeName:d.ZodNativeEnum,..._(e)});var U=class extends v{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return l(t,{code:u.invalid_type,expected:f.promise,received:t.parsedType}),h;let a=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return A(a.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};U.create=(r,e)=>new U({type:r,typeName:d.ZodPromise,..._(e)});var C=class extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===d.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:i=>{l(a,i),i.fatal?t.abort():t.dirty()},get path(){return a.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let i=n.transform(a.data,s);if(a.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return h;let c=await this._def.schema._parseAsync({data:o,path:a.path,parent:a});return c.status==="aborted"?h:c.status==="dirty"?B(c.value):t.value==="dirty"?B(c.value):c});{if(t.value==="aborted")return h;let o=this._def.schema._parseSync({data:i,path:a.path,parent:a});return o.status==="aborted"?h:o.status==="dirty"?B(o.value):t.value==="dirty"?B(o.value):o}}if(n.type==="refinement"){let i=o=>{let c=n.refinement(o,s);if(a.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(a.common.async===!1){let o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return o.status==="aborted"?h:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>o.status==="aborted"?h:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(a.common.async===!1){let i=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!F(i))return h;let o=n.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(i=>F(i)?Promise.resolve(n.transform(i.value,s)).then(o=>({status:t.value,value:o})):h);x.assertNever(n)}};C.create=(r,e,t)=>new C({schema:r,typeName:d.ZodEffects,effect:e,..._(t)});C.createWithPreprocess=(r,e,t)=>new C({schema:e,effect:{type:"preprocess",transform:r},typeName:d.ZodEffects,..._(t)});var N=class extends v{_parse(e){return this._getType(e)===f.undefined?A(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};N.create=(r,e)=>new N({innerType:r,typeName:d.ZodOptional,..._(e)});var M=class extends v{_parse(e){return this._getType(e)===f.null?A(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};M.create=(r,e)=>new M({innerType:r,typeName:d.ZodNullable,..._(e)});var te=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),a=t.data;return t.parsedType===f.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};te.create=(r,e)=>new te({innerType:r,typeName:d.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});var re=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return se(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new O(a.common.issues)},input:a.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new O(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};re.create=(r,e)=>new re({innerType:r,typeName:d.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});var he=class extends v{_parse(e){if(this._getType(e)!==f.nan){let a=this._getOrReturnCtx(e);return l(a,{code:u.invalid_type,expected:f.nan,received:a.parsedType}),h}return{status:"valid",value:e.data}}};he.create=r=>new he({typeName:d.ZodNaN,..._(r)});var gr=Symbol("zod_brand"),_e=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}},ve=class r extends v{_parse(e){let{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?h:s.status==="dirty"?(t.dirty(),B(s.value)):this._def.out._parseAsync({data:s.value,path:a.path,parent:a})})();{let n=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?h:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:a.path,parent:a})}}static create(e,t){return new r({in:e,out:t,typeName:d.ZodPipeline})}},ae=class extends v{_parse(e){let t=this._def.innerType._parse(e),a=n=>(F(n)&&(n.value=Object.freeze(n.value)),n);return se(t)?t.then(n=>a(n)):a(t)}unwrap(){return this._def.innerType}};ae.create=(r,e)=>new ae({innerType:r,typeName:d.ZodReadonly,..._(e)});var _r={object:S.lazycreate},d;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(d||(d={}));var vr=q.create,xr=ie.create,br=he.create,kr=oe.create,wr=ce.create,Ar=ue.create,Tr=de.create,Or=J.create,Sr=H.create,Pr=le.create,jr=L.create,Nr=R.create,Cr=pe.create,Zr=V.create,Dr=S.create,Rr=S.strictCreate,Er=Y.create,Ir=Pe.create,$r=K.create,Mr=$.create,zr=Ne.create,Lr=fe.create,Vr=me.create,Fr=Ce.create,Ur=G.create,Br=Q.create,Wr=X.create,qr=ee.create,Jr=U.create,Hr=C.create,Yr=N.create,Kr=M.create,Gr=C.createWithPreprocess,Qr=ve.create;var xe=(r,e)=>{let t=0;for(;t<r.length&&t<e.length&&r[t]===e[t];t++);return[(r.length-t).toString(),...e.slice(t)].join("/")};function k(r){if(r.target!=="openAi")return{};let e=[...r.basePath,r.definitionPath,r.openAiAnyTypeName];return r.flags.hasReferencedOpenAiAnyType=!0,{$ref:r.$refStrategy==="relative"?xe(e,r.currentPath):e.join("/")}}function Ze(r,e,t,a){a?.errorMessages&&t&&(r.errorMessage={...r.errorMessage,[e]:t})}function b(r,e,t,a,n){r[e]=t,Ze(r,e,a,n)}function We(r,e){let t={type:"array"};return r.type?._def&&r.type?._def?.typeName!==d.ZodAny&&(t.items=y(r.type._def,{...e,currentPath:[...e.currentPath,"items"]})),r.minLength&&b(t,"minItems",r.minLength.value,r.minLength.message,e),r.maxLength&&b(t,"maxItems",r.maxLength.value,r.maxLength.message,e),r.exactLength&&(b(t,"minItems",r.exactLength.value,r.exactLength.message,e),b(t,"maxItems",r.exactLength.value,r.exactLength.message,e)),t}function qe(r,e){let t={type:"integer",format:"int64"};if(!r.checks)return t;for(let a of r.checks)switch(a.kind){case"min":e.target==="jsonSchema7"?a.inclusive?b(t,"minimum",a.value,a.message,e):b(t,"exclusiveMinimum",a.value,a.message,e):(a.inclusive||(t.exclusiveMinimum=!0),b(t,"minimum",a.value,a.message,e));break;case"max":e.target==="jsonSchema7"?a.inclusive?b(t,"maximum",a.value,a.message,e):b(t,"exclusiveMaximum",a.value,a.message,e):(a.inclusive||(t.exclusiveMaximum=!0),b(t,"maximum",a.value,a.message,e));break;case"multipleOf":b(t,"multipleOf",a.value,a.message,e);break}return t}function Je(){return{type:"boolean"}}function be(r,e){return y(r.type._def,e)}var He=(r,e)=>y(r.innerType._def,e);function De(r,e,t){let a=t??e.dateStrategy;if(Array.isArray(a))return{anyOf:a.map((n,s)=>De(r,e,n))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Bt(r,e)}}var Bt=(r,e)=>{let t={type:"integer",format:"unix-time"};if(e.target==="openApi3")return t;for(let a of r.checks)switch(a.kind){case"min":b(t,"minimum",a.value,a.message,e);break;case"max":b(t,"maximum",a.value,a.message,e);break}return t};function Ye(r,e){return{...y(r.innerType._def,e),default:r.defaultValue()}}function Ke(r,e){return e.effectStrategy==="input"?y(r.schema._def,e):k(e)}function Ge(r){return{type:"string",enum:Array.from(r.values)}}var Wt=r=>"type"in r&&r.type==="string"?!1:"allOf"in r;function Qe(r,e){let t=[y(r.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),y(r.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(s=>!!s),a=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,n=[];return t.forEach(s=>{if(Wt(s))n.push(...s.allOf),s.unevaluatedProperties===void 0&&(a=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:o,...c}=s;i=c}else a=void 0;n.push(i)}}),n.length?{allOf:n,...a}:void 0}function Xe(r,e){let t=typeof r.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(r.value)?"array":"object"}:e.target==="openApi3"?{type:t==="bigint"?"integer":t,enum:[r.value]}:{type:t==="bigint"?"integer":t,const:r.value}}var Re,Z={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Re===void 0&&(Re=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Re),uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function ke(r,e){let t={type:"string"};if(r.checks)for(let a of r.checks)switch(a.kind){case"min":b(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,a.value):a.value,a.message,e);break;case"max":b(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,a.value):a.value,a.message,e);break;case"email":switch(e.emailStrategy){case"format:email":D(t,"email",a.message,e);break;case"format:idn-email":D(t,"idn-email",a.message,e);break;case"pattern:zod":T(t,Z.email,a.message,e);break}break;case"url":D(t,"uri",a.message,e);break;case"uuid":D(t,"uuid",a.message,e);break;case"regex":T(t,a.regex,a.message,e);break;case"cuid":T(t,Z.cuid,a.message,e);break;case"cuid2":T(t,Z.cuid2,a.message,e);break;case"startsWith":T(t,RegExp(`^${Ee(a.value,e)}`),a.message,e);break;case"endsWith":T(t,RegExp(`${Ee(a.value,e)}$`),a.message,e);break;case"datetime":D(t,"date-time",a.message,e);break;case"date":D(t,"date",a.message,e);break;case"time":D(t,"time",a.message,e);break;case"duration":D(t,"duration",a.message,e);break;case"length":b(t,"minLength",typeof t.minLength=="number"?Math.max(t.minLength,a.value):a.value,a.message,e),b(t,"maxLength",typeof t.maxLength=="number"?Math.min(t.maxLength,a.value):a.value,a.message,e);break;case"includes":{T(t,RegExp(Ee(a.value,e)),a.message,e);break}case"ip":{a.version!=="v6"&&D(t,"ipv4",a.message,e),a.version!=="v4"&&D(t,"ipv6",a.message,e);break}case"base64url":T(t,Z.base64url,a.message,e);break;case"jwt":T(t,Z.jwt,a.message,e);break;case"cidr":{a.version!=="v6"&&T(t,Z.ipv4Cidr,a.message,e),a.version!=="v4"&&T(t,Z.ipv6Cidr,a.message,e);break}case"emoji":T(t,Z.emoji(),a.message,e);break;case"ulid":{T(t,Z.ulid,a.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{D(t,"binary",a.message,e);break}case"contentEncoding:base64":{b(t,"contentEncoding","base64",a.message,e);break}case"pattern:zod":{T(t,Z.base64,a.message,e);break}}break}case"nanoid":T(t,Z.nanoid,a.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return t}function Ee(r,e){return e.patternStrategy==="escape"?Jt(r):r}var qt=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Jt(r){let e="";for(let t=0;t<r.length;t++)qt.has(r[t])||(e+="\\"),e+=r[t];return e}function D(r,e,t,a){r.format||r.anyOf?.some(n=>n.format)?(r.anyOf||(r.anyOf=[]),r.format&&(r.anyOf.push({format:r.format,...r.errorMessage&&a.errorMessages&&{errorMessage:{format:r.errorMessage.format}}}),delete r.format,r.errorMessage&&(delete r.errorMessage.format,Object.keys(r.errorMessage).length===0&&delete r.errorMessage)),r.anyOf.push({format:e,...t&&a.errorMessages&&{errorMessage:{format:t}}})):b(r,"format",e,t,a)}function T(r,e,t,a){r.pattern||r.allOf?.some(n=>n.pattern)?(r.allOf||(r.allOf=[]),r.pattern&&(r.allOf.push({pattern:r.pattern,...r.errorMessage&&a.errorMessages&&{errorMessage:{pattern:r.errorMessage.pattern}}}),delete r.pattern,r.errorMessage&&(delete r.errorMessage.pattern,Object.keys(r.errorMessage).length===0&&delete r.errorMessage)),r.allOf.push({pattern:et(e,a),...t&&a.errorMessages&&{errorMessage:{pattern:t}}})):b(r,"pattern",et(e,a),t,a)}function et(r,e){if(!e.applyRegexFlags||!r.flags)return r.source;let t={i:r.flags.includes("i"),m:r.flags.includes("m"),s:r.flags.includes("s")},a=t.i?r.source.toLowerCase():r.source,n="",s=!1,i=!1,o=!1;for(let c=0;c<a.length;c++){if(s){n+=a[c],s=!1;continue}if(t.i){if(i){if(a[c].match(/[a-z]/)){o?(n+=a[c],n+=`${a[c-2]}-${a[c]}`.toUpperCase(),o=!1):a[c+1]==="-"&&a[c+2]?.match(/[a-z]/)?(n+=a[c],o=!0):n+=`${a[c]}${a[c].toUpperCase()}`;continue}}else if(a[c].match(/[a-z]/)){n+=`[${a[c]}${a[c].toUpperCase()}]`;continue}}if(t.m){if(a[c]==="^"){n+=`(^|(?<=[\r
4
+ ]))`;continue}else if(a[c]==="$"){n+=`($|(?=[\r
5
+ ]))`;continue}}if(t.s&&a[c]==="."){n+=i?`${a[c]}\r
6
+ `:`[${a[c]}\r
7
+ ]`;continue}n+=a[c],a[c]==="\\"?s=!0:i&&a[c]==="]"?i=!1:!i&&a[c]==="["&&(i=!0)}try{new RegExp(n)}catch{return console.warn(`Could not convert regex pattern at ${e.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),r.source}return n}function we(r,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&r.keyType?._def.typeName===d.ZodEnum)return{type:"object",required:r.keyType._def.values,properties:r.keyType._def.values.reduce((a,n)=>({...a,[n]:y(r.valueType._def,{...e,currentPath:[...e.currentPath,"properties",n]})??k(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let t={type:"object",additionalProperties:y(r.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return t;if(r.keyType?._def.typeName===d.ZodString&&r.keyType._def.checks?.length){let{type:a,...n}=ke(r.keyType._def,e);return{...t,propertyNames:n}}else{if(r.keyType?._def.typeName===d.ZodEnum)return{...t,propertyNames:{enum:r.keyType._def.values}};if(r.keyType?._def.typeName===d.ZodBranded&&r.keyType._def.type._def.typeName===d.ZodString&&r.keyType._def.type._def.checks?.length){let{type:a,...n}=be(r.keyType._def,e);return{...t,propertyNames:n}}}return t}function tt(r,e){if(e.mapStrategy==="record")return we(r,e);let t=y(r.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||k(e),a=y(r.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||k(e);return{type:"array",maxItems:125,items:{type:"array",items:[t,a],minItems:2,maxItems:2}}}function rt(r){let e=r.values,a=Object.keys(r.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),n=Array.from(new Set(a.map(s=>typeof s)));return{type:n.length===1?n[0]==="string"?"string":"number":["string","number"],enum:a}}function at(r){return r.target==="openAi"?void 0:{not:k({...r,currentPath:[...r.currentPath,"not"]})}}function nt(r){return r.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var ye={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function it(r,e){if(e.target==="openApi3")return st(r,e);let t=r.options instanceof Map?Array.from(r.options.values()):r.options;if(t.every(a=>a._def.typeName in ye&&(!a._def.checks||!a._def.checks.length))){let a=t.reduce((n,s)=>{let i=ye[s._def.typeName];return i&&!n.includes(i)?[...n,i]:n},[]);return{type:a.length>1?a:a[0]}}else if(t.every(a=>a._def.typeName==="ZodLiteral"&&!a.description)){let a=t.reduce((n,s)=>{let i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...n,i];case"bigint":return[...n,"integer"];case"object":if(s._def.value===null)return[...n,"null"];case"symbol":case"undefined":case"function":default:return n}},[]);if(a.length===t.length){let n=a.filter((s,i,o)=>o.indexOf(s)===i);return{type:n.length>1?n:n[0],enum:t.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(t.every(a=>a._def.typeName==="ZodEnum"))return{type:"string",enum:t.reduce((a,n)=>[...a,...n._def.values.filter(s=>!a.includes(s))],[])};return st(r,e)}var st=(r,e)=>{let t=(r.options instanceof Map?Array.from(r.options.values()):r.options).map((a,n)=>y(a._def,{...e,currentPath:[...e.currentPath,"anyOf",`${n}`]})).filter(a=>!!a&&(!e.strictUnions||typeof a=="object"&&Object.keys(a).length>0));return t.length?{anyOf:t}:void 0};function ot(r,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(r.innerType._def.typeName)&&(!r.innerType._def.checks||!r.innerType._def.checks.length))return e.target==="openApi3"?{type:ye[r.innerType._def.typeName],nullable:!0}:{type:[ye[r.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let a=y(r.innerType._def,{...e,currentPath:[...e.currentPath]});return a&&"$ref"in a?{allOf:[a],nullable:!0}:a&&{...a,nullable:!0}}let t=y(r.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return t&&{anyOf:[t,{type:"null"}]}}function ct(r,e){let t={type:"number"};if(!r.checks)return t;for(let a of r.checks)switch(a.kind){case"int":t.type="integer",Ze(t,"type",a.message,e);break;case"min":e.target==="jsonSchema7"?a.inclusive?b(t,"minimum",a.value,a.message,e):b(t,"exclusiveMinimum",a.value,a.message,e):(a.inclusive||(t.exclusiveMinimum=!0),b(t,"minimum",a.value,a.message,e));break;case"max":e.target==="jsonSchema7"?a.inclusive?b(t,"maximum",a.value,a.message,e):b(t,"exclusiveMaximum",a.value,a.message,e):(a.inclusive||(t.exclusiveMaximum=!0),b(t,"maximum",a.value,a.message,e));break;case"multipleOf":b(t,"multipleOf",a.value,a.message,e);break}return t}function ut(r,e){let t=e.target==="openAi",a={type:"object",properties:{}},n=[],s=r.shape();for(let o in s){let c=s[o];if(c===void 0||c._def===void 0)continue;let p=Yt(c);p&&t&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),p=!1);let g=y(c._def,{...e,currentPath:[...e.currentPath,"properties",o],propertyPath:[...e.currentPath,"properties",o]});g!==void 0&&(a.properties[o]=g,p||n.push(o))}n.length&&(a.required=n);let i=Ht(r,e);return i!==void 0&&(a.additionalProperties=i),a}function Ht(r,e){if(r.catchall._def.typeName!=="ZodNever")return y(r.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(r.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function Yt(r){try{return r.isOptional()}catch{return!0}}var dt=(r,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return y(r.innerType._def,e);let t=y(r.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return t?{anyOf:[{not:k(e)},t]}:k(e)};var lt=(r,e)=>{if(e.pipeStrategy==="input")return y(r.in._def,e);if(e.pipeStrategy==="output")return y(r.out._def,e);let t=y(r.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),a=y(r.out._def,{...e,currentPath:[...e.currentPath,"allOf",t?"1":"0"]});return{allOf:[t,a].filter(n=>n!==void 0)}};function pt(r,e){return y(r.type._def,e)}function ft(r,e){let a={type:"array",uniqueItems:!0,items:y(r.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return r.minSize&&b(a,"minItems",r.minSize.value,r.minSize.message,e),r.maxSize&&b(a,"maxItems",r.maxSize.value,r.maxSize.message,e),a}function mt(r,e){return r.rest?{type:"array",minItems:r.items.length,items:r.items.map((t,a)=>y(t._def,{...e,currentPath:[...e.currentPath,"items",`${a}`]})).reduce((t,a)=>a===void 0?t:[...t,a],[]),additionalItems:y(r.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:r.items.length,maxItems:r.items.length,items:r.items.map((t,a)=>y(t._def,{...e,currentPath:[...e.currentPath,"items",`${a}`]})).reduce((t,a)=>a===void 0?t:[...t,a],[])}}function ht(r){return{not:k(r)}}function yt(r){return k(r)}var gt=(r,e)=>y(r.innerType._def,e);var _t=(r,e,t)=>{switch(e){case d.ZodString:return ke(r,t);case d.ZodNumber:return ct(r,t);case d.ZodObject:return ut(r,t);case d.ZodBigInt:return qe(r,t);case d.ZodBoolean:return Je();case d.ZodDate:return De(r,t);case d.ZodUndefined:return ht(t);case d.ZodNull:return nt(t);case d.ZodArray:return We(r,t);case d.ZodUnion:case d.ZodDiscriminatedUnion:return it(r,t);case d.ZodIntersection:return Qe(r,t);case d.ZodTuple:return mt(r,t);case d.ZodRecord:return we(r,t);case d.ZodLiteral:return Xe(r,t);case d.ZodEnum:return Ge(r);case d.ZodNativeEnum:return rt(r);case d.ZodNullable:return ot(r,t);case d.ZodOptional:return dt(r,t);case d.ZodMap:return tt(r,t);case d.ZodSet:return ft(r,t);case d.ZodLazy:return()=>r.getter()._def;case d.ZodPromise:return pt(r,t);case d.ZodNaN:case d.ZodNever:return at(t);case d.ZodEffects:return Ke(r,t);case d.ZodAny:return k(t);case d.ZodUnknown:return yt(t);case d.ZodDefault:return Ye(r,t);case d.ZodBranded:return be(r,t);case d.ZodReadonly:return gt(r,t);case d.ZodCatch:return He(r,t);case d.ZodPipeline:return lt(r,t);case d.ZodFunction:case d.ZodVoid:case d.ZodSymbol:return;default:return(a=>{})(e)}};function y(r,e,t=!1){let a=e.seen.get(r);if(e.override){let o=e.override?.(r,e,a,t);if(o!==Me)return o}if(a&&!t){let o=Kt(a,e);if(o!==void 0)return o}let n={def:r,path:e.currentPath,jsonSchema:void 0};e.seen.set(r,n);let s=_t(r,r.typeName,e),i=typeof s=="function"?y(s(),e):s;if(i&&Gt(r,e,i),e.postProcess){let o=e.postProcess(i,r,e);return n.jsonSchema=i,o}return n.jsonSchema=i,i}var Kt=(r,e)=>{switch(e.$refStrategy){case"root":return{$ref:r.path.join("/")};case"relative":return{$ref:xe(e.currentPath,r.path)};case"none":case"seen":return r.path.length<e.currentPath.length&&r.path.every((t,a)=>e.currentPath[a]===t)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),k(e)):e.$refStrategy==="seen"?k(e):void 0}},Gt=(r,e,t)=>(r.description&&(t.description=r.description,e.markdownDescription&&(t.markdownDescription=r.description)),t);var vt=r=>{let e=ze(r),t=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:t,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([a,n])=>[n._def,{def:n._def,path:[...e.basePath,e.definitionPath,a],jsonSchema:void 0}]))}};var Qt=(r,e)=>{let t=vt(e),a=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((c,[p,g])=>({...c,[p]:y(g._def,{...t,currentPath:[...t.basePath,t.definitionPath,p]},!0)??k(t)}),{}):void 0,n=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,s=y(r._def,n===void 0?t:{...t,currentPath:[...t.basePath,t.definitionPath,n]},!1)??k(t),i=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;i!==void 0&&(s.title=i),t.flags.hasReferencedOpenAiAnyType&&(a||(a={}),a[t.openAiAnyTypeName]||(a[t.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:t.$refStrategy==="relative"?"1":[...t.basePath,t.definitionPath,t.openAiAnyTypeName].join("/")}}));let o=n===void 0?a?{...s,[t.definitionPath]:a}:s:{$ref:[...t.$refStrategy==="relative"?[]:t.basePath,t.definitionPath,n].join("/"),[t.definitionPath]:{...a,[n]:s}};return t.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":(t.target==="jsonSchema2019-09"||t.target==="openAi")&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),t.target==="openAi"&&("anyOf"in o||"oneOf"in o||"allOf"in o||"type"in o&&Array.isArray(o.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),o};export{Dr as a,Qt as b};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import{a as c,b as m}from"./chunk-DKGGJM6Z.js";import{Aa as u,Ca as n,H as f,X as s}from"./chunk-PIEH7J6J.js";async function y(r){await n();let e=s(r);return e==="null"?null:JSON.parse(e)}async function d(r){await n();let e;try{e=f(r)}catch{return null}if(e.length<8)return null;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),i=t.getUint32(0,!0),a=t.getUint32(4,!0),o=i*a*4;return e.length<8+o?null:{width:i,height:a,rgba:new Uint8ClampedArray(e.subarray(8,8+o))}}async function b(r,e=8){await n();let t=m(u,"decode_tiff_preview");if(!t)return d(r);try{return c(t(r,e))}catch{return null}}export{y as a,d as b,b as c};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
- var n=[{codec:"prores",label:"Apple ProRes",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"preview tier is DC-only 1/8 COLOR (2026-08-05 \u2014 was gray luma; Y+Cb+Cr DC walks, no AC/IDCT) \u2014 the realtime tier for BOTH playback and scrub: full 4K XQ decode is ~170ms/frame + a 35MB RGBA hand-off, which can hold neither 24fps nor a smooth scrub; the parked frame upgrades to full via the standard 160ms park timer (scrubPreview flipped true 2026-08-05 with the colour preview \u2014 the old 'full decode is scrub-fast' held for 2K 422, not 4K XQ). Both wrappers: .mov (sample table) and MXF OP1a (RDD 44, 2026-07-28 \u2014 is_prores_mxf routes the identical icpf bitstream through the walker via decode_prores_mxf; Suite ap4h fixture gated byte-exact vs ffmpeg 10-bit, rust tests/prores_mxf_gate.rs)"},{codec:"prores_raw",label:"Apple ProRes RAW",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"preview tier is a TRUE DC-only Bayer decode (2026-08-11 \u2014 was full entropy decode + subsample in develop): the DC-DPCM segment is a strict prefix of each tile component's bitstream, so the preview reads just those prefixes (no AC walk, no IDCT \u2014 real work reduction on single-threaded wasm), lands the exact closed-form flat value the full IDCT produces, and runs the SAME ACEScct develop on the 1/8 RGGB grid; Bayer-domain corr vs full block means 1.00000, developed-RGBA gate in tier_parity (aprh \u22650.99; aprn 0.93 floor \u2014 Jensen gap of the strongly-curved Panasonic linearisation, not a decode gap), ~50x native / ~70x serial-wasm-estimate vs Full. Bayer decode byte-exact vs ffmpeg 8.0; develop RE'd against Apple's own VideoToolbox decode \u2192 scene-linear Rec.2020 (decode_prores_raw_rec2020) / ACEScct. matrix=header cam\u2192XYZ; PER-SENSOR linearisation keyed on header fingerprint (Sony a7S III / Panasonic RE'd, joint fallback) fixes milky-black shadow toe \u2192 full-frame display vs Apple 13\u21923 codes (aprh) / 6\u21924 (aprn), oracle-gate 0.64%. Demosaic still bilinear (Apple adaptive; RE'd in oracle/media/prores_raw, deferred). Viewer tiers render ACEScct log (2026-07-26 \u2014 no baked Rec.709/sRGB; PRR has no vendor log curve, ACEScct is the transcode-grade log form)"},{codec:"h264",label:"H.264 / AVC",full:!0,preview:!0,luma:!1,scrubPreview:!0,backend:"webcodecs",notes:"scrub = nearest-keyframe snap (1 decode); exact frame on park"},{codec:"hevc",label:"HEVC / H.265",full:!0,preview:!0,luma:!1,scrubPreview:!0,backend:"webcodecs",notes:"scrub = nearest-keyframe snap (1 decode); exact frame on park"},{codec:"xavc",label:"Sony XAVC-Intra",full:!0,preview:!1,luma:!1,scrubPreview:!1,backend:"webcodecs",notes:"all-intra; already scrub-fast"},{codec:"h264_mxf",label:"H.264 long-GOP (MXF)",full:!0,preview:!0,luma:!1,scrubPreview:!0,backend:"webcodecs",notes:"Camera proxies (Sony CTAPA and kin): H.264 High long-GOP in MXF OP1a. SEPARATE from 'xavc' because XAVC-Intra is all-intra and this is not \u2014 measured on a 1224-frame CTAPA proxy: IBBP, I every 12, but a true RAP (index flag 0x80) only every 48; the intervening I-frames are open-GOP (flag 0x40) and are NOT legal entry points. Decoded by LongGopPlayer: walk the GOP from its RAP, first AU 'key' and the rest 'delta', outputs taken in EMISSION order (WebCodecs owns the B-frame reorder, so the index's temporal_offset is never interpreted). Whole GOP is cached, so any scrub inside those 2s is free. Until 2026-08-10 these files were misidentified as xavc and decoded one isolated AU at a time (submit + flush), so every P/B frame hit a decoder with no reference state, only the leading IDR ever decoded, and the viewer showed frame 0 forever. Gated by oracle/i2o/e2e/mxf-longgop-playback.spec.ts against ffmpeg"},{codec:"r3d",label:"RED R3D",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"Full + preview render NATIVE RWG/Log3G10 (2026-07-26 \u2014 IPP2 output LUT removed from decoders; display transforms are downstream)"},{codec:"arriraw",label:"ARRIRAW",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"EVERY STAGE BYTE-EXACT vs the ARRI SDK (2026-07-27): prep, the ADA-7 demosaic (0 of 15,690,240), the LuMaTaLu colour kernel (0 of 31,457,280 \u2014 closed by transcribing the SDK's own f32 op order: the LUT index is fmul-then-fadd not a fused mul_add, the B-spline weights are evaluated expanded with the sixth applied last, and the bicubic accumulates columns before rows), the 1:1 resample (identity) and AfaScaler+BufferScaler (0 of 43,739,136). The shipped master still omits AfaScaler's Rec.709 YCbCr detail and its Jenkins-hash grain \u2014 added looks, not native signal \u2014 so the end-to-end floor gate vs the SDK's DEFAULT output reads 0.16/255; colour is no part of that number. exact AWG4/LogC4 develop (2026-07-21, vs ARRI SDK); preview is colour via the same per-clip develop plan (tier gate corr \u22650.997). Pre-A35 12-bit ALEV-III (Mini/Mini LF) fully wired 2026-07-26: Gen2 develop to native AWG3/LogC3, SDK-gated MAE<0.8/255, probe inner_codec 'arriraw-alev3' \u2192 decode_arriraw12_mxf; other ALEV3 bodies decode flagged calib:parametric-alev3-family-unvalidated"},{codec:"dnxhr",label:"Avid DNxHR / DNxHD",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"DC-only 1/8 preview tier is COLOR (2026-08-05 \u2014 was gray luma) \u2014 playback + scrub ride it (4K/UHD DNxHR full decodes aren't scrub-fast); park upgrades to full"},{codec:"crm",label:"Canon Cinema RAW Light",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"preview LL tier develops through the SAME tone-exact Canon Log 2 path as Full (2026-07-26 \u2014 replaced the placeholder tone map that drifted -46/255)"},{codec:"braw",label:"Blackmagic RAW",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"per-clip WB develop (bmdf wkel/wtin \u2192 wb_grid tables; Pocket-6K-family sweep-validated); preview is COLOUR-accurate native Gen5 log (gate corr \u22650.996 vs downsampled full). ENTROPY-PROFILE GATED PER FRAME (rust braw::PROFILES): the frame-header ladder selects one of four separately-compiled SDK decoder families AND its dequant table, and it is per-frame rate-control output \u2014 NOT a per-clip constant (the old 'compression base' model was wrong; two encodes off the same PYXIS body carry different ladders). A frame whose exact ladder we have not captured tables for is refused with calib:unsupported-entropy-profile rather than decoded on a neighbouring quantiser. Captured profiles: (0,0,0,1) C013/C060 8\xD78 byte-exact; and the 12\xD712 family (SHIPPED 2026-07-26) \u2014 (1,2,3,4) URSA 12K, plus BOTH PYXIS encodes (0,1,2,4) and (0,0,1,2), which are the same camera at the same raster with quantisers half a step apart. That family is 12\xD712 luma / 12\xD76 chroma, 2 luma + Cb + Cr per unit off one threaded bit-reader; all four walks (full, multithreaded, DC preview, colour preview) are parametric over it. GRAIN + EDGE FILTER MODELLED 2026-07-26 \u2014 the decode is now essentially the SDK's literal output: the synthesized high-frequency PRNG grain is reproduced (scatter map verified 0 mismatches over 76,896 observations across two clips), its per-frame seed turns out to be carried IN the bitstream (16 BE bytes before the first tile) and re-seeded per tile as s1 ^= broadcast16(region<<5|vtile), and the post-IDCT block-edge filter (A*b + B*(a+c) >> 4) is applied. The filter's per-block STRENGTH byte is solved too (2026-07-26): it is transmitted, not derived - each unit ends with a [ctx+0x68]-bit field on its own reader (the skip the walk used to call 'hf_bias' and discard), packing four 2-bit weight selectors per block (bits 7:6/5:4 = the horizontal cut's two 6-px column spans, 3:2/1:0 = the vertical cut's two 6-px row spans); and the four weights are master[ladder[k]] with master[i] = (16-2i, i), so the header ladder IS the deblock strength ramp and no future profile needs a capture for it. BRAW IS BYTE-EXACT (2026-07-26). Frame-gated vs the SDK's own decoded.bin, through BOTH the oracle bitstream and the real .braw container path: all four captures \u2014 C060 (8x8), URSA 12K, and both PYXIS encodes \u2014 now differ from the SDK in ZERO samples, luma and chroma alike, across 208,099,712 luma samples; the gates assert max == 0 rather than a mean bound, because a tolerance cannot tell 'clean' from 'one wrong block in 400,000'. The last drift (11,248 URSA pixels off by one, ~0.014%) was never a modelling gap: the SDK computes an Arai-Agui-Nakajima SCALED DCT \u2014 coefficients premultiplied by s[u]*s[v] = c(k)/(2*cos(k*pi/2N)), then a unit-scale radix-3 x radix-4 butterfly \u2014 so a dense basis multiply is the same function through a DIFFERENT operation graph and rounds differently in f32, which is why f32, f32+FMA and f64 all missed. Both transforms (luma 12x12 @0x6e9c8, chroma 12x6 @0x6fc68) are now the SDK's literal dataflow, machine-transcribed by oracle/media/braw/t12_transcribe.py \u2014 a symbolic byte-slot emulator of the unrolled NEON \u2014 into the generated rust/media-core/src/codecs/braw_t12_idct.rs. The 8x8 family gains the same seed fix (whole-frame grain, no captured constant) AND the same edge filter: it was never a different algorithm, only a different compiled copy (@0x6b6a4) whose ladder (0,0,0,1) resolves to three identities plus one weak tap - C060 Y 1.76 -> 0.003. Also solved by censusing where the residual sat: the SDK runs horizontal before vertical; a vertical cut is governed by the block to its LEFT; the frame's final vertical cut is not filtered (the SDK handles cuts in pairs and drops the pair whose second cut leaves the frame); and the 8x8 byte is a nibble per block (7:6 h / 5:4 v for block 0, 3:2 h / 1:0 v for block 1). Both PYXIS profiles now carry captured grain quantisers (the PARIS original's were read once its volume was remounted). Also gated: the multithreaded walk is byte-identical to single-threaded, and both preview tiers are exact block means of the full decode (corr 1.0000). Still refused: Pocket 6K C040 (2,3,4,4) = a fourth algorithm. See oracle/media/braw/ENTROPY_PROFILE_RE.md"},{codec:"xocn",label:"Sony X-OCN",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"Full + preview render NATIVE S-Gamut3/S-Log3 (2026-07-26 \u2014 replaced the adaptive display transform); preview = LL-band-only decode (~1/8 per axis, ~90x faster), colour-consistent with Full by construction. Fitted sensors: Burano LT/8K (SBRg), Venice ST (SBRe), VENICE 2 8.6K (SBRf, 2026-07-26 \u2014 decodes via the same parametric geometry, own C0_VENICE2 matrix R\xB2\u22650.9994). X-OCN IS BYTE-EXACT ACROSS MODES (2026-07-27): LT 6K, Venice ST and Burano 8K all decode to ZERO differing samples vs libSonyRawDev's own decoder output \u2014 86,293,760 samples over the three, gated in tests/xocn_variant_gate.rs against hashes of the SDK's planes. Venice ST and 8K previously lost their top and bottom rows (28 and 12 rows; the interiors were already exact) because the band row ranges were formulas in the LL strip count n, read off the LT capture (y0=10, y1=8n-2 and friends) \u2014 those hold only when 8n == h + 12, which is an LT coincidence. The real rule (xocn::phase_chain): the standalone band carries the frame's h rows CENTRED in its 8n coded rows, and every coarser level is the even subset of the level below, so lo = a[k] and y14 = a[k] + n[k] fall out per level and reproduce LT's captured constants exactly. Settled by MEASURING the bitstream \u2014 strips are byte-aligned, so the row count of a strip is the count whose decode consumes its byte size (harness xocnstrip) \u2014 not by sweeping constants. The write-side dy row shift that used to paper over the phase is gone. SBRf/VENICE 2 decodes through the same path but is not yet re-gated byte-exact (fixture on PARIS)"}],o=new Map(n.map(r=>[r.codec,r]));function a(r){let e=(r??"").toLowerCase().trim();return e?e==="aprn"||e==="aprh"?"prores_raw":e==="prores_mxf"||e.startsWith("ap")?"prores":e==="arriraw-alev3"?"arriraw":e==="avc1"||e==="avc3"||e==="h264"?"h264":e.startsWith("hvc")||e.startsWith("hev")||e==="h265"?"hevc":e.startsWith("avd")||e==="dnxh"||e==="dnxhd"?"dnxhr":e==="redcode"?"r3d":o.has(e)?e:null:null}function s(r){let e=(r??"").toLowerCase().trim();if(!e)return null;if(e==="aprn"||e==="aprh"||a(e)==="prores_raw"||e==="ap4h"||e==="ap4x")return 12;if(e.startsWith("ap"))return 10;let t=a(e);return t==="r3d"?16:t==="arriraw"||t==="braw"?12:t==="xocn"?16:t==="crm"?12:/dnxhr.?(hqx|444)/.test(e)?10:null}function i(r,e){if(typeof e!="number")return null;let t=a(r);return t==="h264"?[66,77,88,100].includes(e)?8:e===110?10:null:t==="hevc"?e===1?8:e===2?10:null:null}export{a,s as b,i as c};
3
+ var n=[{codec:"prores",label:"Apple ProRes",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"preview tier is DC-only 1/8 COLOR (2026-08-05 \u2014 was gray luma; Y+Cb+Cr DC walks, no AC/IDCT) \u2014 the realtime tier for BOTH playback and scrub: full 4K XQ decode is ~170ms/frame + a 35MB RGBA hand-off, which can hold neither 24fps nor a smooth scrub; the parked frame upgrades to full via the standard 160ms park timer (scrubPreview flipped true 2026-08-05 with the colour preview \u2014 the old 'full decode is scrub-fast' held for 2K 422, not 4K XQ). Both wrappers: .mov (sample table) and MXF OP1a (RDD 44, 2026-07-28 \u2014 is_prores_mxf routes the identical icpf bitstream through the walker via decode_prores_mxf; Suite ap4h fixture gated byte-exact vs ffmpeg 10-bit, rust tests/prores_mxf_gate.rs)"},{codec:"prores_raw",label:"Apple ProRes RAW",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"preview tier is a TRUE DC-only Bayer decode (2026-08-11 \u2014 was full entropy decode + subsample in develop): the DC-DPCM segment is a strict prefix of each tile component's bitstream, so the preview reads just those prefixes (no AC walk, no IDCT \u2014 real work reduction on single-threaded wasm), lands the exact closed-form flat value the full IDCT produces, and runs the SAME ACEScct develop on the 1/8 RGGB grid; Bayer-domain corr vs full block means 1.00000, developed-RGBA gate in tier_parity (aprh \u22650.99; aprn 0.93 floor \u2014 Jensen gap of the strongly-curved Panasonic linearisation, not a decode gap), ~50x native / ~70x serial-wasm-estimate vs Full. Bayer decode byte-exact vs ffmpeg 8.0; develop RE'd against Apple's own VideoToolbox decode \u2192 scene-linear Rec.2020 (decode_prores_raw_rec2020) / ACEScct. matrix=header cam\u2192XYZ; PER-SENSOR linearisation keyed on header fingerprint (Sony a7S III / Panasonic RE'd, joint fallback) fixes milky-black shadow toe \u2192 full-frame display vs Apple 13\u21923 codes (aprh) / 6\u21924 (aprn), oracle-gate 0.64%. Demosaic still bilinear (Apple adaptive; RE'd in oracle/media/prores_raw, deferred). Viewer tiers render ACEScct log (2026-07-26 \u2014 no baked Rec.709/sRGB; PRR has no vendor log curve, ACEScct is the transcode-grade log form)"},{codec:"h264",label:"H.264 / AVC",full:!0,preview:!0,luma:!1,scrubPreview:!0,backend:"webcodecs",notes:"scrub = nearest-keyframe snap (1 decode); exact frame on park"},{codec:"hevc",label:"HEVC / H.265",full:!0,preview:!0,luma:!1,scrubPreview:!0,backend:"webcodecs",notes:"scrub = nearest-keyframe snap (1 decode); exact frame on park"},{codec:"xavc",label:"Sony XAVC-Intra",full:!0,preview:!1,luma:!1,scrubPreview:!1,backend:"webcodecs",notes:"all-intra; already scrub-fast"},{codec:"h264_mxf",label:"H.264 long-GOP (MXF)",full:!0,preview:!0,luma:!1,scrubPreview:!0,backend:"webcodecs",notes:"Camera proxies (Sony CTAPA and kin): H.264 High long-GOP in MXF OP1a. SEPARATE from 'xavc' because XAVC-Intra is all-intra and this is not \u2014 measured on a 1224-frame CTAPA proxy: IBBP, I every 12, but a true RAP (index flag 0x80) only every 48; the intervening I-frames are open-GOP (flag 0x40) and are NOT legal entry points. Decoded by LongGopPlayer: walk the GOP from its RAP, first AU 'key' and the rest 'delta', outputs taken in EMISSION order (WebCodecs owns the B-frame reorder, so the index's temporal_offset is never interpreted). Whole GOP is cached, so any scrub inside those 2s is free. Until 2026-08-10 these files were misidentified as xavc and decoded one isolated AU at a time (submit + flush), so every P/B frame hit a decoder with no reference state, only the leading IDR ever decoded, and the viewer showed frame 0 forever. Gated by oracle/i2o/e2e/mxf-longgop-playback.spec.ts against ffmpeg"},{codec:"r3d",label:"RED R3D",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"Full + preview render NATIVE RWG/Log3G10 (2026-07-26 \u2014 IPP2 output LUT removed from decoders; display transforms are downstream)"},{codec:"arriraw",label:"ARRIRAW",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"EVERY STAGE BYTE-EXACT vs the ARRI SDK (2026-07-27): prep, the ADA-7 demosaic (0 of 15,690,240), the LuMaTaLu colour kernel (0 of 31,457,280 \u2014 closed by transcribing the SDK's own f32 op order: the LUT index is fmul-then-fadd not a fused mul_add, the B-spline weights are evaluated expanded with the sixth applied last, and the bicubic accumulates columns before rows), the 1:1 resample (identity) and AfaScaler+BufferScaler (0 of 43,739,136). The shipped master still omits AfaScaler's Rec.709 YCbCr detail and its Jenkins-hash grain \u2014 added looks, not native signal \u2014 so the end-to-end floor gate vs the SDK's DEFAULT output reads 0.16/255; colour is no part of that number. exact AWG4/LogC4 develop (2026-07-21, vs ARRI SDK); preview is colour via the same per-clip develop plan (tier gate corr \u22650.997). Pre-A35 12-bit ALEV-III (Mini/Mini LF) fully wired 2026-07-26: Gen2 develop to native AWG3/LogC3, SDK-gated MAE<0.8/255, probe inner_codec 'arriraw-alev3' \u2192 decode_arriraw12_mxf; other ALEV3 bodies decode flagged calib:parametric-alev3-family-unvalidated"},{codec:"dnxhr",label:"Avid DNxHR / DNxHD",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"DC-only 1/8 preview tier is COLOR (2026-08-05 \u2014 was gray luma) \u2014 playback + scrub ride it (4K/UHD DNxHR full decodes aren't scrub-fast); park upgrades to full"},{codec:"crm",label:"Canon Cinema RAW Light",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"preview LL tier develops through the SAME tone-exact Canon Log 2 path as Full (2026-07-26 \u2014 replaced the placeholder tone map that drifted -46/255)"},{codec:"braw",label:"Blackmagic RAW",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"per-clip WB develop (bmdf wkel/wtin \u2192 wb_grid tables; Pocket-6K-family sweep-validated); preview is COLOUR-accurate native Gen5 log (gate corr \u22650.996 vs downsampled full). ENTROPY-PROFILE GATED PER FRAME (rust braw::PROFILES): the frame-header ladder selects one of four separately-compiled SDK decoder families AND its dequant table, and it is per-frame rate-control output \u2014 NOT a per-clip constant (the old 'compression base' model was wrong; two encodes off the same PYXIS body carry different ladders). A frame whose exact ladder we have not captured tables for is refused with calib:unsupported-entropy-profile rather than decoded on a neighbouring quantiser. Captured profiles: (0,0,0,1) C013/C060 8\xD78 byte-exact; and the 12\xD712 family (SHIPPED 2026-07-26) \u2014 (1,2,3,4) URSA 12K, plus BOTH PYXIS encodes (0,1,2,4) and (0,0,1,2), which are the same camera at the same raster with quantisers half a step apart. That family is 12\xD712 luma / 12\xD76 chroma, 2 luma + Cb + Cr per unit off one threaded bit-reader; all four walks (full, multithreaded, DC preview, colour preview) are parametric over it. GRAIN + EDGE FILTER MODELLED 2026-07-26 \u2014 the decode is now essentially the SDK's literal output: the synthesized high-frequency PRNG grain is reproduced (scatter map verified 0 mismatches over 76,896 observations across two clips), its per-frame seed turns out to be carried IN the bitstream (16 BE bytes before the first tile) and re-seeded per tile as s1 ^= broadcast16(region<<5|vtile), and the post-IDCT block-edge filter (A*b + B*(a+c) >> 4) is applied. The filter's per-block STRENGTH byte is solved too (2026-07-26): it is transmitted, not derived - each unit ends with a [ctx+0x68]-bit field on its own reader (the skip the walk used to call 'hf_bias' and discard), packing four 2-bit weight selectors per block (bits 7:6/5:4 = the horizontal cut's two 6-px column spans, 3:2/1:0 = the vertical cut's two 6-px row spans); and the four weights are master[ladder[k]] with master[i] = (16-2i, i), so the header ladder IS the deblock strength ramp and no future profile needs a capture for it. BRAW IS BYTE-EXACT (2026-07-26). Frame-gated vs the SDK's own decoded.bin, through BOTH the oracle bitstream and the real .braw container path: all four captures \u2014 C060 (8x8), URSA 12K, and both PYXIS encodes \u2014 now differ from the SDK in ZERO samples, luma and chroma alike, across 208,099,712 luma samples; the gates assert max == 0 rather than a mean bound, because a tolerance cannot tell 'clean' from 'one wrong block in 400,000'. The last drift (11,248 URSA pixels off by one, ~0.014%) was never a modelling gap: the SDK computes an Arai-Agui-Nakajima SCALED DCT \u2014 coefficients premultiplied by s[u]*s[v] = c(k)/(2*cos(k*pi/2N)), then a unit-scale radix-3 x radix-4 butterfly \u2014 so a dense basis multiply is the same function through a DIFFERENT operation graph and rounds differently in f32, which is why f32, f32+FMA and f64 all missed. Both transforms (luma 12x12 @0x6e9c8, chroma 12x6 @0x6fc68) are now the SDK's literal dataflow, machine-transcribed by oracle/media/braw/t12_transcribe.py \u2014 a symbolic byte-slot emulator of the unrolled NEON \u2014 into the generated rust/media-core/src/codecs/braw_t12_idct.rs. The 8x8 family gains the same seed fix (whole-frame grain, no captured constant) AND the same edge filter: it was never a different algorithm, only a different compiled copy (@0x6b6a4) whose ladder (0,0,0,1) resolves to three identities plus one weak tap - C060 Y 1.76 -> 0.003. Also solved by censusing where the residual sat: the SDK runs horizontal before vertical; a vertical cut is governed by the block to its LEFT; the frame's final vertical cut is not filtered (the SDK handles cuts in pairs and drops the pair whose second cut leaves the frame); and the 8x8 byte is a nibble per block (7:6 h / 5:4 v for block 0, 3:2 h / 1:0 v for block 1). Both PYXIS profiles now carry captured grain quantisers (the PARIS original's were read once its volume was remounted). Also gated: the multithreaded walk is byte-identical to single-threaded, and both preview tiers are exact block means of the full decode (corr 1.0000). Still refused: Pocket 6K C040 (2,3,4,4) = a fourth algorithm. See oracle/media/braw/ENTROPY_PROFILE_RE.md"},{codec:"xocn",label:"Sony X-OCN",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"Full + preview render NATIVE S-Gamut3/S-Log3 (2026-07-26 \u2014 replaced the adaptive display transform); preview = LL-band-only decode (~1/8 per axis, ~90x faster), colour-consistent with Full by construction. Fitted sensors: Burano LT/8K (SBRg), Venice ST (SBRe), VENICE 2 8.6K (SBRf, 2026-07-26 \u2014 decodes via the same parametric geometry, own C0_VENICE2 matrix R\xB2\u22650.9994). X-OCN IS BYTE-EXACT ACROSS MODES (2026-07-27): LT 6K, Venice ST and Burano 8K all decode to ZERO differing samples vs libSonyRawDev's own decoder output \u2014 86,293,760 samples over the three, gated in tests/xocn_variant_gate.rs against hashes of the SDK's planes. Venice ST and 8K previously lost their top and bottom rows (28 and 12 rows; the interiors were already exact) because the band row ranges were formulas in the LL strip count n, read off the LT capture (y0=10, y1=8n-2 and friends) \u2014 those hold only when 8n == h + 12, which is an LT coincidence. The real rule (xocn::phase_chain): the standalone band carries the frame's h rows CENTRED in its 8n coded rows, and every coarser level is the even subset of the level below, so lo = a[k] and y14 = a[k] + n[k] fall out per level and reproduce LT's captured constants exactly. Settled by MEASURING the bitstream \u2014 strips are byte-aligned, so the row count of a strip is the count whose decode consumes its byte size (harness xocnstrip) \u2014 not by sweeping constants. The write-side dy row shift that used to paper over the phase is gone. SBRf/VENICE 2 decodes through the same path but is not yet re-gated byte-exact (fixture on PARIS)"}],o=new Map(n.map(t=>[t.codec,t]));function a(t){let e=(t??"").toLowerCase().trim();return e?e==="aprn"||e==="aprh"?"prores_raw":e==="prores_mxf"||e.startsWith("ap")?"prores":e==="arriraw-alev3"?"arriraw":e==="avc1"||e==="avc3"||e==="h264"?"h264":e.startsWith("hvc")||e.startsWith("hev")||e==="h265"?"hevc":e.startsWith("avd")||e==="dnxh"||e==="dnxhd"?"dnxhr":e==="redcode"?"r3d":o.has(e)?e:null:null}function s(t){let e=(t??"").toLowerCase().trim();if(!e)return null;if(e==="aprn"||e==="aprh"||a(e)==="prores_raw"||e==="ap4h"||e==="ap4x")return 12;if(e.startsWith("ap"))return 10;let r=a(e);return r==="r3d"?16:r==="arriraw"||r==="braw"?12:r==="xocn"?16:r==="crm"?12:/dnxhr.?(hqx|444)/.test(e)?10:null}function i(t,e){if(typeof e!="number")return null;let r=a(t);return r==="h264"?[66,77,88,100].includes(e)?8:e===110?10:null:r==="hevc"?e===1?8:e===2?10:null:null}function l(t){let e=(t??"").toLowerCase().trim();if(!e)return null;if(e==="ap4h"||e==="ap4x")return"4:4:4";let r=a(e);return r==="prores_raw"||r==="r3d"||r==="arriraw"||r==="braw"||r==="xocn"||r==="crm"?"bayer":r==="prores"?"4:2:2":/dnxhr.?444/.test(e)?"4:4:4":/dnxhr.?(hqx|hq|sq|lb)/.test(e)?"4:2:2":null}function d(t){let e=t.toLowerCase().replace(/[^0-9a-z]/g,"");return e==="bayer"||e==="raw"?"bayer":e.length>=3&&/^\d+$/.test(e)?e.split("").join(":"):e}export{a,s as b,i as c,l as d,d as e};
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import{Ca as r,S as s,l as o}from"./chunk-PIEH7J6J.js";async function d(t){await r();let e=s(t);return e==="null"?null:JSON.parse(e)}async function l(t){await r();let e;try{e=o(t)}catch{return null}if(e.length<8)return null;let n=new DataView(e.buffer,e.byteOffset,e.byteLength),a=n.getUint32(0,!0),i=n.getUint32(4,!0),u=a*i*4;return e.length<8+u?null:{width:a,height:i,rgba:new Uint8ClampedArray(e.subarray(8,8+u))}}export{d as a,l as b};