allyhub 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (632) hide show
  1. package/dist/audio-text.js +1 -1
  2. package/dist/commands/add.js +2 -2
  3. package/dist/commands/cloud-tools.js +5 -5
  4. package/dist/commands/dev.js +1 -1
  5. package/dist/commands/frames/piece.js +1 -1
  6. package/dist/commands/frames/sheet.js +1 -1
  7. package/dist/commands/frames.js +8 -8
  8. package/dist/commands/index.js +1 -1
  9. package/dist/commands/inspect/common.js +1 -1
  10. package/dist/commands/inspect/layout.js +1 -1
  11. package/dist/commands/render.js +1 -1
  12. package/dist/commands/sheet.js +7 -7
  13. package/dist/commands/site.js +3 -2
  14. package/dist/commands/skills.js +3 -3
  15. package/dist/commands/slides.js +2 -2
  16. package/dist/node_modules/@allyhub-next/audio/dist/node/index.js +1 -1
  17. package/dist/node_modules/@allyhub-next/audio/dist/node/master.js +1 -1
  18. package/dist/node_modules/@allyhub-next/audio/package.json +1 -1
  19. package/dist/node_modules/@allyhub-next/browser/dist/html.js +1 -1
  20. package/dist/node_modules/@allyhub-next/browser/package.json +1 -1
  21. package/dist/node_modules/@allyhub-next/build/dist/content.d.ts +4 -0
  22. package/dist/node_modules/@allyhub-next/build/dist/content.js +1 -1
  23. package/dist/node_modules/@allyhub-next/build/dist/index.d.ts +2 -2
  24. package/dist/node_modules/@allyhub-next/build/dist/index.js +1 -1
  25. package/dist/node_modules/@allyhub-next/build/dist/meta-worker.d.ts +2 -2
  26. package/dist/node_modules/@allyhub-next/build/dist/meta-worker.js +3 -3
  27. package/dist/node_modules/@allyhub-next/build/dist/move-refs.d.ts +1 -1
  28. package/dist/node_modules/@allyhub-next/build/dist/move-refs.js +1 -1
  29. package/dist/node_modules/@allyhub-next/build/dist/plugin.d.ts +12 -3
  30. package/dist/node_modules/@allyhub-next/build/dist/plugin.js +7 -6
  31. package/dist/node_modules/@allyhub-next/build/dist/prepare.d.ts +9 -5
  32. package/dist/node_modules/@allyhub-next/build/dist/prepare.js +2 -2
  33. package/dist/node_modules/@allyhub-next/build/dist/vite.d.ts +10 -0
  34. package/dist/node_modules/@allyhub-next/build/dist/vite.js +2 -2
  35. package/dist/node_modules/@allyhub-next/build/package.json +1 -1
  36. package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +2 -2
  37. package/dist/node_modules/@allyhub-next/chart/dist/chart.d.ts +14 -5
  38. package/dist/node_modules/@allyhub-next/chart/dist/chart.js +1 -1
  39. package/dist/node_modules/@allyhub-next/chart/package.json +1 -1
  40. package/dist/node_modules/@allyhub-next/check/dist/check.js +3 -3
  41. package/dist/node_modules/@allyhub-next/check/package.json +1 -1
  42. package/dist/node_modules/@allyhub-next/cloud/dist/blobs.js +2 -0
  43. package/dist/node_modules/@allyhub-next/cloud/dist/call.js +4 -2
  44. package/dist/node_modules/@allyhub-next/cloud/dist/client.js +1 -1
  45. package/dist/node_modules/@allyhub-next/cloud/dist/errors.js +1 -1
  46. package/dist/node_modules/@allyhub-next/cloud/dist/hashes.js +2 -0
  47. package/dist/node_modules/@allyhub-next/cloud/dist/index.js +1 -1
  48. package/dist/node_modules/@allyhub-next/cloud/dist/sites.js +2 -0
  49. package/dist/node_modules/@allyhub-next/cloud/dist/voice.js +1 -1
  50. package/dist/node_modules/@allyhub-next/cloud/package.json +1 -1
  51. package/dist/node_modules/@allyhub-next/components/package.json +1 -1
  52. package/dist/node_modules/@allyhub-next/components/r/caption-subtitle.json +1 -1
  53. package/dist/node_modules/@allyhub-next/components/src/caption-subtitle.ts +54 -16
  54. package/dist/node_modules/@allyhub-next/dev-server/dist/background.js +1 -1
  55. package/dist/node_modules/@allyhub-next/dev-server/dist/exports.js +1 -1
  56. package/dist/node_modules/@allyhub-next/dev-server/dist/fonts.js +2 -0
  57. package/dist/node_modules/@allyhub-next/dev-server/dist/index.js +1 -1
  58. package/dist/node_modules/@allyhub-next/dev-server/dist/live.js +1 -1
  59. package/dist/node_modules/@allyhub-next/dev-server/dist/project.js +1 -1
  60. package/dist/node_modules/@allyhub-next/dev-server/dist/reach.js +2 -0
  61. package/dist/node_modules/@allyhub-next/dev-server/dist/record.js +2 -0
  62. package/dist/node_modules/@allyhub-next/dev-server/dist/server.js +2 -2
  63. package/dist/node_modules/@allyhub-next/dev-server/dist/tools.js +1 -1
  64. package/dist/node_modules/@allyhub-next/dev-server/dist/tree.js +2 -0
  65. package/dist/node_modules/@allyhub-next/dev-server/package.json +1 -1
  66. package/dist/node_modules/@allyhub-next/doc/package.json +1 -1
  67. package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.js +1 -1
  68. package/dist/node_modules/@allyhub-next/export/dist/export.js +5 -5
  69. package/dist/node_modules/@allyhub-next/export/dist/index.js +1 -1
  70. package/dist/node_modules/@allyhub-next/export/package.json +1 -1
  71. package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.d.ts +205 -0
  72. package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.js +2 -0
  73. package/dist/node_modules/@allyhub-next/formats/dist/data/script.d.ts +4 -1
  74. package/dist/node_modules/@allyhub-next/formats/dist/data/script.js +1 -1
  75. package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +248 -18
  76. package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +1 -1
  77. package/dist/node_modules/@allyhub-next/formats/dist/data/slides.d.ts +1114 -91
  78. package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +1 -1
  79. package/dist/node_modules/@allyhub-next/formats/dist/data/website.d.ts +20 -0
  80. package/dist/node_modules/@allyhub-next/formats/dist/data/website.js +2 -0
  81. package/dist/node_modules/@allyhub-next/formats/dist/index.d.ts +4 -0
  82. package/dist/node_modules/@allyhub-next/formats/dist/index.js +1 -1
  83. package/dist/node_modules/@allyhub-next/formats/dist/items.d.ts +1 -1
  84. package/dist/node_modules/@allyhub-next/formats/dist/items.js +1 -1
  85. package/dist/node_modules/@allyhub-next/formats/dist/media-type.d.ts +3 -0
  86. package/dist/node_modules/@allyhub-next/formats/dist/media-type.js +2 -0
  87. package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +625 -30
  88. package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +1 -1
  89. package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +2 -0
  90. package/dist/node_modules/@allyhub-next/formats/dist/strict.js +1 -1
  91. package/dist/node_modules/@allyhub-next/formats/dist/zip.d.ts +17 -0
  92. package/dist/node_modules/@allyhub-next/formats/dist/zip.js +2 -0
  93. package/dist/node_modules/@allyhub-next/formats/package.json +2 -1
  94. package/dist/node_modules/@allyhub-next/measure/package.json +1 -1
  95. package/dist/node_modules/@allyhub-next/media/dist/index.d.ts +1 -1
  96. package/dist/node_modules/@allyhub-next/media/dist/index.js +1 -1
  97. package/dist/node_modules/@allyhub-next/media/dist/sheet.d.ts +2 -0
  98. package/dist/node_modules/@allyhub-next/media/dist/sheet.js +7 -7
  99. package/dist/node_modules/@allyhub-next/media/package.json +1 -1
  100. package/dist/node_modules/@allyhub-next/model/package.json +1 -1
  101. package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.d.ts +31 -0
  102. package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.js +2 -0
  103. package/dist/node_modules/@allyhub-next/ooxml/dist/color.d.ts +33 -0
  104. package/dist/node_modules/@allyhub-next/ooxml/dist/color.js +2 -0
  105. package/dist/node_modules/@allyhub-next/ooxml/dist/enums.d.ts +13 -0
  106. package/dist/node_modules/@allyhub-next/ooxml/dist/enums.js +2 -0
  107. package/dist/node_modules/@allyhub-next/ooxml/dist/ext.d.ts +79 -0
  108. package/dist/node_modules/@allyhub-next/ooxml/dist/ext.js +2 -0
  109. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.d.ts +132 -0
  110. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.js +2 -0
  111. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.d.ts +28 -0
  112. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.js +2 -0
  113. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.d.ts +4708 -0
  114. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.js +2 -0
  115. package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.d.ts +57 -0
  116. package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.js +2 -0
  117. package/dist/node_modules/@allyhub-next/ooxml/dist/index.d.ts +10 -0
  118. package/dist/node_modules/@allyhub-next/ooxml/dist/index.js +2 -0
  119. package/dist/node_modules/@allyhub-next/ooxml/dist/mce.d.ts +12 -0
  120. package/dist/node_modules/@allyhub-next/ooxml/dist/mce.js +2 -0
  121. package/dist/node_modules/@allyhub-next/ooxml/dist/node.d.ts +111 -0
  122. package/dist/node_modules/@allyhub-next/ooxml/dist/node.js +2 -0
  123. package/dist/node_modules/@allyhub-next/ooxml/dist/ns.d.ts +45 -0
  124. package/dist/node_modules/@allyhub-next/ooxml/dist/ns.js +2 -0
  125. package/dist/node_modules/@allyhub-next/ooxml/dist/opc.d.ts +48 -0
  126. package/dist/node_modules/@allyhub-next/ooxml/dist/opc.js +2 -0
  127. package/dist/node_modules/@allyhub-next/ooxml/dist/report.d.ts +45 -0
  128. package/dist/node_modules/@allyhub-next/ooxml/dist/report.js +2 -0
  129. package/dist/node_modules/@allyhub-next/ooxml/dist/xml.d.ts +28 -0
  130. package/dist/node_modules/@allyhub-next/ooxml/dist/xml.js +2 -0
  131. package/dist/node_modules/@allyhub-next/ooxml/package.json +26 -0
  132. package/dist/node_modules/@allyhub-next/project/dist/deck-keys.js +2 -0
  133. package/dist/node_modules/@allyhub-next/project/dist/deck-measure.js +2 -0
  134. package/dist/node_modules/@allyhub-next/project/dist/deck-pool.js +2 -0
  135. package/dist/node_modules/@allyhub-next/project/dist/index.js +1 -1
  136. package/dist/node_modules/@allyhub-next/project/dist/session.js +1 -1
  137. package/dist/node_modules/@allyhub-next/project/dist/stills.js +2 -0
  138. package/dist/node_modules/@allyhub-next/project/package.json +1 -1
  139. package/dist/node_modules/@allyhub-next/protocol/dist/account.d.ts +338 -0
  140. package/dist/node_modules/@allyhub-next/protocol/dist/account.js +2 -0
  141. package/dist/node_modules/@allyhub-next/protocol/dist/auth.d.ts +12 -13
  142. package/dist/node_modules/@allyhub-next/protocol/dist/auth.js +1 -1
  143. package/dist/node_modules/@allyhub-next/protocol/dist/blobs.d.ts +35 -0
  144. package/dist/node_modules/@allyhub-next/protocol/dist/blobs.js +2 -0
  145. package/dist/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +101 -32
  146. package/dist/node_modules/@allyhub-next/protocol/dist/cloud.js +1 -1
  147. package/dist/node_modules/@allyhub-next/protocol/dist/editor.d.ts +89 -5
  148. package/dist/node_modules/@allyhub-next/protocol/dist/editor.js +1 -1
  149. package/dist/node_modules/@allyhub-next/protocol/dist/files.d.ts +2 -2
  150. package/dist/node_modules/@allyhub-next/protocol/dist/index.d.ts +6 -0
  151. package/dist/node_modules/@allyhub-next/protocol/dist/index.js +1 -1
  152. package/dist/node_modules/@allyhub-next/protocol/dist/notes.d.ts +23 -0
  153. package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +1 -1
  154. package/dist/node_modules/@allyhub-next/protocol/dist/open.d.ts +13 -0
  155. package/dist/node_modules/@allyhub-next/protocol/dist/open.js +2 -0
  156. package/dist/node_modules/@allyhub-next/protocol/dist/registry.d.ts +73 -59
  157. package/dist/node_modules/@allyhub-next/protocol/dist/registry.js +1 -1
  158. package/dist/node_modules/@allyhub-next/protocol/dist/routes.d.ts +1 -1
  159. package/dist/node_modules/@allyhub-next/protocol/dist/routes.js +1 -1
  160. package/dist/node_modules/@allyhub-next/protocol/dist/shares.d.ts +115 -0
  161. package/dist/node_modules/@allyhub-next/protocol/dist/shares.js +2 -0
  162. package/dist/node_modules/@allyhub-next/protocol/dist/sites.d.ts +293 -0
  163. package/dist/node_modules/@allyhub-next/protocol/dist/sites.js +2 -0
  164. package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.d.ts +377 -0
  165. package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.js +2 -0
  166. package/dist/node_modules/@allyhub-next/protocol/dist/teams.d.ts +27 -9
  167. package/dist/node_modules/@allyhub-next/protocol/dist/teams.js +1 -1
  168. package/dist/node_modules/@allyhub-next/protocol/dist/tools.d.ts +53 -14
  169. package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +1 -1
  170. package/dist/node_modules/@allyhub-next/protocol/package.json +2 -1
  171. package/dist/node_modules/@allyhub-next/registry/package.json +1 -1
  172. package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.js +3 -2
  173. package/dist/node_modules/@allyhub-next/render/dist/doc/index.js +1 -1
  174. package/dist/node_modules/@allyhub-next/render/dist/doc/pdf.js +34 -0
  175. package/dist/node_modules/@allyhub-next/render/dist/doc/print.js +4 -4
  176. package/dist/node_modules/@allyhub-next/render/dist/exports.js +2 -2
  177. package/dist/node_modules/@allyhub-next/render/dist/pdf.js +2 -0
  178. package/dist/node_modules/@allyhub-next/render/package.json +1 -1
  179. package/dist/node_modules/@allyhub-next/runtime/dist/fonts.js +1 -1
  180. package/dist/node_modules/@allyhub-next/runtime/dist/music.js +1 -1
  181. package/dist/node_modules/@allyhub-next/runtime/package.json +1 -1
  182. package/dist/node_modules/@allyhub-next/runtimes/package.json +1 -1
  183. package/dist/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +25 -5
  184. package/dist/node_modules/@allyhub-next/scaffold/dist/index.js +4 -4
  185. package/dist/node_modules/@allyhub-next/scaffold/package.json +1 -1
  186. package/dist/node_modules/@allyhub-next/scenery/package.json +1 -1
  187. package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.d.ts +10 -0
  188. package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.js +3 -3
  189. package/dist/node_modules/@allyhub-next/scenery-host/package.json +1 -1
  190. package/dist/node_modules/@allyhub-next/sheet/dist/api/capabilities.js +1 -1
  191. package/dist/node_modules/@allyhub-next/sheet/dist/api/index.d.ts +1 -0
  192. package/dist/node_modules/@allyhub-next/sheet/dist/api/index.js +1 -1
  193. package/dist/node_modules/@allyhub-next/sheet/dist/api/page.d.ts +83 -0
  194. package/dist/node_modules/@allyhub-next/sheet/dist/api/page.js +2 -0
  195. package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.d.ts +40 -1
  196. package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.js +1 -1
  197. package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +9 -3
  198. package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +1 -1
  199. package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +5 -1
  200. package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +1 -1
  201. package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +60 -13
  202. package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +1 -1
  203. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +1 -1
  204. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.d.ts +4 -0
  205. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.js +2 -0
  206. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +1 -1
  207. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +1 -1
  208. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +1 -1
  209. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +27 -1
  210. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +1 -1
  211. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.d.ts +16 -0
  212. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.js +2 -0
  213. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +18 -1
  214. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +1 -1
  215. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +1 -1
  216. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +2 -0
  217. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +1 -1
  218. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +1 -1
  219. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +1 -1
  220. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +1 -1
  221. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +1 -1
  222. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +1 -1
  223. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.d.ts +2 -0
  224. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.js +2 -0
  225. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +1 -1
  226. package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.d.ts +38 -0
  227. package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.js +2 -0
  228. package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.d.ts +19 -0
  229. package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.js +2 -0
  230. package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.d.ts +49 -0
  231. package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.js +2 -0
  232. package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.d.ts +82 -0
  233. package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.js +2 -0
  234. package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +6 -1
  235. package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +1 -1
  236. package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +1 -1
  237. package/dist/node_modules/@allyhub-next/sheet/dist/check.js +1 -1
  238. package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +15 -0
  239. package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +1 -1
  240. package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +29 -8
  241. package/dist/node_modules/@allyhub-next/sheet/dist/export.js +3 -4
  242. package/dist/node_modules/@allyhub-next/sheet/dist/file.js +2 -2
  243. package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +8 -2
  244. package/dist/node_modules/@allyhub-next/sheet/dist/format.js +1 -1
  245. package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +52 -4
  246. package/dist/node_modules/@allyhub-next/sheet/dist/html.js +43 -11
  247. package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +7 -3
  248. package/dist/node_modules/@allyhub-next/sheet/dist/index.js +1 -1
  249. package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +1 -1
  250. package/dist/node_modules/@allyhub-next/sheet/dist/paginate.d.ts +98 -0
  251. package/dist/node_modules/@allyhub-next/sheet/dist/paginate.js +2 -0
  252. package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +1 -1
  253. package/dist/node_modules/@allyhub-next/sheet/dist/table-style.d.ts +32 -0
  254. package/dist/node_modules/@allyhub-next/sheet/dist/table-style.js +2 -0
  255. package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.d.ts +3 -0
  256. package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.js +2 -0
  257. package/dist/node_modules/@allyhub-next/sheet/dist/values.js +1 -1
  258. package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +10 -1
  259. package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +1 -1
  260. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +12 -1
  261. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +1 -1
  262. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +14 -4
  263. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +2 -2
  264. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +11 -1
  265. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +36 -16
  266. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +6 -1
  267. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +1 -1
  268. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +44 -2
  269. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -1
  270. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.d.ts +23 -0
  271. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.js +2 -0
  272. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +2 -0
  273. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +1 -1
  274. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +6 -0
  275. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +1 -1
  276. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.d.ts +40 -0
  277. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.js +2 -0
  278. package/dist/node_modules/@allyhub-next/sheet/package.json +1 -1
  279. package/dist/node_modules/@allyhub-next/slides-core/dist/animation.js +1 -1
  280. package/dist/node_modules/@allyhub-next/slides-core/dist/api.d.ts +121 -44
  281. package/dist/node_modules/@allyhub-next/slides-core/dist/api.js +2 -2
  282. package/dist/node_modules/@allyhub-next/slides-core/dist/capabilities.js +1 -1
  283. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.d.ts +50 -13
  284. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +1 -1
  285. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-file.js +1 -1
  286. package/dist/node_modules/@allyhub-next/slides-core/dist/check.js +1 -1
  287. package/dist/node_modules/@allyhub-next/slides-core/dist/code.d.ts +33 -0
  288. package/dist/node_modules/@allyhub-next/slides-core/dist/code.js +2 -0
  289. package/dist/node_modules/@allyhub-next/slides-core/dist/components.d.ts +31 -0
  290. package/dist/node_modules/@allyhub-next/slides-core/dist/components.js +2 -0
  291. package/dist/node_modules/@allyhub-next/slides-core/dist/enums.d.ts +188 -5
  292. package/dist/node_modules/@allyhub-next/slides-core/dist/enums.js +1 -1
  293. package/dist/node_modules/@allyhub-next/slides-core/dist/file.d.ts +43 -21
  294. package/dist/node_modules/@allyhub-next/slides-core/dist/file.js +3 -3
  295. package/dist/node_modules/@allyhub-next/slides-core/dist/identity.d.ts +17 -0
  296. package/dist/node_modules/@allyhub-next/slides-core/dist/identity.js +2 -0
  297. package/dist/node_modules/@allyhub-next/slides-core/dist/index.d.ts +5 -0
  298. package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +1 -1
  299. package/dist/node_modules/@allyhub-next/slides-core/dist/lang.d.ts +6 -0
  300. package/dist/node_modules/@allyhub-next/slides-core/dist/lang.js +2 -0
  301. package/dist/node_modules/@allyhub-next/slides-core/dist/measure.js +1 -1
  302. package/dist/node_modules/@allyhub-next/slides-core/dist/merge.d.ts +58 -0
  303. package/dist/node_modules/@allyhub-next/slides-core/dist/merge.js +2 -0
  304. package/dist/node_modules/@allyhub-next/slides-core/dist/model.d.ts +38 -4
  305. package/dist/node_modules/@allyhub-next/slides-core/dist/office.d.ts +27 -1
  306. package/dist/node_modules/@allyhub-next/slides-core/dist/office.js +1 -1
  307. package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.d.ts +26 -5
  308. package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.js +1 -1
  309. package/dist/node_modules/@allyhub-next/slides-core/dist/script.d.ts +18 -16
  310. package/dist/node_modules/@allyhub-next/slides-core/dist/script.js +2 -2
  311. package/dist/node_modules/@allyhub-next/slides-core/dist/stage.d.ts +51 -53
  312. package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +1 -1
  313. package/dist/node_modules/@allyhub-next/slides-core/dist/units.d.ts +27 -0
  314. package/dist/node_modules/@allyhub-next/slides-core/dist/units.js +1 -1
  315. package/dist/node_modules/@allyhub-next/slides-core/dist/values.d.ts +7 -0
  316. package/dist/node_modules/@allyhub-next/slides-core/dist/values.js +2 -0
  317. package/dist/node_modules/@allyhub-next/slides-core/package.json +1 -1
  318. package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.js +1 -1
  319. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/code.js +4 -0
  320. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/index.js +3 -0
  321. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/names.js +2 -0
  322. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/script.js +2 -0
  323. package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.js +1 -1
  324. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/chart.js +2 -0
  325. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/common.js +2 -0
  326. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/index.js +4 -0
  327. package/dist/{site.js → node_modules/@allyhub-next/slides-pptx/dist/read/model.js} +1 -1
  328. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/shapes.js +2 -0
  329. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/table.js +2 -0
  330. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/text.js +2 -0
  331. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/timing.js +2 -0
  332. package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.js +1 -1
  333. package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.js +1 -1
  334. package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.js +1 -1
  335. package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.js +1 -1
  336. package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.js +2 -2
  337. package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.js +2 -2
  338. package/dist/node_modules/@allyhub-next/slides-pptx/package.json +1 -1
  339. package/dist/node_modules/@allyhub-next/slides-runtime/dist/component.js +2 -0
  340. package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.js +2 -2
  341. package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.js +1 -1
  342. package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.js +5 -5
  343. package/dist/node_modules/@allyhub-next/slides-runtime/package.json +5 -1
  344. package/dist/node_modules/@allyhub-next/stage/dist/graphics.js +1 -1
  345. package/dist/node_modules/@allyhub-next/stage/dist/index.js +1 -1
  346. package/dist/node_modules/@allyhub-next/stage/dist/page.js +22 -12
  347. package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.js +5 -5
  348. package/dist/node_modules/@allyhub-next/stage/dist/server.js +1 -1
  349. package/dist/node_modules/@allyhub-next/stage/package.json +1 -1
  350. package/dist/node_modules/@allyhub-next/stage-page/dist/host.js +1 -20
  351. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/probe.html +8 -0
  352. package/dist/{astro.js → node_modules/@allyhub-next/stage-page/dist/runtime/probe.js} +1 -1
  353. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/runtime.js +79 -0
  354. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.html +21 -0
  355. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.js +3 -0
  356. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.html +9 -0
  357. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.js +3 -0
  358. package/dist/node_modules/@allyhub-next/stage-page/package.json +2 -3
  359. package/dist/node_modules/@allyhub-next/video-core/dist/captions.js +6 -6
  360. package/dist/node_modules/@allyhub-next/video-core/dist/fact.d.ts +47 -8
  361. package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +1 -1
  362. package/dist/node_modules/@allyhub-next/video-core/dist/index.d.ts +1 -0
  363. package/dist/node_modules/@allyhub-next/video-core/dist/index.js +1 -1
  364. package/dist/node_modules/@allyhub-next/video-core/dist/marks.d.ts +14 -0
  365. package/dist/node_modules/@allyhub-next/video-core/dist/marks.js +1 -1
  366. package/dist/node_modules/@allyhub-next/video-core/dist/music.d.ts +2 -1
  367. package/dist/node_modules/@allyhub-next/video-core/dist/piece.d.ts +11 -2
  368. package/dist/node_modules/@allyhub-next/video-core/dist/problem.d.ts +4 -0
  369. package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +1 -1
  370. package/dist/node_modules/@allyhub-next/video-core/dist/schema.d.ts +2 -2
  371. package/dist/node_modules/@allyhub-next/video-core/dist/schema.js +1 -1
  372. package/dist/node_modules/@allyhub-next/video-core/dist/script.d.ts +2 -1
  373. package/dist/node_modules/@allyhub-next/video-core/dist/script.js +1 -1
  374. package/dist/node_modules/@allyhub-next/video-core/dist/source.d.ts +7 -0
  375. package/dist/node_modules/@allyhub-next/video-core/dist/source.js +2 -0
  376. package/dist/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +10 -33
  377. package/dist/node_modules/@allyhub-next/video-core/package.json +1 -1
  378. package/dist/node_modules/@allyhub-next/website/LICENSE +241 -0
  379. package/dist/node_modules/@allyhub-next/website/dist/index.js +2 -0
  380. package/dist/node_modules/@allyhub-next/website/dist/publish.js +3 -0
  381. package/dist/node_modules/@allyhub-next/website/dist/rules.js +2 -0
  382. package/dist/node_modules/@allyhub-next/website/dist/website.js +4 -0
  383. package/dist/node_modules/@allyhub-next/website/package.json +13 -0
  384. package/dist/text/facts-text.js +4 -4
  385. package/dist/works.js +1 -1
  386. package/editor-web/assets/calc-worker-Bz9r26p1.js +158 -0
  387. package/editor-web/assets/dist-0emakyZE.js +36 -0
  388. package/editor-web/assets/dist-B3UoDUa5.js +37 -0
  389. package/editor-web/assets/dist-B6KzR3pN.js +10 -0
  390. package/editor-web/assets/dist-Bc5iA5k1.js +1 -0
  391. package/editor-web/assets/dist-CTQIm8Im.js +10 -0
  392. package/editor-web/assets/dist-CiHNHwyq.js +2 -0
  393. package/editor-web/assets/dist-DNZ8PQ-E.js +224 -0
  394. package/editor-web/assets/index-CFt3ovRY.js +69 -0
  395. package/editor-web/assets/index-ujKjdu_s.css +2 -0
  396. package/editor-web/assets/minus-BhoPZC5P.js +1 -0
  397. package/editor-web/assets/react-C_-rEEBU.js +101 -0
  398. package/editor-web/assets/tabs-Den4gHrU.js +105 -0
  399. package/editor-web/assets/text-align-start-CsW4nqqL.js +1 -0
  400. package/editor-web/index.html +5 -5
  401. package/package.json +8 -14
  402. package/dist/astro.d.ts +0 -2
  403. package/dist/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +0 -52
  404. package/dist/node_modules/@allyhub-next/audio/dist/decode.d.ts +0 -33
  405. package/dist/node_modules/@allyhub-next/audio/dist/envelope.d.ts +0 -37
  406. package/dist/node_modules/@allyhub-next/audio/dist/index.d.ts +0 -17
  407. package/dist/node_modules/@allyhub-next/audio/dist/levels.d.ts +0 -97
  408. package/dist/node_modules/@allyhub-next/audio/dist/master.d.ts +0 -29
  409. package/dist/node_modules/@allyhub-next/audio/dist/music.d.ts +0 -11
  410. package/dist/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +0 -39
  411. package/dist/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +0 -25
  412. package/dist/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +0 -31
  413. package/dist/node_modules/@allyhub-next/audio/dist/node/index.d.ts +0 -8
  414. package/dist/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +0 -18
  415. package/dist/node_modules/@allyhub-next/audio/dist/node/master.d.ts +0 -42
  416. package/dist/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +0 -60
  417. package/dist/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +0 -31
  418. package/dist/node_modules/@allyhub-next/audio/dist/plan.d.ts +0 -143
  419. package/dist/node_modules/@allyhub-next/audio/dist/recorded.d.ts +0 -26
  420. package/dist/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +0 -47
  421. package/dist/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +0 -89
  422. package/dist/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +0 -64
  423. package/dist/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +0 -26
  424. package/dist/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +0 -42
  425. package/dist/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +0 -56
  426. package/dist/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +0 -10
  427. package/dist/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +0 -12
  428. package/dist/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +0 -67
  429. package/dist/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +0 -32
  430. package/dist/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +0 -27
  431. package/dist/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +0 -64
  432. package/dist/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +0 -78
  433. package/dist/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +0 -111
  434. package/dist/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +0 -3
  435. package/dist/node_modules/@allyhub-next/audio/dist/render.d.ts +0 -26
  436. package/dist/node_modules/@allyhub-next/audio/dist/sfx.d.ts +0 -10
  437. package/dist/node_modules/@allyhub-next/audio/dist/shape.d.ts +0 -118
  438. package/dist/node_modules/@allyhub-next/audio/dist/voice.d.ts +0 -45
  439. package/dist/node_modules/@allyhub-next/browser/dist/browser.d.ts +0 -24
  440. package/dist/node_modules/@allyhub-next/browser/dist/capture.d.ts +0 -61
  441. package/dist/node_modules/@allyhub-next/browser/dist/cdp.d.ts +0 -51
  442. package/dist/node_modules/@allyhub-next/browser/dist/flags.d.ts +0 -13
  443. package/dist/node_modules/@allyhub-next/browser/dist/frames.d.ts +0 -35
  444. package/dist/node_modules/@allyhub-next/browser/dist/html.d.ts +0 -19
  445. package/dist/node_modules/@allyhub-next/browser/dist/index.d.ts +0 -10
  446. package/dist/node_modules/@allyhub-next/browser/dist/launch.d.ts +0 -35
  447. package/dist/node_modules/@allyhub-next/browser/dist/page.d.ts +0 -67
  448. package/dist/node_modules/@allyhub-next/browser/dist/server.d.ts +0 -26
  449. package/dist/node_modules/@allyhub-next/check/dist/cache.d.ts +0 -46
  450. package/dist/node_modules/@allyhub-next/check/dist/check.d.ts +0 -142
  451. package/dist/node_modules/@allyhub-next/check/dist/generated.d.ts +0 -22
  452. package/dist/node_modules/@allyhub-next/check/dist/index.d.ts +0 -7
  453. package/dist/node_modules/@allyhub-next/check/dist/plans.d.ts +0 -111
  454. package/dist/node_modules/@allyhub-next/check/dist/result.d.ts +0 -12
  455. package/dist/node_modules/@allyhub-next/check/dist/scenery.d.ts +0 -23
  456. package/dist/node_modules/@allyhub-next/dev-server/dist/background.d.ts +0 -50
  457. package/dist/node_modules/@allyhub-next/dev-server/dist/card.d.ts +0 -17
  458. package/dist/node_modules/@allyhub-next/dev-server/dist/exports.d.ts +0 -18
  459. package/dist/node_modules/@allyhub-next/dev-server/dist/index.d.ts +0 -11
  460. package/dist/node_modules/@allyhub-next/dev-server/dist/live.d.ts +0 -77
  461. package/dist/node_modules/@allyhub-next/dev-server/dist/mime.d.ts +0 -2
  462. package/dist/node_modules/@allyhub-next/dev-server/dist/mime.js +0 -2
  463. package/dist/node_modules/@allyhub-next/dev-server/dist/paths.d.ts +0 -27
  464. package/dist/node_modules/@allyhub-next/dev-server/dist/project.d.ts +0 -153
  465. package/dist/node_modules/@allyhub-next/dev-server/dist/reveal.d.ts +0 -6
  466. package/dist/node_modules/@allyhub-next/dev-server/dist/server.d.ts +0 -47
  467. package/dist/node_modules/@allyhub-next/dev-server/dist/sound.d.ts +0 -21
  468. package/dist/node_modules/@allyhub-next/dev-server/dist/stage.d.ts +0 -82
  469. package/dist/node_modules/@allyhub-next/dev-server/dist/stage.js +0 -121
  470. package/dist/node_modules/@allyhub-next/dev-server/dist/tools.d.ts +0 -24
  471. package/dist/node_modules/@allyhub-next/dev-server/dist/validate.d.ts +0 -6
  472. package/dist/node_modules/@allyhub-next/dev-server/dist/watcher.d.ts +0 -47
  473. package/dist/node_modules/@allyhub-next/dev-server/dist/writer.d.ts +0 -51
  474. package/dist/node_modules/@allyhub-next/export/dist/batch.d.ts +0 -70
  475. package/dist/node_modules/@allyhub-next/export/dist/deck-fonts.d.ts +0 -24
  476. package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.d.ts +0 -12
  477. package/dist/node_modules/@allyhub-next/export/dist/export.d.ts +0 -123
  478. package/dist/node_modules/@allyhub-next/export/dist/index.d.ts +0 -5
  479. package/dist/node_modules/@allyhub-next/export/dist/names.d.ts +0 -36
  480. package/dist/node_modules/@allyhub-next/measure/dist/compare.d.ts +0 -195
  481. package/dist/node_modules/@allyhub-next/measure/dist/contrast.d.ts +0 -14
  482. package/dist/node_modules/@allyhub-next/measure/dist/cut-sheet.d.ts +0 -90
  483. package/dist/node_modules/@allyhub-next/measure/dist/cuts.d.ts +0 -108
  484. package/dist/node_modules/@allyhub-next/measure/dist/facts.d.ts +0 -60
  485. package/dist/node_modules/@allyhub-next/measure/dist/fidelity.d.ts +0 -40
  486. package/dist/node_modules/@allyhub-next/measure/dist/flat.d.ts +0 -42
  487. package/dist/node_modules/@allyhub-next/measure/dist/index.d.ts +0 -24
  488. package/dist/node_modules/@allyhub-next/measure/dist/loop.d.ts +0 -22
  489. package/dist/node_modules/@allyhub-next/measure/dist/overlay.d.ts +0 -57
  490. package/dist/node_modules/@allyhub-next/measure/dist/recording-report.d.ts +0 -66
  491. package/dist/node_modules/@allyhub-next/measure/dist/reference/compare.d.ts +0 -118
  492. package/dist/node_modules/@allyhub-next/measure/dist/reference/folder.d.ts +0 -75
  493. package/dist/node_modules/@allyhub-next/measure/dist/reference/interpret.d.ts +0 -39
  494. package/dist/node_modules/@allyhub-next/measure/dist/reference/piece.d.ts +0 -53
  495. package/dist/node_modules/@allyhub-next/measure/dist/reference/sections.d.ts +0 -53
  496. package/dist/node_modules/@allyhub-next/measure/dist/reference/sets.d.ts +0 -84
  497. package/dist/node_modules/@allyhub-next/measure/dist/reference/text.d.ts +0 -27
  498. package/dist/node_modules/@allyhub-next/measure/dist/reference/video.d.ts +0 -55
  499. package/dist/node_modules/@allyhub-next/measure/dist/seams.d.ts +0 -46
  500. package/dist/node_modules/@allyhub-next/measure/dist/sound-measures.d.ts +0 -74
  501. package/dist/node_modules/@allyhub-next/measure/dist/sound-report.d.ts +0 -156
  502. package/dist/node_modules/@allyhub-next/measure/dist/still.d.ts +0 -58
  503. package/dist/node_modules/@allyhub-next/measure/dist/version-voice.d.ts +0 -12
  504. package/dist/node_modules/@allyhub-next/project/dist/console.d.ts +0 -34
  505. package/dist/node_modules/@allyhub-next/project/dist/digest.d.ts +0 -9
  506. package/dist/node_modules/@allyhub-next/project/dist/index.d.ts +0 -11
  507. package/dist/node_modules/@allyhub-next/project/dist/ledger.d.ts +0 -17
  508. package/dist/node_modules/@allyhub-next/project/dist/media-index.d.ts +0 -27
  509. package/dist/node_modules/@allyhub-next/project/dist/page.d.ts +0 -119
  510. package/dist/node_modules/@allyhub-next/project/dist/says.d.ts +0 -15
  511. package/dist/node_modules/@allyhub-next/project/dist/scenery.d.ts +0 -35
  512. package/dist/node_modules/@allyhub-next/project/dist/session.d.ts +0 -37
  513. package/dist/node_modules/@allyhub-next/project/dist/stretch.d.ts +0 -38
  514. package/dist/node_modules/@allyhub-next/project/dist/version.d.ts +0 -114
  515. package/dist/node_modules/@allyhub-next/render/dist/cap.d.ts +0 -41
  516. package/dist/node_modules/@allyhub-next/render/dist/capture.d.ts +0 -78
  517. package/dist/node_modules/@allyhub-next/render/dist/clip.d.ts +0 -27
  518. package/dist/node_modules/@allyhub-next/render/dist/composite.d.ts +0 -106
  519. package/dist/node_modules/@allyhub-next/render/dist/delivery.d.ts +0 -18
  520. package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.d.ts +0 -3
  521. package/dist/node_modules/@allyhub-next/render/dist/doc/index.d.ts +0 -3
  522. package/dist/node_modules/@allyhub-next/render/dist/doc/print.d.ts +0 -51
  523. package/dist/node_modules/@allyhub-next/render/dist/encode.d.ts +0 -111
  524. package/dist/node_modules/@allyhub-next/render/dist/errors.d.ts +0 -15
  525. package/dist/node_modules/@allyhub-next/render/dist/exports.d.ts +0 -76
  526. package/dist/node_modules/@allyhub-next/render/dist/ffmpeg.d.ts +0 -75
  527. package/dist/node_modules/@allyhub-next/render/dist/footage.d.ts +0 -169
  528. package/dist/node_modules/@allyhub-next/render/dist/image.d.ts +0 -16
  529. package/dist/node_modules/@allyhub-next/render/dist/index.d.ts +0 -26
  530. package/dist/node_modules/@allyhub-next/render/dist/junction.d.ts +0 -70
  531. package/dist/node_modules/@allyhub-next/render/dist/look.d.ts +0 -21
  532. package/dist/node_modules/@allyhub-next/render/dist/page.d.ts +0 -186
  533. package/dist/node_modules/@allyhub-next/render/dist/parts.d.ts +0 -140
  534. package/dist/node_modules/@allyhub-next/render/dist/png.d.ts +0 -37
  535. package/dist/node_modules/@allyhub-next/render/dist/pool.d.ts +0 -54
  536. package/dist/node_modules/@allyhub-next/render/dist/post-probe.d.ts +0 -27
  537. package/dist/node_modules/@allyhub-next/render/dist/post.d.ts +0 -27
  538. package/dist/node_modules/@allyhub-next/render/dist/render.d.ts +0 -151
  539. package/dist/node_modules/@allyhub-next/render/dist/segments.d.ts +0 -40
  540. package/dist/node_modules/@allyhub-next/render/dist/sound.d.ts +0 -24
  541. package/dist/node_modules/@allyhub-next/render/dist/stills.d.ts +0 -41
  542. package/dist/node_modules/@allyhub-next/render/dist/tools.d.ts +0 -25
  543. package/dist/node_modules/@allyhub-next/render/dist/webp.d.ts +0 -17
  544. package/dist/node_modules/@allyhub-next/runtime/dist/bridge.d.ts +0 -211
  545. package/dist/node_modules/@allyhub-next/runtime/dist/captions.d.ts +0 -24
  546. package/dist/node_modules/@allyhub-next/runtime/dist/clock.d.ts +0 -32
  547. package/dist/node_modules/@allyhub-next/runtime/dist/compose.d.ts +0 -149
  548. package/dist/node_modules/@allyhub-next/runtime/dist/console.d.ts +0 -21
  549. package/dist/node_modules/@allyhub-next/runtime/dist/contrast.d.ts +0 -13
  550. package/dist/node_modules/@allyhub-next/runtime/dist/embed.d.ts +0 -50
  551. package/dist/node_modules/@allyhub-next/runtime/dist/env.d.ts +0 -101
  552. package/dist/node_modules/@allyhub-next/runtime/dist/errors.d.ts +0 -21
  553. package/dist/node_modules/@allyhub-next/runtime/dist/facade.d.ts +0 -42
  554. package/dist/node_modules/@allyhub-next/runtime/dist/fonts.d.ts +0 -110
  555. package/dist/node_modules/@allyhub-next/runtime/dist/footage.d.ts +0 -52
  556. package/dist/node_modules/@allyhub-next/runtime/dist/frame.d.ts +0 -61
  557. package/dist/node_modules/@allyhub-next/runtime/dist/guards.d.ts +0 -32
  558. package/dist/node_modules/@allyhub-next/runtime/dist/index.d.ts +0 -14
  559. package/dist/node_modules/@allyhub-next/runtime/dist/inspect.d.ts +0 -112
  560. package/dist/node_modules/@allyhub-next/runtime/dist/locate.d.ts +0 -11
  561. package/dist/node_modules/@allyhub-next/runtime/dist/measure.d.ts +0 -41
  562. package/dist/node_modules/@allyhub-next/runtime/dist/mix-plan.d.ts +0 -42
  563. package/dist/node_modules/@allyhub-next/runtime/dist/music.d.ts +0 -29
  564. package/dist/node_modules/@allyhub-next/runtime/dist/output.d.ts +0 -5
  565. package/dist/node_modules/@allyhub-next/runtime/dist/pictures.d.ts +0 -39
  566. package/dist/node_modules/@allyhub-next/runtime/dist/piece.d.ts +0 -34
  567. package/dist/node_modules/@allyhub-next/runtime/dist/player/clips.d.ts +0 -41
  568. package/dist/node_modules/@allyhub-next/runtime/dist/player/cutout.d.ts +0 -57
  569. package/dist/node_modules/@allyhub-next/runtime/dist/player/player.d.ts +0 -78
  570. package/dist/node_modules/@allyhub-next/runtime/dist/reads.d.ts +0 -132
  571. package/dist/node_modules/@allyhub-next/runtime/dist/sound.d.ts +0 -22
  572. package/dist/node_modules/@allyhub-next/runtime/dist/speech.d.ts +0 -107
  573. package/dist/node_modules/@allyhub-next/runtime/dist/stage-kit.d.ts +0 -12
  574. package/dist/node_modules/@allyhub-next/runtime/dist/stage.d.ts +0 -34
  575. package/dist/node_modules/@allyhub-next/runtime/dist/styles.d.ts +0 -35
  576. package/dist/node_modules/@allyhub-next/runtime/dist/takes.d.ts +0 -72
  577. package/dist/node_modules/@allyhub-next/runtime/dist/titles.d.ts +0 -10
  578. package/dist/node_modules/@allyhub-next/runtime/dist/transitions.d.ts +0 -26
  579. package/dist/node_modules/@allyhub-next/site/dist/assets.d.ts +0 -59
  580. package/dist/node_modules/@allyhub-next/site/dist/assets.js +0 -2
  581. package/dist/node_modules/@allyhub-next/site/dist/astro.d.ts +0 -22
  582. package/dist/node_modules/@allyhub-next/site/dist/astro.js +0 -3
  583. package/dist/node_modules/@allyhub-next/site/dist/lockfile.d.ts +0 -40
  584. package/dist/node_modules/@allyhub-next/site/dist/lockfile.js +0 -3
  585. package/dist/node_modules/@allyhub-next/site/dist/media.d.ts +0 -24
  586. package/dist/node_modules/@allyhub-next/site/dist/media.js +0 -4
  587. package/dist/node_modules/@allyhub-next/site/package.json +0 -25
  588. package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.d.ts +0 -6
  589. package/dist/node_modules/@allyhub-next/slides-pptx/dist/fonts.d.ts +0 -45
  590. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.d.ts +0 -18
  591. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.js +0 -3
  592. package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.d.ts +0 -5
  593. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.d.ts +0 -55
  594. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.js +0 -4
  595. package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.d.ts +0 -67
  596. package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.d.ts +0 -21
  597. package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.d.ts +0 -4
  598. package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.d.ts +0 -32
  599. package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.d.ts +0 -32
  600. package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.d.ts +0 -26
  601. package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.d.ts +0 -40
  602. package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.d.ts +0 -4
  603. package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.js +0 -2
  604. package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.d.ts +0 -4
  605. package/dist/node_modules/@allyhub-next/slides-runtime/dist/ink.d.ts +0 -10
  606. package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.d.ts +0 -6
  607. package/dist/node_modules/@allyhub-next/stage/dist/bakes.d.ts +0 -42
  608. package/dist/node_modules/@allyhub-next/stage/dist/graphics.d.ts +0 -7
  609. package/dist/node_modules/@allyhub-next/stage/dist/identity.d.ts +0 -2
  610. package/dist/node_modules/@allyhub-next/stage/dist/index.d.ts +0 -9
  611. package/dist/node_modules/@allyhub-next/stage/dist/page.d.ts +0 -87
  612. package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.d.ts +0 -69
  613. package/dist/node_modules/@allyhub-next/stage/dist/scenery-solve.d.ts +0 -49
  614. package/dist/node_modules/@allyhub-next/stage/dist/scenery.d.ts +0 -8
  615. package/dist/node_modules/@allyhub-next/stage/dist/server.d.ts +0 -21
  616. package/dist/node_modules/@allyhub-next/stage-page/dist/host.d.ts +0 -22
  617. package/dist/node_modules/@allyhub-next/stage-page/dist/page.js +0 -79
  618. package/dist/site.d.ts +0 -2
  619. package/editor-web/assets/dist-Cg2PdedY.js +0 -6
  620. package/editor-web/assets/dist-CuW84oPe.js +0 -233
  621. package/editor-web/assets/dist-CxAS_vp7.js +0 -2
  622. package/editor-web/assets/dist-DCVaj9i1.js +0 -4
  623. package/editor-web/assets/dist-DGVUuVPB.js +0 -33
  624. package/editor-web/assets/dist-Yi3sy7Ea.js +0 -1
  625. package/editor-web/assets/index-B7S9RZhL.css +0 -2
  626. package/editor-web/assets/index-pwRfZ2Jv.js +0 -69
  627. package/editor-web/assets/minus-BizJdinJ.js +0 -1
  628. package/editor-web/assets/react-D54s6gwK.js +0 -101
  629. package/editor-web/assets/textarea-CvxipnGW.js +0 -105
  630. package/editor-web/assets/trash-2-Bq1Dt8XG.js +0 -1
  631. package/editor-web/assets/undo-2-Djhvu4xt.js +0 -1
  632. /package/dist/node_modules/@allyhub-next/{site → ooxml}/LICENSE +0 -0
@@ -1,79 +0,0 @@
1
- /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- var __defProp=Object.defineProperty,__export=(e,t)=>{for(var n in t)__defProp(e,n,{get:t[n],enumerable:!0})},MEDIA_DIR="assets/media",TEXT_DIR="assets/text",LOCAL_DIR=".allyhub",CACHE_DIR=".allyhub/cache",GITIGNORE=`node_modules/
3
- ${LOCAL_DIR}/
4
- .playwright-cli/
5
- `;function baseOf(e){return e.slice(e.lastIndexOf("/")+1)}var TIP=6,HELD=.85,CLOSED=.25,clamp=(e,t,n)=>Math.min(n,Math.max(t,e));function boxAround(e){const t=e.map(i=>i.x),n=e.map(i=>i.y),r=Math.min(...t),u=Math.min(...n);return{x:r,y:u,width:Math.max(...t)-r,height:Math.max(...n)-u}}function isClosed(e){const[t]=e,n=e.at(-1);if(!t||!n)return!1;const{width:r,height:u}=boxAround(e),i=Math.hypot(r,u);return i>0&&Math.hypot(n.x-t.x,n.y-t.y)<=i*CLOSED}var overlaps=(e,t)=>e.x<t.x+Math.max(t.width,1)&&e.x+Math.max(e.width,1)>t.x&&e.y<t.y+Math.max(t.height,1)&&e.y+Math.max(e.height,1)>t.y;function roundTouches(e,t){const n=e.width/2||1,r=e.height/2||1,u=e.x+n,i=e.y+r,o=(clamp(u,t.x,t.x+t.width)-u)/n,a=(clamp(i,t.y,t.y+t.height)-i)/r;return Math.hypot(o,a)<=HELD}function segmentTouches(e,t,n){const r=t.x-e.x,u=t.y-e.y;let i=0,o=1;for(const[a,s]of[[-r,e.x-n.x],[r,n.x+n.width-e.x],[-u,e.y-n.y],[u,n.y+n.height-e.y]]){if(a===0){if(s<0)return!1}else a<0?i=Math.max(i,s/a):o=Math.min(o,s/a);if(i>o)return!1}return!0}function touches(e,t){switch(e.kind){case"box":return overlaps(e.rect,t);case"round":return roundTouches(e.rect,t);case"arrow":return overlaps({x:e.to.x-TIP,y:e.to.y-TIP,width:2*TIP,height:2*TIP},t);case"line":return isClosed(e.points)?roundTouches(boxAround(e.points),t):e.points.some((n,r)=>segmentTouches(e.points[r-1]??n,n,t))}}function mapShape(e,t){switch(e.kind){case"box":case"round":{const n=t(e.rect),r=t({x:e.rect.x+e.rect.width,y:e.rect.y+e.rect.height});return{kind:e.kind,rect:{...n,width:r.x-n.x,height:r.y-n.y}}}case"arrow":return{kind:"arrow",from:t(e.from),to:t(e.to)};case"line":return{kind:"line",points:e.points.map(t)}}}var CODE_EXTENSIONS=["ts","tsx","mts","js","jsx","mjs"],code=e=>CODE_EXTENSIONS.map(t=>`${e}.${t}`),ITEM_KINDS={video:{entries:code("video"),editor:"video",name:"video"},slides:{entries:code("slides"),editor:"slides",name:"slides"},doc:{entries:["doc.mdx"],editor:"doc",name:"doc"},sheet:{entries:["sheet.yaml"],editor:"sheet",name:"sheet"},scenery:{entries:code("scenery"),editor:"scenery",name:"3D scenery"},model:{entries:code("model"),editor:"scenery",name:"3D model"},website:{entries:["astro.config.mjs","astro.config.ts","astro.config.mts","astro.config.js"],editor:"website",name:"website"}},KINDS=Object.keys(ITEM_KINDS),BY_ENTRY=new Map(KINDS.flatMap(e=>ITEM_KINDS[e].entries.map(t=>[t,e])));function entryKind(e){return BY_ENTRY.get(baseOf(e))}var external_exports={};__export(external_exports,{$brand:()=>$brand,$input:()=>$input,$output:()=>$output,INVALID:()=>INVALID,NEVER:()=>NEVER,TimePrecision:()=>TimePrecision,ZodAny:()=>ZodAny,ZodArray:()=>ZodArray,ZodBase64:()=>ZodBase64,ZodBase64URL:()=>ZodBase64URL,ZodBigInt:()=>ZodBigInt,ZodBigIntFormat:()=>ZodBigIntFormat,ZodBoolean:()=>ZodBoolean,ZodCIDRv4:()=>ZodCIDRv4,ZodCIDRv6:()=>ZodCIDRv6,ZodCUID:()=>ZodCUID,ZodCUID2:()=>ZodCUID2,ZodCatch:()=>ZodCatch,ZodCodec:()=>ZodCodec,ZodCompileAsyncError:()=>ZodCompileAsyncError,ZodCompileUnsupportedError:()=>ZodCompileUnsupportedError,ZodCreditCard:()=>ZodCreditCard,ZodCustom:()=>ZodCustom,ZodCustomStringFormat:()=>ZodCustomStringFormat,ZodDate:()=>ZodDate,ZodDefault:()=>ZodDefault,ZodDiscriminatedUnion:()=>ZodDiscriminatedUnion,ZodE164:()=>ZodE164,ZodEmail:()=>ZodEmail,ZodEmoji:()=>ZodEmoji,ZodEnum:()=>ZodEnum,ZodError:()=>ZodError,ZodExactOptional:()=>ZodExactOptional,ZodFile:()=>ZodFile,ZodFirstPartyTypeKind:()=>ZodFirstPartyTypeKind,ZodFunction:()=>ZodFunction,ZodGUID:()=>ZodGUID,ZodIBAN:()=>ZodIBAN,ZodIPv4:()=>ZodIPv4,ZodIPv6:()=>ZodIPv6,ZodISODate:()=>ZodISODate,ZodISODateTime:()=>ZodISODateTime,ZodISODuration:()=>ZodISODuration,ZodISOTime:()=>ZodISOTime,ZodInstanceOf:()=>ZodInstanceOf,ZodIntersection:()=>ZodIntersection,ZodIssueCode:()=>ZodIssueCode,ZodJWT:()=>ZodJWT,ZodKSUID:()=>ZodKSUID,ZodLazy:()=>ZodLazy,ZodLiteral:()=>ZodLiteral,ZodMAC:()=>ZodMAC,ZodMap:()=>ZodMap,ZodNaN:()=>ZodNaN,ZodNanoID:()=>ZodNanoID,ZodNever:()=>ZodNever,ZodNonOptional:()=>ZodNonOptional,ZodNull:()=>ZodNull,ZodNullable:()=>ZodNullable,ZodNumber:()=>ZodNumber,ZodNumberFormat:()=>ZodNumberFormat,ZodObject:()=>ZodObject,ZodOptional:()=>ZodOptional,ZodPipe:()=>ZodPipe,ZodPrefault:()=>ZodPrefault,ZodPreprocess:()=>ZodPreprocess,ZodPromise:()=>ZodPromise,ZodReadonly:()=>ZodReadonly,ZodRealError:()=>ZodRealError,ZodRecord:()=>ZodRecord,ZodSet:()=>ZodSet,ZodString:()=>ZodString,ZodStringFormat:()=>ZodStringFormat,ZodSuccess:()=>ZodSuccess,ZodSymbol:()=>ZodSymbol,ZodTemplateLiteral:()=>ZodTemplateLiteral,ZodTransform:()=>ZodTransform,ZodTuple:()=>ZodTuple,ZodType:()=>ZodType,ZodULID:()=>ZodULID,ZodURL:()=>ZodURL,ZodUUID:()=>ZodUUID,ZodUndefined:()=>ZodUndefined,ZodUnion:()=>ZodUnion,ZodUnknown:()=>ZodUnknown,ZodVoid:()=>ZodVoid,ZodXID:()=>ZodXID,ZodXor:()=>ZodXor,_ZodString:()=>_ZodString,_default:()=>_default2,_function:()=>_function,any:()=>any,array:()=>array,base64:()=>base642,base64url:()=>base64url2,bigint:()=>bigint2,boolean:()=>boolean2,catch:()=>_catch2,check:()=>check,cidrv4:()=>cidrv42,cidrv6:()=>cidrv62,clone:()=>clone,codec:()=>codec,coerce:()=>coerce_exports,compile:()=>compile,config:()=>config,core:()=>core_exports2,creditCard:()=>creditCard2,cuid:()=>cuid3,cuid2:()=>cuid22,currencyCode:()=>currencyCode2,custom:()=>custom,date:()=>date2,decode:()=>decode2,decodeAsync:()=>decodeAsync2,deepPartial:()=>deepPartial,describe:()=>describe2,discriminatedUnion:()=>discriminatedUnion,e164:()=>e1642,email:()=>email2,emoji:()=>emoji2,encode:()=>encode2,encodeAsync:()=>encodeAsync2,endsWith:()=>_endsWith,enum:()=>_enum2,exactOptional:()=>exactOptional,file:()=>file,flattenError:()=>flattenError,float32:()=>float32,float64:()=>float64,formatError:()=>formatError,fromJSONSchema:()=>fromJSONSchema,function:()=>_function,getDiscriminatedOption:()=>getDiscriminatedOption,getErrorMap:()=>getErrorMap,globalRegistry:()=>globalRegistry,gt:()=>_gt,gte:()=>_gte,guid:()=>guid2,hash:()=>hash,hex:()=>hex2,hostname:()=>hostname2,httpUrl:()=>httpUrl,iban:()=>iban2,includes:()=>_includes,input:()=>input,instanceof:()=>_instanceof,int:()=>int,int32:()=>int32,int64:()=>int64,intersection:()=>intersection,invertCodec:()=>invertCodec,ipv4:()=>ipv42,ipv6:()=>ipv62,iso:()=>iso_exports,json:()=>json,jwt:()=>jwt,keyof:()=>keyof,ksuid:()=>ksuid2,lazy:()=>lazy,length:()=>_length,literal:()=>literal,locales:()=>locales_exports,looseObject:()=>looseObject,looseRecord:()=>looseRecord,lowercase:()=>_lowercase,lt:()=>_lt,lte:()=>_lte,mac:()=>mac2,map:()=>map,maxLength:()=>_maxLength,maxSize:()=>_maxSize,memoizer:()=>memoizer,meta:()=>meta2,mime:()=>_mime,minLength:()=>_minLength,minSize:()=>_minSize,multipleOf:()=>_multipleOf,nan:()=>nan,nanoid:()=>nanoid2,nativeEnum:()=>nativeEnum,negative:()=>_negative,never:()=>never,nonnegative:()=>_nonnegative,nonoptional:()=>nonoptional,nonpositive:()=>_nonpositive,normalize:()=>_normalize,null:()=>_null3,nullable:()=>nullable,nullish:()=>nullish2,number:()=>number2,object:()=>object,optional:()=>optional,output:()=>output,overwrite:()=>_overwrite,parse:()=>parse2,parseAsync:()=>parseAsync2,partialRecord:()=>partialRecord,pipe:()=>pipe,positive:()=>_positive,prefault:()=>prefault,preprocess:()=>preprocess,prettifyError:()=>prettifyError,promise:()=>promise,properties:()=>_properties,property:()=>_property,readonly:()=>readonly,record:()=>record,refine:()=>refine,regex:()=>_regex,regexes:()=>regexes_exports,registry:()=>registry,safeDecode:()=>safeDecode2,safeDecodeAsync:()=>safeDecodeAsync2,safeEncode:()=>safeEncode2,safeEncodeAsync:()=>safeEncodeAsync2,safeParse:()=>safeParse2,safeParseAsync:()=>safeParseAsync2,set:()=>set,setErrorMap:()=>setErrorMap,size:()=>_size,slugify:()=>_slugify,startsWith:()=>_startsWith,strictObject:()=>strictObject,string:()=>string2,stringFormat:()=>stringFormat,stringbool:()=>stringbool,success:()=>success,superRefine:()=>superRefine,symbol:()=>symbol,templateLiteral:()=>templateLiteral,toJSONSchema:()=>toJSONSchema,toLowerCase:()=>_toLowerCase,toUpperCase:()=>_toUpperCase,toZod:()=>toZod,transform:()=>transform,treeifyError:()=>treeifyError,trim:()=>_trim,tuple:()=>tuple,uint32:()=>uint32,uint64:()=>uint64,ulid:()=>ulid2,undefined:()=>_undefined3,union:()=>union,unknown:()=>unknown,uppercase:()=>_uppercase,url:()=>url,util:()=>util_exports,uuid:()=>uuid2,uuidv4:()=>uuidv4,uuidv6:()=>uuidv6,uuidv7:()=>uuidv7,validate:()=>validate,validateAsync:()=>validateAsync,void:()=>_void2,withParser:()=>withParser,xid:()=>xid2,xor:()=>xor});var core_exports2={};__export(core_exports2,{$ZodAny:()=>$ZodAny,$ZodArray:()=>$ZodArray,$ZodAsyncError:()=>$ZodAsyncError,$ZodBase64:()=>$ZodBase64,$ZodBase64URL:()=>$ZodBase64URL,$ZodBigInt:()=>$ZodBigInt,$ZodBigIntFormat:()=>$ZodBigIntFormat,$ZodBoolean:()=>$ZodBoolean,$ZodCIDRv4:()=>$ZodCIDRv4,$ZodCIDRv6:()=>$ZodCIDRv6,$ZodCUID:()=>$ZodCUID,$ZodCUID2:()=>$ZodCUID2,$ZodCatch:()=>$ZodCatch,$ZodCheck:()=>$ZodCheck,$ZodCheckBigIntFormat:()=>$ZodCheckBigIntFormat,$ZodCheckEndsWith:()=>$ZodCheckEndsWith,$ZodCheckGreaterThan:()=>$ZodCheckGreaterThan,$ZodCheckIncludes:()=>$ZodCheckIncludes,$ZodCheckLengthEquals:()=>$ZodCheckLengthEquals,$ZodCheckLessThan:()=>$ZodCheckLessThan,$ZodCheckLowerCase:()=>$ZodCheckLowerCase,$ZodCheckMaxLength:()=>$ZodCheckMaxLength,$ZodCheckMaxSize:()=>$ZodCheckMaxSize,$ZodCheckMimeType:()=>$ZodCheckMimeType,$ZodCheckMinLength:()=>$ZodCheckMinLength,$ZodCheckMinSize:()=>$ZodCheckMinSize,$ZodCheckMultipleOf:()=>$ZodCheckMultipleOf,$ZodCheckNumberFormat:()=>$ZodCheckNumberFormat,$ZodCheckOverwrite:()=>$ZodCheckOverwrite,$ZodCheckProperties:()=>$ZodCheckProperties,$ZodCheckProperty:()=>$ZodCheckProperty,$ZodCheckRegex:()=>$ZodCheckRegex,$ZodCheckSizeEquals:()=>$ZodCheckSizeEquals,$ZodCheckStartsWith:()=>$ZodCheckStartsWith,$ZodCheckStringFormat:()=>$ZodCheckStringFormat,$ZodCheckUpperCase:()=>$ZodCheckUpperCase,$ZodCodec:()=>$ZodCodec,$ZodCreditCard:()=>$ZodCreditCard,$ZodCustom:()=>$ZodCustom,$ZodCustomStringFormat:()=>$ZodCustomStringFormat,$ZodCyclicError:()=>$ZodCyclicError,$ZodDate:()=>$ZodDate,$ZodDefault:()=>$ZodDefault,$ZodDiscriminatedUnion:()=>$ZodDiscriminatedUnion,$ZodE164:()=>$ZodE164,$ZodEmail:()=>$ZodEmail,$ZodEmoji:()=>$ZodEmoji,$ZodEncodeError:()=>$ZodEncodeError,$ZodEnum:()=>$ZodEnum,$ZodError:()=>$ZodError,$ZodExactOptional:()=>$ZodExactOptional,$ZodFile:()=>$ZodFile,$ZodFunction:()=>$ZodFunction,$ZodGUID:()=>$ZodGUID,$ZodIBAN:()=>$ZodIBAN,$ZodIPv4:()=>$ZodIPv4,$ZodIPv6:()=>$ZodIPv6,$ZodISODate:()=>$ZodISODate,$ZodISODateTime:()=>$ZodISODateTime,$ZodISODuration:()=>$ZodISODuration,$ZodISOTime:()=>$ZodISOTime,$ZodIntersection:()=>$ZodIntersection,$ZodJWT:()=>$ZodJWT,$ZodKSUID:()=>$ZodKSUID,$ZodLazy:()=>$ZodLazy,$ZodLiteral:()=>$ZodLiteral,$ZodMAC:()=>$ZodMAC,$ZodMap:()=>$ZodMap,$ZodNaN:()=>$ZodNaN,$ZodNanoID:()=>$ZodNanoID,$ZodNever:()=>$ZodNever,$ZodNonOptional:()=>$ZodNonOptional,$ZodNull:()=>$ZodNull,$ZodNullable:()=>$ZodNullable,$ZodNumber:()=>$ZodNumber,$ZodNumberFormat:()=>$ZodNumberFormat,$ZodObject:()=>$ZodObject,$ZodObjectJIT:()=>$ZodObjectJIT,$ZodOptional:()=>$ZodOptional,$ZodPipe:()=>$ZodPipe,$ZodPrefault:()=>$ZodPrefault,$ZodPreprocess:()=>$ZodPreprocess,$ZodPromise:()=>$ZodPromise,$ZodReadonly:()=>$ZodReadonly,$ZodRealError:()=>$ZodRealError,$ZodRecord:()=>$ZodRecord,$ZodRegistry:()=>$ZodRegistry,$ZodSet:()=>$ZodSet,$ZodString:()=>$ZodString,$ZodStringFormat:()=>$ZodStringFormat,$ZodSuccess:()=>$ZodSuccess,$ZodSymbol:()=>$ZodSymbol,$ZodTemplateLiteral:()=>$ZodTemplateLiteral,$ZodTransform:()=>$ZodTransform,$ZodTuple:()=>$ZodTuple,$ZodType:()=>$ZodType,$ZodULID:()=>$ZodULID,$ZodURL:()=>$ZodURL,$ZodUUID:()=>$ZodUUID,$ZodUndefined:()=>$ZodUndefined,$ZodUnion:()=>$ZodUnion,$ZodUnknown:()=>$ZodUnknown,$ZodVoid:()=>$ZodVoid,$ZodXID:()=>$ZodXID,$ZodXor:()=>$ZodXor,$brand:()=>$brand,$constructor:()=>$constructor,$input:()=>$input,$output:()=>$output,Doc:()=>Doc,INVALID:()=>INVALID,JSONSchema:()=>json_schema_exports,JSONSchemaGenerator:()=>JSONSchemaGenerator,NEVER:()=>NEVER,TimePrecision:()=>TimePrecision,URL_BAD_FORMAT:()=>URL_BAD_FORMAT,URL_UNPARSEABLE:()=>URL_UNPARSEABLE,ZodCompileAsyncError:()=>ZodCompileAsyncError,ZodCompileUnsupportedError:()=>ZodCompileUnsupportedError,_any:()=>_any,_array:()=>_array,_base64:()=>_base64,_base64url:()=>_base64url,_bigint:()=>_bigint,_boolean:()=>_boolean,_catch:()=>_catch,_check:()=>_check,_cidrv4:()=>_cidrv4,_cidrv6:()=>_cidrv6,_coercedBigint:()=>_coercedBigint,_coercedBoolean:()=>_coercedBoolean,_coercedDate:()=>_coercedDate,_coercedNumber:()=>_coercedNumber,_coercedString:()=>_coercedString,_creditCard:()=>_creditCard,_cuid:()=>_cuid,_cuid2:()=>_cuid2,_custom:()=>_custom,_date:()=>_date,_decode:()=>_decode,_decodeAsync:()=>_decodeAsync,_default:()=>_default,_discriminatedUnion:()=>_discriminatedUnion,_e164:()=>_e164,_email:()=>_email,_emoji:()=>_emoji2,_encode:()=>_encode,_encodeAsync:()=>_encodeAsync,_endsWith:()=>_endsWith,_enum:()=>_enum,_file:()=>_file,_float32:()=>_float32,_float64:()=>_float64,_gt:()=>_gt,_gte:()=>_gte,_guid:()=>_guid,_iban:()=>_iban,_includes:()=>_includes,_int:()=>_int,_int32:()=>_int32,_int64:()=>_int64,_intersection:()=>_intersection,_ipv4:()=>_ipv4,_ipv6:()=>_ipv6,_isoDate:()=>_isoDate,_isoDateTime:()=>_isoDateTime,_isoDuration:()=>_isoDuration,_isoTime:()=>_isoTime,_jwt:()=>_jwt,_ksuid:()=>_ksuid,_lazy:()=>_lazy,_length:()=>_length,_literal:()=>_literal,_lowercase:()=>_lowercase,_lt:()=>_lt,_lte:()=>_lte,_mac:()=>_mac,_map:()=>_map,_max:()=>_lte,_maxLength:()=>_maxLength,_maxSize:()=>_maxSize,_mime:()=>_mime,_min:()=>_gte,_minLength:()=>_minLength,_minSize:()=>_minSize,_multipleOf:()=>_multipleOf,_nan:()=>_nan,_nanoid:()=>_nanoid,_nativeEnum:()=>_nativeEnum,_negative:()=>_negative,_never:()=>_never,_nonnegative:()=>_nonnegative,_nonoptional:()=>_nonoptional,_nonpositive:()=>_nonpositive,_normalize:()=>_normalize,_null:()=>_null2,_nullable:()=>_nullable,_number:()=>_number,_optional:()=>_optional,_overwrite:()=>_overwrite,_parse:()=>_parse,_parseAsync:()=>_parseAsync,_pipe:()=>_pipe,_positive:()=>_positive,_promise:()=>_promise,_properties:()=>_properties,_property:()=>_property,_readonly:()=>_readonly,_record:()=>_record,_refine:()=>_refine,_regex:()=>_regex,_safeDecode:()=>_safeDecode,_safeDecodeAsync:()=>_safeDecodeAsync,_safeEncode:()=>_safeEncode,_safeEncodeAsync:()=>_safeEncodeAsync,_safeParse:()=>_safeParse,_safeParseAsync:()=>_safeParseAsync,_set:()=>_set,_size:()=>_size,_slugify:()=>_slugify,_startsWith:()=>_startsWith,_string:()=>_string,_stringFormat:()=>_stringFormat,_stringbool:()=>_stringbool,_success:()=>_success,_superRefine:()=>_superRefine,_symbol:()=>_symbol,_templateLiteral:()=>_templateLiteral,_toLowerCase:()=>_toLowerCase,_toUpperCase:()=>_toUpperCase,_transform:()=>_transform,_trim:()=>_trim,_tuple:()=>_tuple,_uint32:()=>_uint32,_uint64:()=>_uint64,_ulid:()=>_ulid,_undefined:()=>_undefined2,_union:()=>_union,_unknown:()=>_unknown,_uppercase:()=>_uppercase,_url:()=>_url,_uuid:()=>_uuid,_uuidv4:()=>_uuidv4,_uuidv6:()=>_uuidv6,_uuidv7:()=>_uuidv7,_void:()=>_void,_xid:()=>_xid,_xor:()=>_xor,base64Charset:()=>base64Charset,base64urlCharset:()=>base64urlCharset,canParseURL:()=>canParseURL,clone:()=>clone,compile:()=>compile,compileFn:()=>compileFn,config:()=>config,createStandardJSONSchemaMethod:()=>createStandardJSONSchemaMethod,createToJSONSchemaMethod:()=>createToJSONSchemaMethod,decode:()=>decode,decodeAsync:()=>decodeAsync,describe:()=>describe,encode:()=>encode,encodeAsync:()=>encodeAsync,extractDefs:()=>extractDefs,finalize:()=>finalize,flattenError:()=>flattenError,formatError:()=>formatError,getDiscriminatedOption:()=>getDiscriminatedOption,globalConfig:()=>globalConfig,globalRegistry:()=>globalRegistry,handleUnrepresentable:()=>handleUnrepresentable,initializeContext:()=>initializeContext,isBackEdge:()=>isBackEdge,isRecursiveSchema:()=>isRecursiveSchema,isValidBase64:()=>isValidBase64,isValidBase64URL:()=>isValidBase64URL,isValidCIDRv6:()=>isValidCIDRv6,isValidCreditCard:()=>isValidCreditCard,isValidIBAN:()=>isValidIBAN,isValidIPv6:()=>isValidIPv6,isValidJWT:()=>isValidJWT,locales:()=>locales_exports,memoizer:()=>memoizer,mergeValues:()=>mergeValues,meta:()=>meta,parse:()=>parse,parseAsync:()=>parseAsync,parseURLObject:()=>parseURLObject,prettifyError:()=>prettifyError,process:()=>processSchema,processSchema:()=>processSchema,regexes:()=>regexes_exports,registry:()=>registry,safeDecode:()=>safeDecode,safeDecodeAsync:()=>safeDecodeAsync,safeEncode:()=>safeEncode,safeEncodeAsync:()=>safeEncodeAsync,safeParse:()=>safeParse,safeParseAsync:()=>safeParseAsync,standardProps:()=>standardProps,stripTabAndNewline:()=>stripTabAndNewline,toDotPath:()=>toDotPath,toJSONSchema:()=>toJSONSchema,toZod:()=>toZod,treeifyError:()=>treeifyError,urlHostnameOk:()=>urlHostnameOk,urlProtocolOk:()=>urlProtocolOk,util:()=>util_exports,validate:()=>validate,validateAsync:()=>validateAsync,validateURL:()=>validateURL,version:()=>version,withParser:()=>withParser});var util_exports={};__export(util_exports,{BIGINT_FORMAT_RANGES:()=>BIGINT_FORMAT_RANGES,CONSTANT_CATCH:()=>CONSTANT_CATCH,Class:()=>Class,NUMBER_FORMAT_RANGES:()=>NUMBER_FORMAT_RANGES,aborted:()=>aborted,allowsEval:()=>allowsEval,assert:()=>assert,assertEqual:()=>assertEqual,assertIs:()=>assertIs,assertNever:()=>assertNever,assertNotEqual:()=>assertNotEqual,assignProp:()=>assignProp,attachSchema:()=>attachSchema,base64ToUint8Array:()=>base64ToUint8Array,base64urlToUint8Array:()=>base64urlToUint8Array,cached:()=>cached,captureStackTrace:()=>captureStackTrace,cleanEnum:()=>cleanEnum,cleanRegex:()=>cleanRegex,clone:()=>clone,cloneDef:()=>cloneDef,codePointLength:()=>codePointLength,constantCatch:()=>constantCatch,createTransparentProxy:()=>createTransparentProxy,defineLazy:()=>defineLazy,defineLazyInternal:()=>defineLazyInternal,derived:()=>derived,esc:()=>esc,escapeRegex:()=>escapeRegex,explicitlyAborted:()=>explicitlyAborted,extend:()=>extend,finalizeIssue:()=>finalizeIssue,floatSafeRemainder:()=>floatSafeRemainder,getElementAtPath:()=>getElementAtPath,getEnumValues:()=>getEnumValues,getLengthableOrigin:()=>getLengthableOrigin,getParsedType:()=>getParsedType,getSizableOrigin:()=>getSizableOrigin,hexToUint8Array:()=>hexToUint8Array,hide:()=>hide,installLazyProp:()=>installLazyProp,isObject:()=>isObject,isPlainObject:()=>isPlainObject,issue:()=>issue,joinValues:()=>joinValues,jsonStringifyReplacer:()=>jsonStringifyReplacer,members:()=>members,merge:()=>merge,mergeDefs:()=>mergeDefs,normalizeParams:()=>normalizeParams,nullish:()=>nullish,numKeys:()=>numKeys,objectClone:()=>objectClone,omit:()=>omit,optionalKeys:()=>optionalKeys,own:()=>own,parsedType:()=>parsedType,partial:()=>partial,pick:()=>pick,prefixIssues:()=>prefixIssues,primitiveTypes:()=>primitiveTypes,promiseAllObject:()=>promiseAllObject,propertyKeyTypes:()=>propertyKeyTypes,randomString:()=>randomString,rawShape:()=>rawShape,required:()=>required,safeExtend:()=>safeExtend,shallowClone:()=>shallowClone,sizeCaps:()=>sizeCaps,slugify:()=>slugify,stringifyPrimitive:()=>stringifyPrimitive,toZod:()=>toZod,uint8ArrayToBase64:()=>uint8ArrayToBase64,uint8ArrayToBase64url:()=>uint8ArrayToBase64url,uint8ArrayToHex:()=>uint8ArrayToHex,unwrapMessage:()=>unwrapMessage});function assertEqual(e){return e}function assertNotEqual(e){return e}function toZod(){return e=>e}function assertIs(e){}function assertNever(e){throw new Error("Unexpected value in exhaustive check")}function assert(e){}function getEnumValues(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,u])=>t.indexOf(+r)===-1).map(([r,u])=>u)}function joinValues(e,t="|"){return e.map(n=>stringifyPrimitive(n)).join(t)}function jsonStringifyReplacer(e,t){return typeof t=="bigint"?t.toString():t}var Cached=class{constructor(e){this._getter=e,this._value=void 0}get value(){const e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function cached(e){return new Cached(e)}function nullish(e){return e==null}function cleanRegex(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function floatSafeRemainder(e,t){const n=e/t,r=Math.round(n),u=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<u?0:n-r}var EVALUATING=Symbol("evaluating");function defineLazy(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==EVALUATING)return r===void 0&&(r=EVALUATING,r=n()),r},set(u){Object.defineProperty(e,t,{value:u})},configurable:!0})}function objectClone(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function assignProp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function rawShape(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function sourceShape(e){return rawShape(e._zod.def)??e._zod.def.shape}function deferProp(e,t,n){Object.defineProperty(e,t,{get(){const r=n();return assignProp(this,t,r),r},enumerable:!0,configurable:!0})}function putProp(e,t,n){t in e?assignProp(e,t,n):e[t]=n}function mirrorShape(e,t,n,r){const u=sourceShape(t);for(const i of n){const o=Object.getOwnPropertyDescriptor(u,i);o.enumerable&&(o.get?deferProp(e,i,()=>{const a=t._zod.def.shape[i];return r?r(a,i):a}):putProp(e,i,r?r(o.value,i):o.value))}}function mirrorProps(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?deferProp(e,n,()=>t[n]):putProp(e,n,r.value))}}function mergeDefs(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function cloneDef(e){return mergeDefs(e._zod.def)}function getElementAtPath(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function promiseAllObject(e){const t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{const u={};for(let i=0;i<t.length;i++)u[t[i]]=r[i];return u})}function randomString(e=10){const t="abcdefghijklmnopqrstuvwxyz";let n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function esc(e){return JSON.stringify(e)}function slugify(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var captureStackTrace="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function isObject(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var allowsEval=cached(()=>{if(globalConfig.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function isPlainObject(e){if(isObject(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(isObject(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function shallowClone(e){return isPlainObject(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function numKeys(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var getParsedType=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},propertyKeyTypes=new Set(["string","number","symbol"]),primitiveTypes=new Set(["string","number","bigint","boolean","symbol","undefined"]);function escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function clone(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function normalizeParams(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function createTransparentProxy(e){let t;return new Proxy({},{get(n,r,u){return t??(t=e()),Reflect.get(t,r,u)},set(n,r,u,i){return t??(t=e()),Reflect.set(t,r,u,i)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,u){return t??(t=e()),Reflect.defineProperty(t,r,u)}})}function stringifyPrimitive(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function optionalKeys(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var NUMBER_FORMAT_RANGES={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},BIGINT_FORMAT_RANGES={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function pick(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const i={};return mirrorShape(i,e,maskedKeys(e,t)),clone(e,mergeDefs(n,{shape:i,checks:[]}))}function maskedKeys(e,t){const n=sourceShape(e),r=[];for(const u of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,u)?.enumerable)throw new Error(`Unrecognized key: "${String(u)}"`);t[u]&&r.push(u)}return r}function omit(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const i=new Set(maskedKeys(e,t)),o={};return mirrorShape(o,e,Reflect.ownKeys(sourceShape(e)).filter(a=>!i.has(a))),clone(e,mergeDefs(n,{shape:o,checks:[]}))}function extend(e,t){if(!isPlainObject(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const u=sourceShape(e);for(const i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(u,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return clone(e,mergeDefs(e._zod.def,{shape:extended(e,t)}))}function extended(e,t){const n={};return mirrorShape(n,e,Reflect.ownKeys(sourceShape(e))),mirrorProps(n,t),n}function safeExtend(e,t){if(!isPlainObject(t))throw new Error("Invalid input to safeExtend: expected a plain object");return clone(e,mergeDefs(e._zod.def,{shape:extended(e,t)}))}function merge(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};mirrorShape(n,e,Reflect.ownKeys(sourceShape(e))),mirrorShape(n,t,Reflect.ownKeys(sourceShape(t)));const r=mergeDefs(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return clone(e,r)}function partial(e,t,n,r="partial"){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const a=n?new Set(maskedKeys(t,n)):void 0,s={};return mirrorShape(s,t,Reflect.ownKeys(sourceShape(t)),e&&((c,l)=>a&&!a.has(l)?c:new e({type:"optional",innerType:c}))),clone(t,mergeDefs(t._zod.def,{shape:s,checks:[]}))}function required(e,t,n){const r=n?new Set(maskedKeys(t,n)):void 0,u={};return mirrorShape(u,t,Reflect.ownKeys(sourceShape(t)),(i,o)=>r&&!r.has(o)?i:new e({type:"nonoptional",innerType:i})),clone(t,mergeDefs(t._zod.def,{shape:u}))}function aborted(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function explicitlyAborted(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function prefixIssues(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function unwrapMessage(e){return typeof e=="string"?e:e?.message}function sizeCaps(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const u=r.maximum??r.length??r.size;u>=0&&t.push([u,n])}return t}function attachSchema(e,t,n){var r;for(let u=t;u<e.length;u++)(r=e[u]).schema??(r.schema=n)}function finalizeIssue(e,t,n){var r;const u=e.inst?._zod?.traits;u?.has("$ZodType")&&(u.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);const i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,o=e.message?e.message:unwrapMessage(e.inst?._zod.def?.error?.(e))??unwrapMessage(i?.(e))??unwrapMessage(t?.error?.(e))??unwrapMessage(n.customError?.(e))??unwrapMessage(n.localeError?.(e))??"Invalid input",a={};for(const s of Object.keys(e))s==="inst"||s==="schema"||s==="continue"||s==="input"||s==="__proto__"||(a[s]=e[s]);return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=e.input),a}function getSizableOrigin(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var highSurrogate=/[\uD800-\uDBFF]/;function codePointLength(e){const t=e.length;if(!highSurrogate.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function getLengthableOrigin(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function parsedType(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function issue(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function cleanEnum(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function base64ToUint8Array(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function uint8ArrayToBase64(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function base64urlToUint8Array(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return base64ToUint8Array(t+n)}function uint8ArrayToBase64url(e){return uint8ArrayToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function hexToUint8Array(e){const t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");const n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function uint8ArrayToHex(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Class=class{constructor(...e){}};function members(e,t){for(const n in t){const r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):defineBound(e,n,r.value)}}function own(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function hide(e,t,n){return own(e,t,n,!1)}function derived(e,t){for(const n in e){const r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return own(this,n,r(this))},set(u){own(this,n,u)}})}return t}function defineBound(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:own(this,t,n.bind(this))},set(r){own(this,t,r)}})}function claim(e,t){const n=Object.getPrototypeOf(e);return t in n?void 0:n}var installing,broke=!1,breaker={configurable:!0,get(){broke=!0}};function defineLazyInternal(e,t,n){const r=Object.getPrototypeOf(e._zod);if(t in r&&installing!==e._zod){installing=void 0;return}installing=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,breaker);const u=broke;broke=!1;try{const i=n(this);return broke?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),broke=broke||u,i}catch(i){throw delete this[t],broke=broke||u,i}},set(u){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:u})}})}function installLazyProp(e,t,n,r){const u=claim(e,t);u&&Object.defineProperty(u,t,{configurable:!0,get(){const i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,i),i.value=n(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:i})}})}var CONSTANT_CATCH="~constantCatch";function constantCatch(e){const t=()=>e;return t[CONSTANT_CATCH]=!0,t}var _a,NEVER=Object.freeze({status:"aborted"}),_zodDesc={value:void 0,enumerable:!1},_E="captureStackTrace"in Error?Error:null;function newError(e){const t=_E;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return _E=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function $constructor(e,t,n,r){const u={};function i(f){this.def=f,this.constr=d,this.traits=new Set}i.prototype=u;const o=n,a=o&&new WeakSet;function s(f,m){if(f._zod){if(f._zod.traits.has(e))return}else{_zodDesc.value=new i(m);try{Object.defineProperty(f,"_zod",_zodDesc)}finally{_zodDesc.value=void 0}}if(f._zod.traits.add(e),t(f,m),a){const g=Object.getPrototypeOf(f),E=f._zod.constr.prototype;let D=g;for(;D&&D!==E;)D=Object.getPrototypeOf(D);const p=D??g;a.has(p)||(a.add(p),members(p,o))}const h=d.prototype;for(const g in h)Object.prototype.hasOwnProperty.call(h,g)&&(g in f||(f[g]=h[g].bind(f)))}const c=r?.Parent??Object;class l extends c{}Object.defineProperty(l,"name",{value:e});function d(f){const m=r?.Parent?newError(l):this;s(m,f);const h=m._zod.deferred;if(h){for(const E of h)E();m._zod.deferred=void 0}const g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(m),m}return Object.defineProperty(d,"init",{value:s}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>r?.Parent&&f instanceof r.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var $brand=Symbol("zod_brand"),$ZodAsyncError=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},$ZodEncodeError=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(_a=globalThis).__zod_globalConfig??(_a.__zod_globalConfig={});var globalConfig=globalThis.__zod_globalConfig;function config(e){return e&&Object.assign(globalConfig,e),globalConfig}function _getMessage(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,jsonStringifyReplacer,2)),e.message}function _setMessage(e){this._zod.message=e}var _messageDesc={get:_getMessage,set:_setMessage,enumerable:!0,configurable:!0},_issuesDesc={value:void 0,enumerable:!1},_installedToString=new WeakSet([Object.prototype,Error.prototype]),initializer=(e,t)=>{e.name="$ZodError",_issuesDesc.value=t,Object.defineProperty(e,"issues",_issuesDesc),_issuesDesc.value=void 0,Object.defineProperty(e,"message",_messageDesc);const n=Object.getPrototypeOf(e);_installedToString.has(n)||(_installedToString.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},$ZodError=$constructor("$ZodError",initializer),$ZodRealError=$constructor("$ZodError",initializer,void 0,{Parent:Error});function node(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function flattenError(e,t=n=>n.message){const n={},r=[];for(const u of e.issues)u.path.length>0?node(n,u.path[0],()=>[]).push(t(u)):r.push(t(u));return{formErrors:r,fieldErrors:n}}function formatError(e,t=n=>n.message){const n={_errors:[]},r=(u,i=[])=>{for(const o of u.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a},[...i,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...i,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...i,...o.path]);else{const a=[...i,...o.path];if(a.length===0)n._errors.push(t(o));else{let s=n,c=0;for(;c<a.length;){const l=a[c],d=c===a.length-1;if(l==="_errors"){d&&s._errors.push(t(o)),c++;continue}Object.prototype.hasOwnProperty.call(s,l)||Object.defineProperty(s,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const f=s[l];d&&f._errors.push(t(o)),s=f,c++}}}};return r(e),n}function treeifyError(e,t=n=>n.message){const n={errors:[]},r=(u,i=[])=>{var o;for(const a of u.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>r({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...i,...a.path]);else{const s=[...i,...a.path];if(s.length===0){n.errors.push(t(a));continue}let c=n,l=0;for(;l<s.length;){const d=s[l],f=l===s.length-1;typeof d=="string"?(c.properties??(c.properties={}),Object.prototype.hasOwnProperty.call(c.properties,d)||Object.defineProperty(c.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),c=c.properties[d]):(c.items??(c.items=[]),(o=c.items)[d]??(o[d]={errors:[]}),c=c.items[d]),f&&c.errors.push(t(a)),l++}}};return r(e),n}function toDotPath(e){const t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(const r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function prettifyError(e){const t=[],n=[...e.issues].sort((r,u)=>(r.path??[]).length-(u.path??[]).length);for(const r of n)t.push(`✖ ${r.message}`),r.path?.length&&t.push(` → at ${toDotPath(r.path)}`);return t.join(`
6
- `)}function finalizeParams(e,t){return{callee:t?.callee??e,Err:t?.Err}}var _parse=e=>{const t=(n,r,u,i)=>{const o=u?{...u,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new $ZodAsyncError;if(a.issues.length){const s=new(i?.Err??e)(a.issues.map(c=>finalizeIssue(c,o,config())));throw captureStackTrace(s,i?.callee??t),s}return a.value};return t},parse=_parse($ZodRealError),_parseAsync=e=>{const t=async(n,r,u,i)=>{const o=u?{...u,async:!0}:{async:!0};let a=n._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const s=new(i?.Err??e)(a.issues.map(c=>finalizeIssue(c,o,config())));throw captureStackTrace(s,i?.callee??t),s}return a.value};return t},parseAsync=_parseAsync($ZodRealError),_safeParse=e=>(t,n,r)=>{const u=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},u);if(i instanceof Promise)throw new $ZodAsyncError;return i.issues.length?failure(e,i.issues,u):{success:!0,data:i.value}},safeParse=_safeParse($ZodRealError);function failure(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(u=>finalizeIssue(u,n,config()))),t=void 0,n=void 0),r},set error(u){r=u,t=void 0,n=void 0}}}var _safeParseAsync=e=>async(t,n,r)=>{const u=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},u);return i instanceof Promise&&(i=await i),i.issues.length?failure(e,i.issues,u):{success:!0,data:i.value}},safeParseAsync=_safeParseAsync($ZodRealError),COMPILE_INVALID=Symbol.for("zod.compile.invalid"),COMPILE_FALLBACK=Symbol.for("zod.compile.fallback"),validate=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==COMPILE_INVALID)return!0;if(r.definite===!0&&n===void 0)return!1}return validateFallback(e,t,n)});function validateFallback(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},u=e._zod.bag.fallbackRun;let i;if(u?(r[COMPILE_FALLBACK]=!0,i=u({value:t,issues:[]},r)):i=e._zod.run({value:t,issues:[]},r),i instanceof Promise)throw new $ZodAsyncError;return i.issues.length===0}var validateAsync=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let u=e._zod.run({value:t,issues:[]},r);return u instanceof Promise&&(u=await u),u.issues.length===0},_encode=e=>{const t=_parse(e),n=(r,u,i,o)=>{const a=i?{...i,direction:"backward"}:{direction:"backward"};return t(r,u,a,finalizeParams(n,o))};return n},encode=_encode($ZodRealError),_decode=e=>{const t=_parse(e),n=(r,u,i,o)=>t(r,u,i,finalizeParams(n,o));return n},decode=_decode($ZodRealError),_encodeAsync=e=>{const t=_parseAsync(e),n=async(r,u,i,o)=>{const a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(r,u,a,finalizeParams(n,o))};return n},encodeAsync=_encodeAsync($ZodRealError),_decodeAsync=e=>{const t=_parseAsync(e),n=async(r,u,i,o)=>await t(r,u,i,finalizeParams(n,o));return n},decodeAsync=_decodeAsync($ZodRealError),_safeEncode=e=>(t,n,r)=>{const u=r?{...r,direction:"backward"}:{direction:"backward"};return _safeParse(e)(t,n,u)},safeEncode=_safeEncode($ZodRealError),_safeDecode=e=>(t,n,r)=>_safeParse(e)(t,n,r),safeDecode=_safeDecode($ZodRealError),_safeEncodeAsync=e=>async(t,n,r)=>{const u=r?{...r,direction:"backward"}:{direction:"backward"};return _safeParseAsync(e)(t,n,u)},safeEncodeAsync=_safeEncodeAsync($ZodRealError),_safeDecodeAsync=e=>async(t,n,r)=>_safeParseAsync(e)(t,n,r),safeDecodeAsync=_safeDecodeAsync($ZodRealError),regexes_exports={};__export(regexes_exports,{anyString:()=>anyString,base64:()=>base64,base64url:()=>base64url,bigint:()=>bigint,boolean:()=>boolean,browserEmail:()=>browserEmail,cidrv4:()=>cidrv4,cidrv6:()=>cidrv6,creditCard:()=>creditCard,cuid:()=>cuid,cuid2:()=>cuid2,currencyCode:()=>currencyCode,date:()=>date,datetime:()=>datetime,domain:()=>domain,duration:()=>duration,e164:()=>e164,email:()=>email,emoji:()=>emoji,extendedDuration:()=>extendedDuration,guid:()=>guid,hex:()=>hex,hostname:()=>hostname,html5Email:()=>html5Email,httpProtocol:()=>httpProtocol,iban:()=>iban,idnEmail:()=>idnEmail,integer:()=>integer,ipv4:()=>ipv4,ipv6:()=>ipv6,ksuid:()=>ksuid,lowercase:()=>lowercase,mac:()=>mac,md5_base64:()=>md5_base64,md5_base64url:()=>md5_base64url,md5_hex:()=>md5_hex,nanoid:()=>nanoid,nanoidOfLength:()=>nanoidOfLength,null:()=>_null,number:()=>number,rfc5322Email:()=>rfc5322Email,sha1_base64:()=>sha1_base64,sha1_base64url:()=>sha1_base64url,sha1_hex:()=>sha1_hex,sha256_base64:()=>sha256_base64,sha256_base64url:()=>sha256_base64url,sha256_hex:()=>sha256_hex,sha384_base64:()=>sha384_base64,sha384_base64url:()=>sha384_base64url,sha384_hex:()=>sha384_hex,sha512_base64:()=>sha512_base64,sha512_base64url:()=>sha512_base64url,sha512_hex:()=>sha512_hex,string:()=>string,time:()=>time,ulid:()=>ulid,undefined:()=>_undefined,unicodeEmail:()=>unicodeEmail,uppercase:()=>uppercase,uuid:()=>uuid,uuid4:()=>uuid4,uuid6:()=>uuid6,uuid7:()=>uuid7,xid:()=>xid});var cuid=/^[cC][0-9a-z]{6,}$/,cuid2=/^[0-9a-z]+$/,ulid=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,xid=/^[0-9a-vA-V]{20}$/,ksuid=/^[A-Za-z0-9]{27}$/,nanoid=/^[a-zA-Z0-9_-]{21}$/;function nanoidOfLength(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var duration=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,extendedDuration=/^[-+]?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)?)??$/,guid=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,uuid=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,uuid4=uuid(4),uuid6=uuid(6),uuid7=uuid(7),email=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,html5Email=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,rfc5322Email=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,unicodeEmail=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,idnEmail=unicodeEmail,browserEmail=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,_emoji="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function emoji(){return new RegExp(_emoji,"u")}var 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])$/,ipv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,mac=e=>{const t=escapeRegex(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},cidrv4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,cidrv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(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=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,hostname=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,domain=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,httpProtocol=/^https?$/,e164=/^\+[1-9]\d{6,14}$/,creditCard=/^\d(?:[ -]?\d){11,18}$/,currencyCode=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,iban=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,dateSource="(?:(?:\\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])))";function anchor(e){return new RegExp(`^${e}$`)}var date=anchor(dateSource);function timeSource(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function time(e){return new RegExp(`^${timeSource(e)}$`)}function datetime(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${timeSource({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${timeSource({precision:e.precision})}`:n;return new RegExp(`^${dateSource}T(?:${r})$`)}var anyString=/^[\s\S]{0,}$/,string=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},bigint=/^-?\d+n?$/,integer=/^-?\d+$/,number=/^-?\d+(?:\.\d+)?$/,boolean=/^(?:true|false)$/i,_null=/^null$/i,_undefined=/^undefined$/i,lowercase=/^[^A-Z]*$/,uppercase=/^[^a-z]*$/,hex=/^[0-9a-fA-F]*$/;function fixedBase64(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function fixedBase64url(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var md5_hex=/^[0-9a-fA-F]{32}$/,md5_base64=fixedBase64(22,"=="),md5_base64url=fixedBase64url(22),sha1_hex=/^[0-9a-fA-F]{40}$/,sha1_base64=fixedBase64(27,"="),sha1_base64url=fixedBase64url(27),sha256_hex=/^[0-9a-fA-F]{64}$/,sha256_base64=fixedBase64(43,"="),sha256_base64url=fixedBase64url(43),sha384_hex=/^[0-9a-fA-F]{96}$/,sha384_base64=fixedBase64(64,""),sha384_base64url=fixedBase64url(64),sha512_hex=/^[0-9a-fA-F]{128}$/,sha512_base64=fixedBase64(86,"=="),sha512_base64url=fixedBase64url(86),$ZodCheck=$constructor("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_whenHasSize=e=>{const t=e.value;return!nullish(t)&&t.size!==void 0},_whenHasLength=e=>{const t=e.value;return!nullish(t)&&t.length!==void 0},numericOriginMap={number:"number",bigint:"bigint",object:"date"},$ZodCheckLessThan=$constructor("$ZodCheckLessThan",(e,t)=>{$ZodCheck.init(e,t);const n=numericOriginMap[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:numericOriginMap[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$ZodCheckGreaterThan=$constructor("$ZodCheckGreaterThan",(e,t)=>{$ZodCheck.init(e,t);const n=numericOriginMap[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:numericOriginMap[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$ZodCheckMultipleOf=$constructor("$ZodCheckMultipleOf",(e,t)=>{$ZodCheck.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):floatSafeRemainder(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),$ZodCheckNumberFormat=$constructor("$ZodCheckNumberFormat",(e,t)=>{$ZodCheck.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[u,i]=NUMBER_FORMAT_RANGES[t.format];e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<u&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:u,inclusive:!0,inst:e,continue:!t.abort}),a>i&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),$ZodCheckBigIntFormat=$constructor("$ZodCheckBigIntFormat",(e,t)=>{$ZodCheck.init(e,t);const[n,r]=BIGINT_FORMAT_RANGES[t.format];e._zod.check=u=>{const i=u.value;i<n&&u.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>r&&u.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),$ZodCheckMaxSize=$constructor("$ZodCheckMaxSize",(e,t)=>{var n;$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=_whenHasSize),e._zod.check=r=>{const u=r.value;u.size<=t.maximum||r.issues.push({origin:getSizableOrigin(u),code:"too_big",maximum:t.maximum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),$ZodCheckMinSize=$constructor("$ZodCheckMinSize",(e,t)=>{var n;$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=_whenHasSize),e._zod.check=r=>{const u=r.value;u.size>=t.minimum||r.issues.push({origin:getSizableOrigin(u),code:"too_small",minimum:t.minimum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),$ZodCheckSizeEquals=$constructor("$ZodCheckSizeEquals",(e,t)=>{var n;$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=_whenHasSize),e._zod.check=r=>{const u=r.value,i=u.size;if(i===t.size)return;const o=i>t.size;r.issues.push({origin:getSizableOrigin(u),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),$ZodCheckMaxLength=$constructor("$ZodCheckMaxLength",(e,t)=>{var n;$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=_whenHasLength),e._zod.check=r=>{const u=r.value,i=u.length;if((typeof u=="string"&&i>t.maximum?codePointLength(u):i)<=t.maximum)return;const a=getLengthableOrigin(u);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),$ZodCheckMinLength=$constructor("$ZodCheckMinLength",(e,t)=>{var n;$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=_whenHasLength),e._zod.check=r=>{const u=r.value,i=u.length;if((typeof u=="string"&&i>=t.minimum&&i<t.minimum*2?codePointLength(u):i)>=t.minimum)return;const a=getLengthableOrigin(u);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),$ZodCheckLengthEquals=$constructor("$ZodCheckLengthEquals",(e,t)=>{var n;$ZodCheck.init(e,t),(n=e._zod.def).when??(n.when=_whenHasLength),e._zod.check=r=>{const u=r.value,i=u.length,o=typeof u=="string"&&i>=t.length&&i<=t.length*2?codePointLength(u):i;if(o===t.length)return;const a=getLengthableOrigin(u),s=o>t.length;r.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),$ZodCheckStringFormat=$constructor("$ZodCheckStringFormat",(e,t)=>{var n,r;$ZodCheck.init(e,t),t.pattern?(n=e._zod).check??(n.check=u=>{t.pattern.lastIndex=0,!t.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:t.format,input:u.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),$ZodCheckRegex=$constructor("$ZodCheckRegex",(e,t)=>{$ZodCheckStringFormat.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),$ZodCheckLowerCase=$constructor("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=lowercase),$ZodCheckStringFormat.init(e,t)}),$ZodCheckUpperCase=$constructor("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=uppercase),$ZodCheckStringFormat.init(e,t)}),$ZodCheckIncludes=$constructor("$ZodCheckIncludes",(e,t)=>{$ZodCheck.init(e,t);const n=escapeRegex(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=u=>{u.value.includes(t.includes,t.position)||u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:u.value,inst:e,continue:!t.abort})}}),$ZodCheckStartsWith=$constructor("$ZodCheckStartsWith",(e,t)=>{$ZodCheck.init(e,t);const n=new RegExp(`^${escapeRegex(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),$ZodCheckEndsWith=$constructor("$ZodCheckEndsWith",(e,t)=>{$ZodCheck.init(e,t);const n=new RegExp(`.*${escapeRegex(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function handleCheckPropertyResult(e,t,n){e.issues.length&&t.issues.push(...prefixIssues(n,e.issues))}var $ZodCheckProperty=$constructor("$ZodCheckProperty",(e,t)=>{$ZodCheck.init(e,t),e._zod.check=n=>{const r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(u=>handleCheckPropertyResult(u,n,t.property));handleCheckPropertyResult(r,n,t.property)}}),$ZodCheckProperties=$constructor("$ZodCheckProperties",(e,t)=>{$ZodCheck.init(e,t),hide(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(o=>[o,t.shape[o]]));const u=r.value;let i;for(const[o,a]of n){const s=a._zod.run({value:u[o],issues:[]},{});s instanceof Promise?(i??(i=[]),i.push(s.then(c=>handleCheckPropertyResult(c,r,o)))):handleCheckPropertyResult(s,r,o)}if(i)return Promise.all(i).then(()=>{})}}),$ZodCheckMimeType=$constructor("$ZodCheckMimeType",(e,t)=>{$ZodCheck.init(e,t);const n=new Set(t.mime);e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),$ZodCheckOverwrite=$constructor("$ZodCheckOverwrite",(e,t)=>{$ZodCheck.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}}),Doc=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const n=e.split(`
7
- `).filter(i=>i),r=Math.min(...n.map(i=>i.length-i.trimStart().length)),u=n.map(i=>i.slice(r)).map(i=>" ".repeat(this.indent*2)+i);for(const i of u)this.content.push(i)}compile(){const e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
8
- ${t.join(`
9
- `)}
10
- };`)(...Object.values(this.closed))}},version={major:4,minor:6,patch:7},$ZodType=$constructor("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=version;const r=e._zod.def.checks,u=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(const i of u)for(const o of i._zod.onattach)o(e);if(u.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(a,s,c)=>{if(a.memo)return a;let l=aborted(a),d;for(const f of s){if(f._zod.def.when){if(explicitlyAborted(a)||!f._zod.def.when(a))continue}else if(l)continue;const m=a.issues.length,h=f._zod.check(a);if(h instanceof Promise&&c?.async===!1)throw new $ZodAsyncError;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await h,a.issues.length!==m&&(attachSchema(a.issues,m,e),l||(l=aborted(a,m)))});else{if(a.issues.length===m)continue;attachSchema(a.issues,m,e),l||(l=aborted(a,m))}}return d?d.then(()=>a):a},o=(a,s,c)=>{if(aborted(a))return a.aborted=!0,a;const l=i(s,u,c);if(l instanceof Promise){if(c.async===!1)throw new $ZodAsyncError;return l.then(d=>e._zod.parse(d,c))}return e._zod.parse(l,c)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){const l=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(d=>o(d,a,s)):o(l,a,s)}const c=e._zod.parse(a,s);if(c instanceof Promise){if(s.async===!1)throw new $ZodAsyncError;return c.then(l=>i(l,u,s))}return i(c,u,s)}}},{get"~standard"(){return hide(this,"~standard",standardProps(this))},set"~standard"(e){own(this,"~standard",e)}}),toStandardResult=(e,t)=>e.issues.length?{issues:e.issues.map(n=>finalizeIssue(n,t,config()))}:{value:e.value};async function validateAsync2(e,t){const n={async:!0};return toStandardResult(await e._zod.run({value:t,issues:[]},n),n)}function standardProps(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return toStandardResult(r,n)}catch{}return validateAsync2(e,t)},vendor:"zod",version:1}}var $ZodString=$constructor("$ZodString",(e,t)=>{$ZodType.init(e,t),e._zod.pattern=t.pattern??anyString,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),$ZodStringFormat=$constructor("$ZodStringFormat",(e,t)=>{$ZodCheckStringFormat.init(e,t),$ZodString.init(e,t)}),$ZodGUID=$constructor("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=guid),$ZodStringFormat.init(e,t)}),$ZodUUID=$constructor("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=uuid(r))}else t.pattern??(t.pattern=uuid());$ZodStringFormat.init(e,t)}),$ZodEmail=$constructor("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=email),$ZodStringFormat.init(e,t)}),URL_BAD_FORMAT=1,URL_UNPARSEABLE=2;function canParseURL(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function validateURL(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?canParseURL(e)||URL_UNPARSEABLE:parseURLObject(e,t)}function parseURLObject(e,t){if(!t.normalize&&t.protocol?.source===httpProtocol.source&&!/^https?:\/\//i.test(e))return URL_BAD_FORMAT;try{if(typeof URL<"u"){const n=URL;if(typeof n.parse=="function")return n.parse(e)??URL_UNPARSEABLE}return new URL(e)}catch{return URL_UNPARSEABLE}}var asciiTabOrNewline=/[\t\n\r]/g;function stripTabAndNewline(e){return e.replace(asciiTabOrNewline,"")}function urlHostnameOk(e,t){return t.lastIndex=0,t.test(e.hostname)}function urlProtocolOk(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var $ZodURL=$constructor("$ZodURL",(e,t)=>{$ZodStringFormat.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),u=validateURL(r,t);if(u===URL_BAD_FORMAT){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(u===URL_UNPARSEABLE){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(u===!0){n.value=stripTabAndNewline(r);return}t.hostname&&!urlHostnameOk(u,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!urlProtocolOk(u,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?u.href:stripTabAndNewline(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),$ZodEmoji=$constructor("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=emoji()),$ZodStringFormat.init(e,t)}),$ZodNanoID=$constructor("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?nanoid:nanoidOfLength(t.length)),$ZodStringFormat.init(e,t)}),$ZodCUID=$constructor("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=cuid),$ZodStringFormat.init(e,t)}),$ZodCUID2=$constructor("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=cuid2),$ZodStringFormat.init(e,t)}),$ZodULID=$constructor("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ulid),$ZodStringFormat.init(e,t)}),$ZodXID=$constructor("$ZodXID",(e,t)=>{t.pattern??(t.pattern=xid),$ZodStringFormat.init(e,t)}),$ZodKSUID=$constructor("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ksuid),$ZodStringFormat.init(e,t)}),$ZodISODateTime=$constructor("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=datetime(t)),$ZodStringFormat.init(e,t)}),$ZodISODate=$constructor("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=date),$ZodStringFormat.init(e,t)}),$ZodISOTime=$constructor("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=time(t)),$ZodStringFormat.init(e,t)}),$ZodISODuration=$constructor("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=duration),$ZodStringFormat.init(e,t)}),$ZodIPv4=$constructor("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ipv4),$ZodStringFormat.init(e,t)}),ipv6Alphabet=/^[0-9a-fA-F:.]+$/;function isValidIPv6(e){return ipv6Alphabet.test(e)?canParseURL(`http://[${e}]`):!1}var $ZodIPv6=$constructor("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ipv6),$ZodStringFormat.init(e,t),e._zod.check=n=>{isValidIPv6(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),$ZodMAC=$constructor("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=mac(t.delimiter)),$ZodStringFormat.init(e,t)}),$ZodCIDRv4=$constructor("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=cidrv4),$ZodStringFormat.init(e,t)});function isValidCIDRv6(e){const t=e.split("/");if(t.length!==2)return!1;const[n,r]=t;if(!r)return!1;const u=Number(r);return`${u}`!==r||u<0||u>128?!1:isValidIPv6(n)}var $ZodCIDRv6=$constructor("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=cidrv6),$ZodStringFormat.init(e,t),e._zod.check=n=>{isValidCIDRv6(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function isValidBase64(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var base64Charset=/^[0-9a-zA-Z+/]*={0,2}$/,$ZodBase64=$constructor("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=base64Charset),$ZodStringFormat.init(e,t),e._zod.check=n=>{isValidBase64(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),base64urlCharset=/^[A-Za-z0-9_-]*$/;function isValidBase64URL(e){if(!base64urlCharset.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return isValidBase64(n)}var $ZodBase64URL=$constructor("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=base64urlCharset),$ZodStringFormat.init(e,t),e._zod.check=n=>{isValidBase64URL(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),$ZodE164=$constructor("$ZodE164",(e,t)=>{t.pattern??(t.pattern=e164),$ZodStringFormat.init(e,t)}),CC_SANITIZE=/[- ]/g;function isLuhnAlgo(e){let t=e.length,n=1,r=0;for(;t;){const u=e.charCodeAt(--t)-48;n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][u]:u}return r%10===0}function isValidCreditCard(e){return creditCard.test(e)?isLuhnAlgo(e.replace(CC_SANITIZE,"")):!1}var $ZodCreditCard=$constructor("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=creditCard),$ZodStringFormat.init(e,t),e._zod.check=n=>{isValidCreditCard(n.value)||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}});function isIso7064Mod97(e){let t=0;const n=e.length;for(let r=4;r<n;r++){const u=e.charCodeAt(r);t=(u>=65?t*100+(u-55):t*10+(u-48))%97}for(let r=0;r<4;r++){const u=e.charCodeAt(r);t=(u>=65?t*100+(u-55):t*10+(u-48))%97}return t===1}function isValidIBAN(e){return iban.test(e)?isIso7064Mod97(e):!1}var $ZodIBAN=$constructor("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=iban),$ZodStringFormat.init(e,t),e._zod.check=n=>{isValidIBAN(n.value)||n.issues.push({code:"invalid_format",format:"iban",input:n.value,inst:e,continue:!t.abort})}});function isValidJWT(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const u=JSON.parse(atob(r));return!("typ"in u&&u?.typ!=="JWT"||!u.alg||t&&(!("alg"in u)||u.alg!==t))}catch{return!1}}var $ZodJWT=$constructor("$ZodJWT",(e,t)=>{$ZodStringFormat.init(e,t),e._zod.check=n=>{isValidJWT(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),$ZodCustomStringFormat=$constructor("$ZodCustomStringFormat",(e,t)=>{$ZodStringFormat.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),$ZodNumber=$constructor("$ZodNumber",(e,t)=>{$ZodType.init(e,t),e._zod.pattern=number,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const u=n.value;if(typeof u=="number"&&!Number.isNaN(u)&&Number.isFinite(u))return n;const i=typeof u=="number"?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:String(u):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:u,inst:e,...i?{received:i}:{}}),n}}),$ZodNumberFormat=$constructor("$ZodNumberFormat",(e,t)=>{$ZodCheckNumberFormat.init(e,t),$ZodNumber.init(e,t)}),$ZodBoolean=$constructor("$ZodBoolean",(e,t)=>{$ZodType.init(e,t),e._zod.pattern=boolean,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const u=n.value;return typeof u=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:e}),n}}),$ZodBigInt=$constructor("$ZodBigInt",(e,t)=>{$ZodType.init(e,t),e._zod.pattern=bigint,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),$ZodBigIntFormat=$constructor("$ZodBigIntFormat",(e,t)=>{$ZodCheckBigIntFormat.init(e,t),$ZodBigInt.init(e,t)}),$ZodSymbol=$constructor("$ZodSymbol",(e,t)=>{$ZodType.init(e,t),e._zod.parse=(n,r)=>{const u=n.value;return typeof u=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:u,inst:e}),n}}),$ZodUndefined=$constructor("$ZodUndefined",(e,t)=>{$ZodType.init(e,t),e._zod.pattern=_undefined,e._zod.values=new Set([void 0]),e._zod.parse=(n,r)=>{const u=n.value;return typeof u>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:u,inst:e}),n}}),$ZodNull=$constructor("$ZodNull",(e,t)=>{$ZodType.init(e,t),e._zod.pattern=_null,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const u=n.value;return u===null||n.issues.push({expected:"null",code:"invalid_type",input:u,inst:e}),n}}),$ZodAny=$constructor("$ZodAny",(e,t)=>{$ZodType.init(e,t),e._zod.parse=n=>n}),$ZodUnknown=$constructor("$ZodUnknown",(e,t)=>{$ZodType.init(e,t),e._zod.parse=n=>n}),$ZodNever=$constructor("$ZodNever",(e,t)=>{$ZodType.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),$ZodVoid=$constructor("$ZodVoid",(e,t)=>{$ZodType.init(e,t),e._zod.parse=(n,r)=>{const u=n.value;return typeof u>"u"||n.issues.push({expected:"void",code:"invalid_type",input:u,inst:e}),n}}),$ZodDate=$constructor("$ZodDate",(e,t)=>{$ZodType.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const u=n.value,i=u instanceof Date;return i&&!Number.isNaN(u.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:u,...i?{received:"Invalid Date"}:{},inst:e}),n}});function capSize(e,t){const n=sizeCaps(e._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(i=>i[0])),u=e._zod.parse;e._zod.parse=(i,o)=>{const a=t(i.value);if(a>r&&!o?.skipChecks&&o?.direction!=="backward"){for(const[s,c]of sizeCaps(e._zod.def.checks))if(a>s&&c._zod.def.when(i)){const l=i.issues.length;return c._zod.check(i),i.issues[l].continue=!1,attachSchema(i.issues,l,e),i}}return u(i,o)}}var arraySize=e=>Array.isArray(e)?e.length:-1,mapSize=e=>e instanceof Map?e.size:-1,setSize=e=>e instanceof Set?e.size:-1;function handleArrayResult(e,t,n){e.issues.length&&t.issues.push(...prefixIssues(n,e.issues)),t.value[n]=e.value}var $ZodArray=$constructor("$ZodArray",(e,t)=>{$ZodType.init(e,t);const n=globalConfig.memoizer;n?.attach(e),e._zod.parse=(r,u)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=n?n.alloc(e,r,Array(i.length),u):Array(i.length);const o=[],a=u?.abortEarly;for(let s=0;s<i.length;s++){const c=i[s],l=t.element._zod.run({value:c,issues:[]},u);if(l instanceof Promise)o.push(l.then(d=>handleArrayResult(d,r,s)));else if(handleArrayResult(l,r,s),a&&l.issues.length!==0&&aborted(l))break}return o.length?Promise.all(o).then(()=>r):r},capSize(e,arraySize)});function handlePropertyResult(e,t,n,r,u,i){const o=n in r,a=i==="optional";if(!(!o&&a&&u==="optional")){if(e.issues.length){if(u!==void 0&&a&&!o)return;t.issues.push(...prefixIssues(n,e.issues))}if(!o&&u===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(o||u==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}var NO_SYMBOL_KEYS=[];function normalizeDef(e){const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:NO_SYMBOL_KEYS,u=r.length?[...t,...r]:t;for(const o of u)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(o)}": expected a Zod schema`);const i=optionalKeys(e.shape);return{...e,allKeys:u,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function handleCatchall(e,t,n,r,u,i,o){const a=[],s=u.keySet,c=u.catchall._zod,l=c.def.type,d=c.optin,f=c.optout;let m=0;for(const h in t){if(o&&n.issues.length!==m){if(aborted(n,m))break;m=n.issues.length}if(s.has(h))continue;if(h==="__proto__"){l==="never"&&a.push(h);continue}if(l==="never"){a.push(h);continue}const g=c.run({value:t[h],issues:[]},r);g instanceof Promise?e.push(g.then(E=>handlePropertyResult(E,n,h,t,d,f))):handlePropertyResult(g,n,h,t,d,f)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var $ZodObject=$constructor("$ZodObject",(e,t)=>{$ZodType.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){const c=()=>{const l={...r};return Object.defineProperty(t,"shape",{value:l}),c.raw=l,l};c.raw=r,Object.defineProperty(t,"shape",{get:c})}const u=cached(()=>normalizeDef(t));defineLazyInternal(e,"propValues",c=>{const l=c.def.shape,d={};for(const f in l){const m=l[f]._zod;if(m.values){Object.prototype.hasOwnProperty.call(d,f)||assignProp(d,f,new Set);for(const h of m.values)d[f].add(h);m.optin!==void 0&&d[f].add(void 0)}}return d});const i=isObject,o=t.catchall;let a;const s=globalConfig.memoizer;s?.attach(e),e._zod.parse=(c,l)=>{a??(a=u.value);const d=c.value;if(!i(d))return c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c;c.value=s?s.alloc(e,c,{},l):{};const f=[],m=a.shape,h=l?.abortEarly;let g=c.issues.length;for(const E of a.allKeys){if(h&&c.issues.length!==g){if(aborted(c,g))break;g=c.issues.length}if(E==="__proto__")continue;const D=m[E],p=D._zod.optin,v=D._zod.optout,y=D._zod.run({value:d[E],issues:[]},l);y instanceof Promise?f.push(y.then(A=>handlePropertyResult(A,c,E,d,p,v))):handlePropertyResult(y,c,E,d,p,v)}return o?handleCatchall(f,d,c,l,u.value,e,h===!0):f.length?Promise.all(f).then(()=>c):c}}),$ZodObjectJIT=$constructor("$ZodObjectJIT",(e,t)=>{$ZodObject.init(e,t);const n=e._zod.parse,r=cached(()=>normalizeDef(t)),u=globalConfig.memoizer,i=m=>{const h=r.value,g=h.symbolKeys,E=new Doc(["payload","ctx"],{shape:m,inst:e,memo:u,syms:g}),D=A=>`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`,p=(A,b)=>`
11
- let ${A}_ab = false;
12
- for (let i = 0; i < ${A}.issues.length; i++) {
13
- const iss = ${A}.issues[i];
14
- iss.path = iss.path ? [${b}, ...iss.path] : [${b}];
15
- payload.issues.push(iss);
16
- if (iss.continue !== true) ${A}_ab = true;
17
- }
18
- if (${A}_ab && ctx && ctx.abortEarly) {
19
- payload.value = newResult;
20
- return payload;
21
- }`;E.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const A of h.allKeys)v[A]=`key_${y++}`;E.write(u?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const A of h.allKeys){if(A==="__proto__")continue;const b=v[A],x=typeof A=="symbol"?`syms[${g.indexOf(A)}]`:esc(A),B=`${x} in input`,$=m[A],k=$?._zod?.optin,w=k!==void 0,I=$?._zod?.optout==="optional";if(E.write(`const ${b} = ${D(x)};`),w&&I){const M=k==="optional"?`${b}_present`:`${b}.value !== undefined || ${b}_present`;E.write(`
22
- const ${b}_present = ${B};
23
- if (!${b}.issues.length || ${b}_present) {
24
- if (${b}.issues.length) {${p(b,x)}
25
- }
26
-
27
- if (${M}) {
28
- newResult[${x}] = ${b}.value;
29
- }
30
- }
31
-
32
- `)}else w?(E.write(`
33
- if (${b}.issues.length) {${p(b,x)}
34
- }
35
- `),k==="defaulted"?E.write(`newResult[${x}] = ${b}.value;`):E.write(`
36
- if (${b}.value !== undefined || ${B}) {
37
- newResult[${x}] = ${b}.value;
38
- }
39
- `)):E.write(`
40
- const ${b}_present = ${B};
41
- if (${b}.issues.length) {${p(b,x)}
42
- }
43
- if (!${b}_present && !${b}.issues.length) {
44
- payload.issues.push({
45
- code: "invalid_type",
46
- expected: "nonoptional",
47
- input: undefined,
48
- path: [${x}]
49
- });
50
- if (ctx && ctx.abortEarly) {
51
- payload.value = newResult;
52
- return payload;
53
- }
54
- }
55
-
56
- if (${b}_present) {
57
- newResult[${x}] = ${b}.value;
58
- }
59
-
60
- `)}return E.write("payload.value = newResult;"),E.write("return payload;"),E.compile()};let o;const a=isObject,s=!globalConfig.jitless,l=s&&allowsEval.value,d=t.catchall;let f;e._zod.parse=(m,h)=>{f??(f=r.value);const g=m.value;return a(g)?s&&l&&h?.async===!1&&h.jitless!==!0?(o||(o=i(t.shape)),m=o(m,h),d?handleCatchall([],g,m,h,f,e,h?.abortEarly===!0):m):n(m,h):(m.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),m)}});function handleUnionResults(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const u=e.filter(i=>!aborted(i));return u.length===1?(t.value=u[0].value,u[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>finalizeIssue(o,r,config())))}),t)}var $ZodUnion=$constructor("$ZodUnion",(e,t)=>{$ZodType.init(e,t),defineLazyInternal(e,"optin",r=>r.def.options.some(u=>u._zod.optin==="defaulted")?"defaulted":r.def.options.some(u=>u._zod.optin!==void 0)?"optional":void 0),defineLazyInternal(e,"optout",r=>r.def.options.some(u=>u._zod.optout==="optional")?"optional":void 0),defineLazyInternal(e,"values",r=>{if(r.def.options.every(u=>u._zod.values))return new Set(r.def.options.flatMap(u=>Array.from(u._zod.values)))}),defineLazyInternal(e,"pattern",r=>{if(r.def.options.every(u=>u._zod.pattern)){const u=r.def.options.map(i=>i._zod.pattern);return new RegExp(`^(${u.map(i=>cleanRegex(i.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,u)=>{if(n)return n(r,u);let i=!1;const o=[];for(const a of t.options){const s=a._zod.run({value:r.value,issues:[]},u);if(s instanceof Promise)o.push(s),i=!0;else{if(s.issues.length===0)return s;o.push(s)}}return i?Promise.all(o).then(a=>handleUnionResults(a,r,e,u)):handleUnionResults(o,r,e,u)}});function handleExclusiveUnionResults(e,t,n,r){const u=[];for(let i=0;i<e.length;i++)e[i].issues.length===0&&u.push(i);return u.length===1?(t.value=e[u[0]].value,t):(u.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>finalizeIssue(o,r,config())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:u}),t)}var $ZodXor=$constructor("$ZodXor",(e,t)=>{$ZodUnion.init(e,t),t.inclusive=!1;const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,u)=>{if(n)return n(r,u);let i=!1;const o=[];for(const a of t.options){const s=a._zod.run({value:r.value,issues:[]},u);s instanceof Promise?(o.push(s),i=!0):o.push(s)}return i?Promise.all(o).then(a=>handleExclusiveUnionResults(a,r,e,u)):handleExclusiveUnionResults(o,r,e,u)}});function getDiscriminatedOption(e,t){const n=e._zod;let r=n.bag.optionsMap;r||(r=discriminatorMap(n.def),n.bag.optionsMap=r);const u=r.get(t);if(u===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return u}function discriminatorMap(e){const t=new Map;for(const n of e.options){const r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(const u of r)if(t.has(u)){if(u!==void 0)throw new Error(`Duplicate discriminator value "${String(u)}"`);t.set(u,null)}else t.set(u,n)}return t}var $ZodDiscriminatedUnion=$constructor("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,$ZodUnion.init(e,t);const n=e._zod.parse;defineLazyInternal(e,"propValues",u=>{const i={};let o=0;for(const a of u.def.options){const s=a._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${u.def.options.indexOf(a)}"`);s[u.def.discriminator]?.has(void 0)&&o++;for(const[c,l]of Object.entries(s)){Object.prototype.hasOwnProperty.call(i,c)||assignProp(i,c,new Set);for(const d of l)i[c].add(d)}}return!u.def.unionFallback&&o>1&&i[u.def.discriminator]?.delete(void 0),i}),t.options.forEach((u,i)=>{const o=rawShape(u._zod.def);if(o&&!Object.prototype.hasOwnProperty.call(o,t.discriminator))throw new Error(`Invalid discriminated union option at index "${i}"`)});const r=cached(()=>discriminatorMap(t));e._zod.parse=(u,i)=>{const o=u.value;if(!isObject(o))return u.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),u;const a=o?.[t.discriminator],s=r.value.get(a);return s&&(a!==void 0||i.direction!=="backward")?s._zod.run(u,i):t.unionFallback||i.direction==="backward"?n(u,i):(u.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(c=>r.value.get(c)!==null),input:o,path:[t.discriminator],inst:e}),u)}}),$ZodIntersection=$constructor("$ZodIntersection",(e,t)=>{$ZodType.init(e,t),e._zod.parse=(n,r)=>{const u=n.value,i=t.left._zod.run({value:u,issues:[]},r),o=t.right._zod.run({value:u,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([s,c])=>handleIntersectionResults(n,s,c)):handleIntersectionResults(n,i,o)}});function mergeValues(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(isPlainObject(e)&&isPlainObject(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),u={...e,...t};Object.prototype.hasOwnProperty.call(u,"__proto__")&&delete u.__proto__;for(const i of r){if(i==="__proto__")continue;const o=mergeValues(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};u[i]=o.data}return{valid:!0,data:u}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const u=e[r],i=t[r],o=mergeValues(u,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function handleIntersectionResults(e,t,n){const r=new Map;let u;const i=new Map,o=(c,l)=>{let d;if(c.code==="unrecognized_keys"&&!c.path?.length)u??(u=c),d=c.keys;else if(c.code==="invalid_key"&&c.origin==="record"&&c.path?.length===1){const f=String(c.path[0]);i.has(f)||i.set(f,c),d=[f]}else return!1;for(const f of d)r.has(f)||r.set(f,{}),r.get(f)[l]=!0;return!0};for(const c of t.issues)o(c,"l")||e.issues.push(c);for(const c of n.issues)o(c,"r")||e.issues.push(c);const a=[...r].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(a.length){const c=u?a.filter(l=>u.keys.includes(l)):[];c.length&&e.issues.push({...u,keys:c});for(const l of a)!c.includes(l)&&i.has(l)&&e.issues.push(i.get(l))}const s=mergeValues(t.value,n.value);if(!s.valid){if(aborted(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`)}return e.value=s.data,e}var $ZodTuple=$constructor("$ZodTuple",(e,t)=>{$ZodType.init(e,t);const n=t.items,r=globalConfig.memoizer;r?.attach(e),e._zod.parse=(u,i)=>{const o=u.value;if(!Array.isArray(o))return u.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),u;u.value=r?r.alloc(e,u,[],i):[];const a=[],s=getTupleOptStart(n,"optin"),c=getTupleOptStart(n,"optout");if(!t.rest){if(o.length<s)return u.issues.push({code:"too_small",minimum:s,inclusive:!0,input:o,inst:e,origin:"array"}),u;o.length>n.length&&u.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:e,origin:"array"})}const l=new Array(n.length),d=t.rest?i?.abortEarly:void 0;let f=!1;for(let m=0;m<n.length;m++){const h=n[m]._zod.run({value:o[m],issues:[]},i);h instanceof Promise?a.push(h.then(g=>{l[m]=g})):(l[m]=h,d&&!f&&h.issues.length&&(f=aborted(h)))}if(t.rest&&!f){let m=n.length-1;const h=o.slice(n.length);let g=u.issues.length;for(const E of h){if(d&&u.issues.length!==g){if(aborted(u,g))break;g=u.issues.length}m++;const D=t.rest._zod.run({value:E,issues:[]},i);D instanceof Promise?a.push(D.then(p=>handleTupleResult(p,u,m))):handleTupleResult(D,u,m)}}return a.length?Promise.all(a).then(()=>handleTupleResults(l,u,n,o,c)):handleTupleResults(l,u,n,o,c)}});function getTupleOptStart(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function handleTupleResult(e,t,n){e.issues.length&&t.issues.push(...prefixIssues(n,e.issues)),t.value[n]=e.value}function handleTupleResults(e,t,n,r,u){for(let i=0;i<n.length;i++){const o=e[i],a=i<r.length;if(!a&&i>=u&&n[i]._zod.optin==="optional"){t.value.length=i;break}if(o.issues.length){if(!a&&i>=u){t.value.length=i;break}t.issues.push(...prefixIssues(i,o.issues))}t.value[i]=o.value}for(let i=t.value.length-1;i>=r.length&&(n[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}var $ZodRecord=$constructor("$ZodRecord",(e,t)=>{$ZodType.init(e,t);const n=globalConfig.memoizer;n?.attach(e),e._zod.parse=(r,u)=>{const i=r.value;if(!isPlainObject(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;const o=[],a=t.keyType._zod.values;if(a&&!t.partial){r.value=n?n.alloc(e,r,{},u):{};const s=new Set;for(const l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){if(s.add(typeof l=="number"?l.toString():l),l==="__proto__")continue;const d=t.keyType._zod.run({value:l,issues:[]},u);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(h=>finalizeIssue(h,u,config())),input:l,path:[l],inst:e});continue}const f=d.value;if(f==="__proto__")continue;const m=t.valueType._zod.run({value:i[l],issues:[]},u);m instanceof Promise?o.push(m.then(h=>{h.issues.length&&r.issues.push(...prefixIssues(l,h.issues)),r.value[f]=h.value})):(m.issues.length&&r.issues.push(...prefixIssues(l,m.issues)),r.value[f]=m.value)}let c;for(const l in i)if(!s.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;r.value[l]=i[l]}else c=c??[],c.push(l);c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c,continue:!0})}else{r.value=n?n.alloc(e,r,{},u):{};let s;for(const c of Reflect.ownKeys(i)){if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,c))continue;let l=t.keyType._zod.run({value:c,issues:[]},u);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&number.test(c)&&l.issues.length){const h=t.keyType._zod.run({value:Number(c),issues:[]},u);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(l=h)}if(l.issues.length){t.mode==="loose"?r.value[c]=i[c]:a?(s=s??[],s.push(c)):r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(h=>finalizeIssue(h,u,config())),input:c,path:[c],inst:e});continue}const f=l.value;if(f==="__proto__")continue;const m=t.valueType._zod.run({value:i[c],issues:[]},u);m instanceof Promise?o.push(m.then(h=>{h.issues.length&&r.issues.push(...prefixIssues(c,h.issues)),r.value[f]=h.value})):(m.issues.length&&r.issues.push(...prefixIssues(c,m.issues)),r.value[f]=m.value)}s&&s.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:s,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),$ZodMap=$constructor("$ZodMap",(e,t)=>{$ZodType.init(e,t);const n=globalConfig.memoizer;n?.attach(e),e._zod.parse=(r,u)=>{const i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;const o=[];r.value=n?n.alloc(e,r,new Map,u):new Map;const a=u?.abortEarly;let s=r.issues.length;for(const[c,l]of i){if(a&&r.issues.length!==s){if(aborted(r,s))break;s=r.issues.length}const d=t.keyType._zod.run({value:c,issues:[]},u),f=t.valueType._zod.run({value:l,issues:[]},u);d instanceof Promise||f instanceof Promise?o.push(Promise.all([d,f]).then(([m,h])=>{handleMapResult(m,h,r,c,i,e,u)})):handleMapResult(d,f,r,c,i,e,u)}return o.length?Promise.all(o).then(()=>r):r},capSize(e,mapSize)});function handleMapResult(e,t,n,r,u,i,o){e.issues.length&&(propertyKeyTypes.has(typeof r)?n.issues.push(...prefixIssues(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:u,inst:i,issues:e.issues.map(a=>finalizeIssue(a,o,config()))})),t.issues.length&&(propertyKeyTypes.has(typeof r)?n.issues.push(...prefixIssues(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:u,inst:i,key:r,issues:t.issues.map(a=>finalizeIssue(a,o,config()))})),n.value.set(e.value,t.value)}var $ZodSet=$constructor("$ZodSet",(e,t)=>{$ZodType.init(e,t);const n=globalConfig.memoizer;n?.attach(e),e._zod.parse=(r,u)=>{const i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;const o=[];r.value=n?n.alloc(e,r,new Set,u):new Set;const a=u?.abortEarly;let s=r.issues.length;for(const c of i){if(a&&r.issues.length!==s){if(aborted(r,s))break;s=r.issues.length}const l=t.valueType._zod.run({value:c,issues:[]},u);l instanceof Promise?o.push(l.then(d=>handleSetResult(d,r))):handleSetResult(l,r)}return o.length?Promise.all(o).then(()=>r):r},capSize(e,setSize)});function handleSetResult(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var $ZodEnum=$constructor("$ZodEnum",(e,t)=>{$ZodType.init(e,t);const n=getEnumValues(t.entries),r=new Set(n);e._zod.values=r,defineLazyInternal(e,"pattern",u=>{const i=getEnumValues(u.def.entries).filter(o=>propertyKeyTypes.has(typeof o));return new RegExp(i.length?`^(${i.map(o=>escapeRegex(o.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(u,i)=>{const o=u.value;return r.has(o)||u.issues.push({code:"invalid_value",values:n,input:o,inst:e}),u}}),$ZodLiteral=$constructor("$ZodLiteral",(e,t)=>{$ZodType.init(e,t);const n=new Set(t.values);e._zod.values=n,defineLazyInternal(e,"pattern",r=>{const u=r.def.values;return new RegExp(u.length?`^(${u.map(i=>typeof i=="string"?escapeRegex(i):i?escapeRegex(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,u)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),$ZodFile=$constructor("$ZodFile",(e,t)=>{$ZodType.init(e,t),e._zod.parse=(n,r)=>{const u=n.value;return u instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:u,inst:e}),n}}),$ZodTransform=$constructor("$ZodTransform",(e,t)=>{$ZodType.init(e,t),e._zod.optin="optional",globalConfig.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new $ZodEncodeError(e.constructor.name);const u=t.transform(n.value,n);if(r.async)return(u instanceof Promise?u:Promise.resolve(u)).then(o=>(n.value=o,n));if(u instanceof Promise)throw new $ZodAsyncError;return n.value=u,n}});function handleOptionalResult(e,t){return e.value=t.issues.length?void 0:t.value,e}var $ZodOptional=$constructor("$ZodOptional",(e,t)=>{$ZodType.init(e,t),defineLazyInternal(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",defineLazyInternal(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),defineLazyInternal(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${cleanRegex(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const u=t.innerType._zod.run({value:n.value,issues:[]},r);return u instanceof Promise?u.then(i=>handleOptionalResult(n,i)):handleOptionalResult(n,u)}return t.innerType._zod.run(n,r)}}),$ZodExactOptional=$constructor("$ZodExactOptional",(e,t)=>{$ZodOptional.init(e,t),defineLazyInternal(e,"values",n=>n.def.innerType._zod.values),defineLazyInternal(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),$ZodNullable=$constructor("$ZodNullable",(e,t)=>{$ZodType.init(e,t),defineLazyInternal(e,"optin",n=>n.def.innerType._zod.optin),defineLazyInternal(e,"optout",n=>n.def.innerType._zod.optout),defineLazyInternal(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${cleanRegex(r.source)}|null)$`):void 0}),defineLazyInternal(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),$ZodDefault=$constructor("$ZodDefault",(e,t)=>{$ZodType.init(e,t),e._zod.optin="defaulted",defineLazyInternal(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const u=t.innerType._zod.run(n,r);return u instanceof Promise?u.then(i=>handleDefaultResult(i,t)):handleDefaultResult(u,t)}});function handleDefaultResult(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var $ZodPrefault=$constructor("$ZodPrefault",(e,t)=>{$ZodType.init(e,t),e._zod.optin="defaulted",defineLazyInternal(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),$ZodNonOptional=$constructor("$ZodNonOptional",(e,t)=>{$ZodType.init(e,t),defineLazyInternal(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(u=>u!==void 0)):void 0}),e._zod.parse=(n,r)=>{const u=t.innerType._zod.run(n,r);return u instanceof Promise?u.then(i=>handleNonOptionalResult(i,e)):handleNonOptionalResult(u,e)}});function handleNonOptionalResult(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var $ZodSuccess=$constructor("$ZodSuccess",(e,t)=>{$ZodType.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new $ZodEncodeError("ZodSuccess");const u=t.innerType._zod.run(n,r);return u instanceof Promise?u.then(i=>(n.value=i.issues.length===0,n)):(n.value=u.issues.length===0,n)}});function handleCatchResult(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(u=>finalizeIssue(u,r,config()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var $ZodCatch=$constructor("$ZodCatch",(e,t)=>{$ZodType.init(e,t),defineLazyInternal(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),defineLazyInternal(e,"optout",n=>n.def.innerType._zod.optout),defineLazyInternal(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const u=t.innerType._zod.run({value:n.value,issues:[]},r);return u instanceof Promise?u.then(i=>handleCatchResult(n,i,t,r)):handleCatchResult(n,u,t,r)}}),$ZodNaN=$constructor("$ZodNaN",(e,t)=>{$ZodType.init(e,t),e._zod.parse=(n,r)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),$ZodPipe=$constructor("$ZodPipe",(e,t)=>{$ZodType.init(e,t),defineLazyInternal(e,"values",n=>n.def.in._zod.values),defineLazyInternal(e,"optin",n=>n.def.in._zod.optin),defineLazyInternal(e,"optout",n=>n.def.out._zod.optout),defineLazyInternal(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>handlePipeResult(o,t.in,r)):handlePipeResult(i,t.in,r)}const u=t.in._zod.run(n,r);return u instanceof Promise?u.then(i=>handlePipeResult(i,t.out,r)):handlePipeResult(u,t.out,r)}});function handlePipeResult(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var $ZodCodec=$constructor("$ZodCodec",(e,t)=>{$ZodType.init(e,t),defineLazyInternal(e,"values",n=>n.def.in._zod.values),defineLazyInternal(e,"optin",n=>n.def.in._zod.optin),defineLazyInternal(e,"optout",n=>n.def.out._zod.optout),defineLazyInternal(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if((r.direction||"forward")==="forward"){const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(o=>handleCodecAResult(o,t,r)):handleCodecAResult(i,t,r)}else{const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>handleCodecAResult(o,t,r)):handleCodecAResult(i,t,r)}}});function handleCodecAResult(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){const u=t.transform(e.value,e);return u instanceof Promise?u.then(i=>handleCodecTxResult(e,i,t.out,n)):handleCodecTxResult(e,u,t.out,n)}else{const u=t.reverseTransform(e.value,e);return u instanceof Promise?u.then(i=>handleCodecTxResult(e,i,t.in,n)):handleCodecTxResult(e,u,t.in,n)}}function handleCodecTxResult(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var $ZodPreprocess=$constructor("$ZodPreprocess",(e,t)=>{$ZodPipe.init(e,t)}),$ZodReadonly=$constructor("$ZodReadonly",(e,t)=>{$ZodType.init(e,t),defineLazyInternal(e,"propValues",n=>n.def.innerType._zod.propValues),defineLazyInternal(e,"values",n=>n.def.innerType._zod.values),defineLazyInternal(e,"optin",n=>n.def.innerType?._zod?.optin),defineLazyInternal(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const u=t.innerType._zod.run(n,r);return u instanceof Promise?u.then(handleReadonlyResult):handleReadonlyResult(u)}});function handleReadonlyResult(e){return e.memo||(e.value=Object.freeze(e.value)),e}function leafPattern(e){const t=e._zod.def;let n=t.pattern,r=!!t.format?.includes("int"),u,i;for(const a of t.checks??[]){const s=a._zod.def;s.pattern&&(n=s.pattern),r||(r=!!s.format?.includes("int"));const c=s.minimum??s.length,l=s.maximum??s.length;c!==void 0&&(u===void 0||c>u)&&(u=c),l!==void 0&&(i===void 0||l<i)&&(i=l)}if(n)return n.source;if(u!==void 0&&i!==void 0&&u>i)return"(?!)";if(u!==void 0||i!==void 0)return string({minimum:u,maximum:i}).source;const o=e._zod.pattern;return(r&&o===number?integer:o)?.source}function partPattern(e){const t=e._zod.def,n=e._zod.pattern?.source,r=t.innerType??e._zod.innerType;if(r){const u=r._zod.pattern?.source,i=partPattern(r);return n&&u&&i&&i!==u?n.replace(cleanRegex(u),()=>cleanRegex(i)):n}if(t.options){const u=t.options.map(partPattern);if(u.every(Boolean))return`^(${u.map(i=>cleanRegex(i)).join("|")})$`}return leafPattern(e)}var $ZodTemplateLiteral=$constructor("$ZodTemplateLiteral",(e,t)=>{$ZodType.init(e,t);const n=[];for(const r of t.parts)if(typeof r=="object"&&r!==null){const u=partPattern(r);if(!u)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);n.push(cleanRegex(u))}else if(r===null||primitiveTypes.has(typeof r))n.push(escapeRegex(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(r,u)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),$ZodFunction=$constructor("$ZodFunction",(e,t)=>($ZodType.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...r){const u=e._def.input?parse(e._def.input,r):r,i=Reflect.apply(n,this,u);return e._def.output?parse(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...r){const u=e._def.input?await parseAsync(e._def.input,r):r,i=await Reflect.apply(n,this,u);return e._def.output?await parseAsync(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(n,r)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{const r=e.constructor;return Array.isArray(n[0])?new r({type:"function",input:new $ZodTuple({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new r({type:"function",input:n[0],output:e._def.output})},e.output=n=>{const r=e.constructor;return new r({type:"function",input:e._def.input,output:n})},e)),$ZodPromise=$constructor("$ZodPromise",(e,t)=>{$ZodType.init(e,t),e._zod.parse=(n,r)=>Promise.resolve(n.value).then(u=>t.innerType._zod.run({value:u,issues:[]},r))}),$ZodLazy=$constructor("$ZodLazy",(e,t)=>{$ZodType.init(e,t),defineLazy(e._zod,"innerType",()=>{const n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),defineLazyInternal(e,"pattern",n=>n.innerType?._zod?.pattern),defineLazyInternal(e,"propValues",n=>n.innerType?._zod?.propValues),defineLazyInternal(e,"optin",n=>n.innerType?._zod?.optin??void 0),defineLazyInternal(e,"optout",n=>n.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),$ZodCustom=$constructor("$ZodCustom",(e,t)=>{$ZodCheck.init(e,t),$ZodType.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,u=t.fn(r);if(u instanceof Promise)return u.then(i=>handleRefineResult(i,n,r,e));handleRefineResult(u,n,r,e)}});function handleRefineResult(e,t,n,r){if(!e){const u={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(u.params=r._zod.def.params),t.issues.push(issue(u))}}var $ZodCyclicError=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},STATE="~memo",NO_ISSUES=[];function isRef(e){return e!==null&&typeof e=="object"}function cloneIssues(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var recursive=new WeakMap,NONE=0,ASSUMED=1,PROVEN=2;function isRecursive(e,t,n){const r=recursive.get(e);if(r!==void 0)return r?PROVEN:NONE;if(t.has(e))return PROVEN;t.add(e);let u=NONE;const i=l=>{if(u!==PROVEN&&l?._zod){const d=isRecursive(l,t,n);d>u&&(u=d)}},o=(l,d)=>{let f=NONE;for(const m of Reflect.ownKeys(l)){const h=Object.getOwnPropertyDescriptor(l,m);if(d&&!h.enumerable)continue;const g=h.get?ASSUMED:h.value?._zod?isRecursive(h.value,t,n):NONE;g>f&&(f=g)}return f},a=l=>{l>u&&(u=l)},s=e._zod.def,c=s.type;switch(c){case"object":{const l=rawShape(s);a(l?o(l,!0):ASSUMED),i(s.catchall);break}case"array":i(s.element);break;case"tuple":for(const l of s.items)i(l);i(s.rest);break;case"record":case"map":i(s.keyType),i(s.valueType);break;case"set":i(s.valueType);break;case"union":for(const l of s.options)i(l);break;case"intersection":i(s.left),i(s.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(s.innerType);break;case"pipe":i(s.in),i(s.out);break;case"function":i(s.input),i(s.output);break;case"lazy":{const l=s._cachedInner??(n?e._zod.innerType:void 0);a(l?isRecursive(l,t,!1):ASSUMED);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const l in s){const d=Object.getOwnPropertyDescriptor(s,l);if(!d||d.get)continue;const f=d.value;if(!(!f||typeof f!="object")){if(f._zod)i(f);else if(Array.isArray(f))for(const m of f)i(m)}}}return t.delete(e),settle(e,u)}function settle(e,t){return t!==ASSUMED&&recursive.set(e,t===PROVEN),t}function isRecursiveSchema(e){return isRecursive(e,new Set,!0)!==NONE}function bucketFor(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var handoff,open=[],memo={alloc(e,t,n){const r=handoff;if(!r)return n;handoff=void 0;const u={value:n,issues:null};return r.set(t.value,u),open.push(u),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(u,i)=>{if(i.direction!=="backward"&&isBackEdge(i,u.value))throw new $ZodCyclicError;return n(u,i)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,u,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const o=e._zod.parse,a=(s,c)=>{if(n===void 0){const D=isRecursive(e,new Set,!1);if(D===NONE)return e._zod.parse=o,e._zod.run===a&&(e._zod.run=o),o(s,c);D===PROVEN||r?n=!0:r=!0}const l=s.value;if(!isRef(l))return o(s,c);let d=c[STATE];d||(d={buckets:new WeakMap,backEdges:void 0},c[STATE]=d);let f;u===c?f=i:(f=bucketFor(d,e),u=c,i=f);const m=f.get(l);if(m)return s.value=m.value,m.issues?m.issues.length&&s.issues.push(...cloneIssues(m.issues)):(s.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(m.value)),s;handoff=f;const h=open.length,g=o(s,c);handoff=void 0;const E=open.length>h?open.pop():void 0;return g instanceof Promise?g.then(D=>(E&&(E.issues=D.issues.length?cloneIssues(D.issues):NO_ISSUES),D)):(E&&(E.issues=g.issues.length?cloneIssues(g.issues):NO_ISSUES),g)};e._zod.parse=a,e._zod.run===o&&(e._zod.run=a)})}};function memoizer(){return memo}function isBackEdge(e,t){const n=e[STATE]?.backEdges;return n!==void 0&&isRef(t)&&n.has(t)}var locales_exports={};__export(locales_exports,{ar:()=>ar_default,az:()=>az_default,be:()=>be_default,bg:()=>bg_default,bn:()=>bn_default,ca:()=>ca_default,ckb:()=>ckb_default,cs:()=>cs_default,da:()=>da_default,de:()=>de_default,el:()=>el_default,en:()=>en_default,eo:()=>eo_default,es:()=>es_default,fa:()=>fa_default,fi:()=>fi_default,fr:()=>fr_default,frCA:()=>fr_CA_default,gu:()=>gu_default,he:()=>he_default,hi:()=>hi_default,hr:()=>hr_default,hu:()=>hu_default,hy:()=>hy_default,id:()=>id_default,is:()=>is_default,it:()=>it_default,ja:()=>ja_default,ka:()=>ka_default,kh:()=>kh_default,km:()=>km_default,kn:()=>kn_default,ko:()=>ko_default,lt:()=>lt_default,mk:()=>mk_default,ms:()=>ms_default,ne:()=>ne_default,nl:()=>nl_default,nn:()=>nn_default,no:()=>no_default,ota:()=>ota_default,pl:()=>pl_default,ps:()=>ps_default,pt:()=>pt_default,ptBR:()=>pt_BR_default,ro:()=>ro_default,ru:()=>ru_default,sk:()=>sk_default,sl:()=>sl_default,sv:()=>sv_default,ta:()=>ta_default,tg:()=>tg_default,th:()=>th_default,tk:()=>tk_default,tr:()=>tr_default,ua:()=>ua_default,uk:()=>uk_default,ur:()=>ur_default,uz:()=>uz_default,vi:()=>vi_default,yo:()=>yo_default,zhCN:()=>zh_CN_default,zhTW:()=>zh_TW_default});var error=()=>{const e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"},map:{unit:"عنصر",verb:"أن يحوي"}};function t(u){return e[u]??null}const n={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",mac:"عنوان MAC",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",credit_card:"رقم بطاقة الائتمان",currency_code:"رمز العملة",iban:"IBAN",jwt:"JWT",template_literal:"مدخل"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${u.expected}، ولكن تم إدخال ${a}`:`مدخلات غير مقبولة: يفترض إدخال ${i}، ولكن تم إدخال ${a}`}case"invalid_value":return u.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${stringifyPrimitive(u.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?` أكبر من اللازم: يفترض أن تكون ${u.origin??"القيمة"} ${i} ${u.maximum.toString()} ${o.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${u.origin??"القيمة"} ${i} ${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`أصغر من اللازم: يفترض لـ ${u.origin} أن يكون ${i} ${u.minimum.toString()} ${o.unit}`:`أصغر من اللازم: يفترض لـ ${u.origin} أن يكون ${i} ${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${u.prefix}"`:i.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`:i.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`:i.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`:`${n[i.format]??u.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${u.divisor}`;case"unrecognized_keys":return`معرف${u.keys.length>1?"ات":""} غريب${u.keys.length>1?"ة":""}: ${joinValues(u.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${u.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${u.origin}`;default:return"مدخل غير مقبول"}}};function ar_default(){return{localeError:error()}}var error2=()=>{const e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"},map:{unit:"element",verb:"olmalıdır"}};function t(u){return e[u]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",credit_card:"kredit kartı nömrəsi",currency_code:"valyuta kodu",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Yanlış dəyər: gözlənilən instanceof ${u.expected}, daxil olan ${a}`:`Yanlış dəyər: gözlənilən ${i}, daxil olan ${a}`}case"invalid_value":return u.values.length===1?`Yanlış dəyər: gözlənilən ${stringifyPrimitive(u.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Çox böyük: gözlənilən ${u.origin??"dəyər"} ${i}${u.maximum.toString()} ${o.unit??"element"}`:`Çox böyük: gözlənilən ${u.origin??"dəyər"} ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Çox kiçik: gözlənilən ${u.origin} ${i}${u.minimum.toString()} ${o.unit}`:`Çox kiçik: gözlənilən ${u.origin} ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`:i.format==="ends_with"?`Yanlış mətn: "${i.suffix}" ilə bitməlidir`:i.format==="includes"?`Yanlış mətn: "${i.includes}" daxil olmalıdır`:i.format==="regex"?`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${n[i.format]??u.format}`}case"not_multiple_of":return`Yanlış ədəd: ${u.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${u.keys.length>1?"lar":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`${u.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${u.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function az_default(){return{localeError:error2()}}function getBelarusianPlural(e,t,n,r){const u=Math.abs(e),i=u%10,o=u%100;return o>=11&&o<=19?r:i===1?t:i>=2&&i<=4?n:r}var error3=()=>{const e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},map:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(u){return e[u]??null}const n={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",mac:"MAC адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",credit_card:"нумар крэдытнай карты",currency_code:"код валюты",iban:"IBAN",jwt:"JWT",template_literal:"увод"},r={nan:"NaN",number:"лік",array:"масіў"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Няправільны ўвод: чакаўся instanceof ${u.expected}, атрымана ${a}`:`Няправільны ўвод: чакаўся ${i}, атрымана ${a}`}case"invalid_value":return u.values.length===1?`Няправільны ўвод: чакалася ${stringifyPrimitive(u.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);if(o){const a=Number(u.maximum),s=getBelarusianPlural(a,o.unit.one,o.unit.few,o.unit.many);return`Занадта вялікі: чакалася, што ${u.origin??"значэнне"} павінна ${o.verb} ${i}${u.maximum.toString()} ${s}`}return`Занадта вялікі: чакалася, што ${u.origin??"значэнне"} павінна быць ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);if(o){const a=Number(u.minimum),s=getBelarusianPlural(a,o.unit.one,o.unit.few,o.unit.many);return`Занадта малы: чакалася, што ${u.origin} павінна ${o.verb} ${i}${u.minimum.toString()} ${s}`}return`Занадта малы: чакалася, што ${u.origin} павінна быць ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${i.prefix}"`:i.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${i.suffix}"`:i.format==="includes"?`Няправільны радок: павінен змяшчаць "${i.includes}"`:i.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`:`Няправільны ${n[i.format]??u.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${u.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${u.keys.length>1?"ключы":"ключ"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${u.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${u.origin}`;default:return"Няправільны ўвод"}}};function be_default(){return{localeError:error3()}}var error4=()=>{const e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"},map:{unit:"елемента",verb:"да съдържа"}};function t(u){return e[u]??null}const n={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",mac:"MAC адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",credit_card:"номер на кредитна карта",currency_code:"код на валута",iban:"IBAN",jwt:"JWT",template_literal:"вход"},r={nan:"NaN",number:"число",array:"масив"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Невалиден вход: очакван instanceof ${u.expected}, получен ${a}`:`Невалиден вход: очакван ${i}, получен ${a}`}case"invalid_value":return u.values.length===1?`Невалиден вход: очакван ${stringifyPrimitive(u.values[0])}`:`Невалидна опция: очаквано едно от ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Твърде голямо: очаква се ${u.origin??"стойност"} да съдържа ${i}${u.maximum.toString()} ${o.unit??"елемента"}`:`Твърде голямо: очаква се ${u.origin??"стойност"} да бъде ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Твърде малко: очаква се ${u.origin} да съдържа ${i}${u.minimum.toString()} ${o.unit}`:`Твърде малко: очаква се ${u.origin} да бъде ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;if(i.format==="starts_with")return`Невалиден низ: трябва да започва с "${i.prefix}"`;if(i.format==="ends_with")return`Невалиден низ: трябва да завършва с "${i.suffix}"`;if(i.format==="includes")return`Невалиден низ: трябва да включва "${i.includes}"`;if(i.format==="regex")return`Невалиден низ: трябва да съвпада с ${i.pattern}`;let o="Невалиден";return i.format==="emoji"&&(o="Невалидно"),i.format==="datetime"&&(o="Невалидно"),i.format==="date"&&(o="Невалидна"),i.format==="time"&&(o="Невалидно"),i.format==="duration"&&(o="Невалидна"),`${o} ${n[i.format]??u.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${u.divisor}`;case"unrecognized_keys":return`Неразпознат${u.keys.length>1?"и":""} ключ${u.keys.length>1?"ове":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${u.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${u.origin}`;default:return"Невалиден вход"}}};function bg_default(){return{localeError:error4()}}var error5=()=>{const e={string:{unit:"অক্ষর",verb:"থাকতে হবে"},file:{unit:"বাইট",verb:"থাকতে হবে"},array:{unit:"আইটেম",verb:"থাকতে হবে"},set:{unit:"আইটেম",verb:"থাকতে হবে"},map:{unit:"এন্ট্রি",verb:"থাকতে হবে"}};function t(u){return e[u]??null}const n={regex:"ইনপুট",email:"ইমেইল ঠিকানা",url:"URL",emoji:"ইমোজি",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO তারিখ ও সময়",date:"ISO তারিখ",time:"ISO সময়",duration:"ISO সময়কাল",ipv4:"IPv4 ঠিকানা",ipv6:"IPv6 ঠিকানা",mac:"MAC ঠিকানা",cidrv4:"IPv4 রেঞ্জ",cidrv6:"IPv6 রেঞ্জ",base64:"base64-এনকোডেড স্ট্রিং",base64url:"base64url-এনকোডেড স্ট্রিং",json_string:"JSON স্ট্রিং",e164:"E.164 নম্বর",credit_card:"ক্রেডিট কার্ড নম্বর",currency_code:"মুদ্রা কোড",iban:"IBAN",jwt:"JWT",template_literal:"ইনপুট"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return`অবৈধ ইনপুট: প্রত্যাশিত ${i}, প্রাপ্ত ${a}`}case"invalid_value":return u.values.length===1?`অবৈধ ইনপুট: প্রত্যাশিত ${stringifyPrimitive(u.values[0])}`:`অবৈধ অপশন: ${joinValues(u.values," | ")} এর মধ্যে একটি প্রত্যাশিত`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`অনেক বড়: ${u.origin??"মান"} ${i}${u.maximum.toString()} ${o.unit??"এলিমেন্ট"} হতে হবে`:`অনেক বড়: ${u.origin??"মান"} ${i}${u.maximum.toString()} হতে হবে`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`অনেক ছোট: ${u.origin} ${i}${u.minimum.toString()} ${o.unit} হতে হবে`:`অনেক ছোট: ${u.origin} ${i}${u.minimum.toString()} হতে হবে`}case"invalid_format":{const i=u;return i.format==="starts_with"?`অবৈধ স্ট্রিং: "${i.prefix}" দিয়ে শুরু হতে হবে`:i.format==="ends_with"?`অবৈধ স্ট্রিং: "${i.suffix}" দিয়ে শেষ হতে হবে`:i.format==="includes"?`অবৈধ স্ট্রিং: "${i.includes}" অন্তর্ভুক্ত থাকতে হবে`:i.format==="regex"?`অবৈধ স্ট্রিং: ${i.pattern} প্যাটার্ন মিলতে হবে`:`অবৈধ ${n[i.format]??u.format}`}case"not_multiple_of":return`অবৈধ নম্বর: ${u.divisor} এর গুণিতক হতে হবে`;case"unrecognized_keys":return`অচেনা কী${u.keys.length>1?"গুলো":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`${u.origin} এ অবৈধ কী`;case"invalid_union":return u.options&&Array.isArray(u.options)&&u.options.length>0?`অবৈধ ডিসক্রিমিনেটর মান। প্রত্যাশিত ${u.options.map(o=>`'${o}'`).join(" | ")}`:"অবৈধ ইনপুট";case"invalid_element":return`${u.origin} এ অবৈধ মান`;default:return"অবৈধ ইনপুট"}}};function bn_default(){return{localeError:error5()}}var error6=()=>{const e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"},map:{unit:"elements",verb:"contenir"}};function t(u){return e[u]??null}const n={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",mac:"adreça MAC",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",credit_card:"número de targeta de crèdit",currency_code:"codi de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Tipus invàlid: s'esperava instanceof ${u.expected}, s'ha rebut ${a}`:`Tipus invàlid: s'esperava ${i}, s'ha rebut ${a}`}case"invalid_value":return u.values.length===1?`Valor invàlid: s'esperava ${stringifyPrimitive(u.values[0])}`:`Opció invàlida: s'esperava una de ${joinValues(u.values," o ")}`;case"too_big":{const i=u.inclusive?"com a màxim":"menys de",o=t(u.origin);return o?`Massa gran: s'esperava que ${u.origin??"el valor"} contingués ${i} ${u.maximum.toString()} ${o.unit??"elements"}`:`Massa gran: s'esperava que ${u.origin??"el valor"} fos ${i} ${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?"com a mínim":"més de",o=t(u.origin);return o?`Massa petit: s'esperava que ${u.origin} contingués ${i} ${u.minimum.toString()} ${o.unit}`:`Massa petit: s'esperava que ${u.origin} fos ${i} ${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Format invàlid: ha de començar amb "${i.prefix}"`:i.format==="ends_with"?`Format invàlid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format invàlid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${i.pattern}`:`Format invàlid per a ${n[i.format]??u.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${u.divisor}`;case"unrecognized_keys":return`Clau${u.keys.length>1?"s":""} no reconeguda${u.keys.length>1?"s":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${u.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${u.origin}`;default:return"Entrada invàlida"}}};function ca_default(){return{localeError:error6()}}var error7=()=>{const e={string:{unit:"پیت",verb:"بێت"},file:{unit:"بایت",verb:"بێت"},array:{unit:"دانە",verb:"بێت"},set:{unit:"دانە",verb:"بێت"},map:{unit:"دانە",verb:"بێت"}};function t(u){return e[u]??null}const n={regex:"regex",email:"ئیمەیڵ",url:"بەستەر (URL)",emoji:"ئیمۆجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ڕێکەوت و کات",date:"ڕێکەوت",time:"کات",duration:"ماوە",ipv4:"ناونیشانی IPv4",ipv6:"ناونیشانی IPv6",mac:"ناونیشانی MAC",cidrv4:"مەودای IPv4",cidrv6:"مەودای IPv6",base64:"دەقی base64",base64url:"دەقی base64url",json_string:"دەقی JSON",e164:"ژمارەی E.164",credit_card:"ژمارەی کارتی کرێدیت",currency_code:"کۆدی دراو",iban:"IBAN",jwt:"JWT",template_literal:"تێکردە"},r={nan:"NaN",string:"نووسین",number:"ژمارە",boolean:"boolean",array:"array",object:"object",date:"ڕێکەوت",integer:"ژمارە",float:"ژمارە",null:"null",undefined:"undefined",function:"function",symbol:"symbol",unknown:"unknown",promise:"promise",void:"void",never:"never",map:"map",set:"set"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o,s=["ا","و","ۆ","وو","ە","ی","ێ"].some(l=>a.endsWith(l))?"یە":"ە",c=/^[a-zA-Z]+$/.test(a);return o==="null"||o==="undefined"?"داواکراوە":`چاوەڕوانکراوە ${i} بێت، بەڵام ${a}${c?"":s}`}case"invalid_value":return u.values.length===1?`بەهاکە نادرووستە: چاوەڕوانکراوە ${stringifyPrimitive(u.values[0])} بێت`:`هەڵبژاردەی نادروست: چاوەڕوانکراوە یەکێک بێت لە ${joinValues(u.values,"|")}`;case"too_big":{const i=t(u.origin);return i?`پێویستە بە لایەنی زۆرەوە ${u.maximum.toString()} ${i.unit} ${i.verb}`:`پێویستە بە لایەنی زۆرەوە ${u.maximum.toString()} بێت`}case"too_small":{const i=t(u.origin);return i?`پێویستە بە لایەنی کەمەوە ${u.minimum.toString()} ${i.unit} ${i.verb}`:`پێویستە بە لایەنی کەمەوە ${u.minimum.toString()} بێت`}case"invalid_format":{const i=u;return i.format==="starts_with"?`دەقی نادروست: پێویستە دەستپێبکات بە "${i.prefix}"`:i.format==="ends_with"?`دەقی نادروست: پێویستە کۆتاییبێت بە "${i.suffix}"`:i.format==="includes"?`دەقی نادروست: پێویستە "${i.includes}" لەخۆبگرێت`:i.format==="regex"?`دەقی نادروست: پێویستە لەگەڵ پاتێرنی ${i.pattern} بگونجێت`:`بەهای ${n[i.format]??u.format} نادروستە`}case"not_multiple_of":return`ژمارەی نادروست: دەبێت چەند هێندە بێت بۆ ${u.divisor}`;case"unrecognized_keys":return`کلیلی نەناسراو: ${joinValues(u.keys,", ")}`;case"invalid_key":return`کلیلی نادروست لە ${u.origin}`;case"invalid_union":return u.options&&Array.isArray(u.options)&&u.options.length>0?`بەهای نەناسراو هەیە. بەهای چاوەڕوانکراو: ${u.options.map(o=>`'${o}'`).join(" | ")}`:"یەکگرتنی نادروست";case"invalid_element":return`${u.origin} بەهاکە نادروستە`;default:return"تێکردەی نادروست"}}};function ckb_default(){return{localeError:error7()}}var error8=()=>{const e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"},map:{unit:"prvků",verb:"mít"}};function t(u){return e[u]??null}const n={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",credit_card:"číslo kreditní karty",currency_code:"kód měny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Neplatný vstup: očekáváno instanceof ${u.expected}, obdrženo ${a}`:`Neplatný vstup: očekáváno ${i}, obdrženo ${a}`}case"invalid_value":return u.values.length===1?`Neplatný vstup: očekáváno ${stringifyPrimitive(u.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Hodnota je příliš velká: ${u.origin??"hodnota"} musí mít ${i}${u.maximum.toString()} ${o.unit??"prvků"}`:`Hodnota je příliš velká: ${u.origin??"hodnota"} musí být ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Hodnota je příliš malá: ${u.origin??"hodnota"} musí mít ${i}${u.minimum.toString()} ${o.unit??"prvků"}`:`Hodnota je příliš malá: ${u.origin??"hodnota"} musí být ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Neplatný řetězec: musí začínat na "${i.prefix}"`:i.format==="ends_with"?`Neplatný řetězec: musí končit na "${i.suffix}"`:i.format==="includes"?`Neplatný řetězec: musí obsahovat "${i.includes}"`:i.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${i.pattern}`:`Neplatný formát ${n[i.format]??u.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${u.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${u.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${u.origin}`;default:return"Neplatný vstup"}}};function cs_default(){return{localeError:error8()}}var error9=()=>{const e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"},map:{unit:"elementer",verb:"indeholdt"}};function t(u){return e[u]??null}const n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kreditkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Ugyldigt input: forventede instanceof ${u.expected}, fik ${a}`:`Ugyldigt input: forventede ${i}, fik ${a}`}case"invalid_value":return u.values.length===1?`Ugyldig værdi: forventede ${stringifyPrimitive(u.values[0])}`:`Ugyldigt valg: forventede en af følgende ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin),a=r[u.origin]??u.origin;return o?`For stor: forventede ${a??"value"} ${o.verb} ${i} ${u.maximum.toString()} ${o.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${i} ${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin),a=r[u.origin]??u.origin;return o?`For lille: forventede ${a} ${o.verb} ${i} ${u.minimum.toString()} ${o.unit}`:`For lille: forventede ${a} havde ${i} ${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche mønsteret ${i.pattern}`:`Ugyldig ${n[i.format]??u.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${u.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${u.origin}`;default:return"Ugyldigt input"}}};function da_default(){return{localeError:error9()}}var error10=()=>{const e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"},map:{unit:"Elemente",verb:"zu haben"}};function t(u){return e[u]??null}const n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",mac:"MAC-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",credit_card:"Kreditkartennummer",currency_code:"Währungscode",iban:"IBAN",jwt:"JWT",template_literal:"Eingabe"},r={nan:"NaN",number:"Zahl",array:"Array"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Ungültige Eingabe: erwartet instanceof ${u.expected}, erhalten ${a}`:`Ungültige Eingabe: erwartet ${i}, erhalten ${a}`}case"invalid_value":return u.values.length===1?`Ungültige Eingabe: erwartet ${stringifyPrimitive(u.values[0])}`:`Ungültige Option: erwartet eine von ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Zu groß: erwartet, dass ${u.origin??"Wert"} ${i}${u.maximum.toString()} ${o.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${u.origin??"Wert"} ${i}${u.maximum.toString()} ist`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Zu klein: erwartet, dass ${u.origin} ${i}${u.minimum.toString()} ${o.unit} hat`:`Zu klein: erwartet, dass ${u.origin} ${i}${u.minimum.toString()} ist`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Ungültiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ungültiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ungültiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ungültiger String: muss dem Muster ${i.pattern} entsprechen`:`Ungültig: ${n[i.format]??u.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${u.divisor} sein`;case"unrecognized_keys":return`${u.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${u.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${u.origin}`;default:return"Ungültige Eingabe"}}};function de_default(){return{localeError:error10()}}var error11=()=>{const e={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function t(u){return e[u]??null}const n={regex:"είσοδος",email:"διεύθυνση email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ημερομηνία και ώρα",date:"ISO ημερομηνία",time:"ISO ώρα",duration:"ISO διάρκεια",ipv4:"διεύθυνση IPv4",ipv6:"διεύθυνση IPv6",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",credit_card:"αριθμός πιστωτικής κάρτας",currency_code:"κωδικός νομίσματος",iban:"IBAN",jwt:"JWT",template_literal:"είσοδος"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return typeof u.expected=="string"&&/^[A-Z]/.test(u.expected)?`Μη έγκυρη είσοδος: αναμενόταν instanceof ${u.expected}, λήφθηκε ${a}`:`Μη έγκυρη είσοδος: αναμενόταν ${i}, λήφθηκε ${a}`}case"invalid_value":return u.values.length===1?`Μη έγκυρη είσοδος: αναμενόταν ${stringifyPrimitive(u.values[0])}`:`Μη έγκυρη επιλογή: αναμενόταν ένα από ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Πολύ μεγάλο: αναμενόταν ${u.origin??"τιμή"} να έχει ${i}${u.maximum.toString()} ${o.unit??"στοιχεία"}`:`Πολύ μεγάλο: αναμενόταν ${u.origin??"τιμή"} να είναι ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Πολύ μικρό: αναμενόταν ${u.origin} να έχει ${i}${u.minimum.toString()} ${o.unit}`:`Πολύ μικρό: αναμενόταν ${u.origin} να είναι ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${i.prefix}"`:i.format==="ends_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${i.suffix}"`:i.format==="includes"?`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${i.includes}"`:i.format==="regex"?`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${i.pattern}`:`Μη έγκυρο: ${n[i.format]??u.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${u.divisor}`;case"unrecognized_keys":return`Άγνωστ${u.keys.length>1?"α":"ο"} κλειδ${u.keys.length>1?"ιά":"ί"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${u.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${u.origin}`;default:return"Μη έγκυρη είσοδος"}}};function el_default(){return{localeError:error11()}}var error12=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(i){return e[i]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function u(i,o){return i==="number"&&typeof o=="number"&&!Number.isFinite(o)?String(o):r[i]??i}return i=>{switch(i.code){case"invalid_type":{const o=u(i.expected),a=parsedType(i.input),s=u(a,i.input);return`Invalid input: expected ${o}, received ${s}`}case"invalid_value":return i.values.length===1?`Invalid input: expected ${stringifyPrimitive(i.values[0])}`:`Invalid option: expected one of ${joinValues(i.values,"|")}`;case"too_big":{const o=i.exact?"exactly ":i.inclusive?"<=":"<",a=t(i.origin);return a?`Too big: expected ${i.origin??"value"} to have ${o}${i.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${o}${i.maximum.toString()}`}case"too_small":{const o=i.exact?"exactly ":i.inclusive?">=":">",a=t(i.origin);return a?`Too small: expected ${i.origin} to have ${o}${i.minimum.toString()} ${a.unit}`:`Too small: expected ${i.origin} to be ${o}${i.minimum.toString()}`}case"invalid_format":{const o=i;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${joinValues(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return i.options&&Array.isArray(i.options)&&i.options.length>0?`Invalid discriminator value. Expected ${i.options.map(a=>`'${a}'`).join(" | ")}`:i.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function en_default(){return{localeError:error12()}}var error13=()=>{const e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"},map:{unit:"elementojn",verb:"havi"}};function t(u){return e[u]??null}const n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",mac:"MAC-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",credit_card:"kreditkarta numero",currency_code:"valuta kodo",iban:"IBAN",jwt:"JWT",template_literal:"enigo"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Nevalida enigo: atendiĝis instanceof ${u.expected}, riceviĝis ${a}`:`Nevalida enigo: atendiĝis ${i}, riceviĝis ${a}`}case"invalid_value":return u.values.length===1?`Nevalida enigo: atendiĝis ${stringifyPrimitive(u.values[0])}`:`Nevalida opcio: atendiĝis unu el ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Tro granda: atendiĝis ke ${u.origin??"valoro"} havu ${i}${u.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${u.origin??"valoro"} havu ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Tro malgranda: atendiĝis ke ${u.origin} havu ${i}${u.minimum.toString()} ${o.unit}`:`Tro malgranda: atendiĝis ke ${u.origin} estu ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${n[i.format]??u.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${u.divisor}`;case"unrecognized_keys":return`Nekonata${u.keys.length>1?"j":""} ŝlosilo${u.keys.length>1?"j":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${u.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${u.origin}`;default:return"Nevalida enigo"}}};function eo_default(){return{localeError:error13()}}var error14=()=>{const e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(u){return e[u]??null}const n={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",mac:"dirección MAC",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",credit_card:"número de tarjeta de crédito",currency_code:"código de moneda",iban:"IBAN",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Entrada inválida: se esperaba instanceof ${u.expected}, recibido ${a}`:`Entrada inválida: se esperaba ${i}, recibido ${a}`}case"invalid_value":return u.values.length===1?`Entrada inválida: se esperaba ${stringifyPrimitive(u.values[0])}`:`Opción inválida: se esperaba una de ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin),a=r[u.origin]??u.origin;return o?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${i}${u.maximum.toString()} ${o.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin),a=r[u.origin]??u.origin;return o?`Demasiado pequeño: se esperaba que ${a} tuviera ${i}${u.minimum.toString()} ${o.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Cadena inválida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inválida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inválida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${i.pattern}`:`Inválido ${n[i.format]??u.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${u.divisor}`;case"unrecognized_keys":return`Llave${u.keys.length>1?"s":""} desconocida${u.keys.length>1?"s":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Llave inválida en ${r[u.origin]??u.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${r[u.origin]??u.origin}`;default:return"Entrada inválida"}}};function es_default(){return{localeError:error14()}}var error15=()=>{const e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"},map:{unit:"آیتم",verb:"داشته باشد"}};function t(u){return e[u]??null}const n={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",mac:"MAC آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",credit_card:"شماره کارت اعتباری",currency_code:"کد ارز",iban:"IBAN",jwt:"JWT",template_literal:"ورودی"},r={nan:"NaN",number:"عدد",array:"آرایه"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`ورودی نامعتبر: می‌بایست instanceof ${u.expected} می‌بود، ${a} دریافت شد`:`ورودی نامعتبر: می‌بایست ${i} می‌بود، ${a} دریافت شد`}case"invalid_value":return u.values.length===1?`ورودی نامعتبر: می‌بایست ${stringifyPrimitive(u.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${joinValues(u.values,"|")} می‌بود`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`خیلی بزرگ: ${u.origin??"مقدار"} باید ${i}${u.maximum.toString()} ${o.unit??"عنصر"} باشد`:`خیلی بزرگ: ${u.origin??"مقدار"} باید ${i}${u.maximum.toString()} باشد`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`خیلی کوچک: ${u.origin} باید ${i}${u.minimum.toString()} ${o.unit} باشد`:`خیلی کوچک: ${u.origin} باید ${i}${u.minimum.toString()} باشد`}case"invalid_format":{const i=u;return i.format==="starts_with"?`رشته نامعتبر: باید با "${i.prefix}" شروع شود`:i.format==="ends_with"?`رشته نامعتبر: باید با "${i.suffix}" تمام شود`:i.format==="includes"?`رشته نامعتبر: باید شامل "${i.includes}" باشد`:i.format==="regex"?`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`:`${n[i.format]??u.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${u.divisor} باشد`;case"unrecognized_keys":return`کلید${u.keys.length>1?"های":""} ناشناس: ${joinValues(u.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${u.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${u.origin}`;default:return"ورودی نامعتبر"}}};function fa_default(){return{localeError:error15()}}var error16=()=>{const e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},map:{unit:"alkiota",subject:"kuvauksen"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(u){return e[u]??null}const n={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",mac:"MAC-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",credit_card:"luottokortin numero",currency_code:"valuuttakoodi",iban:"IBAN",jwt:"JWT",template_literal:"templaattimerkkijono"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Virheellinen tyyppi: odotettiin instanceof ${u.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${a}`}case"invalid_value":return u.values.length===1?`Virheellinen syöte: täytyy olla ${stringifyPrimitive(u.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Liian suuri: ${o.subject} täytyy olla ${i}${u.maximum.toString()} ${o.unit}`.trim():`Liian suuri: arvon täytyy olla ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Liian pieni: ${o.subject} täytyy olla ${i}${u.minimum.toString()} ${o.unit}`.trim():`Liian pieni: arvon täytyy olla ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen syöte: täytyy sisältää "${i.includes}"`:i.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${i.pattern}`:`Virheellinen ${n[i.format]??u.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${u.divisor} monikerta`;case"unrecognized_keys":return`${u.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function fi_default(){return{localeError:error16()}}var error17=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(u){return e[u]??null}const n={regex:"expression régulière",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne de caractères encodée en base64",base64url:"chaîne de caractères encodée en base64url",json_string:"chaîne de caractères JSON",e164:"numéro au format E.164",credit_card:"numéro de carte de crédit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entrée"},r={string:"chaîne de caractères",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"record",map:"map",set:"ensemble",file:"fichier",nonoptional:"non optionnel",nan:"NaN",function:"fonction"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Entrée invalide : instance de ${u.expected} attendu, ${a} reçu`:`Entrée invalide : ${i} attendu, ${a} reçu`}case"invalid_value":return u.values.length===1?`Entrée invalide : ${stringifyPrimitive(u.values[0])} attendu`:`Option invalide : une valeur parmi ${joinValues(u.values,"|")} attendue`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Trop grand : ${r[u.origin]??"valeur"} doit ${o.verb} ${i}${u.maximum.toString()} ${o.unit??"élément(s)"}`:`Trop grand : ${r[u.origin]??"valeur"} doit être ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Trop petit : ${r[u.origin]??"valeur"} doit ${o.verb} ${i}${u.minimum.toString()} ${o.unit}`:`Trop petit : ${r[u.origin]??"valeur"} doit être ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Chaîne de caractères invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Chaîne de caractères invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Chaîne de caractères invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Chaîne de caractères invalide : doit correspondre au motif ${i.pattern}`:`${n[i.format]??u.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${u.divisor}`;case"unrecognized_keys":return`Clé${u.keys.length>1?"s":""} non reconnue${u.keys.length>1?"s":""} : ${joinValues(u.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${u.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${u.origin}`;default:return"Entrée invalide"}}};function fr_default(){return{localeError:error17()}}var error18=()=>{const e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"},map:{unit:"éléments",verb:"avoir"}};function t(u){return e[u]??null}const n={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",mac:"adresse MAC",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",credit_card:"numéro de carte de crédit",currency_code:"code de devise",iban:"IBAN",jwt:"JWT",template_literal:"entrée"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Entrée invalide : attendu instanceof ${u.expected}, reçu ${a}`:`Entrée invalide : attendu ${i}, reçu ${a}`}case"invalid_value":return u.values.length===1?`Entrée invalide : attendu ${stringifyPrimitive(u.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"≤":"<",o=t(u.origin);return o?`Trop grand : attendu que ${u.origin??"la valeur"} ait ${i}${u.maximum.toString()} ${o.unit}`:`Trop grand : attendu que ${u.origin??"la valeur"} soit ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?"≥":">",o=t(u.origin);return o?`Trop petit : attendu que ${u.origin} ait ${i}${u.minimum.toString()} ${o.unit}`:`Trop petit : attendu que ${u.origin} soit ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Chaîne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Chaîne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Chaîne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Chaîne invalide : doit correspondre au motif ${i.pattern}`:`${n[i.format]??u.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${u.divisor}`;case"unrecognized_keys":return`Clé${u.keys.length>1?"s":""} non reconnue${u.keys.length>1?"s":""} : ${joinValues(u.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${u.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${u.origin}`;default:return"Entrée invalide"}}};function fr_CA_default(){return{localeError:error18()}}var error19=()=>{const e={string:{unit:"અક્ષર",verb:"હોવા જોઈએ"},file:{unit:"બાયટ",verb:"હોવા જોઈએ"},array:{unit:"આઇટમ",verb:"હોવા જોઈએ"},set:{unit:"આઇટમ",verb:"હોવા જોઈએ"},map:{unit:"એન્ટ્રી",verb:"હોવા જોઈએ"}};function t(u){return e[u]??null}const n={regex:"ઇનપુટ",email:"ઈમેઇલ એડ્રેસ",url:"URL",emoji:"ઇમોજી",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO તારીખ અને સમય",date:"ISO તારીખ",time:"ISO સમય",duration:"ISO અવધિ",ipv4:"IPv4 એડ્રેસ",ipv6:"IPv6 એડ્રેસ",mac:"MAC એડ્રેસ",cidrv4:"IPv4 શ્રેણી",cidrv6:"IPv6 શ્રેણી",base64:"base64-એન્કોડેડ સ્ટ્રિંગ",base64url:"base64url-એન્કોડેડ સ્ટ્રિંગ",json_string:"JSON સ્ટ્રિંગ",e164:"E.164 નંબર",credit_card:"ક્રેડિટ કાર્ડ નંબર",currency_code:"ચલણ કોડ",iban:"IBAN",jwt:"JWT",template_literal:"ઇનપુટ"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return`અમાન્ય ઇનપુટ: અપેક્ષિત ${i}, પ્રાપ્ત ${a}`}case"invalid_value":return u.values.length===1?`અમાન્ય ઇનપુટ: અપેક્ષિત ${stringifyPrimitive(u.values[0])}`:`અમાન્ય વિકલ્પ: ${joinValues(u.values," | ")} માધ્યમથી એક અપેક્ષિત`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`ખૂબ મોટું: ${u.origin??"મૂલ્ય"} ${i}${u.maximum.toString()} ${o.unit??"એલિમેન્ટ"} હોવા જોઈએ`:`ખૂબ મોટું: ${u.origin??"મૂલ્ય"} ${i}${u.maximum.toString()} હોવું જોઈએ`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`ખૂબ નાનું: ${u.origin} ${i}${u.minimum.toString()} ${o.unit} હોવા જોઈએ`:`ખૂબ નાનું: ${u.origin} ${i}${u.minimum.toString()} હોવું જોઈએ`}case"invalid_format":{const i=u;return i.format==="starts_with"?`અમાન્ય સ્ટ્રિંગ: "${i.prefix}" થી શરૂ થવું જોઈએ`:i.format==="ends_with"?`અમાન્ય સ્ટ્રિંગ: "${i.suffix}" પર સમાપ્ત થવું જોઈએ`:i.format==="includes"?`અમાન્ય સ્ટ્રિંગ: "${i.includes}" શામેલ હોવું જોઈએ`:i.format==="regex"?`અમાન્ય સ્ટ્રિંગ: પેટર્ન ${i.pattern} સાથે મેળ ખાવું જોઈએ`:`અમાન્ય ${n[i.format]??u.format}`}case"not_multiple_of":return`અમાન્ય નંબર: ${u.divisor} નો ગુણાંક હોવો જોઈએ`;case"unrecognized_keys":return`ઓળખી શકાતા નહીં તે કી${u.keys.length>1?"ઓ":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`${u.origin} માં અમાન્ય કી`;case"invalid_union":return u.options&&Array.isArray(u.options)&&u.options.length>0?`અમાન્ય ડિસ્ક્રિમિનેટર મૂલ્ય. અપેક્ષિત ${u.options.map(o=>`'${o}'`).join(" | ")}`:"અમાન્ય ઇનપુટ";case"invalid_element":return`${u.origin} માં અમાન્ય મૂલ્ય`;default:return"અમાન્ય ઇનપુટ"}}};function gu_default(){return{localeError:error19()}}var error20=()=>{const e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},n=c=>c?e[c]:void 0,r=c=>{const l=n(c);return l?l.label:c??e.unknown.label},u=c=>`ה${r(c)}`,i=c=>(n(c)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",o=c=>c?t[c]??null:null,a={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},uuidv4:{label:"UUIDv4",gender:"m"},uuidv6:{label:"UUIDv6",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},mac:{label:"כתובת MAC",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},credit_card:{label:"מספר כרטיס אשראי",gender:"m"},currency_code:{label:"קוד מטבע",gender:"m"},iban:{label:"IBAN",gender:"m"},jwt:{label:"JWT",gender:"m"},template_literal:{label:"קלט",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},s={nan:"NaN"};return c=>{switch(c.code){case"invalid_type":{const l=c.expected,d=s[l??""]??r(l),f=parsedType(c.input),m=s[f]??e[f]?.label??f;return/^[A-Z]/.test(c.expected)?`קלט לא תקין: צריך להיות instanceof ${c.expected}, התקבל ${m}`:`קלט לא תקין: צריך להיות ${d}, התקבל ${m}`}case"invalid_value":{if(c.values.length===1)return`ערך לא תקין: הערך חייב להיות ${stringifyPrimitive(c.values[0])}`;const l=c.values.map(m=>stringifyPrimitive(m));if(c.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${l[0]} או ${l[1]}`;const d=l[l.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${l.slice(0,-1).join(", ")} או ${d}`}case"too_big":{const l=o(c.origin),d=u(c.origin??"value");if(c.origin==="string")return`${l?.longLabel??"ארוך"} מדי: ${d} צריכה להכיל ${c.maximum.toString()} ${l?.unit??""} ${c.inclusive?"או פחות":"לכל היותר"}`.trim();if(c.origin==="number"){const h=c.inclusive?`קטן או שווה ל-${c.maximum}`:`קטן מ-${c.maximum}`;return`גדול מדי: ${d} צריך להיות ${h}`}if(c.origin==="array"||c.origin==="set"){const h=c.origin==="set"?"צריכה":"צריך",g=c.inclusive?`${c.maximum} ${l?.unit??""} או פחות`:`פחות מ-${c.maximum} ${l?.unit??""}`;return`גדול מדי: ${d} ${h} להכיל ${g}`.trim()}const f=c.inclusive?"<=":"<",m=i(c.origin??"value");return l?.unit?`${l.longLabel} מדי: ${d} ${m} ${f}${c.maximum.toString()} ${l.unit}`:`${l?.longLabel??"גדול"} מדי: ${d} ${m} ${f}${c.maximum.toString()}`}case"too_small":{const l=o(c.origin),d=u(c.origin??"value");if(c.origin==="string")return`${l?.shortLabel??"קצר"} מדי: ${d} צריכה להכיל ${c.minimum.toString()} ${l?.unit??""} ${c.inclusive?"או יותר":"לפחות"}`.trim();if(c.origin==="number"){const h=c.inclusive?`גדול או שווה ל-${c.minimum}`:`גדול מ-${c.minimum}`;return`קטן מדי: ${d} צריך להיות ${h}`}if(c.origin==="array"||c.origin==="set"){const h=c.origin==="set"?"צריכה":"צריך";if(c.minimum===1&&c.inclusive){const E=(c.origin==="set","לפחות פריט אחד");return`קטן מדי: ${d} ${h} להכיל ${E}`}const g=c.inclusive?`${c.minimum} ${l?.unit??""} או יותר`:`יותר מ-${c.minimum} ${l?.unit??""}`;return`קטן מדי: ${d} ${h} להכיל ${g}`.trim()}const f=c.inclusive?">=":">",m=i(c.origin??"value");return l?.unit?`${l.shortLabel} מדי: ${d} ${m} ${f}${c.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"קטן"} מדי: ${d} ${m} ${f}${c.minimum.toString()}`}case"invalid_format":{const l=c;if(l.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${l.prefix}"`;if(l.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${l.suffix}"`;if(l.format==="includes")return`המחרוזת חייבת לכלול "${l.includes}"`;if(l.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${l.pattern}`;const d=a[l.format],f=d?.label??l.format,h=(d?.gender??"m")==="f"?"תקינה":"תקין";return`${f} לא ${h}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${c.divisor}`;case"unrecognized_keys":return`מפתח${c.keys.length>1?"ות":""} לא מזוה${c.keys.length>1?"ים":"ה"}: ${joinValues(c.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${u(c.origin??"array")}`;default:return"קלט לא תקין"}}};function he_default(){return{localeError:error20()}}var error21=()=>{const e={string:{unit:"अक्षर",verb:"रखने के लिए"},file:{unit:"बाइट्स",verb:"रखने के लिए"},array:{unit:"तत्व",verb:"रखने के लिए"},set:{unit:"तत्व",verb:"रखने के लिए"},map:{unit:"प्रविष्टियाँ",verb:"रखने के लिए"}};function t(u){return e[u]??null}const n={regex:"इनपुट",email:"ईमेल पता",url:"URL",emoji:"इमोजी",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO तिथि और समय",date:"ISO तिथि",time:"ISO समय",duration:"ISO अवधि",ipv4:"IPv4 पता",ipv6:"IPv6 पता",mac:"MAC पता",cidrv4:"IPv4 श्रेणी",cidrv6:"IPv6 श्रेणी",base64:"Base64-एन्कोडेड स्ट्रिंग",base64url:"Base64URL-एन्कोडेड स्ट्रिंग",json_string:"JSON स्ट्रिंग",e164:"E.164 संख्या",credit_card:"क्रेडिट कार्ड संख्या",currency_code:"मुद्रा कोड",iban:"IBAN",jwt:"JWT",template_literal:"इनपुट"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return`अमान्य इनपुट: अपेक्षित ${i}, प्राप्त ${a}`}case"invalid_value":return u.values.length===1?`अमान्य इनपुट: अपेक्षित ${stringifyPrimitive(u.values[0])}`:`अमान्य विकल्प: अपेक्षित मानों में से एक ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`बहुत बड़ा: अपेक्षित था कि ${u.origin??"मान"} में ${i}${u.maximum} ${o.unit} हों`:`बहुत बड़ा: अपेक्षित था कि ${u.origin??"मान"} ${i}${u.maximum} हो`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`बहुत छोटा: अपेक्षित था कि ${u.origin} में ${i}${u.minimum} ${o.unit} हों`:`बहुत छोटा: अपेक्षित था कि ${u.origin} ${i}${u.minimum} हो`}case"invalid_format":{const i=u;return i.format==="starts_with"?`अमान्य स्ट्रिंग: "${i.prefix}" से शुरू होना चाहिए`:i.format==="ends_with"?`अमान्य स्ट्रिंग: "${i.suffix}" पर समाप्त होना चाहिए`:i.format==="includes"?`अमान्य स्ट्रिंग: इसमें "${i.includes}" शामिल होना चाहिए`:i.format==="regex"?`अमान्य स्ट्रिंग: पैटर्न ${i.pattern} से मेल खाना चाहिए`:`अमान्य ${n[i.format]??u.format}`}case"not_multiple_of":return`अमान्य संख्या: यह ${u.divisor} का गुणज होना चाहिए`;case"unrecognized_keys":return`अपरिचित कुंजी${u.keys.length>1?"याँ":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`अमान्य कुंजी: ${u.origin} में`;case"invalid_union":return u.options&&Array.isArray(u.options)&&u.options.length>0?`अमान्य डिस्क्रिमिनेटर मान: अपेक्षित ${u.options.map(o=>`'${o}'`).join(" | ")}`:"अमान्य इनपुट";case"invalid_element":return`अमान्य मान: ${u.origin} में`;default:return"अमान्य इनपुट"}}};function hi_default(){return{localeError:error21()}}var error22=()=>{const e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(u){return e[u]??null}const n={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",credit_card:"broj kreditne kartice",currency_code:"kod valute",iban:"IBAN",jwt:"JWT",template_literal:"unos"},r={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Neispravan unos: očekuje se instanceof ${u.expected}, a primljeno je ${a}`:`Neispravan unos: očekuje se ${i}, a primljeno je ${a}`}case"invalid_value":return u.values.length===1?`Neispravna vrijednost: očekivano ${stringifyPrimitive(u.values[0])}`:`Neispravna opcija: očekivano jedno od ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin),a=r[u.origin]??u.origin;return o?`Preveliko: očekivano da ${a??"vrijednost"} ima ${i}${u.maximum.toString()} ${o.unit??"elemenata"}`:`Preveliko: očekivano da ${a??"vrijednost"} bude ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin),a=r[u.origin]??u.origin;return o?`Premalo: očekivano da ${a} ima ${i}${u.minimum.toString()} ${o.unit}`:`Premalo: očekivano da ${a} bude ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Neispravan tekst: mora započinjati s "${i.prefix}"`:i.format==="ends_with"?`Neispravan tekst: mora završavati s "${i.suffix}"`:i.format==="includes"?`Neispravan tekst: mora sadržavati "${i.includes}"`:i.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`:`Neispravna ${n[i.format]??u.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${u.divisor}`;case"unrecognized_keys":return`Neprepoznat${u.keys.length>1?"i ključevi":" ključ"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${r[u.origin]??u.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${r[u.origin]??u.origin}`;default:return"Neispravan unos"}}};function hr_default(){return{localeError:error22()}}var error23=()=>{const e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"},map:{unit:"elem",verb:"legyen"}};function t(u){return e[u]??null}const n={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",mac:"MAC cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",credit_card:"hitelkártyaszám",currency_code:"pénznemkód",iban:"IBAN",jwt:"JWT",template_literal:"bemenet"},r={nan:"NaN",number:"szám",array:"tömb"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Érvénytelen bemenet: a várt érték instanceof ${u.expected}, a kapott érték ${a}`:`Érvénytelen bemenet: a várt érték ${i}, a kapott érték ${a}`}case"invalid_value":return u.values.length===1?`Érvénytelen bemenet: a várt érték ${stringifyPrimitive(u.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Túl nagy: ${u.origin??"érték"} mérete túl nagy ${i}${u.maximum.toString()} ${o.unit??"elem"}`:`Túl nagy: a bemeneti érték ${u.origin??"érték"} túl nagy: ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Túl kicsi: a bemeneti érték ${u.origin} mérete túl kicsi ${i}${u.minimum.toString()} ${o.unit}`:`Túl kicsi: a bemeneti érték ${u.origin} túl kicsi ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Érvénytelen string: "${i.prefix}" értékkel kell kezdődnie`:i.format==="ends_with"?`Érvénytelen string: "${i.suffix}" értékkel kell végződnie`:i.format==="includes"?`Érvénytelen string: "${i.includes}" értéket kell tartalmaznia`:i.format==="regex"?`Érvénytelen string: ${i.pattern} mintának kell megfelelnie`:`Érvénytelen ${n[i.format]??u.format}`}case"not_multiple_of":return`Érvénytelen szám: ${u.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${u.keys.length>1?"s":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${u.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${u.origin}`;default:return"Érvénytelen bemenet"}}};function hu_default(){return{localeError:error23()}}function getArmenianPlural(e,t,n){return Math.abs(e)===1?t:n}function withDefiniteArticle(e){if(!e)return"";const t=["ա","ե","ը","ի","ո","ու","օ"],n=e[e.length-1];return e+(t.includes(n)?"ն":"ը")}var error24=()=>{const e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},map:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(u){return e[u]??null}const n={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",mac:"MAC հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",credit_card:"կրեդիտ քարտի համար",currency_code:"արժույթի կոդ",iban:"IBAN",jwt:"JWT",template_literal:"մուտք"},r={nan:"NaN",number:"թիվ",array:"զանգված"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${u.expected}, ստացվել է ${a}`:`Սխալ մուտքագրում․ սպասվում էր ${i}, ստացվել է ${a}`}case"invalid_value":return u.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${stringifyPrimitive(u.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);if(o){const a=Number(u.maximum),s=getArmenianPlural(a,o.unit.one,o.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${withDefiniteArticle(u.origin??"արժեք")} կունենա ${i}${u.maximum.toString()} ${s}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${withDefiniteArticle(u.origin??"արժեք")} լինի ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);if(o){const a=Number(u.minimum),s=getArmenianPlural(a,o.unit.one,o.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${withDefiniteArticle(u.origin)} կունենա ${i}${u.minimum.toString()} ${s}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${withDefiniteArticle(u.origin)} լինի ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${i.prefix}"-ով`:i.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${i.suffix}"-ով`:i.format==="includes"?`Սխալ տող․ պետք է պարունակի "${i.includes}"`:i.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${i.pattern} ձևաչափին`:`Սխալ ${n[i.format]??u.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${u.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${u.keys.length>1?"ներ":""}. ${joinValues(u.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${withDefiniteArticle(u.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${withDefiniteArticle(u.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function hy_default(){return{localeError:error24()}}var error25=()=>{const e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"},map:{unit:"item",verb:"memiliki"}};function t(u){return e[u]??null}const n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",credit_card:"nomor kartu kredit",currency_code:"kode mata uang",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Input tidak valid: diharapkan instanceof ${u.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${i}, diterima ${a}`}case"invalid_value":return u.values.length===1?`Input tidak valid: diharapkan ${stringifyPrimitive(u.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Terlalu besar: diharapkan ${u.origin??"value"} memiliki ${i}${u.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: diharapkan ${u.origin??"value"} menjadi ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Terlalu kecil: diharapkan ${u.origin} memiliki ${i}${u.minimum.toString()} ${o.unit}`:`Terlalu kecil: diharapkan ${u.origin} menjadi ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${n[i.format]??u.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${u.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${u.keys.length>1?"s":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${u.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${u.origin}`;default:return"Input tidak valid"}}};function id_default(){return{localeError:error25()}}var error26=()=>{const e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"},map:{unit:"hluti",verb:"að hafa"}};function t(u){return e[u]??null}const n={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",credit_card:"kreditkortanúmer",currency_code:"gjaldmiðilskóði",iban:"IBAN",jwt:"JWT",template_literal:"gildi"},r={nan:"NaN",number:"númer",array:"fylki"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Rangt gildi: Þú slóst inn ${a} þar sem á að vera instanceof ${u.expected}`:`Rangt gildi: Þú slóst inn ${a} þar sem á að vera ${i}`}case"invalid_value":return u.values.length===1?`Rangt gildi: gert ráð fyrir ${stringifyPrimitive(u.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Of stórt: gert er ráð fyrir að ${u.origin??"gildi"} hafi ${i}${u.maximum.toString()} ${o.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${u.origin??"gildi"} sé ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Of lítið: gert er ráð fyrir að ${u.origin} hafi ${i}${u.minimum.toString()} ${o.unit}`:`Of lítið: gert er ráð fyrir að ${u.origin} sé ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Ógildur strengur: verður að byrja á "${i.prefix}"`:i.format==="ends_with"?`Ógildur strengur: verður að enda á "${i.suffix}"`:i.format==="includes"?`Ógildur strengur: verður að innihalda "${i.includes}"`:i.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${i.pattern}`:`Rangt ${n[i.format]??u.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${u.divisor}`;case"unrecognized_keys":return`Óþekkt ${u.keys.length>1?"ir lyklar":"ur lykill"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${u.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${u.origin}`;default:return"Rangt gildi"}}};function is_default(){return{localeError:error26()}}var error27=()=>{const e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"},map:{unit:"elementi",verb:"avere"}};function t(u){return e[u]??null}const n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",mac:"indirizzo MAC",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",credit_card:"numero di carta di credito",currency_code:"codice valuta",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"numero",array:"vettore"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Input non valido: atteso instanceof ${u.expected}, ricevuto ${a}`:`Input non valido: atteso ${i}, ricevuto ${a}`}case"invalid_value":return u.values.length===1?`Input non valido: atteso ${stringifyPrimitive(u.values[0])}`:`Opzione non valida: atteso uno tra ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Troppo grande: ${u.origin??"valore"} deve avere ${i}${u.maximum.toString()} ${o.unit??"elementi"}`:`Troppo grande: ${u.origin??"valore"} deve essere ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Troppo piccolo: ${u.origin} deve avere ${i}${u.minimum.toString()} ${o.unit}`:`Troppo piccolo: ${u.origin} deve essere ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Input non valido: ${n[i.format]??u.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${u.divisor}`;case"unrecognized_keys":return`Chiav${u.keys.length>1?"i":"e"} non riconosciut${u.keys.length>1?"e":"a"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${u.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${u.origin}`;default:return"Input non valido"}}};function it_default(){return{localeError:error27()}}var error28=()=>{const e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"},map:{unit:"要素",verb:"である"}};function t(u){return e[u]??null}const n={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",mac:"MACアドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",credit_card:"クレジットカード番号",currency_code:"通貨コード",iban:"IBAN",jwt:"JWT",template_literal:"入力値"},r={nan:"NaN",number:"数値",array:"配列"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`無効な入力: instanceof ${u.expected}が期待されましたが、${a}が入力されました`:`無効な入力: ${i}が期待されましたが、${a}が入力されました`}case"invalid_value":return u.values.length===1?`無効な入力: ${stringifyPrimitive(u.values[0])}が期待されました`:`無効な選択: ${joinValues(u.values,"、")}のいずれかである必要があります`;case"too_big":{const i=u.inclusive?"以下である":"より小さい",o=t(u.origin);return o?`大きすぎる値: ${u.origin??"値"}は${u.maximum.toString()}${o.unit??"要素"}${i}必要があります`:`大きすぎる値: ${u.origin??"値"}は${u.maximum.toString()}${i}必要があります`}case"too_small":{const i=u.inclusive?"以上である":"より大きい",o=t(u.origin);return o?`小さすぎる値: ${u.origin}は${u.minimum.toString()}${o.unit}${i}必要があります`:`小さすぎる値: ${u.origin}は${u.minimum.toString()}${i}必要があります`}case"invalid_format":{const i=u;return i.format==="starts_with"?`無効な文字列: "${i.prefix}"で始まる必要があります`:i.format==="ends_with"?`無効な文字列: "${i.suffix}"で終わる必要があります`:i.format==="includes"?`無効な文字列: "${i.includes}"を含む必要があります`:i.format==="regex"?`無効な文字列: パターン${i.pattern}に一致する必要があります`:`無効な${n[i.format]??u.format}`}case"not_multiple_of":return`無効な数値: ${u.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${u.keys.length>1?"群":""}: ${joinValues(u.keys,"、")}`;case"invalid_key":return`${u.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${u.origin}内の無効な値`;default:return"無効な入力"}}};function ja_default(){return{localeError:error28()}}var error29=()=>{const e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},map:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(u){return e[u]??null}const n={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",mac:"MAC მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული ველი",base64url:"base64url-კოდირებული ველი",json_string:"JSON ველი",e164:"E.164 ნომერი",credit_card:"საკრედიტო ბარათის ნომერი",currency_code:"ვალუტის კოდი",iban:"IBAN",jwt:"JWT",template_literal:"შეყვანა"},r={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${u.expected}, მიღებული ${a}`:`არასწორი შეყვანა: მოსალოდნელი ${i}, მიღებული ${a}`}case"invalid_value":return u.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${stringifyPrimitive(u.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${joinValues(u.values,"|")}-დან`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`ზედმეტად დიდი: მოსალოდნელი ${u.origin??"მნიშვნელობა"} ${o.verb} ${i}${u.maximum.toString()} ${o.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${u.origin??"მნიშვნელობა"} იყოს ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`ზედმეტად პატარა: მოსალოდნელი ${u.origin} ${o.verb} ${i}${u.minimum.toString()} ${o.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${u.origin} იყოს ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`არასწორი ველი: უნდა იწყებოდეს "${i.prefix}"-ით`:i.format==="ends_with"?`არასწორი ველი: უნდა მთავრდებოდეს "${i.suffix}"-ით`:i.format==="includes"?`არასწორი ველი: უნდა შეიცავდეს "${i.includes}"-ს`:i.format==="regex"?`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${i.pattern}`:`არასწორი ${n[i.format]??u.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${u.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${u.keys.length>1?"ები":"ი"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${u.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${u.origin}-ში`;default:return"არასწორი შეყვანა"}}};function ka_default(){return{localeError:error29()}}var error30=()=>{const e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"},map:{unit:"ធាតុ",verb:"គួរមាន"}};function t(u){return e[u]??null}const n={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",mac:"អាសយដ្ឋាន MAC",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",credit_card:"លេខប័ណ្ណឥណទាន",currency_code:"កូដរូបិយប័ណ្ណ",iban:"IBAN",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},r={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${u.expected} ប៉ុន្តែទទួលបាន ${a}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${i} ប៉ុន្តែទទួលបាន ${a}`}case"invalid_value":return u.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${stringifyPrimitive(u.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`ធំពេក៖ ត្រូវការ ${u.origin??"តម្លៃ"} ${i} ${u.maximum.toString()} ${o.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${u.origin??"តម្លៃ"} ${i} ${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`តូចពេក៖ ត្រូវការ ${u.origin} ${i} ${u.minimum.toString()} ${o.unit}`:`តូចពេក៖ ត្រូវការ ${u.origin} ${i} ${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`:i.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`:i.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`:i.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`:`មិនត្រឹមត្រូវ៖ ${n[i.format]??u.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${u.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${joinValues(u.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${u.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${u.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function km_default(){return{localeError:error30()}}function kh_default(){return km_default()}var error31=()=>{const e={string:{unit:"ಅಕ್ಷರಗಳು",verb:"ಹೊಂದಲು"},file:{unit:"ಬೈಟ್‌ಗಳು",verb:"ಹೊಂದಲು"},array:{unit:"ವಸ್ತುಗಳು",verb:"ಹೊಂದಲು"},set:{unit:"ವಸ್ತುಗಳು",verb:"ಹೊಂದಲು"},map:{unit:"entries",verb:"ಹೊಂದಲು"}};function t(u){return e[u]??null}const n={regex:"ಇನ್ಪುಟ್",email:"email ವಿಳಾಸ",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ದಿನಾಂಕದ ಸಮಯ",date:"ISO ದಿನಾಂಕ",time:"ISO ಸಮಯ",duration:"ISO ಅವಧಿ",ipv4:"IPv4 ವಿಳಾಸ",ipv6:"IPv6 ವಿಳಾಸ",mac:"MAC ವಿಳಾಸ",cidrv4:"IPv4 ವ್ಯಾಪ್ತಿಯ",cidrv6:"IPv6 ವ್ಯಾಪ್ತಿಯ",base64:"base64-encodedಸ್ಟ್ರಿಂಗ್",base64url:"base64url-encodedಸ್ಟ್ರಿಂಗ್",json_string:"JSONಸ್ಟ್ರಿಂಗ್",e164:"E.164 ಸಂಖ್ಯೆ",credit_card:"ಕ್ರೆಡಿಟ್ ಕಾರ್ಡ್ ಸಂಖ್ಯೆ",currency_code:"ಕರೆನ್ಸಿ ಕೋಡ್",iban:"IBAN",jwt:"JWT",template_literal:"ಇನ್ಪುಟ್"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return`ಅಮಾನ್ಯ ಇನ್‌ಪುಟ್: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${i}, ಸ್ವೀಕರಿಸಿದನು ${a}`}case"invalid_value":return u.values.length===1?`ಅಮಾನ್ಯ ಇನ್‌ಪುಟ್: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${stringifyPrimitive(u.values[0])}`:`ಅಮಾನ್ಯ ಆಯ್ಕೆ: ಇವುಗಳಲ್ಲಿ ಒಂದನ್ನು ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`ತುಂಬಾ ದೊಡ್ಡದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${u.origin??"value"} ಹೊಂದಲು ${i}${u.maximum.toString()} ${o.unit??"ಅಂಶಗಳು"}`:`ತುಂಬಾ ದೊಡ್ಡದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${u.origin??"value"} ಎಂದು ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`ತುಂಬಾ ಚಿಕ್ಕದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${u.origin} ಹೊಂದಲು ${i}${u.minimum.toString()} ${o.unit}`:`ತುಂಬಾ ಚಿಕ್ಕದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${u.origin} ಎಂದು ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಇದರೊಂದಿಗೆ ಪ್ರಾರಂಭಿಸಬೇಕು "${i.prefix}"`:i.format==="ends_with"?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಇದರೊಂದಿಗೆ ಕೊನೆಗೊಳ್ಳಬೇಕು "${i.suffix}"`:i.format==="includes"?`ಅಮಾನ್ಯ ಸ್ಟ್ರಿಂಗ್: ಒಳಗೊಂಡಿರಬೇಕು "${i.includes}"`:i.format==="regex"?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಮಾದರಿಗೆ ಹೊಂದಿಕೆಯಾಗಬೇಕು ${i.pattern}`:`ಅಮಾನ್ಯ ${n[i.format]??u.format}`}case"not_multiple_of":return`ಅಮಾನ್ಯ ಸಂಖ್ಯೆ: ಬಹುಸಂಖ್ಯೆಯಾಗಿರಬೇಕು ${u.divisor}`;case"unrecognized_keys":return`ಗುರುತಿಸಲಾಗದ ಕೀ ${u.keys.length>1?"s":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`ಅಮಾನ್ಯವಾದ ಕೀ ಇನ್ ${u.origin}`;case"invalid_union":return u.options&&Array.isArray(u.options)&&u.options.length>0?`ಅಮಾನ್ಯ ತಾರತಮ್ಯ ಮೌಲ್ಯ. ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${u.options.map(o=>`'${o}'`).join(" | ")}`:"ಅಮಾನ್ಯ ಇನ್‌ಪುಟ್";case"invalid_element":return`ರಲ್ಲಿ ಅಮಾನ್ಯ ಮೌಲ್ಯ ${u.origin}`;default:return"ಅಮಾನ್ಯ ಇನ್‌ಪುಟ್"}}};function kn_default(){return{localeError:error31()}}var error32=()=>{const e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"},map:{unit:"개",verb:"to have"}};function t(u){return e[u]??null}const n={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",mac:"MAC 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",credit_card:"신용카드 번호",currency_code:"통화 코드",iban:"IBAN",jwt:"JWT",template_literal:"입력"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`잘못된 입력: 예상 타입은 instanceof ${u.expected}, 받은 타입은 ${a}입니다`:`잘못된 입력: 예상 타입은 ${i}, 받은 타입은 ${a}입니다`}case"invalid_value":return u.values.length===1?`잘못된 입력: 값은 ${stringifyPrimitive(u.values[0])} 이어야 합니다`:`잘못된 옵션: ${joinValues(u.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const i=u.inclusive?"이하":"미만",o=i==="미만"?"이어야 합니다":"여야 합니다",a=t(u.origin),s=a?.unit??"요소";return a?`${u.origin??"값"}이 너무 큽니다: ${u.maximum.toString()}${s} ${i}${o}`:`${u.origin??"값"}이 너무 큽니다: ${u.maximum.toString()} ${i}${o}`}case"too_small":{const i=u.inclusive?"이상":"초과",o=i==="이상"?"이어야 합니다":"여야 합니다",a=t(u.origin),s=a?.unit??"요소";return a?`${u.origin??"값"}이 너무 작습니다: ${u.minimum.toString()}${s} ${i}${o}`:`${u.origin??"값"}이 너무 작습니다: ${u.minimum.toString()} ${i}${o}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`:i.format==="ends_with"?`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`:i.format==="includes"?`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`:i.format==="regex"?`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`:`잘못된 ${n[i.format]??u.format}`}case"not_multiple_of":return`잘못된 숫자: ${u.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${joinValues(u.keys,", ")}`;case"invalid_key":return`잘못된 키: ${u.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${u.origin}`;default:return"잘못된 입력"}}};function ko_default(){return{localeError:error32()}}var capitalizeFirstCharacter=e=>e.charAt(0).toUpperCase()+e.slice(1);function getUnitTypeFromNumber(e){const t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?"many":n===1?"one":"few"}var error33=()=>{const e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(u,i,o,a){const s=e[u]??null;return s===null?s:{unit:s.unit[i],verb:s.verb[a][o?"inclusive":"notInclusive"]}}const n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",mac:"MAC adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",credit_card:"kredito kortelės numeris",currency_code:"valiutos kodas",iban:"IBAN",jwt:"JWT",template_literal:"įvestis"},r={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Gautas tipas ${a}, o tikėtasi - instanceof ${u.expected}`:`Gautas tipas ${a}, o tikėtasi - ${i}`}case"invalid_value":return u.values.length===1?`Privalo būti ${stringifyPrimitive(u.values[0])}`:`Privalo būti vienas iš ${joinValues(u.values,"|")} pasirinkimų`;case"too_big":{const i=r[u.origin]??u.origin,o=t(u.origin,getUnitTypeFromNumber(Number(u.maximum)),u.inclusive??!1,"smaller");if(o?.verb)return`${capitalizeFirstCharacter(i??u.origin??"reikšmė")} ${o.verb} ${u.maximum.toString()} ${o.unit??"elementų"}`;const a=u.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${capitalizeFirstCharacter(i??u.origin??"reikšmė")} turi būti ${a} ${u.maximum.toString()} ${o?.unit}`}case"too_small":{const i=r[u.origin]??u.origin,o=t(u.origin,getUnitTypeFromNumber(Number(u.minimum)),u.inclusive??!1,"bigger");if(o?.verb)return`${capitalizeFirstCharacter(i??u.origin??"reikšmė")} ${o.verb} ${u.minimum.toString()} ${o.unit??"elementų"}`;const a=u.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${capitalizeFirstCharacter(i??u.origin??"reikšmė")} turi būti ${a} ${u.minimum.toString()} ${o?.unit}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Eilutė privalo prasidėti "${i.prefix}"`:i.format==="ends_with"?`Eilutė privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilutė privalo įtraukti "${i.includes}"`:i.format==="regex"?`Eilutė privalo atitikti ${i.pattern}`:`Neteisingas ${n[i.format]??u.format}`}case"not_multiple_of":return`Skaičius privalo būti ${u.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${u.keys.length>1?"i":"as"} rakt${u.keys.length>1?"ai":"as"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const i=r[u.origin]??u.origin;return`${capitalizeFirstCharacter(i??u.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function lt_default(){return{localeError:error33()}}var error34=()=>{const e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"},map:{unit:"ставки",verb:"да имаат"}};function t(u){return e[u]??null}const n={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",mac:"MAC адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",credit_card:"број на кредитна картичка",currency_code:"код на валута",iban:"IBAN",jwt:"JWT",template_literal:"внес"},r={nan:"NaN",number:"број",array:"низа"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Грешен внес: се очекува instanceof ${u.expected}, примено ${a}`:`Грешен внес: се очекува ${i}, примено ${a}`}case"invalid_value":return u.values.length===1?`Invalid input: expected ${stringifyPrimitive(u.values[0])}`:`Грешана опција: се очекува една ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Премногу голем: се очекува ${u.origin??"вредноста"} да има ${i}${u.maximum.toString()} ${o.unit??"елементи"}`:`Премногу голем: се очекува ${u.origin??"вредноста"} да биде ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Премногу мал: се очекува ${u.origin} да има ${i}${u.minimum.toString()} ${o.unit}`:`Премногу мал: се очекува ${u.origin} да биде ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Неважечка низа: мора да започнува со "${i.prefix}"`:i.format==="ends_with"?`Неважечка низа: мора да завршува со "${i.suffix}"`:i.format==="includes"?`Неважечка низа: мора да вклучува "${i.includes}"`:i.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${i.pattern}`:`Invalid ${n[i.format]??u.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${u.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${u.origin}`;default:return"Грешен внес"}}};function mk_default(){return{localeError:error34()}}var error35=()=>{const e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"},map:{unit:"elemen",verb:"mempunyai"}};function t(u){return e[u]??null}const n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",mac:"alamat MAC",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",credit_card:"nombor kad kredit",currency_code:"kod mata wang",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"nombor"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Input tidak sah: dijangka instanceof ${u.expected}, diterima ${a}`:`Input tidak sah: dijangka ${i}, diterima ${a}`}case"invalid_value":return u.values.length===1?`Input tidak sah: dijangka ${stringifyPrimitive(u.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Terlalu besar: dijangka ${u.origin??"nilai"} ${o.verb} ${i}${u.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: dijangka ${u.origin??"nilai"} adalah ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Terlalu kecil: dijangka ${u.origin} ${o.verb} ${i}${u.minimum.toString()} ${o.unit}`:`Terlalu kecil: dijangka ${u.origin} adalah ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${n[i.format]??u.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${u.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${u.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${u.origin}`;default:return"Input tidak sah"}}};function ms_default(){return{localeError:error35()}}var error36=()=>{const e={string:{unit:"अक्षर",verb:"हुनुपर्छ"},file:{unit:"बाइट",verb:"हुनुपर्छ"},array:{unit:"तत्व",verb:"हुनुपर्छ"},set:{unit:"तत्व",verb:"हुनुपर्छ"},map:{unit:"प्रविष्टि",verb:"हुनुपर्छ"}};function t(u){return e[u]??null}const n={regex:"इनपुट",email:"इमेल ठेगाना",url:"URL",emoji:"इमोजी",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO मिति र समय",date:"ISO मिति",time:"ISO समय",duration:"ISO अवधि",ipv4:"IPv4 ठेगाना",ipv6:"IPv6 ठेगाना",mac:"MAC ठेगाना",cidrv4:"IPv4 दायरा",cidrv6:"IPv6 दायरा",base64:"base64-इन्कोड गरिएको स्ट्रिङ",base64url:"base64url-इन्कोड गरिएको स्ट्रिङ",json_string:"JSON स्ट्रिङ",e164:"E.164 नम्बर",credit_card:"क्रेडिट कार्ड नम्बर",currency_code:"मुद्रा कोड",iban:"IBAN",jwt:"JWT",template_literal:"इनपुट"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return`अमान्य इनपुट: अपेक्षित ${i}, प्राप्त ${a}`}case"invalid_value":return u.values.length===1?`अमान्य इनपुट: अपेक्षित ${stringifyPrimitive(u.values[0])}`:`अमान्य विकल्प: अपेक्षित मानहरू मध्ये एक ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`धेरै ठूलो: ${u.origin??"मान"} मा ${i}${u.maximum.toString()} ${o.unit} ${o.verb}`:`धेरै ठूलो: ${u.origin??"मान"} ${i}${u.maximum.toString()} हुनुपर्छ`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`धेरै सानो: ${u.origin} मा ${i}${u.minimum.toString()} ${o.unit} ${o.verb}`:`धेरै सानो: ${u.origin} ${i}${u.minimum.toString()} हुनुपर्छ`}case"invalid_format":{const i=u;return i.format==="starts_with"?`अमान्य स्ट्रिङ: "${i.prefix}" बाट सुरु हुनुपर्छ`:i.format==="ends_with"?`अमान्य स्ट्रिङ: "${i.suffix}" मा समाप्त हुनुपर्छ`:i.format==="includes"?`अमान्य स्ट्रिङ: "${i.includes}" समावेश हुनुपर्छ`:i.format==="regex"?`अमान्य स्ट्रिङ: ढाँचा ${i.pattern} सँग मेल खानुपर्छ`:`अमान्य ${n[i.format]??u.format}`}case"not_multiple_of":return`अमान्य संख्या: ${u.divisor} को गुणज हुनुपर्छ`;case"unrecognized_keys":return`अपरिचित कुञ्जी${u.keys.length>1?"हरू":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`अमान्य कुञ्जी: ${u.origin} मा`;case"invalid_union":return u.options&&Array.isArray(u.options)&&u.options.length>0?`अमान्य डिस्क्रिमिनेटर मान: अपेक्षित ${u.options.map(o=>`'${o}'`).join(" | ")}`:"अमान्य इनपुट";case"invalid_element":return`अमान्य मान: ${u.origin} मा`;default:return"अमान्य इनपुट"}}};function ne_default(){return{localeError:error36()}}var error37=()=>{const e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"},map:{unit:"elementen",verb:"heeft"}};function t(u){return e[u]??null}const n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",mac:"MAC-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",credit_card:"creditcardnummer",currency_code:"valutacode",iban:"IBAN",jwt:"JWT",template_literal:"invoer"},r={nan:"NaN",number:"getal"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Ongeldige invoer: verwacht instanceof ${u.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${i}, ontving ${a}`}case"invalid_value":return u.values.length===1?`Ongeldige invoer: verwacht ${stringifyPrimitive(u.values[0])}`:`Ongeldige optie: verwacht één van ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin),a=u.origin==="date"?"laat":u.origin==="string"?"lang":"groot";return o?`Te ${a}: verwacht dat ${u.origin??"waarde"} ${i}${u.maximum.toString()} ${o.unit??"elementen"} ${o.verb}`:`Te ${a}: verwacht dat ${u.origin??"waarde"} ${i}${u.maximum.toString()} is`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin),a=u.origin==="date"?"vroeg":u.origin==="string"?"kort":"klein";return o?`Te ${a}: verwacht dat ${u.origin} ${i}${u.minimum.toString()} ${o.unit} ${o.verb}`:`Te ${a}: verwacht dat ${u.origin} ${i}${u.minimum.toString()} is`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${n[i.format]??u.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${u.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${u.keys.length>1?"s":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${u.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${u.origin}`;default:return"Ongeldige invoer"}}};function nl_default(){return{localeError:error37()}}var error38=()=>{const e={string:{unit:"teikn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"element",verb:"å innehalde"},set:{unit:"element",verb:"å innehalde"},map:{unit:"element",verb:"å innehalde"}};function t(u){return e[u]??null}const n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varigheit",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkoda streng",base64url:"base64url-enkoda streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tal",array:"liste"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Ugyldig input: forventa instanceof ${u.expected}, fekk ${a}`:`Ugyldig input: forventa ${i}, fekk ${a}`}case"invalid_value":return u.values.length===1?`Ugyldig verdi: forventa ${stringifyPrimitive(u.values[0])}`:`Ugyldig val: forventa eitt av ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`For stor(t): forventa ${u.origin??"value"} til å ha ${i}${u.maximum.toString()} ${o.unit??"element"}`:`For stor(t): forventa ${u.origin??"value"} til å ha ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`For lite(n): forventa ${u.origin} til å ha ${i}${u.minimum.toString()} ${o.unit}`:`For lite(n): forventa ${u.origin} til å ha ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Ugyldig streng: må starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: må slutte med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: må innehalde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: må matche mønsteret ${i.pattern}`:`Ugyldig ${n[i.format]??u.format}`}case"not_multiple_of":return`Ugyldig tal: må vere eit multiplum av ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ukjende nøklar":"Ukjend nøkkel"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${u.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${u.origin}`;default:return"Ugyldig input"}}};function nn_default(){return{localeError:error38()}}var error39=()=>{const e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"},map:{unit:"elementer",verb:"å inneholde"}};function t(u){return e[u]??null}const n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-adresse",ipv6:"IPv6-adresse",mac:"MAC-adresse",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",credit_card:"kredittkortnummer",currency_code:"valutakode",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tall",array:"liste"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Ugyldig input: forventet instanceof ${u.expected}, fikk ${a}`:`Ugyldig input: forventet ${i}, fikk ${a}`}case"invalid_value":return u.values.length===1?`Ugyldig verdi: forventet ${stringifyPrimitive(u.values[0])}`:`Ugyldig valg: forventet en av ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`For stor(t): forventet ${u.origin??"value"} til å ha ${i}${u.maximum.toString()} ${o.unit??"elementer"}`:`For stor(t): forventet ${u.origin??"value"} til å ha ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`For lite(n): forventet ${u.origin} til å ha ${i}${u.minimum.toString()} ${o.unit}`:`For lite(n): forventet ${u.origin} til å ha ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Ugyldig streng: må starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: må ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: må inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: må matche mønsteret ${i.pattern}`:`Ugyldig ${n[i.format]??u.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${u.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${u.origin}`;default:return"Ugyldig input"}}};function no_default(){return{localeError:error39()}}var error40=()=>{const e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"},map:{unit:"unsur",verb:"olmalıdır"}};function t(u){return e[u]??null}const n={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",mac:"MAC nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",credit_card:"i'tibâr kartı numarası",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"giren"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Fâsit giren: umulan instanceof ${u.expected}, alınan ${a}`:`Fâsit giren: umulan ${i}, alınan ${a}`}case"invalid_value":return u.values.length===1?`Fâsit giren: umulan ${stringifyPrimitive(u.values[0])}`:`Fâsit tercih: mûteberler ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Fazla büyük: ${u.origin??"value"}, ${i}${u.maximum.toString()} ${o.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${u.origin??"value"}, ${i}${u.maximum.toString()} olmalıydı.`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Fazla küçük: ${u.origin}, ${i}${u.minimum.toString()} ${o.unit} sahip olmalıydı.`:`Fazla küçük: ${u.origin}, ${i}${u.minimum.toString()} olmalıydı.`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Fâsit metin: "${i.prefix}" ile başlamalı.`:i.format==="ends_with"?`Fâsit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`Fâsit metin: "${i.includes}" ihtivâ etmeli.`:i.format==="regex"?`Fâsit metin: ${i.pattern} nakşına uymalı.`:`Fâsit ${n[i.format]??u.format}`}case"not_multiple_of":return`Fâsit sayı: ${u.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${u.keys.length>1?"s":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`${u.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${u.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function ota_default(){return{localeError:error40()}}var error41=()=>{const e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"},map:{unit:"توکي",verb:"ولري"}};function t(u){return e[u]??null}const n={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",mac:"د MAC پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",credit_card:"د کریډیټ کارت شمیره",currency_code:"د اسعارو کوډ",iban:"IBAN",jwt:"JWT",template_literal:"ورودي"},r={nan:"NaN",number:"عدد",array:"ارې"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`ناسم ورودي: باید instanceof ${u.expected} وای, مګر ${a} ترلاسه شو`:`ناسم ورودي: باید ${i} وای, مګر ${a} ترلاسه شو`}case"invalid_value":return u.values.length===1?`ناسم ورودي: باید ${stringifyPrimitive(u.values[0])} وای`:`ناسم انتخاب: باید یو له ${joinValues(u.values,"|")} څخه وای`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`ډیر لوی: ${u.origin??"ارزښت"} باید ${i}${u.maximum.toString()} ${o.unit??"عنصرونه"} ولري`:`ډیر لوی: ${u.origin??"ارزښت"} باید ${i}${u.maximum.toString()} وي`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`ډیر کوچنی: ${u.origin} باید ${i}${u.minimum.toString()} ${o.unit} ولري`:`ډیر کوچنی: ${u.origin} باید ${i}${u.minimum.toString()} وي`}case"invalid_format":{const i=u;return i.format==="starts_with"?`ناسم متن: باید د "${i.prefix}" سره پیل شي`:i.format==="ends_with"?`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`:i.format==="includes"?`ناسم متن: باید "${i.includes}" ولري`:i.format==="regex"?`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`:`${n[i.format]??u.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${u.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${u.keys.length>1?"کلیډونه":"کلیډ"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${u.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${u.origin} کې`;default:return"ناسمه ورودي"}}};function ps_default(){return{localeError:error41()}}var error42=()=>{const e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"},map:{unit:"elementów",verb:"mieć"}};function t(u){return e[u]??null}const n={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",mac:"adres MAC",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",credit_card:"numer karty kredytowej",currency_code:"kod waluty",iban:"IBAN",jwt:"JWT",template_literal:"wejście"},r={nan:"NaN",number:"liczba",array:"tablica"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${u.expected}, otrzymano ${a}`:`Nieprawidłowe dane wejściowe: oczekiwano ${i}, otrzymano ${a}`}case"invalid_value":return u.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${stringifyPrimitive(u.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Za duża wartość: oczekiwano, że ${u.origin??"wartość"} będzie mieć ${i}${u.maximum.toString()} ${o.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${u.origin??"wartość"} będzie wynosić ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Za mała wartość: oczekiwano, że ${u.origin??"wartość"} będzie mieć ${i}${u.minimum.toString()} ${o.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${u.origin??"wartość"} będzie wynosić ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${i.prefix}"`:i.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${i.suffix}"`:i.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${i.includes}"`:i.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${i.pattern}`:`Nieprawidłow(y/a/e) ${n[i.format]??u.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${u.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${u.keys.length>1?"s":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${u.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${u.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function pl_default(){return{localeError:error42()}}var error43=()=>{const e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(o){return e[o]??null}const n={regex:"a entrada",email:"o endereço de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a duração ISO",ipv4:"o endereço IPv4",ipv6:"o endereço IPv6",mac:"o endereço MAC",cidrv4:"o intervalo de endereços IPv4",cidrv6:"o intervalo de endereços IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o número E.164",credit_card:"o número de cartão de crédito",currency_code:"o código de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},r={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},u={string:{name:"texto",articles:r.masculine},number:{name:"número",articles:r.masculine},int:{name:"número inteiro",articles:r.masculine},boolean:{name:"valor booleano",articles:r.masculine},bigint:{name:"número bigint",articles:r.masculine},symbol:{name:"símbolo",articles:r.masculine},undefined:{name:'valor "undefined"',articles:r.masculine},null:{name:'valor "nulo"',articles:r.masculine},never:{name:'valor "never"',articles:r.masculine},void:{name:'valor "void"',articles:r.masculine},date:{name:"data",articles:r.feminine},array:{name:"vetor",articles:r.masculine},object:{name:"objeto",articles:r.masculine},tuple:{name:"tuplo",articles:r.masculine},record:{name:"registo",articles:r.masculine},map:{name:"mapa",articles:r.masculine},set:{name:"conjunto",articles:r.masculine},file:{name:"ficheiro",articles:r.masculine},nonoptional:{name:"valor não opcional",articles:r.masculine},nan:{name:'valor "NaN"',articles:r.masculine},function:{name:"função",articles:r.feminine}};function i(o,a){const s=u[o]??{name:`valor "${o}"`,articles:r.masculine};return`${s.articles[a]} ${s.name}`}return o=>{switch(o.code){case"invalid_type":{const a=i(o.expected,"indefinite"),s=parsedType(o.input),c=i(s,"indefinite");return`Entrada inválida: esperava ${a}, recebeu ${c}`}case"invalid_value":return o.values.length===1?`Entrada inválida: esperava ${stringifyPrimitive(o.values[0])}`:`Opção inválida: esperava uma das seguintes opções: ${joinValues(o.values,"|")}`;case"too_big":{const a=o.inclusive?"<=":"<",s=t(o.origin);return s?`Demasiado grande: esperava que ${i(o.origin,"definite")} tivesse ${a} ${o.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: esperava que ${i(o.origin,"definite")} fosse ${a} ${o.maximum.toString()}`}case"too_small":{const a=o.inclusive?">=":">",s=t(o.origin);return s?`Demasiado pequeno: esperava que ${i(o.origin,"definite")} tivesse ${a} ${o.minimum.toString()} ${s.unit??"elementos"}`:`Demasiado pequeno: esperava que ${i(o.origin,"definite")} fosse ${a} ${o.minimum.toString()}`}case"invalid_format":{const a=o;return a.format==="starts_with"?`Texto inválido: deve começar por "${a.prefix}"`:a.format==="ends_with"?`Texto inválido: deve terminar em "${a.suffix}"`:a.format==="includes"?`Texto inválido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inválido: deve corresponder ao padrão ${a.pattern}`:`Formato d${n[a.format]??o.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${o.divisor}`;case"unrecognized_keys":{const a=o.keys.length>1?"s":"";return`Chave${a} inválida${a}: ${joinValues(o.keys,", ")}`}case"invalid_key":return`Entrada inválida n${i(o.origin,"definite")}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Valor de discriminação inválido. Esperava ${o.options.map(s=>`'${s}'`).join(" | ")}`:"Entrada inválida";case"invalid_element":return`Entrada inválida n${i(o.origin,"definite")}`;default:return"Entrada inválida"}}};function pt_default(){return{localeError:error43()}}var error44=()=>{const e={string:{unit:"caracteres"},file:{unit:"bytes"},array:{unit:"elementos"},set:{unit:"elementos"},map:{unit:"entradas"}};function t(o){return e[o]??null}const n={regex:"a entrada",email:"o endereço de e-mail",url:"o URL",emoji:"o emoji",uuid:"o UUID",uuidv4:"o UUIDv4",uuidv6:"o UUIDv6",nanoid:"o nanoid",guid:"o GUID",cuid:"o cuid",cuid2:"o cuid2",ulid:"o ULID",xid:"o XID",ksuid:"o KSUID",datetime:"a data e hora ISO",date:"a data ISO",time:"a hora ISO",duration:"a duração ISO",ipv4:"o endereço IPv4",ipv6:"o endereço IPv6",mac:"o endereço MAC",cidrv4:"a faixa de endereços IPv4",cidrv6:"a faixa de endereços IPv6",base64:"o texto codificado em base64",base64url:"o texto codificado em base64url",json_string:"o texto JSON",e164:"o número E.164",credit_card:"o número de cartão de crédito",currency_code:"o código de moeda",iban:"o IBAN",jwt:"o JWT",template_literal:"a entrada"},r={masculine:{definite:"o",indefinite:"um"},feminine:{definite:"a",indefinite:"uma"}},u={string:{name:"texto",articles:r.masculine},number:{name:"número",articles:r.masculine},int:{name:"número inteiro",articles:r.masculine},boolean:{name:"valor booleano",articles:r.masculine},bigint:{name:"número bigint",articles:r.masculine},symbol:{name:"símbolo",articles:r.masculine},undefined:{name:'valor "undefined"',articles:r.masculine},null:{name:'valor "nulo"',articles:r.masculine},never:{name:'valor "never"',articles:r.masculine},void:{name:'valor "void"',articles:r.masculine},date:{name:"data",articles:r.feminine},array:{name:"vetor",articles:r.masculine},object:{name:"objeto",articles:r.masculine},tuple:{name:"tupla",articles:r.feminine},record:{name:"registro",articles:r.masculine},map:{name:"mapa",articles:r.masculine},set:{name:"conjunto",articles:r.masculine},file:{name:"arquivo",articles:r.masculine},nonoptional:{name:"valor não opcional",articles:r.masculine},nan:{name:'valor "NaN"',articles:r.masculine},function:{name:"função",articles:r.feminine}};function i(o,a){const s=u[o]??{name:`valor "${o}"`,articles:r.masculine};return`${s.articles[a]} ${s.name}`}return o=>{switch(o.code){case"invalid_type":{const a=i(o.expected,"indefinite"),s=parsedType(o.input),c=i(s,"indefinite");return`Entrada inválida: esperava ${a}, recebeu ${c}`}case"invalid_value":return o.values.length===1?`Entrada inválida: esperava ${stringifyPrimitive(o.values[0])}`:`Opção inválida: esperava uma das seguintes opções: ${joinValues(o.values,"|")}`;case"too_big":{const a=o.inclusive?"<=":"<",s=t(o.origin);return s?`Grande demais: esperava que ${i(o.origin,"definite")} tivesse ${a} ${o.maximum.toString()} ${s.unit??"elementos"}`:`Grande demais: esperava que ${i(o.origin,"definite")} fosse ${a} ${o.maximum.toString()}`}case"too_small":{const a=o.inclusive?">=":">",s=t(o.origin);return s?`Pequeno demais: esperava que ${i(o.origin,"definite")} tivesse ${a} ${o.minimum.toString()} ${s.unit??"elementos"}`:`Pequeno demais: esperava que ${i(o.origin,"definite")} fosse ${a} ${o.minimum.toString()}`}case"invalid_format":{const a=o;return a.format==="starts_with"?`Texto inválido: deve começar com "${a.prefix}"`:a.format==="ends_with"?`Texto inválido: deve terminar com "${a.suffix}"`:a.format==="includes"?`Texto inválido: deve incluir "${a.includes}"`:a.format==="regex"?`Texto inválido: deve corresponder ao padrão ${a.pattern}`:`Formato d${n[a.format]??o.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${o.divisor}`;case"unrecognized_keys":{const a=o.keys.length>1?"s":"";return`Chave${a} inválida${a}: ${joinValues(o.keys,", ")}`}case"invalid_key":return`Entrada inválida n${i(o.origin,"definite")}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Valor de discriminação inválido. Esperava ${o.options.map(s=>`'${s}'`).join(" | ")}`:"Entrada inválida";case"invalid_element":return`Entrada inválida n${i(o.origin,"definite")}`;default:return"Entrada inválida"}}};function pt_BR_default(){return{localeError:error44()}}var error45=()=>{const e={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function t(u){return e[u]??null}const n={regex:"intrare",email:"adresă de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",credit_card:"număr de card de credit",currency_code:"cod valutar",iban:"IBAN",jwt:"JWT",template_literal:"intrare"},r={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return`Intrare invalidă: așteptat ${i}, primit ${a}`}case"invalid_value":return u.values.length===1?`Intrare invalidă: așteptat ${stringifyPrimitive(u.values[0])}`:`Opțiune invalidă: așteptat una dintre ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Prea mare: așteptat ca ${u.origin??"valoarea"} ${o.verb} ${i}${u.maximum.toString()} ${o.unit??"elemente"}`:`Prea mare: așteptat ca ${u.origin??"valoarea"} să fie ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Prea mic: așteptat ca ${u.origin} ${o.verb} ${i}${u.minimum.toString()} ${o.unit}`:`Prea mic: așteptat ca ${u.origin} să fie ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Șir invalid: trebuie să înceapă cu "${i.prefix}"`:i.format==="ends_with"?`Șir invalid: trebuie să se termine cu "${i.suffix}"`:i.format==="includes"?`Șir invalid: trebuie să includă "${i.includes}"`:i.format==="regex"?`Șir invalid: trebuie să se potrivească cu modelul ${i.pattern}`:`Format invalid: ${n[i.format]??u.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${u.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${u.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${u.origin}`;default:return"Intrare invalidă"}}};function ro_default(){return{localeError:error45()}}function getRussianPlural(e,t,n,r){const u=Math.abs(e),i=u%10,o=u%100;return o>=11&&o<=19?r:i===1?t:i>=2&&i<=4?n:r}var error46=()=>{const e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},map:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(u){return e[u]??null}const n={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",mac:"MAC адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",credit_card:"номер кредитной карты",currency_code:"код валюты",iban:"IBAN",jwt:"JWT",template_literal:"ввод"},r={nan:"NaN",number:"число",array:"массив"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Неверный ввод: ожидалось instanceof ${u.expected}, получено ${a}`:`Неверный ввод: ожидалось ${i}, получено ${a}`}case"invalid_value":return u.values.length===1?`Неверный ввод: ожидалось ${stringifyPrimitive(u.values[0])}`:`Неверный вариант: ожидалось одно из ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);if(o){const a=Number(u.maximum),s=getRussianPlural(a,o.unit.one,o.unit.few,o.unit.many);return`Слишком большое значение: ожидалось, что ${u.origin??"значение"} будет иметь ${i}${u.maximum.toString()} ${s}`}return`Слишком большое значение: ожидалось, что ${u.origin??"значение"} будет ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);if(o){const a=Number(u.minimum),s=getRussianPlural(a,o.unit.one,o.unit.few,o.unit.many);return`Слишком маленькое значение: ожидалось, что ${u.origin} будет иметь ${i}${u.minimum.toString()} ${s}`}return`Слишком маленькое значение: ожидалось, что ${u.origin} будет ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Неверная строка: должна начинаться с "${i.prefix}"`:i.format==="ends_with"?`Неверная строка: должна заканчиваться на "${i.suffix}"`:i.format==="includes"?`Неверная строка: должна содержать "${i.includes}"`:i.format==="regex"?`Неверная строка: должна соответствовать шаблону ${i.pattern}`:`Неверный ${n[i.format]??u.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${u.divisor}`;case"unrecognized_keys":return`Нераспознанн${u.keys.length>1?"ые":"ый"} ключ${u.keys.length>1?"и":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${u.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${u.origin}`;default:return"Неверные входные данные"}}};function ru_default(){return{localeError:error46()}}var error47=()=>{const e={string:{unit:"znakov",verb:"mať"},file:{unit:"bajtov",verb:"mať"},array:{unit:"prvkov",verb:"mať"},set:{unit:"prvkov",verb:"mať"},map:{unit:"položiek",verb:"mať"}};function t(u){return e[u]??null}const n={regex:"regulárny výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dátum a čas vo formáte ISO",date:"dátum vo formáte ISO",time:"čas vo formáte ISO",duration:"doba trvania ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",mac:"MAC adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"reťazec zakódovaný vo formáte base64",base64url:"reťazec zakódovaný vo formáte base64url",json_string:"reťazec vo formáte JSON",e164:"číslo E.164",credit_card:"číslo kreditnej karty",currency_code:"kód meny",iban:"IBAN",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"číslo",string:"reťazec",function:"funkcia",array:"pole"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Neplatný vstup: očakávané instanceof ${u.expected}, obdržané ${a}`:`Neplatný vstup: očakávané ${i}, obdržané ${a}`}case"invalid_value":return u.values.length===1?`Neplatný vstup: očakávané ${stringifyPrimitive(u.values[0])}`:`Neplatný vstup: očakávaná jedna z hodnôt ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Hodnota je príliš veľká: ${u.origin??"hodnota"} musí mať ${i}${u.maximum.toString()} ${o.unit??"prvkov"}`:`Hodnota je príliš veľká: ${u.origin??"hodnota"} musí byť ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Hodnota je príliš malá: ${u.origin??"hodnota"} musí mať ${i}${u.minimum.toString()} ${o.unit??"prvkov"}`:`Hodnota je príliš malá: ${u.origin??"hodnota"} musí byť ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Neplatný reťazec: musí začínať na "${i.prefix}"`:i.format==="ends_with"?`Neplatný reťazec: musí končiť na "${i.suffix}"`:i.format==="includes"?`Neplatný reťazec: musí obsahovať "${i.includes}"`:i.format==="regex"?`Neplatný reťazec: musí zodpovedať vzoru ${i.pattern}`:`Neplatný formát ${n[i.format]??u.format}`}case"not_multiple_of":return`Neplatné číslo: musí byť násobkom ${u.divisor}`;case"unrecognized_keys":return`Neznáme klúče: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Neplatný klúč v ${u.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${u.origin}`;default:return"Neplatný vstup"}}};function sk_default(){return{localeError:error47()}}var error48=()=>{const e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"},map:{unit:"elementov",verb:"imeti"}};function t(u){return e[u]??null}const n={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",mac:"MAC naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",credit_card:"številka kreditne kartice",currency_code:"koda valute",iban:"IBAN",jwt:"JWT",template_literal:"vnos"},r={nan:"NaN",number:"število",array:"tabela"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Neveljaven vnos: pričakovano instanceof ${u.expected}, prejeto ${a}`:`Neveljaven vnos: pričakovano ${i}, prejeto ${a}`}case"invalid_value":return u.values.length===1?`Neveljaven vnos: pričakovano ${stringifyPrimitive(u.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Preveliko: pričakovano, da bo ${u.origin??"vrednost"} imelo ${i}${u.maximum.toString()} ${o.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${u.origin??"vrednost"} ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Premajhno: pričakovano, da bo ${u.origin} imelo ${i}${u.minimum.toString()} ${o.unit}`:`Premajhno: pričakovano, da bo ${u.origin} ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Neveljaven niz: mora se začeti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se končati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${n[i.format]??u.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${u.divisor}`;case"unrecognized_keys":return`Neprepoznan${u.keys.length>1?"i ključi":" ključ"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${u.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${u.origin}`;default:return"Neveljaven vnos"}}};function sl_default(){return{localeError:error48()}}var error49=()=>{const e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"},map:{unit:"objekt",verb:"att innehålla"}};function t(u){return e[u]??null}const n={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-adress",ipv6:"IPv6-adress",mac:"MAC-adress",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",credit_card:"kreditkortsnummer",currency_code:"valutakod",iban:"IBAN",jwt:"JWT",template_literal:"mall-literal"},r={nan:"NaN",number:"antal",array:"lista"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Ogiltig inmatning: förväntat instanceof ${u.expected}, fick ${a}`:`Ogiltig inmatning: förväntat ${i}, fick ${a}`}case"invalid_value":return u.values.length===1?`Ogiltig inmatning: förväntat ${stringifyPrimitive(u.values[0])}`:`Ogiltigt val: förväntade en av ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`För stor(t): förväntade ${u.origin??"värdet"} att ha ${i}${u.maximum.toString()} ${o.unit??"element"}`:`För stor(t): förväntat ${u.origin??"värdet"} att ha ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`För lite(t): förväntade ${u.origin??"värdet"} att ha ${i}${u.minimum.toString()} ${o.unit}`:`För lite(t): förväntade ${u.origin??"värdet"} att ha ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Ogiltig sträng: måste börja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig sträng: måste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig sträng: måste innehålla "${i.includes}"`:i.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${i.pattern}"`:`Ogiltig(t) ${n[i.format]??u.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${u.divisor}`;case"unrecognized_keys":return`${u.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${u.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${u.origin??"värdet"}`;default:return"Ogiltig input"}}};function sv_default(){return{localeError:error49()}}var error50=()=>{const e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},map:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(u){return e[u]??null}const n={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",mac:"MAC முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",credit_card:"கடன் அட்டை எண்",currency_code:"நாணயக் குறியீடு",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${u.expected}, பெறப்பட்டது ${a}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${i}, பெறப்பட்டது ${a}`}case"invalid_value":return u.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${stringifyPrimitive(u.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${joinValues(u.values,"|")} இல் ஒன்று`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${u.origin??"மதிப்பு"} ${i}${u.maximum.toString()} ${o.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${u.origin??"மதிப்பு"} ${i}${u.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${u.origin} ${i}${u.minimum.toString()} ${o.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${u.origin} ${i}${u.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const i=u;return i.format==="starts_with"?`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`:i.format==="ends_with"?`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`:i.format==="includes"?`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`:i.format==="regex"?`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[i.format]??u.format}`}case"not_multiple_of":return`தவறான எண்: ${u.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${u.keys.length>1?"கள்":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`${u.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${u.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function ta_default(){return{localeError:error50()}}var error51=()=>{const e={string:{unit:"аломат",verb:"дошта бошад"},file:{unit:"байт",verb:"дошта бошад"},array:{unit:"унсур",verb:"дошта бошад"},set:{unit:"унсур",verb:"дошта бошад"},map:{unit:"сабт",verb:"дошта бошад"}};function t(u){return e[u]??null}const n={regex:"вуруд",email:"суроғаи email",url:"URL",emoji:"эмоҷи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"санаву вақти ISO",date:"санаи ISO",time:"вақти ISO",duration:"давомнокии ISO",ipv4:"суроғаи IPv4",ipv6:"суроғаи IPv6",mac:"суроғаи MAC",cidrv4:"маҳдудаи IPv4",cidrv6:"маҳдудаи IPv6",base64:"сатри дар формати base64",base64url:"сатри дар формати base64url",json_string:"сатри JSON",e164:"рақами E.164",credit_card:"рақами корти кредитӣ",currency_code:"рамзи асъор",iban:"IBAN",jwt:"JWT",template_literal:"вуруд"},r={nan:"NaN",number:"рақам",string:"сатр",array:"массив",object:"объект",date:"сана"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return`Вуруди нодуруст: ${i} интизор мерафт, ${a} гирифта шуд`}case"invalid_value":return u.values.length===1?`Вуруди нодуруст: ${stringifyPrimitive(u.values[0])} интизор мерафт`:`Интихоби нодуруст: яке аз ${joinValues(u.values,"|")} интизор мерафт`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Хеле калон: ${u.origin??"қимат"} бояд ${i}${u.maximum.toString()} ${o.unit} ${o.verb}`:`Хеле калон: ${u.origin??"қимат"} бояд ${i}${u.maximum.toString()} бошад`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Хеле хурд: ${u.origin} бояд ${i}${u.minimum.toString()} ${o.unit} ${o.verb}`:`Хеле хурд: ${u.origin} бояд ${i}${u.minimum.toString()} бошад`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Сатри нодуруст: бояд бо "${i.prefix}" оғоз шавад`:i.format==="ends_with"?`Сатри нодуруст: бояд бо "${i.suffix}" анҷом ёбад`:i.format==="includes"?`Сатри нодуруст: бояд "${i.includes}"-ро дар бар гирад`:i.format==="regex"?`Сатри нодуруст: бояд ба намунаи ${i.pattern} мувофиқат кунад`:`${n[i.format]??u.format}-и нодуруст`}case"not_multiple_of":return`Рақами нодуруст: бояд ба ${u.divisor} бе бақия тақсим шавад`;case"unrecognized_keys":return`Калид${u.keys.length>1?"ҳои":"и"} номаълум: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Калиди нодуруст дар ${u.origin}`;case"invalid_union":return u.options&&Array.isArray(u.options)&&u.options.length>0?`Қимати нодурусти дискриминатор: ${u.options.map(o=>`'${o}'`).join(" | ")} интизор мерафт`:"Вуруди нодуруст";case"invalid_element":return`Қимати нодуруст дар ${u.origin}`;default:return"Вуруди нодуруст"}}};function tg_default(){return{localeError:error51()}}var error52=()=>{const e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"},map:{unit:"รายการ",verb:"ควรมี"}};function t(u){return e[u]??null}const n={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",mac:"ที่อยู่ MAC",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",credit_card:"หมายเลขบัตรเครดิต",currency_code:"รหัสสกุลเงิน",iban:"IBAN",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},r={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${u.expected} แต่ได้รับ ${a}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${i} แต่ได้รับ ${a}`}case"invalid_value":return u.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${stringifyPrimitive(u.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"ไม่เกิน":"น้อยกว่า",o=t(u.origin);return o?`เกินกำหนด: ${u.origin??"ค่า"} ควรมี${i} ${u.maximum.toString()} ${o.unit??"รายการ"}`:`เกินกำหนด: ${u.origin??"ค่า"} ควรมี${i} ${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?"อย่างน้อย":"มากกว่า",o=t(u.origin);return o?`น้อยกว่ากำหนด: ${u.origin} ควรมี${i} ${u.minimum.toString()} ${o.unit}`:`น้อยกว่ากำหนด: ${u.origin} ควรมี${i} ${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`:i.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`:i.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`:i.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`:`รูปแบบไม่ถูกต้อง: ${n[i.format]??u.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${u.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${joinValues(u.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${u.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${u.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function th_default(){return{localeError:error52()}}var error53=()=>{const e={string:{unit:"simwol",verb:"bolmaly"},file:{unit:"baýt",verb:"bolmaly"},array:{unit:"elementler",verb:"bolmaly"},set:{unit:"elementler",verb:"bolmaly"},map:{unit:"elementler",verb:"bolmaly"}};function t(u){return e[u]??null}const n={regex:"giriş",email:"e-poçta salgysy",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sene we wagt",date:"ISO sene",time:"ISO wagt",duration:"ISO wagt aralygy",ipv4:"IPv4 salgysy",ipv6:"IPv6 salgysy",mac:"MAC salgysy",cidrv4:"IPv4 aralygy",cidrv6:"IPv6 aralygy",base64:"base64 bilen şifrlenen setir",base64url:"base64url bilen şifrlenen setir",json_string:"JSON setiri",e164:"E.164 nomeri",credit_card:"kredit kartynyň nomeri",currency_code:"walýuta kody",iban:"IBAN",jwt:"JWT",template_literal:"şablon"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return`Nädogry baha: garaşylan ${i} ýerine ${a} alyndy`}case"invalid_value":return u.values.length===1?`Nädogry baha: ${stringifyPrimitive(u.values[0])} bolmaly`:`Nädogry saýlaw: aşakdakylardan biri bolmaly: ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Has uly: garaşylýan ${u.origin??"baha"} ${i} ${u.maximum.toString()} ${o.unit??"element"}`:`Has uly: garaşylýan ${u.origin??"baha"} ${i} ${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Has kiçi: garaşylýan ${u.origin} ${i} ${u.minimum.toString()} ${o.unit}`:`Has kiçi: garaşylýan ${u.origin} ${i} ${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Nädogry setir: "${i.prefix}" bilen başlamaly`:i.format==="ends_with"?`Nädogry setir: "${i.suffix}" bilen gutarmaly`:i.format==="includes"?`Nädogry setir: "${i.includes}" saklamaly`:i.format==="regex"?`Nädogry setir: ${i.pattern} nusga laýyk bolmaly`:`Nädogry ${n[i.format]??u.format}`}case"not_multiple_of":return`Nädogry san: ${u.divisor} bilen galyndysyz bölünmeli`;case"unrecognized_keys":return`Tanalmaýan açar${u.keys.length>1?"lar":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`${u.origin} içinde nädogry açar`;case"invalid_union":return"Nädogry baha";case"invalid_element":return`${u.origin} içinde nädogry baha`;default:return"Nädogry baha"}}};function tk_default(){return{localeError:error53()}}var error54=()=>{const e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"},map:{unit:"öğe",verb:"olmalı"}};function t(u){return e[u]??null}const n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",mac:"MAC adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",credit_card:"kredi kartı numarası",currency_code:"para birimi kodu",iban:"IBAN",jwt:"JWT",template_literal:"Şablon dizesi"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Geçersiz değer: beklenen instanceof ${u.expected}, alınan ${a}`:`Geçersiz değer: beklenen ${i}, alınan ${a}`}case"invalid_value":return u.values.length===1?`Geçersiz değer: beklenen ${stringifyPrimitive(u.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Çok büyük: beklenen ${u.origin??"değer"} ${i}${u.maximum.toString()} ${o.unit??"öğe"}`:`Çok büyük: beklenen ${u.origin??"değer"} ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Çok küçük: beklenen ${u.origin} ${i}${u.minimum.toString()} ${o.unit}`:`Çok küçük: beklenen ${u.origin} ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Geçersiz metin: "${i.prefix}" ile başlamalı`:i.format==="ends_with"?`Geçersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Geçersiz metin: "${i.includes}" içermeli`:i.format==="regex"?`Geçersiz metin: ${i.pattern} desenine uymalı`:`Geçersiz ${n[i.format]??u.format}`}case"not_multiple_of":return`Geçersiz sayı: ${u.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${u.keys.length>1?"lar":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`${u.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${u.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function tr_default(){return{localeError:error54()}}var error55=()=>{const e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"},map:{unit:"елементів",verb:"матиме"}};function t(u){return e[u]??null}const n={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",mac:"адреса MAC",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",credit_card:"номер кредитної картки",currency_code:"код валюти",iban:"IBAN",jwt:"JWT",template_literal:"вхідні дані"},r={nan:"NaN",number:"число",array:"масив"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Неправильні вхідні дані: очікується instanceof ${u.expected}, отримано ${a}`:`Неправильні вхідні дані: очікується ${i}, отримано ${a}`}case"invalid_value":return u.values.length===1?`Неправильні вхідні дані: очікується ${stringifyPrimitive(u.values[0])}`:`Неправильна опція: очікується одне з ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Занадто велике: очікується, що ${u.origin??"значення"} ${o.verb} ${i}${u.maximum.toString()} ${o.unit??"елементів"}`:`Занадто велике: очікується, що ${u.origin??"значення"} буде ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Занадто мале: очікується, що ${u.origin} ${o.verb} ${i}${u.minimum.toString()} ${o.unit}`:`Занадто мале: очікується, що ${u.origin} буде ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Неправильний рядок: повинен починатися з "${i.prefix}"`:i.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`:i.format==="includes"?`Неправильний рядок: повинен містити "${i.includes}"`:i.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`:`Неправильний ${n[i.format]??u.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${u.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${u.keys.length>1?"і":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${u.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${u.origin}`;default:return"Неправильні вхідні дані"}}};function uk_default(){return{localeError:error55()}}function ua_default(){return uk_default()}var error56=()=>{const e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"},map:{unit:"آئٹمز",verb:"ہونا"}};function t(u){return e[u]??null}const n={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",mac:"ایم اے سی ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",credit_card:"کریڈٹ کارڈ نمبر",currency_code:"کرنسی کوڈ",iban:"IBAN",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},r={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`غلط ان پٹ: instanceof ${u.expected} متوقع تھا، ${a} موصول ہوا`:`غلط ان پٹ: ${i} متوقع تھا، ${a} موصول ہوا`}case"invalid_value":return u.values.length===1?`غلط ان پٹ: ${stringifyPrimitive(u.values[0])} متوقع تھا`:`غلط آپشن: ${joinValues(u.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`بہت بڑا: ${u.origin??"ویلیو"} کے ${i}${u.maximum.toString()} ${o.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${u.origin??"ویلیو"} کا ${i}${u.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`بہت چھوٹا: ${u.origin} کے ${i}${u.minimum.toString()} ${o.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${u.origin} کا ${i}${u.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const i=u;return i.format==="starts_with"?`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`:i.format==="ends_with"?`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`:i.format==="includes"?`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`:i.format==="regex"?`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`:`غلط ${n[i.format]??u.format}`}case"not_multiple_of":return`غلط نمبر: ${u.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${u.keys.length>1?"ز":""}: ${joinValues(u.keys,"، ")}`;case"invalid_key":return`${u.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${u.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function ur_default(){return{localeError:error56()}}var error57=()=>{const e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function t(u){return e[u]??null}const n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",credit_card:"kredit karta raqami",currency_code:"valyuta kodi",iban:"IBAN",jwt:"JWT",template_literal:"kirish"},r={nan:"NaN",number:"raqam",array:"massiv"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${u.expected}, qabul qilingan ${a}`:`Noto‘g‘ri kirish: kutilgan ${i}, qabul qilingan ${a}`}case"invalid_value":return u.values.length===1?`Noto‘g‘ri kirish: kutilgan ${stringifyPrimitive(u.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Juda katta: kutilgan ${u.origin??"qiymat"} ${i}${u.maximum.toString()} ${o.unit} ${o.verb}`:`Juda katta: kutilgan ${u.origin??"qiymat"} ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Juda kichik: kutilgan ${u.origin} ${i}${u.minimum.toString()} ${o.unit} ${o.verb}`:`Juda kichik: kutilgan ${u.origin} ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Noto‘g‘ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto‘g‘ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto‘g‘ri satr: "${i.includes}" ni o‘z ichiga olishi kerak`:i.format==="regex"?`Noto‘g‘ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[i.format]??u.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${u.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${u.keys.length>1?"lar":""}: ${joinValues(u.keys,", ")}`;case"invalid_key":return`${u.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${u.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function uz_default(){return{localeError:error57()}}var error58=()=>{const e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"},map:{unit:"phần tử",verb:"có"}};function t(u){return e[u]??null}const n={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",mac:"địa chỉ MAC",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",credit_card:"số thẻ tín dụng",currency_code:"mã tiền tệ",iban:"IBAN",jwt:"JWT",template_literal:"đầu vào"},r={nan:"NaN",number:"số",array:"mảng"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${u.expected}, nhận được ${a}`:`Đầu vào không hợp lệ: mong đợi ${i}, nhận được ${a}`}case"invalid_value":return u.values.length===1?`Đầu vào không hợp lệ: mong đợi ${stringifyPrimitive(u.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Quá lớn: mong đợi ${u.origin??"giá trị"} ${o.verb} ${i}${u.maximum.toString()} ${o.unit??"phần tử"}`:`Quá lớn: mong đợi ${u.origin??"giá trị"} ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Quá nhỏ: mong đợi ${u.origin} ${o.verb} ${i}${u.minimum.toString()} ${o.unit}`:`Quá nhỏ: mong đợi ${u.origin} ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${i.prefix}"`:i.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${i.suffix}"`:i.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${i.includes}"`:i.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${i.pattern}`:`${n[i.format]??u.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${u.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${u.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${u.origin}`;default:return"Đầu vào không hợp lệ"}}};function vi_default(){return{localeError:error58()}}var error59=()=>{const e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"},map:{unit:"项",verb:"包含"}};function t(u){return e[u]??null}const n={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",mac:"MAC地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",credit_card:"信用卡号",currency_code:"货币代码",iban:"IBAN",jwt:"JWT",template_literal:"输入"},r={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`无效输入:期望 instanceof ${u.expected},实际接收 ${a}`:`无效输入:期望 ${i},实际接收 ${a}`}case"invalid_value":return u.values.length===1?`无效输入:期望 ${stringifyPrimitive(u.values[0])}`:`无效选项:期望以下之一 ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`数值过大:期望 ${u.origin??"值"} ${i}${u.maximum.toString()} ${o.unit??"个元素"}`:`数值过大:期望 ${u.origin??"值"} ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`数值过小:期望 ${u.origin} ${i}${u.minimum.toString()} ${o.unit}`:`数值过小:期望 ${u.origin} ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`无效字符串:必须以 "${i.prefix}" 开头`:i.format==="ends_with"?`无效字符串:必须以 "${i.suffix}" 结尾`:i.format==="includes"?`无效字符串:必须包含 "${i.includes}"`:i.format==="regex"?`无效字符串:必须满足正则表达式 ${i.pattern}`:`无效${n[i.format]??u.format}`}case"not_multiple_of":return`无效数字:必须是 ${u.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${joinValues(u.keys,", ")}`;case"invalid_key":return`${u.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${u.origin} 中包含无效值(value)`;default:return"无效输入"}}};function zh_CN_default(){return{localeError:error59()}}var error60=()=>{const e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"},map:{unit:"項目",verb:"擁有"}};function t(u){return e[u]??null}const n={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",mac:"MAC 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",credit_card:"信用卡號",currency_code:"貨幣代碼",iban:"IBAN",jwt:"JWT",template_literal:"輸入"},r={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`無效的輸入值:預期為 instanceof ${u.expected},但收到 ${a}`:`無效的輸入值:預期為 ${i},但收到 ${a}`}case"invalid_value":return u.values.length===1?`無效的輸入值:預期為 ${stringifyPrimitive(u.values[0])}`:`無效的選項:預期為以下其中之一 ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`數值過大:預期 ${u.origin??"值"} 應為 ${i}${u.maximum.toString()} ${o.unit??"個元素"}`:`數值過大:預期 ${u.origin??"值"} 應為 ${i}${u.maximum.toString()}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`數值過小:預期 ${u.origin} 應為 ${i}${u.minimum.toString()} ${o.unit}`:`數值過小:預期 ${u.origin} 應為 ${i}${u.minimum.toString()}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`無效的字串:必須以 "${i.prefix}" 開頭`:i.format==="ends_with"?`無效的字串:必須以 "${i.suffix}" 結尾`:i.format==="includes"?`無效的字串:必須包含 "${i.includes}"`:i.format==="regex"?`無效的字串:必須符合格式 ${i.pattern}`:`無效的 ${n[i.format]??u.format}`}case"not_multiple_of":return`無效的數字:必須為 ${u.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${u.keys.length>1?"們":""}:${joinValues(u.keys,"、")}`;case"invalid_key":return`${u.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${u.origin} 中有無效的值`;default:return"無效的輸入值"}}};function zh_TW_default(){return{localeError:error60()}}var error61=()=>{const e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"},map:{unit:"nkan",verb:"ní"}};function t(u){return e[u]??null}const n={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",mac:"àdírẹ́sì MAC",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",credit_card:"nọmba kaadi gbese",currency_code:"koodu owó",iban:"IBAN",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},r={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return u=>{switch(u.code){case"invalid_type":{const i=r[u.expected]??u.expected,o=parsedType(u.input),a=r[o]??o;return/^[A-Z]/.test(u.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${u.expected}, àmọ̀ a rí ${a}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${i}, àmọ̀ a rí ${a}`}case"invalid_value":return u.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${stringifyPrimitive(u.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${joinValues(u.values,"|")}`;case"too_big":{const i=u.inclusive?"<=":"<",o=t(u.origin);return o?`Tó pọ̀ jù: a ní láti jẹ́ pé ${u.origin??"iye"} ${o.verb} ${i}${u.maximum} ${o.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${i}${u.maximum}`}case"too_small":{const i=u.inclusive?">=":">",o=t(u.origin);return o?`Kéré ju: a ní láti jẹ́ pé ${u.origin} ${o.verb} ${i}${u.minimum} ${o.unit}`:`Kéré ju: a ní láti jẹ́ ${i}${u.minimum}`}case"invalid_format":{const i=u;return i.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${i.prefix}"`:i.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${i.suffix}"`:i.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${i.includes}"`:i.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${i.pattern}`:`Aṣìṣe: ${n[i.format]??u.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${u.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${joinValues(u.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${u.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${u.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function yo_default(){return{localeError:error61()}}var _a2,$output=Symbol("ZodOutput"),$input=Symbol("ZodInput"),$ZodRegistry=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&typeof t=="object"&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function registry(){return new $ZodRegistry}(_a2=globalThis).__zod_globalRegistry??(_a2.__zod_globalRegistry=registry());var globalRegistry=globalThis.__zod_globalRegistry,INVALID=Symbol.for("zod.compile.invalid"),FALLBACK_FLAG=Symbol.for("zod.compile.fallback"),ZodCompileAsyncError=class extends Error{constructor(e="z.compile does not support async refinements, transforms, or checks"){super(e),this.name="ZodCompileAsyncError"}},ZodCompileUnsupportedError=class extends Error{constructor(e,t=!0){super(`z.compile does not support ${e}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=t}};function compileValidator(e,t){try{return compileFn(e,{assertOnly:!0})}catch{return t}}function compile(e,t){try{const n=compileFn(e),r=withParser(e,n);return r._zod.bag.validator=compileValidator(e,n),r}catch(n){if(t?.strict)throw n;return e}}function withParser(e,t){if(isRecursiveSchema(e))throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");const n=clone(e),r=e._zod.run,u=r.__originalRun??r,i=(o,a)=>{if(a?.async||a?.direction==="backward"||a?.skipChecks||a?.[FALLBACK_FLAG]||a&&isBackEdge(a,o.value))return u(o,a);const s=t(o.value);return s!==INVALID?(o.value=s,o):(a&&(a[FALLBACK_FLAG]=!0),u(o,a))};return i.__originalRun=u,n._zod.bag.fallbackRun=u,n._zod.bag.validator=t,n._zod.run=i,r.__originalRun||installCompiledUserMethods(n,e,t),n}function installCompiledUserMethods(e,t,n){const r=e,u=t;if(typeof u.safeParse=="function"){const i=u.safeParse;r.safeParse=(o,a)=>{const s=n(o);return s!==INVALID?{success:!0,data:s}:i(o,a)}}if(typeof u.parse=="function"){const i=u.parse;r.parse=(o,a)=>{const s=n(o);return s!==INVALID?s:i(o,a)}}}function compileFn(e,t){let n=!0;try{n=isRecursiveSchema(e)}catch{}if(n)throw new ZodCompileUnsupportedError("a schema whose subtree contains a reference cycle");const r={constants:new Map,constantCounter:0,varCounter:0,definite:!0},u=new Doc(["input"]),i=generateCheck(u,r,e,"input",!t?.assertOnly);u.write(i===null?"return true;":`return ${i};`);const o=["INVALID",...r.constants.keys()],a=[INVALID,...r.constants.values()],s=u.content.join(`
61
- `),c=t?.debug?o.length>0?`// Constants: ${o.join(", ")}
62
- ${s}`:s:"",l=Function,d=`return (input) => {
63
- ${s}
64
- }`;let f;try{f=new l(...o,d)(...a)}catch(m){throw new ZodCompileUnsupportedError(`this schema (generated code failed to evaluate: ${m.message})`)}return t?.debug&&(f.code=c),f.definite=r.definite,f}function addConstant(e,t){for(const[r,u]of e.constants)if(u===t)return r;const n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function addUserConstant(e,t){return e.definite=!1,addConstant(e,t)}function newVar(e){return`v${e.varCounter++}`}function runtimeRun(e,t){const n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return INVALID;const r=n;return r.issues.length===0?r.value:INVALID}function compileChild(e,t,n,r,u=!0){const i=e.content.length,o=t.constants.size,a=t.constantCounter,s=t.varCounter;try{return generateCheck(e,t,n,r,u)}catch(c){if(!(c instanceof ZodCompileUnsupportedError)||!c.islandable)throw c;if(e.content.length=i,t.constants.size>o){const l=Array.from(t.constants.keys()).slice(o);for(const d of l)t.constants.delete(d)}return t.constantCounter=a,t.varCounter=s,emitRuntimeIsland(e,t,n,r)}}function emitRuntimeIsland(e,t,n,r){t.definite=!1;const u=addConstant(t,n),i=addConstant(t,runtimeRun),o=newVar(t);return e.write(`const ${o} = ${i}(${u}, ${r});`),e.write(`if (${o} === INVALID) return INVALID;`),o}var WHEN_DEFAULTED_CHECKS=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function generateChecks(e,t,n,r){const u=n._zod.def.checks;if(!u||u.length===0)return r;let i=r;for(const o of u){const a=o._zod.def;if(a.when&&!WHEN_DEFAULTED_CHECKS.has(a.check))throw new ZodCompileUnsupportedError('check with a custom "when" condition');switch(a.check){case"greater_than":generateGreaterThanCheck(e,t,a,i);break;case"less_than":generateLessThanCheck(e,t,a,i);break;case"multiple_of":generateMultipleOfCheck(e,t,a,i);break;case"number_format":generateNumberFormatCheck(e,a,i);break;case"min_length":{const s=numericOperand(a.minimum,"min_length"),c=codePointLengthVar(e,t,i,`${i}.length >= ${s} && ${i}.length < ${a.minimum*2}`);e.write(`if (${c} < ${s}) return INVALID;`);break}case"max_length":{const s=numericOperand(a.maximum,"max_length"),c=codePointLengthVar(e,t,i,`${i}.length > ${s}`);e.write(`if (${c} > ${s}) return INVALID;`);break}case"length_equals":{const s=numericOperand(a.length,"length_equals"),c=codePointLengthVar(e,t,i,`${i}.length >= ${s} && ${i}.length <= ${a.length*2}`);e.write(`if (${c} !== ${s}) return INVALID;`);break}case"min_size":e.write(`if (${i}.size < ${numericOperand(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${i}.size > ${numericOperand(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${i}.size !== ${numericOperand(a.size,"size_equals")}) return INVALID;`);break;case"string_format":i=generateStringFormatCheck(e,t,a,i);break;case"custom":i=generateCustomRefineCheck(e,t,o,i);break;case"bigint_format":generateBigIntFormatCheck(e,a,i);break;case"mime_type":generateMimeTypeCheck(e,t,a,i);break;case"property":generatePropertyCheck(e,t,a,i);break;case"properties":generatePropertiesChecks(e,t,a,i);break;case"overwrite":{const s=newVar(t);generateOverwriteCheck(e,t,o,i,s),i=s;break}default:throw new ZodCompileUnsupportedError(`check type ${a.check}`)}}return i}function codePointLengthVar(e,t,n,r){const u=addConstant(t,codePointLength),i=newVar(t);return e.write(`const ${i} = typeof ${n} === "string" && ${r} ? ${u}(${n}) : ${n}.length;`),i}function numericOperand(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new ZodCompileUnsupportedError(`${t} bound of type ${typeof e}`);return`${e}`}function comparisonOperand(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new ZodCompileUnsupportedError("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new ZodCompileUnsupportedError("comparison check with Invalid Date bound");return addConstant(e,t)}throw new ZodCompileUnsupportedError(`comparison check bound of type ${typeof t}`)}function generateGreaterThanCheck(e,t,n,r){const u=n.inclusive?"<":"<=";e.write(`if (${r} ${u} ${comparisonOperand(t,n.value)}) return INVALID;`)}function generateLessThanCheck(e,t,n,r){const u=n.inclusive?">":">=";e.write(`if (${r} ${u} ${comparisonOperand(t,n.value)}) return INVALID;`)}function generateMultipleOfCheck(e,t,n,r){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new ZodCompileUnsupportedError("multiple_of check with a zero divisor");e.write(`if (${r} % ${n.value}n !== 0n) return INVALID;`)}else{const u=addConstant(t,floatSafeRemainder);e.write(`if (${u}(${r}, ${numericOperand(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function generateNumberFormatCheck(e,t,n){const r=t.format;switch(r){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new ZodCompileUnsupportedError(`number format ${r}`)}}function generateBigIntFormatCheck(e,t,n){const r=t.format;if(r)switch(r){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new ZodCompileUnsupportedError(`bigint format ${r}`)}}function generateMimeTypeCheck(e,t,n,r){const u=n.mime;if(u&&u.length>0){const i=addConstant(t,new Set(u));e.write(`if (!${i}.has(${r}.type)) return INVALID;`)}}function generatePropertiesChecks(e,t,n,r){if(n.when)throw new ZodCompileUnsupportedError('check with a custom "when" condition');e.write(`if (${r} == null) return INVALID;`);const u=n.shape;for(const i of Reflect.ownKeys(u)){const o=typeof i=="symbol"?addConstant(t,i):esc(i),a=newVar(t);e.write(`const ${a} = ${r}[${o}];`),compileChild(e,t,u[i],a,!1)}}function generatePropertyCheck(e,t,n,r){const u=`${r}[${JSON.stringify(n.property)}]`;generateCheck(e,t,n.schema,u)}function generateOverwriteCheck(e,t,n,r,u){const i=n._zod.def.tx;if(!i)throw new ZodCompileUnsupportedError("overwrite check without a transform function");if(isAsyncFunction(i))throw new ZodCompileAsyncError("z.compile: async overwrite transforms are not supported");const o=addConstant(t,i);e.write(`const ${u} = ${o}(${r});`)}function throwAsync(){throw new $ZodAsyncError}function pushIssue(e){this.issues.push(e)}function generateCustomRefineCheck(e,t,n,r){const u=n._zod.def;if(u.fn){if(isAsyncFunction(u.fn))throw new ZodCompileAsyncError("z.compile: async .refine() predicates are not supported");const i=addUserConstant(t,u.fn),o=addConstant(t,throwAsync),a=newVar(t);return e.write(`const ${a} = ${i}(${r});`),e.write(`if (${a} instanceof Promise) ${o}();`),e.write(`if (!${a}) return INVALID;`),r}if(n._zod.check){if(isAsyncFunction(n._zod.check))throw new ZodCompileAsyncError("z.compile: async .superRefine() / check functions are not supported");const i=n._zod.check,a=addUserConstant(t,c=>{const l={value:c,issues:[],addIssue:pushIssue};return i(l)instanceof Promise&&throwAsync(),l.issues.length===0?l.value:INVALID}),s=newVar(t);return e.write(`const ${s} = ${a}(${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}throw new ZodCompileUnsupportedError("custom check without a predicate or check function")}var PATTERN_IS_COMPLETE=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function generateStringFormatCheck(e,t,n,r,u=!0){const i=n.format;if(i==="base64"){const c=addConstant(t,isValidBase64);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="base64url"){const c=addConstant(t,isValidBase64URL);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="jwt"){const c=addConstant(t,isValidJWT),l=addConstant(t,n.alg??null);return e.write(`if (!${c}(${r}, ${l})) return INVALID;`),r}if(i==="ipv6"){const c=addConstant(t,isValidIPv6);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="cidrv6"){const c=addConstant(t,isValidCIDRv6);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="credit_card"){const c=addConstant(t,isValidCreditCard);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(i==="iban"){const c=addConstant(t,isValidIBAN);return e.write(`if (!${c}(${r})) return INVALID;`),r}const o=n;if(i==="url"||i==="httpurl"||o.normalize||o.hostname!==void 0||o.protocol!==void 0){const c=addConstant(t,validateURL),l=addConstant(t,n),d=newVar(t),f=newVar(t);if(e.write(`const ${d} = ${r}.trim();`),e.write(`const ${f} = ${c}(${d}, ${l});`),e.write(`if (typeof ${f} === "number") return INVALID;`),o.hostname!==void 0){const g=addConstant(t,urlHostnameOk);e.write(`if (!${g}(${f}, ${l}.hostname)) return INVALID;`)}if(o.protocol!==void 0){const g=addConstant(t,urlProtocolOk);e.write(`if (!${g}(${f}, ${l}.protocol)) return INVALID;`)}if(!u)return null;const m=newVar(t),h=o.normalize?`${f}.href`:`${addConstant(t,stripTabAndNewline)}(${d})`;return e.write(`const ${m} = ${h};`),m}const a=n.fn;if(a){if(isAsyncFunction(a))throw new ZodCompileUnsupportedError(`async string format ${i}`);const c=addConstant(t,a);return e.write(`if (!${c}(${r})) return INVALID;`),r}if(PATTERN_IS_COMPLETE.has(i)&&n.pattern){const c=addConstant(t,n.pattern);return e.write(`${c}.lastIndex = 0;`),e.write(`if (!${c}.test(${r})) return INVALID;`),r}const s=n.format;switch(s){case"regex":throw new ZodCompileUnsupportedError("regex format without a pattern");case"lowercase":e.write(`if (${r} !== ${r}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${r} !== ${r}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${r}.includes(${esc(n.includes)})) return INVALID;`);break;case"starts_with":{const c=n.prefix;e.write(`if (${r}.slice(0, ${c.length}) !== ${esc(c)}) return INVALID;`);break}case"ends_with":{const c=n.suffix;e.write(`if (${r}.slice(-${c.length}) !== ${esc(c)}) return INVALID;`);break}default:throw new ZodCompileUnsupportedError(`string format ${s}`)}return r}function generateCheck(e,t,n,r,u=!0){const i=n._zod.def,o=i.type;if(i.coerce)throw new ZodCompileUnsupportedError(`coercion (z.coerce.${o}())`);const a=u||!!i.checks?.length;let s;switch(o){case"string":s=generateStringCheck(e,t,n,r,a);break;case"number":s=generateNumberCheck(e,n,r);break;case"boolean":s=generateBooleanCheck(e,r);break;case"bigint":s=generateBigIntCheck(e,n,r);break;case"symbol":s=generateSymbolCheck(e,r);break;case"undefined":s=generateUndefinedCheck(e,r);break;case"null":s=generateNullCheck(e,r);break;case"any":case"unknown":s=r;break;case"never":e.write("return INVALID;"),s=r;break;case"void":s=generateVoidCheck(e,r);break;case"nan":s=generateNaNCheck(e,r);break;case"date":s=generateDateCheck(e,r);break;case"object":s=generateObjectCheck(e,t,n,r,a);break;case"optional":s=generateOptionalCheck(e,t,n,r,a);break;case"nullable":s=generateNullableCheck(e,t,n,r,a);break;case"array":s=generateArrayCheck(e,t,n,r,a);break;case"literal":s=generateLiteralCheck(e,t,n,r);break;case"enum":s=generateEnumCheck(e,t,n,r);break;case"readonly":{const c=generateWrapperCheck(e,t,n,r),l=newVar(t);e.write(`const ${l} = Object.freeze(${c});`),s=l;break}case"success":generateWrapperCheck(e,t,n,r),s="true";break;case"default":case"prefault":s=generateDefaultCheck(e,t,n,r);break;case"nonoptional":s=generateNonOptionalCheck(e,t,n,r);break;case"tuple":s=generateTupleCheck(e,t,n,r);break;case"union":s=generateUnionCheck(e,t,n,r);break;case"intersection":s=generateIntersectionCheck(e,t,n,r);break;case"record":s=generateRecordCheck(e,t,n,r);break;case"map":s=generateMapCheck(e,t,n,r);break;case"set":s=generateSetCheck(e,t,n,r);break;case"file":s=generateFileCheck(e,r);break;case"template_literal":s=generateTemplateLiteralCheck(e,t,n,r);break;case"lazy":s=generateLazyCheck(e,t,n,r);break;case"pipe":s=generatePipeCheck(e,t,n,r);break;case"custom":s=generateCustomCheck(e,t,n,r);break;case"transform":s=generateTransformCheck(e,t,n,r);break;case"catch":s=generateCatchCheck(e,t,n,r);break;default:throw new ZodCompileUnsupportedError(`schema type ${o}`)}return s===null?null:generateChecks(e,t,n,s)}function generateStringCheck(e,t,n,r,u=!0){e.write(`if (typeof ${r} !== "string") return INVALID;`);const i=n._zod.def;return i.format===void 0?r:generateStringFormatCheck(e,t,i,r,u)}function generateNumberCheck(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);const r=t._zod.def;return r.check==="number_format"&&r.format&&generateNumberFormatCheck(e,{format:r.format},n),n}function generateBooleanCheck(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function generateBigIntCheck(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);const r=t._zod.def;if(r.format)switch(r.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function generateSymbolCheck(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function generateUndefinedCheck(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function generateNullCheck(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function generateVoidCheck(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function generateNaNCheck(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function generateDateCheck(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function generateObjectCheck(e,t,n,r,u=!0){const i=n._zod.def;e.write(`if (typeof ${r} !== "object" || ${r} === null || Array.isArray(${r})) return INVALID;`);const o=i.shape,a=Object.keys(o),s=Object.getOwnPropertySymbols(o),c=s.length?[...a,...s]:a,l=p=>typeof p=="symbol"?addConstant(t,p):esc(p),d=p=>typeof p=="symbol"?`[${l(p)}]`:esc(p),f=o;if(a.includes("__proto__"))throw new ZodCompileUnsupportedError('object shape key "__proto__"');const m=new Map;for(const p of c){const v=f[p],y=l(p),A=newVar(t);if(e.write(`const ${A} = ${r}[${y}];`),v._zod.optin!==void 0){const b=newVar(t);e.write(`let ${b} = (() => {`),e.indented(x=>{const B=compileChild(x,t,v,A);x.write(`return ${B};`)}),e.write("})();"),v._zod.optout==="optional"?(e.write(`if (${b} === INVALID) {`),e.indented(x=>{x.write(`if (${y} in ${r}) return INVALID;`),x.write(`${b} = undefined;`)}),e.write("}")):e.write(`if (${b} === INVALID) return INVALID;`),m.set(p,b)}else{requiresPresenceCheck(v)&&e.write(`if (!(${y} in ${r})) return INVALID;`);const b=compileChild(e,t,v,A,u);b!==null&&m.set(p,b)}}const h=i.catchall;let g="none";if(h){const p=h._zod.def.type;if(p==="never"){const v=a.map(y=>`k !== ${esc(y)}`).join(" && ")||"true";e.write(`for (const k in ${r}) {`),e.indented(y=>{y.write(`if (${v}) return INVALID;`)}),e.write("}")}else(p==="unknown"||p==="any")&&!h._zod.def.checks?.length?g="passthrough":g="schema"}const E=newVar(t),D=c.some(p=>mayOmitUndefined(f[p])||dropsWhenAbsent(f[p]));if(!u){if(g==="schema"){const p=a.length>0?addConstant(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented(v=>{v.write('if (k === "__proto__") continue;'),p&&v.write(`if (${p}.has(k)) continue;`);const y=newVar(t);v.write(`const ${y} = ${r}[k];`),compileChild(v,t,h,y,!1)}),e.write("}")}return null}if(D){e.write(`const ${E} = {};`);for(const p of c){const v=l(p),y=m.get(p);dropsWhenAbsent(f[p])?e.write(`if (${v} in ${r}) ${E}[${v}] = ${y};`):mayOmitUndefined(f[p])?e.write(`if (${y} !== undefined || ${v} in ${r}) ${E}[${v}] = ${y};`):e.write(`${E}[${v}] = ${y};`)}}else{const p=c.map(v=>`${d(v)}: ${m.get(v)}`).join(", ");e.write(`const ${E} = { ${p} };`)}if(g!=="none"){const p=a.length>0?addConstant(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented(v=>{if(v.write('if (k === "__proto__") continue;'),p&&v.write(`if (${p}.has(k)) continue;`),g==="passthrough")v.write(`${E}[k] = ${r}[k];`);else{const y=newVar(t);v.write(`const ${y} = ${r}[k];`);const A=compileChild(v,t,h,y);v.write(`${E}[k] = ${A};`)}}),e.write("}")}return E}function generateOptionalCheck(e,t,n,r,u=!0){const i=n._zod.def;if(isExactOptional(n))return generateCheck(e,t,i.innerType,r,u);if(i.innerType._zod.optin==="defaulted"){const a=newVar(t),s=newVar(t);return e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(c=>{c.write(`const ${s} = (() => {`),c.indented(l=>{const d=generateCheck(l,t,i.innerType,r);l.write(`return ${d};`)}),c.write("})();"),c.write(`if (${s} !== INVALID) ${a} = ${s};`)}),e.write("} else {"),e.indented(c=>{const l=generateCheck(c,t,i.innerType,r);c.write(`${a} = ${l};`)}),e.write("}"),a}const o=u?newVar(t):null;return o&&e.write(`let ${o};`),e.write(`if (${r} !== undefined) {`),e.indented(a=>{const s=generateCheck(a,t,i.innerType,r,u);o&&s!==null&&a.write(`${o} = ${s};`)}),e.write("}"),o}function isExactOptional(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function requiresPresenceCheck(e){return e._zod.optin===void 0&&fastPathAcceptsAbsence(e)}function fastPathAcceptsAbsence(e){if(e._zod.def.coerce)return!0;const t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?fastPathAcceptsAbsence(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?fastPathAcceptsAbsence(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(fastPathAcceptsAbsence):!0;case"intersection":return!t.left||!t.right?!0:fastPathAcceptsAbsence(t.left)&&fastPathAcceptsAbsence(t.right);case"pipe":return t.in?fastPathAcceptsAbsence(t.in):!0;default:return!0}}function dropsWhenAbsent(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function mayOmitUndefined(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&mayOutputUndefined(e)}function mayOutputUndefined(e){const t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?mayOutputUndefined(t.innerType):!0;case"union":return t.options?t.options.some(mayOutputUndefined):!0;case"intersection":return!t.left||!t.right||mayOutputUndefined(t.left)||mayOutputUndefined(t.right);case"pipe":return t.out?mayOutputUndefined(t.out):!0;default:return!0}}function generateNullableCheck(e,t,n,r,u=!0){const i=n._zod.def,o=u?newVar(t):null;return o&&e.write(`let ${o} = null;`),e.write(`if (${r} !== null) {`),e.indented(a=>{const s=generateCheck(a,t,i.innerType,r,u);o&&s!==null&&a.write(`${o} = ${s};`)}),e.write("}"),o}function generateSizeGate(e,t,n){for(const[r,u]of sizeCaps(t._zod.def.checks))e.write(`if (${n} > ${numericOperand(r,u._zod.def.check)}) return INVALID;`)}function generateArrayCheck(e,t,n,r,u=!0){const i=n._zod.def;e.write(`if (!Array.isArray(${r})) return INVALID;`),generateSizeGate(e,n,`${r}.length`);const o=u?newVar(t):null,a=newVar(t),s=newVar(t);return o&&e.write(`const ${o} = new Array(${r}.length);`),e.write(`for (let ${a} = 0; ${a} < ${r}.length; ${a}++) {`),e.indented(c=>{c.write(`const ${s} = ${r}[${a}];`);const l=compileChild(c,t,i.element,s,u);o&&l!==null&&c.write(`${o}[${a}] = ${l};`)}),e.write("}"),o}function generateLiteralCheck(e,t,n,r){const i=n._zod.def.values;if(i.length!==1){const a=addConstant(t,new Set(i));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}const o=i[0];if(typeof o=="number"&&Number.isNaN(o)){const a=addConstant(t,new Set(i));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}if(typeof o=="string")e.write(`if (${r} !== ${esc(o)}) return INVALID;`);else if(typeof o=="number"||typeof o=="boolean")e.write(`if (${r} !== ${o}) return INVALID;`);else if(o===null)e.write(`if (${r} !== null) return INVALID;`);else if(o===void 0)e.write(`if (${r} !== undefined) return INVALID;`);else if(typeof o=="bigint")e.write(`if (${r} !== ${o}n) return INVALID;`);else throw new ZodCompileUnsupportedError(`literal type ${typeof o}`);return r}function generateEnumCheck(e,t,n,r){const u=n._zod.values;if(!u)throw new ZodCompileUnsupportedError("enum schema without enumerated values");const i=addConstant(t,u);return e.write(`if (!${i}.has(${r})) return INVALID;`),r}function generateWrapperCheck(e,t,n,r){const u=n._zod.def;return generateCheck(e,t,u.innerType,r)}function generateDefaultCheck(e,t,n,r){const u=n._zod.def,o=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!o)return generateCheck(e,t,u.innerType,r);const s=addConstant(t,o),c=newVar(t);return e.write(`let ${c} = ${r};`),e.write(`if (${r} === undefined) ${c} = ${s}();`),generateCheck(e,t,u.innerType,c)}const a=newVar(t);if(o){const s=addConstant(t,o),c=addConstant(t,shallowClone);e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(l=>{l.write(`${a} = ${c}(${s}());`)}),e.write("} else {"),e.indented(l=>{const d=generateCheck(l,t,u.innerType,r);l.write(`${a} = ${d} === undefined ? ${c}(${s}()) : ${d};`)}),e.write("}")}else e.write(`let ${a};`),e.write(`if (${r} !== undefined) {`),e.indented(s=>{const c=generateCheck(s,t,u.innerType,r);s.write(`${a} = ${c};`)}),e.write("}");return a}function generateNonOptionalCheck(e,t,n,r){const u=n._zod.def,i=generateCheck(e,t,u.innerType,r),o=newVar(t);return e.write(`const ${o} = ${i};`),e.write(`if (${o} === undefined) return INVALID;`),o}function generateTupleCheck(e,t,n,r){const u=n._zod.def,i=u.items,o=u.rest;e.write(`if (!Array.isArray(${r})) return INVALID;`);const a=getTupleOptStart2(i,"optin"),s=getTupleOptStart2(i,"optout");o?e.write(`if (${r}.length < ${a}) return INVALID;`):e.write(`if (${r}.length < ${a} || ${r}.length > ${i.length}) return INVALID;`);const c=newVar(t);e.write(`const ${c} = [];`);for(let l=0;l<i.length;l++){const d=i[l];if(l>=s)e.write(`if (${c}.length === ${l}) {`),e.indented(f=>{f.write(`if (${l} < ${r}.length) {`),f.indented(m=>{const h=newVar(t);m.write(`const ${h} = ${r}[${l}];`);const g=compileChild(m,t,d,h);m.write(`${c}[${l}] = ${g};`)}),f.write("} else {"),f.indented(m=>{if(dropsWhenAbsent(d)){m.write(`${c}.length = ${l};`);return}const h=newVar(t),g=newVar(t);m.write(`const ${h} = undefined;`),m.write(`const ${g} = (() => {`),m.indented(E=>{const D=compileChild(E,t,d,h);E.write(`return ${D};`)}),m.write("})();"),m.write(`if (${g} === INVALID || ${g} === undefined) ${c}.length = ${l};`),m.write(`else ${c}[${l}] = ${g};`)}),f.write("}")}),e.write("}");else{const f=newVar(t);e.write(`const ${f} = ${r}[${l}];`);const m=compileChild(e,t,d,f);e.write(`${c}[${l}] = ${m};`)}}if(o){const l=newVar(t),d=newVar(t);e.write(`for (let ${l} = ${i.length}; ${l} < ${r}.length; ${l}++) {`),e.indented(f=>{f.write(`const ${d} = ${r}[${l}];`);const m=compileChild(f,t,o,d);f.write(`${c}[${l}] = ${m};`)}),e.write("}")}return c}function getTupleOptStart2(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function generateUnionCheck(e,t,n,r){const u=n._zod.def,i=u.options;if(u.discriminator)return generateDiscriminatedUnionCheck(e,t,u,r);if(u.inclusive===!1)throw new ZodCompileUnsupportedError("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),r;if(i.length===1)return generateCheck(e,t,i[0],r);if(i.every(s=>s._zod.def.type==="literal"&&!s._zod.def.checks?.length)){const s=new Set(i.flatMap(l=>l._zod.def.values)),c=addConstant(t,s);return e.write(`if (!${c}.has(${r})) return INVALID;`),r}const a=newVar(t);e.write(`let ${a};`);for(let s=0;s<i.length;s++){const c=i[s];s===0?e.write(`${a} = (() => {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(l=>{const d=generateCheck(l,t,c,r);l.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${a} === INVALID) return INVALID;`),a}function generateDiscriminatedUnionCheck(e,t,n,r){if(n.unionFallback)throw new ZodCompileUnsupportedError("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),r;const u=newVar(t),i=newVar(t);e.write(`const ${u} = ${r}?.[${esc(n.discriminator)}];`),e.write(`let ${i};`);let o=!0;const a=new Set;for(const s of n.options){const c=s._zod.propValues?.[n.discriminator];if(!c||c.size===0)throw new ZodCompileUnsupportedError("discriminated union option without static discriminator values");for(const f of c){if(a.has(f))throw new ZodCompileUnsupportedError(`duplicate discriminator value ${String(f)}`);a.add(f)}const l=Array.from(c,f=>literalEquality(t,u,f)),d=o?"if":"else if";e.write(`${d} (${l.join(" || ")}) {`),e.indented(f=>{const m=generateCheck(f,t,s,r);f.write(`${i} = ${m};`)}),e.write("}"),o=!1}return e.write("else { return INVALID; }"),i}function literalEquality(e,t,n){if(typeof n=="string")return`${t} === ${esc(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){const r=addConstant(e,n);return`${t} === ${r}`}throw new ZodCompileUnsupportedError(`literal discriminator value ${String(n)}`)}function generateIntersectionCheck(e,t,n,r){const u=n._zod.def;t.definite=!1;const i=compileChild(e,t,u.left,r),o=compileChild(e,t,u.right,r),a=addConstant(t,mergeValues),s=newVar(t);return e.write(`const ${s} = ${a}(${i}, ${o});`),e.write(`if (!${s}.valid) return INVALID;`),`${s}.data`}function generateRecordCheck(e,t,n,r){const u=n._zod.def,i=addConstant(t,isPlainObject);e.write(`if (!${i}(${r})) return INVALID;`);const o=newVar(t),a=newVar(t),s=newVar(t);e.write(`const ${o} = {};`);const c=u,l=c.partial?void 0:u.keyType._zod.values;if(l){const m=[];for(const g of l){if(!(typeof g=="string"||typeof g=="number"||typeof g=="symbol"))throw new ZodCompileUnsupportedError(`record key value ${String(g)}`);const E=typeof g=="number"?g.toString():g;if(E==="__proto__")throw new ZodCompileUnsupportedError('record key "__proto__"');m.push(E);const D=addConstant(t,g),p=generateCheck(e,t,u.keyType,D),v=newVar(t);e.write(`const ${v} = ${r}[${literalPropertyKey(t,E)}];`);const y=compileChild(e,t,u.valueType,v);e.write(`${o}[${p}] = ${y};`)}const h=addConstant(t,new Set(m));return e.write(`for (const ${a} in ${r}) {`),e.indented(g=>{g.write(`if (${h}.has(${a})) continue;`),c.mode==="loose"?g.write(`if (${a} !== "__proto__") ${o}[${a}] = ${r}[${a}];`):g.write("return INVALID;")}),e.write("}"),o}const d=u.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){const m=u.mode==="loose",h=compileFn(u.keyType);h.definite===!1&&(t.definite=!1);const g=addConstant(t,h),E=addConstant(t,number),D=newVar(t);return emitOwnKeys(e,t,r,a,p=>{p.write(`let ${D} = ${g}(${a});`),p.write(`if (${D} === INVALID && typeof ${a} === "string" && ${E}.test(${a})) ${D} = ${g}(Number(${a}));`),m?p.write(`if (${D} === INVALID) { ${o}[${a}] = ${r}[${a}]; continue; }`):p.write(`if (${D} === INVALID) return INVALID;`),p.write(`if (${D} === "__proto__") continue;`);const v=newVar(t);p.write(`const ${v} = ${r}[${a}];`);const y=compileChild(p,t,u.valueType,v);p.write(`${o}[${D}] = ${y};`)}),o}return emitOwnKeys(e,t,r,a,m=>{m.write(`const ${s} = ${r}[${a}];`);const h=compileChild(m,t,u.valueType,s);m.write(`${o}[${a}] = ${h};`)},"return INVALID;"),o}function emitOwnKeys(e,t,n,r,u,i){const o=addConstant(t,Object.prototype.propertyIsEnumerable),a=newVar(t),s=newVar(t),c=newVar(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${n});`),e.write(`const ${s} = Object.getOwnPropertyNames(${n});`),e.write(`for (let ${c} = 0; ${c} < ${s}.length; ${c}++) {`),e.indented(l=>{l.write(`const ${r} = ${s}[${c}];`),l.write(`if (${r} === "__proto__" || !${o}.call(${n}, ${r})) continue;`),u(l)}),e.write("}"),e.write(`for (let ${c} = 0; ${c} < ${a}.length; ${c}++) {`),e.indented(l=>{l.write(`const ${r} = ${a}[${c}];`),l.write(`if (!${o}.call(${n}, ${r})) continue;`),i?l.write(i):u(l)}),e.write("}")}function literalPropertyKey(e,t){return typeof t=="string"?esc(t):addConstant(e,t)}function generateMapCheck(e,t,n,r){const u=n._zod.def;e.write(`if (!(${r} instanceof Map)) return INVALID;`),generateSizeGate(e,n,`${r}.size`);const i=newVar(t),o=newVar(t),a=newVar(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${o}, ${a}] of ${r}) {`),e.indented(s=>{const c=generateCheck(s,t,u.keyType,o),l=generateCheck(s,t,u.valueType,a);s.write(`${i}.set(${c}, ${l});`)}),e.write("}"),i}function generateSetCheck(e,t,n,r){const u=n._zod.def;e.write(`if (!(${r} instanceof Set)) return INVALID;`),generateSizeGate(e,n,`${r}.size`);const i=newVar(t),o=newVar(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${o} of ${r}) {`),e.indented(a=>{const s=generateCheck(a,t,u.valueType,o);a.write(`${i}.add(${s});`)}),e.write("}"),i}function generateFileCheck(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function generateTemplateLiteralCheck(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);const u=n._zod.pattern;if(u){const i=addConstant(t,u);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${r})) return INVALID;`)}return r}function generateLazyCheck(e,t,n,r){const u=n._zod.def,i=addUserConstant(t,u.getter),o=addConstant(t,{parser:null});e.write(`if (!${o}.parser) {`),e.indented(s=>{s.write(`const inner = ${i}();`),s.write(`${o}.parser = function(input) {`),s.indented(c=>{c.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),c.write("return result.issues.length === 0 ? result.value : INVALID;")}),s.write("};")}),e.write("}");const a=newVar(t);return e.write(`const ${a} = ${o}.parser(${r});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function generatePipeCheck(e,t,n,r){const u=n._zod.def,i=generateCheck(e,t,u.in,r);if(u.transform){if(isAsyncFunction(u.transform))throw new ZodCompileAsyncError("z.compile: async transforms in pipes are not supported");const o=u.transform,s=addUserConstant(t,l=>{const d={value:l,issues:[],addIssue:pushIssue},f=o(l,d);return f instanceof Promise?INVALID:d.issues.length===0?f:INVALID}),c=newVar(t);return e.write(`const ${c} = ${s}(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),generateCheck(e,t,u.out,c)}else return generateCheck(e,t,u.out,i)}function isAsyncFunction(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function generateCustomCheck(e,t,n,r){const u=n._zod.def;if(u.fn){if(isAsyncFunction(u.fn))throw new ZodCompileAsyncError("z.compile: async custom predicates are not supported");const i=addUserConstant(t,u.fn),o=addConstant(t,throwAsync),a=newVar(t);e.write(`const ${a} = ${i}(${r});`),e.write(`if (${a} instanceof Promise) ${o}();`),e.write(`if (!${a}) return INVALID;`)}else throw new ZodCompileUnsupportedError("custom schema without a predicate function");return r}function runtimeCatch(e,t,n){const r=e._zod.run({value:n,issues:[]},{});if(r&&typeof r.then=="function")return INVALID;const u=r;return u.issues.length===0?u.value:t()}function generateCatchCheck(e,t,n,r){const u=n._zod.def;if(!u.catchValue[CONSTANT_CATCH])throw new ZodCompileUnsupportedError("catch with a callback (only a constant catch value compiles)",!1);const i=newVar(t);e.write(`let ${i} = (() => {`),e.indented(c=>{const l=compileChild(c,t,u.innerType,r);c.write(`return ${l};`)}),e.write("})();");const o=addConstant(t,u.innerType),a=addUserConstant(t,u.catchValue),s=addConstant(t,runtimeCatch);return e.write(`if (${i} === INVALID) {`),e.indented(c=>{c.write(`${i} = ${s}(${o}, ${a}, ${r});`),c.write(`if (${i} === INVALID) return INVALID;`)}),e.write("}"),i}function generateTransformCheck(e,t,n,r){const u=n._zod.def;if(u.transform){if(isAsyncFunction(u.transform))throw new ZodCompileAsyncError("z.compile: async transforms are not supported");const i=u.transform,a=addUserConstant(t,c=>{const l={value:c,issues:[],addIssue:pushIssue},d=i(c,l);return d instanceof Promise?INVALID:l.issues.length===0?d:INVALID}),s=newVar(t);return e.write(`const ${s} = ${a}(${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}return r}function snapshotChecks(e){return e.checks&&(e.checks=[...e.checks]),e}function _string(e,t){return new e(snapshotChecks({type:"string",...normalizeParams(t)}))}function _coercedString(e,t){return new e(snapshotChecks({type:"string",coerce:!0,...normalizeParams(t)}))}function _email(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...normalizeParams(t)})}function _guid(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...normalizeParams(t)})}function _uuid(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...normalizeParams(t)})}function _uuidv4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...normalizeParams(t)})}function _uuidv6(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...normalizeParams(t)})}function _uuidv7(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...normalizeParams(t)})}function _url(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...normalizeParams(t)})}function _emoji2(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...normalizeParams(t)})}function _nanoid(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...normalizeParams(t)})}function _cuid(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...normalizeParams(t)})}function _cuid2(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...normalizeParams(t)})}function _ulid(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...normalizeParams(t)})}function _xid(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...normalizeParams(t)})}function _ksuid(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...normalizeParams(t)})}function _ipv4(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...normalizeParams(t)})}function _ipv6(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...normalizeParams(t)})}function _mac(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...normalizeParams(t)})}function _cidrv4(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...normalizeParams(t)})}function _cidrv6(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...normalizeParams(t)})}function _base64(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...normalizeParams(t)})}function _base64url(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...normalizeParams(t)})}function _e164(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...normalizeParams(t)})}function _creditCard(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...normalizeParams(t)})}function _iban(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...normalizeParams(t)})}function _jwt(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...normalizeParams(t)})}var TimePrecision={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function _isoDateTime(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...normalizeParams(t)})}function _isoDate(e,t){return new e({type:"string",format:"date",check:"string_format",...normalizeParams(t)})}function _isoTime(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...normalizeParams(t)})}function _isoDuration(e,t){return new e({type:"string",format:"duration",check:"string_format",...normalizeParams(t)})}function _number(e,t){return new e(snapshotChecks({type:"number",checks:[],...normalizeParams(t)}))}function _coercedNumber(e,t){return new e(snapshotChecks({type:"number",coerce:!0,checks:[],...normalizeParams(t)}))}function _int(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...normalizeParams(t)})}function _float32(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...normalizeParams(t)})}function _float64(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...normalizeParams(t)})}function _int32(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...normalizeParams(t)})}function _uint32(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...normalizeParams(t)})}function _boolean(e,t){return new e({type:"boolean",...normalizeParams(t)})}function _coercedBoolean(e,t){return new e({type:"boolean",coerce:!0,...normalizeParams(t)})}function _bigint(e,t){return new e({type:"bigint",...normalizeParams(t)})}function _coercedBigint(e,t){return new e({type:"bigint",coerce:!0,...normalizeParams(t)})}function _int64(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...normalizeParams(t)})}function _uint64(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...normalizeParams(t)})}function _symbol(e,t){return new e({type:"symbol",...normalizeParams(t)})}function _undefined2(e,t){return new e({type:"undefined",...normalizeParams(t)})}function _null2(e,t){return new e({type:"null",...normalizeParams(t)})}function _any(e){return new e({type:"any"})}function _unknown(e){return new e({type:"unknown"})}function _never(e,t){return new e({type:"never",...normalizeParams(t)})}function _void(e,t){return new e({type:"void",...normalizeParams(t)})}function _date(e,t){return new e({type:"date",...normalizeParams(t)})}function _coercedDate(e,t){return new e({type:"date",coerce:!0,...normalizeParams(t)})}function _nan(e,t){return new e({type:"nan",...normalizeParams(t)})}function _lt(e,t){return new $ZodCheckLessThan({check:"less_than",...normalizeParams(t),value:e,inclusive:!1})}function _lte(e,t){return new $ZodCheckLessThan({check:"less_than",...normalizeParams(t),value:e,inclusive:!0})}function _gt(e,t){return new $ZodCheckGreaterThan({check:"greater_than",...normalizeParams(t),value:e,inclusive:!1})}function _gte(e,t){return new $ZodCheckGreaterThan({check:"greater_than",...normalizeParams(t),value:e,inclusive:!0})}function _positive(e){return _gt(0,e)}function _negative(e){return _lt(0,e)}function _nonpositive(e){return _lte(0,e)}function _nonnegative(e){return _gte(0,e)}function _multipleOf(e,t){return new $ZodCheckMultipleOf({check:"multiple_of",...normalizeParams(t),value:e})}function _maxSize(e,t){return new $ZodCheckMaxSize({check:"max_size",...normalizeParams(t),maximum:e})}function _minSize(e,t){return new $ZodCheckMinSize({check:"min_size",...normalizeParams(t),minimum:e})}function _size(e,t){return new $ZodCheckSizeEquals({check:"size_equals",...normalizeParams(t),size:e})}function _maxLength(e,t){return new $ZodCheckMaxLength({check:"max_length",...normalizeParams(t),maximum:e})}function _minLength(e,t){return new $ZodCheckMinLength({check:"min_length",...normalizeParams(t),minimum:e})}function _length(e,t){return new $ZodCheckLengthEquals({check:"length_equals",...normalizeParams(t),length:e})}function _regex(e,t){return new $ZodCheckRegex({check:"string_format",format:"regex",...normalizeParams(t),pattern:e})}function _lowercase(e){return new $ZodCheckLowerCase({check:"string_format",format:"lowercase",...normalizeParams(e)})}function _uppercase(e){return new $ZodCheckUpperCase({check:"string_format",format:"uppercase",...normalizeParams(e)})}function _includes(e,t){return new $ZodCheckIncludes({check:"string_format",format:"includes",...normalizeParams(t),includes:e})}function _startsWith(e,t){return new $ZodCheckStartsWith({check:"string_format",format:"starts_with",...normalizeParams(t),prefix:e})}function _endsWith(e,t){return new $ZodCheckEndsWith({check:"string_format",format:"ends_with",...normalizeParams(t),suffix:e})}function _property(e,t,n){return new $ZodCheckProperty({check:"property",property:e,schema:t,...normalizeParams(n)})}function _properties(e,t){return new $ZodCheckProperties({check:"properties",shape:e,...normalizeParams(t)})}function _mime(e,t){return new $ZodCheckMimeType({check:"mime_type",mime:e,...normalizeParams(t)})}function _overwrite(e){return new $ZodCheckOverwrite({check:"overwrite",tx:e})}function _normalize(e){return _overwrite(t=>t.normalize(e))}function _trim(){return _overwrite(e=>e.trim())}function _toLowerCase(){return _overwrite(e=>e.toLowerCase())}function _toUpperCase(){return _overwrite(e=>e.toUpperCase())}function _slugify(){return _overwrite(e=>slugify(e))}function _array(e,t,n){return new e({type:"array",element:t,...normalizeParams(n)})}function _union(e,t,n){return new e({type:"union",options:t,...normalizeParams(n)})}function _xor(e,t,n){return new e({type:"union",options:t,inclusive:!1,...normalizeParams(n)})}function _discriminatedUnion(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...normalizeParams(r)})}function _intersection(e,t,n){return new e({type:"intersection",left:t,right:n})}function _tuple(e,t,n,r){const u=n instanceof $ZodType,i=u?r:n,o=u?n:null;return new e({type:"tuple",items:t,rest:o,...normalizeParams(i)})}function _record(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...normalizeParams(r)})}function _map(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...normalizeParams(r)})}function _set(e,t,n){return new e({type:"set",valueType:t,...normalizeParams(n)})}function _enum(e,t,n){const r=Array.isArray(t)?Object.fromEntries(t.map(u=>[u,u])):t;return new e({type:"enum",entries:r,...normalizeParams(n)})}function _nativeEnum(e,t,n){return new e({type:"enum",entries:t,...normalizeParams(n)})}function _literal(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...normalizeParams(n)})}function _file(e,t){return new e({type:"file",...normalizeParams(t)})}function _transform(e,t){return new e({type:"transform",transform:t})}function _optional(e,t){return new e({type:"optional",innerType:t})}function _nullable(e,t){return new e({type:"nullable",innerType:t})}function _default(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():shallowClone(n)}})}function _nonoptional(e,t,n){return new e({type:"nonoptional",innerType:t,...normalizeParams(n)})}function _success(e,t){return new e({type:"success",innerType:t})}function _catch(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:constantCatch(n)})}function _pipe(e,t,n){return new e({type:"pipe",in:t,out:n})}function _readonly(e,t){return new e({type:"readonly",innerType:t})}function _templateLiteral(e,t,n){return new e({type:"template_literal",parts:t,...normalizeParams(n)})}function _lazy(e,t){return new e({type:"lazy",getter:t})}function _promise(e,t){return new e({type:"promise",innerType:t})}function _custom(e,t,n){const r=normalizeParams(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function _refine(e,t,n){return new e({type:"custom",check:"custom",fn:t,...normalizeParams(n)})}function _superRefine(e,t){const n=_check(r=>(r.addIssue=u=>{if(typeof u=="string")r.issues.push(issue(u,r.value,n._zod.def));else{const i=u;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(issue(i))}},e(r.value,r)),t);return n}function _check(e,t){const n=new $ZodCheck({check:"custom",...normalizeParams(t)});return n._zod.check=e,n}function describe(e){const t=new $ZodCheck({check:"describe"});return t._zod.onattach=[n=>{const r=globalRegistry.get(n)??{};globalRegistry.add(n,{...r,description:e})}],t._zod.check=()=>{},t}function meta(e){const t=new $ZodCheck({check:"meta"});return t._zod.onattach=[n=>{const r=globalRegistry.get(n)??{};globalRegistry.add(n,{...r,...e})}],t._zod.check=()=>{},t}function _stringbool(e,t){const n=normalizeParams(t);let r=n.truthy??["true","1","yes","on","y","enabled"],u=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(r=r.map(m=>typeof m=="string"?m.toLowerCase():m),u=u.map(m=>typeof m=="string"?m.toLowerCase():m));const i=new Set(r),o=new Set(u),a=e.Codec??$ZodCodec,s=e.Boolean??$ZodBoolean,c=e.String??$ZodString,l=new c({type:"string",error:n.error}),d=new s({type:"boolean",error:n.error}),f=new a({type:"pipe",in:l,out:d,transform:((m,h)=>{let g=m;return n.case!=="sensitive"&&(g=g.toLowerCase()),i.has(g)?!0:o.has(g)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...o],input:h.value,inst:f,continue:!1}),{})}),reverseTransform:((m,h)=>m===!0?r[0]||"true":u[0]||"false"),error:n.error});return f._zod.bag.truthy=r,f._zod.bag.falsy=u,f._zod.bag.case=n.case??"insensitive",f}function _stringFormat(e,t,n,r={}){const u=normalizeParams(r),i={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...u};return n instanceof RegExp&&(i.pattern=n),new e(i)}function assignProps(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&assignProp(e,r,n[r]);return e}function initializeContext(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??globalRegistry,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function handleUnrepresentable(e,t,n,r,u){const i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:u}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(u);return Object.assign(n,i),!0}function processSchema(e,t,n={path:[],schemaPath:[]}){var r;const u=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,l);else{const f=o.schema,m=t.processors[u.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);m(e,t,f,l)}const d=e._zod.parent;d&&(o.ref||(o.ref=d),processSchema(d,t,l),t.seen.get(d).isParent=!0)}const s=t.metadataRegistry.get(e);return s&&assignProps(o.schema,s),t.io==="input"&&isTransforming(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function encodeJSONPointerSegment(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function extractDefs(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const o of e.seen.entries()){const a=e.metadataRegistry.get(o[0])?.id;if(a){const s=r.get(a);if(s&&s!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,o[0])}}const u=o=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(o[0])?.id,f=e.external.uri??(h=>h);if(d)return{ref:f(d)};const m=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=m,{defId:m,ref:`${f("__shared")}#/${a}/${encodeJSONPointerSegment(m)}`}}const s="#",c=`${s}/${a}/`;if(o[1]===n&&!o[1].schema.id)return{ref:s};const l=o[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:c+encodeJSONPointerSegment(l)}},i=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:s,defId:c}=u(o);a.def={...a.schema},c&&(a.defId=c);const l=a.schema;for(const d in l)delete l[d];l.$ref=s};if(e.cycles==="throw")for(const o of e.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
65
-
66
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const a=o[1];if(t===o[0]){i(o);continue}if(e.external){const c=e.external.registry.get(o[0])?.id;if(t!==o[0]&&c){i(o);continue}}if(e.metadataRegistry.get(o[0])?.id){i(o);continue}if(a.cycle){i(o);continue}a.count>1&&e.reused==="ref"&&i(o)}e.external&&(e.sharedDefsExtractedFor=e.external)}function compactTypeUnion(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;compactTypeUnion(r);const u=Object.keys(r);if(u.length!==1||u[0]!=="type")return;const i=r.type;for(const o of Array.isArray(i)?i:[i]){if(typeof o!="string")return;n.includes(o)||n.push(o)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var FOLDABLE_KEYS=new Set(["type","properties","required","additionalProperties"]),UNION_KEYS=["oneOf","anyOf"];function undeclaredConstraint(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function foldObjects(e){const t=[];for(const i of e){if(typeof i!="object"||i.type!=="object")return null;for(const o in i)if(!FOLDABLE_KEYS.has(o))return null;t.push(i)}const n={},r=new Set;for(const i of t){for(const o in i.properties){if(Object.prototype.hasOwnProperty.call(n,o))continue;const a=[];for(const c of t){const l=c.properties?.[o]??undeclaredConstraint(c);l!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(l))||a.push(l))}const s=a.length===1?a[0]:foldObjects(a)??{allOf:a};assignProp(n,o,s)}for(const o of i.required??[])r.add(o)}const u={type:"object",properties:n};if(r.size&&(u.required=[...r]),t.every(i=>i.additionalProperties===!1))u.additionalProperties=!1;else{const i=[];for(const o of t){const a=undeclaredConstraint(o);a&&!i.some(s=>JSON.stringify(s)===JSON.stringify(a))&&i.push(a)}i.length===1?u.additionalProperties=i[0]:i.length>1&&(u.additionalProperties={allOf:i})}return u}function foldIntersection(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const u of FOLDABLE_KEYS)if(u in e)return;const n=t.filter(u=>UNION_KEYS.some(i=>Array.isArray(u[i])));let r=null;if(!n.length)r=foldObjects(t);else{const u=n[0],i=UNION_KEYS.find(s=>Array.isArray(u[s]));if(Object.keys(u).length!==1)return;const o=t.filter(s=>s!==u),a=u[i].map(s=>foldObjects([...o,s]));if(a.some(s=>!s))return;r={[i]:a}}r&&(delete e.allOf,assignProps(e,r))}function finalize(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const s=e.seen.get(a);if(s.ref===null)return;const c=s.def??s.schema,l={...c},d=s.ref;if(s.ref=null,d){r(d);const m=e.seen.get(d),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(h)):assignProps(c,h),assignProps(c,l),a._zod.parent===d)for(const E in c)E==="$ref"||E==="allOf"||E in l||delete c[E];if(h.$ref&&m.def)for(const E in c)E==="$ref"||E==="allOf"||E in m.def&&JSON.stringify(c[E])===JSON.stringify(m.def[E])&&delete c[E]}const f=a._zod.parent;if(f&&f!==d){r(f);const m=e.seen.get(f);if(m?.schema.$ref&&(c.$ref=m.schema.$ref,m.def))for(const h in c)h==="$ref"||h==="allOf"||h in m.def&&JSON.stringify(c[h])===JSON.stringify(m.def[h])&&delete c[h]}e.override({zodSchema:a,jsonSchema:c,path:s.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const a of[...e.seen.entries()].reverse())r(a[0]);if(e.target!=="openapi-3.0")for(const a of e.seen.entries())compactTypeUnion(a[1].def??a[1].schema);for(const a of e.deferred)a();if(e.intersections.length){const a=new Map;for(const s of e.seen.values())for(const c of[s.schema,s.def]){const l=c?.allOf;if(!Array.isArray(l))continue;const d=a.get(l);d?d.push(c):a.set(l,[c])}for(const s of e.intersections)for(const c of a.get(s)??[])foldIntersection(c)}}const u={};if(e.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?u.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?u.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");u.$id=e.external.uri(a)}assignProps(u,n.defId?n.schema:n.def??n.schema);const i=e.metadataRegistry.get(t)?.id;i!==void 0&&u.id===i&&delete u.id;const o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const a of e.seen.entries()){const s=a[1];s.def&&s.defId&&(s.def.id===s.defId&&delete s.def.id,assignProp(o,s.defId,s.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?u.$defs=o:u.definitions=o);try{const a=JSON.parse(JSON.stringify(u));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:createStandardJSONSchemaMethod(t,"input",e.processors),output:createStandardJSONSchemaMethod(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function isTransforming(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return isTransforming(r.element,n);if(r.type==="set")return isTransforming(r.valueType,n);if(r.type==="lazy")return isTransforming(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return isTransforming(r.innerType,n);if(r.type==="intersection")return isTransforming(r.left,n)||isTransforming(r.right,n);if(r.type==="record"||r.type==="map")return isTransforming(r.keyType,n)||isTransforming(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:isTransforming(r.in,n)||isTransforming(r.out,n);if(r.type==="object"){for(const u in r.shape)if(isTransforming(r.shape[u],n))return!0;return!1}if(r.type==="union"){for(const u of r.options)if(isTransforming(u,n))return!0;return!1}if(r.type==="tuple"){for(const u of r.items)if(isTransforming(u,n))return!0;return!!(r.rest&&isTransforming(r.rest,n))}return!1}var createToJSONSchemaMethod=(e,t={})=>n=>{const r=initializeContext({...n,processors:t});return processSchema(e,r),extractDefs(r,e),finalize(r,e)},createStandardJSONSchemaMethod=(e,t,n={})=>r=>{const{libraryOptions:u,target:i}=r??{},o=initializeContext({...u??{},target:i,io:t,processors:n});return processSchema(e,o),extractDefs(o,e),finalize(o,e)},narrowMin=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},narrowMax=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},narrowBoth=(e,t)=>{narrowMin(e,"minimum",t),narrowMax(e,"maximum",t)},addDivisor=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},addPattern=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},intersectMime=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},setFormat=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},minContributor=(e,t)=>narrowMin(e,"minimum",t.minimum),maxContributor=(e,t)=>narrowMax(e,"maximum",t.maximum),formatContributor=e=>(t,n)=>{setFormat(t,n.format);const[r,u]=e[n.format];narrowMin(t,"minimum",r),narrowMax(t,"maximum",u)},contributors={greater_than:(e,t)=>narrowMin(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>narrowMax(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>addDivisor(e,t.value),number_format:formatContributor(NUMBER_FORMAT_RANGES),bigint_format:formatContributor(BIGINT_FORMAT_RANGES),min_length:minContributor,max_length:maxContributor,length_equals:(e,t)=>narrowBoth(e,t.length),min_size:minContributor,max_size:maxContributor,size_equals:(e,t)=>narrowBoth(e,t.size),string_format:(e,t)=>{setFormat(e,t.format),t.pattern&&addPattern(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>intersectMime(e,t.mime)};function aggregateChecks(e){const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const i of r)contributors[i._zod.def.check]?.(t,i._zod.def);const u=e._zod.bag;u.minimum!==void 0&&narrowMin(t,"minimum",u.minimum),u.exclusiveMinimum!==void 0&&narrowMin(t,"exclusiveMinimum",u.exclusiveMinimum),u.maximum!==void 0&&narrowMax(t,"maximum",u.maximum),u.exclusiveMaximum!==void 0&&narrowMax(t,"exclusiveMaximum",u.exclusiveMaximum),u.multipleOf!==void 0&&addDivisor(t,u.multipleOf),u.format!==void 0&&(t.format??(t.format=u.format),u.format.includes("int")&&(t.isInt=!0)),u.mime&&intersectMime(t,u.mime);for(const i of u.patterns??[])addPattern(t,i);return t}var formatMap={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},exactPatterns=new Map([[base64Charset,base64],[base64urlCharset,base64url]]),exactPattern=e=>exactPatterns.get(e)??e,stringProcessor=(e,t,n,r)=>{const u=n;u.type="string";const{minimum:i,maximum:o,format:a,patterns:s,contentEncoding:c,laxFormat:l}=aggregateChecks(e);if(typeof i=="number"&&(u.minLength=i),typeof o=="number"&&(u.maxLength=o),a&&(u.format=formatMap[a]??a,u.format===""&&delete u.format,(a==="time"||l)&&delete u.format),c&&(u.contentEncoding=c),s&&s.size>0){const d=[...s].map(exactPattern);d.length===1?u.pattern=d[0].source:d.length>1&&(u.allOf=[...d.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},numberProcessor=(e,t,n,r)=>{const u=n,{minimum:i,maximum:o,multipleOf:a,exclusiveMaximum:s,exclusiveMinimum:c,isInt:l}=aggregateChecks(e);u.type=l?"integer":"number";const d=typeof c=="number"&&c>=(i??Number.NEGATIVE_INFINITY),f=typeof s=="number"&&s<=(o??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(d?m?(u.minimum=c,u.exclusiveMinimum=!0):u.exclusiveMinimum=c:typeof i=="number"&&(u.minimum=i),f?m?(u.maximum=s,u.exclusiveMaximum=!0):u.exclusiveMaximum=s:typeof o=="number"&&(u.maximum=o),a){const h=new Set;for(const D of a)Number.isFinite(D)&&D!==0?h.add(Math.abs(D)):handleUnrepresentable(e,t,u,r,`A multipleOf divisor of ${D} cannot be represented in JSON Schema`);const[g,...E]=h;g!==void 0&&(u.multipleOf=g),E.length&&(u.allOf=[...u.allOf??[],...E.map(D=>({multipleOf:D}))])}},booleanProcessor=(e,t,n,r)=>{n.type="boolean"},bigintProcessor=(e,t,n,r)=>{handleUnrepresentable(e,t,n,r,"BigInt cannot be represented in JSON Schema")},symbolProcessor=(e,t,n,r)=>{handleUnrepresentable(e,t,n,r,"Symbols cannot be represented in JSON Schema")},nullProcessor=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},undefinedProcessor=(e,t,n,r)=>{handleUnrepresentable(e,t,n,r,"Undefined cannot be represented in JSON Schema")},voidProcessor=(e,t,n,r)=>{handleUnrepresentable(e,t,n,r,"Void cannot be represented in JSON Schema")},neverProcessor=(e,t,n,r)=>{n.not={}},anyProcessor=(e,t,n,r)=>{},unknownProcessor=(e,t,n,r)=>{},dateProcessor=(e,t,n,r)=>{handleUnrepresentable(e,t,n,r,"Date cannot be represented in JSON Schema")},enumProcessor=(e,t,n,r)=>{const u=e._zod.def,i=getEnumValues(u.entries);if(i.length===0){n.not={};return}i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},literalProcessor=(e,t,n,r)=>{const u=e._zod.def;if(u.values.length===0){n.not={};return}const i=[];for(const o of u.values)if(o===void 0){if(handleUnrepresentable(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o=="bigint"){if(handleUnrepresentable(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},nanProcessor=(e,t,n,r)=>{handleUnrepresentable(e,t,n,r,"NaN cannot be represented in JSON Schema")},templateLiteralProcessor=(e,t,n,r)=>{const u=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");u.type="string",u.pattern=i.source},fileProcessor=(e,t,n,r)=>{const u=n;u.type="string",u.format="binary",u.contentEncoding="binary";const{minimum:i,maximum:o,mime:a}=aggregateChecks(e);i!==void 0&&(u.minLength=i),o!==void 0&&(u.maxLength=o),a&&(a.length===0?u.not={}:a.length===1?u.contentMediaType=a[0]:u.anyOf=a.map(s=>({contentMediaType:s})))},successProcessor=(e,t,n,r)=>{n.type="boolean"},customProcessor=(e,t,n,r)=>{handleUnrepresentable(e,t,n,r,"Custom types cannot be represented in JSON Schema")},functionProcessor=(e,t,n,r)=>{handleUnrepresentable(e,t,n,r,"Function types cannot be represented in JSON Schema")},transformProcessor=(e,t,n,r)=>{handleUnrepresentable(e,t,n,r,"Transforms cannot be represented in JSON Schema")},mapProcessor=(e,t,n,r)=>{handleUnrepresentable(e,t,n,r,"Map cannot be represented in JSON Schema")},setProcessor=(e,t,n,r)=>{handleUnrepresentable(e,t,n,r,"Set cannot be represented in JSON Schema")},arrayProcessor=(e,t,n,r)=>{const u=n,i=e._zod.def,{minimum:o,maximum:a}=aggregateChecks(e);typeof o=="number"&&(u.minItems=o),typeof a=="number"&&(u.maxItems=a),u.type="array",u.items=processSchema(i.element,t,{...r,path:[...r.path,"items"]})};function inputOptin(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?inputOptin(t.out):t.type==="catch"?inputOptin(t.innerType):e._zod.optin}var objectProcessor=(e,t,n,r)=>{const u=n,i=e._zod.def,o=i.shape;if(Object.getOwnPropertySymbols(o).length&&handleUnrepresentable(e,t,u,r,"Symbol keys cannot be represented in JSON Schema"))return;u.type="object",u.properties={};for(const c in o)assignProp(u.properties,c,processSchema(o[c],t,{...r,path:[...r.path,"properties",c]}));const s=[];for(const c of Object.keys(o)){const l=i.shape[c];(t.io==="input"?inputOptin(l)===void 0:l._zod.optout===void 0)&&s.push(c)}s.length>0&&(u.required=s),i.catchall?._zod.def.type==="never"?u.additionalProperties=!1:i.catchall?i.catchall&&(u.additionalProperties=processSchema(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(u.additionalProperties=!1)},unionProcessor=(e,t,n,r)=>{const u=e._zod.def,i=u.inclusive===!1,o=u.options.map((a,s)=>processSchema(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",s]}));i?n.oneOf=o:n.anyOf=o},intersectionProcessor=(e,t,n,r)=>{const u=e._zod.def,i=processSchema(u.left,t,{...r,path:[...r.path,"allOf",0]}),o=processSchema(u.right,t,{...r,path:[...r.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,s=[...a(i)?i.allOf:[i],...a(o)?o.allOf:[o]];n.allOf=s,t.intersections.push(s)},tupleProcessor=(e,t,n,r)=>{const u=n,i=e._zod.def;u.type="array";const o=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",s=i.items.map((g,E)=>processSchema(g,t,{...r,path:[...r.path,o,E]})),c=i.rest?processSchema(i.rest,t,{...r,path:[...r.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;let l=i.items.length;for(;l>0;){const g=i.items[l-1];if(!(t.io==="input"?inputOptin(g)!==void 0:g._zod.optout==="optional"))break;l--}const d=i.items.length,f=!i.rest;t.target==="draft-2020-12"?(u.prefixItems=s,f?u.items=!1:c&&(u.items=c),l>0&&(u.minItems=l),f&&(u.maxItems=d)):t.target==="openapi-3.0"?(u.items={anyOf:s},c&&u.items.anyOf.push(c),l>0&&(u.minItems=l),f&&(u.maxItems=d)):(u.items=s,f?u.additionalItems=!1:c&&(u.additionalItems=c),l>0&&(u.minItems=l),f&&(u.maxItems=d));const{minimum:m,maximum:h}=aggregateChecks(e);typeof m=="number"&&(u.minItems=m),typeof h=="number"&&(u.maxItems=h)};function stringifyKeyNames(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);const h=e.get(t)?.def;if(!h)return t;const g=stringifyKeyNames(e,h,n);return g===h?t:g}for(const h of["anyOf","oneOf"]){const g=t[h];if(!Array.isArray(g))continue;const E=g.map(D=>stringifyKeyNames(e,D,n));E.some((D,p)=>D!==g[p])&&(t={...t,[h]:E})}const r=Array.isArray(t.type)?t.type:[t.type],u=!r.includes("string")&&r.some(h=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!u&&!i?.some(h=>typeof h=="number"))return t;const{minimum:o,maximum:a,exclusiveMinimum:s,exclusiveMaximum:c,multipleOf:l,format:d,id:f,...m}=t;return m.enum?m.enum=m.enum.map(h=>typeof h=="number"?String(h):h):typeof m.const=="number"&&(m.const=String(m.const)),u&&(m.type="string",i||(m.pattern=(r.includes("number")?number:integer).source)),m}var pendingRecords=new WeakMap;function rewriteKeyNames(e){const t=new Map;for(const r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);const n=new Map;for(const r of pendingRecords.get(e)??[]){const u=e.seen.get(r),i=(u?.def??u?.schema)?.propertyNames;if(!i||i===!0||n.has(i))continue;const o=stringifyKeyNames(t,i,new Set);o!==i&&n.set(i,o)}if(n.size)for(const r of e.seen.values())for(const u of[r.schema,r.def]){const i=u&&n.get(u.propertyNames);i&&(u.propertyNames=i)}}var recordProcessor=(e,t,n,r)=>{const u=n,i=e._zod.def;u.type="object";const o=i.keyType,a=aggregateChecks(o).patterns;if(i.mode==="loose"&&a&&a.size>0){const l=processSchema(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});u.patternProperties={};for(const d of a)assignProp(u.patternProperties,exactPattern(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){u.propertyNames=processSchema(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let l=pendingRecords.get(t);l||(l=[],pendingRecords.set(t,l),t.deferred.push(()=>rewriteKeyNames(t))),l.push(e)}u.additionalProperties=processSchema(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}const s=o._zod.values,c=t.io==="input"&&inputOptin(i.valueType)!==void 0;if(s&&!i.partial&&!c){const l=[...s].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(u.required=l.map(String))}},nullableProcessor=(e,t,n,r)=>{const u=e._zod.def,i=processSchema(u.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=u.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},nonoptionalProcessor=(e,t,n,r)=>{const u=e._zod.def;processSchema(u.innerType,t,r);const i=t.seen.get(e);i.ref=u.innerType},UNREPRESENTABLE_DEFAULT=Symbol();function serializeDefaultValue(e,t,n,r,u){let i=!1;const o=JSON.stringify(e,(a,s)=>typeof s!="bigint"?s:(i=!0,null));return i?(handleUnrepresentable(t,n,r,u,"BigInt defaults cannot be represented in JSON Schema"),UNREPRESENTABLE_DEFAULT):JSON.parse(o)}var defaultProcessor=(e,t,n,r)=>{const u=e._zod.def;processSchema(u.innerType,t,r);const i=t.seen.get(e);i.ref=u.innerType;const o=serializeDefaultValue(u.defaultValue,e,t,n,r);o!==UNREPRESENTABLE_DEFAULT&&(n.default=o)},prefaultProcessor=(e,t,n,r)=>{const u=e._zod.def;processSchema(u.innerType,t,r);const i=t.seen.get(e);if(i.ref=u.innerType,t.io!=="input")return;const o=serializeDefaultValue(u.defaultValue,e,t,n,r);o!==UNREPRESENTABLE_DEFAULT&&(n._prefault=o)},catchProcessor=(e,t,n,r)=>{const u=e._zod.def;processSchema(u.innerType,t,r);const i=t.seen.get(e);i.ref=u.innerType;let o;try{o=u.catchValue(void 0)}catch{handleUnrepresentable(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=o},pipeProcessor=(e,t,n,r)=>{const u=e._zod.def,i=u.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?i?u.out:u.in:u.out;processSchema(o,t,r);const a=t.seen.get(e);a.ref=o},readonlyProcessor=(e,t,n,r)=>{const u=e._zod.def;processSchema(u.innerType,t,r);const i=t.seen.get(e);i.ref=u.innerType,n.readOnly=!0},promiseProcessor=(e,t,n,r)=>{const u=e._zod.def;processSchema(u.innerType,t,r);const i=t.seen.get(e);i.ref=u.innerType},optionalProcessor=(e,t,n,r)=>{const u=e._zod.def;processSchema(u.innerType,t,r);const i=t.seen.get(e);i.ref=u.innerType},lazyProcessor=(e,t,n,r)=>{const u=e._zod.innerType;processSchema(u,t,r);const i=t.seen.get(e);i.ref=u},allProcessors={string:stringProcessor,number:numberProcessor,boolean:booleanProcessor,bigint:bigintProcessor,symbol:symbolProcessor,null:nullProcessor,undefined:undefinedProcessor,void:voidProcessor,never:neverProcessor,any:anyProcessor,unknown:unknownProcessor,date:dateProcessor,enum:enumProcessor,literal:literalProcessor,nan:nanProcessor,template_literal:templateLiteralProcessor,file:fileProcessor,success:successProcessor,custom:customProcessor,function:functionProcessor,transform:transformProcessor,map:mapProcessor,set:setProcessor,array:arrayProcessor,object:objectProcessor,union:unionProcessor,intersection:intersectionProcessor,tuple:tupleProcessor,record:recordProcessor,nullable:nullableProcessor,nonoptional:nonoptionalProcessor,default:defaultProcessor,prefault:prefaultProcessor,catch:catchProcessor,pipe:pipeProcessor,readonly:readonlyProcessor,promise:promiseProcessor,optional:optionalProcessor,lazy:lazyProcessor};function toJSONSchema(e,t){if("_idmap"in e){const r=e,u=initializeContext({...t,processors:allProcessors}),i={};for(const s of r._idmap.entries()){const[c,l]=s;processSchema(l,u)}const o={},a={registry:r,uri:t?.uri,defs:i};u.external=a;for(const s of r._idmap.entries()){const[c,l]=s;extractDefs(u,l),assignProp(o,c,finalize(u,l))}if(Object.keys(i).length>0){const s=u.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[s]:i}}return{schemas:o}}const n=initializeContext({...t,processors:allProcessors});return processSchema(e,n),extractDefs(n,e),finalize(n,e)}var JSONSchemaGenerator=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),this.ctx=initializeContext({processors:allProcessors,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return processSchema(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,extractDefs(this.ctx,e);const n=finalize(this.ctx,e),{"~standard":r,...u}=n;return u}},json_schema_exports={},schemas_exports2={};__export(schemas_exports2,{ZodAny:()=>ZodAny,ZodArray:()=>ZodArray,ZodBase64:()=>ZodBase64,ZodBase64URL:()=>ZodBase64URL,ZodBigInt:()=>ZodBigInt,ZodBigIntFormat:()=>ZodBigIntFormat,ZodBoolean:()=>ZodBoolean,ZodCIDRv4:()=>ZodCIDRv4,ZodCIDRv6:()=>ZodCIDRv6,ZodCUID:()=>ZodCUID,ZodCUID2:()=>ZodCUID2,ZodCatch:()=>ZodCatch,ZodCodec:()=>ZodCodec,ZodCreditCard:()=>ZodCreditCard,ZodCustom:()=>ZodCustom,ZodCustomStringFormat:()=>ZodCustomStringFormat,ZodDate:()=>ZodDate,ZodDefault:()=>ZodDefault,ZodDiscriminatedUnion:()=>ZodDiscriminatedUnion,ZodE164:()=>ZodE164,ZodEmail:()=>ZodEmail,ZodEmoji:()=>ZodEmoji,ZodEnum:()=>ZodEnum,ZodExactOptional:()=>ZodExactOptional,ZodFile:()=>ZodFile,ZodFunction:()=>ZodFunction,ZodGUID:()=>ZodGUID,ZodIBAN:()=>ZodIBAN,ZodIPv4:()=>ZodIPv4,ZodIPv6:()=>ZodIPv6,ZodISODate:()=>ZodISODate,ZodISODateTime:()=>ZodISODateTime,ZodISODuration:()=>ZodISODuration,ZodISOTime:()=>ZodISOTime,ZodInstanceOf:()=>ZodInstanceOf,ZodIntersection:()=>ZodIntersection,ZodJWT:()=>ZodJWT,ZodKSUID:()=>ZodKSUID,ZodLazy:()=>ZodLazy,ZodLiteral:()=>ZodLiteral,ZodMAC:()=>ZodMAC,ZodMap:()=>ZodMap,ZodNaN:()=>ZodNaN,ZodNanoID:()=>ZodNanoID,ZodNever:()=>ZodNever,ZodNonOptional:()=>ZodNonOptional,ZodNull:()=>ZodNull,ZodNullable:()=>ZodNullable,ZodNumber:()=>ZodNumber,ZodNumberFormat:()=>ZodNumberFormat,ZodObject:()=>ZodObject,ZodOptional:()=>ZodOptional,ZodPipe:()=>ZodPipe,ZodPrefault:()=>ZodPrefault,ZodPreprocess:()=>ZodPreprocess,ZodPromise:()=>ZodPromise,ZodReadonly:()=>ZodReadonly,ZodRecord:()=>ZodRecord,ZodSet:()=>ZodSet,ZodString:()=>ZodString,ZodStringFormat:()=>ZodStringFormat,ZodSuccess:()=>ZodSuccess,ZodSymbol:()=>ZodSymbol,ZodTemplateLiteral:()=>ZodTemplateLiteral,ZodTransform:()=>ZodTransform,ZodTuple:()=>ZodTuple,ZodType:()=>ZodType,ZodULID:()=>ZodULID,ZodURL:()=>ZodURL,ZodUUID:()=>ZodUUID,ZodUndefined:()=>ZodUndefined,ZodUnion:()=>ZodUnion,ZodUnknown:()=>ZodUnknown,ZodVoid:()=>ZodVoid,ZodXID:()=>ZodXID,ZodXor:()=>ZodXor,_ZodString:()=>_ZodString,_default:()=>_default2,_function:()=>_function,any:()=>any,array:()=>array,base64:()=>base642,base64url:()=>base64url2,bigint:()=>bigint2,boolean:()=>boolean2,catch:()=>_catch2,check:()=>check,cidrv4:()=>cidrv42,cidrv6:()=>cidrv62,codec:()=>codec,creditCard:()=>creditCard2,cuid:()=>cuid3,cuid2:()=>cuid22,currencyCode:()=>currencyCode2,custom:()=>custom,date:()=>date2,describe:()=>describe2,discriminatedUnion:()=>discriminatedUnion,e164:()=>e1642,email:()=>email2,emoji:()=>emoji2,enum:()=>_enum2,exactOptional:()=>exactOptional,file:()=>file,float32:()=>float32,float64:()=>float64,function:()=>_function,guid:()=>guid2,hash:()=>hash,hex:()=>hex2,hostname:()=>hostname2,httpUrl:()=>httpUrl,iban:()=>iban2,instanceof:()=>_instanceof,int:()=>int,int32:()=>int32,int64:()=>int64,intersection:()=>intersection,invertCodec:()=>invertCodec,ipv4:()=>ipv42,ipv6:()=>ipv62,json:()=>json,jwt:()=>jwt,keyof:()=>keyof,ksuid:()=>ksuid2,lazy:()=>lazy,literal:()=>literal,looseObject:()=>looseObject,looseRecord:()=>looseRecord,mac:()=>mac2,map:()=>map,meta:()=>meta2,nan:()=>nan,nanoid:()=>nanoid2,nativeEnum:()=>nativeEnum,never:()=>never,nonoptional:()=>nonoptional,null:()=>_null3,nullable:()=>nullable,nullish:()=>nullish2,number:()=>number2,object:()=>object,optional:()=>optional,partialRecord:()=>partialRecord,pipe:()=>pipe,prefault:()=>prefault,preprocess:()=>preprocess,promise:()=>promise,readonly:()=>readonly,record:()=>record,refine:()=>refine,set:()=>set,strictObject:()=>strictObject,string:()=>string2,stringFormat:()=>stringFormat,stringbool:()=>stringbool,success:()=>success,superRefine:()=>superRefine,symbol:()=>symbol,templateLiteral:()=>templateLiteral,transform:()=>transform,tuple:()=>tuple,uint32:()=>uint32,uint64:()=>uint64,ulid:()=>ulid2,undefined:()=>_undefined3,union:()=>union,unknown:()=>unknown,url:()=>url,uuid:()=>uuid2,uuidv4:()=>uuidv4,uuidv6:()=>uuidv6,uuidv7:()=>uuidv7,void:()=>_void2,xid:()=>xid2,xor:()=>xor});var checks_exports2={};__export(checks_exports2,{endsWith:()=>_endsWith,gt:()=>_gt,gte:()=>_gte,includes:()=>_includes,length:()=>_length,lowercase:()=>_lowercase,lt:()=>_lt,lte:()=>_lte,maxLength:()=>_maxLength,maxSize:()=>_maxSize,mime:()=>_mime,minLength:()=>_minLength,minSize:()=>_minSize,multipleOf:()=>_multipleOf,negative:()=>_negative,nonnegative:()=>_nonnegative,nonpositive:()=>_nonpositive,normalize:()=>_normalize,overwrite:()=>_overwrite,positive:()=>_positive,properties:()=>_properties,property:()=>_property,regex:()=>_regex,size:()=>_size,slugify:()=>_slugify,startsWith:()=>_startsWith,toLowerCase:()=>_toLowerCase,toUpperCase:()=>_toUpperCase,trim:()=>_trim,uppercase:()=>_uppercase});var _installedErrorProtos=new WeakSet([Object.prototype,Error.prototype]);function _lazyMethod(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}var initializer2=(e,t)=>{$ZodError.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);_installedErrorProtos.has(n)||(_installedErrorProtos.add(n),_lazyMethod(n,"format",r=>u=>formatError(r,u)),_lazyMethod(n,"flatten",r=>u=>flattenError(r,u)),_lazyMethod(n,"addIssue",r=>u=>{r.issues.push(u),r.message=JSON.stringify(r.issues,jsonStringifyReplacer,2)}),_lazyMethod(n,"addIssues",r=>u=>{r.issues.push(...u),r.message=JSON.stringify(r.issues,jsonStringifyReplacer,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},ZodError=$constructor("ZodError",initializer2),ZodRealError=$constructor("ZodError",initializer2,void 0,{Parent:Error}),parse2=_parse(ZodRealError),parseAsync2=_parseAsync(ZodRealError),safeParse2=_safeParse(ZodRealError),safeParseAsync2=_safeParseAsync(ZodRealError),encode2=_encode(ZodRealError),decode2=_decode(ZodRealError),encodeAsync2=_encodeAsync(ZodRealError),decodeAsync2=_decodeAsync(ZodRealError),safeEncode2=_safeEncode(ZodRealError),safeDecode2=_safeDecode(ZodRealError),safeEncodeAsync2=_safeEncodeAsync(ZodRealError),safeDecodeAsync2=_safeDecodeAsync(ZodRealError);function _ensureDefaultLocale(){globalConfig.localeError||config(en_default())}function _ensureDefaultMemoizer(){globalConfig.memoizer||config({memoizer:memoizer()})}var ZodType=$constructor("ZodType",(e,t)=>(_ensureDefaultLocale(),$ZodType.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(util_exports.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return clone(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(refine(e,t))},superRefine(e,t){return this.check(superRefine(e,t))},overwrite(e){return this.check(_overwrite(e))},optional(){return optional(this)},exactOptional(){return exactOptional(this)},nullable(){return nullable(this)},nullish(){return optional(nullable(this))},nonoptional(e){return nonoptional(this,e)},array(){return array(this)},or(e){return union([this,e])},and(e){return intersection(this,e)},transform(e){return pipe(this,transform(e))},default(e){return _default2(this,e)},prefault(e){return prefault(this,e)},catch(e){return _catch2(this,e)},pipe(e){return pipe(this,e)},readonly(){return readonly(this)},describe(e){const t=this.clone();return globalRegistry.add(t,{description:e}),t},meta(...e){if(e.length===0)return globalRegistry.get(this);const t=this.clone();return globalRegistry.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return util_exports.hide(this,"~standard",{...standardProps(this),jsonSchema:{input:createStandardJSONSchemaMethod(this,"input"),output:createStandardJSONSchemaMethod(this,"output")}})},set"~standard"(e){util_exports.own(this,"~standard",e)},parse:function e(t,n){return parse2(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await parseAsync2(this,t,n,{callee:e})},safeParse(e,t){return safeParse2(this,e,t)},async safeParseAsync(e,t){return safeParseAsync2(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){util_exports.own(this,"spa",e)},validate(e,t){return validate(this,e,t)},validateAsync(e,t){return validateAsync(this,e,t)},encode:function e(t,n){return encode2(this,t,n,{callee:e})},decode:function e(t,n){return decode2(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await encodeAsync2(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await decodeAsync2(this,t,n,{callee:e})},safeEncode(e,t){return safeEncode2(this,e,t)},safeDecode(e,t){return safeDecode2(this,e,t)},async safeEncodeAsync(e,t){return safeEncodeAsync2(this,e,t)},async safeDecodeAsync(e,t){return safeDecodeAsync2(this,e,t)},toJSONSchema(e){return createToJSONSchemaMethod(this,{})(e)},get description(){return globalRegistry.get(this)?.description},get _def(){return this._zod.def}}),_ZodString=$constructor("_ZodString",(e,t)=>{$ZodString.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>stringProcessor(e,n,r,u)},util_exports.derived({format:e=>aggregateChecks(e).format??null,minLength:e=>aggregateChecks(e).minimum??null,maxLength:e=>aggregateChecks(e).maximum??null},{regex(...e){return this.check(_regex(...e))},includes(...e){return this.check(_includes(...e))},startsWith(...e){return this.check(_startsWith(...e))},endsWith(...e){return this.check(_endsWith(...e))},min(...e){return this.check(_minLength(...e))},max(...e){return this.check(_maxLength(...e))},length(...e){return this.check(_length(...e))},nonempty(...e){return this.check(_minLength(1,...e))},lowercase(e){return this.check(_lowercase(e))},uppercase(e){return this.check(_uppercase(e))},trim(){return this.check(_trim())},normalize(...e){return this.check(_normalize(...e))},toLowerCase(){return this.check(_toLowerCase())},toUpperCase(){return this.check(_toUpperCase())},slugify(){return this.check(_slugify())}})),ZodString=$constructor("ZodString",(e,t)=>{$ZodString.init(e,t),_ZodString.init(e,t)},{email(e){return this.check(_email(ZodEmail,e))},url(e){return this.check(_url(ZodURL,e))},jwt(e){return this.check(_jwt(ZodJWT,e))},emoji(e){return this.check(_emoji2(ZodEmoji,e))},guid(e){return this.check(_guid(ZodGUID,e))},uuid(e){return this.check(_uuid(ZodUUID,e))},uuidv4(e){return this.check(_uuidv4(ZodUUID,e))},uuidv6(e){return this.check(_uuidv6(ZodUUID,e))},uuidv7(e){return this.check(_uuidv7(ZodUUID,e))},nanoid(e){return this.check(_nanoid(ZodNanoID,e))},cuid(e){return this.check(_cuid(ZodCUID,e))},cuid2(e){return this.check(_cuid2(ZodCUID2,e))},ulid(e){return this.check(_ulid(ZodULID,e))},base64(e){return this.check(_base64(ZodBase64,e))},base64url(e){return this.check(_base64url(ZodBase64URL,e))},xid(e){return this.check(_xid(ZodXID,e))},ksuid(e){return this.check(_ksuid(ZodKSUID,e))},ipv4(e){return this.check(_ipv4(ZodIPv4,e))},ipv6(e){return this.check(_ipv6(ZodIPv6,e))},cidrv4(e){return this.check(_cidrv4(ZodCIDRv4,e))},cidrv6(e){return this.check(_cidrv6(ZodCIDRv6,e))},e164(e){return this.check(_e164(ZodE164,e))},datetime(e){return this.check(_isoDateTime(ZodISODateTime,e))},date(e){return this.check(_isoDate(ZodISODate,e))},time(e){return this.check(_isoTime(ZodISOTime,e))},duration(e){return this.check(_isoDuration(ZodISODuration,e))}});function string2(e){return _string(ZodString,e)}var ZodStringFormat=$constructor("ZodStringFormat",(e,t)=>{$ZodStringFormat.init(e,t),_ZodString.init(e,t)}),ZodISODateTime=$constructor("ZodISODateTime",(e,t)=>{$ZodISODateTime.init(e,t),ZodStringFormat.init(e,t)}),ZodISODate=$constructor("ZodISODate",(e,t)=>{$ZodISODate.init(e,t),ZodStringFormat.init(e,t)}),ZodISOTime=$constructor("ZodISOTime",(e,t)=>{$ZodISOTime.init(e,t),ZodStringFormat.init(e,t)}),ZodISODuration=$constructor("ZodISODuration",(e,t)=>{$ZodISODuration.init(e,t),ZodStringFormat.init(e,t)}),ZodEmail=$constructor("ZodEmail",(e,t)=>{$ZodEmail.init(e,t),ZodStringFormat.init(e,t)});function email2(e){return _email(ZodEmail,e)}var ZodGUID=$constructor("ZodGUID",(e,t)=>{$ZodGUID.init(e,t),ZodStringFormat.init(e,t)});function guid2(e){return _guid(ZodGUID,e)}var ZodUUID=$constructor("ZodUUID",(e,t)=>{$ZodUUID.init(e,t),ZodStringFormat.init(e,t)});function uuid2(e){return _uuid(ZodUUID,e)}function uuidv4(e){return _uuidv4(ZodUUID,e)}function uuidv6(e){return _uuidv6(ZodUUID,e)}function uuidv7(e){return _uuidv7(ZodUUID,e)}var ZodURL=$constructor("ZodURL",(e,t)=>{$ZodURL.init(e,t),ZodStringFormat.init(e,t)});function url(e){return _url(ZodURL,e)}function httpUrl(e){return _url(ZodURL,{protocol:httpProtocol,hostname:domain,...util_exports.normalizeParams(e)})}var ZodEmoji=$constructor("ZodEmoji",(e,t)=>{$ZodEmoji.init(e,t),ZodStringFormat.init(e,t)});function emoji2(e){return _emoji2(ZodEmoji,e)}var ZodNanoID=$constructor("ZodNanoID",(e,t)=>{$ZodNanoID.init(e,t),ZodStringFormat.init(e,t)});function nanoid2(e){return _nanoid(ZodNanoID,e)}var ZodCUID=$constructor("ZodCUID",(e,t)=>{$ZodCUID.init(e,t),ZodStringFormat.init(e,t)});function cuid3(e){return _cuid(ZodCUID,e)}var ZodCUID2=$constructor("ZodCUID2",(e,t)=>{$ZodCUID2.init(e,t),ZodStringFormat.init(e,t)});function cuid22(e){return _cuid2(ZodCUID2,e)}var ZodULID=$constructor("ZodULID",(e,t)=>{$ZodULID.init(e,t),ZodStringFormat.init(e,t)});function ulid2(e){return _ulid(ZodULID,e)}var ZodXID=$constructor("ZodXID",(e,t)=>{$ZodXID.init(e,t),ZodStringFormat.init(e,t)});function xid2(e){return _xid(ZodXID,e)}var ZodKSUID=$constructor("ZodKSUID",(e,t)=>{$ZodKSUID.init(e,t),ZodStringFormat.init(e,t)});function ksuid2(e){return _ksuid(ZodKSUID,e)}var ZodIPv4=$constructor("ZodIPv4",(e,t)=>{$ZodIPv4.init(e,t),ZodStringFormat.init(e,t)});function ipv42(e){return _ipv4(ZodIPv4,e)}var ZodMAC=$constructor("ZodMAC",(e,t)=>{$ZodMAC.init(e,t),ZodStringFormat.init(e,t)});function mac2(e){return _mac(ZodMAC,e)}var ZodIPv6=$constructor("ZodIPv6",(e,t)=>{$ZodIPv6.init(e,t),ZodStringFormat.init(e,t)});function ipv62(e){return _ipv6(ZodIPv6,e)}var ZodCIDRv4=$constructor("ZodCIDRv4",(e,t)=>{$ZodCIDRv4.init(e,t),ZodStringFormat.init(e,t)});function cidrv42(e){return _cidrv4(ZodCIDRv4,e)}var ZodCIDRv6=$constructor("ZodCIDRv6",(e,t)=>{$ZodCIDRv6.init(e,t),ZodStringFormat.init(e,t)});function cidrv62(e){return _cidrv6(ZodCIDRv6,e)}var ZodBase64=$constructor("ZodBase64",(e,t)=>{$ZodBase64.init(e,t),ZodStringFormat.init(e,t)});function base642(e){return _base64(ZodBase64,e)}var ZodBase64URL=$constructor("ZodBase64URL",(e,t)=>{$ZodBase64URL.init(e,t),ZodStringFormat.init(e,t)});function base64url2(e){return _base64url(ZodBase64URL,e)}var ZodE164=$constructor("ZodE164",(e,t)=>{$ZodE164.init(e,t),ZodStringFormat.init(e,t)});function e1642(e){return _e164(ZodE164,e)}var ZodCreditCard=$constructor("ZodCreditCard",(e,t)=>{$ZodCreditCard.init(e,t),ZodStringFormat.init(e,t)});function creditCard2(e){return _creditCard(ZodCreditCard,e)}var ZodIBAN=$constructor("ZodIBAN",(e,t)=>{$ZodIBAN.init(e,t),ZodStringFormat.init(e,t)});function iban2(e){return _iban(ZodIBAN,e)}var ZodJWT=$constructor("ZodJWT",(e,t)=>{$ZodJWT.init(e,t),ZodStringFormat.init(e,t)});function jwt(e){return _jwt(ZodJWT,e)}var ZodCustomStringFormat=$constructor("ZodCustomStringFormat",(e,t)=>{$ZodCustomStringFormat.init(e,t),ZodStringFormat.init(e,t)});function stringFormat(e,t,n={}){return _stringFormat(ZodCustomStringFormat,e,t,n)}function hostname2(e){return _stringFormat(ZodCustomStringFormat,"hostname",hostname,e)}function hex2(e){return _stringFormat(ZodCustomStringFormat,"hex",hex,e)}function currencyCode2(e){return _stringFormat(ZodCustomStringFormat,"currency_code",currencyCode,e)}function hash(e,t){const n=t?.enc??"hex",r=`${e}_${n}`,u=regexes_exports[r];if(!u)throw new Error(`Unrecognized hash format: ${r}`);return _stringFormat(ZodCustomStringFormat,r,u,t)}var ZodNumber=$constructor("ZodNumber",(e,t)=>{$ZodNumber.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>numberProcessor(e,n,r,u),e.isFinite=!0},util_exports.derived({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=aggregateChecks(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=aggregateChecks(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=aggregateChecks(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>aggregateChecks(e).format??null},{gt(e,t){return this.check(_gt(e,t))},gte(e,t){return this.check(_gte(e,t))},min(e,t){return this.check(_gte(e,t))},lt(e,t){return this.check(_lt(e,t))},lte(e,t){return this.check(_lte(e,t))},max(e,t){return this.check(_lte(e,t))},int(e){return this.check(int(e))},safe(e){return this.check(int(e))},positive(e){return this.check(_gt(0,e))},nonnegative(e){return this.check(_gte(0,e))},negative(e){return this.check(_lt(0,e))},nonpositive(e){return this.check(_lte(0,e))},multipleOf(e,t){return this.check(_multipleOf(e,t))},step(e,t){return this.check(_multipleOf(e,t))},finite(){return this}}));function number2(e){return _number(ZodNumber,e)}var ZodNumberFormat=$constructor("ZodNumberFormat",(e,t)=>{$ZodNumberFormat.init(e,t),ZodNumber.init(e,t)});function int(e){return _int(ZodNumberFormat,e)}function float32(e){return _float32(ZodNumberFormat,e)}function float64(e){return _float64(ZodNumberFormat,e)}function int32(e){return _int32(ZodNumberFormat,e)}function uint32(e){return _uint32(ZodNumberFormat,e)}var ZodBoolean=$constructor("ZodBoolean",(e,t)=>{$ZodBoolean.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>booleanProcessor(e,n,r,u)});function boolean2(e){return _boolean(ZodBoolean,e)}var ZodBigInt=$constructor("ZodBigInt",(e,t)=>{$ZodBigInt.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>bigintProcessor(e,n,r,u)},util_exports.derived({minValue:e=>aggregateChecks(e).minimum??null,maxValue:e=>aggregateChecks(e).maximum??null,format:e=>aggregateChecks(e).format??null},{gte(e,t){return this.check(_gte(e,t))},min(e,t){return this.check(_gte(e,t))},gt(e,t){return this.check(_gt(e,t))},lt(e,t){return this.check(_lt(e,t))},lte(e,t){return this.check(_lte(e,t))},max(e,t){return this.check(_lte(e,t))},positive(e){return this.check(_gt(BigInt(0),e))},negative(e){return this.check(_lt(BigInt(0),e))},nonpositive(e){return this.check(_lte(BigInt(0),e))},nonnegative(e){return this.check(_gte(BigInt(0),e))},multipleOf(e,t){return this.check(_multipleOf(e,t))}}));function bigint2(e){return _bigint(ZodBigInt,e)}var ZodBigIntFormat=$constructor("ZodBigIntFormat",(e,t)=>{$ZodBigIntFormat.init(e,t),ZodBigInt.init(e,t)});function int64(e){return _int64(ZodBigIntFormat,e)}function uint64(e){return _uint64(ZodBigIntFormat,e)}var ZodSymbol=$constructor("ZodSymbol",(e,t)=>{$ZodSymbol.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>symbolProcessor(e,n,r,u)});function symbol(e){return _symbol(ZodSymbol,e)}var ZodUndefined=$constructor("ZodUndefined",(e,t)=>{$ZodUndefined.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>undefinedProcessor(e,n,r,u)});function _undefined3(e){return _undefined2(ZodUndefined,e)}var ZodNull=$constructor("ZodNull",(e,t)=>{$ZodNull.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>nullProcessor(e,n,r,u)});function _null3(e){return _null2(ZodNull,e)}var ZodAny=$constructor("ZodAny",(e,t)=>{$ZodAny.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>anyProcessor(e,n,r,u)});function any(){return _any(ZodAny)}var ZodUnknown=$constructor("ZodUnknown",(e,t)=>{$ZodUnknown.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>unknownProcessor(e,n,r,u)});function unknown(){return _unknown(ZodUnknown)}var ZodNever=$constructor("ZodNever",(e,t)=>{$ZodNever.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>neverProcessor(e,n,r,u)});function never(e){return _never(ZodNever,e)}var ZodVoid=$constructor("ZodVoid",(e,t)=>{$ZodVoid.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>voidProcessor(e,n,r,u)});function _void2(e){return _void(ZodVoid,e)}var ZodDate=$constructor("ZodDate",(e,t)=>{$ZodDate.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>dateProcessor(e,n,r,u),e.min=(n,r)=>e.check(_gte(n,r)),e.max=(n,r)=>e.check(_lte(n,r))},util_exports.derived({minDate:e=>{const{minimum:t}=aggregateChecks(e);return t?new Date(t):null},maxDate:e=>{const{maximum:t}=aggregateChecks(e);return t?new Date(t):null}},{}));function date2(e){return _date(ZodDate,e)}var ZodArray=$constructor("ZodArray",(e,t)=>{_ensureDefaultMemoizer(),$ZodArray.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>arrayProcessor(e,n,r,u),e.element=t.element},{min(e,t){return this.check(_minLength(e,t))},nonempty(e){return this.check(_minLength(1,e))},max(e,t){return this.check(_maxLength(e,t))},length(e,t){return this.check(_length(e,t))},unwrap(){return this.element}});function array(e,t){return _array(ZodArray,e,t)}function keyof(e){const t=e._zod.def.shape;return _enum2(Object.keys(t))}var ZodObject=$constructor("ZodObject",(e,t)=>{_ensureDefaultMemoizer(),$ZodObjectJIT.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>objectProcessor(e,n,r,u),util_exports.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return _enum2(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(util_exports.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(util_exports.mergeDefs(this._zod.def,{catchall:unknown()}))},loose(){return this.clone(util_exports.mergeDefs(this._zod.def,{catchall:unknown()}))},strict(){return this.clone(util_exports.mergeDefs(this._zod.def,{catchall:never()}))},strip(){return this.clone(util_exports.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return util_exports.extend(this,e)},safeExtend(e){return util_exports.safeExtend(this,e)},merge(e){return util_exports.merge(this,e)},pick(e){return util_exports.pick(this,e)},omit(e){return util_exports.omit(this,e)},partial(...e){return util_exports.partial(ZodOptional,this,e[0])},exactPartial(...e){return util_exports.partial(ZodExactOptional,this,e[0],"exactPartial")},required(...e){return util_exports.required(ZodNonOptional,this,e[0])}});function object(e,t){const n={type:"object",shape:e??{},...util_exports.normalizeParams(t)};return new ZodObject(n)}function strictObject(e,t){return new ZodObject({type:"object",shape:e,catchall:never(),...util_exports.normalizeParams(t)})}function looseObject(e,t){return new ZodObject({type:"object",shape:e,catchall:unknown(),...util_exports.normalizeParams(t)})}var ZodUnion=$constructor("ZodUnion",(e,t)=>{$ZodUnion.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>unionProcessor(e,n,r,u),e.options=t.options});function union(e,t){return new ZodUnion({type:"union",options:e,...util_exports.normalizeParams(t)})}var ZodXor=$constructor("ZodXor",(e,t)=>{ZodUnion.init(e,t),$ZodXor.init(e,t),e._zod.processJSONSchema=(n,r,u)=>unionProcessor(e,n,r,u),e.options=t.options});function xor(e,t){return new ZodXor({type:"union",options:e,inclusive:!1,...util_exports.normalizeParams(t)})}var ZodDiscriminatedUnion=$constructor("ZodDiscriminatedUnion",(e,t)=>{ZodUnion.init(e,t),$ZodDiscriminatedUnion.init(e,t)});function discriminatedUnion(e,t,n){return new ZodDiscriminatedUnion({type:"union",options:t,discriminator:e,...util_exports.normalizeParams(n)})}var ZodIntersection=$constructor("ZodIntersection",(e,t)=>{$ZodIntersection.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>intersectionProcessor(e,n,r,u)});function intersection(e,t){return new ZodIntersection({type:"intersection",left:e,right:t})}var ZodTuple=$constructor("ZodTuple",(e,t)=>{_ensureDefaultMemoizer(),$ZodTuple.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>tupleProcessor(e,n,r,u)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){const e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new ZodOptional({type:"optional",innerType:t}))})}});function tuple(e,t,n){const r=t instanceof $ZodType,u=r?n:t,i=r?t:null;return new ZodTuple({type:"tuple",items:e,rest:i,...util_exports.normalizeParams(u)})}var ZodRecord=$constructor("ZodRecord",(e,t)=>{_ensureDefaultMemoizer(),$ZodRecord.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>recordProcessor(e,n,r,u),e.keyType=t.keyType,e.valueType=t.valueType});function record(e,t,n){return!t||!t._zod?new ZodRecord({type:"record",keyType:string2(),valueType:e,...util_exports.normalizeParams(t)}):new ZodRecord({type:"record",keyType:e,valueType:t,...util_exports.normalizeParams(n)})}function partialRecord(e,t,n){return new ZodRecord({type:"record",keyType:e,valueType:t,...util_exports.normalizeParams(n),partial:!0})}function looseRecord(e,t,n){return new ZodRecord({type:"record",keyType:e,valueType:t,mode:"loose",...util_exports.normalizeParams(n)})}var ZodMap=$constructor("ZodMap",(e,t)=>{_ensureDefaultMemoizer(),$ZodMap.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>mapProcessor(e,n,r,u),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(_minSize(...n)),e.nonempty=n=>e.check(_minSize(1,n)),e.max=(...n)=>e.check(_maxSize(...n)),e.size=(...n)=>e.check(_size(...n))});function map(e,t,n){return new ZodMap({type:"map",keyType:e,valueType:t,...util_exports.normalizeParams(n)})}var ZodSet=$constructor("ZodSet",(e,t)=>{_ensureDefaultMemoizer(),$ZodSet.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>setProcessor(e,n,r,u),e.min=(...n)=>e.check(_minSize(...n)),e.nonempty=n=>e.check(_minSize(1,n)),e.max=(...n)=>e.check(_maxSize(...n)),e.size=(...n)=>e.check(_size(...n))});function set(e,t){return new ZodSet({type:"set",valueType:e,...util_exports.normalizeParams(t)})}var ZodEnum=$constructor("ZodEnum",(e,t)=>{$ZodEnum.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(r,u,i)=>enumProcessor(e,r,u,i),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,u)=>{const i={};for(const o of r)if(n.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new ZodEnum({...t,checks:[],...util_exports.normalizeParams(u),entries:i})},e.exclude=(r,u)=>{const i={...t.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new ZodEnum({...t,checks:[],...util_exports.normalizeParams(u),entries:i})}});function _enum2(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ZodEnum({type:"enum",entries:n,...util_exports.normalizeParams(t)})}function nativeEnum(e,t){return new ZodEnum({type:"enum",entries:e,...util_exports.normalizeParams(t)})}var ZodLiteral=$constructor("ZodLiteral",(e,t)=>{$ZodLiteral.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>literalProcessor(e,n,r,u),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function literal(e,t){return new ZodLiteral({type:"literal",values:Array.isArray(e)?e:[e],...util_exports.normalizeParams(t)})}var ZodFile=$constructor("ZodFile",(e,t)=>{$ZodFile.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>fileProcessor(e,n,r,u),e.min=(n,r)=>e.check(_minSize(n,r)),e.max=(n,r)=>e.check(_maxSize(n,r)),e.mime=(n,r)=>e.check(_mime(Array.isArray(n)?n:[n],r))});function file(e){return _file(ZodFile,e)}var ZodTransform=$constructor("ZodTransform",(e,t)=>{_ensureDefaultMemoizer(),$ZodTransform.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>transformProcessor(e,n,r,u),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new $ZodEncodeError(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(util_exports.issue(i,n.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=n.value),o.inst??(o.inst=e),n.issues.push(util_exports.issue(o))}};const u=t.transform(n.value,n);return u instanceof Promise?u.then(i=>(n.value=i,n)):(n.value=u,n)}});function transform(e){return new ZodTransform({type:"transform",transform:e})}var ZodOptional=$constructor("ZodOptional",(e,t)=>{$ZodOptional.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>optionalProcessor(e,n,r,u),e.unwrap=()=>e._zod.def.innerType});function optional(e){return new ZodOptional({type:"optional",innerType:e})}var ZodExactOptional=$constructor("ZodExactOptional",(e,t)=>{$ZodExactOptional.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>optionalProcessor(e,n,r,u),e.unwrap=()=>e._zod.def.innerType});function exactOptional(e){return new ZodExactOptional({type:"optional",innerType:e})}var ZodNullable=$constructor("ZodNullable",(e,t)=>{$ZodNullable.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>nullableProcessor(e,n,r,u),e.unwrap=()=>e._zod.def.innerType});function nullable(e){return new ZodNullable({type:"nullable",innerType:e})}function nullish2(e){return optional(nullable(e))}var ZodDefault=$constructor("ZodDefault",(e,t)=>{$ZodDefault.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>defaultProcessor(e,n,r,u),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function _default2(e,t){return new ZodDefault({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():util_exports.shallowClone(t)}})}var ZodPrefault=$constructor("ZodPrefault",(e,t)=>{$ZodPrefault.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>prefaultProcessor(e,n,r,u),e.unwrap=()=>e._zod.def.innerType});function prefault(e,t){return new ZodPrefault({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():util_exports.shallowClone(t)}})}var ZodNonOptional=$constructor("ZodNonOptional",(e,t)=>{$ZodNonOptional.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>nonoptionalProcessor(e,n,r,u),e.unwrap=()=>e._zod.def.innerType});function nonoptional(e,t){return new ZodNonOptional({type:"nonoptional",innerType:e,...util_exports.normalizeParams(t)})}var ZodSuccess=$constructor("ZodSuccess",(e,t)=>{$ZodSuccess.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>successProcessor(e,n,r,u),e.unwrap=()=>e._zod.def.innerType});function success(e){return new ZodSuccess({type:"success",innerType:e})}var ZodCatch=$constructor("ZodCatch",(e,t)=>{$ZodCatch.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>catchProcessor(e,n,r,u),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function _catch2(e,t){return new ZodCatch({type:"catch",innerType:e,catchValue:typeof t=="function"?t:util_exports.constantCatch(t)})}var ZodNaN=$constructor("ZodNaN",(e,t)=>{$ZodNaN.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>nanProcessor(e,n,r,u)});function nan(e){return _nan(ZodNaN,e)}var ZodPipe=$constructor("ZodPipe",(e,t)=>{$ZodPipe.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>pipeProcessor(e,n,r,u),e.in=t.in,e.out=t.out});function pipe(e,t){return new ZodPipe({type:"pipe",in:e,out:t})}var ZodCodec=$constructor("ZodCodec",(e,t)=>{ZodPipe.init(e,t),$ZodCodec.init(e,t)});function codec(e,t,n){return new ZodCodec({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function invertCodec(e){const t=e._zod.def;return new ZodCodec({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var ZodPreprocess=$constructor("ZodPreprocess",(e,t)=>{ZodPipe.init(e,t),$ZodPreprocess.init(e,t)}),ZodReadonly=$constructor("ZodReadonly",(e,t)=>{$ZodReadonly.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>readonlyProcessor(e,n,r,u),e.unwrap=()=>e._zod.def.innerType});function readonly(e){return new ZodReadonly({type:"readonly",innerType:e})}var ZodTemplateLiteral=$constructor("ZodTemplateLiteral",(e,t)=>{$ZodTemplateLiteral.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>templateLiteralProcessor(e,n,r,u)});function templateLiteral(e,t){return new ZodTemplateLiteral({type:"template_literal",parts:e,...util_exports.normalizeParams(t)})}var ZodLazy=$constructor("ZodLazy",(e,t)=>{$ZodLazy.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>lazyProcessor(e,n,r,u),e.unwrap=()=>e._zod.def.getter()});function lazy(e){return new ZodLazy({type:"lazy",getter:e})}var ZodPromise=$constructor("ZodPromise",(e,t)=>{$ZodPromise.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>promiseProcessor(e,n,r,u),e.unwrap=()=>e._zod.def.innerType});function promise(e){return new ZodPromise({type:"promise",innerType:e})}var ZodFunction=$constructor("ZodFunction",(e,t)=>{$ZodFunction.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>functionProcessor(e,n,r,u)});function _function(e){return new ZodFunction({type:"function",input:Array.isArray(e?.input)?tuple(e?.input):e?.input??array(unknown()),output:e?.output??unknown()})}var ZodCustom=$constructor("ZodCustom",(e,t)=>{$ZodCustom.init(e,t),ZodType.init(e,t),e._zod.processJSONSchema=(n,r,u)=>customProcessor(e,n,r,u)});function check(e){const t=new $ZodCheck({check:"custom"});return t._zod.check=e,t}function custom(e,t){return _custom(ZodCustom,e??(()=>!0),t)}function refine(e,t={}){return _refine(ZodCustom,e,t)}function superRefine(e,t){return _superRefine(e,t)}var describe2=describe,meta2=meta,ZodInstanceOf=$constructor("ZodInstanceOf",(e,t)=>{ZodCustom.init(e,t)},{properties(e,t){return this.check(_properties(e,t))}});function _instanceof(e,t={}){const n=new ZodInstanceOf({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...util_exports.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var stringbool=(...e)=>_stringbool({Codec:ZodCodec,Boolean:ZodBoolean,String:ZodString},...e);function json(e){const t=lazy(()=>union([string2(e),number2(),boolean2(),_null3(),array(t),record(string2(),t)]));return t}function preprocess(e,t){return new ZodPreprocess({type:"pipe",in:transform(e),out:t})}var ZodIssueCode={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function setErrorMap(e){config({customError:e})}function getErrorMap(){return config().customError}var ZodFirstPartyTypeKind;ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={});var iso_exports={};__export(iso_exports,{ZodISODate:()=>ZodISODate,ZodISODateTime:()=>ZodISODateTime,ZodISODuration:()=>ZodISODuration,ZodISOTime:()=>ZodISOTime,date:()=>date3,datetime:()=>datetime2,duration:()=>duration2,time:()=>time2});function datetime2(e){return _isoDateTime(ZodISODateTime,e)}function date3(e){return _isoDate(ZodISODate,e)}function time2(e){return _isoTime(ZodISOTime,e)}function duration2(e){return _isoDuration(ZodISODuration,e)}var z={...schemas_exports2,...checks_exports2,iso:iso_exports},RECOGNIZED_KEYS=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function detectVersion(e,t){const n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function applyMinItems(e,t){return e.map((n,r)=>r<t?n:n.optional())}function decodeJSONPointerSegment(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function resolveRef(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;const r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){const u=n[1]===void 0?void 0:decodeJSONPointerSegment(n[1]);if(!u||!t.defs[u])throw new Error(`Reference not found: ${e}`);return t.defs[u]}throw new Error(`Reference not found: ${e}`)}function checkObjectGuards(e,t){return z.transform(r=>r).check(r=>{const u=r.value;if(typeof u!="object"||u===null||Array.isArray(u))return;const i=Object.getOwnPropertyNames(u);if(t.minProperties!==void 0&&i.length<t.minProperties&&r.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:u,inst:e,continue:!0}),t.maxProperties!==void 0&&i.length>t.maxProperties&&r.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:u,inst:e,continue:!0}),t.keySchema)for(const o of i){const a=t.keySchema.safeParse(o);a.success||r.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:o,path:[o],continue:!0})}}).pipe(e)}function canonicalKey(e,t){if(e===null)return"z";const n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;const r=String(e);return`${n[0]}${r.length}:${r}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){const i=[];for(const o of e){const a=canonicalKey(o,t);if(a===null)return null;i.push(a)}return`a${i.length}:[${i.join(",")}]`}const r=Object.keys(e).sort(),u=[];for(const i of r){const o=canonicalKey(e[i],t);if(o===null)return null;u.push(`${i.length}:${i}=${o}`)}return`o${u.length}:{${u.join(",")}}`}finally{t.delete(e)}}var SCHEMA_KEYWORDS=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),SCHEMA_MAP_KEYWORDS=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function containsRef(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(containsRef):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>SCHEMA_KEYWORDS.has(t)?containsRef(n):!SCHEMA_MAP_KEYWORDS.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(containsRef))}function plural(e){return e===1?"element":"elements"}function checkArrayGuards(e,t){return z.transform(r=>r).check(r=>{const u=r.value;if(Array.isArray(u)){if(t.uniqueItems===!0){const i=new Map;for(let o=0;o<u.length;o++){const a=canonicalKey(u[o],new Set);if(a===null)continue;const s=i.get(a);if(s===void 0){i.set(a,o);continue}r.issues.push({code:"custom",message:`Array items must be unique: element at index ${o} duplicates the one at index ${s}`,input:u,path:[o],continue:!0})}}if(t.containsSchema){const i=t.minContains??1,o=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY;let a=0;for(const s of u)if(t.containsSchema.safeParse(s).success&&++a>=o)break;a<i&&r.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${plural(i)}; found ${a}`,input:u,continue:!0}),t.maxContains!==void 0&&a>t.maxContains&&r.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${plural(t.maxContains)}`,input:u,continue:!0})}}}).pipe(e)}function getTupleRest(e,t){if(e!==!1)return e===void 0||e===!0?z.any():convertSchema(e,t)}var fullTime=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function convertBaseSchema(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return z.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){const u=e.$ref;if(t.refs.has(u))return t.refs.get(u);if(t.processing.has(u))return z.lazy(()=>{if(!t.refs.has(u))throw new Error(`Circular reference not resolved: ${u}`);return t.refs.get(u)});t.processing.add(u);const i=resolveRef(u,t),o=convertSchema(i,t);return t.refs.set(u,o),t.processing.delete(u),o}if(e.enum!==void 0){const u=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&u.length===1&&u[0]===null)return z.null();if(u.length===0)return z.never();if(u.length===1)return z.literal(u[0]);if(u.every(o=>typeof o=="string"))return z.enum(u);const i=u.map(o=>z.literal(o));return i.length<2?i[0]:z.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return z.literal(e.const);const n=e.type;if(Array.isArray(n)){const u=n.map(i=>{const o={...e,type:i};return convertBaseSchema(o,t)});return u.length===0?z.never():u.length===1?u[0]:z.union(u)}if(!n)return z.any();let r;switch(n){case"string":{let u=z.string();if(e.format){const i=e.format;i==="email"?u=u.check(z.email()):i==="uri"||i==="uri-reference"?u=u.check(z.url()):i==="uuid"||i==="guid"?u=u.check(z.uuid()):i==="date-time"?u=u.check(z.iso.datetime({offset:!0})):i==="date"?u=u.check(z.iso.date()):i==="time"?u=u.check(z.regex(fullTime)):i==="duration"?u=u.check(z.iso.duration()):i==="hostname"?u=u.check(z.hostname()):i==="ipv4"?u=u.check(z.ipv4()):i==="ipv6"?u=u.check(z.ipv6()):i==="mac"?u=u.check(z.mac()):i==="cidr"?u=u.check(z.cidrv4()):i==="cidr-v6"?u=u.check(z.cidrv6()):i==="base64"?u=u.check(z.base64()):i==="base64url"?u=u.check(z.base64url()):i==="e164"?u=u.check(z.e164()):i==="credit_card"?u=u.check(z.creditCard()):i==="iban"?u=u.check(z.iban()):i==="jwt"?u=u.check(z.jwt()):i==="emoji"?u=u.check(z.emoji()):i==="nanoid"?u=u.check(z.nanoid()):i==="cuid"?u=u.check(z.cuid()):i==="cuid2"?u=u.check(z.cuid2()):i==="ulid"?u=u.check(z.ulid()):i==="xid"?u=u.check(z.xid()):i==="ksuid"&&(u=u.check(z.ksuid()))}typeof e.minLength=="number"&&(u=u.min(e.minLength)),typeof e.maxLength=="number"&&(u=u.max(e.maxLength)),e.pattern&&(u=u.regex(new RegExp(e.pattern))),r=u;break}case"number":case"integer":{let u=n==="integer"?z.number().int():z.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(u=u.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(u=u.max(e.maximum)),typeof e.exclusiveMinimum=="number"?u=u.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(u=u.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?u=u.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(u=u.lt(e.maximum)),typeof e.multipleOf=="number"&&(u=u.multipleOf(e.multipleOf)),r=u;break}case"boolean":{r=z.boolean();break}case"null":{r=z.null();break}case"object":{const u={},i=e.properties||{},o=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?convertSchema(e.additionalProperties,t):void 0;for(const[d,f]of Object.entries(i)){const m=convertSchema(f,t);assignProp(u,d,o.has(d)?m:m.optional())}if(e.patternProperties){const d=e.patternProperties,f=Object.keys(d),m=[];for(const g of f){const E=convertSchema(d[g],t),D=z.string().regex(new RegExp(g));m.push(z.looseRecord(D,E))}const h=[];if(Object.keys(u).length>0&&h.push(z.object(u).passthrough()),h.push(...m),h.length===0)r=z.object({}).passthrough();else if(h.length===1)r=h[0];else{let g=z.intersection(h[0],h[1]);for(let E=2;E<h.length;E++)g=z.intersection(g,h[E]);r=g}if(e.additionalProperties===!1){const g=Object.keys(u),E=f.map(p=>new RegExp(p)),D=r;r=r.check(p=>{if(!isPlainObject(p.value))return;const v=[];for(const y of Object.keys(p.value))g.includes(y)||E.some(A=>A.test(y))||v.push(y);v.length&&p.issues.push({code:"unrecognized_keys",keys:v,input:p.value,inst:D})})}}else{const d=z.object(u);e.additionalProperties===!1?r=d.strict():a?r=d.catchall(a):r=d.passthrough()}const s=e.propertyNames!==void 0&&e.propertyNames!==!0,c=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(s||c!==void 0||l!==void 0){let d;if(s){const f=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=convertSchema(f,t)}r=checkObjectGuards(r,{keySchema:d,minProperties:c,maxProperties:l})}break}case"array":{const u=e.prefixItems,i=e.items;if(u&&Array.isArray(u)){const o=typeof e.minItems=="number"?e.minItems:0,a=u.map(d=>convertSchema(d,t)),s=applyMinItems(a,o),c=Array.isArray(i)?void 0:getTupleRest(i,t),l=z.tuple(s);r=c?l.rest(c):l,typeof e.minItems=="number"&&(r=r.check(z.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(z.maxLength(e.maxItems)))}else if(Array.isArray(i)){const o=typeof e.minItems=="number"?e.minItems:0,a=i.map(d=>convertSchema(d,t)),s=applyMinItems(a,o),c=getTupleRest(e.additionalItems,t),l=z.tuple(s);r=c?l.rest(c):l,typeof e.minItems=="number"&&(r=r.check(z.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(z.maxLength(e.maxItems)))}else if(i!==void 0){const o=convertSchema(i,t);let a=z.array(o);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),r=a}else r=z.array(z.any());(e.uniqueItems===!0||e.contains!==void 0)&&(r=checkArrayGuards(r,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?convertSchema(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return r}function convertSchema(e,t){if(typeof e=="boolean")return e?z.any():z.never();let n=convertBaseSchema(e,t);const r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){const a=e.anyOf.map(c=>convertSchema(c,t)),s=z.union(a);n=r?z.intersection(n,s):s}if(e.oneOf&&Array.isArray(e.oneOf)){const a=e.oneOf.map(c=>convertSchema(c,t)),s=z.xor(a);n=r?z.intersection(n,s):s}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:z.any();else{let a=r?n:convertSchema(e.allOf[0],t);const s=r?0:1;for(let c=s;c<e.allOf.length;c++)a=z.intersection(a,convertSchema(e.allOf[c],t));n=a}e.nullable===!0&&t.version==="openapi-3.0"&&(n=z.nullable(n)),e.readOnly===!0&&(n=z.readonly(n)),e.default!==void 0&&(n=n.default(e.default));const u={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(const a of i)a in e&&(u[a]=e[a]);const o=["contentEncoding","contentMediaType","contentSchema"];for(const a of o)a in e&&(u[a]=e[a]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!containsRef(e.propertyNames)&&(u.propertyNames=e.propertyNames);for(const a of["minProperties","maxProperties"])e[a]!==void 0&&(u[a]=e[a])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!containsRef(e.contains)&&(u.contains=e.contains);for(const a of["uniqueItems","minContains","maxContains"])e[a]!==void 0&&(u[a]=e[a])}for(const a of Object.keys(e))RECOGNIZED_KEYS.has(a)||assignProp(u,a,e[a]);return Object.keys(u).length>0&&t.registry.add(n,u),e.description&&(n=n.describe(e.description)),n}function fromJSONSchema(e,t){if(typeof e=="boolean")return e?z.any():z.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}const r=detectVersion(n,t?.defaultTarget),u=n.$defs||n.definitions||{},i={version:r,defs:u,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??globalRegistry};return convertSchema(n,i)}var RESOLVING=Symbol("z.visit/resolving");function visit(e,t){const n=typeof t=="function"?t:(o,a)=>{const s=t[o._zod.def.type];return s?s(o,a):o},r=new Map;function u(o){const a=r.get(o);if(a===RESOLVING)return new $ZodLazy({type:"lazy",getter:()=>r.get(o)});if(a!==void 0)return a;r.set(o,RESOLVING);const s=i(o),c=n(s,s!==o);return r.set(o,c),c}function i(o){const a=o._zod.def,s=a.type;switch(s){case"object":{const c=a.shape,l=Object.keys(c);let d=!1;const f={};for(const h of l){const g=u(c[h]);g!==c[h]&&(d=!0),f[h]=g}let m=a.catchall;return a.catchall&&(m=u(a.catchall),m!==a.catchall&&(d=!0)),d?clone(o,{...a,shape:f,catchall:m}):o}case"array":{const c=u(a.element);return c===a.element?o:clone(o,{...a,element:c})}case"tuple":{const c=a.items;let l=!1;const d=[];for(const m of c){const h=u(m);h!==m&&(l=!0),d.push(h)}let f=a.rest;return a.rest&&(f=u(a.rest),f!==a.rest&&(l=!0)),l?clone(o,{...a,items:d,rest:f}):o}case"record":case"map":{const c=u(a.keyType),l=u(a.valueType);return c===a.keyType&&l===a.valueType?o:clone(o,{...a,keyType:c,valueType:l})}case"set":{const c=u(a.valueType);return c===a.valueType?o:clone(o,{...a,valueType:c})}case"union":{const c=a.options;let l=!1;const d=[];for(const f of c){const m=u(f);m!==f&&(l=!0),d.push(m)}return l?clone(o,{...a,options:d}):o}case"intersection":{const c=u(a.left),l=u(a.right);return c===a.left&&l===a.right?o:clone(o,{...a,left:c,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{const c=u(a.innerType);return c===a.innerType?o:clone(o,{...a,innerType:c})}case"pipe":{const c=u(a.in),l=u(a.out);return c===a.in&&l===a.out?o:clone(o,{...a,in:c,out:l})}case"function":{const c=u(a.input),l=u(a.output);return c===a.input&&l===a.output?o:clone(o,{...a,input:c,output:l})}case"lazy":{const c=a.getter,{_cachedInner:l,...d}=a;return clone(o,{...d,getter:()=>u(c())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return o;default:return o}}return u(e)}function deepPartial(e){return visit(e,{object:t=>t.partial(),union:t=>{const n=t._zod.def;return n.discriminator===void 0?t:union(n.options)}})}function withChecks(e,t){if(!t?.length)return e;const n=e._zod.def;return clone(e,mergeDefs(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function outSide(e){return withChecks(e.out,e.checks)}function inSide(e){return e.in._zod.traits.has("$ZodTransform")?outSide(e):e.in}function input(e){return visit(e,{pipe:t=>inSide(t._zod.def),default:(t,n)=>n?optional(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function output(e){return visit(e,{pipe:t=>outSide(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var coerce_exports={};__export(coerce_exports,{bigint:()=>bigint3,boolean:()=>boolean3,date:()=>date4,number:()=>number3,string:()=>string3});function string3(e){return _coercedString(ZodString,e)}function number3(e){return _coercedNumber(ZodNumber,e)}function boolean3(e){return _coercedBoolean(ZodBoolean,e)}function bigint3(e){return _coercedBigint(ZodBigInt,e)}function date4(e){return _coercedDate(ZodDate,e)}var SHA256=external_exports.string().regex(/^[0-9a-f]{64}$/u,"A sha256 is 64 lowercase hexadecimal digits."),SECONDS=external_exports.number().nonnegative(),INSTANT=external_exports.iso.datetime({offset:!0});function dataFile(e){return external_exports.strictObject({$schema:external_exports.string().optional(),...e})}var TargetSchema=external_exports.discriminatedUnion("type",[external_exports.strictObject({type:external_exports.literal("quote"),exact:external_exports.string().min(1),prefix:external_exports.string().optional(),suffix:external_exports.string().optional()}),external_exports.strictObject({type:external_exports.literal("cells"),range:external_exports.string().regex(/^[A-Z]+[1-9]\d*(?::[A-Z]+[1-9]\d*)?$/u)}),external_exports.strictObject({type:external_exports.literal("item")})]),AuthorSchema=external_exports.strictObject({kind:external_exports.enum(["person","agent"]),name:external_exports.string().min(1)}),CommentSchema=external_exports.strictObject({id:external_exports.string().min(1),author:AuthorSchema,text:external_exports.string().min(1),at:INSTANT}),ThreadSchema=external_exports.strictObject({id:external_exports.string().min(1),target:TargetSchema,resolved:external_exports.boolean().default(!1),comments:external_exports.array(CommentSchema).min(1)}),CommentsFileSchema=dataFile({version:external_exports.literal(1),threads:external_exports.array(ThreadSchema).default([])}),ConfigSchema=external_exports.strictObject({fonts:external_exports.array(external_exports.string().min(1)).default([]),text:external_exports.string().optional(),locales:external_exports.array(external_exports.string().min(2)).min(1).optional(),look:external_exports.record(external_exports.string(),external_exports.unknown()).optional(),defaults:external_exports.record(external_exports.string(),external_exports.unknown()).optional()}),Stretch=external_exports.strictObject({from:SECONDS,to:SECONDS}).refine(e=>e.to>e.from,{message:"A stretch ends after its start.",path:["to"]}),PAD_MAX=2,PAD_SIDE=external_exports.number().min(0).max(PAD_MAX),EditsFileSchema=dataFile({version:external_exports.literal(1),take:external_exports.string().optional(),remove:external_exports.array(external_exports.strictObject({from:external_exports.int().nonnegative(),to:external_exports.int().nonnegative(),text:external_exports.string().optional()}).refine(e=>e.to>=e.from,{message:"A range ends at or after its start.",path:["to"]})).optional(),sounds:external_exports.array(Stretch).optional(),inWord:external_exports.array(Stretch).optional(),maxPause:external_exports.number().min(.05).max(10).optional(),pad:external_exports.strictObject({before:PAD_SIDE.optional(),after:PAD_SIDE.optional()}).optional()}),ElementBoxSchema=external_exports.tuple([external_exports.number(),external_exports.number(),external_exports.number().nonnegative(),external_exports.number().nonnegative()]),ElementsFileSchema=external_exports.record(external_exports.string().min(1),ElementBoxSchema),Omitted=external_exports.strictObject({omitted:external_exports.literal(!0),sha256:SHA256,bytes:external_exports.int().nonnegative()}),GenFileSchema=dataFile({version:external_exports.literal(1),ai:external_exports.boolean(),tool:external_exports.string().optional(),model:external_exports.string().optional(),input:external_exports.record(external_exports.string(),external_exports.unknown()).optional(),inputHash:SHA256.optional(),output:external_exports.record(external_exports.string(),external_exports.unknown()).optional(),credits:external_exports.number().nonnegative().optional(),at:INSTANT,sha256:SHA256,bytes:external_exports.int().nonnegative(),source:external_exports.strictObject({library:external_exports.string(),page:external_exports.url(),authors:external_exports.array(external_exports.string()).default([]),license:external_exports.string()}).optional()}),MESSAGE_KEY=/^[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*$/u,SpokenSchema=external_exports.strictObject({display:external_exports.string(),speak:external_exports.string()}),VariantsSchema=external_exports.strictObject({declarations:external_exports.array(external_exports.string()).default([]),selectors:external_exports.array(external_exports.string()).default([]),match:external_exports.record(external_exports.string(),external_exports.string()).refine(e=>Object.keys(e).length>0,"A match needs at least one case.")}),MessageSchema=external_exports.union([external_exports.string(),SpokenSchema,external_exports.tuple([VariantsSchema])]),MessagesFileSchema=external_exports.record(external_exports.string(),external_exports.unknown()).superRefine((e,t)=>{for(const[n,r]of Object.entries(e)){if(n==="$schema"){typeof r!="string"&&t.addIssue({code:"custom",path:[n],message:"$schema is a string."});continue}MESSAGE_KEY.test(n)||t.addIssue({code:"custom",path:[n],message:`"${n}" is not a message key: letters, digits, _ and -, in segments joined by dots.`});const u=MessageSchema.safeParse(r);u.success||t.addIssue({code:"custom",path:[n],message:Array.isArray(r)?`A message with variants is [{ "declarations": […], "selectors": […], "match": {…} }]: ${u.error.issues.map(i=>i.message).join("; ")}`:"A message is a string, { display, speak }, or [{ declarations, selectors, match }]."})}}).transform(e=>{const t={...e};return delete t.$schema,t}),SHARE_BOX=external_exports.tuple([external_exports.number(),external_exports.number(),external_exports.number(),external_exports.number()]),SCORED=external_exports.object({t:SECONDS,score:external_exports.number()}),MAYBE=external_exports.number().nullable(),COUNT=external_exports.number().int().nonnegative(),ReferenceSentenceSchema=external_exports.object({index:COUNT,start:SECONDS,end:SECONDS,words:external_exports.tuple([external_exports.number().int(),external_exports.number().int()]),text:external_exports.string(),punctuation:external_exports.boolean(),pauseAfter:SECONDS.optional()}),ReferenceGapSchema=external_exports.object({after:COUNT,start:SECONDS,end:SECONDS,dur:SECONDS}),ReferenceBoundarySchema=external_exports.object({t:SECONDS,cut:SCORED.optional(),weak:SCORED.optional(),pause:external_exports.object({start:SECONDS,end:SECONDS,dur:SECONDS}).optional(),sentence:COUNT.optional()}),ReferenceTextSchema=external_exports.object({id:COUNT,text:external_exports.string(),box:SHARE_BOX,height:external_exports.number(),conf:external_exports.number(),words:COUNT,upper:external_exports.number().min(0).max(1),start:SECONDS,end:SECONDS,spans:external_exports.array(external_exports.tuple([SECONDS,SECONDS])),seconds:SECONDS,seen:external_exports.number().int().positive(),frames:external_exports.number().min(0).max(1),spread:external_exports.number().min(0).max(1),said:external_exports.number().min(0).max(1)}),SectionNumbersSchema=external_exports.object({start:SECONDS,end:SECONDS,dur:SECONDS,said:external_exports.string(),words:COUNT,wordsPerMinute:external_exports.number().nonnegative(),cuts:external_exports.array(SECONDS),shots:external_exports.number().int().positive(),cutsPerMinute:external_exports.number().nonnegative(),text:external_exports.array(COUNT),textSeconds:SECONDS}),ReferenceSegmentSchema=SectionNumbersSchema.extend({index:COUNT,name:external_exports.string(),sentences:external_exports.tuple([external_exports.number().int(),external_exports.number().int()]).optional()}),ReferencePacingSchema=external_exports.object({cutsPerMinute:external_exports.number().nonnegative(),meanShot:SECONDS,medianShot:SECONDS,wordsPerMinute:external_exports.number().nonnegative(),speakingRate:external_exports.number().nonnegative(),timeToFirstWord:SECONDS.optional(),timeToFirstCut:SECONDS.optional(),textShare:external_exports.number().min(0).max(1),speechShare:external_exports.number().min(0).max(1),tempo:external_exports.object({bpm:external_exports.number().positive(),confidence:external_exports.number().min(0),candidates:external_exports.array(external_exports.object({bpm:external_exports.number(),r:external_exports.number(),score:external_exports.number()})).optional(),prior:external_exports.number().optional()}).optional(),onsetsPerMinute:external_exports.number().nonnegative()}),LEVELS=external_exports.object({seconds:SECONDS,p10:external_exports.number(),median:external_exports.number(),p90:external_exports.number()}),ReferenceSoundSchema=external_exports.object({gap:SECONDS,edge:SECONDS,voiced:external_exports.number().min(0).max(100),whole:LEVELS,words:LEVELS.optional(),between:LEVELS.extend({voicedShare:external_exports.number().min(0).max(1),onsetsPerMinute:external_exports.number().nonnegative()}).optional(),floor:external_exports.number()}),ReferencePictureSchema=external_exports.object({params:external_exports.record(external_exports.string(),external_exports.unknown()),frames:external_exports.object({tone:COUNT,color:COUNT,motion:COUNT}),luma:external_exports.object({p1:MAYBE,p50:MAYBE,p99:MAYBE}),blackShare:MAYBE,noise:MAYBE,sharpness:MAYBE,saturation:MAYBE,warmth:MAYBE,motion:external_exports.object({speed:external_exports.object({p50:MAYBE,p90:MAYBE}),shake:external_exports.object({p50:MAYBE,p90:MAYBE}),stillShare:MAYBE,runs:COUNT}),sharpnessBySpeed:external_exports.array(external_exports.object({from:external_exports.number(),to:MAYBE,frames:COUNT,sharpness:MAYBE})),noiseByLuma:external_exports.array(external_exports.object({from:external_exports.number(),to:external_exports.number(),blocks:COUNT,noise:MAYBE,median:MAYBE})),shake:external_exports.array(external_exports.object({start:SECONDS,end:SECONDS,rms:external_exports.number(),peaks:external_exports.array(external_exports.object({hz:external_exports.number(),share:external_exports.number()})),flatness:external_exports.number()}))}),BANDWIDTH=external_exports.object({frames:COUNT,reach:external_exports.array(external_exports.object({drop:external_exports.number(),hz:MAYBE})),rolloff95:MAYBE,rolloff99:MAYBE,steps:external_exports.array(external_exports.object({hz:external_exports.number(),db:external_exports.number()}))}),ReferenceAudioSchema=external_exports.object({loudness:external_exports.object({integrated:MAYBE,range:MAYBE,truePeak:MAYBE}),recording:external_exports.object({params:external_exports.record(external_exports.string(),external_exports.unknown()),spectrum:external_exports.array(external_exports.object({hz:external_exports.number(),db:external_exports.number()})),dynamics:external_exports.object({spread:external_exports.number(),crest:external_exports.number()})}).loose(),bandwidth:BANDWIDTH.extend({params:external_exports.record(external_exports.string(),external_exports.unknown())}),voice:BANDWIDTH.optional()}),ReferenceSchema=external_exports.object({version:external_exports.literal(1),id:external_exports.string(),source:external_exports.object({file:external_exports.string(),url:external_exports.string().optional(),title:external_exports.string().optional(),sha256:SHA256}),analysedAt:external_exports.string(),duration:SECONDS,width:external_exports.number().int().positive(),height:external_exports.number().int().positive(),fps:external_exports.number().positive(),encoding:external_exports.object({codec:external_exports.string().optional(),bitrate:external_exports.number().positive().optional(),audio:external_exports.object({codec:external_exports.string().optional(),profile:external_exports.string().optional(),bitrate:external_exports.number().positive().optional(),rate:external_exports.number().positive().optional(),channels:external_exports.number().int().positive().optional()}).optional()}).optional(),words:external_exports.string().optional(),wordCount:COUNT,asr:external_exports.string().optional(),wordsMissing:external_exports.object({code:external_exports.string().optional(),message:external_exports.string(),hint:external_exports.string().optional(),instead:external_exports.string()}).optional(),shots:external_exports.object({threshold:external_exports.number().min(0).max(1),minShot:external_exports.number().nonnegative(),weakFloor:external_exports.number().min(0).max(1),prominence:external_exports.number().nonnegative(),cuts:external_exports.array(SCORED),weak:external_exports.array(SCORED),candidates:external_exports.array(external_exports.object({t:SECONDS,score:external_exports.number(),source:external_exports.enum(["jump","change"]),around:external_exports.number(),passes:external_exports.boolean()})).optional()}),speech:external_exports.object({pause:SECONDS,sentences:external_exports.array(ReferenceSentenceSchema),pauses:external_exports.array(ReferenceGapSchema),gaps:external_exports.array(ReferenceGapSchema).optional()}),boundaries:external_exports.object({cutWithin:SECONDS,candidates:external_exports.array(ReferenceBoundarySchema)}),ocr:external_exports.object({engine:external_exports.string(),confidence:external_exports.object({word:external_exports.number().min(0).max(100),short:external_exports.number().min(0).max(100)}),frames:COUNT,samePlace:external_exports.number(),saidWithin:SECONDS,low:external_exports.array(external_exports.object({t:SECONDS,text:external_exports.string(),conf:external_exports.number(),box:SHARE_BOX})).optional()}),text:external_exports.array(ReferenceTextSchema),pacing:ReferencePacingSchema,sound:ReferenceSoundSchema.optional(),segments:external_exports.object({rule:external_exports.string(),pause:SECONDS,cutWithin:SECONDS,minLength:SECONDS,list:external_exports.array(ReferenceSegmentSchema).min(1)}),sheets:external_exports.array(external_exports.string()),picture:ReferencePictureSchema,audio:ReferenceAudioSchema.optional()}),InterpretedSectionSchema=external_exports.strictObject({start:SECONDS,end:SECONDS,name:external_exports.string().min(1).optional(),role:external_exports.string().min(1).optional(),picture:external_exports.string().optional(),onScreen:external_exports.array(external_exports.string()).optional(),notes:external_exports.string().optional()}),InterpretationSchema=dataFile({version:external_exports.literal(1).default(1),summary:external_exports.string().optional(),layout:external_exports.string().optional(),hook:external_exports.string().optional(),sections:external_exports.array(InterpretedSectionSchema).min(1),captions:external_exports.strictObject({lines:external_exports.array(COUNT).optional(),style:external_exports.string().optional()}).optional(),watermarks:external_exports.array(COUNT).optional(),notes:external_exports.string().optional(),labels:external_exports.record(external_exports.string(),external_exports.union([external_exports.string(),external_exports.number(),external_exports.boolean(),external_exports.array(external_exports.string())])).optional()}),SCRIPT_NAME=/^[A-Za-z0-9_-]+$/u,NamedSchema=external_exports.string().regex(SCRIPT_NAME,"A name is letters, digits, _ and -."),ScriptTextSchema=external_exports.lazy(()=>external_exports.union([external_exports.string(),SpokenSchema,VariantsSchema,external_exports.array(ScriptTextSchema),external_exports.record(NamedSchema,ScriptTextSchema)])),ScriptPartSchema=external_exports.strictObject({id:NamedSchema,say:external_exports.union([external_exports.string(),VariantsSchema]).optional(),screen:external_exports.record(NamedSchema,ScriptTextSchema).optional()}),ScriptSlideSchema=external_exports.strictObject({id:NamedSchema,text:external_exports.record(NamedSchema,ScriptTextSchema).optional(),notes:external_exports.union([external_exports.string(),VariantsSchema]).optional()}),ScriptFileSchema=external_exports.strictObject({title:external_exports.string().optional(),text:external_exports.record(NamedSchema,ScriptTextSchema).optional(),parts:external_exports.array(ScriptPartSchema).default([]),slides:external_exports.array(ScriptSlideSchema).default([])}).superRefine((e,t)=>{const n=new Set;e.parts.forEach((u,i)=>{n.has(u.id)&&t.addIssue({code:"custom",path:["parts",i,"id"],message:`Two parts are "${u.id}".`}),n.add(u.id)});const r=new Set;e.slides.forEach((u,i)=>{r.has(u.id)&&t.addIssue({code:"custom",path:["slides",i,"id"],message:`Two slides are "${u.id}".`}),r.add(u.id)})}),SLIDES_FILE="slides.yaml",NameSchema=external_exports.string().regex(SCRIPT_NAME,"A name is letters, digits, _ and -."),THEME_COLORS=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],TEXT_ALIGNS=["l","ctr","r","just"],SHAPE_GEOMETRIES=["rect","roundRect","ellipse","triangle","rightArrow","line"],ANIMATION_EFFECTS=["appear","fade","wipe","fly-in","zoom","disappear","fade-out","wipe-out","fly-out","zoom-out","pulse","path"],ANIMATION_STARTS=["on-click","with-previous","after-previous"],ANIMATION_DIRECTIONS=["from-bottom","from-top","from-left","from-right"],LINE_DASHES=["solid","sysDash","sysDot","dash","dashDot","lgDash","lgDashDot","lgDashDotDot"],LINE_ENDS=["none","triangle","arrow","stealth","diamond","oval"],FrameSchema=external_exports.strictObject({x:external_exports.number(),y:external_exports.number(),w:external_exports.number().nonnegative(),h:external_exports.number().nonnegative()}),ColorFileSchema=external_exports.union([external_exports.enum(THEME_COLORS),external_exports.string().regex(/^#[0-9A-Fa-f]{6}$/u,"a theme colour or #RRGGBB")]),TextStyleSchema=external_exports.strictObject({size:external_exports.number().positive().max(4e3).optional(),bold:external_exports.boolean().optional(),italic:external_exports.boolean().optional(),color:ColorFileSchema.optional(),font:external_exports.string().min(1).optional(),align:external_exports.enum(TEXT_ALIGNS).optional()}),CropSchema=external_exports.strictObject({left:external_exports.number().min(0).max(1).optional(),top:external_exports.number().min(0).max(1).optional(),right:external_exports.number().min(0).max(1).optional(),bottom:external_exports.number().min(0).max(1).optional()}),PropValueSchema=external_exports.lazy(()=>external_exports.union([external_exports.string(),external_exports.number(),external_exports.boolean(),external_exports.null(),external_exports.array(PropValueSchema),external_exports.record(external_exports.string(),PropValueSchema)])),CHART_TYPES=["column-clustered","column-stacked","column-stacked-100","bar-clustered","bar-stacked","bar-stacked-100","line","line-markers","area","area-stacked","area-stacked-100","pie","doughnut"],SHEET_CHART_TYPES=[...CHART_TYPES,"scatter","scatter-lines","scatter-smooth"],CHART_LEGEND_POSITIONS=["bottom","top","left","right"],ChartAxisSchema=external_exports.strictObject({min:external_exports.number().optional(),max:external_exports.number().optional(),major:external_exports.number().positive().optional(),gridlines:external_exports.boolean().optional(),visible:external_exports.boolean().optional(),format:external_exports.string().min(1).optional(),reverse:external_exports.boolean().optional(),gridline_color:ColorFileSchema.optional(),line_color:ColorFileSchema.optional()}),ChartSchema=external_exports.strictObject({type:external_exports.enum(CHART_TYPES),data:external_exports.string().min(1).optional(),categories:external_exports.union([external_exports.string().min(1),external_exports.array(external_exports.string())]),series:external_exports.array(external_exports.union([external_exports.string().min(1),external_exports.strictObject({name:external_exports.string().min(1),values:external_exports.array(external_exports.number().nullable()).optional(),color:ColorFileSchema.optional(),format:external_exports.string().min(1).optional(),smooth:external_exports.boolean().optional(),line_width:external_exports.number().positive().optional(),marker_size:external_exports.number().int().min(2).max(72).optional()})])).min(1),legend:external_exports.enum(CHART_LEGEND_POSITIONS).optional(),labels:external_exports.union([external_exports.boolean(),external_exports.strictObject({value:external_exports.boolean().optional(),percentage:external_exports.boolean().optional(),category:external_exports.boolean().optional(),series:external_exports.boolean().optional(),format:external_exports.string().min(1).optional(),position:external_exports.enum(["outEnd","inEnd","ctr","inBase","t","b","l","r","bestFit"]).optional(),size:external_exports.number().positive().optional(),color:ColorFileSchema.optional()})]).optional(),gap_width:external_exports.number().min(0).max(500).optional(),overlap:external_exports.number().min(-100).max(100).optional(),vary_by_categories:external_exports.boolean().optional(),hole_size:external_exports.number().min(10).max(90).optional(),value_axis:ChartAxisSchema.optional(),category_axis:ChartAxisSchema.optional(),size:external_exports.number().positive().optional(),title_size:external_exports.number().positive().optional(),color:ColorFileSchema.optional()}),ShapeSchema=external_exports.strictObject({frame:FrameSchema.optional(),z:external_exports.int().optional(),fill:ColorFileSchema.optional(),line:external_exports.union([ColorFileSchema,external_exports.literal("none")]).optional(),line_width:external_exports.number().positive().max(1584).optional(),line_dash:external_exports.enum(LINE_DASHES).optional(),line_begin:external_exports.enum(LINE_ENDS).optional(),line_end:external_exports.enum(LINE_ENDS).optional(),text:TextStyleSchema.optional(),textbox:external_exports.literal(!0).optional(),picture:external_exports.string().min(1).optional(),crop:CropSchema.optional(),movie:external_exports.string().min(1).optional(),poster:external_exports.number().min(0).optional(),geometry:external_exports.enum(SHAPE_GEOMETRIES).optional(),path:external_exports.strictObject({w:external_exports.number().positive(),h:external_exports.number().positive(),d:external_exports.string().min(1)}).optional(),table:external_exports.strictObject({columns:external_exports.array(external_exports.number().positive()).min(1),rows:external_exports.array(external_exports.strictObject({height:external_exports.number().positive(),fill:ColorFileSchema.optional(),text:TextStyleSchema.optional(),line:ColorFileSchema.optional()})).min(1)}).optional(),chart:ChartSchema.optional(),group:NameSchema.optional(),component:NameSchema.optional(),props:external_exports.record(external_exports.string(),PropValueSchema).optional()}),SHAPE_KINDS=["textbox","picture","movie","geometry","path","table","chart","component"],SLIDE_TRANSITIONS=["fade","push","wipe","morph"],TransitionSchema=external_exports.strictObject({type:external_exports.enum(SLIDE_TRANSITIONS),direction:external_exports.enum(ANIMATION_DIRECTIONS).optional(),duration:external_exports.number().positive().optional()}),AnimationSchema=external_exports.strictObject({shape:external_exports.string().min(1),paragraph:external_exports.int().min(0).optional(),effect:external_exports.enum(ANIMATION_EFFECTS),direction:external_exports.enum(ANIMATION_DIRECTIONS).optional(),start:external_exports.enum(ANIMATION_STARTS).optional(),duration:external_exports.number().min(0).optional(),delay:external_exports.number().min(0).optional(),path:external_exports.string().min(1).optional()}),SlideSchema=external_exports.strictObject({id:NameSchema,layout:external_exports.string().min(1).optional(),generate:NameSchema.optional(),hidden:external_exports.union([external_exports.literal(!0),external_exports.array(external_exports.string())]).optional(),shapes:external_exports.record(external_exports.string().min(1),ShapeSchema).optional(),animations:external_exports.array(AnimationSchema).optional(),transition:TransitionSchema.optional()}),SlidesFileSchema=external_exports.strictObject({slides:external_exports.array(SlideSchema).default([])}).superRefine((e,t)=>{const n=new Set;e.slides.forEach((r,u)=>{n.has(r.id)&&t.addIssue({code:"custom",path:["slides",u,"id"],message:`Two slides are "${r.id}".`}),n.add(r.id),(r.layout===void 0?0:1)+(r.generate===void 0?0:1)!==1&&t.addIssue({code:"custom",path:["slides",u],message:`Slide ${r.id} has a layout or a generator: one of them.`}),r.hidden!==void 0&&r.generate===void 0&&r.hidden!==!0&&t.addIssue({code:"custom",path:["slides",u,"hidden"],message:`Slide ${r.id} is hidden (true); a list of ids is a generated block's.`});for(const[o,a]of Object.entries(r.shapes??{})){const s=SHAPE_KINDS.filter(d=>a[d]!==void 0);s.length>1&&t.addIssue({code:"custom",path:["slides",u,"shapes",o],message:`Shape ${o} is one kind of shape, not ${s.join(" and ")}.`});const c=o.includes("/")?o.split("/"):[o];(!(c.length<=2&&c.every(d=>SCRIPT_NAME.test(d)))||c.length===2&&r.generate===void 0)&&t.addIssue({code:"custom",path:["slides",u,"shapes",o],message:"A shape's name is letters, digits, _ and -; <slide>/<shape> only in a generated block."})}})}),SHEET_FILE="sheet.yaml",Color=external_exports.string().regex(/^#[0-9a-fA-F]{6}$/u,"A colour is #RRGGBB."),SHEET_ALIGNS=["general","left","center","right","fill","justify","centerContinuous","distributed"],SHEET_VALIGNS=["top","center","bottom","justify","distributed"],SHEET_UNDERLINES=["single","double","singleAccounting","doubleAccounting"],SHEET_BORDERS=["none","thin","medium","thick","double","hair","dotted","dashed","dashDot","dashDotDot","mediumDashed","mediumDashDot","mediumDashDotDot","slantDashDot"],SHEET_PATTERNS=["solid","darkDown","darkGray","darkGrid","darkHorizontal","darkTrellis","darkUp","darkVertical","gray0625","gray125","lightDown","lightGray","lightGrid","lightHorizontal","lightTrellis","lightUp","lightVertical","mediumGray"],Side=external_exports.strictObject({style:external_exports.enum(SHEET_BORDERS),color:Color.optional()}),LookFields={bold:external_exports.boolean().optional(),italic:external_exports.boolean().optional(),underline:external_exports.union([external_exports.boolean(),external_exports.enum(SHEET_UNDERLINES)]).optional(),strike:external_exports.boolean().optional(),font:external_exports.string().min(1).optional(),size:external_exports.number().positive().optional(),color:Color.optional(),fill:external_exports.union([Color,external_exports.strictObject({pattern:external_exports.enum(SHEET_PATTERNS),color:Color.optional(),background:Color.optional()})]).optional(),align:external_exports.enum(SHEET_ALIGNS).optional(),valign:external_exports.enum(SHEET_VALIGNS).optional(),wrap:external_exports.boolean().optional(),shrink:external_exports.boolean().optional(),indent:external_exports.number().int().min(0).optional(),rotation:external_exports.number().int().min(-90).max(180).optional(),border:external_exports.strictObject({left:Side.optional(),right:Side.optional(),top:Side.optional(),bottom:Side.optional()}).optional()},Styled={...LookFields,format:external_exports.string().min(1).optional()},Scalar=external_exports.union([external_exports.number(),external_exports.boolean(),external_exports.string(),external_exports.null()]),CellLong=external_exports.strictObject({value:Scalar.optional(),formula:external_exports.string().min(1).optional(),name:external_exports.string().min(1).optional(),...Styled}).refine(e=>e.value===void 0||e.formula===void 0,{message:"A cell has a value or a formula, not both."}),CellEntry=external_exports.union([Scalar,CellLong]),FormatEntry=external_exports.strictObject({range:external_exports.string().min(1),...Styled}),FilesColumn=external_exports.union([external_exports.literal(!0),external_exports.strictObject({separator:external_exports.string().min(1).optional(),height:external_exports.number().positive().optional()})]),TableColumn=external_exports.strictObject({formula:external_exports.string().min(1).optional(),...Styled,width:external_exports.number().positive().optional(),files:FilesColumn.optional()}),FilterColumn=external_exports.strictObject({values:external_exports.array(external_exports.string()).optional(),blanks:external_exports.boolean().optional()}),Table=external_exports.strictObject({name:external_exports.string().min(1),at:external_exports.string().min(1),rows:external_exports.string().min(1),key:external_exports.string().min(1).optional(),style:external_exports.string().min(1).optional(),columns:external_exports.record(external_exports.string(),TableColumn).optional(),filter:external_exports.union([external_exports.literal(!1),external_exports.strictObject({columns:external_exports.record(external_exports.string(),FilterColumn)})]).optional()}),Block=external_exports.strictObject({at:external_exports.string().min(1),rows:external_exports.string().min(1)}),ColumnEntry=external_exports.strictObject({width:external_exports.number().positive().optional(),hidden:external_exports.boolean().optional(),...Styled,files:FilesColumn.optional()}),RowEntry=external_exports.strictObject({height:external_exports.number().positive().optional(),hidden:external_exports.boolean().optional(),...Styled}),SheetFilter=external_exports.strictObject({range:external_exports.string().min(1),columns:external_exports.record(external_exports.string(),FilterColumn).optional()}),SHEET_OPERATORS=["between","notBetween","equal","notEqual","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual"],Bound=external_exports.union([external_exports.number(),external_exports.string()]),RuleLook={bold:external_exports.boolean().optional(),italic:external_exports.boolean().optional(),underline:external_exports.boolean().optional(),strike:external_exports.boolean().optional(),color:Color.optional(),fill:Color.optional(),border:LookFields.border},RuleBase={range:external_exports.string().min(1),stop:external_exports.boolean().optional()},Stop=external_exports.strictObject({at:external_exports.enum(["min","max","num","percent","percentile","formula"]),value:Bound.optional()}),SHEET_ICONS=["3Arrows","3ArrowsGray","3Flags","3TrafficLights1","3TrafficLights2","3Signs","3Symbols","3Symbols2","4Arrows","4ArrowsGray","4RedToBlack","4Rating","4TrafficLights","5Arrows","5ArrowsGray","5Rating","5Quarters"],Conditional=external_exports.discriminatedUnion("type",[external_exports.strictObject({...RuleBase,...RuleLook,type:external_exports.literal("cellIs"),operator:external_exports.enum(SHEET_OPERATORS),formula:external_exports.array(Bound).min(1).max(2)}),external_exports.strictObject({...RuleBase,...RuleLook,type:external_exports.literal("containsText"),operator:external_exports.enum(["contains","notContains","beginsWith","endsWith"]).optional(),text:external_exports.string()}),external_exports.strictObject({...RuleBase,...RuleLook,type:external_exports.enum(["duplicateValues","uniqueValues"])}),external_exports.strictObject({...RuleBase,...RuleLook,type:external_exports.literal("top10"),rank:external_exports.number().int().positive(),percent:external_exports.boolean().optional(),bottom:external_exports.boolean().optional()}),external_exports.strictObject({...RuleBase,...RuleLook,type:external_exports.literal("aboveAverage"),below:external_exports.boolean().optional(),equal:external_exports.boolean().optional()}),external_exports.strictObject({...RuleBase,...RuleLook,type:external_exports.literal("expression"),formula:external_exports.string().min(1)}),external_exports.strictObject({...RuleBase,type:external_exports.literal("dataBar"),color:Color,min:Stop.optional(),max:Stop.optional(),show:external_exports.boolean().optional()}),external_exports.strictObject({...RuleBase,type:external_exports.literal("colorScale"),stops:external_exports.array(external_exports.strictObject({...Stop.shape,color:Color})).min(2).max(3)}),external_exports.strictObject({...RuleBase,type:external_exports.literal("iconSet"),icons:external_exports.enum(SHEET_ICONS),stops:external_exports.array(Stop).min(3).max(5).optional(),reverse:external_exports.boolean().optional(),show:external_exports.boolean().optional()})]),SHEET_VALIDATIONS=["whole","decimal","list","date","time","textLength","custom"],Validation=external_exports.strictObject({range:external_exports.string().min(1),type:external_exports.enum(SHEET_VALIDATIONS),operator:external_exports.enum(SHEET_OPERATORS).optional(),formula:external_exports.array(Bound).max(2).optional(),values:external_exports.array(external_exports.string()).optional(),multiple:external_exports.boolean().optional(),separator:external_exports.string().min(1).optional(),blank:external_exports.boolean().optional(),dropdown:external_exports.boolean().optional(),prompt:external_exports.strictObject({title:external_exports.string().optional(),message:external_exports.string().optional(),show:external_exports.boolean().optional()}).optional(),error:external_exports.strictObject({style:external_exports.enum(["stop","warning","information"]).optional(),title:external_exports.string().optional(),message:external_exports.string().optional(),show:external_exports.boolean().optional()}).optional()}),ChartSeries=external_exports.strictObject({values:external_exports.string().min(1),x:external_exports.string().min(1).optional(),name:external_exports.string().optional(),color:Color.optional(),format:external_exports.string().min(1).optional(),smooth:external_exports.boolean().optional(),line_width:external_exports.number().positive().optional(),marker_size:external_exports.number().int().min(2).max(72).optional()}),ChartAxis=external_exports.strictObject({title:external_exports.string().optional(),min:external_exports.number().optional(),max:external_exports.number().optional(),major:external_exports.number().positive().optional(),gridlines:external_exports.boolean().optional(),visible:external_exports.boolean().optional(),format:external_exports.string().min(1).optional(),reverse:external_exports.boolean().optional()}),Chart=external_exports.strictObject({type:external_exports.enum(SHEET_CHART_TYPES),at:external_exports.string().min(1),x:external_exports.number().min(0).optional(),y:external_exports.number().min(0).optional(),width:external_exports.number().positive().optional(),height:external_exports.number().positive().optional(),title:external_exports.string().optional(),categories:external_exports.string().min(1).optional(),series:external_exports.array(ChartSeries).min(1),legend:external_exports.enum(CHART_LEGEND_POSITIONS).optional(),labels:ChartSchema.shape.labels,gap_width:ChartSchema.shape.gap_width,overlap:ChartSchema.shape.overlap,vary_by_categories:ChartSchema.shape.vary_by_categories,hole_size:ChartSchema.shape.hole_size,value_axis:ChartAxis.optional(),category_axis:ChartAxis.optional(),size:external_exports.number().positive().optional(),title_size:external_exports.number().positive().optional(),color:Color.optional()}),Worksheet=external_exports.strictObject({name:external_exports.string().min(1),hidden:external_exports.boolean().optional(),gridlines:external_exports.boolean().optional(),tab:Color.optional(),freeze:external_exports.string().min(1).optional(),tables:external_exports.array(Table).optional(),columns:external_exports.record(external_exports.string(),ColumnEntry).optional(),rows:external_exports.record(external_exports.string(),RowEntry).optional(),cells:external_exports.record(external_exports.string(),CellEntry).optional(),format:external_exports.array(FormatEntry).optional(),merges:external_exports.array(external_exports.string().min(1)).optional(),blocks:external_exports.array(Block).optional(),filter:SheetFilter.optional(),conditional:external_exports.array(Conditional).optional(),validations:external_exports.array(Validation).optional(),charts:external_exports.array(Chart).optional()}),Check=external_exports.strictObject({name:external_exports.string().min(1),formula:external_exports.string().min(1)}),SheetFileSchema=external_exports.strictObject({title:external_exports.string().optional(),names:external_exports.record(external_exports.string(),Scalar).optional(),sheets:external_exports.array(Worksheet).min(1),checks:external_exports.array(Check).optional(),scenarios:external_exports.record(external_exports.string(),external_exports.record(external_exports.string(),Scalar)).optional()}),WordSchema=external_exports.strictObject({text:external_exports.string().min(1),start:SECONDS,end:SECONDS,confidence:external_exports.number().min(0).max(1).optional()}).refine(e=>e.end>=e.start,{message:"A word ends at or after its start.",path:["end"]}),WordsFileSchema=dataFile({version:external_exports.literal(1),language:external_exports.string().min(2).optional(),duration:SECONDS.optional(),model:external_exports.string().optional(),words:external_exports.array(WordSchema)}).refine(e=>e.words.every((t,n)=>n===0||t.start>=(e.words[n-1]?.start??0)),{message:"Words are in the order they are said.",path:["words"]}),DATA_FILES={words:{schema:WordsFileSchema,files:["**/*.words.json"],about:"The words said in an audio or video file, with their times."},edits:{schema:EditsFileSchema,files:["**/edits/*.json"],about:"A recording's cut list."},elements:{schema:ElementsFileSchema,files:["**/*.elements.json"],about:"A page screenshot's named elements, each its box in the picture's pixels."},gen:{schema:GenFileSchema,files:["**/*.gen.json"],about:"How a media file was made, and where it came from."},comments:{schema:CommentsFileSchema,files:["**/comments.json"],about:"What was said about an item, in threads."},script:{schema:ScriptFileSchema,files:["**/script.*.yaml"],about:"An item's words in one language."},messages:{schema:MessagesFileSchema,files:["assets/text/*.json"],about:"Words several items share, in one language."},sheet:{schema:SheetFileSchema,files:[`**/${SHEET_FILE}`],about:"A workbook: its sheets, cells, formulas, formats, names, checks and scenarios."},slides:{schema:SlidesFileSchema,files:["**/slides.yaml"],about:"A deck's pages: their order, layouts, values and what was placed on them."},interpretation:{schema:InterpretationSchema,files:["**/reference/*/interpretation.json"],about:"What the agent concludes of a reference video: its sections, captions, watermarks and labels."},config:{schema:ConfigSchema,files:[],about:"allyhub.config.ts's settings."}};function publicNames(e){const t=new Set;for(let n=e;n!==null&&n!==Object.prototype;n=Object.getPrototypeOf(n))for(const r of Object.getOwnPropertyNames(n))r!=="constructor"&&!r.startsWith("_")&&t.add(r);return[...t].sort()}var PROBED=new Set(["then","toJSON","constructor","length"]),hasSetter=(e,t)=>{for(let n=e;n!==null;n=Object.getPrototypeOf(n)){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r.set!==void 0||"value"in r}return!1};function distance(e,t){let n=Array.from({length:t.length+1},(r,u)=>u);for(let r=1;r<=e.length;r++){const u=[r];for(let i=1;i<=t.length;i++)u[i]=Math.min((n[i]??0)+1,(u[i-1]??0)+1,(n[i-1]??0)+(e[r-1]===t[i-1]?0:1));n=u}return n[t.length]??0}function closest(e,t){const n=Math.max(2,Math.floor(e.length/3));return t.map(r=>[r,distance(e.toLowerCase(),r.toLowerCase())]).filter(([,r])=>r<=n).sort((r,u)=>r[1]-u[1]).slice(0,3).map(([r])=>r)}var NotHeld=class extends Error{constructor(e,t,n,r){const u=closest(t,n);super(`${e} has no ${t} here.`+(u.length>0?` Did you mean ${u.join(" or ")}?`:"")+` It holds: ${n.join(", ")}. ${r}`),this.name="NotHeld"}};function strict(e,t,n,r={}){const u=(i,o)=>new NotHeld(t,o,publicNames(Object.getPrototypeOf(i)),n);return new Proxy(e,{get(i,o,a){if(typeof o=="symbol"||o in i||PROBED.has(o))return Reflect.get(i,o,a);if(r.index&&/^(0|[1-9]\d*)$/u.test(o)){const c=r.index(Number(o));if(c===void 0)throw new RangeError(`${t}[${o}]: there is none.`);return c}const s=r.key?.(o);if(s!==void 0)return s;throw u(i,o)},set(i,o,a,s){if(r.setIndex&&typeof o=="string"&&/^(0|[1-9]\d*)$/u.test(o))return r.setIndex(Number(o),a),!0;if(typeof o=="symbol"||o.startsWith("_")||hasSetter(i,o))return Reflect.set(i,o,a,s);if(r.setKey?.(o,a)===!0)return!0;throw u(i,o)}})}function strictEnum(e,t,n){return new Proxy(t,{get(r,u){if(typeof u=="symbol"||Object.hasOwn(r,u)||PROBED.has(u))return Reflect.get(r,u);throw new NotHeld(e,u,Object.keys(r),n)}})}var CJK=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u;function normText(e){return e.normalize("NFKD").replace(/\p{M}/gu,"").toLowerCase().replace(/[^\p{L}\p{N}]/gu,"")}var WordStream=class{text;owner=[];wordStart=[];words;constructor(e){this.words=e;let t="";e.forEach((n,r)=>{const u=normText(n.text);this.wordStart.push(t.length),this.owner.push(...new Array(u.length).fill(r)),t+=u}),this.text=t}wordAt(e){const t=Math.min(Math.max(e,0),this.owner.length-1);return this.owner[t]??0}charOf(e){return this.wordStart[e]??this.text.length}find(e,t,n,r=1){if(!e)return-1;const u=this.charOf(t),i=this.charOf(n+1),o=CJK.test(e);let a=0,s=this.text.indexOf(e,u);for(;s>=0&&s+e.length<=i;){const c=this.owner[s];if(c!==void 0&&(o||this.wordStart[c]===s)&&(a++,a===r))return c;s=this.text.indexOf(e,s+1)}return-1}span(e,t,n,r=1){if(!e)return;const u=this.charOf(t),i=this.charOf(n+1),o=CJK.test(e);let a=0,s=this.text.indexOf(e,u);for(;s>=0&&s+e.length<=i;){const c=this.owner[s];if(c!==void 0&&(o||this.wordStart[c]===s)&&(a++,a===r))return{first:c,last:this.wordAt(s+e.length-1)};s=this.text.indexOf(e,s+1)}}},WordView=class{index;stream;constructor(e,t=new Set){const n=[];e.forEach((r,u)=>{t.has(u)||n.push(u)}),this.index=n,this.stream=new WordStream(n.map(r=>e[r]??{text:"",start:0,end:0}))}at(e){let t=0,n=this.index.length;for(;t<n;){const r=t+n>>1;(this.index[r]??0)<e?t=r+1:n=r}return t}take(e){return this.index[e]??this.index.at(-1)??0}findLine(e,t=0){const n=this.at(t);if(n>=this.index.length)return;const r=findLine(this.stream,e,n);return r&&{...r,first:this.take(r.first),last:this.take(r.last)}}span(e,t,n,r=1){const u=this.at(t),i=this.at(n+1)-1;if(u>i)return;const o=this.stream.span(e,u,i,r);return o&&{first:this.take(o.first),last:this.take(o.last)}}},ScriptAlignment=class{stream;lines;offsets;map;matched;takeHits;constructor(e,t){this.stream=e,this.lines=t.map(normText),this.offsets=[];let n="";for(const p of this.lines)this.offsets.push(n.length),n+=p;const r=e.text,u=n.length,i=r.length;if(this.map=new Int32Array(u).fill(-1),this.matched=this.lines.map(()=>0),this.takeHits=new Uint8Array(e.text.length),u===0||i===0)return;const o=Math.max(64,Math.ceil(.25*Math.max(u,i))),a=2*o+1,s=new Int32Array(u+1),c=new Uint8Array((u+1)*a),l=1<<29,d=p=>Math.round(p*i/u);let f=new Int32Array(a).fill(l),m=0;for(let p=0;p<=u;p++){const v=Math.max(0,d(p)-o),y=Math.min(i,d(p)+o);s[p]=v;const A=new Int32Array(a).fill(l);for(let b=v;b<=y;b++){const x=b-v;if(p===0){A[x]=b,c[x]=2;continue}if(b===0){A[x]=p,c[p*a+x]=1;continue}const B=_=>{const F=_-m;return F>=0&&F<a?f[F]??l:l},$=B(b-1)+(n[p-1]===r[b-1]?0:1),k=B(b)+1,w=x>0?(A[x-1]??l)+1:l;let I=$,M=0;k<I&&(I=k,M=1),w<I&&(I=w,M=2),A[x]=I,c[p*a+x]=M}f=A,m=v}const h=new Uint8Array(u);let g=u,E=i;for(;g>0&&E>0;){const p=c[g*a+(E-(s[g]??0))];p===0?(n[g-1]===r[E-1]&&(h[g-1]=1,this.takeHits[E-1]=1),this.map[g-1]=E-1,g--,E--):p===1?g--:E--}let D=0;for(let p=0;p<u;){let v=p;for(;v+1<u&&h[p]===1&&h[v+1]===1&&(this.map[v+1]??-1)===(this.map[v]??-1)+1;)v++;if(h[p]===1&&v-p+1>=3)for(let y=p;y<=v;y++){for(;D+1<this.offsets.length&&(this.offsets[D+1]??u)<=y;)D++;this.matched[D]=(this.matched[D]??0)+1}p=v+1}this.lines.forEach((p,v)=>{if(p.length===0||p.length>=3)return;const y=this.offsets[v]??0;let A=!0;for(let b=y;b<y+p.length;b++)h[b]!==1&&(A=!1);A&&(this.matched[v]=p.length)})}textPos(e){const t=this.map.length,n=this.map[e]??-1;if(n>=0)return n;let r=e-1;for(;r>=0&&(this.map[r]??-1)<0;)r--;let u=e+1;for(;u<t&&(this.map[u]??-1)<0;)u++;const i=r>=0?this.map[r]??0:0,o=u<t?this.map[u]??0:this.stream.text.length-1,a=r>=0?r:-1,s=u<t?u:t;return Math.round(i+(e-a)*(o-i)/(s-a))}wordAtChar(e,t){const n=this.lines[e]??"",r=Math.max(0,Math.min(t,Math.max(0,n.length-1)));return this.stream.wordAt(this.textPos((this.offsets[e]??0)+r))}lineStart(e){return this.stream.wordAt(this.textPos(this.offsets[e]??0))}wordFor(e,t,n=1){const r=normText(t),u=this.lines[e]??"";if(!r)return-1;let i=-1;for(let o=0;o<n;o++)if(i=u.indexOf(r,i+1),i<0)return-1;return this.stream.wordAt(this.textPos((this.offsets[e]??0)+i))}};function runsMatched(e,t,n){let r=0;for(let u=0;u<n;){let i=u;for(;i+1<n&&e[u]===1&&e[i+1]===1&&(t[i+1]??-1)===(t[i]??-1)+1;)i++;e[u]===1&&i-u+1>=3&&(r+=i-u+1),u=i+1}return n>0&&n<3&&e.every(u=>u===1)?n:r}var LINE_FOUND=.4,LINE_CELLS=4e7;function findLine(e,t,n=0){const r=normText(t),u=e.charOf(n),i=r.length,o=Math.min(e.text.length-u,Math.max(1,Math.floor(LINE_CELLS/(i+1))));if(i===0||o<=0)return;const a=e.text.slice(u,u+o),s=o+1,c=new Uint8Array((i+1)*s);let l=new Int32Array(s);for(let p=1;p<=i;p++){const v=new Int32Array(s);v[0]=p,c[p*s]=1;for(let y=1;y<=o;y++){const A=(l[y-1]??0)+(r[p-1]===a[y-1]?0:1),b=(l[y]??0)+1,x=(v[y-1]??0)+1;let B=A,$=0;b<B&&(B=b,$=1),x<B&&(B=x,$=2),v[y]=B,c[p*s+y]=$}l=v}let d=0;for(let p=1;p<=o;p++)(l[p]??0)<(l[d]??0)&&(d=p);const f=new Int32Array(i).fill(-1),m=new Uint8Array(i);let h=i,g=d;for(;h>0&&g>0;){const p=c[h*s+g];p===0?(r[h-1]===a[g-1]&&(m[h-1]=1),f[h-1]=g-1,h--,g--):p===1?h--:g--}let E=-1,D=-1;for(let p=0;p<i;p++){const v=f[p]??-1;v<0||(E<0&&(E=v),D=v)}return E<0?{first:n,last:n,score:0}:{first:e.wordAt(u+E),last:e.wordAt(u+D),score:runsMatched(m,f,i)/i}}function distance2(e,t){let n=Array.from({length:t.length+1},(r,u)=>u);for(let r=1;r<=e.length;r++){const u=[r];for(let i=1;i<=t.length;i++)u[i]=Math.min((n[i-1]??0)+(e[r-1]===t[i-1]?0:1),(n[i]??0)+1,(u[i-1]??0)+1);n=u}return n[t.length]??0}function nearestPhrases(e,t,n=3){const r=normText(t);if(!r||e.length===0)return[];const u=Math.max(1,CJK.test(t)?1:t.trim().split(/\s+/u).length),i=[];for(let a=0;a+u<=e.length;a++){const s=joinWords(e.slice(a,a+u));i.push({text:s,d:distance2(r,normText(s))})}i.sort((a,s)=>a.d-s.d);const o=[];for(const a of i)if(o.includes(a.text)||o.push(a.text),o.length>=n)break;return o}function joinWords(e){let t="";for(const n of e){const r=n.text.trim();if(!r)continue;const u=t===""||CJK.test(t.slice(-1))&&CJK.test(r.charAt(0))?"":" ";t+=u+r}return t}function parseWordRef(e){const t=/^(.+?)(?:@(\d+))?([+-]\d*\.?\d+)?$/su.exec(e.trim());return t?{text:t[1]??e,nth:t[2]===void 0?1:Number(t[2]),shift:t[3]===void 0?0:Number(t[3])}:{text:e,nth:1,shift:0}}function numericRef(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&/^\s*-?\d*\.?\d+\s*$/.test(e))return Number(e)}function cutOnFrame(e,t,n,r){const u=s=>Math.min(Math.max(s,0),r),i=s=>n.find(c=>c.start<s-1e-6&&c.end>s+1e-6),o=u(Math.round(e*t)/t),a=i(o);return!a||i(e)===a?o:u(e<=a.start+1e-6?Math.floor(a.start*t+1e-6)/t:Math.ceil(a.end*t-1e-6)/t)}var PIECE=/\s+|[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]|[\p{L}\p{N}]+|./gsu,COMPARE_CELLS=4e5;function changesOf(e,t){const n=e.match(PIECE)??[],r=t.match(PIECE)??[];let u=0;for(;u<n.length&&u<r.length&&n[u]===r[u];)u++;let i=0;for(;i<n.length-u&&i<r.length-u&&n[n.length-1-i]===r[r.length-1-i];)i++;const o=n.length-u-i,a=r.length-u-i,s=(p,v,y)=>{let A=0;for(let b=v;b<y;b++)A+=(p[b]??"").length;return A},c=s(n,0,u);if(o===0&&a===0)return[];if(o===0||a===0||o*a>COMPARE_CELLS)return[{at:c,removed:s(n,u,u+o),into:c,inserted:s(r,u,u+a)}];const l=a+1,d=new Int32Array((o+1)*l);for(let p=o-1;p>=0;p--)for(let v=a-1;v>=0;v--)d[p*l+v]=n[u+p]===r[u+v]?(d[(p+1)*l+v+1]??0)+1:Math.max(d[(p+1)*l+v]??0,d[p*l+v+1]??0);const f=[];let m=c,h=c,g,E=0,D=0;for(;E<o||D<a;){const p=n[u+E],v=r[u+D];if(E<o&&D<a&&p===v){g=void 0,m+=(p??"").length,h+=(v??"").length,E++,D++;continue}g||(g={at:m,removed:0,into:h,inserted:0},f.push(g)),D>=a||E<o&&(d[(E+1)*l+D]??0)>=(d[E*l+D+1]??0)?(g.removed+=(p??"").length,m+=(p??"").length,E++):(g.inserted+=(v??"").length,h+=(v??"").length,D++)}return f}function lineAnchors(e,t,n=r=>r){const r=u=>normText(n(e.slice(0,u))).length;return t.map(u=>({name:u.name,at:r(u.at),...u.end===void 0?{}:{end:r(u.end)}}))}function parseAnchorRef(e,t=new Set){const n=/^@(\/?)(.+)$/su.exec(e.trim());if(!n?.[2])return;const r=n[1]==="/",u=n[2];if(t.has(u))return{name:u,end:r,shift:0};const i=/^(.+?)([+-]\d*\.?\d+)$/su.exec(u);return i?.[1]&&i[2]?{name:i[1],end:r,shift:Number(i[2])}:{name:u,end:r,shift:0}}var PIECE_BRAND="__allyhubPiece",PART_BRAND="__allyhubPart",LAYER_BRAND="__allyhubLayer",SPEECH_BRAND="__allyhubSpeech";function partAnchorList(e){return Object.entries(e??{}).map(([t,n])=>typeof n=="number"?{name:t,at:n}:{name:t,at:n[0],end:n[1]})}function isSpeechSpec(e){return typeof e=="object"&&e!==null&&SPEECH_BRAND in e}function isPerOrient(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function forOrient(e,t){return isPerOrient(e)?e[t]??e.default:e}function isLayerSpec(e){return typeof e=="object"&&e!==null&&LAYER_BRAND in e}function isPartSpec(e){return typeof e=="object"&&e!==null&&PART_BRAND in e}var PART_DEFAULTS={dur:4,lead:.2,tail:.3};function partDefaults(...e){const t={...PART_DEFAULTS};for(const n of e)n?.dur!==void 0&&(t.dur=n.dur),n?.lead!==void 0&&(t.lead=n.lead),n?.tail!==void 0&&(t.tail=n.tail);return t}function isPieceDefinition(e){return typeof e=="object"&&e!==null&&PIECE_BRAND in e}var outputName=e=>e;function outputOf(e){const t={};for(const[n,r]of Object.entries(e))PIECE_KEYS.has(n)||(t[n]=r);return{kind:"video",build:e.parts,options:t}}var PIECE_KEYS=new Set([PIECE_BRAND,"kind","parts","id","base","title","format","matrix","meta","written"]);function messagePrefix(e){return e.replace(/\//g,".")}var LAYER_OFF="data-ak-off";function showLayer(e,t){e.toggleAttribute(LAYER_OFF,!t)}function layerShown(e){return!e.hasAttribute(LAYER_OFF)}function addLayerRule(e){if(e.adoptedStyleSheets.some(n=>n.allyhubLayers))return;const t=new CSSStyleSheet;t.replaceSync(`[${LAYER_OFF}] { display: none !important; }`),Object.assign(t,{allyhubLayers:!0}),e.adoptedStyleSheets=[...e.adoptedStyleSheets,t]}function momentOf(e,t){const n=new Set(e.parts.flatMap(i=>(i.anchors??[]).map(o=>o.name))),r=parseAnchorRef(t,n);if(r){for(const i of e.parts){const o=i.anchors?.find(a=>a.name===r.name);if(o){if(r.end&&o.end===void 0)throw new Error(`The anchor "${r.name}" of part ${i.key} is a place, not a stretch: "@/${r.name}" has no end. Use "@${r.name}".`);return(r.end?o.end??o.at:o.at)+r.shift}}throw new Error(`No part of the video has the anchor "${r.name}"; it has ${n.size>0?[...n].map(i=>`@${i}`).join(", "):"no anchors"}.`)}const u=e.parts.find(i=>i.key===t);if(u)return u.start;throw new Error(`"${t}" is not an anchor ("@name") or a part of the video; its parts are ${e.parts.map(i=>i.key).join(", ")}.`)}var BUILTIN_SFX=["whoosh","tick","pop"];function isBuiltinSfx(e){return BUILTIN_SFX.includes(e)}var CLEAN_LOOK={name:"clean",color:{bg:"#ffffff",fg:"#16181d",accent:"#2f5bea",muted:"#5d6470",surface:"#f3f4f6"},font:{display:'"Inter Variable", "Noto Sans SC", "Noto Sans CJK SC", sans-serif',body:'"Inter Variable", "Noto Sans SC", "Noto Sans CJK SC", sans-serif',mono:'ui-monospace, "SF Mono", Menlo, monospace',emoji:'"Noto Color Emoji"'},motion:{beat:.5},sfx:{}};function lookCss(e){const t={};for(const[n,r]of Object.entries(e.color))t[`--ak-color-${n}`]=r;for(const[n,r]of Object.entries(e.font))t[`--ak-font-${n}`]=r;return t["--ak-motion-beat"]=`${String(e.motion.beat)}s`,t}var PRESETS=["16x9","9x16","1x1","4x5"];function isPreset(e){return typeof e=="string"&&PRESETS.includes(e)}var INFO={"16x9":{width:1920,height:1080,orient:"landscape",safe:{top:60,bottom:90,left:80,right:80}},"9x16":{width:1080,height:1920,orient:"portrait",safe:{top:150,bottom:400,left:40,right:140}},"1x1":{width:1080,height:1080,orient:"square",safe:{top:50,bottom:90,left:40,right:40}},"4x5":{width:1080,height:1350,orient:"portrait",safe:{top:60,bottom:120,left:40,right:40}}};function contentEdges(e,t={}){const{width:n,height:r,orient:u,safe:i}=e,o=Math.min(n,r)/1080,a=t.margin??(u==="landscape"?120:84)*o,s=Math.max(a,i.left,i.right),c=Math.max(s,i.top+(t.topGap??30*o)),l=r-Math.max(s,i.bottom+(t.bottomGap??20*o));return{k:o,pad:s,top:c,bottom:l,left:s,right:n-s}}function presetInfo(e){return INFO[e]}var PROFILES=["tiktok","reels","shorts","meta-feed","amazon","linkedin"];function isProfile(e){return typeof e=="string"&&PROFILES.includes(e)}var PROFILE_INFO={tiktok:{name:"tiktok",label:"TikTok",width:1080,height:1920,safe:{top:240,bottom:660,left:120,right:180},maxDuration:600,loudness:-14,file:{container:"mp4",video:"h264",audio:"aac",cover:{width:1080,height:1920},maxBytes:5e8,encode:{crf:20,maxKbps:6e3}}},reels:{name:"reels",label:"Instagram Reels",width:1080,height:1920,safe:{top:269,bottom:672,left:65,right:65},maxDuration:180,loudness:-14,file:{container:"mp4",video:"h264",audio:"aac",cover:{width:1080,height:1920},maxBytes:4e9,encode:{crf:20,maxKbps:6e3}}},shorts:{name:"shorts",label:"YouTube Shorts",width:1080,height:1920,safe:{top:288,bottom:672,left:48,right:192},maxDuration:180,loudness:-14,file:{container:"mp4",video:"h264",audio:"aac",cover:{width:1080,height:1920},maxBytes:256e9,encode:{crf:20,maxKbps:8e3}}},"meta-feed":{name:"meta-feed",label:"Facebook and Instagram feed",width:1080,height:1350,safe:{top:60,bottom:120,left:40,right:40},maxDuration:14460,loudness:-14,file:{container:"mp4",video:"h264",audio:"aac",cover:{width:1080,height:1350},maxBytes:4e9,encode:{crf:20,maxKbps:6e3}}},amazon:{name:"amazon",label:"Amazon Sponsored Brands video",width:1920,height:1080,safe:{top:60,bottom:90,left:80,right:80},maxDuration:45,loudness:-14,file:{container:"mp4",video:"h264",audio:"aac",cover:{width:1920,height:1080},maxBytes:5e8,encode:{crf:20,maxKbps:8e3}}},linkedin:{name:"linkedin",label:"LinkedIn",width:1080,height:1080,safe:{top:50,bottom:90,left:40,right:40},maxDuration:1800,loudness:-14,file:{container:"mp4",video:"h264",audio:"aac",cover:{width:1080,height:1080},maxBytes:2e8,encode:{crf:20,maxKbps:6e3}}}},FPS=30,LOAD_LIMIT=10,SEEK_LIMIT=30,LOAD_WAITS=4,MAX_FPS=120,NTSC=[24,30,48,60,120];function parseFps(e){if(typeof e=="number"){if(!Number.isFinite(e))return;if(Number.isInteger(e))return e>=1&&e<=MAX_FPS?e:void 0;for(const r of NTSC){const u=r*1e3/1001;if(Math.abs(e-u)<.005)return u}return}if(typeof e!="string")return;const t=e.trim(),n=/^(\d+)\s*\/\s*(\d+)$/.exec(t);if(n){const r=Number(n[1]),u=Number(n[2]);return u===1?parseFps(r):u===1001&&NTSC.some(i=>i*1e3===r)?r/u:void 0}return t!==""&&Number.isFinite(Number(t))?parseFps(Number(t)):void 0}function toFrame(e,t=FPS){return Math.floor(e*t+1e-9)/t}var CUSTOM=/^([1-9]\d{1,3})x([1-9]\d{1,3})$/,NO_SAFE={top:0,bottom:0,left:0,right:0},orientOf=(e,t)=>e>t?"landscape":e<t?"portrait":"square";function formatName(e){return typeof e=="string"?e:e.format}function formatEntry(e,t){return e.find(n=>formatName(n)===t)}function withSpec(e,t){const n={...e.safe,...definedOf(t.safe??{})},r=e.profile;return{...e,safe:n,...r?{profile:{...r,safe:n,...t.maxDuration===void 0?{}:{maxDuration:t.maxDuration},...t.loudness===void 0?{}:{loudness:t.loudness}}}:{}}}function definedOf(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function formatInfo(e){if(typeof e!="string"){const u=formatInfo(e.format);return u&&withSpec(u,e)}if(isPreset(e))return INFO[e];if(isProfile(e)){const u=PROFILE_INFO[e];return{width:u.width,height:u.height,orient:orientOf(u.width,u.height),safe:u.safe,profile:u}}const t=CUSTOM.exec(e);if(!t)return;const n=Number(t[1]),r=Number(t[2]);if(!(n<64||r<64||n>8192||r>8192))return{width:n,height:r,orient:orientOf(n,r),safe:NO_SAFE}}function isVideoFormat(e){if(isPreset(e)||isProfile(e))return!0;if(typeof e!="string")return!1;const t=formatInfo(e);return t!==void 0&&t.width%2===0&&t.height%2===0}var VIDEO_FORMAT_HELP=`one of ${PRESETS.join(", ")}, a platform profile (${PROFILES.join(", ")}), or WIDTHxHEIGHT in pixels with even sides from 64 to 8192, such as 1280x720`,clamp01=e=>Math.min(Math.max(e,0),1);function pixelRect(e,t,n){const r=Math.round(clamp01(e[0])*t),u=Math.round(clamp01(e[1])*n),i=Math.round(clamp01(e[0]+e[2])*t),o=Math.round(clamp01(e[1]+e[3])*n);return[Math.min(r,t-1),Math.min(u,n-1),Math.max(1,i-r),Math.max(1,o-u)]}function placeFootage(e){const{frame:t}=e,n=e.box==="full"?[0,0,t.width,t.height]:pixelRect(e.box,t.width,t.height),r=e.source;if(!r||r.width<=0||r.height<=0)return{box:n,picture:[...n]};const u=e.crop?pixelRect(e.crop,r.width,r.height):[0,0,r.width,r.height],[i,o,a,s]=n,c=a/u[2],l=s/u[3],d=e.fit==="cover"?Math.max(c,l):Math.min(c,l),f=e.fit==="cover"?Math.ceil:Math.round,m=Math.max(1,f(u[2]*d-1e-6)),h=Math.max(1,f(u[3]*d-1e-6)),g=[i+Math.round((a-m)/2),o+Math.round((s-h)/2),m,h];return{box:n,crop:u,picture:g}}function intersect(e,t){const n=Math.max(e[0],t[0]),r=Math.max(e[1],t[1]),u=Math.min(e[0]+e[2],t[0]+t[2]),i=Math.min(e[1]+e[3],t[1]+t[3]);return u>n&&i>r?[n,r,u-n,i-r]:void 0}function asUrlString(e){return Object.prototype.hasOwnProperty.call(e,"toString")||Object.defineProperty(e,"toString",{value(){return this.url},enumerable:!1,configurable:!0,writable:!0}),e}var INDEX_DIR=`${CACHE_DIR}/index`;function boxAt(e,t,n){const r=e[0],u=e.at(-1);if(!r||!u)return;const i=1/Math.max(1,t);if(n<r.t-i||n>u.t+i)return;if(n<=r.t)return r.box;if(n>=u.t)return u.box;let o=0,a=e.length-1;for(;a-o>1;){const d=o+a>>1;(e[d]?.t??0)<=n?o=d:a=d}const s=e[o]??r,c=e[a]??u,l=c.t===s.t?0:(n-s.t)/(c.t-s.t);return[0,1,2,3].map(d=>(s.box[d]??0)+((c.box[d]??0)-(s.box[d]??0))*l)}function faceAt(e,t,n=e.speaker){if(n===void 0)return;const r=e.faces.find(u=>u.id===n);return r?boxAt(r.samples,e.fps,t):void 0}function facesAt(e,t){return e.faces.flatMap(n=>{const r=boxAt(n.samples,e.fps,t);return r?[{id:n.id,box:r}]:[]})}function hasFace(e,t){return e.faces.some(n=>n.id===t)}var EXT={png:"image",jpg:"image",jpeg:"image",webp:"image",gif:"image",svg:"image",avif:"image",mp3:"audio",wav:"audio",m4a:"audio",ogg:"audio",aac:"audio",flac:"audio",mp4:"video",webm:"video",mov:"video",m4v:"video",qt:"video",woff2:"font",woff:"font",ttf:"font",otf:"font",glb:"model",gltf:"model",bin:"model",ktx2:"model",hdr:"environment",exr:"environment"},MEDIA_EXTENSIONS=Object.keys(EXT);function repoPath(e,t){return pathIn(e.split("/").slice(0,-1).join("/"),t)}function pathIn(e,t){const n=t.startsWith("/")||e===""?[]:e.split("/");for(const r of t.split("/"))if(!(r==="."||r===""))if(r===".."){if(n.length===0)return;n.pop()}else n.push(r);return n.join("/")}function isSpoken(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.display=="string"&&typeof e.speak=="string"}function isVariants(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.match=="object"}function displayOf(e,t={},n){return isVariants(e)?selectVariant(e,t,n):isSpoken(e)?e.display:e}function speakOf(e,t={},n){return isVariants(e)?selectVariant(e,t,n):isSpoken(e)?e.speak:e}function textsOf(e){if(isVariants(e))return[...new Set(Object.values(e.match))];const t=displayOf(e);return t===void 0?[]:[t]}var INPUT_DECL=/^input\s+([A-Za-z_][A-Za-z0-9_]*)$/,LOCAL_DECL=/^local\s+([A-Za-z_][A-Za-z0-9_]*)\s*=\s*([A-Za-z_][A-Za-z0-9_]*)\s*:\s*([A-Za-z]+)((?:\s+[A-Za-z]+\s*=\s*[A-Za-z]+)*)$/;function parseDeclaration(e){const t=e.trim(),n=INPUT_DECL.exec(t);if(n?.[1])return{kind:"input",name:n[1]};const r=LOCAL_DECL.exec(t);if(r?.[1]&&r[2]&&r[3]){if(r[3]!=="plural")return`"${t}": only plural is supported, not ${r[3]}`;const i=new Map([...(r[4]??"").matchAll(/([A-Za-z]+)\s*=\s*([A-Za-z]+)/g)].map(o=>[o[1]??"",o[2]??""])).get("type")??"cardinal";return i!=="cardinal"&&i!=="ordinal"?`"${t}": type must be cardinal or ordinal`:{kind:"plural",name:r[1],of:r[2],ordinal:i==="ordinal"}}return`cannot read "${t}": write "input name" or "local name = input: plural"`}function parseMatchKey(e){const t=new Map;for(const n of e.split(",")){const r=/^\s*([A-Za-z_][A-Za-z0-9_]*)\s*=\s*([^,=\s]+)\s*$/.exec(n);if(!r?.[1]||!r[2])return;t.set(r[1],r[2])}return t}function selectorsOf(e){if(e.selectors.length>0)return e.selectors;const t=Object.keys(e.match)[0];return t===void 0?[]:[...parseMatchKey(t)?.keys()??[]]}function declarations(e){return e.declarations.map(parseDeclaration).filter(t=>typeof t!="string")}var pluralRules=new Map;function pluralCategory(e,t,n){if(!Number.isFinite(e))return;const r=`${t??""}|${String(n)}`;let u=pluralRules.get(r);if(!u){const i=n?"ordinal":"cardinal";try{u=new Intl.PluralRules(t,{type:i})}catch{u=new Intl.PluralRules(void 0,{type:i})}pluralRules.set(r,u)}return u.select(e)}function selectVariant(e,t,n){const r=new Map;for(const s of declarations(e))s.kind==="plural"&&r.set(s.name,{of:s.of,ordinal:s.ordinal});const u=selectorsOf(e),i=u.map(s=>{const c=r.get(s);if(c){const d=t[c.of],f=d===void 0||d===""?NaN:Number(d);return{exact:Number.isFinite(f)?String(f):void 0,category:pluralCategory(f,n,c.ordinal)}}const l=t[s];return{exact:l===void 0?void 0:String(l),category:void 0}});let o,a=-1;for(const[s,c]of Object.entries(e.match)){const l=parseMatchKey(s);if(!l)continue;let d=0;for(const[f,m]of u.entries()){const h=l.get(m),g=i[f];if(h==="*")d+=1;else if(g?.exact!==void 0&&h===g.exact)d+=3;else if(g?.category!==void 0&&h===g.category)d+=2;else{d=-1;break}}d>a&&(o=c,a=d)}if(o!==void 0)return o;if(r.size>0)for(const[s,c]of Object.entries(e.match)){const l=parseMatchKey(s);if(l&&[...r.keys()].every(d=>l.get(d)==="other"))return c}return Object.values(e.match)[0]??""}function fillMessage(e,t){return e.replace(/\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(n,r)=>{const u=t[r];return u===void 0?n:String(u)})}function messageList(e,t,n,r=[]){const u=`${n}.`,i=[...t].filter(s=>s.startsWith(u)),o=s=>{const c=e(s);if(c!==void 0&&!i.some(m=>m.startsWith(`${s}.`)))return r.push(s),c;const l=new Set;for(const m of i){if(!m.startsWith(`${s}.`))continue;const h=m.slice(s.length+1).split(".")[0];h&&l.add(h)}if(l.size===0)return;if([...l].every(m=>/^\d+$/.test(m))){const m=[];for(let h=0;l.has(String(h));h++){const g=o(`${s}.${String(h)}`);g!==void 0&&m.push(g)}return m}const f={};for(const m of[...l].sort()){const h=o(`${s}.${m}`);h!==void 0&&(f[m]=h)}return f},a=o(n);return Array.isArray(a)?a:[]}var KIND={"**":"strong","*":"em","~~":"strike","`":"code"},TOKEN=/\\([\\*~`])|\*\*|~~|\*|`/g,SPACE=/\s/u;function tokens(e){const t=[];let n=0;for(const r of e.matchAll(TOKEN)){if(r.index>n&&t.push({kind:"text",text:e.slice(n,r.index)}),n=r.index+r[0].length,r[1]!==void 0){t.push({kind:"escape",text:r[1]});continue}const u=e[r.index-1],i=e[n];t.push({kind:"delim",text:r[0],opens:i!==void 0&&!SPACE.test(i),closes:u!==void 0&&!SPACE.test(u)})}return n<e.length&&t.push({kind:"text",text:e.slice(n)}),t}var hasMarks=e=>/[*~`\\]/.test(e);function readMarks(e){if(!hasMarks(e))return{text:e,marks:[]};const t=tokens(e),n=[];for(let o=0;o<t.length;o++){const a=t[o];if(a?.kind!=="delim")continue;if(a.text==="`"){const d=t.findIndex((m,h)=>h>o&&m.kind==="delim"&&m.text==="`");if(d<0)continue;const f=t[d];a.pair=d,f?.kind==="delim"&&(f.pair=o),o=d;continue}let s=-1;if(a.closes)for(let d=n.length-1;d>=0&&s<0;d--)t[n[d]??-1]?.text===a.text&&(s=d);const c=n[s],l=c===void 0?void 0:t[c];c!==void 0&&l?.kind==="delim"&&c<o-1?(l.pair=o,a.pair=c,n.length=s):a.opens&&n.push(o)}let r="";const u=[],i=new Map;for(let o=0;o<t.length;o++){const a=t[o];if(!a)continue;if(a.kind!=="delim"){r+=a.text;continue}if(a.pair===void 0){r+=a.text;continue}const s=KIND[a.text];if(s===void 0)continue;if(a.pair>o){if(i.set(o,r.length),s!=="code")continue;for(let l=o+1;l<a.pair;l++){const d=t[l];d&&(r+=d.kind==="escape"?`\\${d.text}`:d.text)}o=a.pair-1;continue}const c=i.get(a.pair);c!==void 0&&r.length>c&&u.push({at:c,end:r.length,kind:s})}return u.sort((o,a)=>o.at-a.at||a.end-o.end),{text:r,marks:u}}var withoutMarks=e=>readMarks(e).text,ORDER=["strong","em","strike","code"];function markRuns(e,t=[]){const n=[...new Set([0,e.length,...t.flatMap(u=>[u.at,u.end])])].filter(u=>u>=0&&u<=e.length).sort((u,i)=>u-i),r=[];return n.forEach((u,i)=>{const o=n[i+1];if(o===void 0||o<=u)return;const a=t.filter(s=>s.at<=u&&o<=s.end);r.push({text:e.slice(u,o),kinds:ORDER.filter(s=>a.some(c=>c.kind===s))})}),r}var RULES={"AK-M001":{level:"error",rule:"The fields of video(), slides() or defineComponent do not match the format"},"AK-M002":{level:"error",rule:"A piece is not the entry file of an item folder"},"AK-M003":{level:"error",rule:"An item's entry file does not match its folder or its kind"},"AK-M004":{level:"error",rule:"The project has no pieces"},"AK-M006":{level:"error",rule:"A messages file does not match the format"},"AK-M007":{level:"error",rule:"A script file does not match the format"},"AK-M008":{level:"error",rule:"A doc's file is not MDX, holds what a doc does not draw, or is not an item of its own"},"AK-M009":{level:"error",rule:"A sheet is wrong whatever the taste: its files cannot be read, a formula does not parse or names what is not there, a reference is circular, or a check does not hold"},"AK-M010":{level:"error",rule:"A video item reaches itself through the videos it shows (a screen, a video take, a footage of a video item)"},"AK-M011":{level:"error",rule:"A deck's slides.yaml does not match the format, or names a layout, a prop, a file or a video item the deck does not have"},"AK-M012":{level:"error",rule:"A sheet's sheet.ts reads the clock or a random number, reaches outside the project, or does not make the same sheets twice"},"AK-B001":{level:"error",rule:"Two pieces have the same id"},"AK-B003":{level:"error",rule:"The build made a network request"},"AK-B004":{level:"error",rule:"The build timed out, or its result is over the size limit"},"AK-B005":{level:"error",rule:"An import of a file outside the project, or of a package not declared in package.json"},"AK-B006":{level:"error",rule:"An import of an @allyhub/sdk entry point that does not exist"},"AK-B008":{level:"error",rule:"The project's @allyhub/sdk is another version than the allyhub that builds it"},"AK-B009":{level:"error",rule:"The project's package.json declares AllyHub, but its packages are not installed"},"AK-B010":{level:"error",rule:"A 3D model does not build"},"AK-K001":{level:"error",rule:"Two parts have the same key"},"AK-K003":{level:"error",rule:"The output has no parts"},"AK-D002":{level:"error",rule:"The same frame has different pixels when drawn in order and out of order"},"AK-N003":{level:"error",rule:"The sandbox blocked a request at run time"},"AK-S001":{level:"error",rule:"The code reads a key that is missing in the default language too"},"AK-T001":{level:"error",rule:"A take has no word times beside it (<name>.words.json)"},"AK-T002":{level:"error",rule:"A say part has no generated file for its text, voice and tool"},"AK-T003":{level:"error",rule:"A take's range phrase, or the line a part is saying, is not found in the take"},"AK-T004":{level:"error",rule:"A word reference is not in its part's words, or an anchor is not in its line"},"AK-T005":{level:"error",rule:"A take's edits file is missing or does not match the format, or an edit's words are no longer in the take"},"AK-T006":{level:"error",rule:"A take's range phrase, or the line a part is saying, is said in words the take's edits remove"},"AK-T007":{level:"error",rule:"A part says a line its generated voice was not made from"},"AK-F001":{level:"error",rule:"The video is longer than its platform profile takes"},"AK-A001":{level:"error",rule:"A referenced media or data file does not exist"},"AK-A003":{level:"error",rule:"Wrong media type"},"AK-A005":{level:"error",rule:"A layer draws a picture that does not load: its source is not a file the stage serves, or not a picture"},"AK-P002":{level:"error",rule:"Loading took longer than the piece's loadLimit (default 10 seconds)"},"AK-P003":{level:"error",rule:"A moment did not finish drawing within the piece's seekLimit (default 30 seconds): work a layer waits for (ctx.wait) or a picture it shows never settled"},"AK-R001":{level:"error",rule:"An unhandled exception was thrown at run time"},"AK-R003":{level:"error",rule:"The page was changed outside the stage"},"AK-R004":{level:"error",rule:"The code sets a style value the browser does not accept, so the style does not apply"},"AK-G001":{level:"error",rule:"Unknown format: not one of the four presets, a platform profile or WIDTHxHEIGHT with even sides"},"AK-X001":{level:"error",rule:"The matrix's slots, structures, rules or combos name something that does not exist, or a combo lacks a slot of its structure"},"AK-X002":{level:"error",rule:"The matrix's rules leave no combination to make, or rule out a combo matrix.combos names"},"AK-X004":{level:"error",rule:"Two chosen combos are the same, or more alike than the matrix's differ allows"},"AK-X005":{level:"error",rule:"A part reads another slot's pick, so one render of it cannot serve every combo"},"AK-X006":{level:"error",rule:"A combo is longer than its output's maxDuration"},"AK-W001":{level:"error",rule:"A scenery does not build: its module's export is not a scenery, its build throws or does not finish, or its update throws"},"AK-W002":{level:"error",rule:"WebGL cannot be made or is lost, or draws on something other than SwiftShader where the CPU was asked for (--cpu, ALLYHUB_GPU=0, or the default off macOS)"},"AK-W003":{level:"error",rule:"A model, texture, environment or splat file does not load, names a file that is not there, or needs a decoder AllyHub does not lend"},"AK-W004":{level:"error",rule:"A camera cannot be drawn: a number that is not finite, a target at its position, a view along its up, a field of view outside (0°, 180°), or near and far planes out of order"},"AK-W005":{level:"error",rule:"A name a camera, a move or a measurement refers to names no object in the scenery, or names two"},"AK-W006":{level:"error",rule:"A material's shader does not compile or link on this renderer, or needs more texture units than the renderer has, so what uses it draws nothing (warn: more than the 16 a GPU may have)"},"AK-W008":{level:"error",rule:"A screen drawn in the scenery cannot show its element as it is: an element of it is in the browser's top layer (a modal dialog, a popover), planes of a preserve-3d context overlap, its element is larger than the largest texture, or its picture could not be copied"},"AK-S002":{level:"warn",rule:"Missing translation"},"AK-L002":{level:"warn",rule:"Text overflows the frame or is clipped"},"AK-L003":{level:"warn",rule:"Missing glyphs"},"AK-L006":{level:"warn",rule:"Text is drawn in a fallback font, or in a bold or italic the font does not have"},"AK-W007":{level:"warn",rule:"A screen asked to be drawn in the scenery is drawn over it, unlit and untoned: this browser cannot draw an element into a canvas (Chrome's HTML-in-Canvas), or ALLYHUB_HTML_IN_CANVAS=0"}};function problem(e,t,n={}){const{level:r,...u}=n;return{code:e,level:r??RULES[e].level,message:t,...u}}var round3=e=>Math.round(e*1e3)/1e3;function frameStarts(e,t,n){const r=o=>Math.round(o*n)/n,u=e.map(r);for(let o=1;o<u.length;o++){const a=u[o-1]??0;(u[o]??0)<=a&&(u[o]=a+1/n)}const i=u.at(-1)??0;return{starts:u,end:Math.max(r(t),i+1/n)}}var voiced=e=>e.speechDur!==void 0&&e.speechDur>0;function overlapOf(e,t){const n=e[t]??0;if(!voiced(e)||!Number.isFinite(n)||n<=0)return 0;const r=(e.speechDur??0)/2+(t==="before"?e.lead:e.tail);return Math.min(n,r)}function timeParts(e,t={}){const n=e.map((E,D)=>({...E,before:D===0?0:E.before??0,after:D===e.length-1?0:E.after??0})),r=t.fps??FPS,u=t.beat??0,i=[];for(const E of n){const D=new Set((E.placed??[]).map(p=>p.name));for(const p of E.anchors??[])D.has(p.name)&&i.push(problem("AK-T004",`The anchor ${p.name} of part ${E.key} is both in the line it says (@{${p.name}}) and in the part's own anchors; "@${p.name}" is the part's own. Rename one of them.`,{part:E.key}))}const o=[];let a=0;for(const E of n){o.push(a);let D;if(voiced(E))D=E.lead+(E.speechDur??0)+E.tail-overlapOf(E,"before")-overlapOf(E,"after");else{D=E.dur;const p=t.snap?.(a+D,a);if(p!==void 0)D=p-a;else if(u>0&&!t.snap){const v=t.beatPhase??0;let y=v+Math.round((a+D-v)/u)*u;y<=a+1e-9&&(y+=u),D=y-a}}a+=Math.max(D,1/r)}const{starts:s,end:c}=frameStarts(o,a,r),l=n.map((E,D)=>{const p=s[D]??0;return{key:E.key,start:p,end:s[D+1]??c,...voiced(E)?{speechAt:round3(p+E.lead-overlapOf(E,"before"))}:{}}}),d=new Map,f=E=>{if(d.has(E))return d.get(E);const D=n[E],p=D?.script&&D.words?.length?new ScriptAlignment(new WordStream(D.words),[D.script]):void 0;return d.set(E,p),p};function m(E,D){const p=l[E],v=n[E];if(!p||!v)return;const y=v.anchors??[],A=v.placed??[],b=parseAnchorRef(D,new Set([...y,...A].map(P=>P.name)));if(!b)return;const x=p.end-p.start,B=P=>(i.push(problem("AK-T004",P,{part:v.key})),round3(x/2)),$=P=>round3(Math.min(x,Math.max(0,P))),k=A.find(P=>P.name===b.name);if(k)return b.end&&k.end===void 0?B(`"${D}" asks for the end of the anchor ${k.name} of part ${v.key}, which is a point. Give it as a stretch (anchors: { ${k.name}: [from, to] }), or use "@${k.name}".`):$((b.end?k.end??k.at:k.at)+b.shift);const w=y.find(P=>P.name===b.name);if(!w){const P=[...y,...A].map(V=>`@${V.name}`);return B(`The anchor "${D}" is not in the line part ${v.key} says, nor in the part's own anchors${P.length>0?` (its anchors: ${P.join(", ")})`:""}. Write @{${b.name}} before the word it is for, in the part's say in the item's script, in every language (the part must say that line, s("….say")); or give its seconds in the part: anchors: { ${b.name}: 1.2 }.`)}if(b.end&&w.end===void 0)return B(`"${D}" asks for the end of the anchor ${w.name} of part ${v.key}, which is a point. Write @{${w.name}}…@{/${w.name}} around the words in the script, or use "@${w.name}".`);const I=b.end?w.end??w.at:w.at,M=normText(v.script??"");if(v.pending===!0&&p.speechAt===void 0)return M.length===0?round3(x/2):$(I/M.length*x+b.shift);const _=v.words??[],F=f(E);if(p.speechAt===void 0||!F||_.length===0)return B(`The anchor "${D}" is in part ${v.key}, which has no speech. Give its seconds in the part instead: anchors: { ${b.name}: 1.2 }.`);const N=_.at(-1),T=b.end?_[F.wordAtChar(0,Math.max(0,I-1))]?.end:I>=M.length?N?.end:_[F.wordAtChar(0,I)]?.start;return $(p.speechAt+(T??0)+b.shift-p.start)}function h(E,D){const p=numericRef(D);if(p!==void 0)return p;const v=typeof D=="string"?m(E,D):void 0;if(v!==void 0)return v;const y=l[E],A=n[E];if(!y||!A)return 0;const b=y.end-y.start,x=A.words??[],{text:B,nth:$,shift:k}=parseWordRef(String(D));let w=-1;x.length>0&&(w=f(E)?.wordFor(0,B,$)??-1,w<0&&(w=new WordStream(x).find(normText(B),0,x.length-1,$)));const I=x[w];if(A.pending===!0&&y.speechAt===void 0){const _=normText(A.script??"");let F=-1;for(let N=0;N<$;N++)F=_.indexOf(normText(B),F+1);return F<0||_.length===0?round3(b/2):round3(Math.min(b,Math.max(0,F/_.length*b+k)))}if(w<0||!I||y.speechAt===void 0){const _=A.script??joinWords(x);return i.push(problem("AK-T004",y.speechAt===void 0?`The word reference "${String(D)}" is in part ${A.key}, which has no speech. Give it in seconds from the part's start instead.`:`The word reference "${String(D)}" is not in the words of part ${A.key}${_?` (it says: "${_.length>160?`${_.slice(0,160)}…`:_}")`:""}. Use a word the part says, as "word", "word@2" or "word+0.2".`,{part:A.key})),round3(b/2)}const M=y.speechAt+I.start+k;return round3(Math.min(b,Math.max(0,M-y.start)))}function g(E){const D=l[E],p=n[E];if(!D||!p||D.speechAt===void 0)return[];const v=D.speechAt-D.start;return(p.words??[]).map(y=>({text:y.text,start:round3(y.start+v),end:round3(y.end+v)}))}return{parts:l,duration:c,problems:i,at:h,words:g}}var MUSIC_DEFAULTS={seam:.03,meter:4,loopSeam:.25};function musicGrid(e,t={}){if(!e||!(e.bpm>0))return;const n=e.beat??0;return{beat:60/e.bpm,first:t.downbeat??n,meter:t.meter??MUSIC_DEFAULTS.meter,downbeat:t.downbeat??n}}function musicSeconds(e,t){if(typeof e=="number")return e;if(t)return"beat"in e?t.first+e.beat*t.beat:t.downbeat+e.bar*t.meter*t.beat}var onGrid=e=>typeof e!="number";function placeStretches(e,t,n,r){const u=[];let i=0;const o=a=>{const s=Math.max(0,a.from),c=Math.min(n,a.to);return c-s<.001?!1:(u.push({at:i,from:s,to:c}),i+=c-s,!0)};for(const a of e){if(i>=r)return u;o(a)}if(t)for(;i<r&&o(t););return u}function wholeLoop(e,t,n,r=MUSIC_DEFAULTS.loopSeam){const u=t>1?r:0,i=t-u;if(i<=0)return[];const o=[];let a=0,s=Math.max(0,e)%i;for(;a<n;)o.push({at:a,from:s,to:i}),a+=i-s,s=0;return o}function musicSegments(e,t,n,r="before",u=!0){const i=e.map(o=>({at:o.at,from:o.from,dur:o.to-o.from,fadeIn:0,fadeOut:0}));for(let o=0;o<i.length;o++){const a=i[o],s=e[o];if(!a||!s||t<=0)continue;const c=e[o+1],l=i[o+1],d=m=>Math.min(t,m.dur/2);if(!c||!l){u&&n-s.to>.001&&(a.fadeOut=d(a));continue}if(r==="after"){const m=Math.min(t,n-s.to);a.dur+=m,a.fadeOut=m,l.fadeIn=m;continue}a.fadeOut=d(a);const f=Math.min(t,c.from);l.at-=f,l.from-=f,l.dur+=f,l.fadeIn=f}return i}function filmBeats(e,t,n="beat"){const r=n==="bar"?t.beat*t.meter:t.beat,u=n==="bar"?t.downbeat:t.first,i=[];for(const o of e){let a=Math.ceil((o.from-u)/r-1e-9);for(;;){const s=u+a*r;if(s>=o.to-1e-9)break;s>=o.from-1e-9&&i.push(o.at+(s-o.from)),a++}}return i.sort((o,a)=>o-a)}function beatNear(e,t,n,r){const u=e.at(-1);if(u===void 0||!(t>0))return;let i;const o=a=>{a<=r+1e-9||(i===void 0||Math.abs(a-n)<Math.abs(i-n))&&(i=a)};for(const a of e)o(a);if(n+t>u){const a=Math.max(1,Math.round((n-u)/t));for(const s of[a-1,a,a+1])s>=1&&o(u+s*t)}if(i===void 0){const a=Math.max(1,Math.ceil((r-u)/t+1e-9));i=u+a*t}return i}var SAY_DIR=`${MEDIA_DIR}/gen/say`,DEFAULT_VOICE_TOOL="speech-elevenlabs-multilingual-v2";function hash64(e){let t=0xcbf29ce484222325n;const n=0x100000001b3n;for(const r of new TextEncoder().encode(e))t^=BigInt(r),t=t*n&0xffffffffffffffffn;return t.toString(16).padStart(16,"0")}function canonicalJson(e){if(Array.isArray(e))return`[${e.map(canonicalJson).join(",")}]`;if(typeof e=="object"&&e!==null){const t=e;return`{${Object.keys(t).sort().map(n=>`${JSON.stringify(n)}:${canonicalJson(t[n])}`).join(",")}}`}return JSON.stringify(e)}function sayStem(e){const t=e.tool??DEFAULT_VOICE_TOOL,n=e.params&&Object.keys(e.params).length>0?`
67
- ${canonicalJson(e.params)}`:"";return`${SAY_DIR}/${hash64(`${t}
68
- ${e.voice??""}
69
- ${e.text}${n}`)}`}function mediaByStem(e,t){for(const[n,r]of Object.entries(e))if(r.kind==="audio"&&n.startsWith(`${t}.`)){const u=n.slice(t.length+1);if(!u.includes("/")&&!u.includes("."))return r}}function wordsIn(e,t,n,r,u=1){const i=c=>Math.round(c*1e3)/1e3,o=t+n*u,a=r-t,s=c=>i(u===1?c+a:r+(c-t)/u);return e.filter(c=>c.start>=t-1e-6&&c.start<o-1e-6).map(c=>({text:c.text,start:s(c.start),end:s(Math.min(c.end,o))}))}var CJK_CHAR=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/gu,SPEECH_RATE_DEFAULTS={word:.38,cjk:.22};function speechUnits(e){const t=e.match(CJK_CHAR)?.length??0;return{words:e.replace(CJK_CHAR," ").split(/\s+/u).filter(r=>/[\p{L}\p{N}]/u.test(r)).length,cjk:t}}var unitSeconds=(e,t)=>{const{words:n,cjk:r}=speechUnits(e);return n*(t.word??SPEECH_RATE_DEFAULTS.word)+r*(t.cjk??SPEECH_RATE_DEFAULTS.cjk)};function estimateSpeech(e,t={}){return Math.max(1,Math.round(unitSeconds(e,t)*10)/10)}var VOICE_HOP=.01;function frameDb(e,t){const n=e.db[t];return n===void 0?-120:-n}function envelopeFrames(e){return{hop:VOICE_HOP,db:Uint8Array.from(atob(e),t=>t.charCodeAt(0))}}function quietest(e,t,n,r){const u=c=>Math.min(Math.max(c,n),r);if(!(r>=n))return t;const i=Math.ceil(n/e.hop-1e-9),o=Math.floor(r/e.hop+1e-9);let a,s=1/0;for(let c=Math.max(0,i);c<=o&&c<e.db.length;c++){const l=frameDb(e,c),d=c*e.hop;(l<s||l===s&&a!==void 0&&Math.abs(d-t)<Math.abs(a-t))&&(a=d,s=l)}return u(a===void 0?t:Math.round(a*1e3)/1e3)}var r3=e=>Math.round(e*1e3)/1e3,r1=e=>Math.round(e*10)/10,FLOOR_SHARE=.25,FLOOR_FRAMES=3;function floorLevel(e,t,n,r=FLOOR_FRAMES){const u=Math.max(0,Math.ceil(t/e.hop-1e-9)),i=Math.min(e.db.length,Math.ceil(n/e.hop-1e-9)),o=[];for(let c=u;c<i;c++)o.push(frameDb(e,c));if(o.length<Math.max(FLOOR_FRAMES,r))return;o.sort((c,l)=>c-l);const a=o.slice(0,Math.max(FLOOR_FRAMES,Math.ceil(o.length*FLOOR_SHARE))),s=a.reduce((c,l)=>c+10**(l/10),0)/a.length;return r1(10*Math.log10(s+1e-12))}var ROOM_MATCH={near:.3,least:.1,fade:.04,limitDb:6};function matchRoom(e,t,n,r=ROOM_MATCH.limitDb){const u=e?floorLevel(e,t.from,t.to):void 0,i=e?floorLevel(e,n.from,n.to,Math.round(ROOM_MATCH.least/e.hop)):void 0;if(u===void 0||i===void 0)return{level:u??null,floor:i??null,gainDb:0,from:"unmeasured"};const o=i-u,a=r1(Math.min(r,Math.max(-r,o)));return{level:u,floor:i,gainDb:a,from:"matched",...a===r1(o)?{}:{limited:!0}}}var ROOM_DB=6;function roomTone(e){const t=e.db.length;if(t===0)return;const r=Array.from(e.db,o=>-o).sort((o,a)=>o-a)[Math.floor(t*.1)]??-120;let u,i=-1;for(let o=0;o<=t;o++){const a=o<t&&frameDb(e,o)<=r+ROOM_DB;a&&i<0&&(i=o),!a&&i>=0&&((!u||o-i>u[1]-u[0])&&(u=[i,o]),i=-1)}if(!(!u||(u[1]-u[0])*e.hop<.2))return{from:r3((u[0]+1)*e.hop),to:r3((u[1]-1)*e.hop)}}var PAD_BEFORE=.12,PAD_AFTER=.08,SNAP=.04,JOIN=.04,round32=e=>Math.round(e*1e3)/1e3,isTime=e=>typeof e=="number"&&Number.isFinite(e)&&e>=0;function parseEditList(e){if(typeof e!="object"||e===null||Array.isArray(e))return"an edits file is a JSON object: { version: 1, remove, sounds, inWord, maxPause, pad }";const t=e;if(t.version!==1)return"version is 1";for(const o of["take","$schema"])if(t[o]!==void 0&&typeof t[o]!="string")return`${o} is a string`;const n=Object.keys(t).filter(o=>!["version","remove","sounds","inWord","maxPause","pad","take","$schema"].includes(o));if(n.length>0)return`unknown field${n.length>1?"s":""} ${n.join(", ")} (an edits file has version, remove, sounds, inWord, maxPause, pad and take)`;const r={};if(t.remove!==void 0){if(!Array.isArray(t.remove))return"remove is a list of { from, to, text }";const o=[];for(const[a,s]of t.remove.entries()){const c=s,l=c?.from,d=c?.to,f=c?.text;if(typeof l!="number"||typeof d!="number"||!Number.isInteger(l)||!Number.isInteger(d)||l<0||d<l||f!==void 0&&typeof f!="string")return`remove[${String(a)}] is not { from, to, text } with word indices from ≤ to`;o.push({from:l,to:d,...f===void 0?{}:{text:f}})}r.remove=o}for(const o of["sounds","inWord"]){if(t[o]===void 0)continue;if(!Array.isArray(t[o]))return`${o} is a list of { from, to } in seconds of the take`;const a=[];for(const[s,c]of t[o].entries()){const l=c,d=l?.from,f=l?.to;if(!isTime(d)||!isTime(f)||f<=d)return`${o}[${String(s)}] is not { from, to } in seconds with from < to`;a.push({from:d,to:f})}r[o]=a}const u=t.maxPause;if(u!==void 0){if(typeof u!="number"||!Number.isFinite(u)||u<.05||u>10)return"maxPause is seconds, from 0.05 to 10";r.maxPause=u}const i=t.pad;if(i!==void 0){const o=i,a=typeof i=="object"&&o!==null&&!Array.isArray(i),s=a?Object.keys(o).filter(f=>f!=="before"&&f!=="after"):[],c=f=>f===void 0||isTime(f)&&f<=PAD_MAX;if(!a||s.length>0||!c(o.before)||!c(o.after))return`pad is { before, after }: seconds of silence kept before and after each cut, each from 0 to ${String(PAD_MAX)}`;const l=o.before,d=o.after;r.pad={...l===void 0?{}:{before:l},...d===void 0?{}:{after:d}}}return r}function rangeText(e,t,n){return joinWords(e.slice(t,n+1))}function locateRange(e,t,n=new WordStream(e)){const r=t.from>=0&&t.to<e.length&&t.to>=t.from;if(t.text===void 0)return r?{from:t.from,to:t.to}:void 0;const u=normText(t.text);if(u==="")return r?{from:t.from,to:t.to}:void 0;if(r&&normText(rangeText(e,t.from,t.to))===u)return{from:t.from,to:t.to};let i;for(let o=1;;o++){const a=n.span(u,0,e.length-1,o);if(!a)break;normText(rangeText(e,a.first,a.last))===u&&(!i||Math.abs(a.first-t.from)<Math.abs(i.from-t.from))&&(i={from:a.first,to:a.last})}return i}function removedWords(e,t,n=new WordStream(e)){const r=new Set,u=[];for(const i of t?.remove??[]){const o=locateRange(e,i,n);if(!o){u.push(i);continue}for(let a=o.from;a<=o.to;a++)r.add(a)}return{cut:r,lost:u}}function snapCut(e,t,n,r){const u=Math.min(Math.max(t,n),r);return e?quietest(e,u,Math.max(n,u-SNAP),Math.min(r,u+SNAP)):u}var ROOM_IN=.5,ROOM_OUT=.6;function speechPads(e,t,n,r,u){const i=e[t],o=e[n]??i;if(!i||!o)return{padIn:0,padOut:0};const a=i.start,s=e[t-1]?.end??0,c=e[n+1]?.start??r??o.end+.4,l=Math.max(0,Math.min((a-s)/2,a)),d=Math.max(0,(c-o.end)/2),f=snapCut(u,a-Math.min(ROOM_IN,l),a-l,a),m=snapCut(u,o.end+Math.min(ROOM_OUT,d),o.end,o.end+d);return{padIn:round32(Math.max(0,a-f)),padOut:round32(Math.max(0,m-o.end))}}function applyEdits(e,t,n=0,r=e.length-1,u={}){const{levels:i,fps:o}=u,{cut:a,lost:s}=removedWords(e,t),c=[];for(let _=n;_<=r;_++)a.has(_)||c.push(_);const l=[...a].filter(_=>_>=n&&_<=r).sort((_,F)=>_-F),d=t?.maxPause,f=[],m=[],h=_=>e[_]??{text:"",start:0,end:0};if(c.length===0)return{ranges:[],words:[],kept:c,removed:l,sounds:[],inWord:[],pauses:f,lost:s};const g=[],E=new Map;for(const _ of t?.sounds??[])for(let F=0;F<c.length-1;F++){const N=h(c[F]??0),T=h(c[F+1]??0),P=Math.max(_.from,N.end),V=Math.min(_.to,T.start);if(V-P<.01)continue;const Z=E.get(F)??[];Z.push({start:P,end:V}),E.set(F,Z),g.push({from:round32(P),to:round32(V)})}const D=h(c[0]??0);let p=D.start,v=D.start;const y=t?.pad?.before??PAD_BEFORE,A=t?.pad?.after??PAD_AFTER,b=d===void 0?y:Math.min(y,d/2),x=d===void 0?A:Math.min(A,d/2);for(let _=0;_<c.length-1;_++){const F=c[_]??0,N=c[_+1]??0,T=h(F),P=h(N),V=[];for(let te=F+1;te<N;te++)V.push({start:h(te).start,end:h(te).end});V.push(...E.get(_)??[]),V.sort((te,ae)=>te.start-ae.start);const Z=V[0],S=V.at(-1);if(!Z||!S){const te=P.start-T.end;if(d!==void 0&&te>d){const ae=snapCut(i,T.end+d/2,T.end,P.start),re=snapCut(i,P.start-d/2,ae,P.start);re-ae>=JOIN&&(f.push({after:F,was:round32(te),now:d}),m.push({from:p,to:ae,lo:v,hi:re}),p=re,v=ae)}continue}const H=Math.max(0,Z.start-T.end),R=Math.max(0,P.start-S.end),G=snapCut(i,T.end+Math.min(b,H/2),T.end,T.end+H/2),X=snapCut(i,P.start-Math.min(x,R/2),P.start-R/2,P.start);m.push({from:p,to:G,lo:v,hi:Z.start}),p=Math.max(X,G),v=Math.min(p,S.end)}const B=h(c.at(-1)??0);m.push({from:p,to:B.end,lo:v,hi:B.end});const $=[];for(const _ of t?.inWord??[]){const F=(_.from+_.to)/2,N=snapCut(i,_.from,_.from-SNAP,F),T=snapCut(i,_.to,F,_.to+SNAP);if(T-N<JOIN)continue;let P=!1;for(let V=0;V<m.length;V++){const Z=m[V];!Z||N>=Z.to||T<=Z.from||(P=!0,N>Z.from&&T<Z.to?(m.splice(V,1,{from:Z.from,to:N,lo:Z.lo,hi:N},{from:T,to:Z.to,lo:T,hi:Z.hi}),V++):N<=Z.from&&T>=Z.to?(m.splice(V,1),V--):N<=Z.from?(Z.from=T,Z.lo=T):(Z.to=N,Z.hi=N))}P&&$.push({from:round32(N),to:round32(T),words:c.filter(V=>h(V).start<T&&h(V).end>N)})}o!==void 0&&o>0&&m.forEach((_,F)=>{if(F>0){const N=Math.floor(_.from*o+1e-6)/o;N>=_.lo-1e-9&&(_.from=N)}if(F<m.length-1){const N=Math.ceil(_.to*o-1e-6)/o;N<=_.hi+1e-9&&(_.to=N)}});const k=[];for(const _ of m){const F=k.at(-1);F&&_.from-F.to<JOIN?F.to=Math.max(F.to,_.to):k.push({from:_.from,to:_.to})}const w=k.map(_=>({from:round32(_.from),to:round32(_.to)})),I=editedLength(w),M=_=>round32(Math.min(I,Math.max(0,toEdited(w,_))));return{ranges:w,words:c.map(_=>{const F=h(_);return{text:F.text,start:M(F.start),end:M(F.end)}}),kept:c,removed:l,sounds:g,inWord:$,pauses:f,lost:s}}function editedLength(e){return e.reduce((t,n)=>t+(n.to-n.from),0)}function toEdited(e,t){let n=0;const r=e[0];if(!r)return t;if(t<=r.from)return t-r.from;for(const i of e){if(t<i.from)return n;if(t<=i.to)return n+(t-i.from);n+=i.to-i.from}const u=e.at(-1)??r;return n+(t-u.to)}function fromEdited(e,t){const n=e[0];if(!n)return t;if(t<=0)return n.from+t;let r=0;for(const i of e){const o=i.to-i.from;if(t<r+o)return i.from+(t-r);r+=o}return(e.at(-1)??n).to+(t-r)}var CAPTION_CUE_DEFAULTS={maxChars:42,maxCharsCjk:16,minSeconds:.8,maxSeconds:6,gapFrames:2};function shownToSpoken(e,t){const n=(u,i)=>normText(u.slice(0,i)).length,r=[[0,0]];for(const u of changesOf(e,t))r.push([n(e,u.at),n(t,u.into)]),r.push([n(e,u.at+u.removed),n(t,u.into+u.inserted)]);return r.push([normText(e).length,normText(t).length]),u=>{for(let i=1;i<r.length;i++){const[o,a]=r[i-1]??[0,0],[s,c]=r[i]??[0,0];if(u>s&&i<r.length-1)continue;if(s<=o)return u<=o?a:c;const l=Math.max(0,Math.min(1,(u-o)/(s-o)));return a+(c-a)*l}return 0}}var CJK2=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,SENTENCE=/[。!?!?…]|\.(?=\s|$)/u,CLAUSE=/[,、;:,;:—]/u,TRAILING=/[,、;:。,;:.\s]+$/u;function keptSpans(e,t){const n=[],r=shownWords(e).map(u=>({...u,n:normText(u.w)}));for(const u of t){const i=normText(u);if(!i)continue;if(CJK2.test(u)){const a=[];Array.from(e).reduce((c,l)=>(normText(l)&&a.push(c),c+l.length),0);const s=normText(e);for(let c=s.indexOf(i);c>=0;c=s.indexOf(i,c+1)){const l=a[c],d=a[c+i.length-1];l!==void 0&&d!==void 0&&n.push([l,d+1])}continue}const o=u.split(/\s+/u).map(normText).filter(Boolean);for(let a=0;a+o.length<=r.length;a++)if(o.every((s,c)=>r[a+c]?.n===s)){const s=r[a],c=r[a+o.length-1];s&&c&&n.push([s.from,c.to])}}return n}var inside=(e,t)=>e.some(([n,r])=>t>n&&t<r);function splitLine(e,t=CJK2.test(e)?CAPTION_CUE_DEFAULTS.maxCharsCjk:CAPTION_CUE_DEFAULTS.maxChars,n=[]){const r=[],u=(o,a)=>{const s=e.slice(o,a),c=s.length-s.trimStart().length,l=s.trim();l&&r.push({text:l,from:o+c,to:o+c+l.length})},i=(o,a,s)=>{const c=e.slice(o,a);if(Array.from(c.trim()).length<=t){u(o,a);return}const d=s===0?SENTENCE:s===1?CLAUSE:void 0;if(d){let g=-1;for(let E=1;E<c.length-1;E++)d.test(c[E]??"")&&!inside(n,o+E+1)&&(g<0||Math.abs(E-c.length/2)<Math.abs(g-c.length/2))&&(g=E);if(g<0){i(o,a,s+1);return}i(o,o+g+1,s),i(o+g+1,a,s);return}const f=Math.floor(c.length/2),m=g=>g>0&&g<c.length&&!inside(n,o+g);let h=-1;if(!CJK2.test(c)){for(let g=f;g>0&&h<0;g--)c[g]===" "&&m(g)&&(h=g);for(let g=f;g<c.length&&h<0;g++)c[g]===" "&&m(g)&&(h=g)}for(let g=0;g<=c.length&&h<0;g++)m(f-g)?h=f-g:m(f+g)&&(h=f+g);if(h<0){u(o,a);return}i(o,o+h,s),i(o+h,a,s)};return i(0,e.length,0),r}function captionCues(e,t={}){const{lines:n,fps:r}=e,u={...CAPTION_CUE_DEFAULTS,...t},i=[];for(const c of n){if(c.words.length===0)continue;const l=c.words,d=new ScriptAlignment(new WordStream(l),[c.spoken]),f=(D,p)=>{const v=l[d.wordAtChar(0,D)];return v?p?v.end:v.start:0};if((d.lines[0]?.length??0)===0)continue;const g=normText(c.shown)===normText(c.spoken)?D=>D:shownToSpoken(c.shown,c.spoken),E=CJK2.test(c.shown)?u.maxCharsCjk:u.maxChars;for(const D of splitLine(c.shown,E)){const p=Math.round(g(normText(c.shown.slice(0,D.from)).length)),v=Math.round(g(normText(c.shown.slice(0,D.to)).length)),y=f(p,!1),A=f(Math.max(p,v-1),!0),b=CJK2.test(D.text)?D.text.replace(TRAILING,""):D.text.replace(/[,;:]+$/u,"");b&&i.push({start:y,end:Math.max(A,y),text:b,part:c.part})}}const o=1/r,a=c=>Math.round(c*r)/r,s=i.map(c=>({...c,start:a(c.start),end:a(c.end)}));for(let c=0;c<s.length;c++){const l=s[c];if(!l)continue;const d=s[c+1],f=d?d.start-u.gapFrames*o:1/0;l.end=Math.min(Math.max(l.end,l.start+u.minSeconds),l.start+u.maxSeconds,f),l.end<=l.start&&(l.end=l.start+o)}return s}function subtitleCues(e,t){return t===void 0?captionCues(e):wordCues(e.lines,{...t,fps:e.fps}).map(n=>({start:n.start,end:n.end,text:n.text,part:n.part}))}function shownWords(e){const t=[],n=/\S+/gu;for(let r=n.exec(e);r;r=n.exec(e))t.push({w:r[0],from:r.index,to:r.index+r[0].length});return t}function wordCues(e,t){const{fps:n}=t,r=[];for(const a of e){if(a.words.length===0)continue;const s=a.words,c=new ScriptAlignment(new WordStream(s),[a.spoken]);if((c.lines[0]?.length??0)===0)continue;const d=(p,v)=>{const y=s[c.wordAtChar(0,p)];return y?v?y.end:y.start:0},m=normText(a.shown)===normText(a.spoken)?p=>p:shownToSpoken(a.shown,a.spoken),h=(p,v)=>{const y=Math.round(m(normText(a.shown.slice(0,p)).length)),A=Math.round(m(normText(a.shown.slice(0,v)).length));return[d(y,!1),d(Math.max(y,A-1),!0)]},g=CJK2.test(a.shown),E=t.maxChars??(g?16:32),D=keptSpans(a.shown,t.keep??[]);for(const p of splitLine(a.shown,E,D)){const v=(g?[{w:p.text,from:p.from,to:p.to}]:shownWords(a.shown.slice(p.from,p.to)).map(k=>({w:k.w,from:k.from+p.from,to:k.to+p.from}))).filter(k=>normText(k.w)!=="");if(v.length===0)continue;const y=t.maxWords&&t.maxWords>0?t.maxWords:v.length,A=Math.ceil(v.length/y),b=Math.ceil(v.length/A),x=[];v.forEach((k,w)=>{const I=v[w-1],M=x.at(-1);M&&I&&inside(D,Math.ceil((I.to+k.from)/2))?M.push(k):x.push([k])});const B=[];let $=[];for(const k of x)$.length>0&&$.length+k.length>b&&(B.push($),$=[]),$.push(...k);$.length>0&&B.push($);for(const k of B){const w=k.map(F=>{const[N,T]=h(F.from,F.to);return{text:F.w,start:N,end:Math.max(T,N)}}),I=w[0],M=w.at(-1);if(!I||!M)continue;const _=k.map(F=>F.w).join(g?"":" ").replace(g?TRAILING:/[,;:]+$/u,"");r.push({start:I.start,end:M.end,text:_,part:a.part,words:w})}}}const u=a=>Math.round(a*n)/n,i=1/n,o=r.map(a=>({...a,start:u(a.start),end:u(a.end)}));for(let a=0;a<o.length;a++){const s=o[a];if(!s)continue;const c=o[a+1],l=c?.part===s.part;c&&l&&c.start-s.end<(t.close??.4)&&(s.end=c.start),s.end=Math.max(s.end,s.start+Math.min(.5,6*i)),c&&s.end>c.start&&(s.end=c.start),s.end<=s.start&&(s.end=s.start+i)}return o}function cuesIn(e,t,n){const r=u=>Math.round(u*1e6)/1e6;return e.filter(u=>u.end>t&&u.start<n).map(u=>({start:r(Math.max(u.start,t)-t),end:r(Math.min(u.end,n)-t),text:u.text,words:u.words.map(i=>({text:i.text,start:r(i.start-t),end:r(i.end-t)}))}))}function easeValue(e,t){const n=Math.min(Math.max(t,0),1);switch(e??"linear"){case"linear":return n;case"in":return n*n*n;case"out":return 1-(1-n)**3;case"in-out":return n<.5?4*n*n*n:1-(-2*n+2)**3/2}}function keyAt(e,t){const n=e[0];if(!n)return 0;if(t<=n.t)return n.v;for(let r=1;r<e.length;r++){const u=e[r-1],i=e[r];if(!(!u||!i)&&t<i.t){const o=i.t-u.t;return o<=0?i.v:u.v+(i.v-u.v)*easeValue(i.ease,(t-u.t)/o)}}return e.at(-1)?.v??n.v}function rectChannel(e,t){return e.map(n=>({t:n.t,v:n.rect[t],...n.ease?{ease:n.ease}:{}}))}function rectAt(e,t){return[keyAt(rectChannel(e,0),t),keyAt(rectChannel(e,1),t),keyAt(rectChannel(e,2),t),keyAt(rectChannel(e,3),t)]}function simplifyKeys(e,t){if(e.length<=2)return[...e];const n=new Uint8Array(e.length);n[0]=1,n[e.length-1]=1;const r=[[0,e.length-1]];for(;r.length>0;){const[u,i]=r.pop()??[0,0],o=e[u],a=e[i];if(!o||!a)continue;let s=-1,c=-1;for(let l=u+1;l<i;l++){const d=e[l];if(!d)continue;const f=a.t===o.t?0:(d.t-o.t)/(a.t-o.t);let m=0;d.v.forEach((h,g)=>{const E=(o.v[g]??0)+((a.v[g]??0)-(o.v[g]??0))*f;m=Math.max(m,Math.abs(h-E))}),m>s&&(s=m,c=l)}s>t&&c>0&&(n[c]=1,r.push([u,c],[c,i]))}return e.filter((u,i)=>n[i]===1)}var TRANSITION_TYPES=["fade","dip","slide","push","wipe","zoom","custom"],TRANSITION_DEFAULTS={dur:.4,split:.5,direction:"left",scale:1.2};function transitionEase(e){return e==="fade"||e==="dip"||e==="custom"?"linear":"in-out"}var isNumber=e=>typeof e=="number"&&Number.isFinite(e);function channelKeys(e){if(isNumber(e))return[{t:0,v:e},{t:1,v:e}];if(!Array.isArray(e)||e.length===0)return;const t=e;if(t.length===2&&isNumber(t[0])&&isNumber(t[1]))return[{t:0,v:t[0]},{t:1,v:t[1]}];const n=[];for(const r of t){if(typeof r!="object"||r===null)return;const{p:u,v:i}=r;if(!isNumber(u)||!isNumber(i)||u<0||u>1||n.length>0&&u<(n.at(-1)?.t??0))return;n.push({t:u,v:i})}return n}var CLIP_EDGES=["left","right","top","bottom"],TYPE_LIST=TRANSITION_TYPES.map(e=>`"${e}"`).join(", ");function transitionSpec(e){return typeof e=="string"?{type:e}:e}var line=(e,t)=>[{t:0,v:e},{t:1,v:t}],still=(e,t)=>e.every(n=>Math.abs(n.v-t)<1e-9);function customPicture(e){const t={};if(!e)return t;const n=(r,u,i)=>{const o=u===void 0?void 0:channelKeys(u);o&&!still(o,i)&&(t[r]=o)};n("x",e.x,0),n("y",e.y,0),n("scale",e.scale,1),n("opacity",e.opacity,1);for(const r of CLIP_EDGES)n(r,e.clip?.[r],0);return t}var isClear=e=>e==="transparent"||/^#[0-9a-f]{6}00$/i.test(e);function transitionKeys(e,t){const n=t.transparent?{add:!0}:{};switch(e.type){case"fade":return{out:{},in:{opacity:line(0,1)},...n};case"dip":{const r=t.color??t.background,u=[{t:0,v:0},{t:.5,v:0},{t:1,v:1}];return isClear(r)?{out:{opacity:[{t:0,v:1},{t:.5,v:0},{t:1,v:0}]},in:{opacity:u}}:{out:{},in:{opacity:u},color:{value:r,opacity:[{t:0,v:0},{t:.5,v:1},{t:1,v:1}]}}}case"slide":case"push":{const r=e.direction??TRANSITION_DEFAULTS.direction,u=r==="left"||r==="right",i=r==="left"||r==="up"?1:-1,o=a=>u?{x:a}:{y:a};return{out:e.type==="push"?o(line(0,-i)):{},in:o(line(i,0))}}case"wipe":{const r=e.direction??TRANSITION_DEFAULTS.direction,u=line(1,0);return{out:{},in:r==="left"?{left:u}:r==="right"?{right:u}:r==="up"?{top:u}:{bottom:u}}}case"zoom":{const r=e.scale??TRANSITION_DEFAULTS.scale,u=e.from??r;return{out:{scale:line(1,r)},in:{...Math.abs(u-1)<1e-9?{}:{scale:line(u,1)},opacity:line(0,1)},...n}}case"custom":{const r=e.color===void 0?void 0:channelKeys(e.color.opacity),u=t.color??t.background;return{out:customPicture(e.out),in:customPicture(e.in),...r&&!still(r,0)&&!isClear(u)?{color:{value:u,opacity:r}}:{}}}}}function transitionWindow(e,t,n,r){const u=Math.max(1,Math.round((e.dur??TRANSITION_DEFAULTS.dur)*t)),i=Math.min(Math.max(e.split??TRANSITION_DEFAULTS.split,0),1),o=Math.round(u*i);return{before:Math.max(0,Math.min(o,Math.floor(n/2))),after:Math.max(0,Math.min(u-o,Math.floor(r/2)))}}function windowFrames(e,t){const n=Math.round(e.start*t);return{first:n,frames:Math.round(e.end*t)-n,join:Math.round(e.at*t)}}function transitionAt(e,t,n){if(!e||e.length===0)return;const r=Math.floor(t*n+1e-6);return e.find(u=>r>=Math.round(u.start*n)&&r<Math.round(u.end*n))}var rawProgress=(e,t)=>Math.min(Math.max((e+1)/(t+1),0),1);function progressAt(e,t,n){const r=windowFrames(e,n);return easeValue(e.ease,rawProgress(t-r.first,r.frames))}var at=(e,t,n)=>e?keyAt(e,n):t;function pictureAt(e,t){return{x:at(e.x,0,t),y:at(e.y,0,t),scale:at(e.scale,1,t),opacity:at(e.opacity,1,t),left:at(e.left,0,t),right:at(e.right,0,t),top:at(e.top,0,t),bottom:at(e.bottom,0,t)}}function stateAt(e,t){const n=pictureAt(e.in,t),r=pictureAt(e.out,t),u=e.add===!0;return{out:u?{...r,opacity:1-n.opacity}:r,in:n,...e.color?{color:{value:e.color.value,opacity:at(e.color.opacity,0,t)}}:{},add:u}}function transitionState(e,t,n){return stateAt(e.keys,progressAt(e,t,n))}function pictureOffset(e,t,n){return[Math.floor(e.x*t+.5),Math.floor(e.y*n+.5)]}var fixed=e=>{const t=(Math.round(e*1e4)/1e4).toString();return t==="-0"?"0":t};function pictureCss(e,t,n){const[r,u]=pictureOffset(e,t,n),i=r!==0||u!==0,o=Math.abs(e.scale-1)>1e-9,a=e.left>0||e.right>0||e.top>0||e.bottom>0;return{transform:`${i?`translate(${String(r)}px, ${String(u)}px)`:""}${i&&o?" ":""}${o?`scale(${fixed(e.scale)})`:""}`,opacity:e.opacity>=1?"":fixed(Math.max(0,e.opacity)),clipPath:a?`inset(${fixed(e.top*n)}px ${fixed(e.right*t)}px ${fixed(e.bottom*n)}px ${fixed(e.left*t)}px)`:""}}function heldTime(e,t,n){if(t>=e.start&&t<e.end-.5/n)return t;const r=Math.round(e.start*n),u=Math.max(r,Math.round(e.end*n)-1),i=Math.min(Math.max(Math.round(t*n),r),u);return i===r?e.start:i/n}function extendFootage(e,t,n){const r=e.cuts?.[0],u=r?Math.max(t,e.start-Math.max(0,r.from)):t;if(u===e.start&&n===e.end)return e;const i=e.start-u;return{...e,start:u,end:n,from:r?r.from-i:e.from-i*e.speed,...e.cuts&&r?{cuts:[{at:u,from:r.from-i},...e.cuts.slice(1)]}:{}}}function withHandles(e,t,n,r){if(!n||n.length===0)return[...e];const u=(i,o)=>Math.round(i*r)===Math.round(o*r);return e.map(i=>{const o=t.find(d=>d.key===i.part);if(!o)return i;const a=n.find(d=>d.part===i.part),s=n.find(d=>d.from===i.part),c=a&&u(i.start,o.start)&&a.start<i.start?a.start:i.start,l=s&&u(i.end,o.end)&&s.end>i.end?s.end:i.end;return extendFootage(i,c,l)})}function sourceAt(e,t){const n=e.cuts;if(n&&n.length>0){let r=n[0]??{at:e.start,from:e.from};for(const u of n)u.at<=t+1e-9&&(r=u);return r.from+(t-r.at)}return e.from+(t-e.start)*e.speed}function zoomRect(e,t,n,r){if(t===1)return e;const u=1-1/t;return[e[0]+n*e[2]*u,e[1]+r*e[3]*u,e[2]/t,e[3]/t]}function zoomChannel(e,t){return e.map(n=>({t:n.t,v:n[t],...n.ease?{ease:n.ease}:{}}))}function placementAt(e,t){let n=e.box,r=e.picture;if(e.boxes&&e.boxes.length>0){const i=e.boxes[0]?.box??e.box,o=rectAt(e.boxes.map(h=>({t:h.t,rect:h.box,...h.ease?{ease:h.ease}:{}})),t),a=boxFit(e,i,o),[s,c,l,d]=e.picture,f=o[0]+o[2]/2+(s+l/2-(i[0]+i[2]/2))*a,m=o[1]+o[3]/2+(c+d/2-(i[1]+i[3]/2))*a;r=[f-l*a/2,m-d*a/2,l*a,d*a],n=o}let u=e.crop;if(u&&e.pan&&e.pan.length>0){const i=keyAt(e.pan.map(a=>({t:a.t,v:a.x})),t),o=keyAt(e.pan.map(a=>({t:a.t,v:a.y})),t);u=[i,o,u[2],u[3]]}return u&&e.zoom&&e.zoom.length>0&&(u=zoomRect(u,keyAt(zoomChannel(e.zoom,"z"),t),keyAt(zoomChannel(e.zoom,"cx"),t),keyAt(zoomChannel(e.zoom,"cy"),t))),{box:n,picture:r,...u?{crop:u}:{}}}function boxFit(e,t,n){const[,,r,u]=e.picture;if(r<=0||u<=0||t[2]<=0||t[3]<=0)return 1;const i=e.fit==="cover"?Math.max:Math.min,o=i(t[2]/r,t[3]/u);return i(n[2]/r,n[3]/u)/o}function sourceToFrame(e,t){const n=e.crop;if(!n)return t;const r=e.picture[2]/n[2],u=e.picture[3]/n[3];return[e.picture[0]+(t[0]-n[0])*r,e.picture[1]+(t[1]-n[1])*u,t[2]*r,t[3]*u]}function overlap(e,t){const n=Math.max(e[0],t[0]),r=Math.max(e[1],t[1]),u=Math.min(e[0]+e[2],t[0]+t[2]),i=Math.min(e[1]+e[3],t[1]+t[3]);return u>n&&i>r?[n,r,u-n,i-r]:void 0}function faceOnFrame(e,t,n,r=e.speaker??t.speaker){if(n<e.start||n>=e.end)return;const u=faceAt(t,sourceAt(e,n),r);if(!u)return;const i=placementAt(e,n);return overlap(sourceToFrame(i,u),i.box)}function facesOnFrame(e,t,n){if(n<e.start||n>=e.end)return[];const r=placementAt(e,n);return facesAt(t,sourceAt(e,n)).flatMap(u=>{const i=overlap(sourceToFrame(r,u.box),r.box);return i?[{id:u.id,box:i}]:[]})}function reframeWindow(e,t){const n=t.w/t.h,r=Math.min(e.width,e.height*n);return{w:Math.min(e.width,Math.round(r)),h:Math.min(e.height,Math.round(r/n))}}var REFRAME_FACE_Y=.4,REFRAME_FALLBACK={x:.5,y:.4};function reframePath(e){const{window:t,source:n,layer:r}=e,u=f=>Math.min(Math.max(f,0),n.width-t.w),i=f=>Math.min(Math.max(f,0),n.height-t.h),o=e.faceY??REFRAME_FACE_Y,a=f=>{const m=e.track?faceAt(e.track,sourceAt(r,f),e.speaker??e.track.speaker):void 0,h=m?m[0]+m[2]/2:(e.focus?.x??.5)*n.width,g=m?m[1]+m[3]/2:(e.focus?.y??.4)*n.height;return[u(h-t.w/2),i(g-t.h*o)]},s=(r.cuts??[]).map(f=>f.at).filter(f=>f>r.start&&f<r.end),c=[r.start,...s,r.end],l=[];for(let f=0;f<c.length-1;f++){const m=c[f]??0,h=c[f+1]??m,g=[];for(let D=m;D<h-1e-6;D+=.1)g.push({t:D,v:a(D)});const E=Math.max(m,h-.001);g.push({t:E,v:a(E)});for(const D of simplifyKeys(g,1.5))l.push({t:Math.round(D.t*1e6)/1e6,x:Math.round((D.v[0]??0)*100)/100,y:Math.round((D.v[1]??0)*100)/100})}const d=l[0];return d&&l.every(f=>f.x===d.x&&f.y===d.y)?[d]:l}var PUNCH_IN=.2,PUNCH_OUT=.25,PUNCH_SCALE=1.12,PUNCH_EASE="in-out",PUNCH_CENTER={x:.5,y:.42};function punchKeys(e){const t=[...e].sort((i,o)=>i.start-o.start),n=[],r=i=>Math.round(i*1e6)/1e6;let u=PUNCH_OUT;for(const i of t){const o=i.in??PUNCH_IN,a=i.out??PUNCH_OUT,s=i.ease??PUNCH_EASE,c=i.start-o/2,l=i.start+o/2,d=n.at(-1);d&&d.t>c?(n.pop(),n.push({t:r(Math.max(d.t-u,l)),z:i.scale,cx:i.cx,cy:i.cy,ease:s})):(n.push({t:r(Math.max(0,c)),z:1,cx:i.cx,cy:i.cy}),n.push({t:r(l),z:i.scale,cx:i.cx,cy:i.cy,ease:s}));const f=Math.max(i.end,l);n.push({t:r(f),z:i.scale,cx:i.cx,cy:i.cy}),n.push({t:r(f+a),z:1,cx:i.cx,cy:i.cy,ease:s}),u=a}return n}var PULLBACK_SCALE=1.12,PULLBACK_DUR=.6,PULLBACK_EASE="out";function pullbackKeys(e,t,n=[]){const r=a=>Math.round(a*1e6)/1e6,u=n[0],i=Math.min(e+t.dur,u?.t??1/0);if(i<=e+1e-6)return[...n];const o=u&&u.t<=i+1e-9&&u.z===1?n.slice(1):n;return[{t:r(e),z:t.scale,cx:t.cx,cy:t.cy},{t:r(i),z:1,cx:t.cx,cy:t.cy,ease:t.ease??PULLBACK_EASE},...o]}function parsePunch(e){const t=/^(.*\S)@(\d*\.\d+)$/u.exec(e.trim());return!t?.[1]||t[2]===void 0?{ref:e}:{ref:t[1],scale:Number(t[2])}}var MATTE_FEATHER=2,MATTE_SHRINK=4;function backdropUnit(e,t){return Math.min(e,t)/1080}var MATTE_FIRM=[.25,.75];function firmLevels(){const e=new Uint8ClampedArray(256),[t,n]=MATTE_FIRM;for(let r=0;r<256;r++)e[r]=Math.round((r/255-t)/(n-t)*255);return e}var MATTE_FLOOR=6;function matteEdge(e,t,n){const r=.2*Math.max(0,n),u=Math.max(Math.hypot(e,r),Math.abs(t)/1.5,.001),i=Math.sqrt(Math.max(0,u*u-r*r)),o=a=>Math.round(a*1e4)/1e4;return{sigma:o(i),gain:o(Math.exp(1.702*t/u))}}function edgeLevels(e){const t=new Uint8ClampedArray(256);for(let n=0;n<256;n++){const r=Math.min(Math.max((n-MATTE_FLOOR)/(255-2*MATTE_FLOOR),0),1);t[n]=Math.round(255*r/(r+e.gain*(1-r)))}return t}var READ_DEFAULTS={every:.2,opacity:.9,shown:.9,phone:[390,844]};function phoneScale(e,t){return Math.min(t[0]/e[0],t[1]/e[1])}function countWords(e){let t=0;for(const r of new Intl.Segmenter(void 0,{granularity:"word"}).segment(e))r.isWordLike&&t++;let n=0;for(const r of new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(e))r.segment.trim()!==""&&n++;return{words:t,chars:n}}function textTime(e,t,n=READ_DEFAULTS){const r=new Map;for(const v of e)r.set(v.text,(r.get(v.text)??0)+1);let u,i=0;for(const v of e){const y=r.get(v.text)??0;y>=i&&(i=y,u=v.text)}if(u===void 0)return;const o=e.filter(v=>v.text===u),a=v=>v.opacity>=n.opacity-1e-9&&v.shown>=n.shown-1e-9,s=n.every,c=v=>r32(Math.min(v+s,t.end)),l=[];for(const v of o){if(!a(v))continue;const y=l.at(-1);y&&v.t-y[1]<s*.5?y[1]=c(v.t):l.push([r32(v.t),c(v.t)])}const d=o.find(a)??o[0];if(!d)return;const f=(o.some(a)?o.filter(a):o).flatMap(v=>v.size===void 0?[]:[v.size]),m=f.length>0?Math.min(...f):void 0,h=(o.some(a)?o.filter(a):o).flatMap(v=>v.xHeight===void 0?[]:[v.xHeight]),g=h.length>0?Math.min(...h):void 0,E=phoneScale(t.frame,n.phone),D=v=>r32(v.reduce((y,[A,b])=>y+Math.max(0,b-A),0)),p=[];for(const v of o){const y=p.at(-1);y&&v.t-y[1]<s*.5?y[1]=c(v.t):p.push([r32(v.t),c(v.t)])}return{part:t.part,text:{layer:t.layer,z:t.z,text:u,box:d.box},...countWords(u),seconds:D(l),spans:l,onScreen:D(p),first:r32(d.t),...m===void 0?{}:{size:{px:r12(m),phone:r12(m*E),...g===void 0?{}:{lowercase:{px:r12(g),phone:r12(g*E)}}}}}}var area=e=>Math.max(0,e[2])*Math.max(0,e[3]);function overlapArea(e,t){const n=Math.min(e[0]+e[2],t[0]+t[2])-Math.max(e[0],t[0]),r=Math.min(e[1]+e[3],t[1]+t[3])-Math.max(e[1],t[1]);return n>0&&r>0?n*r:0}var r32=e=>Math.round(e*1e3)/1e3,r12=e=>Math.round(e*10)/10;function boxOverlap(e,t){const n=overlapArea(e,t);if(n<=0)return;const r=Math.min(area(e),area(t));return{area:Math.round(n),share:r>0?r32(n/r):0}}function safeEdges(e,t,n,r){const[u,i,o,a]=e;return[["top",t.top>0?t.top-i:0],["bottom",t.bottom>0?i+a-(r-t.bottom):0],["left",t.left>0?t.left-u:0],["right",t.right>0?u+o-(n-t.right):0]].filter(([,c])=>c>=1).map(([c,l])=>({side:c,px:Math.round(l)}))}function outsideEdges(e,t){return[["top",t[1]-e[1]],["bottom",e[1]+e[3]-(t[1]+t[3])],["left",t[0]-e[0]],["right",e[0]+e[2]-(t[0]+t[2])]].filter(([,r])=>r>=1).map(([r,u])=>({side:r,px:Math.round(u)}))}function offFrame(e,t,n){let r=0,u=0;const i={top:0,bottom:0,left:0,right:0};let[o,a,s,c]=[1/0,1/0,-1/0,-1/0];for(const h of e)h[2]<=0||h[3]<=0||(o=Math.min(o,h[0]),a=Math.min(a,h[1]),s=Math.max(s,h[0]+h[2]),c=Math.max(c,h[1]+h[3]),r+=area(h),u+=overlapArea(h,[0,0,t,n]),i.top=Math.max(i.top,-h[1]),i.bottom=Math.max(i.bottom,h[1]+h[3]-n),i.left=Math.max(i.left,-h[0]),i.right=Math.max(i.right,h[0]+h[2]-t));if(r<=0)return;const l=["top","bottom","left","right"].filter(h=>i[h]>=1).map(h=>({side:h,px:Math.round(i[h])}));if(l.length===0)return;const d=Math.max(0,r-u),f=Math.round(o),m=Math.round(a);return{outside:Math.round(d),share:r32(d/r),edges:l,glyphs:[f,m,Math.round(s)-f,Math.round(c)-m]}}function measureMoment(e){const t=[],n=[],r=c=>e.seen?.[c]??e.texts[c]?.box;for(let c=0;c<e.texts.length;c++)for(let l=c+1;l<e.texts.length;l++){const d=e.texts[c],f=e.texts[l];if(!d||!f)continue;if(e.owner[c]===e.owner[l]){const h=r(c),g=r(l),E=h&&g?boxOverlap(h,g):void 0;E&&n.push({a:c,b:l,...E});continue}const m=boxOverlap(d.box,f.box);m&&t.push({a:c,b:l,...m})}const u=[];e.texts.forEach((c,l)=>{const d=r(l);if(!(!d||c.viewport))for(const f of e.containers?.[l]??[]){const m=outsideEdges(d,f.box);if(m.length!==0){u.push({text:l,container:f,edges:m});break}}});const i=[],o=e.face;o&&e.texts.forEach((c,l)=>{const d=overlapArea(c.box,o);d<=0||i.push({text:l,area:Math.round(d),ofText:r32(d/Math.max(1,area(c.box))),ofFace:r32(d/Math.max(1,area(o)))})});const a=[];e.texts.forEach((c,l)=>{if(c.viewport)return;const d=safeEdges(c.box,e.safe,e.width,e.height);d.length>0&&a.push({text:l,edges:d})});const s=[];return e.texts.forEach((c,l)=>{if(c.viewport)return;const d=r(l),f=offFrame(e.glyphs?.[l]??(d?[d]:[]),e.width,e.height);f&&s.push({text:l,...f})}),{t:e.t,part:e.part,texts:e.texts,...o?{face:o}:{},overlaps:t,ownOverlaps:n,outside:u,faceOverlaps:i,safeOverlaps:a,offFrame:s}}function footageScale(e,t=1,n){const r=e.crop;if(!r||!e.source||r[2]<=0||r[3]<=0)return;const u=e.picture,i=e.zoom&&e.zoom.length>0?zoomChannel(e.zoom,"z"):[],o=e.boxes&&e.boxes.length>1?e.boxes:void 0,a=o?.[0]?.box,s=o?.map(h=>({t:h.t,rect:h.box,...h.ease?{ease:h.ease}:{}})),c=Math.max(e.start,n?e.end-1/n:e.end),l=[e.start,...i.map(h=>h.t),...(o??[]).map(h=>h.t),c].map(h=>Math.min(Math.max(h,e.start),c)).sort((h,g)=>h-g),d=h=>{const g=i.length>0?keyAt(i,h):1,E=s&&a?boxFit(e,a,rectAt(s,h)):1,D=Math.max(u[2]*E/r[2],u[3]*E/r[3])*g*t,p=[e.fit];return Math.abs(g-1)>1e-6&&p.push(`zoom ${String(r32(g))}×`),s&&Math.abs(E-1)>1e-6&&p.push(`box key ${String(r32(E))}×`),{scale:r32(D),t:r32(h),from:p}};let f=d(e.start),m=f;for(const h of l){const g=d(h);g.scale>f.scale&&(f=g),g.scale<m.scale&&(m=g)}return{part:e.part,file:e.file,source:[e.source.width,e.source.height],shown:[Math.round(r[2]),Math.round(r[3])],max:f,min:m}}var STRUCTURE="structure";function comboKey(e){const t=Object.keys(e).sort();return t.length===0?"default":t.map(n=>`${n}=${e[n]??""}`).join(",")}function seedKey(e,t){return comboKey({...e,size:t})}var hasSlots=e=>e!==void 0&&Object.keys(e.slots).length>0;function structureOf(e,t){return e.declared?t[STRUCTURE]:Object.keys(e.structures)[0]}function slotsOf(e,t){const n=structureOf(e,t);return n===void 0?[]:e.structures[n]??[]}function dimsCombo(e,t){const n={};for(const r of Object.keys(e)){const u=t[r];u!==void 0&&(n[r]=u)}return n}var listOf=e=>typeof e=="string"?[e]:e;function valueMatches(e,t,n){return listOf(e).some(r=>r.startsWith("#")?n?.tags.includes(r.slice(1))??!1:r===t)}function holds(e,t,n,r,u){if(r===STRUCTURE){const i=structureOf(e,n);return i!==void 0&&valueMatches(u,i,void 0)?"yes":"no"}if(r in e.slots){if(!slotsOf(e,n).includes(r))return"no";const i=n[r];if(i===void 0)return"no";const o=e.slots[r]?.find(a=>a.name===i);return valueMatches(u,i,o)?"yes":"no"}if(r in t){const i=n[r];return i===void 0?"unknown":valueMatches(u,i,void 0)?"yes":"no"}return"no"}var all=e=>e.includes("no")?"no":e.includes("unknown")?"unknown":"yes";function keepsRule(e,t,n,r){const u=all(Object.entries(n.if??{}).map(([s,c])=>holds(e,t,r,s,c)));if(u==="no")return"yes";const i=Object.entries(n.require??{}).map(([s,c])=>holds(e,t,r,s,c)),o=Object.entries(n.exclude??{}).map(([s,c])=>{const l=holds(e,t,r,s,c);return l==="yes"?"no":l==="no"?"yes":"unknown"}),a=all([...i,...o]);return a==="yes"?"yes":u==="unknown"||a==="unknown"?"unknown":"no"}function keepsRules(e,t,n,r){return n.every(u=>keepsRule(e,t,u,r)!=="no")}function validCombo(e,t,n,r){const u=new Set(Object.keys(r));for(const[o,a]of Object.entries(t)){if(!a.includes(r[o]??""))return!1;u.delete(o)}if(!hasSlots(e))return u.size===0;const i=structureOf(e,r);if(i===void 0||!(i in e.structures))return!1;e.declared&&u.delete(STRUCTURE);for(const o of slotsOf(e,r)){if(!e.slots[o]?.some(a=>a.name===r[o]))return!1;u.delete(o)}return u.size===0&&keepsRules(e,t,n,r)}function fact(e,t,n){return{kind:e,...t,data:n}}var CONSOLE_LEVELS=["log","info","warn","error","debug"],PHASE_ORDER={module:0,build:1,mount:2,render:3,cover:4,other:5},CONSOLE_LIMIT=200,CONSOLE_TEXT_MAX=4e3,keyOf=e=>[e.level,e.phase,e.part??"",e.layer??"",e.index??"",e.text].join("\0"),ConsoleCollector=class{limit;kept=new Map;droppedCalls=0;constructor(e=CONSOLE_LIMIT){this.limit=Math.max(0,e)}add(e){const t=e.count??1,n=keyOf(e),r=this.kept.get(n);if(r){r.count+=t;const u=[r.t,e.t].filter(o=>o!==void 0),i=[r.until??r.t,e.until??e.t].filter(o=>o!==void 0);if(u.length>0){const o=Math.min(...u),a=Math.max(...i);r.t=o,a>o&&(r.until=a)}return}if(this.kept.size>=this.limit){this.droppedCalls+=t;return}this.kept.set(n,{level:e.level,text:e.text,phase:e.phase,...e.part===void 0?{}:{part:e.part},...e.layer===void 0?{}:{layer:e.layer},...e.index===void 0?{}:{index:e.index},...e.t===void 0?{}:{t:e.t},...e.until!==void 0&&e.t!==void 0&&e.until>e.t?{until:e.until}:{},count:t})}merge(e){for(const t of e.messages)this.add(t);this.droppedCalls+=e.dropped}log(e=[]){const t=new Map(e.map((r,u)=>[r,u]));return{messages:[...this.kept.values()].map((r,u)=>({m:r,i:u})).sort((r,u)=>PHASE_ORDER[r.m.phase]-PHASE_ORDER[u.m.phase]||(t.get(r.m.part??"")??-1)-(t.get(u.m.part??"")??-1)||(r.m.t??-1)-(u.m.t??-1)||r.i-u.i).map(({m:r})=>({...r})),dropped:this.droppedCalls}}};function nodeText(e){const t=globalThis.Node;if(!t||!(e instanceof t))return;const n=e;if(n.nodeType===1){const r=[...n.classList??[]].map(u=>`.${u}`).join("");return`<${n.nodeName.toLowerCase()}${r}${n.id?`#${n.id}`:""}>`}return JSON.stringify(n.textContent??"")}function shown(e){if(typeof e=="bigint")return`${String(e)}n`;if(typeof e=="function")return`[Function${e.name?` ${e.name}`:""}]`;if(typeof e=="number"&&!Number.isFinite(e))return String(e);if(typeof e!="object"||e===null)return e;if(e instanceof Error)return`${e.name}: ${e.message}`;const t=nodeText(e);return t!==void 0?t:e instanceof Map?{Map:[...e]}:e instanceof Set?{Set:[...e]}:ArrayBuffer.isView(e)&&!(e instanceof DataView)?Array.from(e):e}function jsonOf(e){const t=[];try{return JSON.stringify(e,function(n,r){for(;t.length>0&&t[t.length-1]!==this;)t.pop();if(typeof r!="object"||r===null)return shown(r);if(t.includes(r))return"[Circular]";t.push(r);const u=shown(r);return u!==r&&typeof u=="object"&&u!==null&&t.push(u),u})}catch{return Object.prototype.toString.call(e)}}function consoleValue(e){switch(typeof e){case"string":return e;case"number":case"boolean":case"undefined":return String(e);case"bigint":return`${String(e)}n`;case"symbol":return e.toString();case"function":return`[Function${e.name?` ${e.name}`:""}]`;case"object":{if(e===null)return"null";if(e instanceof Error)return`${e.name}: ${e.message}`;const t=nodeText(e);return t!==void 0?t:jsonOf(e)}}}function consoleText(e){const t=[...e],n=[],r=t[0];typeof r=="string"&&r.includes("%")&&(t.shift(),n.push(r.replace(/%([sdifoOjc%])/g,(i,o)=>{if(o==="%")return"%";if(t.length===0)return i;const a=t.shift();if(o==="c")return"";if(o==="d"||o==="i"||o==="f"){const s=typeof a=="symbol"?NaN:Number(a);return String(o==="f"?s:Math.trunc(s))}return consoleValue(a)}))),n.push(...t.map(consoleValue));const u=n.join(" ");return u.length<=CONSOLE_TEXT_MAX?u:`${u.slice(0,CONSOLE_TEXT_MAX)}… (${String(u.length-CONSOLE_TEXT_MAX)} more characters)`}var round33=e=>Math.round(e*1e3)/1e3,round6=e=>Math.round(e*1e6)/1e6;function captionTrack(e,t,n){const{specs:r,videoTakes:u,results:i}=e,{timing:o}=t,a=r.flatMap((f,m)=>{const h=o.parts[m],g=u[m];if(g&&h)return g.captionWords.length===0?[]:[{part:f.key,shown:g.line.shown||joinWords(g.captionWords),spoken:g.line.spoken||joinWords(g.captionWords),words:g.captionWords.map(A=>({text:A.text,start:round33(A.start+h.start),end:round33(A.end+h.start)}))}];const E=i[m]?.speech,D=h?.speechAt;if(D===void 0||!E||E.words.length===0)return[];const p=E.words.map(A=>({text:A.text,start:round33(A.start+D),end:round33(A.end+D)})),v=E.ranges?joinWords(E.words):i[m]?.shown??joinWords(E.words),y=E.ranges?v:E.script??v;return[{part:f.key,shown:v,spoken:y,words:p}]}),s=new Map,c=(f={})=>{const m=JSON.stringify([f.maxChars,f.maxWords,f.keep,f.close]);let h=s.get(m);return h||(h=wordCues(a,{fps:n,...f.maxChars===void 0?{}:{maxChars:f.maxChars},...f.maxWords===void 0?{}:{maxWords:f.maxWords},...f.keep===void 0?{}:{keep:f.keep},...f.close===void 0?{}:{close:f.close}}),s.set(m,h)),h},l=new Map(r.map((f,m)=>[f.key,o.words(m)]));let d;return{lines:a,get asked(){return d},cues:c,partCues(f,m,h){d??=h??{};const g=cuesIn(c(h),f,m);return h?.edges!==!0?g:g.map((E,D)=>({...E,...D===0?{start:0}:{},...D===g.length-1?{end:round6(m-f)}:{}}))},partWords:f=>l.get(f)??[],wordEnd(f,m){let h;for(const g of l.get(f)??[])(!h||Math.abs(g.start-m)<Math.abs(h.start-m))&&(h=g);return h&&Math.abs(h.start-m)<.05?h.end:m+.4}}}var LoadFailure=class extends Error{code;text;constructor(e,t){super(`${e}: ${t}`),this.name="LoadFailure",this.code=e,this.text=t}};function codeOf(e){const t=e??{};if(typeof t.code=="string"&&t.code in RULES)return t.code;if(t.code==="video_cycle")return"AK-M010";const n=typeof t.message=="string"?t.message:"",r=/\bAK-[A-Z]\d{3}\b/.exec(n)?.[0];return r!==void 0&&r in RULES?r:"AK-R001"}var messageOf=e=>e instanceof Error?e.message:String(e),round62=e=>Math.round(e*1e6)/1e6;function timeFilm(e,t,n,r){const{source:u,ledger:i}=e,{fps:o,dims:a,options:s,format:c}=t,{specs:l,inputs:d}=n,f=r?.snapTo(d),m=timeParts([...d],{fps:o,beat:r?.beat??0,beatPhase:r?.beatPhase??0,...f?{snap:f}:{}});n.videoTakes.forEach((p,v)=>{const y=m.parts[v];!p||!y||(p.shown.start=y.start,p.shown.partStart=y.start)});const h=l.map((p,v)=>{const y=m.parts[v],A=d[v]?.placed??[],b=[...A,...(d[v]?.anchors??[]).filter(x=>!A.some(B=>B.name===x.name))];return{key:p.key,start:y?.start??0,anchors:y?b.map(x=>({name:x.name,at:round62(y.start+m.at(v,`@${x.name}`)),...x.end===void 0?{}:{end:round62(y.start+m.at(v,`@/${x.name}`))}})):[]}}),g=p=>momentOf({parts:h},p),E=(p,v)=>{try{if(typeof p=="number")return p;if(typeof p=="string")return g(p);const y=l.findIndex(b=>b.key===p.part),A=m.parts[y];if(y<0||!A)throw new Error(`The video has no part ${p.part}; its parts are ${l.map(b=>b.key).join(", ")}.`);return A.start+m.at(y,p.at)}catch(y){i.problems.push(problem("AK-T004",`${v}: ${messageOf(y)}`,{where:{file:u.file}}));return}},D=new Map;{const p=v=>Math.round((v.end-v.start)*o);l.forEach((v,y)=>{const A=m.parts[y-1],b=m.parts[y];if(v.transition===void 0||!A||!b)return;const x=transitionWindow(transitionSpec(v.transition),o,p(A),p(b));x.before+x.after>0&&D.set(y,x)})}return{timing:m,duration:m.duration,parts:h,filmAt:g,momentAt:E,windows:D,checkLimit(){const p=a.profile,v=s.maxDuration;p&&m.duration>p.maxDuration+1e-6&&!(v!==void 0&&v<=p.maxDuration)&&i.problems.push(problem("AK-F001",`This video lasts ${m.duration.toFixed(1)} s, and ${p.label} (${c}) takes at most ${String(p.maxDuration)} s. Cut ${(m.duration-p.maxDuration).toFixed(1)} s: shorter parts, an edits file on the take, or fewer parts.`,{where:{file:u.file}}))}}}var EPOCH_MS=Date.UTC(2026,0,1);function hashString(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function mulberry32(e){let t=e>>>0;return()=>{t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}var realNow=performance.now.bind(performance),realTimeout=setTimeout.bind(globalThis),nativeClearTimeout=clearTimeout.bind(globalThis),realClearTimeout=e=>{nativeClearTimeout(e)};function within2(e,t){const n=e.map(()=>{});return e.length===0?Promise.resolve(n):new Promise(r=>{let u=e.length;const i=realTimeout(()=>{r([...n])},Math.max(0,t));e.forEach((o,a)=>{o.then(s=>{n[a]={status:"fulfilled",value:s}},s=>{n[a]={status:"rejected",reason:s}}).finally(()=>{u--,u===0&&(realClearTimeout(i),r([...n]))})})})}var realRaf=typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(globalThis):e=>Number(setTimeout(()=>{e(realNow())},16)),realTimers={now:realNow,setTimeout:realTimeout,clearTimeout:realClearTimeout},installed;function installGuards(){if(installed)return installed;const e=globalThis,t=Date;let n=0,r=mulberry32(1);class u extends t{constructor(...c){c.length===0?super(EPOCH_MS+n):super(...c)}static now(){return EPOCH_MS+n}}e.Date=u,Math.random=()=>r(),performance.now=()=>n;const i=s=>{if(s){const c=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);for(let l=0;l<c.length;l++)c[l]=Math.floor(r()*256)}return s};crypto.getRandomValues=i;let o=[],a=1;return e.requestAnimationFrame=s=>{const c=a++;return o.push([c,s]),c},e.cancelAnimationFrame=s=>{o=o.filter(([c])=>c!==s)},e.setTimeout=()=>0,e.setInterval=()=>0,installed={setMoment(s,c){n=s*1e3,r=mulberry32(hashString(c))},flushFrames(){const s=o;o=[];for(const[,c]of s)c(n)}},installed}var isFootage=e=>e.__allyhubLayer==="footage",zOf=e=>e.z==="behind-person"||e.z==="overlay"?e.z:"front",layerNames=e=>e.map(t=>isFootage(t)?"footage":t.component);function resolveTimes(e,t,n){if(Array.isArray(e))return e.map(u=>resolveTimes(u,t,n));if(t===!0)return typeof e=="string"||typeof e=="number"?n(e):e;if(typeof e!="object"||e===null)return e;const r={...e};for(const[u,i]of Object.entries(t))u in r&&r[u]!==void 0&&(r[u]=resolveTimes(r[u],i,n));return r}function windowOf(e,t,n){const r=o=>Math.min(Math.max(o,0),t),u=r(e.at===void 0?0:n(e.at)),i=e.until!==void 0?r(n(e.until)):e.dur!==void 0?r(u+e.dur):t;return[u,i]}function planStack(e){const t=e.some(l=>!isFootage(l)&&zOf(l)==="behind-person"),n=t?e.findIndex(l=>isFootage(l)&&l.file===void 0):-1,r=l=>n>=0&&!isFootage(l)&&zOf(l)==="behind-person",u=l=>l!==void 0&&!isFootage(l)&&zOf(l)==="overlay",i=[];e.forEach((l,d)=>{isFootage(l)?(i.push(d),d===n&&e.forEach((f,m)=>{r(f)&&i.push(m)})):!r(l)&&!u(l)&&i.push(d)}),e.forEach((l,d)=>{u(l)&&i.push(d)});const o=[],a=new Map,s=new Map;let c;for(const l of i){const d=e[l];if(!d)continue;if(isFootage(d)){c=void 0,s.set(l,o.length);continue}const f=r(d)?"behind":u(d)?"overlay":"front";c!==f&&(o.push({layers:[],...f==="behind"?{behindPerson:!0}:{},...f==="overlay"?{overlay:!0}:{}}),c=f),a.set(l,o.length-1)}return{takeAt:n,hasBehind:t,order:i,planes:o,planeOf:a,overOf:s,overlaid:l=>u(e[l])}}var noReads={captions:()=>[],face:()=>{},faces:()=>[],texts:()=>[]};function layerContexts(e,t,n,r,u){const{log:i,ledger:o,embed:a,combo:s}=e,{look:c,format:l,dims:d}=t,f=[[0,0,d.width,d.safe.top],[0,d.height-d.safe.bottom,d.width,d.safe.bottom],[0,0,d.safe.left,d.height],[d.width-d.safe.right,0,d.safe.right,d.height]].filter(E=>E[2]>0&&E[3]>0),m=contentEdges(d),h=[m.left,m.top,m.right-m.left,m.bottom-m.top],g=E=>{if(!u)throw new Error(`"${E}": a page has no film to find it in.`);return u.filmAt(E)};return E=>{const D=E.reads??noReads,p=E.record??(()=>{}),v=E.place,y=E.answers,A={look:c,format:l,dims:d,combo:E.combo??s,dur:E.dur,asset:b=>i.asset(b),optionalAsset:b=>i.optionalAsset(b),words:E.words,at:E.at,layer:{start:E.start,end:E.end},wait:b=>{o.wait(b)},report:b=>{const x=o.running,B=b.code in RULES?b.code:"AK-R001",$=x?.part??v?.part;o.ran(problem(B,b.message,{...b.level?{level:b.level}:{},...$?{part:$}:{},...x?.t===void 0?{}:{t:x.t}}))},captions:b=>D.captions(b),face:(b,x)=>D.face(b,x),faces:b=>D.faces(b),texts:b=>D.texts(b),covered:f,content:h,video:(b,x)=>n.video(b,x,p),cameraFor:b=>a?.cameras?.[b]??a?.cameras?.["*"],...a?.sceneryScale===void 0?{}:{sceneryScale:a.sceneryScale},embedded:a!==void 0,get layoutOnly(){return r.mode==="layout"},realTimers,...y?{answer:(b,x)=>{y.set(b,x)}}:{}};return v&&Object.defineProperty(A,"film",{enumerable:!0,get:()=>(p("film",String(v.start)),{start:v.start,part:v.part,at:g,...a?.shown?{outer:a.shown}:{}})}),A}}var settled=e=>Math.max(0,e-.4),round34=e=>Math.round(e*1e3)/1e3,round63=e=>Math.round(e*1e6)/1e6;function compose(e){const{env:t,piece:n,stage:r,takes:u,film:i,captions:o,footage:a,sound:s}=e,{source:c,options:l,combo:d,picked:f,ledger:m}=t,{fps:h,format:g,dims:E}=n,{specs:D}=u,{timing:p,windows:v}=i,y=[],A=[],b=[],x=l.purpose==="play",B=new Set,$=(k,w)=>{const I={};for(const[M,_]of Object.entries(d)){if(!f.has(M)||M===w){I[M]=_;continue}Object.defineProperty(I,M,{enumerable:!0,get:()=>(B.has(`${k}:${M}`)||(B.add(`${k}:${M}`),m.problems.push(problem("AK-X005",`A layer of part ${k} reads ctx.combo.${M}, ${M===STRUCTURE?"the combo's structure":`the pick of the slot ${M}`}. A part is rendered once and reused in every combo that has it, so it may read only the dimensions${w===void 0?"":` and its own slot (${w})`}. Choose in the output's function instead, and pass the result as a prop.`,{part:k,where:{file:c.file}}))),_)})}return I};for(const[k,w]of D.entries()){const I=p.parts[k];if(!I)continue;const M=I.end-I.start,_=J=>p.at(k,J),F=o.partWords(w.key),N=u.results[k]?.speech,T=u.inputs[k],P=T?.placed??[],V=[...P,...(T?.anchors??[]).filter(J=>!P.some(ne=>ne.name===J.name))],Z=u.speechFor(k,I);let S;if(typeof w.still=="function")S=w.still(M);else if(w.still===void 0){S=settled(M);const J=v.get(k),ne=v.get(k+1);if(J||ne){const le=(J?.after??0)/h,pe=M-((ne?.before??0)+1)/h;S=Math.max(le,Math.min(S,pe))}}else S=_(w.still);let H=toFrame(I.start+S,h);(H<I.start||H>=I.end)&&(H=I.start);const R=w.slot??(f.has(w.key)&&w.key!==STRUCTURE?w.key:void 0),G=f.size>0?$(w.key,R):d,X={reads:new Map,captioned:!1},te=planStack(w.layers),{takeAt:ae,planes:re,planeOf:Ee,overOf:ve,order:ue}=te,se=w.layers,j=w.post??se.map(J=>"props"in J?J.props.sensor?.grade:void 0).find(Boolean),U=u.videoTakes[k],O={key:w.key,...w.title===void 0?{}:{title:w.title},...R===void 0?{}:{slot:R},layers:layerNames(se),start:I.start,end:I.end,planes:re,still:H,...Z.speech?{speech:Z.speech}:{},...V.length>0?{anchors:V.map(J=>({name:J.name,at:round34(I.start+_(`@${J.name}`)),...J.end===void 0?{}:{end:round34(I.start+_(`@/${J.name}`))}}))}:{},...w.tags?.length?{tags:[...w.tags]}:{},...j?{post:{filter:j.filter}}:{},...w.speechGainDb!==void 0&&w.speechGainDb!==0?{speechGainDb:w.speechGainDb}:{},...U?{plays:{video:U.id,from:U.from,to:U.to}}:{}};y.push(O),s.addSpeech(Z.clips,Z.room);const L=document.createElement("section");L.className="ak-part",L.dataset.key=w.key,L.dataset.format=g,Object.assign(L.style,{position:"absolute",inset:"0",overflow:"hidden"}),showLayer(L,!1),r.el.append(L);const K=new Map;x&&se.forEach((J,ne)=>{if(!isFootage(J))return;const le=document.createElement("div");le.className="ak-footage-plane",Object.assign(le.style,{position:"absolute",inset:"0",...(ve.get(ne)??0)>0?{pointerEvents:"none"}:{}}),K.set(ne,le)});let W;K.size>0&&ae>=0&&(W=document.createElement("div"),W.className="ak-cutout-plane",Object.assign(W.style,{position:"absolute",inset:"0",pointerEvents:"none"}));const ee={captions:J=>(X.captioned=!0,o.partCues(I.start,I.end,J)),face:(J,ne)=>a.faceAt(w.key,I.start+J,ne),faces:J=>a.facesAt(w.key,I.start+J)},Q=[],Y=new Map;for(const[J,ne]of se.entries()){const[le,pe]=windowOf(ne,M,_);if(isFootage(ne)){const he=J===ae,ge=a.plan(ne,O,N,I.speechAt,le,pe,{at:_,cutout:he,over:ve.get(J)??0,person:he&&W!==void 0});if(ge&&x){const ye=K.get(J)??L,{matteUrl:Ae,personOver:$e,...we}=ge;b.push({...we,host:ye,...Ae===void 0?{}:{cutoutIn:{host:$e&&W?W:ye,matte:Ae}}})}continue}const oe=zOf(ne),fe=Ee.get(J)??0;re[fe]?.layers.push({component:ne.component,start:round63(O.start+le),end:round63(O.start+Math.max(le,pe))});const me=document.createElement("div");me.className="ak-layer",me.dataset.component=ne.component,Object.assign(me.style,{position:"absolute",inset:"0"}),showLayer(me,!1),Y.set(J,me);const Ce=ne.times?resolveTimes(ne.props,ne.times,_):ne.props,De=Q.slice(),_e=new Map,Be=e.contexts({dur:M,words:()=>F,at:_,start:le,end:pe,combo:G,reads:{...ee,texts:he=>e.texts({part:O,el:L},De,he)},record:(he,ge)=>X.reads.set(he,ge),place:{start:O.start,part:w.key},answers:_e});Q.push({spec:ne,index:J,props:Ce,el:me,ctx:Be,start:le,end:pe,z:oe,plane:fe,answers:_e})}let ie=L,ce;if(re.some(J=>J.overlay===!0)){ie=document.createElement("div"),ce=document.createElement("div"),ie.className="ak-picture",ce.className="ak-overlays";for(const J of[ie,ce])Object.assign(J.style,{position:"absolute",inset:"0",overflow:"hidden"}),L.append(J)}ue.forEach((J,ne)=>{const le=K.get(J)??Y.get(J);le&&(ce&&te.overlaid(J)?ce:ie).append(le);const pe=Ee.get(J),oe=ue[ne+1];W&&pe!==void 0&&re[pe]?.behindPerson===!0&&(oe===void 0||Ee.get(oe)!==pe)&&ie.append(W)}),s.sfx(w,O,_),U&&s.carry(U.inner,U.from,U.to,O.start,O.key,0);for(const J of Q){const ne=u.shownBy.get(J.spec);ne&&(ne.shown.start=O.start+J.start,ne.shown.partStart=O.start,ne.shown.from=ne.from,ne.shown.to=ne.from+(J.end-J.start)*ne.speed,ne.shown.speed=ne.speed,ne.audio!==void 0&&ne.speed===1&&s.carry(ne.inner,ne.from,ne.shown.to,O.start+J.start,O.key,ne.audio))}re.forEach((J,ne)=>{const le=J.layers.filter(oe=>oe.end>oe.start),pe=a.placed.flatMap(oe=>{if(oe.part!==O.key||(oe.over??0)<=ne)return[];if(!le.some(me=>me.end>oe.start&&me.start<oe.end))return[];let fe;for(const me of oe.boxes?oe.boxes.map(Ce=>Ce.box):[oe.box]){const Ce=intersect(me,[0,0,E.width,E.height]),De=Ce?round34(Ce[2]*Ce[3]/(E.width*E.height)):0;(!fe||De>fe.frame)&&(fe={box:me,frame:De})}return fe?[{file:oe.file,start:oe.start,end:oe.end,...fe}]:[]});pe.length!==0&&m.facts.push(fact("graphics-under-footage",{piece:c.piece,part:w.key,t:O.start},{layers:le,footage:pe,covered:Math.max(...pe.map(oe=>oe.frame))}))}),te.hasBehind&&ae<0&&m.facts.push(fact("fallback",{piece:c.piece,part:w.key},{missing:"own-footage",for:"behind-person",fallback:"in-front"})),A.push({part:O,spec:w,n:k,el:L,picture:ie,...ce?{overlays:ce}:{},layers:Q,record:X})}return{parts:y,mounted:A,clips:b}}var momentIn=(e,t)=>typeof t=="number"?t:momentOf(e.timeline,t),camerasOf=e=>e?.cameras??(e?.camera===void 0?void 0:{"*":e.camera});function pieceEntry(e,t){const n=t.written?.file;if(!(n===void 0||n===""))return Object.entries(e.pieces??{}).find(([,r])=>r.file===n)}function createEmbedder(e,t,n){const{source:r,options:u,embed:i,combo:o}=e,a=[],s=[...i?.chain??[],r.piece],c={loaded:a,async load(l,d,f={}){const m=isPieceDefinition(l)?pieceEntry(r,l):void 0;if(!isPieceDefinition(l)||!m)throw new LoadFailure("bad_video",'A video item of the project is shown by its piece, imported (import demo from "../demo/video") and passed as it is.');const[h,g]=m;if(s.includes(h))throw new LoadFailure("video_cycle",`${[...s,h].join(" → ")}: a video item that shows itself, through the videos it shows (AK-M010). A source cannot reach itself.`);const E=outputName(l.kind),D=f.frame===!0?r.format:g.format,p=Object.fromEntries(Object.entries(g.dims).map(([B,$])=>{const k=o[B];return[B,k!==void 0&&$.includes(k)?k:$[0]??""]})),v=d.parentNode,y=d.nextSibling,A=document.createElement("div");A.dataset.akHolder="",Object.assign(A.style,{position:"absolute",left:"0px",top:"0px",visibility:"hidden",pointerEvents:"none"}),t.el.append(A),A.append(d);let b;try{b=await n({...r,piece:h,file:g.file,module:"",styles:[],dims:g.dims,format:D,...g.matrix?{matrix:g.matrix}:{}},{combo:p,purpose:u.purpose},d,{def:l,chain:s,...f.cameras?{cameras:f.cameras}:{},...f.shown?{shown:f.shown}:{},...f.sceneryScale===void 0?{}:{sceneryScale:f.sceneryScale}}),await b.ready()}finally{t.takeOutside(),v?v.insertBefore(d,y):d.remove(),t.takeOutside(),A.remove()}const x={id:h,output:E,format:D,inner:b};return a.push(x),x},async video(l,d,f){const{id:m,output:h,format:g,inner:E}=await c.load(l,d);return f(`video:${m}:${h}:${g}`,JSON.stringify(E.signs())),{id:m,duration:E.timeline.duration,width:E.timeline.width,height:E.timeline.height,seek:(D,p)=>E.seek(D,{mode:p===!0?"layout":"picture"}),at:D=>momentOf(E.timeline,D)}}};return c}var isBoxKeys=e=>Array.isArray(e)&&e.length>0&&typeof e[0]=="object";function videoLayer(e,t,n,r,u){const{inner:i,host:o}=n,a=i.timeline.width,s=i.timeline.height,c=forOrient(t.box,e.orient);if(isBoxKeys(c))throw new LoadFailure("bad_footage",'footage() of a video item takes one box (or "full"), not keyframes.');const[l,d,f,m]=c===void 0||c==="full"?[0,0,1,1]:c,h=t.fit??"cover",g=t.cameras??(t.camera===void 0?void 0:t.camera);return{[LAYER_BRAND]:"graphic",component:"video",...t.at===void 0?{}:{at:t.at},...t.until===void 0?{}:{until:t.until},...t.dur===void 0?{}:{dur:t.dur},props:{...u,box:[l,d,f,m],fit:h,...g===void 0?{}:{camera:g},...t.quality?{quality:t.quality}:{},parts:i.signs()},mount(E){const D={x:l*e.width,y:d*e.height,w:f*e.width,h:m*e.height},p=h==="contain"?Math.min(D.w/a,D.h/s):Math.max(D.w/a,D.h/s),v=document.createElement("div");Object.assign(v.style,{position:"absolute",left:`${String(D.x)}px`,top:`${String(D.y)}px`,width:`${String(D.w)}px`,height:`${String(D.h)}px`,overflow:"hidden"}),Object.assign(o.style,{position:"absolute",left:`${String((D.w-a*p)/2)}px`,top:`${String((D.h-s*p)/2)}px`,width:`${String(a)}px`,height:`${String(s)}px`,transformOrigin:"0 0",transform:`scale(${String(p)})`}),v.appendChild(o),E.appendChild(v)},render(E,D,p,v){const y=Math.min(Math.max(r(D,v),0),Math.max(0,i.timeline.duration-.001)),A=v.layoutOnly===!0?"layout":"picture";v.wait(Promise.resolve().then(()=>i.seek(y,{mode:A})))}}}var where={phase:"other"},collector=new ConsoleCollector,passThrough=!0,parts=[],installed2=!1;function installConsole(){if(installed2)return;installed2=!0;const e=console;for(const t of CONSOLE_LEVELS){const n=e[t]?.bind(console);e[t]=(...r)=>{try{collector.add({level:t,text:consoleText(r),...where})}catch{}passThrough&&n?.(...r)}}}function resetConsole(e){collector=new ConsoleCollector(e.limit??CONSOLE_LIMIT),passThrough=e.passThrough,parts=[],where={phase:"other"}}function consoleParts(e){parts=e}function consoleAt(e,t){const n=where;where=e;try{return t()}finally{where=n}}async function consoleAtAsync(e,t){const n=where;where=e;try{return await t()}finally{where=n}}function consoleLog(){return collector.log(parts)}var PLACEHOLDER="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",KEY_PART_MIN=3,ReadLog=class{messages=new Map;media=new Map;data=new Map;keyByText=new Map;missingReads=new Set;missingMedia=new Set;problems=[];texts=new Set;tap;opts;fileOf;constructor(e){this.opts=e,this.fileOf=t=>`${e.text??TEXT_DIR}/${t??"en"}.json`}value(e){const{own:t,fallback:n,lang:r,defaultLang:u}=this.opts;return Object.hasOwn(t,e)?{value:t[e],fellBack:!1}:Object.hasOwn(n,e)?{value:n[e],fellBack:r!==u}:{value:void 0,fellBack:!1}}record(e,t,n){if(this.messages.has(e))return;const{value:r,fellBack:u}=this.value(e);if(this.messages.set(e,{key:e,kind:t,fallback:u,...n?{hint:n}:{}}),t!=="list"&&r===void 0){const i=e.slice(e.indexOf(".")+1),o=Object.keys(this.opts.fallback).find(a=>a.endsWith(`.${i}`));this.problems.push(problem("AK-S001",`The code reads ${e}, but the default language ${this.opts.defaultLang??"(no messages)"} does not have it. ${o===void 0?`Add it to ${this.fileOf(this.opts.defaultLang)}.`:`It has ${o}: read that, or give the piece the id "${e.slice(0,e.indexOf("."))}".`}`,{where:{file:this.fileOf(this.opts.defaultLang)}}))}}locale(e){return Object.hasOwn(this.opts.own,e)?this.opts.lang:this.opts.defaultLang}text(e,t,n){this.record(e,"text",t);const{value:r}=this.value(e);this.tap?.(`m:${e}`,JSON.stringify(r??null));for(const u of textsOf(r))this.texts.add(u);return displayOf(r,n,this.locale(e))??""}s(e,t){const n=this.text(e,t,{});return n&&this.keyByText.set(n,{key:e,inputs:{}}),n}with(e,t,n){const r=fillMessage(this.text(e,n,t),t);return this.texts.add(r),r&&this.keyByText.set(r,{key:e,inputs:t}),r}spokenOf(e){const t=this.keyByText.get(e);if(!t)return;const n=speakOf(this.value(t.key).value,t.inputs,this.locale(t.key)),r=(Object.hasOwn(this.opts.own,t.key)?this.opts.anchors?.own:this.opts.anchors?.fallback)?.[t.key];return{key:t.key,speak:n===void 0?e:fillMessage(n,t.inputs),...r&&n!==void 0?{anchors:lineAnchors(n,r,u=>fillMessage(u,t.inputs))}:{}}}list(e,t){const n=[],r=new Set([...Object.keys(this.opts.own),...Object.keys(this.opts.fallback)]),u=messageList(i=>displayOf(this.value(i).value,{},this.locale(i)),r,e,n);this.record(e,"list",t),n.length===0&&this.problems.push(problem("AK-S001",`The code reads the list ${e}, but the default language has no keys like ${e}.0, ${e}.1. Add them to ${this.fileOf(this.opts.defaultLang)}.`,{where:{file:this.fileOf(this.opts.defaultLang)}}));for(const i of n)this.text(i,void 0,{});return u}keysUnder(e){const t=`${e}.`;return[...new Set([...Object.keys(this.opts.own),...Object.keys(this.opts.fallback)])].filter(n=>n.startsWith(t))}peek(e){return this.value(e).value}touch(e){const{value:t,fellBack:n}=this.value(e);return this.tap?.(`m:${e}`,JSON.stringify(t??null)),t!==void 0&&!this.messages.has(e)&&this.messages.set(e,{key:e,kind:"text",fallback:n}),t}mediaAt(e){const t=this.opts.media[e];return t&&this.media.set(e,asUrlString(t)),this.tap?.(`f:${e}`,t?.sha256??""),t}missing(e){this.missingReads.add(e)}report(e){this.problems.some(t=>t.code===e.code&&t.message===e.message)||this.problems.push(e)}relativeTo(e){this.base=e}base;get pathBase(){return this.base??this.opts.file}baseOf(e){return e===void 0?this.pathBase:e===""?"the project's root":e}resolve(e,t){return t===void 0?repoPath(this.pathBase,e):pathIn(t,e)}asset(e,t){const n=this.baseOf(t),r=this.resolve(e,t),u=r===void 0?void 0:this.mediaAt(r);if(u)return u;const i=r??e;return this.missingMedia.has(i)||(this.missingMedia.add(i),this.problems.push(problem("AK-A001",r===void 0?`"${e}" points outside the project. Put media in the project, with a path relative to ${n}.`:`"${e}" (named in ${n}) cannot find ${r}: the path is wrong, or the file is not in the project yet.`,{where:{file:n}}))),asUrlString({path:r??e,sha256:"",kind:"image",url:PLACEHOLDER,width:1,height:1})}optionalAsset(e){const t=repoPath(this.pathBase,e);if(t===void 0)return;const n=this.mediaAt(t);return n||this.missing(t),n?asUrlString(n):void 0}optionalData(e,t){const n=this.resolve(e,t);if(n===void 0)return{found:!1};const r=this.opts.data?.[n];return this.data.set(n,r?.sha256??""),r?r.error===void 0?{full:n,found:!0,value:r.value}:{full:n,found:!0,error:r.error}:{full:n,found:!1}}readData(e){const t=repoPath(this.pathBase,e),n=t===void 0?void 0:this.opts.data?.[t];if(t!==void 0&&n){if(this.data.set(t,n.sha256),this.tap?.(`d:${t}`,n.sha256),n.error===void 0)return n.value;this.missingMedia.has(t)||(this.missingMedia.add(t),this.problems.push(problem("AK-R001",`Cannot read the data file ${t}: ${n.error}`,{where:{file:t}})));return}this.missingMedia.has(e)||(this.missingMedia.add(e),this.problems.push(problem("AK-A001",t===void 0?`ctx.data("${e}") points outside the project. Put data files in the project, with a path relative to ${this.pathBase}.`:`ctx.data("${e}") cannot find ${t}: the path is wrong, or the file is not CSV, YAML or JSON.`,{where:{file:this.pathBase}})))}reads(e,t){const n=r=>{if(!r.startsWith(`${e}.`))return;const u=r.slice(e.length+1).split(".")[0]??"";return t.includes(u)?u:void 0};return{messages:[...this.messages.values()].map(r=>{const u=n(r.key);return u===void 0?r:{...r,part:u}}).sort((r,u)=>r.key<u.key?-1:r.key>u.key?1:0),media:[...[...this.media.values()].map(r=>({path:r.path,sha256:r.sha256,kind:r.kind})),...[...this.missingReads].filter(r=>!this.media.has(r)).map(r=>({path:r,sha256:"",kind:"audio"}))].sort((r,u)=>r.path<u.path?-1:1),data:[...this.data.entries()].map(([r,u])=>({path:r,sha256:u})).sort((r,u)=>r.path<u.path?-1:1)}}translationProblems(){const e=[];for(const t of this.messages.values())t.fallback&&t.kind==="text"&&e.push(problem("AK-S002",`${this.opts.lang??""} is missing a translation: ${t.key}. The ${this.opts.defaultLang??""} text was used.`,{where:{file:this.fileOf(this.opts.lang)}}));return e}keysShowing(e){const t=o=>o.replace(/[\s\p{Cf}]+/gu,""),n=t(e);if(n==="")return[];const r=[],u=[];for(const o of this.messages.values()){const a=textsOf(this.peek(o.key)).flatMap(s=>hasMarks(s)?[s,withoutMarks(s)]:[s]).map(t);a.includes(n)?r.push(o.key):a.some(s=>s.includes(n))&&u.push(o.key)}return r.length>0?r:(n.match(/[\p{L}\p{N}]/gu)?.length??0)>=KEY_PART_MIN?u:[]}get file(){return this.fileOf(this.opts.lang)}},RUN_PROBLEMS=200,Ledger=class{problems=[];facts=[];run=[];times=[];running;loading=!0;doing;waiting=[];ran(e){this.run.length>=RUN_PROBLEMS||this.run.some(t=>t.code===e.code&&t.message===e.message&&t.part===e.part)||this.run.push(e)}async timed(e,t){const n=realNow();try{return await t()}finally{this.times.push({what:e,ms:realNow()-n})}}wait(e){const t=this.running;if(!this.loading){this.waiting.push({work:e,who:t});return}const n=this.doing??"a layer",r=realNow();this.waiting.push({work:e.finally(()=>{this.times.push({what:`the work ${n} waited for (ctx.wait)`,ms:realNow()-r})}),who:t})}async settle(e){const t=realNow()+e,n=[];for(;this.waiting.length>0;){const r=this.waiting.splice(0);if((await within2(r.map(i=>i.work),t-realNow())).forEach((i,o)=>{const a=r[o]?.who;if(i===void 0){n.push(`the work ${whoText(a)} waits for (ctx.wait)`);return}if(i.status==="fulfilled")return;const s=i.reason;this.ran(problem(codeOf(i.reason),`${whoText(a)}: the work it waits for (ctx.wait) failed: ${String(s.message??i.reason)}`,{...a?.part===void 0?{}:{part:a.part},...a?.t===void 0?{}:{t:a.t}}))}),n.length>0)break}return n}},whoText=e=>e?.what??"A layer";function checkCombo(e,t){const n=e.dims,r=e.matrix?.space;if(validCombo(r,n,e.matrix?.rules??[],t.combo))return;const u=r?`; slots: ${Object.entries(r.slots).map(([i,o])=>`${i}=${o.map(a=>a.name).join("|")}`).join(", ")}${r.declared?`; structures: ${Object.keys(r.structures).join("|")}`:""}; and the matrix's rules`:"";throw new LoadFailure("bad_combo",`Piece ${e.piece} has no combo ${comboKey(t.combo)} (dimensions: ${Object.entries(n).map(([i,o])=>`${i}=${o.join("|")}`).join(", ")||"none"}${u}).`)}function createEnv(e,t,n){const r=realNow();checkCombo(e,t);const u={...t.combo},i=u.lang,o=e.locales[0],a=!n&&entryKind(e.file)==="slides"?"slides":"video",s=`${e.piece}:${a}:${seedKey(u,e.format)}`,c=seedKey(dimsCombo(e.dims,u),e.format),l=e.matrix?.space,d=new Set(l?[...Object.keys(l.slots),...l.declared?[STRUCTURE]:[]]:[]),f=installGuards();f.setMoment(0,`${s}:load`),n||(installConsole(),resetConsole({...t.consoleLimit===void 0?{}:{limit:t.consoleLimit},passThrough:t.purpose==="play"}));const m=new ReadLog({lang:i,defaultLang:o,...e.text===void 0?{}:{text:e.text},own:i===void 0?{}:e.messages[i]??{},fallback:o===void 0?{}:e.messages[o]??{},...e.anchors?{anchors:{...i!==void 0&&e.anchors[i]?{own:e.anchors[i]}:{},...o!==void 0&&e.anchors[o]?{fallback:e.anchors[o]}:{}}}:{},media:e.media,file:e.file,...e.data?{data:e.data}:{}});return{source:e,options:t,embed:n,combo:u,lang:i,defaultLang:o,output:a,seedBase:s,partSeed:(h,g)=>`${e.piece}:${a}:${c}:${h}:${String(g)}`,picked:d,space:l,guards:f,log:m,ledger:new Ledger,start:r,mediaOf:(h,g)=>typeof h=="string"?m.asset(h,g):m.mediaAt(h.path)??m.asset(`/${h.path}`)}}var BACKDROP_IMAGE=/\.(png|jpe?g|webp)$/i,treats=e=>(e.blur??0)>0||(e.dim??0)>0||(e.desaturate??0)>0||e.color!==void 0||e.image!==void 0,round35=e=>Math.round(e*1e3)/1e3;function footagePlanner(e,t,n,r){const{source:u,ledger:i,embed:o}=e,{dims:a,fps:s}=t,c=[],l=new Map,d=new Set,f=new Map,m=(D,p)=>{const v=f.get(D)??{file:D};v[p]=!0,f.set(D,v)},h=(D,p)=>{i.facts.push(fact("fallback",{piece:u.piece,part:D},p))},g=(D,p,v)=>{const y=backdropUnit(a.width,a.height),A=B=>Math.round(B*y*1e3)/1e3;let b;if(D.image!==void 0){if(b=e.mediaOf(D.image,v),b.sha256==="")return;if(b.kind!=="image"||!BACKDROP_IMAGE.test(b.path)){i.problems.push(problem("AK-A003",`The background image ${b.path} of footage() in part ${p} is not a PNG, JPEG or WebP image.`,{part:p,where:{file:u.file}}));return}}let x;if(D.color!==void 0){const B=CSS.supports("color",D.color)?r(D.color):void 0;if(B===void 0)throw new Error(`footage() background color ${JSON.stringify(D.color)} in part ${p} is not a CSS color.`);x=B.length===9&&B.endsWith("00")?"transparent":B}return{backdrop:{...D.blur?{blur:A(D.blur)}:{},...D.dim?{dim:D.dim}:{},...D.desaturate?{desaturate:D.desaturate}:{},...x===void 0?{}:{color:x},...b?{image:b.path}:{},feather:A(D.feather??MATTE_FEATHER),shrink:A(D.shrink??MATTE_SHRINK)},...b?{imageUrl:b.url}:{}}};return{plan:(D,p,v,y,A,b,x)=>{const B=D.file,$=B===void 0;let k;if($){if(!v){i.problems.push(problem("AK-A001",`footage() in part ${p.key} names no file, so it shows the part's take, and the part has no take. Give footage a file, or give the part speech: take("./clip.mp4").`,{part:p.key,where:{file:u.file}}));return}k=v.media}else k=e.mediaOf(B,D.base);if(k.sha256==="")return;if(k.kind!=="video"){i.problems.push(problem("AK-A003",$?`footage() in part ${p.key} shows the part's take, and ${k.path} is not a video. Give footage a file, or take a video.`:`The footage ${k.path} in part ${p.key} is not a video (mp4, webm or mov).`,{part:p.key,where:{file:u.file}}));return}const w=toFrame(p.start+A,s),I=toFrame(p.start+b,s);if(I<=w)return;k.faces&&l.set(k.path,k.faces),k.matte===!0&&d.add(k.path);let M,_;if($&&v&&y!==void 0){const O=v.ranges??[{from:v.from,to:v.from+v.dur}];if(M=round35(fromEdited(O,w-y)),v.ranges&&v.ranges.length>1){const L=[{at:w,from:M}];let K=0;for(const W of v.ranges){const ee=round35(y+K);K>0&&ee>w+1e-6&&ee<I&&L.push({at:ee,from:W.from}),K+=W.to-W.from}L.length>1&&(_=L)}}else M=Math.max(0,typeof D.from=="number"?D.from:0);const F=k.width!==void 0&&k.height!==void 0?{width:k.width,height:k.height}:void 0,N=D.fit??"cover",T=forOrient(D.box,a.orient),P=forOrient(D.crop,a.orient),V=isBoxKeys(T)?T:void 0,Z=V?.map(O=>({t:toFrame(p.start+Math.min(Math.max(x.at(O.t),A),b),s),box:O.box==="full"?[0,0,a.width,a.height]:pixelRect(O.box,a.width,a.height),...O.ease?{ease:O.ease}:{}})).sort((O,L)=>O.t-L.t),S=V?"full":T??"full",H=Z?.[0],R=placeFootage({box:H?[H.box[0]/a.width,H.box[1]/a.height,H.box[2]/a.width,H.box[3]/a.height]:S,fit:N,...P?{crop:P}:{},...F?{source:F}:{},frame:a}),G=D.shape==="circle"||!D.radius?0:round35(Math.min(D.radius*backdropUnit(a.width,a.height),R.box[2]/2,R.box[3]/2));let X=R.crop,te=R.picture,ae,re;const Ee=D.punchIn??[],ve=D.pullback===void 0||D.pullback===!1?void 0:D.pullback===!0?{}:D.pullback;if((D.reframe!==void 0||Ee.length>0||ve)&&F){const O=R.box,L=reframeWindow(F,{w:O[2],h:O[3]}),K=typeof D.reframe=="object"&&"face"in D.reframe?D.reframe:void 0,W=D.reframe==="face"||K!==void 0;W&&!k.faces&&(m(k.path,"faces"),h(p.key,{file:k.path,missing:"face-track",for:"reframe",fallback:"centred"}));const ee=k.faces,Q=D.speaker??ee?.speaker;ee&&D.speaker!==void 0&&!hasFace(ee,D.speaker)&&h(p.key,{file:k.path,missing:"face",face:D.speaker,for:"speaker",fallback:"centred"});const Y=typeof D.reframe=="object"&&"x"in D.reframe?D.reframe:W?REFRAME_FALLBACK:{x:.5,y:.5},ie={start:w,end:I,from:M,speed:$?1:D.speed??1,..._?{cuts:_}:{}};ae=reframePath({track:W?ee:void 0,speaker:Q,faceY:K?.faceY,focus:Y,window:L,source:F,layer:ie});const ce=ae[0]??{x:0,y:0};X=[ce.x,ce.y,L.w,L.h],te=[...O],ae.length<=1&&(ae=void 0);const J=ae,ne=(fe,me)=>{if(me)return{cx:me.x,cy:me.y};const Ce=ee?faceAt(ee,sourceAt(ie,fe),Q):void 0;if(!Ce)return{cx:PUNCH_CENTER.x,cy:PUNCH_CENTER.y};const De=J?keyAt(J.map(ge=>({t:ge.t,v:ge.x})),fe):ce.x,_e=J?keyAt(J.map(ge=>({t:ge.t,v:ge.y})),fe):ce.y,Be=(Ce[0]+Ce[2]/2-De)/L.w,he=(Ce[1]+Ce[3]/2-_e)/L.h;return{cx:round35(Math.min(Math.max(Be,0),1)),cy:round35(Math.min(Math.max(he,0),1))}},le=[];for(const fe of Ee){const me=typeof fe=="object"?{...fe,ref:fe.at}:{...parsePunch(String(fe)),until:void 0},Ce=x.at(me.ref),De=me.until!==void 0?x.at(me.until):n.wordEnd(p.key,Ce),_e=p.start+Ce;le.push({start:_e,end:p.start+Math.max(De,Ce),scale:me.scale??PUNCH_SCALE,...ne(_e,typeof fe=="object"?fe.center:void 0),...typeof fe=="object"&&fe.in!==void 0?{in:fe.in}:{},...typeof fe=="object"&&fe.out!==void 0?{out:fe.out}:{},...typeof fe=="object"&&fe.ease!==void 0?{ease:fe.ease}:{}})}const pe=le.length>0?punchKeys(le):[],oe=ve?pullbackKeys(w,{scale:ve.scale??PULLBACK_SCALE,dur:ve.dur??PULLBACK_DUR,...ne(w,ve.center),...ve.ease?{ease:ve.ease}:{}},pe):pe;oe.length>0&&(re=oe)}let ue=!1;x.cutout&&(k.matte===!0?ue=!0:(m(k.path,"matte"),h(p.key,{file:k.path,missing:"person-matte",for:"behind-person",fallback:"in-front"})));let se;if(D.background&&treats(D.background)){const O=g(D.background,p.key,D.base);O&&k.matte===!0?se=O:O&&(m(k.path,"matte"),h(p.key,{file:k.path,missing:"person-matte",for:"background",fallback:"unprocessed"}))}if(o)throw new LoadFailure("embedded_footage",`${u.piece}'s part ${p.key} plays ${k.path}: a video shown inside another (a scenery's screen, a part's video take, a footage of a video item) draws its graphic layers only, not footage yet.`);const j=ue&&x.person,U={part:p.key,file:k.path,start:w,end:I,from:M,speed:$?1:D.speed??1,gainDb:D.gainDb??0,audio:(D.audio??!1)&&k.audio===!0,...$?{take:!0}:{},fit:N,box:R.box,...X?{crop:X}:{},picture:te,..._?{cuts:_}:{},...ae?{pan:ae}:{},...re?{zoom:re}:{},...Z&&Z.length>1?{boxes:Z}:{},...x.over>0?{over:x.over}:{},...ue?{cutout:!0}:{},...D.sharpen?{sharpen:D.sharpen}:{},...se?{background:se.backdrop}:{},...se?.imageUrl?{imageUrl:se.imageUrl}:{},...(j||se)&&k.matteUrl?{matteUrl:k.matteUrl}:{},...j?{personOver:!0}:{},...D.shape==="circle"?{shape:"circle"}:{},...G>0?{radius:G}:{},...D.speaker===void 0?{}:{speaker:D.speaker},url:k.url,...k.duration===void 0?{}:{duration:k.duration},...F?{source:F}:{}};return c.push(U),U},placed:c,needs:()=>[...f.values()],speakerIn:D=>c.some(p=>p.part===D&&(l.has(p.file)||d.has(p.file))),faceAt(D,p,v){for(let y=c.length-1;y>=0;y--){const A=c[y];if(A?.part!==D||p<A.start||p>=A.end)continue;const b=l.get(A.file);if(!b)continue;const x=v===void 0?faceOnFrame(A,b,p):faceOnFrame(A,b,p,v);if(x)return x}},facesAt(D,p){for(let v=c.length-1;v>=0;v--){const y=c[v];if(y?.part!==D||p<y.start||p>=y.end)continue;const A=l.get(y.file);if(!A)continue;const b=facesOnFrame(y,A,p);if(b.length>0)return b}return[]}}}function timelineFootage(e){return{part:e.part,file:e.file,start:e.start,end:e.end,from:e.from,speed:e.speed,gainDb:e.gainDb,audio:e.audio,...e.take?{take:!0}:{},fit:e.fit,box:e.box,...e.crop?{crop:e.crop}:{},picture:e.picture,...e.cuts?{cuts:e.cuts}:{},...e.pan?{pan:e.pan}:{},...e.zoom?{zoom:e.zoom}:{},...e.boxes?{boxes:e.boxes}:{},...e.over?{over:e.over}:{},...e.cutout?{cutout:!0}:{},...e.sharpen?{sharpen:e.sharpen}:{},...e.background?{background:e.background}:{},...e.shape?{shape:e.shape}:{},...e.radius?{radius:e.radius}:{},...e.speaker===void 0?{}:{speaker:e.speaker}}}var MIX_DEFAULTS={speech:-16,music:-20,musicAlone:-16,sfx:-22,footage:-16,footageUnderSpeech:-22,duck:{db:-8,attack:.3,release:1,hold:2},musicFade:{in:.3,out:1.5}};function resolveMix(e){const t=MIX_DEFAULTS;return{speech:e?.speech??t.speech,music:e?.music??t.music,musicAlone:e?.musicAlone??t.musicAlone,sfx:e?.sfx??t.sfx,footage:e?.footage??t.footage,footageUnderSpeech:e?.footageUnderSpeech??t.footageUnderSpeech,duck:{...t.duck,...e?.duck},musicFade:{...t.musicFade,...e?.musicFade}}}var MASTER_DEFAULTS={lufs:-14,truePeak:-3},MASTER_MECHANICS={attack:.002,release:.04,oversample:4,rounds:4,tolerance:.1};function resolveMaster(e,t){const n=t??MASTER_DEFAULTS.lufs;return e===!1?{lufs:!1,truePeak:MASTER_DEFAULTS.truePeak}:typeof e=="number"?{lufs:e,truePeak:MASTER_DEFAULTS.truePeak}:{lufs:e?.lufs??n,truePeak:e?.truePeak??MASTER_DEFAULTS.truePeak}}function merge2(e,t){const n=[];for(const r of[...e].sort((u,i)=>u.start-i.start)){const u=n.at(-1);u&&r.start-u.end<t?u.end=Math.max(u.end,r.end):n.push({start:r.start,end:r.end})}return n}function spansEnvelope(e,t,n,r){const u=[];for(const i of e)u.push({t:Math.max(0,i.start-n),db:0},{t:i.start,db:t},{t:i.end,db:t},{t:i.end+r,db:0});return u}function duckEnvelope(e,t=MIX_DEFAULTS.duck){return t.db>=0||e.length===0?[]:spansEnvelope(merge2(e,t.hold+t.attack+t.release),t.db,t.attack,t.release)}function speechSpans(e,t=MIX_DEFAULTS.duck){return merge2(e.filter(n=>n.dur>0).map(n=>({start:n.at,end:n.at+n.dur})),t.attack+t.release)}function speechEnvelope(e,t,n=MIX_DEFAULTS.duck){return t===0||e.length===0?[]:spansEnvelope(e,t,n.attack,n.release)}function addEnvelopes(e,t){return e.length===0?[...t]:t.length===0?[...e]:[...new Set([...e,...t].map(r=>r.t))].sort((r,u)=>r-u).map(r=>({t:r,db:gainAt(e,r)+gainAt(t,r)}))}var equalPower=e=>Math.sin(Math.PI/2*Math.min(1,Math.max(0,e)));function gainAt(e,t){if(e.length===0)return 0;const n=e[0];if(!n||t<=n.t)return n?.db??0;for(let r=1;r<e.length;r++){const u=e[r-1],i=e[r];if(!(!u||!i)&&t<=i.t)return i.t===u.t?i.db:u.db+(i.db-u.db)*(t-u.t)/(i.t-u.t)}return e.at(-1)?.db??0}var decodeKey=(e,t)=>`${e}\0${String(t.denoise??0)}\0${String(t.speed??1)}\0${t.filter??""}`,speechHow=e=>({...e.denoise?{denoise:e.denoise}:{},...e.speed!==void 0&&e.speed!==1?{speed:e.speed}:{}});function decodings(e){const t=new Map,n=(r,u)=>t.set(decodeKey(r,u),{file:r,how:u});for(const r of e.speech)n(r.file,speechHow(r));for(const r of e.footage)n(r.file,{});e.music&&n(e.music.file,e.music.shape?.filter?{filter:e.music.shape.filter}:{});for(const r of e.sfx)r.file!==void 0&&n(r.file,r.shape?.filter?{filter:r.shape.filter}:{});return[...t.values()]}function clipSource(e){return t=>{const n=e(t.file,speechHow(t));if(!n)return;const r=t.speed!==void 0&&t.speed!==1?t.speed:void 0;return r!==void 0&&n.made.speed===r?{src:n.src,stretched:r}:{src:n.src}}}var BUTTERWORTH_Q=Math.SQRT1_2;function biquad(e,t){const n=Math.min(Math.max(e.hz,1),t*.49),r=2*Math.PI*n/t,u=Math.cos(r),i=Math.sin(r);let o,a,s,c,l,d;switch(e.type){case"lowpass":case"highpass":case"bandpass":{const f=e.q??BUTTERWORTH_Q,m=i/(2*f);c=1+m,l=-2*u,d=1-m,e.type==="lowpass"?(o=(1-u)/2,a=1-u,s=(1-u)/2):e.type==="highpass"?(o=(1+u)/2,a=-(1+u),s=(1+u)/2):(o=m,a=0,s=-m);break}case"peak":{const f=10**(e.db/40),m=i/(2*(e.q??1));o=1+m*f,a=-2*u,s=1-m*f,c=1+m/f,l=-2*u,d=1-m/f;break}case"lowshelf":case"highshelf":{const f=10**(e.db/40),m=e.slope??1,h=i/2*Math.sqrt((f+1/f)*(1/m-1)+2),g=2*Math.sqrt(f)*h;e.type==="lowshelf"?(o=f*(f+1-(f-1)*u+g),a=2*f*(f-1-(f+1)*u),s=f*(f+1-(f-1)*u-g),c=f+1+(f-1)*u+g,l=-2*(f-1+(f+1)*u),d=f+1+(f-1)*u-g):(o=f*(f+1+(f-1)*u+g),a=-2*f*(f-1+(f+1)*u),s=f*(f+1+(f-1)*u-g),c=f+1-(f-1)*u+g,l=2*(f-1-(f+1)*u),d=f+1-(f-1)*u-g);break}}return{b0:o/c,b1:a/c,b2:s/c,a1:l/c,a2:d/c}}function biquadGain(e,t,n){const r=2*Math.PI*t/n,u=Math.cos(r),i=Math.sin(r),o=Math.cos(2*r),a=Math.sin(2*r),s=e.b0+e.b1*u+e.b2*o,c=-(e.b1*i+e.b2*a),l=1+e.a1*u+e.a2*o,d=-(e.a1*i+e.a2*a);return Math.hypot(s,c)/Math.hypot(l,d)}function runBiquads(e,t){for(const n of t){let r=0,u=0;for(let i=0;i<e.length;i++){const o=e[i]??0,a=n.b0*o+r;r=n.b1*o-n.a1*a+u,u=n.b2*o-n.a2*a,e[i]=a}}}var fromDb=e=>10**(e/20);function gainComputer(e,t){const n=e-t.threshold,r=t.knee;let u;return 2*n<-r?u=e:r>0&&2*Math.abs(n)<=r?u=e+(1/t.ratio-1)*(n+r/2)**2/(2*r):u=t.threshold+n/t.ratio,u-e}function levels(e,t,n){const r=e[0]?.length??0,u=new Float32Array(r);if(t<=0){for(let a=0;a<r;a++){let s=0;for(const c of e)s=Math.max(s,Math.abs(c[a]??0));u[a]=20*Math.log10(Math.max(s,1e-9))}return u}const i=Math.exp(-1/(t*n));let o=0;for(let a=0;a<r;a++){let s=0;for(const c of e)s=Math.max(s,(c[a]??0)**2);o=i*o+(1-i)*s,u[a]=10*Math.log10(Math.max(o,1e-18))}return u}function smooth(e,t,n,r){const u=t>0?Math.exp(-1/(t*r)):0,i=n>0?Math.exp(-1/(n*r)):0,o=new Float32Array(e.length);let a=0;for(let s=0;s<e.length;s++){const c=e[s]??0,l=c<a?u:i;a=l*a+(1-l)*c,o[s]=a}return o}function compress(e,t,n){const r=levels(e,t.window,n),u=new Float32Array(r.length);for(let o=0;o<r.length;o++)u[o]=gainComputer(r[o]??-180,t);const i=smooth(u,t.attack,t.release,n);for(const o of e)for(let a=0;a<o.length;a++)o[a]=(o[a]??0)*fromDb(i[a]??0)}function deess(e,t,n){const r=biquad({type:"highpass",hz:t.hz},n),u=biquad({type:"lowpass",hz:t.hz},n),i=l=>{const d=Float32Array.from(l);runBiquads(d,[r,r]);const f=Float32Array.from(l);return runBiquads(f,[u,u]),{low:f,high:d}},o=e.map(i),a=levels(o.map(l=>l.high),.005,n),s=new Float32Array(a.length);for(let l=0;l<a.length;l++)s[l]=gainComputer(a[l]??-180,{...t,knee:6});const c=smooth(s,t.attack,t.release,n);e.forEach((l,d)=>{const f=o[d];if(f)for(let m=0;m<l.length;m++)l[m]=(f.low[m]??0)+(f.high[m]??0)*fromDb(c[m]??0)})}function agc(e,t,n){const r=levels(e,.05,n),u=new Float32Array(r.length),i=Math.exp(-1/(Math.max(t.window,.001)*n));let o=-1;for(let s=0;s<r.length;s++){const c=r[s]??-180;if(t.gate===void 0||c>=t.gate){const l=10**(c/10);o=o<0?l:i*o+(1-i)*l}u[s]=o<0?0:Math.min(t.most,t.target-10*Math.log10(Math.max(o,1e-18)))}const a=smooth(u,t.attack,t.release,n);for(const s of e)for(let c=0;c<s.length;c++)s[c]=(s[c]??0)*fromDb(a[c]??0)}function kWeighting(e){const t=1681.974450955533,n=3.999843853973347,r=.7071752369554196,u=Math.tan(Math.PI*t/e),i=10**(n/20),o=i**.4996667741545416,a=1+u/r+u*u,s={b0:(i+o*u/r+u*u)/a,b1:2*(u*u-i)/a,b2:(i-o*u/r+u*u)/a,a1:2*(u*u-1)/a,a2:(1-u/r+u*u)/a},c=biquad({type:"highpass",hz:38.13547087602444,q:.5003270373238773},e),l={b0:1,b1:-2,b2:1,a1:c.a1,a2:c.a2};return[s,l]}function integratedLoudness(e,t){const n=e[0]?.length??0,r=Math.round(.4*t),u=Math.round(.1*t);if(n<r)return;const i=kWeighting(t),o=Math.floor(n/u),a=new Float64Array(o);for(const h of e){const g=Float32Array.from(h);runBiquads(g,i);for(let E=0;E<o;E++){let D=0;for(let p=E*u;p<(E+1)*u;p++)D+=(g[p]??0)**2;a[E]=(a[E]??0)+D}}const s=[],c=Math.round(r/u);for(let h=0;h+c<=o;h++){let g=0;for(let E=0;E<c;E++)g+=a[h+E]??0;s.push(g/(c*u))}const l=h=>-.691+10*Math.log10(Math.max(h,1e-20)),d=s.filter(h=>l(h)>-70);if(d.length===0)return;const f=d.reduce((h,g)=>h+g,0)/d.length,m=d.filter(h=>l(h)>l(f)-10);if(m.length!==0)return l(m.reduce((h,g)=>h+g,0)/m.length)}function steadyLoudness(e,t){const n=kWeighting(t);let r=0,u=0;for(const i of e){const o=Float32Array.from(i);runBiquads(o,n);let a=0;for(const s of o)a+=s*s;r+=a/Math.max(1,o.length),u=Math.max(u,o.length)}if(!(u===0||r<=1e-20))return-.691+10*Math.log10(r)}var COMPRESS_DEFAULTS={ratio:2,knee:6,attack:.01,release:.15,window:.01};function bandAt(e,t){const n=e.keys??[];let r=e.hz,u=e.db??0,i=e.q;if(n.length>0){const o=[...n].sort((f,m)=>f.at-m.at),a=(f,m)=>f[m]??(m==="hz"?e.hz:m==="db"?e.db??0:e.q),s=o[0],c=o.at(-1);let l=s,d=s;if(s&&t<=s.at)l=s,d=s;else if(c&&t>=c.at)l=c,d=c;else for(let f=1;f<o.length;f++){const m=o[f];if(m&&t<m.at){l=o[f-1],d=m;break}}if(l&&d){const f=d.at===l.at?1:(t-l.at)/(d.at-l.at),m=a(l,"hz")??e.hz,h=a(d,"hz")??e.hz;r=m===h||f<=0?m:f>=1?h:Math.exp(Math.log(m)+(Math.log(h)-Math.log(m))*f);const g=a(l,"db")??0,E=a(d,"db")??0;u=g+(E-g)*f;const D=a(l,"q"),p=a(d,"q");i=D===void 0||p===void 0?D??p:D+(p-D)*f}}switch(e.type){case"peak":return{type:"peak",hz:r,db:u,...i===void 0?{}:{q:i}};case"lowshelf":case"highshelf":return{type:e.type,hz:r,db:u,...i===void 0?{}:{slope:i}};default:return{type:e.type,hz:r,...i===void 0?{}:{q:i}}}}var BLOCK=32;function runBand(e,t,n,r){if(!t.keys||t.keys.length===0){runBiquads(e,[biquad(bandAt(t,0),n)]);return}let u=0,i=0,o=biquad(bandAt(t,r),n);for(let a=0;a<e.length;a++){a%BLOCK===0&&(o=biquad(bandAt(t,r+(a+BLOCK/2)/n),n));const s=e[a]??0,c=o.b0*s+u;u=o.b1*s-o.a1*c+i,i=o.b2*s-o.a2*c,e[a]=c}}function shapeSound(e,t,n,r=0){if(!t)return;for(const i of t.eq??[])for(const o of e)runBand(o,i,n,r);const u=t.compress;if(u){const i=soundLevel(e,n)?.lufs;if(i===void 0)return;const o={threshold:i+u.threshold,ratio:u.ratio??COMPRESS_DEFAULTS.ratio,knee:u.knee??COMPRESS_DEFAULTS.knee,attack:u.attack??COMPRESS_DEFAULTS.attack,release:u.release??COMPRESS_DEFAULTS.release,window:u.window??COMPRESS_DEFAULTS.window};compress(e,o,n)}}function soundLevel(e,t){const n=integratedLoudness(e,t);if(n!==void 0&&n>-70)return{lufs:n,by:"integrated"};const r=steadyLoudness(e,t);return r===void 0?void 0:{lufs:r,by:"level"}}var shapes=e=>(e?.eq?.length??0)>0||e?.compress!==void 0;function playMusic(e,t,n,r){const u=Math.round(n*r),i=[new Float32Array(u),new Float32Array(u)],o=t[0].length;if(o===0)return i;for(const d of e.segments){const f=Math.round(d.at*r),m=Math.round(d.from*r),h=Math.round(d.dur*r),g=Math.round(d.fadeIn*r),E=Math.round(d.fadeOut*r);for(let D=0;D<h;D++){const p=f+D,v=m+D;if(p<0||p>=u||v<0||v>=o)continue;let y=1;g>0&&D<g&&(y*=equalPower(D/g)),E>0&&h-1-D<E&&(y*=equalPower((h-1-D)/E)),i[0][p]=(i[0][p]??0)+(t[0][v]??0)*y,i[1][p]=(i[1][p]??0)+(t[1][v]??0)*y}}let a=e.gainDb;if(e.shape&&(shapes(e.shape)||e.shape.filter!==void 0)){shapeSound(i,e.shape,r,0);const d=soundLevel(i,r);d&&(a=e.alone-d.lufs)}const s=Math.round(e.fadeIn*r),c=Math.round(e.fadeOut*r),l=Math.min(u,Math.round((e.until??n)*r));for(let d=0;d<u;d++){if(d>=l){i[0][d]=0,i[1][d]=0;continue}let f=10**((a+gainAt(e.duck,d/r))/20);d<s&&(f*=d/s),l-d<c&&(f*=(l-d)/c),i[0][d]=(i[0][d]??0)*f,i[1][d]=(i[1][d]??0)*f}return i}var SFX_HIT={whoosh:.18,tick:.004,pop:.01};function hashSeed(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t}function rng(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let n=t;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function synthSfx(e,t,n){const r=rng(n),u=()=>r()*2-1,i=.2;if(e==="tick"){const f=Math.round(t*.06),m=new Float32Array(f);for(let h=0;h<f;h++){const g=h/t,E=Math.exp(-g*90);m[h]=(Math.sin(2*Math.PI*3200*g)*.8+u()*.2)*E}return normalize(m,i*.7)}if(e==="pop"){const f=Math.round(t*.12),m=new Float32Array(f);let h=0;for(let g=0;g<f;g++){const E=g/t,D=300+600*Math.exp(-E*40);h+=2*Math.PI*D/t;const p=Math.min(1,E/.002)*Math.exp(-E*35);m[g]=Math.sin(h)*p}return normalize(m,i)}const o=.55,a=Math.round(t*o),s=new Float32Array(a),c=SFX_HIT.whoosh??.18;let l=0,d=0;for(let f=0;f<a;f++){const m=f/t,h=400+2600*Math.exp(-(((m-c)/.12)**2)),g=2*Math.sin(Math.PI*h/t),E=u()-l-.7*d;d+=g*E,l+=g*d;const D=m<c?(m/c)**2:Math.exp(-((m-c)/(o-c))*4);s[f]=d*D}return normalize(s,i)}function normalize(e,t){let n=0;for(const r of e)n=Math.max(n,Math.abs(r));if(n>0)for(let r=0;r<e.length;r++)e[r]=(e[r]??0)/n*t;return e}var twiddles=new Map;function twiddlesOf(e){let t=twiddles.get(e);if(!t){const n=new Float64Array(e/2),r=new Float64Array(e/2);for(let u=0;u<e/2;u++)n[u]=Math.cos(2*Math.PI*u/e),r[u]=-Math.sin(2*Math.PI*u/e);t={cos:n,sin:r},twiddles.set(e,t)}return t}function nextPow2(e){let t=1;for(;t<e;)t*=2;return t}function fft(e,t,n=!1){const r=e.length;if(r<=1)return;for(let a=1,s=0;a<r;a++){let c=r>>1;for(;s&c;c>>=1)s^=c;if(s^=c,a<s){const l=e[a]??0;e[a]=e[s]??0,e[s]=l;const d=t[a]??0;t[a]=t[s]??0,t[s]=d}}const{cos:u,sin:i}=twiddlesOf(r),o=n?-1:1;for(let a=2;a<=r;a<<=1){const s=r/a,c=a/2;for(let l=0;l<r;l+=a)for(let d=0;d<c;d++){const f=u[d*s]??1,m=(i[d*s]??0)*o,h=l+d,g=h+c,E=e[g]??0,D=t[g]??0,p=E*f-D*m,v=E*m+D*f,y=e[h]??0,A=t[h]??0;e[g]=y-p,t[g]=A-v,e[h]=y+p,t[h]=A+v}}if(n)for(let a=0;a<r;a++)e[a]=(e[a]??0)/r,t[a]=(t[a]??0)/r}function convolve(e,t){const n=new Float32Array(e.length);if(t.length===0||e.length===0)return n;if(t.length<=64){for(let c=0;c<e.length;c++){let l=0;const d=Math.min(t.length,c+1);for(let f=0;f<d;f++)l+=(t[f]??0)*(e[c-f]??0);n[c]=l}return n}const r=nextPow2(2*t.length),u=r-t.length+1,i=new Float64Array(r),o=new Float64Array(r);for(let c=0;c<t.length;c++)i[c]=t[c]??0;fft(i,o);const a=new Float64Array(r),s=new Float64Array(r);for(let c=0;c<e.length;c+=2*u){a.fill(0),s.fill(0);const l=c+u;for(let d=0;d<u;d++)a[d]=e[c+d]??0,s[d]=e[l+d]??0;fft(a,s);for(let d=0;d<r;d++){const f=a[d]??0,m=s[d]??0,h=i[d]??0,g=o[d]??0;a[d]=f*h-m*g,s[d]=f*g+m*h}fft(a,s,!0);for(let d=0;d<r;d++){const f=c+d;f<n.length&&(n[f]=(n[f]??0)+(a[d]??0));const m=l+d;m<n.length&&(n[m]=(n[m]??0)+(s[d]??0))}}return n}function minimumPhase(e,t,n=4096){const r=nextPow2(n*4),u=new Float64Array(r),i=new Float64Array(r);for(let s=0;s<=r/2;s++){const c=Math.max(e(s*t/r),1e-6);u[s]=Math.log(c),s>0&&s<r/2&&(u[r-s]=u[s]??0)}fft(u,i,!0);for(let s=1;s<r/2;s++)u[s]=2*(u[s]??0),i[s]=0;i[0]=0,i[r/2]=0;for(let s=r/2+1;s<r;s++)u[s]=0,i[s]=0;fft(u,i);for(let s=0;s<r;s++){const c=Math.exp(u[s]??0),l=i[s]??0;u[s]=c*Math.cos(l),i[s]=c*Math.sin(l)}fft(u,i,!0);const o=new Float64Array(n),a=Math.max(1,Math.floor(n/4));for(let s=0;s<n;s++){const c=s-(n-a),l=c>0?.5*(1+Math.cos(Math.PI*c/a)):1;o[s]=(u[s]??0)*l}return o}var SOUND_SPEED=343,PATTERNS={omni:1,subcardioid:.75,cardioid:.5,supercardioid:.37,hypercardioid:.25,figure8:0};function patternGain(e,t){const n=PATTERNS[e];return n+(1-n)*t}function proximity(e,t,n){const r=PATTERNS[e],u=2*Math.PI*Math.max(n,1)*Math.max(t,.005)/SOUND_SPEED;return Math.hypot(1,(1-r)/u)}var TALKER_BEHIND=[[63,0],[125,-1],[250,-2],[500,-4],[1e3,-6],[2e3,-9],[4e3,-13],[8e3,-18],[16e3,-25]];function curveDb(e,t){const n=e[0],r=e[e.length-1];if(!n||!r)return 0;if(t<=n[0])return n[1];if(t>=r[0])return r[1];for(let u=1;u<e.length;u++){const i=e[u-1],o=e[u];if(!i||!o||t>o[0])continue;const a=Math.log(t/i[0])/Math.log(o[0]/i[0]);return i[1]+(o[1]-i[1])*a}return r[1]}function talkerDb(e,t){return curveDb(TALKER_BEHIND,e)*((1-t)/2)}function cosBetween(e,t){const n=Math.hypot(e[0],e[1],e[2]),r=Math.hypot(t[0],t[1],t[2]);return n===0||r===0?1:(e[0]*t[0]+e[1]*t[1]+e[2]*t[2])/(n*r)}function random(e){let t=e>>>0;return()=>{t=t+1831565813>>>0;let n=t;return n=Math.imul(n^n>>>15,n|1),n^=n+Math.imul(n^n>>>7,n|61),((n^n>>>14)>>>0)/4294967296}}function gaussian(e){const t=random(e);let n;return()=>{if(n!==void 0){const o=n;return n=void 0,o}const r=Math.max(t(),1e-12),u=t(),i=Math.sqrt(-2*Math.log(r));return n=i*Math.sin(2*Math.PI*u),i*Math.cos(2*Math.PI*u)}}function noiseGain(e,t){const n=Math.max(t,10);let r=e.tilt*Math.log2(n/1e3);return r+=e.rumble/(1+(n/120)**2),n>e.top&&(r-=48*Math.log2(n/e.top)),10**(r/20)}function roomTone2(e,t,n,r){const u=gaussian(r),i=new Float32Array(e+4096);for(let d=0;d<i.length;d++)i[d]=u();const o=minimumPhase(d=>noiseGain(n,d),t,2048),a=convolve(i,o).subarray(4096);let s=0;for(const d of a)s+=d*d;const c=Math.sqrt(s/Math.max(1,a.length)),l=new Float32Array(e);for(let d=0;d<e;d++)l[d]=(a[d]??0)/(c||1);if(n.hum){const d=10**(n.hum.db/20)*Math.SQRT2,f=random(r^2654435769);for(let m=1;m<=6;m++){const h=n.hum.hz*m;if(h>n.top)break;const g=d/2**(m-1),E=f()*2*Math.PI,D=2*Math.PI*h/t;for(let p=0;p<e;p++)l[p]=(l[p]??0)+g*Math.sin(D*p+E)}}return l}var ROOM_PRESETS={bedroom:{size:[3.4,2.6,4],walls:"plasterboard",floor:"carpet",ceiling:"plasterboard-ceiling",rt60:.4,talker:[1.5,1.2,1.5],order:3},"living-room":{size:[5,2.7,6],walls:"plasterboard",floor:"wood",ceiling:"plasterboard-ceiling",rt60:.55,talker:[2.2,1.2,2.5],order:3},office:{size:[4,2.8,5],walls:"plasterboard",floor:"carpet-thin",ceiling:"ceiling-tiles",rt60:.45,talker:[1.8,1.2,2],order:3},kitchen:{size:[3,2.6,4],walls:"tiles",floor:"tiles",ceiling:"plasterboard-ceiling",rt60:.75,talker:[1.4,1.6,1.6],order:3},treated:{size:[3,2.6,3.5],walls:"foam",floor:"carpet",ceiling:"foam",rt60:.2,talker:[1.4,1.2,1.4],order:3},car:{size:[1.4,1.15,1.9],walls:"glass",floor:"upholstery",ceiling:"upholstery",rt60:.08,talker:[.45,.85,.9],order:6},outdoor:{size:[60,30,60],walls:"hard",floor:"hard",ceiling:"hard",rt60:.4,talker:[30,1.6,30],open:!0,order:1}},DEESS={hz:5500,threshold:-12,ratio:3,attack:.002,release:.06},POST_PRESETS={finish:{highpass:70,eq:[],deess:DEESS,compress:{threshold:-3,ratio:4,knee:6,attack:.005,release:.3,window:.01}},"phone-app":{highpass:90,eq:[{type:"peak",hz:300,db:-2,q:1},{type:"peak",hz:4e3,db:3,q:.8},{type:"highshelf",hz:1e4,db:1}],deess:DEESS,compress:{threshold:0,ratio:3,knee:6,attack:.005,release:.12,window:.01}}},ROOM_TONE={tilt:-4,rumble:8,top:16e3},SETUP_PRESETS={studio:{pattern:"cardioid",distance:.2,angle:0,below:0,response:[[125,-3.5],[250,-3],[500,-.5],[1e3,0],[2e3,-2],[4e3,-1.5],[8e3,-4],[12500,-4]],band:[20,2e4],stereo:!1,room:!1,noise:!1,agc:!1,post:"finish"},phone:{pattern:"omni",distance:.35,angle:0,below:25,response:[[125,-8.5],[250,-3.5],[500,-.5],[1e3,0],[2e3,0],[4e3,0],[8e3,-3.5],[12500,-2.5]],band:[100,16e3],stereo:.1,room:{preset:"bedroom",rt60:.2},noise:{...ROOM_TONE,below:42},agc:{target:0,most:10,attack:.3,release:1.5,window:2,gate:-25},post:!1},lav:{pattern:"omni",distance:.22,angle:0,below:70,response:[[125,-2],[250,-3],[500,.5],[1e3,0],[2e3,-1],[4e3,-1],[8e3,-3.5],[12500,-4]],band:[70,18e3],stereo:!1,room:{preset:"bedroom",rt60:.13},noise:{tilt:-4,rumble:4,top:18e3,below:50},agc:!1,post:"finish"}},SOURCE_DEFAULTS={pattern:"cardioid",distance:.2};function bandCentres(e){const t=Math.floor(Math.log2(e/125));return Array.from({length:t},(n,r)=>125*2**r)}var MATERIALS={hard:[.02,.02,.03,.03,.04,.05,.05],plasterboard:[.15,.1,.06,.04,.04,.05,.05],"plasterboard-ceiling":[.2,.15,.1,.08,.04,.02,.02],tiles:[.01,.01,.01,.02,.02,.02,.02],concrete:[.01,.03,.05,.02,.02,.02,.02],wood:[.18,.12,.1,.09,.08,.07,.07],carpet:[.08,.08,.3,.6,.75,.8,.8],"carpet-thin":[.02,.04,.08,.2,.35,.4,.4],glass:[.1,.05,.04,.03,.03,.03,.03],curtains:[.05,.12,.35,.45,.38,.36,.36],"ceiling-tiles":[.49,.53,.53,.75,.92,.99,.99],foam:[.12,.33,.83,.97,.98,.95,.95],upholstery:[.44,.6,.77,.89,.82,.7,.7],grass:[.11,.26,.6,.69,.92,.99,.99]},AIR=[1e-4,3e-4,6e-4,.001,.0019,.0058,.0203];function atBands(e,t){return t.map(n=>{const r=Math.log2(n/125),u=Math.min(Math.max(Math.floor(r),0),e.length-2),i=e[u]??0,o=e[u+1]??i;return Math.min(1,Math.max(0,i+(o-i)*(r-u)))})}var C=343;function areas(e){const[t,n,r]=e;return[n*r,n*r,t*r,t*r,t*n,t*n]}function reverberation(e,t){const n=bandCentres(t),[r,u,i]=e.size,o=r*u*i,a=areas(e.size),s=a.reduce((l,d)=>l+d,0),c=atBands(AIR,n);return n.map((l,d)=>{let f=0;e.surfaces.forEach((h,g)=>{const E=e.open?.[g]===!0;f+=(a[g]??0)*(E?1:atBands(h,n)[d]??0)});const m=Math.min(f/s,.999);return 24*Math.LN10*o/(C*(-s*Math.log(1-m)+4*(c[d]??0)*o))})}function withReverberation(e,t,n){const r=a=>({...e,surfaces:e.surfaces.map(s=>s.map(c=>Math.min(.99,c*a)))}),u=a=>{const s=reverberation(a,n);return((s[2]??0)+(s[3]??0))/2};let i=.001,o=1e3;for(let a=0;a<60;a++){const s=Math.sqrt(i*o);u(r(s))>t?i=s:o=s}return r(Math.sqrt(i*o))}function bandShapes(e,t,n){const r=t/2+1,u=e.map(()=>new Float64Array(r)),i=e.map((s,c)=>c===0?0:Math.round(s/Math.SQRT2/n*t)),o=e.map(s=>Math.round(s/n*t)),a=e.map((s,c)=>c===e.length-1?r:Math.round(s*Math.SQRT2/n*t));e.forEach((s,c)=>{const l=u[c];if(l)for(let d=i[c]??0;d<Math.min(a[c]??r,r);d++)l[d]=1});for(let s=1;s<e.length;s++){const c=Math.max(1,Math.round(.5*((a[s]??0)-(o[s]??0)))),l=u[s-1],d=u[s];if(!(!l||!d))for(let f=-c;f<=c;f++){const m=(i[s]??0)+f;if(m<0||m>=r)continue;const h=(f/c+1)/2;l[m]=Math.cos(Math.PI*h/2),d[m]=Math.sin(Math.PI*h/2)}}return u}function addImpulse(e,t,n){const r=Math.floor(t),u=t-r;for(let i=0;i<81;i++){const o=r-40+i;if(o<0||o>=e.length)continue;const a=i-40-u,s=Math.abs(a)<1e-9?1:Math.sin(Math.PI*a)/(Math.PI*a),c=.5-.5*Math.cos(2*Math.PI*i/80);e[o]=(e[o]??0)+n*c*s}}function roomResponse(e,t,n){const r=bandCentres(t),u=r.length,[i,o,a]=e.size,s=[i,o,a],c=e.talker,l=e.mic,d=e.surfaces.map((V,Z)=>e.open?.[Z]===!0?r.map(()=>0):atBands(V,r).map(S=>Math.sqrt(1-S))),f=atBands(AIR,r),m=reverberation(e,t),h=[l[0]-c[0],l[1]-c[1],l[2]-c[2]],g=Math.hypot(...h),E=40,D=e.order,p=[];let v=1/0;for(let V=-(D+1);V<=D+1;V++)for(let Z=-(D+1);Z<=D+1;Z++)for(let S=-(D+1);S<=D+1;S++){const H=Math.abs(V)+Math.abs(Z)+Math.abs(S);if(H===0||H>D+1)continue;const R=[V,Z,S],G=(j,U)=>{const O=s[U]??1,L=c[U];return j*O+(Math.abs(j)%2===1?O-L:L)},X=[G(V,0)-l[0],G(Z,1)-l[1],G(S,2)-l[2]],te=Math.hypot(...X),ae=(te-g)/C;if(H===D+1){R.every((U,O)=>U===0||!(e.open?.[O*2]===!0&&e.open[O*2+1]===!0))&&(v=Math.min(v,ae));continue}let re=!1;const Ee=r.map((j,U)=>{let O=1;return R.forEach((L,K)=>{const W=L>0?Math.floor(L/2):Math.ceil(-L/2),ee=L>0?Math.ceil(L/2):Math.floor(-L/2),Q=d[K*2]?.[U]??0,Y=d[K*2+1]?.[U]??0;(W>0&&Q===0||ee>0&&Y===0)&&(re=!0),O*=Q**W*Y**ee}),O});if(re)continue;const ve=[Math.abs(V)%2===1?X[0]:-X[0],Math.abs(Z)%2===1?X[1]:-X[1],Math.abs(S)%2===1?X[2]:-X[2]],ue=patternGain(e.pattern,cosBetween(X,e.axis)),se=cosBetween(ve,e.facing);p.push({t:ae,amp:Ee.map((j,U)=>{const O=r[U]??1e3,L=proximity(e.pattern,te,O)/proximity(e.source.pattern,e.source.distance,O);return j*ue/te*Math.exp(-.5*(f[U]??0)*te)*10**(talkerDb(O,se)/20)*L})})}Number.isFinite(v)||(v=.08);const y=Math.max(...m),A=Math.ceil((Math.min(Math.max(y,v+.05),3)+.01)*t)+2*E,b=nextPow2(2*A),x=bandShapes(r,b,t),B=new Float64Array(b),$=new Float64Array(b),k=new Float64Array(b),w=new Float64Array(b),I=Math.round(v*t),[M,_,F]=e.size,N=M*_*F,T=e.open?.some(Boolean)===!0,P=new Float64Array(A);if(!T){const V=random(n);let Z=v;for(;Z*t<A-E;){const G=Math.floor(Z*t)+E;P[G]=(P[G]??0)+(V()<.5?-1:1);const X=Math.min(4*Math.PI*C**3*(Z+g/C)**2/N,1e4);Z+=Math.log(1/Math.max(V(),1e-12))/X}const S=Math.max(1,Math.round(.004*t)),H=new Float64Array(A);let R=0;for(let G=0;G<A;G++)R+=(P[G]??0)**2,G>=S&&(R-=(P[G-S]??0)**2),H[G]=R/S;for(let G=0;G<A;G++){const X=H[Math.min(A-1,G+Math.floor(S/2))]??0;X>0&&(P[G]=(P[G]??0)/Math.sqrt(X))}}for(let V=0;V<u;V++){k.fill(0),w.fill(0);for(const S of p)!T&&S.t>v+.002||addImpulse(k,S.t*t+E,S.amp[V]??0);if(!T){const S=m[V]??.4,H=Math.round(.01*t);for(let R=I+E-Math.round(.002*t);R<A;R++){const G=(R-E)/t,X=Math.sqrt(4*Math.PI*C/N/t*Math.exp(-6*Math.LN10*(G+g/C)/S)),te=R-(I+E-Math.round(.002*t)),ae=te<H?.5-.5*Math.cos(Math.PI*te/H):1;w[R]=(P[R]??0)*X*ae}}fft(k,w);const Z=x[V];if(Z)for(let S=0;S<b;S++){const H=S<=b/2?S:b-S,R=(Z[H]??0)**2,G=(b-S)%b,X=k[S]??0,te=w[S]??0,ae=k[G]??0,re=w[G]??0,Ee=(X+ae)/2,ve=(te-re)/2,ue=(te+re)/2,se=(ae-X)/2;B[S]=(B[S]??0)+R*(Ee+ue),$[S]=($[S]??0)+R*(ve+se)}}return fft(B,$,!0),{reflections:B.slice(0,A),direct:{gain:patternGain(e.pattern,cosBetween([-h[0],-h[1],-h[2]],e.axis))/g,cos:cosBetween(h,e.facing),distance:g},lead:E,rt60:m,mixing:v}}var surface=(e,t)=>e===void 0?[...MATERIALS[t]??[]]:typeof e=="string"?[...MATERIALS[e]??[]]:[...e];function resolveRoom(e,t){if(e===!1||e===void 0&&t===!1)return!1;const n=t===!1?{preset:"bedroom"}:typeof t=="string"?{preset:t}:t,r=typeof e=="string"?{preset:e}:e===void 0?n:e.preset===void 0?{...n,...e}:e,u=ROOM_PRESETS[r.preset??"bedroom"];return{size:r.size??u.size,walls:surface(r.walls,u.walls),floor:surface(r.floor,u.floor),ceiling:surface(r.ceiling,u.ceiling),rt60:r.rt60??u.rt60,talker:r.talker??u.talker,...u.open?{open:!0}:{},order:u.order}}function resolvePickup(e,t,n){const r=SETUP_PRESETS[t],u=e.noise===!1?!1:e.noise===void 0?r.noise:{...r.noise||{tilt:-4,rumble:8,top:16e3,below:45},...e.noise},i=e.agc===!1?!1:e.agc===void 0?r.agc:{...r.agc||{target:0,most:10,attack:.3,release:1.5,window:1},...e.agc};return{pattern:e.pattern??r.pattern,distance:e.distance??r.distance,angle:e.angle??r.angle,below:e.below??r.below,response:(e.response??r.response).map(([o,a])=>[o,a]),band:e.band??r.band,stereo:e.stereo??r.stereo,room:resolveRoom(e.room,r.room),noise:u===!1?!1:{tilt:u.tilt,rumble:u.rumble,top:u.top,below:u.below,...u.hum?{hum:u.hum}:{}},agc:i===!1?!1:{target:i.target??0,most:i.most??10,attack:i.attack??.3,release:i.release??1.5,window:i.window??1,...i.gate===void 0?{}:{gate:i.gate}},gain:n,toneAt:r.distance}}function resolvePost(e,t){if(e===!1)return!1;const n=typeof e=="string"?e:e?.preset??(t===!1?void 0:t),r=n===void 0?void 0:POST_PRESETS[n],u=typeof e=="object"?e:{};if(!r&&typeof e!="object")return!1;const i=u.deess===!1?!1:u.deess===void 0?r?.deess??!1:{...r?.deess||POST_PRESETS.finish.deess||{hz:5500,threshold:-12,ratio:3,attack:.002,release:.06},...u.deess},o=u.compress===!1?!1:u.compress===void 0?r?.compress??!1:{...r?.compress||POST_PRESETS.finish.compress||{threshold:2,ratio:2,knee:6,attack:.01,release:.15,window:.01},...u.compress};return{highpass:u.highpass??r?.highpass??!1,eq:[...u.eq??r?.eq??[]],deess:i,compress:o}}function resolveVoice(e){if(e===!1)return!1;const t=typeof e=="string"?{setup:e}:e??{},n=t.setup??"studio",r=SETUP_PRESETS[n],u=resolvePickup(t,n,0);return{setup:n,source:{pattern:t.source?.pattern??SOURCE_DEFAULTS.pattern,distance:t.source?.distance??SOURCE_DEFAULTS.distance},pickups:[u,...(t.also??[]).map(i=>({...resolvePickup(i,i.setup??n,i.gain??-12),...i.room===void 0?{room:u.room}:{}}))],post:resolvePost(t.post,r.post)}}var impulses=new Map;function placement(e,t,n,r){const u=e.angle*Math.PI/180,i=e.below*Math.PI/180,o=[Math.sin(u)*Math.cos(i),-Math.sin(i),Math.cos(u)*Math.cos(i)],a=(c,l)=>Math.min(Math.max(c,.05),l-.05),s=[a(t[0]+o[0]*e.distance+r,n[0]),a(t[1]+o[1]*e.distance,n[1]),a(t[2]+o[2]*e.distance,n[2])];return{mic:s,axis:[t[0]-s[0],t[1]-s[1],t[2]-s[2]]}}function bandGain(e,t,n){let r=1;return e[0]>15&&(r*=biquadGain(biquad({type:"highpass",hz:e[0]},n),t,n)),e[1]<n*.45&&(r*=biquadGain(biquad({type:"lowpass",hz:e[1]},n),t,n)),r}var micFilters=new Map;function micFilter(e,t){const n=JSON.stringify([e.response,e.band,t]);let r=micFilters.get(n);return r||(r=minimumPhase(u=>fromDb(curveDb(e.response,u))*bandGain(e.band,u,t),t,2048),micFilters.set(n,r)),r}function pickupImpulses(e,t,n,r){const u=JSON.stringify([e.pattern,e.distance,e.angle,e.below,e.response,e.band,e.stereo,e.room,t,n,r]),i=impulses.get(u);if(i!==void 0)return i;const o=(h,g)=>proximity(e.pattern,g,h)/proximity(t.pattern,t.distance,h),a=Math.cos(e.angle*Math.PI/180)*Math.cos(e.below*Math.PI/180);if(e.room===!1&&e.response.every(([,h])=>Math.abs(h)<.01)&&e.band[0]<=20&&e.band[1]>=2e4&&Math.abs(o(100,e.distance)-1)<.001&&Math.abs(talkerDb(8e3,a))<.01)return impulses.set(u,null),null;const c=micFilter(e,n),l=[];let d=0;(e.stereo===!1?[0]:[-e.stereo/2,e.stereo/2]).forEach((h,g)=>{let E;if(e.room===!1)E=minimumPhase(v=>o(v,e.distance)*fromDb(talkerDb(v,a)),n,2048);else{const p=e.room,v=placement(e,p.talker,p.size,h);let y={size:p.size,surfaces:[p.walls,p.walls,p.floor,p.ceiling,p.walls,p.walls],...p.open?{open:[!0,!0,!1,!0,!0,!0]}:{},talker:p.talker,facing:[0,0,1],mic:v.mic,axis:v.axis,pattern:e.pattern,source:t,order:p.order};p.open||(y=withReverberation(y,p.rt60,n));const A=roomResponse(y,n,r+g*7919),b=A.direct.distance,x=minimumPhase(B=>o(B,b)*fromDb(talkerDb(B,A.direct.cos)),n,2048);E=Float64Array.from(A.reflections);for(let B=0;B<x.length&&A.lead+B<E.length;B++)E[A.lead+B]=(E[A.lead+B]??0)+A.direct.gain*(x[B]??0);d=A.lead}const D=convolve(Float32Array.from(E),c);l.push(Float64Array.from(D))});const m={channels:l,lead:d};return impulses.set(u,m),m}function distanceDrop(e,t,n,r){if(Math.abs(e.distance-e.toneAt)<1e-6)return 0;const u=a=>{const s=pickupImpulses(a,t,n,r)?.channels[0];if(!s)return;let c=0;for(const l of s)c+=l*l;return c},i=u(e),o=u({...e,distance:e.toneAt});return e.room===!1||i===void 0||o===void 0?20*Math.log10(e.distance/e.toneAt):10*Math.log10(o/i)}function recordVoice(e,t,n,r,u){const[i,o]=e,a=i.length,s=integratedLoudness([i,o],n);if(s===void 0)return;const c=new Float32Array(a);for(let g=0;g<a;g++)c[g]=((i[g]??0)+(o[g]??0))/2;const l=new Float32Array(a),d=new Float32Array(a);t.pickups.forEach((g,E)=>{const D=pickupImpulses(g,t.source,n,r+E*104729);let p,v;if(!D)p=Float32Array.from(i),v=Float32Array.from(o);else{const x=B=>{const $=convolve(c,B);return Float32Array.from({length:a},(k,w)=>$[w+D.lead]??0)};p=x(D.channels[0]??new Float64Array(1)),v=D.channels[1]?x(D.channels[1]):Float32Array.from(p)}const y=integratedLoudness([p,v],n);if(y===void 0)return;const A=fromDb(s-y);for(let x=0;x<a;x++)p[x]=(p[x]??0)*A,v[x]=(v[x]??0)*A;if(g.noise){const x=micFilter(g,n),B=F=>convolve(F,x).subarray(0,a),$=B(roomTone2(a,n,g.noise,r+E*31+1)),k=g.stereo===!1?$:B(roomTone2(a,n,g.noise,r+E*31+2)),w=Math.round(.05*n),I=new Float32Array(a);for(const F of u){const N=Math.max(0,Math.round(F.start*n)),T=Math.min(a,Math.round(F.end*n));for(let P=N;P<T;P++){const V=Math.min(P-N,T-1-P);I[P]=Math.max(I[P]??0,V<w?V/w:1)}}const M=integratedLoudness([$,k],n)??-3,_=fromDb(s-g.noise.below+distanceDrop(g,t.source,n,r+E*104729)-M);for(let F=0;F<a;F++){const N=(I[F]??0)*_;p[F]=(p[F]??0)+($[F]??0)*N,v[F]=(v[F]??0)+(k[F]??0)*N}}g.agc&&agc([p,v],{...g.agc,target:s+g.agc.target,...g.agc.gate===void 0?{}:{gate:s+g.agc.gate}},n);const b=fromDb(g.gain);for(let x=0;x<a;x++)l[x]=(l[x]??0)+(p[x]??0)*b,d[x]=(d[x]??0)+(v[x]??0)*b});const f=t.post;if(f){const g=[...f.highpass===!1?[]:[biquad({type:"highpass",hz:f.highpass},n)],...f.eq.map(E=>biquad(E,n))];runBiquads(l,g),runBiquads(d,g),f.deess&&deess([l,d],{...f.deess,threshold:s+f.deess.threshold},n),f.compress&&compress([l,d],{...f.compress,threshold:s+f.compress.threshold},n)}const m=integratedLoudness([l,d],n),h=m===void 0?1:fromDb(s-m);for(let g=0;g<a;g++)i[g]=(l[g]??0)*h,o[g]=(d[g]??0)*h}function voiceGroups(e){const t=e.voice;if(!t)return{groups:[],dry:[...e.speech]};const n=o=>(o===void 0?void 0:t.parts?.[o])??t.video,r=new Map,u=[],i=o=>{const a=JSON.stringify(o);let s=r.get(a);return s||(s={voice:o,clips:[],spans:[],parts:[],seed:hashSeed(`${t.seed}:voice:${a}`)},r.set(a,s)),s};for(const o of e.speech){const a=n(o.part);a===!1?u.push(o):i(a).clips.push(o)}for(const o of t.spans){const a=n(o.part);if(a===!1)continue;const s=i(a);s.spans.push({start:o.start,end:o.end}),s.parts.push(o.part)}return{groups:[...r.values()],dry:u}}function addSpeech(e,t,n,r,u){const i=Math.round(n.dur*r),o=Math.round(n.at*r),a=10**(n.gainDb/20),s=Math.min(Math.round(.01*r),Math.floor(i/4)),c=D=>D===void 0||D<=0?0:Math.min(Math.round(D*r),Math.floor(i/2)),l=c(n.fadeIn),d=c(n.fadeOut),f=(D,p)=>p>0?equalPower(D/p):s>0&&D<s?D/s:1,m=e[0].length,h=t[0].length,g=u===void 0?n.speed??1:1,E=u===void 0?n.from*r:n.from/u*r;for(let D=0;D<i;D++){const p=o+D;if(p<0||p>=m)continue;const v=g===1?Math.round(E)+D:E+D*g,y=Math.floor(v);if(y<0||y>=h)continue;const A=v-y,b=Math.min(y+1,h-1),x=a*f(D,l)*f(i-1-D,d);for(let B=0;B<2;B++){const $=t[B]??t[0],k=$[y]??0,w=$[b]??0,I=e[B]??e[0];I[p]=(I[p]??0)+(k+(w-k)*A)*x}}}function sumSpeech(e,t,n,r){const u=Math.round(t*n),i=[new Float32Array(u),new Float32Array(u)];for(const o of e){const a=r(o);a&&addSpeech(i,a.src,o,n,a.stretched)}return i}function playVoice(e,t,n,r){const u=sumSpeech(e.clips,t,n,r);return recordVoice(u,e.voice,n,e.seed,e.spans),u}function applyEnvelope(e,t,n){if(t.length===0)return;const r=e[0].length;for(let u=0;u<r;u++){const i=10**(gainAt(t,u/n)/20);i!==1&&(e[0][u]=(e[0][u]??0)*i,e[1][u]=(e[1][u]??0)*i)}}function addPlayed(e,t,n,r,u,i){const o=Math.round(n.dur*r),a=Math.round(n.at*r),s=10**(n.gainDb/20),c=Math.min(Math.round(.01*r),Math.floor(o/4)),l=v=>v===void 0||v<=0?0:Math.min(Math.round(v*r),Math.floor(o/2)),d=l(n.fadeIn),f=l(n.fadeOut),m=(v,y)=>y>0?equalPower(v/y):c>0&&v<c?v/c:1,h=[...n.envelope??[]],g=e[0].length,E=t[0].length,D=u===void 0?n.speed??1:1,p=u===void 0?n.from*r:n.from/u*r;for(let v=0;v<o;v++){const y=a+v;if(y<0||y>=g)continue;const A=D===1?Math.round(p)+v:p+v*D,b=Math.floor(A);if(b<0||b>=E)continue;const x=A-b,B=Math.min(b+1,E-1),$=y/r,k=h.length>0||i.length>0?10**((gainAt(h,$)+gainAt(i,$))/20):1,w=s*k*m(v,d)*m(o-1-v,f);for(let I=0;I<2;I++){const M=t[I]??t[0],_=M[b]??0,F=M[B]??0,N=e[I]??e[0];N[y]=(N[y]??0)+(_+(F-_)*x)*w}}}function playSfx(e,t,n){if(!e.shape||!(shapes(e.shape)||e.shape.filter!==void 0))return{src:t,gainDb:e.gainDb};const r=soundLevel(t,n)?.lufs,u=[Float32Array.from(t[0]),Float32Array.from(t[1])];shapeSound(u,e.shape,n,0);const i=soundLevel(u,n)?.lufs;return i===void 0?{src:u,gainDb:e.gainDb}:e.level?{src:u,gainDb:e.level.target-i+e.level.gainDb}:{src:u,gainDb:e.gainDb+(r===void 0?0:r-i)}}function synthStereo(e,t,n){const r=synthSfx(e,t,n);return[r,r]}function renderMix(e,t,n,r={}){const u=Math.round(e.duration*n),i=[new Float32Array(u),new Float32Array(u)],o=e.speechGain??[],a=clipSource(t),{groups:s,dry:c}=voiceGroups(e);for(const l of s){const[d,f]=playVoice(l,e.duration,n,a);applyEnvelope([d,f],o,n);for(let m=0;m<u;m++)i[0][m]=(i[0][m]??0)+(d[m]??0),i[1][m]=(i[1][m]??0)+(f[m]??0)}for(const l of c){const d=a(l);d&&addPlayed(i,d.src,l,n,d.stretched,o)}if(r.only==="voice")return i;for(const l of e.footage){const d=t(l.file,{});d&&addPlayed(i,d.src,l,n,void 0,[])}if(e.music){const l=e.music,d=t(l.file,l.shape?.filter?{filter:l.shape.filter}:{});if(d){const[f,m]=playMusic(l,d.src,e.duration,n);for(let h=0;h<u;h++)i[0][h]=(i[0][h]??0)+(f[h]??0),i[1][h]=(i[1][h]??0)+(m[h]??0)}}for(const l of e.sfx){let d;if(l.file!==void 0?d=t(l.file,l.shape?.filter?{filter:l.shape.filter}:{})?.src:d=synthStereo(l.sound,n,l.seed),!d)continue;const f=playSfx(l,d,n),m=10**(f.gainDb/20),h=Math.round(l.at*n),g=f.src[0].length;for(let E=0;E<g;E++){const D=h+E;D<0||D>=u||(i[0][D]=(i[0][D]??0)+(f.src[0][E]??0)*m,i[1][D]=(i[1][D]??0)+(f.src[1][E]??0)*m)}}return i}function limitPeaks(e,t,n,r=MASTER_MECHANICS.attack,u=MASTER_MECHANICS.release){const i=e[0].length,o=Math.max(1,Math.round(r*n)),a=new Float32Array(i);for(let g=0;g<i;g++){const E=Math.max(Math.abs(e[0][g]??0),Math.abs(e[1][g]??0));a[g]=E>t?t/E:1}const s=new Float32Array(i),c=[];let l=0;for(let g=i-1;g>=0;g--){const E=a[g]??1;for(;c.length>l&&(a[c[c.length-1]??0]??1)>=E;)c.pop();for(c.push(g);(c[l]??0)>g+o;)l++;s[g]=a[c[l]??g]??1}const d=Math.exp(-1/(Math.max(u,1e-4)*n));let f=1;for(let g=0;g<i;g++)f=Math.min(s[g]??1,1-(1-f)*d),s[g]=f;let m=0;const h=new Float32Array(i);for(let g=0;g<i;g++)m+=s[g]??1,g>=o&&(m-=s[g-o]??1),h[g]=m/Math.min(o,g+1);for(let g=0;g<i;g++){const E=Math.min(h[g]??1,a[g]??1);e[0][g]=(e[0][g]??0)*E,e[1][g]=(e[1][g]??0)*E}}function masterMix(e,t,n){const r=10**(n.truePeak/20),u=integratedLoudness(e,t),i=c=>{const l=10**(c/20),d=[Float32Array.from(e[0],f=>f*l),Float32Array.from(e[1],f=>f*l)];return limitPeaks(d,r,t),d};let o=n.lufs===!1||u===void 0?0:n.lufs-u,a=i(o),s=integratedLoudness(a,t);if(n.lufs!==!1&&u!==void 0)for(let c=1;c<MASTER_MECHANICS.rounds&&s!==void 0;c++){const l=n.lufs-s;if(Math.abs(l)<=MASTER_MECHANICS.tolerance)break;o+=l,a=i(o),s=integratedLoudness(a,t)}return e[0].set(a[0]),e[1].set(a[1]),{gainDb:o,...s===void 0?{}:{integrated:s}}}function previewMaster(e,t,n){const[r,u]=e;let i=!1;for(let o=0;o<r.length&&!i;o++)i=r[o]!==0||u[o]!==0;if(i)return masterMix(e,t,n),e}var BANDWIDTH_DEFAULTS={ref:1e3,drops:[30,50,70],smooth:1/12,stepsFrom:3e3,stepSpan:1/6,stepMin:3,steps:4,floor:-60};function voicePlan(e,t){const n=u=>resolveVoice(u),r=t.filter(u=>u.mic!==void 0);return{mic:{video:n(e),...r.length>0?{parts:Object.fromEntries(r.map(u=>[u.key,n(u.mic)]))}:{}}}}function wordsOnFilm(e,t){return e.flatMap(n=>wordsIn(t(n.file)??[],n.from,n.dur,n.at,n.speed??1)).map(n=>({start:n.start,end:n.end})).sort((n,r)=>n.start-r.start)}var level=(e,t)=>t===void 0||!Number.isFinite(t)?0:e-t,held=e=>[...e].sort((t,n)=>t.t-n.t);function musicPlayed(e,t,n){return e.play?musicSegments(e.play,e.seam??MUSIC_DEFAULTS.seam,t,"before",!e.loop):e.loop?musicSegments(wholeLoop(e.from,t,n,e.seam),t>1?e.seam??MUSIC_DEFAULTS.loopSeam:0,t,"after",!1):musicSegments(placeStretches([{from:e.from,to:t}],void 0,t,n),0,t)}function mixPlan(e,t,n){const r=e.duration,u=e.audio.mix??MIX_DEFAULTS,i={duration:r,speech:[],footage:[],sfx:[]};for(const f of[...e.audio.speech??[],...e.audio.room??[]]){const m=t[f.file];!m||f.dur<=0||i.speech.push({file:f.file,...f.part===void 0?{}:{part:f.part},at:f.at,from:f.from,dur:f.dur,gainDb:level(u.speech,m.loudness)+(f.gainDb??0),...f.speed!==void 0&&f.speed!==1?{speed:f.speed}:{},...f.denoise?{denoise:f.denoise}:{},...f.fadeIn?{fadeIn:f.fadeIn}:{},...f.fadeOut?{fadeOut:f.fadeOut}:{}})}const o=speechSpans(i.speech,u.duck),a=speechEnvelope(o,u.footageUnderSpeech-u.footage,u.duck);for(const f of e.footage??[]){const m=t[f.file];if(!f.audio||f.take===!0||!m)continue;const h=f.speed>0?f.speed:1,g=Math.max(0,f.from),E=f.start+(g-f.from)/h,D=m.duration===void 0?1/0:m.duration-g,p=Math.min(f.end-E,D/h);p<=0||i.footage.push({file:f.file,at:E,from:g,dur:p,...h===1?{}:{speed:h},gainDb:level(u.footage,m.loudness)+f.gainDb,...a.length>0?{envelope:a}:{}})}const s=e.audio.music,c=s?.file===void 0?void 0:t[s.file];if(s?.file!==void 0&&c){const f=(s.gain??[]).map(g=>({t:g.t,db:g.db})),m=c.duration??s.from+r,h={file:s.file,segments:musicPlayed(s,m,r),gainDb:level(u.musicAlone,c.loudness),alone:u.musicAlone,fadeIn:u.musicFade.in,fadeOut:Math.min(u.musicFade.out,r/4),...s.until===void 0?{}:{until:s.until},duck:addEnvelopes(addEnvelopes(speechEnvelope(o,u.music-u.musicAlone,u.duck),duckEnvelope(wordsOnFilm(i.speech,g=>t[g]?.words),u.duck)),held(f)),...s.shape?{shape:s.shape}:{}};i.music=h}const l=speechGains(e);l.length>0&&(i.speechGain=l);const d=e.audio.mic;return d&&(i.voice={video:d.video,...d.parts?{parts:d.parts}:{},spans:e.parts.map(f=>({part:f.key,start:f.start,end:f.end})),seed:n.seed}),e.cues.forEach((f,m)=>{const h=f.gainDb??0;if(f.file!==void 0){const E=t[f.file];if(!E)return;i.sfx.push({sound:f.sound,file:f.file,at:f.t,gainDb:level(u.sfx,E.loudness)+h,seed:0,...f.shape?{shape:f.shape,level:{target:u.sfx,gainDb:h}}:{}});return}const g=SFX_HIT[f.sound];g!==void 0&&i.sfx.push({sound:f.sound,at:Math.max(0,f.t-g),gainDb:u.sfx-MIX_DEFAULTS.sfx+h,seed:hashSeed(`${n.seed}:${f.sound}:${String(m)}`),...f.shape?{shape:f.shape}:{}})}),i}function speechGains(e){const t=new Map;for(const s of e.parts)s.speechGainDb!==void 0&&s.speechGainDb!==0&&t.set(s.key,s.speechGainDb);if(t.size===0)return[];const n=[];for(const s of e.parts)n.push({start:s.start,end:s.end,db:t.get(s.key)??0,rank:0});const r=[...(e.audio.speech??[]).map(s=>({c:s,rank:2})),...(e.audio.room??[]).map(s=>({c:s,rank:1}))];for(const{c:s,rank:c}of r)s.part===void 0||s.dur<=0||n.push({start:s.at,end:s.at+s.dur,db:t.get(s.part)??0,rank:c});const u=[...new Set(n.flatMap(s=>[s.start,s.end]))].sort((s,c)=>s-c),i=[];for(let s=0;s+1<u.length;s++){const c=u[s]??0,l=u[s+1]??c,d=(c+l)/2;let f;for(const h of n)d<h.start||d>=h.end||(!f||h.rank>f.rank||h.rank===f.rank&&h.start>=f.start)&&(f=h);const m=f?.db??0;i.at(-1)?.db!==m&&i.push({t:c,db:m})}if(i.every(s=>s.db===0))return[];const o=.005,a=[];for(const[s,c]of i.entries()){if(s===0){a.push({t:c.t,db:c.db});continue}const l=i[s-1]?.db??0;a.push({t:Math.max(0,c.t-o),db:l},{t:c.t+o,db:c.db})}return a}function canonical(e){return JSON.stringify(e,(t,n)=>{if(typeof n=="function")return`fn:${String(n)}`;if(typeof n=="object"&&n!==null&&"sha256"in n&&"path"in n&&"url"in n){const r={...n};return delete r.url,delete r.matteUrl,delete r.denoisedUrl,r}return n})}function facade(e){const{env:t,piece:n,stage:r,mounted:u,takes:i,captions:o,footage:a}=e,{drawer:s,measurer:c,embedder:l}=e,{source:d,combo:f,log:m,ledger:h}=t,{fps:g,dims:E,format:D,look:p,prefix:v}=n;let y=!1,A;const b=()=>{if(A)return A;const B={fps:g,width:E.width,height:E.height,...E.profile?{profile:E.profile}:{},duration:e.duration,background:e.background,parts:u.map($=>$.part.title===void 0&&$.record.title!==void 0?{...$.part,title:$.record.title}:$.part),cues:[...e.cues],...a.placed.length>0?{footage:a.placed.map(timelineFootage)}:{},...e.transitions.length>0?{transitions:[...e.transitions]}:{},...a.needs().length>0?{index:a.needs()}:{},audio:e.audio};return y&&(A=B),B};return{kind:"video",get timeline(){return b()},async ready(){await s.ready(),y=!0,A=void 0},seek:(B,$)=>s.draw(B,$),words:()=>o.lines.flatMap(B=>[...B.words]),lines:()=>[...o.lines],captionOptions:()=>o.asked??null,measure:B=>c.measure(B),tracks:(B,$)=>c.tracks(B,$),inks:B=>c.inks(B),objects:B=>c.objects(B,$=>m.keysShowing($)),stuck:()=>s.stuck(),seekLimit:n.seekLimitMs/1e3,setPlaying(B){s.setPlaying(B)},text(){return u.map(B=>{const $=i.results[B.n]??{},k=$.speech,w=$.shown??(k?joinWords(k.words):void 0),I=k?.script??$.say?.text,M=e.notes.get(B.part.key);return{key:B.part.key,onScreen:[...new Set(B.record.onScreen??[])],...M===void 0?{}:{notes:M},...w===void 0?{}:{spoken:w},...I!==void 0&&w!==void 0&&I!==w?{speak:I}:{},...$.speechKey===void 0?{}:{speechKey:$.speechKey}}})},signature:()=>c.signature(),signatureAt:B=>c.signatureAt(B),partSignature:(B,$)=>c.partSignature(B,$),reads(){const B=m.reads(v,u.map(I=>I.part.key)),$=l.loaded.reduce((I,M)=>{const _=M.inner.reads(),F=(N,T)=>[...new Map(N.map(P=>[T(P),P])).values()];return{messages:F([...I.messages,..._.messages],N=>N.key),media:F([...I.media,..._.media],N=>N.path),data:F([...I.data,..._.data],N=>N.path)}},B),k=new Map,w=(I,M)=>{const _=k.get(I)??new Set;_.add(M),k.set(I,_)};for(const I of u)for(const M of I.record.reads.keys())M.startsWith("f:")&&w(M.slice(2),I.part.key);for(const I of u)I.part.speech&&w(I.part.speech.file,I.part.key);for(const I of a.placed)w(I.file,I.part);return{...$,media:$.media.flatMap(I=>{const M=k.get(I.path);return M?.size?[...M].sort().map(_=>({...I,part:_})):[I]})}},says:()=>i.says.map(B=>({...B})),signs(){const B={},$=dimsCombo(d.dims,f),k=e.background;for(const w of u)B[w.part.key]=JSON.stringify({v:1,piece:d.piece,output:t.output,kind:"video",key:w.part.key,slot:w.part.slot??null,pick:w.part.slot===void 0?null:f[w.part.slot]??null,dims:$,format:D,fps:g,size:[E.width,E.height],frames:Math.round((w.part.end-w.part.start)*g),background:k,look:p,layers:w.layers.map(I=>[I.spec.component,I.spec.z??"front",Math.round(I.start*1e6)/1e6,Math.round(I.end*1e6)/1e6,canonical(I.props)]),custom:w.layers.some(I=>I.spec.component==="custom"||I.spec.component==="scenery"),words:e.words(w.n),heard:cuesIn(o.cues(),w.part.start,w.part.end),planes:w.part.planes.map(I=>I.overlay===!0?"overlay":I.behindPerson===!0),stack:w.layers.map(I=>[I.index,I.plane]),reads:[...w.record.reads.entries()].sort((I,M)=>I[0]<M[0]?-1:I[0]>M[0]?1:0)});return B},mixPlan:()=>mixPlan(b(),d.media,{seed:t.seedBase}),problems(){const B=[...h.problems,...l.loaded.flatMap(k=>k.inner.problems().map(w=>({...w,message:`In the video ${k.id}: ${w.message}`}))),...m.problems,...e.timingProblems,...h.run,...r.problems(u),...m.translationProblems()],$=new Set;return B.map(k=>({...k,piece:d.piece,output:t.output,combo:f,format:D})).filter(k=>{const w=`${k.code}|${k.message}|${k.part??""}`;return $.has(w)?!1:($.add(w),!0)})},facts:()=>h.facts.map(B=>({...B,output:t.output,combo:f,format:D})),covers:()=>s.covers(),drawCover:B=>s.drawCover(B),async ask(B,$){const k=[];for(const w of u)for(const I of w.layers){const M=I.answers.get(B);if(M)try{k.push({part:w.part.key,layer:I.spec.component,index:I.index,answer:await M($)})}catch(_){h.ran(problem(codeOf(_),`${I.spec.component} (layer ${String(I.index+1)}) in part ${w.part.key} failed to answer ${String(B)}: ${messageOf(_)}`,{part:w.part.key}))}}return k},dispose(){s.dispose(),r.dispose()}}}var GENERIC=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","math","emoji","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","-apple-system","blinkmacsystemfont","inherit","initial"]),isGeneric=e=>GENERIC.has(e.toLowerCase());function families(e){const t=[];let n="",r="";for(const u of e)r?u===r?r="":n+=u:u==='"'||u==="'"?r=u:u===","?(t.push(n.trim()),n=""):n+=u;return t.push(n.trim()),t.filter(Boolean)}function unicodeRanges(e){const t=[];for(const n of e.split(",")){const r=/^\s*u\+([0-9a-f?]+)(?:-([0-9a-f]+))?\s*$/i.exec(n),u=r?.[1];if(u)if(u.includes("?"))t.push([parseInt(u.replace(/\?/g,"0"),16),parseInt(u.replace(/\?/g,"f"),16)]);else{const i=parseInt(u,16);t.push([i,r[2]?parseInt(r[2],16):i])}}return t}function weightRange(e){const t=o=>o==="bold"?700:o==="normal"?400:Number(o),[n="400",r]=e.trim().split(/\s+/),u=t(n),i=r===void 0?u:t(r);return Number.isFinite(u)&&Number.isFinite(i)?[u,i]:[400,400]}function matchWeight(e,t){if(t.length===0)return;if(t.some(([o,a])=>e>=o&&e<=a))return e;const n=t.filter(([o])=>o>e).map(([o])=>o),r=t.filter(([,o])=>o<e).map(([,o])=>o),u=n.length?Math.min(...n):void 0,i=r.length?Math.max(...r):void 0;return e>500?u??i:e<400?i??u:u!==void 0&&u<=500?u:i??u}var BOLD=600,covers=(e,t)=>e.ranges.length===0||t.some(n=>e.ranges.some(([r,u])=>n>=r&&n<=u));function fontIssue(e,t,n,r){const u=e.families[0];if(u===void 0||isGeneric(u))return;let i;for(const o of e.families){if(isGeneric(o))return i&&{kind:"fallback",...i,usedFamily:o};const a=n.filter(f=>f.family.toLowerCase()===o.toLowerCase());if(a.length===0){if(r(o))return i&&{kind:"fallback",...i,usedFamily:o};i??={family:o,failed:!1};continue}const s=a.filter(f=>covers(f,t));if(s.length===0)continue;const c=s.filter(f=>f.status==="loaded");if(c.length===0){if(s.every(f=>f.status==="error")){i??={family:o,failed:!0};continue}return}if(i)return{kind:"fallback",...i,usedFamily:o};const l=matchWeight(e.weight,c.map(f=>f.weight)),d=Math.max(...c.map(f=>f.weight[1]));return e.weight>=BOLD&&d<BOLD?{kind:"bold",family:o,weight:e.weight,drawn:l??d,faked:e.synthBold}:e.italic&&!c.some(f=>f.slanted)?{kind:"italic",family:o,faked:e.synthItalic}:void 0}return i&&{kind:"fallback",...i,usedFamily:"the browser's default font"}}function drawnFamilies(e,t,n,r){const u=[];for(const i of new Set(t)){let o="the browser's default font";for(const a of e.families){if(isGeneric(a)){o=a;break}const s=n.filter(c=>c.family.toLowerCase()===a.toLowerCase());if(s.length===0?r(a):s.some(c=>c.status==="loaded"&&covers(c,[i]))){o=a;break}}u.includes(o)||u.push(o)}return u}function fontIssueText(e){switch(e.kind){case"fallback":return e.failed?`the font "${e.family}" failed to load, so it is drawn in ${quoteFamily(e.usedFamily)}. Check the @font-face url and that the file is in the workspace.`:`the font "${e.family}" is not loaded, so it is drawn in ${quoteFamily(e.usedFamily)}. Import its stylesheet in the piece (import "@fontsource/<id>/400.css" after npm install @fontsource/<id>, or a .css of @font-face rules), or list it in allyhub.config.ts's fonts for every stage, or use a font the look has (var(--ak-font-display), var(--ak-font-body)).`;case"bold":return e.faked?`"${e.family}" has no face for weight ${String(e.weight)} (the loaded faces stop below ${String(BOLD)}), so Chrome fakes the bold by thickening weight ${String(e.drawn)}. Load a bold face of the font, or use a weight it has.`:`"${e.family}" has no face for weight ${String(e.weight)}, so it is drawn at weight ${String(e.drawn)}. Load a bold face of the font, or use a weight it has.`;case"italic":return e.faked?`"${e.family}" has no italic face, so Chrome fakes the italic by slanting the upright letters. Load an italic face of the font, or drop font-style: italic.`:`"${e.family}" has no italic face, so it is drawn upright. Load an italic face of the font, or drop font-style: italic.`}}var quoteFamily=e=>isGeneric(e)?`the browser's ${e} font`:e.startsWith("the ")?e:`"${e}"`;function stringsOf(e,t=2e3){const n=[],r=new Set,u=i=>{if(!(n.length>=t)){if(typeof i=="string")n.push(i);else if(typeof i=="object"&&i!==null&&!r.has(i)){r.add(i);for(const o of Array.isArray(i)?i:Object.values(i))u(o)}}};return u(e),n}function emojiOf(e){const t=/\p{Extended_Pictographic}|\p{Regional_Indicator}|[\u{1F3FB}-\u{1F3FF}\u{E0020}-\u{E007F}]|\u200d|\ufe0f|\u20e3/gu,n=new Set;for(const r of e)for(const u of r.matchAll(t))n.add(u[0]);return[...n].join("")}var localCache=new Map,measure;function pageFaces(){const e=[];return document.fonts.forEach(t=>{e.push({family:families(t.family)[0]??t.family,weight:weightRange(t.weight),slanted:t.style!=="normal",status:t.status,ranges:unicodeRanges(t.unicodeRange)})}),e}function localFamily(e){const t=localCache.get(e);if(t!==void 0)return t;measure??=document.createElement("canvas").getContext("2d");const n=measure;if(!n)return!0;const r="mmmmmmmmmmlli10WQ@#ÆŒ",u=a=>(n.font=a,n.measureText(r).width),i=JSON.stringify(e),o=["monospace","serif","sans-serif"].some(a=>u(`40px ${i}, ${a}`)!==u(`40px ${a}`));return localCache.set(e,o),o}function fontWant(e){const t=Number(e.fontWeight);return{families:families(e.fontFamily),weight:Number.isFinite(t)?t:400,italic:e.fontStyle!=="normal",synthBold:e.getPropertyValue("font-synthesis-weight")!=="none",synthItalic:e.getPropertyValue("font-synthesis-style")!=="none"}}function codePoints(e){const t=new Set;for(const n of e)for(const r of n)t.add(r.codePointAt(0)??0);return t}function coversAny(e,t){if(e.length===0)return!0;for(const n of t)if(e.some(([r,u])=>n>=r&&n<=u))return!0;return!1}function namedFamilies(e){return families(e).filter(t=>!isGeneric(t)&&!t.startsWith("var(")).map(t=>t.toLowerCase())}function styleSheetFamilies(){const e=new Set,t=n=>{for(const r of Array.from(n))if(r instanceof CSSStyleRule){const u=r.style.getPropertyValue("font-family");if(u)for(const i of namedFamilies(u))e.add(i)}else r instanceof CSSGroupingRule&&t(r.cssRules)};for(const n of Array.from(document.styleSheets))try{t(n.cssRules)}catch{}return e}function propFamilies(e){const t=new Set;document.fonts.forEach(u=>{t.add((families(u.family)[0]??u.family).toLowerCase())});const n=e.map(u=>u.toLowerCase()),r=new Set;for(const u of t)u&&n.some(i=>i.includes(u))&&r.add(u);return r}async function loadFaces(e,t){const n=[];document.fonts.forEach(r=>{if(r.status!=="unloaded")return;const u=(families(r.family)[0]??r.family).toLowerCase();e.has(u)&&coversAny(unicodeRanges(r.unicodeRange),t)&&n.push(r.load().catch(()=>{}))}),await Promise.all(n)}async function loadTextFonts(e){const t=new Map,n=new Map,r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let u=r.nextNode();u;u=r.nextNode()){const i=u.nodeValue??"",o=u.parentElement;if(!o||!i.trim())continue;let a=n.get(o);if(a===void 0){const c=getComputedStyle(o);a=`${c.fontStyle==="normal"?"":"italic "}${c.fontWeight} 40px ${c.fontFamily}`,n.set(o,a)}let s=t.get(a);s||(s=new Set,t.set(a,s));for(const c of i)c.trim()&&s.add(c)}await Promise.all([...t].map(([u,i])=>document.fonts.load(u,[...i].join("")).catch(()=>[])))}var fontRows=new Map,measurer;function rowsOf(e,t){const n=`${e}
70
- ${t}`,r=fontRows.get(n);if(r)return r;if(measurer??=document.createElement("canvas").getContext("2d"),!measurer)return;measurer.font=e;const u=measurer.measureText(t),i={fontUp:u.fontBoundingBoxAscent,fontDown:u.fontBoundingBoxDescent,up:u.actualBoundingBoxAscent,down:u.actualBoundingBoxDescent,left:Math.max(0,u.actualBoundingBoxLeft),right:Math.max(0,u.actualBoundingBoxRight-u.width)};return fontRows.set(n,i),i}function inkOf(e,t,n){const r=n.getClientRects(),u=r.item(0),i=r.item(r.length-1),o=n.getBoundingClientRect(),a=Array.from(r).filter(A=>A.width>0&&A.height>0),s=(a.length>0?a:[o]).map(A=>[A.left,A.top,A.right,A.bottom]),c=getComputedStyle(e),l=parseFloat(c.fontSize)||0;if(!u||!i)return{rows:[o.top,o.bottom],lines:s,size:l};const d={rows:[u.top,i.bottom],lines:s,size:l},f=c.textTransform==="uppercase"?t.toUpperCase():c.textTransform==="lowercase"?t.toLowerCase():t,m=rowsOf(`${c.fontStyle} ${c.fontWeight} ${c.fontSize} ${c.fontFamily}`,f),h=m?m.fontUp+m.fontDown:0;if(!m||h<=0||m.up+m.down<=0)return d;const g=u.height/h,E=u.top+(m.fontUp-m.up)*g,D=i.bottom-(m.fontDown-m.down)*g,p=D>E?[E,D]:[u.top,i.bottom],v=a.map((A,b)=>{const x=A.height/h,B=A.top+(m.fontUp-m.up)*x,$=A.bottom-(m.fontDown-m.down)*x,k=A.left-(b===0?m.left*x:0),w=A.right+(b===a.length-1?m.right*x:0);return $>B?[k,B,w,$]:[k,A.top,w,A.bottom]}),y=/[a-z]/.test(f)?rowsOf(`${c.fontStyle} ${c.fontWeight} ${c.fontSize} ${c.fontFamily}`,"x"):void 0;return{rows:p,lines:v.length>0?v:s,size:l*g,...y&&y.up>0?{xHeight:y.up*g}:{}}}var norm=e=>e.replace(/\u200b/g,"").replace(/\s+/g," ").trim();function opacityOf(e,t){let n=1;for(let r=e;r&&r!==t.parentElement;r=r.parentElement){const u=getComputedStyle(r);if(u.display==="none"||u.visibility==="hidden")return 0;n*=Number(u.opacity)}return n}function inPicture(e,t){const n=e.closest("[data-ak-screen]");if(n!==null&&n!==t&&t.contains(n))return!0;const r=e.closest("[data-ak-picture]");return r!==null&&t.contains(r)}function screenTexts(e,t={}){const n=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let u=r.nextNode();u;u=r.nextNode()){const i=norm(u.textContent??""),o=u.parentElement;if(!i||!o||t.screens===!1&&inPicture(o,e))continue;const a=opacityOf(o,e);if(a<=.05)continue;const s=document.createRange();s.selectNodeContents(u);const c=s.getBoundingClientRect();if(c.width===0&&c.height===0)continue;const l=inkOf(o,i,s);n.push({text:i,el:o,bbox:[c.left,c.top,c.width,c.height],opacity:a,rows:l.rows,lines:l.lines,size:l.size,...l.xHeight===void 0?{}:{xHeight:l.xHeight}})}return n}var CLIPS=new Set(["hidden","clip","scroll","auto"]);function clipped(e,t,n,r){let[u,i,o,a]=e;const s=.5;for(let c=t;c&&c!==n.parentElement;c=c.parentElement){const l=getComputedStyle(c),d=CLIPS.has(l.overflowX),f=CLIPS.has(l.overflowY);if(!d&&!f)continue;const m=c.getBoundingClientRect(),h=(g,E,D)=>r&&(D?g>=E-s:g<=E+s);if(d&&(h(m.left,r?.left??0,!1)||(u=Math.max(u,m.left)),h(m.right,r?.right??0,!0)||(o=Math.min(o,m.right))),f&&(h(m.top,r?.top??0,!1)||(i=Math.max(i,m.top)),h(m.bottom,r?.bottom??0,!0)||(a=Math.min(a,m.bottom))),o<=u||a<=i)return}return[u,i,o,a]}var TRANSPARENT=/^(transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\))$/,ZERO_ALPHA=/[,/]\s*0(\.0+)?\s*\)$/;function paintOf(e){const t=[],n=e.backgroundColor;return(e.backgroundImage!=="none"||!TRANSPARENT.test(n)&&!ZERO_ALPHA.test(n))&&t.push("background"),["Top","Right","Bottom","Left"].some(u=>{const i=e[`border${u}Style`];return i!=="none"&&i!=="hidden"&&parseFloat(e[`border${u}Width`])>0})&&t.push("border"),e.boxShadow!=="none"&&t.push("shadow"),t}function containersOf(e,t,n,r,u){const i=[];for(let o=e;o&&o!==t;o=o.parentElement){const a=getComputedStyle(o);if(CLIPS.has(a.overflowX)&&CLIPS.has(a.overflowY))continue;const s=paintOf(a);if(s.length===0||opacityOf(o,t)<=.05)continue;const c=o.getBoundingClientRect(),l=Math.round((c.left-n.left)*r),d=Math.round((c.top-n.top)*r),f=Math.round((c.right-n.left)*r),m=Math.round((c.bottom-n.top)*r);l<=0&&d<=0&&f>=u[0]&&m>=u[1]||i.push({box:[l,d,f-l,m-d],paint:s})}return i}var CJK_EDGE=/[\u3000-\u9fff\uf900-\uffef]/;function textBlocks(e,t,n){const r=t.getBoundingClientRect(),u=r.width>0?n/r.width:1,i=[n,Math.round(r.height*u)],o=new Map;for(const l of screenTexts(e,{screens:!1})){let d=l.el;for(;d!==e&&d.parentElement&&getComputedStyle(d).display.startsWith("inline");)d=d.parentElement;const[f,m,h,g]=l.bbox,[E,D]=l.rows,p=clipped([f,E,f+h,D],l.el,e),v=Math.max(0,h)*Math.max(0,D-E),y=p&&v>0?Math.min(1,(p[2]-p[0])*(p[3]-p[1])/v):p?1:0,A=l.lines.flatMap(B=>{const $=clipped(B,l.el,e,r);return $?[$]:[]}),b=o.get(d);if(!b){o.set(d,{text:l.text,x0:f,y0:m,x1:f+h,y1:m+g,opacity:l.opacity,...p?{ink:p}:{},shown:y,size:l.size,...l.xHeight===void 0?{}:{xHeight:l.xHeight},glyphs:A,runs:[{el:l.el,opacity:l.opacity,glyphs:A}]});continue}b.glyphs.push(...A),b.runs.push({el:l.el,opacity:l.opacity,glyphs:A});const x=CJK_EDGE.test(b.text.slice(-1))||CJK_EDGE.test(l.text.slice(0,1))?"":" ";b.text+=x+l.text,b.x0=Math.min(b.x0,f),b.y0=Math.min(b.y0,m),b.x1=Math.max(b.x1,f+h),b.y1=Math.max(b.y1,m+g),b.opacity=Math.min(b.opacity,l.opacity),b.shown=Math.min(b.shown,y),b.size=Math.min(b.size,l.size),l.xHeight!==void 0&&(b.xHeight=Math.min(b.xHeight??1/0,l.xHeight)),p&&(b.ink=b.ink?[Math.min(b.ink[0],p[0]),Math.min(b.ink[1],p[1]),Math.max(b.ink[2],p[2]),Math.max(b.ink[3],p[3])]:p)}const a=(l,d,f,m)=>{const h=Math.round((l-r.left)*u),g=Math.round((d-r.top)*u);return[h,g,Math.round((f-r.left)*u)-h,Math.round((m-r.top)*u)-g]},s=l=>Math.round(l*u*100)/100,c=([l,d,f,m])=>[s(l-r.left),s(d-r.top),s(f-l),s(m-d)];return[...o.entries()].map(([l,d])=>({text:d.text,...l.closest("[data-ak-viewport]")?{viewport:!0}:{},box:a(d.x0,d.y0,d.x1,d.y1),opacity:Math.round(d.opacity*1e3)/1e3,ink:d.ink?a(...d.ink):null,shown:Math.round(d.shown*1e3)/1e3,size:Math.round(d.size*u*10)/10,...d.xHeight===void 0?{}:{xHeight:Math.round(d.xHeight*u*10)/10},containers:containersOf(l,e,r,u,i),glyphs:d.glyphs.map(c),runs:d.runs.map(f=>({el:f.el,opacity:f.opacity,glyphs:f.glyphs.map(c)})),el:l}))}var PICTURES=new Set(["img","svg","canvas","video"]);function trackedIn(e){const t=[],n=r=>{const u=r.tagName.toLowerCase(),i=PICTURES.has(u);let o=i?u:void 0;if(!i&&r instanceof HTMLElement){const a=norm(Array.from(r.childNodes).filter(s=>s.nodeType===Node.TEXT_NODE).map(s=>s.textContent??"").join(" "));a?o=`text ${JSON.stringify(short(a))}`:paintOf(getComputedStyle(r)).length>0&&(o="box")}if(o!==void 0){const a=r instanceof HTMLElement?opacityOf(r,e):r.parentElement?opacityOf(r.parentElement,e)*Number(getComputedStyle(r).opacity):1;if(a>.05){const s=r instanceof HTMLElement||r instanceof SVGElement?r.dataset.ak:void 0;t.push({el:r,what:o,opacity:Math.round(a*1e3)/1e3,...s?{name:s}:{}})}}if(!i)for(const a of Array.from(r.children))n(a)};for(const r of Array.from(e.children))n(r);return t}function selectorOf(e,t){const n=[];for(let r=e;r&&r!==t;r=r.parentElement){const u=r instanceof HTMLElement||r instanceof SVGElement?r.dataset:{},i=u.key;if(i!==void 0&&r.classList.contains("ak-part")){n.unshift(`section[data-key="${i}"]`);break}const o=u.ak;if(o!==void 0){n.unshift(`[data-ak="${o}"]`);continue}const a=r.parentElement,s=a?Array.from(a.children).indexOf(r)+1:1;n.unshift(`${r.tagName.toLowerCase()}:nth-child(${String(s)})`)}return n.join(" > ")}var short=e=>e.length>40?`${e.slice(0,40)}…`:e,inkCanvas,tofuInk=new Map,glyphMissing=new Map;function ink(e,t){inkCanvas??=Object.assign(document.createElement("canvas"),{width:64,height:64}).getContext("2d",{willReadFrequently:!0});const n=inkCanvas;return n?(n.clearRect(0,0,64,64),n.font=e,n.textBaseline="middle",n.fillText(t,4,32),n.getImageData(0,0,64,64).data.join(",")):""}function missingGlyphs(e,t){const n=getComputedStyle(e),r=`${n.fontStyle} ${n.fontWeight} 40px ${n.fontFamily}`;let u=tofuInk.get(r);u===void 0&&(u=ink(r,"􏿽"),tofuInk.set(r,u));const i=[];for(const o of new Set(Array.from(t.replace(/\s/g,"")))){const a=`${r}|${o}`;let s=glyphMissing.get(a);s===void 0&&(s=ink(r,o)===u,glyphMissing.set(a,s)),s&&i.push(o)}return i}function inspectFrame(e){const{part:t,t:n,section:r,stage:u}=e,i=[],o=new Set,a=new Set;let s;for(const c of screenTexts(r)){const l=p=>{const v=e.keysShowing(c.text);return{selector:selectorOf(c.el,u),bbox:p.map(y=>Math.round(y)),...v.length>0?{file:e.messagesFile}:{}}},d=e.keysShowing(c.text),f=d.length>0?`Shorten the text (${d.join(", ")})`:"Shorten the text",m=c.el.closest("[data-ak-viewport]")!==null,h=getComputedStyle(c.el);if((h.overflowX!=="visible"||h.overflowY!=="visible")&&!inPicture(c.el,r)&&!o.has(c.el)&&(c.el.scrollWidth>c.el.clientWidth+1||c.el.scrollHeight>c.el.clientHeight+1)&&(o.add(c.el),i.push(problem("AK-L002",`Text is cut off: "${short(c.text)}" does not fit its box. ${f}.`,{part:t,t:n,where:l(c.bbox)}))),!m){const p=missingGlyphs(c.el,c.text);p.length>0&&i.push(problem("AK-L003",`No font can draw ${p.map(v=>`"${v}" (U+${(v.codePointAt(0)??0).toString(16).toUpperCase().padStart(4,"0")})`).join(", ")} in "${short(c.text)}": they will show as boxes. Replace these characters, or add a font that supports them to the style.`,{part:t,t:n,where:l(c.bbox)}))}const E=fontWant(h),D=`${h.fontFamily}|${String(E.weight)}|${h.fontStyle}`;if(!a.has(D)){s??=pageFaces();const p=Array.from(c.text.replace(/\s/g,"")).map(y=>y.codePointAt(0)??0),v=fontIssue(E,p,s,localFamily);v&&(a.add(D),i.push(problem("AK-L006",`"${short(c.text)}": ${fontIssueText(v)}`,{part:t,t:n,where:l(c.bbox)})))}}return i}var TITLE_MAX=40;function partTitles(e){const t=[...e.values()],n=new Set;if(t.length>1)for(const{text:u}of t[0]??[])t.every(i=>i.some(o=>o.text===u))&&n.add(u);const r=new Map;for(const[u,i]of e){const o=i.filter(s=>!n.has(s.text));let a=(o.length?o:i)[0];for(const s of o)a&&s.size>a.size&&(a=s);a&&r.set(u,a.text.length>TITLE_MAX?`${a.text.slice(0,TITLE_MAX)}…`:a.text)}return r}var STUCK_WAIT=1e3,newDrawState=()=>({mode:"picture",plane:void 0});function withLayout(e,t){const n=e.mode;e.mode="layout";try{return t()}finally{e.mode=n}}var drawnAt=new WeakMap,settled2=e=>Math.max(0,e-.4);function createDrawer(e){const{env:t,piece:n,stage:r,mounted:u,transitions:i,clips:o,state:a}=e,{guards:s,log:c,ledger:l,embed:d,options:f,seedBase:m,partSeed:h}=t,{fps:g,look:E,dims:D,format:p,seekLimitMs:v}=n,y=e.covers,A=e.transitionStage;let b,x=[],B,$,k=!1,w=!1;const I=S=>`${m}:${String(Math.round(S*g))}`,M=(S,H,R)=>{const G=S.part,te=(a.plane===void 0||H.plane===a.plane)&&R>=H.start&&R<H.end;if(showLayer(H.el,te),!te)return;const ae=l.running;l.running={part:G.key,layer:H.spec.component,index:H.index,t:G.start+R,what:`${H.spec.component} (layer ${String(H.index+1)}) in part ${G.key}`},drawnAt.set(H.el,{by:H.spec.component==="custom"?`custom@${n.writtenIn}`:H.spec.component,t:R});try{consoleAt({phase:"render",part:G.key,layer:H.spec.component,index:H.index,t:R},()=>{H.spec.render(H.el,R,H.props,H.ctx)})}catch(re){l.ran(problem(codeOf(re),`${H.spec.component} (layer ${String(H.index+1)}) in part ${G.key} failed while drawing: ${messageOf(re)}`,{part:G.key,t:G.start+R}))}finally{l.running=ae}},_=(S,H)=>{r.styles&&(r.styles.part=S.part.key),c.tap=(R,G)=>S.record.reads.set(R,G);try{for(const R of S.layers)M(S,R,H)}finally{r.styles&&(r.styles.part=void 0),c.tap=void 0}},F=S=>{for(const H of x)S.includes(H)||showLayer(H.el,!1);for(const H of S)showLayer(H.el,!0);x=S},N=(S,H,R)=>{const G=heldTime(S.part,H,g),X=G+R;s.setMoment(X-S.part.start,h(S.part.key,Math.round((G-S.part.start)*g))),showLayer(S.el,!1),S.el.getBoundingClientRect(),showLayer(S.el,!0),_(S,X-S.part.start),s.flushFrames()};async function T(S,H={}){if(w)return;const R=a.mode;a.mode=H.mode??"picture",a.plane=H.plane;try{await P(S,H.offset??0,H.part)}finally{a.mode=R}}async function P(S,H,R){const G=toFrame(Math.min(Math.max(S,0),e.duration-1/g),g),X=Math.min(Math.max(H,0),(1-1e-6)/g),te=G+X,ae=R===void 0?void 0:u.find(O=>O.part.key===R),re=ae?void 0:transitionAt(i,G,g),Ee=re&&u.find(O=>O.part.key===re.from),ve=re&&u.find(O=>O.part.key===re.part);if(re&&Ee&&ve&&A)F([Ee,ve]),b=G<ve.part.start?Ee:ve,N(Ee,G,X),N(ve,G,X),A.place(re,Ee,ve,G);else{const O=ae??u.find(L=>te>=L.part.start&&te<L.part.end)??u.at(-1);F(O?[O]:[]),b=O,A?.hideVeil(),O?(A?.rest(O),N(O,G,X)):(s.setMoment(te,I(G)),s.flushFrames())}const ue=B===void 0||Math.abs(te-B)>.5;B=te,o.draw(te,ue);const se=k?Math.min(v,STUCK_WAIT):v,j=realNow(),U=await l.settle(se);if(U.push(...(await r.picturesDrawn(se-(realNow()-j))).map(O=>`the picture ${O} to decode`)),$=void 0,U.length>0){k=!0;const O=b?.part.key;$=`Drawing ${O===void 0?"a moment":`part ${O}`} did not finish in ${String(se/1e3)} s (video({ seekLimit }) sets it): it was still waiting for ${U.join("; ")}. It was not waited for again, so the frame may show the moment before.`,l.ran(problem("AK-P003",$,{...O===void 0?{}:{part:O},t:te}))}await Promise.resolve()}async function V(){const S=[...c.texts].join(" ").slice(0,2e4)||"Aa",H=new Set([E.font.display,E.font.body].flatMap(re=>re.split(",")).map(re=>re.trim()).filter(re=>re.startsWith('"'))),R=[];for(const re of H)for(const Ee of[400,700])R.push(document.fonts.load(`${String(Ee)} 40px ${re}`,S).catch(()=>[]));const G=u.flatMap(re=>re.layers.flatMap(Ee=>stringsOf(Ee.props))),X=new Set(namedFamilies(E.font.emoji)),te=new Set([...[E.font.display,E.font.body,E.font.mono].flatMap(namedFamilies),...styleSheetFamilies(),...propFamilies(G)].filter(re=>!X.has(re)));R.push(loadFaces(te,codePoints([S,...G])));const ae=emojiOf([...c.texts,...G]);ae&&R.push(document.fonts.load(`400 40px ${E.font.emoji}`,ae).catch(()=>[])),await Promise.all(R),await document.fonts.ready}async function Z(){d||consoleParts(u.map(ue=>ue.part.key)),await l.timed("loading fonts",V);for(const ue of u){showLayer(ue.el,!0),s.setMoment(0,h(ue.part.key,0)),r.styles&&(r.styles.part=ue.part.key),c.tap=(se,j)=>ue.record.reads.set(se,j);for(const se of ue.layers){showLayer(se.el,!0),l.doing=`${se.spec.component} in part ${ue.part.key}`;const j=realNow();l.running={part:ue.part.key,layer:se.spec.component,index:se.index,what:`${se.spec.component} (layer ${String(se.index+1)}) in part ${ue.part.key}, mounting`};try{consoleAt({phase:"mount",part:ue.part.key,layer:se.spec.component,index:se.index},()=>{se.spec.mount(se.el,se.props,se.ctx)}),l.times.push({what:`mounting ${l.doing}`,ms:realNow()-j})}catch(U){l.ran(problem(codeOf(U),`${se.spec.component} (layer ${String(se.index+1)}) in part ${ue.part.key} failed while mounting: ${messageOf(U)}`,{part:ue.part.key}))}finally{l.running=void 0}showLayer(se.el,!1)}c.tap=void 0,r.styles&&(r.styles.part=void 0),showLayer(ue.el,!1)}b=void 0,x=[];const S=LOAD_WAITS*v,H=realNow(),R=await l.settle(S),G=Array.from(r.el.querySelectorAll("img")),X=await within2(G.map(ue=>ue.decode().then(()=>ue.currentSrc||ue.src,()=>ue.currentSrc||ue.src)),S-(realNow()-H)),te=G.filter((ue,se)=>X[se]===void 0).map(ue=>`the picture ${ue.getAttribute("src")??""} to decode`);R.length+te.length>0&&l.ran(problem("AK-P003",`Loading did not finish in ${String(S/1e3)} s (${String(LOAD_WAITS)} × video({ seekLimit })): it was still waiting for ${[...R,...te].join("; ")}. It was not waited for again.`)),await loadTextFonts(r.el),await document.fonts.ready;const ae=new Map;l.doing=void 0;for(const ue of u){l.doing=`part ${ue.part.key}'s still`,await l.timed(`drawing ${l.doing}`,()=>T(ue.part.still,{part:ue.part.key}));const se=screenTexts(ue.el,{screens:!1});ue.record.onScreen=se.map(j=>j.text),ae.set(ue.part.key,se),f.purpose==="check"&&l.run.push(...inspectFrame({part:ue.part.key,t:ue.part.still,section:ue.el,stage:r.el,format:p,messagesFile:c.file,width:D.width,height:D.height,keysShowing:j=>c.keysShowing(j)}))}const re=partTitles(ae);for(const ue of u){const se=re.get(ue.part.key);ue.part.title===void 0&&se!==void 0&&(ue.record.title=se)}l.doing=void 0,await l.timed("decoding the stage's pictures",()=>r.sweep()),l.loading=!1;const Ee=realNow()-t.start,ve=n.loadLimitMs;if(Ee>ve&&!d){const ue=[...l.times].sort((se,j)=>j.ms-se.ms).slice(0,3).map(se=>`${se.what} ${(se.ms/1e3).toFixed(1)} s`);l.run.push(problem("AK-P002",`Loading took ${(Ee/1e3).toFixed(1)} seconds (the limit is ${String(ve/1e3)} seconds; video({ loadLimit }) sets it). The longest: ${ue.join("; ")}.`))}}return{state:a,get current(){return b},ready:Z,draw:T,forLayout:S=>withLayout(a,S),stuck:()=>$,covers:()=>y.map(S=>({key:S.key,layers:layerNames(S.layers)})),async drawCover(S){const H=y[S];if(!H)throw new LoadFailure("no_cover",`There is no cover ${String(S)}.`);F([]),b=void 0,A?.hideVeil();const R=document.createElement("section");R.className="ak-part ak-cover",Object.assign(R.style,{position:"absolute",inset:"0",overflow:"hidden"}),r.el.append(R);const G=H.dur??n.defaults.dur,X=ae=>numericRef(ae)??0,te=typeof H.still=="function"?H.still(G):H.still===void 0?settled2(G):X(H.still);s.setMoment(te,`${m}:cover:${String(S)}`);for(const[ae,re]of H.layers.entries()){if(re.__allyhubLayer==="footage")continue;const[Ee,ve]=windowOf(re,G,X);if(te<Ee||te>=ve)continue;const ue=document.createElement("div");ue.className="ak-layer",Object.assign(ue.style,{position:"absolute",inset:"0"}),R.append(ue);const se=re.times?resolveTimes(re.props,re.times,X):re.props,j=e.contexts({dur:G,words:()=>[],at:X,start:Ee,end:ve});consoleAt({phase:"cover",part:H.key,layer:re.component,index:ae,t:te},()=>{re.mount(ue,se,j),re.render(ue,te,se,j)})}await loadTextFonts(R),await document.fonts.ready},setPlaying(S){o.setPlaying(S)},dispose(){w=!0,o.dispose()}}}async function coverParts(e,t){if(!e.options.covers)return[];const n=await e.options.covers(t);return Array.isArray(n)?n.filter(isPartSpec):[]}var painter,colours=new Map;function rgbaOf(e){const t=colours.get(e);if(t||colours.has(e))return t;painter??=Object.assign(document.createElement("canvas"),{width:1,height:1}).getContext("2d",{willReadFrequently:!0});let n;if(painter){painter.clearRect(0,0,1,1),painter.fillStyle="rgba(0,0,0,0)",painter.fillStyle=e,painter.fillRect(0,0,1,1);const[r=0,u=0,i=0,o=0]=painter.getImageData(0,0,1,1).data;n=[r,u,i,Math.round(o/255*1e3)/1e3]}return colours.set(e,n),n}function fillOf(e){const t=getComputedStyle(e),r=e instanceof SVGElement?t.fill.startsWith("url(")||t.fill==="none"?"":t.fill:t.webkitTextFillColor||t.color;if(!r)return;const u=rgbaOf(r);return u&&u[3]>0?u:void 0}function inkOfBlock(e,t){const n=[];let r=!1,u=!1;for(const c of e.runs){const l=fillOf(c.el);for(const f of c.glyphs)n.push({box:f,...l?{fill:l}:{},opacity:Math.round(c.opacity*1e3)/1e3});const d=getComputedStyle(c.el);d.textShadow!=="none"&&d.textShadow!==""&&(r=!0),parseFloat(d.webkitTextStrokeWidth||"0")>0&&(u=!0)}const i=e.runs[0]?.el??e.el,o=getComputedStyle(i),a=i.getBoundingClientRect(),s=i.offsetHeight>0&&a.height>0?a.height/i.offsetHeight:1;return{lines:n,size:Math.round(parseFloat(o.fontSize)*s*t*10)/10,weight:Number(o.fontWeight)||400,...r?{shadow:!0}:{},...u?{stroke:!0}:{}}}var MOMENTS_PER_PART=24,MEASURE_EVERY=1;function domHash(e){let t=2166136261,n=5381;for(let r=0;r<e.length;r++){const u=e.charCodeAt(r);t=Math.imul(t^u,16777619)>>>0,n=Math.imul(n,33)+u>>>0}return`${t.toString(16)}${n.toString(16)}:${String(e.length)}`}async function sha256Hex(e){const t=globalThis.crypto?.subtle;if(!t)return`dom:${domHash(e)}`;const n=new Uint8Array(await t.digest("SHA-256",new TextEncoder().encode(e)));let r="";for(const u of n)r+=u.toString(16).padStart(2,"0");return r}function textReader(e,t,n,r){const{guards:u,partSeed:i}=e,{fps:o,dims:a}=t,s=new WeakMap;return({part:c,el:l},d,f)=>{const m=Math.round(f*o),h=m/o,g=[];for(const E of d){if(h<E.start||h>=E.end)continue;let D=s.get(E);D||(D=new Map,s.set(E,D));let p=D.get(m);if(!p){const v=layerShown(l),y=layerShown(E.el),A=l.style.transform;l.style.transform="",showLayer(l,!0),showLayer(E.el,!0),u.setMoment(h,i(c.key,m));try{consoleAt({phase:"render",part:c.key,layer:E.spec.component,index:E.index,t:h},()=>{r(()=>{E.spec.render(E.el,h,E.props,E.ctx)})}),p=textBlocks(E.el,n.el,a.width).map(b=>({layer:E.spec.component,text:b.text,box:b.box}))}catch{p=[]}finally{showLayer(E.el,y),showLayer(l,v),l.style.transform=A,u.setMoment(0,i(c.key,0))}D.set(m,p)}g.push(...p)}return g}}function measurer2(e){const{piece:t,stage:n,drawer:r,mounted:u,duration:i,captions:o,footage:a}=e,{fps:s,dims:c,format:l}=t,d=n.el,f=(D,p)=>r.draw(D,{mode:"layout",...p===void 0?{}:{part:p}}),m=D=>toFrame(Math.min(Math.max(D,0),i-1/s),s),h=()=>{const D=[];for(const p of u){const{part:v}=p,y=new Set,A=x=>{const B=toFrame(x,s);B>=v.start&&B<v.end&&y.add(B)};A(v.still);for(const x of p.layers)x.end>x.start&&A(v.start+(x.start+x.end)/2);if(p.record.captioned)for(const x of cuesIn(o.cues(),v.start,v.end))A(v.start+(x.start+x.end)/2);if(a?.speakerIn(v.key))for(let x=v.start+.5;x<v.end;x+=1)A(x);for(let x=v.start+MEASURE_EVERY;x<v.end;x+=MEASURE_EVERY)A(x);A(v.end-1/s);let b=[...y].sort((x,B)=>x-B);if(b.length>MOMENTS_PER_PART){const x=b.length/MOMENTS_PER_PART,B=b.at(-1)??0;b=Array.from({length:MOMENTS_PER_PART},($,k)=>b[Math.floor(k*x)]??0),b[b.length-1]=B}D.push(...b)}return[...new Set(D)].sort((p,v)=>p-v)},g=async()=>{const D=READ_DEFAULTS,p=[];for(const v of u){const{part:y}=v,A=new Map,b=y.end-1/s;for(let x=0;;x++){const B=toFrame(y.start+x*D.every,s);if(B>b+1e-9)break;await f(B,y.key);const $=r.current;if($){for(const k of $.layers)if(layerShown(k.el))for(const w of textBlocks(k.el,d,c.width)){if(w.ink===null||w.viewport)continue;let I=A.get(w.el);I||(I={layer:k.spec.component,z:k.z,samples:[]},A.set(w.el,I)),I.samples.push({t:Math.round(B*1e3)/1e3,text:w.text,box:w.box,opacity:w.opacity,shown:w.shown,size:w.size,...w.xHeight===void 0?{}:{xHeight:w.xHeight}})}}}for(const x of A.values()){const B=textTime(x.samples,{part:y.key,layer:x.layer,z:x.z,end:y.end,frame:[c.width,c.height]},D);B&&p.push(B)}}return p.sort((v,y)=>v.first-y.first),{options:D,texts:p}},E=()=>{let D="";for(const p of d.children){if(p instanceof HTMLElement&&!layerShown(p))continue;const v="canvas:not([data-ak-sign]), video, iframe, img[src$='.gif' i]";if(p.matches(v)||p.querySelector(v))return;D+=p.outerHTML}return domHash(D)};return{async measure(D){const p=[],v=D?[...D].sort((b,x)=>b-x):h();for(const b of v){const x=m(b),B=u.find(T=>x>=T.part.start&&x<T.part.end);await f(b,B?.part.key);const $=r.current;if(!$)continue;const k=[],w=[],I=[],M=[],_=[],F=pageFaces();$.layers.forEach((T,P)=>{if(layerShown(T.el))for(const V of textBlocks(T.el,d,c.width)){if(V.ink===null)continue;const Z=V.runs[0]?.el,S=Z&&drawnFamilies(fontWant(getComputedStyle(Z)),Array.from(V.text.replace(/\s/gu,"")).map(H=>H.codePointAt(0)??0),F,localFamily);k.push({layer:T.spec.component,z:T.z,text:V.text,box:V.box,...V.viewport?{viewport:!0}:{},...V.opacity<1?{opacity:V.opacity}:{},...V.ink.join()===V.box.join()?{}:{ink:V.ink},...S&&S.length>0?{fonts:S}:{}}),w.push(P),I.push(V.containers),M.push(V.ink),_.push(V.glyphs)}});const N=a?.faceAt($.part.key,x);p.push(measureMoment({t:Math.round(x*1e3)/1e3,part:$.part.key,texts:k,...N?{face:N.map(T=>Math.round(T))}:{},safe:c.safe,width:c.width,height:c.height,owner:w,containers:I,seen:M,glyphs:_}))}const y=(formatInfo(l)?.width??c.width)/c.width,A=(a?.placed??[]).flatMap(b=>{const x=footageScale(b,y,s);return x?[x]:[]});return{width:c.width,height:c.height,safe:c.safe,moments:p,footage:A,...D?{}:{reading:await g()}}},async tracks(D,p){const v=[],y=Math.max(0,Math.ceil(D*s-1e-6)),A=Math.min(Math.floor(p*s+1e-6),Math.round(i*s)-1),b=()=>d.getBoundingClientRect();for(const x of u){const{part:B}=x,$=Math.max(y,Math.round(B.start*s)),k=Math.min(A,Math.round(B.end*s)-1);if(k<$)continue;const w=new Map;for(let I=$;I<=k;I++){const M=I/s;await f(M,B.key);const _=r.current;if(!_)continue;const F=b(),N=F.width>0?c.width/F.width:1,T=new Map;for(const P of _.layers)if(layerShown(P.el))for(const V of trackedIn(P.el)){const Z=V.el.getBoundingClientRect();if(Z.width<=0||Z.height<=0)continue;const S=Math.round((Z.left-F.left)*N),H=Math.round((Z.top-F.top)*N);if(T.set(V.el,{t:Math.round(M*1e3)/1e3,box:[S,H,Math.round((Z.right-F.left)*N)-S,Math.round((Z.bottom-F.top)*N)-H],opacity:V.opacity}),!w.has(V.el)){const R={part:B.key,layer:P.spec.component,what:V.what,selector:selectorOf(V.el,d),...V.name===void 0?{}:{name:V.name},samples:Array.from({length:I-$},(G,X)=>({t:Math.round(($+X)/s*1e3)/1e3,opacity:0}))};w.set(V.el,R),v.push(R)}}for(const[P,V]of w)V.samples.push(T.get(P)??{t:Math.round(M*1e3)/1e3,opacity:0})}}return v},async inks(D){const p=m(D),v=u.find(B=>p>=B.part.start&&p<B.part.end);await r.draw(D,v?{part:v.part.key}:{});const y=r.current;if(!y)return[];const A=d.getBoundingClientRect(),b=A.width>0?c.width/A.width:1,x=[];for(const B of y.layers)if(layerShown(B.el))for(const $ of textBlocks(B.el,d,c.width))$.ink!==null&&x.push({text:{layer:B.spec.component,z:B.z,text:$.text,box:$.box,...$.viewport?{viewport:!0}:{},...$.opacity<1?{opacity:$.opacity}:{},...$.ink.join()===$.box.join()?{}:{ink:$.ink}},...inkOfBlock($,b)});return x},async objects(D,p){const v=m(D),y=u.find(x=>v>=x.part.start&&v<x.part.end);await r.draw(D,y?{part:y.part.key}:{});const A=r.current,b={t:D,elements:[],texts:[]};if(!A)return b;for(const x of A.layers)if(layerShown(x.el))for(const B of textBlocks(x.el,d,c.width))B.ink!==null&&b.texts.push({text:B.text,box:[B.box[0],B.box[1],B.box[2],B.box[3]],size:B.size,keys:p(B.text)});return b},signature:E,async signatureAt(D){return await f(D,void 0),E()},async partSignature(D,p){const v=new Set,y=[],A="video, iframe, img[src$='.gif' i]";for(const b of p){await f(b,D);let x="";const B=[];try{for(const $ of d.children){if($ instanceof HTMLElement&&!layerShown($))continue;const k=$.matches(A)?$:$.querySelector(A);if(k)return{unknown:`a <${k.tagName.toLowerCase()}> at ${b.toFixed(3)} s`};const w=[...$.matches("canvas:not([data-ak-sign])")?[$]:[],...$.querySelectorAll("canvas:not([data-ak-sign])")];for(const I of w){let M=I,_;for(;M&&M!==d&&!_;)_=drawnAt.get(M),_||(M=M.parentElement);if(!_||!M)return{unknown:`a canvas outside any layer at ${b.toFixed(3)} s`};layerShown(M)&&(I.setAttribute("data-ak-drawn",`${_.by} at ${String(Math.round(_.t*1e6)/1e6)}`),B.push(I),v.add(_.by))}x+=$.outerHTML}}finally{for(const $ of B)$.removeAttribute("data-ak-drawn")}y.push(await sha256Hex(x))}return{sign:await sha256Hex(y.join(`
71
- `)),owners:[...v].sort()}}}}var round64=e=>Math.round(e*1e6)/1e6;function musicClock(e,t){const{source:n,lang:r,ledger:u}=e,{options:i}=t,o=i.music===void 0?void 0:typeof i.music=="string"||"path"in i.music?{file:i.music}:i.music,a=o?.file===void 0?void 0:typeof o.file=="string"||"path"in o.file?o.file:r===void 0?void 0:o.file[r],s=a===void 0?void 0:e.mediaOf(a,t.musicBase),c=o??{},l=Math.max(0,c.from??0),d=s?.tempo,f=c.bpm!==void 0?{bpm:c.bpm,source:"given"}:d?{bpm:d.bpm,source:"measured",confidence:d.confidence,beat:d.beat}:void 0,m=()=>s&&s.sha256!==""?{file:s.path}:{},h=o!==void 0&&c.snap===!0&&!!f,g=h?60/f.bpm:0,E=f?.beat??0,D=g>0?(E-l)%g:0;o!==void 0&&c.snap===!0&&!f&&u.facts.push(fact("fallback",{piece:n.piece},{...m(),missing:"tempo",for:"snap",fallback:"not-snapped"}));const p=musicGrid(f,{meter:c.meter,downbeat:c.downbeat}),v=s?.duration,y=c.loop,A=[...c.play??[],...typeof y=="object"?[y]:[]],b=F=>{u.facts.push(fact("fallback",{piece:n.piece},{...m(),missing:"tempo",for:F,fallback:F==="music-play"?"played-once":"film-end"}))};o!==void 0&&!p&&(A.some(F=>onGrid(F.from)||onGrid(F.to))&&b("music-play"),(c.end==="bar"||c.end==="beat")&&b("music-end"));const x=F=>{const N=musicSeconds(F.from,p),T=musicSeconds(F.to,p);return N===void 0||T===void 0?void 0:{from:N,to:T}},B=typeof y=="object"?x(y):void 0,$=c.play?.map(x),k=($?.some(F=>F===void 0)??!1)||typeof y=="object"&&B===void 0,w=!k&&($!==void 0||B!==void 0),I=F=>{if(!(v===void 0||v<=0)){if(k)return placeStretches([{from:l,to:v}],void 0,v,F);if(w){const N=$?.flatMap(T=>T?[T]:[])??(B?[{from:l,to:B.to}]:[]);return placeStretches(N,B,v,F)}return c.loop===!0?wholeLoop(l,v,F,c.seam):placeStretches([{from:l,to:v}],void 0,v,F)}},M=F=>{if(o===void 0)return;const N=F.duration,T=(c.gain??[]).flatMap((S,H)=>{const R=F.momentAt(S.at,`music.gain[${String(H)}].at`);return R===void 0?[]:[{t:round64(R),db:S.db}]}),P=c.filter!==void 0||c.eq!==void 0||c.compress!==void 0?{...c.filter===void 0?{}:{filter:c.filter},...c.eq===void 0?{}:{eq:c.eq.map((S,H)=>{const{keys:R,...G}=S,X=(R??[]).flatMap((te,ae)=>{const re=F.momentAt(te.at,`music.eq[${String(H)}].keys[${String(ae)}].at`);return re===void 0?[]:[{...te,at:round64(re)}]});return X.length>0?{...G,keys:X}:G})},...c.compress===void 0?{}:{compress:c.compress}}:void 0,V=w?I(N):void 0;let Z;if(p&&(c.end==="bar"||c.end==="beat")){const S=I(N),H=S?filmBeats(S,p,c.end):[],R=S?.at(-1);if(R&&!c.loop){const X=c.end==="bar"?p.beat*p.meter:p.beat,te=c.end==="bar"?p.downbeat:p.first,ae=(R.to-te)/X;Math.abs(ae-Math.round(ae))<1e-6&&H.push(R.at+R.to-R.from)}const G=[...H].reverse().find(X=>X>1e-6&&X<=N+1e-6);G!==void 0&&(Z=round64(G))}return{...s&&s.sha256!==""?{file:s.path}:{},from:V?.[0]?.from??l,loop:c.loop===!0||B!==void 0,...f?{tempo:f}:{},snapped:h,...V?{play:V.map(S=>({at:round64(S.at),from:round64(S.from),to:round64(S.to)})),seam:c.seam??MUSIC_DEFAULTS.seam}:c.seam===void 0?{}:{seam:c.seam},...p?{meter:p.meter,downbeat:round64(p.downbeat)}:{},...Z===void 0?{}:{until:Z},...T.length>0?{gain:T}:{},...P?{shape:P}:{}}};return{music:o,media:s,snapped:h,beat:g,beatPhase:D,grid:p,snapTo(F){if(!h||!p)return;const N=F.reduce((V,Z)=>V+(Z.speechDur!==void 0?Z.lead+Z.speechDur+Z.tail:Z.dur)+2*p.beat,0)+10,T=I(N);if(!T)return;const P=filmBeats(T,p);return(V,Z)=>beatNear(P,p.beat,V,Z)},plan:F=>M(F)}}var DECK_VIDEOS="__allyhubVideos";function loadStyles(e){return Promise.all(e.map(t=>new Promise(n=>{const r=document.createElement("link");r.rel="stylesheet",r.href=t,r.onload=()=>{n()},r.onerror=()=>{n()},document.head.append(r)})))}async function definition(e){const{source:t,embed:n,ledger:r}=e;let u=n?.def;const i={};if(!n){let o;try{await loadStyles(t.styles??[]),o=await r.timed("importing the piece's module",()=>consoleAtAsync({phase:"module"},()=>import(t.module)))}catch(s){const c=s instanceof Error?s:new Error(String(s));throw new LoadFailure("load_failed",`Failed to load the piece module: ${c.message}
72
- ${c.stack??""}`)}u=o.default;const a=o[DECK_VIDEOS];if(typeof a=="object"&&a!==null)for(const[s,c]of Object.entries(a))isPieceDefinition(c)&&(i[s]=c)}if(!isPieceDefinition(u))throw new LoadFailure("no_content",`The default export of ${t.file} is not a video({ … }).`);return{def:u,videos:i}}async function resolvePiece(e){const{source:t,log:n}=e,{def:r,videos:u}=await definition(e),i=outputOf(r),o=r.written?.file,a=o!==void 0&&o!==""?o:t.file;a!==t.file&&n.relativeTo(a);const s=i.kind;if(s!=="video")throw new LoadFailure("bad_output",`${t.piece} is ${s}; load() loads a video (a deck is the deck's runtime's).`);const c=i.options,l=parseFps(c.fps)??FPS;if(!isVideoFormat(t.format))throw new LoadFailure("bad_format",`${t.piece} is not rendered in ${t.format}: it is not a format.`);const d=t.format,f=formatEntry(r.format===void 0?[]:[r.format],d)??d,m=formatInfo(f)??presetInfo("16x9"),h=messagePrefix(t.piece),g=c.look??"clean";return{def:r,options:c,fps:l,format:d,dims:m,prefix:h,look:t.looks?.[g]??CLEAN_LOOK,defaults:partDefaults(t.partDefaults,c.defaults?.part),writtenIn:a,musicBase:r.written?.paths?.music?.[1]??a.split("/").slice(0,-1).join("/"),seekLimitMs:(c.seekLimit??SEEK_LIMIT)*1e3,loadLimitMs:(c.loadLimit??LOAD_LIMIT)*1e3,videos:u}}function pieceContext(e,t){const{log:n,combo:r,space:u}=e,i=Object.assign((o,a)=>n.s(o,a),{list:(o,a)=>n.list(o,a),with:(o,a,s)=>n.with(o,a,s)});return{combo:r,pool:o=>{const a=u?.slots[o]?.find(s=>s.name===r[o]);if(a?.file===void 0)throw new LoadFailure("bad_pool",`ctx.pool("${o}"): ${o} is not a pool slot of this piece${u?` (pool slots: ${Object.entries(u.slots).filter(([,s])=>s.some(c=>c.file!==void 0)).map(([s])=>s).join(", ")||"none"})`:""}. Declare it as matrix.slots.${o} = { pool: "./folder" }.`);return`/${a.file}`},s:i,asset:o=>n.asset(o),data:o=>n.readData(o),look:t.look}}async function buildParts(e,t,n){const{source:r,ledger:u}=e,i="part",o=outputOf(t.def),a=await consoleAtAsync({phase:"build"},()=>Promise.resolve(o.build(n)));if(!Array.isArray(a)||a.length===0)throw new LoadFailure("no_parts",`The function of output ${e.output} returned no ${i}s (AK-K003).`);const s=[],c=new Set;for(const[l,d]of a.entries()){if(!isPartSpec(d))throw new LoadFailure("bad_part",`Item ${String(l+1)} is not a ${i} made by part({ key, layers }).`);const f=d.layers.findIndex(m=>!isLayerSpec(m));if(f>=0)throw new LoadFailure("bad_part",`Layer ${String(f+1)} of ${i} ${d.key} is not a layer made by footage(), a component or custom().`);if(d.speech!==void 0&&!isSpeechSpec(d.speech))throw new LoadFailure("bad_part",`The speech of ${i} ${d.key} is not made by take() or say().`);if(c.has(d.key)){u.problems.push(problem("AK-K001",`The ${i} key "${d.key}" is used twice. Every ${i} in an output needs its own key.`,{part:d.key,where:{file:r.file}}));continue}c.add(d.key),s.push(d)}return s}var HARD_SYNC=.15,PAUSED_SYNC=.001,MAX_SIDE=1920,Cutout=class{box;canvas;take;matte;alpha;out;alphaCtx;shown=!1;failed=!1;disposed=!1;edge;soft;softCtx=null;firm=firmLevels();made;constructor(e){this.take=e.take,this.edge=e.edge,e.edge&&(this.soft=document.createElement("canvas"),this.softCtx=this.soft.getContext("2d",{willReadFrequently:!0})),this.box=document.createElement("div"),this.box.className="ak-cutout",this.box.style.overflow="hidden",this.box.style.pointerEvents="none",this.box.style.visibility="hidden",this.canvas=document.createElement("canvas"),this.canvas.style.maxWidth="none",this.size(e.source),this.out=this.canvas.getContext("2d"),this.alpha=document.createElement("canvas"),this.alpha.width=270,this.alpha.height=480,this.alphaCtx=this.alpha.getContext("2d",{willReadFrequently:!0});const t=document.createElement("video");t.muted=!0,t.playsInline=!0,t.preload="auto",t.crossOrigin="anonymous",t.src=e.matte,Object.assign(t.style,{position:"absolute",left:"0",top:"0",width:"1px",height:"1px",opacity:"0"}),this.matte=t,t.addEventListener("loadedmetadata",()=>{t.videoWidth>0&&t.videoHeight>0&&(this.alpha.width=t.videoWidth,this.alpha.height=t.videoHeight),this.sync()}),t.addEventListener("error",()=>{this.failed=!0,this.box.style.visibility="hidden",e.onFail?.()}),this.take.addEventListener("loadedmetadata",()=>{e.source||this.size(void 0)});for(const n of[this.take,t])n.addEventListener("seeked",this.redraw),n.addEventListener("loadeddata",this.redraw);this.box.append(this.canvas,t),e.host.append(this.box),this.everyFrame(this.take),this.everyFrame(t)}size(e){const t=e?.width??this.take.videoWidth,n=e?.height??this.take.videoHeight;if(!(t>0&&n>0))return;const r=Math.min(1,MAX_SIDE/Math.max(t,n));this.canvas.width=Math.max(1,Math.round(t*r)),this.canvas.height=Math.max(1,Math.round(n*r))}redraw=()=>{this.draw()};everyFrame(e){if(!("requestVideoFrameCallback"in e))return;const t=()=>{this.disposed||(this.draw(),e.requestVideoFrameCallback(t))};e.requestVideoFrameCallback(t)}show(e){this.shown=e,this.box.style.visibility=e&&!this.failed?"visible":"hidden",!e&&!this.matte.paused&&this.matte.pause()}sync(){const e=this.take,t=this.matte;if(this.failed||t.readyState===0)return;const n=e.currentTime,r=t.currentTime-n;if(e.paused||!this.shown){t.paused||t.pause(),Math.abs(r)>PAUSED_SYNC&&(t.currentTime=n);return}if(t.paused||Math.abs(r)>HARD_SYNC){t.currentTime=n,t.playbackRate=e.playbackRate,t.paused&&t.play().catch(()=>{});return}const u=Math.min(Math.max(-r*2,-.05),.05);t.playbackRate=e.playbackRate*(1+u)}draw(){const e=this.out,t=this.alphaCtx;if(!e||!t||!this.shown||this.failed)return;const n=this.take,r=this.matte,{width:u,height:i}=this.canvas;if(n.readyState<2||r.readyState<2){e.clearRect(0,0,u,i);return}const o=this.alpha.width,a=this.alpha.height;t.drawImage(r,0,0,o,a);const s=t.getImageData(0,0,o,a),c=s.data,l=this.edgeNow(o),d=this.soft,f=this.softCtx;let m=this.alpha;if(l&&d&&f){const h=this.firm;for(let D=0;D<c.length;D+=4){const p=h[c[D]??0]??0;c[D]=p,c[D+1]=p,c[D+2]=p,c[D+3]=255}t.putImageData(s,0,0),(d.width!==o||d.height!==a)&&(d.width=o,d.height=a),f.globalCompositeOperation="copy",f.filter=l.blur>0?`blur(${String(l.blur)}px)`:"none",f.drawImage(this.alpha,0,0),f.filter="none";const g=f.getImageData(0,0,o,a),E=g.data;for(let D=0;D<E.length;D+=4)E[D+3]=l.levels[E[D]??0]??0;f.putImageData(g,0,0),m=d}else{for(let h=0;h<c.length;h+=4)c[h+3]=c[h]??0;t.putImageData(s,0,0)}e.globalCompositeOperation="copy",e.drawImage(n,0,0,u,i),e.globalCompositeOperation="destination-in",e.drawImage(m,0,0,u,i),e.globalCompositeOperation="source-over"}edgeNow(e){if(!this.edge)return;const t=parseFloat(this.canvas.style.width),n=Number.isFinite(t)&&t>0&&e>0?Math.round(t/e*100)/100:1;if(this.made?.scale!==n){const r=matteEdge(this.edge.feather,this.edge.shrink,n);this.made={scale:n,blur:r.sigma/n,levels:edgeLevels(r)}}return this.made}dispose(){this.disposed=!0,this.matte.pause(),this.matte.removeAttribute("src"),this.matte.load()}},HARD_SYNC2=.5,STEER_FROM=.04,STEER_UNTIL=.01,STEER=.03,PAUSED_SYNC2=.02,px=e=>`${String(e)}px`;function place(e,t){Object.assign(e.style,{position:"absolute",left:px(t[0]),top:px(t[1]),width:px(t[2]),height:px(t[3])})}function round(e,t){if(e.shape==="circle"){t.style.borderRadius="50%";return}if(!e.radius)return;const[,,n,r]=e.boxes?.[0]?.box??e.box,u=i=>`${String(Math.round((e.radius??0)/i*1e5)/1e3)}%`;t.style.borderRadius=`${u(n)} / ${u(r)}`}function layout(e,t,n,r){place(n,t.box);const[u,i,o,a]=t.picture,[s,c]=t.box;if(t.crop&&e.source){const[l,d,f,m]=t.crop,h=o/f,g=a/m;place(r,[u-s-l*h,i-c-d*g,e.source.width*h,e.source.height*g]),r.style.objectFit="fill"}else place(r,[u-s,i-c,o,a]),r.style.objectFit=e.fit}function backdropFilter(e){return[e.blur?`blur(${String(e.blur)}px)`:"",e.desaturate?`saturate(${String(1-e.desaturate)})`:"",e.dim?`brightness(${String(1-e.dim)})`:""].filter(t=>t!=="").join(" ")}function drawBackdrop(e,t,n,r){const u=backdropFilter(t);if(t.color===void 0&&t.image===void 0){r.style.filter=u;return}if(r.style.opacity="0",t.color==="transparent")return;let i;if(t.image!==void 0&&e.imageUrl){const o=document.createElement("img");o.src=e.imageUrl,o.alt="",o.style.objectFit="cover",o.style.maxWidth="none",o.style.filter=u,i=o}else i=document.createElement("div"),i.style.background=t.color??"transparent";return i.className="ak-backdrop",n.prepend(i),i}function layoutBackdrop(e,t){const n=intersect(t.picture,t.box)??t.box;place(e,[n[0]-t.box[0],n[1]-t.box[1],n[2],n[3]])}var Clips=class{drawn;fps;playing=!1;constructor(e,t){this.fps=t,this.drawn=e.map(n=>{const r=document.createElement("div");r.className="ak-footage",r.style.overflow="hidden",round(n,r);const u=document.createElement("video");u.muted=!0,u.playsInline=!0,u.preload="auto",u.src=n.url,u.style.maxWidth="none",u.style.visibility="hidden";const i=placementAt(n,n.start);layout(n,i,r,u),r.append(u),n.host.append(r);const o=(n.pan?.length??0)>1||(n.zoom?.length??0)>0||(n.boxes?.length??0)>1;let a,s;if(n.cutoutIn){const c=n.background;a=new Cutout({take:u,matte:n.cutoutIn.matte,host:n.cutoutIn.host,...n.source?{source:n.source}:{},...c?{edge:{feather:c.feather,shrink:c.shrink},onFail:()=>{u.style.filter="",u.style.opacity="",s?.remove()}}:{}}),round(n,a.box),layout(n,i,a.box,a.canvas),c&&(s=drawBackdrop(n,c,r,u),s&&layoutBackdrop(s,i))}return{clip:n,el:u,box:r,moving:o,...a?{cutout:a}:{},...s?{backdrop:s}:{}}})}sourceAt(e,t){const n=sourceAt(e,t),r=e.duration===void 0?1/0:e.duration-1/this.fps;return Math.max(0,Math.min(n,r))}setPlaying(e){if(this.playing=e,!e)for(const t of this.drawn)t.el.pause(),t.cutout?.sync()}draw(e,t){for(const n of this.drawn){const r=n.clip;if(!(e>=r.start&&e<r.end)){n.el.style.visibility="hidden",n.el.paused||n.el.pause(),n.cutout?.show(!1);continue}if(n.moving){const a=placementAt(r,e);layout(r,a,n.box,n.el),n.cutout&&layout(r,a,n.cutout.box,n.cutout.canvas),n.backdrop&&layoutBackdrop(n.backdrop,a)}n.el.style.visibility="visible";let i;r.cuts&&(i=0,r.cuts.forEach((a,s)=>{a.at<=e+1e-9&&(i=s)}));const o=i!==n.cut;n.cut=i,this.follow(n,n.el,e,t||o),n.cutout&&(n.cutout.show(!0),n.cutout.sync(),n.cutout.draw())}}follow(e,t,n,r){const u=e.clip,i=this.sourceAt(u,n),o=t.currentTime-i,a=sourceAt(u,n),s=a<0||u.duration!==void 0&&a>=u.duration-1/this.fps;if(!this.playing||s){t.paused||t.pause(),Math.abs(o)>PAUSED_SYNC2&&(t.currentTime=i);return}if(r||t.paused||Math.abs(o)>HARD_SYNC2*u.speed){t.currentTime=i,t.playbackRate=u.speed,e.steering=void 0,t.paused&&t.play().catch(()=>{});return}const c=o<0?1:-1;Math.abs(o)>STEER_FROM?e.steering=c:Math.abs(o)<=STEER_UNTIL&&(e.steering=void 0),t.playbackRate=u.speed*(e.steering===void 0?1:1+e.steering*STEER)}dispose(){for(const e of this.drawn)e.cutout?.dispose(),e.el.pause(),e.el.removeAttribute("src"),e.el.load()}},round65=e=>Math.round(e*1e6)/1e6;function soundPlanner(e,t){const{source:n,log:r,ledger:u}=e,{look:i,fps:o,options:a,dims:s}=t,c=[],l=[],d=[],f=(m,h,g)=>{const E=m.sound;let D,p;if(typeof E=="string"){p=E;const v=i.sfx[E];if(v!==void 0){const y=v.replace(/^\.\//,"");if(D=r.mediaAt(y),!D){r.missing(y),u.problems.push(problem("AK-A001",`The look's sound "${E}" is ${y}, which is not in the project. Put the file there, or change look.sfx in allyhub.config.ts.`,{part:h,where:{file:n.file}}));return}}else{if(isBuiltinSfx(E))return{sound:E};if(/[./]/.test(E))D=e.mediaOf(E,g);else{const y=[...BUILTIN_SFX,...Object.keys(i.sfx)];u.problems.push(problem("AK-A001",`The sound "${E}" in part ${h} is not one of the look's sounds (${[...new Set(y)].join(", ")}) and not a file. Name one of them, give a file ("./sfx/${E}.wav" or an import), or add it to look.sfx in allyhub.config.ts.`,{part:h,where:{file:n.file}}));return}}}else D=e.mediaOf(E,g),p=D.path.split("/").pop()??D.path;if(D.sha256!==""){if(D.kind!=="audio"&&!(D.kind==="video"&&D.audio)){u.problems.push(problem("AK-A003",`The sound ${D.path} in part ${h} is not audio. Give an audio file (wav, mp3, m4a…) or a video with sound.`,{part:h,where:{file:n.file}}));return}return{sound:p,file:D.path}}};return{addSpeech(m,h){l.push(...m),d.push(...h)},sfx(m,h,g){const E=h.end-h.start;for(const D of m.sounds??[]){const p=f(D,m.key,m.base);if(!p)continue;const v=Math.min(Math.max(g(D.at),0),E);c.push({t:toFrame(h.start+v,o),sound:p.sound,part:h.key,...D.what===void 0?{}:{what:D.what},...p.file===void 0?{}:{file:p.file},...D.gainDb===void 0||D.gainDb===0?{}:{gainDb:D.gainDb},...D.shape?{shape:D.shape}:{}})}},carry(m,h,g,E,D,p){const v=y=>{const A=Math.max(y.at,h),b=Math.min(y.at+y.dur,g);if(b-A<.005)return;const{fadeIn:x,fadeOut:B,...$}=y;return delete $.tone,{...$,part:D,at:round65(E+A-h),from:round65(y.from+(A-y.at)*(y.speed??1)),dur:round65(b-A),...y.gainDb!==void 0||p!==0?{gainDb:(y.gainDb??0)+p}:{},...x!==void 0&&A===y.at?{fadeIn:x}:{},...B!==void 0&&b===y.at+y.dur?{fadeOut:B}:{}}};for(const y of m.timeline.audio.speech??[]){const A=v(y);A&&l.push(A)}for(const y of m.timeline.audio.room??[]){const A=v(y);A&&d.push(A)}for(const y of m.timeline.cues)y.t<h-1e-6||y.t>=g-1e-6||c.push({...y,t:toFrame(E+y.t-h,o),part:D,...y.gainDb!==void 0||p!==0?{gainDb:(y.gainDb??0)+p}:{}})},cues:()=>[...c].sort((m,h)=>m.t-h.t),audio(m,h){const g=s.profile;return{...l.length>0?{speech:l}:{},...d.length>0?{room:d}:{},...m?{music:m}:{},...a.mix?{mix:resolveMix(a.mix)}:{},master:resolveMaster(a.master,g?.loudness),...voicePlan(a.mic,h)}}}}function servedHere(e,t){let n;try{n=new URL(e,t)}catch{return!0}return n.protocol==="data:"||n.protocol==="blob:"||n.protocol!=="http:"&&n.protocol!=="https:"?!0:n.origin===new URL(t).origin}function backgroundUrls(e){const t=[],n=/url\(\s*(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)'|([^)\s]*))\s*\)/g;for(const r of e.matchAll(n)){const i=(r[1]??r[2]??r[3]??"").replace(/\\(.)/g,"$1");i&&t.push(i)}return t}function pictureHint(e){const t=e.trim();return t==="[object Object]"?"That is an object turned into text: for an imported media value or ctx.asset(…), use its .url.":t==="undefined"||t==="null"?`The source is ${t}: for an imported media value or ctx.asset(…), use its .url.`:/^[a-z][a-z0-9+.-]*:/i.test(t)?"The file is not there, or it is not a picture the browser can draw.":'A path is not a URL the stage serves: import the file (import logo from "./logo.svg") or use ctx.asset(path), and use its .url.'}var decodes=e=>e.decode().then(()=>!0,()=>!1);function watchPictures(e){const t=[],n=()=>document.baseURI,r=(u,i,o)=>{!i||!servedHere(i,n())||t.some(a=>a.el===u&&a.src===i)||t.push({el:u,src:i,via:o})};return e.addEventListener("error",u=>{const i=u.target;i instanceof HTMLImageElement&&r(i,i.getAttribute("src")??"","img")},!0),{async sweep(){const u=Array.from(e.querySelectorAll("img"));await Promise.all(u.map(async o=>{const a=o.getAttribute("src")??"";a&&!await decodes(o)&&o.complete&&o.naturalWidth===0&&r(o,a,"img")}));const i=new Map;for(const o of Array.from(e.querySelectorAll("*"))){const a=getComputedStyle(o).backgroundImage;if(!a.includes("url("))continue;const s=o instanceof HTMLElement||o instanceof SVGElement?o.style.backgroundImage:"",c=s.includes("url(")?s:a;for(const l of backgroundUrls(c))i.set(l,[...i.get(l)??[],o])}await Promise.all([...i].map(async([o,a])=>{if(!servedHere(o,n()))return;const s=new Image;if(s.src=o,!await decodes(s))for(const c of a)r(c,o,"background")}))},broken:()=>[...t]}}function pictureWaiter(e,t){const n=new Map,r=()=>document.baseURI;return async u=>{const i=[],o=[];for(const s of Array.from(e.querySelectorAll("img"))){if(!(s.currentSrc||s.src)||s.getClientRects().length===0)continue;const c=s.getAttribute("src")??s.currentSrc;o.push(c),i.push(s.decode().catch(()=>{s.complete&&s.naturalWidth===0&&servedHere(c,r())&&t?.({el:s,src:c,via:"img"})}))}for(const s of Array.from(e.querySelectorAll('[style*="url("]')))if(s.getClientRects().length!==0)for(const c of backgroundUrls(s.style.backgroundImage)){let l=n.get(c);l||(l=new Image,l.src=c,n.set(c,l)),o.push(c);const d=l;i.push(d.decode().catch(()=>{d.complete&&d.naturalWidth===0&&servedHere(c,r())&&t?.({el:s,src:c,via:"background"})}))}if(i.length===0)return[];const a=await within2(i,u);return o.filter((s,c)=>a[c]===void 0)}}function cssName(e){if(e==="cssFloat")return"float";if(e.includes("-"))return e;const t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);return/^(webkit|moz|ms|o)-/.test(t)?`-${t}`:t}function declarations2(e){const t=[];let n=0,r="",u=0;const i=o=>{const a=e.slice(u,o),s=a.indexOf(":");if(s>0){const c=a.slice(0,s).trim(),l=a.slice(s+1).replace(/!\s*important\s*$/i,"").trim();c&&l&&t.push([c,l])}u=o+1};for(let o=0;o<e.length;o++){const a=e[o];r?a==="\\"?o++:a===r&&(r=""):a==='"'||a==="'"?r=a:a==="("?n++:a===")"?n=Math.max(0,n-1):a===";"&&n===0&&i(o)}return i(e.length),t}var UNIT=/^(-?(?:\d+\.?\d*|\.\d+))([a-z%]+)$/i,NUMBER=/^-?(?:\d+\.?\d*|\.\d+)$/;function styleHint(e,t){const n=cssName(e.prop),r=e.value.trim();if(e.via==="setProperty"&&n!==e.prop.toLowerCase())return`setProperty takes the CSS name "${n}", not "${e.prop}".`;if(!t(n,"initial"))return`Chrome has no style property "${e.prop}"; check its name.`;if(/!\s*important\s*$/i.test(r))return e.via==="cssText"?"Check the value's spelling and units.":`A style property does not take !important in its value: use style.setProperty("${n}", value, "important").`;const u=UNIT.exec(r);return u?.[1]!==void 0&&t(n,u[1])?`${e.prop} takes a number such as ${u[1]}, not ${r}.`:NUMBER.test(r)&&t(n,`${r}px`)?`${e.prop} needs a unit: ${r}px, not ${r}.`:"Check the value's spelling and units: the browser drops a value it cannot read."}var installed3;function watchStyles(e=3){if(installed3)return installed3;const t=[],n=new Set,r=new Map,u=new WeakMap,i=(g,E)=>CSS.supports(g,E),o={part:void 0,rejected:()=>t},a=(g,E,D,p,v=!1)=>{const y=o.part;if(y===void 0)return;const A=`${y}|${E}|${p}`;if(n.has(A))return;n.add(A);const b=r.get(y)??0;if(b>=e)return;r.set(y,b+1);const x=u.get(g);t.push({part:y,prop:E,value:D,via:p,...v?{number:!0}:{},...x?{el:x}:{}})},s=g=>{if(g==null||typeof g!="string"&&typeof g!="number")return;const E=String(g).trim();return E===""?void 0:E},c=CSSStyleDeclaration.prototype,l=Object.getOwnPropertyDescriptor(c,"cssText");if(l?.set){const g=l;Object.defineProperty(c,"cssText",{...g,set(E){g.set?.call(this,E);const D=s(E);if(D!==void 0)for(const[p,v]of declarations2(D))p.startsWith("--")||i(p,v)||a(this,p,v,"cssText")}})}const d=new WeakMap,f=new WeakMap,m={get(g,E){const D=Reflect.get(g,E,g);if(typeof D!="function")return D;let p=f.get(g);p||(p=new Map,f.set(g,p));let v=p.get(E);return v||(v=D.bind(g),p.set(E,v)),v},set(g,E,D){if(typeof E!="string"||E in c||/^\d+$/.test(E)||!(E in g))return Reflect.set(g,E,D,g);const p=s(D),v=p===void 0?"":g.getPropertyValue(cssName(E)),y=Reflect.set(g,E,D,g);if(p===void 0)return y;const A=cssName(E);return g.getPropertyValue(A)!==v||i(A,p)||a(g,E,p,"property",typeof D=="number"),y}};for(const g of[HTMLElement.prototype,SVGElement.prototype]){const E=Object.getOwnPropertyDescriptor(g,"style");if(!E?.get)continue;const D=E;Object.defineProperty(g,"style",{...D,get(){const p=D.get?.call(this);u.set(p,this);let v=d.get(p);return v||(v=new Proxy(p,m),d.set(p,v)),v}})}const h=c.setProperty;return c.setProperty=function(g,E,D){const p=s(E);if(p===void 0||g.startsWith("--")){h.call(this,g,E,D);return}const v=this.getPropertyValue(g),y=this.getPropertyPriority(g);h.call(this,g,E,D),!(this.getPropertyValue(g)!==v||this.getPropertyPriority(g)!==y)&&(i(g,p)||a(this,g,p,"setProperty"))},installed3=o,o}function rejectedMessage(e,t){const n=(u,i)=>CSS.supports(u,i),r=e.via==="cssText"?`its cssText sets ${e.prop}: ${e.value}`:e.via==="setProperty"?`setProperty("${e.prop}", ${JSON.stringify(e.value)})`:`${/^[a-z]+$/i.test(e.prop)?e.prop:JSON.stringify(e.prop)} = ${e.number?e.value:JSON.stringify(e.value)}`;return`Part ${e.part} sets ${r}${t}, which the browser ignores: this style does not apply. ${styleHint(e,n)}`}var hex22=e=>e.toString(16).padStart(2,"0");function createStage(e,t){const{options:n,embed:r}=e,u=n.purpose==="check"&&!r,i=u?watchStyles():void 0,o=u?watchPictures(t):void 0,a=[],s=pictureWaiter(t,g=>{a.some(E=>E.el===g.el&&E.src===g.src)||a.push(g)}),c=new Set,l=g=>!t.contains(g.target)&&!(g.target instanceof HTMLElement&&g.target.dataset.akHolder===""),d=u?new MutationObserver(g=>{for(const E of g)l(E)&&c.add(E.target.nodeName.toLowerCase())}):void 0;let f=!1;const m=g=>{const E=document.createElement("div");E.style.color=g,t.append(E);const D=getComputedStyle(E).color;E.remove();const p=document.createElement("canvas");p.width=1,p.height=1;const v=p.getContext("2d",{willReadFrequently:!0});if(!v)return"#000000";v.fillStyle=D,v.fillRect(0,0,1,1);const[y=0,A=0,b=0,x=255]=v.getImageData(0,0,1,1).data;return`#${hex22(y)}${hex22(A)}${hex22(b)}${x===255?"":hex22(x)}`},h=()=>{d?.takeRecords().forEach(g=>{l(g)&&c.add(g.target.nodeName.toLowerCase())})};return{el:t,styles:i,picturesDrawn:s,get clear(){return f},async sweep(){await o?.sweep()},cssColor:m,takeOutside:h,dress(g){const{dims:E,look:D}=g;f=n.purpose==="render"&&!r||g.options.transparent===!0,t.replaceChildren(),addLayerRule(t.ownerDocument),t.dataset.format=g.format,e.lang!==void 0&&(t.lang=e.lang),Object.assign(t.style,{position:"relative",width:`${String(E.width)}px`,height:`${String(E.height)}px`,overflow:"hidden",background:f?"transparent":"var(--ak-color-bg)",color:"var(--ak-color-fg)",fontFamily:"var(--ak-font-body)"});for(const[y,A]of Object.entries(lookCss(D)))t.style.setProperty(y,A);const v=g.options.transparent===!0?"transparent":m("var(--ak-color-bg)");return f&&n.purpose!=="play"&&!r&&(document.documentElement.style.background="transparent",document.body.style.background="transparent"),d?.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),v},problems(g){h();const E=[...c].map(y=>problem("AK-R003",`Piece code changed <${y}> outside the stage. Draw only inside each layer's own element.`)),D=(i?.rejected()??[]).map(y=>{const A=y.el&&t.contains(y.el)?selectorOf(y.el,t):void 0;return problem("AK-R004",rejectedMessage(y,A?` on ${A}`:""),{part:y.part,...A?{where:{selector:A}}:{}})}),p=o?.broken()??[],v=[...p,...a.filter(y=>!p.some(A=>A.el===y.el&&A.src===y.src))].map(y=>{const A=g.find(k=>k.el.contains(y.el)),b=A?.layers.find(k=>k.el.contains(y.el)),x=t.contains(y.el)?selectorOf(y.el,t):void 0,B=b?`${b.spec.component} (layer ${String(b.index+1)}) in part ${A?.part.key??""}`:A?`Part ${A.part.key}`:"The stage",$=y.via==="img"?`<img src="${y.src}">`:`a background image, url("${y.src}")`;return problem("AK-A005",`${B} draws a picture that does not load: ${$}. ${pictureHint(y.src)}`,{...A?{part:A.part.key}:{},...x?{where:{selector:x}}:{}})});return[...E,...D,...v]},dispose(){d?.disconnect(),t.replaceChildren()}}}var SAYING_MARGIN=.1;function levelsOf(e){return e.envelope===void 0?void 0:envelopeFrames(e.envelope)}function stretch(e,t,n,r){const u=t[n]??{text:"",start:0,end:0},i=t[r]??u,o=u.start,a=Math.max(.05,i.end-u.start),s=c=>Math.round(c*1e3)/1e3;return{from:s(o),dur:s(a),...speechPads(t,n,r,e.duration,levelsOf(e)),words:t.slice(n,r+1).map(c=>({text:c.text,start:s(c.start-o),end:s(c.end-o)}))}}var quoted=e=>e.map(t=>`"${t}"`).join(", ");function resolveSpeech(e,t,n,r){const u=resolveAsRecorded(e,t,n,r),i=e.tempo??1;return i===1?u:atSpeed(u,i)}var round36=e=>Math.round(e*1e3)/1e3;function atSpeed(e,t){const n=e.speech;return{...e,...e.estimate===void 0?{}:{estimate:e.estimate/t},...n?{speech:{...n,dur:round36(n.dur/t),padIn:n.padIn/t,padOut:n.padOut/t,words:n.words.map(r=>({...r,start:round36(r.start/t),end:round36(r.end/t)})),speed:t}}:{}}}function resolveAsRecorded(e,t,n,r){const u={part:t,where:{file:n.file}};if(e.kind==="say"){const M=n.log.spokenOf(e.text),_=M?.speak??e.text,F=e.tool??DEFAULT_VOICE_TOOL,N=sayStem({text:_,voice:e.voice,tool:F,params:e.params}),T=mediaByStem(n.media,N),P={shown:e.text,...M?{speechKey:M.key}:{},...M?.anchors?{anchors:M.anchors}:{}},V={part:t,text:_,...e.voice===void 0?{}:{voice:e.voice},tool:F,...e.params===void 0?{}:{params:e.params},stem:N,...T?{file:T.path}:{}};if(!T)return n.log.missing(N),r.push(problem("AK-T002",`Part ${t} says "${_.length>80?`${_.slice(0,80)}…`:_}" with ${F}${e.voice===void 0?"":` (voice ${e.voice})`}, and there is no file for it yet (${N}.*). Run allyhub voice in the project: it makes one file per say, after you tell the person the price. A changed text, voice, tool or params needs a new file.`,u)),{estimate:estimateSpeech(_),say:V,script:_,...P};const Z=n.log.mediaAt(T.path)??T,S=Z.words??[];return S.length===0?(r.push(problem("AK-T001",`The say file ${Z.path} of part ${t} has no word times beside it. Make it again with allyhub voice, or write them with allyhub words ${Z.path}.`,u)),{estimate:Z.duration??estimateSpeech(_),say:V,script:_,...P}):{speech:{media:Z,...stretch(Z,S,0,S.length-1),script:_,...P},say:V,...P}}const i=e.line===void 0?void 0:n.log.spokenOf(e.line),o=e.line===void 0?{}:{shown:e.line,...i?{speechKey:i.key}:{},...i?.anchors?{anchors:i.anchors}:{}},a=e.line===void 0?void 0:i?.speak??e.line,s=n.mediaOf(e.file,e.fileBase),c=()=>({estimate:a!==void 0?estimateSpeech(a):s.duration??4,...a===void 0?{}:{script:a},...o});if(s.sha256==="")return c();if(s.kind!=="audio"&&s.kind!=="video")return r.push(problem("AK-A003",`The take ${s.path} of part ${t} is not audio or video.`,u)),c();const l=s.gen?.input?.text;a!==void 0&&typeof l=="string"&&!normText(l).includes(normText(a))&&r.push(problem("AK-T007",`Part ${t} says "${a.length>80?`${a.slice(0,80)}…`:a}", but its voice ${s.path} was made from other words (its record ${s.gen?.record??""} has the text). Make the voice again from the lines as they are now, or change the line back; a word the voice was given in another spelling is written <shown|said> in the line.`,u));const d=s.words??[];if(d.length===0)return r.push(problem("AK-T001",`The take ${s.path} of part ${t} has no word times beside it (${s.path.replace(/\.[^./]+$/,"")}.words.json). Run allyhub words ${s.path} to write them.`,u)),c();let f,m;if(e.editsFile!==void 0){const M=n.log.optionalData(e.editsFile,e.editsBase),_=M.full??e.editsFile;if(M.found&&(m=_),!M.found)r.push(problem("AK-T005",`The edits file ${_} of part ${t} is not there (named "${e.editsFile}" in ${n.log.baseOf(e.editsBase)}), so its take would play uncut. Write it (the preview's transcript writes it at the first word struck; { "remove": [] } removes nothing), or fix the path: it is relative to the file that names it.`,{part:t,where:{file:n.log.baseOf(e.editsBase)}}));else if(M.error!==void 0)r.push(problem("AK-T005",`The edits file ${_} of part ${t} is not valid JSON: ${M.error}`,{part:t,where:{file:_}}));else{const F=parseEditList(M.value);typeof F=="string"?r.push(problem("AK-T005",`The edits file ${_} of part ${t} does not match the format: ${F}.`,{part:t,where:{file:_}})):f=F}}const h=new WordStream(d),{cut:g}=removedWords(d,f,h),E=new WordView(d,g),D=g.size>0?new WordView(d):E,p=d.length-1,v=M=>E.index.filter(_=>_>=M).map(_=>d[_]??{text:"",start:0,end:0}),y=(M,_)=>{const F=[];for(let N=M;N<=_;N++){if(!g.has(N))continue;let T=N;for(;T+1<=_&&g.has(T+1);)T++;const P=joinWords(d.slice(N,T+1));F.push(`#${String(N)}${T>N?`–#${String(T)}`:""} ("${P.length>60?`${P.slice(0,60)}…`:P}")`),N=T}return F},A=(M,_)=>g.size>0?D.span(normText(M),_,p):void 0,b=m??"the edits file";let x=0,B=p,$;if(e.from!==void 0){const M=E.span(normText(e.from),0,p);if(!M){const _=A(e.from,0),F=nearestPhrases(v(0),e.from);return r.push(_?problem("AK-T006",`The range of part ${t} starts at "${e.from}", which ${s.path} says only in words its edits remove: ${y(_.first,_.last).join(", ")}. Start the range at words the cut keeps${F.length?` (nearest: ${quoted(F)})`:""}, or keep those words in ${b}.`,u):problem("AK-T003",`The range of part ${t} starts at "${e.from}", which ${s.path} does not say.${F.length?` Nearest: ${quoted(F)}.`:""}`,u)),c()}if(x=M.first,B=p,e.to!==void 0){const _=E.span(normText(e.to),M.first,p);if(!_){const F=A(e.to,M.first),N=nearestPhrases(v(M.first),e.to);return r.push(F?problem("AK-T006",`The range of part ${t} ends at "${e.to}", which ${s.path} says after "${e.from}" only in words its edits remove: ${y(F.first,F.last).join(", ")}. End the range at words the cut keeps${N.length?` (nearest: ${quoted(N)})`:""}, or keep those words in ${b}.`,u):problem("AK-T003",`The range of part ${t} ends at "${e.to}", which ${s.path} does not say after "${e.from}".${N.length?` Nearest: ${quoted(N)}.`:""}`,u)),c()}B=Math.max(_.last,M.first)}}else if(a!==void 0){const M=n.cursor.get(s.path)??0;let _=E.findLine(a,M),F=M;if((!_||_.score<LINE_FOUND)&&M>0){const P=E.findLine(a,0);P&&P.score>=LINE_FOUND&&(_=P,F=0)}const N=a.length>80?`${a.slice(0,80)}…`:a,T=P=>`${String(Math.round(P*100))} %`;if(g.size>0){const P=D.findLine(a,F),V=P?y(P.first,P.last):[];P&&P.score>=LINE_FOUND&&V.length>0&&P.score-(_?.score??0)>=SAYING_MARGIN&&r.push(problem("AK-T006",`Part ${t} is saying "${N}"${i?` (${i.key})`:""}, which ${s.path} says at #${String(P.first)}–#${String(P.last)} (${T(P.score)} of the line), but its edits remove ${V.join(", ")} there. Among the words the cut keeps, ${_?`#${String(_.first)}–#${String(_.last)} match ${T(_.score)} of it`:"it is not found"}. Make the line what the cut keeps, or keep those words in ${b}.`,u))}if(!_||_.score<LINE_FOUND)return r.push(problem("AK-T003",`Part ${t} is saying "${N}", which ${s.path} does not say${g.size>0?" in the words its edits keep":""}${_?` (the closest stretch, #${String(_.first)}–#${String(_.last)}, matches ${T(_.score)} of it)`:""}. Check that the line and the recording are the same script${i?` (${i.key})`:""}.`,u)),c();x=_.first,B=_.last,$={score:Math.round(_.score*100)/100,from:F}}n.cursor.set(s.path,B+1);const k=e.denoiseDb!==void 0&&e.denoiseDb>0?{denoise:e.denoiseDb}:{},I={span:[x,B],...$?{match:$}:{},...m===void 0?{}:{edits:m}};if(f){const M=applyEdits(d,f,x,B,{levels:levelsOf(s),fps:n.fps});for(const S of M.lost)r.push(problem("AK-T005",`An edit in ${b} removes words ${String(S.from)}–${String(S.to)}${S.text===void 0?"":` ("${S.text}")`}, which ${s.path} no longer says. Remove that edit, or strike the words again in the transcript.`,{part:t,where:{file:b}}));const _=M.kept[0],F=M.kept.at(-1),N=M.ranges[0];if(_===void 0||F===void 0||!N)return r.push(problem("AK-T005",`The edits in ${b} remove every word part ${t} says.`,{part:t,where:{file:b}})),c();const T=stretch(s,d,_,F),P=M.ranges.at(-1)??N,V=N.from>(d[_]?.start??0)+1e-6,Z=P.to<(d[F]?.end??0)-1e-6;return{speech:{media:s,...T,...V?{from:N.from,padIn:0}:{},...Z?{padOut:0}:{},dur:Math.round(editedLength(M.ranges)*1e3)/1e3,words:M.words,...M.ranges.length>1?{ranges:M.ranges}:{},...I,...k,...a===void 0?{}:{script:a},...o},...o}}return{speech:{media:s,...stretch(s,d,x,B),...I,...k,...a===void 0?{}:{script:a},...o},...o}}var round66=e=>Math.round(e*1e6)/1e6,round37=e=>Math.round(e*1e3)/1e3,isFootage2=e=>e.__allyhubLayer==="footage";async function videoTake(e,t,n,r,u){const{source:i,ledger:o}=e,{fps:a}=t,s=r.layers.find(B=>isFootage2(B)&&B.file===void 0&&B.video===void 0),c=document.createElement("div"),l={from:0,to:0,part:r.key,start:0,partStart:0},d=camerasOf(s),f=s?.quality?.scale,m=await n.load(u.piece,c,{frame:!0,shown:l,...d?{cameras:d}:{},...f===void 0?{}:{sceneryScale:f}}),h=m.inner.timeline.duration,g=m.inner.words(),E=B=>cutOnFrame(B,a,g,h);let D=0,p=h;try{D=u.from===void 0?0:momentIn(m.inner,u.from),p=u.to===void 0?h:momentIn(m.inner,u.to)}catch(B){o.problems.push(problem("AK-T003",`Part ${r.key} plays a stretch of ${m.id}: ${messageOf(B)}`,{part:r.key,where:{file:i.file}}))}D=E(D),p=E(p),p-D>=1/a||(o.problems.push(problem("AK-T003",`Part ${r.key} plays ${m.id} from ${D.toFixed(3)} s to ${p.toFixed(3)} s, which is no stretch: its end comes after its start, within its ${h.toFixed(3)} s.`,{part:r.key,where:{file:i.file}})),D=0,p=h),l.from=D,l.to=p;const v=[],y=[],A=B=>{const $=Math.min(B.end,p)-Math.max(B.start,D),k=B.end-B.start;return k<=1e-9?B.start>=D-1e-6&&B.start<p:$>k/2+1e-9||Math.abs($-k/2)<=1e-9&&B.start>=D-1e-6};for(const B of m.inner.words()){if(B.end<=D||B.start>=p)continue;for(const[k,w]of[["start",D],["end",p]])B.start<w-1e-6&&B.end>w+1e-6&&o.facts.push(fact("cut-in-word",{piece:i.piece,part:r.key},{source:m.id,side:k,at:round66(w),word:B.text,wordStart:round66(B.start),wordEnd:round66(B.end)}));const $={...B,start:round66(Math.max(B.start,D)-D),end:round66(Math.min(B.end,p)-D)};v.push($),A(B)&&y.push($)}const b=[];for(const B of m.inner.timeline.parts)for(const $ of B.anchors??[])$.at<D-1e-6||$.at>p+1e-6||b.some(k=>k.name===$.name)||b.push({name:$.name,at:round66($.at-D),...$.end===void 0?{}:{end:round66(Math.min($.end,p)-D)}});const x=[];for(const B of m.inner.lines()){const $=B.words.filter(A);if($.length!==0)if($.length===B.words.length)x.push({shown:B.shown,spoken:B.spoken});else{const k=joinWords($);x.push({shown:k,spoken:k})}}return{...m,host:c,from:D,to:p,words:v,captionWords:y,line:{shown:x.map(B=>B.shown).join(" "),spoken:x.map(B=>B.spoken).join(" ")},anchors:b,shown:l}}async function findTakes(e,t,n,r){const{source:u,log:i,ledger:o}=e,{fps:a,defaults:s,dims:c}=t,l=[...n],d=new Map,f=l.map(A=>A.speech&&A.speech.kind!=="video"?resolveSpeech(A.speech,A.key,{log:i,media:u.media,mediaOf:e.mediaOf,file:u.file,cursor:d,fps:a},o.problems):{}),m=f.flatMap(A=>A.say?[A.say]:[]),h=[];for(const A of l){const b=A.speech;h.push(b?.kind==="video"?await videoTake(e,t,r,A,b):void 0)}for(const[A,b]of h.entries()){const x=h[A+1];if(!b||x?.id!==b.id||Math.abs(x.from-b.to)>1e-6)continue;const B=b.to-b.from;b.anchors=b.anchors.filter($=>$.at<B-1e-6||!x.anchors.some(k=>k.name===$.name&&k.at<1e-6))}const g=new WeakMap;for(const[A,b]of l.entries()){const x=h[A];if(!x&&!b.layers.some($=>isFootage2($)&&$.video))continue;const B=[];for(const $ of b.layers){if(!isFootage2($)){B.push($);continue}if(x&&$.file===void 0&&$.video===void 0){B.push(videoLayer(c,$,x,P=>x.from+P,{video:x.id,output:x.output,format:x.format,from:x.from,to:x.to}));continue}if(!$.video){B.push($);continue}const k=document.createElement("div"),w={from:0,to:0,part:b.key,start:0,partStart:0},I=camerasOf($),M=$.quality?.scale,_=await r.load($.video,k,{shown:w,...I?{cameras:I}:{},...M===void 0?{}:{sceneryScale:M}});let F=0;try{F=$.from===void 0?0:momentIn(_.inner,$.from)}catch(P){o.problems.push(problem("AK-T003",`A footage of ${_.id} in part ${b.key}: ${messageOf(P)}`,{part:b.key,where:{file:u.file}}))}const N=$.speed??1,T=videoLayer(c,$,{..._,host:k},(P,V)=>F+(P-V.layer.start)*N,{video:_.id,output:_.output,format:_.format,from:F,speed:N});g.set(T,{inner:_.inner,from:F,speed:N,shown:w,...$.audio===!0?{audio:$.gainDb??0}:{}}),B.push(T)}l[A]={...b,layers:B}}const E=l.map((A,b)=>{const x=f[b]??{},B=x.speech,$=partAnchorList(A.anchors),k=h[b];if(k){const w=[...$,...k.anchors.filter(I=>!$.some(M=>M.name===I.name))];return{key:A.key,...w.length>0?{placed:w}:{},dur:k.to-k.from,lead:0,tail:0,words:k.words,speechDur:k.to-k.from}}return{key:A.key,...$.length>0?{placed:$}:{},dur:x.estimate??A.dur??s.dur,lead:A.lead??s.lead,tail:A.tail??s.tail,...!B&&x.estimate!==void 0?{pending:!0,...x.script===void 0?{}:{script:x.script},...x.anchors===void 0?{}:{anchors:x.anchors}}:{},...B?{words:B.words,speechDur:B.dur,...B.script===void 0?{}:{script:B.script},...B.anchors===void 0?{}:{anchors:B.anchors},...A.overlap?.before===void 0?{}:{before:A.overlap.before},...A.overlap?.after===void 0?{}:{after:A.overlap.after}}:{}}}),D=new Map,p=A=>{let b=D.get(A.path);if(!b){const x=A.envelope===void 0?void 0:envelopeFrames(A.envelope);b={levels:x,room:x?roomTone(x):void 0},D.set(A.path,b)}return b};let v;return{results:f,says:m,videoTakes:h,specs:l,shownBy:g,inputs:E,speechFor:(A,b)=>{const x=l[A],B=f[A]?.speech;if(!x||!B||b.speechAt===void 0)return v=void 0,{clips:[],room:[]};const $=[],k=[],w=b.speechAt-b.start,I=(x.overlap?.before??0)>0?Math.min(B.padIn,.12,Math.max(0,b.speechAt)):Math.min(B.padIn,Math.max(0,w)),M=(x.overlap?.after??0)>0?Math.min(B.padOut,.2):Math.min(B.padOut,Math.max(0,b.end-b.speechAt-B.dur)),_=round37,F=b.speechAt,N=B.speed??1,T=N===1?{}:{speed:N},P={start:_(F-I),end:_(F+B.dur+M),file:B.media.path,from:_(B.from-I*N),...T,...B.edits===void 0?{}:{edits:B.edits},...B.span?{words:B.span}:{},heard:joinWords(B.words),...B.match?{match:B.match}:{}},V=B.denoise===void 0?{}:{denoise:B.denoise},Z=x.speech?.kind==="take"?x.speech.room:void 0,S=Z===!1?void 0:Z,H=p(B.media),R=Z===!1?void 0:S?.from!==void 0&&S.to!==void 0&&S.to>S.from?{from:S.from,to:S.to}:H.room,G=Math.max(0,S?.fade??ROOM_MATCH.fade),X=j=>j>=.01?Math.min(G,j):0,te=(j,U,O,L,K)=>{const W=v;if(v=void 0,!R||O-U<=.02)return 0;const ee=R.to-R.from,Q=Math.min(X(L),(O-U)/2),Y=Math.min(G,ee/4),ie=j==="lead"&&W?.clip.file===B.media.path&&Math.abs(W.end-U)<1e-6,ce=W&&ie?Math.min(Y,W.clip.dur/2):0;W&&ce>0&&(W.clip.fadeOut=_(ce));const J=j==="tail"?U-Q:U-ce,ne=j==="lead"?O+Q:O,le=[];for(let ge=J;ne-ge>.02;ge+=ee-Y)le.push(ge);const pe=Math.min(ee,ne-(le.at(-1)??J)),oe=ge=>Math.min(ROOM_MATCH.near,ge),fe=j==="tail"?{from:R.from,to:R.from+oe(Math.min(ee,ne-J))}:{from:R.from+pe-oe(pe),to:R.from+pe},me=matchRoom(H.levels,fe,K,S?.limitDb),Ce=S?.gainDb!==void 0?{level:me.level,floor:me.floor,gainDb:S.gainDb,from:"given"}:S?.match===!1?{level:me.level,floor:me.floor,gainDb:0,from:"off"}:me,De=j==="tail"?Q:ce,_e=j==="lead"?Q:0,Be=le.map((ge,ye)=>{const Ae=ye===0?De:Y,$e=ye===le.length-1?_e:Y;return{file:B.media.path,part:x.key,at:_(ge),from:R.from,dur:_(Math.min(ee,ne-ge)),...V,...Ce.gainDb===0?{}:{gainDb:Ce.gainDb},...Ae>0?{fadeIn:_(Ae)}:{},...$e>0?{fadeOut:_($e)}:{},tone:{part:x.key,side:j,join:_(j==="lead"?O:U),pad:_(L),...Ce,fade:_(Q)}}}),he=Be.at(-1);return he?(k.push(...Be),j==="tail"&&(v={clip:he,end:O}),Q):0},ae=B.ranges?.at(-1)?.to??B.from+B.dur*N;let re=0;(x.overlap?.before??0)<=0?re=te("lead",b.start,P.start,I,{from:P.from,to:P.from+Math.min(I*N,ROOM_MATCH.near)}):v=void 0;const Ee=B.ranges;if(Ee&&Ee.length>1){const j=[];let U=0;Ee.forEach((O,L)=>{const K=L===0,W=L===Ee.length-1,ee=K?P.start:_(F+U),Q=K?_(O.from-I*N):O.from,Y=(O.to-O.from)/N+(K?I:0)+(W?M:0);j.push({at:ee,from:Q}),$.push({file:B.media.path,part:x.key,at:ee,from:Q,dur:_(Y),...T,...V}),U+=(O.to-O.from)/N}),P.cuts=j}else $.push({file:P.file,part:x.key,at:P.start,from:P.from,dur:_(P.end-P.start),...T,...V});const ve=(x.overlap?.after??0)<=0?te("tail",P.end,b.end,M,{from:ae+M*N-Math.min(M*N,ROOM_MATCH.near),to:ae+M*N}):0,ue=$[0],se=$.at(-1);return ue&&re>0&&(ue.fadeIn=_(re)),se&&ve>0&&(se.fadeOut=_(ve)),{speech:P,clips:$,room:k}}}}function timelineTransitions(e,t,n,r,u,i){const{fps:o,options:a}=e,s=[];for(const[c,l]of n){const d=u(c-1),f=u(c),m=r[c]?.transition;if(!d||!f||m===void 0)continue;const h=transitionSpec(m),g=Math.round(f.start*o),E=h.type==="dip"?h.color:h.type==="custom"?h.color?.value:void 0;s.push({part:f.key,from:d.key,type:h.type,start:(g-l.before)/o,at:f.start,end:(g+l.after)/o,ease:h.ease??transitionEase(h.type),keys:transitionKeys(h,{transparent:a.transparent===!0,background:i,...E===void 0?{}:{color:t.cssColor(E)}}),dur:h.dur??TRANSITION_DEFAULTS.dur,...h.type==="slide"||h.type==="push"||h.type==="wipe"?{direction:h.direction??TRANSITION_DEFAULTS.direction}:{},...h.type==="zoom"?{scale:h.scale??TRANSITION_DEFAULTS.scale}:{}})}return s}function transitionStage(e,t){const{fps:n,dims:r}=e,u=new Set;let i;return{place(o,a,s,c){const l=transitionState(o,Math.round(c*n),n);for(const[d,f,m,h]of[[a,l.out,"1","4"],[s,l.in,"3","5"]]){const g=pictureCss(f,r.width,r.height);d.overlays&&Object.assign(d.overlays.style,{transform:g.transform,opacity:g.opacity,clipPath:g.clipPath,zIndex:h}),Object.assign(d.picture.style,{transform:g.transform,opacity:g.opacity,clipPath:g.clipPath,zIndex:m,background:t.clear?"":"var(--ak-color-bg)",mixBlendMode:l.add&&d===s?"plus-lighter":""}),u.add(d)}l.color?(i||(i=document.createElement("div"),i.className="ak-transition-color",Object.assign(i.style,{position:"absolute",inset:"0",zIndex:"2",pointerEvents:"none"}),t.el.append(i)),Object.assign(i.style,{display:"block",background:l.color.value,opacity:String(Math.round(l.color.opacity*1e4)/1e4)})):i&&(i.style.display="none")},rest(o){if(u.delete(o))for(const a of[o.picture,o.overlays])a&&Object.assign(a.style,{transform:"",opacity:"",clipPath:"",zIndex:"",background:"",mixBlendMode:""})},hideVeil(){i&&(i.style.display="none")}}}async function load(e,t,n,r){const u=createEnv(e,t,r),i=createStage(u,n),o=await resolvePiece(u),a=i.dress(o),s=pieceContext(u,o),c=createEmbedder(u,i,load),l=await buildParts(u,o,s),d=await findTakes(u,o,l,c),f=musicClock(u,o),m=timeFilm(u,o,d,f),h=f.plan(m);m.checkLimit();const g=captionTrack(d,m,o.fps),E=newDrawState(),D=layerContexts(u,o,c,E,m),p=textReader(u,o,i,M=>withLayout(E,M)),v=footagePlanner(u,o,g,i.cssColor),y=soundPlanner(u,o),{parts:A,mounted:b,clips:x}=compose({env:u,piece:o,stage:i,takes:d,film:m,captions:g,footage:v,sound:y,contexts:D,texts:p}),B=timelineTransitions(o,i,m.windows,d.specs,M=>b.find(_=>_.n===M)?.part,a),$=y.audio(h,b.map(M=>M.spec)),k=await coverParts(o,s),w=new Clips(t.purpose==="play"?withHandles(x,A,B,o.fps):[],o.fps),I=createDrawer({env:u,piece:o,stage:i,mounted:b,transitions:B,transitionStage:transitionStage(o,i),duration:m.duration,clips:w,contexts:D,covers:k,state:E});return facade({env:u,piece:o,stage:i,mounted:b,parts:A,takes:d,captions:g,footage:v,cues:y.cues(),audio:$,transitions:B,duration:m.duration,words:M=>m.timing.words(M),timingProblems:m.timing.problems,background:a,embedder:c,drawer:I,measurer:measurer2({piece:o,stage:i,drawer:I,mounted:b,duration:m.duration,captions:g,footage:v}),notes:new Map})}var fmt=e=>`${String(Math.floor(e/60))}:${String(Math.floor(e%60)).padStart(2,"0")}`;async function startPlayer(e){const{output:t,stage:n}=e,r=t.timeline,u=r.fps,i=r.duration,o=i-1/u,a=new AudioContext,s=e.media??{},c=e.seed??"",l=mixPlan(r,s,{seed:c}),d=async q=>{if(q)try{const de=await fetch(q);return de.ok?await a.decodeAudioData(await de.arrayBuffer()):void 0}catch{return}},f=(q,de)=>{const be=s[q]?.denoisedUrl,xe=[...de.denoise?[`db=${de.denoise.toFixed(2)}`]:[],...de.speed===void 0?[]:[`speed=${de.speed.toFixed(6)}`],...de.filter===void 0?[]:[`filter=${encodeURIComponent(de.filter)}`]];return be===void 0||xe.length===0?void 0:`${be}?${xe.join("&")}`},m=new Map,h=new Map,g=[],E=decodings(l);for(const{file:q,how:de}of E){const be=f(q,de);if(be){const xe=await d(`${be}&wait=0`);xe?h.set(decodeKey(q,de),xe):g.push({key:decodeKey(q,de),url:be})}}for(const{file:q,how:de}of E)m.has(q)||h.has(decodeKey(q,de))||m.set(q,await d(s[q]?.url));const D=q=>{const de=q.getChannelData(0);return[de,q.numberOfChannels>1?q.getChannelData(1):de]},p=(q,de)=>{const be=h.get(decodeKey(q,de));if(be)return{src:D(be),made:de};const xe=m.get(q);return xe?{src:D(xe),made:{}}:void 0},v=r.audio.master??{...MASTER_DEFAULTS};let y;const A=()=>{const q=previewMaster(renderMix(l,p,a.sampleRate),a.sampleRate,v);if(!q){y=void 0;return}const[de,be]=q,xe=a.createBuffer(2,Math.max(1,de.length),a.sampleRate);xe.getChannelData(0).set(de),xe.getChannelData(1).set(be),y=xe};A();const b=subtitleCues({lines:t.lines(),fps:r.fps},t.captionOptions()??void 0);let x=!1,B=Math.min(Math.max(e.start??r.parts[0]?.still??0,0),o),$=0,k=0,w=0,I=0,M=[],_=[],F=!1,N={ctx:0,real:0};const T=()=>x?F?$+(a.currentTime-k):$+(realNow()-w)/1e3:B,P=()=>{if(!F)return;const q=realNow();if(a.currentTime!==N.ctx)N={ctx:a.currentTime,real:q};else if(q-N.real>300){const de=T();F=!1,$=de,w=q}},V=e.chrome!==!1,Z="#141210",S="#ece6da",H="#a39a8b",R='ui-monospace,"SF Mono",Menlo,monospace';document.documentElement.style.background=Z,document.body.style.cssText=`margin:0;background:${Z};overflow:hidden;font:13px/1 system-ui,-apple-system,"PingFang SC","Noto Sans SC",sans-serif;color:${S}`;const G=document.createElement("div");G.style.cssText=`position:fixed;left:0;right:0;top:0;bottom:${V?"48px":"0"};overflow:hidden;cursor:pointer`,n.parentElement?.insertBefore(G,n),G.append(n),n.style.position="absolute",n.style.transformOrigin="0 0";const X=document.createElement("div");X.style.cssText=`position:fixed;left:0;right:0;bottom:0;height:48px;display:flex;align-items:center;gap:12px;padding:0 10px;background:${Z};border-top:1px solid #2a2622`;const te=document.createElement("button");te.style.cssText=`width:32px;height:32px;border:0;border-radius:4px;background:${S};color:${Z};cursor:pointer;display:flex;align-items:center;justify-content:center;flex:none`,te.setAttribute("aria-label","play");const ae=document.createElement("input");ae.type="range",ae.min="0",ae.max=String(Math.round(i*u)),ae.step="1",ae.style.cssText=`flex:1;min-width:0;accent-color:${S};cursor:pointer`;const re=document.createElement("span");re.style.cssText=`font:12px/1 ${R};font-variant-numeric:tabular-nums;min-width:86px;text-align:right;color:${H}`;const Ee=`height:28px;padding:0 9px;border:1px solid #3a352e;border-radius:4px;background:transparent;color:${S};font:12px/1 ${R};cursor:pointer;flex:none`,ve=document.createElement("button");ve.textContent="CC",ve.style.cssText=Ee,ve.setAttribute("aria-label","captions"),ve.setAttribute("aria-pressed","false");const ue=document.createElement("button");ue.textContent="Pages",ue.style.cssText=Ee,ue.setAttribute("aria-label","page by page"),ue.setAttribute("aria-pressed","false"),X.setAttribute("role","toolbar"),ae.setAttribute("aria-label","seek"),X.append(te,ae,re,ue),b.length&&X.append(ve),V&&document.body.append(X);const se=()=>{const q=Math.min(G.clientWidth/r.width,G.clientHeight/r.height);n.style.transform=`scale(${String(q)})`,n.style.left=`${String((G.clientWidth-r.width*q)/2)}px`,n.style.top=`${String((G.clientHeight-r.height*q)/2)}px`},j=r.width,U=r.height,O=Math.min(j,U)/1080,L=document.createElement("div");L.style.cssText=`position:absolute;left:0;top:0;width:${String(j)}px;height:${String(U)}px;transform-origin:0 0;pointer-events:none`;const K=document.createElement("div");K.setAttribute("role","status"),K.setAttribute("aria-live","polite"),K.style.cssText=`position:absolute;left:50%;transform:translateX(-50%);bottom:${String((U>j?.2:.08)*U)}px;max-width:${String(j*.84)}px;padding:${String(10*O)}px ${String(22*O)}px;border-radius:${String(12*O)}px;background:rgba(0,0,0,.66);color:#fff;font:600 ${String(44*O)}px/1.3 system-ui,-apple-system,"PingFang SC","Noto Sans SC",sans-serif;text-align:center;display:none`,L.append(K),G.append(L);let W=!1;const ee=q=>{const de=W?b.find(be=>q>=be.start&&q<be.end):void 0;de?(K.textContent!==de.text&&(K.textContent=de.text),K.style.display="block"):K.style.display="none"},Q=()=>{se(),L.style.transform=n.style.transform,L.style.left=n.style.left,L.style.top=n.style.top};new ResizeObserver(Q).observe(G),Q();let Y=t.kind==="slides"?"page":"play",ie=0,ce;const J=q=>Math.max(0,r.parts.findIndex(de=>q>=de.start&&q<de.end));Y==="page"&&(ie=J(B),ue.setAttribute("aria-pressed","true"),ue.textContent="Play all");let ne=-1,le=0,pe=0;const oe=q=>r.parts.find(de=>q>=de.start&&q<de.end)?.key,fe=async(q,de=!1)=>{const be=Math.min(Math.floor(q*u+1e-9),Math.round(o*u));(be!==ne||de)&&(ne=be,await t.seek(be/u),ae.value=String(be),ae.setAttribute("aria-valuetext",fmt(q)),re.textContent=`${fmt(q)} / ${fmt(i)}`),ee(q);const xe=realNow();(de||xe-pe>250)&&(pe=xe,e.post?.({type:"time",t:q,part:oe(q),playing:x,mode:Y}))},me={play:'<svg width="12" height="14" viewBox="0 0 12 14" aria-hidden="true"><path d="M1 1.2v11.6a.6.6 0 0 0 .9.5l9.6-5.8a.6.6 0 0 0 0-1L1.9.7a.6.6 0 0 0-.9.5Z" fill="currentColor"/></svg>',pause:'<svg width="12" height="14" viewBox="0 0 12 14" aria-hidden="true"><rect x="1" y="1" width="3.5" height="12" rx=".6" fill="currentColor"/><rect x="7.5" y="1" width="3.5" height="12" rx=".6" fill="currentColor"/></svg>'},Ce=()=>{te.innerHTML=x?me.pause:me.play,te.setAttribute("aria-label",x?"pause":"play")},De=()=>{for(const q of M)try{q.stop()}catch{}M=[];for(const q of _)q.disconnect();_=[]},_e=q=>k+Math.max(0,q-$);function Be(){if(!y||$>=y.duration)return;const q=a.createGain();q.connect(a.destination),_.push(q);const de=a.createBufferSource();de.buffer=y,de.connect(q),M.push(de),de.start(_e($),$)}function he(q=T()){I++,x=!1,t.setPlaying(!1),B=Math.min(Math.max(q,0),o),De(),Ce(),fe(B,!0)}async function ge(){const q=++I;if(B>=o&&(B=0),await a.resume().catch(()=>{}),q!==I)return;$=B,k=a.currentTime+.05,w=realNow()+50,F=y!==void 0&&a.state==="running",!F&&b.length&&!Ae&&$e(!0),N={ctx:a.currentTime,real:realNow()},x=!0,t.setPlaying(!0),Ce(),Be();const de=()=>{if(le++,!x||q!==I)return;P();const be=T();if(be>=o){he(o);return}if(ce!==void 0&&be>=ce){const xe=r.parts[ie]?.still??ce;ce=void 0,he(xe);return}fe(be),realRaf(de)};realRaf(de)}function ye(q){const de=x;ce=void 0,he(q),de&&ge()}let Ae=!1;function $e(q){W=q&&b.length>0,ve.setAttribute("aria-pressed",String(W)),ve.style.background=W?S:"transparent",ve.style.color=W?Z:S,ee(T())}function we(q){Y=q,ue.setAttribute("aria-pressed",String(q==="page")),ue.textContent=q==="page"?"Play all":"Pages",ce=void 0,q==="page"?ke(J(T())):fe(T(),!0)}function ke(q){ie=Math.min(Math.max(q,0),r.parts.length-1),ce=void 0,he(r.parts[ie]?.still??0)}function Fe(){if(x){ce=void 0,he();return}if(Y==="page"){const q=r.parts[ie];q&&(B=q.start,ce=q.end-1/u)}ge()}return te.addEventListener("click",q=>{q.stopPropagation(),Fe()}),G.addEventListener("click",Fe),ae.addEventListener("input",()=>{ye(Number(ae.value)/u),Y==="page"&&(ie=J(Number(ae.value)/u))}),ve.addEventListener("click",q=>{q.stopPropagation(),Ae=!0,$e(!W)}),ue.addEventListener("click",q=>{q.stopPropagation(),we(Y==="page"?"play":"page")}),addEventListener("keydown",q=>{if(!(q.metaKey||q.ctrlKey||q.altKey)){if(q.key===" "||q.key==="k")Fe();else if(q.key==="ArrowRight")Y==="page"?ke(ie+1):ye(T()+5);else if(q.key==="ArrowLeft")Y==="page"?ke(ie-1):ye(T()-5);else if(q.key==="c"&&b.length)Ae=!0,$e(!W);else if(q.key==="f")document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen().catch(()=>{});else return;q.preventDefault()}}),Ce(),await fe(B,!0),e.post?.({type:"ready",duration:i,parts:r.parts}),g.length>0&&(e.post?.({type:"sound",denoising:!0}),Promise.all(g.map(async({key:q,url:de})=>{const be=await d(de);if(!be||(h.set(q,be),A(),!x))return;const xe=T();De(),$=xe,k=a.currentTime,w=realNow(),Be()})).then(()=>{e.post?.({type:"sound",denoising:!1})})),{command(q){if(q.type==="play"){if(!x){if(Y==="page"){const de=r.parts[ie];de&&(ce=de.end-1/u)}ge()}}else q.type==="pause"?he():q.type==="seek"&&Number.isFinite(q.t)?(ye(q.t),Y==="page"&&(ie=J(q.t))):q.type==="mode"?we(q.mode):q.type==="next"?ke(ie+1):q.type==="prev"?ke(ie-1):q.type==="captions"&&(Ae=!0,$e(q.on))},now:T,state:()=>({playing:x,audioClock:F,audio:a.state,t:T(),frame:ne,ticks:le,generation:I,sounds:M.length,sfx:l.sfx.length,mode:Y,page:ie,captions:W,caption:K.style.display==="none"?"":K.textContent,cues:b.length})}}var MOST=3,MOST_TEXT=120,area2=e=>e.width*e.height;function ownText(e){return[...e.childNodes].filter(t=>t.nodeType===Node.TEXT_NODE).map(t=>t.textContent).join("").trim()}function locateLayers(e,t){const n=i=>i.width>0&&i.height>0&&touches(t,i),r=[],u=[];for(const i of e.querySelectorAll(".ak-layer")){if(!i.checkVisibility({opacityProperty:!0,visibilityProperty:!0})||!n(i.getBoundingClientRect()))continue;const a={part:i.closest(".ak-part")?.dataset.key??"",layer:i.dataset.component??""};let s;for(const d of[i,...i.querySelectorAll("*")]){const f=d.getBoundingClientRect();!n(f)||ownText(d)===""&&!d.hasAttribute("data-ak")||(!s||area2(f)<area2(s.getBoundingClientRect()))&&(s=d)}if(!s){u.push(a);continue}const c=s.closest("[data-ak]")?.getAttribute("data-ak"),l=ownText(s).slice(0,MOST_TEXT);r.push({...a,...c?{name:c}:{},...l===""?{}:{text:l}})}return[...r,...u].slice(0,MOST)}var EMU_PER_INCH=914400,EMU_PER_PT=12700,EMU_PER_MM=36e3,Emu=e=>Math.trunc(e),Inches=e=>Math.trunc(e*EMU_PER_INCH),Pt=e=>Math.trunc(e*EMU_PER_PT),Mm=e=>Math.trunc(e*EMU_PER_MM),SLIDE_SIZES={"16:9":[Emu(12192e3),Emu(6858e3)],"16:10":[Emu(9144e3),Emu(5715e3)],"4:3":[Emu(9144e3),Emu(6858e3)],a4:[Mm(297),Mm(210)],"a4-portrait":[Mm(210),Mm(297)],letter:[Inches(11),Inches(8.5)],"letter-portrait":[Inches(8.5),Inches(11)],"1:1":[Emu(6858e3),Emu(6858e3)],"4:5":[Emu(6858e3),Emu(8572500)],"9:16":[Emu(6858e3),Emu(12192e3)]},HINT="allyhub slides capabilities lists what of python-pptx the API holds and where it differs.";function strict2(e,t,n={}){return strict(e,t,HINT,n)}function strictEnum2(e,t){return strictEnum(e,t,HINT)}var MSO_THEME_COLOR=strictEnum2("MSO_THEME_COLOR",{DARK_1:"dk1",LIGHT_1:"lt1",DARK_2:"dk2",LIGHT_2:"lt2",ACCENT_1:"accent1",ACCENT_2:"accent2",ACCENT_3:"accent3",ACCENT_4:"accent4",ACCENT_5:"accent5",ACCENT_6:"accent6",HYPERLINK:"hlink",FOLLOWED_HYPERLINK:"folHlink",TEXT_1:"dk1",BACKGROUND_1:"lt1",TEXT_2:"dk2",BACKGROUND_2:"lt2"}),PP_ALIGN=strictEnum2("PP_ALIGN",{LEFT:"l",CENTER:"ctr",RIGHT:"r",JUSTIFY:"just"}),MSO_ANCHOR=strictEnum2("MSO_ANCHOR",{TOP:"t",MIDDLE:"ctr",BOTTOM:"b"}),MSO_AUTO_SIZE=strictEnum2("MSO_AUTO_SIZE",{NONE:"none",SHAPE_TO_FIT_TEXT:"shape",TEXT_TO_FIT_SHAPE:"text"}),PP_PLACEHOLDER=strictEnum2("PP_PLACEHOLDER",{TITLE:"title",CENTER_TITLE:"ctrTitle",SUBTITLE:"subTitle",BODY:"body",PICTURE:"pic",MEDIA_CLIP:"media",OBJECT:"obj",DATE:"dt",FOOTER:"ftr",SLIDE_NUMBER:"sldNum"}),MSO_SHAPE=strictEnum2("MSO_SHAPE",{RECTANGLE:"rect",ROUNDED_RECTANGLE:"roundRect",OVAL:"ellipse",ISOSCELES_TRIANGLE:"triangle",RIGHT_ARROW:"rightArrow"}),MSO_CONNECTOR=strictEnum2("MSO_CONNECTOR",{STRAIGHT:"line"}),MSO_LINE=strictEnum2("MSO_LINE",{SOLID:"solid",SQUARE_DOT:"sysDash",ROUND_DOT:"sysDot",DASH:"dash",DASH_DOT:"dashDot",DASH_DOT_DOT:"lgDashDotDot",LONG_DASH:"lgDash",LONG_DASH_DOT:"lgDashDot"}),MSO_ARROWHEAD=strictEnum2("MSO_ARROWHEAD",{NONE:"none",TRIANGLE:"triangle",OPEN:"arrow",STEALTH:"stealth",DIAMOND:"diamond",OVAL:"oval"}),MSO_SHAPE_TYPE=strictEnum2("MSO_SHAPE_TYPE",{AUTO_SHAPE:"autoshape",FREEFORM:"freeform",GROUP:"group",LINE:"line",TABLE:"table",CHART:"chart",MEDIA:"movie",PICTURE:"picture",PLACEHOLDER:"placeholder",TEXT_BOX:"textbox",COMPONENT:"component"}),XL_CHART_TYPE=strictEnum2("XL_CHART_TYPE",{COLUMN_CLUSTERED:"column-clustered",COLUMN_STACKED:"column-stacked",COLUMN_STACKED_100:"column-stacked-100",BAR_CLUSTERED:"bar-clustered",BAR_STACKED:"bar-stacked",BAR_STACKED_100:"bar-stacked-100",LINE:"line",LINE_MARKERS:"line-markers",AREA:"area",AREA_STACKED:"area-stacked",AREA_STACKED_100:"area-stacked-100",PIE:"pie",DOUGHNUT:"doughnut"}),XL_LEGEND_POSITION=strictEnum2("XL_LEGEND_POSITION",{BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"}),XL_LABEL_POSITION=strictEnum2("XL_LABEL_POSITION",{ABOVE:"t",BELOW:"b",BEST_FIT:"bestFit",CENTER:"ctr",INSIDE_BASE:"inBase",INSIDE_END:"inEnd",LEFT:"l",OUTSIDE_END:"outEnd",RIGHT:"r"}),MSO_FILL=strictEnum2("MSO_FILL",{SOLID:"solid",BACKGROUND:"background"}),THEME_FONT=strictEnum2("THEME_FONT",{MAJOR:"+mj-lt",MINOR:"+mn-lt"}),ARGS={M:2,L:2,C:6,Z:0};function pathSteps(e){const t=[],n=e.trim().match(/[A-Za-z]|-?[\d.]+(?:e-?\d+)?/gu)??[];let r=0;for(;r<n.length;){const u=n[r]??"",i=ARGS[u];if(i===void 0)return;const o=n.slice(r+1,r+1+i).map(Number);if(o.length<i||o.some(m=>!Number.isFinite(m)))return;r+=1+i;const[a=0,s=0,c=0,l=0,d=0,f=0]=o;u==="Z"?t.push({op:"close"}):u==="M"?t.push({op:"move",x:a,y:s}):u==="L"?t.push({op:"line",x:a,y:s}):t.push({op:"curve",x1:a,y1:s,x2:c,y2:l,x:d,y:f})}return t[0]?.op==="move"?t:void 0}var ANIMATION_DURATIONS={appear:0,fade:.5,wipe:.5,"fly-in":.5,zoom:.5,disappear:0,"fade-out":.5,"wipe-out":.5,"fly-out":.5,"zoom-out":.5,pulse:.5,path:2},EXITS=new Set(["disappear","fade-out","wipe-out","fly-out","zoom-out"]),ENTRANCES=new Set(["appear","fade","wipe","fly-in","zoom"]),isExit=e=>EXITS.has(e),isEntrance=e=>ENTRANCES.has(e),TRANSITION_DURATIONS={fade:.7,push:1,wipe:1,morph:2},resolveTransition=e=>({type:e.type,direction:e.direction??"from-right",duration:e.duration??TRANSITION_DURATIONS[e.type]}),SIDES={"from-left":{x:-1,y:0},"from-right":{x:1,y:0},"from-top":{x:0,y:-1},"from-bottom":{x:0,y:1}};function transitionAt2(e,t){const n={opacity:1,x:0,y:0};if(e.type==="fade")return{incoming:{...n,opacity:t},outgoing:{x:0,y:0}};if(e.type==="push"){const r=SIDES[e.direction];return{incoming:{...n,x:r.x*(1-t),y:r.y*(1-t)},outgoing:{x:-r.x*t,y:-r.y*t}}}return e.type==="wipe"?{incoming:{...n,clip:wiped(e.direction,1-t)},outgoing:{x:0,y:0}}:{incoming:n,outgoing:{x:0,y:0}}}function morphFrame(e,t,n){const r=n*n*(3-2*n),u=(i,o)=>i+(o-i)*r;return{left:u(e.left,t.left),top:u(e.top,t.top),width:u(e.width,t.width),height:u(e.height,t.height)}}function resolveAnimation(e){const t=e.path===void 0?void 0:pathSteps(e.path);if(!(e.path!==void 0&&!t)&&!(e.effect==="path"&&!t))return{shape:e.shape,...e.paragraph===void 0?{}:{paragraph:e.paragraph},effect:e.effect,direction:e.direction??"from-bottom",start:e.start??"on-click",duration:e.duration??ANIMATION_DURATIONS[e.effect],delay:e.delay??0,...t?{path:t.map(n=>n.op==="close"?n:n.op!=="curve"?{...n,x:n.x*EMU_PER_PT,y:n.y*EMU_PER_PT}:{op:"curve",x1:n.x1*EMU_PER_PT,y1:n.y1*EMU_PER_PT,x2:n.x2*EMU_PER_PT,y2:n.y2*EMU_PER_PT,x:n.x*EMU_PER_PT,y:n.y*EMU_PER_PT})}:{}}}function slideClock(e,t,n,r=0,u=0){const i=new Set(e.filter(d=>isEntrance(d.effect)).map(d=>d.shape));let o=u+(t.some(d=>!i.has(d))?n:0);if(e.length===0)return{timed:[],rests:[Math.max(n,u)]};const a=[],s=[];let c=0,l=u;for(const d of e){d.start==="on-click"?(a.push(o),c++,o+=r,l=o):d.start==="after-previous"&&(l=o);const f=l+d.delay,m=f+d.duration;s.push({...d,step:c,from:f,to:m}),o=Math.max(o,m),t.includes(d.shape)&&isEntrance(d.effect)&&(o=Math.max(o,f+n))}return a.push(o),{timed:s,rests:a}}var SLIDE_SECONDS=4,DECK_FPS=30,onFrame=e=>Math.ceil(e*DECK_FPS-1e-6)/DECK_FPS;function clockOf(e,t){const n=t?0:e.transition?.duration??0,r=slideClock(e.animations,e.shapes.flatMap(u=>u.component?[u.name]:[]),SLIDE_SECONDS-1/DECK_FPS,1/DECK_FPS,n);return{timed:r.timed,rests:r.rests.map(onFrame),lead:n,comesOn:u=>r.timed.find(i=>i.shape===u&&isEntrance(i.effect))?.from??n,goesOff:u=>r.timed.find(i=>i.shape===u&&isExit(i.effect))?.to}}var MOMENT=1e-6,AT_REST={hidden:!1,opacity:1,x:0,y:0,scale:1},decel=e=>1-(1-e)*(1-e);function flatten(e){const t=[];let n={x:0,y:0};for(const r of e){if(r.op==="close")continue;if(r.op!=="curve"){n={x:r.x,y:r.y},t.push(n);continue}const u=n;for(let i=1;i<=24;i++){const o=i/24,a=1-o,s=(c,l,d,f)=>a*a*a*c+3*a*a*o*l+3*a*o*o*d+o*o*o*f;t.push({x:s(u.x,r.x1,r.x2,r.x),y:s(u.y,r.y1,r.y2,r.y)})}n={x:r.x,y:r.y}}return t}function pathPoint(e,t){const n=flatten(e),[r]=n;if(!r)return{x:0,y:0};let u=0;for(let o=1;o<n.length;o++){const[a,s]=[n[o-1]??r,n[o]??r];u+=Math.hypot(s.x-a.x,s.y-a.y)}let i=u*t;for(let o=1;o<n.length;o++){const[a,s]=[n[o-1]??r,n[o]??r],c=Math.hypot(s.x-a.x,s.y-a.y);if(i<=c&&c>0){const l=i/c;return{x:a.x+(s.x-a.x)*l,y:a.y+(s.y-a.y)*l}}i-=c}return n.at(-1)??r}function offSlide(e,t,n){return e==="from-left"?{x:-(t.left+t.width),y:0}:e==="from-right"?{x:n.width-t.left,y:0}:e==="from-top"?{x:0,y:-(t.top+t.height)}:{x:0,y:n.height-t.top}}function wiped(e,t){const n={top:0,right:0,bottom:0,left:0};return e==="from-left"?n.right=t:e==="from-right"?n.left=t:e==="from-top"?n.bottom=t:n.top=t,n}function appearing(e,t,n,r){if(e.effect==="fade"||e.effect==="fade-out")return{opacity:t};if(e.effect==="zoom"||e.effect==="zoom-out")return{scale:t,opacity:t};if(e.effect==="wipe"||e.effect==="wipe-out")return{clip:wiped(e.direction,1-t)};if(e.effect==="fly-in"||e.effect==="fly-out"){const u=offSlide(e.direction,n,r);return{x:u.x*(1-t),y:u.y*(1-t)}}return{}}function drawnAt2(e,t,n,r){let u={...AT_REST};const[i]=e,o=a=>t<a-MOMENT;if(i&&isEntrance(i.effect)&&o(i.from))return{...AT_REST,hidden:!0};for(const a of e){if(o(a.from))break;const s=a.to>a.from?Math.min(1,(t-a.from)/(a.to-a.from)):1;if(a.effect==="path"&&a.path){const c=pathPoint(a.path,s);u={...u,x:c.x,y:c.y}}else a.effect==="pulse"?u={...u,scale:1+.05*Math.sin(s*Math.PI)}:isExit(a.effect)?u=s>=1?{...AT_REST,hidden:!0}:{...u,...appearing(a,1-(a.effect==="fly-out"?s*s:s),n,r)}:u={...AT_REST,...s<1?appearing(a,a.effect==="fly-in"?decel(s):s,n,r):{}}}return u}function animationTargets(e){const t=new Map;for(const n of e){const r=JSON.stringify([n.shape,n.paragraph??null]),u=t.get(r);u?u.animations.push(n):t.set(r,{shape:n.shape,...n.paragraph===void 0?{}:{paragraph:n.paragraph},animations:[n]})}return[...t.values()]}var codeToLocale=Object.freeze({1078:"af",1052:"sq",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar-EG",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ar-MA",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"ar-TN",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-AZ",1068:"az-AZ",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",5146:"bs",1026:"bg",1109:"my",1027:"ca",2052:"zh-CN",3076:"zh-HK",5124:"zh-MO",4100:"zh-SG",1028:"zh-TW",1050:"hr",1029:"cs",1030:"da",1125:"dv",2067:"nl-BE",1043:"nl-NL",1126:"bin",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-CB",2057:"en-GB",16393:"en-IN",6153:"en-IE",8201:"en-JM",5129:"en-NZ",13321:"en-PH",7177:"en-ZA",11273:"en-TT",1033:"en-US",12297:"en-ZW",1061:"et",1071:"mk",1080:"fo",1065:"fa",1124:"fil",1035:"fi",2060:"fr-BE",11276:"fr-CM",3084:"fr-CA",9228:"fr-CG",12300:"fr-CI",1036:"fr-FR",5132:"fr-LU",13324:"fr-ML",6156:"fr-MC",14348:"fr-MA",10252:"fr-SN",4108:"fr-CH",7180:"fr",1122:"fy-NL",2108:"gd-IE",1084:"gd",1110:"gl",1079:"ka",3079:"de-AT",1031:"de-DE",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1140:"gn",1095:"gu",1279:"en",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig-NG",1057:"id",1040:"it-IT",2064:"it-CH",1041:"ja",1099:"kn",1120:"ks",1087:"kk",1107:"km",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1142:"la",1062:"lv",1063:"lt",2110:"ms-BN",1086:"ms-MY",1100:"ml",1082:"mt",1112:"mni",1153:"mi",1102:"mr",1104:"mn",2128:"mn",1121:"ne",1044:"no-NO",2068:"no-NO",1096:"or",1045:"pl",1046:"pt-BR",2070:"pt-PT",1094:"pa",1047:"rm",2072:"ro-MO",1048:"ro-RO",1049:"ru",2073:"ru-MO",1083:"se",1103:"sa",3098:"sr-SP",2074:"sr-SP",1072:"st",1074:"tn",1113:"sd",1115:"si",1051:"sk",1060:"sl",1143:"so",1070:"sb",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",1034:"es-ES",14346:"es-UY",8202:"es-VE",1089:"sw",2077:"sv-FI",1053:"sv-SE",1114:"syc",1064:"tg",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1073:"ts",1055:"tr",1090:"tk",1058:"uk",1056:"ur",2115:"uz-UZ",1091:"uz-UZ",1075:"ve",1066:"vi",1106:"cy",1076:"xh",1085:"yi",1077:"zu"}),TOKEN_GENERAL="GENERAL",TOKEN_HASH="HASH",TOKEN_ZERO="ZERO",TOKEN_QMARK="QMARK",TOKEN_SLASH="SLASH",TOKEN_GROUP="GROUP",TOKEN_SCALE="SCALE",TOKEN_COMMA="COMMA",TOKEN_BREAK="BREAK",TOKEN_TEXT="TEXT",TOKEN_PLUS="PLUS",TOKEN_MINUS="MINUS",TOKEN_POINT="POINT",TOKEN_SPACE="SPACE",TOKEN_PERCENT="PERCENT",TOKEN_DIGIT="DIGIT",TOKEN_CALENDAR="CALENDAR",TOKEN_ERROR="ERROR",TOKEN_DATETIME="DATETIME",TOKEN_DURATION="DURATION",TOKEN_CONDITION="CONDITION",TOKEN_DBNUM="DBNUM",TOKEN_NATNUM="NATNUM",TOKEN_LOCALE="LOCALE",TOKEN_COLOR="COLOR",TOKEN_MODIFIER="MODIFIER",TOKEN_AMPM="AMPM",TOKEN_ESCAPED="ESCAPED",TOKEN_STRING="STRING",TOKEN_SKIP="SKIP",TOKEN_FILL="FILL",TOKEN_PAREN="PAREN",TOKEN_CHAR="CHAR",TOKEN_CURRENCY="CURRENCY",T_TYPE_FRAC="FRAC",T_TYPE_YEAR="YEAR",T_TYPE_YEAR_S="YEAR-SHORT",T_TYPE_MON="MONTH",T_TYPE_MNAME_1="MONTHNAME-SINGLE",T_TYPE_MNAME_S="MONTHNAME-SHORT",T_TYPE_MNAME="MONTHNAME",T_TYPE_WEEKDAY_S="WEEKDAY-SHORT",T_TYPE_WEEKDAY="WEEKDAY",T_TYPE_HOUR="HOUR",T_TYPE_SUBSEC="SUBSEC",T_TYPE_HOUR_E="HOUR-ELAP",T_TYPE_MIN_E="MIN-ELAP",T_TYPE_SEC_E="SEC-ELAP",T_TYPE_B_YEAR="B-YEAR",T_TYPE_B_YEAR_S="B-YEAR-SHORT",MAX_CACHED_PATTERNS=1e3,currencySymbols=["¤","$","£","¥","֏","؋","৳","฿","៛","₡","₦","₩","₪","₫","€","₭","₮","₱","₲","₴","₸","₹","₺","₼","₽","₾","₿"],_B=(e,t="")=>e.replaceAll("~",t).split(";"),_W=(e,t="")=>_B(e,t),_M=(e,t="")=>_B(e,t),xm=(e,t=0,n=0)=>(e.mmm||(e.mmm=t<1?e.mmmm.concat():e.mmmm.map(r=>{const u=r.slice(0,t%10);return u+(t<10||r===u?"":".")})),e.ddd||(e.ddd=n<1?e.dddd.concat():e.dddd.map(r=>{const u=r.slice(0,n%10);return u+(n<10||r===u?"":".")})),!e.mmm6&&e.mmmm6&&(e.mmm6=e.mmmm6),e),xf=e=>({minus:!e.p,sign:!!e.s,dateOrder:e.o??1,currencyPos:e.f??3,padMm:e.m==null?!0:!!e.m,padDd:e.d==null?!0:!!e.d,padHh:e.h==null?!0:!!e.h,padHhAlt:!!e.i,dateSep:e.k??"/",shortDateSep:e.l??"-",timeSep:e.b??":",shortYear:!!e.y,spacePercent:!!e.c}),C_BLACK="Black",C_WHITE="White",C_RED="Red",C_GREEN="Green",C_BLUE="Blue",C_YELLOW="Yellow",C_MAGENTA="Magenta",C_CYAN="Cyan",fp1={k:".",l:"."},fp2={d:0,h:0,m:0,k:".",l:"."},fp3={d:1,y:1,f:0,o:1,k:"-",b:":",s:1},fp4={...fp3,y:0},fp5={h:0,d:0,f:0,m:0,s:1};function initLocales(){const e=_M("一月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月"),t={黑色:C_BLACK,白色:C_WHITE,紅色:C_RED,綠色:C_GREEN,藍色:C_BLUE,黃色:C_YELLOW,洋紅:C_MAGENTA,青色:C_CYAN};addLocale({group:",",ampm:_B("上午;下午"),mmmm:e,mmm:_M("1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月"),dddd:_W("~日;~一;~二;~三;~四;~五;~六","星期"),ddd:_W("周日;周一;周二;周三;周四;周五;周六"),color:"颜色",colors:{黑色:C_BLACK,白色:C_WHITE,红色:C_RED,绿色:C_GREEN,蓝色:C_BLUE,黄色:C_YELLOW,洋红:C_MAGENTA,蓝绿色:C_CYAN},general:"G/通用格式",currency:"¥",format:xf({h:0,d:0,f:0,m:0,o:2,s:1}),sysdate:"yyyy年m月d日",systime:"h:mm:ss"},"zh-CN"),addLocale({group:",",ampm:_B("上午;下午"),mmmm:e,mmm:e,dddd:_W("~日;~一;~二;~三;~四;~五;~六","星期"),ddd:_W("週日;週一;週二;週三;週四;週五;週六"),nan:"非數值",color:"色彩",colors:t,general:"G/通用格式",currency:"NT$",format:xf({d:0,f:0,o:2,m:0,i:1}),sysdate:"yyyy年m月d日",systime:"AM/PM hh:mm:ss"},"zh-TW"),addLocale({group:",",ampm:_B("上午;下午"),mmmm:e,mmm:e,dddd:_W("~日;~一;~二;~三;~四;~五;~六","星期"),ddd:_W("週日;週一;週二;週三;週四;週五;週六"),color:"色彩",colors:t,currency:"HK$",format:xf({h:0,d:0,f:0,m:0,p:1}),sysdate:"yyyy年m月d日",systime:"h:mm:ss"},"zh-HK"),addLocale({group:",",mmmm:_M("1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月"),mmm:_M("1;2;3;4;5;6;7;8;9;10;11;12"),dddd:_W("日曜日;月曜日;火曜日;水曜日;木曜日;金曜日;土曜日"),ddd:_W("日;月;火;水;木;金;土"),ampm:_B("午前;午後"),general:"G/標準",currency:"¥",color:"色",colors:{黒:C_BLACK,白:C_WHITE,赤:C_RED,緑:C_GREEN,青:C_BLUE,黄:C_YELLOW,紫:C_MAGENTA,水:C_CYAN},format:xf({h:0,f:0,o:2,d:1}),sysdate:"yyyy年m月d日",systime:"h:mm:ss"},"ja"),addLocale({group:",",ampm:_B("오전;오후"),mmmm:_M("1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월"),mmm:_M("1;2;3;4;5;6;7;8;9;10;11;12"),dddd:_W("일요일;월요일;화요일;수요일;목요일;금요일;토요일"),ddd:_W("일;월;화;수;목;금;토"),color:"색",colors:{검정:C_BLACK,흰색:C_WHITE,빨강:C_RED,녹색:C_GREEN,파랑:C_BLUE,노랑:C_YELLOW,자홍:C_MAGENTA,녹청:C_CYAN},general:"G/표준",currency:"₩",format:xf({h:0,f:0,o:2,k:"-"}),sysdate:"yyyy년 mmmm d일 dddd",systime:"AM/PM h:mm:ss"},"ko"),addLocale({group:",",mmmm:_M("มกร~;กุมภาพันธ์;มีน~;เมษายน;พฤษภ~;มิถุนายน;กรกฎ~;สิงห~;กันยายน;ตุล~;พฤศจิกายน;ธันว~","าคม"),mmm:_M("ม.ค.;ก.พ.;มี.ค.;เม.ย.;พ.ค.;มิ.ย.;ก.ค.;ส.ค.;ก.ย.;ต.ค.;พ.ย.;ธ.ค."),dddd:_W("อาทิตย์;จันทร์;อังคาร;พุธ;พฤหัสบดี;ศุกร์;เสาร์"),ddd:_W("อา.;จ.;อ.;พ.;พฤ.;ศ.;ส."),color:"สี",colors:{ดำ:C_BLACK,ขาว:C_WHITE,แดง:C_RED,เขียว:C_GREEN,น้ำเงิน:C_BLUE,เหลือง:C_YELLOW,ม่วงมาเจนต้า:C_MAGENTA,ฟ้า:C_CYAN},currency:"฿",format:xf({h:0,d:0,f:0,m:0,o:1}),sysdate:"d mmmm yyyy",systime:"h:mm:ss"},"th"),addLocale(xm({decimal:",",ampm:_B("dop.;odp."),mmmm:_M("leden;únor;březen;duben;květen;červen;červenec;srpen;září;říjen;listopad;prosinec"),mmm:_M("I;II;III;IV;V;VI;VII;VIII;IX;X;XI;XII"),dddd:_W("neděle;pondělí;úterý;středa;čtvrtek;pátek;sobota"),bool:_B("PRAVDA;NEPRAVDA"),color:"Barva",colors:{černá:C_BLACK,bílá:C_WHITE,červená:C_RED,zelená:C_GREEN,modrá:C_BLUE,žlutá:C_YELLOW,purpurová:C_MAGENTA,azurová:C_CYAN},general:"Všeobecný",opcodes:{dy:"r"},currency:"Kč",format:xf({h:0,k:".",l:"."}),sysdate:"dddd d. mmmm yyyy",systime:"h:mm:ss"},-1,2),"cs"),addLocale(xm({group:".",decimal:",",mmmm:_M("januar;februar;marts;april;maj;juni;juli;august;september;oktober;november;december"),dddd:_W("søn~;man~;tirs~;ons~;tors~;fre~;lør~","dag"),bool:_B("SAND;FALSK"),color:"Farve",colors:{sort:C_BLACK,hvid:C_WHITE,rød:C_RED,lysegrøn:C_GREEN,blå:C_BLUE,gul:C_YELLOW,lyslilla:C_MAGENTA,akvamarin:C_CYAN},general:"Standard",opcodes:{dy:"å",th:"t"},currency:"kr.",format:xf({k:"-"}),sysdate:"d. mmmm yyyy",systime:"hh:mm:ss"},3,2),"da"),addLocale(xm({group:".",decimal:",",mmmm:_M("januari;februari;maart;april;mei;juni;juli;augustus;september;oktober;november;december"),mmm:_M("jan;feb;mrt;apr;mei;jun;jul;aug;sep;okt;nov;dec"),dddd:_W("zondag;maandag;dinsdag;woensdag;donderdag;vrijdag;zaterdag"),bool:_B("WAAR;ONWAAR"),color:"Kleur",colors:{zwart:C_BLACK,wit:C_WHITE,rood:C_RED,root:C_RED,groen:C_GREEN,blauw:C_BLUE,geel:C_YELLOW,magenta:C_MAGENTA,cyaan:C_CYAN},general:"Standaard",opcodes:{dy:"j",th:"u"},currency:"€",format:xf({d:0,f:2,m:0,k:"-",s:1}),sysdate:"dddd d mmmm yyyy",systime:"hh:mm:ss"},-1,2),"nl"),addLocale({group:",",format:xf({h:0,d:0,f:0,m:0,o:0,p:1}),sysdate:"dddd, mmmm d, yyyy",systime:"h:mm:ss AM/PM"},"en"),addLocale({group:",",format:xf({h:0,d:0,f:0,m:0,o:0,p:1}),sysdate:"dddd, mmmm d, yyyy",systime:"h:mm:ss AM/PM"},"en-US"),addLocale({group:",",format:xf({h:0,f:0,o:2,p:0,k:"-"}),sysdate:"mmmm d, yyyy",systime:"h:mm:ss AM/PM"},"en-CA"),addLocale({group:",",color:"Colour",ampm:["AM","PM"],format:xf({h:0,d:0,f:0,p:0}),sysdate:"dddd, d mmmm yyyy",systime:"h:mm:ss AM/PM"},"en-AU"),addLocale({group:",",color:"Colour",ampm:["AM","PM"],currency:"£",format:xf({f:0,p:0}),sysdate:"dd mmmm yyyy",systime:"hh:mm:ss"},"en-GB"),addLocale({group:",",mmm:_M("Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sept;Oct;Nov;Dec"),color:"Colour",ampm:["am","pm"],currency:"€",format:xf({f:0,p:0}),sysdate:"dddd d mmmm yyyy",systime:"hh:mm:ss"},"en-IE"),addLocale(xm({decimal:",",nan:"epäluku",ampm:_B("ap.;ip."),mmmm:_M("tammi~;helmi~;maalis~;huhti~;touko~;kesä~;heinä~;elo~;syys~;loka~;marras~;joulu~","kuu"),mmm:_M("tammi;helmi;maalis;huhti;touko;kesä;heinä;elo;syys;loka;marras;joulu"),dddd:_W("sunnun~;maanan~;tiis~;keskiviikko;tors~;perjan~;lauan~","tai"),bool:_B("TOSI;EPÄTOSI"),color:"Väri",colors:{musta:C_BLACK,valkoinen:C_WHITE,punainen:C_RED,vihreä:C_GREEN,sininen:C_BLUE,keltainen:C_YELLOW,magenta:C_MAGENTA,syaani:C_CYAN},general:"Yleinen",currency:"€",opcodes:{dy:"v",dm:"k",dd:"p",th:"t"},format:xf({h:0,d:0,p:0,k:".",l:".",m:0,c:1}),sysdate:"dddd d. mmmm yyyy",systime:"h.mm.ss"},-1,2),"fi");const n=xm({group:" ",decimal:",",mmmm:_M("janvier;février;mars;avril;mai;juin;juillet;août;septembre;octobre;novembre;décembre"),mmm:_M("janv;févr;mars;avr;mai;juin;juil;août;sept;oct;nov;déc"),dddd:_W("~manche;lun~;mar~;mercre~;jeu~;vendre~;same~","di"),ddd:["dim","lun","mar","mer","jeu","ven","sam"],bool:_B("VRAI;FAUX"),color:"Couleur",colors:{noir:C_BLACK,blanc:C_WHITE,rouge:C_RED,vert:C_GREEN,bleu:C_BLUE,jaune:C_YELLOW,magenta:C_MAGENTA,cyan:C_CYAN},opcodes:{dy:"a",dd:"j",wd:"o"},general:"Standard",systime:"hh:mm:ss"},-1,-13);addLocale({...n,currency:"€",format:xf({}),sysdate:"dddd d mmmm yyyy"},"fr"),addLocale({...n,ampm:_B("AM;PM"),format:xf({p:1,o:2,d:1,k:"-",l:"-",s:1}),sysdate:"d mmmm yyyy"},"fr-CA"),addLocale({group:"'",decimal:".",...n,currency:"CHF",format:xf({o:1,d:1,k:".",l:"."}),sysdate:"dddd, d mmmm yyyy"},"fr-CH");const r=xm({mmmm:_M("Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember"),mmm:_M("Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez"),dddd:_W("Sonn~;Mon~;Diens~;Mittwoch;Donners~;Frei~;Sams~","tag"),bool:_B("WAHR;FALSCH"),color:"Farbe",colors:{schwarz:C_BLACK,weiß:C_WHITE,rot:C_RED,grün:C_GREEN,blau:C_BLUE,gelb:C_YELLOW,magenta:C_MAGENTA,zyan:C_CYAN},opcodes:{dy:"j",dd:"t"},general:"Standard",sysdate:"dddd, d. mmmm yyyy",systime:"hh:mm:ss"},-1,2);addLocale({group:".",decimal:",",...r,currency:"€",format:xf({k:".",l:". "})},"de"),addLocale({group:"’",decimal:".",...r,currency:"CHF",mmm:_M("Jan;Feb;Mär;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez"),format:xf({o:1,d:1,k:".",f:2,s:1,l:". "})},"de-CH"),addLocale(xm({group:".",decimal:",",ampm:_B("πμ;μμ"),mmmm:_M("Ιανουαρ~;Φεβρουαρ~;Μαρτ~;Απριλ~;Μαΐου;Ιουν~;Ιουλ~;Αυγούστου;Σεπτεμβρ~;Οκτωβρ~;Νοεμβρ~;Δεκεμβρ~","ίου"),mmm:_M("Ιαν;Φεβ;Μαρ;Απρ;Μαϊ;Ιουν;Ιουλ;Αυγ;Σεπ;Οκτ;Νοε;Δεκ"),dddd:_W("Κυριακή;Δευτέρα;Τρίτη;Τετάρτη;Πέμπτη;Παρασκευή;Σάββατο"),ddd:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],colors:{μαύρο:C_BLACK,λευκό:C_WHITE,κόκκινο:C_RED,πράσινο:C_GREEN,μπλε:C_BLUE,κίτρινο:C_YELLOW,ματζέντα:C_MAGENTA,γαλάζιο:C_CYAN},general:"Γενικός τύπος",color:"Χρώμα",opcodes:{dy:"ε",dm:"μ",dd:"η",th:"ω",tm:"λ",ts:"δ"},currency:"€",format:xf({h:0,d:0,m:0}),sysdate:"dddd, d mmmm yyyy",systime:"h:mm:ss AM/PM"},-1,3),"el"),addLocale({decimal:",",ampm:_B("de.;du."),mmmm:_M("január;február;március;április;május;június;július;augusztus;szeptember;október;november;december"),mmm:_M("jan;febr;márc;ápr;máj;jún;júl;aug;szept;okt;nov;dec"),dddd:_W("vasárnap;hétfő;kedd;szerda;csütörtök;péntek;szombat"),ddd:_W("V;H;K;Sze;Cs;P;Szo"),bool:_B("IGAZ;HAMIS"),currency:"Ft",general:"Normál",opcodes:{dy:"é",dm:"h",dd:"n",th:"ó",tm:"p",ts:"m"},colors:{fekete:C_BLACK,fehér:C_WHITE,piros:C_RED,zöld:C_GREEN,kék:C_BLUE,sárga:C_YELLOW,bíbor:C_MAGENTA,ciánkék:C_CYAN},color:"Szín",format:xf({h:0,o:2,k:".",l:".",d:1}),sysdate:'yyyy. mmmm d".", dddd',systime:"h:mm:ss"},"hu"),addLocale(xm({group:".",decimal:",",ampm:_B("f.h.;e.h."),mmmm:_M("janúar;febrúar;mars;apríl;maí;júní;júlí;ágúst;september;október;nóvember;desember"),dddd:_W("sunnu~;mánu~;þriðju~;miðviku~;fimmtu~;föstu~;laugar~","dagur"),currency:"kr.",format:xf({d:0,m:0,k:".",l:"."}),sysdate:"dddd, d. mmmm yyyy",systime:"hh:mm:ss"},3,3),"is"),addLocale(xm({group:".",decimal:",",ampm:_B("AM;PM"),mmmm:_M("Januari;Februari;Maret;April;Mei;Juni;Juli;Agustus;September;Oktober;November;Desember"),dddd:_W("Minggu;Senin;Selasa;Rabu;Kamis;Jumat;Sabtu"),ddd:_W("Mgg;Sen;Sel;Rab;Kam;Jum;Sab"),color:"Warna",colors:{hitam:C_BLACK,putih:C_WHITE,merah:C_RED,hijau:C_GREEN,biru:C_BLUE,kuning:C_YELLOW,magenta:C_MAGENTA,sian:C_CYAN},currency:"Rp",format:xf({f:0,b:"."}),sysdate:"dddd, dd mmmm yyyy",systime:"hh.mm.ss"},3,3),"id");const u=xm({mmmm:_M("gennaio;febbraio;marzo;aprile;maggio;giugno;luglio;agosto;settembre;ottobre;novembre;dicembre"),dddd:_W("domenica;lunedì;martedì;mercoledì;giovedì;venerdì;sabato"),bool:_B("VERO;FALSO"),general:"Standard",color:"Colore",colors:{nero:C_BLACK,bianco:C_WHITE,rosso:C_RED,verde:C_GREEN,blu:C_BLUE,giallo:C_YELLOW,fucsia:C_MAGENTA,celeste:C_CYAN,ciano:C_CYAN},opcodes:{dy:"a",dd:"g",wd:"o",en:"x"},systime:"hh:mm:ss"},3,3);addLocale({group:".",decimal:",",...u,currency:"€",format:xf({}),sysdate:"dddd d mmmm yyyy"},"it"),addLocale({group:"’",decimal:".",...u,currency:"CHF",format:xf({o:1,d:1,k:".",l:".",f:2,s:1}),sysdate:"dddd, d mmmm yyyy"},"it-CH");const i={decimal:",",ampm:_B("a.m.;p.m."),mmmm:_M("januar;februar;mars;april;mai;juni;juli;august;september;oktober;november;desember"),mmm:_M("jan;feb;mar;apr;mai;jun;jul;aug;sep;okt;nov;des"),dddd:_W("søn~;man~;tirs~;ons~;tors~;fre~;lør~","dag"),bool:_B("SANN;USANN"),color:"Farge",colors:{svart:C_BLACK,hvit:C_WHITE,rød:C_RED,grønn:C_GREEN,blå:C_BLUE,gul:C_YELLOW,magenta:C_MAGENTA,cyan:C_CYAN},general:"Standard",opcodes:{dy:"å",th:"t"},currency:"kr",sysdate:"dddd d. mmmm yyyy",systime:"hh:mm:ss"};addLocale(xm({...i,format:xf({f:2,c:1,k:".",l:".",s:1})},-1,3),"nb"),addLocale(xm({...i,format:xf({f:2,c:1,k:".",l:".",s:1})},-1,3),"no"),addLocale(xm({decimal:",",mmmm:_M("styczeń;luty;marzec;kwiecień;maj;czerwiec;lipiec;sierpień;wrzesień;październik;listopad;grudzień"),dddd:_W("niedziela;poniedziałek;wtorek;środa;czwartek;piątek;sobota"),ddd:_W("niedz;pon;wt;śr;czw;pt;sob"),bool:_B("PRAWDA;FAŁSZ"),color:"Kolor",colors:{czarny:C_BLACK,biały:C_WHITE,czerwony:C_RED,zielony:C_GREEN,niebieski:C_BLUE,żółty:C_YELLOW,amarantowy:C_MAGENTA,błękitny:C_CYAN},general:"Standardowy",opcodes:{dy:"r",th:"g"},currency:"zł",format:xf({d:0,k:".",l:"."}),sysdate:"dddd, d mmmm yyyy",systime:"hh:mm:ss"},3,-1),"pl");const o={decimal:",",mmmm:_M("janeiro;fevereiro;março;abril;maio;junho;julho;agosto;setembro;outubro;novembro;dezembro"),dddd:_W("domingo;segunda-feira;terça-feira;quarta-feira;quinta-feira;sexta-feira;sábado"),bool:_B("VERDADEIRO;FALSO"),opcodes:{dy:"a",wd:"o"},color:"Cor"};addLocale({...xm(o,3,3),group:" ",general:"Estandar",colors:{preto:C_BLACK,branco:C_WHITE,vermelho:C_RED,verde:C_GREEN,azul:C_BLUE,amarelo:C_YELLOW,magenta:C_MAGENTA,turquesa:C_CYAN,ciano:C_CYAN},currency:"€",format:xf({l:"/"}),sysdate:'d "de" mmmm "de" yyyy',systime:"hh:mm:ss"},"pt"),addLocale({...xm(o,3,3),group:".",general:"Geral",colors:{preto:C_BLACK,branco:C_WHITE,vermelho:C_RED,verde:C_GREEN,azul:C_BLUE,amarelo:C_YELLOW,magenta:C_MAGENTA,ciano:C_CYAN},currency:"R$",format:xf({f:2,l:"/"}),sysdate:'dddd, d "de" mmmm "de" yyyy',systime:"hh:mm:ss"},"pt-BR"),addLocale({decimal:",",nan:"не число",mmmm:_M("Январь;Февраль;Март;Апрель;Май;Июнь;Июль;Август;Сентябрь;Октябрь;Ноябрь;Декабрь"),mmm:_M("янв;фев;мар;апр;май;июн;июл;авг;сен;окт;ноя;дек"),dddd:_W("воскресенье;понедельник;вторник;среда;четверг;пятница;суббота"),ddd:_W("Вс;Пн;Вт;Ср;Чт;Пт;Сб"),mmmm6:_M("рамадан;шавваль;зуль-каада;зуль-хиджжа;мухаррам;раби-уль-авваль;раби-уль-ахир;джумад-уль-авваль;джумад-уль-ахир;раджаб;шаабан;рамадан"),mmm6:_M("рам.;шав.;зуль-к.;зуль-х.;мух.;раб. I;раб. II;джум. I;джум. II;радж.;шааб.;рам."),bool:_B("ИСТИНА;ЛОЖЬ"),general:"Основной",opcodes:{dy:"г",dm:"м",dd:"д",th:"ч",tm:"м",ts:"с"},color:"Цвет",colors:{черный:C_BLACK,белый:C_WHITE,красный:C_RED,зеленый:C_GREEN,синий:C_BLUE,желтый:C_YELLOW,фиолетовый:C_MAGENTA,пурпурный:C_MAGENTA,голубой:C_CYAN},currency:"₽",format:xf({h:0,k:".",l:"."}),sysdate:'d mmmm yyyy "г."',systime:"h:mm:ss"},"ru"),addLocale(xm({decimal:",",mmmm:_M("január;február;marec;apríl;máj;jún;júl;august;september;október;november;december"),mmm:_M("1;2;3;4;5;6;7;8;9;10;11;12"),dddd:_W("nedeľa;pondelok;utorok;streda;štvrtok;piatok;sobota"),color:"Farba",colors:{čierna:C_BLACK,biela:C_WHITE,červená:C_RED,zelená:C_GREEN,modrá:C_BLUE,žltá:C_YELLOW,purpurová:C_MAGENTA,azúrová:C_CYAN},currency:"€",format:xf(fp2),sysdate:"dddd d. mmmm yyyy",systime:"h:mm:ss"},3,2),"sk");const a={group:".",decimal:",",ampm:_B("a. m.;p. m."),mmmm:_M("enero;febrero;marzo;abril;mayo;junio;julio;agosto;septiem~;octu~;noviem~;diciem~","bre"),mmm:_M("ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic"),dddd:_W("domingo;lunes;martes;miércoles;jueves;viernes;sábado"),ddd:_W("dom;lun;mar;mié;jue;vie;sáb"),bool:_B("VERDADERO;FALSO"),colors:{negro:C_BLACK,blanco:C_WHITE,rojo:C_RED,verde:C_GREEN,azul:C_BLUE,amarillo:C_YELLOW,magenta:C_MAGENTA,cian:C_CYAN,ciano:C_CYAN},systime:"h:mm:ss",sysdate:'dddd, d "de" mmmm "de" yyyy'},s=_M("ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic"),c=_M("ene;feb;mar;abr;may;jun;jul;ago;sept;oct;nov;dic");addLocale({...a,ampm:_B("AM;PM"),ddd:_W("do;lu;ma;mi;ju;vi;sá"),general:"Estándar",opcodes:{dy:"a",wd:"o"},currency:"€",format:xf({h:0,d:1})},"es"),addLocale({...a,mmm:c,format:xf({d:0,f:2,m:0}),systime:"hh:mm:ss"},"es-AR"),addLocale({...a,mmm:c,currency:"Bs",format:xf({d:0,f:0,m:0}),systime:"hh:mm:ss"},"es-BO"),addLocale({...a,mmm:c,format:xf({h:0,f:0,s:1,k:"-"})},"es-CL"),addLocale({...a,mmm:s,format:xf({h:0,d:0,f:2}),systime:"h:mm:ss AM/PM"},"es-CO"),addLocale({...a,mmm:c,format:xf(fp5)},"es-EC"),addLocale({...a,mmm:c,currency:"₲",format:xf({d:0,f:2,s:1,m:0}),systime:"hh:mm:ss"},"es-PY"),addLocale({...a,group:",",decimal:".",mmm:s,ampm:_B("a. m.;p. m."),opcodes:{dy:"a",wd:"o"},general:"Estándar",format:xf({f:0,i:1}),systime:"hh:mm:ss AM/PM"},"es-MX"),addLocale({...a,mmmm:_M("Enero;Febrero;Marzo;Abril;Mayo;Junio;Julio;Agosto;Setiembre;Octubre;Noviembre;Diciembre"),mmm:_M("Ene;Feb;Mar;Abr;May;Jun;Jul;Ago;set;Oct;Nov;Dic"),format:xf({d:0,f:2,h:0,m:0})},"es-UY"),addLocale({...a,mmm:c,currency:"Bs.S",format:xf(fp5),systime:"h:mm:ss AM/PM"},"es-VE"),addLocale(xm({decimal:",",ampm:_B("fm;em"),mmmm:_M("januari;februari;mars;april;maj;juni;juli;augusti;september;oktober;november;december"),dddd:_W("sön~;mån~;tis~;ons~;tors~;fre~;lör~","dag"),opcodes:{dy:"å",th:"t"},bool:["SANT","FALSKT"],general:"Standard",color:"Färg",colors:{svart:C_BLACK,vit:C_WHITE,röd:C_RED,grön:C_GREEN,blå:C_BLUE,gul:C_YELLOW,magenta:C_MAGENTA,cyanblå:C_CYAN},currency:"kr",format:xf({o:2,k:"-"}),sysdate:'"den" d mmmm yyyy',systime:"hh:mm:ss"},3,3),"sv"),addLocale(xm({group:".",decimal:",",ampm:_B("ÖÖ;ÖS"),mmmm:_M("Ocak;Şubat;Mart;Nisan;Mayıs;Haziran;Temmuz;Ağustos;Eylül;Ekim;Kasım;Aralık"),mmm:_M("Oca;Şub;Mar;Nis;May;Haz;Tem;Ağu;Eyl;Eki;Kas;Ara"),dddd:_W("Pazar;Pazartesi;Salı;Çarşamba;Perşembe;Cuma;Cumartesi"),ddd:_W("Paz;Pzt;Sal;Çar;Per;Cum;Cmt"),bool:_B("DOĞRU;YANLIŞ"),color:"Renk",colors:{siyah:C_BLACK,beyaz:C_WHITE,kırmızı:C_RED,yeşil:C_GREEN,mavi:C_BLUE,sarı:C_YELLOW,pembe:C_MAGENTA,camgöbeği:C_CYAN},opcodes:{dm:"a",dd:"g",th:"s",tm:"d",ts:"n"},general:"Genel",currency:"₺",format:xf({d:0,f:0,k:".",l:"."}),sysdate:"d mmmm yyyy dddd",systime:"hh:mm:ss"},3,-1),"tr"),addLocale({group:",",ampm:_B("AM;PM"),mmmm:_M("Ionawr;Chwefror;Mawrth;Ebrill;Mai;Mehefin;Gorffennaf;Awst;Medi;Hydref;Tachwedd;Rhagfyr"),mmm:_M("Ion;Chwef;Maw;Ebr;Mai;Meh;Gorff;Awst;Medi;Hyd;Tach;Rhag"),dddd:_W("Dydd Sul;Dydd Llun;Dydd Mawrth;Dydd Mercher;Dydd Iau;Dydd Gwener;Dydd Sadwrn"),ddd:_W("Sul;Llun;Maw;Mer;Iau;Gwe;Sad"),currency:"£",format:xf({f:0,p:0}),sysdate:"dddd, d mmmm yyyy",systime:"hh:mm:ss"},"cy"),addLocale({group:".",decimal:",",mmmm:_M("yanvar;fevral;mart;aprel;may;iyun;iyul;avqust;sentyabr;oktyabr;noyabr;dekabr"),mmm:_M("yan;fev;mar;apr;may;iyn;iyl;avq;sen;okt;noy;dek"),dddd:_W("bazar;bazar ertəsi;çərşənbə axşamı;çərşənbə;cümə axşamı;cümə;şənbə"),ddd:_W("B;B.E;Ç.A;Ç;C.A;C;Ş"),currency:"₼",format:xf(fp1),sysdate:"d mmmm yyyy, dddd",systime:"hh:mm:ss"},"az"),addLocale(xm({decimal:",",mmmm:_M("студзень;люты;сакавік;красавік;май;чэрвень;ліпень;жнівень;верасень;кастрычнік;лістапад;снежань"),mmm:_M("студз;лют;сак;крас;май;чэрв;ліп;жн;вер;кастр;ліст;снеж"),dddd:_W("нядзеля;панядзелак;аўторак;серада;чацвер;пятніца;субота"),ddd:_W("нд;пн;аўт;ср;чц;пт;сб"),currency:"Br",format:xf({y:1,k:".",l:"."}),sysdate:"d mmmm yyyy",systime:"hh:mm:ss"},3,-1),"be"),addLocale({decimal:",",mmmm:_M("януари;февруари;март;април;май;юни;юли;август;септември;октомври;ноември;декември"),mmm:_M("яну;фев;мар;апр;май;юни;юли;авг;сеп;окт;ное;дек"),dddd:_W("неделя;понеделник;вторник;сряда;четвъртък;петък;събота"),ddd:_W("нед;пон;вт;ср;четв;пет;съб"),currency:"лв.",format:xf(fp2),sysdate:'dd mmmm yyyy "г."',systime:"h:mm:ss"},"bg"),addLocale({group:".",decimal:",",mmmm:_M("gener;febrer;març;abril;maig;juny;juliol;agost;setembre;octubre;novembre;desembre"),mmm:_M("gen;febr;març;abr;maig;juny;jul;ag;set;oct;nov;des"),dddd:_W("diumenge;dilluns;dimarts;dimecres;dijous;divendres;dissabte"),ddd:_W("dg;dl;dt;dc;dj;dv;ds"),general:"Estándar",opcodes:{dy:"a",wd:"o"},ampm:_B("a. m.;p. m."),currency:"€",format:xf({d:0,o:1,h:0,m:0}),sysdate:'dddd, d mmmm "de" yyyy',systime:"h:mm:ss"},"ca"),addLocale(xm({group:",",decimal:".",mmmm:_M("Enero;Pebrero;Marso;Abril;Mayo;Hunyo;Hulyo;Agosto;Setyembre;Oktubre;Nobyembre;Disyembre"),dddd:_W("Linggo;Lunes;Martes;Miyerkules;Huwebes;Biyernes;Sabado"),currency:"₱",format:xf({h:0,d:0,f:0,m:0,o:0}),sysdate:"dddd, mmmm d, yyyy",systime:"h:mm:ss AM/PM"},3,3),"fil"),addLocale({group:",",decimal:".",ampm:["પૂર્વ મધ્યાહ્ન","ઉત્તર મધ્યાહ્ન"],mmmm:_M("જાન્યુઆરી;ફેબ્રુઆરી;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટેમ્બર;ઑક્ટોબર;નવેમ્બર;ડિસેમ્બર"),mmm:_M("જાન્યુ;ફેબ્રુ;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગ;સપ્ટે;ઑક્ટો;નવે;ડિસે"),dddd:_W("રવિ~;સોમ~;મંગળ~;બુધ~;ગુરુ~;શુક્ર~;શનિ~","વાર"),ddd:_W("રવિ;સોમ;મંગળ;બુધ;ગુરુ;શુક્ર;શનિ"),currency:"₹",format:xf(fp3),sysdate:"dd mmmm yyyy",systime:"hh:mm:ss"},"gu"),addLocale({group:",",decimal:".",ampm:_B("לפ׳;אח׳"),dddd:["יום ראשון","יום שני","יום שלישי","יום רביעי","יום חמישי","יום שישי","שבת"],ddd:["יום א","יום ב","יום ג","יום ד","יום ה","יום ו","שבת"],mmmm:_M("ינואר;פברואר;מרץ;אפריל;מאי;יוני;יולי;אוגוסט;ספטמבר;אוקטובר;נובמבר;דצמבר"),mmm:_M("ינו;פבר;מרץ;אפר;מאי;יונ;יול;אוג;ספט;אוק;נוב;דצמ"),mmmm6:_M("רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע אל־אוול;רביע א־ת׳אני;ג׳ומאדא אל־אולא;ג׳ומאדא א־ת׳אניה;רג׳ב;שעבאן;רמדאן"),mmm6:_M("רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע א׳;רביע ב׳;ג׳ומאדא א׳;ג׳ומאדא ב׳;רג׳ב;שעבאן;רמדאן"),color:"צבע",colors:{שחור:C_BLACK,לבן:C_WHITE,אדום:C_RED,ירוק:C_GREEN,כחול:C_BLUE,צהוב:C_YELLOW,"אדום ארגמן":C_MAGENTA,תכלת:C_CYAN},currency:"₪",format:xf({f:2,s:1}),sysdate:"dddd dd mmmm yyyy",systime:"hh:mm:ss"},"he"),addLocale(xm({group:".",decimal:",",mmmm:_M("siječanj;veljača;ožujak;travanj;svibanj;lipanj;srpanj;kolovoz;rujan;listopad;studeni;prosinac"),mmm:_M("sij;vlj;ožu;tra;svi;lip;srp;kol;ruj;lis;stu;pro"),dddd:_W("nedjelja;ponedjeljak;utorak;srijeda;četvrtak;petak;subota"),currency:"€",format:xf(fp2),sysdate:"d. mmmm yyyy.",systime:"h:mm:ss"},-1,3),"hr"),addLocale({decimal:",",mmmm:_M("Հունվար;Փետրվար;Մարտ;Ապրիլ;Մայիս;Հունիս;Հուլիս;Օգոստոս;Սեպտեմբեր;Հոկտեմբեր;Նոյեմբեր;Դեկտեմբեր"),mmm:_M("Հնվ;Փտվ;Մրտ;Ապր;Մյս;Հնս;Հլս;Օգս;Սպտ;Հկտ;Նյմ;Դկտ"),dddd:_W("Կիրակի;Երկուշաբթի;Երեքշաբթի;Չորեքշաբթի;Հինգշաբթի;Ուրբաթ;Շաբաթ"),ddd:_W("Կիր;Երկ;Երք;Չրք;Հնգ;Ուր;Շբթ"),currency:"֏",format:xf(fp1),sysdate:"d mmmm, yyyy",systime:"hh:mm:ss"},"hy"),addLocale(xm({decimal:",",mmmm:_M("იანვარი;თებერვალი;მარტი;აპრილი;მაისი;ივნისი;ივლისი;აგვისტო;სექტემბერი;ოქტომბერი;ნოემბერი;დეკემბერი"),dddd:_W("კვირა;ორშაბათი;სამშაბათი;ოთხშაბათი;ხუთშაბათი;პარასკევი;შაბათი"),ddd:_W("კვ;ორშ;სამშ;ოთხშ;ხუთშ;პარ;შაბ"),currency:"₾",format:xf(fp1),sysdate:"dddd, dd mmmm, yyyy",systime:"hh:mm:ss"},3,-1),"ka"),addLocale(xm({decimal:",",mmmm:_M("Қаңтар;Ақпан;Наурыз;Сәуір;Мамыр;Маусым;Шілде;Тамыз;Қыркүйек;Қазан;Қараша;Желтоқсан"),mmm:_M("қаң;ақп;нау;сәу;мам;мау;шіл;там;қыр;қаз;қар;жел"),dddd:_W("жексенбі;дүйсенбі;сейсенбі;сәрсенбі;бейсенбі;жұма;сенбі"),ddd:_W("жек;дүй;сей;сәр;бей;жұм;сен"),opcodes:{dy:"г",dm:"м",dd:"д",th:"ч",tm:"м",ts:"с"},currency:"₸",general:"Основной",format:xf(fp1),sysdate:"yyyy ж. d mmmm, dddd",systime:"hh:mm:ss"},-1,-1),"kk"),addLocale({group:",",mmmm:_M("ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಏಪ್ರಿಲ್;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟಂಬರ್;ಅಕ್ಟೋಬರ್;ನವೆಂಬರ್;ಡಿಸೆಂಬರ್"),mmm:_M("ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಎಪ್ರಿಲ್;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟಂಬರ್;ಅಕ್ಟೋಬರ್;ನವೆಂಬರ್;ಡಿಸೆಂಬರ್"),dddd:_W("ಭಾನು~;ಸೋಮ~;ಮಂಗಳ~;ಬುಧ~;ಗುರು~;ಶುಕ್ರ~;ಶನಿ~","ವಾರ"),ddd:_W("ಭಾನು;ಸೋಮ;ಮಂಗಳ;ಬುಧ;ಗುರು;ಶುಕ್ರ;ಶನಿ"),ampm:_B("ಪೂರ್ವಾಹ್ನ;ಅಪರಾಹ್ನ"),currency:"₹",format:xf(fp3),sysdate:"dd mmmm yyyy",systime:"hh:mm:ss"},"kn"),addLocale({decimal:",",mmmm:_M("sausis;vasaris;kovas;balandis;gegužė;birželis;liepa;rugpjūtis;rugsėjis;spalis;lapkritis;gruodis"),mmm:_M("saus;vas;kov;bal;geg;birž;liep;rugp;rugs;spal;lapkr;gruod"),dddd:_W("sekmadienis;pirmadienis;antradienis;trečiadienis;ketvirtadienis;penktadienis;šeštadienis"),ddd:_W("sk;pr;an;tr;kt;pn;št"),ampm:_B("priešpiet;popiet"),currency:"€",format:xf({o:2,k:"-"}),sysdate:'yyyy "m." mmmm d "d.," dddd',systime:"hh:mm:ss"},"lt"),addLocale({decimal:",",mmmm:_M("janvāris;februāris;marts;aprīlis;maijs;jūnijs;jūlijs;augusts;septembris;oktobris;novembris;decembris"),mmm:_M("janv;febr;marts;apr;maijs;jūn;jūl;aug;sept;okt;nov;dec"),dddd:_W("svētdiena;pirmdiena;otrdiena;trešdiena;ceturtdiena;piektdiena;sestdiena"),ddd:_W("Svētd;Pirmd;Otrd;Trešd;Ceturtd;Piektd;Sestd"),ampm:_B("priekšp.;pēcp."),currency:"€",format:xf(fp1),sysdate:'dddd, yyyy. "gada" d. mmmm',systime:"hh:mm:ss"},"lv"),addLocale({group:",",decimal:".",mmmm:_M("ജനുവരി;ഫെബ്രുവരി;മാര്‍‌ച്ച്;ഏപ്രില്‍;മേയ്;ജൂൺ;ജൂലൈ;ആഗസ്റ്റ്;സെപ്‌റ്റംബര്‍;ഒക്‌ടോബര്‍;നവംബര്‍;ഡിസംബര്‍"),mmm:_M("ജനു;ഫെബ്രു;മാർ;ഏപ്രി;മേയ്;ജൂൺ;ജൂലൈ;ഓഗ;സെപ്റ്റം;ഒക്ടോ;നവം;ഡിസം"),dddd:_W("ഞായറാഴ്‌ച;തിങ്കളാഴ്‌ച;ചൊവ്വാഴ്ച;ബുധനാഴ്‌ച;വ്യാഴാഴ്‌ച;വെള്ളിയാഴ്‌ച;ശനിയാഴ്‌ച"),ddd:_W("ഞായർ;തിങ്കൾ;ചൊവ്വ;ബുധൻ;വ്യാഴം;വെള്ളി;ശനി"),currency:"₹",format:xf({d:0,m:0,h:0,y:0,f:0,o:1,k:"/",b:":",s:0}),sysdate:"yyyy, mmmm d, dddd",systime:"h:mm:ss AM/PM"},"ml"),addLocale({group:",",decimal:".",mmmm:_M("Нэгдүгээ~;Хоёрдугаа~;Гуравдугаа~;Дөрөвдүгээ~;Тавдугаа~;Зургаадугаа~;Долоодугаа~;Наймдугаа~;Есдүгээ~;Аравдугаа~;Арван нэгдүгээ~;Арван хоёрдугаар са","р сар"),mmm:_M("1~;2~;3~;4~;5~;6~;7~;8~;9~;10~;11~;12~","-р сар"),dddd:_W("ням;даваа;мягмар;лхагва;пүрэв;баасан;бямба"),ddd:_W("Ня;Да;Мя;Лха;Пү;Ба;Бя"),ampm:_B("ү.ө.;ү.х."),currency:"₮",format:xf({o:2,f:2,k:".",l:"."}),sysdate:"yyyy оны mmmmын d, dddd гараг",systime:"hh:mm:ss"},"mn"),addLocale({group:",",decimal:".",ampm:["म.पू.","म.नं."],mmmm:_M("जानेवारी;फेब्रुवारी;मार्च;एप्रिल;मे;जून;जुलै;ऑगस्ट;सप्टेंबर;ऑक्टोबर;नोव्हेंबर;डिसेंबर"),mmm:_M("जाने;फेब्रु;मार्च;एप्रि;मे;जून;जुलै;ऑग;सप्टें;ऑक्टो;नोव्हें;डिसें"),dddd:_W("रविवार;सोमवार;मंगळवार;बुधवार;गुरुवार;शुक्रवार;शनिवार"),ddd:_W("रवि;सोम;मंगळ;बुध;गुरु;शुक्र;शनि"),currency:"₹",format:xf(fp4),sysdate:"dd mmmm yyyy",systime:"hh:mm:ss"},"mr"),addLocale(xm({group:",",decimal:".",mmmm:_M("ဇန်နဝါရီ;ဖေဖော်ဝါရီ;မတ်;ဧပြီ;မေ;ဇွန်;ဇူလိုင်;ဩဂုတ်;စက်တင်ဘာ;အောက်တိုဘာ;နိုဝင်ဘာ;ဒီဇင်ဘာ"),mmm:_M("ဇန်;ဖေ;မတ်;ဧ;မေ;ဇွန်;ဇူ;ဩ;စက်;အောက်;နို;ဒီ"),dddd:_W("တနင်္ဂနွေ;တနင်္လာ;အင်္ဂါ;ဗုဒ္ဓဟူး;ကြာသပတေး;သောကြာ;စနေ"),ampm:_B("နံနက်;ညနေ"),currency:"K",format:xf({h:0,d:0,m:0}),sysdate:"yyyy၊ mmmm d၊ dddd",systime:"h:mm:ss"},-1,0),"my"),addLocale(xm({group:",",decimal:".",mmmm:_M("ਜਨਵਰੀ;ਫ਼ਰਵਰੀ;ਮਾਰਚ;ਅਪ੍ਰੈਲ;ਮਈ;ਜੂਨ;ਜੁਲਾਈ;ਅਗਸਤ;ਸਤੰਬਰ;ਅਕਤੂਬਰ;ਨਵੰਬਰ;ਦਸੰਬਰ"),dddd:_W("ਐਤਵਾਰ;ਸੋਮਵਾਰ;ਮੰਗਲਵਾਰ;ਬੁੱਧਵਾਰ;ਵੀਰਵਾਰ;ਸ਼ੁੱਕਰਵਾਰ;ਸ਼ਨਿੱਚਰਵਾਰ"),ddd:_W("ਐਤ;ਸੋਮ;ਮੰਗਲ;ਬੁੱਧ;ਵੀਰ;ਸ਼ੁਕਰ;ਸ਼ਨਿੱਚਰ"),ampm:["ਸਵੇਰ","ਸ਼ਾਮ"],currency:"₹",format:xf({d:1,i:1,y:1,f:2,o:1,k:"-",b:":",s:1}),sysdate:"dd mmmm yyyy dddd",systime:"AM/PM hh:mm:ss"}),"pa"),addLocale({group:".",decimal:",",mmmm:_M("ianuarie;februarie;martie;aprilie;mai;iunie;iulie;august;septem~;octom~;noiem~;decem~","brie"),mmm:_M("ian;feb;mar;apr;mai;iun;iul;aug;sept;oct;nov;dec"),dddd:_W("duminică;luni;marți;miercuri;joi;vineri;sâmbătă"),ddd:_W("dum;lun;mar;mie;joi;vin;sâm"),ampm:_B("a.m.;p.m."),currency:"lei",format:xf(fp1),sysdate:"dddd, d mmmm yyyy",systime:"hh:mm:ss"},"ro"),addLocale(xm({group:".",decimal:",",mmmm:_M("januar;februar;marec;april;maj;junij;julij;avgust;september;oktober;november;december"),dddd:_W("nedelja;ponedeljek;torek;sreda;četrtek;petek;sobota"),ampm:_B("dop.;pop."),currency:"€",format:xf({d:0,k:".",l:"."}),sysdate:"dddd, d. mmmm yyyy",systime:"hh:mm:ss"},3,3),"sl"),addLocale(xm({group:".",decimal:",",mmmm:_M("januar;februar;mart;april;maj;jun;jul;avgust;septembar;oktobar;novembar;decembar"),dddd:_W("nedelja;ponedeljak;utorak;sreda;četvrtak;petak;subota"),currency:"RSD",format:xf({d:0,m:0,k:".",l:"."}),sysdate:"dddd, d. mmmm yyyy.",systime:"hh:mm:ss"},3,3),"sr"),addLocale(xm({group:",",decimal:".",ampm:["காலை","மாலை"],mmmm:_M("ஜனவரி;பிப்ரவரி;மார்ச்;ஏப்ரல்;மே;ஜூன்;ஜூலை;ஆகஸ்ட்;செப்டம்பர்;அக்டோபர்;நவம்பர்;டிசம்பர்"),dddd:_W("ஞாயிறு;திங்கள்;செவ்வாய்;புதன்;வியாழன்;வெள்ளி;சனி"),currency:"₹",format:xf({d:1,y:0,f:2,o:1,k:"-",b:":",s:1}),sysdate:"dd mmmm yyyy",systime:"hh:mm:ss"}),"ta"),addLocale({group:",",decimal:".",mmmm:_M("జనవరి;ఫిబ్రవరి;మార్చి;ఏప్రిల్;మే;జూన్;జులై;ఆగస్టు;సెప్టెంబర్;అక్టోబర్;నవంబర్;డిసెంబర్"),mmm:_M("జన;ఫిబ్ర;మార్చి;ఏప్రి;మే;జూన్;జులై;ఆగ;సెప్టెం;అక్టో;నవం;డిసెం"),dddd:_W("ఆదివారం;సోమవారం;మంగళవారం;బుధవారం;గురువారం;శుక్రవారం;శనివారం"),ddd:_W("ఆది;సోమ;మంగళ;బుధ;గురు;శుక్ర;శని"),currency:"₹",format:xf({d:1,h:0,y:0,f:0,o:1,k:"-",b:":",s:0}),sysdate:"d, mmmm yyyy, dddd",systime:"h:mm:ss AM/PM"},"te"),addLocale({decimal:",",mmmm:_M("січень;лютий;березень;квітень;травень;червень;липень;серпень;вересень;жовтень;листопад;грудень"),mmm:_M("Січ;Лют;Бер;Кві;Тра;Чер;Лип;Сер;Вер;Жов;Лис;Гру"),dddd:_W("неділя;понеділок;вівторок;середа;четвер;п'ятниця;субота"),ddd:_W("Нд;Пн;Вт;Ср;Чт;Пт;Сб"),ampm:_B("дп;пп"),currency:"₴",format:xf({h:0,k:".",l:"."}),sysdate:'d mmmm yyyy "р."',systime:"h:mm:ss"},"uk"),addLocale({group:".",decimal:",",mmmm:_M("~Giêng;~Hai;~Ba;~Tư;~Năm;~Sáu;~Bảy;~Tám;~Chín;~Mười;~Mười Một;~Mười Hai","Tháng "),mmm:_M("~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12","Thg"),dddd:_W("Chủ Nhật;~Hai;~Ba;~Tư;~Năm;~Sáu;~Bảy","Thứ "),ddd:_W("CN;T2;T3;T4;T5;T6;T7"),ampm:_B("SA;CH"),currency:"₫",format:xf({h:0,d:1}),sysdate:"dd mmmm yyyy",systime:"h:mm:ss AM/PM"},"vi"),addLocale(xm({group:"٬",decimal:"٫",ampm:_B("ص;م"),percent:"٪",mmmm:_M("يناير;فبراير;مارس;أبريل;مايو;يونيو;يوليو;أغسطس;سبتمبر;أكتوبر;نوفمبر;ديسمبر"),dddd:_W("الأحد;الإثنين;الثلاثاء;الأربعاء;الخميس;الجمعة;السبت"),mmmm6:_M("رمضان;شوال;ذو القعدة;ذو الحجة;محرم;ربيع الأول;ربيع الآخرة;جمادى الأولى;جمادى الآخرة;رجب;شعبان;رمضان"),color:"اللون",colors:{أسود:C_BLACK,أبيض:C_WHITE,أحمر:C_RED,أخضر:C_GREEN,أزرق:C_BLUE,أصفر:C_YELLOW,ماجنتا:C_MAGENTA,سماوي:C_CYAN},currency:"⃁",format:xf({f:2,i:1,y:1,s:1}),sysdate:"dd/mmmm/yyyy",systime:"hh:mm:ss AM/PM"},0,0),"ar"),addLocale({group:",",decimal:".",ampm:["AM","PM"],mmmm:_M("জানুয়ারী;ফেব্রুয়ারী;মার্চ;এপ্রিল;মে;জুন;জুলাই;আগস্ট;সেপ্টেম্বর;অক্টোবর;নভেম্বর;ডিসেম্বর"),mmm:_M("জানু;ফেব্রু;মার্চ;এপ্রিল;মে;জুন;জুলাই;আগ;সেপ্টে;অক্টো;নভে;ডিসে"),dddd:_W("রবিবার;সোমবার;মঙ্গলবার;বুধবার;বৃহস্পতিবার;শুক্রবার;শনিবার"),ddd:_W("রবি.;সোম.;মঙ্গল.;বুধ.;বৃহস্পতি.;শুক্র.;শনি."),currency:"₹",format:xf({f:2,y:1,k:"-",b:".",s:1}),sysdate:"dd mmmm yyyy",systime:"hh.mm.ss"},"bn"),addLocale({group:",",decimal:".",mmmm:_M("जनवरी;फरवरी;मार्च;अप्रैल;मई;जून;जुलाई;अगस्त;सितम्बर;अक्तूबर;नवम्बर;दिसम्बर"),mmm:_M("जनवरी;फरवरी;मार्च;अप्रैल;मई;जून;जुलाई;अगस्त;सितम्बर;अक्तूबर;नवम्बर;दिसम्बर"),dddd:_W("रविवार;सोमवार;मंगलवार;बुधवार;गुरुवार;शुक्रवार;शनिवार"),ddd:_W("रवि.;सोम.;मंगल.;बुध.;गुरु.;शुक्र.;शनि."),ampm:["पूर्वाह्न","अपराह्न"],currency:"₹",format:xf(fp4),sysdate:"dd mmmm yyyy",systime:"hh:mm:ss"},"hi")}var reEsc=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),reCurrencySymbol=new RegExp("^["+reEsc(currencySymbols.join(""))+"]");function getTokenHandlers(e){const t=[];t.push([TOKEN_GENERAL,/^General/i,0]),e.general&&e.general!=="General"&&t.push([TOKEN_GENERAL,new RegExp(`^${reEsc(e.general)}`,"i"),0]),e.colors&&t.push([TOKEN_COLOR,new RegExp(`^\\[(${Object.keys(e.colors).map(reEsc).join("|")})\\]`,"i"),1]),e.color&&t.push([TOKEN_COLOR,new RegExp(`^\\[(${reEsc(e.color)}\\s*\\d+)\\]`,"i"),1]);let n,r;if(e.opcodes){const u=reEsc(e.opcodes.dy??"y"),i=reEsc(e.opcodes.dm??"m"),o=reEsc(e.opcodes.dd??"d"),a=reEsc(e.opcodes.th??"h"),s=reEsc(e.opcodes.tm??"m"),c=reEsc(e.opcodes.ts??"s"),l=reEsc(e.opcodes.wd??"a"),d=reEsc(e.opcodes.en??"g"),f=`[${u+u.toUpperCase()}]+|[${i+i.toUpperCase()}]+|[${o+o.toUpperCase()}]+|[${a+a.toUpperCase()}]+|[${s+s.toUpperCase()}]+|[${c+c.toUpperCase()}]+|[${l+l.toUpperCase()}]{3,}|[${d+d.toUpperCase()}]+|[bB]+|e+`;n=new RegExp(`^(?:${f})`),r=new RegExp(`^(?:\\[(${reEsc(a)}+|${reEsc(s)}+|${reEsc(c)}+)\\]+)`,"i")}else n=/^(?:[hH]+|[mM]+|[sS]+|[yY]+|[bB]+|[dD]+|[gG]+|[aA]{3,}|e+)/,r=/^(?:\[(h+|m+|s+)\])/i;return(e.currency.length>1||!currencySymbols.includes(e.currency))&&t.push([TOKEN_CURRENCY,new RegExp(`^(?:${reEsc(e.currency)})`),0]),t.push([TOKEN_HASH,/^#/,0],[TOKEN_ZERO,/^0/,0],[TOKEN_QMARK,/^\?/,0],[TOKEN_SLASH,/^\//,0],[TOKEN_BREAK,/^;/,0],[TOKEN_TEXT,/^@/,0],[TOKEN_PLUS,/^\+/,0],[TOKEN_MINUS,/^-/,0],[TOKEN_POINT,/^\./,0],[TOKEN_SPACE,/^ /,0],[TOKEN_PERCENT,/^%/,0],[TOKEN_AMPM,/^(?:AM\/PM|am\/pm|A\/P)/,0],[TOKEN_CURRENCY,reCurrencySymbol,0],[TOKEN_DIGIT,/^[1-9]/,0],[TOKEN_CALENDAR,/^(?:B[12])/i,0],[TOKEN_ERROR,/^B$/,0],[TOKEN_DATETIME,n,0],[TOKEN_DURATION,r,1],[TOKEN_CONDITION,/^\[((?:<[=>]?|>=?|=)\s*(?:-?[.\d]+))\]/,1],[TOKEN_DBNUM,/^\[(DBNum[0-4]?\d)\]/i,1],[TOKEN_NATNUM,/^\[(NatNum[0-4]?\d)\]/i,1],[TOKEN_LOCALE,/^\[\$([^\]]*)\]/,1],[TOKEN_COLOR,/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*\d+)\]/i,1],[TOKEN_MODIFIER,/^\[([^\]])\]/,1],[TOKEN_ESCAPED,/^\\(.)/,1],[TOKEN_STRING,/^"([^"]*?)"/,1],[TOKEN_SKIP,/^_(\\.|.)/,1],["EXP",/^[Ee]([+-])/,1],[TOKEN_FILL,/^\*(\\.|.)/,1],[TOKEN_PAREN,/^[()]/,0],[TOKEN_ERROR,/^[EÈÉÊËèéêëĒēĔĕĖėĘęĚěȄȅȆȇȨȩNnÑñŃńŅņŇňǸǹ["*/\\_]/,0],[TOKEN_CHAR,/^./,0]),t}var CODE_QMRK=63,CODE_HASH=35,CODE_ZERO=48,CODE_NINE=57,isNumOp$2=e=>{const t=(e||"\0").charCodeAt(0);return t===CODE_QMRK||t===CODE_HASH||t>=CODE_ZERO&&t<=CODE_NINE};function lexer(e,t){let n=0;const r=[],u=[];for(;n<e.length;){const i=e.slice(n);let o=0;const a=/^(,+)(.)?/.exec(i);if(a){const s=a[1];o=s.length;const c=e[n-1]||"";let l=!1,d=!1;isNumOp$2(c)?(l=!0,d=!0):c==="."&&(d=!0);const f=a[2]||"";if(l&&(!f||f===";")&&(l=!1),d&&isNumOp$2(f)&&(d=!1),l&&!d)r.push({type:TOKEN_GROUP,value:",",raw:s});else if(!l&&d)r.push({type:TOKEN_SCALE,value:",",raw:s});else if(l&&d){const m={type:TOKEN_SCALE,value:",",raw:s};r.push(m),u.push(m)}else r.push({type:TOKEN_COMMA,value:",",raw:s})}else{let s;for(const[c,l,d]of t){const f=l.exec(i);if(f){s={type:c,value:f[d||0],raw:f[0]},r.push(s),o=f[0].length;break}}u.length&&s?.raw===";"&&(u.length=0),s&&u.length&&isNumOp$2(s.raw)&&(u.forEach(c=>c.type=TOKEN_GROUP),u.length=0)}if(!o){const s=i[0];o=1,r.push({type:TOKEN_CHAR,value:s,raw:s})}n+=o}return r}function tokenize(e){return lexer(e,getTokenHandlers(defaultLocale))}var re_locale=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,locales={},baseLocaleData={group:" ",decimal:".",positive:"+",negative:"-",percent:"%",exponent:"E",nan:"NaN",infinity:"∞",ampm:["AM","PM"],mmmm6:["Muharram","Safar","Rabiʻ I","Rabiʻ II","Jumada I","Jumada II","Rajab","Shaʻban","Ramadan","Shawwal","Dhuʻl-Qiʻdah","Dhuʻl-Hijjah"],mmm6:["Muh.","Saf.","Rab. I","Rab. II","Jum. I","Jum. II","Raj.","Sha.","Ram.","Shaw.","Dhuʻl-Q.","Dhuʻl-H."],mmmm:["January","February","March","April","May","June","July","August","September","October","November","December"],mmm:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dddd:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ddd:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],bool:["TRUE","FALSE"],general:"General",currency:"$",sysdate:"dddd, mmmm d, yyyy",systime:"h:mm:ss AM/PM",color:"Color",colors:{black:"Black",white:"White",red:"Red",green:"Green",blue:"Blue",yellow:"Yellow",magenta:"Magenta",cyan:"Cyan"},format:{minus:!0,dateOrder:1,currencyPos:2,monthFirst:!0,padMm:!0,padDd:!0,padHh:!0}};function parseLocale(e){const t=re_locale.exec(e);if(!t)throw new SyntaxError(`Invalid locale: ${e}`);return{lang:t[1]+(t[2]?"-"+t[2]:""),language:t[1],territory:t[2]||""}}function resolveLocale(e){if(typeof e=="number")return codeToLocale[e&65535]||void 0;const t=parseInt(e,16);if(isFinite(t)&&codeToLocale[t&65535])return codeToLocale[t&65535]||void 0;if(re_locale.test(e))return e}function getLocale(e){let t;if(e){const n=resolveLocale(e);if(n){const r=parseLocale(n);t=locales[r.lang]||locales[r.language]||void 0}}return t}function isMonthFirst(e){const t=lexer(e||"",getTokenHandlers(baseLocaleData)),n=t.findIndex(u=>u.type==="DATETIME"&&/^m/i.test(u.value)),r=t.findIndex(u=>u.type==="DATETIME"&&/^dd?$/i.test(u.value));return n>=0&&r>=0&&n<r}function createLocale(e){const t=e.sysdate??baseLocaleData.sysdate;return{...baseLocaleData,...e,opcodes:{...baseLocaleData.opcodes,...e.opcodes},format:{...baseLocaleData.format,...e.format,monthFirst:e.format?.monthFirst??isMonthFirst(t)}}}function addLocale(e,t){const n=typeof t=="object"?t:parseLocale(t);return locales[n.lang]=createLocale(e),n.language!==n.lang&&!locales[n.language]&&(locales[n.language]=createLocale(e)),locales[n.lang]}initLocales();var defaultLocale=getLocale("en");if(!defaultLocale)throw new Error("numfmt default locale is missing!");var defaultOptions={overflow:"######",dateErrorThrows:!1,dateErrorNumber:!0,bigintErrorNumber:!1,dateSpanLarge:!0,leap1900:!0,nbsp:!1,throws:!0,invalid:"######",locale:"",ignoreTimezone:!1,grouping:[3,3],indexColors:!0,skipChar:"",fillChar:""},POW10=[];for(let e=0;e<=22;e++)POW10[e]=10**e;var CHAR_0$1=48,MIN_NORMAL=22250738585072014e-324,SPLIT=134217729;function pow10(e){return e>=0&&e<=22?POW10[e]:10**e}function scale15(e,t){const n=14-t;if(n>=0&&n<=22){const r=POW10[n],u=e*r;let i=SPLIT*e;const o=i-(i-e),a=e-o;i=SPLIT*r;const s=i-(i-r),c=r-s,l=o*s-u+o*c+a*s+a*c,d=Math.floor(u);return u-d-.5>-l?d+1:d}if(n<0&&n>=-22){const r=POW10[-n],u=e%r,i=Math.round((e-u)/r);return u>r/2?i+1:i}return NaN}function fromExponential(e){const t=e.indexOf("e"),n=+e.slice(t+1),r=e.charAt(0)+e.slice(2,t);if(r.length<=15)return[+r*POW10[15-r.length],n];let u=+r.slice(0,15);const i=r.charCodeAt(15);return(i>53||i===53&&/[1-9]/.test(r.slice(16)))&&u++,u>=1e15?[u/10,n+1]:[u,n]}function toDec15(e){if(e<MIN_NORMAL)return fromExponential(e.toExponential());let t=Math.floor(Math.log10(e));e<pow10(t)?t--:e>=pow10(t+1)&&t++;let n=scale15(e,t);return n>=1e15?(t++,n=scale15(e,t)):n<1e14&&(t--,n=scale15(e,t)),n!==n?fromExponential(e.toExponential(14)):n>=1e15?[n/10,t+1]:[n,t]}function fromDec(e,t){return t>=0&&t<=22?e*POW10[t]:t<0&&t>=-22?e/POW10[-t]:+(e+"e"+t)}function roundDigits(e,t){if(t>=15)return e;const n=pow10(15-t),r=Math.floor(e/n);return(e-r*n)*2>=n?r+1:r}function roundPlaces(e,t){if(!e)return[0,0];if(t>=0&&e<1e15&&Number.isInteger(e))return[e,0];const[n,r]=toDec15(e),u=r+1+t;return u>=15?[n,r-14]:[roundDigits(n,u),-t]}function roundSignificand(e,t,n,r){if(!e)return[0,0,0];let[u,i]=toDec15(e);for(;;){let o=n>1?Math.floor(i/n)*n:i;r||o++;const a=i-o+1+t;if(a>=15)return[u,i-14-o,o];const s=roundDigits(u,a);if(a<0||s<pow10(a))return[s,-t,o];u=1e14,i++}}function decToText(e,t){if(!e)return["",""];const n=String(e);if(t>=0)return[t?n+"0".repeat(t):n,""];const r=n.length+t;let u=n.length;for(;u>0&&n.charCodeAt(u-1)===CHAR_0$1;)u--;return[r>0?n.slice(0,r):"",u>r?(r>=0?"":"0".repeat(-r))+n.slice(Math.max(r,0),u):""]}function roundBinary(e,t=0){if(e<0)return-roundBinary(-e,t);if(t){const n=10**t||1;return Math.round(e*n)/n}return Math.round(e)}function round2(e,t=0){return typeof e!="number"?NaN:e<0?-round2(-e,t):!e||!isFinite(e)?e:fromDec(...roundPlaces(e,t))}var PRECISION=1e-13;function dec2frac(e,t=2,n=2){const r=e<0?-1:1,u=10**(t||2),i=10**(n||2);let o=Math.abs(e),a=0,s=0,c=0,l=1,d,f;if(e=o,e%1===0)f=[e*r,1];else if(e<1e-19)f=[r,1e19];else if(e>1e19)f=[1e19*r,1];else{do if(o=1/(o-Math.floor(o)),d=l,l=l*Math.floor(o)+a,a=d,s=c,c=Math.floor(e*l+.5),c>=u||l>=i)return[r*s,a];while(Math.abs(e-c/l)>=PRECISION&&o!==Math.floor(o));f=[r*c,l]}return f}var floor$1=Math.floor;function toYMD_1900(e,t=!0){if(t&&e>=0){if(e===0)return[1900,1,0];if(e===60)return[1900,2,29];if(e<60)return[1900,e<32?1:2,(e-1)%31+1]}let n=e+68569+2415019;const r=floor$1(4*n/146097);n=n-floor$1((146097*r+3)/4);const u=floor$1(4e3*(n+1)/1461001);n=n-floor$1(1461*u/4)+31;const i=floor$1(80*n/2447),o=n-floor$1(2447*i/80);n=floor$1(i/11);const a=i+2-12*n;return[100*(r-49)+u+n|0,a|0,o|0]}function toYMD_1904(e){return toYMD_1900(e+1462)}function toYMD_1317(e){if(e===60)throw new Error("#VALUE!");if(e<=1)return[1317,8,29];if(e<60)return[1317,e<32?9:10,1+(e-2)%30];const t=10631/30,n=8.01/60;let r=e+466935;const u=floor$1(r/10631);r=r-10631*u;const i=floor$1((r-n)/t);r=r-floor$1(i*t+n);const o=floor$1((r+28.5001)/29.5);return o===13?[30*u+i,12,30]:[30*u+i,o,r-floor$1(29.5001*o-29)]}function toYMD(e,t=0,n=!0){const r=floor$1(e);return t===6?toYMD_1317(r):t===-1?toYMD_1904(r):toYMD_1900(r,n)}var floor=Math.floor;function dateToSerial(e,t){let n;if(Array.isArray(e)){const[r,u,i,o,a,s]=e;n=Date.UTC(r,u==null?0:u-1,i??1,o||0,a||0,s||0)}else if(e instanceof Date&&(n=e.valueOf(),!t?.ignoreTimezone)){const r=new Date;r.setUTCFullYear(e.getFullYear(),e.getMonth(),e.getDate()),r.setUTCHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n=r.valueOf()}if(n!=null&&isFinite(n)){const r=floor(n/864e5),u=n-r*864e5;return r-(r<=-25509?-25568:-25569)+u/864e5}}var LRUCache=class{maxSize;entries=new Map;constructor(e){this.maxSize=e}get(e){const t=this.entries.get(e);return t!==void 0&&(this.entries.delete(e),this.entries.set(e,t)),t}set(e,t){this.entries.delete(e),this.entries.set(e,t),this.entries.size>this.maxSize&&this.entries.delete(this.entries.keys().next().value)}getOrSet(e,t){const n=this.entries.has(e)?this.entries.get(e):t(e);return this.set(e,n),n}},okDateFormats=["!d-m-y","!d-m-Y","!j-m-y","!j-m-Y","!d-n-y","!d-n-Y","!j-n-y","!j-n-Y","?m-d-y","?m-d-Y","?m-j-y","?m-j-Y","?n-d-y","?n-d-Y","?n-j-y","?n-j-Y","d-M-y","d-M-Y","j-M-y","j-M-Y","M-d-y","M-d-Y","M-j-y","M-j-Y","d-F-y","d-F-Y","F-d-y","F-d-Y","F-j-y","F-j-Y","j-F-y","j-F-Y","y-F-d","y-F-j","y-M-d","y-M-j","Y-F-d","Y-F-j","Y-M-d","Y-m-d","Y-M-j","Y-m-j","Y-n-d","Y-n-j","j-F","j-M","d-F","d-M","n-d","n-j","n-Y","m-d","m-j","m-Y","M-Y","M-y","F-y","F-Y","Y-M","Y-n","Y-m","Y-F","Y-M"],dateTrieDM={},dateTrieMD={};function packDate(e,t,n=1){if(e){const r=e[0],u=e.slice(1);r==="!"?packDate(u,t,4):r==="?"?packDate(u,t,2):(t[r]=t[r]||{},packDate(u,t[r],n))}else t.$=n}function addFormatToTrie(e,t){packDate(e,t),packDate(e+" x",t),packDate(e+" l",t),packDate(e+" l x",t),packDate("l "+e,t),packDate("l "+e+" x",t),packDate(e+" D",t),packDate(e+" D x",t),packDate("D "+e,t),packDate("D "+e+" x",t)}okDateFormats.forEach(e=>{e.startsWith("?")||addFormatToTrie(e,dateTrieDM),e.startsWith("!")||addFormatToTrie(e,dateTrieMD)});var currentYear$1=new Date().getUTCFullYear(),lookupsCache$1=new LRUCache(10),currentYear=new Date().getUTCFullYear(),lookupsCache=new LRUCache(10);function createPartition(e){return{scale:1,percent:!1,text:!1,parens:!1,fractions:!1,grouping:!1,exponential:!1,integer:!1,locale:"",pattern:"",int_max:0,frac_max:0,frac_min:0,man_p:"",num_p:"",num_min:0,den_min:0,den_max:0,date:0,tokensUsed:0,date_eval:!1,date_system:1,sec_decimals:0,general:!1,clock:24,int_min:0,int_pattern:[],frac_pattern:[],man_pattern:[],den_pattern:[],num_pattern:[],tokens:e??[],den_p:"",int_p:"",denominator:0,sysdate:!1,systime:!1}}function parseLocaleInstr(e){let t,n=0,r,u="";const i=/^([^-]*)-([0-9a-fA-F]{3,8})$/.exec(e);if(i){i[1]&&(u=i[1]);const a=parseInt(i[2],16),s=a>>24&255;s&&(n=s);const c=a>>16&255;c&&(t=c);const l=a&65535;if(l===63488)return{sysdate:!0};if(l===62464)return{systime:!0};l&&codeToLocale[l]&&(r=codeToLocale[l])}else{const a=/^([^-]*)-([a-z\d][a-z\d_.@-]*)?(?:,([a-f\d]{1,4}))?$/i.exec(e);if(a){let s=a[2];if(/^x-sysdate$/.test(s))return{sysdate:!0};if(/^x-systime$/.test(s))return{systime:!0};if(a[1]&&(u=a[1]),s&&(/-x-gannen$/i.test(s)&&(s=s.slice(0,-9)),r=resolveLocale(s)),a[3]){const c=parseInt(a[3],16),l=c>>8&255;l&&(n=l);const d=c&255;d&&(t=d)}}else return e.includes("-")?{currency:e}:{currency:e}}const o={};return t&&(o.calendar=t),n&&(o.numberStyle=n),r&&(o.locale=r),u&&(o.currency=u),o}function add(e,t){typeof e=="string"?t.push({type:TOKEN_STRING,value:e}):t.push(e)}var countNonHash=e=>{let t=0;for(let n=0;n<e.length;n++)e.charCodeAt(n)!==35&&t++;return t};function isNumOp(e,t){const n=e?.type;return n==="HASH"||n==="ZERO"||n==="QMARK"||n==="DIGIT"&&t==="DEN"}function parseFormatSection(e){const t=[],n=createPartition(t);let r="INT",u;const i=[];let o,a=!1,s=-1,c=!1,l="",d=!1;const f=v=>v==="DEN"?n.den_pattern:v==="INT"?n.int_pattern:v==="FRAC"?n.frac_pattern:v==="MAN"?n.man_pattern:[];for(;++s<e.length&&!c;){const v=e[s],y=v.type||"ERROR";if(l+=v.raw,y==="GENERAL")n.general=!0,add({type:y},t);else if(isNumOp(v,r)){const A=f(r);o&&(isNumOp(o,r)||o.type==="GROUP")?(A.push((A.pop()||"")+v.value),u&&"num"in u&&(u.num+=v.value)):(A.push(v.value),u={type:r,num:v.value},add(u,t))}else if(y==="PAREN")v.value==="("&&(n.parens=!0),add(v.value,t);else if(y==="DIGIT")add(v.value,t);else if(y==="SLASH"){d=!0;const A=f(r);if(A.length){if(!u)throw new SyntaxError("Format pattern is missing a numerator");n.fractions=!0;const b=A.pop();n.num_pattern.push(b),u.type="NUM",r="DEN",add({type:"DIV"},t)}else add(v.value,t)}else if(y==="COMMA")add(",",t);else if(y==="SCALE")n.scale=.001**v.raw.length;else if(y==="GROUP"){if(r==="INT"&&(n.grouping=!0),r==="DEN")throw new SyntaxError("Cannot group denominator digits")}else if(y==="SPACE")add({type:y},t);else if(y==="BREAK"){c=!0;break}else if(y==="TEXT")n.text=!0,add({type:y,value:v.value},t);else if(y==="PLUS"||y==="MINUS")add({type:y},t);else if(y==="DURATION"){const A=v.value.toLowerCase(),b=A[0];let x;b==="h"?x={type:T_TYPE_HOUR_E,size:16,pad:A.length}:b==="m"?x={type:T_TYPE_MIN_E,size:32,pad:A.length}:x={type:T_TYPE_SEC_E,size:64,pad:A.length},n.date=n.date|x.size,i.push(x),add(x,t)}else if(n.date&&y==="POINT"&&e[s+1]?.type==="ZERO"){let A=1;s++;let b="0";e[s+1]?.type==="ZERO"&&(b+="0",A=2,s++),e[s+1]?.type==="ZERO"&&(b+="0",A=3,s++),l+=b;const x=[64,128,256,512][A];n.date=n.date|x,n.date_eval=!0,n.sec_decimals=Math.max(n.sec_decimals,A),add({type:T_TYPE_SUBSEC,size:x,decimals:A},t)}else if(y==="CALENDAR")a||(v.value==="B2"||v.value==="b2"?n.date_system=6:n.date_system=1);else if(y==="DATETIME"){let A;const b=v.value.toLowerCase(),x=b[0];if(b==="y"||b==="yy")A={type:T_TYPE_YEAR_S,size:2};else if(x==="y"||x==="e")A={type:T_TYPE_YEAR,size:2};else if(b==="b"||b==="bb")A={type:T_TYPE_B_YEAR_S,size:2};else if(x==="b")A={type:T_TYPE_B_YEAR,size:2};else if(b==="d"||b==="dd")A={type:"DAY",size:8,pad:b==="dd"};else if(b==="ddd"||b==="aaa")A={type:T_TYPE_WEEKDAY_S,size:8};else if(x==="d"||x==="a")A={type:T_TYPE_WEEKDAY,size:8};else if(x==="h")A={type:T_TYPE_HOUR,size:16,pad:b.length>1};else if(x==="m"){b.length===3?A={type:T_TYPE_MNAME_S,size:4}:b.length===5?A={type:T_TYPE_MNAME_1,size:4}:b.length>=4&&(A={type:T_TYPE_MNAME,size:4});const B=i[i.length-1];!A&&B&&!B.used&&B.size&80&&(B.used=!0,A={type:"MIN",size:32,pad:b.length>1}),A||(A={type:T_TYPE_MON,size:4,pad:b.length>1,indeterminate:!0})}else if(x==="s"){A={type:"SEC",size:64,pad:b.length>1};const B=i[i.length-1];B&&B.size&32?A.used=!0:B&&"indeterminate"in B&&(delete B.indeterminate,B.size=32,B.type="MIN",A.used=!0)}A&&(n.date=n.date|A.size,n.date_eval=!0,i.push(A),add(A,t))}else if(y==="AMPM")n.clock=12,n.date=n.date|16,n.date_eval=!0,add({type:y,short:v.value==="A/P"},t);else if(y==="ESCAPED")add({type:TOKEN_STRING,value:v.value,escaped:!0},t);else if(y==="STRING"||y==="CHAR")add(v.value,t);else if(y==="CONDITION"){const A=/^(<[=>]?|>=?|=)\s*(-?[.\d]+)$/.exec(v.value);if(A)n.condition=[A[1],parseFloat(A[2])];else throw new Error("Invalid condition: "+v.value)}else if(y==="LOCALE"){const A=parseLocaleInstr(v.value);A.currency&&add({type:TOKEN_STRING,value:A.currency,escaped:!0},t),A.sysdate&&(n.sysdate=!0),A.systime&&(n.systime=!0),A.locale&&(n.locale=A.locale),(A.calendar===1||A.calendar===6)&&(n.date_system=A.calendar),a=!0}else if(y==="COLOR"){let A;const b=v.value.toLowerCase();(A=/^color\s*(\d+)$/i.exec(b))?n.color=parseInt(A[1],10):n.color=b}else if(y==="PERCENT")n.scale=100,n.percent=!0,add("%",t);else if(y==="POINT")add({type:y,value:v.value},t),n.date||(n.dec_fractions=!0,r=T_TYPE_FRAC);else if(y==="EXP"){n.exponential=!0;const A=v.value.includes("+");n.exp_plus=A,r="MAN",add({type:"EXP",plus:A},t)}else if(y==="SKIP")add({type:y,value:v.value},t);else if(y==="FILL")add({type:y,value:v.value},t);else if(y==="CURRENCY")add({type:y,value:v.value},t);else if(y==="DBNUM"){const A=parseInt(v.value.slice(5));if(A<1||A>4)throw new SyntaxError("Unknown modifier: "+v.value)}else throw y==="NATNUM"?new SyntaxError("Unknown modifier: "+v.value):y==="MODIFIER"?new SyntaxError("Unknown modifier: "+v.value):y==="ERROR"?new SyntaxError(`Illegal character: ${l}`):new SyntaxError(`Unknown token ${y} in ${l}`);o=v}if(n.tokensUsed=s,n.pattern=l,n.fractions&&n.dec_fractions||n.grouping&&!n.int_pattern.length||n.fractions&&n.exponential||n.fractions&&n.den_pattern.length*n.num_pattern.length===0||d&&!n.fractions&&!n.date||n.exponential&&(n.int_pattern.length||n.frac_pattern.length)*n.man_pattern.length===0)throw new SyntaxError(`Invalid pattern: ${l}`);const m=n.int_pattern.join(""),h=n.man_pattern.join(""),g=n.frac_pattern.join("");n.int_max=m.length,n.int_min=countNonHash(m);let E=0;for(let v=0;v<m.length;v++){const y=m[m.length-1-v];/^[0-9?]/.test(y)&&(E=v+1)}n.int_min=E,n.frac_max=g.length,n.frac_min=countNonHash(g);let D=n.num_pattern.join(""),p=n.den_pattern[0]||"";if(p.includes("?")||D.includes("?")?(p=p.replace(/\d/g,"?"),p=p.replace(/#$/g,"?"),n.num_min=countNonHash(D),n.den_max=p.length,n.den_min=countNonHash(p),D=D.replace(/#$/g,"?")):(n.num_min=countNonHash(D),n.den_max=p.length,n.den_min=countNonHash(p)),n.int_p=m,n.man_p=h,n.num_p=D,n.den_p=p,n.den_pattern.length&&(n.denominator=parseInt(n.den_pattern.join("").replace(/\D/g,""),10)),n.integer=!!m.length,!n.integer&&!n.exponential&&g.length){const v=n.tokens.findIndex(y=>y.type===TOKEN_POINT);n.tokens.splice(v,0,{type:"INT",num:"#"}),n.integer=!0,n.int_pattern=["#"],n.int_p="#"}if(!n.tokens.length&&/^\[(?!\$)/.test(n.pattern)&&(n.general=!0,add({type:TOKEN_GENERAL},t)),n.fractions)for(let v=0;v<t.length-1;v++){const y=t[v];if(y.type!=="STRING"&&y.type!=="SPACE")continue;const A=t[v+1].type;A==="NUM"?y.rule="num+int":A==="DIV"?y.rule="num":A==="DEN"&&(y.rule="den")}return n.grouping&&n.int_pattern.length>1&&(n.grouping=!1),n}var maybeAddMinus=e=>{const[t,n]=e.condition??["",0];n<0&&(t==="<"||t==="<="||t==="=")||n===0&&t==="<"||e.tokens.unshift({type:TOKEN_MINUS,volatile:!0})},clonePart=(e,t)=>{const n={};for(const r in e){const u=e[r];n[r]=Array.isArray(u)?[...u]:u}return t&&n.tokens&&n.tokens.unshift(t),n.generated=!0,n};function parsePattern(e){const t=[];let n=!1,r,u=null,i=0,o,a=0,s=0,c=tokenize(e);do{if(o=parseFormatSection(c),(o.date||o.general)&&(o.int_pattern.length||o.frac_pattern.length||o.scale!==1||o.text))throw new Error("Illegal format");if(o.condition&&(s++,n=!0),o.text){if(u)throw new Error("Unexpected partition");u=o}o.locale&&(r=resolveLocale(o.locale)),t.push(o),i=c[o.tokensUsed]?.type==="BREAK"?1:0,c=c.slice(o.tokensUsed+i),a++}while(i&&a<4&&s<3);if(i)throw new Error("Unexpected partition");if(s>2)throw new Error("Unexpected condition");const l=t[3];if(l&&(l.int_pattern.length||l.frac_pattern.length||l.date))throw new Error("Unexpected partition");if(n){t[0].condition||(t[0].condition=[">",0]);const d=t.length;if(d===1&&(t[1]=parseFormatSection(tokenize("General")),t[1].generated=!0),d<=2,d<3){const f=t[0],m=t[1];if(maybeAddMinus(f),m.condition)maybeAddMinus(m);else{const h=f.condition;h&&(h[0]==="="||h[1]>=0&&(h[0]===">"||h[0]===">="))&&m.tokens.unshift({type:TOKEN_MINUS,volatile:!0})}}else t.forEach(maybeAddMinus)}else{if(t.length<4&&u)for(let d=0,f=t.length;d<f;d++)t[d]===u&&t.splice(d,1);if(t.length<1&&u&&(t[0]=parseFormatSection(tokenize("General")),t[0].generated=!0),t.length<2){const d={type:TOKEN_MINUS,volatile:!0};t.push(clonePart(t[0],d))}if(t.length<3&&t.push(clonePart(t[0])),t.length<4)if(u)t.push(u);else{const d=parseFormatSection(tokenize("@"));d.generated=!0,t.push(d)}t[0].condition=[">",0],t[1].condition=["<",0],t[2].condition=void 0}return{pattern:e,partitions:t,locale:r}}var _parseDataCache=new LRUCache(MAX_CACHED_PATTERNS);function prepareFormatterData(e,t=!1){e||(e="General");let n=_parseDataCache.get(e);if(!n)try{n=parsePattern(e),_parseDataCache.set(e,n)}catch(r){if(t)throw r;const u=r&&typeof r=="object"&&"message"in r?String(r.message):"Unknown error",i=createPartition([{type:TOKEN_ERROR}]);i.error=!0,n={pattern:e,partitions:[i,i,i,i],error:u,locale:void 0}}return n}function clamp2(e){if(e===0)return e;const t=Math.ceil(Math.log10(e<0?-e:e)),n=10**(16-Math.floor(t));return isFinite(n)?Math.round(e*n)/n:0}function getExponent(e,t=0){const n=Math.floor(Math.log10(e));return t>1?Math.floor(n/t)*t:n}function getSignificand(e,t=1){return t<-300?parseFloat(e.toExponential().split("e")[0]):e*10**-t}var zero={total:1,sign:0,digits:1,period:0,int:1,frac:0};function numdec(e,t=!0){const n=Math.abs(e);if(!n)return zero;const r=t&&e<0?1:0,u=Math.floor(n),i=Math.floor(Math.log10(n)+1);let o=0,a=0;if(u!==n){o=1;const s=String(round2(n*10**-i,15));let c=s.length,l=!0,d=0;for(;d<=s.length;){if(s[d]==="."){c--;break}else s[d]==="0"&&l?c--:l=!1;d++}a=c-i,a<0&&(a=0,o=0)}return{total:r+Math.max(i,1)+o+a,digits:Math.max(i,0)+a,sign:r,period:o,int:Math.max(i,1),frac:a}}var fixLocale=(e,t)=>e.replace(/\./,t.decimal),getExp=(e,t,n)=>{const r=Math.abs(t);let u;return e===1?u=e:u=round2(e,5),[fixLocale(u+"",n),n.exponent,t<0?n.negative:n.positive,r<10?"0":"",r]};function general(e,t,n){if(typeof t=="string")e.push(t);else{const r=t|0;if(t===r)e.push(Math.abs(r));else{const u=Math.abs(t);let i=getExponent(u),o=getSignificand(u,i);o===10&&(o=1,i++);const a=numdec(u);if(i>=-4&&i<=-1){const s=u.toPrecision(10+i).replace(/\.?0+$/,"");e.push(fixLocale(s,n))}else if(i===10){const s=Math.round(u);s<1e11?e.push(s):e.push(...getExp(1,11,n))}else if(Math.abs(i)<=9)if(a.total<=11){const s=round2(u,9).toFixed(a.frac);e.push(fixLocale(s,n))}else i===9?e.push(Math.round(u)):i>=0&&i<9?e.push(fixLocale(String(round2(u,9-i)),n)):e.push(...getExp(o,i,n));else a.total>=12?e.push(...getExp(o,i,n)):e.push(fixLocale(round2(u,9).toFixed(a.frac),n))}}return e}function pad(e,t=!1){return e==="0"?"0":e==="?"?t?" ":" ":""}var DAYSIZE=86400,CHAR_0=48,CHAR_9=57,dateOverflows=(e,t,n)=>n?e<-694324||t>=35830291:e<0||t>=2958466;function runPart(e,t,n,r){let u="",i="",o="",a="",s="",c="",l=0,d=0;if(typeof e=="bigint"){if(e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER)e=Number(e);else return n.bigintErrorNumber?String(e):n.overflow;d=e}else typeof e=="number"&&(d=Math.trunc(e));let f=0,m=0,h=1,g=0,E=0,D=0,p=0,v=0,y=0;const A=r||defaultLocale;if(!t.text&&isFinite(t.scale)&&t.scale!==1&&typeof e=="number"&&(e=clamp2(e*t.scale)),typeof e=="number"&&t.fractions){if(t.integer){const F=Math.abs(roundBinary(e,1));c+=F<1?"":Math.floor(F)}}else if(typeof e=="number"&&isFinite(e)&&(t.exponential||t.integer||t.dec_fractions)){let F,N;t.exponential?([F,N,l]=roundSignificand(Math.abs(e),t.frac_max,t.int_max,!!t.integer),u+=Math.abs(l),e=(e<0?-F:F)*pow10(N)):[F,N]=roundPlaces(Math.abs(e),t.frac_max);const[T,P]=decToText(F,N);t.integer&&(c=T),t.dec_fractions&&(s=P)}const b=n.grouping[0]??3,x=n.grouping[1]??b,B=!t.error&&(t.num_p.includes("0")||t.den_p.includes("0"));let $=B;if(t.fractions&&typeof e=="number"){$=B||!!(e%1);const F=Math.abs(t.integer?e%1:e);if(F)if($=!0,t.denominator&&isFinite(t.denominator))a+=t.denominator,o+=roundBinary(F*t.denominator),o==="0"&&(o="",a="",$=B);else{const N=dec2frac(F,1/0,t.den_max);o+=N[0],a+=N[1],t.integer&&o==="0"&&(o="",a="",$=B)}else!e&&!t.integer&&($=!0,o="0",a="1");t.integer&&!$&&!Math.trunc(e)&&(c="0")}if(t.date&&typeof e=="number"){d=Math.trunc(e);const F=DAYSIZE*(e-d);if(f=Math.floor(F),y=F-f,Math.abs(y)<1e-6?y=0:y>.9999&&(y=0,f+=1),y){const N=t.date&512||t.date&256||t.date&128;(N===512&&y>.9995||N===256&&y>.995||N===128&&y>.95||!N&&y>=.5)&&(f++,y=0)}if(f===DAYSIZE&&t.date&1008&&(f=0,d+=1),d||t.date_system){const N=toYMD(e+d-Math.trunc(e),t.date_system,n.leap1900);m=N[0],h=N[1],g=N[2]}if(f){const N=f<0?DAYSIZE+f:f;v=Math.floor(N)%60,p=Math.floor(N/60)%60,D=Math.floor(N/60/60)%60}if(E=(6+d)%7,t.date_eval&&dateOverflows(e,d+f/DAYSIZE,n.dateSpanLarge)){if(n.dateErrorThrows)throw new Error("Date out of bounds");return n.dateErrorNumber?general(e<0?[A.negative]:[],e,A).join(""):n.overflow}}const k=pad("?",n.nbsp);l<0?i="-":t.exp_plus&&(i="+");const w=[],I=(F,N,T,P)=>{const V=!P&&F.length>N.length?T.length+F.length-N.length:T.length;F.length<N.length&&(P+=F.length-N.length);for(let Z=0;Z<V;Z++)w.push(F[Z+P]||pad(T[Z],n.nbsp));return V};let M=!1;const _={int:0,frac:0,man:0,num:0,den:0};for(let F=0,N=t.tokens.length;F<N;F++){const T=t.tokens[F],P=T.type,V="num"in T?T.num.length:0;if(P==="STRING"){const Z=T.rule;Z?Z==="num"&&$||Z==="num+int"&&$&&c||Z==="den"&&$?w.push(T.value.replaceAll(" ",k)):(Z==="num"&&t.num_min>0||t.den_min>0||Z==="num+int"&&t.den_min>0&&(c||t.num_min)||Z==="den"&&t.den_min>0||t.den_min>0)&&w.push(k.repeat(T.value.length)):w.push(T.value.replaceAll(" ",k))}else if(P==="SPACE")T.rule==="num+int"?($||t.num_min||t.den_min)&&(c||t.num_min)&&w.push(k):w.push(k);else if(P==="ERROR")w.push(n.invalid);else if(P==="POINT")w.push(t.date?T.value:A.decimal);else if(P==="GENERAL")general(w,e,A);else if(P==="EXP")w.push(A.exponent);else if(P==="MINUS")T.volatile&&t.date||T.volatile&&(typeof e!="number"||e>=0)||(T.volatile&&!t.fractions&&(t.integer||t.dec_fractions)?(typeof e=="number"&&e<0&&c&&c!=="0"||s)&&w.push(A.negative):w.push(A.negative));else if(P==="PLUS")w.push(A.positive);else if(P==="TEXT")w.push(e);else if(P==="FILL")n.fillChar&&w.push(n.fillChar,T.value);else if(P==="SKIP")n.skipChar?w.push(n.skipChar,T.value):w.push(n.nbsp?" ":" ");else if(P==="DIV")$?w.push("/"):t.num_min>0||t.den_min>0?w.push(k):w.push(pad("#",n.nbsp));else if(P==="INT")if(t.int_pattern.length===1){const Z=t.int_p,S=t.exponential&&!e,H=S?Math.max(t.int_min,t.int_max,c.length):Math.max(t.int_min,c.length);let R="";for(let G=H;G>0;G--){let X=c.charAt(c.length-G);S&&!X&&(X="0");const te=X?"":Z.charAt(Z.length-G)||Z[0];let ae="";if(t.grouping){const re=G-1-b;re>=0&&!(re%x)&&(ae=X||te==="0"?A.group:pad("?",n.nbsp))}R+=(X||pad(te,n.nbsp))+ae}w.push(R)}else _.int+=I(c,t.int_p,T.num,_.int);else if(P==="FRAC"){const Z=_.frac;for(let S=0;S<V;S++)w.push(s[S+Z]||pad(T.num[S],n.nbsp));_.frac+=V}else if(P==="MAN")_.man||w.push(i),_.man+=I(u,t.man_p,T.num,_.man);else if(P==="NUM")_.num+=I(o,t.num_p,T.num,_.num);else if(P==="DEN"){const Z=_.den;for(let S=0;S<V;S++){let H=a[S+Z];if(!H){const R=T.num.charCodeAt(S);R>CHAR_0&&R<=CHAR_9||M&&R===CHAR_0?(M=!0,H=n.nbsp?" ":" "):!M&&S===V-1&&R===CHAR_0&&!a?H="1":H=pad(T.num[S],n.nbsp)}w.push(H)}_.den+=V}else if(P==="YEAR")m<0&&w.push(A.negative),w.push(String(Math.abs(m)).padStart(4,"0"));else if(P==="YEAR-SHORT"){const Z=m%100;w.push(Z<10?"0":"",Z)}else if(P==="MONTH")w.push(T.pad&&h<10?"0":"",h);else if(P==="MONTHNAME-SINGLE")t.date_system===6?w.push(A.mmmm6[h-1].charAt(0)):w.push(A.mmmm[h-1].charAt(0));else if(P==="MONTHNAME-SHORT")t.date_system===6?w.push(A.mmm6[h-1]):w.push(A.mmm[h-1]);else if(P==="MONTHNAME")t.date_system===6?w.push(A.mmmm6[h-1]):w.push(A.mmmm[h-1]);else if(T.type==="WEEKDAY-SHORT")w.push(A.ddd[E]);else if(T.type==="CURRENCY")w.push(T.value);else if(P==="WEEKDAY")w.push(A.dddd[E]);else if(P==="DAY")w.push(T.pad&&g<10?"0":"",g);else if(P==="HOUR"){const Z=D%t.clock||(t.clock<24?t.clock:0);w.push(T.pad&&Z<10?"0":"",Z)}else if(P==="MIN")w.push(T.pad&&p<10?"0":"",p);else if(P==="SEC")w.push(T.pad&&v<10?"0":"",v);else if(P==="SUBSEC"){w.push(A.decimal);const Z=y.toFixed(t.sec_decimals);w.push(Z.slice(2,2+T.decimals))}else if(P==="AMPM"){const Z=D<12?0:1;T.short?w.push("AP"[Z]):w.push(A.ampm[Z])}else if(P==="HOUR-ELAP"&&typeof e=="number"){e<0&&w.push(A.negative);const Z=d*24+Math.floor(Math.abs(f)/3600);w.push(String(Math.abs(Z)).padStart(T.pad,"0"))}else if(P==="MIN-ELAP"&&typeof e=="number"){e<0&&w.push(A.negative);const Z=d*1440+Math.floor(Math.abs(f)/60);w.push(String(Math.abs(Z)).padStart(T.pad,"0"))}else if(P==="SEC-ELAP"&&typeof e=="number"){e<0&&w.push(A.negative);const Z=d*DAYSIZE+Math.abs(f);w.push(String(Math.abs(Z)).padStart(T.pad,"0"))}else if(P==="B-YEAR")w.push(m+543);else if(P==="B-YEAR-SHORT"){const Z=(m+543)%100;w.push(Z<10?"0":"",Z)}}return w.join("")}var default_text=parseFormatSection([{type:TOKEN_TEXT,value:"@",raw:"@"}]);function getPart(e,t){for(let n=0;n<3;n++){const r=t[n];if(r){let u=!1;if(r.condition){const i=r.condition[0],o=r.condition[1];i==="="?u=e===o:i==="<>"?u=e!==o:typeof e=="string"?u=!1:i===">"?u=e>o:i==="<"?u=e<o:i===">="?u=e>=o:i==="<="&&(u=e<=o)}else u=!0;if(u)return r}}}function formatValue(e,t,n){const r=t.partitions,u=getLocale(t.locale||n.locale)??defaultLocale,i=r[3]?r[3]:default_text;if(typeof e=="boolean"&&(e=u.bool[e?0:1]),e==null)return"";const o=typeof e=="bigint";if(typeof e!="number"&&!o)return runPart(String(e),i,n,u);if(!o&&!Number.isFinite(e))return Number.isNaN(e)?u.nan:(e<0?u.negative:"")+u.infinity;const a=e;let s=getPart(a,r);return s?.sysdate&&(s=prepareFormatterData(u.sysdate??"dd mmmm yyyy",!1).partitions[0]),s?.systime&&(s=prepareFormatterData(u.systime??"hh:mm:ss",!1).partitions[0]),s?runPart(a,s,n,u):n.overflow}function format(e,t,n={}){const r=Object.assign({},defaultOptions,n),u=prepareFormatterData(e,r.throws);return formatValue(dateToSerial(t,r)??t,u,r)}function isValidFormat(e){try{return prepareFormatterData(e,!0),!0}catch{return!1}}var CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5},ACCENTS=["accent1","accent2","accent3","accent4","accent5","accent6"],accentOf=e=>ACCENTS[e%ACCENTS.length]??"accent1",isBar=e=>e.startsWith("column")||e.startsWith("bar"),isHorizontal=e=>e.startsWith("bar"),isLine=e=>e.startsWith("line"),isArea=e=>e.startsWith("area"),isRound=e=>e==="pie"||e==="doughnut",isScatter=e=>e.startsWith("scatter"),hasLines=e=>!isScatter(e)||e!=="scatter",hasMarkers=e=>e==="line-markers"||e==="scatter"||e==="scatter-lines",groupingOf=e=>e.endsWith("-100")?"percentStacked":e.endsWith("-stacked")?"stacked":isBar(e)?"clustered":"standard";function labelPositionsOf(e){return isArea(e)||e==="doughnut"?[]:e==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(e)||isScatter(e)?["t","b","l","r","ctr"]:groupingOf(e)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}function labelPositionOf(e){const t=labelPositionsOf(e.type),n=e.labels?.position;if(n!==void 0&&t.includes(n))return n;if(t.length!==0)return e.type==="pie"?"ctr":isLine(e.type)||isScatter(e.type)?"t":groupingOf(e.type)==="clustered"?"outEnd":"ctr"}var variesOf=e=>e.vary_by_categories??isRound(e.type);function formatValue2(e,t="General"){return t==="General"||!isValidFormat(t)?String(Number(e.toPrecision(10))):format(t,e)}var NICE=[1,2,5,10];function chartScale(e,t,n,r,u={}){const i=e>0&&(t-e)/t<.16666666666666666?e:Math.min(e,0),o=t<=0&&e<0?0:t,a=u.minimum_scale??i,s=u.maximum_scale??o,c=s>a?s-a:1,l=Math.max(1,Math.floor(n/r)),d=c/l,f=10**Math.floor(Math.log10(d)),m=u.major_unit??(NICE.find(A=>A*f>=d)??10)*f,h=(A,b)=>Number((b(Number((A/m).toFixed(9)))*m).toPrecision(12)),g=o>0?o+c*.05:o===i?c:o,E=u.maximum_scale??h(g,Math.ceil),D=i<0?i-c*.05:i,p=u.minimum_scale??h(D,Math.floor),v=[],y=Math.round((E-p)/m);for(let A=0;A<=y;A++)v.push(Number((p+A*m).toPrecision(12)));return{min:p,max:E,major:m,ticks:v}}var textWidth=(e,t)=>{let n=0;for(const r of e)n+=(r.codePointAt(0)??0)>11903?1:CHART_DEFAULTS.letter;return n*t},num=e=>String(Number(e.toFixed(3)));function smoothPath(e){const t=n=>e[Math.max(0,Math.min(e.length-1,n))]??[0,0];return e.map(([n,r],u)=>{if(u===0)return`M${num(n)} ${num(r)}`;const[i,o]=t(u-2),[a,s]=t(u-1),[c,l]=t(u+1),d=`${num(a+(n-i)/6)} ${num(s+(r-o)/6)}`,f=`${num(n-(c-a)/6)} ${num(r-(l-s)/6)}`;return`C${d} ${f} ${num(n)} ${num(r)}`}).join(" ")}var linePath=e=>e.map(([t,n],r)=>`${r===0?"M":"L"}${num(t)} ${num(n)}`).join(" ");function slicePath(e,t,n,r,u,i){const o=(l,d)=>`${num(e+l*Math.sin(d))} ${num(t-l*Math.cos(d))}`,a=i-u>=Math.PI*2?u+Math.PI*2-1e-4:i,s=a-u>Math.PI?1:0,c=`M${o(n,u)} A${num(n)} ${num(n)} 0 ${String(s)} 1 ${o(n,a)}`;return r<=0?`${c} L${num(e)} ${num(t)} Z`:`${c} L${o(r,a)} A${num(r)} ${num(r)} 0 ${String(s)} 0 ${o(r,u)} Z`}function axisTitleRoom(e,t,n,r){const u=r*1.5;return t!==void 0&&t!==""&&(e.bottom-=u),n!==void 0&&n!==""&&(e.left+=u),{x:e.left-u/2,y:e.bottom+u/2}}function axisTitleWords(e,t,n,r,u,i,o){r!==void 0&&r!==""&&e.words.push({x:t.x+t.width/2,y:n.y,text:r,size:i,anchor:"middle",color:o}),u!==void 0&&u!==""&&e.words.push({x:n.x,y:t.y+t.height/2,text:u,size:i,anchor:"middle",color:o,rotate:-90})}var labelOf=(e,t,n,r,u)=>{const i=e.labels;if(!i)return"";const o=isRound(e.type),a=[];return i.show_series_name&&a.push(r.name),i.show_category_name&&a.push(u),(i.show_value??!(i.show_percentage??!1))&&a.push(formatValue2(t,i.number_format??r.number_format)),i.show_percentage&&o&&a.push(formatValue2(n,i.number_format??"0%")),a.join(", ")};function scatterDrawing(e,t,n,r,u){const i=CHART_DEFAULTS,o=e.category_axis??{},a=e.value_axis??{},s=axisTitleRoom(n,o.title,a.title,r),c=e.series.map($=>$.values.flatMap((k,w)=>{const I=$.x?.[w]??($.x?null:w+1);return I===null||k===null?[]:[[I,k]]})),l=c.flat().map($=>$[0]),d=c.flat().map($=>$[1]),f=$=>$.length>0?Math.min(...$):0,m=$=>$.length>0?Math.max(...$):1,h=a.number_format??e.series[0]?.number_format??"General",g=o.number_format??"General",E=r*.5,D=chartScale(f(d),m(d),n.bottom-n.top,r*2.4,a),p=a.visible===!1?0:Math.max(0,...D.ticks.map($=>textWidth(formatValue2($,h),r)))+E,v=o.visible===!1?0:r*1.2+E,y={x:n.left+p,y:n.top,width:n.right-n.left-p,height:n.bottom-n.top-v};t.plot=y,axisTitleWords(t,y,s,o.title,a.title,r,u);const A=chartScale(f(l),m(l),y.width,r*5,o),b=chartScale(f(d),m(d),y.height,r*2.4,a),x=$=>y.x+(Math.min(A.max,Math.max(A.min,$))-A.min)/(A.max-A.min)*y.width,B=$=>y.y+y.height-(Math.min(b.max,Math.max(b.min,$))-b.min)/(b.max-b.min)*y.height;for(const $ of b.ticks){const k=B($);(a.has_major_gridlines??!0)&&t.grid.push({d:`M${num(y.x)} ${num(k)} H${num(y.x+y.width)}`,color:a.gridline_color??{rgb:i.gridline},width:i.gridWidth}),a.visible!==!1&&t.words.push({x:y.x-E,y:k,text:formatValue2($,h),size:r,anchor:"end",color:u})}for(const $ of A.ticks){const k=x($);o.has_major_gridlines===!0&&t.grid.push({d:`M${num(k)} ${num(y.y)} V${num(y.y+y.height)}`,color:o.gridline_color??{rgb:i.gridline},width:i.gridWidth}),o.visible!==!1&&t.words.push({x:k,y:y.y+y.height+E+r*.6,text:formatValue2($,g),size:r,anchor:"middle",color:u})}t.axes.push({d:`M${num(y.x)} ${num(B(Math.max(b.min,Math.min(b.max,0))))} H${num(y.x+y.width)}`,color:o.line_color??{rgb:i.axisLine},width:i.gridWidth}),e.series.forEach(($,k)=>{const w=$.color??accentOf(k),I=(c[k]??[]).map(([M,_])=>[x(M),B(_)]);if(I.length!==0&&(hasLines(e.type)&&t.lines.push({d:e.type==="scatter-smooth"||$.smooth===!0?smoothPath(I):linePath(I),color:w,width:$.line_width??i.lineWidth,series:k}),hasMarkers(e.type)))for(const[M,_]of I)t.dots.push({x:M,y:_,r:($.marker_size??i.marker)/2,color:w})})}function chartDrawing(e,t,n){const r=CHART_DEFAULTS,u=e.font_size??r.fontSize,i=e.font_color??"dk1",o={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},a={left:r.margin,top:r.margin,right:t-r.margin,bottom:n-r.margin};if(e.title!==void 0&&e.title!==""){const U=e.title_size??u*r.titleScale;o.words.push({x:t/2,y:a.top+U*.7,text:e.title,size:U,anchor:"middle",color:i}),a.top+=U*1.6}const s=isRound(e.type),c=variesOf(e),l=(U,O)=>c?accentOf(O):e.series[U]?.color??accentOf(U);if(e.legend!==void 0){const U=c?e.categories:e.series.map(Q=>Q.name),O=u*.6,L=u*.4,K=u*1.5,W=U.map(Q=>O+L+textWidth(Q,u)),ee=(Q,Y,ie)=>{o.keys.push({x:Y,y:ie-O/2,width:O,height:O,color:c?accentOf(Q):e.series[Q]?.color??accentOf(Q),series:c?0:Q,category:c?Q:0}),o.words.push({x:Y+O+L,y:ie,text:U[Q]??"",size:u,anchor:"start",color:i})};if(e.legend==="top"||e.legend==="bottom"){const Q=W.reduce((ce,J)=>ce+J,0)+u*(U.length-1),Y=e.legend==="top"?a.top+K/2:a.bottom-K/2;let ie=(t-Q)/2;U.forEach((ce,J)=>{ee(J,ie,Y),ie+=(W[J]??0)+u}),e.legend==="top"?a.top+=K:a.bottom-=K}else{const Q=Math.max(0,...W),Y=e.legend==="left"?a.left:a.right-Q,ie=(a.top+a.bottom-K*U.length)/2+K/2;U.forEach((ce,J)=>{ee(J,Y,ie+J*K)}),e.legend==="left"?a.left+=Q+u:a.right-=Q+u}}const d=e.labels,f=d?.size??u,m=d?.color??i,h=(U,O,L,K,W=m)=>{L!==""&&o.words.push({x:U,y:O,text:L,size:f,anchor:K,color:W})};if(s){const U=e.series[0],O=(U?.values??[]).map(ie=>Math.max(0,ie??0)),L=O.reduce((ie,ce)=>ie+ce,0),K=Math.max(0,Math.min(a.right-a.left,a.bottom-a.top)/2),W=(a.left+a.right)/2,ee=(a.top+a.bottom)/2,Q=e.type==="doughnut"?K*((e.hole_size??r.holeSize)/100):0;o.plot={x:W-K,y:ee-K,width:K*2,height:K*2};let Y=0;return O.forEach((ie,ce)=>{const J=L>0?ie/L:0,ne=Y+J*Math.PI*2;if(J>0){o.shapes.push({d:slicePath(W,ee,K,Q,Y,ne),color:"lt1",width:1,fill:l(0,ce),series:0,category:ce});const le=(Y+ne)/2,pe=Q>0?(K+Q)/2:labelPositionOf(e)==="inEnd"?K*.85:K*.6;U&&h(W+pe*Math.sin(le),ee-pe*Math.cos(le),labelOf(e,ie,J,U,e.categories[ce]??""),"middle",d?.color??"lt1")}Y=ne}),o}if(isScatter(e.type))return scatterDrawing(e,o,a,u,i),o;const g=Math.max(1,e.categories.length),E=isHorizontal(e.type),D=groupingOf(e.type),p=D!=="clustered"&&D!=="standard",v=D==="percentStacked",y=e.series.map(U=>e.categories.map((O,L)=>U.values[L]??null)),A=e.categories.map((U,O)=>y.reduce((L,K)=>L+Math.abs(K[O]??0),0)),b=(U,O)=>{const L=y[U]?.[O];if(L==null)return null;const K=A[O]??0;return v?K>0?L/K:0:L};let x=0,B=0;if(e.categories.forEach((U,O)=>{let L=0,K=0;e.series.forEach((W,ee)=>{const Q=b(ee,O)??0;p?Q>=0?L+=Q:K+=Q:(L=Math.max(L,Q),K=Math.min(K,Q))}),B=Math.max(B,L),x=Math.min(x,K)}),!p){const U=y.flat().filter(O=>O!==null);U.length>0&&Math.min(...U)>0&&(x=Math.min(...U))}v&&(B=1,x=Math.min(x,0));const $=e.value_axis??{},k=e.category_axis??{},w=$.number_format??(v?"0%":e.series[0]?.number_format??"General"),I=E?a.right-a.left:a.bottom-a.top,M=E?u*5:u*2.4,_=chartScale(x,B,I,M,{...$,...v?{maximum_scale:$.maximum_scale??1}:{}}),F=$.visible===!1?[]:_.ticks.map(U=>formatValue2(U,w)),N=Math.max(0,...F.map(U=>textWidth(U,u))),T=k.visible!==!1,P=T?Math.max(0,...e.categories.map(U=>textWidth(U,u))):0,V=u*.5,Z=E?$.title:k.title,S=E?k.title:$.title,H=axisTitleRoom(a,Z,S,u),R=E?{x:a.left+(T?P+V:0),y:a.top,width:0,height:a.bottom-a.top-($.visible===!1?0:u*1.2+V)}:{x:a.left+($.visible===!1?0:N+V),y:a.top,width:0,height:a.bottom-a.top-(T?u*1.2+V:0)};R.width=a.right-R.x,o.plot=R,axisTitleWords(o,R,H,Z,S,u,i);const G=chartScale(x,B,E?R.width:R.height,M,{...$,...v?{maximum_scale:$.maximum_scale??1}:{}}),X=U=>(Math.min(G.max,Math.max(G.min,U))-G.min)/(G.max-G.min)*(E?R.width:R.height),te=U=>E?R.x+X(U):R.y+R.height-X(U),ae=isArea(e.type),re=k.reverse_order===!0,Ee=E?!re:re,ve=(E?R.height:R.width)/g,ue=ae?(E?R.height:R.width)/Math.max(1,g-1):ve,se=U=>{const O=ae?U*ue:(U+.5)*ve,L=E?R.height:R.width,K=Ee?L-O:O;return(E?R.y:R.x)+K},j=te(Math.max(G.min,Math.min(G.max,0)));for(const U of G.ticks){const O=te(U);($.has_major_gridlines??!0)&&o.grid.push({d:E?`M${num(O)} ${num(R.y)} V${num(R.y+R.height)}`:`M${num(R.x)} ${num(O)} H${num(R.x+R.width)}`,color:$.gridline_color??{rgb:r.gridline},width:r.gridWidth}),$.visible!==!1&&o.words.push(E?{x:O,y:R.y+R.height+V+u*.6,text:formatValue2(U,w),size:u,anchor:"middle",color:i}:{x:R.x-V,y:O,text:formatValue2(U,w),size:u,anchor:"end",color:i})}if(o.axes.push({d:E?`M${num(j)} ${num(R.y)} V${num(R.y+R.height)}`:`M${num(R.x)} ${num(j)} H${num(R.x+R.width)}`,color:k.line_color??{rgb:r.axisLine},width:r.gridWidth}),T){const U=E?u*1.3:P+u,O=Math.max(1,Math.ceil(U/Math.max(1,ue)));e.categories.forEach((L,K)=>{if(K%O!==0)return;const W=se(K);o.words.push(E?{x:R.x-V,y:W,text:L,size:u,anchor:"end",color:i}:{x:W,y:R.y+R.height+V+u*.6,text:L,size:u,anchor:"middle",color:i})})}if(isBar(e.type)){const U=(e.gap_width??r.gapWidth)/100,O=p?1:e.series.length,L=p?1:(e.overlap??0)/100,K=ve/(Math.max(1,O-(O-1)*L)+U),W=K*(1-L),ee=K+W*(O-1);e.categories.forEach((Q,Y)=>{const ie=se(Y);let ce=0,J=0;e.series.forEach((ne,le)=>{const pe=b(le,Y);if(pe===null)return;const oe=p?pe>=0?ce:J:0,fe=oe+pe;p&&(pe>=0?ce=fe:J=fe);const me=te(oe),Ce=te(fe),De=(p?ie-K/2:ie-ee/2+le*W)+(E&&Ee&&!p?ee-K-2*le*W:0),_e=E?{x:Math.min(me,Ce),y:De,width:Math.abs(Ce-me),height:K}:{x:De,y:Math.min(me,Ce),width:K,height:Math.abs(Ce-me)};if(o.boxes.push({..._e,color:l(le,Y),series:le,category:Y}),!d)return;const Be=labelOf(e,y[le]?.[Y]??0,0,ne,e.categories[Y]??""),he=labelPositionOf(e),ge=f*.8,ye=pe>=0?1:-1,Ae=($e,we)=>he==="ctr"?($e+we)/2:he==="inBase"?$e+(we>$e?ge:-ge):he==="inEnd"?we-(we>$e?ge:-ge):we+(we>=$e?ge:-ge);E?h(Ae(me,Ce),De+K/2,Be,he==="outEnd"?ye>0?"start":"end":"middle"):h(De+K/2,Ae(me,Ce),Be,"middle")})})}else{const U=e.categories.map(()=>0),O=e.series.map((L,K)=>{const W=[],ee=[];return e.categories.forEach((Q,Y)=>{const ie=b(K,Y);if(ie===null)return;const ce=p?U[Y]??0:0,J=ce+ie;p&&(U[Y]=J);const ne=se(Y),le=pe=>E?[te(pe),ne]:[ne,te(pe)];if(W.push(le(J)),ee.push(le(ce)),isLine(e.type)&&d){const pe=labelPositionOf(e),[oe,fe]=le(J);h(oe+(pe==="r"?f:pe==="l"?-f:0),fe+(pe==="t"?-f:pe==="b"?f:0),labelOf(e,y[K]?.[Y]??0,0,L,e.categories[Y]??""),pe==="r"?"start":pe==="l"?"end":"middle")}}),{series:L,s:K,points:W,base:ee}});for(const{series:L,s:K,points:W,base:ee}of O){const Q=L.color??accentOf(K);if(isArea(e.type)&&W.length>0)o.shapes.push({d:`${linePath([...W,...[...ee].reverse()])} Z`,color:Q,width:0,fill:Q,series:K});else if(W.length>0&&(o.lines.push({d:L.smooth===!0?smoothPath(W):linePath(W),color:Q,width:L.line_width??r.lineWidth,series:K}),hasMarkers(e.type)))for(const[Y,ie]of W)o.dots.push({x:Y,y:ie,r:(L.marker_size??r.marker)/2,color:Q})}o.shapes.reverse()}return o}var LEVELS2=9,levels2=e=>Array.from({length:LEVELS2},(t,n)=>e(n)),OFFICE_TEXT_STYLES={title:levels2(()=>({alignment:"l",line_spacing:{lines:.9},space_before:0,bullet:null,font:{name:"+mj-lt",size:Pt(44),color:"dk1"}})),body:levels2(e=>({alignment:"l",line_spacing:{lines:.9},space_before:Pt(e===0?10:5),bullet:"•",bullet_font:"Arial",margin_left:Emu(228600+e*457200),indent:Emu(-228600),font:{name:"+mn-lt",size:Pt([28,24,20][e]??18),color:"dk1"}})),other:levels2(e=>({alignment:"l",margin_left:Emu(e*457200),font:{name:"+mn-lt",size:Pt(18),color:"dk1"}}))},TEXT_FALLBACK={alignment:"l",line_spacing:{lines:1},space_before:0,space_after:0,indent:0,font:{name:"+mn-lt",size:Pt(18),color:"dk1"}},TEXT_INSETS={left:Inches(.1),top:Inches(.05),right:Inches(.1),bottom:Inches(.05)},styleKindOf=e=>e===void 0?"other":e==="title"||e==="ctrTitle"?"title":"body";function placeholderFrame(e){const t=e==="dt"||e==="ftr"||e==="sldNum";return{vertical_anchor:e==="title"||e==="ctrTitle"||t?"ctr":"t",auto_size:t?"none":"text",word_wrap:!0}}var FOOTER_IDX={dt:10,ftr:11,sldNum:12},TEXTBOX_FRAME={word_wrap:!1,auto_size:"shape"},DRAWN_TEXTBOX_FRAME={word_wrap:!0,auto_size:"shape"},AUTOSHAPE_STYLE={fill:"accent1",line:"accent1",line_width:Emu(6350),font_color:"lt1",vertical_anchor:"ctr",alignment:"ctr"},CONNECTOR_STYLE={line:"accent1",line_width:Emu(12700)},BASE_TYPE={title:"title",ctrTitle:"title",subTitle:"body",body:"body",pic:"body",media:"body",obj:"body",dt:"dt",ftr:"ftr",sldNum:"sldNum"};function masterPlaceholder(e,t){const n=BASE_TYPE[t];return e.shapes.find(r=>r.kind==="placeholder"&&r.placeholder?.type===n)}var Unsupported=class extends Error{constructor(e){super(`${e} (allyhub slides capabilities lists what the API holds).`),this.name="Unsupported"}},refuse=e=>{throw new Unsupported(e)},RGB=/^#?[0-9a-f]{6}$/iu,rgbOf=e=>{if(!RGB.test(e))throw new Error(`rgb ${e} is not RRGGBB.`);return`#${e.replace("#","").toUpperCase()}`},RGBColor=Object.assign((e,t,n)=>{for(const r of[e,t,n])if(!Number.isInteger(r)||r<0||r>255)throw new Error(`RGBColor(${String(e)}, ${String(t)}, ${String(n)}): each is 0 to 255.`);return`#${[e,t,n].map(r=>r.toString(16).padStart(2,"0")).join("").toUpperCase()}`},{from_string:e=>rgbOf(e)}),ColorFormat=class{read;write;constructor(e,t){return this.read=e,this.write=t,strict2(this,"ColorFormat")}get theme_color(){const e=this.read();return typeof e=="string"?e:void 0}set theme_color(e){this.write(e)}get rgb(){const e=this.read();return typeof e=="object"?e.rgb:void 0}set rgb(e){this.write(e===void 0?void 0:{rgb:rgbOf(e)})}},Font=class{def;constructor(e){return this.def=e,strict2(this,"Font")}_set(e,t){t===void 0?Reflect.deleteProperty(this.def,e):this.def[e]=t}get name(){return this.def.name}set name(e){this._set("name",e)}get size(){return this.def.size}set size(e){this._set("size",e)}get bold(){return this.def.bold}set bold(e){this._set("bold",e)}get italic(){return this.def.italic}set italic(e){this._set("italic",e)}get underline(){return this.def.underline}set underline(e){this._set("underline",e)}get spacing(){return this.def.spacing}set spacing(e){this._set("spacing",e)}get color(){return new ColorFormat(()=>this.def.rgb!==void 0?{rgb:this.def.rgb}:this.def.color,e=>{delete this.def.color,delete this.def.rgb,typeof e=="string"?this.def.color=e:e&&(this.def.rgb=e.rgb)})}},Run=class{def;constructor(e){return this.def=e,strict2(this,"_Run")}get text(){return this.def.text}set text(e){this.def.text=e}get font(){return this.def.font??={},new Font(this.def.font)}},spacingIn=e=>{if(!Number.isFinite(e)||e<=0)throw new Error(`line_spacing ${String(e)} is not over 0.`);return Number.isInteger(e)&&e>=EMU_PER_PT?{fixed:e}:{lines:e}},spacingOut=e=>e===void 0?void 0:"lines"in e?e.lines:e.fixed,runsOf=e=>e.split(/\n|\v/u).flatMap((t,n)=>[...n>0?[{text:"\v"}]:[],...t===""?[]:[{text:t}]]),Format=class{_set(e,t){t===void 0?Reflect.deleteProperty(this.fmt,e):this.fmt[e]=t}get alignment(){return this.fmt.alignment}set alignment(e){this._set("alignment",e)}get line_spacing(){return spacingOut(this.fmt.line_spacing)}set line_spacing(e){this._set("line_spacing",e===void 0?void 0:spacingIn(e))}get space_before(){return this.fmt.space_before}set space_before(e){this._set("space_before",e)}get space_after(){return this.fmt.space_after}set space_after(e){this._set("space_after",e)}get font(){return this.fmt.font??={},new Font(this.fmt.font)}},Paragraph=class extends Format{fmt;constructor(e){return super(),this.fmt=e,strict2(this,"_Paragraph")}get text(){return this.fmt.runs.map(e=>e.text).join("")}set text(e){this.fmt.runs=runsOf(e)}get runs(){return this.fmt.runs.filter(e=>e.text!=="\v").map(e=>new Run(e))}add_run(){const e={text:""};return this.fmt.runs.push(e),new Run(e)}add_line_break(){this.fmt.runs.push({text:"\v"})}clear(){return this.fmt.runs=[],this}get level(){return this.fmt.level}set level(e){if(!Number.isInteger(e)||e<0||e>8)throw new Error(`level ${String(e)} is not 0 to 8.`);this.fmt.level=e}},ListLevel=class extends Format{fmt;constructor(e){return super(),this.fmt=e,strict2(this,"ListLevel")}get bullet(){return this.fmt.bullet}set bullet(e){this._set("bullet",e)}get bullet_font(){return this.fmt.bullet_font}set bullet_font(e){this._set("bullet_font",e)}get margin_left(){return this.fmt.margin_left}set margin_left(e){this._set("margin_left",e)}get indent(){return this.fmt.indent}set indent(e){this._set("indent",e)}},listStyleOf=e=>Object.freeze(e.map(t=>new ListLevel(t))),newLevels=()=>Array.from({length:9},()=>({})),newText=()=>({paragraphs:[],levels:newLevels()}),TextFrame=class{def;constructor(e){return this.def=e,strict2(this,"TextFrame")}_set(e,t){t===void 0?Reflect.deleteProperty(this.def,e):this.def[e]=t}get text(){return this.def.paragraphs.map(e=>e.runs.map(t=>t.text).join("")).join(`
73
- `)}set text(e){this.def.paragraphs=e.split(`
74
- `).map(t=>({runs:runsOf(t),level:0}))}get paragraphs(){return this.def.paragraphs.length===0&&this.def.paragraphs.push({runs:[],level:0}),this.def.paragraphs.map(e=>new Paragraph(e))}add_paragraph(){this.def.paragraphs.length===0&&this.def.paragraphs.push({runs:[],level:0});const e={runs:[],level:0};return this.def.paragraphs.push(e),new Paragraph(e)}clear(){const e=this.def.paragraphs[0];this.def.paragraphs=e?[{...e,runs:[]}]:[]}fit_text(e,t=18,n,r){this.def.auto_size="text",this.def.word_wrap=!0;for(const u of this.def.paragraphs)for(const i of u.runs)i.font={...i.font,size:Math.trunc(t*EMU_PER_PT),...e===void 0?{}:{name:e},...n===void 0?{}:{bold:n},...r===void 0?{}:{italic:r}}}get list_style(){return listStyleOf(this.def.levels)}get vertical_anchor(){return this.def.vertical_anchor}set vertical_anchor(e){this._set("vertical_anchor",e)}get auto_size(){return this.def.auto_size}set auto_size(e){this._set("auto_size",e)}get word_wrap(){return this.def.word_wrap}set word_wrap(e){this._set("word_wrap",e)}get margin_left(){return this.def.margin_left??TEXT_INSETS.left}set margin_left(e){this.def.margin_left=e}get margin_top(){return this.def.margin_top??TEXT_INSETS.top}set margin_top(e){this.def.margin_top=e}get margin_right(){return this.def.margin_right??TEXT_INSETS.right}set margin_right(e){this.def.margin_right=e}get margin_bottom(){return this.def.margin_bottom??TEXT_INSETS.bottom}set margin_bottom(e){this.def.margin_bottom=e}},FillFormat=class{read;write;start;constructor(e,t,n="lt1"){return this.read=e,this.write=t,this.start=n,strict2(this,"FillFormat")}solid(){const e=this.read();e==null&&this.write(this.start)}background(){this.write(null)}get type(){const e=this.read();return e===void 0?void 0:e===null?"background":"solid"}get fore_color(){const e=this.read();if(e==null)throw new TypeError("This fill is not solid, so it has no fore_color: call fill.solid() first.");return new ColorFormat(()=>this.read()??void 0,t=>{this.write(t??this.start)})}},LineFormat=class{def;constructor(e){return this.def=e,strict2(this,"LineFormat")}get color(){return new ColorFormat(()=>this.def.line??void 0,e=>{this.def.line=e??null})}get fill(){return new FillFormat(()=>this.def.line,e=>{this.def.line=e},"dk1")}get width(){return this.def.line_width??0}set width(e){this.def.line_width=e}get dash_style(){return this.def.line_dash??null}set dash_style(e){e===null?delete this.def.line_dash:this.def.line_dash=e}get begin_arrow(){return this.def.line_begin??"none"}set begin_arrow(e){this.def.line_begin=e}get end_arrow(){return this.def.line_end??"none"}set end_arrow(e){this.def.line_end=e}},Background=class{holder;constructor(e){return this.holder=e,strict2(this,"_Background")}get fill(){return new FillFormat(()=>this.holder.background,e=>{this.holder.background=e??"lt1"})}},ADJUSTMENT_DEFAULTS={roundRect:[.16667]},Adjustments=class{def;constructor(e){return this.def=e,strict2(this,"Adjustments",{index:t=>this._values()[t],setIndex:(t,n)=>{this._set(t,Number(n))}})}_values(){return this.def.adjustments??[...ADJUSTMENT_DEFAULTS[this.def.geometry??"rect"]??[]]}get length(){return this._values().length}_set(e,t){const n=this._values();if(e<0||e>=n.length)throw new RangeError(`adjustments[${String(e)}]: ${this.def.geometry??"this shape"} has ${String(n.length)}.`);if(!Number.isFinite(t))throw new Error(`adjustments[${String(e)}] = ${String(t)} is not a number.`);n[e]=t,this.def.adjustments=n}},NO_FRAME={left:0,top:0,width:0,height:0},Shape=class{def;inherit;constructor(e,t=()=>{}){return this.def=e,this.inherit=t,strict2(this,"Shape")}get _def(){return this.def}_frame(){return this.def.frame??this.inherit()??NO_FRAME}_own(){return this.def.frame??={...this._frame()},this.def.frame}get name(){return this.def.name}set name(e){this.def.name=e}get shape_type(){return this.def.path?"freeform":this.def.geometry==="line"?"line":this.def.kind}get is_placeholder(){return this.def.kind==="placeholder"}get has_table(){return this.def.table!==void 0}get has_chart(){return this.def.chart!==void 0}get chart(){if(!this.def.chart)throw new Error(`${this.def.name} is not a chart.`);return new Chart2(this.def.chart)}get table(){if(!this.def.table)throw new Error(`${this.def.name} is not a table.`);return new Table2(this.def.table)}get placeholder_format(){if(!this.def.placeholder)throw new Error(`${this.def.name} is not a placeholder.`);return{...this.def.placeholder}}get left(){return this._frame().left}set left(e){this._own().left=e}get top(){return this._frame().top}set top(e){this._own().top=e}get width(){return this._frame().width}set width(e){this._own().width=e}get height(){return this._frame().height}set height(e){this._own().height=e}get rotation(){return this.def.rotation??0}set rotation(e){if(!Number.isFinite(e))throw new Error(`${this.def.name}: rotation is a number of degrees.`);const t=(Math.trunc(e*6e4)%216e5+216e5)%216e5/6e4;t===0?Reflect.deleteProperty(this.def,"rotation"):this.def.rotation=t}get has_text_frame(){return this.def.text!==void 0}get text_frame(){if(!this.def.text)throw new Error(`${this.def.name} (a ${this.shape_type}) has no text frame: has_text_frame is false.`);return new TextFrame(this.def.text)}get text(){return this.text_frame.text}set text(e){this.text_frame.text=e}get fill(){return new FillFormat(()=>this.def.fill,e=>{this.def.fill=e})}get line(){return new LineFormat(this.def)}get adjustments(){return new Adjustments(this.def)}},isLength=e=>typeof e=="number"&&Number.isFinite(e),frameOf=(e,t,n,r,{line:u=!1}={})=>{for(const[i,o]of Object.entries({left:e,top:t,width:n,height:r}))if(!isLength(o))throw new Error(`${i} ${String(o)} is not a length (Emu, Inches, Pt, Cm, Mm).`);if(u?n<0||r<0:n<=0||r<=0)throw new Error("A shape's width and height are over 0.");return{left:Math.trunc(e),top:Math.trunc(t),width:Math.trunc(n),height:Math.trunc(r)}},GEOMETRIES=new Set(Object.values(MSO_SHAPE)),FreeformBuilder=class{steps;sx;sy;make;constructor(e,t,n){return this.steps=[{op:"move",x:e[0],y:e[1]}],[this.sx,this.sy]=typeof t=="number"?[t,t]:t,this.make=n,strict2(this,"FreeformBuilder")}add_line_segments(e,t=!0){for(const[n,r]of e)this.steps.push({op:"line",x:n,y:r});return t&&this.steps.push({op:"close"}),this}add_curve_segment(e,t,n,r,u,i){return this.steps.push({op:"curve",x1:e,y1:t,x2:n,y2:r,x:u,y:i}),this}move_to(e,t){return this.steps.push({op:"move",x:e,y:t}),this}convert_to_shape(e=0,t=0){this.steps.length<2&&refuse("convert_to_shape(): a freeform needs a segment.");const n=this.steps.flatMap(l=>l.op==="close"?[]:l.op==="curve"?[[l.x1,l.y1],[l.x2,l.y2],[l.x,l.y]]:[[l.x,l.y]]),r=n.map(l=>l[0]),u=n.map(l=>l[1]),i=Math.min(...r),o=Math.min(...u),a=Math.max(...r)-i,s=Math.max(...u)-o,c=(l,d)=>({x:l-i,y:d-o});return this.make({w:a,h:s,steps:this.steps.map(l=>{if(l.op==="close")return l;if(l.op!=="curve")return{op:l.op,...c(l.x,l.y)};const d=c(l.x1,l.y1),f=c(l.x2,l.y2);return{op:"curve",x1:d.x,y1:d.y,x2:f.x,y2:f.y,...c(l.x,l.y)}})},frameOf(Math.round(i*this.sx)+e,Math.round(o*this.sy)+t,Math.round(a*this.sx),Math.round(s*this.sy)))}},GroupShape=class{list;_name;make;constructor(e,t,n){return this.list=e,this._name=t,this.make=n,strict2(this,"GroupShape")}members(){return this.list.filter(e=>e.group===this._name)}box(){const e=this.members().flatMap(r=>r.frame?[r.frame]:[]),t=Math.min(...e.map(r=>r.left)),n=Math.min(...e.map(r=>r.top));return{left:e.length>0?t:0,top:e.length>0?n:0,right:Math.max(0,...e.map(r=>r.left+r.width)),bottom:Math.max(0,...e.map(r=>r.top+r.height))}}get shapes(){return this.make(this._name)}get shape_type(){return MSO_SHAPE_TYPE.GROUP}get name(){return this._name}set name(e){for(const t of this.members())t.group=e;this._name=e}get left(){return this.box().left}set left(e){const t=e-this.box().left;for(const n of this.members())n.frame&&(n.frame.left+=t)}get top(){return this.box().top}set top(e){const t=e-this.box().top;for(const n of this.members())n.frame&&(n.frame.top+=t)}get width(){const e=this.box();return e.right-e.left}get height(){const e=this.box();return e.bottom-e.top}},Cell=class{def;table;row;col;constructor(e,t,n,r){return this.def=e,this.table=t,this.row=n,this.col=r,strict2(this,"_Cell")}get text_frame(){return new TextFrame(this.def.text)}get text(){return this.text_frame.text}set text(e){this.text_frame.text=e}get fill(){return new FillFormat(()=>this.def.fill,e=>{this.def.fill=e})}get borders(){return this.def.borders??{}}set borders(e){this.def.borders=e}get margin_left(){return this.def.text.margin_left??TEXT_INSETS.left}set margin_left(e){this.def.text.margin_left=e}get margin_right(){return this.def.text.margin_right??TEXT_INSETS.right}set margin_right(e){this.def.text.margin_right=e}get margin_top(){return this.def.text.margin_top??TEXT_INSETS.top}set margin_top(e){this.def.text.margin_top=e}get margin_bottom(){return this.def.text.margin_bottom??TEXT_INSETS.bottom}set margin_bottom(e){this.def.text.margin_bottom=e}get vertical_anchor(){return this.def.text.vertical_anchor}set vertical_anchor(e){e===void 0?delete this.def.text.vertical_anchor:this.def.text.vertical_anchor=e}get is_merge_origin(){return(this.def.span_width??1)>1||(this.def.span_height??1)>1}get is_spanned(){return this.def.spanned===!0}get span_width(){return this.def.span_width??1}get span_height(){return this.def.span_height??1}merge(e){const t=[this.row,e.row].sort((a,s)=>a-s),n=[this.col,e.col].sort((a,s)=>a-s),[r=0,u=0]=t,[i=0,o=0]=n;for(let a=r;a<=u;a++)for(let s=i;s<=o;s++){const c=this.table.rows[a]?.cells[s];c&&(a===r&&s===i?(o>i&&(c.span_width=o-i+1),u>r&&(c.span_height=u-r+1)):c.spanned=!0)}}split(){const e=this.span_width,t=this.span_height;delete this.def.span_width,delete this.def.span_height;for(let n=this.row;n<this.row+t;n++)for(let r=this.col;r<this.col+e;r++){const u=this.table.rows[n]?.cells[r];u&&delete u.spanned}}},Column=class{def;at;constructor(e,t){return this.def=e,this.at=t,strict2(this,"_Column")}get width(){return this.def.columns[this.at]??0}set width(e){this.def.columns[this.at]=e}},Row=class{def;at;constructor(e,t){return this.def=e,this.at=t,strict2(this,"_Row")}get row(){const e=this.def.rows[this.at];if(!e)throw new Error(`The table has no row ${String(this.at)}.`);return e}get height(){return this.row.height}set height(e){this.row.height=e}},Table2=class{def;constructor(e){return this.def=e,strict2(this,"Table")}cell(e,t){const n=this.def.rows[e]?.cells[t];if(!n)throw new Error(`cell(): the table has ${String(this.def.rows.length)} rows and ${String(this.def.columns.length)} columns.`);return new Cell(n,this.def,e,t)}*iter_cells(){for(let e=0;e<this.def.rows.length;e++)for(let t=0;t<this.def.columns.length;t++)yield this.cell(e,t)}get columns(){return this.def.columns.map((e,t)=>new Column(this.def,t))}get rows(){return this.def.rows.map((e,t)=>new Row(this.def,t))}flag(e){return this.def[e]===!0}get first_row(){return this.flag("first_row")}set first_row(e){this.def.first_row=e}get first_col(){return this.flag("first_col")}set first_col(e){this.def.first_col=e}get last_row(){return this.flag("last_row")}set last_row(e){this.def.last_row=e}get last_col(){return this.flag("last_col")}set last_col(e){this.def.last_col=e}get horz_banding(){return this.flag("horz_banding")}set horz_banding(e){this.def.horz_banding=e}get vert_banding(){return this.flag("vert_banding")}set vert_banding(e){this.def.vert_banding=e}};function freeShapeName(e,t,n=[]){const r=new Set([...e,...n].map(i=>i.name));let u=1;for(;r.has(`${t}-${String(u)}`);)u++;return`${t}-${String(u)}`}var ShapeCollection=class Se{list;base;components;inherit;group;under;constructor(t,n,r,u=()=>{},i=()=>[],o){return this.list=t,this.base=n,this.components=r,this.inherit=u,this.under=i,this.group=o,strict2(this,"SlideShapes",{index:a=>this._at(a)})}_wrap(t){return new Shape(t,()=>this.inherit(t))}_at(t){const n=this.list[t];return n?this._wrap(n):void 0}*[Symbol.iterator](){for(const t of this.list)yield this._wrap(t)}get length(){return this.list.length}get(t){const n=this.list.find(r=>r.name===t);return n?this._wrap(n):void 0}get title(){const t=this.list.find(n=>n.placeholder?.type==="title"||n.placeholder?.type==="ctrTitle");return t?this._wrap(t):void 0}get placeholders(){return new Placeholders(this.list,this.inherit)}_add(t,n){const r={name:freeShapeName(this.list,t,this.under()),...n,...this.group===void 0?{}:{group:this.group}};return this.list.push(r),this._wrap(r)}add_textbox(t,n,r,u){return this._add("textbox",{kind:"textbox",frame:frameOf(t,n,r,u),text:{...newText(),...TEXTBOX_FRAME}})}add_picture(t,n,r,u,i){return(u===void 0||i===void 0)&&refuse("add_picture() takes a width and a height here: a picture's own size is not read while a deck's code runs"),this._add("picture",{kind:"picture",frame:frameOf(n,r,u??0,i??0),media:{path:t,base:this.base}})}add_movie(t,n,r,u,i,o={}){return this._add("movie",{kind:"movie",frame:frameOf(n,r,u,i),media:{path:t,base:this.base,...o.poster_frame_time===void 0?{}:{poster:o.poster_frame_time}}})}add_shape(t,n,r,u,i){GEOMETRIES.has(t)||refuse(`add_shape(): ${t} is not one of MSO_SHAPE's ${Object.keys(MSO_SHAPE).join(", ")}`);const o=newText();return o.vertical_anchor=AUTOSHAPE_STYLE.vertical_anchor,o.paragraphs=[{runs:[],level:0,alignment:AUTOSHAPE_STYLE.alignment}],this._add("shape",{kind:"autoshape",frame:frameOf(n,r,u,i),geometry:t,fill:AUTOSHAPE_STYLE.fill,line:AUTOSHAPE_STYLE.line,line_width:AUTOSHAPE_STYLE.line_width,text:o})}add_table(t,n,r,u,i,o){(t<1||n<1)&&refuse("add_table(): a table has at least a row and a column.");const a=Math.floor(i/n),s=Math.floor(o/t);return this._add("table",{kind:"table",frame:frameOf(r,u,i,o),table:{columns:Array.from({length:n},()=>a),rows:Array.from({length:t},()=>({height:s,cells:Array.from({length:n},()=>({text:newText()}))}))}})}add_chart(t,n,r,u,i,o){return this._add("chart",{kind:"chart",frame:frameOf(n,r,u,i),chart:{type:t,categories:[...o.categories],series:o._series()}})}add_group_shape(){this.group!==void 0&&refuse("add_group_shape(): a group here holds shapes, not another group.");let t=1;for(;this.list.some(n=>n.group===`group-${String(t)}`);)t++;return new GroupShape(this.list,`group-${String(t)}`,n=>new Se(this.list,this.base,this.components,this.inherit,this.under,n))}build_freeform(t=0,n=0,r=1){return new FreeformBuilder([t,n],r,(u,i)=>{const o=newText();return o.vertical_anchor=AUTOSHAPE_STYLE.vertical_anchor,o.paragraphs=[{runs:[],level:0,alignment:AUTOSHAPE_STYLE.alignment}],this._add("freeform",{kind:"autoshape",frame:i,path:u,fill:AUTOSHAPE_STYLE.fill,line:AUTOSHAPE_STYLE.line,line_width:AUTOSHAPE_STYLE.line_width,text:o})})}add_connector(t,n,r,u,i){t!==MSO_CONNECTOR.STRAIGHT&&refuse(`add_connector(): ${t} is not one of MSO_CONNECTOR's ${Object.keys(MSO_CONNECTOR).join(", ")}`);const o=frameOf(Math.min(n,u),Math.min(r,i),Math.abs(u-n),Math.abs(i-r),{line:!0}),a=u<n,s=i<r;return this._add("connector",{kind:"autoshape",frame:o,geometry:"line",...a||s?{flip:{...a?{h:a}:{},...s?{v:s}:{}}}:{},line:CONNECTOR_STYLE.line,line_width:CONNECTOR_STYLE.line_width})}add_component(t,n,r,u,i,o={}){if(!Object.hasOwn(this.components(),t))throw new Error(`add_component(): the presentation has no component ${t}; add it with prs.components.add("${t}", { … }) first.`);return this._add(t,{kind:"component",frame:frameOf(n,r,u,i),component:{name:t,props:o}})}},NAME_OF_TYPE={title:"title",ctrTitle:"title",subTitle:"subtitle",body:"body",pic:"picture",media:"media",obj:"content",dt:"date",ftr:"footer",sldNum:"slide-number"},Placeholders=class{list;inherit;constructor(e,t=()=>{}){return this.list=e,this.inherit=t,strict2(this,"placeholders",{index:n=>this.get(n)})}_wrap(e){return new Shape(e,()=>this.inherit(e))}*[Symbol.iterator](){for(const e of this.list)e.kind==="placeholder"&&(yield this._wrap(e))}get length(){return this.list.filter(e=>e.kind==="placeholder").length}get(e){const t=this.list.find(n=>n.kind==="placeholder"&&(typeof e=="number"?n.placeholder?.idx===e:n.name===e||n.placeholder?.type===e));return t?this._wrap(t):void 0}add(e,t,n,r,u,i={}){const o=typeof t=="object"?t:i,a=typeof t=="object"?void 0:t;Object.values(PP_PLACEHOLDER).includes(e)||refuse(`placeholders.add(): ${e} is not one of PP_PLACEHOLDER's ${Object.keys(PP_PLACEHOLDER).join(", ")}`);const s=this.list.filter(h=>h.kind==="placeholder"),c=new Set(s.map(h=>h.placeholder?.idx));let l=e==="title"||e==="ctrTitle"?0:FOOTER_IDX[e]??1;for(;c.has(l)&&l!==0;)l++;if(c.has(l))throw new Error("A layout has one title placeholder (idx 0).");const d=o.name??NAME_OF_TYPE[e];if(this.list.some(h=>h.name===d))throw new Error(`Two shapes are ${d}: give the placeholder a name ({ name }).`);const f=[a,n,r,u].filter(h=>h!==void 0);if(f.length!==0&&f.length!==4)throw new Error("placeholders.add(type, left, top, width, height): give all four, or none to take the master's frame.");const m={name:d,kind:"placeholder",placeholder:{type:e,idx:l},...f.length===4?{frame:frameOf(a??0,n??0,r??0,u??0)}:{},text:newText()};return this.list.push(m),this._wrap(m)}},SlideLayout=class{def;master;ctx;constructor(e,t,n){return this.def=e,this.master=t,this.ctx=n,strict2(this,"SlideLayout")}get _def(){return this.def}inherit=e=>e.placeholder?masterPlaceholder(this.master._def,e.placeholder.type)?.frame:void 0;get name(){return this.def.name}get slide_master(){return this.master}get display_master_shapes(){return this.def.display_master_shapes??!0}set display_master_shapes(e){e?delete this.def.display_master_shapes:this.def.display_master_shapes=!1}get background(){return new Background(this.def)}get placeholders(){return new Placeholders(this.def.shapes,this.inherit)}get shapes(){return new ShapeCollection(this.def.shapes,this.ctx.base,this.ctx.components,this.inherit,()=>this.master._def.shapes)}},SlideLayouts=class{list;make;constructor(e,t){return this.list=e,this.make=t,strict2(this,"SlideLayouts",{index:n=>this.list[n]})}*[Symbol.iterator](){yield*this.list}get length(){return this.list.length}get_by_name(e,t){return this.list.find(n=>n.name===e)??t}index(e){const t=this.list.indexOf(e);if(t<0)throw new Error(`${e.name} is not among these layouts.`);return t}add(e,t){if(!this.make)throw new Error("A layout is added to a master: master.slide_layouts.add(name).");const n=this.make(e);return t?.(n),n}},TextStyles=class{def;constructor(e){return this.def=e,strict2(this,"text_styles")}get title_style(){return listStyleOf(this.def.title)}get body_style(){return listStyleOf(this.def.body)}get other_style(){return listStyleOf(this.def.other)}},SlideMaster=class{def;layouts=[];ctx;allLayouts;constructor(e,t,n){return this.def=e,this.ctx=t,this.allLayouts=n,strict2(this,"SlideMaster")}get _def(){return this.def}get name(){return this.def.name}get background(){return new Background(this.def)}get placeholders(){return new Placeholders(this.def.shapes)}get shapes(){return new ShapeCollection(this.def.shapes,this.ctx.base,this.ctx.components)}get text_styles(){return new TextStyles(this.def.text_styles)}get slide_layouts(){return new SlideLayouts(this.layouts,e=>{if(this.allLayouts.some(r=>r.name===e))throw new Error(`Two layouts are "${e}": a layout's name is unique in the deck, as slides.yaml names it.`);const t={name:e,master:this.def.name,shapes:[]};this.def.layouts.push(t);const n=new SlideLayout(t,this,this.ctx);return this.layouts.push(n),this.allLayouts.push(n),n})}},SlideMasters=class{list;make;constructor(e,t){return this.list=e,this.make=t,strict2(this,"SlideMasters",{index:n=>this.list[n]})}*[Symbol.iterator](){yield*this.list}get length(){return this.list.length}index(e){return this.list.indexOf(e)}add(e,t){const n=this.make(e);return t?.(n),n}},GeneratedSlide=class{own;def;layout;constructor(e,t,n){this.def=e,this.layout=t,this.own=t._def.shapes.filter(u=>u.kind==="placeholder").map(u=>({name:u.name,kind:"placeholder",...u.placeholder?{placeholder:{...u.placeholder}}:{},text:newText()}));const r=u=>{const i=t._def.shapes.find(o=>o.kind==="placeholder"&&o.placeholder?.idx===u.placeholder?.idx);return i?i.frame??(i.placeholder?masterPlaceholder(t.slide_master._def,i.placeholder.type)?.frame:void 0):void 0};return this._shapes=new ShapeCollection(this.own,n.base,n.components,r,()=>[...t.slide_master._def.shapes,...t._def.shapes]),this._placeholders=new Placeholders(this.own,r),strict2(this,"Slide")}_shapes;_placeholders;get shapes(){return this._shapes}get placeholders(){return this._placeholders}get slide_id(){return this.def.id}get slide_layout(){return this.layout}get has_notes_slide(){return this.def.notes!==void 0}get notes_slide(){const e=this.def;return{notes_text_frame:{get text(){return e.notes??""},set text(t){e.notes=t}}}}get transition(){return this.def.transition}set transition(e){e===void 0?delete this.def.transition:this.def.transition=e}get animations(){return new Animations(this.def.animations??=[])}_done(){const e={},t=[];for(const n of this.own)n.kind==="placeholder"&&n.placeholder?(n.text?.paragraphs.some(r=>r.runs.length>0)&&(e[n.placeholder.idx]=n.text.paragraphs),n.frame&&t.push({...n,text:newText()})):t.push(n);return{...this.def,shapes:t,text:e}}},Animations=class{list;constructor(e){return this.list=e,strict2(this,"Animations")}add(e,t,n={}){this.list.push({shape:typeof e=="string"?e:e.name,effect:t,...n})}get length(){return this.list.length}},GeneratedSlides=class{gen;constructor(e){return this.gen=e,strict2(this,"slides")}add_slide(e,t){return this.gen._add(e,t)}},Generator=class{list=[];prs;ctx;constructor(e,t){return this.prs=e,this.ctx=t,strict2(this,"Generator")}data(e){return this.ctx.data(e)}get slides(){return new GeneratedSlides(this)}_add(e,t){const n=typeof e=="string"?this.prs._layout(e):e;if(!n)throw new Error(`add_slide(): the presentation has no layout ${typeof e=="string"?e:e.name}.`);if(!/^[A-Za-z0-9_-]+$/u.test(t))throw new Error(`add_slide(): ${t} is not an id of letters, digits, _ and -.`);if(this.list.some(u=>u.slide_id===t))throw new Error(`add_slide(): two slides are ${t}.`);const r=new GeneratedSlide({id:t,layout:n.name,shapes:[],text:{}},n,this.prs._ctx);return this.list.push(r),r}_made(){return this.list.map(e=>e._done())}},cloneStyles=()=>JSON.parse(JSON.stringify(OFFICE_TEXT_STYLES)),Presentation=class{masters=[];layouts=[];def;_ctx;constructor(e,t){return this.def={slide_width:e[0],slide_height:e[1],masters:[],components:{},generators:{}},this._ctx={base:t,components:()=>this.def.components},strict2(this,"Presentation")}get _def(){return this.def}get slide_width(){return this.def.slide_width}set slide_width(e){this.def.slide_width=e}get slide_height(){return this.def.slide_height}set slide_height(e){this.def.slide_height=e}get slide_masters(){return new SlideMasters(this.masters,e=>{if(this.masters.some(r=>r.name===e))throw new Error(`Two masters are "${e}".`);const t={name:e,background:"lt1",text_styles:cloneStyles(),shapes:[],layouts:[]};this.def.masters.push(t);const n=new SlideMaster(t,this._ctx,this.layouts);return this.masters.push(n),n})}get slide_master(){const e=this.masters[0];if(!e)throw new Error("The presentation has no master yet: prs.slide_masters.add(name) makes one.");return e}get slide_layouts(){const e=this.masters[0];return e?e.slide_layouts:new SlideLayouts([])}get slides(){return refuse("A deck's slides are slides.yaml's, in order, each on a layout, and their words the script's; slides made from data are a generator's (prs.generators.add)")}save(){return refuse("A deck is not saved by its code: allyhub render writes its PDF, pictures and PPTX")}get theme(){return this.def.theme??={},this.def.theme}set theme(e){this.def.theme=e}get components(){return strict2({add:(e,t)=>{if(Object.hasOwn(this.def.components,e))throw new Error(`Two components are "${e}".`);if(typeof t.layers!="function")throw new Error(`Component ${e} draws with its layers function.`);this.def.components[e]={name:e,props:t.props??{},layers:t.layers}}},"components")}get generators(){return strict2({add:(e,t)=>{if(Object.hasOwn(this.def.generators,e))throw new Error(`Two generators are "${e}".`);this.def.generators[e]={name:e,make:n=>{const r=new Generator(this,n);return t(r),r._made()}}}},"generators")}_layout(e){return this.layouts.find(t=>t.name===e)}},DECK_BRAND="__allyhubDeck";function isDeck(e){return typeof e=="object"&&e!==null&&DECK_BRAND in e}function evaluateDeck(e){const t=e.options.size??"16:9",n=typeof t=="string"?SLIDE_SIZES[t]:[t.width,t.height],r=e.written.file.split("/").slice(0,-1).join("/"),u=new Presentation(n,r);return e.options.theme&&(u.theme=JSON.parse(JSON.stringify(e.options.theme))),e.build(u),u._def}var pointsOf=e=>e===void 0?void 0:e/Pt(1),ChartFont=class{read;write;constructor(e,t){return this.read=e,this.write=t,strict2(this,"ChartFont")}get size(){const e=this.read().size;return e===void 0?void 0:Pt(e)}set size(e){const t=this.read(),n=pointsOf(e);this.write({...t.color===void 0?{}:{color:t.color},...n===void 0?{}:{size:n}})}get color(){return new ColorFormat(()=>this.read().color,e=>{const{size:t}=this.read();this.write({...t===void 0?{}:{size:t},...e===void 0?{}:{color:e}})})}},ChartLine=class{read;write;constructor(e,t){return this.read=e,this.write=t,strict2(this,"ChartLine")}get color(){return new ColorFormat(this.read,this.write)}},ChartSeries2=class{def;at;constructor(e,t){return this.def=e,this.at=t,strict2(this,"ChartSeries")}get name(){return this.def.name}get values(){return this.def.values}get marker(){const e=this.def;return{get size(){return e.marker_size},set size(t){t===void 0?delete e.marker_size:e.marker_size=t}}}get smooth(){return this.def.smooth===!0}set smooth(e){this.def.smooth=e}get format(){const e=this.def;return{line:{get width(){return e.line_width===void 0?void 0:Pt(e.line_width)},set width(t){t===void 0?delete e.line_width:e.line_width=t/Pt(1)}},fill:new FillFormat(()=>this.def.color??accentOf(this.at),t=>{t!==null&&(this.def.color=t)})}}},DataLabels=class{def;constructor(e){return this.def=e,strict2(this,"DataLabels")}get show_value(){return this.def.show_value??!1}set show_value(e){this.def.show_value=e}get show_percentage(){return this.def.show_percentage??!1}set show_percentage(e){this.def.show_percentage=e}get show_category_name(){return this.def.show_category_name??!1}set show_category_name(e){this.def.show_category_name=e}get show_series_name(){return this.def.show_series_name??!1}set show_series_name(e){this.def.show_series_name=e}get number_format(){return this.def.number_format??"General"}set number_format(e){this.def.number_format=e}get position(){return this.def.position}set position(e){e===void 0?delete this.def.position:this.def.position=e}get font(){return new ChartFont(()=>({...this.def.size===void 0?{}:{size:this.def.size},...this.def.color===void 0?{}:{color:this.def.color}}),e=>{delete this.def.size,delete this.def.color,Object.assign(this.def,e)})}},ChartPlot=class{def;constructor(e){return this.def=e,strict2(this,"ChartPlot")}get categories(){return this.def.categories}get series(){return this.def.series.map((e,t)=>new ChartSeries2(e,t))}get has_data_labels(){return this.def.labels!==void 0}set has_data_labels(e){e?this.def.labels??={show_value:!0}:delete this.def.labels}get data_labels(){return this.def.labels??={show_value:!0},new DataLabels(this.def.labels)}get gap_width(){return this.def.gap_width??150}set gap_width(e){this.def.gap_width=e}get overlap(){return this.def.overlap??0}set overlap(e){this.def.overlap=e}get vary_by_categories(){return this.def.vary_by_categories??isRound(this.def.type)}set vary_by_categories(e){this.def.vary_by_categories=e}},ChartLegend=class{def;constructor(e){return this.def=e,strict2(this,"ChartLegend")}get position(){return this.def.legend??"right"}set position(e){this.def.legend=e}},ChartAxis2=class{def;constructor(e){return this.def=e,strict2(this,"ChartAxis")}get minimum_scale(){return this.def.minimum_scale}set minimum_scale(e){e===void 0?delete this.def.minimum_scale:this.def.minimum_scale=e}get maximum_scale(){return this.def.maximum_scale}set maximum_scale(e){e===void 0?delete this.def.maximum_scale:this.def.maximum_scale=e}get major_unit(){return this.def.major_unit}set major_unit(e){e===void 0?delete this.def.major_unit:this.def.major_unit=e}get has_major_gridlines(){return this.def.has_major_gridlines??!0}set has_major_gridlines(e){this.def.has_major_gridlines=e}get visible(){return this.def.visible??!0}set visible(e){this.def.visible=e}get reverse_order(){return this.def.reverse_order??!1}set reverse_order(e){this.def.reverse_order=e}get tick_labels(){const e=this.def;return{get number_format(){return e.number_format??"General"},set number_format(t){e.number_format=t}}}get major_gridlines(){return{format:{line:new ChartLine(()=>this.def.gridline_color,e=>{e===void 0?delete this.def.gridline_color:this.def.gridline_color=e})}}}get format(){return{line:new ChartLine(()=>this.def.line_color,e=>{e===void 0?delete this.def.line_color:this.def.line_color=e})}}},Chart2=class{def;constructor(e){return this.def=e,strict2(this,"Chart")}get chart_type(){return this.def.type}get has_legend(){return this.def.legend!==void 0}set has_legend(e){e?this.def.legend??="right":delete this.def.legend}get legend(){return new ChartLegend(this.def)}get has_title(){return this.def.title!==void 0}set has_title(e){e?this.def.title??="":delete this.def.title}get chart_title(){const e=this.def;return{font:{get size(){return e.title_size===void 0?void 0:Pt(e.title_size)},set size(t){t===void 0?delete e.title_size:e.title_size=t/Pt(1)}},text_frame:{get text(){return e.title??""},set text(t){e.title=t}}}}get font(){return new ChartFont(()=>({...this.def.font_size===void 0?{}:{size:this.def.font_size},...this.def.font_color===void 0?{}:{color:this.def.font_color}}),e=>{delete this.def.font_size,delete this.def.font_color,e.size!==void 0&&(this.def.font_size=e.size),e.color!==void 0&&(this.def.font_color=e.color)})}get plots(){return[new ChartPlot(this.def)]}get series(){return this.def.series.map((e,t)=>new ChartSeries2(e,t))}get value_axis(){return this.def.value_axis??={},new ChartAxis2(this.def.value_axis)}get category_axis(){return this.def.category_axis??={},new ChartAxis2(this.def.category_axis)}replace_data(e){const t=this.def.series;this.def.categories=[...e.categories],this.def.series=e._series().map((n,r)=>{const u=t[r]?.color;return u===void 0?n:{...n,color:u}})}},DECK_FONTS={major:"Arial",minor:"Arial",major_east_asian:"Microsoft YaHei",minor_east_asian:"Microsoft YaHei",code:"Courier New"},EAST_ASIAN_FONT=DECK_FONTS.minor_east_asian,OFFICE_THEME={name:"Office",colors:{dk1:"#000000",lt1:"#FFFFFF",dk2:"#44546A",lt2:"#E7E6E6",accent1:"#4472C4",accent2:"#ED7D31",accent3:"#A5A5A5",accent4:"#FFC000",accent5:"#5B9BD5",accent6:"#70AD47",hlink:"#0563C1",folHlink:"#954F72"},fonts:{major:"Calibri Light",minor:"Calibri",major_east_asian:EAST_ASIAN_FONT,minor_east_asian:EAST_ASIAN_FONT,code:DECK_FONTS.code}};function themeOfLook(e){return{name:e.name??"look",colors:{...OFFICE_THEME.colors,dk1:e.color.fg,lt1:e.color.bg,dk2:e.color.muted,lt2:e.color.surface,accent1:e.color.accent},fonts:{...DECK_FONTS}}}function themeOver(e,t){return t?{name:t.name??e.name,colors:{...e.colors,...t.colors},fonts:{...e.fonts,...t.fonts}}:e}var fontFace=e=>(e.split(",")[0]??e).trim().replace(/^["']|["']$/gu,"").replace(/ Variable$/u,"");function joinPath(e,t){if(t.startsWith("/"))return t.slice(1);const n=e===""?[]:e.split("/");for(const r of t.split("/"))r===""||r==="."||(r===".."?n.pop():n.push(r));return n.join("/")}var NO_FRAME2={left:0,top:0,width:0,height:0},fallbackLevels=()=>Array.from({length:9},()=>({...TEXT_FALLBACK,font:{...TEXT_FALLBACK.font},margin_left:0}));function levelsOver(e,...t){return e.map((n,r)=>{let u={...n,font:{...n.font}};for(const i of t){const o=i?.[r];o&&(u={...u,...o.alignment===void 0?{}:{alignment:o.alignment},...o.line_spacing===void 0?{}:{line_spacing:o.line_spacing},...o.space_before===void 0?{}:{space_before:o.space_before},...o.space_after===void 0?{}:{space_after:o.space_after},...o.margin_left===void 0?{}:{margin_left:o.margin_left},...o.indent===void 0?{}:{indent:o.indent},font:{...u.font,...o.font}},o.font?.color!==void 0&&delete u.font.rgb,o.font?.rgb!==void 0&&delete u.font.color,o.bullet===null?delete u.bullet:o.bullet!==void 0?u.bullet={char:o.bullet,...o.bullet_font===void 0?{}:{font:o.bullet_font}}:o.bullet_font!==void 0&&u.bullet&&(u.bullet={...u.bullet,font:o.bullet_font}))}return u})}function bodyOf(e,...t){const n=t.filter(u=>u!==void 0),r=u=>{for(let i=n.length-1;i>=0;i--){const o=n[i]?.[u];if(o!==void 0)return o}};return{vertical_anchor:r("vertical_anchor")??e.vertical_anchor,auto_size:r("auto_size")??e.auto_size,word_wrap:r("word_wrap")??e.word_wrap,margins:{left:r("margin_left")??TEXT_INSETS.left,top:r("margin_top")??TEXT_INSETS.top,right:r("margin_right")??TEXT_INSETS.right,bottom:r("margin_bottom")??TEXT_INSETS.bottom}}}var PLAIN={vertical_anchor:"t",auto_size:"none",word_wrap:!0};function plainStyle(e,t){return{...bodyOf(PLAIN,t),levels:levelsOver(fallbackLevels(),e.text_styles.other,t.levels)}}function placeholderStyle(e,t,...n){return{...bodyOf(placeholderFrame(t),...n),levels:levelsOver(fallbackLevels(),e.text_styles[styleKindOf(t)],...n.map(r=>r?.levels))}}var AUTOSHAPE_LEVELS=Array.from({length:9},()=>({font:{color:AUTOSHAPE_STYLE.font_color}})),AUTOSHAPE_FRAME={vertical_anchor:AUTOSHAPE_STYLE.vertical_anchor};function autoshapeStyle(e,t){return{...bodyOf(PLAIN,t),levels:levelsOver(fallbackLevels(),e.text_styles.other,AUTOSHAPE_LEVELS,t.levels)}}var ownOf=e=>{const t={...e};return delete t.paragraphs,t},fileFrame=e=>({paragraphs:[],levels:[],...e}),lineOfFile=e=>e==="none"?null:colorOfFile(e),WORDS_SPAN=/<span((?:\s+(?:color|font)="[^"\n]*")+)\s*>(.*?)<\/span>/gu,SPAN_ATTR=/(color|font)="([^"\n]*)"/gu,SPAN=57344,SPANS=256,SPAN_END="",SPAN_PART=/[\ue000-\ue100]|[^\ue000-\ue100]+/gu,colorOfFile=e=>e.startsWith("#")?{rgb:e.toUpperCase()}:e;function tableOf(e,t,n=[]){return{...e,rows:e.rows.map((r,u)=>({height:r.height,cells:r.cells.map(i=>{const o=n[u];return{...i,text:{paragraphs:i.text.paragraphs,style:withFileStyle({...plainStyle(t,i.text),auto_size:"shape"},o),own:ownOf(i.text),empty:!1},...o?{fileText:o}:{}}})}))}}function withFileStyle(e,t){return t?{...e,levels:e.levels.map(n=>{const r={...n.font,...t.size===void 0?{}:{size:Pt(t.size)},...t.bold===void 0?{}:{bold:t.bold},...t.italic===void 0?{}:{italic:t.italic},...t.font===void 0?{}:{name:t.font}};if(t.color!==void 0){const u=colorOfFile(t.color);typeof u=="string"?(r.color=u,delete r.rgb):(r.rgb=u.rgb,delete r.color)}return{...n,font:r,...t.align===void 0?{}:{alignment:t.align}}})}:e}function spanFont(e){const t={};for(const[,n,r=""]of e.matchAll(SPAN_ATTR))if(n==="font")t.name=r.trim();else{const u=colorOfFile(r);typeof u=="string"?t.color=u:t.rgb=u.rgb}return t}function paragraphsOfWords(e,t=0,n=DECK_FONTS.code){return e===void 0?[]:typeof e=="string"?e.split(/\r?\n/u).map(r=>{const u=[],i=r.replace(WORDS_SPAN,(c,l,d)=>(u.push(spanFont(l)),`${String.fromCharCode(SPAN+u.length-1)}${d}${SPAN_END}`)),o=readMarks(i);let a;const s=markRuns(o.text,o.marks).flatMap(c=>{const l=c.kinds.includes("code"),d={...c.kinds.includes("strong")?{bold:!0}:{},...c.kinds.includes("em")?{italic:!0}:{},...l?{name:n}:{}};return[...c.text.matchAll(SPAN_PART)].flatMap(f=>{const m=f[0],h=m.charCodeAt(0);if(m===SPAN_END)return a=void 0,[];if(h>=SPAN&&h<SPAN+SPANS)return a=u[h-SPAN],[];const g={...a,...d};return[{text:m,...Object.keys(g).length>0?{font:g}:{},...l?{code:!0}:{}}]})});return{runs:s.length>0?s:[{text:""}],level:t}}):e.flatMap(r=>paragraphsOfWords(r,Array.isArray(r)?Math.min(t+1,8):t,n))}var frameOfFile=e=>({left:Pt(e.x),top:Pt(e.y),width:Pt(e.w),height:Pt(e.h)}),cropOf=e=>e===void 0?void 0:{left:e.left??0,top:e.top??0,right:e.right??0,bottom:e.bottom??0};function resolveDeck(e){const{def:t,file:n,words:r,prefix:u,base:i}=e,o=[],a=themeOver(e.theme??OFFICE_THEME,t.theme),s=new Map;for(const p of t.masters)for(const v of p.layouts)s.set(v.name,{layout:v,master:p});const c=[],l=(p,v,y)=>({name:p.name,kind:p.kind,frame:{...p.frame??NO_FRAME2},...p.flip?{flip:{...p.flip}}:{},...p.rotation===void 0?{}:{rotation:p.rotation},level:v,...p.text?{text:{paragraphs:p.text.paragraphs,style:p.kind==="autoshape"?autoshapeStyle(y,p.text):plainStyle(y,p.text),own:ownOf(p.text),empty:!1}}:{},...p.fill===void 0?{}:{fill:p.fill},...p.line===void 0?{}:{line:p.line},...p.line_width===void 0?{}:{line_width:p.line_width},...p.line_dash===void 0?{}:{line_dash:p.line_dash},...p.line_begin===void 0?{}:{line_begin:p.line_begin},...p.line_end===void 0?{}:{line_end:p.line_end},...p.path?{path:p.path}:{},...p.table?{table:tableOf(p.table,y)}:{},...p.chart?{chart:p.chart}:{},...p.group===void 0?{}:{group:p.group},...p.geometry?{geometry:p.geometry}:{},...p.adjustments?{adjustments:[...p.adjustments]}:{},...p.media?{media:{path:joinPath(p.media.base,p.media.path),...p.media.poster===void 0?{}:{poster:p.media.poster}}}:{},...p.component?{component:{...p.component}}:{},sources:{frame:{from:v}}}),d=(p,v)=>{const y=p.placeholder?.type??"body",A=masterPlaceholder(v,y),b=p.frame??A?.frame??NO_FRAME2;return{name:p.name,kind:"placeholder",frame:{...b},level:"slide",...p.placeholder?{placeholder:{...p.placeholder}}:{},text:{paragraphs:[],style:placeholderStyle(v,y,A?.text,p.text),empty:!0},...p.fill===void 0?{}:{fill:p.fill},...p.line===void 0?{}:{line:p.line},sources:{frame:{from:p.frame||!A?"layout":"master"},text:{from:"layout"}}}},f=(p,v,y)=>{const A=t.components[p];if(!A){o.push({...y,message:`There is no component ${p} in slides.ts (it has ${Object.keys(t.components).join(", ")||"none"}).`});return}for(const b of Object.keys(v??{}))Object.hasOwn(A.props,b)||o.push({...y,message:`Component ${p} has no prop ${b} a person sets (it has ${Object.keys(A.props).join(", ")||"none"}).`});return{name:p,props:{...v??{}}}},m=(p,v,y,A,b)=>{const x={slide:A,shape:p,path:y};if(!v.frame){o.push({...x,message:`Shape ${p} is the slide's own: it needs a frame { x, y, w, h } in points.`});return}const B=frameOfFile(v.frame),$={frame:{from:"slide",path:`${y}.frame`}},k={name:p,frame:B,level:"slide",...v.fill===void 0?{}:{fill:colorOfFile(v.fill)},...v.line===void 0?{}:{line:lineOfFile(v.line)},...v.line_dash===void 0?{}:{line_dash:v.line_dash},...v.line_begin===void 0?{}:{line_begin:v.line_begin},...v.line_end===void 0?{}:{line_end:v.line_end},...v.group===void 0?{}:{group:v.group}};if(v.textbox)return{...k,kind:"textbox",text:{paragraphs:paragraphsOfWords(r(`${u}.${A}.${p}`),0,a.fonts.code),style:withFileStyle(plainStyle(b,fileFrame(DRAWN_TEXTBOX_FRAME)),v.text),own:ownOf(fileFrame(DRAWN_TEXTBOX_FRAME)),empty:!1},...v.text?{fileText:{...v.text}}:{},sources:{...$,text:{from:"slide",path:`${y}.text`}}};if(v.picture!==void 0){const I=cropOf(v.crop);return{...k,kind:"picture",media:{path:joinPath(i,v.picture),...I?{crop:I}:{}},sources:$}}if(v.movie!==void 0)return{...k,kind:"movie",media:{path:joinPath(i,v.movie),...v.poster===void 0?{}:{poster:v.poster}},sources:$};if(v.chart){const I=r(`${u}.${A}.${p}`),M=chartOfFile(v.chart,{title:typeof I=="string"?I:void 0,base:i,rows:_=>e.data?.(_),problem:_=>{o.push({...x,message:`Chart ${p}: ${_}`})}});return M?{...k,kind:"chart",chart:M,sources:$}:void 0}if(v.table){const I=v.table,M=B.width/I.columns.reduce((T,P)=>T+P,0),_=B.height/I.rows.reduce((T,P)=>T+P.height,0),F=r(`${u}.${A}.${p}`),N=Array.isArray(F)?F:[];return N.length>I.rows.length&&o.push({...x,message:`Table ${p} has ${String(I.rows.length)} rows and its words ${String(N.length)}.`}),{...k,kind:"table",table:tableOf({columns:I.columns.map(T=>Math.round(T*M)),rows:I.rows.map((T,P)=>{const V=N[P],Z=Array.isArray(V)?V:V===void 0?[]:[V];return{height:Math.round(T.height*_),cells:I.columns.map((S,H)=>({text:{levels:[],paragraphs:paragraphsOfWords(Z[H],0,a.fonts.code)},...T.fill===void 0?{}:{fill:colorOfFile(T.fill)},...T.line===void 0?{}:{borders:{bottom:{color:colorOfFile(T.line),width:Pt(1)}}}}))}})},b,I.rows.map(T=>T.text)),sources:$}}const w=v.path&&pathSteps(v.path.d);if(v.path&&!w){o.push({...x,message:`Shape ${p}'s path starts with M and says only M, L, C and Z, absolute.`});return}if(v.geometry!==void 0||v.path&&w)return{...k,kind:"autoshape",...v.path&&w?{path:{w:v.path.w,h:v.path.h,steps:w}}:v.geometry===void 0?{}:{geometry:v.geometry},...v.geometry==="line"?{line:v.line===void 0?CONNECTOR_STYLE.line:lineOfFile(v.line),line_width:v.line_width===void 0?CONNECTOR_STYLE.line_width:Pt(v.line_width)}:{fill:v.fill===void 0?AUTOSHAPE_STYLE.fill:colorOfFile(v.fill),line:v.line===void 0?AUTOSHAPE_STYLE.line:lineOfFile(v.line),line_width:v.line_width===void 0?AUTOSHAPE_STYLE.line_width:Pt(v.line_width)},...v.text&&v.geometry!=="line"?{fileText:{...v.text}}:{},...v.geometry==="line"?{}:{text:{paragraphs:paragraphsOfWords(r(`${u}.${A}.${p}`)).map(I=>v.text?.align===void 0?{alignment:AUTOSHAPE_STYLE.alignment,...I}:I),style:withFileStyle(autoshapeStyle(b,fileFrame(AUTOSHAPE_FRAME)),v.text),own:ownOf(fileFrame(AUTOSHAPE_FRAME)),empty:!1}},sources:{...$,fill:{from:"slide",path:`${y}.fill`}}};if(v.component!==void 0){const I=f(v.component,v.props,x);return I?{...k,kind:"component",component:I,sources:$}:void 0}},h=(p,v,y)=>{if(v.frame&&(p.frame=frameOfFile(v.frame),p.sources.frame={from:"slide",path:`${y}.frame`}),v.text&&p.text&&(p.text.style=withFileStyle(p.text.style,v.text),p.fileText={...v.text},p.sources.text={from:"slide",path:`${y}.text`}),v.line!==void 0&&(p.line=lineOfFile(v.line),p.sources.line={from:"slide",path:`${y}.line`}),v.line_width!==void 0&&(p.line_width=Pt(v.line_width)),v.line_dash!==void 0&&(p.line_dash=v.line_dash),v.line_begin!==void 0&&(p.line_begin=v.line_begin),v.line_end!==void 0&&(p.line_end=v.line_end),v.fill!==void 0&&(p.fill=colorOfFile(v.fill),p.sources.fill={from:"slide",path:`${y}.fill`}),(v.picture!==void 0||v.movie!==void 0)&&(p.placeholder?.type==="pic"||p.placeholder?.type==="media"||p.placeholder?.type==="obj")){const A=cropOf(v.crop);p.kind=v.picture!==void 0?"picture":"movie",p.media={path:joinPath(i,v.picture??v.movie??""),...A?{crop:A}:{},...v.poster===void 0?{}:{poster:v.poster}},delete p.text}},g=(p,v,y,A,b)=>{const x=s.get(v);if(!x){o.push({slide:p,path:`slides.${String(y)}.layout`,message:`Slide ${p} is on the layout "${v}", which slides.ts does not have (it has ${[...s.keys()].join(", ")||"none"}).`});return}const{layout:B,master:$}=x,k=[...(B.display_master_shapes===!1?[]:$.shapes).filter(I=>I.kind!=="placeholder").map(I=>l(I,"master",$)),...B.shapes.filter(I=>I.kind!=="placeholder").map(I=>l(I,"layout",$))],w=B.shapes.filter(I=>I.kind==="placeholder").map((I,M)=>({shape:d(I,$),order:M}));return{slide:{id:p,layout:B.name,master:$.name,hidden:A,background:B.background??$.background,shapes:k,animations:[],file:{index:y,...b===void 0?{}:{generate:b}}},placed:w,master:$}},E=(p,v,y,A,b,x,B,$,k)=>{const w=new Set(y.map(M=>M.shape.name));let I=y.length;for(const[M,_]of Object.entries(A??{})){const F=x(M);if(F===void 0)continue;const N=`${b}.shapes.${M}`,T=_.textbox!==void 0||_.geometry!==void 0||_.path!==void 0||_.table!==void 0||_.chart!==void 0||_.component!==void 0||(_.picture!==void 0||_.movie!==void 0)&&!w.has(F),P=y.find(Z=>Z.shape.name===F);if(P&&!T){h(P.shape,_,N),_.z!==void 0&&(P.z=_.z);continue}if(P){o.push({slide:p.id,shape:F,path:N,message:`Slide ${p.id} has a ${P.shape.kind} ${F} already: a shape of its own needs another name.`});continue}if(!T){o.push({slide:p.id,shape:F,path:N,message:`Slide ${p.id} has no shape ${F} to change (its layout's placeholders and its own shapes are ${[...w].join(", ")||"none"}).`});continue}const V=m(F,_,N,p.id,v);V&&(y.push({shape:V,order:I++,..._.z===void 0?{}:{z:_.z}}),w.add(F))}y.sort((M,_)=>(M.z??0)-(_.z??0)||M.order-_.order);for(const M of y){const _=M.shape.text;if(M.shape.kind==="placeholder"&&_){const F=B(M.shape);_.paragraphs=paragraphsOfWords(F,0,a.fonts.code),_.empty=_.paragraphs.length===0||_.paragraphs.every(N=>N.runs.every(T=>T.text===""))}}p.shapes.push(...y.map(M=>M.shape)),$!==void 0&&$.trim()!==""&&(p.notes=$);for(const[M,_]of(k??[]).entries()){const F=x(_.shape);if(F===void 0)continue;const N={slide:p.id,shape:F,path:`${b}.animations.${String(M)}`},T=p.shapes.find(V=>V.name===F&&V.level==="slide");if(!T){o.push({...N,message:`Slide ${p.id} has no shape ${F} to animate (it has ${p.shapes.filter(V=>V.level==="slide").map(V=>V.name).join(", ")}).`});continue}if(_.paragraph!==void 0&&_.paragraph>=(T.text?.paragraphs.length??0)){o.push({...N,message:`Shape ${F} has no paragraph ${String(_.paragraph)} to animate (it has ${String(T.text?.paragraphs.length??0)}).`});continue}const P=resolveAnimation({..._,shape:F});P?p.animations.push(P):o.push({...N,message:`The animation of ${F} needs a path that starts with M and says only M, L and C, absolute.`})}},D=new Set;return n.slides.forEach((p,v)=>{const y=`slides.${String(v)}`;if(p.layout!==void 0){const $=g(p.id,p.layout,v,p.hidden===!0);if(!$)return;const k=r(`${u}.${p.id}.notes`);p.transition&&($.slide.transition=resolveTransition(p.transition)),E($.slide,$.master,$.placed,p.shapes,y,w=>w,w=>r(`${u}.${p.id}.${w.name}`),typeof k=="string"?k:void 0,p.animations),c.push($.slide),D.add(p.id);return}const A=p.generate??"",b=t.generators[A];if(!b){o.push({slide:p.id,path:`${y}.generate`,message:`There is no generator ${A} in slides.ts (it has ${Object.keys(t.generators).join(", ")||"none"}).`});return}let x;try{x=b.make({data:e.data??(()=>{throw new Error("No data here.")})})}catch($){o.push({slide:p.id,path:`${y}.generate`,message:`Generator ${A} failed: ${$ instanceof Error?$.message:String($)}`});return}const B=new Set(Array.isArray(p.hidden)?p.hidden:[]);for(const $ of x){const k=`${p.id}/${$.id}`,w=g(k,$.layout,v,B.has($.id),A);if(!w)continue;for(const _ of $.shapes){const F=_.placeholder?w.placed.find(N=>N.shape.placeholder?.idx===_.placeholder?.idx):void 0;if(F)_.frame&&(F.shape.frame={..._.frame}),F.shape.sources.frame={from:"code"};else{const N=l(_,"layout",w.master);w.placed.push({shape:{...N,level:"slide",sources:{frame:{from:"code"}}},order:w.placed.length})}}const I=`${$.id}/`,M=$.transition??($===x[0]?p.transition:void 0);M&&(w.slide.transition=resolveTransition(M)),E(w.slide,w.master,w.placed,p.shapes,y,_=>_.startsWith(I)?_.slice(I.length):void 0,_=>{const F=_.placeholder===void 0?void 0:$.text[_.placeholder.idx];return F===void 0?void 0:F.map(N=>N.runs.map(T=>T.text).join(""))},$.notes,[...($.animations??[]).map(_=>({..._,shape:`${I}${_.shape}`})),...p.animations??[]]);for(const _ of w.slide.shapes){const F=_.placeholder===void 0?void 0:$.text[_.placeholder.idx];F&&_.text&&(_.text.paragraphs=F,_.text.empty=!1)}c.push(w.slide),D.add(k)}for(const $ of Object.keys(p.shapes??{})){const[k]=$.split("/");k!==void 0&&!x.some(w=>w.id===k)&&o.push({slide:p.id,path:`${y}.shapes.${$}`,message:`Generator ${A} makes no slide ${k}: ${$} changes nothing.`})}}),{deck:{width:t.slide_width,height:t.slide_height,theme:a,slides:c},problems:o}}var axisOf=e=>e&&{...e.min===void 0?{}:{minimum_scale:e.min},...e.max===void 0?{}:{maximum_scale:e.max},...e.major===void 0?{}:{major_unit:e.major},...e.gridlines===void 0?{}:{has_major_gridlines:e.gridlines},...e.visible===void 0?{}:{visible:e.visible},...e.format===void 0?{}:{number_format:e.format},...e.reverse===void 0?{}:{reverse_order:e.reverse},...e.gridline_color===void 0?{}:{gridline_color:colorOfFile(e.gridline_color)},...e.line_color===void 0?{}:{line_color:colorOfFile(e.line_color)}},labelsOf=e=>{if(!(e===void 0||e===!1))return e===!0?{show_value:!0}:{...e.value===void 0?{}:{show_value:e.value},...e.percentage===void 0?{}:{show_percentage:e.percentage},...e.category===void 0?{}:{show_category_name:e.category},...e.series===void 0?{}:{show_series_name:e.series},...e.format===void 0?{}:{number_format:e.format},...e.position===void 0?{}:{position:e.position},...e.size===void 0?{}:{size:e.size},...e.color===void 0?{}:{color:colorOfFile(e.color)}}};function numberOf(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e==null)return null;if(typeof e!="string")return;const t=e.trim();if(t==="")return null;const n=Number(t);return Number.isFinite(n)?n:void 0}function chartOfFile(e,t){const n=labelsOf(e.labels);let r,u;const i=c=>({...c.color===void 0?{}:{color:colorOfFile(c.color)},...c.format===void 0?{}:{number_format:c.format},...c.smooth===void 0?{}:{smooth:c.smooth},...c.line_width===void 0?{}:{line_width:c.line_width},...c.marker_size===void 0?{}:{marker_size:c.marker_size}});if(e.data!==void 0){let c;try{c=t.rows(e.data)}catch(g){t.problem(`${e.data} cannot be read: ${g instanceof Error?g.message:String(g)}`);return}if(!Array.isArray(c)||c.length===0){t.problem(`${e.data} holds no rows.`);return}const l=c,d=e.categories;if(typeof d!="string"){t.problem("with data, categories names its column.");return}const f=Object.keys(l[0]??{}),h=[d,...e.series.map(g=>typeof g=="string"?g:g.name)].filter(g=>!f.includes(g));if(h.length>0){t.problem(`${e.data} has no column ${h.join(", ")} (it has ${f.join(", ")}).`);return}r=l.map(g=>{const E=g[d];return typeof E=="string"||typeof E=="number"?String(E):""}),u=e.series.map(g=>{const E=typeof g=="string"?g:g.name,D=l.map((p,v)=>{const y=numberOf(p[E]);return y===void 0?(t.problem(`${String(e.data)} row ${String(v+1)}: ${JSON.stringify(p[E])} in ${E} is not a number.`),null):y});return{name:E,values:D,...typeof g=="string"?{}:i(g)}})}else{if(typeof e.categories=="string"){t.problem("categories names a column, and there is no data to read.");return}r=e.categories;const c=[];for(const l of e.series){if(typeof l=="string"||!l.values){const d=typeof l=="string"?l:l.name;t.problem(`series ${d} has no values, and there is no data to read.`);return}l.values.length!==r.length&&t.problem(`series ${l.name} has ${String(l.values.length)} values for ${String(r.length)} categories.`),c.push({name:l.name,values:l.values,...i(l)})}u=c}const o=n?.position;o!==void 0&&!labelPositionsOf(e.type).includes(o)&&t.problem(`a ${e.type} chart has no label position ${o}, which PowerPoint would repair (it has ${labelPositionsOf(e.type).join(", ")||"none"}).`);const a=axisOf(e.value_axis),s=axisOf(e.category_axis);return{type:e.type,categories:r,series:u,...t.title===void 0?{}:{title:t.title},...e.legend===void 0?{}:{legend:e.legend},...n?{labels:n}:{},...e.gap_width===void 0?{}:{gap_width:e.gap_width},...e.overlap===void 0?{}:{overlap:e.overlap},...e.vary_by_categories===void 0?{}:{vary_by_categories:e.vary_by_categories},...e.hole_size===void 0?{}:{hole_size:e.hole_size},...a?{value_axis:a}:{},...s?{category_axis:s}:{},...e.size===void 0?{}:{font_size:e.size},...e.title_size===void 0?{}:{title_size:e.title_size},...e.color===void 0?{}:{font_color:colorOfFile(e.color)},...e.data===void 0?{}:{source:joinPath(t.base,e.data)}}}var SHAPE_ATTR="data-ak-shape",LINE_WIDTH=Pt(.75),SINGLE_SPACING=1.2,MIN_FONT_SCALE=.25;function themeCss(e){const t={};for(const[n,r]of Object.entries(e.colors))t[`--ak-theme-${n}`]=r;return t["--ak-theme-major"]=family(e.fonts.major),t["--ak-theme-minor"]=family(e.fonts.minor),t["--ak-theme-major-ea"]=family(e.fonts.major_east_asian),t["--ak-theme-minor-ea"]=family(e.fonts.minor_east_asian),t}var family=e=>e.includes(",")||e.includes('"')?e:`"${e}", "Noto Sans SC", sans-serif`,colorCss=e=>e==null?"transparent":typeof e=="string"?`var(--ak-theme-${e})`:e.rgb,fontCss=e=>e===void 0?void 0:e==="+mj-lt"?"var(--ak-theme-major)":e==="+mn-lt"?"var(--ak-theme-minor)":family(e),ALIGN={l:"left",ctr:"center",r:"right",just:"justify"},ANCHOR={t:"flex-start",ctr:"center",b:"flex-end"},EAST_ASIAN=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\u2E80-\u2FDF\u3000-\u303F\uFF00-\uFFEF]/u,AMBIGUOUS=/[\u2018\u2019\u201C\u201D\u2026\u2014\u2013\u2025\u00B7]/u;function eastAsianRuns(e,t){const n=[];for(const r of e){const u=EAST_ASIAN.test(r)||t&&AMBIGUOUS.test(r),i=n.at(-1);i?.ea===u?i.text+=r:n.push({text:r,ea:u})}return n}function styleRun(e,t,n,r){if(!t)return;const u=fontCss(t.name);u&&(e.style.fontFamily=u),t.size!==void 0&&(e.style.fontSize=`${String(t.size*n*r)}px`),t.bold!==void 0&&(e.style.fontWeight=t.bold?"700":"400"),t.italic!==void 0&&(e.style.fontStyle=t.italic?"italic":"normal"),t.underline!==void 0&&(e.style.textDecoration=t.underline?"underline":"none"),t.spacing!==void 0&&(e.style.letterSpacing=`${String(t.spacing*n*r)}px`),t.rgb!==void 0?e.style.color=t.rgb:t.color!==void 0&&(e.style.color=colorCss(t.color))}function bulletStyle(){if(document.getElementById("ak-bullet-style"))return;const e=document.createElement("style");e.id="ak-bullet-style",e.textContent="[data-ak-bullet]::before{content:attr(data-ak-bullet)}",document.head.append(e)}function paragraphStyle(e,t){const n=t[e.level]??t[0];if(!n)throw new Error("A text style has nine levels.");return{...n,...e.alignment===void 0?{}:{alignment:e.alignment},...e.line_spacing===void 0?{}:{line_spacing:e.line_spacing},...e.space_before===void 0?{}:{space_before:e.space_before},...e.space_after===void 0?{}:{space_after:e.space_after},...e.margin_left===void 0?{}:{margin_left:e.margin_left},...e.indent===void 0?{}:{indent:e.indent},font:{...n.font,...e.font}}}function setText(e,t,n,r,u=!1){e.replaceChildren(),t.paragraphs.forEach((i,o)=>{const a=paragraphStyle(i,t.style.levels),s=document.createElement("div");s.dataset.akParagraph=String(o),s.dataset.akLevel=String(i.level);const c=a.font.size*n*r,l="lines"in a.line_spacing?String(a.line_spacing.lines*SINGLE_SPACING):`${String(a.line_spacing.fixed*n*r)}px`,f=i.runs.some(m=>m.text!==""&&m.text!=="\v")?a.bullet:void 0;if(Object.assign(s.style,{position:"relative",textAlign:ALIGN[a.alignment],paddingLeft:`${String(a.margin_left*n)}px`,textIndent:f?"0px":`${String(a.indent*n)}px`,marginTop:o===0?"0px":`${String(a.space_before*n*r)}px`,marginBottom:`${String(a.space_after*n*r)}px`,lineHeight:l,fontSize:`${String(c)}px`,minHeight:"lines"in a.line_spacing?`${String(c*a.line_spacing.lines*SINGLE_SPACING)}px`:l}),styleRun(s,a.font,n,r),f){bulletStyle();const m=document.createElement("span");m.dataset.akBullet=f.char,Object.assign(m.style,{position:"absolute",left:`${String((a.margin_left+a.indent)*n)}px`,...f.font===void 0?{}:{fontFamily:fontCss(f.font)}}),s.append(m)}for(const m of i.runs){const h=document.createElement("span");styleRun(h,m.font,n,r);const g=m.font?.color??m.font?.rgb;g!==void 0&&(h.dataset.akColor=g),m.code?h.dataset.akCode="":m.font?.name!==void 0&&(h.dataset.akFont=m.font.name);const D=`var(--ak-theme-${(m.font?.name??a.font.name)==="+mj-lt"?"major":"minor"}-ea)`;for(const p of eastAsianRuns(m.text.replaceAll("\v",`
75
- `),u)){if(!p.ea){h.append(p.text);continue}const v=document.createElement("span");v.style.fontFamily=D,v.textContent=p.text,h.append(v)}s.append(h)}e.append(s)})}var isCjk=e=>e!==void 0&&/^(zh|ja|ko)(-|$)/iu.test(e);function textFrame(e,t,n){const{style:r}=e,u=r.auto_size==="shape",i=document.createElement("div");i.dataset.akText="",i.dataset.akAutofit=r.auto_size,Object.assign(i.style,{position:u?"relative":"absolute",inset:u?"auto":"0px",minHeight:"100%",display:"flex",flexDirection:"column",justifyContent:ANCHOR[r.vertical_anchor],padding:`${String(r.margins.top*t)}px ${String(r.margins.right*t)}px ${String(r.margins.bottom*t)}px ${String(r.margins.left*t)}px`,whiteSpace:r.word_wrap?"pre-wrap":"pre",overflowWrap:"break-word",boxSizing:"border-box"});const o=document.createElement("div");return o.dataset.akBody="",i.append(o),setText(o,e,t,1,n),i.akText=e,n&&(i.dataset.akCjk=""),i}function fitText(e,t){const n=e.akText,r=e.querySelector("[data-ak-body]");if(!n||!r||e.dataset.akAutofit!=="text")return 1;const u=e.clientHeight-parseFloat(getComputedStyle(e).paddingTop)-parseFloat(getComputedStyle(e).paddingBottom),i=s=>(setText(r,n,t,s,e.dataset.akCjk!==void 0),r.scrollHeight<=u+.5);if(i(1))return 1;let o=MIN_FONT_SCALE,a=1;if(!i(o))return o;for(;a-o>.01;){const s=(o+a)/2;i(s)?o=s:a=s}return i(o),e.dataset.akFontScale=o.toFixed(2),o}function drawLine(e,t,n,r){const u=t.frame.width*n,i=t.frame.height*n,o=t.flip?.h?u:0,a=t.flip?.v?i:0,s="http://www.w3.org/2000/svg",c=document.createElementNS(s,"svg");c.setAttribute("width",String(Math.max(u,1))),c.setAttribute("height",String(Math.max(i,1))),Object.assign(c.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"});const l=u-o,d=i-a,f=colorCss(t.line??"accent1"),m=A=>A===void 0||A==="none"||A==="arrow"?0:r*1.5,h=Math.hypot(l-o,d-a)||1,g=(l-o)/h,E=(d-a)/h,D=m(t.line_begin),p=m(t.line_end),v=document.createElementNS(s,"line");v.setAttribute("x1",String(o+g*D)),v.setAttribute("y1",String(a+E*D)),v.setAttribute("x2",String(l-g*p)),v.setAttribute("y2",String(d-E*p)),v.setAttribute("stroke",f),v.setAttribute("stroke-width",String(r));const y=dashOf(t.line_dash,r);y&&v.setAttribute("stroke-dasharray",y),c.append(v);for(const[A,b,x,B,$]of[[t.line_begin,o,a,-g,-E],[t.line_end,l,d,g,E]]){const k=lineHead(A,b,x,B,$,r,f);k&&c.append(k)}e.append(c)}var DASHES={sysDash:[3,1],sysDot:[1,1],dash:[4,3],dashDot:[4,3,1,3],lgDash:[8,3],lgDashDot:[8,3,1,3],lgDashDotDot:[8,3,1,3,1,3]},dashOf=(e,t)=>e&&DASHES[e]?.map(n=>String(n*t)).join(" ");function lineHead(e,t,n,r,u,i,o){if(e===void 0||e==="none")return;const a="http://www.w3.org/2000/svg",s=i*3,c=(m,h)=>`${String(t-r*m-u*h)},${String(n-u*m+r*h)}`;if(e==="oval"){const m=document.createElementNS(a,"circle");return m.setAttribute("cx",String(t)),m.setAttribute("cy",String(n)),m.setAttribute("r",String(s/2)),m.setAttribute("fill",o),m}const l=e==="arrow",d=document.createElementNS(a,l?"polyline":"polygon"),f={triangle:[c(0,0),c(s,s/2),c(s,-s/2)],stealth:[c(0,0),c(s,s/2),c(s*.7,0),c(s,-s/2)],diamond:[c(-s/2,0),c(0,s/2),c(s/2,0),c(0,-s/2)],arrow:[c(s,s/2),c(0,0),c(s,-s/2)]}[e];return d.setAttribute("points",f.join(" ")),l?(d.setAttribute("fill","none"),d.setAttribute("stroke",o),d.setAttribute("stroke-width",String(i))):d.setAttribute("fill",o),d}function drawPath(e,t,n,r){const u=t.path;if(!u)return;const i=t.frame.width*n,o=t.frame.height*n,a=u.w===0?0:i/u.w,s=u.h===0?0:o/u.h,c=u.steps.map(m=>m.op==="close"?"Z":m.op==="move"?`M${String(m.x*a)} ${String(m.y*s)}`:m.op==="line"?`L${String(m.x*a)} ${String(m.y*s)}`:`C${String(m.x1*a)} ${String(m.y1*s)} ${String(m.x2*a)} ${String(m.y2*s)} ${String(m.x*a)} ${String(m.y*s)}`).join(""),l="http://www.w3.org/2000/svg",d=document.createElementNS(l,"svg");d.setAttribute("width",String(Math.max(i,1))),d.setAttribute("height",String(Math.max(o,1))),Object.assign(d.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"});const f=document.createElementNS(l,"path");if(f.setAttribute("d",c),f.setAttribute("fill-rule","evenodd"),f.setAttribute("fill",colorCss(t.fill)),t.line!==void 0&&t.line!==null){f.setAttribute("stroke",colorCss(t.line)),f.setAttribute("stroke-width",String(r));const m=dashOf(t.line_dash,r);m&&f.setAttribute("stroke-dasharray",m)}d.append(f),e.append(d)}function geometryCss(e,t,n){const r=t.geometry??"rect",u=t.frame.width*n,i=t.frame.height*n;r==="roundRect"?e.style.borderRadius=`${String(Math.min(u,i)*Math.min(.5,Math.max(0,t.adjustments?.[0]??ADJUSTMENT_DEFAULTS.roundRect?.[0]??0)))}px`:r==="ellipse"?e.style.borderRadius="50%":r==="triangle"?e.style.clipPath="polygon(50% 0, 100% 100%, 0 100%)":r==="rightArrow"&&(e.style.clipPath="polygon(0 25%, 60% 25%, 60% 0, 100% 50%, 60% 100%, 60% 75%, 0 75%)")}var BORDERS={left:"borderLeft",right:"borderRight",top:"borderTop",bottom:"borderBottom"},SVG="http://www.w3.org/2000/svg";function drawChart(e,t,n,r){const u=n.width/EMU_PER_PT,i=n.height/EMU_PER_PT,o=r*EMU_PER_PT,a=chartDrawing(t,u,i),s=document.createElementNS(SVG,"svg");s.setAttribute("viewBox",`0 0 ${String(u)} ${String(i)}`),s.setAttribute("width","100%"),s.setAttribute("height","100%"),Object.assign(s.style,{position:"absolute",inset:"0px",overflow:"visible"});const c=(d,f)=>{const m=document.createElementNS(SVG,d);for(const[h,g]of Object.entries(f))m.setAttribute(h,String(g));s.append(m)},l=d=>{c("path",{d:d.d,fill:d.fill===void 0?"none":colorCss(d.fill),stroke:d.width>0?colorCss(d.color):"none","stroke-width":d.width,"stroke-linejoin":"round"})};for(const d of[...a.grid,...a.shapes])l(d);for(const d of[...a.boxes,...a.keys])c("rect",{x:d.x,y:d.y,width:d.width,height:d.height,fill:colorCss(d.color)});for(const d of[...a.axes,...a.lines])l(d);for(const d of a.dots)c("circle",{cx:d.x,cy:d.y,r:d.r,fill:colorCss(d.color)});e.append(s);for(const d of a.words){const f=document.createElement("div");f.textContent=d.text,Object.assign(f.style,{position:"absolute",left:`${String(d.x*o)}px`,top:`${String(d.y*o)}px`,transform:`translate(${{start:"0",middle:"-50%",end:"-100%"}[d.anchor]}, -50%)`,fontSize:`${String(d.size*o)}px`,lineHeight:"1",whiteSpace:"nowrap",color:colorCss(d.color),fontFamily:"var(--ak-theme-minor)"}),e.append(f)}}function drawTable(e,t,n,r){const u=document.createElement("table");Object.assign(u.style,{borderCollapse:"collapse",tableLayout:"fixed",width:`${String(t.columns.reduce((o,a)=>o+a,0)*n)}px`});const i=document.createElement("colgroup");for(const o of t.columns){const a=document.createElement("col");a.style.width=`${String(o*n)}px`,i.append(a)}u.append(i);for(const[o,a]of t.rows.entries()){const s=document.createElement("tr");s.style.height=`${String(a.height*n)}px`;for(const[c,l]of a.cells.entries()){if(l.spanned)continue;const d=document.createElement("td");d.dataset.akCell=`${String(o)},${String(c)}`,l.span_width&&(d.colSpan=l.span_width),l.span_height&&(d.rowSpan=l.span_height),d.style.padding="0px",d.style.verticalAlign={t:"top",ctr:"middle",b:"bottom"}[l.text.style.vertical_anchor],l.fill!==void 0&&(d.style.background=colorCss(l.fill));for(const[m,h]of Object.entries(BORDERS)){const g=l.borders?.[m];g&&(d.style[h]=`${String(g.width*n)}px solid ${colorCss(g.color)}`)}const f=textFrame(l.text,n,r);f.style.minHeight="0px",d.append(f),s.append(d)}u.append(s)}e.style.height="auto",e.append(u)}function drawShape(e,t,n){const{k:r}=n;if(t.kind==="placeholder"&&t.text?.empty===!0&&!n.editing)return;const u=document.createElement("div");u.setAttribute(SHAPE_ATTR,`${e}/${t.name}`);const{left:i,top:o,width:a,height:s}=t.frame;Object.assign(u.style,{position:"absolute",left:`${String(i*r)}px`,top:`${String(o*r)}px`,width:`${String(a*r)}px`,height:`${String(s*r)}px`}),t.rotation!==void 0&&(u.style.transform=`rotate(${String(t.rotation)}deg)`);const c=(t.line_width??LINE_WIDTH)*r;if(t.chart)drawChart(u,t.chart,t.frame,r);else if(t.table)return drawTable(u,t.table,r,isCjk(n.lang)),u;if(t.kind==="autoshape"){if(t.geometry==="line")return drawLine(u,t,r,c),u;if(t.path)return drawPath(u,t,r,c),t.text&&u.append(textFrame(t.text,r,isCjk(n.lang))),u;u.style.background=colorCss(t.fill),geometryCss(u,t,r)}else t.fill!==void 0&&(u.style.background=colorCss(t.fill));if(t.line!==void 0&&t.line!==null&&(u.style.outline=`${String(c)}px ${t.line_dash===void 0||t.line_dash==="solid"?"solid":"dashed"} ${colorCss(t.line)}`),t.text?.style.auto_size==="shape"&&(u.style.height="auto",u.style.minHeight="0px",t.text.style.word_wrap||(u.style.width="max-content")),t.kind==="picture"&&t.media){u.style.overflow="hidden";const l=document.createElement("img");l.alt="",l.src=n.url(t.media.path);const d=t.media.crop??{left:0,top:0,right:0,bottom:0},f=1-d.left-d.right,m=1-d.top-d.bottom;Object.assign(l.style,{position:"absolute",width:`${String(100/f)}%`,height:`${String(100/m)}%`,left:`${String(-d.left/f*100)}%`,top:`${String(-d.top/m*100)}%`,maxWidth:"none"}),u.append(l)}else if(t.kind==="movie"&&t.media&&!n.playing)u.dataset.akFilm="";else if(t.kind==="movie"&&t.media){const l=document.createElement("video");l.src=n.url(t.media.path),l.muted=!0,l.playsInline=!0,l.preload="auto",t.media.poster!==void 0&&(l.currentTime=t.media.poster),Object.assign(l.style,{width:"100%",height:"100%",objectFit:"fill"}),u.append(l)}return t.text&&u.append(textFrame(t.text,r,isCjk(n.lang))),u}function drawSlide(e,t){const n=document.createElement("div");n.dataset.akSlide=e.id,Object.assign(n.style,{position:"absolute",inset:"0px",background:colorCss(e.background),overflow:"hidden"});for(const r of e.shapes){const u=drawShape(e.id,r,t);u&&n.append(u)}return n}var BOLD2=600,LEVEL_STEP=342900,LAST_LEVEL=8,LEAST_ZOOM=.25,BLUR_WAIT_MS=120;function restyled(e,t,n){const r=e.commonAncestorContainer,u=[];if(r instanceof Text)u.push(r);else{const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT);for(;c.nextNode();)c.currentNode instanceof Text&&e.intersectsNode(c.currentNode)&&u.push(c.currentNode)}const i=[];for(const c of u){const l=c===e.startContainer?e.startOffset:0,d=c===e.endContainer?e.endOffset:c.length;if(l>=d)continue;const f=l>0?c.splitText(l):c;d-l<f.length&&f.splitText(d-l);const m=document.createElement("span");t(m),f.replaceWith(m),m.append(f),i.push(m)}const[o]=i,a=i.at(-1);if(!o||!a)return;const s=document.createRange();s.setStartBefore(o),s.setEndAfter(a),n.removeAllRanges(),n.addRange(s)}function insertText(e){document.execCommand("insertText",!1,e)}function wordAt(e,t){if(!(e instanceof Text))return;const n=new Intl.Segmenter(document.documentElement.lang||void 0,{granularity:"word"}).segment(e.data);for(const r of[t,t-1]){if(r<0||r>=e.length)continue;const u=n.containing(r);if(u?.isWordLike!==!0)continue;const i=document.createRange();return i.setStart(e,u.index),i.setEnd(e,u.index+u.segment.length),i}}function zoomToFit(e){const t=e.closest("[data-ak-autofit='text']");if(!t)return;const n=1/Number(t.dataset.akFontScale??"1"),r=getComputedStyle(t),u=t.clientHeight-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom),i=t.getBoundingClientRect().height/t.offsetHeight,o=c=>{e.style.setProperty("zoom",String(c));const l=e.firstElementChild?.getBoundingClientRect(),d=e.lastElementChild?.getBoundingClientRect();return!l||!d||d.bottom-l.top<=u*i+.5};if(o(n))return;let a=LEAST_ZOOM,s=n;for(;s-a>.01;){const c=(a+s)/2;o(c)?a=c:s=c}o(a)}var sameLook=(e,t)=>e.bold===t.bold&&e.italic===t.italic&&e.code===t.code&&e.color===t.color&&e.font===t.font;function runsOf2(e){const t=getComputedStyle(e),n=[],r=i=>{const o=n.at(-1);o&&(sameLook(o,i)||i.text.trim()==="")?o.text+=i.text:n.push(i)},u=i=>{if(i instanceof HTMLBRElement){r({...PLAIN2,text:"\v"});return}if(i.nodeType!==Node.TEXT_NODE){i.childNodes.forEach(u);return}const o=i.parentElement;if(!o)return;const a=getComputedStyle(o);r({text:i.textContent??"",bold:Number(a.fontWeight)>=BOLD2&&Number(t.fontWeight)<BOLD2,italic:a.fontStyle==="italic"&&t.fontStyle!=="italic",code:o.closest("[data-ak-code]")!==null,color:o.closest("[data-ak-color]")?.dataset.akColor,font:o.closest("[data-ak-font]")?.dataset.akFont})};return e.childNodes.forEach(u),n}var PLAIN2={bold:!1,italic:!1,code:!1,color:void 0,font:void 0};function runText(e){const[,t="",n="",r=""]=/^(\s*)(.*?)(\s*)$/su.exec(e.text)??[];if(n===""||e.text==="\v")return e.text;let u=e.code?`\`${n}\``:n;const i=[...e.color===void 0?[]:[`color="${e.color}"`],...e.font===void 0?[]:[`font="${e.font}"`]];return i.length>0&&(u=`<span ${i.join(" ")}>${u}</span>`),e.italic&&(u=`*${u}*`),e.bold&&(u=`**${u}**`),`${t}${u}${r}`}function paragraphsOf(e){const t=[...e.children].filter(n=>n instanceof HTMLElement);return t.length===0?[{text:e.innerText.trim(),level:0}]:t.map(n=>({text:runsOf2(n).map(runText).join("").replace(/\v$/u,""),level:Number(n.dataset.akLevel??"0")||0}))}function deckEditor(e,t){const n=i=>e.querySelector(`[${SHAPE_ATTR}="${CSS.escape(i)}"]`);let r;const u=(i,o)=>{if(i.type==="deck-frame"){const S=n(i.shape);if(!S)return;if(S.dataset.akFileFrame??=JSON.stringify([S.style.left,S.style.top,S.style.width,S.style.height]),i.frame===null){const[R,G,X,te]=JSON.parse(S.dataset.akFileFrame);Object.assign(S.style,{left:R,top:G,width:X,height:te});return}const H=i.frame;Object.assign(S.style,{left:`${String(H.left*t)}px`,top:`${String(H.top*t)}px`,width:`${String(H.width*t)}px`,height:`${String(H.height*t)}px`});return}if(i.type==="deck-stop"){r?.stop();return}if(i.type==="deck-hold"){r?.hold();return}if(i.type==="deck-format"){r?.format(i);return}const a=n(i.shape),s=e.getBoundingClientRect(),c=i.at&&[s.left+i.at.x*s.width,s.top+i.at.y*s.height],l=a?[...a.querySelectorAll("[data-ak-cell]")]:[],d=c&&document.elementFromPoint(c[0],c[1]),f=l.find(S=>S.dataset.akCell===i.cell?.join(","))??(d?l.find(S=>S.contains(d)):void 0)??l[0],m=(f??a)?.querySelector("[data-ak-body]");if(!a||!m)return;r?.stop();const h=i.shape,g=f?.dataset.akCell?.split(",").map(Number),E=g?{cell:g}:{};if(m.children.length===0){const S=document.createElement("div");S.dataset.akParagraph="0",S.dataset.akLevel="0",S.append(document.createElement("br")),m.append(S)}m.contentEditable="true",m.spellcheck=!1,m.style.outline="none",m.style.cursor="text";const D=()=>paragraphsOf(m),p=S=>{S instanceof InputEvent&&S.isComposing||(zoomToFit(m),o({type:"deck-text",shape:h,paragraphs:D(),...E}))},v=S=>{S.preventDefault();const H=S.clipboardData?.getData("text/plain")??"";insertText(H)},y=S=>{const H=getSelection()?.anchorNode,R=(H instanceof Element?H:H?.parentElement)?.closest("[data-ak-level]");if(!R)return;const G=Number(R.dataset.akLevel??"0")+S;if(G<0||G>LAST_LEVEL)return;R.dataset.akLevel=String(G);const X=parseFloat(R.style.marginLeft)||0;R.style.marginLeft=`${String(X+S*LEVEL_STEP*t)}px`,o({type:"deck-text",shape:h,paragraphs:D(),...E})},A=S=>{const H=S?.dataset.akCell?.split(",").map(Number);!H||S===f||(k(!1),u({type:"deck-edit",shape:h,cell:[H[0]??0,H[1]??0]},o))},b=S=>{S.stopPropagation(),S.key==="Escape"&&w(),S.key==="Tab"&&(S.preventDefault(),f?A(l[l.indexOf(f)+(S.shiftKey?-1:1)]):y(S.shiftKey?-1:1)),(S.metaKey||S.ctrlKey)&&S.key==="u"&&S.preventDefault()};let x;const B=S=>{x=l.find(H=>H!==f&&S.target instanceof Node&&H.contains(S.target)),x&&S.preventDefault()},$=S=>{S.stopPropagation(),A(x)},k=S=>{m.removeEventListener("input",p),m.removeEventListener("compositionend",p),m.removeEventListener("paste",v),m.removeEventListener("keydown",b),m.removeEventListener("blur",N),m.removeEventListener("focus",T),document.removeEventListener("selectionchange",F),clearTimeout(_),a.removeEventListener("mousedown",B),document.removeEventListener("click",$,!0),m.contentEditable="false",r=void 0,o({type:S?"deck-text-done":"deck-text",shape:h,paragraphs:D(),...E})},w=()=>{k(!0)};let I,M=!1,_;const F=()=>{const S=getSelection();if(!S||S.rangeCount===0)return;const H=S.getRangeAt(0);if(!m.contains(H.commonAncestorContainer))return;I=H.cloneRange();const R=H.startContainer instanceof Element?H.startContainer:H.startContainer.parentElement;o({type:"deck-selection",shape:h,words:!H.collapsed,bold:R?Number(getComputedStyle(R).fontWeight)>=BOLD2:!1,italic:R?getComputedStyle(R).fontStyle==="italic":!1})},N=()=>{_=setTimeout(()=>{M||w()},BLUR_WAIT_MS)},T=()=>{M=!1,clearTimeout(_)},P=S=>{const H=getSelection();if(!H||!I)return;window.focus(),m.focus();const R=I.collapsed?wordAt(I.startContainer,I.startOffset):I;R&&(I=R,H.removeAllRanges(),H.addRange(I),restyled(I,G=>{S.bold!==void 0&&(G.style.fontWeight=S.bold?"700":"400"),S.italic!==void 0&&(G.style.fontStyle=S.italic?"italic":"normal"),S.color!==void 0&&(G.dataset.akColor=S.color,G.style.color=S.color.startsWith("#")?S.color:`var(--ak-theme-${S.color})`)},H),zoomToFit(m),o({type:"deck-text",shape:h,paragraphs:D(),...E}),F())};m.addEventListener("input",p),m.addEventListener("compositionend",p),m.addEventListener("paste",v),m.addEventListener("keydown",b),m.addEventListener("blur",N),m.addEventListener("focus",T),document.addEventListener("selectionchange",F),f&&a.addEventListener("mousedown",B),document.addEventListener("click",$,!0),window.focus(),r={body:m,stop:w,format:P,hold:()=>{M=!0}},m.focus();const V=c?document.caretPositionFromPoint(c[0],c[1]):null,Z=getSelection();if(Z){if(Z.removeAllRanges(),V&&m.contains(V.offsetNode)){const S=document.createRange();S.setStart(V.offsetNode,V.offset),S.collapse(!0),Z.addRange(S);const H=i.word===!0?wordAt(V.offsetNode,V.offset):void 0;H&&(Z.removeAllRanges(),Z.addRange(H))}else{const S=document.createRange();S.selectNodeContents(m),S.collapse(!1),Z.addRange(S)}i.text!==void 0&&insertText(i.text)}};return u}var context,ctx=()=>context??=document.createElement("canvas").getContext("2d");function wordsOf(e,t){const n=ctx();if(!n)return[];const r=getComputedStyle(e);n.font=`${r.fontStyle} ${r.fontWeight} ${r.fontSize} ${r.fontFamily}`;const u=[],i=document.createRange();for(const o of e.childNodes){if(o.nodeType!==Node.TEXT_NODE)continue;const a=o.textContent??"";for(const s of a.matchAll(/\S+/gu)){i.setStart(o,s.index),i.setEnd(o,s.index+s[0].length);const c=n.measureText(s[0]);for(const l of i.getClientRects()){if(l.width===0)continue;const d=l.top+c.fontBoundingBoxAscent*t;u.push({left:l.left,right:l.right,top:d-c.actualBoundingBoxAscent*t,bottom:d+c.actualBoundingBoxDescent*t,baseline:d})}}}return u}function inkLines(e,t,n){const r=t.getBoundingClientRect(),u=r.width>0?r.width/n:1,i=e.flatMap(s=>wordsOf(s,u)).sort((s,c)=>s.baseline-c.baseline||s.left-c.left),o=[];for(const s of i){const c=o.at(-1);c&&Math.abs(s.baseline-c.baseline)<=(s.bottom-s.top)/4?(c.left=Math.min(c.left,s.left),c.right=Math.max(c.right,s.right),c.top=Math.min(c.top,s.top),c.bottom=Math.max(c.bottom,s.bottom)):o.push({...s})}const a=(s,c)=>(s-c)/u;return o.map(s=>[a(s.left,r.left),a(s.top,r.top),(s.right-s.left)/u,(s.bottom-s.top)/u])}function union2(e){if(e.length===0)return null;const t=Math.floor(Math.min(...e.map(i=>i[0]))),n=Math.floor(Math.min(...e.map(i=>i[1]))),r=Math.ceil(Math.max(...e.map(i=>i[0]+i[2]))),u=Math.ceil(Math.max(...e.map(i=>i[1]+i[3])));return[t,n,r-t,u-n]}var SLIDE_LAYER="slide",PLAYING_GAP=.5,VIDEO_DRIFT=.3,NO_SAFE2={top:0,bottom:0,left:0,right:0};async function playOut(e){e.muted=!1,await e.play().catch(async()=>{e.muted=!0,await e.play().catch(()=>{})})}function wordsReader(e){const t=n=>{if(e.peek(n)!==void 0)return e.s(n);const r=[...new Set(e.keysUnder(n).map(u=>u.slice(n.length+1).split(".")[0]).filter(u=>u!==void 0&&/^\d+$/u.test(u)))].sort((u,i)=>Number(u)-Number(i));if(r.length!==0)return r.map(u=>t(`${n}.${u}`)).filter(u=>u!==void 0)};return t}async function loadDeck(e,t,n){const r=createEnv(e,t),{log:u,ledger:i,guards:o}=r,[a,s]=e.format.split("x").map(Number);if(!(a>0&&s>0))throw new LoadFailure("bad_format",`${e.piece} is drawn at ${e.format}: a deck's stage is WIDTHxHEIGHT pixels.`);for(const j of e.styles??[]){const U=document.createElement("link");U.rel="stylesheet",U.href=j;const O=new Promise(L=>{U.onload=L,U.onerror=L});document.head.append(U),await O}let c;try{c=await consoleAtAsync({phase:"module"},()=>import(e.module))}catch(j){const U=j instanceof Error?j:new Error(String(j));throw new LoadFailure("load_failed",`Failed to load the deck's module: ${U.message}
76
- ${U.stack??""}`)}const l=c.default;if(!isDeck(l))throw new LoadFailure("no_content",`The default export of ${e.file} is not a presentation({ … }) from @allyhub/sdk/slides.`);let d;try{d=consoleAt({phase:"build"},()=>evaluateDeck(l))}catch(j){throw new LoadFailure("load_failed",`The deck's code failed: ${j instanceof Error?j.message:String(j)}`)}const f=messagePrefix(e.piece),m=e.looks?.clean??CLEAN_LOOK,h=e.file.split("/").slice(0,-1).join("/"),g={file:`${h===""?"":`${h}/`}${SLIDES_FILE}`},{deck:E,problems:D}=resolveDeck({def:d,file:e.slides??{slides:[]},words:wordsReader(u),prefix:f,base:h,theme:themeOfLook(m),data:j=>u.readData(j)});for(const j of D)i.problems.push(problem("AK-M011",j.message,{...j.slide===void 0?{}:{part:j.slide},where:g}));if(E.slides.length===0)throw new LoadFailure("no_parts",`The deck has no slides: its ${SLIDES_FILE} lists none (AK-K003).`);const p=a/E.width;Object.assign(n.style,{position:"relative",width:`${String(a)}px`,height:`${String(s)}px`,overflow:"hidden"});for(const[j,U]of Object.entries({...lookCss(m),...themeCss(E.theme)}))n.style.setProperty(j,U);n.replaceChildren();const v=t.purpose==="play";t.purpose==="render"&&(document.documentElement.style.background="transparent",document.body.style.background="transparent");const y=j=>u.mediaAt(j)?.url??"",A=j=>Math.round(j*DECK_FPS)/DECK_FPS,b=[],x=[],B=[];let $=0;E.slides.forEach((j,U)=>{const O=clockOf(j,U===0),{rests:L,comesOn:K,goesOff:W}=O,ee=$,Q=ee+(L.at(-1)??0),Y=j.shapes.flatMap(oe=>oe.kind!=="movie"||!oe.media?[]:[{shape:oe.name,from:K(oe.name),poster:oe.media.poster??0,length:u.mediaAt(oe.media.path)?.duration??0,rest:L.at(-1)??0}]),ie=Math.max(Q+1/DECK_FPS,...Y.map(oe=>ee+oe.from+oe.length-oe.poster));$=ie;const ce=r.combo.lang,J=drawSlide(j,{k:p,url:y,editing:t.editing===!0,playing:v,...ce===void 0?{}:{lang:ce}});J.style.visibility="hidden",n.append(J);const ne=[],le=[[]];for(const oe of j.shapes){const fe=J.querySelector(`[${SHAPE_ATTR}="${CSS.escape(`${j.id}/${oe.name}`)}"]`);if(fe&&le.at(-1)?.push(fe),oe.component&&fe){const me=d.components[oe.component.name];if(!me)continue;const Ce=oe.frame.width*p,De=oe.frame.height*p;consoleAt({phase:"build",part:j.id},()=>me.layers(oe.component?.props??{},{width:Ce,height:De,slide:j.id})).forEach((Be,he)=>{if(typeof Be!="object"||Be===null||Be[LAYER_BRAND]!=="graphic"){i.problems.push(problem("AK-M011",`Component ${me.name} on slide ${j.id} drew something that is not a graphic layer (custom(), a component): a footage layer is a movie shape on a slide.`,{part:j.id,where:g}));return}const ge=Be,ye=document.createElement("div");Object.assign(ye.style,{position:"absolute",inset:"0px"}),fe.append(ye);const Ae=stageContext({look:m,width:Ce,height:De,start:ee,end:ie,combo:r.combo,format:e.format,asset:$e=>u.asset($e),wait:$e=>B.push($e),report:$e=>i.problems.push(problem($e.code,$e.message,{part:j.id,where:g}))});ne.push({layer:ge,el:ye,ctx:Ae,props:ge.props,from:K(oe.name)}),consoleAt({phase:"mount",part:j.id,layer:ge.component,index:he},()=>{ge.mount(ye,ge.props,Ae)})})}if(oe.kind==="movie"&&oe.media&&!v&&u.mediaAt(oe.media.path)){const me=[oe.frame.left*p,oe.frame.top*p,oe.frame.width*p,oe.frame.height*p],Ce=A(K(oe.name)),De=W(oe.name);x.push({part:j.id,file:oe.media.path,start:ee+Ce,end:De===void 0?ie:ee+A(De),from:(oe.media.poster??0)-((L.at(-1)??0)-Ce),speed:1,gainDb:0,audio:!1,fit:"cover",box:me,picture:me,over:le.length}),le.push([])}}for(;le.length>1&&le.at(-1)?.length===0;)le.pop();const pe=A(Q);b.push({slide:j,el:J,layers:ne,targets:animationTargets(O.timed),lead:O.lead,movies:Y,planes:le,part:{key:j.id,layers:[...new Set(ne.map(oe=>oe.layer.component))],start:ee,end:ie,planes:le.map(oe=>({layers:[{component:SLIDE_LAYER,start:ee,end:ie},...ne.filter(fe=>oe.some(me=>me.contains(fe.el))).map(fe=>({component:fe.layer.component,start:ee,end:ie}))]})),still:pe,...L.length>1?{steps:L.map(oe=>Math.round((ee+oe)*DECK_FPS)/DECK_FPS)}:{},...titled(j),...j.hidden?{hidden:!0}:{}}})});const k=$,w={fps:DECK_FPS,width:a,height:s,paper:`${String(E.width/EMU_PER_INCH)}in ${String(E.height/EMU_PER_INCH)}in`,duration:k,background:E.theme.colors.lt1,parts:b.map(j=>j.part),cues:[],...x.length>0?{footage:x}:{},audio:{}},I=pictureWaiter(n);let M;const _=new WeakMap,F=[],N=(j,U)=>{const O={...U};for(const L of Object.keys(U))O[L]=j.style[L];F.push(()=>{Object.assign(j.style,O)}),Object.assign(j.style,U)},T=(j,U)=>j.el.querySelector(`[${SHAPE_ATTR}="${CSS.escape(`${j.slide.id}/${U}`)}"]`);let P;const V=(j,U)=>T(j,U)?.querySelector("video")??void 0,Z=new Set,S=(j,U)=>{const O=P;if(O&&O.m!==j){for(const K of O.m.movies)V(O.m,K.shape)?.pause();Z.clear()}const L=O?.m===j&&U>O.t&&U-O.t<PLAYING_GAP;P={m:j,t:U};for(const K of j.movies){const W=V(j,K.shape);if(!W)continue;const ee=K.poster+Math.max(0,U-K.from);if(L&&U>=K.from&&ee<K.length){Math.abs(W.currentTime-ee)>VIDEO_DRIFT&&(W.currentTime=ee),W.paused&&playOut(W);continue}W.pause(),L&&ee>=K.length&&Z.add(K.shape);const Q=Z.has(K.shape)?K.length:Math.max(0,K.poster-(K.rest-U));Math.abs(W.currentTime-Q)>1/DECK_FPS&&(W.currentTime=Q)}},H=(j,U)=>{const O=j.slide.transition;if(!O||U>=j.lead)return;const L=b.indexOf(j),K=b.slice(0,L).reverse().find(Y=>!Y.slide.hidden);if(!K)return;R(K,K.part.still-K.part.start),K.el.style.visibility="visible";const W=Math.min(1,U/j.lead);if(O.type!=="morph"){const Y=transitionAt2(O,W),ie=(J,ne)=>`translate(${String(J*100)}%, ${String(ne*100)}%)`,ce=Y.incoming.clip;N(j.el,{opacity:String(Y.incoming.opacity),transform:ie(Y.incoming.x,Y.incoming.y),...ce?{clipPath:`inset(${String(ce.top*100)}% ${String(ce.right*100)}% ${String(ce.bottom*100)}% ${String(ce.left*100)}%)`}:{}}),N(K.el,{transform:ie(Y.outgoing.x,Y.outgoing.y)});return}const ee=new Map(K.slide.shapes.map(Y=>[Y.name,Y]));N(j.el,{background:`color-mix(in srgb, ${getComputedStyle(j.el).backgroundColor} ${String(W*100)}%, transparent)`});const Q=new Set;for(const Y of j.slide.shapes){const ie=T(j,Y.name);if(!ie)continue;const ce=ee.get(Y.name);if(!ce){N(ie,{opacity:String(W)});continue}Q.add(Y.name);const J=morphFrame(ce.frame,Y.frame,W),ne=Y.frame.width>0?J.width/Y.frame.width:1,le=Y.frame.height>0?J.height/Y.frame.height:1;N(ie,{transformOrigin:"0 0",transform:`translate(${String((J.left-Y.frame.left)*p)}px, ${String((J.top-Y.frame.top)*p)}px) scale(${String(ne)}, ${String(le)}) ${ie.style.transform}`})}for(const Y of K.slide.shapes){const ie=T(K,Y.name);ie&&(Q.has(Y.name)?N(ie,{visibility:"hidden"}):N(ie,{opacity:String(1-W)}))}},R=(j,U)=>{for(const O of j.targets){const L=j.slide.shapes.find(ce=>ce.name===O.shape),K=j.el.querySelector(`[${SHAPE_ATTR}="${CSS.escape(`${j.slide.id}/${O.shape}`)}"]`);if(!L||!K)continue;const W=O.paragraph===void 0?K:K.querySelector(`[data-ak-paragraph="${String(O.paragraph)}"]`);if(!W)continue;const ee=_.get(W)??{transform:W.style.transform,clipPath:W.style.clipPath};_.set(W,ee);const Q=drawnAt2(O.animations,U,L.frame,{width:E.width,height:E.height});W.style.visibility=Q.hidden?"hidden":"",W.style.opacity=Q.opacity===1?"":String(Q.opacity);const Y=Q.x!==0||Q.y!==0?`translate(${String(Q.x*p)}px, ${String(Q.y*p)}px)`:"",ie=Q.scale===1?"":`scale(${String(Q.scale)})`;W.style.transform=[Y,ie,ee.transform].filter(ce=>ce!=="").join(" "),W.style.clipPath=Q.clip?`inset(${String(Q.clip.top*100)}% ${String(Q.clip.right*100)}% ${String(Q.clip.bottom*100)}% ${String(Q.clip.left*100)}%)`:ee.clipPath}},G=(j,U)=>{if(U>0){const O=j.el.style.background;j.el.style.background="none",F.push(()=>{j.el.style.background=O})}for(const[O,L]of j.planes.entries())for(const K of O===U?[]:L){const W=K.style.visibility;K.style.visibility="hidden",F.push(()=>{K.style.visibility=W})}},X=async(j,U)=>{const O=Math.min(Math.max(0,j),k-1/DECK_FPS),L=b.find(W=>O<W.part.end-1e-6)??b[b.length-1];if(!L)return;for(const W of b)W.el.style.visibility=W===L?"visible":"hidden";M=L,o.setMoment(O,`${r.seedBase}:${L.slide.id}`);const K=O-L.part.start;for(;F.length>0;)F.pop()?.();R(L,K),H(L,K),S(L,K);for(const[W,ee]of L.layers.entries())consoleAt({phase:"render",part:L.slide.id,layer:ee.layer.component,index:W,t:O-L.part.start},()=>{ee.layer.render(ee.el,Math.max(0,K-ee.from),ee.props,ee.ctx)});U!==void 0&&G(L,U),await I(SEEK_LIMIT*1e3)},te=()=>M??b[0],ae=deckEditor(n,p),re=async j=>{await X(j);const U=te(),O=n.getBoundingClientRect(),L=O.width>0?a/O.width:1;return{m:U,blocks:U?textBlocks(U.el,n,a):[],scale:L}},Ee=()=>{const j=new Map,U=E.theme.fonts;for(const O of[U.major,U.minor,U.major_east_asian,U.minor_east_asian])j.set(fontFace(O),"theme");for(const O of E.slides)for(const L of O.shapes){const K=[...L.text?.style.levels.map(W=>W.font.name)??[],...L.text?.paragraphs.flatMap(W=>[W.font?.name,...W.runs.map(ee=>ee.font?.name)])??[]];for(const W of K)W!==void 0&&!W.startsWith("+")&&!j.has(fontFace(W))&&j.set(fontFace(W),"text")}return[...j].map(([O,L])=>({name:O,where:L}))},ve=j=>{const U=j.text?.paragraphs[0],O=U?.alignment??j.text?.style.levels[U?.level??0]?.alignment;return O===void 0?{}:{align:O}},ue=(j,U)=>{const O=n.getBoundingClientRect(),L=O.width>0?a/O.width:1,K=[],W=[],ee=[],Q=[],Y=[],ie=[],ce=p*EMU_PER_PT;return j.slide.shapes.forEach((J,ne)=>{const le=j.el.querySelector(`[${SHAPE_ATTR}="${CSS.escape(`${j.slide.id}/${J.name}`)}"]`);if(!le)return;const pe=le.getBoundingClientRect(),oe=[Math.round((pe.left-O.left)*L),Math.round((pe.top-O.top)*L),Math.round(pe.width*L),Math.round(pe.height*L)],fe=getComputedStyle(le).visibility==="hidden",me=textBlocks(le,n,a).filter(he=>he.ink!==null&&he.runs.some(ge=>getComputedStyle(ge.el).visibility!=="hidden")),Ce=me.map(he=>inkLines([...new Set(he.runs.map(ge=>ge.el))],n,a));me.forEach((he,ge)=>{const ye=Ce[ge]??[],Ae=union2(ye);Ae&&(K.push({layer:J.name,z:"front",text:he.text,box:Ae,...he.opacity<1?{opacity:he.opacity}:{}}),W.push(ne),ee.push(he.containers),Q.push(Ae),Y.push(ye))});const De={name:J.name,kind:J.geometry==="line"?"line":J.kind,level:J.level,...J.placeholder?{placeholder:J.placeholder.type}:{},frame:[Math.round(J.frame.left*p),Math.round(J.frame.top*p),Math.round(J.frame.width*p),Math.round(J.frame.height*p)],box:oe,...fe?{hidden:fe}:{},opaque:J.kind==="picture"||J.kind==="movie"||J.geometry!=="line"&&J.fill!==void 0&&J.fill!==null};if(J.chart){const he=J.chart.series.flatMap(ge=>ge.values.filter(ye=>ye!==null));De.chart={type:J.chart.type,categories:J.chart.categories.length,series:J.chart.series.length,...he.length>0?{low:Math.min(...he),high:Math.max(...he)}:{},...J.chart.source===void 0?{}:{source:J.chart.source}}}if(J.table){const he=[...le.querySelectorAll("tr")];De.rows=J.table.rows.map((ge,ye)=>({set:Math.round(ge.height*p),drawn:Math.round((he[ye]?.getBoundingClientRect().height??0)*L)}))}const _e=Ce.flat();if(_e.length>0){const he=new Map;for(const Ae of me)for(const $e of Ae.runs){const we=getComputedStyle($e.el),ke=Math.round(parseFloat(we.fontSize)/ce*10)/10,Fe=parseInt(we.fontWeight,10)||400,q=`${String(ke)}/${String(Fe)}`;he.has(q)||he.set(q,{size:ke,weight:Fe,...Ae.xHeight===void 0?{}:{xHeight:Math.round(Ae.xHeight/ce*10)/10}})}const ge=me.map(Ae=>Ae.text).join(`
77
- `),ye=le.querySelector("[data-ak-font-scale]")?.dataset.akFontScale;De.text={text:ge,words:countWords(ge).words,lines:_e,glyphs:union2(_e),type:[...he.values()],...ye===void 0?{}:{scale:Number(ye)},...ve(J)}}const Be=le.querySelector("img");if(Be&&Be.naturalWidth>0){const he=J.media?.crop??{left:0,top:0,right:0,bottom:0};De.picture={source:[Be.naturalWidth,Be.naturalHeight],shown:[Math.round(Be.naturalWidth*(1-he.left-he.right)),Math.round(Be.naturalHeight*(1-he.top-he.bottom))]}}ie.push(De)}),{moment:measureMoment({t:U,part:j.slide.id,texts:K,safe:NO_SAFE2,width:a,height:s,owner:W,containers:ee,seen:Q,glyphs:Y}),slide:{slide:j.slide.id,steps:j.part.steps?.length??1,t:U,layout:j.slide.layout,hidden:j.slide.hidden,...j.slide.notes===void 0?{}:{notes:j.slide.notes},shapes:ie}}},se={kind:"slides",get timeline(){return w},async ready(){await loadTextFonts(n);for(const j of b){j.el.style.visibility="visible";for(const U of j.el.querySelectorAll("[data-ak-autofit='text']"))fitText(U,p);j.el.style.visibility="hidden"}await Promise.all(B),await X(b[0]?.part.still??0)},seek:(j,U)=>X(j,U?.plane),edit:(j,U)=>{ae(j,U)},words:()=>[],lines:()=>[],captionOptions:()=>null,setPlaying:()=>{},text:()=>b.map(j=>({key:j.slide.id,...j.slide.notes===void 0?{}:{notes:j.slide.notes},onScreen:j.slide.shapes.flatMap(U=>U.text&&!U.text.empty?[U.text.paragraphs.map(O=>O.runs.map(L=>L.text).join("")).join(`
78
- `)]:[])})),reads:()=>u.reads(f,b.map(j=>j.slide.id)),problems:()=>[...u.problems,...i.problems,...u.translationProblems()],stuck:()=>{},seekLimit:SEEK_LIMIT,facts:()=>[],says:()=>[],signs:()=>Object.fromEntries(b.map(j=>[j.slide.id,JSON.stringify({slide:j.slide,theme:E.theme,width:a,height:s})])),mixPlan:()=>({duration:k,speech:[],footage:[],sfx:[]}),covers:()=>[],drawCover:()=>Promise.resolve(),async measure(j){const U=[],O=[];for(const L of j??b.flatMap(K=>K.part.steps??[K.part.still])){await X(L);const K=te();if(!K)continue;const W=ue(K,L);U.push(W.moment),O.push(W.slide)}return{width:a,height:s,deck:{pxPerPt:p*EMU_PER_PT,slides:O,fonts:Ee()},safe:NO_SAFE2,moments:U,footage:[]}},tracks:()=>Promise.resolve([]),deck:()=>{const j={};for(const O of b)for(const L of O.el.querySelectorAll("[data-ak-font-scale]")){const K=L.closest(`[${SHAPE_ATTR}]`)?.getAttribute(SHAPE_ATTR),W=Number(L.dataset.akFontScale);K&&W<1&&(j[K]=W)}const U=r.combo.lang;return{width:E.width,height:E.height,theme:E.theme,masters:d.masters,slides:E.slides,fitted:j,...U===void 0?{}:{lang:U}}},async inks(j){const{blocks:U,scale:O}=await re(j);return U.flatMap(L=>L.ink===null?[]:[{text:{layer:"slide",z:"front",text:L.text,box:L.box},...inkOfBlock(L,O)}])},async objects(j){const{m:U,blocks:O}=await re(j),L=n.getBoundingClientRect(),K=L.width>0?a/L.width:1;return{t:j,elements:U?[...U.el.querySelectorAll(`[${SHAPE_ATTR}]`)].map(W=>{const ee=W.getBoundingClientRect();return{id:W.getAttribute(SHAPE_ATTR)??"",box:[(ee.left-L.left)*K,(ee.top-L.top)*K,ee.width*K,ee.height*K]}}):[],texts:O.map(W=>({text:W.text,box:[W.box[0],W.box[1],W.box[2],W.box[3]],size:W.size,keys:u.keysShowing(W.text)}))}},signature:()=>{const j=te();if(!(!j||j.el.querySelector("canvas, video, iframe")))return domHash(JSON.stringify(E.theme)+j.el.outerHTML)},async signatureAt(j){return await X(j),se.signature()},async partSignature(j,U){const O=b.find(K=>K.slide.id===j);if(!O)return{unknown:`no slide ${j}`};const L=[];for(const K of U){if(await X(K),O.el.querySelector("canvas, video, iframe"))return{unknown:"a canvas, a video or a frame on the slide"};L.push(O.el.outerHTML)}return{sign:domHash(L.join(`
79
- `)),owners:O.layers.map(K=>K.layer.component)}},ask:()=>Promise.resolve([]),dispose(){n.replaceChildren()}};return se}var titled=e=>{const t=titleOf(e);return t===void 0?{}:{title:t}};function titleOf(e){const n=e.shapes.find(r=>r.placeholder?.type==="title"||r.placeholder?.type==="ctrTitle")?.text?.paragraphs.map(r=>r.runs.map(u=>u.text).join("")).join(" ").trim();return n===void 0||n===""?void 0:n}function stageContext(e){const t=n=>()=>{throw new Error(`${n} is a video's: a slide has no speech.`)};return{look:e.look,format:e.format,dims:{width:e.width,height:e.height,orient:e.width>e.height?"landscape":e.width<e.height?"portrait":"square",safe:{top:0,bottom:0,left:0,right:0}},combo:e.combo,dur:e.end-e.start,asset:e.asset,words:()=>[],at:t("ctx.at()"),layer:{start:0,end:e.end-e.start},wait:e.wait,report:e.report,captions:()=>[],face:()=>{},faces:()=>[],texts:()=>[],covered:[],content:[0,0,e.width,e.height],realTimers}}installConsole();var output2,bridge={get output(){return output2},async load(e,t){output2?.dispose(),output2=void 0;const n=document.getElementById("ak-stage");if(!n)throw new Error("The stage page has no #ak-stage element.");const r=e.kind==="slides"?await loadDeck(e,t,n):await load(e,t,n);return await r.ready(),output2=r,{kind:r.kind,timeline:r.timeline,problems:r.problems(),facts:r.facts(),reads:r.reads(),text:r.text(),says:r.says(),signs:r.signs(),covers:r.covers(),seekLimit:r.seekLimit}},console:()=>consoleLog(),locate:e=>locateLayers(document,mapShape(e,({x:t,y:n})=>({x:t*innerWidth,y:n*innerHeight}))),async play(e){const t=document.getElementById("ak-stage");if(!output2||!t)throw new Error("Nothing is loaded to play.");const n=await startPlayer({output:output2,stage:t,...e.media?{media:e.media}:{},...e.seed===void 0?{}:{seed:e.seed},...e.start===void 0?{}:{start:e.start},...e.post?{post:e.post}:{},...e.chrome===void 0?{}:{chrome:e.chrome}});return{command(r){n.command(r)}}}};window.allyhub=bridge;