@agimon-ai/po-cloudflare 0.0.2-alpha.4 → 0.0.2-alpha.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/README.md +30 -6
  2. package/container/Dockerfile +27 -0
  3. package/dist/{BrowserWebSocketTransport-C2SC2VeJ.js → BrowserWebSocketTransport-B4heNdrp.js} +1 -1
  4. package/dist/{NodeWebSocketTransport-CKilJesa.js → NodeWebSocketTransport-BCiOXUEz.js} +2 -2
  5. package/dist/{abort-signals-Bkmp_euQ.js → abort-signals-BPGaXWA5.js} +1 -1
  6. package/dist/agent-COvApaVM.js +3878 -0
  7. package/dist/{anthropic-messages-CkYm8M3V.js → anthropic-messages-BxS7qXqx.js} +291 -63
  8. package/dist/apiContracts-BCr_ULWJ.js +1603 -0
  9. package/dist/{approval-Eu7UgGL-.js → approval-Cg-PCa5M.js} +19 -3
  10. package/dist/{approvalPrompt-Bg1JrEEY.js → approvalPrompt-D7peArNh.js} +1 -2
  11. package/dist/artifactFiles-CbGIbj93.js +1 -0
  12. package/dist/assets/assets/{CodeEditorView-rEfljuRK.js → CodeEditorView-J2_5q1WT.js} +2 -2
  13. package/dist/assets/assets/{abnfDiagram-WEYOIA3C-J6Iu5p17.js → abnfDiagram-WEYOIA3C-_gWnN1r-.js} +2 -2
  14. package/dist/assets/assets/{architecture-WOLXFQ4H-DKj_xMR1.js → architecture-WOLXFQ4H-DOEVRwUT.js} +1 -1
  15. package/dist/assets/assets/{architectureDiagram-ZHVYKT53--D1MzuBo.js → architectureDiagram-ZHVYKT53-BI3jFrO0.js} +2 -2
  16. package/dist/assets/assets/{blockDiagram-RJAE7QA3-CrWO0t-Q.js → blockDiagram-RJAE7QA3-B_PkpROK.js} +2 -2
  17. package/dist/assets/assets/{c4Diagram-XDPPPE54-CBMOJREz.js → c4Diagram-XDPPPE54-DhSjpw5T.js} +2 -2
  18. package/dist/assets/assets/channel-CVgc46nD.js +2 -0
  19. package/dist/assets/assets/{chunk-2E7WHVMD-CR9NMk46.js → chunk-2E7WHVMD-BrDo2biY.js} +2 -2
  20. package/dist/assets/assets/{chunk-4EMNKR2T-B4D0falO.js → chunk-4EMNKR2T-CdlJ35FL.js} +2 -2
  21. package/dist/assets/assets/{chunk-55XCU76K-CKrttFen.js → chunk-55XCU76K-D9eb1FTZ.js} +2 -2
  22. package/dist/assets/assets/{chunk-7S6XSTFO-BPNrdjSb.js → chunk-7S6XSTFO-VVyUsBaV.js} +2 -2
  23. package/dist/assets/assets/{chunk-AQDTSKZB-Ddx2gPU_.js → chunk-AQDTSKZB-DJmW9j7o.js} +2 -2
  24. package/dist/assets/assets/{chunk-DSNLSHJZ-iQg3RbZ_.js → chunk-DSNLSHJZ-bQ4kpxiE.js} +2 -2
  25. package/dist/assets/assets/{chunk-HAGFOTED-CGlDRwnk.js → chunk-HAGFOTED-CXTtS6oc.js} +2 -2
  26. package/dist/assets/assets/{chunk-HNE4Q36P-CN7VMEsn.js → chunk-HNE4Q36P-CjJ9StOJ.js} +2 -2
  27. package/dist/assets/assets/{chunk-NQOKRVIF-DQKmIS4j.js → chunk-NQOKRVIF-CEttWQFT.js} +2 -2
  28. package/dist/assets/assets/{chunk-UHW7PFBP-BKSG_d1a.js → chunk-UHW7PFBP-CJZzmAtC.js} +2 -2
  29. package/dist/assets/assets/{chunk-VQ5W62QI-AbFHiDOg.js → chunk-VQ5W62QI-Bp76YSjS.js} +2 -2
  30. package/dist/assets/assets/{chunk-WQQL4CDK-C5a4DmCb.js → chunk-WQQL4CDK-wm0yUUcN.js} +2 -2
  31. package/dist/assets/assets/chunk-XXDRQBXY-BkEG_5cB.js +2 -0
  32. package/dist/assets/assets/{chunk-YZO67HFG-UbKezTdY.js → chunk-YZO67HFG-BmXRKyV5.js} +2 -2
  33. package/dist/assets/assets/{chunk-ZAUX2LTX-BShGGpRc.js → chunk-ZAUX2LTX-DJCmQeWP.js} +2 -2
  34. package/dist/assets/assets/{chunk-ZCHMQSOR-BmV-PDP0.js → chunk-ZCHMQSOR-D3pxm97L.js} +2 -2
  35. package/dist/assets/assets/{classDiagram-v2-4MYWR3UA-DB-cfBNq.js → classDiagram-v2-4MYWR3UA-DxMxFm6d.js} +2 -2
  36. package/dist/assets/assets/{cose-bilkent-JH36ORCC-Dprqh48h.js → cose-bilkent-JH36ORCC-Ck_lCjTR.js} +2 -2
  37. package/dist/assets/assets/{cynefin-EF2NZ3EQ-Bz4CND4n.js → cynefin-EF2NZ3EQ-CgjU58bC.js} +1 -1
  38. package/dist/assets/assets/{cynefinDiagram-WF24UDRP-Cv0Tq-0q.js → cynefinDiagram-WF24UDRP-CUP0NVKn.js} +2 -2
  39. package/dist/assets/assets/{dagre-NK4GIZVX-H4d8oeNm.js → dagre-NK4GIZVX-DkvcOoGp.js} +2 -2
  40. package/dist/assets/assets/{diagram-CBK3MWTC-D75OthTM.js → diagram-CBK3MWTC-CFl4wUVN.js} +2 -2
  41. package/dist/assets/assets/{diagram-I5XIIV2D-CB_W2jXU.js → diagram-I5XIIV2D-CldqmFr0.js} +2 -2
  42. package/dist/assets/assets/{diagram-ODIL2UCW-DPO0lYZ-.js → diagram-ODIL2UCW-CPieOVfl.js} +2 -2
  43. package/dist/assets/assets/{diagram-PFBEJUXE-DJ9olXAC.js → diagram-PFBEJUXE-DgTWsRKS.js} +2 -2
  44. package/dist/assets/assets/{diagram-RJA3I4VV-DL3974PI.js → diagram-RJA3I4VV-DmxD5RVL.js} +2 -2
  45. package/dist/assets/assets/{diagram-TYUNFSNR-ZuYESp4p.js → diagram-TYUNFSNR-DC_QoE9Q.js} +2 -2
  46. package/dist/assets/assets/{dist-CeotBqYt.js → dist-BoXKbh_9.js} +2 -2
  47. package/dist/assets/assets/{dist-CdrEbsAL.js → dist-C-aQ-0ab.js} +2 -2
  48. package/dist/assets/assets/{dist-CXqaT1wB.js → dist-CHKWIm0j.js} +2 -2
  49. package/dist/assets/assets/{dist-BnkGKHOV.js → dist-CeZ4Dyeb.js} +2 -2
  50. package/dist/assets/assets/{dist-C8iSs-hT.js → dist-DtfkqVX-.js} +2 -2
  51. package/dist/assets/assets/{dist-G3vL_xw7.js → dist-JVpnlOn0.js} +2 -2
  52. package/dist/assets/assets/{dist-DvCNYjgK.js → dist-L_xVrjFQ.js} +2 -2
  53. package/dist/assets/assets/{dist-zXhaMKmO.js → dist-_Q_eXWhh.js} +2 -2
  54. package/dist/assets/assets/{dist-D2iSi_lg.js → dist-m3yHSyxW.js} +2 -2
  55. package/dist/assets/assets/{ebnfDiagram-V4P3TTPT-DNfHKEsm.js → ebnfDiagram-V4P3TTPT-BdrqTmnC.js} +2 -2
  56. package/dist/assets/assets/{elk-QONTBCTQ-C0FX9D60.js → elk-QONTBCTQ-BBnxKz3T.js} +2 -2
  57. package/dist/assets/assets/{erDiagram-KYQIGQAA-BI1O9lW0.js → erDiagram-KYQIGQAA-DX45_hK2.js} +2 -2
  58. package/dist/assets/assets/{eventmodeling-K75KTNOO-BmWt-aOv.js → eventmodeling-K75KTNOO-EIuQjWpD.js} +1 -1
  59. package/dist/assets/assets/flowDiagram-IUGLLWBU-Bdol35Vj.js +1 -0
  60. package/dist/assets/assets/{ganttDiagram-R7GPNTJY-pM7PmQ6B.js → ganttDiagram-R7GPNTJY-CveiRngd.js} +2 -2
  61. package/dist/assets/assets/{gitGraph-VSP46ZUC-D0QXMQxv.js → gitGraph-VSP46ZUC-D4yRXN3j.js} +1 -1
  62. package/dist/assets/assets/{gitGraphDiagram-PDYL7XHY-BsMltgt3.js → gitGraphDiagram-PDYL7XHY-D5DsbgCK.js} +2 -2
  63. package/dist/assets/assets/index-BDUEIar6.css +1 -0
  64. package/dist/assets/assets/index-BfW-zJ-Y.js +200 -0
  65. package/dist/assets/assets/{info-OHQRW6UA-Dp5Eu5PX.js → info-OHQRW6UA-C0PnFIek.js} +1 -1
  66. package/dist/assets/assets/{infoDiagram-MVDRKAX5-TgXRfZiq.js → infoDiagram-MVDRKAX5-DpwE-14N.js} +2 -2
  67. package/dist/assets/assets/{ishikawaDiagram-HPEHV2GE-Qzrmih4p.js → ishikawaDiagram-HPEHV2GE-X1GxSc7S.js} +2 -2
  68. package/dist/assets/assets/{journeyDiagram-BOSHW7O7-BksI3QOT.js → journeyDiagram-BOSHW7O7-0cwzSgYT.js} +2 -2
  69. package/dist/assets/assets/{kanban-definition-FNSA4HC5-l_IuN5_k.js → kanban-definition-FNSA4HC5-C-U-zp3B.js} +2 -2
  70. package/dist/assets/assets/{line-BDKssGoM.js → line-CxMWkCyB.js} +2 -2
  71. package/dist/assets/assets/{linear-C9vmtzBC.js → linear-BpB8rX3C.js} +2 -2
  72. package/dist/assets/assets/{mermaid-parser.core-O1yFX7K_.js → mermaid-parser.core-CmAfQFuk.js} +4 -4
  73. package/dist/assets/assets/{mermaid.core-CIq57361.js → mermaid.core-BTk7Bw6z.js} +5 -5
  74. package/dist/assets/assets/{mindmap-definition-6OY57UG3-BkVuZ010.js → mindmap-definition-6OY57UG3-B2sMo2jC.js} +2 -2
  75. package/dist/assets/assets/{packet-JDAUHWVQ-PPNcSWeV.js → packet-JDAUHWVQ-BzzVSUon.js} +1 -1
  76. package/dist/assets/assets/{pegDiagram-ECIUJNBX-ClwrHXhM.js → pegDiagram-ECIUJNBX-VIiN2lIU.js} +2 -2
  77. package/dist/assets/assets/{pie-XZMESJXO-BAE4Cy9j.js → pie-XZMESJXO-B-jSi7x9.js} +1 -1
  78. package/dist/assets/assets/{pieDiagram-GNMPY74T-CvQ62Knb.js → pieDiagram-GNMPY74T-190bpqyE.js} +2 -2
  79. package/dist/assets/assets/{quadrantDiagram-D57K4MC3-CzAyT5ZB.js → quadrantDiagram-D57K4MC3-CHsQo88q.js} +2 -2
  80. package/dist/assets/assets/{radar-ABXABTNO-CoEe8B7b.js → radar-ABXABTNO-CW2EglFo.js} +1 -1
  81. package/dist/assets/assets/{railroad-I3PHUGI6-BbK5J8H5.js → railroad-I3PHUGI6-C1b0ftsy.js} +1 -1
  82. package/dist/assets/assets/{railroad-abnf-LNEFI6M7-DlGngfop.js → railroad-abnf-LNEFI6M7-DTT_CP-y.js} +1 -1
  83. package/dist/assets/assets/{railroad-ebnf-DWYD2UWJ-BRk4ifMx.js → railroad-ebnf-DWYD2UWJ-RCPkVVI9.js} +1 -1
  84. package/dist/assets/assets/{railroad-peg-JR7BVNR7-Rz-3vbj2.js → railroad-peg-JR7BVNR7-DixVu6c8.js} +1 -1
  85. package/dist/assets/assets/{railroadDiagram-Y72NRBL7-DQISBRHH.js → railroadDiagram-Y72NRBL7-DbdG32pF.js} +2 -2
  86. package/dist/assets/assets/{requirementDiagram-EQYSW5RA-DcK4FnTB.js → requirementDiagram-EQYSW5RA-U_x9QFHY.js} +2 -2
  87. package/dist/assets/assets/{sankeyDiagram-SY24JHO5-N2EXBOYb.js → sankeyDiagram-SY24JHO5-qfiLv1KI.js} +2 -2
  88. package/dist/assets/assets/{sequenceDiagram-BLEHNHQU-CMJ2EqC_.js → sequenceDiagram-BLEHNHQU-DMBomC37.js} +2 -2
  89. package/dist/assets/assets/{src-Df9VBjd7.js → src-DaNTNLrJ.js} +2 -2
  90. package/dist/assets/assets/{stateDiagram-v2-A6IESKWZ-D6Cxm8wj.js → stateDiagram-v2-A6IESKWZ-BgAnpbx_.js} +2 -2
  91. package/dist/assets/assets/{swimlanes-B3ENRKFQ-BybuzSPd.js → swimlanes-B3ENRKFQ-Dihe5c6o.js} +2 -2
  92. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-Cgg-RsbC.js +9 -0
  93. package/dist/assets/assets/{timeline-definition-JXYKGLGB-BzjkWUdz.js → timeline-definition-JXYKGLGB-BISDYTXW.js} +2 -2
  94. package/dist/assets/assets/{treeView-D4JQ5SDB-DIDWwDtU.js → treeView-D4JQ5SDB-DMSWtiHi.js} +1 -1
  95. package/dist/assets/assets/{treemap-SAJKECNS-SWP4JszI.js → treemap-SAJKECNS-0SsdPE-3.js} +1 -1
  96. package/dist/assets/assets/{usecaseDiagram-WPOLBNNX-ZfCxSJdE.js → usecaseDiagram-WPOLBNNX-CY0WaaL_.js} +2 -2
  97. package/dist/assets/assets/{vennDiagram-Q3Y3IDCW-o44wkgGH.js → vennDiagram-Q3Y3IDCW-DXXcHfKI.js} +2 -2
  98. package/dist/assets/assets/{wardley-7MLQ67FV-0zKRsI4Z.js → wardley-7MLQ67FV-BzVdmZfO.js} +1 -1
  99. package/dist/assets/assets/{wardleyDiagram-IVAIDKWA-CyBVyB40.js → wardleyDiagram-IVAIDKWA-BiDG6ka7.js} +2 -2
  100. package/dist/assets/assets/{webpack-C4nkEwJD.js → webpack-CUCfmjk-.js} +2 -2
  101. package/dist/assets/assets/{xychartDiagram-4URNHDU4-BMvRihYC.js → xychartDiagram-4URNHDU4-DTR1zwTC.js} +2 -2
  102. package/dist/assets/bundle-asset-policy.json +1 -1
  103. package/dist/assets/index.html +8 -2
  104. package/dist/assets/plugins/assets/base-LmdY6uBA.css +2 -0
  105. package/dist/assets/plugins/assets/browserCaptureWorklet-Droj0fW0-Droj0fW0.js +13 -0
  106. package/dist/assets/plugins/assets/sileroVadWorker-D894njUe-DjN_BMWf.mjs +110 -0
  107. package/dist/assets/plugins/assets/silero_vad_v6.2.1-SjbCxFXk-SjbCxFXk.onnx +0 -0
  108. package/dist/assets/plugins/chunks/po-web-runtime-Ka6K4y6i.js +1 -0
  109. package/dist/assets/plugins/compositions.json +1 -1
  110. package/dist/assets/plugins/slots/approval.dd60ec90-D_Iw2VJn.js +2 -0
  111. package/dist/assets/plugins/slots/artifacts.a078f1a5-CS9a_zNA.js +1 -0
  112. package/dist/assets/plugins/slots/author.497633d0-BFa_H5ZE.js +93 -0
  113. package/dist/assets/plugins/slots/autocompact.86aeccf4-B0hGnck7.js +1 -0
  114. package/dist/assets/plugins/slots/browse.5fcf164c-CVRtiGzR.js +1 -0
  115. package/dist/assets/plugins/slots/builtin-tools.0a7f0b8e-CJTf-98P.js +7 -0
  116. package/dist/assets/plugins/slots/codemode.ff16ac06-BRYQKsyR.js +11 -0
  117. package/dist/assets/plugins/slots/domain.3ddea842-02QPrhJk.js +1 -0
  118. package/dist/assets/plugins/slots/edit.c5b0b072-CETRuGf0.js +7 -0
  119. package/dist/assets/plugins/slots/files.8ffcdcc0-DgGX5poR.js +2 -0
  120. package/dist/assets/plugins/slots/goal.423c7a26-D67j7FqW.js +1 -0
  121. package/dist/assets/plugins/slots/grep.95f470b3-CmhMD_DW.js +1 -0
  122. package/dist/assets/plugins/slots/help.03b9ba99-os14i52k.js +3 -0
  123. package/dist/assets/plugins/slots/log.19bda339-DvprmzHk.js +4 -0
  124. package/dist/assets/plugins/slots/mcp.ffbe405a-CcCIF5cJ.js +109 -0
  125. package/dist/assets/plugins/slots/plan.5eac6563-CqYx6E9R.js +3 -0
  126. package/dist/assets/plugins/slots/{profile.ab16dcec-Cu6ev2uW.js → profile.176710dd-BDgBh-Su.js} +1 -1
  127. package/dist/assets/plugins/slots/prompts.2c187969-Bls5s3m1.js +3 -0
  128. package/dist/assets/plugins/slots/read.1629d556-Bg9NIMAZ.js +1 -0
  129. package/dist/assets/plugins/slots/runner.962030e5-_04Fb699.js +8 -0
  130. package/dist/assets/plugins/slots/sessions.fc763f42-BaHBIWGm.js +1 -0
  131. package/dist/assets/plugins/slots/skill.f5396fde-MNxJbIRc.js +4 -0
  132. package/dist/assets/plugins/slots/subagents.d815a296-DNYKN2_3.js +7 -0
  133. package/dist/assets/plugins/slots/vault.57fd9047-C3YDx6j4.js +1 -0
  134. package/dist/assets/plugins/slots/voice.b709d05c-BT788wX1.js +1 -0
  135. package/dist/assets/pwa/pwa.js +12 -12
  136. package/dist/assets/pwa/sw.js +4 -4
  137. package/dist/{atomicJson-DwSqByUJ.js → atomicJson-CU27fWtF.js} +2 -3
  138. package/dist/{azure-openai-config-DHMgdIa-.js → azure-openai-config-DkmTos8T.js} +2 -2
  139. package/dist/{azure-openai-responses-CTgRdQ4m.js → azure-openai-responses-sm_U3omr.js} +13 -13
  140. package/dist/backgroundWork-C3TYOD5X.js +49 -0
  141. package/dist/browser-BWf8OMfl.js +3 -0
  142. package/dist/{browser-EJ5_ffnN.js → browser-IsHIcvFg.js} +1 -1
  143. package/dist/childSession-Cf2-kH4O.js +22 -0
  144. package/dist/{classifier-shared-jXm-plIK.js → classifier-shared-B7BdEyPa.js} +5 -5
  145. package/dist/{cloudflare-workers-ai-system-one-B0wH6HU5.js → cloudflare-workers-ai-system-one-DpnCKwVj.js} +3 -3
  146. package/dist/{codemode-yHAHBZO-.js → codemode-CU_gontV.js} +5 -2
  147. package/dist/contracts-B_eb2dl9.js +19 -0
  148. package/dist/contracts-mVtrvUmY.js +40 -0
  149. package/dist/{diagnostics-DPTP-yrt.js → diagnostics-C43OHsIc.js} +2 -2
  150. package/dist/{server-y9pjeHJM.js → dist-B-vqs6tA.js} +1 -546
  151. package/dist/{dist-Dvx5mlIR.js → dist-CLdzaXdw.js} +16 -3
  152. package/dist/{dist-BVBi6VMV.js → dist-CfOWb6f7.js} +1 -1
  153. package/dist/{dist-PDDFdqDX.js → dist-Dd6zUvjw.js} +1 -1
  154. package/dist/edge-accj222e.js +266 -0
  155. package/dist/{emscripten-module.cloudflare-D4Bc9Ykz.js → emscripten-module.cloudflare-B4fhfquU.js} +1 -1
  156. package/dist/{env-api-keys-CAnjjnsR.js → env-api-keys-CSPKWgJn.js} +1 -1
  157. package/dist/{error-body-DQZRsyL5.js → error-body-BvLDKbXN.js} +26 -4
  158. package/dist/esm-BKJy3O9-.js +1553 -0
  159. package/dist/{exports-CrJqsTU6.js → exports-BlsXYnB_.js} +27 -9
  160. package/dist/{remoteMcp-Ci8crSU9.js → exports-CHx8bsjQ.js} +1062 -176
  161. package/dist/exports-CUM-AowA.js +34 -0
  162. package/dist/extensionFile-Bf1PbYVu.js +121 -0
  163. package/dist/{factory-Cs8iaUtc.js → factory-DwoANAyi.js} +1 -1
  164. package/dist/{github-copilot-headers-DpQQAh-s.js → github-copilot-headers-CZIImZmD.js} +1 -1
  165. package/dist/{google-generative-ai-BTTOo5RQ.js → google-generative-ai-P4ubvgcU.js} +9 -9
  166. package/dist/{google-shared-S7bqOccz.js → google-shared-C8Kez75I.js} +6 -6
  167. package/dist/{google-vertex-BcMU_DMb.js → google-vertex-T1trcCEz.js} +10 -10
  168. package/dist/{domains-dHfk2U8X.js → harnessState-DMini_AN.js} +175 -16
  169. package/dist/{harnessStore-CRtlTdbI.js → harnessStore-CTomNyVl.js} +4 -5
  170. package/dist/{hash-B3RRpLS2.js → hash-CMLRVP3c.js} +1 -1
  171. package/dist/{headers-BEuxFxDI.js → headers-CX-ZuPIi.js} +1 -1
  172. package/dist/help-BxTDP41H.js +1 -0
  173. package/dist/help-C4aC-kWh.js +100 -0
  174. package/dist/http-4lVtjwa7.js +59 -0
  175. package/dist/{hubChannel-Cj1iF847.js → hubChannel-Bq4zyVgX.js} +12 -29
  176. package/dist/hubRevisions-BknPawK7.js +364 -0
  177. package/dist/{identity-BIeAyilV.js → identity-DEwhWpjw.js} +3 -3
  178. package/dist/index.edge-ClLTmPFz.js +191 -0
  179. package/dist/index.edge-CwcYQLj9.js +70 -0
  180. package/dist/index.edge-D2RirEwK.js +14 -0
  181. package/dist/index.edge-Dw11TL5F.js +56 -0
  182. package/dist/index.edge-DyUqSroq.js +67 -0
  183. package/dist/index.edge-Ts1NG9b4.js +937 -0
  184. package/dist/iso-BCXA5x1w.js +10 -0
  185. package/dist/{kysely-adapter-D51abb3q.js → kysely-adapter-D3TQ9BKb.js} +1 -1
  186. package/dist/{layeredConfig-BqIwPJ-I.js → layeredConfig-DVe-JMGQ.js} +217 -24
  187. package/dist/{majorModes-C-OD4PBc.js → majorModes-BBT0wftm.js} +4 -14
  188. package/dist/majorModes-BcA8pk7t.js +1 -0
  189. package/dist/{mcpProjection-BsP0IEnb.js → mcpProjection-BZoy_uKa.js} +1 -2
  190. package/dist/{mistral-conversations-DN8VSERk.js → mistral-conversations-jEBsA1Xz.js} +12 -12
  191. package/dist/modeDefinition-C3Zbrw48.js +44 -0
  192. package/dist/{models-D6d73jcW.js → models-BoBYu6VI.js} +41 -46
  193. package/dist/narration-BtGsZwE7.js +127 -0
  194. package/dist/{node-UuMT2C3q.js → node-CdIUdDAa.js} +2 -2
  195. package/dist/{node-DytJOfYf.js → node-CjBe953N.js} +2 -2
  196. package/dist/notification-BHaYyLJJ.js +101 -0
  197. package/dist/{openai-bt3ZRBZv.js → openai-69NOv-G_.js} +187 -187
  198. package/dist/{openai-codex-responses-cL36x0ml.js → openai-codex-responses-x01Vnd68.js} +21 -25
  199. package/dist/{openai-completions-BWsTNYyT.js → openai-completions-B81ryS-E.js} +26 -19
  200. package/dist/{openai-decisions-Dfn_KgQd.js → openai-decisions-Kybq6lsr.js} +3 -3
  201. package/dist/{openai-responses-aa0LoyCJ.js → openai-responses-BK5Zz1Ib.js} +17 -15
  202. package/dist/{openai-responses-shared-H-jH5SlM.js → openai-responses-shared-b4nN_ZS7.js} +7 -7
  203. package/dist/{openrouter-cost-D99Qqcs6.js → openrouter-cost-C4M4CjUF.js} +1 -1
  204. package/dist/{openrouter-images-BpwVpALC.js → openrouter-images-DMMiksXo.js} +7 -7
  205. package/dist/photon_rs_bg.wasm +0 -0
  206. package/dist/{pi-messages-BHAIkYBj.js → pi-messages-D3F6NGQb.js} +6 -6
  207. package/dist/piConfig-BeRtzEWI.js +126 -0
  208. package/dist/piSettings-CDcdxob2.js +1 -0
  209. package/dist/platform-CAhzdBhg.js +113 -0
  210. package/dist/pluginContributions-Be9EnCAW.js +16 -0
  211. package/dist/pluginProtocol-ZOY2-HIL.js +136 -0
  212. package/dist/{protocol-Xpm_mCNN.js → protocol-Db1l1xpe.js} +1 -2
  213. package/dist/{provider-env-DgfpjgTa.js → provider-env-C6KlbHmf.js} +2 -2
  214. package/dist/{provider-retry-ChD-K2Gv.js → provider-retry-C8AvzuUi.js} +1 -1
  215. package/dist/{puppeteer-cloudflare-B-GHrPGO.js → puppeteer-cloudflare-D4l8smMS.js} +3 -3
  216. package/dist/{rolldown-runtime-B-lAHAz2.js → rolldown-runtime-DbVrKiKs.js} +1 -1
  217. package/dist/{sanitize-unicode-Dl4ROF7y.js → sanitize-unicode-Di-31Zpn.js} +1 -1
  218. package/dist/{schemas-Vj8-rCR4.js → schemas-BMBR99Q5.js} +3 -2
  219. package/dist/server-4R5ZprW5.js +978 -0
  220. package/dist/server-B0PFs3Yl.js +288 -0
  221. package/dist/server-B4f5d7ka.js +1811 -0
  222. package/dist/server-BQ0I9oeZ.js +1359 -0
  223. package/dist/server-BZ_bk5i9.js +295 -0
  224. package/dist/{server-CUvohcAm.js → server-Ba7pnDkx.js} +54 -47
  225. package/dist/server-BayLsR7Z.js +343 -0
  226. package/dist/{server-BccTx_r6.js → server-BbNo0APc.js} +121 -19
  227. package/dist/server-Bi9VOAOP.js +833 -0
  228. package/dist/{server-De_PIOty.js → server-BkmcRLIT.js} +47 -27
  229. package/dist/{server-DwWTQg1J.js → server-BwtSRROE.js} +14 -5
  230. package/dist/server-BxzzL3_G.js +1883 -0
  231. package/dist/{server-CYQHzqaQ.js → server-By1ctEvA.js} +11 -9
  232. package/dist/server-CA5TuWDo.js +3125 -0
  233. package/dist/{server-C1ijZQp4.js → server-CBHlRlm4.js} +3 -10
  234. package/dist/server-CDypk2xJ.js +1296 -0
  235. package/dist/server-ChlBgWIn.js +1116 -0
  236. package/dist/server-CkMqSsYi.js +15105 -0
  237. package/dist/server-CnsLcuj-.js +1518 -0
  238. package/dist/server-CrqcdtBx.js +178 -0
  239. package/dist/server-CwlDZ2N-.js +491 -0
  240. package/dist/server-D3j7dywQ.js +576 -0
  241. package/dist/server-DXD7cbH0.js +679 -0
  242. package/dist/server-DesEguVZ.js +640 -0
  243. package/dist/server-Dqjcc8p0.js +2656 -0
  244. package/dist/{server-BPvd3Ya5.js → server-DrmY-Chg.js} +570 -127
  245. package/dist/{server-B2xd7WTP.js → server-DtCOCPGp.js} +9 -20
  246. package/dist/server-DuAckacI.js +1522 -0
  247. package/dist/server-EgPpwMaj.js +505 -0
  248. package/dist/server-h0TSZCjm.js +189 -0
  249. package/dist/serverPlugin-Cx6a5RT0.js +36624 -0
  250. package/dist/session-resources-DLg07yAP.js +10 -0
  251. package/dist/{sessionConfig-2a4LWInR.js → sessionConfig-6NVRcVwL.js} +615 -766
  252. package/dist/{simple-options-DWrW31_K.js → simple-options-DM-a_ljY.js} +13 -6
  253. package/dist/{streaming-json-t4rzNHEp.js → streaming-json-Bs_lERVE.js} +6 -6
  254. package/dist/{system-one-shared-DLVLdzYL.js → system-one-shared-B63vQ3Om.js} +3 -3
  255. package/dist/{notification-D76PSL7r.js → telemetry-CrTcxeA5.js} +2 -93
  256. package/dist/{transform-messages-CjTSwW9q.js → transform-messages-Bbr4sgbB.js} +3 -16
  257. package/dist/truncate-M3KbFyVj.js +89 -0
  258. package/dist/{server-DrZBZ17y.js → type-CuAiPMD4.js} +569 -1409
  259. package/dist/type-yokaDI_F.js +7 -0
  260. package/dist/{typesafe-system-one-DBVcjcUQ.js → typesafe-system-one-7g930h9C.js} +3 -3
  261. package/dist/{uuid-mkNGilLv.js → uuid-D5Z4Ivdo.js} +1 -1
  262. package/dist/{validation-D77NZBrx.js → validation-DesEfRe-.js} +8 -3
  263. package/dist/vaultSettings-BdkqnmJf.js +292 -0
  264. package/dist/voiceTools-Chad-LEE.js +246 -0
  265. package/dist/web-QeFwt_Vl.js +3 -0
  266. package/dist/worker.js +56560 -35339
  267. package/dist/workflow-BLBCriNp.js +113 -0
  268. package/package.json +44 -25
  269. package/wrangler.jsonc +13 -3
  270. package/dist/apiContracts-CHOiCbS_.js +0 -4451
  271. package/dist/assets/assets/channel-CNegK3Rr.js +0 -2
  272. package/dist/assets/assets/chunk-XXDRQBXY-BbVKQGnw.js +0 -2
  273. package/dist/assets/assets/flowDiagram-IUGLLWBU-DQj3H5a6.js +0 -1
  274. package/dist/assets/assets/index-BTHzc8EN.js +0 -155
  275. package/dist/assets/assets/index-DZM68mTk.css +0 -1
  276. package/dist/assets/assets/swimlanesDiagram-AYQRV4AK-CXJkO6sc.js +0 -9
  277. package/dist/assets/plugins/assets/base-B5jpmLBl.css +0 -2
  278. package/dist/assets/plugins/chunks/po-web-runtime-D4qQFtJO.js +0 -1
  279. package/dist/assets/plugins/slots/approval.09e72f36-Cck_K9ex.js +0 -2
  280. package/dist/assets/plugins/slots/artifacts.50b639bb-BZM7uEbe.js +0 -1
  281. package/dist/assets/plugins/slots/builtin-tools.75108f21-EWWGTveL.js +0 -7
  282. package/dist/assets/plugins/slots/codemode.c58fb583-CgfTL6kt.js +0 -9
  283. package/dist/assets/plugins/slots/domain.753f9f92-BU0ilfwM.js +0 -1
  284. package/dist/assets/plugins/slots/mcp.82cc1ff5-BaCD2xZB.js +0 -109
  285. package/dist/assets/plugins/slots/skill.62a0a1b3-Bz20F1eA.js +0 -4
  286. package/dist/backgroundWork-bE3pc-R9.js +0 -25
  287. package/dist/build-2gFaVEfG.js +0 -3355
  288. package/dist/contextProjection-DVP2Vc5j.js +0 -188
  289. package/dist/extensionFile-CY4EFNHQ.js +0 -409
  290. package/dist/harnessState-gmzJcPGt.js +0 -88
  291. package/dist/harnessStore-DZ4lDIq6.js +0 -1
  292. package/dist/index.edge-BgSx_gRO.js +0 -45
  293. package/dist/majorModes-AYZvnOpU.js +0 -1
  294. package/dist/piSettings-B6fsgIBA.js +0 -1
  295. package/dist/platform-CNhm9zLi.js +0 -16
  296. package/dist/platformFiles-3rzOh9cg.js +0 -39
  297. package/dist/server-Bf3_VTkt.js +0 -592
  298. package/dist/server-BmAziQml.js +0 -657
  299. package/dist/server-BvV-GqDO.js +0 -280
  300. package/dist/server-xiuzwJ1C.js +0 -118
  301. package/dist/serverPlugin-H4T49sac.js +0 -3347
  302. package/dist/value-Djvc2foV.js +0 -2247
@@ -1,3355 +0,0 @@
1
- import { n as __exportAll } from "./rolldown-runtime-B-lAHAz2.js";
2
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/system/memory/metrics.mjs
3
- /** TypeBox instantiation metrics */
4
- const Metrics = {
5
- assign: 0,
6
- create: 0,
7
- clone: 0,
8
- discard: 0,
9
- update: 0
10
- };
11
- //#endregion
12
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/guard/unicode/unicode_segment.mjs
13
- function IsBetween(value, min, max) {
14
- return value >= min && value <= max;
15
- }
16
- function IsZeroWidthJoiner(value) {
17
- return value === 8205;
18
- }
19
- function IsRegionalIndicator(value) {
20
- return IsBetween(value, 127462, 127487);
21
- }
22
- function IsVariationSelector(value) {
23
- return IsBetween(value, 65024, 65039);
24
- }
25
- function IsCombiningMark(value) {
26
- return IsBetween(value, 768, 879) || IsBetween(value, 6832, 6911) || IsBetween(value, 7616, 7679) || IsBetween(value, 65056, 65071);
27
- }
28
- function CodePointLength(value) {
29
- return value > 65535 ? 2 : 1;
30
- }
31
- function ConsumeModifiers(value, index) {
32
- while (index < value.length) {
33
- const point = value.codePointAt(index);
34
- if (IsCombiningMark(point) || IsVariationSelector(point)) index += CodePointLength(point);
35
- else break;
36
- }
37
- return index;
38
- }
39
- function NextGraphemeClusterIndex(value, clusterStart) {
40
- const startCP = value.codePointAt(clusterStart);
41
- let clusterEnd = clusterStart + CodePointLength(startCP);
42
- clusterEnd = ConsumeModifiers(value, clusterEnd);
43
- while (clusterEnd < value.length - 1 && IsZeroWidthJoiner(value.codePointAt(clusterEnd))) {
44
- const nextCP = value.codePointAt(clusterEnd + 1);
45
- clusterEnd += 1 + CodePointLength(nextCP);
46
- clusterEnd = ConsumeModifiers(value, clusterEnd);
47
- }
48
- if (IsRegionalIndicator(startCP) && clusterEnd < value.length && IsRegionalIndicator(value.codePointAt(clusterEnd))) clusterEnd += CodePointLength(value.codePointAt(clusterEnd));
49
- return clusterEnd;
50
- }
51
- /** Returns the number of grapheme clusters in a string */
52
- function GraphemeCount$1(value) {
53
- let count = 0, index = 0;
54
- while (index < value.length) {
55
- index = NextGraphemeClusterIndex(value, index);
56
- count++;
57
- }
58
- return count;
59
- }
60
- //#endregion
61
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/guard/unicode/unicode.mjs
62
- /** Returns the total number of Unicode code points in the string */
63
- function CodePointCount$1(value) {
64
- let result = 0, index = 0, prev = 0;
65
- while (index < value.length) {
66
- const next = value.charCodeAt(index++) >> 10;
67
- result += +((prev << 8 | next) !== 13879);
68
- prev = next;
69
- }
70
- return result;
71
- }
72
- /** Returns true if the string length in Unicode code points is less than or equal to maxLength */
73
- function IsMaxLength$1(value, maxLength) {
74
- return value.length <= maxLength || value.length <= maxLength << 1 && CodePointCount$1(value) <= maxLength;
75
- }
76
- /** Returns true if the string length in Unicode code points is greater than or equal to minLength */
77
- function IsMinLength$1(value, minLength) {
78
- return value.length >= minLength << 1 || value.length >= minLength && CodePointCount$1(value) >= minLength;
79
- }
80
- //#endregion
81
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/guard/guard.mjs
82
- var guard_exports = /* @__PURE__ */ __exportAll({
83
- CodePointCount: () => CodePointCount,
84
- Counted: () => Counted,
85
- Entries: () => Entries,
86
- EntriesRegExp: () => EntriesRegExp,
87
- Every: () => Every,
88
- EveryAll: () => EveryAll,
89
- GraphemeCount: () => GraphemeCount,
90
- HasPropertyKey: () => HasPropertyKey,
91
- IsArray: () => IsArray$1,
92
- IsBigInt: () => IsBigInt$1,
93
- IsBoolean: () => IsBoolean$2,
94
- IsClassInstance: () => IsClassInstance,
95
- IsConstructor: () => IsConstructor$1,
96
- IsDeepEqual: () => IsDeepEqual,
97
- IsEqual: () => IsEqual,
98
- IsFunction: () => IsFunction$1,
99
- IsGreaterEqualThan: () => IsGreaterEqualThan,
100
- IsGreaterThan: () => IsGreaterThan,
101
- IsInteger: () => IsInteger$1,
102
- IsLessEqualThan: () => IsLessEqualThan,
103
- IsLessThan: () => IsLessThan,
104
- IsMaxLength: () => IsMaxLength,
105
- IsMinLength: () => IsMinLength,
106
- IsMultipleOf: () => IsMultipleOf,
107
- IsNull: () => IsNull$1,
108
- IsNumber: () => IsNumber$2,
109
- IsObject: () => IsObject$1,
110
- IsObjectNotArray: () => IsObjectNotArray,
111
- IsString: () => IsString$2,
112
- IsSymbol: () => IsSymbol$1,
113
- IsUndefined: () => IsUndefined$1,
114
- IsUnsafePropertyKey: () => IsUnsafePropertyKey,
115
- IsValueLike: () => IsValueLike,
116
- Keys: () => Keys$1,
117
- ShiftLeft: () => ShiftLeft,
118
- Some: () => Some,
119
- SomeAll: () => SomeAll,
120
- Symbols: () => Symbols,
121
- Values: () => Values
122
- });
123
- /** Returns true if this value is an array */
124
- function IsArray$1(value) {
125
- return Array.isArray(value);
126
- }
127
- /** Returns true if this value is bigint */
128
- function IsBigInt$1(value) {
129
- return IsEqual(typeof value, "bigint");
130
- }
131
- /** Returns true if this value is a boolean */
132
- function IsBoolean$2(value) {
133
- return IsEqual(typeof value, "boolean");
134
- }
135
- /** Returns true if this value is a constructor */
136
- function IsConstructor$1(value) {
137
- if (IsUndefined$1(value) || !IsFunction$1(value)) return false;
138
- const result = Function.prototype.toString.call(value);
139
- if (/^class\s/.test(result)) return true;
140
- if (/\[native code\]/.test(result)) return true;
141
- return false;
142
- }
143
- /** Returns true if this value is a function */
144
- function IsFunction$1(value) {
145
- return IsEqual(typeof value, "function");
146
- }
147
- /** Returns true if this value is integer */
148
- function IsInteger$1(value) {
149
- return Number.isInteger(value);
150
- }
151
- /** Returns true if this value is null */
152
- function IsNull$1(value) {
153
- return IsEqual(value, null);
154
- }
155
- /** Returns true if this value is number */
156
- function IsNumber$2(value) {
157
- return Number.isFinite(value);
158
- }
159
- /** Returns true if this value is an object but not an array */
160
- function IsObjectNotArray(value) {
161
- return IsObject$1(value) && !IsArray$1(value);
162
- }
163
- /** Returns true if this value is an object */
164
- function IsObject$1(value) {
165
- return IsEqual(typeof value, "object") && !IsNull$1(value);
166
- }
167
- /** Returns true if this value is string */
168
- function IsString$2(value) {
169
- return IsEqual(typeof value, "string");
170
- }
171
- /** Returns true if this value is symbol */
172
- function IsSymbol$1(value) {
173
- return IsEqual(typeof value, "symbol");
174
- }
175
- /** Returns true if this value is undefined */
176
- function IsUndefined$1(value) {
177
- return IsEqual(value, void 0);
178
- }
179
- function IsEqual(left, right) {
180
- return left === right;
181
- }
182
- function IsGreaterThan(left, right) {
183
- return left > right;
184
- }
185
- function IsLessThan(left, right) {
186
- return left < right;
187
- }
188
- function IsLessEqualThan(left, right) {
189
- return left <= right;
190
- }
191
- function IsGreaterEqualThan(left, right) {
192
- return left >= right;
193
- }
194
- function IsMultipleOf(dividend, divisor) {
195
- if (IsBigInt$1(dividend) || IsBigInt$1(divisor)) return BigInt(dividend) % BigInt(divisor) === 0n;
196
- const tolerance = 1e-10;
197
- if (!IsNumber$2(dividend)) return true;
198
- if (IsInteger$1(dividend) && 1 / divisor % 1 === 0) return true;
199
- const mod = dividend % divisor;
200
- return Math.min(Math.abs(mod), Math.abs(mod - divisor), Math.abs(mod + divisor)) < tolerance;
201
- }
202
- /** Returns true if the value appears to be an instance of a class. */
203
- function IsClassInstance(value) {
204
- if (!IsObject$1(value)) return false;
205
- const proto = globalThis.Object.getPrototypeOf(value);
206
- if (IsNull$1(proto)) return false;
207
- return IsEqual(typeof proto.constructor, "function") && !(IsEqual(proto.constructor, globalThis.Object) || IsEqual(proto.constructor.name, "Object"));
208
- }
209
- function IsValueLike(value) {
210
- return IsBigInt$1(value) || IsBoolean$2(value) || IsNull$1(value) || IsNumber$2(value) || IsString$2(value) || IsUndefined$1(value);
211
- }
212
- /** Returns the total number of visual grapheme clusters in the string. */
213
- function GraphemeCount(value) {
214
- return GraphemeCount$1(value);
215
- }
216
- /** Returns the total number of Unicode code points in the string. */
217
- function CodePointCount(value) {
218
- return CodePointCount$1(value);
219
- }
220
- /** Returns true if the string length in Unicode code points does not exceed maxLength */
221
- function IsMaxLength(value, maxLength) {
222
- return IsMaxLength$1(value, maxLength);
223
- }
224
- /** Returns true if the string length in Unicode code points is at least minLength */
225
- function IsMinLength(value, minLength) {
226
- return IsMinLength$1(value, minLength);
227
- }
228
- /** Returns true if every element from offset satisfies the callback, short-circuiting on the first failure */
229
- function Every(value, offset, callback) {
230
- return value.every((item, index) => index < offset || callback(item, index));
231
- }
232
- /** Returns true if every element from offset satisfies the callback, using exhaustive enumeration */
233
- function EveryAll(value, offset, callback) {
234
- let result = true;
235
- value.forEach((item, index) => {
236
- if (index >= offset && !callback(item, index)) result = false;
237
- });
238
- return result;
239
- }
240
- /** Returns true if some element satisfies the callback, short-circuiting on the first success */
241
- function Some(value, callback) {
242
- return value.some((value, index) => callback(value, index));
243
- }
244
- /** Returns true if some element satisfies the callback, using exhaustive enumeration */
245
- function SomeAll(value, callback) {
246
- let result = false;
247
- value.forEach((item, index) => {
248
- if (callback(item, index)) result = true;
249
- });
250
- return result;
251
- }
252
- /** Returns the count of elements that satisfy the callback */
253
- function Counted(value, callback) {
254
- return value.reduce((result, value, index) => callback(value, index) ? ++result : result, 0);
255
- }
256
- /** Shifts the left-most element from an array and dispatches to the true arm, or the false arm if empty */
257
- function ShiftLeft(array, true_, false_) {
258
- return IsEqual(array.length, 0) ? false_() : true_(array[0], array.slice(1));
259
- }
260
- /** Returns true if the PropertyKey is Unsafe (ref: prototype-pollution). */
261
- function IsUnsafePropertyKey(key) {
262
- return IsEqual(key, "__proto__") || IsEqual(key, "constructor") || IsEqual(key, "prototype");
263
- }
264
- /** Returns true if this value has this property key */
265
- function HasPropertyKey(value, key) {
266
- return IsUnsafePropertyKey(key) ? Object.prototype.hasOwnProperty.call(value, key) : key in value;
267
- }
268
- /** Returns object entries as `[RegExp, Value][]` */
269
- function EntriesRegExp(value) {
270
- return Keys$1(value).map((key) => [new RegExp(`^${key}$`), value[key]]);
271
- }
272
- /** Returns object entries as `[string, Value][]` */
273
- function Entries(value) {
274
- return Object.entries(value);
275
- }
276
- /** Returns property keys for this object via `Object.getOwnPropertyNames({ ... })` */
277
- function Keys$1(value) {
278
- return Object.getOwnPropertyNames(value);
279
- }
280
- /** Returns the property keys for this object via `Object.getOwnPropertySymbols({ ... })` */
281
- function Symbols(value) {
282
- return Object.getOwnPropertySymbols(value);
283
- }
284
- /** Returns the property values for the given object via `Object.values()` */
285
- function Values(value) {
286
- return Object.values(value);
287
- }
288
- function DeepEqualObject(left, right) {
289
- if (!IsObject$1(right)) return false;
290
- const keys = Keys$1(left);
291
- return IsEqual(keys.length, Keys$1(right).length) && keys.every((key) => IsDeepEqual(left[key], right[key]));
292
- }
293
- function DeepEqualArray(left, right) {
294
- return IsArray$1(right) && IsEqual(left.length, right.length) && left.every((_, index) => IsDeepEqual(left[index], right[index]));
295
- }
296
- /** Returns true if left and right values are structurally equal */
297
- function IsDeepEqual(left, right) {
298
- return IsArray$1(left) ? DeepEqualArray(left, right) : IsObject$1(left) ? DeepEqualObject(left, right) : IsEqual(left, right);
299
- }
300
- //#endregion
301
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/guard/globals.mjs
302
- function IsBoolean$1(value) {
303
- return value instanceof Boolean;
304
- }
305
- function IsNumber$1(value) {
306
- return value instanceof Number;
307
- }
308
- function IsString$1(value) {
309
- return value instanceof String;
310
- }
311
- function IsTypeArray(value) {
312
- return globalThis.ArrayBuffer.isView(value);
313
- }
314
- /** Returns true if the value is a RegExp */
315
- function IsRegExp(value) {
316
- return value instanceof globalThis.RegExp;
317
- }
318
- /** Returns true if the value is a Date */
319
- function IsDate(value) {
320
- return value instanceof globalThis.Date;
321
- }
322
- /** Returns true if the value is a Set */
323
- function IsSet(value) {
324
- return value instanceof globalThis.Set;
325
- }
326
- /** Returns true if the value is a Map */
327
- function IsMap(value) {
328
- return value instanceof globalThis.Map;
329
- }
330
- //#endregion
331
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/system/settings/settings.mjs
332
- const settings = {
333
- immutableTypes: false,
334
- maxErrors: 8,
335
- maxParseErrors: 1,
336
- maxInstantiationCount: 128,
337
- useAcceleration: true,
338
- exactOptionalPropertyTypes: false,
339
- enumerableKind: false,
340
- correctiveParse: false,
341
- unionPrioritySort: true
342
- };
343
- /** Gets current system settings */
344
- function Get() {
345
- return settings;
346
- }
347
- //#endregion
348
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/system/memory/keys.mjs
349
- /** Returns the own string and symbol keys of the given object. */
350
- function Keys(value) {
351
- return [...Keys$1(value), ...Symbols(value)];
352
- }
353
- //#endregion
354
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/system/memory/finalize.mjs
355
- function Freeze(value, seen) {
356
- if (seen.has(value)) return;
357
- seen.add(value);
358
- for (const key of Keys(value)) {
359
- const descriptor = Object.getOwnPropertyDescriptor(value, key);
360
- if (!descriptor || !("value" in descriptor)) continue;
361
- if (IsObject$1(descriptor.value)) Freeze(descriptor.value, seen);
362
- }
363
- Object.freeze(value);
364
- }
365
- /** Finalizes a type. Will recursively freeze if `immutableTypes` is true, otherwise no action. */
366
- function Finalize(value) {
367
- if (!Get().immutableTypes) return value;
368
- Freeze(value, /* @__PURE__ */ new WeakSet());
369
- return value;
370
- }
371
- //#endregion
372
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/system/memory/assign.mjs
373
- /** Performs an Object assign using the Left and Right object types. */
374
- function Assign(left, right) {
375
- Metrics.assign += 1;
376
- const result = {}, rightKeys = Keys(right), leftKeys = Keys(left);
377
- for (const key of leftKeys) {
378
- if (rightKeys.includes(key)) continue;
379
- Object.defineProperty(result, key, Object.getOwnPropertyDescriptor(left, key));
380
- }
381
- for (const key of rightKeys) Object.defineProperty(result, key, Object.getOwnPropertyDescriptor(right, key));
382
- return Finalize(result);
383
- }
384
- //#endregion
385
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/system/memory/create.mjs
386
- function WithEnumerable$1(left, right) {
387
- return {
388
- ...left,
389
- ...right
390
- };
391
- }
392
- function WithHidden$1(left, right) {
393
- for (const key of Object.keys(right)) Object.defineProperty(left, key, {
394
- configurable: true,
395
- writable: true,
396
- enumerable: false,
397
- value: right[key]
398
- });
399
- return left;
400
- }
401
- /** Creates an object with hidden, enumerable, and optional property sets. */
402
- function Create(hidden, enumerable, options = {}) {
403
- Metrics.create += 1;
404
- const withEnumerable = WithEnumerable$1(enumerable, options);
405
- return Finalize(Get().enumerableKind ? WithEnumerable$1(withEnumerable, hidden) : WithHidden$1(withEnumerable, hidden));
406
- }
407
- //#endregion
408
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/system/memory/discard.mjs
409
- /** Discards property keys from the given object. */
410
- function Discard(value, propertyKeys) {
411
- Metrics.discard += 1;
412
- const result = {};
413
- for (const key of Keys(value)) {
414
- if (propertyKeys.includes(key)) continue;
415
- const descriptor = Object.getOwnPropertyDescriptor(value, key);
416
- Object.defineProperty(result, key, descriptor);
417
- }
418
- return Finalize(result);
419
- }
420
- //#endregion
421
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/system/memory/update.mjs
422
- function WithCurrent(current, hiddenKeys, enumerableKeys, result) {
423
- for (const key of Keys(current)) {
424
- if (IsUnsafePropertyKey(key) || hiddenKeys.includes(key) || enumerableKeys.includes(key)) continue;
425
- const descriptor = Object.getOwnPropertyDescriptor(current, key);
426
- Object.defineProperty(result, key, descriptor);
427
- }
428
- }
429
- function WithHidden(hidden, keys, result) {
430
- const enumerableKind = Get().enumerableKind;
431
- for (const key of keys) {
432
- if (IsUnsafePropertyKey(key)) continue;
433
- Object.defineProperty(result, key, {
434
- configurable: true,
435
- writable: true,
436
- enumerable: enumerableKind,
437
- value: hidden[key]
438
- });
439
- }
440
- }
441
- function WithEnumerable(enumerable, keys, result) {
442
- for (const key of keys) {
443
- if (IsUnsafePropertyKey(key)) continue;
444
- Object.defineProperty(result, key, {
445
- configurable: true,
446
- enumerable: true,
447
- writable: true,
448
- value: enumerable[key]
449
- });
450
- }
451
- }
452
- /** Updates an existing type with additional hidden and enumerable properties while preserving property configuration. */
453
- function Update(current, hidden, enumerable) {
454
- Metrics.update += 1;
455
- const result = {}, hiddenKeys = Keys(hidden), enumerableKeys = Keys(enumerable);
456
- WithCurrent(current, hiddenKeys, enumerableKeys, result);
457
- WithHidden(hidden, hiddenKeys, result);
458
- WithEnumerable(enumerable, enumerableKeys, result);
459
- return Finalize(result);
460
- }
461
- //#endregion
462
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/schema.mjs
463
- function IsKind(value, kind) {
464
- return IsObject$1(value) && HasPropertyKey(value, "~kind") && IsEqual(value["~kind"], kind);
465
- }
466
- function IsSchema(value) {
467
- return IsObject$1(value);
468
- }
469
- //#endregion
470
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/deferred.mjs
471
- /** Creates a Deferred action. */
472
- function Deferred(action, parameters, options) {
473
- return Create({ "~kind": "Deferred" }, {
474
- type: "deferred",
475
- action,
476
- parameters,
477
- options
478
- }, {});
479
- }
480
- /** Returns true if the given value is a TDeferred. */
481
- function IsDeferred(value) {
482
- return IsKind(value, "Deferred");
483
- }
484
- //#endregion
485
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs
486
- function AddReadonlyAction(type, options) {
487
- return Update(type, { "~readonly": true }, options);
488
- }
489
- function AddReadonlyInstantiate(context, state, type, options) {
490
- return AddReadonlyAction(InstantiateType(context, state, type), options);
491
- }
492
- //#endregion
493
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs
494
- function AddOptionalAction(type, options) {
495
- return Update(type, { "~optional": true }, options);
496
- }
497
- function AddOptionalInstantiate(context, state, type, options) {
498
- return AddOptionalAction(InstantiateType(context, state, type), options);
499
- }
500
- //#endregion
501
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/array.mjs
502
- /** Creates an Array type. */
503
- function _Array_(items, options) {
504
- return Create({ "~kind": "Array" }, {
505
- type: "array",
506
- items
507
- }, options);
508
- }
509
- /** Returns true if the given value is a TArray. */
510
- function IsArray(value) {
511
- return IsKind(value, "Array");
512
- }
513
- /** Extracts options from a TArray. */
514
- function ArrayOptions(type) {
515
- return Discard(type, [
516
- "~kind",
517
- "type",
518
- "items"
519
- ]);
520
- }
521
- //#endregion
522
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/constructor.mjs
523
- /** Creates a Constructor type. */
524
- function Constructor(parameters, instanceType, options = {}) {
525
- return Create({ "~kind": "Constructor" }, {
526
- type: "constructor",
527
- parameters,
528
- instanceType
529
- }, options);
530
- }
531
- /** Returns true if the given value is a TConstructor. */
532
- function IsConstructor(value) {
533
- return IsKind(value, "Constructor");
534
- }
535
- /** Extracts options from a TConstructor. */
536
- function ConstructorOptions(type) {
537
- return Discard(type, [
538
- "~kind",
539
- "type",
540
- "parameters",
541
- "instanceType"
542
- ]);
543
- }
544
- //#endregion
545
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/function.mjs
546
- /** Creates a Function type. */
547
- function _Function_(parameters, returnType, options = {}) {
548
- return Create({ ["~kind"]: "Function" }, {
549
- type: "function",
550
- parameters,
551
- returnType
552
- }, options);
553
- }
554
- /** Returns true if the given value is TFunction. */
555
- function IsFunction(value) {
556
- return IsKind(value, "Function");
557
- }
558
- /** Extracts options from a TFunction. */
559
- function FunctionOptions(type) {
560
- return Discard(type, [
561
- "~kind",
562
- "type",
563
- "parameters",
564
- "returnType"
565
- ]);
566
- }
567
- //#endregion
568
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/ref.mjs
569
- /** Creates a Ref type. */
570
- function Ref(ref, options) {
571
- return Create({ ["~kind"]: "Ref" }, { $ref: ref }, options);
572
- }
573
- /** Returns true if the given value is TRef. */
574
- function IsRef(value) {
575
- return IsKind(value, "Ref");
576
- }
577
- //#endregion
578
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/generic.mjs
579
- /** Creates a Generic type. */
580
- function Generic(parameters, expression) {
581
- return Create({ "~kind": "Generic" }, {
582
- type: "generic",
583
- parameters,
584
- expression
585
- });
586
- }
587
- /** Returns true if the given value is a TGeneric. */
588
- function IsGeneric(value) {
589
- return IsKind(value, "Generic");
590
- }
591
- //#endregion
592
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/any.mjs
593
- /** Creates a Any type. */
594
- function Any(options) {
595
- return Create({ ["~kind"]: "Any" }, {}, options);
596
- }
597
- /** Returns true if the given value is a TAny. */
598
- function IsAny(value) {
599
- return IsKind(value, "Any");
600
- }
601
- //#endregion
602
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/never.mjs
603
- const NeverPattern = "(?!)";
604
- /** Creates a Never type. */
605
- function Never(options) {
606
- return Create({ "~kind": "Never" }, { not: {} }, options);
607
- }
608
- /** Returns true if the given value is TNever. */
609
- function IsNever(value) {
610
- return IsKind(value, "Never");
611
- }
612
- //#endregion
613
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/_add_optional.mjs
614
- /** Applies an AddOptional action to a type. */
615
- function AddOptional(type, options = {}) {
616
- return AddOptionalAction(type, options);
617
- }
618
- //#endregion
619
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/_optional.mjs
620
- /** Applies an Optional modifier to the given type. */
621
- function Optional(type) {
622
- return AddOptional(type);
623
- }
624
- /** Returns true if the given value is TOptional */
625
- function IsOptional(value) {
626
- return IsSchema(value) && HasPropertyKey(value, "~optional");
627
- }
628
- //#endregion
629
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/properties.mjs
630
- /** Creates a RequiredArray derived from the given TProperties value. */
631
- function RequiredArray(properties) {
632
- return Keys$1(properties).filter((key) => !IsOptional(properties[key]));
633
- }
634
- /** Extracts a tuple of keys from a TProperties value. */
635
- function PropertyKeys(properties) {
636
- return Keys$1(properties);
637
- }
638
- /** Extracts a tuple of property values from a TProperties value. */
639
- function PropertyValues(properties) {
640
- return Values(properties);
641
- }
642
- //#endregion
643
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/object.mjs
644
- /** Creates an Object type. */
645
- function _Object_(properties, options = {}) {
646
- const requiredKeys = RequiredArray(properties);
647
- return Create({ "~kind": "Object" }, {
648
- type: "object",
649
- ...requiredKeys.length > 0 ? { required: requiredKeys } : {},
650
- properties
651
- }, options);
652
- }
653
- /** Returns true if the given value is TObject. */
654
- function IsObject(value) {
655
- return IsKind(value, "Object");
656
- }
657
- /** Extracts options from a TObject. */
658
- function ObjectOptions(type) {
659
- return Discard(type, [
660
- "~kind",
661
- "type",
662
- "properties",
663
- "required"
664
- ]);
665
- }
666
- //#endregion
667
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/unknown.mjs
668
- /** Creates an Unknown type. */
669
- function Unknown(options) {
670
- return Create({ ["~kind"]: "Unknown" }, {}, options);
671
- }
672
- /** Returns true if the given value is TUnknown. */
673
- function IsUnknown(value) {
674
- return IsKind(value, "Unknown");
675
- }
676
- //#endregion
677
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/cyclic.mjs
678
- /** Creates a Cyclic type. */
679
- function Cyclic($defs, $ref, options) {
680
- const defs = Keys$1($defs).reduce((result, key) => {
681
- return {
682
- ...result,
683
- [key]: Update($defs[key], {}, { $id: key })
684
- };
685
- }, {});
686
- return Create({ ["~kind"]: "Cyclic" }, {
687
- $defs: defs,
688
- $ref
689
- }, options);
690
- }
691
- /** Returns true if the given value is a TCyclic. */
692
- function IsCyclic(value) {
693
- return IsKind(value, "Cyclic");
694
- }
695
- //#endregion
696
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/unsafe.mjs
697
- /** Creates a Unsafe type. */
698
- function Unsafe(schema) {
699
- return Update(schema, { ["~unsafe"]: null }, {});
700
- }
701
- /** Returns true if the given value is TUnsafe. */
702
- function IsUnsafe(value) {
703
- return IsObjectNotArray(value) && HasPropertyKey(value, "~unsafe") && IsNull$1(value["~unsafe"]);
704
- }
705
- //#endregion
706
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/infer.mjs
707
- /** Returns true if the given value is TInfer. */
708
- function IsInfer(value) {
709
- return IsKind(value, "Infer");
710
- }
711
- //#endregion
712
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/dependent.mjs
713
- /** Creates a Dependent type */
714
- function Dependent(if_, then_, else_, options = {}) {
715
- return Create({ "~kind": "Dependent" }, {
716
- if: if_,
717
- then: then_,
718
- else: else_
719
- }, options);
720
- }
721
- /** Returns true if the given value is TDependent. */
722
- function IsDependent(value) {
723
- return IsKind(value, "Dependent");
724
- }
725
- /** Extracts options from a IsDependent. */
726
- function DependentOptions(type) {
727
- return Discard(type, [
728
- "~kind",
729
- "if",
730
- "then",
731
- "else"
732
- ]);
733
- }
734
- //#endregion
735
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/enum.mjs
736
- /** Returns true if the given value is a TEnum. */
737
- function IsEnum(value) {
738
- return IsKind(value, "Enum");
739
- }
740
- //#endregion
741
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/intersect.mjs
742
- /** Creates a Intersect type. */
743
- function Intersect(types, options = {}) {
744
- return Create({ "~kind": "Intersect" }, { allOf: types }, options);
745
- }
746
- /** Returns true if the given value is TIntersect. */
747
- function IsIntersect(value) {
748
- return IsKind(value, "Intersect");
749
- }
750
- /** Extracts options from a TIntersect. */
751
- function IntersectOptions(type) {
752
- return Discard(type, ["~kind", "allOf"]);
753
- }
754
- //#endregion
755
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/system/unreachable/unreachable.mjs
756
- /** Used for unreachable logic */
757
- function Unreachable() {
758
- throw new Error("Unreachable");
759
- }
760
- //#endregion
761
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/system/hashing/hash.mjs
762
- function InstanceKeys(value) {
763
- const propertyKeys = /* @__PURE__ */ new Set();
764
- let current = value;
765
- while (current && current !== Object.prototype) {
766
- for (const key of Reflect.ownKeys(current)) if (key !== "constructor" && typeof key !== "symbol") propertyKeys.add(key);
767
- current = Object.getPrototypeOf(current);
768
- }
769
- return [...propertyKeys];
770
- }
771
- function IsIEEE754(value) {
772
- return typeof value === "number";
773
- }
774
- const ByteMarker = {
775
- Array: 0,
776
- BigInt: 1,
777
- Boolean: 2,
778
- Date: 3,
779
- Constructor: 4,
780
- Function: 5,
781
- Null: 6,
782
- Number: 7,
783
- Object: 8,
784
- RegExp: 9,
785
- String: 10,
786
- Symbol: 11,
787
- TypeArray: 12,
788
- Undefined: 13
789
- };
790
- let A0 = 8997;
791
- let A1 = 33826;
792
- let A2 = 40164;
793
- let A3 = 52210;
794
- const F64 = /* @__PURE__ */ new Float64Array(1);
795
- const F64In = new DataView(F64.buffer);
796
- const F64Out = new Uint8Array(F64.buffer);
797
- function FNV1A64_OP(byte) {
798
- const L0 = A0 ^ byte;
799
- const T0 = L0 * 435;
800
- const T1 = A1 * 435 + (T0 >>> 16);
801
- const T2 = A2 * 435 + (T1 >>> 16) + (L0 << 8);
802
- const T3 = A3 * 435 + (T2 >>> 16) + (A1 << 8);
803
- A0 = T0 & 65535;
804
- A1 = T1 & 65535;
805
- A2 = T2 & 65535;
806
- A3 = T3 & 65535;
807
- }
808
- function FromArray$3(value) {
809
- FNV1A64_OP(ByteMarker.Array);
810
- for (const item of value) FromValue(item);
811
- }
812
- function FromBigInt(value) {
813
- FNV1A64_OP(ByteMarker.BigInt);
814
- F64In.setBigInt64(0, value);
815
- for (const byte of F64Out) FNV1A64_OP(byte);
816
- }
817
- function FromBoolean(value) {
818
- FNV1A64_OP(ByteMarker.Boolean);
819
- FNV1A64_OP(value ? 1 : 0);
820
- }
821
- function FromConstructor(value) {
822
- FNV1A64_OP(ByteMarker.Constructor);
823
- FromValue(value.toString());
824
- }
825
- function FromDate(value) {
826
- FNV1A64_OP(ByteMarker.Date);
827
- FromValue(value.getTime());
828
- }
829
- function FromFunction(value) {
830
- FNV1A64_OP(ByteMarker.Function);
831
- FromValue(value.toString());
832
- }
833
- function FromNull(_value) {
834
- FNV1A64_OP(ByteMarker.Null);
835
- }
836
- function FromNumber(value) {
837
- FNV1A64_OP(ByteMarker.Number);
838
- F64In.setFloat64(0, value, true);
839
- for (const byte of F64Out) FNV1A64_OP(byte);
840
- }
841
- function FromObject$7(value) {
842
- FNV1A64_OP(ByteMarker.Object);
843
- for (const key of InstanceKeys(value).sort()) {
844
- FromValue(key);
845
- FromValue(value[key]);
846
- }
847
- }
848
- function FromRegExp(value) {
849
- FNV1A64_OP(ByteMarker.RegExp);
850
- FromString(value.toString());
851
- }
852
- const encoder = new TextEncoder();
853
- function FromString(value) {
854
- FNV1A64_OP(ByteMarker.String);
855
- for (let i = 0; i < value.length; i++) {
856
- const code = value.charCodeAt(i);
857
- if (code > 127) {
858
- for (const byte of encoder.encode(value.slice(i))) FNV1A64_OP(byte);
859
- return;
860
- }
861
- FNV1A64_OP(code);
862
- }
863
- }
864
- function FromSymbol(value) {
865
- FNV1A64_OP(ByteMarker.Symbol);
866
- FromValue(value.toString());
867
- }
868
- function FromTypeArray(value) {
869
- FNV1A64_OP(ByteMarker.TypeArray);
870
- const buffer = new Uint8Array(value.buffer);
871
- for (let i = 0; i < buffer.length; i++) FNV1A64_OP(buffer[i]);
872
- }
873
- function FromUndefined(_value) {
874
- return FNV1A64_OP(ByteMarker.Undefined);
875
- }
876
- function FromValue(value) {
877
- return IsTypeArray(value) ? FromTypeArray(value) : IsDate(value) ? FromDate(value) : IsRegExp(value) ? FromRegExp(value) : IsBoolean$1(value) ? FromBoolean(value.valueOf()) : IsString$1(value) ? FromString(value.valueOf()) : IsNumber$1(value) ? FromNumber(value.valueOf()) : IsIEEE754(value) ? FromNumber(value) : IsArray$1(value) ? FromArray$3(value) : IsBoolean$2(value) ? FromBoolean(value) : IsBigInt$1(value) ? FromBigInt(value) : IsConstructor$1(value) ? FromConstructor(value) : IsNull$1(value) ? FromNull(value) : IsObject$1(value) ? FromObject$7(value) : IsString$2(value) ? FromString(value) : IsSymbol$1(value) ? FromSymbol(value) : IsUndefined$1(value) ? FromUndefined(value) : IsFunction$1(value) ? FromFunction(value) : Unreachable();
878
- }
879
- function Hex(limb) {
880
- return limb.toString(16).padStart(4, "0");
881
- }
882
- /** Generates a FNV1A-64 non cryptographic hash of the given value */
883
- function Hash(value) {
884
- A0 = 8997, A1 = 33826, A2 = 40164, A3 = 52210;
885
- FromValue(value);
886
- return `${Hex(A3)}${Hex(A2)}${Hex(A1)}${Hex(A0)}`;
887
- }
888
- //#endregion
889
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/_codec.mjs
890
- function IsCodec(value) {
891
- return IsSchema(value) && HasPropertyKey(value, "~codec") && IsObject$1(value["~codec"]) && HasPropertyKey(value["~codec"], "encode") && HasPropertyKey(value["~codec"], "decode");
892
- }
893
- //#endregion
894
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/_immutable.mjs
895
- /** Returns true if the given value is a TImmutable */
896
- function IsImmutable(value) {
897
- return IsSchema(value) && HasPropertyKey(value, "~immutable");
898
- }
899
- //#endregion
900
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/_add_readonly.mjs
901
- /** Applies an AddReadonly action to a type. */
902
- function AddReadonly(type, options = {}) {
903
- return AddReadonlyAction(type, options);
904
- }
905
- //#endregion
906
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/_readonly.mjs
907
- /** Returns true if the given value is a TReadonly */
908
- function IsReadonly(value) {
909
- return IsSchema(value) && HasPropertyKey(value, "~readonly");
910
- }
911
- //#endregion
912
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/bigint.mjs
913
- const BigIntPattern = "-?(?:0|[1-9][0-9]*)n";
914
- /** Creates a BigInt type. */
915
- function BigInt$1(options) {
916
- return Create({ "~kind": "BigInt" }, { type: "bigint" }, options);
917
- }
918
- /** Returns true if the given value is a TBigInt. */
919
- function IsBigInt(value) {
920
- return IsKind(value, "BigInt");
921
- }
922
- //#endregion
923
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/boolean.mjs
924
- /** Creates a Boolean type. */
925
- function Boolean$1(options) {
926
- return Create({ "~kind": "Boolean" }, { type: "boolean" }, options);
927
- }
928
- /** Returns true if the given value is a TBoolean. */
929
- function IsBoolean(value) {
930
- return IsKind(value, "Boolean");
931
- }
932
- //#endregion
933
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/integer.mjs
934
- const IntegerPattern = "-?(?:0|[1-9][0-9]*)";
935
- /** Creates a Integer type. */
936
- function Integer(options) {
937
- return Create({ "~kind": "Integer" }, { type: "integer" }, options);
938
- }
939
- /** Returns true if the given value is TInteger. */
940
- function IsInteger(value) {
941
- return IsKind(value, "Integer");
942
- }
943
- //#endregion
944
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/literal.mjs
945
- var InvalidLiteralValue = class extends Error {
946
- constructor(value) {
947
- super(`Invalid Literal value`);
948
- Object.defineProperty(this, "cause", {
949
- value: { value },
950
- writable: false,
951
- configurable: false,
952
- enumerable: false
953
- });
954
- }
955
- };
956
- function LiteralTypeName(value) {
957
- return IsBigInt$1(value) ? "bigint" : IsBoolean$2(value) ? "boolean" : IsNumber$2(value) ? "number" : IsString$2(value) ? "string" : (() => {
958
- throw new InvalidLiteralValue(value);
959
- })();
960
- }
961
- /** Creates a Literal type. */
962
- function Literal(value, options) {
963
- return Create({ "~kind": "Literal" }, {
964
- type: LiteralTypeName(value),
965
- const: value
966
- }, options);
967
- }
968
- /** Returns true if the given value is a TLiteralValue. */
969
- function IsLiteralValue(value) {
970
- return IsBigInt$1(value) || IsBoolean$2(value) || IsNumber$2(value) || IsString$2(value);
971
- }
972
- /** Returns true if the given value is TLiteral<bigint>. */
973
- function IsLiteralBigInt(value) {
974
- return IsLiteral(value) && IsBigInt$1(value.const);
975
- }
976
- /** Returns true if the given value is TLiteral<boolean>. */
977
- function IsLiteralBoolean(value) {
978
- return IsLiteral(value) && IsBoolean$2(value.const);
979
- }
980
- /** Returns true if the given value is TLiteral<number>. */
981
- function IsLiteralNumber(value) {
982
- return IsLiteral(value) && IsNumber$2(value.const);
983
- }
984
- /** Returns true if the given value is TLiteral<string>. */
985
- function IsLiteralString(value) {
986
- return IsLiteral(value) && IsString$2(value.const);
987
- }
988
- /** Returns true if the given value is TLiteral. */
989
- function IsLiteral(value) {
990
- return IsKind(value, "Literal");
991
- }
992
- //#endregion
993
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/null.mjs
994
- /** Creates a Null type. */
995
- function Null(options) {
996
- return Create({ "~kind": "Null" }, { type: "null" }, options);
997
- }
998
- /** Returns true if the given value is TNull. */
999
- function IsNull(value) {
1000
- return IsKind(value, "Null");
1001
- }
1002
- //#endregion
1003
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/number.mjs
1004
- const NumberPattern = "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";
1005
- /** Creates a Number type. */
1006
- function Number$1(options) {
1007
- return Create({ "~kind": "Number" }, { type: "number" }, options);
1008
- }
1009
- /** Returns true if the given value is a TNumber. */
1010
- function IsNumber(value) {
1011
- return IsKind(value, "Number");
1012
- }
1013
- //#endregion
1014
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/symbol.mjs
1015
- /** Creates a Symbol type. */
1016
- function Symbol(options) {
1017
- return Create({ "~kind": "Symbol" }, { type: "symbol" }, options);
1018
- }
1019
- /** Returns true if the given value is TSymbol. */
1020
- function IsSymbol(value) {
1021
- return IsKind(value, "Symbol");
1022
- }
1023
- //#endregion
1024
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/string.mjs
1025
- /** Creates a String type. */
1026
- function String$1(options) {
1027
- return Create({ "~kind": "String" }, { type: "string" }, options);
1028
- }
1029
- /** Returns true if the given value is TString. */
1030
- function IsString(value) {
1031
- return IsKind(value, "String");
1032
- }
1033
- //#endregion
1034
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/union.mjs
1035
- /** Creates a Union type. */
1036
- function Union(anyOf, options = {}) {
1037
- return Create({ "~kind": "Union" }, { anyOf }, options);
1038
- }
1039
- /** Returns true if the given value is TUnion. */
1040
- function IsUnion(value) {
1041
- return IsKind(value, "Union");
1042
- }
1043
- /** Extracts options from a TUnion. */
1044
- function UnionOptions(type) {
1045
- return Discard(type, ["~kind", "anyOf"]);
1046
- }
1047
- //#endregion
1048
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/patterns/pattern.mjs
1049
- /** Parses a Pattern into a sequence of TemplateLiteral types. A result of [] indicates failure to parse. */
1050
- function ParsePatternIntoTypes(pattern) {
1051
- const parsed = Pattern(pattern);
1052
- return IsEqual(parsed.length, 2) ? parsed[0] : [];
1053
- }
1054
- //#endregion
1055
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs
1056
- function FromLiteral$4(_value) {
1057
- return true;
1058
- }
1059
- function FromTypesReduce(types) {
1060
- return ShiftLeft(types, (left, right) => FromType$17(left) ? FromTypesReduce(right) : false, () => true);
1061
- }
1062
- function FromTypes$4(types) {
1063
- return IsEqual(types.length, 0) ? false : FromTypesReduce(types);
1064
- }
1065
- function FromType$17(type) {
1066
- return IsUnion(type) ? FromTypes$4(type.anyOf) : IsLiteral(type) ? FromLiteral$4(type.const) : false;
1067
- }
1068
- /** Returns true if the given TemplateLiteral types yields a finite variant set */
1069
- function IsTemplateLiteralFinite(types) {
1070
- return FromTypes$4(types);
1071
- }
1072
- //#endregion
1073
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/template_literal/create.mjs
1074
- function TemplateLiteralCreate(pattern) {
1075
- return Create({ ["~kind"]: "TemplateLiteral" }, {
1076
- type: "string",
1077
- pattern
1078
- }, {});
1079
- }
1080
- //#endregion
1081
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/template_literal/decode.mjs
1082
- function FromLiteralPush(variants, value, result = []) {
1083
- return ShiftLeft(variants, (left, right) => FromLiteralPush(right, value, [...result, `${left}${value}`]), () => result);
1084
- }
1085
- function FromLiteral$3(variants, value) {
1086
- return IsEqual(variants.length, 0) ? [`${value}`] : FromLiteralPush(variants, value);
1087
- }
1088
- function FromUnion$7(variants, types, result = []) {
1089
- return ShiftLeft(types, (left, right) => FromUnion$7(variants, right, [...result, ...FromType$16(variants, left)]), () => result);
1090
- }
1091
- function FromType$16(variants, type) {
1092
- return IsUnion(type) ? FromUnion$7(variants, type.anyOf) : IsLiteral(type) ? FromLiteral$3(variants, type.const) : Unreachable();
1093
- }
1094
- function DecodeFromSpan(variants, types) {
1095
- return ShiftLeft(types, (left, right) => DecodeFromSpan(FromType$16(variants, left), right), () => variants);
1096
- }
1097
- function VariantsToLiterals(variants) {
1098
- return variants.map((variant) => Literal(variant));
1099
- }
1100
- function DecodeTypesAsUnion(types) {
1101
- return Union(VariantsToLiterals(DecodeFromSpan([], types)));
1102
- }
1103
- function DecodeTypes(types) {
1104
- return IsEqual(types.length, 0) ? Unreachable() : IsEqual(types.length, 1) && IsLiteral(types[0]) ? types[0] : DecodeTypesAsUnion(types);
1105
- }
1106
- /**
1107
- * (Internal) Decodes a TemplateLiteral pattern into a Type. This function is unsafe. Decoding a non-finite
1108
- * TemplateLiteral pattern may produce another TemplateLiteral pattern. During enumeration, this
1109
- * TemplateLiteral -> TemplateLiteral behavior can cause a StackOverflow. A better in-flight template-literal
1110
- * decoding algorithm is needed. (for review)
1111
- */
1112
- function TemplateLiteralDecodeUnsafe(pattern) {
1113
- const types = ParsePatternIntoTypes(pattern);
1114
- return IsEqual(types.length, 0) ? String$1() : IsTemplateLiteralFinite(types) ? DecodeTypes(types) : TemplateLiteralCreate(pattern);
1115
- }
1116
- /** Decodes a TemplateLiteral pattern but returns TString if the pattern in non-finite. */
1117
- function TemplateLiteralDecode(pattern) {
1118
- const decoded = TemplateLiteralDecodeUnsafe(pattern);
1119
- return IsTemplateLiteral(decoded) ? String$1() : decoded;
1120
- }
1121
- //#endregion
1122
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/record_create.mjs
1123
- function CreateRecord(key, value) {
1124
- const type = "object";
1125
- const patternProperties = { [key]: value };
1126
- return Create({ ["~kind"]: "Record" }, {
1127
- type,
1128
- patternProperties
1129
- });
1130
- }
1131
- //#endregion
1132
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/from_key_any.mjs
1133
- function FromAnyKey(value) {
1134
- return CreateRecord(StringKey, value);
1135
- }
1136
- //#endregion
1137
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs
1138
- function FromBooleanKey(value) {
1139
- return _Object_({
1140
- true: value,
1141
- false: value
1142
- });
1143
- }
1144
- //#endregion
1145
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/tuple.mjs
1146
- /** Creates a Tuple type. */
1147
- function Tuple(types, options = {}) {
1148
- const [items, minItems, additionalItems] = [
1149
- types,
1150
- types.length,
1151
- false
1152
- ];
1153
- return Create({ ["~kind"]: "Tuple" }, {
1154
- type: "array",
1155
- additionalItems,
1156
- items,
1157
- minItems
1158
- }, options);
1159
- }
1160
- /** Returns true if the given value is TTuple. */
1161
- function IsTuple(value) {
1162
- return IsKind(value, "Tuple");
1163
- }
1164
- /** Extracts options from a TTuple. */
1165
- function TupleOptions(type) {
1166
- return Discard(type, [
1167
- "~kind",
1168
- "type",
1169
- "items",
1170
- "minItems",
1171
- "additionalItems"
1172
- ]);
1173
- }
1174
- //#endregion
1175
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/tuple/to_object.mjs
1176
- function TupleElementsToProperties(types) {
1177
- return types.reduceRight((result, right, index) => {
1178
- return {
1179
- [index]: right,
1180
- ...result
1181
- };
1182
- }, {});
1183
- }
1184
- function TupleToObject(type) {
1185
- return _Object_(TupleElementsToProperties(type.items));
1186
- }
1187
- //#endregion
1188
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs
1189
- function RemoveOptionalOperation(type) {
1190
- return Discard(type, ["~optional"]);
1191
- }
1192
- function RemoveOptionalAction(type, options) {
1193
- return Update(RemoveOptionalOperation(type), {}, options);
1194
- }
1195
- function RemoveOptionalInstantiate(context, state, type, options) {
1196
- return RemoveOptionalAction(InstantiateType(context, state, type), options);
1197
- }
1198
- //#endregion
1199
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs
1200
- function RemoveReadonlyOperation(type) {
1201
- return Discard(type, ["~readonly"]);
1202
- }
1203
- function RemoveReadonlyAction(type, options) {
1204
- return Update(RemoveReadonlyOperation(type), {}, options);
1205
- }
1206
- function RemoveReadonlyInstantiate(context, state, type, options) {
1207
- return RemoveReadonlyAction(InstantiateType(context, state, type), options);
1208
- }
1209
- //#endregion
1210
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/evaluate/property.mjs
1211
- function EvaluatePropertyIntersect(left, right) {
1212
- const isReadonly = IsReadonly(left) && IsReadonly(right);
1213
- const isOptional = IsOptional(left) && IsOptional(right);
1214
- const property = RemoveReadonlyAction(RemoveOptionalAction(EvaluateIntersect([left, right]), {}), {});
1215
- return isReadonly && isOptional ? AddReadonlyAction(AddOptionalAction(property, {}), {}) : isReadonly ? AddReadonlyAction(property, {}) : isOptional ? AddOptionalAction(property, {}) : property;
1216
- }
1217
- function EvaluatePropertyUnion(left, right) {
1218
- const isReadonly = IsReadonly(left) || IsReadonly(right);
1219
- const isOptional = IsOptional(left) || IsOptional(right);
1220
- const property = EvaluateUnion([RemoveReadonlyAction(RemoveOptionalAction(left, {}), {}), RemoveReadonlyAction(RemoveOptionalAction(right, {}), {})]);
1221
- return isReadonly && isOptional ? AddReadonlyAction(AddOptionalAction(property, {}), {}) : isReadonly ? AddReadonlyAction(property, {}) : isOptional ? AddOptionalAction(property, {}) : property;
1222
- }
1223
- //#endregion
1224
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/evaluate/composite.mjs
1225
- function CompositePropertyKey(left, right, key) {
1226
- return key in left ? key in right ? EvaluatePropertyIntersect(left[key], right[key]) : left[key] : key in right ? right[key] : Never();
1227
- }
1228
- function CompositeProperties(left, right) {
1229
- return [.../* @__PURE__ */ new Set([...Keys$1(left), ...Keys$1(right)])].reduce((result, key) => {
1230
- return {
1231
- ...result,
1232
- [key]: CompositePropertyKey(left, right, key)
1233
- };
1234
- }, {});
1235
- }
1236
- function GetProperties(type) {
1237
- return IsObject(type) ? type.properties : IsTuple(type) ? TupleElementsToProperties(type.items) : {};
1238
- }
1239
- function Composite(left, right) {
1240
- return _Object_(CompositeProperties(GetProperties(left), GetProperties(right)));
1241
- }
1242
- //#endregion
1243
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/evaluate/narrow.mjs
1244
- function NarrowCompareRule(left, right) {
1245
- const result = Compare(left, right);
1246
- return IsEqual(result, 2) ? left : IsEqual(result, 3) ? right : IsEqual(result, 0) ? right : Never();
1247
- }
1248
- function CanComposite(type) {
1249
- return IsObject(type) || IsTuple(type);
1250
- }
1251
- function NarrowCompositeRule(left, right) {
1252
- const canCompositeLeft = CanComposite(left);
1253
- const canCompositeRight = CanComposite(right);
1254
- return canCompositeLeft && canCompositeRight ? Composite(left, right) : canCompositeLeft && !canCompositeRight ? left : !canCompositeLeft && canCompositeRight ? right : NarrowCompareRule(left, right);
1255
- }
1256
- function Narrow(left, right) {
1257
- return IsNever(left) ? left : IsAny(left) ? left : IsUnknown(left) ? right : IsNever(right) ? right : IsAny(right) ? right : IsUnknown(right) ? left : NarrowCompositeRule(left, right);
1258
- }
1259
- //#endregion
1260
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/evaluate/distribute.mjs
1261
- function ShouldEvaluate(left, right) {
1262
- return IsUnion(left) || IsUnion(right);
1263
- }
1264
- function DistributeOperation(left, right) {
1265
- const evaluatedLeft = EvaluateType(left);
1266
- const evaluatedRight = EvaluateType(right);
1267
- return ShouldEvaluate(evaluatedLeft, evaluatedRight) ? EvaluateIntersect([evaluatedLeft, evaluatedRight]) : Narrow(evaluatedLeft, evaluatedRight);
1268
- }
1269
- function DistributeType(type, types, result = []) {
1270
- return ShiftLeft(types, (left, right) => DistributeType(type, right, [...result, DistributeOperation(left, type)]), () => IsEqual(result.length, 0) ? [type] : result);
1271
- }
1272
- function DistributeUnion(types, distribution, result = []) {
1273
- return ShiftLeft(types, (left, right) => DistributeUnion(right, distribution, [...result, ...Distribute$1([left], distribution)]), () => result);
1274
- }
1275
- function Distribute$1(types, result = []) {
1276
- return ShiftLeft(types, (left, right) => IsUnion(left) ? Distribute$1(right, DistributeUnion(left.anyOf, result)) : Distribute$1(right, DistributeType(left, result)), () => result);
1277
- }
1278
- //#endregion
1279
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/exclude/operation.mjs
1280
- function ExcludeType(left, right) {
1281
- return IsExtendsTrueLike(Extends({}, left, right)) ? [] : [left];
1282
- }
1283
- function ExcludeUnion(left, right, result = []) {
1284
- return ShiftLeft(left, (head, tail) => ExcludeUnion(tail, right, [...result, ...ExcludeType(head, right)]), () => result);
1285
- }
1286
- function ExcludeOperation(left, right) {
1287
- const evaluated = EvaluateType(left);
1288
- return EvaluateUnion(ExcludeUnion(IsUnion(evaluated) ? evaluated.anyOf : [evaluated], right));
1289
- }
1290
- //#endregion
1291
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs
1292
- function EvaluateDependent(if_, then_, else_) {
1293
- return EvaluateUnion([EvaluateIntersect([if_, then_]), ExcludeOperation(else_, if_)]);
1294
- }
1295
- function EvaluateEnum(values, result = []) {
1296
- return ShiftLeft(values, (left, right) => EvaluateEnum(right, [...result, Literal(left)]), () => EvaluateUnion(result));
1297
- }
1298
- function EvaluateIntersect(types) {
1299
- return EvaluateUnion(Broaden(Distribute$1(types)));
1300
- }
1301
- function EvaluateTemplateLiteral(pattern) {
1302
- return EvaluateType(TemplateLiteralDecode(pattern));
1303
- }
1304
- function EvaluateUnion(types) {
1305
- return EvaluateUnionFast(Broaden(types));
1306
- }
1307
- function EvaluateType(type) {
1308
- return IsDependent(type) ? EvaluateDependent(type.if, type.then, type.else) : IsEnum(type) ? EvaluateEnum(type.enum) : IsIntersect(type) ? EvaluateIntersect(type.allOf) : IsTemplateLiteral(type) ? EvaluateTemplateLiteral(type.pattern) : IsUnion(type) ? EvaluateUnion(type.anyOf) : type;
1309
- }
1310
- function EvaluateUnionFast(types) {
1311
- return IsEqual(types.length, 1) ? types[0] : IsEqual(types.length, 0) ? Never() : Union(types);
1312
- }
1313
- //#endregion
1314
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/from_key_enum.mjs
1315
- function FromEnumKey(values, value) {
1316
- return FromKey(EvaluateEnum(values), value);
1317
- }
1318
- //#endregion
1319
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/from_key_integer.mjs
1320
- function FromIntegerKey(_key, value) {
1321
- return CreateRecord(IntegerKey, value);
1322
- }
1323
- //#endregion
1324
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs
1325
- function FromIntersectKey(types, value) {
1326
- return FromKey(EvaluateIntersect(types), value);
1327
- }
1328
- //#endregion
1329
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/from_key_literal.mjs
1330
- function FromLiteralKey(key, value) {
1331
- return IsString$2(key) || IsNumber$2(key) ? _Object_({ [key]: value }) : IsEqual(key, false) ? _Object_({ false: value }) : IsEqual(key, true) ? _Object_({ true: value }) : _Object_({});
1332
- }
1333
- //#endregion
1334
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/from_key_number.mjs
1335
- function FromNumberKey(_key, value) {
1336
- return CreateRecord(NumberKey, value);
1337
- }
1338
- //#endregion
1339
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/from_key_string.mjs
1340
- function FromStringKey(key, value) {
1341
- return HasPropertyKey(key, "pattern") && (IsString$2(key.pattern) || key.pattern instanceof RegExp) ? CreateRecord(key.pattern.toString(), value) : CreateRecord(StringKey, value);
1342
- }
1343
- //#endregion
1344
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs
1345
- function FromTemplateKey(pattern, value) {
1346
- return IsTemplateLiteralFinite(ParsePatternIntoTypes(pattern)) ? FromKey(EvaluateTemplateLiteral(pattern), value) : CreateRecord(pattern, value);
1347
- }
1348
- //#endregion
1349
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/evaluate/flatten.mjs
1350
- function FlattenType(type) {
1351
- return IsUnion(type) ? Flatten(type.anyOf) : [type];
1352
- }
1353
- function Flatten(types, result = []) {
1354
- return ShiftLeft(types, (left, right) => Flatten(right, [...result, ...FlattenType(left)]), () => result);
1355
- }
1356
- //#endregion
1357
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/from_key_union.mjs
1358
- function StringOrNumberCheck(types) {
1359
- return types.some((type) => IsString(type) || IsNumber(type) || IsInteger(type));
1360
- }
1361
- function TryBuildRecord(types, value) {
1362
- return IsEqual(StringOrNumberCheck(types), true) ? CreateRecord(StringKey, value) : void 0;
1363
- }
1364
- function CreateProperties(types, value) {
1365
- return types.reduce((result, left) => {
1366
- return IsLiteral(left) && (IsString$2(left.const) || IsNumber$2(left.const)) ? {
1367
- ...result,
1368
- [left.const]: value
1369
- } : result;
1370
- }, {});
1371
- }
1372
- function CreateObject(types, value) {
1373
- return _Object_(CreateProperties(types, value));
1374
- }
1375
- function FromUnionKey(types, value) {
1376
- const flattened = Flatten(types);
1377
- const record = TryBuildRecord(flattened, value);
1378
- return IsSchema(record) ? record : CreateObject(flattened, value);
1379
- }
1380
- //#endregion
1381
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/from_key.mjs
1382
- function FromKey(key, value) {
1383
- return IsAny(key) ? FromAnyKey(value) : IsBoolean(key) ? FromBooleanKey(value) : IsEnum(key) ? FromEnumKey(key.enum, value) : IsInteger(key) ? FromIntegerKey(key, value) : IsIntersect(key) ? FromIntersectKey(key.allOf, value) : IsLiteral(key) ? FromLiteralKey(key.const, value) : IsNumber(key) ? FromNumberKey(key, value) : IsUnion(key) ? FromUnionKey(key.anyOf, value) : IsString(key) ? FromStringKey(key, value) : IsTemplateLiteral(key) ? FromTemplateKey(key.pattern, value) : _Object_({});
1384
- }
1385
- //#endregion
1386
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/record/instantiate.mjs
1387
- function RecordAction(key, value, options) {
1388
- return CanInstantiate([key]) ? Update(FromKey(key, value), {}, options) : RecordDeferred(key, value, options);
1389
- }
1390
- function RecordInstantiate(context, state, key, value, options) {
1391
- return RecordAction(InstantiateType(context, state, key), InstantiateType(context, state, value), options);
1392
- }
1393
- //#endregion
1394
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/record.mjs
1395
- const IntegerKey = `^${IntegerPattern}$`;
1396
- const NumberKey = `^${NumberPattern}$`;
1397
- const StringKey = `^.*$`;
1398
- /** Represents a deferred Record action. */
1399
- function RecordDeferred(key, value, options = {}) {
1400
- return Deferred("Record", [key, value], options);
1401
- }
1402
- /** Creates a Record type. */
1403
- function Record(key, value, options = {}) {
1404
- return RecordAction(key, value, options);
1405
- }
1406
- /** Creates a Record type from regular expression pattern. */
1407
- function RecordFromPattern(pattern, value) {
1408
- return CreateRecord(pattern, value);
1409
- }
1410
- /** Transforms a Record Pattern to a Type */
1411
- function RecordPatternToType(pattern) {
1412
- return IsEqual(pattern, StringKey) ? String$1() : IsEqual(pattern, IntegerKey) ? Integer() : IsEqual(pattern, NumberKey) ? Number$1() : TemplateLiteralDecodeUnsafe(pattern);
1413
- }
1414
- /** Extracts the Pattern from a Record type */
1415
- function RecordPattern(type) {
1416
- return Keys$1(type.patternProperties)[0];
1417
- }
1418
- /** Extracts the Key from a Record type */
1419
- function RecordKey(type) {
1420
- return RecordPatternToType(RecordPattern(type));
1421
- }
1422
- /** Extracts the Value from a Record type */
1423
- function RecordValue(type) {
1424
- return type.patternProperties[RecordPattern(type)];
1425
- }
1426
- function IsRecord(value) {
1427
- return IsKind(value, "Record");
1428
- }
1429
- //#endregion
1430
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/rest.mjs
1431
- /** Creates a Rest instruction type. */
1432
- function Rest(type) {
1433
- return Create({ "~kind": "Rest" }, {
1434
- type: "rest",
1435
- items: type
1436
- }, {});
1437
- }
1438
- /** Returns true if the given value is TRest. */
1439
- function IsRest(value) {
1440
- return IsKind(value, "Rest");
1441
- }
1442
- //#endregion
1443
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/this.mjs
1444
- /** Returns true if the given value is TThis. */
1445
- function IsThis(value) {
1446
- return IsKind(value, "This");
1447
- }
1448
- //#endregion
1449
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/undefined.mjs
1450
- /** Creates a Undefined type. */
1451
- function Undefined(options) {
1452
- return Create({ "~kind": "Undefined" }, { type: "undefined" }, options);
1453
- }
1454
- /** Returns true if the given value is TUndefined. */
1455
- function IsUndefined(value) {
1456
- return IsKind(value, "Undefined");
1457
- }
1458
- //#endregion
1459
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/void.mjs
1460
- /** Returns true if the given value is TVoid. */
1461
- function IsVoid(value) {
1462
- return IsKind(value, "Void");
1463
- }
1464
- //#endregion
1465
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/script/mapping.mjs
1466
- function PatternBigIntMapping(input) {
1467
- return BigInt$1();
1468
- }
1469
- function PatternStringMapping(input) {
1470
- return String$1();
1471
- }
1472
- function PatternNumberMapping(input) {
1473
- return Number$1();
1474
- }
1475
- function PatternIntegerMapping(input) {
1476
- return Integer();
1477
- }
1478
- function PatternNeverMapping(input) {
1479
- return Never();
1480
- }
1481
- function PatternTextMapping(input) {
1482
- return Literal(input);
1483
- }
1484
- function PatternBaseMapping(input) {
1485
- return input;
1486
- }
1487
- function PatternGroupMapping(input) {
1488
- return Union(input[1]);
1489
- }
1490
- function PatternUnionMapping(input) {
1491
- return input.length === 3 ? [...input[0], ...input[2]] : input.length === 1 ? [...input[0]] : [];
1492
- }
1493
- function PatternTermMapping(input) {
1494
- return [input[0], ...input[1]];
1495
- }
1496
- function PatternBodyMapping(input) {
1497
- return input;
1498
- }
1499
- function PatternMapping(input) {
1500
- return input[1];
1501
- }
1502
- //#endregion
1503
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/script/token/internal/match.mjs
1504
- /** Checks the value is a Tuple-2 [string, string] result */
1505
- function IsMatch(value) {
1506
- return IsEqual(value.length, 2);
1507
- }
1508
- /** Matches on a result and dispatches either left or right arm */
1509
- function Match$1(input, ok, fail) {
1510
- return IsMatch(input) ? ok(input[0], input[1]) : fail();
1511
- }
1512
- //#endregion
1513
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/script/token/internal/take.mjs
1514
- function TakeVariant(variant, input) {
1515
- return IsEqual(input.indexOf(variant), 0) ? [variant, input.slice(variant.length)] : [];
1516
- }
1517
- /** Takes one of the given variants or fail */
1518
- function Take(variants, input) {
1519
- for (let i = 0; i < variants.length; i++) {
1520
- const result = TakeVariant(variants[i], input);
1521
- if (IsMatch(result)) return result;
1522
- }
1523
- return [];
1524
- }
1525
- //#endregion
1526
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/script/token/internal/char.mjs
1527
- function Range(start, end) {
1528
- return Array.from({ length: end - start + 1 }, (_, i) => String.fromCharCode(start + i));
1529
- }
1530
- const Alpha = [...Range(97, 122), ...Range(65, 90)];
1531
- const Digit = ["0", ...Range(49, 57)];
1532
- //#endregion
1533
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/script/token/internal/trim.mjs
1534
- const LineComment = "//";
1535
- const OpenComment = "/*";
1536
- const CloseComment = "*/";
1537
- function DiscardMultilineComment(input) {
1538
- const index = input.indexOf(CloseComment);
1539
- return IsEqual(index, -1) ? "" : input.slice(index + 2);
1540
- }
1541
- function DiscardLineComment(input) {
1542
- const index = input.indexOf("\n");
1543
- return IsEqual(index, -1) ? "" : input.slice(index);
1544
- }
1545
- function TrimStartUntilNewline(input) {
1546
- return input.replace(/^[ \t\r\f\v]+/, "");
1547
- }
1548
- function TrimWhitespace(input) {
1549
- const trimmed = TrimStartUntilNewline(input);
1550
- return trimmed.startsWith(OpenComment) ? TrimWhitespace(DiscardMultilineComment(trimmed.slice(2))) : trimmed.startsWith(LineComment) ? TrimWhitespace(DiscardLineComment(trimmed.slice(2))) : trimmed;
1551
- }
1552
- function Trim(input) {
1553
- const trimmed = input.trimStart();
1554
- return trimmed.startsWith(OpenComment) ? Trim(DiscardMultilineComment(trimmed.slice(2))) : trimmed.startsWith(LineComment) ? Trim(DiscardLineComment(trimmed.slice(2))) : trimmed;
1555
- }
1556
- [...Digit];
1557
- //#endregion
1558
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/script/token/const.mjs
1559
- function TakeConst(const_, input) {
1560
- return Take([const_], input);
1561
- }
1562
- /** Matches if next is the given Const value */
1563
- function Const(const_, input) {
1564
- return IsEqual(const_, "") ? ["", input] : const_.startsWith("\n") ? TakeConst(const_, TrimWhitespace(input)) : const_.startsWith(" ") ? TakeConst(const_, input) : TakeConst(const_, Trim(input));
1565
- }
1566
- [...[
1567
- ...Alpha,
1568
- "_",
1569
- "$"
1570
- ], ...Digit];
1571
- [...Digit];
1572
- //#endregion
1573
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/script/token/until.mjs
1574
- function TakeOne(input) {
1575
- return IsEqual(input, "") ? [] : [input.slice(0, 1), input.slice(1)];
1576
- }
1577
- function IsInputMatchSentinal(end, input) {
1578
- return ShiftLeft(end, (left, right) => input.startsWith(left) ? true : IsInputMatchSentinal(right, input), () => false);
1579
- }
1580
- /** Match Input until but not including End. No match if End not found. */
1581
- function Until(end, input, result = "") {
1582
- return Match$1(TakeOne(input), (One, Rest) => IsInputMatchSentinal(end, input) ? [result, input] : Until(end, Rest, `${result}${One}`), () => []);
1583
- }
1584
- //#endregion
1585
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/script/token/until_1.mjs
1586
- /** Match Input until but not including End. No match if End not found or match is zero-length. */
1587
- function Until_1(end, input) {
1588
- return Match$1(Until(end, input), (Until, UntilRest) => IsEqual(Until, "") ? [] : [Until, UntilRest], () => []);
1589
- }
1590
- //#endregion
1591
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/script/parser.mjs
1592
- const If = (result, left, right = () => []) => result.length === 2 ? left(result) : right();
1593
- const PatternBigInt = (input) => If(Const("-?(?:0|[1-9][0-9]*)n", input), ([_0, input]) => [PatternBigIntMapping(_0), input]);
1594
- const PatternString = (input) => If(Const(".*", input), ([_0, input]) => [PatternStringMapping(_0), input]);
1595
- const PatternNumber = (input) => If(Const("-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?", input), ([_0, input]) => [PatternNumberMapping(_0), input]);
1596
- const PatternInteger = (input) => If(Const("-?(?:0|[1-9][0-9]*)", input), ([_0, input]) => [PatternIntegerMapping(_0), input]);
1597
- const PatternNever = (input) => If(Const("(?!)", input), ([_0, input]) => [PatternNeverMapping(_0), input]);
1598
- const PatternText = (input) => If(Until_1([
1599
- "-?(?:0|[1-9][0-9]*)n",
1600
- ".*",
1601
- "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?",
1602
- "-?(?:0|[1-9][0-9]*)",
1603
- "(?!)",
1604
- "(",
1605
- ")",
1606
- "$",
1607
- "|"
1608
- ], input), ([_0, input]) => [PatternTextMapping(_0), input]);
1609
- const PatternBase = (input) => If(If(PatternBigInt(input), ([_0, input]) => [_0, input], () => If(PatternString(input), ([_0, input]) => [_0, input], () => If(PatternNumber(input), ([_0, input]) => [_0, input], () => If(PatternInteger(input), ([_0, input]) => [_0, input], () => If(PatternNever(input), ([_0, input]) => [_0, input], () => If(PatternGroup(input), ([_0, input]) => [_0, input], () => If(PatternText(input), ([_0, input]) => [_0, input], () => []))))))), ([_0, input]) => [PatternBaseMapping(_0), input]);
1610
- const PatternGroup = (input) => If(If(Const("(", input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => If(Const(")", input), ([_2, input]) => [[
1611
- _0,
1612
- _1,
1613
- _2
1614
- ], input]))), ([_0, input]) => [PatternGroupMapping(_0), input]);
1615
- const PatternUnion = (input) => If(If(If(PatternTerm(input), ([_0, input]) => If(Const("|", input), ([_1, input]) => If(PatternUnion(input), ([_2, input]) => [[
1616
- _0,
1617
- _1,
1618
- _2
1619
- ], input]))), ([_0, input]) => [_0, input], () => If(If(PatternTerm(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [PatternUnionMapping(_0), input]);
1620
- const PatternTerm = (input) => If(If(PatternBase(input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [PatternTermMapping(_0), input]);
1621
- const PatternBody = (input) => If(If(PatternUnion(input), ([_0, input]) => [_0, input], () => If(PatternTerm(input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [PatternBodyMapping(_0), input]);
1622
- const Pattern = (input) => If(If(Const("^", input), ([_0, input]) => If(PatternBody(input), ([_1, input]) => If(Const("$", input), ([_2, input]) => [[
1623
- _0,
1624
- _1,
1625
- _2
1626
- ], input]))), ([_0, input]) => [PatternMapping(_0), input]);
1627
- //#endregion
1628
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/template_literal/encode.mjs
1629
- function JoinString(input) {
1630
- return input.join("|");
1631
- }
1632
- function UnwrapTemplateLiteralPattern(pattern) {
1633
- return pattern.slice(1, pattern.length - 1);
1634
- }
1635
- function EncodeLiteral(value, right, pattern) {
1636
- return EncodeTypes(right, `${pattern}${value}`);
1637
- }
1638
- function EncodeBigInt(right, pattern) {
1639
- return EncodeTypes(right, `${pattern}${BigIntPattern}`);
1640
- }
1641
- function EncodeInteger(right, pattern) {
1642
- return EncodeTypes(right, `${pattern}${IntegerPattern}`);
1643
- }
1644
- function EncodeNumber(right, pattern) {
1645
- return EncodeTypes(right, `${pattern}${NumberPattern}`);
1646
- }
1647
- function EncodeBoolean(right, pattern) {
1648
- return EncodeType(Union([Literal("false"), Literal("true")]), right, pattern);
1649
- }
1650
- function EncodeString(right, pattern) {
1651
- return EncodeTypes(right, `${pattern}.*`);
1652
- }
1653
- function EncodeTemplateLiteral(templatePattern, right, pattern) {
1654
- return EncodeTypes(right, `${pattern}${UnwrapTemplateLiteralPattern(templatePattern)}`);
1655
- }
1656
- function EncodeTemplateLiteralDeferred(types, right, pattern) {
1657
- return EncodeType(TemplateLiteralAction(types, {}), right, pattern);
1658
- }
1659
- function EncodeEnum(values, right, pattern) {
1660
- return EncodeType(EvaluateEnum(values), right, pattern);
1661
- }
1662
- function EncodeUnion(types, right, pattern, result = []) {
1663
- return ShiftLeft(types, (head, tail) => EncodeUnion(tail, right, pattern, [...result, EncodeType(head, [], "")]), () => EncodeTypes(right, `${pattern}(${JoinString(result)})`));
1664
- }
1665
- function EncodeType(type, right, pattern) {
1666
- return IsEnum(type) ? EncodeEnum(type.enum, right, pattern) : IsInteger(type) ? EncodeInteger(right, pattern) : IsLiteral(type) ? EncodeLiteral(type.const, right, pattern) : IsBigInt(type) ? EncodeBigInt(right, pattern) : IsBoolean(type) ? EncodeBoolean(right, pattern) : IsNumber(type) ? EncodeNumber(right, pattern) : IsString(type) ? EncodeString(right, pattern) : IsTemplateLiteral(type) ? EncodeTemplateLiteral(type.pattern, right, pattern) : IsTemplateLiteralDeferred(type) ? EncodeTemplateLiteralDeferred(type.parameters[0], right, pattern) : IsUnion(type) ? EncodeUnion(type.anyOf, right, pattern) : NeverPattern;
1667
- }
1668
- function EncodeTypes(types, pattern) {
1669
- return ShiftLeft(types, (left, right) => EncodeType(left, right, pattern), () => pattern);
1670
- }
1671
- function EncodePattern(types) {
1672
- return `^${EncodeTypes(types, "")}$`;
1673
- }
1674
- /** Encodes a TemplateLiteral type sequence into a TemplateLiteral */
1675
- function TemplateLiteralEncode(types) {
1676
- return TemplateLiteralCreate(EncodePattern(types));
1677
- }
1678
- //#endregion
1679
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs
1680
- function TemplateLiteralAction(types, options) {
1681
- return CanInstantiate(types) ? Update(TemplateLiteralEncode(types), {}, options) : TemplateLiteralDeferred(types, options);
1682
- }
1683
- function TemplateLiteralInstantiate(context, state, types, options) {
1684
- return TemplateLiteralAction(InstantiateTypes(context, state, types), options);
1685
- }
1686
- //#endregion
1687
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/template_literal.mjs
1688
- /** Creates a deferred TemplateLiteral action. */
1689
- function TemplateLiteralDeferred(types, options = {}) {
1690
- return Deferred("TemplateLiteral", [types], options);
1691
- }
1692
- /** Returns true if this value is a deferred Interface action. */
1693
- function IsTemplateLiteralDeferred(value) {
1694
- return IsSchema(value) && HasPropertyKey(value, "action") && IsEqual(value.action, "TemplateLiteral");
1695
- }
1696
- /** Returns true if the given value is TTemplateLiteral. */
1697
- function IsTemplateLiteral(value) {
1698
- return IsKind(value, "TemplateLiteral");
1699
- }
1700
- //#endregion
1701
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/result.mjs
1702
- function ExtendsUnion$1(inferred) {
1703
- return Create({ ["~kind"]: "ExtendsUnion" }, { inferred });
1704
- }
1705
- function IsExtendsUnion(value) {
1706
- return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "inferred") && IsEqual(value["~kind"], "ExtendsUnion") && IsObject$1(value.inferred);
1707
- }
1708
- function ExtendsTrue(inferred) {
1709
- return Create({ ["~kind"]: "ExtendsTrue" }, { inferred });
1710
- }
1711
- function IsExtendsTrue(value) {
1712
- return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "inferred") && IsEqual(value["~kind"], "ExtendsTrue") && IsObject$1(value.inferred);
1713
- }
1714
- function ExtendsFalse() {
1715
- return Create({ ["~kind"]: "ExtendsFalse" }, {});
1716
- }
1717
- function IsExtendsFalse(value) {
1718
- return IsObject$1(value) && HasPropertyKey(value, "~kind") && IsEqual(value["~kind"], "ExtendsFalse");
1719
- }
1720
- function IsExtendsTrueLike(value) {
1721
- return IsExtendsUnion(value) || IsExtendsTrue(value);
1722
- }
1723
- function Match(result, true_, false_) {
1724
- return IsExtendsTrueLike(result) ? true_(result.inferred) : false_();
1725
- }
1726
- //#endregion
1727
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/extends_right.mjs
1728
- function ExtendsRightInfer(inferred, name, left, right) {
1729
- return Match(ExtendsLeft(inferred, left, right), (checkInferred) => ExtendsTrue(Assign(Assign(inferred, checkInferred), { [name]: left })), () => ExtendsFalse());
1730
- }
1731
- function ExtendsRightAny(inferred, _left) {
1732
- return ExtendsTrue(inferred);
1733
- }
1734
- function ExtendsRightDependent(inferred, left, if_, then_, else_) {
1735
- return Match(ExtendsLeft(inferred, left, if_), (inferred) => Match(ExtendsLeft(inferred, left, then_), (inferred) => ExtendsTrue(inferred), () => ExtendsFalse()), () => Match(ExtendsLeft(inferred, left, else_), (inferred) => ExtendsTrue(inferred), () => ExtendsFalse()));
1736
- }
1737
- function ExtendsRightEnum(inferred, left, right) {
1738
- return ExtendsLeft(inferred, left, EvaluateEnum(right));
1739
- }
1740
- function ExtendsRightIntersect(inferred, left, right) {
1741
- return ShiftLeft(right, (head, tail) => Match(ExtendsLeft(inferred, left, head), (inferred) => ExtendsRightIntersect(inferred, left, tail), () => ExtendsFalse()), () => ExtendsTrue(inferred));
1742
- }
1743
- function ExtendsRightTemplateLiteral(inferred, left, right) {
1744
- return ExtendsLeft(inferred, left, EvaluateTemplateLiteral(right));
1745
- }
1746
- function ExtendsRightUnion(inferred, left, right) {
1747
- return ShiftLeft(right, (head, tail) => Match(ExtendsLeft(inferred, left, head), (inferred) => ExtendsTrue(inferred), () => ExtendsRightUnion(inferred, left, tail)), () => ExtendsFalse());
1748
- }
1749
- function ExtendsRight(inferred, left, right) {
1750
- return IsAny(right) ? ExtendsRightAny(inferred, left) : IsDependent(right) ? ExtendsRightDependent(inferred, left, right.if, right.then, right.else) : IsEnum(right) ? ExtendsRightEnum(inferred, left, right.enum) : IsInfer(right) ? ExtendsRightInfer(inferred, right.name, left, right.extends) : IsIntersect(right) ? ExtendsRightIntersect(inferred, left, right.allOf) : IsTemplateLiteral(right) ? ExtendsRightTemplateLiteral(inferred, left, right.pattern) : IsUnion(right) ? ExtendsRightUnion(inferred, left, right.anyOf) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
1751
- }
1752
- //#endregion
1753
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/any.mjs
1754
- function ExtendsAny(inferred, left, right) {
1755
- return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsUnion$1(inferred);
1756
- }
1757
- //#endregion
1758
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/array.mjs
1759
- function ExtendsImmutable(left, right) {
1760
- const isImmutableLeft = IsImmutable(left);
1761
- const isImmutableRight = IsImmutable(right);
1762
- return isImmutableLeft && isImmutableRight ? true : !isImmutableLeft && isImmutableRight ? true : isImmutableLeft && !isImmutableRight ? false : true;
1763
- }
1764
- function ExtendsArray(inferred, arrayLeft, left, right) {
1765
- return IsArray(right) ? ExtendsImmutable(arrayLeft, right) ? ExtendsLeft(inferred, left, right.items) : ExtendsFalse() : ExtendsRight(inferred, arrayLeft, right);
1766
- }
1767
- //#endregion
1768
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/bigint.mjs
1769
- function ExtendsBigInt(inferred, left, right) {
1770
- return IsBigInt(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
1771
- }
1772
- //#endregion
1773
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/boolean.mjs
1774
- function ExtendsBoolean(inferred, left, right) {
1775
- return IsBoolean(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
1776
- }
1777
- //#endregion
1778
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/parameters.mjs
1779
- function ParameterCompare(inferred, left, leftRest, right, rightRest) {
1780
- const checkLeft = IsInfer(right) ? left : right;
1781
- const checkRight = IsInfer(right) ? right : left;
1782
- const isLeftOptional = IsOptional(left);
1783
- const isRightOptional = IsOptional(right);
1784
- return !isLeftOptional && isRightOptional ? ExtendsFalse() : Match(ExtendsLeft(inferred, checkLeft, checkRight), (inferred) => ExtendsParameters(inferred, leftRest, rightRest), () => ExtendsFalse());
1785
- }
1786
- function ParameterRight(inferred, left, leftRest, rightRest) {
1787
- return ShiftLeft(rightRest, (head, tail) => ParameterCompare(inferred, left, leftRest, head, tail), () => IsOptional(left) ? ExtendsTrue(inferred) : ExtendsFalse());
1788
- }
1789
- function ParametersLeft(inferred, left, rightRest) {
1790
- return ShiftLeft(left, (head, tail) => ParameterRight(inferred, head, tail, rightRest), () => ExtendsTrue(inferred));
1791
- }
1792
- function ExtendsParameters(inferred, left, right) {
1793
- return ParametersLeft(inferred, left, right);
1794
- }
1795
- //#endregion
1796
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/return_type.mjs
1797
- function ExtendsReturnType(inferred, left, right) {
1798
- return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsLeft(inferred, left, right);
1799
- }
1800
- //#endregion
1801
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/constructor.mjs
1802
- function ExtendsConstructor(inferred, parameters, returnType, right) {
1803
- return IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : IsConstructor(right) ? Match(ExtendsParameters(inferred, parameters, right["parameters"]), (inferred) => ExtendsReturnType(inferred, returnType, right["instanceType"]), () => ExtendsFalse()) : ExtendsFalse();
1804
- }
1805
- //#endregion
1806
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/dependent.mjs
1807
- function ExtendsDependent(inferred, if_, then_, else_, right) {
1808
- return Match(ExtendsLeft(inferred, if_, right), () => ExtendsLeft(inferred, then_, right), () => ExtendsLeft(inferred, else_, right));
1809
- }
1810
- //#endregion
1811
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/enum.mjs
1812
- function ExtendsEnum(inferred, left, right) {
1813
- return ExtendsLeft(inferred, EvaluateEnum(left), right);
1814
- }
1815
- //#endregion
1816
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/function.mjs
1817
- function ExtendsFunction(inferred, parameters, returnType, right) {
1818
- return IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : IsFunction(right) ? Match(ExtendsParameters(inferred, parameters, right["parameters"]), (inferred) => ExtendsReturnType(inferred, returnType, right["returnType"]), () => ExtendsFalse()) : ExtendsFalse();
1819
- }
1820
- //#endregion
1821
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/integer.mjs
1822
- function ExtendsInteger(inferred, left, right) {
1823
- return IsInteger(right) ? ExtendsTrue(inferred) : IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
1824
- }
1825
- //#endregion
1826
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/intersect.mjs
1827
- function ExtendsIntersect(inferred, left, right) {
1828
- return ExtendsLeft(inferred, EvaluateIntersect(left), right);
1829
- }
1830
- //#endregion
1831
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/literal.mjs
1832
- function ExtendsLiteralValue(inferred, left, right) {
1833
- return left === right ? ExtendsTrue(inferred) : ExtendsFalse();
1834
- }
1835
- function ExtendsLiteralBigInt(inferred, left, right) {
1836
- return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBigInt(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
1837
- }
1838
- function ExtendsLiteralBoolean(inferred, left, right) {
1839
- return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsBoolean(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
1840
- }
1841
- function ExtendsLiteralNumber(inferred, left, right) {
1842
- return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
1843
- }
1844
- function ExtendsLiteralString(inferred, left, right) {
1845
- return IsLiteral(right) ? ExtendsLiteralValue(inferred, left, right.const) : IsString(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, Literal(left), right);
1846
- }
1847
- function ExtendsLiteral(inferred, left, right) {
1848
- return IsBigInt$1(left.const) ? ExtendsLiteralBigInt(inferred, left.const, right) : IsBoolean$2(left.const) ? ExtendsLiteralBoolean(inferred, left.const, right) : IsNumber$2(left.const) ? ExtendsLiteralNumber(inferred, left.const, right) : IsString$2(left.const) ? ExtendsLiteralString(inferred, left.const, right) : Unreachable();
1849
- }
1850
- //#endregion
1851
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/never.mjs
1852
- function ExtendsNever(inferred, left, right) {
1853
- return IsInfer(right) ? ExtendsRight(inferred, left, right) : ExtendsTrue(inferred);
1854
- }
1855
- //#endregion
1856
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/null.mjs
1857
- function ExtendsNull(inferred, left, right) {
1858
- return IsNull(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
1859
- }
1860
- //#endregion
1861
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/number.mjs
1862
- function ExtendsNumber(inferred, left, right) {
1863
- return IsNumber(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
1864
- }
1865
- //#endregion
1866
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/object.mjs
1867
- function ExtendsPropertyOptional(inferred, left, right) {
1868
- return IsOptional(left) ? IsOptional(right) ? ExtendsTrue(inferred) : ExtendsFalse() : ExtendsTrue(inferred);
1869
- }
1870
- function ExtendsProperty(inferred, left, right) {
1871
- return IsInfer(right) && IsNever(right.extends) ? ExtendsFalse() : Match(ExtendsLeft(inferred, left, right), (inferred) => ExtendsPropertyOptional(inferred, left, right), () => ExtendsFalse());
1872
- }
1873
- function ExtractInferredProperties(keys, properties) {
1874
- return keys.reduce((result, key) => {
1875
- return key in properties ? IsExtendsTrueLike(properties[key]) ? {
1876
- ...result,
1877
- ...properties[key].inferred
1878
- } : Unreachable() : Unreachable();
1879
- }, {});
1880
- }
1881
- function ExtendsPropertiesComparer(inferred, left, right) {
1882
- const properties = {};
1883
- for (const rightKey of Keys$1(right)) properties[rightKey] = rightKey in left ? ExtendsProperty({}, left[rightKey], right[rightKey]) : IsOptional(right[rightKey]) ? IsInfer(right[rightKey]) ? ExtendsTrue(Assign(inferred, { [right[rightKey].name]: right[rightKey].extends })) : ExtendsTrue(inferred) : ExtendsFalse();
1884
- const checked = Values(properties).every((result) => IsExtendsTrueLike(result));
1885
- const extracted = checked ? ExtractInferredProperties(Keys$1(properties), properties) : {};
1886
- return checked ? ExtendsTrue(extracted) : ExtendsFalse();
1887
- }
1888
- function ExtendsProperties(inferred, left, right) {
1889
- const compared = ExtendsPropertiesComparer(inferred, left, right);
1890
- return IsExtendsTrueLike(compared) ? ExtendsTrue(Assign(inferred, compared.inferred)) : ExtendsFalse();
1891
- }
1892
- function ExtendsObjectToObject(inferred, left, right) {
1893
- return ExtendsProperties(inferred, left, right);
1894
- }
1895
- function RecordMergeInferred(left, right) {
1896
- return Keys$1(right).reduce((result, key) => {
1897
- return {
1898
- ...result,
1899
- [key]: HasPropertyKey(left, key) ? IsUnion(result[key]) ? Union([...result[key].anyOf, right[key]]) : Union([left[key], right[key]]) : right[key]
1900
- };
1901
- }, left);
1902
- }
1903
- function ExtendsRecordComparer(properties, keys, type, result) {
1904
- return ShiftLeft(keys, (left, right) => Match(ExtendsLeft({}, properties[left], type), (inferred) => ExtendsRecordComparer(properties, right, type, RecordMergeInferred(result, inferred)), () => ExtendsFalse()), () => ExtendsTrue(result));
1905
- }
1906
- function ExtendsObjectToRecord(inferred, properties, _pattern, value) {
1907
- return ExtendsRecordComparer(properties, Keys$1(properties), value, inferred);
1908
- }
1909
- function ExtendsObject(inferred, left, right) {
1910
- return IsRecord(right) ? ExtendsObjectToRecord(inferred, left, RecordPattern(right), RecordValue(right)) : IsObject(right) ? ExtendsObjectToObject(inferred, left, right.properties) : ExtendsRight(inferred, _Object_(left), right);
1911
- }
1912
- //#endregion
1913
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/record.mjs
1914
- function FromObject$6(inferred, properties) {
1915
- return IsEqual(Keys$1(properties).length, 0) ? ExtendsTrue(inferred) : ExtendsFalse();
1916
- }
1917
- function FromRecord$1(inferred, _leftKey, leftValue, _rightKey, rightValue) {
1918
- return ExtendsLeft(inferred, leftValue, rightValue);
1919
- }
1920
- function ExtendsRecord(inferred, leftPattern, leftValue, right) {
1921
- return IsRecord(right) ? FromRecord$1(inferred, RecordPatternToType(leftPattern), leftValue, RecordPatternToType(RecordPattern(right)), RecordValue(right)) : IsObject(right) ? FromObject$6(inferred, right.properties) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
1922
- }
1923
- //#endregion
1924
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/string.mjs
1925
- function ExtendsString(inferred, left, right) {
1926
- return IsString(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
1927
- }
1928
- //#endregion
1929
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/symbol.mjs
1930
- function ExtendsSymbol(inferred, left, right) {
1931
- return IsSymbol(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
1932
- }
1933
- //#endregion
1934
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/template_literal.mjs
1935
- function ExtendsTemplateLiteral(inferred, left, right) {
1936
- return ExtendsLeft(inferred, EvaluateTemplateLiteral(left), right);
1937
- }
1938
- //#endregion
1939
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/inference.mjs
1940
- function Inferrable(name, type) {
1941
- return Create({ "~kind": "Inferrable" }, {
1942
- name,
1943
- type
1944
- }, {});
1945
- }
1946
- function IsInferable(value) {
1947
- return IsObject$1(value) && HasPropertyKey(value, "~kind") && HasPropertyKey(value, "name") && HasPropertyKey(value, "type") && IsEqual(value["~kind"], "Inferrable") && IsString$2(value.name) && IsObject$1(value.type);
1948
- }
1949
- function TryRestInferable(type) {
1950
- return IsRest(type) ? IsInfer(type.items) ? IsArray(type.items.extends) ? Inferrable(type.items.name, type.items.extends.items) : IsUnknown(type.items.extends) ? Inferrable(type.items.name, type.items.extends) : void 0 : Unreachable() : void 0;
1951
- }
1952
- function TryInferable(type) {
1953
- return IsInfer(type) ? Inferrable(type.name, type.extends) : void 0;
1954
- }
1955
- function TryInferResults(rest, right) {
1956
- const result = [];
1957
- for (const head of rest) {
1958
- if (!IsExtendsTrueLike(ExtendsLeft({}, head, right))) return void 0;
1959
- result.push(head);
1960
- }
1961
- return result;
1962
- }
1963
- function InferTupleResult(inferred, name, left, right) {
1964
- const results = TryInferResults(left, right);
1965
- return IsArray$1(results) ? ExtendsTrue(Assign(inferred, { [name]: Tuple(results) })) : ExtendsFalse();
1966
- }
1967
- function InferUnionResult(inferred, name, left, right) {
1968
- const results = TryInferResults(left, right);
1969
- return IsArray$1(results) ? ExtendsTrue(Assign(inferred, { [name]: Union(results) })) : ExtendsFalse();
1970
- }
1971
- //#endregion
1972
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/tuple.mjs
1973
- function Reverse(types) {
1974
- return [...types].reverse();
1975
- }
1976
- function ApplyReverse(types, reversed) {
1977
- return reversed ? Reverse(types) : types;
1978
- }
1979
- function Reversed(types) {
1980
- const first = types.length > 0 ? types[0] : void 0;
1981
- return IsSchema(IsSchema(first) ? TryRestInferable(first) : void 0);
1982
- }
1983
- function ElementsCompare(inferred, reversed, left, leftRest, right, rightRest) {
1984
- return Match(ExtendsLeft(inferred, left, right), (checkInferred) => Elements(checkInferred, reversed, leftRest, rightRest), () => ExtendsFalse());
1985
- }
1986
- function ElementsLeft(inferred, reversed, leftRest, right, rightRest) {
1987
- const inferable = TryRestInferable(right);
1988
- return IsInferable(inferable) ? InferTupleResult(inferred, inferable["name"], ApplyReverse(leftRest, reversed), inferable["type"]) : ShiftLeft(leftRest, (head, tail) => ElementsCompare(inferred, reversed, head, tail, right, rightRest), () => ExtendsFalse());
1989
- }
1990
- function ElementsRight(inferred, reversed, leftRest, rightRest) {
1991
- return ShiftLeft(rightRest, (head, tail) => ElementsLeft(inferred, reversed, leftRest, head, tail), () => IsEqual(leftRest.length, 0) ? ExtendsTrue(inferred) : ExtendsFalse());
1992
- }
1993
- function Elements(inferred, reversed, leftRest, rightRest) {
1994
- return ElementsRight(inferred, reversed, leftRest, rightRest);
1995
- }
1996
- function ExtendsTupleToTuple(inferred, left, right) {
1997
- const instantiatedRight = InstantiateElements(inferred, State([], []), right);
1998
- const reversed = Reversed(instantiatedRight);
1999
- return Elements(inferred, reversed, ApplyReverse(left, reversed), ApplyReverse(instantiatedRight, reversed));
2000
- }
2001
- function ExtendsTupleToArrayReduce(inferred, left, right) {
2002
- for (const head of left) {
2003
- const result = ExtendsLeft(inferred, head, right);
2004
- if (!IsExtendsTrueLike(result)) return result;
2005
- inferred = result.inferred;
2006
- }
2007
- return ExtendsTrue(inferred);
2008
- }
2009
- function ExtendsTupleToArray(inferred, left, right) {
2010
- const inferrable = TryInferable(right);
2011
- return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable["name"], left, inferrable["type"]) : ExtendsTupleToArrayReduce(inferred, left, right);
2012
- }
2013
- function ExtendsTuple(inferred, left, right) {
2014
- const instantiatedLeft = InstantiateElements(inferred, State([], []), left);
2015
- return IsTuple(right) ? ExtendsTupleToTuple(inferred, instantiatedLeft, right.items) : IsArray(right) ? ExtendsTupleToArray(inferred, instantiatedLeft, right.items) : ExtendsRight(inferred, Tuple(instantiatedLeft), right);
2016
- }
2017
- //#endregion
2018
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/undefined.mjs
2019
- function ExtendsUndefined(inferred, left, right) {
2020
- return IsVoid(right) ? ExtendsTrue(inferred) : IsUndefined(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2021
- }
2022
- //#endregion
2023
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/union.mjs
2024
- function ExtendsUnionSome(inferred, type, unionTypes) {
2025
- return ShiftLeft(unionTypes, (head, tail) => Match(ExtendsLeft(inferred, type, head), (inferred) => ExtendsTrue(inferred), () => ExtendsUnionSome(inferred, type, tail)), () => ExtendsFalse());
2026
- }
2027
- function ExtendsUnionLeft(inferred, left, right) {
2028
- return ShiftLeft(left, (head, tail) => Match(ExtendsUnionSome(inferred, head, right), (inferred) => ExtendsUnionLeft(inferred, tail, right), () => ExtendsFalse()), () => ExtendsTrue(inferred));
2029
- }
2030
- function ExtendsUnion(inferred, left, right) {
2031
- const inferrable = TryInferable(right);
2032
- return IsInferable(inferrable) ? InferUnionResult(inferred, inferrable.name, left, inferrable.type) : IsUnion(right) ? ExtendsUnionLeft(inferred, left, right.anyOf) : ExtendsUnionLeft(inferred, left, [right]);
2033
- }
2034
- //#endregion
2035
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/unknown.mjs
2036
- function ExtendsUnknown(inferred, left, right) {
2037
- return IsInfer(right) ? ExtendsRight(inferred, left, right) : IsAny(right) ? ExtendsTrue(inferred) : IsUnknown(right) ? ExtendsTrue(inferred) : ExtendsFalse();
2038
- }
2039
- //#endregion
2040
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/void.mjs
2041
- function ExtendsVoid(inferred, left, right) {
2042
- return IsVoid(right) ? ExtendsTrue(inferred) : ExtendsRight(inferred, left, right);
2043
- }
2044
- //#endregion
2045
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/extends_left.mjs
2046
- function ExtendsLeft(inferred, left, right) {
2047
- return IsAny(left) ? ExtendsAny(inferred, left, right) : IsArray(left) ? ExtendsArray(inferred, left, left.items, right) : IsBigInt(left) ? ExtendsBigInt(inferred, left, right) : IsBoolean(left) ? ExtendsBoolean(inferred, left, right) : IsConstructor(left) ? ExtendsConstructor(inferred, left.parameters, left.instanceType, right) : IsDependent(left) ? ExtendsDependent(inferred, left.if, left.then, left.else, right) : IsEnum(left) ? ExtendsEnum(inferred, left.enum, right) : IsFunction(left) ? ExtendsFunction(inferred, left.parameters, left.returnType, right) : IsInteger(left) ? ExtendsInteger(inferred, left, right) : IsIntersect(left) ? ExtendsIntersect(inferred, left.allOf, right) : IsLiteral(left) ? ExtendsLiteral(inferred, left, right) : IsNever(left) ? ExtendsNever(inferred, left, right) : IsNull(left) ? ExtendsNull(inferred, left, right) : IsNumber(left) ? ExtendsNumber(inferred, left, right) : IsObject(left) ? ExtendsObject(inferred, left.properties, right) : IsRecord(left) ? ExtendsRecord(inferred, RecordPattern(left), RecordValue(left), right) : IsString(left) ? ExtendsString(inferred, left, right) : IsSymbol(left) ? ExtendsSymbol(inferred, left, right) : IsTemplateLiteral(left) ? ExtendsTemplateLiteral(inferred, left.pattern, right) : IsTuple(left) ? ExtendsTuple(inferred, left.items, right) : IsUndefined(left) ? ExtendsUndefined(inferred, left, right) : IsUnion(left) ? ExtendsUnion(inferred, left.anyOf, right) : IsUnknown(left) ? ExtendsUnknown(inferred, left, right) : IsVoid(left) ? ExtendsVoid(inferred, left, right) : ExtendsFalse();
2048
- }
2049
- //#endregion
2050
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/interface/instantiate.mjs
2051
- function InterfaceOperation(heritage, properties) {
2052
- return EvaluateIntersect([...heritage, _Object_(properties)]);
2053
- }
2054
- function InterfaceAction(heritage, properties, options) {
2055
- return CanInstantiate(heritage) ? Update(InterfaceOperation(heritage, properties), {}, options) : InterfaceDeferred(heritage, properties, options);
2056
- }
2057
- function InterfaceInstantiate(context, state, heritage, properties, options) {
2058
- return InterfaceAction(InstantiateTypes(context, state, heritage), InstantiateProperties(context, state, properties), options);
2059
- }
2060
- //#endregion
2061
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/interface.mjs
2062
- /** Creates a deferred Interface action. */
2063
- function InterfaceDeferred(heritage, properties, options = {}) {
2064
- return Deferred("Interface", [heritage, properties], options);
2065
- }
2066
- /** Returns true if this value is a deferred Interface action. */
2067
- function IsInterfaceDeferred(value) {
2068
- return IsSchema(value) && HasPropertyKey(value, "action") && IsEqual(value.action, "Interface");
2069
- }
2070
- //#endregion
2071
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/cyclic/check.mjs
2072
- function FromRef$3(stack, context, ref) {
2073
- return stack.includes(ref) ? true : FromType$15([...stack, ref], context, context[ref]);
2074
- }
2075
- function FromProperties$2(stack, context, properties) {
2076
- return FromTypes$3(stack, context, PropertyValues(properties));
2077
- }
2078
- function FromTypes$3(stack, context, types) {
2079
- return ShiftLeft(types, (left, right) => FromType$15(stack, context, left) ? true : FromTypes$3(stack, context, right), () => false);
2080
- }
2081
- function FromType$15(stack, context, type) {
2082
- return IsRef(type) ? FromRef$3(stack, context, type.$ref) : IsArray(type) ? FromType$15(stack, context, type.items) : IsConstructor(type) ? FromTypes$3(stack, context, [...type.parameters, type.instanceType]) : IsFunction(type) ? FromTypes$3(stack, context, [...type.parameters, type.returnType]) : IsInterfaceDeferred(type) ? FromProperties$2(stack, context, type.parameters[1]) : IsIntersect(type) ? FromTypes$3(stack, context, type.allOf) : IsObject(type) ? FromProperties$2(stack, context, type.properties) : IsUnion(type) ? FromTypes$3(stack, context, type.anyOf) : IsTuple(type) ? FromTypes$3(stack, context, type.items) : IsRecord(type) ? FromType$15(stack, context, RecordValue(type)) : false;
2083
- }
2084
- /** Performs a cyclic check on the given type. Initial key stack can be empty, but faster if specified */
2085
- function CyclicCheck(stack, context, type) {
2086
- return FromType$15(stack, context, type);
2087
- }
2088
- //#endregion
2089
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/cyclic/candidates.mjs
2090
- function ResolveCandidateKeys(context, keys) {
2091
- return keys.reduce((result, left) => {
2092
- return CyclicCheck([left], context, context[left]) ? [...result, left] : result;
2093
- }, []);
2094
- }
2095
- /** Returns keys for context types that need to be transformed to TCyclic. */
2096
- function CyclicCandidates(context) {
2097
- return ResolveCandidateKeys(context, PropertyKeys(context));
2098
- }
2099
- //#endregion
2100
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs
2101
- function FromRef$2(context, ref, result) {
2102
- return result.includes(ref) ? result : ref in context ? FromType$14(context, context[ref], [...result, ref]) : Unreachable();
2103
- }
2104
- function FromProperties$1(context, properties, result) {
2105
- return FromTypes$2(context, PropertyValues(properties), result);
2106
- }
2107
- function FromTypes$2(context, types, result) {
2108
- return types.reduce((result, left) => {
2109
- return FromType$14(context, left, result);
2110
- }, result);
2111
- }
2112
- function FromType$14(context, type, result) {
2113
- return IsRef(type) ? FromRef$2(context, type.$ref, result) : IsArray(type) ? FromType$14(context, type.items, result) : IsConstructor(type) ? FromTypes$2(context, [...type.parameters, type.instanceType], result) : IsFunction(type) ? FromTypes$2(context, [...type.parameters, type.returnType], result) : IsInterfaceDeferred(type) ? FromProperties$1(context, type.parameters[1], result) : IsIntersect(type) ? FromTypes$2(context, type.allOf, result) : IsObject(type) ? FromProperties$1(context, type.properties, result) : IsUnion(type) ? FromTypes$2(context, type.anyOf, result) : IsTuple(type) ? FromTypes$2(context, type.items, result) : IsRecord(type) ? FromType$14(context, RecordValue(type), result) : result;
2114
- }
2115
- /** Returns dependent cyclic keys for the given type. This function is used to dead-type-eliminate (DTE) for initializing TCyclic types. */
2116
- function CyclicDependencies(context, key, type) {
2117
- return FromType$14(context, type, [key]);
2118
- }
2119
- //#endregion
2120
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/cyclic/extends.mjs
2121
- function FromRef$1(_ref) {
2122
- return Any();
2123
- }
2124
- function FromProperties(properties) {
2125
- return Keys$1(properties).reduce((result, key) => {
2126
- return {
2127
- ...result,
2128
- [key]: FromType$13(properties[key])
2129
- };
2130
- }, {});
2131
- }
2132
- function FromTypes$1(types) {
2133
- return types.reduce((result, left) => {
2134
- return [...result, FromType$13(left)];
2135
- }, []);
2136
- }
2137
- function FromType$13(type) {
2138
- return IsRef(type) ? FromRef$1(type.$ref) : IsArray(type) ? _Array_(FromType$13(type.items), ArrayOptions(type)) : IsConstructor(type) ? Constructor(FromTypes$1(type.parameters), FromType$13(type.instanceType)) : IsFunction(type) ? _Function_(FromTypes$1(type.parameters), FromType$13(type.returnType)) : IsIntersect(type) ? Intersect(FromTypes$1(type.allOf)) : IsObject(type) ? _Object_(FromProperties(type.properties)) : IsRecord(type) ? Record(RecordKey(type), FromType$13(RecordValue(type))) : IsUnion(type) ? Union(FromTypes$1(type.anyOf)) : IsTuple(type) ? Tuple(FromTypes$1(type.items)) : type;
2139
- }
2140
- function CyclicAnyFromParameters(defs, ref) {
2141
- return ref in defs ? FromType$13(defs[ref]) : Unknown();
2142
- }
2143
- /** Transforms TCyclic TRef's into TAny's. This function is used prior to TExtends checks to enable cyclics to be structurally checked and terminated (with TAny) at first point of recursion, what would otherwise be a recursive TRef.*/
2144
- function CyclicExtends(type) {
2145
- return CyclicAnyFromParameters(type.$defs, type.$ref);
2146
- }
2147
- //#endregion
2148
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs
2149
- function CyclicInterface(context, heritage, properties) {
2150
- const instantiatedHeritage = InstantiateTypes(context, State([], []), heritage);
2151
- const instantiatedProperties = InstantiateProperties({}, State([], []), properties);
2152
- return EvaluateIntersect([...instantiatedHeritage, _Object_(instantiatedProperties)]);
2153
- }
2154
- function CyclicDefinitions(context, dependencies) {
2155
- return Keys$1(context).filter((key) => dependencies.includes(key)).reduce((result, key) => {
2156
- const type = context[key];
2157
- const instantiatedType = IsInterfaceDeferred(type) ? CyclicInterface(context, type.parameters[0], type.parameters[1]) : type;
2158
- return {
2159
- ...result,
2160
- [key]: instantiatedType
2161
- };
2162
- }, {});
2163
- }
2164
- function InstantiateCyclic(context, ref, type) {
2165
- return Cyclic(CyclicDefinitions(context, CyclicDependencies(context, ref, type)), ref);
2166
- }
2167
- //#endregion
2168
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/cyclic/target.mjs
2169
- function Resolve(defs, ref) {
2170
- return ref in defs ? IsRef(defs[ref]) ? Resolve(defs, defs[ref].$ref) : defs[ref] : Never();
2171
- }
2172
- /** Returns the target Type from the Defs or Never if target is non-resolvable */
2173
- function CyclicTarget(defs, ref) {
2174
- return Resolve(defs, ref);
2175
- }
2176
- //#endregion
2177
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/extends/extends.mjs
2178
- function Canonical(type) {
2179
- return IsCyclic(type) ? CyclicExtends(type) : IsUnsafe(type) ? Unknown() : type;
2180
- }
2181
- /** Performs a structural extends check on left and right types and yields inferred types on right if specified. */
2182
- function Extends(inferred, left, right) {
2183
- return ExtendsLeft(inferred, Canonical(left), Canonical(right));
2184
- }
2185
- /** Compares left and right types and determines their set relationship. */
2186
- function Compare(left, right) {
2187
- const extendsCheck = [Extends({}, left, right), Extends({}, right, left)];
2188
- return IsExtendsTrueLike(extendsCheck[0]) && IsExtendsTrueLike(extendsCheck[1]) ? 0 : IsExtendsTrueLike(extendsCheck[0]) && IsExtendsFalse(extendsCheck[1]) ? 2 : IsExtendsFalse(extendsCheck[0]) && IsExtendsTrueLike(extendsCheck[1]) ? 3 : 1;
2189
- }
2190
- //#endregion
2191
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/evaluate/broaden.mjs
2192
- function BroadenFilter(type, types, result = [], all = types) {
2193
- return ShiftLeft(types, (left, right) => {
2194
- const compare = Compare(type, left);
2195
- return IsEqual(compare, 2) || IsEqual(compare, 0) ? all : IsEqual(compare, 1) ? BroadenFilter(type, right, [...result, left], all) : BroadenFilter(type, right, result, all);
2196
- }, () => [...result, type]);
2197
- }
2198
- function BroadenType(type, types, result) {
2199
- const evaluated = EvaluateType(type);
2200
- return IsAny(evaluated) ? [evaluated] : IsUnknown(evaluated) ? [evaluated] : IsNever(evaluated) ? BroadenTypes(types, result) : IsObject(evaluated) ? BroadenTypes(types, [...result, evaluated]) : BroadenTypes(types, BroadenFilter(evaluated, result));
2201
- }
2202
- function BroadenTypes(types, result = []) {
2203
- return ShiftLeft(types, (left, right) => BroadenType(left, right, result), () => result);
2204
- }
2205
- /** Broadens a set of types and returns either the most broad type, or union or disjoint types. */
2206
- function Broaden(types) {
2207
- return Flatten(BroadenTypes(types));
2208
- }
2209
- //#endregion
2210
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs
2211
- function EvaluateAction(type, options) {
2212
- return Update(EvaluateType(type), {}, options);
2213
- }
2214
- function EvaluateInstantiate(context, state, type, options) {
2215
- return EvaluateAction(InstantiateType(context, state, type), options);
2216
- }
2217
- //#endregion
2218
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs
2219
- function CollectDistributionNames(expression, result = []) {
2220
- return IsDeferred(expression) && IsEqual(expression.action, "Conditional") ? IsRef(expression.parameters[0]) ? CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], [...result, expression.parameters[0]["$ref"]])) : CollectDistributionNames(expression.parameters[2], CollectDistributionNames(expression.parameters[3], result)) : IsDeferred(expression) && IsEqual(expression.action, "Mapped") ? IsDeferred(expression.parameters[1]) && IsEqual(expression.parameters[1].action, "KeyOf") && IsRef(expression.parameters[1].parameters[0]) ? [...result, expression.parameters[1].parameters[0]["$ref"]] : result : result;
2221
- }
2222
- function BuildDistributionArray(parameters, names) {
2223
- return parameters.reduce((result, left) => [...result, names.includes(left.name)], []);
2224
- }
2225
- function ZipDistributionArray(arguments_, distributionArray, result = []) {
2226
- return ShiftLeft(arguments_, (argumentLeft, argumentRight) => ShiftLeft(distributionArray, (booleanLeft, booleanRight) => ZipDistributionArray(argumentRight, booleanRight, [...result, [booleanLeft, argumentLeft]]), () => result), () => result);
2227
- }
2228
- function CanonicalArgument(type) {
2229
- return IsTemplateLiteral(type) ? EvaluateTemplateLiteral(type.pattern) : IsEnum(type) ? EvaluateEnum(type.enum) : type;
2230
- }
2231
- function Expand(type) {
2232
- const canonicalArgument = CanonicalArgument(type);
2233
- return IsUnion(canonicalArgument) ? [...canonicalArgument.anyOf] : [canonicalArgument];
2234
- }
2235
- function Append(current, type) {
2236
- return current.reduce((result, left) => [...result, [...left, type]], []);
2237
- }
2238
- function Cross(current, variants) {
2239
- return variants.reduce((result, left) => {
2240
- return [...result, ...Append(current, left)];
2241
- }, []);
2242
- }
2243
- function Distribute(zipped) {
2244
- return zipped.reduce((result, left) => {
2245
- return IsEqual(left[0], true) ? Cross(result, Expand(left[1])) : Cross(result, [left[1]]);
2246
- }, [[]]);
2247
- }
2248
- function DistributeArguments(parameters, arguments_, expression) {
2249
- const zippedArguments = ZipDistributionArray(arguments_, BuildDistributionArray(parameters, CollectDistributionNames(expression)));
2250
- return IsDeferred(expression) && IsEqual(expression.action, "Conditional") ? Distribute(zippedArguments) : IsDeferred(expression) && IsEqual(expression.action, "Mapped") ? Distribute(zippedArguments) : [arguments_];
2251
- }
2252
- //#endregion
2253
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/call/resolve_target.mjs
2254
- function FromNotResolvable() {
2255
- return ["(not-resolvable)", Never()];
2256
- }
2257
- function FromNotGeneric() {
2258
- return ["(not-generic)", Never()];
2259
- }
2260
- function FromGeneric(name, parameters, expression) {
2261
- return [name, Generic(parameters, expression)];
2262
- }
2263
- function FromRef(context, ref, arguments_) {
2264
- return ref in context ? FromType$12(context, ref, context[ref], arguments_) : FromNotResolvable();
2265
- }
2266
- function FromType$12(context, name, target, arguments_) {
2267
- return IsGeneric(target) ? FromGeneric(name, target.parameters, target.expression) : IsRef(target) ? FromRef(context, target.$ref, arguments_) : FromNotGeneric();
2268
- }
2269
- /** Resolves a named generic target from the context, or returns TNever if it cannot be resolved or is not generic. */
2270
- function ResolveTarget(context, target, arguments_) {
2271
- return FromType$12(context, "(anonymous)", target, arguments_);
2272
- }
2273
- //#endregion
2274
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs
2275
- function AssertArgumentExtends(name, type, extends_) {
2276
- if (IsInfer(type) || IsCall(type) || IsExtendsTrueLike(Extends({}, type, extends_))) return;
2277
- const cause = {
2278
- parameter: name,
2279
- expect: extends_,
2280
- actual: type
2281
- };
2282
- throw new Error(`Argument for parameter ${name} does not satisfy constraint`, { cause });
2283
- }
2284
- function BindArgument(context, state, name, extends_, type) {
2285
- const instantiatedArgument = InstantiateType(context, state, type);
2286
- AssertArgumentExtends(name, instantiatedArgument, extends_);
2287
- return Assign(context, { [name]: instantiatedArgument });
2288
- }
2289
- function BindArguments(context, state, parameterLeft, parameterRight, arguments_) {
2290
- const instantiatedExtends = InstantiateType(context, state, parameterLeft.extends);
2291
- const instantiatedEquals = InstantiateType(context, state, parameterLeft.equals);
2292
- return ShiftLeft(arguments_, (left, right) => BindParameters(BindArgument(context, state, parameterLeft["name"], instantiatedExtends, left), state, parameterRight, right), () => BindParameters(BindArgument(context, state, parameterLeft["name"], instantiatedExtends, instantiatedEquals), state, parameterRight, []));
2293
- }
2294
- function BindParameters(context, state, parameters, arguments_) {
2295
- return ShiftLeft(parameters, (left, right) => BindArguments(context, state, left, right, arguments_), () => context);
2296
- }
2297
- function ResolveArgumentsContext(context, state, parameters, arguments_) {
2298
- return BindParameters(context, state, parameters, arguments_);
2299
- }
2300
- //#endregion
2301
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/call/instantiate.mjs
2302
- let instantiationDepth = 0;
2303
- let instantiationCount = 0;
2304
- function InstantiationAssert() {
2305
- if (IsLessThan(instantiationCount, Get().maxInstantiationCount)) return;
2306
- throw Error("Type instantiation is excessively deep and possibly infinite");
2307
- }
2308
- function InstantiationIncrement() {
2309
- InstantiationAssert();
2310
- instantiationCount++;
2311
- instantiationDepth++;
2312
- }
2313
- function InstantiationDecrement() {
2314
- instantiationDepth--;
2315
- if (IsEqual(instantiationDepth, 0)) instantiationCount = 0;
2316
- }
2317
- function Peek(state) {
2318
- return IsGreaterThan(state.callstack.length, 0) ? state.callstack[state.callstack.length - 1] : "";
2319
- }
2320
- function IsTailCall(state, name) {
2321
- return IsEqual(Peek(state), name);
2322
- }
2323
- function CallDispatch(context, state, target, parameters, expression, arguments_) {
2324
- InstantiationIncrement();
2325
- try {
2326
- const argumentsContext = ResolveArgumentsContext(context, state, parameters, arguments_);
2327
- const returnType = InstantiateType(argumentsContext, State([...state["callstack"], target["$ref"]], state["visited"]), expression);
2328
- return InstantiateType(argumentsContext, State([], []), returnType);
2329
- } finally {
2330
- InstantiationDecrement();
2331
- }
2332
- }
2333
- function CallDistributed(context, state, target, parameters, expression, distributedArguments) {
2334
- return distributedArguments.reduce((result, arguments_) => {
2335
- const returnType = CallDispatch(context, state, target, parameters, expression, arguments_);
2336
- return [...result, returnType];
2337
- }, []);
2338
- }
2339
- function CallImmediate(context, state, target, parameters, expression, arguments_) {
2340
- const returnTypes = CallDistributed(context, state, target, parameters, expression, DistributeArguments(parameters, arguments_, expression));
2341
- return IsEqual(returnTypes.length, 1) ? returnTypes[0] : EvaluateUnion(returnTypes);
2342
- }
2343
- function CallInstantiate(context, state, target, arguments_) {
2344
- const instantiatedArguments = InstantiateTypes(context, state, arguments_);
2345
- const resolved = ResolveTarget(context, target, arguments_);
2346
- const name = resolved[0];
2347
- const type = resolved[1];
2348
- return IsGeneric(type) ? IsTailCall(state, name) ? CallConstruct(Ref(name), instantiatedArguments) : CallImmediate(context, state, Ref(name), type.parameters, type.expression, instantiatedArguments) : CallConstruct(target, instantiatedArguments);
2349
- }
2350
- //#endregion
2351
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/types/call.mjs
2352
- function CallConstruct(target, arguments_) {
2353
- return Create({ ["~kind"]: "Call" }, {
2354
- type: "call",
2355
- target,
2356
- arguments: arguments_
2357
- }, {});
2358
- }
2359
- /** Returns true if the given type is a TCall. */
2360
- function IsCall(value) {
2361
- return IsKind(value, "Call");
2362
- }
2363
- //#endregion
2364
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs
2365
- function RemoveImmutableOperation(type) {
2366
- return Discard(type, ["~immutable"]);
2367
- }
2368
- function RemoveImmutableAction(type, options) {
2369
- return Update(RemoveImmutableOperation(type), {}, options);
2370
- }
2371
- function RemoveImmutableInstantiate(context, state, type, options) {
2372
- return RemoveImmutableAction(InstantiateType(context, state, type), options);
2373
- }
2374
- //#endregion
2375
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs
2376
- function ApplyMapping(mapping, value) {
2377
- return mapping(value);
2378
- }
2379
- //#endregion
2380
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs
2381
- function FromLiteral$2(mapping, value) {
2382
- return IsString$2(value) ? Literal(ApplyMapping(mapping, value)) : Literal(value);
2383
- }
2384
- //#endregion
2385
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs
2386
- function FromTemplateLiteral$2(mapping, pattern) {
2387
- return FromType$11(mapping, EvaluateTemplateLiteral(pattern));
2388
- }
2389
- //#endregion
2390
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs
2391
- function FromUnion$6(mapping, types) {
2392
- return Union(types.map((type) => FromType$11(mapping, type)));
2393
- }
2394
- //#endregion
2395
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs
2396
- function FromType$11(mapping, type) {
2397
- return IsLiteral(type) ? FromLiteral$2(mapping, type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral$2(mapping, type.pattern) : IsUnion(type) ? FromUnion$6(mapping, type.anyOf) : type;
2398
- }
2399
- //#endregion
2400
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/capitalize.mjs
2401
- /** Creates a deferred Capitalize action. */
2402
- function CapitalizeDeferred(type, options = {}) {
2403
- return Deferred("Capitalize", [type], options);
2404
- }
2405
- //#endregion
2406
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/lowercase.mjs
2407
- /** Creates a deferred Lowercase action. */
2408
- function LowercaseDeferred(type, options = {}) {
2409
- return Deferred("Lowercase", [type], options);
2410
- }
2411
- //#endregion
2412
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/uncapitalize.mjs
2413
- /** Creates a deferred Uncapitalize action. */
2414
- function UncapitalizeDeferred(type, options = {}) {
2415
- return Deferred("Uncapitalize", [type], options);
2416
- }
2417
- //#endregion
2418
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/uppercase.mjs
2419
- /** Creates a deferred Uppercase action. */
2420
- function UppercaseDeferred(type, options = {}) {
2421
- return Deferred("Uppercase", [type], options);
2422
- }
2423
- //#endregion
2424
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs
2425
- const CapitalizeMapping = (input) => input[0].toUpperCase() + input.slice(1);
2426
- const LowercaseMapping = (input) => input.toLowerCase();
2427
- const UncapitalizeMapping = (input) => input[0].toLowerCase() + input.slice(1);
2428
- const UppercaseMapping = (input) => input.toUpperCase();
2429
- function CapitalizeAction(type, options) {
2430
- return CanInstantiate([type]) ? Update(FromType$11(CapitalizeMapping, type), {}, options) : CapitalizeDeferred(type, options);
2431
- }
2432
- function LowercaseAction(type, options) {
2433
- return CanInstantiate([type]) ? Update(FromType$11(LowercaseMapping, type), {}, options) : LowercaseDeferred(type, options);
2434
- }
2435
- function UncapitalizeAction(type, options) {
2436
- return CanInstantiate([type]) ? Update(FromType$11(UncapitalizeMapping, type), {}, options) : UncapitalizeDeferred(type, options);
2437
- }
2438
- function UppercaseAction(type, options) {
2439
- return CanInstantiate([type]) ? Update(FromType$11(UppercaseMapping, type), {}, options) : UppercaseDeferred(type, options);
2440
- }
2441
- function CapitalizeInstantiate(context, state, type, options) {
2442
- return CapitalizeAction(InstantiateType(context, state, type), options);
2443
- }
2444
- function LowercaseInstantiate(context, state, type, options) {
2445
- return LowercaseAction(InstantiateType(context, state, type), options);
2446
- }
2447
- function UncapitalizeInstantiate(context, state, type, options) {
2448
- return UncapitalizeAction(InstantiateType(context, state, type), options);
2449
- }
2450
- function UppercaseInstantiate(context, state, type, options) {
2451
- return UppercaseAction(InstantiateType(context, state, type), options);
2452
- }
2453
- //#endregion
2454
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/conditional.mjs
2455
- /** Creates a deferred Conditional action. */
2456
- function ConditionalDeferred(left, right, true_, false_, options = {}) {
2457
- return Deferred("Conditional", [
2458
- left,
2459
- right,
2460
- true_,
2461
- false_
2462
- ], options);
2463
- }
2464
- //#endregion
2465
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/conditional/instantiate.mjs
2466
- function ConditionalOperation(context, state, left, right, true_, false_) {
2467
- const extendsResult = Extends(context, left, right);
2468
- return IsExtendsUnion(extendsResult) ? Union([InstantiateType(extendsResult.inferred, state, true_), InstantiateType(context, state, false_)]) : IsExtendsTrue(extendsResult) ? InstantiateType(extendsResult.inferred, state, true_) : InstantiateType(context, state, false_);
2469
- }
2470
- function ConditionalAction(context, state, left, right, true_, false_, options) {
2471
- return CanInstantiate([left, right]) ? Update(ConditionalOperation(context, state, left, right, true_, false_), {}, options) : ConditionalDeferred(left, right, true_, false_, options);
2472
- }
2473
- function ConditionalInstantiate(context, state, left, right, true_, false_, options) {
2474
- return ConditionalAction(context, state, InstantiateType(context, state, left), InstantiateType(context, state, right), true_, false_, options);
2475
- }
2476
- //#endregion
2477
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/constructor_parameters.mjs
2478
- /** Creates a deferred ConstructorParameters action. */
2479
- function ConstructorParametersDeferred(type, options = {}) {
2480
- return Deferred("ConstructorParameters", [type], options);
2481
- }
2482
- //#endregion
2483
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs
2484
- function ConstructorParametersOperation(type) {
2485
- const parameters = IsConstructor(type) ? type["parameters"] : [];
2486
- return Tuple(InstantiateElements({}, State([], []), parameters));
2487
- }
2488
- function ConstructorParametersAction(type, options) {
2489
- return CanInstantiate([type]) ? Update(ConstructorParametersOperation(type), {}, options) : ConstructorParametersDeferred(type, options);
2490
- }
2491
- function ConstructorParametersInstantiate(context, state, type, options) {
2492
- return ConstructorParametersAction(InstantiateType(context, state, type), options);
2493
- }
2494
- //#endregion
2495
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/exclude.mjs
2496
- /** Creates a deferred Exclude action. */
2497
- function ExcludeDeferred(left, right, options = {}) {
2498
- return Deferred("Exclude", [left, right], options);
2499
- }
2500
- //#endregion
2501
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/exclude/instantiate.mjs
2502
- function ExcludeAction(left, right, options) {
2503
- return CanInstantiate([left, right]) ? Update(ExcludeOperation(left, right), {}, options) : ExcludeDeferred(left, right, options);
2504
- }
2505
- function ExcludeInstantiate(context, state, left, right, options) {
2506
- return ExcludeAction(InstantiateType(context, state, left), InstantiateType(context, state, right), options);
2507
- }
2508
- //#endregion
2509
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/extract.mjs
2510
- /** Creates a deferred Extract action. */
2511
- function ExtractDeferred(left, right, options = {}) {
2512
- return Deferred("Extract", [left, right], options);
2513
- }
2514
- //#endregion
2515
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/extract/operation.mjs
2516
- function ExtractType(left, right) {
2517
- return IsExtendsTrueLike(Extends({}, left, right)) ? [left] : [];
2518
- }
2519
- function ExtractUnion(left, right, result = []) {
2520
- return ShiftLeft(left, (head, tail) => ExtractUnion(tail, right, [...result, ...ExtractType(head, right)]), () => result);
2521
- }
2522
- function ExtractOperation(left, right) {
2523
- const evaluated = EvaluateType(left);
2524
- return EvaluateUnion(ExtractUnion(IsUnion(evaluated) ? evaluated.anyOf : [evaluated], right));
2525
- }
2526
- //#endregion
2527
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/extract/instantiate.mjs
2528
- function ExtractAction(left, right, options) {
2529
- return CanInstantiate([left, right]) ? Update(ExtractOperation(left, right), {}, options) : ExtractDeferred(left, right, options);
2530
- }
2531
- function ExtractInstantiate(context, state, left, right, options) {
2532
- return ExtractAction(InstantiateType(context, state, left), InstantiateType(context, state, right), options);
2533
- }
2534
- //#endregion
2535
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs
2536
- function KeysToLiterals(keys) {
2537
- return keys.reduce((result, left) => {
2538
- return IsLiteralValue(left) ? [...result, Literal(left)] : result;
2539
- }, []);
2540
- }
2541
- function KeysToIndexer(keys) {
2542
- return Union(KeysToLiterals(keys));
2543
- }
2544
- //#endregion
2545
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/indexed.mjs
2546
- /** Creates a deferred Index action. */
2547
- function IndexDeferred(type, indexer, options = {}) {
2548
- return Deferred("Index", [type, indexer], options);
2549
- }
2550
- //#endregion
2551
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/object/from_cyclic.mjs
2552
- function FromCyclic$4(defs, ref) {
2553
- return FromType$10(CyclicTarget(defs, ref));
2554
- }
2555
- //#endregion
2556
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/object/from_dependent.mjs
2557
- function FromDependent$4(if_, then_, else_) {
2558
- return FromType$10(EvaluateDependent(if_, then_, else_));
2559
- }
2560
- //#endregion
2561
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/object/from_intersect.mjs
2562
- function CollapseIntersectProperties(left, right) {
2563
- const leftKeys = Keys$1(left).filter((key) => !HasPropertyKey(right, key));
2564
- const rightKeys = Keys$1(right).filter((key) => !HasPropertyKey(left, key));
2565
- const sharedKeys = Keys$1(left).filter((key) => HasPropertyKey(right, key));
2566
- const leftProperties = leftKeys.reduce((result, key) => ({
2567
- ...result,
2568
- [key]: left[key]
2569
- }), {});
2570
- const rightProperties = rightKeys.reduce((result, key) => ({
2571
- ...result,
2572
- [key]: right[key]
2573
- }), {});
2574
- const sharedProperties = sharedKeys.reduce((result, key) => ({
2575
- ...result,
2576
- [key]: EvaluatePropertyIntersect(left[key], right[key])
2577
- }), {});
2578
- return Assign(Assign(leftProperties, rightProperties), sharedProperties);
2579
- }
2580
- function FromIntersect$4(types) {
2581
- return types.reduce((result, left) => {
2582
- return CollapseIntersectProperties(result, FromType$10(left));
2583
- }, {});
2584
- }
2585
- //#endregion
2586
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/object/from_object.mjs
2587
- function FromObject$5(properties) {
2588
- return properties;
2589
- }
2590
- //#endregion
2591
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/object/from_tuple.mjs
2592
- function FromTuple$3(types) {
2593
- return FromType$10(TupleToObject(Tuple(types)));
2594
- }
2595
- //#endregion
2596
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/object/from_union.mjs
2597
- function CollapseUnionProperties(left, right) {
2598
- return Keys$1(left).filter((key) => key in right).reduce((result, key) => {
2599
- return {
2600
- ...result,
2601
- [key]: EvaluatePropertyUnion(left[key], right[key])
2602
- };
2603
- }, {});
2604
- }
2605
- function ReduceVariants(types, result) {
2606
- return ShiftLeft(types, (left, right) => ReduceVariants(right, CollapseUnionProperties(result, FromType$10(left))), () => result);
2607
- }
2608
- function FromUnion$5(types) {
2609
- return ShiftLeft(types, (left, right) => ReduceVariants(right, FromType$10(left)), () => Unreachable());
2610
- }
2611
- //#endregion
2612
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/object/from_type.mjs
2613
- function FromType$10(type) {
2614
- return IsCyclic(type) ? FromCyclic$4(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$4(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect$4(type.allOf) : IsUnion(type) ? FromUnion$5(type.anyOf) : IsTuple(type) ? FromTuple$3(type.items) : IsObject(type) ? FromObject$5(type.properties) : {};
2615
- }
2616
- //#endregion
2617
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/object/collapse.mjs
2618
- /**
2619
- * Collapses a type into a TObject schema. This is a lossy fast path used to
2620
- * normalize arbitrary TSchema types into a TObject structure. This function is
2621
- * primarily used in indexing operations where a normalized object structure
2622
- * is required. If the type cannot be collapsed, an empty object schema is returned.
2623
- */
2624
- function CollapseToObject(type) {
2625
- return _Object_(FromType$10(type));
2626
- }
2627
- //#endregion
2628
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/helpers/keys.mjs
2629
- const integerKeyPattern = /* @__PURE__ */ new RegExp("^(?:0|[1-9][0-9]*)$");
2630
- function ConvertToIntegerKey(value) {
2631
- const normal = `${value}`;
2632
- return integerKeyPattern.test(normal) ? parseInt(normal) : value;
2633
- }
2634
- //#endregion
2635
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexed/from_array.mjs
2636
- function NormalizeLiteral(value) {
2637
- return Literal(ConvertToIntegerKey(value));
2638
- }
2639
- function NormalizeIndexerTypes(types) {
2640
- return types.map((type) => NormalizeIndexer(type));
2641
- }
2642
- function NormalizeIndexer(type) {
2643
- return IsIntersect(type) ? Intersect(NormalizeIndexerTypes(type.allOf)) : IsUnion(type) ? Union(NormalizeIndexerTypes(type.anyOf)) : IsLiteral(type) ? NormalizeLiteral(type.const) : type;
2644
- }
2645
- function FromArray$2(type, indexer) {
2646
- return IsExtendsTrueLike(Extends({}, NormalizeIndexer(indexer), Number$1())) ? type : IsLiteral(indexer) && IsEqual(indexer.const, "length") ? Number$1() : Never();
2647
- }
2648
- //#endregion
2649
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs
2650
- function FromCyclic$3(defs, ref) {
2651
- return FromType$9(CyclicTarget(defs, ref));
2652
- }
2653
- //#endregion
2654
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs
2655
- function FromDependent$3(if_, then_, else_) {
2656
- return FromType$9(EvaluateDependent(if_, then_, else_));
2657
- }
2658
- //#endregion
2659
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexable/from_enum.mjs
2660
- function FromEnum$1(values) {
2661
- return FromType$9(EvaluateEnum(values));
2662
- }
2663
- //#endregion
2664
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs
2665
- function FromIntersect$3(types) {
2666
- return FromType$9(EvaluateIntersect(types));
2667
- }
2668
- //#endregion
2669
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexable/from_literal.mjs
2670
- function FromLiteral$1(value) {
2671
- return [`${value}`];
2672
- }
2673
- //#endregion
2674
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs
2675
- function FromTemplateLiteral$1(pattern) {
2676
- return FromType$9(EvaluateTemplateLiteral(pattern));
2677
- }
2678
- //#endregion
2679
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexable/from_union.mjs
2680
- function FromUnion$4(types) {
2681
- return types.reduce((result, left) => {
2682
- return [...result, ...FromType$9(left)];
2683
- }, []);
2684
- }
2685
- //#endregion
2686
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexable/from_type.mjs
2687
- function FromType$9(type) {
2688
- return IsCyclic(type) ? FromCyclic$3(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$3(type.if, type.then, type.else) : IsEnum(type) ? FromEnum$1(type.enum) : IsIntersect(type) ? FromIntersect$3(type.allOf) : IsLiteral(type) ? FromLiteral$1(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral$1(type.pattern) : IsUnion(type) ? FromUnion$4(type.anyOf) : [];
2689
- }
2690
- //#endregion
2691
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs
2692
- /**
2693
- * Transforms a type meant as an Indexer into string[] array which is used by Indexable types
2694
- * like Index, Pick and Omit to select from property keys. This function should only be used
2695
- * for Object key selection, and not for Array / Tuple key selection as Array-Like structures
2696
- * require TNumber indexing support.
2697
- */
2698
- function ToIndexableKeys(type) {
2699
- return FromType$9(type);
2700
- }
2701
- //#endregion
2702
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/this/expand_this.mjs
2703
- function FromTypes(properties, types) {
2704
- return types.map((type) => FromType$8(properties, type));
2705
- }
2706
- function FromType$8(properties, type) {
2707
- return IsArray(type) ? _Array_(FromType$8(properties, type.items)) : IsConstructor(type) ? Constructor(FromTypes(properties, type.parameters), FromType$8(properties, type.instanceType)) : IsFunction(type) ? _Function_(FromTypes(properties, type.parameters), FromType$8(properties, type.returnType)) : IsTuple(type) ? Tuple(FromTypes(properties, type.items)) : IsUnion(type) ? Union(FromTypes(properties, type.anyOf)) : IsIntersect(type) ? Intersect(FromTypes(properties, type.allOf)) : IsThis(type) ? _Object_(properties) : type;
2708
- }
2709
- function ExpandThis(properties, type) {
2710
- return FromType$8(properties, type);
2711
- }
2712
- //#endregion
2713
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexed/from_object.mjs
2714
- function IndexProperty(properties, key) {
2715
- return ExpandThis(properties, key in properties ? properties[key] : Never());
2716
- }
2717
- function IndexProperties(properties, keys) {
2718
- return keys.reduce((result, left) => {
2719
- return [...result, IndexProperty(properties, left)];
2720
- }, []);
2721
- }
2722
- function FromIndexer(properties, indexer) {
2723
- return EvaluateUnion(IndexProperties(properties, ToIndexableKeys(indexer)));
2724
- }
2725
- const NumericKeyPattern = new RegExp(IntegerKey);
2726
- function NumericKeys(keys) {
2727
- return keys.filter((key) => NumericKeyPattern.test(key));
2728
- }
2729
- function FromIndexerNumber(properties) {
2730
- return EvaluateUnion(IndexProperties(properties, NumericKeys(PropertyKeys(properties))));
2731
- }
2732
- function FromObject$4(properties, indexer) {
2733
- return IsNumber(indexer) ? FromIndexerNumber(properties) : FromIndexer(properties, indexer);
2734
- }
2735
- //#endregion
2736
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs
2737
- function ConvertLiteral(value) {
2738
- return Literal(ConvertToIntegerKey(value));
2739
- }
2740
- function ArrayIndexerTypes(types) {
2741
- return types.map((type) => FormatArrayIndexer(type));
2742
- }
2743
- /** Formats embedded integer-like strings on an Indexer to be number values inline with TS indexing | coercion behaviors. */
2744
- function FormatArrayIndexer(type) {
2745
- return IsIntersect(type) ? Intersect(ArrayIndexerTypes(type.allOf)) : IsUnion(type) ? Union(ArrayIndexerTypes(type.anyOf)) : IsLiteral(type) ? ConvertLiteral(type.const) : type;
2746
- }
2747
- //#endregion
2748
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs
2749
- function IndexElementsWithIndexer(types, indexer) {
2750
- return types.reduceRight((result, right, index) => {
2751
- return IsExtendsTrueLike(Extends({}, Literal(index), indexer)) ? [right, ...result] : result;
2752
- }, []);
2753
- }
2754
- function FromTupleWithIndexer(types, indexer) {
2755
- return EvaluateUnionFast(IndexElementsWithIndexer(types, FormatArrayIndexer(indexer)));
2756
- }
2757
- function FromTupleWithoutIndexer(types) {
2758
- return EvaluateUnionFast(types);
2759
- }
2760
- function FromTuple$2(types, indexer) {
2761
- return IsLiteral(indexer) && IsEqual(indexer.const, "length") ? Literal(types.length) : IsNumber(indexer) || IsInteger(indexer) ? FromTupleWithoutIndexer(types) : FromTupleWithIndexer(types, indexer);
2762
- }
2763
- //#endregion
2764
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexed/from_type.mjs
2765
- function FromType$7(type, indexer) {
2766
- return IsArray(type) ? FromArray$2(type.items, indexer) : IsObject(type) ? FromObject$4(type.properties, indexer) : IsTuple(type) ? FromTuple$2(type.items, indexer) : Never();
2767
- }
2768
- //#endregion
2769
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexed/instantiate.mjs
2770
- function NormalizeType$1(type) {
2771
- return IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
2772
- }
2773
- function IndexAction(type, indexer, options) {
2774
- return CanInstantiate([type, indexer]) ? Update(FromType$7(NormalizeType$1(type), indexer), {}, options) : IndexDeferred(type, indexer, options);
2775
- }
2776
- function IndexInstantiate(context, state, type, indexer, options) {
2777
- return IndexAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
2778
- }
2779
- //#endregion
2780
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/instance_type.mjs
2781
- /** Creates a deferred InstanceType action. */
2782
- function InstanceTypeDeferred(type, options = {}) {
2783
- return Deferred("InstanceType", [type], options);
2784
- }
2785
- //#endregion
2786
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs
2787
- function InstanceTypeOperation(type) {
2788
- return IsConstructor(type) ? type["instanceType"] : Never();
2789
- }
2790
- function InstanceTypeAction(type, options) {
2791
- return CanInstantiate([type]) ? Update(InstanceTypeOperation(type), {}, options) : InstanceTypeDeferred(type, options);
2792
- }
2793
- function InstanceTypeInstantiate(context, state, type, options = {}) {
2794
- return InstanceTypeAction(InstantiateType(context, state, type), options);
2795
- }
2796
- //#endregion
2797
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/keyof.mjs
2798
- /** Creates a deferred KeyOf action. */
2799
- function KeyOfDeferred(type, options = {}) {
2800
- return Deferred("KeyOf", [type], options);
2801
- }
2802
- //#endregion
2803
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/keyof/from_any.mjs
2804
- function FromAny() {
2805
- return Union([
2806
- Number$1(),
2807
- String$1(),
2808
- Symbol()
2809
- ]);
2810
- }
2811
- //#endregion
2812
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/keyof/from_array.mjs
2813
- function FromArray$1(_type) {
2814
- return Number$1();
2815
- }
2816
- //#endregion
2817
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/keyof/from_object.mjs
2818
- function FromPropertyKeys(keys) {
2819
- return keys.reduce((result, left) => {
2820
- return IsLiteralValue(left) ? [...result, Literal(ConvertToIntegerKey(left))] : Unreachable();
2821
- }, []);
2822
- }
2823
- function FromObject$3(properties) {
2824
- return EvaluateUnionFast(FromPropertyKeys(Keys$1(properties)));
2825
- }
2826
- //#endregion
2827
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/keyof/from_record.mjs
2828
- function FromRecord(type) {
2829
- return RecordKey(type);
2830
- }
2831
- //#endregion
2832
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs
2833
- function FromTuple$1(types) {
2834
- return EvaluateUnionFast(types.map((_, index) => Literal(index)));
2835
- }
2836
- //#endregion
2837
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/keyof/from_type.mjs
2838
- function FromType$6(type) {
2839
- return IsAny(type) ? FromAny() : IsArray(type) ? FromArray$1(type.items) : IsObject(type) ? FromObject$3(type.properties) : IsRecord(type) ? FromRecord(type) : IsTuple(type) ? FromTuple$1(type.items) : Never();
2840
- }
2841
- //#endregion
2842
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/keyof/instantiate.mjs
2843
- function NormalizeType(type) {
2844
- return IsCyclic(type) || IsDependent(type) || IsIntersect(type) || IsUnion(type) ? CollapseToObject(type) : type;
2845
- }
2846
- function KeyOfAction(type, options) {
2847
- return CanInstantiate([type]) ? Update(FromType$6(NormalizeType(type)), {}, options) : KeyOfDeferred(type, options);
2848
- }
2849
- function KeyOfInstantiate(context, state, type, options) {
2850
- return KeyOfAction(InstantiateType(context, state, type), options);
2851
- }
2852
- //#endregion
2853
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/mapped.mjs
2854
- /** Creates a deferred Mapped action. */
2855
- function MappedDeferred(identifier, type, as, property, options = {}) {
2856
- return Deferred("Mapped", [
2857
- identifier,
2858
- type,
2859
- as,
2860
- property
2861
- ], options);
2862
- }
2863
- //#endregion
2864
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs
2865
- function FromTemplateLiteral(pattern) {
2866
- return FromType$5(EvaluateTemplateLiteral(pattern));
2867
- }
2868
- function FromUnion$3(types) {
2869
- return types.reduce((result, left) => {
2870
- return [...result, ...FromType$5(left)];
2871
- }, []);
2872
- }
2873
- function FromEnum(values) {
2874
- return FromType$5(EvaluateEnum(values));
2875
- }
2876
- function FromLiteral(value) {
2877
- return IsNumber$2(value) ? [Literal(`${value}`)] : [Literal(value)];
2878
- }
2879
- function FromType$5(type) {
2880
- return IsEnum(type) ? FromEnum(type.enum) : IsLiteral(type) ? FromLiteral(type.const) : IsTemplateLiteral(type) ? FromTemplateLiteral(type.pattern) : IsUnion(type) ? FromUnion$3(type.anyOf) : [type];
2881
- }
2882
- function MappedVariants(type) {
2883
- return FromType$5(type);
2884
- }
2885
- //#endregion
2886
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs
2887
- function CanonicalAs(instantiatedAs) {
2888
- return IsTemplateLiteral(instantiatedAs) ? EvaluateTemplateLiteral(instantiatedAs.pattern) : instantiatedAs;
2889
- }
2890
- function MappedVariant(context, state, identifier, variant, as, property) {
2891
- const variantContext = Assign(context, { [identifier["name"]]: variant });
2892
- const canonicalAs = CanonicalAs(InstantiateType(variantContext, state, as));
2893
- const instantiatedProperty = InstantiateType(variantContext, state, property);
2894
- return IsLiteralNumber(canonicalAs) || IsLiteralString(canonicalAs) ? { [canonicalAs.const]: instantiatedProperty } : {};
2895
- }
2896
- function MappedProperties(context, state, identifier, variants, as, property) {
2897
- return variants.reduce((result, left) => {
2898
- return [...result, MappedVariant(context, state, identifier, left, as, property)];
2899
- }, []);
2900
- }
2901
- function MappedObjects(properties) {
2902
- return properties.reduce((result, left) => {
2903
- return [...result, _Object_(left)];
2904
- }, []);
2905
- }
2906
- function MappedOperation(context, state, identifier, type, as, property) {
2907
- return EvaluateIntersect(MappedObjects(MappedProperties(context, state, identifier, MappedVariants(type), as, property)));
2908
- }
2909
- //#endregion
2910
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/mapped/instantiate.mjs
2911
- function MappedAction(context, state, identifier, type, as, property, options) {
2912
- return CanInstantiate([type]) ? Update(MappedOperation(context, state, identifier, type, as, property), {}, options) : MappedDeferred(identifier, type, as, property, options);
2913
- }
2914
- function MappedInstantiate(context, state, identifier, type, as, property, options) {
2915
- return MappedAction(context, state, identifier, InstantiateType(context, state, type), as, property, options);
2916
- }
2917
- //#endregion
2918
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/module/instantiate.mjs
2919
- function InstantiateCyclics(context, declarations, cyclicKeys) {
2920
- const declarationContext = Assign(context, declarations);
2921
- return Keys$1(declarations).filter((key) => cyclicKeys.includes(key)).reduce((result, key) => {
2922
- return {
2923
- ...result,
2924
- [key]: InstantiateCyclic(declarationContext, key, declarations[key])
2925
- };
2926
- }, {});
2927
- }
2928
- function InstantiateNonCyclics(context, declarations, cyclicKeys) {
2929
- const declarationContext = Assign(context, declarations);
2930
- return Keys$1(declarations).filter((key) => !cyclicKeys.includes(key)).reduce((result, key) => {
2931
- return {
2932
- ...result,
2933
- [key]: InstantiateType(declarationContext, State([], []), declarations[key])
2934
- };
2935
- }, {});
2936
- }
2937
- function InstantiateModule(context, declarations, options) {
2938
- const cyclicCandidates = CyclicCandidates(declarations);
2939
- const instantiatedCyclics = InstantiateCyclics(context, declarations, cyclicCandidates);
2940
- const instantiatedNonCyclics = InstantiateNonCyclics(context, declarations, cyclicCandidates);
2941
- return Update({
2942
- ...instantiatedCyclics,
2943
- ...instantiatedNonCyclics
2944
- }, {}, options);
2945
- }
2946
- function ModuleInstantiate(context, _state, declarations, options) {
2947
- return InstantiateModule(context, declarations, options);
2948
- }
2949
- //#endregion
2950
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/non_nullable.mjs
2951
- /** Creates a deferred NonNullable action. */
2952
- function NonNullableDeferred(type, options = {}) {
2953
- return Deferred("NonNullable", [type], options);
2954
- }
2955
- //#endregion
2956
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs
2957
- function NonNullableOperation(type) {
2958
- return ExcludeAction(type, Union([Null(), Undefined()]), {});
2959
- }
2960
- function NonNullableAction(type, options) {
2961
- return CanInstantiate([type]) ? Update(NonNullableOperation(type), {}, options) : NonNullableDeferred(type, options);
2962
- }
2963
- function NonNullableInstantiate(context, state, type, options) {
2964
- return NonNullableAction(InstantiateType(context, state, type), options);
2965
- }
2966
- //#endregion
2967
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/omit.mjs
2968
- /** Creates a deferred Omit action. */
2969
- function OmitDeferred(type, indexer, options = {}) {
2970
- return Deferred("Omit", [type, indexer], options);
2971
- }
2972
- /** Applies a Omit action using the given types. */
2973
- function Omit(type, indexer_or_keys, options = {}) {
2974
- return OmitAction(type, IsArray$1(indexer_or_keys) ? KeysToIndexer(indexer_or_keys) : indexer_or_keys, options);
2975
- }
2976
- //#endregion
2977
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs
2978
- /** Transforms a type into a TProperties used for indexing operations */
2979
- function ToIndexable(type) {
2980
- const collapsed = CollapseToObject(type);
2981
- return IsObject(collapsed) ? collapsed.properties : Unreachable();
2982
- }
2983
- //#endregion
2984
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/omit/from_type.mjs
2985
- function FromKeys$1(properties, keys) {
2986
- return Keys$1(properties).reduce((result, key) => {
2987
- return keys.includes(key) ? result : {
2988
- ...result,
2989
- [key]: properties[key]
2990
- };
2991
- }, {});
2992
- }
2993
- function FromType$4(type, indexer) {
2994
- return _Object_(FromKeys$1(ToIndexable(type), ToIndexableKeys(indexer)));
2995
- }
2996
- //#endregion
2997
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/omit/instantiate.mjs
2998
- function OmitAction(type, indexer, options) {
2999
- return CanInstantiate([type, indexer]) ? Update(FromType$4(type, indexer), {}, options) : OmitDeferred(type, indexer, options);
3000
- }
3001
- function OmitInstantiate(context, state, type, indexer, options) {
3002
- return OmitAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
3003
- }
3004
- //#endregion
3005
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/parameters.mjs
3006
- /** Creates a deferred Parameters action. */
3007
- function ParametersDeferred(type, options = {}) {
3008
- return Deferred("Parameters", [type], options);
3009
- }
3010
- //#endregion
3011
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/parameters/instantiate.mjs
3012
- function ParametersOperation(type) {
3013
- const parameters = IsFunction(type) ? type["parameters"] : [];
3014
- return Tuple(InstantiateElements({}, State([], []), parameters));
3015
- }
3016
- function ParametersAction(type, options) {
3017
- return CanInstantiate([type]) ? Update(ParametersOperation(type), {}, options) : ParametersDeferred(type, options);
3018
- }
3019
- function ParametersInstantiate(context, state, type, options) {
3020
- return ParametersAction(InstantiateType(context, state, type), options);
3021
- }
3022
- //#endregion
3023
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/partial.mjs
3024
- /** Creates a deferred Partial action. */
3025
- function PartialDeferred(type, options = {}) {
3026
- return Deferred("Partial", [type], options);
3027
- }
3028
- /** Applies a Partial action to the given type. */
3029
- function Partial(type, options = {}) {
3030
- return PartialAction(type, options);
3031
- }
3032
- //#endregion
3033
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs
3034
- function FromCyclic$2(defs, ref) {
3035
- const partial = FromType$3(CyclicTarget(defs, ref));
3036
- return Cyclic(Assign(defs, { [ref]: partial }), ref);
3037
- }
3038
- //#endregion
3039
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/partial/from_dependent.mjs
3040
- function FromDependent$2(if_, then_, else_) {
3041
- return FromType$3(EvaluateDependent(if_, then_, else_));
3042
- }
3043
- //#endregion
3044
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/partial/from_intersect.mjs
3045
- function FromIntersect$2(types) {
3046
- return FromType$3(EvaluateIntersect(types));
3047
- }
3048
- //#endregion
3049
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/partial/from_union.mjs
3050
- function FromUnion$2(types) {
3051
- return Union(types.map((type) => FromType$3(type)));
3052
- }
3053
- //#endregion
3054
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/partial/from_object.mjs
3055
- function FromObject$2(properties) {
3056
- return _Object_(Keys$1(properties).reduce((result, left) => {
3057
- return {
3058
- ...result,
3059
- [left]: AddOptional(properties[left])
3060
- };
3061
- }, {}));
3062
- }
3063
- //#endregion
3064
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/partial/from_type.mjs
3065
- function FromType$3(type) {
3066
- return IsCyclic(type) ? FromCyclic$2(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$2(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect$2(type.allOf) : IsUnion(type) ? FromUnion$2(type.anyOf) : IsObject(type) ? FromObject$2(type.properties) : _Object_({});
3067
- }
3068
- //#endregion
3069
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/partial/instantiate.mjs
3070
- function PartialAction(type, options) {
3071
- return CanInstantiate([type]) ? Update(FromType$3(type), {}, options) : PartialDeferred(type, options);
3072
- }
3073
- function PartialInstantiate(context, state, type, options) {
3074
- return PartialAction(InstantiateType(context, state, type), options);
3075
- }
3076
- //#endregion
3077
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/pick.mjs
3078
- /** Creates a deferred Pick action. */
3079
- function PickDeferred(type, indexer, options = {}) {
3080
- return Deferred("Pick", [type, indexer], options);
3081
- }
3082
- //#endregion
3083
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/pick/from_type.mjs
3084
- function FromKeys(properties, keys) {
3085
- return Keys$1(properties).reduce((result, key) => {
3086
- return keys.includes(key) ? Assign(result, { [key]: properties[key] }) : result;
3087
- }, {});
3088
- }
3089
- function FromType$2(type, indexer) {
3090
- return _Object_(FromKeys(ToIndexable(type), ToIndexableKeys(indexer)));
3091
- }
3092
- //#endregion
3093
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/pick/instantiate.mjs
3094
- function PickAction(type, indexer, options) {
3095
- return CanInstantiate([type, indexer]) ? Update(FromType$2(type, indexer), {}, options) : PickDeferred(type, indexer, options);
3096
- }
3097
- function PickInstantiate(context, state, type, indexer, options) {
3098
- return PickAction(InstantiateType(context, state, type), InstantiateType(context, state, indexer), options);
3099
- }
3100
- //#endregion
3101
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/readonly_object.mjs
3102
- /** Creates a deferred ReadonlyType action. */
3103
- function ReadonlyObjectDeferred(type, options = {}) {
3104
- return Deferred("ReadonlyObject", [type], options);
3105
- }
3106
- //#endregion
3107
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs
3108
- function FromArray(type) {
3109
- return AddImmutable(_Array_(type));
3110
- }
3111
- //#endregion
3112
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs
3113
- function FromCyclic$1(defs, ref) {
3114
- const partial = FromType$1(CyclicTarget(defs, ref));
3115
- return Cyclic(Assign(defs, { [ref]: partial }), ref);
3116
- }
3117
- //#endregion
3118
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs
3119
- function FromDependent$1(if_, then_, else_) {
3120
- return FromType$1(EvaluateDependent(if_, then_, else_));
3121
- }
3122
- //#endregion
3123
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs
3124
- function FromIntersect$1(types) {
3125
- return FromType$1(EvaluateIntersect(types));
3126
- }
3127
- //#endregion
3128
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs
3129
- function FromObject$1(properties) {
3130
- return _Object_(Keys$1(properties).reduce((result, left) => {
3131
- return {
3132
- ...result,
3133
- [left]: AddReadonly(properties[left])
3134
- };
3135
- }, {}));
3136
- }
3137
- //#endregion
3138
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs
3139
- function FromTuple(types) {
3140
- return AddImmutable(Tuple(types));
3141
- }
3142
- //#endregion
3143
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs
3144
- function FromUnion$1(types) {
3145
- return Union(types.map((type) => FromType$1(type)));
3146
- }
3147
- //#endregion
3148
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs
3149
- function FromType$1(type) {
3150
- return IsArray(type) ? FromArray(type.items) : IsCyclic(type) ? FromCyclic$1(type.$defs, type.$ref) : IsDependent(type) ? FromDependent$1(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect$1(type.allOf) : IsObject(type) ? FromObject$1(type.properties) : IsTuple(type) ? FromTuple(type.items) : IsUnion(type) ? FromUnion$1(type.anyOf) : type;
3151
- }
3152
- //#endregion
3153
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs
3154
- function ReadonlyObjectAction(type, options) {
3155
- return CanInstantiate([type]) ? Update(FromType$1(type), {}, options) : ReadonlyObjectDeferred(type);
3156
- }
3157
- function ReadonlyObjectInstantiate(context, state, type, options) {
3158
- return ReadonlyObjectAction(InstantiateType(context, state, type), options);
3159
- }
3160
- //#endregion
3161
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/ref/instantiate.mjs
3162
- function RefInstantiate(context, state, type, ref) {
3163
- return state.visited.includes(ref) ? type : ref in context ? InstantiateType(context, State(state["callstack"], [...state["visited"], ref]), context[ref]) : type;
3164
- }
3165
- //#endregion
3166
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/required/from_cyclic.mjs
3167
- function FromCyclic(defs, ref) {
3168
- const partial = FromType(CyclicTarget(defs, ref));
3169
- return Cyclic(Assign(defs, { [ref]: partial }), ref);
3170
- }
3171
- //#endregion
3172
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/required/from_dependent.mjs
3173
- function FromDependent(if_, then_, else_) {
3174
- return FromType(EvaluateDependent(if_, then_, else_));
3175
- }
3176
- //#endregion
3177
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/required/from_intersect.mjs
3178
- function FromIntersect(types) {
3179
- return FromType(EvaluateIntersect(types));
3180
- }
3181
- //#endregion
3182
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/required/from_union.mjs
3183
- function FromUnion(types) {
3184
- return Union(types.map((type) => FromType(type)));
3185
- }
3186
- //#endregion
3187
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/_remove_optional.mjs
3188
- /** Applies an RemoveOptional action to a type. */
3189
- function RemoveOptional(type, options = {}) {
3190
- return RemoveOptionalAction(type, options);
3191
- }
3192
- //#endregion
3193
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/required/from_object.mjs
3194
- function FromObject(properties) {
3195
- return _Object_(Keys$1(properties).reduce((result, left) => {
3196
- return {
3197
- ...result,
3198
- [left]: RemoveOptional(properties[left])
3199
- };
3200
- }, {}));
3201
- }
3202
- //#endregion
3203
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/required/from_type.mjs
3204
- function FromType(type) {
3205
- return IsCyclic(type) ? FromCyclic(type.$defs, type.$ref) : IsDependent(type) ? FromDependent(type.if, type.then, type.else) : IsIntersect(type) ? FromIntersect(type.allOf) : IsUnion(type) ? FromUnion(type.anyOf) : IsObject(type) ? FromObject(type.properties) : _Object_({});
3206
- }
3207
- //#endregion
3208
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/required.mjs
3209
- /** Creates a deferred Required action. */
3210
- function RequiredDeferred(type, options = {}) {
3211
- return Deferred("Required", [type], options);
3212
- }
3213
- //#endregion
3214
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/required/instantiate.mjs
3215
- function RequiredAction(type, options) {
3216
- return CanInstantiate([type]) ? Update(FromType(type), {}, options) : RequiredDeferred(type, options);
3217
- }
3218
- function RequiredInstantiate(context, state, type, options) {
3219
- return RequiredAction(InstantiateType(context, state, type), options);
3220
- }
3221
- //#endregion
3222
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/return_type.mjs
3223
- /** Creates a deferred ReturnType action. */
3224
- function ReturnTypeDeferred(type, options = {}) {
3225
- return Deferred("ReturnType", [type], options);
3226
- }
3227
- //#endregion
3228
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/return_type/instantiate.mjs
3229
- function ReturnTypeOperation(type) {
3230
- return IsFunction(type) ? type["returnType"] : Never();
3231
- }
3232
- function ReturnTypeAction(type, options) {
3233
- return CanInstantiate([type]) ? Update(ReturnTypeOperation(type), {}, options) : ReturnTypeDeferred(type, options);
3234
- }
3235
- function ReturnTypeInstantiate(context, state, type, options = {}) {
3236
- return ReturnTypeAction(InstantiateType(context, state, type), options);
3237
- }
3238
- //#endregion
3239
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/with.mjs
3240
- /** Creates a deferred With action. */
3241
- function WithDeferred(type, options) {
3242
- return Deferred("With", [type, options], {});
3243
- }
3244
- /** Applies annotation options to the given type. */
3245
- function With(type, options) {
3246
- return WithAction(type, options);
3247
- }
3248
- //#endregion
3249
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/with/instantiate.mjs
3250
- function WithAction(type, options) {
3251
- return CanInstantiate([type]) ? Update(type, {}, options) : WithDeferred(type, options);
3252
- }
3253
- function WithInstantiate(context, state, type, options) {
3254
- return WithAction(InstantiateType(context, state, type), options);
3255
- }
3256
- //#endregion
3257
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/rest/spread.mjs
3258
- function SpreadElement(type) {
3259
- return IsRest(type) ? IsTuple(type.items) ? RestSpread(type.items.items) : IsInfer(type.items) ? [type] : IsRef(type.items) ? [type] : [Never()] : [type];
3260
- }
3261
- function RestSpread(types) {
3262
- return types.reduce((result, left) => {
3263
- return [...result, ...SpreadElement(left)];
3264
- }, []);
3265
- }
3266
- //#endregion
3267
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/instantiate.mjs
3268
- function State(callstack, visited) {
3269
- return {
3270
- callstack,
3271
- visited
3272
- };
3273
- }
3274
- function CanInstantiate(types) {
3275
- return ShiftLeft(types, (left, right) => IsRef(left) ? false : CanInstantiate(right), () => true);
3276
- }
3277
- function InstantiateProperties(context, state, properties) {
3278
- return Keys$1(properties).reduce((result, key) => {
3279
- return {
3280
- ...result,
3281
- [key]: InstantiateType(context, state, properties[key])
3282
- };
3283
- }, {});
3284
- }
3285
- function InstantiateElements(context, state, types) {
3286
- return RestSpread(InstantiateTypes(context, state, types));
3287
- }
3288
- function InstantiateTypes(context, state, types) {
3289
- return types.map((type) => InstantiateType(context, state, type));
3290
- }
3291
- function WithModifiers(type, instantiatedType) {
3292
- const withOptional = IsOptional(type) ? AddOptionalAction(instantiatedType, {}) : instantiatedType;
3293
- const withReadonly = IsReadonly(type) ? AddReadonlyAction(withOptional, {}) : withOptional;
3294
- return IsImmutable(type) ? AddImmutableAction(withReadonly, {}) : withReadonly;
3295
- }
3296
- function InstantiateDeferred(context, state, action, parameters, options) {
3297
- return IsEqual(action, "AddImmutable") ? AddImmutableInstantiate(context, state, parameters[0], options) : IsEqual(action, "RemoveImmutable") ? RemoveImmutableInstantiate(context, state, parameters[0], options) : IsEqual(action, "AddReadonly") ? AddReadonlyInstantiate(context, state, parameters[0], options) : IsEqual(action, "RemoveReadonly") ? RemoveReadonlyInstantiate(context, state, parameters[0], options) : IsEqual(action, "AddOptional") ? AddOptionalInstantiate(context, state, parameters[0], options) : IsEqual(action, "RemoveOptional") ? RemoveOptionalInstantiate(context, state, parameters[0], options) : IsEqual(action, "Capitalize") ? CapitalizeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Conditional") ? ConditionalInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : IsEqual(action, "ConstructorParameters") ? ConstructorParametersInstantiate(context, state, parameters[0], options) : IsEqual(action, "Evaluate") ? EvaluateInstantiate(context, state, parameters[0], options) : IsEqual(action, "Exclude") ? ExcludeInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Extract") ? ExtractInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Index") ? IndexInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "InstanceType") ? InstanceTypeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Interface") ? InterfaceInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "KeyOf") ? KeyOfInstantiate(context, state, parameters[0], options) : IsEqual(action, "Lowercase") ? LowercaseInstantiate(context, state, parameters[0], options) : IsEqual(action, "Mapped") ? MappedInstantiate(context, state, parameters[0], parameters[1], parameters[2], parameters[3], options) : IsEqual(action, "Module") ? ModuleInstantiate(context, state, parameters[0], options) : IsEqual(action, "NonNullable") ? NonNullableInstantiate(context, state, parameters[0], options) : IsEqual(action, "Pick") ? PickInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Parameters") ? ParametersInstantiate(context, state, parameters[0], options) : IsEqual(action, "Partial") ? PartialInstantiate(context, state, parameters[0], options) : IsEqual(action, "Omit") ? OmitInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "ReadonlyObject") ? ReadonlyObjectInstantiate(context, state, parameters[0], options) : IsEqual(action, "Record") ? RecordInstantiate(context, state, parameters[0], parameters[1], options) : IsEqual(action, "Required") ? RequiredInstantiate(context, state, parameters[0], options) : IsEqual(action, "ReturnType") ? ReturnTypeInstantiate(context, state, parameters[0], options) : IsEqual(action, "TemplateLiteral") ? TemplateLiteralInstantiate(context, state, parameters[0], options) : IsEqual(action, "Uncapitalize") ? UncapitalizeInstantiate(context, state, parameters[0], options) : IsEqual(action, "Uppercase") ? UppercaseInstantiate(context, state, parameters[0], options) : IsEqual(action, "With") ? WithInstantiate(context, state, parameters[0], parameters[1]) : Deferred(action, parameters, options);
3298
- }
3299
- function InstantiateImmediate(context, state, type) {
3300
- return WithModifiers(type, IsRef(type) ? RefInstantiate(context, state, type, type.$ref) : IsArray(type) ? _Array_(InstantiateType(context, state, type.items), ArrayOptions(type)) : IsCall(type) ? CallInstantiate(context, state, type.target, type.arguments) : IsConstructor(type) ? Constructor(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.instanceType), ConstructorOptions(type)) : IsFunction(type) ? _Function_(InstantiateTypes(context, state, type.parameters), InstantiateType(context, state, type.returnType), FunctionOptions(type)) : IsDependent(type) ? Dependent(InstantiateType(context, state, type.if), InstantiateType(context, state, type.then), InstantiateType(context, state, type.else), DependentOptions(type)) : IsIntersect(type) ? Intersect(InstantiateTypes(context, state, type.allOf), IntersectOptions(type)) : IsObject(type) ? _Object_(InstantiateProperties(context, state, type.properties), ObjectOptions(type)) : IsRecord(type) ? RecordFromPattern(RecordPattern(type), InstantiateType(context, state, RecordValue(type))) : IsRest(type) ? Rest(InstantiateType(context, state, type.items)) : IsTuple(type) ? Tuple(InstantiateElements(context, state, type.items), TupleOptions(type)) : IsUnion(type) ? Union(InstantiateTypes(context, state, type.anyOf), UnionOptions(type)) : type);
3301
- }
3302
- function InstantiateType(context, state, type) {
3303
- return IsDeferred(type) ? InstantiateDeferred(context, state, type.action, type.parameters, type.options) : InstantiateImmediate(context, state, type);
3304
- }
3305
- /** Instantiates computed schematics using the given context and type. */
3306
- function Instantiate(context, type) {
3307
- return InstantiateType(context, State([], []), type);
3308
- }
3309
- //#endregion
3310
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs
3311
- function AddImmutableAction(type, options) {
3312
- return Update(type, { "~immutable": true }, options);
3313
- }
3314
- function AddImmutableInstantiate(context, state, type, options) {
3315
- return AddImmutableAction(InstantiateType(context, state, type), options);
3316
- }
3317
- //#endregion
3318
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/_add_immutable.mjs
3319
- /** Applies an AddImmutable action to a type. */
3320
- function AddImmutable(type, options = {}) {
3321
- return AddImmutableAction(type, options);
3322
- }
3323
- //#endregion
3324
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/action/evaluate.mjs
3325
- /** Applies an Evaluate action to a type. */
3326
- function Evaluate(type, options = {}) {
3327
- return EvaluateAction(type, options);
3328
- }
3329
- //#endregion
3330
- //#region ../../../node_modules/.pnpm/typebox@1.4.2/node_modules/typebox/build/type/engine/priority/priority.mjs
3331
- function Comparer(left, right) {
3332
- const compareResult = Compare(left, right);
3333
- return IsEqual(compareResult, 3) ? 1 : IsEqual(compareResult, 1) ? 1 : 0;
3334
- }
3335
- function Insert(type, types, result = []) {
3336
- return ShiftLeft(types, (left, right) => IsEqual(Comparer(type, left), 1) ? Insert(type, right, [...result, left]) : [
3337
- ...result,
3338
- type,
3339
- ...types
3340
- ], () => [...result, type]);
3341
- }
3342
- function Sort(types, result = []) {
3343
- return ShiftLeft(types, (left, right) => Sort(right, Insert(left, result)), () => result);
3344
- }
3345
- /**
3346
- * Priority sorts types in sequence of narrowest to broadest using an Insertion Sort
3347
- * algorithm. This function is typically used to sequence types for union variant
3348
- * checks to ensure that values are checked against the most narrow types before
3349
- * the broadest, which in turn helps ensure order-independent Union checking.
3350
- */
3351
- function Priority(types) {
3352
- return Sort(types);
3353
- }
3354
- //#endregion
3355
- export { IsSchema as $, Integer as A, IsObject$1 as At, IsEnum as B, Symbols as Bt, Null as C, IsLessEqualThan as Ct, IsLiteralNumber as D, IsMultipleOf as Dt, IsLiteralBoolean as E, IsMinLength as Et, IsCodec as F, IsUnsafePropertyKey as Ft, _Object_ as G, IsCyclic as H, Hash as I, IsValueLike as It, IsRef as J, IsOptional as K, Unreachable as L, Keys$1 as Lt, Boolean$1 as M, IsString$2 as Mt, IsBoolean as N, IsSymbol$1 as Nt, IsLiteralString as O, IsNull$1 as Ot, IsBigInt as P, IsUndefined$1 as Pt, _Array_ as Q, Intersect as R, Some as Rt, IsNull as S, IsInteger$1 as St, IsLiteralBigInt as T, IsMaxLength as Tt, Unknown as U, Unsafe as V, guard_exports as Vt, IsObject as W, ArrayOptions as X, Ref as Y, IsArray as Z, Union as _, IsDeepEqual as _t, Partial as a, IsTypeArray as at, IsNumber as b, IsGreaterEqualThan as bt, IsVoid as c, EntriesRegExp as ct, Record as d, HasPropertyKey as dt, Assign as et, RecordPattern as f, IsArray$1 as ft, IsUnion as g, IsConstructor$1 as gt, Tuple as h, IsClassInstance as ht, With as i, IsSet as it, IsInteger as j, IsObjectNotArray as jt, Literal as k, IsNumber$2 as kt, IsUndefined as l, Every as lt, IsTuple as m, IsBoolean$2 as mt, Evaluate as n, IsMap as nt, Omit as o, Counted as ot, RecordValue as p, IsBigInt$1 as pt, Optional as q, Instantiate as r, IsRegExp as rt, IsTemplateLiteral as s, Entries as st, Priority as t, Get as tt, IsRecord as u, EveryAll as ut, IsString as v, IsEqual as vt, IsLiteral as w, IsLessThan as wt, Number$1 as x, IsGreaterThan as xt, String$1 as y, IsFunction$1 as yt, IsIntersect as z, SomeAll as zt };