cf 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.
- package/dist/_meta/agent-context.json +78 -41
- package/dist/_meta/commands.json +19888 -21071
- package/dist/_meta/schemas.json +14305 -15328
- package/dist/abuse-reports-BsF9JZPW.mjs +8 -0
- package/dist/account-D8mYiWxQ.mjs +2 -0
- package/dist/accounts-CJci1Oez.mjs +23 -0
- package/dist/acm-CmCd985Q.mjs +3 -0
- package/dist/addressing-R7p6TRBe.mjs +12 -0
- package/dist/{agent-context-DMPfi54f.mjs → agent-context-Bzl5PGW-.mjs} +1 -1
- package/dist/ai-BzJg0RIX.mjs +3 -0
- package/dist/ai-audit-B0vJNOZG.mjs +2 -0
- package/dist/ai-gateway-D3vJR3My.mjs +10 -0
- package/dist/ai-search-CNg7W7U4.mjs +7 -0
- package/dist/alerting-_sdM0B0S.mjs +6 -0
- package/dist/alerts-dpT6Qsdu.mjs +2 -0
- package/dist/{analytics-DSSRDZz8.mjs → analytics-BFBJhDrP.mjs} +1 -1
- package/dist/analytics_engine-CWhFvyeK.mjs +2 -0
- package/dist/api-gateway-D4AIEtUq.mjs +33 -0
- package/dist/argo-Bjk6nFfs.mjs +2 -0
- package/dist/artifacts-Ba4b3iOa.mjs +4 -0
- package/dist/{audit-logs-BuExU_nz.mjs → audit-logs-BE0T5All.mjs} +1 -1
- package/dist/{auth-CSC4yhEJ.mjs → auth-CZ0E51rF.mjs} +3 -3
- package/dist/auth-D_zyQbDR.mjs +5 -0
- package/dist/autorag-Cnpp8PAG.mjs +2 -0
- package/dist/billing-Dz6Zj8Eq.mjs +2 -0
- package/dist/bot-management-pFwIbFi-.mjs +5 -0
- package/dist/botnet-feed-BY9uGChY.mjs +3 -0
- package/dist/brand-protection-DkPAk2Cz.mjs +3 -0
- package/dist/brands-CGpk9nZB.mjs +2 -0
- package/dist/browser-extension-D9P6Yv8i.mjs +3 -0
- package/dist/browser-run-DhHtz4y3.mjs +4 -0
- package/dist/build-CWuStmDi.mjs +2 -0
- package/dist/cache-DVhkiIGK.mjs +5 -0
- package/dist/calls-95zjvIcO.mjs +4 -0
- package/dist/certificate-authorities-BowBqbVq.mjs +2 -0
- package/dist/cf-BLT7uKJF.mjs +18 -0
- package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +397 -0
- package/dist/clear-DXx8WBAN.mjs +2 -0
- package/dist/client-certificates-D6mE4vJu.mjs +3 -0
- package/dist/cloud-connector-DmwsjeFN.mjs +2 -0
- package/dist/cloudforce-one-CG3TT7IN.mjs +23 -0
- package/dist/{completions-DOeHPdCG.mjs → completions-DMc_PlIw.mjs} +2 -2
- package/dist/connectivity-DJkE3crz.mjs +3 -0
- package/dist/connector-interrupts-DTgQ7onV.mjs +2 -0
- package/dist/connector-telemetry-events-D0rTHDou.mjs +2 -0
- package/dist/connector-telemetry-snapshots--0QmD3z6.mjs +2 -0
- package/dist/connectors-zWaZTi2A.mjs +3 -0
- package/dist/content-scanning-CGvGf04y.mjs +4 -0
- package/dist/ct-alerting-ebSPSWNC.mjs +3 -0
- package/dist/custom-certificates-CWUrPYLP.mjs +5 -0
- package/dist/custom-csrs-CRtdrF9R.mjs +4 -0
- package/dist/custom-hostnames-CVQSksqq.mjs +5 -0
- package/dist/custom-nameservers-BRwbIdsX.mjs +3 -0
- package/dist/custom-pages-Ci8sTQX7.mjs +4 -0
- package/dist/d1-78Ym1P6D.mjs +4 -0
- package/dist/data-security-zmFoMwRU.mjs +6 -0
- package/dist/{dcv-delegation-Bgf86J-r.mjs → dcv-delegation-Dd4FZ2IG.mjs} +1 -1
- package/dist/{deploy-dVrgDUOp.mjs → deploy-CVvkZFjR.mjs} +1 -1
- package/dist/{dev-C01_Lby6.mjs → dev-DSslyDXx.mjs} +1 -1
- package/dist/diagnostics-B8Ev5m_o.mjs +3 -0
- package/dist/dispatch-namespaces-Dm5vGeEP.mjs +7 -0
- package/dist/dist-B7hsuvbF.mjs +57 -0
- package/dist/dist-BH-4NQOV.mjs +134 -0
- package/dist/dns-D7VAaCyO.mjs +29 -0
- package/dist/dns-firewall-ByLCsf0q.mjs +57 -0
- package/dist/domain-info-CRvKc2Lg.mjs +2 -0
- package/dist/durable-objects-BIpvyu9m.mjs +2 -0
- package/dist/email-auth-Cx--s8W4.mjs +2 -0
- package/dist/email-routing-CiDbivcN.mjs +10 -0
- package/dist/email-security-BYeAuSc6.mjs +12 -0
- package/dist/email-sending-Dg2rSmHH.mjs +4 -0
- package/dist/filters-DZ8YnQ90.mjs +4 -0
- package/dist/firewall-DEd1hs_I.mjs +11 -0
- package/dist/flagship-DVw7xGoP.mjs +4 -0
- package/dist/{fraud-C03MtdZb.mjs → fraud-BbGS3FZs.mjs} +2 -2
- package/dist/google-tag-gateway-CBnRGYQR.mjs +2 -0
- package/dist/healthchecks-Da9N3ix4.mjs +4 -0
- package/dist/hostnames-mimZu2tB.mjs +3 -0
- package/dist/hyperdrive-BNdvxOos.mjs +21 -0
- package/dist/iam-DGQ-OgRl.mjs +6 -0
- package/dist/images-CI6Iy9ho.mjs +7 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-BDB-aRtU.mjs +3 -0
- package/dist/internal-Czlp5Ekb.mjs +2 -0
- package/dist/{ips-nv9INuWZ.mjs → ips-B9UuPvsY.mjs} +1 -1
- package/dist/keyless-certificates-Ua9uJgPt.mjs +3 -0
- package/dist/kv-BHerx4dZ.mjs +5 -0
- package/dist/leaked-credential-checks-B8Vunj9h.mjs +3 -0
- package/dist/live-Ce7dZW7p.mjs +2 -0
- package/dist/load-balancers-DSjS5WKw.mjs +6 -0
- package/dist/logexplorer-DBIfTlRP.mjs +24 -0
- package/dist/logo-matches-C00iGpzW.mjs +2 -0
- package/dist/logos-CJLhx1go.mjs +3 -0
- package/dist/logpush-Cr1U-eK-.mjs +5 -0
- package/dist/logs-DMvtchc6.mjs +3 -0
- package/dist/magic-cloud-networking-FQfO8QWH.mjs +5 -0
- package/dist/magic-network-monitoring-CDd70fJQ.mjs +4 -0
- package/dist/magic-transit-DiKiPUax.mjs +110 -0
- package/dist/managed-transforms-fPVUTrAv.mjs +3 -0
- package/dist/matches-B0yHbQ2I.mjs +2 -0
- package/dist/moq-UgBawOXe.mjs +13 -0
- package/dist/mtls-certificates-xKUbC5EL.mjs +3 -0
- package/dist/network-interconnects-BJzOE2ny.mjs +41 -0
- package/dist/oauth-DBJ5GSFk.mjs +40 -0
- package/dist/observability-B-1y36QS.mjs +4 -0
- package/dist/organization-Dq3PClZ7.mjs +41 -0
- package/dist/organizations-AhsQkHyX.mjs +2 -0
- package/dist/origin-ca-certificates-CRgF0UyU.mjs +3 -0
- package/dist/origin-post-quantum-encryption-BXTx7DPa.mjs +2 -0
- package/dist/origin-tls-client-auth-BDw5q-6G.mjs +4 -0
- package/dist/{page-rules-EZHJePmn.mjs → page-rules-DqYQ23eg.mjs} +5 -5
- package/dist/{page-shield-CXJioWPs.mjs → page-shield-DKdlZOLO.mjs} +5 -5
- package/dist/pages-BsXF11Kv.mjs +11 -0
- package/dist/pay-per-crawl-BGAwuAP3.mjs +2 -0
- package/dist/pipelines-D_QhSnGW.mjs +6 -0
- package/dist/progress-O88q63Bk.mjs +2 -0
- package/dist/prompt-DTAWiEm2.mjs +3 -0
- package/dist/queries-CAE95-OH.mjs +3 -0
- package/dist/queues-BBz35Mqd.mjs +6 -0
- package/dist/r2-Zp99S5xF.mjs +21 -0
- package/dist/r2-data-catalog-BeVLZwrE.mjs +16 -0
- package/dist/radar-Cij-XVQJ.mjs +2 -0
- package/dist/rate-limit-analytics-CGviSPnJ.mjs +2 -0
- package/dist/rate-limits-DSdToIWv.mjs +5 -0
- package/dist/raw-fetch-DgezeshQ.mjs +2 -0
- package/dist/ready-DMpJvyaz.mjs +2 -0
- package/dist/realtime-kit-9rJcapfM.mjs +18 -0
- package/dist/recent-submissions-LS5IM-bm.mjs +2 -0
- package/dist/refute-BGTpr5sy.mjs +2 -0
- package/dist/registrar-CXViZlah.mjs +83 -0
- package/dist/registrar-sandbox-CvQyjXLJ.mjs +83 -0
- package/dist/request-tracers-DATfBnE9.mjs +2 -0
- package/dist/{resolve-C3h-mwp7.mjs → resolve-Bs2sMRYS.mjs} +1 -1
- package/dist/resource-sharing-Cmhn6ghR.mjs +3 -0
- package/dist/resource-tagging-BTn05AOj.mjs +16 -0
- package/dist/rules-ens3OHme.mjs +4 -0
- package/dist/rulesets-bkreZRao.mjs +8 -0
- package/dist/rum-CpgXFcwl.mjs +4 -0
- package/dist/scan-logo-DUDIZJ2A.mjs +2 -0
- package/dist/scan-page-BqoQTk3R.mjs +2 -0
- package/dist/{schema-BR31o4P6.mjs → schema-DCF4yEp_.mjs} +1 -1
- package/dist/schema-validation-Ca6o94ts.mjs +24 -0
- package/dist/scim-C4oT8TMc.mjs +4 -0
- package/dist/sdk-pQ5kaGUX.mjs +3 -0
- package/dist/search-C4T5riPh.mjs +2 -0
- package/dist/secrets-store-CWEuiDNo.mjs +7 -0
- package/dist/security-center-BOvm7xy6.mjs +2 -0
- package/dist/security-txt-BCAUBctN.mjs +3 -0
- package/dist/session-B1ARgLG7.mjs +2 -0
- package/dist/share-DhmVspmL.mjs +5 -0
- package/dist/shared-Bod3-Exx.mjs +990 -0
- package/dist/signed-url-DA509wgp.mjs +2 -0
- package/dist/smart-shield-DZm4fn6z.mjs +3 -0
- package/dist/snippets-oQ0u26-z.mjs +4 -0
- package/dist/{spawn-CCGzKlC4.mjs → spawn-ChG5Xi9Z.mjs} +1 -1
- package/dist/{spectrum-pVGxb7u5.mjs → spectrum-Cnkee5Ww.mjs} +6 -6
- package/dist/speed-DqNnvLBD.mjs +4 -0
- package/dist/{src-DU7FBCOX.mjs → src-By-zTCHz.mjs} +9 -9
- package/dist/ssl-tS3CYZsZ.mjs +15 -0
- package/dist/state-OsdDJvdj.mjs +2 -0
- package/dist/stream-Bud9Os5V.mjs +14 -0
- package/dist/submission-info-DfIXmu-M.mjs +2 -0
- package/dist/submit-BtP8she2.mjs +2 -0
- package/dist/tenant-CMwHa-tU.mjs +2 -0
- package/dist/token-validation-BYC7HTok.mjs +10 -0
- package/dist/{tools-D_hfUU_Z.mjs → tools-Dru4l8yh.mjs} +1 -1
- package/dist/total-queries-DdLBNJzd.mjs +2 -0
- package/dist/tracked-domains-BbaY-IuY.mjs +2 -0
- package/dist/turnstile-CP4nScaL.mjs +23 -0
- package/dist/{ui-erjBdVKL.mjs → ui-BNoF0KpD.mjs} +2 -2
- package/dist/url-info-Chs9h7Y-.mjs +2 -0
- package/dist/url-normalization-XYxW5Gj0.mjs +3 -0
- package/dist/url-scanner-D4pYNlO-.mjs +2 -0
- package/dist/user-DtefniLc.mjs +11 -0
- package/dist/vectorize-BeAY2g-7.mjs +4 -0
- package/dist/verify-D7J3F_NZ.mjs +2 -0
- package/dist/{versions-CBHwWPAM.mjs → versions-dMW3bLVv.mjs} +1 -1
- package/dist/waiting-rooms-K78HeeTg.mjs +11 -0
- package/dist/web3-Dhw79l4S.mjs +4 -0
- package/dist/workers-builds-CuOAB3u4.mjs +7 -0
- package/dist/workers-l3zMNOU6.mjs +20 -0
- package/dist/workflows-rb7RYBKP.mjs +6 -0
- package/dist/zaraz-CHecMYuo.mjs +2 -0
- package/dist/zero-trust-DAZoa-Aj.mjs +117 -0
- package/dist/zone-BnnqJwW-.mjs +2 -0
- package/dist/zones-DpI2YikF.mjs +21 -0
- package/package.json +3 -1
- package/dist/abuse-reports-Ina5TlsU.mjs +0 -8
- package/dist/accounts-B_joQcMi.mjs +0 -22
- package/dist/acm-_kIHqYME.mjs +0 -3
- package/dist/addressing-CaFlw8y1.mjs +0 -12
- package/dist/ai-CqnhNb_c.mjs +0 -2
- package/dist/ai-gateway-pgYGI519.mjs +0 -8
- package/dist/ai-search-eqQMPQol.mjs +0 -7
- package/dist/ai_gateway--vuVLnOm.mjs +0 -4
- package/dist/alerting-CPxHiYHb.mjs +0 -6
- package/dist/analytics_engine-gWyfnsCs.mjs +0 -2
- package/dist/api-gateway-BXXGFCVR.mjs +0 -33
- package/dist/argo-aC6A3JyX.mjs +0 -2
- package/dist/artifacts-HD4V2xpK.mjs +0 -4
- package/dist/auth-D5hNsOFq.mjs +0 -5
- package/dist/billing-COaghyxl.mjs +0 -2
- package/dist/bot-management-DmEzeV1Y.mjs +0 -5
- package/dist/botnet-feed-ByEAXAkw.mjs +0 -3
- package/dist/brand-protection-dPrGe8sL.mjs +0 -3
- package/dist/browser-rendering-BiSGnpBf.mjs +0 -4
- package/dist/build-HuS9-R0V.mjs +0 -1054
- package/dist/cache-CY-7Lt71.mjs +0 -5
- package/dist/calls-wOQGDWPl.mjs +0 -4
- package/dist/certificate-authorities-CtqzAtxQ.mjs +0 -2
- package/dist/client-certificates-CRf41xLe.mjs +0 -3
- package/dist/cloud-connector-BA5IRZUP.mjs +0 -2
- package/dist/cloudforce-one-Bq_qPAWs.mjs +0 -21
- package/dist/config-B5k-XbwS.mjs +0 -2
- package/dist/connectivity-Bx3MgTHX.mjs +0 -3
- package/dist/connector-interrupts-D7ylweJZ.mjs +0 -2
- package/dist/connector-telemetry-events-6izV1kbP.mjs +0 -2
- package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +0 -2
- package/dist/connectors-DRt4e6d_.mjs +0 -3
- package/dist/content-scanning-Cd2vy5Sz.mjs +0 -4
- package/dist/context-jpewmual.mjs +0 -2
- package/dist/custom-certificates-DYE-9epx.mjs +0 -5
- package/dist/custom-hostnames-CtuTdFcX.mjs +0 -5
- package/dist/custom-nameservers-CWqA51in.mjs +0 -3
- package/dist/custom-pages-DeUKEFGe.mjs +0 -4
- package/dist/d1-DvWY9Gp4.mjs +0 -4
- package/dist/data-security-BPo6dIWu.mjs +0 -6
- package/dist/diagnostics-6nKPmVgz.mjs +0 -3
- package/dist/dispatch-namespaces-64lXx2WJ.mjs +0 -7
- package/dist/dist-C6zxsVdY.mjs +0 -306
- package/dist/dist-t_YrL25p.mjs +0 -82
- package/dist/dns-ClciFGxx.mjs +0 -29
- package/dist/dns-firewall-DfUmXDCe.mjs +0 -57
- package/dist/durable-objects-CMaYZ-YU.mjs +0 -2
- package/dist/email-routing-CGXhFqF5.mjs +0 -10
- package/dist/email-security-D5viPq8S.mjs +0 -8
- package/dist/email-sending-C2jpc3gh.mjs +0 -3
- package/dist/filters-bzsFcWt0.mjs +0 -4
- package/dist/firewall-DYZcTtIC.mjs +0 -11
- package/dist/google-tag-gateway-Dfy887yA.mjs +0 -2
- package/dist/healthchecks-DRoAlWgr.mjs +0 -4
- package/dist/hostnames-CFgIVI3s.mjs +0 -3
- package/dist/hyperdrive-C7-gwTSV.mjs +0 -18
- package/dist/iam-DqVPzGrb.mjs +0 -6
- package/dist/images-BYfl4YgR.mjs +0 -7
- package/dist/intel-duTEPIHc.mjs +0 -3
- package/dist/keyless-certificates-CRCDVd3g.mjs +0 -3
- package/dist/kv-CZoV4tiv.mjs +0 -5
- package/dist/leaked-credential-checks-DNIBg7Pe.mjs +0 -3
- package/dist/load-balancers--OMg0HNt.mjs +0 -6
- package/dist/logpush-C0_lZTyY.mjs +0 -4
- package/dist/logs-BtpWZQfV.mjs +0 -3
- package/dist/magic-cloud-networking-u6rwYbGg.mjs +0 -5
- package/dist/magic-network-monitoring-CKgQyRj4.mjs +0 -4
- package/dist/magic-transit-CLhMcJ_-.mjs +0 -89
- package/dist/managed-transforms-D0Z2mlth.mjs +0 -3
- package/dist/mtls-certificates-BL65NK5T.mjs +0 -3
- package/dist/network-interconnects-Bgu9gmaG.mjs +0 -36
- package/dist/oauth-Bk-F-tIO.mjs +0 -52
- package/dist/observability-BynRbTF4.mjs +0 -4
- package/dist/organizations-BqJHyvMK.mjs +0 -41
- package/dist/origin-ca-certificates-BGvYwm3C.mjs +0 -3
- package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +0 -2
- package/dist/origin-tls-client-auth-d3snC3vr.mjs +0 -4
- package/dist/pages-D4aYteKk.mjs +0 -11
- package/dist/pipelines-G8Iusxq-.mjs +0 -6
- package/dist/progress-DrDErV9w.mjs +0 -2
- package/dist/queues-DEkbKqZX.mjs +0 -6
- package/dist/r2-CV0IkCAW.mjs +0 -21
- package/dist/r2-data-catalog-NtqGC_a_.mjs +0 -14
- package/dist/radar-D986zPJr.mjs +0 -2
- package/dist/rate-limits-B2wRsUX1.mjs +0 -5
- package/dist/raw-fetch-_n0lMAnD.mjs +0 -2
- package/dist/realtime-kit-Ld3c5eU6.mjs +0 -18
- package/dist/registrar-CDIwTz3G.mjs +0 -46
- package/dist/request-tracers-D7SFMDik.mjs +0 -2
- package/dist/resource-sharing-YIQ04jXE.mjs +0 -5
- package/dist/resource-tagging-Bd6Y03sg.mjs +0 -16
- package/dist/rules-DHjLP5Kx.mjs +0 -4
- package/dist/rulesets-q4QABpKs.mjs +0 -8
- package/dist/rum-SmT4HZmM.mjs +0 -4
- package/dist/schema-validation-vVetgC_P.mjs +0 -24
- package/dist/scim-ChOkZpNx.mjs +0 -3
- package/dist/sdk-DhIhH6GB.mjs +0 -5
- package/dist/secrets-store-BAK9G12O.mjs +0 -25
- package/dist/security-center-eScuYDKP.mjs +0 -2
- package/dist/security-txt-x7R4gmQu.mjs +0 -3
- package/dist/session-DHYCE-PM.mjs +0 -93
- package/dist/shared-BAjo72Lz.mjs +0 -2
- package/dist/smart-shield-CWlSsNi8.mjs +0 -3
- package/dist/snippets-DrlgYJYp.mjs +0 -4
- package/dist/speed-ZFrMWDgd.mjs +0 -4
- package/dist/ssl-9JY05sYt.mjs +0 -15
- package/dist/stream-tRU39b8K.mjs +0 -14
- package/dist/tenants-HLGUazms.mjs +0 -2
- package/dist/token-validation-_VdamKpz.mjs +0 -10
- package/dist/turnstile-BRzXd28B.mjs +0 -23
- package/dist/url-normalization-D-NxuLtN.mjs +0 -3
- package/dist/url-scanner-BzzR6iDx.mjs +0 -2
- package/dist/user-C4omq__w.mjs +0 -10
- package/dist/vectorize-By6EqcNR.mjs +0 -4
- package/dist/waiting-rooms-u6KwrzWd.mjs +0 -11
- package/dist/web3-DQ5dmE9W.mjs +0 -4
- package/dist/workers-D8Be7_as.mjs +0 -18
- package/dist/workers-builds-BE3W3qNk.mjs +0 -7
- package/dist/workflows-BWWufqFA.mjs +0 -4
- package/dist/zaraz-Bsa9AvVL.mjs +0 -2
- package/dist/zero-trust-UNVZFnKu.mjs +0 -118
- package/dist/zero_trust-B0_Rk4p2.mjs +0 -3
- package/dist/zones-BXtdwt6E.mjs +0 -21
- /package/dist/{body-parser-DWSy7uZ8.mjs → body-parser-BO6mfo_W.mjs} +0 -0
- /package/dist/{cli-types-BeyOc81z.mjs → cli-types-CFw6Xygp.mjs} +0 -0
- /package/dist/{input-validation-_fMCApaH.mjs → input-validation-BwUR9z8e.mjs} +0 -0
- /package/dist/{lib-4PQI6yRW.mjs → lib-Og5sB51C.mjs} +0 -0
- /package/dist/{local-CYc9q7l2.mjs → local-C6TLPAT6.mjs} +0 -0
- /package/dist/{metadata-OOwvpR8m.mjs → metadata-Cnyws6iO.mjs} +0 -0
- /package/dist/{open-YWOUIZ5Y-3jqSKAB1.mjs → open-YWOUIZ5Y-CFRcYALi.mjs} +0 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./chunk-DH-VkVmc.mjs";import*as t from"node:module";import{existsSync as n,readFileSync as r,statSync as i}from"node:fs";import a,{dirname as o,isAbsolute as s,join as c,resolve as l}from"node:path";import{fileURLToPath as u,pathToFileURL as d}from"node:url";import{AsyncLocalStorage as f}from"node:async_hooks";const p=Symbol.for(`@cloudflare/config:definition`);async function m(e,t){return typeof e==`function`?await e(t):await e}async function h(e,t){if(typeof e==`object`&&e&&p in e){let{config:n,type:r}=e[p];return{...await m(n,t),type:r}}return await m(e,t)}var g;const _=Object.freeze({status:`aborted`});function v(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var y=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},b=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(g=globalThis).__zod_globalConfig??(g.__zod_globalConfig={});const x=globalThis.__zod_globalConfig;function S(e){return e&&Object.assign(x,e),x}function ee(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function C(e,t){return typeof t==`bigint`?t.toString():t}function w(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function T(e){return e==null}function E(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function te(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const ne=Symbol(`evaluating`);function D(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ne)return r===void 0&&(r=ne,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function O(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function re(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function ie(e){return JSON.stringify(e)}function ae(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const oe=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function se(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const ce=w(()=>{if(x.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function le(e){if(se(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(se(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ue(e){return le(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const de=new Set([`string`,`number`,`symbol`]),fe=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function pe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function k(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function A(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw 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 me(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const he={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ge(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return k(e,re(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return O(this,`shape`,e),e},checks:[]}))}function _e(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return k(e,re(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return O(this,`shape`,r),r},checks:[]}))}function ve(e,t){if(!le(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return k(e,re(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return O(this,`shape`,n),n}}))}function ye(e,t){if(!le(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return k(e,re(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return O(this,`shape`,n),n}}))}function be(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return k(e,re(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return O(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function xe(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return k(t,re(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return O(this,`shape`,i),i},checks:[]}))}function Se(e,t,n){return k(t,re(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return O(this,`shape`,i),i}}))}function Ce(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 we(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 Te(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ee(e){return typeof e==`string`?e:e?.message}function j(e,t,n){let r=e.message?e.message:Ee(e.inst?._zod.def?.error?.(e))??Ee(t?.error?.(e))??Ee(n.customError?.(e))??Ee(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function De(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Oe(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const ke=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,C,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},Ae=v(`$ZodError`,ke),je=v(`$ZodError`,ke,{Parent:Error});function Me(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ne(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...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{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}const Pe=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new y;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>j(e,a,S())));throw oe(t,i?.callee),t}return o.value},Fe=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>j(e,a,S())));throw oe(t,i?.callee),t}return o.value},Ie=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new y;return a.issues.length?{success:!1,error:new(e??Ae)(a.issues.map(e=>j(e,i,S())))}:{success:!0,data:a.value}},Le=Ie(je),Re=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>j(e,i,S())))}:{success:!0,data:a.value}},ze=Re(je),Be=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Pe(e)(t,n,i)},Ve=e=>(t,n,r)=>Pe(e)(t,n,r),He=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Fe(e)(t,n,i)},Ue=e=>async(t,n,r)=>Fe(e)(t,n,r),We=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ie(e)(t,n,i)},Ge=e=>(t,n,r)=>Ie(e)(t,n,r),Ke=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Re(e)(t,n,i)},qe=e=>async(t,n,r)=>Re(e)(t,n,r),Je=/^[cC][0-9a-z]{6,}$/,Ye=/^[0-9a-z]+$/,Xe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ze=/^[0-9a-vA-V]{20}$/,Qe=/^[A-Za-z0-9]{27}$/,$e=/^[a-zA-Z0-9_-]{21}$/,et=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tt=/^([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})$/,nt=e=>e?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)$/,rt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function it(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const at=/^(?:(?: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])$/,ot=/^(([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}|:))$/,st=/^((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])$/,ct=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ut=/^[A-Za-z0-9_-]*$/,dt=/^https?$/,ft=/^\+[1-9]\d{6,14}$/,pt=`(?:(?:\\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])))`,mt=RegExp(`^${pt}$`);function ht(e){let 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}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function gt(e){return RegExp(`^${ht(e)}$`)}function _t(e){let t=ht({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${pt}T(?:${r})$`)}const vt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},yt=/^-?\d+$/,bt=/^-?\d+(?:\.\d+)?$/,xt=/^(?:true|false)$/i,St=/^null$/i,Ct=/^[^A-Z]*$/,wt=/^[^a-z]*$/,M=v(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Tt={number:`number`,bigint:`bigint`,object:`date`},Et=v(`$ZodCheckLessThan`,(e,t)=>{M.init(e,t);let n=Tt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin: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})}}),Dt=v(`$ZodCheckGreaterThan`,(e,t)=>{M.init(e,t);let n=Tt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin: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})}}),Ot=v(`$ZodCheckMultipleOf`,(e,t)=>{M.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):te(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})}}),kt=v(`$ZodCheckNumberFormat`,(e,t)=>{M.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=he[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=yt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),At=v(`$ZodCheckMaxLength`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!T(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=De(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jt=v(`$ZodCheckMinLength`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!T(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=De(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Mt=v(`$ZodCheckLengthEquals`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!T(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=De(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Nt=v(`$ZodCheckStringFormat`,(e,t)=>{var n,r;M.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Pt=v(`$ZodCheckRegex`,(e,t)=>{Nt.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})}}),Ft=v(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ct,Nt.init(e,t)}),It=v(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=wt,Nt.init(e,t)}),Lt=v(`$ZodCheckIncludes`,(e,t)=>{M.init(e,t);let n=pe(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Rt=v(`$ZodCheckStartsWith`,(e,t)=>{M.init(e,t);let n=RegExp(`^${pe(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),zt=v(`$ZodCheckEndsWith`,(e,t)=>{M.init(e,t);let n=RegExp(`.*${pe(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Bt=v(`$ZodCheckOverwrite`,(e,t)=>{M.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var Vt=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
4
|
+
`))}};const Ht={major:4,minor:4,patch:3},N=v(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ht;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Ce(e),i;for(let a of t){if(a._zod.def.when){if(we(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new y;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Ce(e,t))});else{if(e.issues.length===t)continue;r||=Ce(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Ce(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new y;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new y;return o.then(e=>t(e,r,a))}return t(o,r,a)}}D(e,`~standard`,()=>({validate:t=>{try{let n=Le(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ze(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Ut=v(`$ZodString`,(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??vt(e._zod.bag),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}}),P=v(`$ZodStringFormat`,(e,t)=>{Nt.init(e,t),Ut.init(e,t)}),Wt=v(`$ZodGUID`,(e,t)=>{t.pattern??=tt,P.init(e,t)}),Gt=v(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=nt(e)}else t.pattern??=nt();P.init(e,t)}),Kt=v(`$ZodEmail`,(e,t)=>{t.pattern??=rt,P.init(e,t)}),qt=v(`$ZodURL`,(e,t)=>{P.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===dt.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Jt=v(`$ZodEmoji`,(e,t)=>{t.pattern??=it(),P.init(e,t)}),Yt=v(`$ZodNanoID`,(e,t)=>{t.pattern??=$e,P.init(e,t)}),Xt=v(`$ZodCUID`,(e,t)=>{t.pattern??=Je,P.init(e,t)}),Zt=v(`$ZodCUID2`,(e,t)=>{t.pattern??=Ye,P.init(e,t)}),Qt=v(`$ZodULID`,(e,t)=>{t.pattern??=Xe,P.init(e,t)}),$t=v(`$ZodXID`,(e,t)=>{t.pattern??=Ze,P.init(e,t)}),en=v(`$ZodKSUID`,(e,t)=>{t.pattern??=Qe,P.init(e,t)}),tn=v(`$ZodISODateTime`,(e,t)=>{t.pattern??=_t(t),P.init(e,t)}),nn=v(`$ZodISODate`,(e,t)=>{t.pattern??=mt,P.init(e,t)}),rn=v(`$ZodISOTime`,(e,t)=>{t.pattern??=gt(t),P.init(e,t)}),an=v(`$ZodISODuration`,(e,t)=>{t.pattern??=et,P.init(e,t)}),on=v(`$ZodIPv4`,(e,t)=>{t.pattern??=at,P.init(e,t),e._zod.bag.format=`ipv4`}),sn=v(`$ZodIPv6`,(e,t)=>{t.pattern??=ot,P.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),cn=v(`$ZodCIDRv4`,(e,t)=>{t.pattern??=st,P.init(e,t)}),ln=v(`$ZodCIDRv6`,(e,t)=>{t.pattern??=ct,P.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function un(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const dn=v(`$ZodBase64`,(e,t)=>{t.pattern??=lt,P.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{un(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function fn(e){if(!ut.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return un(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const pn=v(`$ZodBase64URL`,(e,t)=>{t.pattern??=ut,P.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{fn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),mn=v(`$ZodE164`,(e,t)=>{t.pattern??=ft,P.init(e,t)});function hn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const gn=v(`$ZodJWT`,(e,t)=>{P.init(e,t),e._zod.check=n=>{hn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),_n=v(`$ZodNumber`,(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??bt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),vn=v(`$ZodNumberFormat`,(e,t)=>{kt.init(e,t),_n.init(e,t)}),yn=v(`$ZodBoolean`,(e,t)=>{N.init(e,t),e._zod.pattern=xt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),bn=v(`$ZodNull`,(e,t)=>{N.init(e,t),e._zod.pattern=St,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),xn=v(`$ZodUnknown`,(e,t)=>{N.init(e,t),e._zod.parse=e=>e}),Sn=v(`$ZodNever`,(e,t)=>{N.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Cn(e,t,n){e.issues.length&&t.issues.push(...Te(n,e.issues)),t.value[n]=e.value}const wn=v(`$ZodArray`,(e,t)=>{N.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Cn(t,n,e))):Cn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Tn(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Te(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function En(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=me(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Dn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Tn(e,n,i,t,u,d))):Tn(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const On=v(`$ZodObject`,(e,t)=>{if(N.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=w(()=>En(t));D(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=se,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Tn(n,t,e,s,r,i))):Tn(a,t,e,s,r,i)}return i?Dn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),kn=v(`$ZodObjectJIT`,(e,t)=>{On.init(e,t);let n=e._zod.parse,r=w(()=>En(t)),i=e=>{let t=new Vt([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=ie(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=ie(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
5
|
+
if (${n}.issues.length) {
|
|
6
|
+
if (${o} in input) {
|
|
7
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
8
|
+
...iss,
|
|
9
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
10
|
+
})));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (${n}.value === undefined) {
|
|
15
|
+
if (${o} in input) {
|
|
16
|
+
newResult[${o}] = undefined;
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
newResult[${o}] = ${n}.value;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
`):c?t.write(`
|
|
23
|
+
if (${n}.issues.length) {
|
|
24
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
25
|
+
...iss,
|
|
26
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
27
|
+
})));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (${n}.value === undefined) {
|
|
31
|
+
if (${o} in input) {
|
|
32
|
+
newResult[${o}] = undefined;
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
newResult[${o}] = ${n}.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
`):t.write(`
|
|
39
|
+
const ${n}_present = ${o} in input;
|
|
40
|
+
if (${n}.issues.length) {
|
|
41
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
42
|
+
...iss,
|
|
43
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
44
|
+
})));
|
|
45
|
+
}
|
|
46
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
47
|
+
payload.issues.push({
|
|
48
|
+
code: "invalid_type",
|
|
49
|
+
expected: "nonoptional",
|
|
50
|
+
input: undefined,
|
|
51
|
+
path: [${o}]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (${n}_present) {
|
|
56
|
+
if (${n}.value === undefined) {
|
|
57
|
+
newResult[${o}] = undefined;
|
|
58
|
+
} else {
|
|
59
|
+
newResult[${o}] = ${n}.value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=se,s=!x.jitless,c=s&&ce.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Dn([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function An(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Ce(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>j(e,r,S())))}),t)}const jn=v(`$ZodUnion`,(e,t)=>{N.init(e,t),D(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),D(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),D(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),D(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>E(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>An(t,r,e,i)):An(o,r,e,i)}}),Mn=v(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,jn.init(e,t);let n=e._zod.parse;D(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=w(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!se(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Nn=v(`$ZodIntersection`,(e,t)=>{N.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Fn(e,t,n)):Fn(e,i,a)}});function Pn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(le(e)&&le(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Pn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Pn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Fn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Ce(e))return e;let o=Pn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const In=v(`$ZodRecord`,(e,t)=>{N.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!le(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>j(e,r,S())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...Te(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...Te(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&bt.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>j(e,r,S())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Te(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Te(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Ln=v(`$ZodEnum`,(e,t)=>{N.init(e,t);let n=ee(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>de.has(typeof e)).map(e=>typeof e==`string`?pe(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Rn=v(`$ZodLiteral`,(e,t)=>{if(N.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?pe(e):e?pe(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),zn=v(`$ZodTransform`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new b(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new y;return n.value=i,n.fallback=!0,n}});function Bn(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Vn=v(`$ZodOptional`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,D(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),D(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${E(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Bn(e,r)):Bn(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Hn=v(`$ZodExactOptional`,(e,t)=>{Vn.init(e,t),D(e._zod,`values`,()=>t.innerType._zod.values),D(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Un=v(`$ZodNullable`,(e,t)=>{N.init(e,t),D(e._zod,`optin`,()=>t.innerType._zod.optin),D(e._zod,`optout`,()=>t.innerType._zod.optout),D(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${E(e.source)}|null)$`):void 0}),D(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Wn=v(`$ZodDefault`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,D(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Gn(e,t)):Gn(r,t)}});function Gn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Kn=v(`$ZodPrefault`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,D(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),qn=v(`$ZodNonOptional`,(e,t)=>{N.init(e,t),D(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Jn(t,e)):Jn(i,e)}});function Jn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Yn=v(`$ZodCatch`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,D(e._zod,`optout`,()=>t.innerType._zod.optout),D(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>j(e,n,S()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>j(e,n,S()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Xn=v(`$ZodPipe`,(e,t)=>{N.init(e,t),D(e._zod,`values`,()=>t.in._zod.values),D(e._zod,`optin`,()=>t.in._zod.optin),D(e._zod,`optout`,()=>t.out._zod.optout),D(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Zn(e,t.in,n)):Zn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Zn(e,t.out,n)):Zn(r,t.out,n)}});function Zn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Qn=v(`$ZodReadonly`,(e,t)=>{N.init(e,t),D(e._zod,`propValues`,()=>t.innerType._zod.propValues),D(e._zod,`values`,()=>t.innerType._zod.values),D(e._zod,`optin`,()=>t.innerType?._zod?.optin),D(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then($n):$n(r)}});function $n(e){return e.value=Object.freeze(e.value),e}const er=v(`$ZodTemplateLiteral`,(e,t)=>{N.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||fe.has(typeof e))n.push(pe(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),tr=v(`$ZodLazy`,(e,t)=>{N.init(e,t),D(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),D(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),D(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),D(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),D(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),nr=v(`$ZodCustom`,(e,t)=>{M.init(e,t),N.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>rr(t,n,r,e));rr(i,n,r,e)}});function rr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Oe(e))}}var ir,ar=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let 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){let 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){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let 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 or(){return new ar}(ir=globalThis).__zod_globalRegistry??(ir.__zod_globalRegistry=or());const sr=globalThis.__zod_globalRegistry;function cr(e,t){return new e({type:`string`,...A(t)})}function lr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...A(t)})}function ur(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...A(t)})}function dr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...A(t)})}function fr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...A(t)})}function pr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...A(t)})}function mr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...A(t)})}function hr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...A(t)})}function gr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...A(t)})}function _r(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...A(t)})}function vr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...A(t)})}function yr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...A(t)})}function br(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...A(t)})}function xr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...A(t)})}function Sr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...A(t)})}function Cr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...A(t)})}function wr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...A(t)})}function Tr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...A(t)})}function Er(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...A(t)})}function Dr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...A(t)})}function Or(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...A(t)})}function kr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...A(t)})}function Ar(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...A(t)})}function jr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...A(t)})}function Mr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...A(t)})}function Nr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...A(t)})}function Pr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...A(t)})}function Fr(e,t){return new e({type:`number`,checks:[],...A(t)})}function Ir(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...A(t)})}function Lr(e,t){return new e({type:`boolean`,...A(t)})}function Rr(e,t){return new e({type:`null`,...A(t)})}function zr(e){return new e({type:`unknown`})}function Br(e,t){return new e({type:`never`,...A(t)})}function Vr(e,t){return new Et({check:`less_than`,...A(t),value:e,inclusive:!1})}function Hr(e,t){return new Et({check:`less_than`,...A(t),value:e,inclusive:!0})}function Ur(e,t){return new Dt({check:`greater_than`,...A(t),value:e,inclusive:!1})}function Wr(e,t){return new Dt({check:`greater_than`,...A(t),value:e,inclusive:!0})}function Gr(e,t){return new Ot({check:`multiple_of`,...A(t),value:e})}function Kr(e,t){return new At({check:`max_length`,...A(t),maximum:e})}function qr(e,t){return new jt({check:`min_length`,...A(t),minimum:e})}function Jr(e,t){return new Mt({check:`length_equals`,...A(t),length:e})}function Yr(e,t){return new Pt({check:`string_format`,format:`regex`,...A(t),pattern:e})}function Xr(e){return new Ft({check:`string_format`,format:`lowercase`,...A(e)})}function Zr(e){return new It({check:`string_format`,format:`uppercase`,...A(e)})}function Qr(e,t){return new Lt({check:`string_format`,format:`includes`,...A(t),includes:e})}function $r(e,t){return new Rt({check:`string_format`,format:`starts_with`,...A(t),prefix:e})}function ei(e,t){return new zt({check:`string_format`,format:`ends_with`,...A(t),suffix:e})}function ti(e){return new Bt({check:`overwrite`,tx:e})}function ni(e){return ti(t=>t.normalize(e))}function ri(){return ti(e=>e.trim())}function ii(){return ti(e=>e.toLowerCase())}function ai(){return ti(e=>e.toUpperCase())}function oi(){return ti(e=>ae(e))}function si(e,t,n){return new e({type:`array`,element:t,...A(n)})}function ci(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...A(n)})}function li(e,t){let n=ui(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Oe(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Oe(r))}},e(t.value,t)),t);return n}function ui(e,t){let n=new M({check:`custom`,...A(t)});return n._zod.check=e,n}function di(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??sr,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function F(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,F(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&I(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 fi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
64
|
+
|
|
65
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function pi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:hi(t,`input`,e.processors),output:hi(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function I(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return I(r.element,n);if(r.type===`set`)return I(r.valueType,n);if(r.type===`lazy`)return I(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`)return I(r.innerType,n);if(r.type===`intersection`)return I(r.left,n)||I(r.right,n);if(r.type===`record`||r.type===`map`)return I(r.keyType,n)||I(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:I(r.in,n)||I(r.out,n);if(r.type===`object`){for(let e in r.shape)if(I(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(I(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(I(e,n))return!0;return!!(r.rest&&I(r.rest,n))}return!1}const mi=(e,t={})=>n=>{let r=di({...n,processors:t});return F(e,r),fi(r,e),pi(r,e)},hi=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=di({...i??{},target:a,io:t,processors:n});return F(e,o),fi(o,e),pi(o,e)},gi={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},_i=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=gi[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},vi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},yi=(e,t,n,r)=>{n.type=`boolean`},bi=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},xi=(e,t,n,r)=>{n.not={}},Si=(e,t,n,r)=>{let i=e._zod.def,a=ee(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Ci=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},wi=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Ti=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ei=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Di=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=F(a.element,t,{...r,path:[...r.path,`items`]})},Oi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=F(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=F(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ki=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>F(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ai=(e,t,n,r)=>{let i=e._zod.def,a=F(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=F(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},ji=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=F(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=F(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=F(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Mi=(e,t,n,r)=>{let i=e._zod.def,a=F(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ni=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Pi=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Fi=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ii=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Li=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;F(o,t,r);let s=t.seen.get(e);s.ref=o},Ri=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},zi=(e,t,n,r)=>{let i=e._zod.def;F(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Bi=(e,t,n,r)=>{let i=e._zod.innerType;F(i,t,r);let a=t.seen.get(e);a.ref=i},Vi=v(`ZodISODateTime`,(e,t)=>{tn.init(e,t),B.init(e,t)});function Hi(e){return jr(Vi,e)}const Ui=v(`ZodISODate`,(e,t)=>{nn.init(e,t),B.init(e,t)});function Wi(e){return Mr(Ui,e)}const Gi=v(`ZodISOTime`,(e,t)=>{rn.init(e,t),B.init(e,t)});function Ki(e){return Nr(Gi,e)}const qi=v(`ZodISODuration`,(e,t)=>{an.init(e,t),B.init(e,t)});function Ji(e){return Pr(qi,e)}const L=v(`ZodError`,(e,t)=>{Ae.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ne(e,t)},flatten:{value:t=>Me(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,C,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,C,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Yi=Pe(L),Xi=Fe(L),Zi=Ie(L),Qi=Re(L),$i=Be(L),ea=Ve(L),ta=He(L),na=Ue(L),ra=We(L),ia=Ge(L),aa=Ke(L),oa=qe(L),sa=new WeakMap;function ca(e,t,n){let r=Object.getPrototypeOf(e),i=sa.get(r);if(i||(i=new Set,sa.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const R=v(`ZodType`,(e,t)=>(N.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:hi(e,`input`),output:hi(e,`output`)}}),e.toJSONSchema=mi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>Yi(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Zi(e,t,n),e.parseAsync=async(t,n)=>Xi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Qi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>$i(e,t,n),e.decode=(t,n)=>ea(e,t,n),e.encodeAsync=async(t,n)=>ta(e,t,n),e.decodeAsync=async(t,n)=>na(e,t,n),e.safeEncode=(t,n)=>ra(e,t,n),e.safeDecode=(t,n)=>ia(e,t,n),e.safeEncodeAsync=async(t,n)=>aa(e,t,n),e.safeDecodeAsync=async(t,n)=>oa(e,t,n),ca(e,`ZodType`,{check(...e){let t=this.def;return this.clone(re(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return k(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(wo(e,t))},superRefine(e,t){return this.check(To(e,t))},overwrite(e){return this.check(ti(e))},optional(){return to(this)},exactOptional(){return ro(this)},nullable(){return ao(this)},nullish(){return to(ao(this))},nonoptional(e){return fo(this,e)},array(){return U(this)},or(e){return G([this,e])},and(e){return Ja(this,e)},transform(e){return go(this,$a(e))},default(e){return so(this,e)},prefault(e){return lo(this,e)},catch(e){return mo(this,e)},pipe(e){return go(this,e)},readonly(){return vo(this)},describe(e){let t=this.clone();return sr.add(t,{description:e}),t},meta(...e){if(e.length===0)return sr.get(this);let t=this.clone();return sr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return sr.get(e)?.description},configurable:!0}),e)),la=v(`_ZodString`,(e,t)=>{Ut.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ca(e,`_ZodString`,{regex(...e){return this.check(Yr(...e))},includes(...e){return this.check(Qr(...e))},startsWith(...e){return this.check($r(...e))},endsWith(...e){return this.check(ei(...e))},min(...e){return this.check(qr(...e))},max(...e){return this.check(Kr(...e))},length(...e){return this.check(Jr(...e))},nonempty(...e){return this.check(qr(1,...e))},lowercase(e){return this.check(Xr(e))},uppercase(e){return this.check(Zr(e))},trim(){return this.check(ri())},normalize(...e){return this.check(ni(...e))},toLowerCase(){return this.check(ii())},toUpperCase(){return this.check(ai())},slugify(){return this.check(oi())}})}),ua=v(`ZodString`,(e,t)=>{Ut.init(e,t),la.init(e,t),e.email=t=>e.check(lr(da,t)),e.url=t=>e.check(hr(ma,t)),e.jwt=t=>e.check(Ar(ka,t)),e.emoji=t=>e.check(gr(ha,t)),e.guid=t=>e.check(ur(fa,t)),e.uuid=t=>e.check(dr(pa,t)),e.uuidv4=t=>e.check(fr(pa,t)),e.uuidv6=t=>e.check(pr(pa,t)),e.uuidv7=t=>e.check(mr(pa,t)),e.nanoid=t=>e.check(_r(ga,t)),e.guid=t=>e.check(ur(fa,t)),e.cuid=t=>e.check(vr(_a,t)),e.cuid2=t=>e.check(yr(va,t)),e.ulid=t=>e.check(br(ya,t)),e.base64=t=>e.check(Dr(Ea,t)),e.base64url=t=>e.check(Or(Da,t)),e.xid=t=>e.check(xr(ba,t)),e.ksuid=t=>e.check(Sr(xa,t)),e.ipv4=t=>e.check(Cr(Sa,t)),e.ipv6=t=>e.check(wr(Ca,t)),e.cidrv4=t=>e.check(Tr(wa,t)),e.cidrv6=t=>e.check(Er(Ta,t)),e.e164=t=>e.check(kr(Oa,t)),e.datetime=t=>e.check(Hi(t)),e.date=t=>e.check(Wi(t)),e.time=t=>e.check(Ki(t)),e.duration=t=>e.check(Ji(t))});function z(e){return cr(ua,e)}const B=v(`ZodStringFormat`,(e,t)=>{P.init(e,t),la.init(e,t)}),da=v(`ZodEmail`,(e,t)=>{Kt.init(e,t),B.init(e,t)}),fa=v(`ZodGUID`,(e,t)=>{Wt.init(e,t),B.init(e,t)}),pa=v(`ZodUUID`,(e,t)=>{Gt.init(e,t),B.init(e,t)}),ma=v(`ZodURL`,(e,t)=>{qt.init(e,t),B.init(e,t)}),ha=v(`ZodEmoji`,(e,t)=>{Jt.init(e,t),B.init(e,t)}),ga=v(`ZodNanoID`,(e,t)=>{Yt.init(e,t),B.init(e,t)}),_a=v(`ZodCUID`,(e,t)=>{Xt.init(e,t),B.init(e,t)}),va=v(`ZodCUID2`,(e,t)=>{Zt.init(e,t),B.init(e,t)}),ya=v(`ZodULID`,(e,t)=>{Qt.init(e,t),B.init(e,t)}),ba=v(`ZodXID`,(e,t)=>{$t.init(e,t),B.init(e,t)}),xa=v(`ZodKSUID`,(e,t)=>{en.init(e,t),B.init(e,t)}),Sa=v(`ZodIPv4`,(e,t)=>{on.init(e,t),B.init(e,t)}),Ca=v(`ZodIPv6`,(e,t)=>{sn.init(e,t),B.init(e,t)}),wa=v(`ZodCIDRv4`,(e,t)=>{cn.init(e,t),B.init(e,t)}),Ta=v(`ZodCIDRv6`,(e,t)=>{ln.init(e,t),B.init(e,t)}),Ea=v(`ZodBase64`,(e,t)=>{dn.init(e,t),B.init(e,t)}),Da=v(`ZodBase64URL`,(e,t)=>{pn.init(e,t),B.init(e,t)}),Oa=v(`ZodE164`,(e,t)=>{mn.init(e,t),B.init(e,t)}),ka=v(`ZodJWT`,(e,t)=>{gn.init(e,t),B.init(e,t)}),Aa=v(`ZodNumber`,(e,t)=>{_n.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),ca(e,`ZodNumber`,{gt(e,t){return this.check(Ur(e,t))},gte(e,t){return this.check(Wr(e,t))},min(e,t){return this.check(Wr(e,t))},lt(e,t){return this.check(Vr(e,t))},lte(e,t){return this.check(Hr(e,t))},max(e,t){return this.check(Hr(e,t))},int(e){return this.check(Ma(e))},safe(e){return this.check(Ma(e))},positive(e){return this.check(Ur(0,e))},nonnegative(e){return this.check(Wr(0,e))},negative(e){return this.check(Vr(0,e))},nonpositive(e){return this.check(Hr(0,e))},multipleOf(e,t){return this.check(Gr(e,t))},step(e,t){return this.check(Gr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function V(e){return Fr(Aa,e)}const ja=v(`ZodNumberFormat`,(e,t)=>{vn.init(e,t),Aa.init(e,t)});function Ma(e){return Ir(ja,e)}const Na=v(`ZodBoolean`,(e,t)=>{yn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r)});function H(e){return Lr(Na,e)}const Pa=v(`ZodNull`,(e,t)=>{bn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r)});function Fa(e){return Rr(Pa,e)}const Ia=v(`ZodUnknown`,(e,t)=>{xn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function La(){return zr(Ia)}const Ra=v(`ZodNever`,(e,t)=>{Sn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r)});function za(e){return Br(Ra,e)}const Ba=v(`ZodArray`,(e,t)=>{wn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e.element=t.element,ca(e,`ZodArray`,{min(e,t){return this.check(qr(e,t))},nonempty(e){return this.check(qr(1,e))},max(e,t){return this.check(Kr(e,t))},length(e,t){return this.check(Jr(e,t))},unwrap(){return this.element}})});function U(e,t){return si(Ba,e,t)}const Va=v(`ZodObject`,(e,t)=>{kn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),D(e,`shape`,()=>t.shape),ca(e,`ZodObject`,{keyof(){return q(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:La()})},loose(){return this.clone({...this._zod.def,catchall:La()})},strict(){return this.clone({...this._zod.def,catchall:za()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ve(this,e)},safeExtend(e){return ye(this,e)},merge(e){return be(this,e)},pick(e){return ge(this,e)},omit(e){return _e(this,e)},partial(...e){return xe(eo,this,e[0])},required(...e){return Se(uo,this,e[0])}})});function Ha(e,t){return new Va({type:`object`,shape:e??{},...A(t)})}function W(e,t){return new Va({type:`object`,shape:e,catchall:za(),...A(t)})}function Ua(e,t){return new Va({type:`object`,shape:e,catchall:La(),...A(t)})}const Wa=v(`ZodUnion`,(e,t)=>{jn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.options=t.options});function G(e,t){return new Wa({type:`union`,options:e,...A(t)})}const Ga=v(`ZodDiscriminatedUnion`,(e,t)=>{Wa.init(e,t),Mn.init(e,t)});function Ka(e,t,n){return new Ga({type:`union`,options:t,discriminator:e,...A(n)})}const qa=v(`ZodIntersection`,(e,t)=>{Nn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r)});function Ja(e,t){return new qa({type:`intersection`,left:e,right:t})}const Ya=v(`ZodRecord`,(e,t)=>{In.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function K(e,t,n){return!t||!t._zod?new Ya({type:`record`,keyType:z(),valueType:e,...A(t)}):new Ya({type:`record`,keyType:e,valueType:t,...A(n)})}const Xa=v(`ZodEnum`,(e,t)=>{Ln.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Xa({...t,checks:[],...A(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Xa({...t,checks:[],...A(r),entries:i})}});function q(e,t){return new Xa({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...A(t)})}const Za=v(`ZodLiteral`,(e,t)=>{Rn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function J(e,t){return new Za({type:`literal`,values:Array.isArray(e)?e:[e],...A(t)})}const Qa=v(`ZodTransform`,(e,t)=>{zn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new b(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Oe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Oe(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function $a(e){return new Qa({type:`transform`,transform:e})}const eo=v(`ZodOptional`,(e,t)=>{Vn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function to(e){return new eo({type:`optional`,innerType:e})}const no=v(`ZodExactOptional`,(e,t)=>{Hn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ro(e){return new no({type:`optional`,innerType:e})}const io=v(`ZodNullable`,(e,t)=>{Un.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ao(e){return new io({type:`nullable`,innerType:e})}const oo=v(`ZodDefault`,(e,t)=>{Wn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function so(e,t){return new oo({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ue(t)}})}const co=v(`ZodPrefault`,(e,t)=>{Kn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lo(e,t){return new co({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ue(t)}})}const uo=v(`ZodNonOptional`,(e,t)=>{qn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fo(e,t){return new uo({type:`nonoptional`,innerType:e,...A(t)})}const po=v(`ZodCatch`,(e,t)=>{Yn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function mo(e,t){return new po({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const ho=v(`ZodPipe`,(e,t)=>{Xn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r),e.in=t.in,e.out=t.out});function go(e,t){return new ho({type:`pipe`,in:e,out:t})}const _o=v(`ZodReadonly`,(e,t)=>{Qn.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vo(e){return new _o({type:`readonly`,innerType:e})}const yo=v(`ZodTemplateLiteral`,(e,t)=>{er.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r)});function bo(e,t){return new yo({type:`template_literal`,parts:e,...A(t)})}const xo=v(`ZodLazy`,(e,t)=>{tr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function So(e){return new xo({type:`lazy`,getter:e})}const Co=v(`ZodCustom`,(e,t)=>{nr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r)});function wo(e,t={}){return ci(Co,e,t)}function To(e,t){return li(e,t)}function Eo(e){let t=So(()=>G([z(e),V(),H(),Fa(),U(t),K(z(),t)]));return t}var Do=e({ConfigExportsSchema:()=>Zo,InputWorkerSchema:()=>qo,ModuleTypeSchema:()=>Qo,OutputWorkerSchema:()=>es,SettingsSchema:()=>Jo,convertToWranglerConfig:()=>Wc,loadAndValidateConfig:()=>dl,loadConfig:()=>al,registerConfigHooks:()=>sl,resolveExportDefinition:()=>h}),Oo=Object.getOwnPropertyNames,ko=(e,t)=>function(){return t||(0,e[Oo(e)[0]])((t={exports:{}}).exports,t),t.exports};const Ao=W({htmlHandling:q([`auto-trailing-slash`,`drop-trailing-slash`,`force-trailing-slash`,`none`]).optional(),notFoundHandling:q([`single-page-application`,`404-page`,`none`]).optional(),runWorkerFirst:G([U(z()),H()]).optional()}),jo=Ka(`type`,[W({type:J(`agent-memory`),namespace:z(),remote:H().optional()}),W({type:J(`ai`),remote:H().optional()}),W({type:J(`ai-search`),name:z(),remote:H().optional()}),W({type:J(`ai-search-namespace`),namespace:z(),remote:H().optional()}),W({type:J(`analytics-engine-dataset`),name:z().optional()}),W({type:J(`artifacts`),namespace:z(),remote:H().optional()}),W({type:J(`assets`)}),W({type:J(`browser`),remote:H().optional()}),W({type:J(`d1`),name:z().optional(),id:z().optional(),remote:H().optional()}),W({type:J(`dispatch-namespace`),namespace:z().optional(),outbound:W({workerName:z(),parameters:U(z()).optional()}).optional(),remote:H().optional()}),W({type:J(`durable-object`),workerName:z(),exportName:z()}),W({type:J(`flagship`),id:z().optional(),remote:H().optional()}),W({type:J(`hyperdrive`),id:z(),localConnectionString:z().optional()}),W({type:J(`images`),remote:H().optional()}),W({type:J(`json`),value:Eo()}),W({type:J(`kv`),id:z().optional(),remote:H().optional()}),W({type:J(`logfwdr`),destination:z()}),W({type:J(`media`),remote:H().optional()}),W({type:J(`mtls-certificate`),id:z(),remote:H().optional()}),W({type:J(`pipeline`),name:z(),remote:H().optional()}),W({type:J(`queue`),name:z().optional(),deliveryDelay:V().optional(),remote:H().optional()}),W({type:J(`rate-limit`),namespace:z(),simple:W({limit:V(),period:G([J(10),J(60)])})}),W({type:J(`r2`),name:z().optional(),jurisdiction:z().optional(),remote:H().optional()}),W({type:J(`secret`)}),W({type:J(`secrets-store-secret`),storeId:z(),secretName:z()}),W({type:J(`send-email`),destinationAddress:z().optional(),allowedDestinationAddresses:U(z()).optional(),allowedSenderAddresses:U(z()).optional(),remote:H().optional()}),W({type:J(`stream`),remote:H().optional()}),W({type:J(`text`),value:z()}),W({type:J(`vectorize`),name:z(),remote:H().optional()}),W({type:J(`version-metadata`)}),W({type:J(`vpc-service`),id:z(),remote:H().optional()}),W({type:J(`vpc-network`),tunnelId:z().optional(),networkId:z().optional(),remote:H().optional()}).superRefine((e,t)=>{let n=e.tunnelId!==void 0;n===(e.networkId!==void 0)&&t.addIssue({code:`custom`,message:n?`"vpc-network" bindings must specify exactly one of "tunnelId" or "networkId", not both`:`"vpc-network" bindings must specify either "tunnelId" or "networkId"`})}),W({type:J(`web-search`),remote:H().optional()}),W({type:J(`worker`),workerName:z(),exportName:z().optional(),props:K(z(),La()).optional(),remote:H().optional()}),W({type:J(`worker-loader`)})]),Mo=Ua({type:bo([`unsafe:`,z().min(1)]),dev:W({plugin:W({package:z(),name:z()}),options:K(z(),La()).optional()}).optional()}),No=La().transform((e,t)=>{let n=(typeof e==`object`&&e&&`type`in e&&typeof e.type==`string`&&e.type.startsWith(`unsafe:`)?Mo:jo).safeParse(e);return n.success?n.data:(t.issues.push(...n.error.issues),_)});function Po(e){return e.type.startsWith(`unsafe:`)}const Fo=W({enabled:H(),crossVersionCache:H().optional()}),Io=new Set([`ai`,`assets`,`browser`,`images`,`media`,`stream`,`version-metadata`,`web-search`]),Lo=new Intl.ListFormat(`en-US`),Ro=K(z(),No).superRefine((e,t)=>{let n=new Set,r=new Set;for(let t of Object.values(e)){let e=t.type;Io.has(e)&&(n.has(e)&&r.add(e),n.add(e))}r.size>0&&t.addIssue({code:`custom`,message:`${Lo.format([...r].sort())} bindings can only be defined once`})}).optional(),zo=G([W({type:J(`durable-object`),state:J(`created`).optional(),storage:q([`sqlite`,`legacy-kv`])}),W({type:J(`durable-object`),state:J(`deleted`)}),W({type:J(`durable-object`),state:J(`renamed`),renamedTo:z()}),W({type:J(`durable-object`),state:J(`transferred`),transferredTo:z()}),W({type:J(`durable-object`),state:J(`expecting-transfer`),storage:q([`sqlite`,`legacy-kv`]),transferFrom:z()}),W({type:J(`worker`),cache:W({enabled:H()}).optional()})]),Bo=W({cpuMs:V().optional(),subrequests:V().optional()}),Vo=W({enabled:H().optional(),headSamplingRate:V().optional(),logs:W({enabled:H().optional(),headSamplingRate:V().optional(),invocationLogs:H().optional(),persist:H().optional(),destinations:U(z()).optional()}).optional(),traces:W({enabled:H().optional(),headSamplingRate:V().optional(),persist:H().optional(),destinations:U(z()).optional()}).optional()}),Ho=G([W({mode:q([`off`,`smart`]),hint:z().optional()}),W({mode:J(`targeted`).optional(),region:z()}),W({mode:J(`targeted`).optional(),host:z()}),W({mode:J(`targeted`).optional(),hostname:z()})]),Uo=W({workerName:z(),streaming:H().optional()}),Wo=Ka(`type`,[W({type:J(`email`),addresses:U(z())}),W({type:J(`fetch`),pattern:z(),zone:z().optional()}),W({type:J(`queue`),name:z(),deadLetterQueue:z().optional(),maxBatchSize:V().optional(),maxBatchTimeout:V().optional(),maxConcurrency:V().nullable().optional(),maxRetries:V().optional(),retryDelay:V().optional(),visibilityTimeoutMs:V().optional()}),W({type:J(`scheduled`),schedule:z()})]),Go=W({metadata:K(z(),La()).optional(),capnp:G([W({basePath:z(),sourceSchemas:U(z()),compiledSchema:za().optional()}),W({basePath:za().optional(),sourceSchemas:za().optional(),compiledSchema:z()})]).optional()}),Ko=W({type:J(`worker`),name:z(),compatibilityDate:z(),compatibilityFlags:U(z()).optional(),assets:Ao.optional(),domains:U(z()).optional(),triggers:U(Wo).optional(),tailConsumers:U(Uo).optional(),cache:Fo.optional(),placement:Ho.optional(),limits:Bo.optional(),logpush:H().optional(),observability:Vo.optional(),workersDev:H().optional(),previewUrls:H().optional(),firstPartyWorker:H().optional(),unsafe:Go.optional(),env:Ro,exports:K(z(),zo).optional()}),qo=Ko.extend({entrypoint:G([z(),W({default:z()})]).transform(e=>typeof e==`string`?e:e.default).optional()}),Jo=W({type:J(`settings`),accountId:z().optional(),complianceRegion:q([`public`,`fedramp-high`]).optional()}),Yo=Ka(`type`,[qo,Jo]),Xo=`settings`,Zo=K(z(),Yo).check(e=>{for(let[t,n]of Object.entries(e.value)){let r=t===Xo,i=n.type===`settings`;i&&!r?e.issues.push({code:`custom`,input:n,path:[t],message:`A \`settings\` config is only allowed on the \`${Xo}\` export; found one on the \`${t}\` export.`}):r&&!i&&e.issues.push({code:`custom`,input:n,path:[t],message:`The \`${Xo}\` export is reserved for a \`settings\` config; found a \`${n.type}\` config.`})}}),Qo=q([`esm`,`cjs`,`python`,`python-requirement`,`wasm`,`text`,`data`,`json`,`sourcemap`]),$o=W({mainModule:z(),modules:K(z(),W({type:Qo}))}),es=Ko.extend({manifest:$o.optional()});ko({"../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/dist/index.js":(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dedent=void 0;function t(e){var t=[...arguments].slice(1),n=Array.from(typeof e==`string`?[e]:e);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,``);var r=n.reduce(function(e,t){var n=t.match(/\n([\t ]+|(?!\s).)/g);return n?e.concat(n.map(function(e){return e.match(/[\t ]/g)?.length??0})):e},[]);if(r.length){var i=RegExp(`
|
|
66
|
+
[ ]{`+Math.min.apply(Math,r)+`}`,`g`);n=n.map(function(e){return e.replace(i,`
|
|
67
|
+
`)})}n[0]=n[0].replace(/^\r?\n/,``);var a=n[0];return t.forEach(function(e,t){var r=a.match(/(?:^|\n)( *)$/),i=r?r[1]:``,o=e;typeof e==`string`&&e.includes(`
|
|
68
|
+
`)&&(o=String(e).split(`
|
|
69
|
+
`).map(function(e,t){return t===0?e:``+i+e}).join(`
|
|
70
|
+
`)),a+=o+n[t+1]}),a}e.dedent=t})})();var ts=Object.defineProperty,Y=(e,t)=>ts(e,`name`,{value:t,configurable:!0});function ns(e){let t={"durable-object":{},worker:{}};if(e===void 0)return t;for(let[n,r]of Object.entries(e))t[r.type][n]=r;return t}Y(ns,`partitionExports`);var X=class extends Error{static{Y(this,`UserError`)}telemetryMessage;constructor(e,t){super(e,t),Object.setPrototypeOf(this,new.target.prototype),this.telemetryMessage=typeof t?.telemetryMessage==`string`?t.telemetryMessage:t?.telemetryMessage?e:void 0}};(class extends X{static{Y(this,`DeprecationError`)}constructor(e,t){super(`Deprecation:
|
|
71
|
+
${e}`,t)}});var rs=class extends X{static{Y(this,`FatalError`)}code;constructor(e,t){super(e,t),this.code=t.code}};(class extends X{static{Y(this,`CommandLineArgsError`)}});var is=class extends rs{static{Y(this,`JsonFriendlyFatalError`)}};(class extends Error{static{Y(this,`MissingConfigError`)}telemetryMessage;constructor(e){super(`Missing config value for ${e}`),this.telemetryMessage=`Missing config value for ${e}`}});function as(e,t,n){return t?new is(JSON.stringify(e),n):new rs(`${e}`,n)}Y(as,`createFatalError`);function os(e,t=!1){let n=e.length,r=0,i=``,a=0,o=16,s=0,c=0,l=0,u=0,d=0;function f(t,n){let i=0,a=0;for(;i<t||!n;){let t=e.charCodeAt(r);if(t>=48&&t<=57)a=a*16+t-48;else if(t>=65&&t<=70)a=a*16+t-65+10;else if(t>=97&&t<=102)a=a*16+t-97+10;else break;r++,i++}return i<t&&(a=-1),a}Y(f,`scanHexDigits`);function p(e){r=e,i=``,a=0,o=16,d=0}Y(p,`setPosition`);function m(){let t=r;if(e.charCodeAt(r)===48)r++;else for(r++;r<e.length&&ls(e.charCodeAt(r));)r++;if(r<e.length&&e.charCodeAt(r)===46)if(r++,r<e.length&&ls(e.charCodeAt(r)))for(r++;r<e.length&&ls(e.charCodeAt(r));)r++;else return d=3,e.substring(t,r);let n=r;if(r<e.length&&(e.charCodeAt(r)===69||e.charCodeAt(r)===101))if(r++,(r<e.length&&e.charCodeAt(r)===43||e.charCodeAt(r)===45)&&r++,r<e.length&&ls(e.charCodeAt(r))){for(r++;r<e.length&&ls(e.charCodeAt(r));)r++;n=r}else d=3;return e.substring(t,n)}Y(m,`scanNumber`);function h(){let t=``,i=r;for(;;){if(r>=n){t+=e.substring(i,r),d=2;break}let a=e.charCodeAt(r);if(a===34){t+=e.substring(i,r),r++;break}if(a===92){if(t+=e.substring(i,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+=`"`;break;case 92:t+=`\\`;break;case 47:t+=`/`;break;case 98:t+=`\b`;break;case 102:t+=`\f`;break;case 110:t+=`
|
|
72
|
+
`;break;case 114:t+=`\r`;break;case 116:t+=` `;break;case 117:let e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}i=r;continue}if(a>=0&&a<=31)if(cs(a)){t+=e.substring(i,r),d=2;break}else d=6;r++}return t}Y(h,`scanString`);function g(){if(i=``,d=0,a=r,c=s,u=l,r>=n)return a=n,o=17;let t=e.charCodeAt(r);if(ss(t)){do r++,i+=String.fromCharCode(t),t=e.charCodeAt(r);while(ss(t));return o=15}if(cs(t))return r++,i+=String.fromCharCode(t),t===13&&e.charCodeAt(r)===10&&(r++,i+=`
|
|
73
|
+
`),s++,l=r,o=14;switch(t){case 123:return r++,o=1;case 125:return r++,o=2;case 91:return r++,o=3;case 93:return r++,o=4;case 58:return r++,o=6;case 44:return r++,o=5;case 34:return r++,i=h(),o=10;case 47:let c=r-1;if(e.charCodeAt(r+1)===47){for(r+=2;r<n&&!cs(e.charCodeAt(r));)r++;return i=e.substring(c,r),o=12}if(e.charCodeAt(r+1)===42){r+=2;let t=n-1,a=!1;for(;r<t;){let t=e.charCodeAt(r);if(t===42&&e.charCodeAt(r+1)===47){r+=2,a=!0;break}r++,cs(t)&&(t===13&&e.charCodeAt(r)===10&&r++,s++,l=r)}return a||(r++,d=1),i=e.substring(c,r),o=13}return i+=String.fromCharCode(t),r++,o=16;case 45:if(i+=String.fromCharCode(t),r++,r===n||!ls(e.charCodeAt(r)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return i+=m(),o=11;default:for(;r<n&&_(t);)r++,t=e.charCodeAt(r);if(a!==r){switch(i=e.substring(a,r),i){case`true`:return o=8;case`false`:return o=9;case`null`:return o=7}return o=16}return i+=String.fromCharCode(t),r++,o=16}}Y(g,`scanNext`);function _(e){if(ss(e)||cs(e))return!1;switch(e){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}Y(_,`isUnknownContentCharacter`);function v(){let e;do e=g();while(e>=12&&e<=15);return e}return Y(v,`scanNextNonTrivia`),{setPosition:p,getPosition:Y(()=>r,`getPosition`),scan:t?v:g,getToken:Y(()=>o,`getToken`),getTokenValue:Y(()=>i,`getTokenValue`),getTokenOffset:Y(()=>a,`getTokenOffset`),getTokenLength:Y(()=>r-a,`getTokenLength`),getTokenStartLine:Y(()=>c,`getTokenStartLine`),getTokenStartCharacter:Y(()=>a-u,`getTokenStartCharacter`),getTokenError:Y(()=>d,`getTokenError`)}}Y(os,`createScanner`);function ss(e){return e===32||e===9}Y(ss,`isWhiteSpace`);function cs(e){return e===10||e===13}Y(cs,`isLineBreak`);function ls(e){return e>=48&&e<=57}Y(ls,`isDigit`);var us;(function(e){e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.space=32]=`space`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.asterisk=42]=`asterisk`,e[e.backslash=92]=`backslash`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.plus=43]=`plus`,e[e.slash=47]=`slash`,e[e.formFeed=12]=`formFeed`,e[e.tab=9]=`tab`})(us||={});function ds(e,t,n){let r,i,a,o,s;if(t){for(o=t.offset,s=o+t.length,a=o;a>0&&!hs(e,a-1);)a--;let c=s;for(;c<e.length&&!hs(e,c);)c++;i=e.substring(a,c),r=ps(i,n)}else i=e,r=0,a=0,o=0,s=e.length;let c=ms(n,e),l=0,u=0,d;d=n.insertSpaces?fs(` `,n.tabSize||4):` `;let f=os(i,!1),p=!1;function m(){return l>1?fs(c,l)+fs(d,r+u):c+fs(d,r+u)}Y(m,`newLinesAndIndent`);function h(){let e=f.scan();for(l=0;e===15||e===14;)e===14&&n.keepLines?l+=1:e===14&&(l=1),e=f.scan();return p=e===16||f.getTokenError()!==0,e}Y(h,`scanNext`);let g=[];function _(n,r,i){!p&&(!t||r<s&&i>o)&&e.substring(r,i)!==n&&g.push({offset:r,length:i-r,content:n})}Y(_,`addEdit`);let v=h();if(n.keepLines&&l>0&&_(fs(c,l),0,0),v!==17){let e=f.getTokenOffset()+a;_(fs(d,r),a,e)}for(;v!==17;){let e=f.getTokenOffset()+f.getTokenLength()+a,t=h(),r=``,i=!1;for(;l===0&&(t===12||t===13);){let n=f.getTokenOffset()+a;_(` `,e,n),e=f.getTokenOffset()+f.getTokenLength()+a,i=t===12,r=i?m():``,t=h()}if(t===2)v!==1&&u--,n.keepLines&&l>0||!n.keepLines&&v!==1?r=m():n.keepLines&&(r=` `);else if(t===4)v!==3&&u--,n.keepLines&&l>0||!n.keepLines&&v!==3?r=m():n.keepLines&&(r=` `);else{switch(v){case 3:case 1:u++,r=n.keepLines&&l>0||!n.keepLines?m():` `;break;case 5:r=n.keepLines&&l>0||!n.keepLines?m():` `;break;case 12:r=m();break;case 13:l>0?r=m():i||(r=` `);break;case 6:n.keepLines&&l>0?r=m():i||(r=` `);break;case 10:n.keepLines&&l>0?r=m():t===6&&!i&&(r=``);break;case 7:case 8:case 9:case 11:case 2:case 4:n.keepLines&&l>0?r=m():(t===12||t===13)&&!i?r=` `:t!==5&&t!==17&&(p=!0);break;case 16:p=!0;break}l>0&&(t===12||t===13)&&(r=m())}t===17&&(r=n.keepLines&&l>0?m():n.insertFinalNewline?c:``);let o=f.getTokenOffset()+a;_(r,e,o),v=t}return g}Y(ds,`format`);function fs(e,t){let n=``;for(let r=0;r<t;r++)n+=e;return n}Y(fs,`repeat`);function ps(e,t){let n=0,r=0,i=t.tabSize||4;for(;n<e.length;){let t=e.charAt(n);if(t===` `)r++;else if(t===` `)r+=i;else break;n++}return Math.floor(r/i)}Y(ps,`computeIndentLevel`);function ms(e,t){for(let e=0;e<t.length;e++){let n=t.charAt(e);if(n===`\r`)return e+1<t.length&&t.charAt(e+1)===`
|
|
74
|
+
`?`\r
|
|
75
|
+
`:`\r`;if(n===`
|
|
76
|
+
`)return`
|
|
77
|
+
`}return e&&e.eol||`
|
|
78
|
+
`}Y(ms,`getEOL`);function hs(e,t){return`\r
|
|
79
|
+
`.indexOf(e.charAt(t))!==-1}Y(hs,`isEOL`);var gs;(function(e){e.DEFAULT={allowTrailingComma:!1}})(gs||={});function _s(e,t=[],n=gs.DEFAULT){let r=null,i=[],a=[];function o(e){Array.isArray(i)?i.push(e):r!==null&&(i[r]=e)}return Y(o,`onValue`),bs(e,{onObjectBegin:Y(()=>{let e={};o(e),a.push(i),i=e,r=null},`onObjectBegin`),onObjectProperty:Y(e=>{r=e},`onObjectProperty`),onObjectEnd:Y(()=>{i=a.pop()},`onObjectEnd`),onArrayBegin:Y(()=>{let e=[];o(e),a.push(i),i=e,r=null},`onArrayBegin`),onArrayEnd:Y(()=>{i=a.pop()},`onArrayEnd`),onLiteralValue:o,onError:Y((e,n,r)=>{t.push({error:e,offset:n,length:r})},`onError`)},n),i[0]}Y(_s,`parse`);function vs(e,t=[],n=gs.DEFAULT){let r={type:`array`,offset:-1,length:-1,children:[],parent:void 0};function i(e){r.type===`property`&&(r.length=e-r.offset,r=r.parent)}Y(i,`ensurePropertyComplete`);function a(e){return r.children.push(e),e}Y(a,`onValue`),bs(e,{onObjectBegin:Y(e=>{r=a({type:`object`,offset:e,length:-1,parent:r,children:[]})},`onObjectBegin`),onObjectProperty:Y((e,t,n)=>{r=a({type:`property`,offset:t,length:-1,parent:r,children:[]}),r.children.push({type:`string`,value:e,offset:t,length:n,parent:r})},`onObjectProperty`),onObjectEnd:Y((e,t)=>{i(e+t),r.length=e+t-r.offset,r=r.parent,i(e+t)},`onObjectEnd`),onArrayBegin:Y((e,t)=>{r=a({type:`array`,offset:e,length:-1,parent:r,children:[]})},`onArrayBegin`),onArrayEnd:Y((e,t)=>{r.length=e+t-r.offset,r=r.parent,i(e+t)},`onArrayEnd`),onLiteralValue:Y((e,t,n)=>{a({type:xs(e),offset:t,length:n,parent:r,value:e}),i(t+n)},`onLiteralValue`),onSeparator:Y((e,t,n)=>{r.type===`property`&&(e===`:`?r.colonOffset=t:e===`,`&&i(t))},`onSeparator`),onError:Y((e,n,r)=>{t.push({error:e,offset:n,length:r})},`onError`)},n);let o=r.children[0];return o&&delete o.parent,o}Y(vs,`parseTree`);function ys(e,t){if(!e)return;let n=e;for(let e of t)if(typeof e==`string`){if(n.type!==`object`||!Array.isArray(n.children))return;let t=!1;for(let r of n.children)if(Array.isArray(r.children)&&r.children[0].value===e&&r.children.length===2){n=r.children[1],t=!0;break}if(!t)return}else{let t=e;if(n.type!==`array`||t<0||!Array.isArray(n.children)||t>=n.children.length)return;n=n.children[t]}return n}Y(ys,`findNodeAtLocation`);function bs(e,t,n=gs.DEFAULT){let r=os(e,!1),i=[];function a(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}Y(a,`toNoArgVisit`);function o(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}Y(o,`toNoArgVisitWithPath`);function s(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}Y(s,`toOneArgVisit`);function c(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),()=>i.slice()):()=>!0}Y(c,`toOneArgVisitWithPath`);let l=o(t.onObjectBegin),u=c(t.onObjectProperty),d=a(t.onObjectEnd),f=o(t.onArrayBegin),p=a(t.onArrayEnd),m=c(t.onLiteralValue),h=s(t.onSeparator),g=a(t.onComment),_=s(t.onError),v=n&&n.disallowComments,y=n&&n.allowTrailingComma;function b(){for(;;){let e=r.scan();switch(r.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:v||x(11);break;case 2:x(12);break;case 6:x(16);break}switch(e){case 12:case 13:v?x(10):g();break;case 16:x(1);break;case 15:case 14:break;default:return e}}}Y(b,`scanNext`);function x(e,t=[],n=[]){if(_(e),t.length+n.length>0){let e=r.getToken();for(;e!==17;){if(t.indexOf(e)!==-1){b();break}else if(n.indexOf(e)!==-1)break;e=b()}}}Y(x,`handleError`);function S(e){let t=r.getTokenValue();return e?m(t):(u(t),i.push(t)),b(),!0}Y(S,`parseString`);function ee(){switch(r.getToken()){case 11:let e=r.getTokenValue(),t=Number(e);isNaN(t)&&(x(2),t=0),m(t);break;case 7:m(null);break;case 8:m(!0);break;case 9:m(!1);break;default:return!1}return b(),!0}Y(ee,`parseLiteral`);function C(){return r.getToken()===10?(S(!1),r.getToken()===6?(h(`:`),b(),E()||x(4,[],[2,5])):x(5,[],[2,5]),i.pop(),!0):(x(3,[],[2,5]),!1)}Y(C,`parseProperty`);function w(){l(),b();let e=!1;for(;r.getToken()!==2&&r.getToken()!==17;){if(r.getToken()===5){if(e||x(4,[],[]),h(`,`),b(),r.getToken()===2&&y)break}else e&&x(6,[],[]);C()||x(4,[],[2,5]),e=!0}return d(),r.getToken()===2?b():x(7,[2],[]),!0}Y(w,`parseObject`);function T(){f(),b();let e=!0,t=!1;for(;r.getToken()!==4&&r.getToken()!==17;){if(r.getToken()===5){if(t||x(4,[],[]),h(`,`),b(),r.getToken()===4&&y)break}else t&&x(6,[],[]);e?(i.push(0),e=!1):i[i.length-1]++,E()||x(4,[],[4,5]),t=!0}return p(),e||i.pop(),r.getToken()===4?b():x(8,[4],[]),!0}Y(T,`parseArray`);function E(){switch(r.getToken()){case 3:return T();case 1:return w();case 10:return S(!0);default:return ee()}}return Y(E,`parseValue`),b(),r.getToken()===17?n.allowEmptyContent?!0:(x(4,[],[]),!1):E()?(r.getToken()!==17&&x(9,[],[]),!0):(x(4,[],[]),!1)}Y(bs,`visit`);function xs(e){switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`string`:return`string`;case`object`:return e?Array.isArray(e)?`array`:`object`:`null`;default:return`null`}}Y(xs,`getNodeType`);function Ss(e,t,n,r){let i=t.slice(),a=vs(e,[]),o,s;for(;i.length>0&&(s=i.pop(),o=ys(a,i),o===void 0&&n!==void 0);)n=typeof s==`string`?{[s]:n}:[n];if(!o){if(n===void 0)throw Error(`Can not delete in empty document`);return Cs(e,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(n)},r)}else if(o.type===`object`&&typeof s==`string`&&Array.isArray(o.children)){let t=ys(o,[s]);if(t!==void 0)if(n===void 0){if(!t.parent)throw Error(`Malformed AST`);let n=o.children.indexOf(t.parent),i,a=t.parent.offset+t.parent.length;if(n>0){let e=o.children[n-1];i=e.offset+e.length}else i=o.offset+1,o.children.length>1&&(a=o.children[1].offset);return Cs(e,{offset:i,length:a-i,content:``},r)}else return Cs(e,{offset:t.offset,length:t.length,content:JSON.stringify(n)},r);else{if(n===void 0)return[];let t=`${JSON.stringify(s)}: ${JSON.stringify(n)}`,i=r.getInsertionIndex?r.getInsertionIndex(o.children.map(e=>e.children[0].value)):o.children.length,a;if(i>0){let e=o.children[i-1];a={offset:e.offset+e.length,length:0,content:`,`+t}}else a=o.children.length===0?{offset:o.offset+1,length:0,content:t}:{offset:o.offset+1,length:0,content:t+`,`};return Cs(e,a,r)}}else if(o.type===`array`&&typeof s==`number`&&Array.isArray(o.children)){let t=s;if(t===-1){let t=`${JSON.stringify(n)}`,i;if(o.children.length===0)i={offset:o.offset+1,length:0,content:t};else{let e=o.children[o.children.length-1];i={offset:e.offset+e.length,length:0,content:`,`+t}}return Cs(e,i,r)}else if(n===void 0&&o.children.length>=0){let t=s,n=o.children[t],i;if(o.children.length===1)i={offset:o.offset+1,length:o.length-2,content:``};else if(o.children.length-1===t){let e=o.children[t-1],n=e.offset+e.length;i={offset:n,length:o.offset+o.length-2-n,content:``}}else i={offset:n.offset,length:o.children[t+1].offset-n.offset,content:``};return Cs(e,i,r)}else if(n!==void 0){let t,i=`${JSON.stringify(n)}`;if(!r.isArrayInsertion&&o.children.length>s){let e=o.children[s];t={offset:e.offset,length:e.length,content:i}}else if(o.children.length===0||s===0)t={offset:o.offset+1,length:0,content:o.children.length===0?i:i+`,`};else{let e=s>o.children.length?o.children.length:s,n=o.children[e-1];t={offset:n.offset+n.length,length:0,content:`,`+i}}return Cs(e,t,r)}else throw Error(`Can not ${n===void 0?`remove`:r.isArrayInsertion?`insert`:`modify`} Array index ${t} as length is not sufficient`)}else throw Error(`Can not add ${typeof s==`number`?`property`:`index`} to parent of type ${o.type}`)}Y(Ss,`setProperty`);function Cs(e,t,n){if(!n.formattingOptions)return[t];let r=ws(e,t),i=t.offset,a=t.offset+t.content.length;if(t.length===0||t.content.length===0){for(;i>0&&!hs(r,i-1);)i--;for(;a<r.length&&!hs(r,a);)a++}let o=ds(r,{offset:i,length:a-i},{...n.formattingOptions,keepLines:!1});for(let e=o.length-1;e>=0;e--){let t=o[e];r=ws(r,t),i=Math.min(i,t.offset),a=Math.max(a,t.offset+t.length),a+=t.content.length-t.length}let s=e.length-(r.length-a)-i;return[{offset:i,length:s,content:r.substring(i,a)}]}Y(Cs,`withFormatting`);function ws(e,t){return e.substring(0,t.offset)+t.content+e.substring(t.offset+t.length)}Y(ws,`applyEdit`);var Ts;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(Ts||={});var Es;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(Es||={});var Ds=_s,Os;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(Os||={});function ks(e){switch(e){case 1:return`InvalidSymbol`;case 2:return`InvalidNumberFormat`;case 3:return`PropertyNameExpected`;case 4:return`ValueExpected`;case 5:return`ColonExpected`;case 6:return`CommaExpected`;case 7:return`CloseBraceExpected`;case 8:return`CloseBracketExpected`;case 9:return`EndOfFileExpected`;case 10:return`InvalidCommentToken`;case 11:return`UnexpectedEndOfComment`;case 12:return`UnexpectedEndOfString`;case 13:return`UnexpectedEndOfNumber`;case 14:return`InvalidUnicode`;case 15:return`InvalidEscapeCharacter`;case 16:return`InvalidCharacter`}return`<unknown ParseErrorCode>`}Y(ks,`printParseErrorCode`);function As(e,t,n){return ds(e,t,n)}Y(As,`format`);function js(e,t,n,r){return Ss(e,t,n,r)}Y(js,`modify`);function Ms(e,t){let n=t.slice(0).sort((e,t)=>{let n=e.offset-t.offset;return n===0?e.length-t.length:n}),r=e.length;for(let t=n.length-1;t>=0;t--){let i=n[t];if(i.offset+i.length<=r)e=ws(e,i);else throw Error(`Overlapping edit`);r=i.offset}return e}Y(Ms,`applyEdits`);function Ns(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}Y(Ns,`getLineColFromPtr`);function Ps(e,t,n){let r=e.split(/\r\n|\n|\r/g),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
|
|
80
|
+
`,e===t&&(i+=` `.repeat(a+n+2),i+=`^
|
|
81
|
+
`))}return i}Y(Ps,`makeCodeBlock`);var Z=class extends Error{static{Y(this,`TomlError`)}line;column;codeblock;constructor(e,t){let[n,r]=Ns(t.toml,t.ptr),i=Ps(t.toml,n,r);super(`Invalid TOML document: ${e}
|
|
82
|
+
|
|
83
|
+
${i}`,t),this.line=n,this.column=r,this.codeblock=i}};function Fs(e,t){let n=0;for(;e[t-++n]===`\\`;);return--n&&n%2}Y(Fs,`isEscaped`);function Is(e,t=0,n=e.length){let r=e.indexOf(`
|
|
84
|
+
`,t);return e[r-1]===`\r`&&r--,r<=n?r:-1}Y(Is,`indexOfNewline`);function Ls(e,t){for(let n=t;n<e.length;n++){let r=e[n];if(r===`
|
|
85
|
+
`)return n;if(r===`\r`&&e[n+1]===`
|
|
86
|
+
`)return n+1;if(r<` `&&r!==` `||r===``)throw new Z(`control characters are not allowed in comments`,{toml:e,ptr:t})}return e.length}Y(Ls,`skipComment`);function Q(e,t,n,r){let i;for(;(i=e[t])===` `||i===` `||!n&&(i===`
|
|
87
|
+
`||i===`\r`&&e[t+1]===`
|
|
88
|
+
`);)t++;return r||i!==`#`?t:Q(e,Ls(e,t),n)}Y(Q,`skipVoid`);function Rs(e,t,n,r,i=!1){if(!r)return t=Is(e,t),t<0?e.length:t;for(let a=t;a<e.length;a++){let t=e[a];if(t===`#`)a=Is(e,a);else if(t===n)return a+1;else if(t===r||i&&(t===`
|
|
89
|
+
`||t===`\r`&&e[a+1]===`
|
|
90
|
+
`))return a}throw new Z(`cannot find end of structure`,{toml:e,ptr:t})}Y(Rs,`skipUntil`);function zs(e,t){let n=e[t],r=n===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):n;t+=r.length-1;do t=e.indexOf(r,++t);while(t>-1&&n!==`'`&&Fs(e,t));return t>-1&&(t+=r.length,r.length>1&&(e[t]===n&&t++,e[t]===n&&t++)),t}Y(zs,`getStringEnd`);var Bs=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i,Vs=class e extends Date{static{Y(this,`TomlDate`)}#e=!1;#t=!1;#n=null;constructor(e){let t=!0,n=!0,r=`Z`;if(typeof e==`string`){let i=e.match(Bs);i?(i[1]||(t=!1,e=`0000-01-01T${e}`),n=!!i[2],n&&e[10]===` `&&(e=e.replace(` `,`T`)),i[2]&&+i[2]>23?e=``:(r=i[3]||null,e=e.toUpperCase(),!r&&n&&(e+=`Z`))):e=``}super(e),isNaN(this.getTime())||(this.#e=t,this.#t=n,this.#n=r)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}},Hs=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,Us=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,Ws=/^[+-]?0[0-9_]/,Gs=/^[0-9a-f]{4,8}$/i,Ks={b:`\b`,t:` `,n:`
|
|
91
|
+
`,f:`\f`,r:`\r`,'"':`"`,"\\":`\\`};function qs(e,t=0,n=e.length){let r=e[t]===`'`,i=e[t++]===e[t]&&e[t]===e[t+1];i&&(n-=2,e[t+=2]===`\r`&&t++,e[t]===`
|
|
92
|
+
`&&t++);let a=0,o,s=``,c=t;for(;t<n-1;){let n=e[t++];if(n===`
|
|
93
|
+
`||n===`\r`&&e[t]===`
|
|
94
|
+
`){if(!i)throw new Z(`newlines are not allowed in strings`,{toml:e,ptr:t-1})}else if(n<` `&&n!==` `||n===``)throw new Z(`control characters are not allowed in strings`,{toml:e,ptr:t-1});if(o){if(o=!1,n===`u`||n===`U`){let r=e.slice(t,t+=n===`u`?4:8);if(!Gs.test(r))throw new Z(`invalid unicode escape`,{toml:e,ptr:a});try{s+=String.fromCodePoint(parseInt(r,16))}catch{throw new Z(`invalid unicode escape`,{toml:e,ptr:a})}}else if(i&&(n===`
|
|
95
|
+
`||n===` `||n===` `||n===`\r`)){if(t=Q(e,t-1,!0),e[t]!==`
|
|
96
|
+
`&&e[t]!==`\r`)throw new Z(`invalid escape: only line-ending whitespace may be escaped`,{toml:e,ptr:a});t=Q(e,t)}else if(n in Ks)s+=Ks[n];else throw new Z(`unrecognized escape sequence`,{toml:e,ptr:a});c=t}else !r&&n===`\\`&&(a=t-1,o=!0,s+=e.slice(c,a))}return s+e.slice(c,n-1)}Y(qs,`parseString`);function Js(e,t,n,r){if(e===`true`)return!0;if(e===`false`)return!1;if(e===`-inf`)return-1/0;if(e===`inf`||e===`+inf`)return 1/0;if(e===`nan`||e===`+nan`||e===`-nan`)return NaN;if(e===`-0`)return r?0n:0;let i=Hs.test(e);if(i||Us.test(e)){if(Ws.test(e))throw new Z(`leading zeroes are not allowed`,{toml:t,ptr:n});e=e.replace(/_/g,``);let a=+e;if(isNaN(a))throw new Z(`invalid number`,{toml:t,ptr:n});if(i){if((i=!Number.isSafeInteger(a))&&!r)throw new Z(`integer value cannot be represented losslessly`,{toml:t,ptr:n});(i||r===!0)&&(a=BigInt(e))}return a}let a=new Vs(e);if(!a.isValid())throw new Z(`invalid value`,{toml:t,ptr:n});return a}Y(Js,`parseValue`);function Ys(e,t,n,r){let i=e.slice(t,n),a=i.indexOf(`#`);a>-1&&(Ls(e,a),i=i.slice(0,a));let o=i.trimEnd();if(!r){let n=i.indexOf(`
|
|
97
|
+
`,o.length);if(n>-1)throw new Z(`newlines are not allowed in inline tables`,{toml:e,ptr:t+n})}return[o,a]}Y(Ys,`sliceAndTrimEndOf`);function Xs(e,t,n,r,i){if(r===0)throw new Z(`document contains excessively nested structures. aborting.`,{toml:e,ptr:t});let a=e[t];if(a===`[`||a===`{`){let[o,s]=a===`[`?ec(e,t,r,i):$s(e,t,r,i),c=n?Rs(e,s,`,`,n):s;if(s-c&&n===`}`){let t=Is(e,s,c);if(t>-1)throw new Z(`newlines are not allowed in inline tables`,{toml:e,ptr:t})}return[o,c]}let o;if(a===`"`||a===`'`){o=zs(e,t);let r=qs(e,t,o);if(n){if(o=Q(e,o,n!==`]`),e[o]&&e[o]!==`,`&&e[o]!==n&&e[o]!==`
|
|
98
|
+
`&&e[o]!==`\r`)throw new Z(`unexpected character encountered`,{toml:e,ptr:o});o+=+(e[o]===`,`)}return[r,o]}o=Rs(e,t,`,`,n);let s=Ys(e,t,o-+(e[o-1]===`,`),n===`]`);if(!s[0])throw new Z(`incomplete key-value declaration: no value specified`,{toml:e,ptr:t});return n&&s[1]>-1&&(o=Q(e,t+s[1]),o+=+(e[o]===`,`)),[Js(s[0],e,t,i),o]}Y(Xs,`extractValue`);var Zs=/^[a-zA-Z0-9-_]+[ \t]*$/;function Qs(e,t,n=`=`){let r=t-1,i=[],a=e.indexOf(n,t);if(a<0)throw new Z(`incomplete key-value: cannot find end of key`,{toml:e,ptr:t});do{let o=e[t=++r];if(o!==` `&&o!==` `)if(o===`"`||o===`'`){if(o===e[t+1]&&o===e[t+2])throw new Z(`multiline strings are not allowed in keys`,{toml:e,ptr:t});let s=zs(e,t);if(s<0)throw new Z(`unfinished string encountered`,{toml:e,ptr:t});r=e.indexOf(`.`,s);let c=e.slice(s,r<0||r>a?a:r),l=Is(c);if(l>-1)throw new Z(`newlines are not allowed in keys`,{toml:e,ptr:t+r+l});if(c.trimStart())throw new Z(`found extra tokens after the string part`,{toml:e,ptr:s});if(a<s&&(a=e.indexOf(n,s),a<0))throw new Z(`incomplete key-value: cannot find end of key`,{toml:e,ptr:t});i.push(qs(e,t,s))}else{r=e.indexOf(`.`,t);let n=e.slice(t,r<0||r>a?a:r);if(!Zs.test(n))throw new Z(`only letter, numbers, dashes and underscores are allowed in keys`,{toml:e,ptr:t});i.push(n.trimEnd())}}while(r+1&&r<a);return[i,Q(e,a+1,!0,!0)]}Y(Qs,`parseKey`);function $s(e,t,n,r){let i={},a=new Set,o,s=0;for(t++;(o=e[t++])!==`}`&&o;){let c={toml:e,ptr:t-1};if(o===`
|
|
99
|
+
`)throw new Z(`newlines are not allowed in inline tables`,c);if(o===`#`)throw new Z(`inline tables cannot contain comments`,c);if(o===`,`)throw new Z(`expected key-value, found comma`,c);if(o!==` `&&o!==` `){let o,c=i,l=!1,[u,d]=Qs(e,t-1);for(let n=0;n<u.length;n++){if(n&&(c=l?c[o]:c[o]={}),o=u[n],(l=Object.hasOwn(c,o))&&(typeof c[o]!=`object`||a.has(c[o])))throw new Z(`trying to redefine an already defined value`,{toml:e,ptr:t});!l&&o===`__proto__`&&Object.defineProperty(c,o,{enumerable:!0,configurable:!0,writable:!0})}if(l)throw new Z(`trying to redefine an already defined value`,{toml:e,ptr:t});let[f,p]=Xs(e,d,`}`,n-1,r);a.add(f),c[o]=f,t=p,s=e[t-1]===`,`?t-1:0}}if(s)throw new Z(`trailing commas are not allowed in inline tables`,{toml:e,ptr:s});if(!o)throw new Z(`unfinished table encountered`,{toml:e,ptr:t});return[i,t]}Y($s,`parseInlineTable`);function ec(e,t,n,r){let i=[],a;for(t++;(a=e[t++])!==`]`&&a;)if(a===`,`)throw new Z(`expected value, found comma`,{toml:e,ptr:t-1});else if(a===`#`)t=Ls(e,t);else if(a!==` `&&a!==` `&&a!==`
|
|
100
|
+
`&&a!==`\r`){let a=Xs(e,t-1,`]`,n-1,r);i.push(a[0]),t=a[1]}if(!a)throw new Z(`unfinished array encountered`,{toml:e,ptr:t});return[i,t]}Y(ec,`parseArray`);function tc(e,t,n,r){let i=t,a=n,o,s=!1,c;for(let t=0;t<e.length;t++){if(t){if(i=s?i[o]:i[o]={},a=(c=a[o]).c,r===0&&(c.t===1||c.t===2))return null;if(c.t===2){let e=i.length-1;i=i[e],a=a[e].c}}if(o=e[t],(s=Object.hasOwn(i,o))&&a[o]?.t===0&&a[o]?.d)return null;s||(o===`__proto__`&&(Object.defineProperty(i,o,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(a,o,{enumerable:!0,configurable:!0,writable:!0})),a[o]={t:t<e.length-1&&r===2?3:r,d:!1,i:0,c:{}})}if(c=a[o],c.t!==r&&!(r===1&&c.t===3)||(r===2&&(c.d||(c.d=!0,i[o]=[]),i[o].push(i={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,r===1)i=s?i[o]:i[o]={};else if(r===0&&s)return null;return[o,i,c.c]}Y(tc,`peekTable`);function nc(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let r={},i={},a=r,o=i;for(let s=Q(e,0);s<e.length;){if(e[s]===`[`){let t=e[++s]===`[`,n=Qs(e,s+=+t,`]`);if(t){if(e[n[1]-1]!==`]`)throw new Z(`expected end of table declaration`,{toml:e,ptr:n[1]-1});n[1]++}let c=tc(n[0],r,i,t?2:1);if(!c)throw new Z(`trying to redefine an already defined table or value`,{toml:e,ptr:s});o=c[2],a=c[1],s=n[1]}else{let r=Qs(e,s),i=tc(r[0],a,o,0);if(!i)throw new Z(`trying to redefine an already defined table or value`,{toml:e,ptr:s});let c=Xs(e,r[1],void 0,t,n);i[1][i[0]]=c[0],s=c[1]}if(s=Q(e,s,!0),e[s]&&e[s]!==`
|
|
101
|
+
`&&e[s]!==`\r`)throw new Z(`each key-value declaration must be followed by an end-of-line`,{toml:e,ptr:s});s=Q(e,s)}return r}Y(nc,`parse`);var rc=/^[a-z0-9-_]+$/i;function ic(e){let t=typeof e;if(t===`object`){if(Array.isArray(e))return`array`;if(e instanceof Date)return`date`}return t}Y(ic,`extendedTypeOf`);function ac(e){for(let t=0;t<e.length;t++)if(ic(e[t])!==`object`)return!1;return e.length!=0}Y(ac,`isArrayOfTables`);function oc(e){return JSON.stringify(e).replace(/\x7f/g,`\\u007f`)}Y(oc,`formatString`);function sc(e,t,n,r){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);if(t===`number`)return isNaN(e)?`nan`:e===1/0?`inf`:e===-1/0?`-inf`:r&&Number.isInteger(e)?e.toFixed(1):e.toString();if(t===`bigint`||t===`boolean`)return e.toString();if(t===`string`)return oc(e);if(t===`date`){if(isNaN(e.getTime()))throw TypeError(`cannot serialize invalid date`);return e.toISOString()}if(t===`object`)return cc(e,n,r);if(t===`array`)return lc(e,n,r)}Y(sc,`stringifyValue`);function cc(e,t,n){let r=Object.keys(e);if(r.length===0)return`{}`;let i=`{ `;for(let a=0;a<r.length;a++){let o=r[a];a&&(i+=`, `),i+=rc.test(o)?o:oc(o),i+=` = `,i+=sc(e[o],ic(e[o]),t-1,n)}return i+` }`}Y(cc,`stringifyInlineTable`);function lc(e,t,n){if(e.length===0)return`[]`;let r=`[ `;for(let i=0;i<e.length;i++){if(i&&(r+=`, `),e[i]===null||e[i]===void 0)throw TypeError(`arrays cannot contain null or undefined values`);r+=sc(e[i],ic(e[i]),t-1,n)}return r+` ]`}Y(lc,`stringifyArray`);function uc(e,t,n,r){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let i=``;for(let a=0;a<e.length;a++)i+=`${i&&`
|
|
102
|
+
`}[[${t}]]
|
|
103
|
+
`,i+=dc(0,e[a],t,n,r);return i}Y(uc,`stringifyArrayTable`);function dc(e,t,n,r,i){if(r===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let a=``,o=``,s=Object.keys(t);for(let e=0;e<s.length;e++){let c=s[e];if(t[c]!==null&&t[c]!==void 0){let e=ic(t[c]);if(e===`symbol`||e===`function`)throw TypeError(`cannot serialize values of type '${e}'`);let s=rc.test(c)?c:oc(c);if(e===`array`&&ac(t[c]))o+=(o&&`
|
|
104
|
+
`)+uc(t[c],n?`${n}.${s}`:s,r-1,i);else if(e===`object`){let e=n?`${n}.${s}`:s;o+=(o&&`
|
|
105
|
+
`)+dc(e,t[c],e,r-1,i)}else a+=s,a+=` = `,a+=sc(t[c],e,r,i),a+=`
|
|
106
|
+
`}}return e&&(a||!o)&&(a=a?`[${e}]
|
|
107
|
+
${a}`:`[${e}]`),a&&o?`${a}
|
|
108
|
+
${o}`:a||o}Y(dc,`stringifyTable`);function fc(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(ic(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let r=dc(0,e,``,t,n);return r[r.length-1]===`
|
|
109
|
+
`?r:r+`
|
|
110
|
+
`}Y(fc,`stringify`);var pc={parse:nc,stringify:fc,TomlDate:Vs,TomlError:Z},mc=class extends X{static{Y(this,`ParseError`)}text;notes;location;kind;constructor({text:e,notes:t,location:n,kind:r,telemetryMessage:i}){super(e,{telemetryMessage:i}),this.name=this.constructor.name,this.text=e,this.notes=t??[],this.location=n,this.kind=r??`error`}};(class extends mc{static{Y(this,`APIError`)}#e;code;accountTag;meta;retryAfterMs;constructor({status:e,retryAfterMs:t,...n}){super(n),this.name=this.constructor.name,this.#e=e,this.retryAfterMs=t}get status(){return this.#e}isGatewayError(){return this.#e===void 0?!1:[524].includes(this.#e)}isRetryable(){return String(this.#e).startsWith(`5`)}#t=!0;get reportable(){return this.#t}preventReport(){this.#t=!1}});function hc(e,t){try{return pc.parse(e)}catch(n){if(!(n instanceof Z))throw n;let r={lineText:e.split(`
|
|
111
|
+
`)[n.line-1],line:n.line,column:n.column-1,file:t,fileText:e};throw new mc({text:n.message.substring(0,n.message.indexOf(`
|
|
112
|
+
`)),location:r,telemetryMessage:`TOML parse error`})}}Y(hc,`parseTOML`);function gc(e,t){return _c(e,t)}Y(gc,`parsePackageJSON`);function _c(e,t){return vc(e,t,{allowEmptyContent:!1,allowTrailingComma:!1,disallowComments:!0})}Y(_c,`parseJSON`);function vc(e,t,n={allowTrailingComma:!0}){let r=[],i=Ds(e,r,n);if(r.length)throw new mc({text:ks(r[0].error),location:{...xc({file:t,fileText:e},r[0].offset+1),length:r[0].length},telemetryMessage:`JSON(C) parse error`});return i}Y(vc,`parseJSONC`);function yc(e){try{return r(e)}catch(t){let{message:n}=t;throw new mc({text:`Could not read file: ${e}`,notes:[{text:n.replace(e,l(e))}],telemetryMessage:!1})}}Y(yc,`readFileSyncToBuffer`);function bc(e){try{return Oc(r(e),e)}catch(t){if(t instanceof mc)throw t;let{message:n}=t;throw new mc({text:`Could not read file: ${e}`,notes:[{text:n.replace(e,l(e))}],telemetryMessage:`Could not read file`})}}Y(bc,`readFileSync`);function xc(e,t){let n,r=0,i=0,a=0,{fileText:o=``}=e;for(let e of o.split(`
|
|
113
|
+
`))if(r++,a+=e.length+1,a>=t){n=e,i=e.length-(a-t);break}return{lineText:n,line:r,column:i,...e}}Y(xc,`indexLocation`);function Sc(e,t){let n,r,i=0,a=0,o=String(t),{fileText:s=``}=e;for(let e of s.split(`
|
|
114
|
+
`)){i++;let t=e.indexOf(o);if(t>=0){n=e,a=t,r=o.length;break}}return{lineText:n,line:i,column:a,length:r,...e}}Y(Sc,`searchLocation`);var Cc={nanoseconds:1e-9,nanosecond:1e-9,microseconds:1e-6,microsecond:1e-6,milliseconds:.001,millisecond:.001,seconds:1,second:1,minutes:60,minute:60,hours:3600,hour:3600,days:86400,day:86400,weeks:604800,week:604800,month:18144e3,year:220752e3,nsecs:1e-9,nsec:1e-9,usecs:1e-6,usec:1e-6,msecs:.001,msec:.001,secs:1,sec:1,mins:60,min:60,ns:1e-9,us:1e-6,ms:.001,mo:18144e3,yr:220752e3,s:1,m:60,h:3600,d:86400,w:604800,y:220752e3};function wc(e){let t=new Map(Object.entries(Cc));e=e.trim().toLowerCase();let n=1;for(let[r,i]of t)if(e.endsWith(r)){e=e.substring(0,e.length-r.length),n=t.get(r)||1;break}return Number(e)*n}Y(wc,`parseHumanDuration`);function Tc(e){if(e==null||e.includes(`-`))return e;if(e.length!=32)return null;let t=[];t.push(e.slice(0,8)),t.push(e.slice(8,12)),t.push(e.slice(12,16)),t.push(e.slice(16,20)),t.push(e.slice(20));let n=``;return t.forEach(e=>n+=e+`-`),n.slice(0,36)}Y(Tc,`parseNonHyphenedUuid`);function Ec(e,t=void 0){let n=e.match(/^(\d*\.*\d*)\s*([kKmMgGtTpP]{0,1})([i]{0,1}[bB]{0,1})$/);if(!n)return NaN;let r=n[1];if(r.length===0||isNaN(Number(r)))return NaN;let i=n[2].toLowerCase(),a={k:1,m:2,g:3,t:4,p:5};if(i.length!==0&&!(i in a))return NaN;let o=n[3].toLowerCase()==`ib`;if(o&&i.length===0)return NaN;let s=a[i]||0;return Math.floor(Number(r)*(t??(o?1024:1e3))**+s)}Y(Ec,`parseByteSize`);var Dc=[{buffer:Buffer.from([0,0,254,255]),encoding:`UTF-32 BE`},{buffer:Buffer.from([255,254,0,0]),encoding:`UTF-32 LE`},{buffer:Buffer.from([254,255]),encoding:`UTF-16 BE`},{buffer:Buffer.from([255,254]),encoding:`UTF-16 LE`}];function Oc(e,t){for(let n of Dc)if(e.length>=n.buffer.length&&e.subarray(0,n.buffer.length).equals(n.buffer))throw new mc({text:`Configuration file contains ${n.encoding} byte order marker`,notes:[{text:`The file "${t}" appears to be encoded as ${n.encoding}. Please save the file as UTF-8 without BOM.`}],location:{file:t,line:1,column:0},telemetryMessage:`${n.encoding} BOM detected`});let n=e.toString(`utf-8`);return n.charCodeAt(0)===65279?n.slice(1):n}Y(Oc,`removeBOMAndValidate`);var kc=`.wrangler/deploy/config.json`;function Ac(e,t){return s(e)?e:l(t||`.`,e)}Y(Ac,`absolute`);function jc(e,t){let{last:n,cwd:r}=t||{},i=Ac(e,r),a=Ac(n||`/`,r),s,c=[];for(;s!==a&&(c.push(i),i=o(s=i),i!==s););return c}Y(jc,`up`);function Mc(e,t){let n,r;for(n of jc(t&&t.cwd||``,t))try{if(r=c(n,e),i(r).isFile())return r}catch{}}Y(Mc,`file`);function Nc(e,t){let n,r;for(n of jc(t&&t.cwd||``,t))try{if(r=c(n,e),i(r).isDirectory())return r}catch{}}Y(Nc,`dir`);function Pc(e){var t=[...arguments].slice(1),n=Array.from(typeof e==`string`?[e]:e);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,``);var r=n.reduce(function(e,t){var n=t.match(/\n([\t ]+|(?!\s).)/g);return n?e.concat(n.map(function(e){return e.match(/[\t ]/g)?.length??0})):e},[]);if(r.length){var i=RegExp(`
|
|
115
|
+
[ ]{`+Math.min.apply(Math,r)+`}`,`g`);n=n.map(function(e){return e.replace(i,`
|
|
116
|
+
`)})}n[0]=n[0].replace(/^\r?\n/,``);var a=n[0];return t.forEach(function(e,t){var r=a.match(/(?:^|\n)( *)$/),i=r?r[1]:``,o=e;typeof e==`string`&&e.includes(`
|
|
117
|
+
`)&&(o=String(e).split(`
|
|
118
|
+
`).map(function(e,t){return t===0?e:``+i+e}).join(`
|
|
119
|
+
`)),a+=o+n[t+1]}),a}Y(Pc,`dedent`);var Fc=Pc;function Ic({config:e,script:t},n){return e===void 0?Lc(t===void 0?process.cwd():a.dirname(t),n):{userConfigPath:e,configPath:e,deployConfigPath:void 0,redirected:!1}}Y(Ic,`resolveWranglerConfigPath`);function Lc(e=process.cwd(),{useRedirectIfAvailable:t=!1}={}){let n=Mc(`wrangler.json`,{cwd:e})??Mc(`wrangler.jsonc`,{cwd:e})??Mc(`wrangler.toml`,{cwd:e});if(!t)return{userConfigPath:n,configPath:n,deployConfigPath:void 0,redirected:!1};let{configPath:r,deployConfigPath:i,redirected:a}=Rc(e,n);return{userConfigPath:n,configPath:r,deployConfigPath:i,redirected:a}}Y(Lc,`findWranglerConfig`);function Rc(e,t){let r=Mc(kc,{cwd:e});if(r===void 0)return{configPath:t,deployConfigPath:r,redirected:!1};let i,o=bc(r);try{let e=vc(o,r);i=e.configPath&&a.resolve(a.dirname(r),e.configPath)}catch(e){throw new X(`Failed to parse the deploy configuration file at ${a.relative(`.`,r)}`,{cause:e,telemetryMessage:!1})}if(!i)throw new X(Fc`
|
|
120
|
+
A deploy configuration file was found at "${a.relative(`.`,r)}".
|
|
121
|
+
But this is not valid - the required "configPath" property was not found.
|
|
122
|
+
Instead this file contains:
|
|
123
|
+
\`\`\`
|
|
124
|
+
${o}
|
|
125
|
+
\`\`\`
|
|
126
|
+
`,{telemetryMessage:!1});if(!n(i))throw new X(Fc`
|
|
127
|
+
There is a deploy configuration at "${a.relative(`.`,r)}".
|
|
128
|
+
But the redirected configuration path it points to, "${a.relative(`.`,i)}", does not exist.
|
|
129
|
+
`,{telemetryMessage:!1});if(t&&a.join(a.dirname(t),kc)!==r)throw new X(Fc`
|
|
130
|
+
Found both a user configuration file at "${a.relative(`.`,t)}"
|
|
131
|
+
and a deploy configuration file at "${a.relative(`.`,r)}".
|
|
132
|
+
But these do not share the same base path so it is not clear which should be used.
|
|
133
|
+
`,{telemetryMessage:!1});return{configPath:i,deployConfigPath:r,redirected:!0}}Y(Rc,`findRedirectedWranglerConfig`);function zc(e){return e.configPath!==void 0&&e.configPath!==e.userConfigPath}Y(zc,`isRedirectedConfig`);function Bc(e,t,n){return zc({configPath:t,userConfigPath:n})}Y(Bc,`isRedirectedRawConfig`);function Vc(e){return e?.endsWith(`toml`)?`toml`:e?.endsWith(`jsonc`)?`jsonc`:e?.endsWith(`json`)?`json`:`none`}Y(Vc,`configFormat`);function Hc(e){switch(Vc(e)){case`toml`:return`wrangler.toml`;case`json`:return`wrangler.json`;case`jsonc`:return`wrangler.jsonc`;default:return`Wrangler configuration`}}Y(Hc,`configFileName`);function Uc(e,t,n=!0){return Vc(t)===`toml`?pc.stringify(e):n?JSON.stringify(e,null,2):JSON.stringify(e)}Y(Uc,`formatConfigSnippet`);function Wc(e,t){let n={};return Kc(e,n),Yc(e,n),Xc(e,n),Qc(e,n),Zc(e,n),$c(e,n),t!==void 0&&Gc(t,n),n}function Gc(e,t){e.accountId!==void 0&&(t.account_id=e.accountId),e.complianceRegion!==void 0&&(t.compliance_region=e.complianceRegion===`fedramp-high`?`fedramp_high`:`public`)}function Kc(e,t){if(e.name!==void 0&&(t.name=e.name),typeof e.entrypoint==`string`&&(t.main=e.entrypoint),e.compatibilityDate!==void 0&&(t.compatibility_date=e.compatibilityDate),e.compatibilityFlags!==void 0&&(t.compatibility_flags=e.compatibilityFlags),e.workersDev!==void 0&&(t.workers_dev=e.workersDev),e.previewUrls!==void 0&&(t.preview_urls=e.previewUrls),e.logpush!==void 0&&(t.logpush=e.logpush),e.firstPartyWorker!==void 0&&(t.first_party_worker=e.firstPartyWorker),e.placement!==void 0&&(t.placement=e.placement),e.limits!==void 0){let n={};e.limits.cpuMs!==void 0&&(n.cpu_ms=e.limits.cpuMs),e.limits.subrequests!==void 0&&(n.subrequests=e.limits.subrequests),t.limits=n}if(e.observability!==void 0&&(t.observability=qc(e.observability)),e.cache!==void 0){let n={enabled:e.cache.enabled};e.cache.crossVersionCache!==void 0&&(n.cross_version_cache=e.cache.crossVersionCache),t.cache=n}e.unsafe!==void 0&&(t.unsafe=Jc(e.unsafe))}function qc(e){let t={};if(e.enabled!==void 0&&(t.enabled=e.enabled),e.headSamplingRate!==void 0&&(t.head_sampling_rate=e.headSamplingRate),e.logs!==void 0){let n={},{logs:r}=e;r.enabled!==void 0&&(n.enabled=r.enabled),r.headSamplingRate!==void 0&&(n.head_sampling_rate=r.headSamplingRate),r.invocationLogs!==void 0&&(n.invocation_logs=r.invocationLogs),r.persist!==void 0&&(n.persist=r.persist),r.destinations!==void 0&&(n.destinations=r.destinations),t.logs=n}if(e.traces!==void 0){let n={},{traces:r}=e;r.enabled!==void 0&&(n.enabled=r.enabled),r.headSamplingRate!==void 0&&(n.head_sampling_rate=r.headSamplingRate),r.persist!==void 0&&(n.persist=r.persist),r.destinations!==void 0&&(n.destinations=r.destinations),t.traces=n}return t}function Jc(e){let t={};return e.metadata!==void 0&&(t.metadata=e.metadata),e.capnp!==void 0&&(`compiledSchema`in e.capnp&&e.capnp.compiledSchema?t.capnp={compiled_schema:e.capnp.compiledSchema}:`basePath`in e.capnp&&e.capnp.basePath&&(t.capnp={base_path:e.capnp.basePath,source_schemas:e.capnp.sourceSchemas??[]})),t}function Yc(e,t){let n,r=e.env??{},i=[],a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=[],_=[],v=[],y=[],b=[],x=[],S=[],ee=[],C=[],w=[],T=[],E=[],te=[],ne=[],D={},O=[];for(let[e,T]of Object.entries(r)){if(Po(T)){ne.push({...T,name:e,type:T.type.slice(7)});continue}switch(T.type){case`agent-memory`:m.push($({binding:e,namespace:T.namespace,remote:T.remote}));break;case`ai`:t.ai=$({binding:e,remote:T.remote});break;case`ai-search`:f.push($({binding:e,instance_name:T.name,remote:T.remote}));break;case`ai-search-namespace`:p.push($({binding:e,namespace:T.namespace,remote:T.remote}));break;case`analytics-engine-dataset`:h.push($({binding:e,dataset:T.name}));break;case`artifacts`:g.push($({binding:e,namespace:T.namespace,remote:T.remote}));break;case`assets`:n=e;break;case`browser`:t.browser=$({binding:e,remote:T.remote});break;case`d1`:a.push($({binding:e,database_id:T.id,database_name:T.name,remote:T.remote}));break;case`dispatch-namespace`:{let t={binding:e,namespace:T.namespace};T.outbound&&(t.outbound=$({service:T.outbound.workerName,parameters:T.outbound.parameters})),T.remote!==void 0&&(t.remote=T.remote),_.push(t);break}case`durable-object`:w.push({name:e,class_name:T.exportName,script_name:T.workerName});break;case`flagship`:d.push($({binding:e,app_id:T.id,remote:T.remote}));break;case`hyperdrive`:l.push($({binding:e,id:T.id,localConnectionString:T.localConnectionString}));break;case`images`:t.images=$({binding:e,remote:T.remote});break;case`json`:D[e]=T.value;break;case`kv`:i.push($({binding:e,id:T.id,remote:T.remote}));break;case`logfwdr`:te.push({name:e,destination:T.destination});break;case`media`:t.media=$({binding:e,remote:T.remote});break;case`mtls-certificate`:c.push($({binding:e,certificate_id:T.id,remote:T.remote}));break;case`pipeline`:u.push($({binding:e,stream:T.name,remote:T.remote}));break;case`queue`:E.push($({binding:e,queue:T.name,delivery_delay:T.deliveryDelay,remote:T.remote}));break;case`rate-limit`:ee.push({name:e,namespace_id:T.namespace,simple:T.simple});break;case`r2`:o.push($({binding:e,bucket_name:T.name,jurisdiction:T.jurisdiction,remote:T.remote}));break;case`secret`:O.push(e);break;case`secrets-store-secret`:v.push({binding:e,store_id:T.storeId,secret_name:T.secretName});break;case`send-email`:y.push($({name:e,destination_address:T.destinationAddress,allowed_destination_addresses:T.allowedDestinationAddresses,allowed_sender_addresses:T.allowedSenderAddresses,remote:T.remote}));break;case`stream`:t.stream=$({binding:e,remote:T.remote});break;case`text`:D[e]=T.value;break;case`vectorize`:s.push($({binding:e,index_name:T.name,remote:T.remote}));break;case`version-metadata`:t.version_metadata={binding:e};break;case`vpc-service`:b.push($({binding:e,service_id:T.id,remote:T.remote}));break;case`vpc-network`:T.tunnelId===void 0?T.networkId!==void 0&&x.push($({binding:e,network_id:T.networkId,remote:T.remote})):x.push($({binding:e,tunnel_id:T.tunnelId,remote:T.remote}));break;case`web-search`:t.websearch=$({binding:e,remote:T.remote});break;case`worker`:C.push($({binding:e,service:T.workerName,entrypoint:T.exportName,props:T.props,remote:T.remote}));break;case`worker-loader`:S.push({binding:e});break}}if(i.length&&(t.kv_namespaces=i),a.length&&(t.d1_databases=a),o.length&&(t.r2_buckets=o),s.length&&(t.vectorize=s),c.length&&(t.mtls_certificates=c),l.length&&(t.hyperdrive=l),u.length&&(t.pipelines=u),d.length&&(t.flagship=d),f.length&&(t.ai_search=f),p.length&&(t.ai_search_namespaces=p),m.length&&(t.agent_memory=m),h.length&&(t.analytics_engine_datasets=h),g.length&&(t.artifacts=g),_.length&&(t.dispatch_namespaces=_),v.length&&(t.secrets_store_secrets=v),y.length&&(t.send_email=y),b.length&&(t.vpc_services=b),x.length&&(t.vpc_networks=x),S.length&&(t.worker_loaders=S),ee.length&&(t.ratelimits=ee),C.length&&(t.services=C),w.length&&(t.durable_objects={bindings:w}),T.length&&(t.workflows=T),E.length&&(t.queues={...t.queues??{},producers:E}),te.length&&(t.logfwdr={bindings:te}),ne.length&&(t.unsafe={...t.unsafe??{},bindings:ne}),Object.keys(D).length&&(t.vars=D),O.length&&(t.secrets={required:O}),e.assets!==void 0||n!==void 0){let r={};n!==void 0&&(r.binding=n),e.assets?.htmlHandling!==void 0&&(r.html_handling=e.assets.htmlHandling),e.assets?.notFoundHandling!==void 0&&(r.not_found_handling=e.assets.notFoundHandling),e.assets?.runWorkerFirst!==void 0&&(r.run_worker_first=e.assets.runWorkerFirst),t.assets=r}}function Xc(e,t){let n=e.exports;if(!n)return;let r={},i={};for(let[e,t]of Object.entries(n)){if(t.type===`worker`){r[e]=t;continue}if(t.type!==`durable-object`){i[e]=t;continue}switch(t.state){case void 0:case`created`:r[e]={type:`durable-object`,storage:t.storage};break;case`deleted`:r[e]={type:`durable-object`,state:`deleted`};break;case`renamed`:r[e]={type:`durable-object`,state:`renamed`,renamed_to:t.renamedTo};break;case`transferred`:r[e]={type:`durable-object`,state:`transferred`,transferred_to:t.transferredTo};break;case`expecting-transfer`:r[e]={type:`durable-object`,state:`expecting-transfer`,storage:t.storage,transfer_from:t.transferFrom};break}}if(Object.keys(i).length>0)throw new X(`Unknown export types found: `+Object.entries(i).map(([e,{type:t}])=>`- ${e} : ${t}`).join(`
|
|
134
|
+
`),{telemetryMessage:`Unknown export types found`});Object.keys(r).length>0&&(t.exports=r)}function Zc(e,t){let n=e.triggers;if(!n||n.length===0)return;let r=[],i=t.routes?[...t.routes]:[],a=t.queues?.consumers?[...t.queues.consumers]:[],o;for(let e of n)switch(e.type){case`email`:o??=[],o.push(...e.addresses);break;case`scheduled`:r.push(e.schedule);break;case`fetch`:e.zone===void 0?i.push(e.pattern):e.zone.includes(`.`)?i.push({pattern:e.pattern,zone_name:e.zone}):i.push({pattern:e.pattern,zone_id:e.zone});break;case`queue`:a.push($({queue:e.name,dead_letter_queue:e.deadLetterQueue,max_batch_size:e.maxBatchSize,max_batch_timeout:e.maxBatchTimeout,max_concurrency:e.maxConcurrency,max_retries:e.maxRetries,retry_delay:e.retryDelay,visibility_timeout_ms:e.visibilityTimeoutMs}));break}r.length&&(t.triggers={crons:r}),i.length&&(t.routes=i),a.length&&(t.queues={...t.queues??{},consumers:a}),o!==void 0&&(t.addresses=o)}function Qc(e,t){if(!e.domains||e.domains.length===0)return;let n=t.routes?[...t.routes]:[];for(let t of e.domains)n.push({pattern:t,custom_domain:!0});t.routes=n}function $c(e,t){let n=e.tailConsumers;if(!n||n.length===0)return;let r=[],i=[];for(let e of n)e.streaming?i.push({service:e.workerName}):r.push({service:e.workerName});r.length&&(t.tail_consumers=r),i.length&&(t.streaming_tail_consumers=i)}function $(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}const el=`cf-worker:`,tl=`no-cache`,nl=`cf-no-cache`,rl=/[/\\]node_modules[/\\]/,il=new f;async function al(e,t){sl();let n=d(e).href,r=new Set,i=await il.run(r,()=>import(n,{with:{cf:tl}})),a={};for(let[e,n]of Object.entries(i))t?.include&&!t.include.includes(e)||(a[e]=n);return{exports:a,dependencies:r}}let ol;function sl(){if(ol)return ol;if(typeof process<`u`&&process.versions.bun)throw Error(`cloudflare.config.ts loading is not supported on Bun. Please use Node.js v22.18.0 or higher.`);let e=t.registerHooks;if(typeof e!=`function`)throw Error(`cloudflare.config.ts loading requires Node.js v22.18.0 or higher.`);let n=e({resolve(e,t,n){let r=t.importAttributes??{};if(r.type===`cf-worker`){let n=(e.startsWith(`./`)||e.startsWith(`../`))&&t.parentURL?u(new URL(e,t.parentURL)):e;return{url:`${el}${encodeURIComponent(n)}`,format:`module`,shortCircuit:!0}}let i=r.cf===tl,a=n(e,t);if(rl.test(a.url)||!a.url.startsWith(`file://`))return a;let o=cl(t.parentURL);return!o&&!i?a:(il.getStore()?.add(u(a.url)),a.url=ll(a.url,o||crypto.randomUUID()),a)},load(e,t,n){if(e.startsWith(el)){let t=decodeURIComponent(e.slice(10));return{format:`module`,source:`export default ${JSON.stringify(t)};`,shortCircuit:!0}}return ul(t),n(e,t)}});return ol=()=>{n.deregister(),ol=void 0},ol}function cl(e){if(e)return new URL(e).searchParams.get(nl)??void 0}function ll(e,t){let n=new URL(e);return n.searchParams.set(nl,t),n.toString()}function ul(e){if(!e.importAttributes?.cf)return;let t=Object.assign(Object.create(null),e.importAttributes);delete t.cf,e.importAttributes=t,Object.freeze(e.importAttributes)}async function dl(e,t,n){let{exports:r,dependencies:i}=await al(e,n),a={};for(let[e,n]of Object.entries(r))a[e]=await h(n,t);return{result:Zo.safeParse(a),dependencies:i}}export{_ as S,W as _,q as a,G as b,H as c,J as d,Ua as f,K as g,Ha as h,Do as i,Ka as l,V as m,Jo as n,Fa as o,za as p,Wc as r,U as s,es as t,Eo as u,z as v,La as x,bo as y};
|