@stacksjs/actions 0.70.23 → 0.70.26

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 (384) hide show
  1. package/dist/chunk-2gh7kgpc.js +3 -0
  2. package/dist/chunk-2kaj93p5.js +3 -0
  3. package/dist/chunk-2qchdrf9.js +3 -0
  4. package/dist/chunk-3086k7zk.js +184 -0
  5. package/dist/chunk-3beht8ja.js +130 -0
  6. package/dist/chunk-60qjz7zb.js +3 -0
  7. package/dist/chunk-67y94dzt.js +658 -0
  8. package/dist/chunk-6x1m5rkr.js +17 -0
  9. package/dist/chunk-7bpdkc40.js +714 -0
  10. package/dist/chunk-96b7fcmd.js +3 -0
  11. package/dist/chunk-aw6d8zr3.js +7 -0
  12. package/dist/chunk-c8qt2xst.js +3 -0
  13. package/dist/chunk-d4srk6ma.js +3 -0
  14. package/dist/chunk-e9tcbk71.js +1 -0
  15. package/dist/chunk-gt77jmb5.js +46 -0
  16. package/dist/chunk-h93n2j40.js +95 -0
  17. package/dist/chunk-jd1yzkq5.js +3 -0
  18. package/dist/chunk-kzhgexj4.js +3 -0
  19. package/dist/chunk-n1y0gpv6.js +3 -0
  20. package/dist/chunk-n2fd1d0m.js +3 -0
  21. package/dist/chunk-n2x7v39b.js +5 -0
  22. package/dist/chunk-rdajkt2s.js +88 -0
  23. package/dist/chunk-s735m9mg.js +1 -0
  24. package/dist/chunk-schcaf73.js +3 -0
  25. package/dist/chunk-tc935b45.js +93 -0
  26. package/dist/chunk-v0wnrnaa.js +7 -0
  27. package/dist/chunk-w418anbq.js +5 -0
  28. package/dist/chunk-wnrgcx3d.js +114 -0
  29. package/dist/chunk-wv5yb5wb.js +101 -0
  30. package/dist/chunk-x471rxrn.js +7 -0
  31. package/dist/chunk-xg9xscqz.js +1 -0
  32. package/dist/src/action.d.ts +60 -0
  33. package/dist/src/action.js +2 -0
  34. package/dist/src/actions.d.ts +2 -0
  35. package/dist/src/actions.js +2 -0
  36. package/dist/src/add.d.ts +6 -0
  37. package/dist/src/add.js +2 -0
  38. package/dist/src/ai/request-model-access.d.ts +1 -0
  39. package/dist/src/ai/request-model-access.js +2 -0
  40. package/dist/src/auth/client.d.ts +1 -0
  41. package/dist/src/auth/client.js +3 -0
  42. package/dist/src/auth/prune.d.ts +1 -0
  43. package/dist/src/auth/prune.js +2 -0
  44. package/dist/src/auth/setup.d.ts +1 -0
  45. package/dist/src/auth/setup.js +148 -0
  46. package/dist/src/auth/token.d.ts +1 -0
  47. package/dist/src/auth/token.js +2 -0
  48. package/dist/src/build/cli.d.ts +1 -0
  49. package/dist/src/build/cli.js +2 -0
  50. package/dist/src/build/component-libs.d.ts +1 -0
  51. package/dist/src/build/component-libs.js +2 -0
  52. package/dist/src/build/core.d.ts +1 -0
  53. package/dist/src/build/core.js +2 -0
  54. package/dist/src/build/desktop.d.ts +1 -0
  55. package/dist/src/build/desktop.js +2 -0
  56. package/dist/src/build/docs.d.ts +1 -0
  57. package/dist/src/build/docs.js +2 -0
  58. package/dist/src/build/server.d.ts +1 -0
  59. package/dist/src/build/server.js +2 -0
  60. package/dist/src/build/stacks.d.ts +1 -0
  61. package/dist/src/build/stacks.js +2 -0
  62. package/dist/src/build/views.d.ts +1 -0
  63. package/dist/src/build/views.js +2 -0
  64. package/dist/{build.d.ts → src/build.d.ts} +1 -2
  65. package/dist/src/build.js +2 -0
  66. package/dist/src/bump.d.ts +1 -0
  67. package/dist/src/bump.js +2 -0
  68. package/dist/src/cdn/invalidate-cache.d.ts +1 -0
  69. package/dist/src/cdn/invalidate-cache.js +1 -0
  70. package/dist/src/changelog.d.ts +1 -0
  71. package/dist/src/changelog.js +2 -0
  72. package/dist/src/check/ports.d.ts +1 -0
  73. package/dist/src/check/ports.js +2 -0
  74. package/dist/src/clean.d.ts +1 -0
  75. package/dist/src/clean.js +2 -0
  76. package/dist/{commit.d.ts → src/commit.d.ts} +1 -2
  77. package/dist/src/commit.js +2 -0
  78. package/dist/src/copy-types.d.ts +1 -0
  79. package/dist/src/copy-types.js +3 -0
  80. package/dist/src/database/seed.d.ts +1 -0
  81. package/dist/src/database/seed.js +2 -0
  82. package/dist/src/deploy/create-receipt-rule.d.ts +1 -0
  83. package/dist/src/deploy/create-receipt-rule.js +2 -0
  84. package/dist/src/deploy/index.d.ts +1 -0
  85. package/dist/src/deploy/index.js +307 -0
  86. package/dist/src/dev/api.d.ts +1 -0
  87. package/dist/src/dev/api.js +6 -0
  88. package/dist/src/dev/components.d.ts +1 -0
  89. package/dist/src/dev/components.js +2 -0
  90. package/dist/src/dev/dashboard-globals.d.ts +4 -0
  91. package/dist/src/dev/dashboard-globals.js +3 -0
  92. package/dist/src/dev/dashboard-utils.d.ts +126 -0
  93. package/dist/src/dev/dashboard-utils.js +2 -0
  94. package/dist/src/dev/dashboard.d.ts +12 -0
  95. package/dist/src/dev/dashboard.js +8 -0
  96. package/dist/src/dev/desktop.d.ts +1 -0
  97. package/dist/src/dev/desktop.js +2 -0
  98. package/dist/src/dev/docs.d.ts +1 -0
  99. package/dist/src/dev/docs.js +2 -0
  100. package/dist/src/dev/index.d.ts +10 -0
  101. package/dist/src/dev/index.js +2 -0
  102. package/dist/src/dev/system-tray.d.ts +1 -0
  103. package/dist/src/dev/system-tray.js +2 -0
  104. package/dist/src/dev/views.d.ts +1 -0
  105. package/dist/src/dev/views.js +2 -0
  106. package/dist/src/discover-packages.d.ts +18 -0
  107. package/dist/src/discover-packages.js +2 -0
  108. package/dist/src/domains/add.d.ts +1 -0
  109. package/dist/src/domains/add.js +2 -0
  110. package/dist/src/domains/purchase.d.ts +1 -0
  111. package/dist/src/domains/purchase.js +2 -0
  112. package/dist/src/domains/remove.d.ts +1 -0
  113. package/dist/src/domains/remove.js +2 -0
  114. package/dist/{examples.d.ts → src/examples.d.ts} +1 -2
  115. package/dist/src/examples.js +2 -0
  116. package/dist/src/find-projects.d.ts +1 -0
  117. package/dist/src/find-projects.js +2 -0
  118. package/dist/src/fresh.d.ts +1 -0
  119. package/dist/src/fresh.js +2 -0
  120. package/dist/src/generate/action-types.d.ts +1 -0
  121. package/dist/src/generate/action-types.js +8 -0
  122. package/dist/src/generate/component-meta.d.ts +1 -0
  123. package/dist/src/generate/component-meta.js +3 -0
  124. package/dist/src/generate/custom-cli-file.d.ts +1 -0
  125. package/dist/src/generate/custom-cli-file.js +4 -0
  126. package/dist/src/generate/env-files.d.ts +1 -0
  127. package/dist/src/generate/env-files.js +26 -0
  128. package/dist/src/generate/ide-helpers.d.ts +1 -0
  129. package/dist/src/generate/ide-helpers.js +3 -0
  130. package/dist/src/generate/index.d.ts +36 -0
  131. package/dist/src/generate/index.js +2 -0
  132. package/dist/src/generate/lib-entries.d.ts +1 -0
  133. package/dist/src/generate/lib-entries.js +3 -0
  134. package/dist/src/generate/pantry-file.d.ts +1 -0
  135. package/dist/src/generate/pantry-file.js +2 -0
  136. package/dist/src/generate/symlink-core.d.ts +1 -0
  137. package/dist/src/generate/symlink-core.js +2 -0
  138. package/dist/src/generate/types.d.ts +1 -0
  139. package/dist/src/generate/types.js +2 -0
  140. package/dist/src/generate/vscode-custom-data.d.ts +1 -0
  141. package/dist/src/generate/vscode-custom-data.js +3 -0
  142. package/dist/src/generate/web-types.d.ts +1 -0
  143. package/dist/src/generate/web-types.js +1 -0
  144. package/dist/src/helpers/component-meta.d.ts +26 -0
  145. package/dist/src/helpers/component-meta.js +2 -0
  146. package/dist/src/helpers/index.d.ts +4 -0
  147. package/dist/src/helpers/index.js +2 -0
  148. package/dist/{lib-entries.d.ts → src/helpers/lib-entries.d.ts} +9 -5
  149. package/dist/src/helpers/lib-entries.js +2 -0
  150. package/dist/src/helpers/package-json.d.ts +2 -0
  151. package/dist/src/helpers/package-json.js +43 -0
  152. package/dist/src/helpers/utils.d.ts +23 -0
  153. package/dist/src/helpers/utils.js +2 -0
  154. package/dist/{vscode-custom-data.d.ts → src/helpers/vscode-custom-data.d.ts} +1 -1
  155. package/dist/src/helpers/vscode-custom-data.js +2 -0
  156. package/dist/src/index.d.ts +42 -0
  157. package/dist/src/index.js +2 -0
  158. package/dist/src/key-generate.d.ts +1 -0
  159. package/dist/src/key-generate.js +2 -0
  160. package/dist/src/lint/fix.d.ts +1 -0
  161. package/dist/src/lint/fix.js +4 -0
  162. package/dist/src/lint/index.d.ts +1 -0
  163. package/dist/src/lint/index.js +3 -0
  164. package/dist/src/make-command.d.ts +10 -0
  165. package/dist/src/make-command.js +2 -0
  166. package/dist/src/make-job.d.ts +5 -0
  167. package/dist/src/make-job.js +2 -0
  168. package/dist/src/make-policy.d.ts +10 -0
  169. package/dist/src/make-policy.js +2 -0
  170. package/dist/src/make-resource.d.ts +10 -0
  171. package/dist/src/make-resource.js +2 -0
  172. package/dist/{make.d.ts → src/make.d.ts} +11 -9
  173. package/dist/src/make.js +2 -0
  174. package/dist/src/migrate/database.d.ts +1 -0
  175. package/dist/src/migrate/database.js +2 -0
  176. package/dist/src/migrate/fresh.d.ts +1 -0
  177. package/dist/src/migrate/fresh.js +2 -0
  178. package/dist/src/orm/base.d.ts +1 -0
  179. package/dist/src/orm/base.js +2 -0
  180. package/dist/src/orm/test.d.ts +1 -0
  181. package/dist/src/orm/test.js +1 -0
  182. package/dist/src/prepublish.d.ts +1 -0
  183. package/dist/src/prepublish.js +2 -0
  184. package/dist/src/queue/clear.d.ts +1 -0
  185. package/dist/src/queue/clear.js +2 -0
  186. package/dist/src/queue/failed.d.ts +1 -0
  187. package/dist/src/queue/failed.js +5 -0
  188. package/dist/src/queue/flush.d.ts +1 -0
  189. package/dist/src/queue/flush.js +3 -0
  190. package/dist/src/queue/inspect.d.ts +1 -0
  191. package/dist/src/queue/inspect.js +8 -0
  192. package/dist/src/queue/monitor.d.ts +1 -0
  193. package/dist/src/queue/monitor.js +7 -0
  194. package/dist/src/queue/retry.d.ts +1 -0
  195. package/dist/src/queue/retry.js +2 -0
  196. package/dist/src/queue/schedule-list.d.ts +1 -0
  197. package/dist/src/queue/schedule-list.js +5 -0
  198. package/dist/src/queue/schedule.d.ts +1 -0
  199. package/dist/src/queue/schedule.js +2 -0
  200. package/dist/src/queue/status.d.ts +1 -0
  201. package/dist/src/queue/status.js +5 -0
  202. package/dist/src/queue/table.d.ts +1 -0
  203. package/dist/src/queue/table.js +2 -0
  204. package/dist/src/queue/work.d.ts +1 -0
  205. package/dist/src/queue/work.js +2 -0
  206. package/dist/src/release.d.ts +1 -0
  207. package/dist/src/release.js +3 -0
  208. package/dist/src/route/list.d.ts +1 -0
  209. package/dist/src/route/list.js +3 -0
  210. package/dist/src/run-action.d.ts +2 -0
  211. package/dist/src/run-action.js +2 -0
  212. package/dist/src/saas/setup.d.ts +1 -0
  213. package/dist/src/saas/setup.js +2 -0
  214. package/dist/src/scaffold-crud.d.ts +25 -0
  215. package/dist/src/scaffold-crud.js +2 -0
  216. package/dist/src/schedule/run.d.ts +1 -0
  217. package/dist/src/schedule/run.js +2 -0
  218. package/dist/src/search/flush.d.ts +1 -0
  219. package/dist/src/search/flush.js +2 -0
  220. package/dist/src/search/import.d.ts +1 -0
  221. package/dist/src/search/import.js +2 -0
  222. package/dist/src/search/settings-list.d.ts +1 -0
  223. package/dist/src/search/settings-list.js +2 -0
  224. package/dist/src/search/settings.d.ts +1 -0
  225. package/dist/src/search/settings.js +2 -0
  226. package/dist/src/serve/api.d.ts +1 -0
  227. package/dist/src/serve/api.js +2 -0
  228. package/dist/src/setup/index.d.ts +1 -0
  229. package/dist/src/setup/index.js +2 -0
  230. package/dist/src/setup/ssl.d.ts +38 -0
  231. package/dist/src/setup/ssl.js +2 -0
  232. package/dist/src/stacks.d.ts +4 -0
  233. package/dist/src/stacks.js +2 -0
  234. package/dist/src/templates.d.ts +8 -0
  235. package/dist/src/templates.js +2 -0
  236. package/dist/src/test/feature.d.ts +1 -0
  237. package/dist/src/test/feature.js +2 -0
  238. package/dist/src/test/index.d.ts +1 -0
  239. package/dist/src/test/index.js +2 -0
  240. package/dist/src/test/ui.d.ts +1 -0
  241. package/dist/src/test/ui.js +2 -0
  242. package/dist/src/test/unit.d.ts +1 -0
  243. package/dist/src/test/unit.js +2 -0
  244. package/dist/src/typecheck.d.ts +1 -0
  245. package/dist/src/typecheck.js +2 -0
  246. package/dist/{types.d.ts → src/types.d.ts} +1 -2
  247. package/dist/src/types.js +2 -0
  248. package/dist/src/upgrade/binary.d.ts +1 -0
  249. package/dist/src/upgrade/binary.js +2 -0
  250. package/dist/src/upgrade/bun.d.ts +1 -0
  251. package/dist/src/upgrade/bun.js +1 -0
  252. package/dist/src/upgrade/dependencies.d.ts +1 -0
  253. package/dist/src/upgrade/dependencies.js +2 -0
  254. package/dist/src/upgrade/framework-utils.d.ts +102 -0
  255. package/dist/src/upgrade/framework-utils.js +2 -0
  256. package/dist/src/upgrade/framework.d.ts +1 -0
  257. package/dist/src/upgrade/framework.js +7 -0
  258. package/dist/src/upgrade/index.d.ts +1 -0
  259. package/dist/src/upgrade/index.js +2 -0
  260. package/dist/src/upgrade/shell.d.ts +1 -0
  261. package/dist/src/upgrade/shell.js +5 -0
  262. package/dist/src/upgrade.d.ts +7 -0
  263. package/dist/src/upgrade.js +2 -0
  264. package/package.json +39 -23
  265. package/dist/action-types.d.ts +0 -9
  266. package/dist/action.d.ts +0 -64
  267. package/dist/actions.d.ts +0 -2
  268. package/dist/add.d.ts +0 -5
  269. package/dist/add.js +0 -33
  270. package/dist/api.d.ts +0 -1
  271. package/dist/binary.d.ts +0 -2
  272. package/dist/build/component-libs.js +0 -9
  273. package/dist/build/core.js +0 -23
  274. package/dist/build/stacks.js +0 -8
  275. package/dist/build.js +0 -108
  276. package/dist/bump.d.ts +0 -2
  277. package/dist/bump.js +0 -17
  278. package/dist/changelog.d.ts +0 -2
  279. package/dist/changelog.js +0 -17
  280. package/dist/chunk-2dvnt46s.js +0 -7657
  281. package/dist/chunk-494jp8d5.js +0 -54
  282. package/dist/chunk-4axj3j8y.js +0 -34
  283. package/dist/chunk-56ar3gp7.js +0 -3823
  284. package/dist/chunk-76zhb40c.js +0 -92
  285. package/dist/chunk-7s5qcjkt.js +0 -105
  286. package/dist/chunk-9v6qtbez.js +0 -45
  287. package/dist/chunk-a13x0e43.js +0 -1180
  288. package/dist/chunk-a7k3cdby.js +0 -2266
  289. package/dist/chunk-b5g5w1hh.js +0 -1482
  290. package/dist/chunk-bf8bq8pc.js +0 -205
  291. package/dist/chunk-ccnf3w1b.js +0 -2228
  292. package/dist/chunk-dvkgakrr.js +0 -1283
  293. package/dist/chunk-frw3va9v.js +0 -69
  294. package/dist/chunk-hvfeg6n6.js +0 -179248
  295. package/dist/chunk-mdj7x1vs.js +0 -790
  296. package/dist/chunk-mdqphqep.js +0 -438
  297. package/dist/chunk-mmskr8ar.js +0 -212
  298. package/dist/chunk-nrr524a7.js +0 -658
  299. package/dist/chunk-p0c688mg.js +0 -729
  300. package/dist/chunk-pacq2bz6.js +0 -902
  301. package/dist/chunk-psa9yf21.js +0 -72
  302. package/dist/chunk-q81mf99q.js +0 -169
  303. package/dist/chunk-q9dmga3k.js +0 -11
  304. package/dist/chunk-qhh0v93n.js +0 -73
  305. package/dist/chunk-qkm8e752.js +0 -51
  306. package/dist/chunk-saqpg5nd.js +0 -118
  307. package/dist/chunk-t5em30ak.js +0 -379
  308. package/dist/chunk-veja9rez.js +0 -5764
  309. package/dist/chunk-w4bfpxhm.js +0 -311
  310. package/dist/chunk-w6fdq4hk.js +0 -14425
  311. package/dist/chunk-wkwtsvym.js +0 -477
  312. package/dist/chunk-xgsmf4cy.js +0 -410
  313. package/dist/chunk-ykb33tkv.js +0 -177
  314. package/dist/chunk-ze46550n.js +0 -0
  315. package/dist/chunk-zzerxbrm.js +0 -107
  316. package/dist/clean.js +0 -6
  317. package/dist/commit.js +0 -22
  318. package/dist/component-meta.d.ts +0 -15
  319. package/dist/components.d.ts +0 -3
  320. package/dist/copy-types.d.ts +0 -1
  321. package/dist/copy-types.js +0 -14
  322. package/dist/core.d.ts +0 -1
  323. package/dist/create-receipt-rule.d.ts +0 -4
  324. package/dist/database/seed.js +0 -30
  325. package/dist/database.d.ts +0 -2
  326. package/dist/deploy/index.js +0 -48
  327. package/dist/dev/components.js +0 -11
  328. package/dist/dev/docs.js +0 -7
  329. package/dist/dev/index.js +0 -58
  330. package/dist/env-files.d.ts +0 -9
  331. package/dist/examples.js +0 -46
  332. package/dist/feature.d.ts +0 -2
  333. package/dist/find-projects.d.ts +0 -1
  334. package/dist/fix.d.ts +0 -1
  335. package/dist/flush.d.ts +0 -2
  336. package/dist/fresh.d.ts +0 -1
  337. package/dist/fresh.js +0 -21
  338. package/dist/generate/component-meta.js +0 -17
  339. package/dist/generate/ide-helpers.js +0 -18
  340. package/dist/generate/index.js +0 -216
  341. package/dist/generate/lib-entries.js +0 -30
  342. package/dist/generate/vscode-custom-data.js +0 -17
  343. package/dist/helpers/component-meta.js +0 -204227
  344. package/dist/helpers/lib-entries.js +0 -122
  345. package/dist/helpers/package-json.js +0 -96
  346. package/dist/helpers/utils.js +0 -76
  347. package/dist/helpers/vscode-custom-data.js +0 -43
  348. package/dist/import.d.ts +0 -2
  349. package/dist/index.d.ts +0 -2
  350. package/dist/index.js +0 -172
  351. package/dist/key-generate.js +0 -15
  352. package/dist/lint/fix.js +0 -18
  353. package/dist/lint/index.js +0 -5
  354. package/dist/list.d.ts +0 -1
  355. package/dist/make.js +0 -349
  356. package/dist/package-json.d.ts +0 -92
  357. package/dist/pkgx-file.d.ts +0 -8
  358. package/dist/ports.d.ts +0 -2
  359. package/dist/prepublish.d.ts +0 -1
  360. package/dist/prepublish.js +0 -17
  361. package/dist/purchase.d.ts +0 -6
  362. package/dist/release.js +0 -49
  363. package/dist/remove.d.ts +0 -6
  364. package/dist/request-model-access.d.ts +0 -1
  365. package/dist/run.d.ts +0 -1
  366. package/dist/settings-list.d.ts +0 -2
  367. package/dist/settings.d.ts +0 -1
  368. package/dist/setup.d.ts +0 -1
  369. package/dist/shell.d.ts +0 -2
  370. package/dist/table.d.ts +0 -1
  371. package/dist/test/feature.js +0 -14
  372. package/dist/test/index.js +0 -14
  373. package/dist/test/ui.js +0 -6
  374. package/dist/test/unit.js +0 -14
  375. package/dist/typecheck.js +0 -6
  376. package/dist/types.js +0 -23
  377. package/dist/unit.d.ts +0 -2
  378. package/dist/upgrade/dependencies.js +0 -8
  379. package/dist/upgrade/index.js +0 -22
  380. package/dist/upgrade.d.ts +0 -5
  381. package/dist/upgrade.js +0 -50
  382. package/dist/utils.d.ts +0 -75
  383. package/dist/work.d.ts +0 -3
  384. /package/dist/{upgrade/framework.js → chunk-cdk2r2jd.js} +0 -0
@@ -1,729 +0,0 @@
1
- // @bun
2
- import {
3
- C,
4
- N
5
- } from "./chunk-qhh0v93n.js";
6
- import"./chunk-9v6qtbez.js";
7
-
8
- // ../../../../node_modules/confbox/dist/toml.mjs
9
- /*!
10
- * Copyright (c) Squirrel Chat et al., All rights reserved.
11
- * SPDX-License-Identifier: BSD-3-Clause
12
- *
13
- * Redistribution and use in source and binary forms, with or without
14
- * modification, are permitted provided that the following conditions are met:
15
- *
16
- * 1. Redistributions of source code must retain the above copyright notice, this
17
- * list of conditions and the following disclaimer.
18
- * 2. Redistributions in binary form must reproduce the above copyright notice,
19
- * this list of conditions and the following disclaimer in the
20
- * documentation and/or other materials provided with the distribution.
21
- * 3. Neither the name of the copyright holder nor the names of its contributors
22
- * may be used to endorse or promote products derived from this software without
23
- * specific prior written permission.
24
- *
25
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
26
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
29
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
- */
36
- function v(e, n) {
37
- let t = e.slice(0, n).split(/\r\n|\n|\r/g);
38
- return [t.length, t.pop().length + 1];
39
- }
40
- function C2(e, n, t) {
41
- let l = e.split(/\r\n|\n|\r/g), r = "", i = (Math.log10(n + 1) | 0) + 1;
42
- for (let o = n - 1;o <= n + 1; o++) {
43
- let f = l[o - 1];
44
- f && (r += o.toString().padEnd(i, " "), r += ": ", r += f, r += `
45
- `, o === n && (r += " ".repeat(i + t + 2), r += `^
46
- `));
47
- }
48
- return r;
49
- }
50
-
51
- class c extends Error {
52
- line;
53
- column;
54
- codeblock;
55
- constructor(n, t) {
56
- const [l, r] = v(t.toml, t.ptr), i = C2(t.toml, l, r);
57
- super(`Invalid TOML document: ${n}
58
-
59
- ${i}`, t), this.line = l, this.column = r, this.codeblock = i;
60
- }
61
- }
62
- /*!
63
- * Copyright (c) Squirrel Chat et al., All rights reserved.
64
- * SPDX-License-Identifier: BSD-3-Clause
65
- *
66
- * Redistribution and use in source and binary forms, with or without
67
- * modification, are permitted provided that the following conditions are met:
68
- *
69
- * 1. Redistributions of source code must retain the above copyright notice, this
70
- * list of conditions and the following disclaimer.
71
- * 2. Redistributions in binary form must reproduce the above copyright notice,
72
- * this list of conditions and the following disclaimer in the
73
- * documentation and/or other materials provided with the distribution.
74
- * 3. Neither the name of the copyright holder nor the names of its contributors
75
- * may be used to endorse or promote products derived from this software without
76
- * specific prior written permission.
77
- *
78
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
79
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
80
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
81
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
82
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
83
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
84
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
85
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
86
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
87
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88
- */
89
- function g(e, n = 0, t = e.length) {
90
- let l = e.indexOf(`
91
- `, n);
92
- return e[l - 1] === "\r" && l--, l <= t ? l : -1;
93
- }
94
- function y(e, n) {
95
- for (let t = n;t < e.length; t++) {
96
- let l = e[t];
97
- if (l === `
98
- `)
99
- return t;
100
- if (l === "\r" && e[t + 1] === `
101
- `)
102
- return t + 1;
103
- if (l < " " && l !== "\t" || l === "\x7F")
104
- throw new c("control characters are not allowed in comments", { toml: e, ptr: n });
105
- }
106
- return e.length;
107
- }
108
- function s(e, n, t, l) {
109
- let r;
110
- for (;(r = e[n]) === " " || r === "\t" || !t && (r === `
111
- ` || r === "\r" && e[n + 1] === `
112
- `); )
113
- n++;
114
- return l || r !== "#" ? n : s(e, y(e, n), t);
115
- }
116
- function A(e, n, t, l, r = false) {
117
- if (!l)
118
- return n = g(e, n), n < 0 ? e.length : n;
119
- for (let i = n;i < e.length; i++) {
120
- let o = e[i];
121
- if (o === "#")
122
- i = g(e, i);
123
- else {
124
- if (o === t)
125
- return i + 1;
126
- if (o === l)
127
- return i;
128
- if (r && (o === `
129
- ` || o === "\r" && e[i + 1] === `
130
- `))
131
- return i;
132
- }
133
- }
134
- throw new c("cannot find end of structure", { toml: e, ptr: n });
135
- }
136
- function S(e, n) {
137
- let t = e[n], l = t === e[n + 1] && e[n + 1] === e[n + 2] ? e.slice(n, n + 3) : t;
138
- n += l.length - 1;
139
- do
140
- n = e.indexOf(l, ++n);
141
- while (n > -1 && t !== "'" && e[n - 1] === "\\" && e[n - 2] !== "\\");
142
- return n > -1 && (n += l.length, l.length > 1 && (e[n] === t && n++, e[n] === t && n++)), n;
143
- }
144
- /*!
145
- * Copyright (c) Squirrel Chat et al., All rights reserved.
146
- * SPDX-License-Identifier: BSD-3-Clause
147
- *
148
- * Redistribution and use in source and binary forms, with or without
149
- * modification, are permitted provided that the following conditions are met:
150
- *
151
- * 1. Redistributions of source code must retain the above copyright notice, this
152
- * list of conditions and the following disclaimer.
153
- * 2. Redistributions in binary form must reproduce the above copyright notice,
154
- * this list of conditions and the following disclaimer in the
155
- * documentation and/or other materials provided with the distribution.
156
- * 3. Neither the name of the copyright holder nor the names of its contributors
157
- * may be used to endorse or promote products derived from this software without
158
- * specific prior written permission.
159
- *
160
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
161
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
162
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
163
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
164
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
165
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
166
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
167
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
168
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
169
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
170
- */
171
- var R = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;
172
-
173
- class w extends Date {
174
- #n = false;
175
- #t = false;
176
- #e = null;
177
- constructor(n) {
178
- let t = true, l = true, r = "Z";
179
- if (typeof n == "string") {
180
- let i = n.match(R);
181
- i ? (i[1] || (t = false, n = `0000-01-01T${n}`), l = !!i[2], i[2] && +i[2] > 23 ? n = "" : (r = i[3] || null, n = n.toUpperCase(), !r && l && (n += "Z"))) : n = "";
182
- }
183
- super(n), isNaN(this.getTime()) || (this.#n = t, this.#t = l, this.#e = r);
184
- }
185
- isDateTime() {
186
- return this.#n && this.#t;
187
- }
188
- isLocal() {
189
- return !this.#n || !this.#t || !this.#e;
190
- }
191
- isDate() {
192
- return this.#n && !this.#t;
193
- }
194
- isTime() {
195
- return this.#t && !this.#n;
196
- }
197
- isValid() {
198
- return this.#n || this.#t;
199
- }
200
- toISOString() {
201
- let n = super.toISOString();
202
- if (this.isDate())
203
- return n.slice(0, 10);
204
- if (this.isTime())
205
- return n.slice(11, 23);
206
- if (this.#e === null)
207
- return n.slice(0, -1);
208
- if (this.#e === "Z")
209
- return n;
210
- let t = +this.#e.slice(1, 3) * 60 + +this.#e.slice(4, 6);
211
- return t = this.#e[0] === "-" ? t : -t, new Date(this.getTime() - t * 60000).toISOString().slice(0, -1) + this.#e;
212
- }
213
- static wrapAsOffsetDateTime(n, t = "Z") {
214
- let l = new w(n);
215
- return l.#e = t, l;
216
- }
217
- static wrapAsLocalDateTime(n) {
218
- let t = new w(n);
219
- return t.#e = null, t;
220
- }
221
- static wrapAsLocalDate(n) {
222
- let t = new w(n);
223
- return t.#t = false, t.#e = null, t;
224
- }
225
- static wrapAsLocalTime(n) {
226
- let t = new w(n);
227
- return t.#n = false, t.#e = null, t;
228
- }
229
- }
230
- /*!
231
- * Copyright (c) Squirrel Chat et al., All rights reserved.
232
- * SPDX-License-Identifier: BSD-3-Clause
233
- *
234
- * Redistribution and use in source and binary forms, with or without
235
- * modification, are permitted provided that the following conditions are met:
236
- *
237
- * 1. Redistributions of source code must retain the above copyright notice, this
238
- * list of conditions and the following disclaimer.
239
- * 2. Redistributions in binary form must reproduce the above copyright notice,
240
- * this list of conditions and the following disclaimer in the
241
- * documentation and/or other materials provided with the distribution.
242
- * 3. Neither the name of the copyright holder nor the names of its contributors
243
- * may be used to endorse or promote products derived from this software without
244
- * specific prior written permission.
245
- *
246
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
247
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
248
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
249
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
250
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
251
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
252
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
253
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
254
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
255
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
256
- */
257
- var M = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
258
- var Z = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
259
- var j = /^[+-]?0[0-9_]/;
260
- var z = /^[0-9a-f]{4,8}$/i;
261
- var I = { b: "\b", t: "\t", n: `
262
- `, f: "\f", r: "\r", '"': '"', "\\": "\\" };
263
- function $(e, n = 0, t = e.length) {
264
- let l = e[n] === "'", r = e[n++] === e[n] && e[n] === e[n + 1];
265
- r && (t -= 2, e[n += 2] === "\r" && n++, e[n] === `
266
- ` && n++);
267
- let i = 0, o, f = "", a = n;
268
- for (;n < t - 1; ) {
269
- let u = e[n++];
270
- if (u === `
271
- ` || u === "\r" && e[n] === `
272
- `) {
273
- if (!r)
274
- throw new c("newlines are not allowed in strings", { toml: e, ptr: n - 1 });
275
- } else if (u < " " && u !== "\t" || u === "\x7F")
276
- throw new c("control characters are not allowed in strings", { toml: e, ptr: n - 1 });
277
- if (o) {
278
- if (o = false, u === "u" || u === "U") {
279
- let d = e.slice(n, n += u === "u" ? 4 : 8);
280
- if (!z.test(d))
281
- throw new c("invalid unicode escape", { toml: e, ptr: i });
282
- try {
283
- f += String.fromCodePoint(parseInt(d, 16));
284
- } catch {
285
- throw new c("invalid unicode escape", { toml: e, ptr: i });
286
- }
287
- } else if (r && (u === `
288
- ` || u === " " || u === "\t" || u === "\r")) {
289
- if (n = s(e, n - 1, true), e[n] !== `
290
- ` && e[n] !== "\r")
291
- throw new c("invalid escape: only line-ending whitespace may be escaped", { toml: e, ptr: i });
292
- n = s(e, n);
293
- } else if (u in I)
294
- f += I[u];
295
- else
296
- throw new c("unrecognized escape sequence", { toml: e, ptr: i });
297
- a = n;
298
- } else
299
- !l && u === "\\" && (i = n - 1, o = true, f += e.slice(a, i));
300
- }
301
- return f + e.slice(a, t - 1);
302
- }
303
- function F(e, n, t) {
304
- if (e === "true")
305
- return true;
306
- if (e === "false")
307
- return false;
308
- if (e === "-inf")
309
- return -1 / 0;
310
- if (e === "inf" || e === "+inf")
311
- return 1 / 0;
312
- if (e === "nan" || e === "+nan" || e === "-nan")
313
- return NaN;
314
- if (e === "-0")
315
- return 0;
316
- let l;
317
- if ((l = M.test(e)) || Z.test(e)) {
318
- if (j.test(e))
319
- throw new c("leading zeroes are not allowed", { toml: n, ptr: t });
320
- let i = +e.replace(/_/g, "");
321
- if (isNaN(i))
322
- throw new c("invalid number", { toml: n, ptr: t });
323
- if (l && !Number.isSafeInteger(i))
324
- throw new c("integer value cannot be represented losslessly", { toml: n, ptr: t });
325
- return i;
326
- }
327
- let r = new w(e);
328
- if (!r.isValid())
329
- throw new c("invalid value", { toml: n, ptr: t });
330
- return r;
331
- }
332
- /*!
333
- * Copyright (c) Squirrel Chat et al., All rights reserved.
334
- * SPDX-License-Identifier: BSD-3-Clause
335
- *
336
- * Redistribution and use in source and binary forms, with or without
337
- * modification, are permitted provided that the following conditions are met:
338
- *
339
- * 1. Redistributions of source code must retain the above copyright notice, this
340
- * list of conditions and the following disclaimer.
341
- * 2. Redistributions in binary form must reproduce the above copyright notice,
342
- * this list of conditions and the following disclaimer in the
343
- * documentation and/or other materials provided with the distribution.
344
- * 3. Neither the name of the copyright holder nor the names of its contributors
345
- * may be used to endorse or promote products derived from this software without
346
- * specific prior written permission.
347
- *
348
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
349
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
350
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
351
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
352
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
353
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
354
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
355
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
356
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
357
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
358
- */
359
- function V(e, n, t, l) {
360
- let r = e.slice(n, t), i = r.indexOf("#");
361
- i > -1 && (y(e, i), r = r.slice(0, i));
362
- let o = r.trimEnd();
363
- if (!l) {
364
- let f = r.indexOf(`
365
- `, o.length);
366
- if (f > -1)
367
- throw new c("newlines are not allowed in inline tables", { toml: e, ptr: n + f });
368
- }
369
- return [o, i];
370
- }
371
- function b(e, n, t, l) {
372
- if (l === 0)
373
- throw new c("document contains excessively nested structures. aborting.", { toml: e, ptr: n });
374
- let r = e[n];
375
- if (r === "[" || r === "{") {
376
- let [f, a] = r === "[" ? U(e, n, l) : K(e, n, l), u = A(e, a, ",", t);
377
- if (t === "}") {
378
- let d = g(e, a, u);
379
- if (d > -1)
380
- throw new c("newlines are not allowed in inline tables", { toml: e, ptr: d });
381
- }
382
- return [f, u];
383
- }
384
- let i;
385
- if (r === '"' || r === "'") {
386
- i = S(e, n);
387
- let f = $(e, n, i);
388
- if (t) {
389
- if (i = s(e, i, t !== "]"), e[i] && e[i] !== "," && e[i] !== t && e[i] !== `
390
- ` && e[i] !== "\r")
391
- throw new c("unexpected character encountered", { toml: e, ptr: i });
392
- i += +(e[i] === ",");
393
- }
394
- return [f, i];
395
- }
396
- i = A(e, n, ",", t);
397
- let o = V(e, n, i - +(e[i - 1] === ","), t === "]");
398
- if (!o[0])
399
- throw new c("incomplete key-value declaration: no value specified", { toml: e, ptr: n });
400
- return t && o[1] > -1 && (i = s(e, n + o[1]), i += +(e[i] === ",")), [F(o[0], e, n), i];
401
- }
402
- /*!
403
- * Copyright (c) Squirrel Chat et al., All rights reserved.
404
- * SPDX-License-Identifier: BSD-3-Clause
405
- *
406
- * Redistribution and use in source and binary forms, with or without
407
- * modification, are permitted provided that the following conditions are met:
408
- *
409
- * 1. Redistributions of source code must retain the above copyright notice, this
410
- * list of conditions and the following disclaimer.
411
- * 2. Redistributions in binary form must reproduce the above copyright notice,
412
- * this list of conditions and the following disclaimer in the
413
- * documentation and/or other materials provided with the distribution.
414
- * 3. Neither the name of the copyright holder nor the names of its contributors
415
- * may be used to endorse or promote products derived from this software without
416
- * specific prior written permission.
417
- *
418
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
419
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
420
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
421
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
422
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
423
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
424
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
425
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
426
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
427
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
428
- */
429
- var G = /^[a-zA-Z0-9-_]+[ \t]*$/;
430
- function x(e, n, t = "=") {
431
- let l = n - 1, r = [], i = e.indexOf(t, n);
432
- if (i < 0)
433
- throw new c("incomplete key-value: cannot find end of key", { toml: e, ptr: n });
434
- do {
435
- let o = e[n = ++l];
436
- if (o !== " " && o !== "\t")
437
- if (o === '"' || o === "'") {
438
- if (o === e[n + 1] && o === e[n + 2])
439
- throw new c("multiline strings are not allowed in keys", { toml: e, ptr: n });
440
- let f = S(e, n);
441
- if (f < 0)
442
- throw new c("unfinished string encountered", { toml: e, ptr: n });
443
- l = e.indexOf(".", f);
444
- let a = e.slice(f, l < 0 || l > i ? i : l), u = g(a);
445
- if (u > -1)
446
- throw new c("newlines are not allowed in keys", { toml: e, ptr: n + l + u });
447
- if (a.trimStart())
448
- throw new c("found extra tokens after the string part", { toml: e, ptr: f });
449
- if (i < f && (i = e.indexOf(t, f), i < 0))
450
- throw new c("incomplete key-value: cannot find end of key", { toml: e, ptr: n });
451
- r.push($(e, n, f));
452
- } else {
453
- l = e.indexOf(".", n);
454
- let f = e.slice(n, l < 0 || l > i ? i : l);
455
- if (!G.test(f))
456
- throw new c("only letter, numbers, dashes and underscores are allowed in keys", { toml: e, ptr: n });
457
- r.push(f.trimEnd());
458
- }
459
- } while (l + 1 && l < i);
460
- return [r, s(e, i + 1, true, true)];
461
- }
462
- function K(e, n, t) {
463
- let l = {}, r = new Set, i, o = 0;
464
- for (n++;(i = e[n++]) !== "}" && i; ) {
465
- if (i === `
466
- `)
467
- throw new c("newlines are not allowed in inline tables", { toml: e, ptr: n - 1 });
468
- if (i === "#")
469
- throw new c("inline tables cannot contain comments", { toml: e, ptr: n - 1 });
470
- if (i === ",")
471
- throw new c("expected key-value, found comma", { toml: e, ptr: n - 1 });
472
- if (i !== " " && i !== "\t") {
473
- let f, a = l, u = false, [d, N2] = x(e, n - 1);
474
- for (let m = 0;m < d.length; m++) {
475
- if (m && (a = u ? a[f] : a[f] = {}), f = d[m], (u = Object.hasOwn(a, f)) && (typeof a[f] != "object" || r.has(a[f])))
476
- throw new c("trying to redefine an already defined value", { toml: e, ptr: n });
477
- !u && f === "__proto__" && Object.defineProperty(a, f, { enumerable: true, configurable: true, writable: true });
478
- }
479
- if (u)
480
- throw new c("trying to redefine an already defined value", { toml: e, ptr: n });
481
- let [_, k] = b(e, N2, "}", t - 1);
482
- r.add(_), a[f] = _, n = k, o = e[n - 1] === "," ? n - 1 : 0;
483
- }
484
- }
485
- if (o)
486
- throw new c("trailing commas are not allowed in inline tables", { toml: e, ptr: o });
487
- if (!i)
488
- throw new c("unfinished table encountered", { toml: e, ptr: n });
489
- return [l, n];
490
- }
491
- function U(e, n, t) {
492
- let l = [], r;
493
- for (n++;(r = e[n++]) !== "]" && r; ) {
494
- if (r === ",")
495
- throw new c("expected value, found comma", { toml: e, ptr: n - 1 });
496
- if (r === "#")
497
- n = y(e, n);
498
- else if (r !== " " && r !== "\t" && r !== `
499
- ` && r !== "\r") {
500
- let i = b(e, n - 1, "]", t - 1);
501
- l.push(i[0]), n = i[1];
502
- }
503
- }
504
- if (!r)
505
- throw new c("unfinished array encountered", { toml: e, ptr: n });
506
- return [l, n];
507
- }
508
- /*!
509
- * Copyright (c) Squirrel Chat et al., All rights reserved.
510
- * SPDX-License-Identifier: BSD-3-Clause
511
- *
512
- * Redistribution and use in source and binary forms, with or without
513
- * modification, are permitted provided that the following conditions are met:
514
- *
515
- * 1. Redistributions of source code must retain the above copyright notice, this
516
- * list of conditions and the following disclaimer.
517
- * 2. Redistributions in binary form must reproduce the above copyright notice,
518
- * this list of conditions and the following disclaimer in the
519
- * documentation and/or other materials provided with the distribution.
520
- * 3. Neither the name of the copyright holder nor the names of its contributors
521
- * may be used to endorse or promote products derived from this software without
522
- * specific prior written permission.
523
- *
524
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
525
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
526
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
527
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
528
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
529
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
530
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
531
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
532
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
533
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
534
- */
535
- function p(e, n, t, l) {
536
- let r = n, i = t, o, f = false, a;
537
- for (let u = 0;u < e.length; u++) {
538
- if (u) {
539
- if (r = f ? r[o] : r[o] = {}, i = (a = i[o]).c, l === 0 && (a.t === 1 || a.t === 2))
540
- return null;
541
- if (a.t === 2) {
542
- let d = r.length - 1;
543
- r = r[d], i = i[d].c;
544
- }
545
- }
546
- if (o = e[u], (f = Object.hasOwn(r, o)) && i[o]?.t === 0 && i[o]?.d)
547
- return null;
548
- f || (o === "__proto__" && (Object.defineProperty(r, o, { enumerable: true, configurable: true, writable: true }), Object.defineProperty(i, o, { enumerable: true, configurable: true, writable: true })), i[o] = { t: u < e.length - 1 && l === 2 ? 3 : l, d: false, i: 0, c: {} });
549
- }
550
- if (a = i[o], a.t !== l && !(l === 1 && a.t === 3) || (l === 2 && (a.d || (a.d = true, r[o] = []), r[o].push(r = {}), a.c[a.i++] = a = { t: 1, d: false, i: 0, c: {} }), a.d))
551
- return null;
552
- if (a.d = true, l === 1)
553
- r = f ? r[o] : r[o] = {};
554
- else if (l === 0 && f)
555
- return null;
556
- return [o, r, a.c];
557
- }
558
- function X(e, n) {
559
- let t = n?.maxDepth ?? 1000, l = {}, r = {}, i = l, o = r;
560
- for (let f = s(e, 0);f < e.length; ) {
561
- if (e[f] === "[") {
562
- let a = e[++f] === "[", u = x(e, f += +a, "]");
563
- if (a) {
564
- if (e[u[1] - 1] !== "]")
565
- throw new c("expected end of table declaration", { toml: e, ptr: u[1] - 1 });
566
- u[1]++;
567
- }
568
- let d = p(u[0], l, r, a ? 2 : 1);
569
- if (!d)
570
- throw new c("trying to redefine an already defined table or value", { toml: e, ptr: f });
571
- o = d[2], i = d[1], f = u[1];
572
- } else {
573
- let a = x(e, f), u = p(a[0], i, o, 0);
574
- if (!u)
575
- throw new c("trying to redefine an already defined table or value", { toml: e, ptr: f });
576
- let d = b(e, a[1], undefined, t);
577
- u[1][u[0]] = d[0], f = d[1];
578
- }
579
- if (f = s(e, f, true), e[f] && e[f] !== `
580
- ` && e[f] !== "\r")
581
- throw new c("each key-value declaration must be followed by an end-of-line", { toml: e, ptr: f });
582
- f = s(e, f);
583
- }
584
- return l;
585
- }
586
- /*!
587
- * Copyright (c) Squirrel Chat et al., All rights reserved.
588
- * SPDX-License-Identifier: BSD-3-Clause
589
- *
590
- * Redistribution and use in source and binary forms, with or without
591
- * modification, are permitted provided that the following conditions are met:
592
- *
593
- * 1. Redistributions of source code must retain the above copyright notice, this
594
- * list of conditions and the following disclaimer.
595
- * 2. Redistributions in binary form must reproduce the above copyright notice,
596
- * this list of conditions and the following disclaimer in the
597
- * documentation and/or other materials provided with the distribution.
598
- * 3. Neither the name of the copyright holder nor the names of its contributors
599
- * may be used to endorse or promote products derived from this software without
600
- * specific prior written permission.
601
- *
602
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
603
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
604
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
605
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
606
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
607
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
608
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
609
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
610
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
611
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
612
- */
613
- var D = /^[a-z0-9-_]+$/i;
614
- function h(e) {
615
- let n = typeof e;
616
- if (n === "object") {
617
- if (Array.isArray(e))
618
- return "array";
619
- if (e instanceof Date)
620
- return "date";
621
- }
622
- return n;
623
- }
624
- function B(e) {
625
- for (let n = 0;n < e.length; n++)
626
- if (h(e[n]) !== "object")
627
- return false;
628
- return e.length != 0;
629
- }
630
- function E(e) {
631
- return JSON.stringify(e).replace(/\x7f/g, "\\u007f");
632
- }
633
- function O(e, n, t) {
634
- if (t === 0)
635
- throw new Error("Could not stringify the object: maximum object depth exceeded");
636
- if (n === "number")
637
- return isNaN(e) ? "nan" : e === 1 / 0 ? "inf" : e === -1 / 0 ? "-inf" : e.toString();
638
- if (n === "bigint" || n === "boolean")
639
- return e.toString();
640
- if (n === "string")
641
- return E(e);
642
- if (n === "date") {
643
- if (isNaN(e.getTime()))
644
- throw new TypeError("cannot serialize invalid date");
645
- return e.toISOString();
646
- }
647
- if (n === "object")
648
- return Y(e, t);
649
- if (n === "array")
650
- return q(e, t);
651
- }
652
- function Y(e, n) {
653
- let t = Object.keys(e);
654
- if (t.length === 0)
655
- return "{}";
656
- let l = "{ ";
657
- for (let r = 0;r < t.length; r++) {
658
- let i = t[r];
659
- r && (l += ", "), l += D.test(i) ? i : E(i), l += " = ", l += O(e[i], h(e[i]), n - 1);
660
- }
661
- return l + " }";
662
- }
663
- function q(e, n) {
664
- if (e.length === 0)
665
- return "[]";
666
- let t = "[ ";
667
- for (let l = 0;l < e.length; l++) {
668
- if (l && (t += ", "), e[l] === null || e[l] === undefined)
669
- throw new TypeError("arrays cannot contain null or undefined values");
670
- t += O(e[l], h(e[l]), n - 1);
671
- }
672
- return t + " ]";
673
- }
674
- function J(e, n, t) {
675
- if (t === 0)
676
- throw new Error("Could not stringify the object: maximum object depth exceeded");
677
- let l = "";
678
- for (let r = 0;r < e.length; r++)
679
- l += `[[${n}]]
680
- `, l += T(e[r], n, t), l += `
681
-
682
- `;
683
- return l;
684
- }
685
- function T(e, n, t) {
686
- if (t === 0)
687
- throw new Error("Could not stringify the object: maximum object depth exceeded");
688
- let l = "", r = "", i = Object.keys(e);
689
- for (let o = 0;o < i.length; o++) {
690
- let f = i[o];
691
- if (e[f] !== null && e[f] !== undefined) {
692
- let a = h(e[f]);
693
- if (a === "symbol" || a === "function")
694
- throw new TypeError(`cannot serialize values of type '${a}'`);
695
- let u = D.test(f) ? f : E(f);
696
- if (a === "array" && B(e[f]))
697
- r += J(e[f], n ? `${n}.${u}` : u, t - 1);
698
- else if (a === "object") {
699
- let d = n ? `${n}.${u}` : u;
700
- r += `[${d}]
701
- `, r += T(e[f], d, t - 1), r += `
702
-
703
- `;
704
- } else
705
- l += u, l += " = ", l += O(e[f], a, t), l += `
706
- `;
707
- }
708
- }
709
- return `${l}
710
- ${r}`.trim();
711
- }
712
- function H(e, n) {
713
- if (h(e) !== "object")
714
- throw new TypeError("stringify can only be called with an object");
715
- let t = n?.maxDepth ?? 1000;
716
- return T(e, "", t);
717
- }
718
- function Q(e) {
719
- const n = X(e);
720
- return N(e, n, { preserveIndentation: false }), n;
721
- }
722
- function W(e) {
723
- const n = C(e, {}), t = H(e);
724
- return n.whitespace.start + t + n.whitespace.end;
725
- }
726
- export {
727
- W as stringifyTOML,
728
- Q as parseTOML
729
- };