@abtnode/webapp 1.17.6 → 1.17.7-beta-20251224-045844-3c7f459a

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 (185) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-BjFsoQ-w.js → AdapterDayjs-CTE9A4XS.js} +1 -1
  4. package/dist/assets/{Add-DwgbzyUw.js → Add-CDjPaJKP.js} +1 -1
  5. package/dist/assets/ArrowDropDown-DVc4YlSr.js +1 -0
  6. package/dist/assets/{Autocomplete-Dm1_2YSl.js → Autocomplete-Bk7apAFc.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-CJg6cGOH.js → Breadcrumbs-CD40dK_D.js} +1 -1
  8. package/dist/assets/{ButtonGroup-Td8BNrZx.js → ButtonGroup-CufACnLw.js} +1 -1
  9. package/dist/assets/{CSSTransition-y8iKTN7d.js → CSSTransition-exmZd1Pd.js} +1 -1
  10. package/dist/assets/{CallMerge-KptmKwB4.js → CallMerge-C9Klwufe.js} +1 -1
  11. package/dist/assets/{CardContent-ewSbhAdG.js → CardContent-_17XtZEs.js} +1 -1
  12. package/dist/assets/{ChevronLeft-nSrR9D_I.js → ChevronLeft-PZrWRTUE.js} +1 -1
  13. package/dist/assets/{ChevronRight-CRb5GVq5.js → ChevronRight-C64VDrVw.js} +1 -1
  14. package/dist/assets/{Clear-CP-1JSsG.js → Clear-Cxz7AyBG.js} +1 -1
  15. package/dist/assets/{Delete-zum6vOfn.js → Delete-BWThh3lU.js} +1 -1
  16. package/dist/assets/{DeleteOutline-BRn6KXm4.js → DeleteOutline-DGv1wjmr.js} +1 -1
  17. package/dist/assets/{Done-BD3-Bno_.js → Done-BPhEa-lh.js} +1 -1
  18. package/dist/assets/{Edit-fbuEYDWz.js → Edit-DU8cRp9d.js} +1 -1
  19. package/dist/assets/{ErrorOutline-eTinVSTi.js → ErrorOutline-BGT4By5f.js} +1 -1
  20. package/dist/assets/{FilterList-CoptEImh.js → FilterList-DnTA4h-A.js} +1 -1
  21. package/dist/assets/{Google-DYe0WpSM.js → Google-CQNl2Qei.js} +1 -1
  22. package/dist/assets/{HelpOutline-CTq25q-V.js → HelpOutline-Cq89intm.js} +1 -1
  23. package/dist/assets/{KeyboardArrowDown-DBKPniSI.js → KeyboardArrowDown-Du2c6qjk.js} +1 -1
  24. package/dist/assets/{Launch-BMpdke3b.js → Launch-MVYS8Hns.js} +1 -1
  25. package/dist/assets/{Link-Bum1u5am.js → Link-BnEYcCWC.js} +1 -1
  26. package/dist/assets/{ListItemButton-DAHFrrOj.js → ListItemButton-7lbPyGsz.js} +1 -1
  27. package/dist/assets/{ListSubheader-DmTgdBz5.js → ListSubheader-DYeGWpur.js} +1 -1
  28. package/dist/assets/{LoadingButton-Hr-4vZXO.js → LoadingButton-DTEhJUCj.js} +1 -1
  29. package/dist/assets/{MoreVert-Bs574HAx.js → MoreVert-CBPzGUWs.js} +1 -1
  30. package/dist/assets/{OpenInNew-Df7bSVHt.js → OpenInNew-Dap82Gj1.js} +1 -1
  31. package/dist/assets/{Refresh-mfLuZ9Wj.js → Refresh-TSC86hrV.js} +1 -1
  32. package/dist/assets/{Replay-CUAnOum2.js → Replay-CCjt3MYi.js} +1 -1
  33. package/dist/assets/{Search-CCrESOjg.js → Search-BTki5Tlw.js} +1 -1
  34. package/dist/assets/{Stepper-CDtZbh-4.js → Stepper-DWCCfU77.js} +1 -1
  35. package/dist/assets/{TableSearch-hUcYhTcB.js → TableSearch-CPKsMI8E.js} +1 -1
  36. package/dist/assets/{ToggleButtonGroup-B8Mjp9ll.js → ToggleButtonGroup-DxN7gyOm.js} +1 -1
  37. package/dist/assets/{UnfoldMore-DDQ8EkCp.js → UnfoldMore-DM7uEg-t.js} +1 -1
  38. package/dist/assets/{Verified-D2LDOD6a.js → Verified-CNxkIuze.js} +1 -1
  39. package/dist/assets/{VerifiedUser-dJrRBh25.js → VerifiedUser-CwrDiVvI.js} +1 -1
  40. package/dist/assets/{ViewList-Dd0smq67.js → ViewList-DAPsQ9qa.js} +1 -1
  41. package/dist/assets/{_createAggregator-Btgpq5ky.js → _createAggregator-CAAbBm3S.js} +1 -1
  42. package/dist/assets/{actions-Bsd5QbHY.js → actions-BSlGM89P.js} +1 -1
  43. package/dist/assets/{actions-PjGF5ddj.js → actions-DLaMcDXc.js} +1 -1
  44. package/dist/assets/{agreement-CR0Ele2A.js → agreement-CetGa5Zn.js} +1 -1
  45. package/dist/assets/api-BgOKuKLm.js +1 -0
  46. package/dist/assets/{appearance-Dde_YYZa.js → appearance-Bw0rB7tg.js} +1 -1
  47. package/dist/assets/{audit-logs-BA1_e5TT.js → audit-logs-VYgS8pEE.js} +1 -1
  48. package/dist/assets/{base-chart-DoQaNYbB.js → base-chart-DK86Bg6l.js} +1 -1
  49. package/dist/assets/{blocklet-9wr_FD8g.js → blocklet-BtHx1Y24.js} +1 -1
  50. package/dist/assets/{chain-xcMn0w3E.js → chain-CnR1vCEL.js} +1 -1
  51. package/dist/assets/{click-to-copy-BkgGJ2iu.js → click-to-copy-C6Ix5G0V.js} +1 -1
  52. package/dist/assets/cloneDeep-CsXhtsDM.js +1 -0
  53. package/dist/assets/{config-navigation-B8xULYAA.js → config-navigation-D2rte6dv.js} +3 -3
  54. package/dist/assets/{connect-to-D7kv9JZG.js → connect-to-ZkEn8UXb.js} +1 -1
  55. package/dist/assets/{cssMode-CrKT5NTU.js → cssMode-Cy0Ht4-w.js} +1 -1
  56. package/dist/assets/{delete-confirm-DsbMbRAa.js → delete-confirm-C6-PGb0E.js} +1 -1
  57. package/dist/assets/{depsEqual-BIKlqTyk.js → depsEqual-IFL5M-qa.js} +1 -1
  58. package/dist/assets/{detail-Y8udUtll.js → detail-akdyilvB.js} +3 -3
  59. package/dist/assets/{domains-B-frEuQt.js → domains-CBW5W-A4.js} +1 -1
  60. package/dist/assets/{download-DjEQp-4L.js → download-_CsYRy7z.js} +1 -1
  61. package/dist/assets/{edit.svg-_S0cvmEV.js → edit.svg-BI9q0cq7.js} +1 -1
  62. package/dist/assets/emotion-cache.browser.esm-P8IIbJhy.js +1 -0
  63. package/dist/assets/engine-DLi7rSr-.js +1 -0
  64. package/dist/assets/{freemarker2-DMLRgxDr.js → freemarker2-CHbFGeGq.js} +1 -1
  65. package/dist/assets/{get-safe-url-DcDP4eG0.js → get-safe-url-DvnzSlO6.js} +1 -1
  66. package/dist/assets/getValidReactChildren-DVWXmlzf.js +1 -0
  67. package/dist/assets/{graphqlMode-BF3BGh5s.js → graphqlMode-DC3lY9Bc.js} +2 -2
  68. package/dist/assets/{handlebars-D79JLSFR.js → handlebars-DRfC1etE.js} +1 -1
  69. package/dist/assets/{html-BnBm7tse.js → html-DSKmnSdn.js} +1 -1
  70. package/dist/assets/{html-title-CFJOQU04.js → html-title-BSurkQWH.js} +1 -1
  71. package/dist/assets/{htmlMode-Dbi5GsHR.js → htmlMode-_-dLWJfg.js} +1 -1
  72. package/dist/assets/{iframe-DTPDSES_.js → iframe-Bt3m8KPW.js} +1 -1
  73. package/dist/assets/{index-_p9TGBvO.js → index-40MfJqec.js} +1 -1
  74. package/dist/assets/{index-Cqnb030V.js → index-8POE69-i.js} +1 -1
  75. package/dist/assets/{index-DxeaApG7.js → index-B108geQF.js} +1 -1
  76. package/dist/assets/{index-DAzO4vT3.js → index-B1FMLcMH.js} +1 -1
  77. package/dist/assets/{index-Br_3Odot.js → index-B1Nj4Dbn.js} +1 -1
  78. package/dist/assets/{index-gW2LRVpQ.js → index-B6ukQo_6.js} +3 -3
  79. package/dist/assets/{index-B3f37Bjf.js → index-BAjBvyiG.js} +1 -1
  80. package/dist/assets/{index-aQCP0zMr.js → index-BD3aqk2R.js} +24 -24
  81. package/dist/assets/{index-CsR2mhWN.js → index-BK7GVg3F.js} +1 -1
  82. package/dist/assets/{index-DpFVufZF.js → index-BRwrysOT.js} +3 -3
  83. package/dist/assets/{index-BOjP8MFh.js → index-BdJ8QXo_.js} +1 -1
  84. package/dist/assets/{index-D49gl1dV.js → index-BdkR_Gq6.js} +1 -1
  85. package/dist/assets/{index-CZVZy3tE.js → index-BkzhB5R6.js} +1 -1
  86. package/dist/assets/{index-DfO0PkR5.js → index-BqbzDVxw.js} +2 -2
  87. package/dist/assets/{index-DAIx6BU9.js → index-Br1ngDZj.js} +9 -9
  88. package/dist/assets/{index-Cj3feFCu.js → index-BsfcFq96.js} +1 -1
  89. package/dist/assets/{index-CusFNu14.js → index-BwYWp4uB.js} +1 -1
  90. package/dist/assets/{index-Crh7ejXx.js → index-BzsBXHYe.js} +3 -3
  91. package/dist/assets/{index-DqKWQ6lA.js → index-C8QDtMUx.js} +1 -1
  92. package/dist/assets/index-CCHTs-ny.js +1 -0
  93. package/dist/assets/{index-CeVw-yV4.js → index-CDv5sV-r.js} +1 -1
  94. package/dist/assets/{index-B6CCglEp.js → index-CFEh-tzA.js} +1 -1
  95. package/dist/assets/{index-C0xGIN2P.js → index-CMgJdphE.js} +1 -1
  96. package/dist/assets/{index-BruXFS68.js → index-CPY0YlbJ.js} +1 -1
  97. package/dist/assets/{index-Dter8RWU.js → index-CRebSTUo.js} +1 -1
  98. package/dist/assets/{index-8vHqMMTo.js → index-CTnrh8HT.js} +1 -1
  99. package/dist/assets/{index-DmsOwDxy.js → index-CW8HQTvR.js} +1 -1
  100. package/dist/assets/{index-BESOxZme.js → index-CgGaIeHC.js} +1 -1
  101. package/dist/assets/{index-D09yH344.js → index-Ci0Kk6rk.js} +1 -1
  102. package/dist/assets/{index-DKlmfMu8.js → index-CixkoMpL.js} +1 -1
  103. package/dist/assets/{index-CySEKiOM.js → index-D5NCDKoy.js} +1 -1
  104. package/dist/assets/{index-DkNsYHWd.js → index-D97ip1uo.js} +1 -1
  105. package/dist/assets/{index-DSki-yHd.js → index-DEcH1z__.js} +3 -3
  106. package/dist/assets/{index-FOfUOpKU.js → index-DfNf7S5Q.js} +1 -1
  107. package/dist/assets/{index-CaHbIkEa.js → index-DkcG4kie.js} +1 -1
  108. package/dist/assets/{index-C-G6LjU2.js → index-Dq_LjxOb.js} +1 -1
  109. package/dist/assets/{index-C4bxvfjr.js → index-DtWrHdLQ.js} +1 -1
  110. package/dist/assets/{index-Cy1gRvjJ.js → index-DxuCw2B5.js} +1 -1
  111. package/dist/assets/{index-TkRGX0aU.js → index-Dyi8pxAj.js} +1 -1
  112. package/dist/assets/{index-CSqb8yB_.js → index-KhMC1sR2.js} +1 -1
  113. package/dist/assets/{index-C6w6MwHd.js → index-LjsyWu4w.js} +1 -1
  114. package/dist/assets/{index-B3S0fIB2.js → index-PyGYazDG.js} +1 -1
  115. package/dist/assets/{index-CnaB1RS2.js → index-WuCKKQ6-.js} +1 -1
  116. package/dist/assets/{index-gY5iKTIg.js → index-jNjCxoJx.js} +1 -1
  117. package/dist/assets/{index-BprceCor.js → index-sKIgMA4E.js} +1 -1
  118. package/dist/assets/{index.esm-DNw2WsMP.js → index.esm-DmjTLIy8.js} +1 -1
  119. package/dist/assets/{install-from-url-ChxBmd8y.js → install-from-url-Ch_1I_g4.js} +1 -1
  120. package/dist/assets/{invitation-CK-9fzay.js → invitation-wPdHjRbO.js} +1 -1
  121. package/dist/assets/{is-path-prefix-equal-z6rXFfWF.js → is-path-prefix-equal-CH8zcdAz.js} +1 -1
  122. package/dist/assets/{item-Bi4YOXoV.js → item-DwlLrYZ8.js} +1 -1
  123. package/dist/assets/{javascript-gR9EmbFN.js → javascript-v_dB2LCD.js} +1 -1
  124. package/dist/assets/{jsonMode-C2iokhm3.js → jsonMode-A_r5s-xz.js} +1 -1
  125. package/dist/assets/{liquid-DlmH91G9.js → liquid-BpLkSRaK.js} +1 -1
  126. package/dist/assets/{list-header-CiZSpcHw.js → list-header-aIJDfQ7C.js} +1 -1
  127. package/dist/assets/{lock.svg-D4RerwXL.js → lock.svg-DIfrAsKr.js} +1 -1
  128. package/dist/assets/{log-fHnfsRRc.js → log-D1BgNL7X.js} +1 -1
  129. package/dist/assets/{lottie-react.esm-DwGuMXwe.js → lottie-react.esm-BWoLX3N3.js} +1 -1
  130. package/dist/assets/{mdx-B4KL37qQ.js → mdx-CcVqE20R.js} +1 -1
  131. package/dist/assets/{memory-_jD3viB0.js → memory-BLdw7rTR.js} +1 -1
  132. package/dist/assets/{metric-D-n9wLBp.js → metric-IUjf35f-.js} +1 -1
  133. package/dist/assets/omit-CDfacidt.js +1 -0
  134. package/dist/assets/{overview-DTGYE6TZ.js → overview-D7Y-efsF.js} +1 -1
  135. package/dist/assets/{permission-a5zDq7rM.js → permission-lRCqS6FX.js} +1 -1
  136. package/dist/assets/{preference-B-CYFAI3.js → preference-BPMZO3G0.js} +3 -3
  137. package/dist/assets/{python-BM52WTwZ.js → python-BOBV8DO9.js} +1 -1
  138. package/dist/assets/{raf-schd.esm-B5OMlrCf.js → raf-schd.esm-1Wuo2M9L.js} +1 -1
  139. package/dist/assets/{razor-DrYd4877.js → razor-Bm4kx_M6.js} +1 -1
  140. package/dist/assets/{rotate-session-key-DETYEvOS.js → rotate-session-key-BVzu2iwA.js} +1 -1
  141. package/dist/assets/{runtime-C5Qv_-EQ.js → runtime-bAThj0Aq.js} +1 -1
  142. package/dist/assets/schema-2rSPa9BO.js +1 -0
  143. package/dist/assets/sdk-DLjX87O7.js +1 -0
  144. package/dist/assets/{service-CU627QjX.js → service-B1eJ3WVA.js} +1 -1
  145. package/dist/assets/{shorten-label-izVabXeE.js → shorten-label-CoRoKICP.js} +1 -1
  146. package/dist/assets/{simple-select-BSptVRvh.js → simple-select-DJQq12UY.js} +1 -1
  147. package/dist/assets/{spaces-CGMxc8V-.js → spaces-DaLcXe5Q.js} +1 -1
  148. package/dist/assets/{status-DsuywKQN.js → status-B9k6GD3L.js} +1 -1
  149. package/dist/assets/{status-Cc65Exxv.js → status-Bqt7B9nn.js} +1 -1
  150. package/dist/assets/{switch-control-BrQIub8A.js → switch-control-CQRoTkvj.js} +1 -1
  151. package/dist/assets/{table-icons-hVAZnA0-.js → table-icons-DNYeh5xy.js} +1 -1
  152. package/dist/assets/{team-651xYHqY.js → team-CCZFetkg.js} +1 -1
  153. package/dist/assets/{toLower-BTh_yPFG.js → toLower-wanvKBaZ.js} +1 -1
  154. package/dist/assets/toUpper-DhA75wMh.js +1 -0
  155. package/dist/assets/{traffic-DEO0b2pJ.js → traffic-DpPN1079.js} +1 -1
  156. package/dist/assets/{tsMode-DFoW-qGq.js → tsMode-BU3eTe2J.js} +1 -1
  157. package/dist/assets/{typescript-yTEHeHqu.js → typescript-BrdqWxrm.js} +1 -1
  158. package/dist/assets/{url-evaluation-htR8cP0c.js → url-evaluation-CgzjVAvg.js} +1 -1
  159. package/dist/assets/{url-join-CvBUjlHE.js → url-join-DOdOelSC.js} +1 -1
  160. package/dist/assets/{use-mobile-CD0b5-fF.js → use-mobile-BVZp-Eov.js} +1 -1
  161. package/dist/assets/{use-mobile-B2fvjcjL.js → use-mobile-DlRpLfd1.js} +1 -1
  162. package/dist/assets/{useAsync-DTSaiLA6.js → useAsync-TDFBzBqx.js} +1 -1
  163. package/dist/assets/{useAsyncRetry-3oMBxbWI.js → useAsyncRetry-CrZDAawF.js} +1 -1
  164. package/dist/assets/{useLocalStorage-pDiaOOl8.js → useLocalStorage-BpFDuJHy.js} +1 -1
  165. package/dist/assets/{useThemeProps-D2o2I8tH.js → useThemeProps-DiahvBki.js} +1 -1
  166. package/dist/assets/{util-CO7za6kW.js → util-DTNmxH9u.js} +1 -1
  167. package/dist/assets/{wait-container-CKMtOVZ5.js → wait-container-DPxn2Zp4.js} +1 -1
  168. package/dist/assets/{without-wallet-Bz0faV9X.js → without-wallet-E48cNWb9.js} +4 -4
  169. package/dist/assets/wrap-locale-BIL9uJmS.js +1 -0
  170. package/dist/assets/{xml-DOoQrL1t.js → xml-BeHXnyv2.js} +1 -1
  171. package/dist/assets/{yaml-CEc3MOv9.js → yaml-apFNFPw8.js} +1 -1
  172. package/dist/index.html +1 -1
  173. package/package.json +1 -1
  174. package/dist/assets/ArrowDropDown-CbNJotqT.js +0 -1
  175. package/dist/assets/api-IHWlq8qW.js +0 -1
  176. package/dist/assets/cloneDeep-DvQOj2-I.js +0 -1
  177. package/dist/assets/emotion-cache.browser.esm-B4otC3_4.js +0 -1
  178. package/dist/assets/engine-B_GmO38d.js +0 -1
  179. package/dist/assets/getValidReactChildren-DUKHPCTn.js +0 -1
  180. package/dist/assets/index-DdF52dPT.js +0 -1
  181. package/dist/assets/omit-CPRZ0B0R.js +0 -1
  182. package/dist/assets/schema-BpWVtFwc.js +0 -1
  183. package/dist/assets/sdk-BCvN9-9d.js +0 -1
  184. package/dist/assets/toUpper-BY5QEPjh.js +0 -1
  185. package/dist/assets/wrap-locale-BbjqZMGZ.js +0 -1
@@ -1,4 +1,4 @@
1
- import{dy as lt,ez as ut,eA as ft,eB as mt,eC as De,cJ as ht,eD as dt,dG as pt,eE as gt,V as yt,j as He,eF as vt,aD as bt,eG as _t,o as wt}from"./index-DpFVufZF.js";import{r as Et}from"./index-BOjP8MFh.js";var q={},Rt=null;const $t=Object.freeze(Object.defineProperty({__proto__:null,default:Rt},Symbol.toStringTag,{value:"Module"})),ct=lt($t);var Fe={exports:{}},Xe;function Ke(){return Xe||(Xe=1,function(G,N){(function(D,U){G.exports=U()})(self,()=>{return D={7629:(S,w,p)=>{const i=p(375),g=p(8571),h=p(9474),l=p(1687),t=p(8652),a=p(8160),n=p(3292),s=p(6354),r=p(8901),c=p(9708),e=p(6914),o=p(2294),f=p(6133),m=p(1152),y=p(8863),R=p(2036),_={Base:class{constructor(u){this.type=u,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new o.Ids,this._preferences=null,this._refs=new f.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return i(typeof c.describe=="function","Manifest functionality disabled"),c.describe(this)}allow(...u){return a.verifyFlat(u,"allow"),this._values(u,"_valids")}alter(u){i(u&&typeof u=="object"&&!Array.isArray(u),"Invalid targets argument"),i(!this._inRuleset(),"Cannot set alterations inside a ruleset");const d=this.clone();d.$_terms.alterations=d.$_terms.alterations||[];for(const v in u){const E=u[v];i(typeof E=="function","Alteration adjuster for",v,"must be a function"),d.$_terms.alterations.push({target:v,adjuster:E})}return d.$_temp.ruleset=!1,d}artifact(u){return i(u!==void 0,"Artifact cannot be undefined"),i(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",u)}cast(u){return i(u===!1||typeof u=="string","Invalid to value"),i(u===!1||this._definition.cast[u],"Type",this.type,"does not support casting to",u),this.$_setFlag("cast",u===!1?void 0:u)}default(u,d){return this._default("default",u,d)}description(u){return i(u&&typeof u=="string","Description must be a non-empty string"),this.$_setFlag("description",u)}empty(u){const d=this.clone();return u!==void 0&&(u=d.$_compile(u,{override:!1})),d.$_setFlag("empty",u,{clone:!1})}error(u){return i(u,"Missing error"),i(u instanceof Error||typeof u=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",u)}example(u,d={}){return i(u!==void 0,"Missing example"),a.assertOptions(d,["override"]),this._inner("examples",u,{single:!0,override:d.override})}external(u,d){return typeof u=="object"&&(i(!d,"Cannot combine options with description"),d=u.description,u=u.method),i(typeof u=="function","Method must be a function"),i(d===void 0||d&&typeof d=="string","Description must be a non-empty string"),this._inner("externals",{method:u,description:d},{single:!0})}failover(u,d){return this._default("failover",u,d)}forbidden(){return this.presence("forbidden")}id(u){return u?(i(typeof u=="string","id must be a non-empty string"),i(/^[^\.]+$/.test(u),"id cannot contain period character"),this.$_setFlag("id",u)):this.$_setFlag("id",void 0)}invalid(...u){return this._values(u,"_invalids")}label(u){return i(u&&typeof u=="string","Label name must be a non-empty string"),this.$_setFlag("label",u)}meta(u){return i(u!==void 0,"Meta cannot be undefined"),this._inner("metas",u,{single:!0})}note(...u){i(u.length,"Missing notes");for(const d of u)i(d&&typeof d=="string","Notes must be non-empty strings");return this._inner("notes",u)}only(u=!0){return i(typeof u=="boolean","Invalid mode:",u),this.$_setFlag("only",u)}optional(){return this.presence("optional")}prefs(u){i(u,"Missing preferences"),i(u.context===void 0,"Cannot override context"),i(u.externals===void 0,"Cannot override externals"),i(u.warnings===void 0,"Cannot override warnings"),i(u.debug===void 0,"Cannot override debug"),a.checkPreferences(u);const d=this.clone();return d._preferences=a.preferences(d._preferences,u),d}presence(u){return i(["optional","required","forbidden"].includes(u),"Unknown presence mode",u),this.$_setFlag("presence",u)}raw(u=!0){return this.$_setFlag("result",u?"raw":void 0)}result(u){return i(["raw","strip"].includes(u),"Unknown result mode",u),this.$_setFlag("result",u)}required(){return this.presence("required")}strict(u){const d=this.clone(),v=u!==void 0&&!u;return d._preferences=a.preferences(d._preferences,{convert:v}),d}strip(u=!0){return this.$_setFlag("result",u?"strip":void 0)}tag(...u){i(u.length,"Missing tags");for(const d of u)i(d&&typeof d=="string","Tags must be non-empty strings");return this._inner("tags",u)}unit(u){return i(u&&typeof u=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",u)}valid(...u){a.verifyFlat(u,"valid");const d=this.allow(...u);return d.$_setFlag("only",!!d._valids,{clone:!1}),d}when(u,d){const v=this.clone();v.$_terms.whens||(v.$_terms.whens=[]);const E=n.when(v,u,d);if(!["any","link"].includes(v.type)){const k=E.is?[E]:E.switch;for(const O of k)i(!O.then||O.then.type==="any"||O.then.type===v.type,"Cannot combine",v.type,"with",O.then&&O.then.type),i(!O.otherwise||O.otherwise.type==="any"||O.otherwise.type===v.type,"Cannot combine",v.type,"with",O.otherwise&&O.otherwise.type)}return v.$_terms.whens.push(E),v.$_mutateRebuild()}cache(u){i(!this._inRuleset(),"Cannot set caching inside a ruleset"),i(!this._cache,"Cannot override schema cache"),i(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const d=this.clone();return d._cache=u||t.provider.provision(),d.$_temp.ruleset=!1,d}clone(){const u=Object.create(Object.getPrototypeOf(this));return this._assign(u)}concat(u){i(a.isSchema(u),"Invalid schema object"),i(this.type==="any"||u.type==="any"||u.type===this.type,"Cannot merge type",this.type,"with another type:",u.type),i(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),i(!u._inRuleset(),"Cannot concatenate a schema with open ruleset");let d=this.clone();if(this.type==="any"&&u.type!=="any"){const v=u.clone();for(const E of Object.keys(d))E!=="type"&&(v[E]=d[E]);d=v}d._ids.concat(u._ids),d._refs.register(u,f.toSibling),d._preferences=d._preferences?a.preferences(d._preferences,u._preferences):u._preferences,d._valids=R.merge(d._valids,u._valids,u._invalids),d._invalids=R.merge(d._invalids,u._invalids,u._valids);for(const v of u._singleRules.keys())d._singleRules.has(v)&&(d._rules=d._rules.filter(E=>E.keep||E.name!==v),d._singleRules.delete(v));for(const v of u._rules)u._definition.rules[v.method].multi||d._singleRules.set(v.name,v),d._rules.push(v);if(d._flags.empty&&u._flags.empty){d._flags.empty=d._flags.empty.concat(u._flags.empty);const v=Object.assign({},u._flags);delete v.empty,l(d._flags,v)}else if(u._flags.empty){d._flags.empty=u._flags.empty;const v=Object.assign({},u._flags);delete v.empty,l(d._flags,v)}else l(d._flags,u._flags);for(const v in u.$_terms){const E=u.$_terms[v];E?d.$_terms[v]?d.$_terms[v]=d.$_terms[v].concat(E):d.$_terms[v]=E.slice():d.$_terms[v]||(d.$_terms[v]=E)}return this.$_root._tracer&&this.$_root._tracer._combine(d,[this,u]),d.$_mutateRebuild()}extend(u){return i(!u.base,"Cannot extend type with another base"),r.type(this,u)}extract(u){return u=Array.isArray(u)?u:u.split("."),this._ids.reach(u)}fork(u,d){i(!this._inRuleset(),"Cannot fork inside a ruleset");let v=this;for(let E of[].concat(u))E=Array.isArray(E)?E:E.split("."),v=v._ids.fork(E,d,v);return v.$_temp.ruleset=!1,v}rule(u){const d=this._definition;a.assertOptions(u,Object.keys(d.modifiers)),i(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const v=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;i(v>=0&&v<this._rules.length,"Cannot apply rules to empty ruleset");const E=this.clone();for(let k=v;k<E._rules.length;++k){const O=E._rules[k],A=g(O);for(const I in u)d.modifiers[I](A,u[I]),i(A.name===O.name,"Cannot change rule name");E._rules[k]=A,E._singleRules.get(A.name)===O&&E._singleRules.set(A.name,A)}return E.$_temp.ruleset=!1,E.$_mutateRebuild()}get ruleset(){i(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const u=this.clone();return u.$_temp.ruleset=u._rules.length,u}get $(){return this.ruleset}tailor(u){u=[].concat(u),i(!this._inRuleset(),"Cannot tailor inside a ruleset");let d=this;if(this.$_terms.alterations)for(const{target:v,adjuster:E}of this.$_terms.alterations)u.includes(v)&&(d=E(d),i(a.isSchema(d),"Alteration adjuster for",v,"failed to return a schema object"));return d=d.$_modify({each:v=>v.tailor(u),ref:!1}),d.$_temp.ruleset=!1,d.$_mutateRebuild()}tracer(){return m.location?m.location(this):this}validate(u,d){return y.entry(u,this,d)}validateAsync(u,d){return y.entryAsync(u,this,d)}$_addRule(u){typeof u=="string"&&(u={name:u}),i(u&&typeof u=="object","Invalid options"),i(u.name&&typeof u.name=="string","Invalid rule name");for(const O in u)i(O[0]!=="_","Cannot set private rule properties");const d=Object.assign({},u);d._resolve=[],d.method=d.method||d.name;const v=this._definition.rules[d.method],E=d.args;i(v,"Unknown rule",d.method);const k=this.clone();if(E){i(Object.keys(E).length===1||Object.keys(E).length===this._definition.rules[d.name].args.length,"Invalid rule definition for",this.type,d.name);for(const O in E){let A=E[O];if(v.argsByName){const I=v.argsByName.get(O);if(I.ref&&a.isResolvable(A))d._resolve.push(O),k.$_mutateRegister(A);else if(I.normalize&&(A=I.normalize(A),E[O]=A),I.assert){const T=a.validateArg(A,O,I);i(!T,T,"or reference")}}A!==void 0?E[O]=A:delete E[O]}}return v.multi||(k._ruleRemove(d.name,{clone:!1}),k._singleRules.set(d.name,d)),k.$_temp.ruleset===!1&&(k.$_temp.ruleset=null),v.priority?k._rules.unshift(d):k._rules.push(d),k}$_compile(u,d){return n.schema(this.$_root,u,d)}$_createError(u,d,v,E,k,O={}){const A=O.flags!==!1?this._flags:{},I=O.messages?e.merge(this._definition.messages,O.messages):this._definition.messages;return new s.Report(u,d,v,A,I,E,k)}$_getFlag(u){return this._flags[u]}$_getRule(u){return this._singleRules.get(u)}$_mapLabels(u){return u=Array.isArray(u)?u:u.split("."),this._ids.labels(u)}$_match(u,d,v,E){(v=Object.assign({},v)).abortEarly=!0,v._externals=!1,d.snapshot();const k=!y.validate(u,this,d,v,E).errors;return d.restore(),k}$_modify(u){return a.assertOptions(u,["each","once","ref","schema"]),o.schema(this,u)||this}$_mutateRebuild(){return i(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(u,{source:d,name:v,path:E,key:k})=>{const O=this._definition[d][v]&&this._definition[d][v].register;O!==!1&&this.$_mutateRegister(u,{family:O,key:k})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(u,{family:d,key:v}={}){this._refs.register(u,d),this._ids.register(u,{key:v})}$_property(u){return this._definition.properties[u]}$_reach(u){return this._ids.reach(u)}$_rootReferences(){return this._refs.roots()}$_setFlag(u,d,v={}){i(u[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const E=this._definition.flags[u]||{};if(h(d,E.default)&&(d=void 0),h(d,this._flags[u]))return this;const k=v.clone!==!1?this.clone():this;return d!==void 0?(k._flags[u]=d,k.$_mutateRegister(d)):delete k._flags[u],u[0]!=="_"&&(k.$_temp.ruleset=!1),k}$_parent(u,...d){return this[u][a.symbols.parent].call(this,...d)}$_validate(u,d,v){return y.validate(u,this,d,v)}_assign(u){u.type=this.type,u.$_root=this.$_root,u.$_temp=Object.assign({},this.$_temp),u.$_temp.whens={},u._ids=this._ids.clone(),u._preferences=this._preferences,u._valids=this._valids&&this._valids.clone(),u._invalids=this._invalids&&this._invalids.clone(),u._rules=this._rules.slice(),u._singleRules=g(this._singleRules,{shallow:!0}),u._refs=this._refs.clone(),u._flags=Object.assign({},this._flags),u._cache=null,u.$_terms={};for(const d in this.$_terms)u.$_terms[d]=this.$_terms[d]?this.$_terms[d].slice():null;u.$_super={};for(const d in this.$_super)u.$_super[d]=this._super[d].bind(u);return u}_bare(){const u=this.clone();u._reset();const d=u._definition.terms;for(const v in d){const E=d[v];u.$_terms[v]=E.init}return u.$_mutateRebuild()}_default(u,d,v={}){return a.assertOptions(v,"literal"),i(d!==void 0,"Missing",u,"value"),i(typeof d=="function"||!v.literal,"Only function value supports literal option"),typeof d=="function"&&v.literal&&(d={[a.symbols.literal]:!0,literal:d}),this.$_setFlag(u,d)}_generate(u,d,v){if(!this.$_terms.whens)return{schema:this};const E=[],k=[];for(let I=0;I<this.$_terms.whens.length;++I){const T=this.$_terms.whens[I];if(T.concat){E.push(T.concat),k.push(`${I}.concat`);continue}const F=T.ref?T.ref.resolve(u,d,v):u,K=T.is?[T]:T.switch,V=k.length;for(let z=0;z<K.length;++z){const{is:P,then:X,otherwise:Z}=K[z],J=`${I}${T.switch?"."+z:""}`;if(P.$_match(F,d.nest(P,`${J}.is`),v)){if(X){const Q=d.localize([...d.path,`${J}.then`],d.ancestors,d.schemas),{schema:ne,id:ie}=X._generate(u,Q,v);E.push(ne),k.push(`${J}.then${ie?`(${ie})`:""}`);break}}else if(Z){const Q=d.localize([...d.path,`${J}.otherwise`],d.ancestors,d.schemas),{schema:ne,id:ie}=Z._generate(u,Q,v);E.push(ne),k.push(`${J}.otherwise${ie?`(${ie})`:""}`);break}}if(T.break&&k.length>V)break}const O=k.join(", ");if(d.mainstay.tracer.debug(d,"rule","when",O),!O)return{schema:this};if(!d.mainstay.tracer.active&&this.$_temp.whens[O])return{schema:this.$_temp.whens[O],id:O};let A=this;this._definition.generate&&(A=this._definition.generate(this,u,d,v));for(const I of E)A=A.concat(I);return this.$_root._tracer&&this.$_root._tracer._combine(A,[this,...E]),this.$_temp.whens[O]=A,{schema:A,id:O}}_inner(u,d,v={}){i(!this._inRuleset(),`Cannot set ${u} inside a ruleset`);const E=this.clone();return E.$_terms[u]&&!v.override||(E.$_terms[u]=[]),v.single?E.$_terms[u].push(d):E.$_terms[u].push(...d),E.$_temp.ruleset=!1,E}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(u,d={}){if(!this._singleRules.has(u))return this;const v=d.clone!==!1?this.clone():this;v._singleRules.delete(u);const E=[];for(let k=0;k<v._rules.length;++k){const O=v._rules[k];O.name!==u||O.keep?E.push(O):v._inRuleset()&&k<v.$_temp.ruleset&&--v.$_temp.ruleset}return v._rules=E,v}_values(u,d){a.verifyFlat(u,d.slice(1,-1));const v=this.clone(),E=u[0]===a.symbols.override;if(E&&(u=u.slice(1)),!v[d]&&u.length?v[d]=new R:E&&(v[d]=u.length?new R:null,v.$_mutateRebuild()),!v[d])return v;E&&v[d].override();for(const k of u){i(k!==void 0,"Cannot call allow/valid/invalid with undefined"),i(k!==a.symbols.override,"Override must be the first value");const O=d==="_invalids"?"_valids":"_invalids";v[O]&&(v[O].remove(k),v[O].length||(i(d==="_valids"||!v._flags.only,"Setting invalid value",k,"leaves schema rejecting all values due to previous valid rule"),v[O]=null)),v[d].add(k,v._refs)}return v}}};_.Base.prototype[a.symbols.any]={version:a.version,compile:n.compile,root:"$_root"},_.Base.prototype.isImmutable=!0,_.Base.prototype.deny=_.Base.prototype.invalid,_.Base.prototype.disallow=_.Base.prototype.invalid,_.Base.prototype.equal=_.Base.prototype.valid,_.Base.prototype.exist=_.Base.prototype.required,_.Base.prototype.not=_.Base.prototype.invalid,_.Base.prototype.options=_.Base.prototype.prefs,_.Base.prototype.preferences=_.Base.prototype.prefs,S.exports=new _.Base},8652:(S,w,p)=>{const i=p(375),g=p(8571),h=p(8160),l={max:1e3,supported:new Set(["undefined","boolean","number","string"])};w.provider={provision:t=>new l.Cache(t)},l.Cache=class{constructor(t={}){h.assertOptions(t,["max"]),i(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||l.max,this._map=new Map,this._list=new l.List}get length(){return this._map.size}set(t,a){if(t!==null&&!l.supported.has(typeof t))return;let n=this._map.get(t);if(n)return n.value=a,void this._list.first(n);n=this._list.unshift({key:t,value:a}),this._map.set(t,n),this._compact()}get(t){const a=this._map.get(t);if(a)return this._list.first(a),g(a.value)}_compact(){if(this._map.size>this._max){const t=this._list.pop();this._map.delete(t.key)}}},l.List=class{constructor(){this.tail=null,this.head=null}unshift(t){return t.next=null,t.prev=this.head,this.head&&(this.head.next=t),this.head=t,this.tail||(this.tail=t),t}first(t){t!==this.head&&(this._remove(t),this.unshift(t))}pop(){return this._remove(this.tail)}_remove(t){const{next:a,prev:n}=t;return a.prev=n,n&&(n.next=a),t===this.tail&&(this.tail=a),t.prev=null,t.next=null,t}}},8160:(S,w,p)=>{const i=p(375),g=p(7916),h=p(5934);let l,t;const a={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};w.version=h.version,w.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},w.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},w.assertOptions=function(n,s,r="Options"){i(n&&typeof n=="object"&&!Array.isArray(n),"Options must be of type object");const c=Object.keys(n).filter(e=>!s.includes(e));i(c.length===0,`${r} contain unknown keys: ${c}`)},w.checkPreferences=function(n){t=t||p(3378);const s=t.preferences.validate(n);if(s.error)throw new g([s.error.details[0].message])},w.compare=function(n,s,r){switch(r){case"=":return n===s;case">":return n>s;case"<":return n<s;case">=":return n>=s;case"<=":return n<=s}},w.default=function(n,s){return n===void 0?s:n},w.isIsoDate=function(n){return a.isoDate.test(n)},w.isNumber=function(n){return typeof n=="number"&&!isNaN(n)},w.isResolvable=function(n){return!!n&&(n[w.symbols.ref]||n[w.symbols.template])},w.isSchema=function(n,s={}){const r=n&&n[w.symbols.any];return!!r&&(i(s.legacy||r.version===w.version,"Cannot mix different versions of joi schemas"),!0)},w.isValues=function(n){return n[w.symbols.values]},w.limit=function(n){return Number.isSafeInteger(n)&&n>=0},w.preferences=function(n,s){l=l||p(6914),n=n||{},s=s||{};const r=Object.assign({},n,s);return s.errors&&n.errors&&(r.errors=Object.assign({},n.errors,s.errors),r.errors.wrap=Object.assign({},n.errors.wrap,s.errors.wrap)),s.messages&&(r.messages=l.compile(s.messages,n.messages)),delete r[w.symbols.prefs],r},w.tryWithPath=function(n,s,r={}){try{return n()}catch(c){throw c.path!==void 0?c.path=s+"."+c.path:c.path=s,r.append&&(c.message=`${c.message} (${c.path})`),c}},w.validateArg=function(n,s,{assert:r,message:c}){if(w.isSchema(r)){const e=r.validate(n);return e.error?e.error.message:void 0}if(!r(n))return s?`${s} ${c}`:c},w.verifyFlat=function(n,s){for(const r of n)i(!Array.isArray(r),"Method no longer accepts array arguments:",s)}},3292:(S,w,p)=>{const i=p(375),g=p(8160),h=p(6133),l={};w.schema=function(t,a,n={}){g.assertOptions(n,["appendPath","override"]);try{return l.schema(t,a,n)}catch(s){throw n.appendPath&&s.path!==void 0&&(s.message=`${s.message} (${s.path})`),s}},l.schema=function(t,a,n){i(a!==void 0,"Invalid undefined schema"),Array.isArray(a)&&(i(a.length,"Invalid empty array schema"),a.length===1&&(a=a[0]));const s=(r,...c)=>n.override!==!1?r.valid(t.override,...c):r.valid(...c);if(l.simple(a))return s(t,a);if(typeof a=="function")return t.custom(a);if(i(typeof a=="object","Invalid schema content:",typeof a),g.isResolvable(a))return s(t,a);if(g.isSchema(a))return a;if(Array.isArray(a)){for(const r of a)if(!l.simple(r))return t.alternatives().try(...a);return s(t,...a)}return a instanceof RegExp?t.string().regex(a):a instanceof Date?s(t.date(),a):(i(Object.getPrototypeOf(a)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(a))},w.ref=function(t,a){return h.isRef(t)?t:h.create(t,a)},w.compile=function(t,a,n={}){g.assertOptions(n,["legacy"]);const s=a&&a[g.symbols.any];if(s)return i(n.legacy||s.version===g.version,"Cannot mix different versions of joi schemas:",s.version,g.version),a;if(typeof a!="object"||!n.legacy)return w.schema(t,a,{appendPath:!0});const r=l.walk(a);return r?r.compile(r.root,a):w.schema(t,a,{appendPath:!0})},l.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(const n of t){const s=l.walk(n);if(s)return s}return null}const a=t[g.symbols.any];if(a)return{root:t[a.root],compile:a.compile};i(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const n in t){const s=l.walk(t[n]);if(s)return s}return null},l.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)},w.when=function(t,a,n){if(n===void 0&&(i(a&&typeof a=="object","Missing options"),n=a,a=h.create(".")),Array.isArray(n)&&(n={switch:n}),g.assertOptions(n,["is","not","then","otherwise","switch","break"]),g.isSchema(a))return i(n.is===void 0,'"is" can not be used with a schema condition'),i(n.not===void 0,'"not" can not be used with a schema condition'),i(n.switch===void 0,'"switch" can not be used with a schema condition'),l.condition(t,{is:a,then:n.then,otherwise:n.otherwise,break:n.break});if(i(h.isRef(a)||typeof a=="string","Invalid condition:",a),i(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let r=n;n.not!==void 0&&(r={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let c=r.is!==void 0?t.$_compile(r.is):t.$_root.invalid(null,!1,0,"").required();return i(r.then!==void 0||r.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),i(r.break===void 0||r.then===void 0||r.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is===void 0||h.isRef(n.is)||g.isSchema(n.is)||(c=c.required()),l.condition(t,{ref:w.ref(a),is:c,then:r.then,otherwise:r.otherwise,break:r.break})}i(Array.isArray(n.switch),'"switch" must be an array'),i(n.is===void 0,'Cannot combine "switch" with "is"'),i(n.not===void 0,'Cannot combine "switch" with "not"'),i(n.then===void 0,'Cannot combine "switch" with "then"');const s={ref:w.ref(a),switch:[],break:n.break};for(let r=0;r<n.switch.length;++r){const c=n.switch[r],e=r===n.switch.length-1;g.assertOptions(c,e?["is","then","otherwise"]:["is","then"]),i(c.is!==void 0,'Switch statement missing "is"'),i(c.then!==void 0,'Switch statement missing "then"');const o={is:t.$_compile(c.is),then:t.$_compile(c.then)};if(h.isRef(c.is)||g.isSchema(c.is)||(o.is=o.is.required()),e){i(n.otherwise===void 0||c.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const f=n.otherwise!==void 0?n.otherwise:c.otherwise;f!==void 0&&(i(s.break===void 0,"Cannot specify both otherwise and break"),o.otherwise=t.$_compile(f))}s.switch.push(o)}return s},l.condition=function(t,a){for(const n of["then","otherwise"])a[n]===void 0?delete a[n]:a[n]=t.$_compile(a[n]);return a}},6354:(S,w,p)=>{const i=p(5688),g=p(8160),h=p(3328);w.Report=class{constructor(l,t,a,n,s,r,c){if(this.code=l,this.flags=n,this.messages=s,this.path=r.path,this.prefs=c,this.state=r,this.value=t,this.message=null,this.template=null,this.local=a||{},this.local.label=w.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const e=this.path[this.path.length-1];typeof e!="object"&&(this.local.key=e)}}_setTemplate(l){if(this.template=l,!this.flags.label&&this.path.length===0){const t=this._template(this.template,"root");t&&(this.local.label=t)}}toString(){if(this.message)return this.message;const l=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return t===void 0?`Error code "${l}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(l,t){return w.template(this.value,l,t||this.code,this.state,this.prefs)}},w.path=function(l){let t="";for(const a of l)typeof a!="object"&&(typeof a=="string"?(t&&(t+="."),t+=a):t+=`[${a}]`);return t},w.template=function(l,t,a,n,s){if(!t)return;if(h.isTemplate(t))return a!=="root"?t:null;let r=s.errors.language;if(g.isResolvable(r)&&(r=r.resolve(l,n,s)),r&&t[r]){if(t[r][a]!==void 0)return t[r][a];if(t[r]["*"]!==void 0)return t[r]["*"]}return t[a]?t[a]:t["*"]},w.label=function(l,t,a,n){if(l.label)return l.label;if(!a.errors.label)return"";let s=t.path;return a.errors.label==="key"&&t.path.length>1&&(s=t.path.slice(-1)),w.path(s)||w.template(null,a.messages,"root",t,a)||n&&w.template(null,n,"root",t,a)||"value"},w.process=function(l,t,a){if(!l)return null;const{override:n,message:s,details:r}=w.details(l);if(n)return n;if(a.errors.stack)return new w.ValidationError(s,r,t);const c=Error.stackTraceLimit;Error.stackTraceLimit=0;const e=new w.ValidationError(s,r,t);return Error.stackTraceLimit=c,e},w.details=function(l,t={}){let a=[];const n=[];for(const s of l){if(s instanceof Error){if(t.override!==!1)return{override:s};const c=s.toString();a.push(c),n.push({message:c,type:"override",context:{error:s}});continue}const r=s.toString();a.push(r),n.push({message:r,path:s.path.filter(c=>typeof c!="object"),type:s.code,context:s.local})}return a.length>1&&(a=[...new Set(a)]),{message:a.join(". "),details:n}},w.ValidationError=class extends Error{constructor(l,t,a){super(l),this._original=a,this.details=t}static isError(l){return l instanceof w.ValidationError}},w.ValidationError.prototype.isJoi=!0,w.ValidationError.prototype.name="ValidationError",w.ValidationError.prototype.annotate=i.error},8901:(S,w,p)=>{const i=p(375),g=p(8571),h=p(8160),l=p(6914),t={};w.type=function(a,n){const s=Object.getPrototypeOf(a),r=g(s),c=a._assign(Object.create(r)),e=Object.assign({},n);delete e.base,r._definition=e;const o=s._definition||{};e.messages=l.merge(o.messages,e.messages),e.properties=Object.assign({},o.properties,e.properties),c.type=e.type,e.flags=Object.assign({},o.flags,e.flags);const f=Object.assign({},o.terms);if(e.terms)for(const _ in e.terms){const u=e.terms[_];i(c.$_terms[_]===void 0,"Invalid term override for",e.type,_),c.$_terms[_]=u.init,f[_]=u}e.terms=f,e.args||(e.args=o.args),e.prepare=t.prepare(e.prepare,o.prepare),e.coerce&&(typeof e.coerce=="function"&&(e.coerce={method:e.coerce}),e.coerce.from&&!Array.isArray(e.coerce.from)&&(e.coerce={method:e.coerce.method,from:[].concat(e.coerce.from)})),e.coerce=t.coerce(e.coerce,o.coerce),e.validate=t.validate(e.validate,o.validate);const m=Object.assign({},o.rules);if(e.rules)for(const _ in e.rules){const u=e.rules[_];i(typeof u=="object","Invalid rule definition for",e.type,_);let d=u.method;if(d===void 0&&(d=function(){return this.$_addRule(_)}),d&&(i(!r[_],"Rule conflict in",e.type,_),r[_]=d),i(!m[_],"Rule conflict in",e.type,_),m[_]=u,u.alias){const v=[].concat(u.alias);for(const E of v)r[E]=u.method}u.args&&(u.argsByName=new Map,u.args=u.args.map(v=>(typeof v=="string"&&(v={name:v}),i(!u.argsByName.has(v.name),"Duplicated argument name",v.name),h.isSchema(v.assert)&&(v.assert=v.assert.strict().label(v.name)),u.argsByName.set(v.name,v),v)))}e.rules=m;const y=Object.assign({},o.modifiers);if(e.modifiers)for(const _ in e.modifiers){i(!r[_],"Rule conflict in",e.type,_);const u=e.modifiers[_];i(typeof u=="function","Invalid modifier definition for",e.type,_);const d=function(v){return this.rule({[_]:v})};r[_]=d,y[_]=u}if(e.modifiers=y,e.overrides){r._super=s,c.$_super={};for(const _ in e.overrides)i(s[_],"Cannot override missing",_),e.overrides[_][h.symbols.parent]=s[_],c.$_super[_]=s[_].bind(c);Object.assign(r,e.overrides)}e.cast=Object.assign({},o.cast,e.cast);const R=Object.assign({},o.manifest,e.manifest);return R.build=t.build(e.manifest&&e.manifest.build,o.manifest&&o.manifest.build),e.manifest=R,e.rebuild=t.rebuild(e.rebuild,o.rebuild),c},t.build=function(a,n){return a&&n?function(s,r){return n(a(s,r),r)}:a||n},t.coerce=function(a,n){return a&&n?{from:a.from&&n.from?[...new Set([...a.from,...n.from])]:null,method(s,r){let c;if((!n.from||n.from.includes(typeof s))&&(c=n.method(s,r),c)){if(c.errors||c.value===void 0)return c;s=c.value}if(!a.from||a.from.includes(typeof s)){const e=a.method(s,r);if(e)return e}return c}}:a||n},t.prepare=function(a,n){return a&&n?function(s,r){const c=a(s,r);if(c){if(c.errors||c.value===void 0)return c;s=c.value}return n(s,r)||c}:a||n},t.rebuild=function(a,n){return a&&n?function(s){n(s),a(s)}:a||n},t.validate=function(a,n){return a&&n?function(s,r){const c=n(s,r);if(c){if(c.errors&&(!Array.isArray(c.errors)||c.errors.length))return c;s=c.value}return a(s,r)||c}:a||n}},5107:(S,w,p)=>{const i=p(375),g=p(8571),h=p(8652),l=p(8160),t=p(3292),a=p(6354),n=p(8901),s=p(9708),r=p(6133),c=p(3328),e=p(1152);let o;const f={types:{alternatives:p(4946),any:p(8068),array:p(546),boolean:p(4937),date:p(7500),function:p(390),link:p(8785),number:p(3832),object:p(8966),string:p(7417),symbol:p(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const m={_types:new Set(Object.keys(f.types))};for(const y of m._types)m[y]=function(...R){return i(!R.length||["alternatives","link","object"].includes(y),"The",y,"type does not allow arguments"),f.generate(this,f.types[y],R)};for(const y of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])m[y]=function(...R){return this.any()[y](...R)};Object.assign(m,f.methods);for(const y in f.aliases){const R=f.aliases[y];m[y]=m[R]}return m.x=m.expression,e.setup&&e.setup(m),m}};f.methods={ValidationError:a.ValidationError,version:l.version,cache:h.provider,assert(m,y,...R){f.assert(m,y,!0,R)},attempt:(m,y,...R)=>f.assert(m,y,!1,R),build(m){return i(typeof s.build=="function","Manifest functionality disabled"),s.build(this,m)},checkPreferences(m){l.checkPreferences(m)},compile(m,y){return t.compile(this,m,y)},defaults(m){i(typeof m=="function","modifier must be a function");const y=Object.assign({},this);for(const R of y._types){const _=m(y[R]());i(l.isSchema(_),"modifier must return a valid schema object"),y[R]=function(...u){return f.generate(this,_,u)}}return y},expression:(...m)=>new c(...m),extend(...m){l.verifyFlat(m,"extend"),o=o||p(3378),i(m.length,"You need to provide at least one extension"),this.assert(m,o.extensions);const y=Object.assign({},this);y._types=new Set(y._types);for(let R of m){typeof R=="function"&&(R=R(y)),this.assert(R,o.extension);const _=f.expandExtension(R,y);for(const u of _){i(y[u.type]===void 0||y._types.has(u.type),"Cannot override name",u.type);const d=u.base||this.any(),v=n.type(d,u);y._types.add(u.type),y[u.type]=function(...E){return f.generate(this,v,E)}}}return y},isError:a.ValidationError.isError,isExpression:c.isTemplate,isRef:r.isRef,isSchema:l.isSchema,in:(...m)=>r.in(...m),override:l.symbols.override,ref:(...m)=>r.create(...m),types(){const m={};for(const y of this._types)m[y]=this[y]();for(const y in f.aliases)m[y]=this[y]();return m}},f.assert=function(m,y,R,_){const u=_[0]instanceof Error||typeof _[0]=="string"?_[0]:null,d=u!==null?_[1]:_[0],v=y.validate(m,l.preferences({errors:{stack:!0}},d||{}));let E=v.error;if(!E)return v.value;if(u instanceof Error)throw u;const k=R&&typeof E.annotate=="function"?E.annotate():E.message;throw E instanceof a.ValidationError==0&&(E=g(E)),E.message=u?`${u} ${k}`:k,E},f.generate=function(m,y,R){return i(m,"Must be invoked on a Joi instance."),y.$_root=m,y._definition.args&&R.length?y._definition.args(y,...R):y},f.expandExtension=function(m,y){if(typeof m.type=="string")return[m];const R=[];for(const _ of y._types)if(m.type.test(_)){const u=Object.assign({},m);u.type=_,u.base=y[_](),R.push(u)}return R},S.exports=f.root()},6914:(S,w,p)=>{const i=p(375),g=p(8571),h=p(3328);w.compile=function(l,t){if(typeof l=="string")return i(!t,"Cannot set single message string"),new h(l);if(h.isTemplate(l))return i(!t,"Cannot set single message template"),l;i(typeof l=="object"&&!Array.isArray(l),"Invalid message options"),t=t?g(t):{};for(let a in l){const n=l[a];if(a==="root"||h.isTemplate(n)){t[a]=n;continue}if(typeof n=="string"){t[a]=new h(n);continue}i(typeof n=="object"&&!Array.isArray(n),"Invalid message for",a);const s=a;for(a in t[s]=t[s]||{},n){const r=n[a];a==="root"||h.isTemplate(r)?t[s][a]=r:(i(typeof r=="string","Invalid message for",a,"in",s),t[s][a]=new h(r))}}return t},w.decompile=function(l){const t={};for(let a in l){const n=l[a];if(a==="root"){t.root=n;continue}if(h.isTemplate(n)){t[a]=n.describe({compact:!0});continue}const s=a;for(a in t[s]={},n){const r=n[a];a!=="root"?t[s][a]=r.describe({compact:!0}):t[s].root=r}}return t},w.merge=function(l,t){if(!l)return w.compile(t);if(!t)return l;if(typeof t=="string")return new h(t);if(h.isTemplate(t))return t;const a=g(l);for(let n in t){const s=t[n];if(n==="root"||h.isTemplate(s)){a[n]=s;continue}if(typeof s=="string"){a[n]=new h(s);continue}i(typeof s=="object"&&!Array.isArray(s),"Invalid message for",n);const r=n;for(n in a[r]=a[r]||{},s){const c=s[n];n==="root"||h.isTemplate(c)?a[r][n]=c:(i(typeof c=="string","Invalid message for",n,"in",r),a[r][n]=new h(c))}}return a}},2294:(S,w,p)=>{const i=p(375),g=p(8160),h=p(6133),l={};w.Ids=l.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const t=new l.Ids;return t._byId=new Map(this._byId),t._byKey=new Map(this._byKey),t._schemaChain=this._schemaChain,t}concat(t){t._schemaChain&&(this._schemaChain=!0);for(const[a,n]of t._byId.entries())i(!this._byKey.has(a),"Schema id conflicts with existing key:",a),this._byId.set(a,n);for(const[a,n]of t._byKey.entries())i(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,n)}fork(t,a,n){const s=this._collect(t);s.push({schema:n});const r=s.shift();let c={id:r.id,schema:a(r.schema)};i(g.isSchema(c.schema),"adjuster function failed to return a joi schema type");for(const e of s)c={id:e.id,schema:l.fork(e.schema,c.id,c.schema)};return c.schema}labels(t,a=[]){const n=t[0],s=this._get(n);if(!s)return[...a,...t].join(".");const r=t.slice(1);return a=[...a,s.schema._flags.label||n],r.length?s.schema._ids.labels(r,a):a.join(".")}reach(t,a=[]){const n=t[0],s=this._get(n);i(s,"Schema does not contain path",[...a,...t].join("."));const r=t.slice(1);return r.length?s.schema._ids.reach(r,[...a,n]):s.schema}register(t,{key:a}={}){if(!t||!g.isSchema(t))return;(t.$_property("schemaChain")||t._ids._schemaChain)&&(this._schemaChain=!0);const n=t._flags.id;if(n){const s=this._byId.get(n);i(!s||s.schema===t,"Cannot add different schemas with the same id:",n),i(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}a&&(i(!this._byKey.has(a),"Schema already contains key:",a),i(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,{schema:t,id:a}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(t,a=[],n=[]){const s=t[0],r=this._get(s);i(r,"Schema does not contain path",[...a,...t].join(".")),n=[r,...n];const c=t.slice(1);return c.length?r.schema._ids._collect(c,[...a,s],n):n}_get(t){return this._byId.get(t)||this._byKey.get(t)}},l.fork=function(t,a,n){const s=w.schema(t,{each:(r,{key:c})=>{if(a===(r._flags.id||c))return n},ref:!1});return s?s.$_mutateRebuild():t},w.schema=function(t,a){let n;for(const s in t._flags){if(s[0]==="_")continue;const r=l.scan(t._flags[s],{source:"flags",name:s},a);r!==void 0&&(n=n||t.clone(),n._flags[s]=r)}for(let s=0;s<t._rules.length;++s){const r=t._rules[s],c=l.scan(r.args,{source:"rules",name:r.name},a);if(c!==void 0){n=n||t.clone();const e=Object.assign({},r);e.args=c,n._rules[s]=e,n._singleRules.get(r.name)===r&&n._singleRules.set(r.name,e)}}for(const s in t.$_terms){if(s[0]==="_")continue;const r=l.scan(t.$_terms[s],{source:"terms",name:s},a);r!==void 0&&(n=n||t.clone(),n.$_terms[s]=r)}return n},l.scan=function(t,a,n,s,r){const c=s||[];if(t===null||typeof t!="object")return;let e;if(Array.isArray(t)){for(let o=0;o<t.length;++o){const f=a.source==="terms"&&a.name==="keys"&&t[o].key,m=l.scan(t[o],a,n,[o,...c],f);m!==void 0&&(e=e||t.slice(),e[o]=m)}return e}if(n.schema!==!1&&g.isSchema(t)||n.ref!==!1&&h.isRef(t)){const o=n.each(t,{...a,path:c,key:r});return o===t?void 0:o}for(const o in t){if(o[0]==="_")continue;const f=l.scan(t[o],a,n,[o,...c],r);f!==void 0&&(e=e||Object.assign({},t),e[o]=f)}return e}},6133:(S,w,p)=>{const i=p(375),g=p(8571),h=p(9621),l=p(8160);let t;const a={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};w.create=function(n,s={}){i(typeof n=="string","Invalid reference key:",n),l.assertOptions(s,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),i(!s.prefix||typeof s.prefix=="object","options.prefix must be of type object");const r=Object.assign({},a.defaults,s);delete r.prefix;const c=r.separator,e=a.context(n,c,s.prefix);if(r.type=e.type,n=e.key,r.type==="value")if(e.root&&(i(!c||n[0]!==c,"Cannot specify relative path with root prefix"),r.ancestor="root",n||(n=null)),c&&c===n)n=null,r.ancestor=0;else if(r.ancestor!==void 0)i(!c||!n||n[0]!==c,"Cannot combine prefix with ancestor option");else{const[o,f]=a.ancestor(n,c);f&&(n=n.slice(f))===""&&(n=null),r.ancestor=o}return r.path=c?n===null?[]:n.split(c):[n],new a.Ref(r)},w.in=function(n,s={}){return w.create(n,{...s,in:!0})},w.isRef=function(n){return!!n&&!!n[l.symbols.ref]},a.Ref=class{constructor(n){i(typeof n=="object","Invalid reference construction"),l.assertOptions(n,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),i([!1,void 0].includes(n.separator)||typeof n.separator=="string"&&n.separator.length===1,"Invalid separator"),i(!n.adjust||typeof n.adjust=="function","options.adjust must be a function"),i(!n.map||Array.isArray(n.map),"options.map must be an array"),i(!n.map||!n.adjust,"Cannot set both map and adjust options"),Object.assign(this,a.defaults,n),i(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(n,s,r,c,e={}){return i(!this.in||e.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(r.context,s,e):this.type==="local"?this._resolve(c,s,e):this.ancestor?this.ancestor==="root"?this._resolve(s.ancestors[s.ancestors.length-1],s,e):(i(this.ancestor<=s.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(s.ancestors[this.ancestor-1],s,e)):this._resolve(n,s,e)}_resolve(n,s,r){let c;if(this.type==="value"&&s.mainstay.shadow&&r.shadow!==!1&&(c=s.mainstay.shadow.get(this.absolute(s))),c===void 0&&(c=h(n,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(c=this.adjust(c)),this.map){const e=this.map.get(c);e!==void 0&&(c=e)}return s.mainstay&&s.mainstay.tracer.resolve(s,this,c),c}toString(){return this.display}absolute(n){return[...n.path.slice(0,-this.ancestor),...this.path]}clone(){return new a.Ref(this)}describe(){const n={path:this.path};this.type!=="value"&&(n.type=this.type),this.separator!=="."&&(n.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(n.ancestor=this.ancestor),this.map&&(n.map=[...this.map]);for(const s of["adjust","iterables","render"])this[s]!==null&&this[s]!==void 0&&(n[s]=this[s]);return this.in!==!1&&(n.in=!0),{ref:n}}updateDisplay(){const n=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${n}`);if(!this.separator)return void(this.display=`ref:${n}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${n}`);if(this.ancestor==="root")return void(this.display=`ref:root:${n}`);if(this.ancestor===1)return void(this.display=`ref:${n||".."}`);const s=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${s}${n||""}`}},a.Ref.prototype[l.symbols.ref]=!0,w.build=function(n){return(n=Object.assign({},a.defaults,n)).type==="value"&&n.ancestor===void 0&&(n.ancestor=1),new a.Ref(n)},a.context=function(n,s,r={}){if(n=n.trim(),r){const c=r.global===void 0?"$":r.global;if(c!==s&&n.startsWith(c))return{key:n.slice(c.length),type:"global"};const e=r.local===void 0?"#":r.local;if(e!==s&&n.startsWith(e))return{key:n.slice(e.length),type:"local"};const o=r.root===void 0?"/":r.root;if(o!==s&&n.startsWith(o))return{key:n.slice(o.length),type:"value",root:!0}}return{key:n,type:"value"}},a.ancestor=function(n,s){if(!s)return[1,0];if(n[0]!==s)return[1,0];if(n[1]!==s)return[0,1];let r=2;for(;n[r]===s;)++r;return[r-1,r]},w.toSibling=0,w.toParent=1,w.Manager=class{constructor(){this.refs=[]}register(n,s){if(n)if(s=s===void 0?w.toParent:s,Array.isArray(n))for(const r of n)this.register(r,s);else if(l.isSchema(n))for(const r of n._refs.refs)r.ancestor-s>=0&&this.refs.push({ancestor:r.ancestor-s,root:r.root});else w.isRef(n)&&n.type==="value"&&n.ancestor-s>=0&&this.refs.push({ancestor:n.ancestor-s,root:n.root}),t=t||p(3328),t.isTemplate(n)&&this.register(n.refs(),s)}get length(){return this.refs.length}clone(){const n=new w.Manager;return n.refs=g(this.refs),n}reset(){this.refs=[]}roots(){return this.refs.filter(n=>!n.ancestor).map(n=>n.root)}}},3378:(S,w,p)=>{const i=p(5107),g={};g.wrap=i.string().min(1).max(2).allow(!1),w.preferences=i.object({allowUnknown:i.boolean(),abortEarly:i.boolean(),artifacts:i.boolean(),cache:i.boolean(),context:i.object(),convert:i.boolean(),dateFormat:i.valid("date","iso","string","time","utc"),debug:i.boolean(),errors:{escapeHtml:i.boolean(),label:i.valid("path","key",!1),language:[i.string(),i.object().ref()],render:i.boolean(),stack:i.boolean(),wrap:{label:g.wrap,array:g.wrap,string:g.wrap}},externals:i.boolean(),messages:i.object(),noDefaults:i.boolean(),nonEnumerables:i.boolean(),presence:i.valid("required","optional","forbidden"),skipFunctions:i.boolean(),stripUnknown:i.object({arrays:i.boolean(),objects:i.boolean()}).or("arrays","objects").allow(!0,!1),warnings:i.boolean()}).strict(),g.nameRx=/^[a-zA-Z0-9]\w*$/,g.rule=i.object({alias:i.array().items(i.string().pattern(g.nameRx)).single(),args:i.array().items(i.string(),i.object({name:i.string().pattern(g.nameRx).required(),ref:i.boolean(),assert:i.alternatives([i.function(),i.object().schema()]).conditional("ref",{is:!0,then:i.required()}),normalize:i.function(),message:i.string().when("assert",{is:i.function(),then:i.required()})})),convert:i.boolean(),manifest:i.boolean(),method:i.function().allow(!1),multi:i.boolean(),validate:i.function()}),w.extension=i.object({type:i.alternatives([i.string(),i.object().regex()]).required(),args:i.function(),cast:i.object().pattern(g.nameRx,i.object({from:i.function().maxArity(1).required(),to:i.function().minArity(1).maxArity(2).required()})),base:i.object().schema().when("type",{is:i.object().regex(),then:i.forbidden()}),coerce:[i.function().maxArity(3),i.object({method:i.function().maxArity(3).required(),from:i.array().items(i.string()).single()})],flags:i.object().pattern(g.nameRx,i.object({setter:i.string(),default:i.any()})),manifest:{build:i.function().arity(2)},messages:[i.object(),i.string()],modifiers:i.object().pattern(g.nameRx,i.function().minArity(1).maxArity(2)),overrides:i.object().pattern(g.nameRx,i.function()),prepare:i.function().maxArity(3),rebuild:i.function().arity(1),rules:i.object().pattern(g.nameRx,g.rule),terms:i.object().pattern(g.nameRx,i.object({init:i.array().allow(null).required(),manifest:i.object().pattern(/.+/,[i.valid("schema","single"),i.object({mapped:i.object({from:i.string().required(),to:i.string().required()}).required()})])})),validate:i.function().maxArity(3)}).strict(),w.extensions=i.array().items(i.object(),i.function().arity(1)).strict(),g.desc={buffer:i.object({buffer:i.string()}),func:i.object({function:i.function().required(),options:{literal:!0}}),override:i.object({override:!0}),ref:i.object({ref:i.object({type:i.valid("value","global","local"),path:i.array().required(),separator:i.string().length(1).allow(!1),ancestor:i.number().min(0).integer().allow("root"),map:i.array().items(i.array().length(2)).min(1),adjust:i.function(),iterables:i.boolean(),in:i.boolean(),render:i.boolean()}).required()}),regex:i.object({regex:i.string().min(3)}),special:i.object({special:i.valid("deep").required()}),template:i.object({template:i.string().required(),options:i.object()}),value:i.object({value:i.alternatives([i.object(),i.array()]).required()})},g.desc.entity=i.alternatives([i.array().items(i.link("...")),i.boolean(),i.function(),i.number(),i.string(),g.desc.buffer,g.desc.func,g.desc.ref,g.desc.regex,g.desc.special,g.desc.template,g.desc.value,i.link("/")]),g.desc.values=i.array().items(null,i.boolean(),i.function(),i.number().allow(1/0,-1/0),i.string().allow(""),i.symbol(),g.desc.buffer,g.desc.func,g.desc.override,g.desc.ref,g.desc.regex,g.desc.template,g.desc.value),g.desc.messages=i.object().pattern(/.+/,[i.string(),g.desc.template,i.object().pattern(/.+/,[i.string(),g.desc.template])]),w.description=i.object({type:i.string().required(),flags:i.object({cast:i.string(),default:i.any(),description:i.string(),empty:i.link("/"),failover:g.desc.entity,id:i.string(),label:i.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:i.boolean(),unit:i.string()}).unknown(),preferences:{allowUnknown:i.boolean(),abortEarly:i.boolean(),artifacts:i.boolean(),cache:i.boolean(),convert:i.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:i.boolean(),label:["path","key"],language:[i.string(),g.desc.ref],wrap:{label:g.wrap,array:g.wrap}},externals:i.boolean(),messages:g.desc.messages,noDefaults:i.boolean(),nonEnumerables:i.boolean(),presence:["required","optional","forbidden"],skipFunctions:i.boolean(),stripUnknown:i.object({arrays:i.boolean(),objects:i.boolean()}).or("arrays","objects").allow(!0,!1),warnings:i.boolean()},allow:g.desc.values,invalid:g.desc.values,rules:i.array().min(1).items({name:i.string().required(),args:i.object().min(1),keep:i.boolean(),message:[i.string(),g.desc.messages],warn:i.boolean()}),keys:i.object().pattern(/.*/,i.link("/")),link:g.desc.ref}).pattern(/^[a-z]\w*$/,i.any())},493:(S,w,p)=>{const i=p(8571),g=p(9621),h=p(8160),l={value:Symbol("value")};S.exports=l.State=class{constructor(t,a,n){this.path=t,this.ancestors=a,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(t,a=null,n=null){const s=new l.State(t,a,this);return n&&s.schemas&&(s.schemas=[l.schemas(n),...s.schemas]),s}nest(t,a){const n=new l.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[l.schemas(t),...n.schemas],n.debug=a,n}shadow(t,a){this.mainstay.shadow=this.mainstay.shadow||new l.Shadow,this.mainstay.shadow.set(this.path,t,a)}snapshot(){this.mainstay.shadow&&(this._snapshot=i(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},l.schemas=function(t){return h.isSchema(t)?{schema:t}:t},l.Shadow=class{constructor(){this._values=null}set(t,a,n){if(!t.length||n==="strip"&&typeof t[t.length-1]=="number")return;this._values=this._values||new Map;let s=this._values;for(let r=0;r<t.length;++r){const c=t[r];let e=s.get(c);e||(e=new Map,s.set(c,e)),s=e}s[l.value]=a}get(t){const a=this.node(t);if(a)return a[l.value]}node(t){if(this._values)return g(this._values,t,{iterables:!0})}override(t,a){if(!this._values)return;const n=t.slice(0,-1),s=t[t.length-1],r=g(this._values,n,{iterables:!0});a?r.set(s,a):r&&r.delete(s)}}},3328:(S,w,p)=>{const i=p(375),g=p(8571),h=p(5277),l=p(1447),t=p(8160),a=p(6354),n=p(6133),s={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};S.exports=s.Template=class{constructor(r,c){if(i(typeof r=="string","Template source must be a string"),i(!r.includes("\0")&&!r.includes(""),"Template source cannot contain reserved control characters"),this.source=r,this.rendered=r,this._template=null,c){const{functions:e,...o}=c;this._settings=Object.keys(o).length?g(o):void 0,this._functions=e,this._functions&&(i(Object.keys(this._functions).every(f=>typeof f=="string"),"Functions keys must be strings"),i(Object.values(this._functions).every(f=>typeof f=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const r=s.encode(this.source),c=s.split(r);let e=!1;const o=[],f=c.shift();f&&o.push(f);for(const m of c){const y=m[0]!=="{",R=y?"}":"}}",_=m.indexOf(R);if(_===-1||m[1]==="{"){o.push(`{${s.decode(m)}`);continue}let u=m.slice(y?0:1,_);const d=u[0]===":";d&&(u=u.slice(1));const v=this._ref(s.decode(u),{raw:y,wrapped:d});o.push(v),typeof v!="string"&&(e=!0);const E=m.slice(_+R.length);E&&o.push(s.decode(E))}e?this._template=o:this.rendered=o.join("")}static date(r,c){return s.dateFormat[c.dateFormat].call(r)}describe(r={}){if(!this._settings&&r.compact)return this.source;const c={template:this.source};return this._settings&&(c.options=this._settings),this._functions&&(c.functions=this._functions),c}static build(r){return new s.Template(r.template,r.options||r.functions?{...r.options,functions:r.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(r){return!!r&&!!r[t.symbols.template]}refs(){if(!this._template)return;const r=[];for(const c of this._template)typeof c!="string"&&r.push(...c.refs);return r}resolve(r,c,e,o){return this._template&&this._template.length===1?this._part(this._template[0],r,c,e,o,{}):this.render(r,c,e,o)}_part(r,...c){return r.ref?r.ref.resolve(...c):r.formula.evaluate(c)}render(r,c,e,o,f={}){if(!this.isDynamic())return this.rendered;const m=[];for(const y of this._template)if(typeof y=="string")m.push(y);else{const R=this._part(y,r,c,e,o,f),_=s.stringify(R,r,c,e,o,f);if(_!==void 0){const u=y.raw||(f.errors&&f.errors.escapeHtml)===!1?_:h(_);m.push(s.wrap(u,y.wrapped&&e.errors.wrap.label))}}return m.join("")}_ref(r,{raw:c,wrapped:e}){const o=[],f=y=>{const R=n.create(y,this._settings);return o.push(R),_=>{const u=R.resolve(..._);return u!==void 0?u:null}};try{const y=this._functions?{...s.functions,...this._functions}:s.functions;var m=new l.Parser(r,{reference:f,functions:y,constants:s.constants})}catch(y){throw y.message=`Invalid template variable "${r}" fails due to: ${y.message}`,y}if(m.single){if(m.single.type==="reference"){const y=o[0];return{ref:y,raw:c,refs:o,wrapped:e||y.type==="local"&&y.key==="label"}}return s.stringify(m.single.value)}return{formula:m,raw:c,refs:o}}toString(){return this.source}},s.Template.prototype[t.symbols.template]=!0,s.Template.prototype.isImmutable=!0,s.encode=function(r){return r.replace(/\\(\{+)/g,(c,e)=>s.opens.slice(0,e.length)).replace(/\\(\}+)/g,(c,e)=>s.closes.slice(0,e.length))},s.decode=function(r){return r.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},s.split=function(r){const c=[];let e="";for(let o=0;o<r.length;++o){const f=r[o];if(f==="{"){let m="";for(;o+1<r.length&&r[o+1]==="{";)m+="{",++o;c.push(e),e=m}else e+=f}return c.push(e),c},s.wrap=function(r,c){return c?c.length===1?`${c}${r}${c}`:`${c[0]}${r}${c[1]}`:r},s.stringify=function(r,c,e,o,f,m={}){const y=typeof r,R=o&&o.errors&&o.errors.wrap||{};let _=!1;if(n.isRef(r)&&r.render&&(_=r.in,r=r.resolve(c,e,o,f,{in:r.in,...m})),r===null)return"null";if(y==="string")return s.wrap(r,m.arrayItems&&R.string);if(y==="number"||y==="function"||y==="symbol")return r.toString();if(y!=="object")return JSON.stringify(r);if(r instanceof Date)return s.Template.date(r,o);if(r instanceof Map){const d=[];for(const[v,E]of r.entries())d.push(`${v.toString()} -> ${E.toString()}`);r=d}if(!Array.isArray(r))return r.toString();const u=[];for(const d of r)u.push(s.stringify(d,c,e,o,f,{arrayItems:!0,...m}));return s.wrap(u.join(", "),!_&&R.array)},s.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},s.functions={if:(r,c,e)=>r?c:e,length:r=>typeof r=="string"?r.length:r&&typeof r=="object"?Array.isArray(r)?r.length:Object.keys(r).length:null,msg(r){const[c,e,o,f,m]=this,y=m.messages;if(!y)return"";const R=a.template(c,y[0],r,e,o)||a.template(c,y[1],r,e,o);return R?R.render(c,e,o,f,m):""},number:r=>typeof r=="number"?r:typeof r=="string"?parseFloat(r):typeof r=="boolean"?r?1:0:r instanceof Date?r.getTime():null}},4946:(S,w,p)=>{const i=p(375),g=p(1687),h=p(8068),l=p(8160),t=p(3292),a=p(6354),n=p(6133),s={};S.exports=h.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:n.toSibling}},args:(r,...c)=>c.length===1&&Array.isArray(c[0])?r.try(...c[0]):r.try(...c),validate(r,c){const{schema:e,error:o,state:f,prefs:m}=c;if(e._flags.match){const R=[],_=[];for(let d=0;d<e.$_terms.matches.length;++d){const v=e.$_terms.matches[d],E=f.nest(v.schema,`match.${d}`);E.snapshot();const k=v.schema.$_validate(r,E,m);k.errors?(_.push(k.errors),E.restore()):(R.push(k.value),E.commit())}if(R.length===0)return{errors:o("alternatives.any",{details:_.map(d=>a.details(d,{override:!1}))})};if(e._flags.match==="one")return R.length===1?{value:R[0]}:{errors:o("alternatives.one")};if(R.length!==e.$_terms.matches.length)return{errors:o("alternatives.all",{details:_.map(d=>a.details(d,{override:!1}))})};const u=d=>d.$_terms.matches.some(v=>v.schema.type==="object"||v.schema.type==="alternatives"&&u(v.schema));return u(e)?{value:R.reduce((d,v)=>g(d,v,{mergeArrays:!1}))}:{value:R[R.length-1]}}const y=[];for(let R=0;R<e.$_terms.matches.length;++R){const _=e.$_terms.matches[R];if(_.schema){const v=f.nest(_.schema,`match.${R}`);v.snapshot();const E=_.schema.$_validate(r,v,m);if(!E.errors)return v.commit(),E;v.restore(),y.push({schema:_.schema,reports:E.errors});continue}const u=_.ref?_.ref.resolve(r,f,m):r,d=_.is?[_]:_.switch;for(let v=0;v<d.length;++v){const E=d[v],{is:k,then:O,otherwise:A}=E,I=`match.${R}${_.switch?"."+v:""}`;if(k.$_match(u,f.nest(k,`${I}.is`),m)){if(O)return O.$_validate(r,f.nest(O,`${I}.then`),m)}else if(A)return A.$_validate(r,f.nest(A,`${I}.otherwise`),m)}}return s.errors(y,c)},rules:{conditional:{method(r,c){i(!this._flags._endedSwitch,"Unreachable condition"),i(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),i(c.break===void 0,"Cannot use break option with alternatives conditional");const e=this.clone(),o=t.when(e,r,c),f=o.is?[o]:o.switch;for(const m of f)if(m.then&&m.otherwise){e.$_setFlag("_endedSwitch",!0,{clone:!1});break}return e.$_terms.matches.push(o),e.$_mutateRebuild()}},match:{method(r){if(i(["any","one","all"].includes(r),"Invalid alternatives match mode",r),r!=="any")for(const c of this.$_terms.matches)i(c.schema,"Cannot combine match mode",r,"with conditional rules");return this.$_setFlag("match",r)}},try:{method(...r){i(r.length,"Missing alternative schemas"),l.verifyFlat(r,"try"),i(!this._flags._endedSwitch,"Unreachable condition");const c=this.clone();for(const e of r)c.$_terms.matches.push({schema:c.$_compile(e)});return c.$_mutateRebuild()}}},overrides:{label(r){return this.$_parent("label",r).$_modify({each:(c,e)=>e.path[0]!=="is"&&typeof c._flags.label!="string"?c.label(r):void 0,ref:!1})}},rebuild(r){r.$_modify({each:c=>{l.isSchema(c)&&c.type==="array"&&r.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(r,c){if(c.matches)for(const e of c.matches){const{schema:o,ref:f,is:m,not:y,then:R,otherwise:_}=e;r=o?r.try(o):f?r.conditional(f,{is:m,then:R,not:y,otherwise:_,switch:e.switch}):r.conditional(m,{then:R,otherwise:_})}return r}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),s.errors=function(r,{error:c,state:e}){if(!r.length)return{errors:c("alternatives.any")};if(r.length===1)return{errors:r[0].reports};const o=new Set,f=[];for(const{reports:m,schema:y}of r){if(m.length>1)return s.unmatched(r,c);const R=m[0];if(R instanceof a.Report==0)return s.unmatched(r,c);if(R.state.path.length!==e.path.length){f.push({type:y.type,report:R});continue}if(R.code==="any.only"){for(const d of R.local.valids)o.add(d);continue}const[_,u]=R.code.split(".");u==="base"?o.add(_):f.push({type:y.type,report:R})}return f.length?f.length===1?{errors:f[0].report}:s.unmatched(r,c):{errors:c("alternatives.types",{types:[...o]})}},s.unmatched=function(r,c){const e=[];for(const o of r)e.push(...o.reports);return{errors:c("alternatives.match",a.details(e,{override:!1}))}}},8068:(S,w,p)=>{const i=p(375),g=p(7629),h=p(8160),l=p(6914);S.exports=g.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(t,a){return i(typeof t=="function","Method must be a function"),i(a===void 0||a&&typeof a=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:t,description:a}})},validate(t,a,{method:n}){try{return n(t,a)}catch(s){return a.error("any.custom",{error:s})}},args:["method","description"],multi:!0},messages:{method(t){return this.prefs({messages:t})}},shared:{method(t){i(h.isSchema(t)&&t._flags.id,"Schema must be a schema with an id");const a=this.clone();return a.$_terms.shared=a.$_terms.shared||[],a.$_terms.shared.push(t),a.$_mutateRegister(t),a}},warning:{method(t,a){return i(t&&typeof t=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:t,local:a},warn:!0})},validate:(t,a,{code:n,local:s})=>a.error(n,s),args:["code","local"],multi:!0}},modifiers:{keep(t,a=!0){t.keep=a},message(t,a){t.message=l.compile(a)},warn(t,a=!0){t.warn=a}},manifest:{build(t,a){for(const n in a){const s=a[n];if(["examples","externals","metas","notes","tags"].includes(n))for(const r of s)t=t[n.slice(0,-1)](r);else if(n!=="alterations")if(n!=="whens"){if(n==="shared")for(const r of s)t=t.shared(r)}else for(const r of s){const{ref:c,is:e,not:o,then:f,otherwise:m,concat:y}=r;t=y?t.concat(y):c?t.when(c,{is:e,not:o,then:f,otherwise:m,switch:r.switch,break:r.break}):t.when(e,{then:f,otherwise:m,break:r.break})}else{const r={};for(const{target:c,adjuster:e}of s)r[c]=e;t=t.alter(r)}}return t}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(S,w,p)=>{const i=p(375),g=p(9474),h=p(9621),l=p(8068),t=p(8160),a=p(3292),n={};S.exports=l.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(s,{schema:r,state:c,prefs:e}){if(!Array.isArray(s))return;const o=r.$_getRule("sort");return o?n.sort(r,s,o.args.options,c,e):void 0}},validate(s,{schema:r,error:c}){if(!Array.isArray(s)){if(r._flags.single){const e=[s];return e[t.symbols.arraySingle]=!0,{value:e}}return{errors:c("array.base")}}if(r.$_getRule("items")||r.$_terms.externals)return{value:s.slice()}},rules:{has:{method(s){s=this.$_compile(s,{appendPath:!0});const r=this.$_addRule({name:"has",args:{schema:s}});return r.$_mutateRegister(s),r},validate(s,{state:r,prefs:c,error:e},{schema:o}){const f=[s,...r.ancestors];for(let y=0;y<s.length;++y){const R=r.localize([...r.path,y],f,o);if(o.$_match(s[y],R,c))return s}const m=o._flags.label;return m?e("array.hasKnown",{patternLabel:m}):e("array.hasUnknown",null)},multi:!0},items:{method(...s){t.verifyFlat(s,"items");const r=this.$_addRule("items");for(let c=0;c<s.length;++c){const e=t.tryWithPath(()=>this.$_compile(s[c]),c,{append:!0});r.$_terms.items.push(e)}return r.$_mutateRebuild()},validate(s,{schema:r,error:c,state:e,prefs:o,errorsArray:f}){const m=r.$_terms._requireds.slice(),y=r.$_terms.ordered.slice(),R=[...r.$_terms._inclusions,...m],_=!s[t.symbols.arraySingle];delete s[t.symbols.arraySingle];const u=f();let d=s.length;for(let v=0;v<d;++v){const E=s[v];let k=!1,O=!1;const A=_?v:new Number(v),I=[...e.path,A];if(!r._flags.sparse&&E===void 0){if(u.push(c("array.sparse",{key:A,path:I,pos:v,value:void 0},e.localize(I))),o.abortEarly)return u;y.shift();continue}const T=[s,...e.ancestors];for(const z of r.$_terms._exclusions)if(z.$_match(E,e.localize(I,T,z),o,{presence:"ignore"})){if(u.push(c("array.excludes",{pos:v,value:E},e.localize(I))),o.abortEarly)return u;k=!0,y.shift();break}if(k)continue;if(r.$_terms.ordered.length){if(y.length){const z=y.shift(),P=z.$_validate(E,e.localize(I,T,z),o);if(P.errors){if(u.push(...P.errors),o.abortEarly)return u}else if(z._flags.result==="strip")n.fastSplice(s,v),--v,--d;else{if(!r._flags.sparse&&P.value===void 0){if(u.push(c("array.sparse",{key:A,path:I,pos:v,value:void 0},e.localize(I))),o.abortEarly)return u;continue}s[v]=P.value}continue}if(!r.$_terms.items.length){if(u.push(c("array.orderedLength",{pos:v,limit:r.$_terms.ordered.length})),o.abortEarly)return u;break}}const F=[];let K=m.length;for(let z=0;z<K;++z){const P=e.localize(I,T,m[z]);P.snapshot();const X=m[z].$_validate(E,P,o);if(F[z]=X,!X.errors){if(P.commit(),s[v]=X.value,O=!0,n.fastSplice(m,z),--z,--K,!r._flags.sparse&&X.value===void 0&&(u.push(c("array.sparse",{key:A,path:I,pos:v,value:void 0},e.localize(I))),o.abortEarly))return u;break}P.restore()}if(O)continue;const V=o.stripUnknown&&!!o.stripUnknown.arrays||!1;K=R.length;for(const z of R){let P;const X=m.indexOf(z);if(X!==-1)P=F[X];else{const Z=e.localize(I,T,z);if(Z.snapshot(),P=z.$_validate(E,Z,o),!P.errors){Z.commit(),z._flags.result==="strip"?(n.fastSplice(s,v),--v,--d):r._flags.sparse||P.value!==void 0?s[v]=P.value:(u.push(c("array.sparse",{key:A,path:I,pos:v,value:void 0},e.localize(I))),k=!0),O=!0;break}Z.restore()}if(K===1){if(V){n.fastSplice(s,v),--v,--d,O=!0;break}if(u.push(...P.errors),o.abortEarly)return u;k=!0;break}}if(!k&&(r.$_terms._inclusions.length||r.$_terms._requireds.length)&&!O){if(V){n.fastSplice(s,v),--v,--d;continue}if(u.push(c("array.includes",{pos:v,value:E},e.localize(I))),o.abortEarly)return u}}return m.length&&n.fillMissedErrors(r,u,m,s,e,o),y.length&&(n.fillOrderedErrors(r,u,y,s,e,o),u.length||n.fillDefault(y,s,e,o)),u.length?u:s},priority:!0,manifest:!1},length:{method(s){return this.$_addRule({name:"length",args:{limit:s},operator:"="})},validate:(s,r,{limit:c},{name:e,operator:o,args:f})=>t.compare(s.length,c,o)?s:r.error("array."+e,{limit:f.limit,value:s}),args:[{name:"limit",ref:!0,assert:t.limit,message:"must be a positive integer"}]},max:{method(s){return this.$_addRule({name:"max",method:"length",args:{limit:s},operator:"<="})}},min:{method(s){return this.$_addRule({name:"min",method:"length",args:{limit:s},operator:">="})}},ordered:{method(...s){t.verifyFlat(s,"ordered");const r=this.$_addRule("items");for(let c=0;c<s.length;++c){const e=t.tryWithPath(()=>this.$_compile(s[c]),c,{append:!0});n.validateSingle(e,r),r.$_mutateRegister(e),r.$_terms.ordered.push(e)}return r.$_mutateRebuild()}},single:{method(s){const r=s===void 0||!!s;return i(!r||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",r)}},sort:{method(s={}){t.assertOptions(s,["by","order"]);const r={order:s.order||"ascending"};return s.by&&(r.by=a.ref(s.by,{ancestor:0}),i(!r.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:r}})},validate(s,{error:r,state:c,prefs:e,schema:o},{options:f}){const{value:m,errors:y}=n.sort(o,s,f,c,e);if(y)return y;for(let R=0;R<s.length;++R)if(s[R]!==m[R])return r("array.sort",{order:f.order,by:f.by?f.by.key:"value"});return s},convert:!0},sparse:{method(s){const r=s===void 0||!!s;return this._flags.sparse===r?this:(r?this.clone():this.$_addRule("items")).$_setFlag("sparse",r,{clone:!1})}},unique:{method(s,r={}){i(!s||typeof s=="function"||typeof s=="string","comparator must be a function or a string"),t.assertOptions(r,["ignoreUndefined","separator"]);const c={name:"unique",args:{options:r,comparator:s}};if(s)if(typeof s=="string"){const e=t.default(r.separator,".");c.path=e?s.split(e):[s]}else c.comparator=s;return this.$_addRule(c)},validate(s,{state:r,error:c,schema:e},{comparator:o,options:f},{comparator:m,path:y}){const R={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},_=m||g,u=f.ignoreUndefined;for(let d=0;d<s.length;++d){const v=y?h(s[d],y):s[d],E=m?R.custom:R[typeof v];if(i(E,"Failed to find unique map container for type",typeof v),E instanceof Map){const k=E.entries();let O;for(;!(O=k.next()).done;)if(_(O.value[0],v)){const A=r.localize([...r.path,d],[s,...r.ancestors]),I={pos:d,value:s[d],dupePos:O.value[1],dupeValue:s[O.value[1]]};return y&&(I.path=o),c("array.unique",I,A)}E.set(v,d)}else{if((!u||v!==void 0)&&E[v]!==void 0){const k={pos:d,value:s[d],dupePos:E[v],dupeValue:s[E[v]]};return y&&(k.path=o),c("array.unique",k,r.localize([...r.path,d],[s,...r.ancestors]))}E[v]=d}}return s},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(s,r)=>new Set(s)}},rebuild(s){s.$_terms._inclusions=[],s.$_terms._exclusions=[],s.$_terms._requireds=[];for(const r of s.$_terms.items)n.validateSingle(r,s),r._flags.presence==="required"?s.$_terms._requireds.push(r):r._flags.presence==="forbidden"?s.$_terms._exclusions.push(r):s.$_terms._inclusions.push(r);for(const r of s.$_terms.ordered)n.validateSingle(r,s)},manifest:{build:(s,r)=>(r.items&&(s=s.items(...r.items)),r.ordered&&(s=s.ordered(...r.ordered)),s)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),n.fillMissedErrors=function(s,r,c,e,o,f){const m=[];let y=0;for(const R of c){const _=R._flags.label;_?m.push(_):++y}m.length?y?r.push(s.$_createError("array.includesRequiredBoth",e,{knownMisses:m,unknownMisses:y},o,f)):r.push(s.$_createError("array.includesRequiredKnowns",e,{knownMisses:m},o,f)):r.push(s.$_createError("array.includesRequiredUnknowns",e,{unknownMisses:y},o,f))},n.fillOrderedErrors=function(s,r,c,e,o,f){const m=[];for(const y of c)y._flags.presence==="required"&&m.push(y);m.length&&n.fillMissedErrors(s,r,m,e,o,f)},n.fillDefault=function(s,r,c,e){const o=[];let f=!0;for(let m=s.length-1;m>=0;--m){const y=s[m],R=[r,...c.ancestors],_=y.$_validate(void 0,c.localize(c.path,R,y),e).value;if(f){if(_===void 0)continue;f=!1}o.unshift(_)}o.length&&r.push(...o)},n.fastSplice=function(s,r){let c=r;for(;c<s.length;)s[c++]=s[c];--s.length},n.validateSingle=function(s,r){(s.type==="array"||s._flags._arrayItems)&&(i(!r._flags.single,"Cannot specify array item with single rule enabled"),r.$_setFlag("_arrayItems",!0,{clone:!1}))},n.sort=function(s,r,c,e,o){const f=c.order==="ascending"?1:-1,m=-1*f,y=f,R=(_,u)=>{let d=n.compare(_,u,m,y);if(d!==null||(c.by&&(_=c.by.resolve(_,e,o),u=c.by.resolve(u,e,o)),d=n.compare(_,u,m,y),d!==null))return d;const v=typeof _;if(v!==typeof u)throw s.$_createError("array.sort.mismatching",r,null,e,o);if(v!=="number"&&v!=="string")throw s.$_createError("array.sort.unsupported",r,{type:v},e,o);return v==="number"?(_-u)*f:_<u?m:y};try{return{value:r.slice().sort(R)}}catch(_){return{errors:_}}},n.compare=function(s,r,c,e){return s===r?0:s===void 0?1:r===void 0?-1:s===null?e:r===null?c:null}},4937:(S,w,p)=>{const i=p(375),g=p(8068),h=p(8160),l=p(2036),t={isBool:function(a){return typeof a=="boolean"}};S.exports=g.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(a,{schema:n}){if(typeof a!="boolean"){if(typeof a=="string"){const s=n._flags.sensitive?a:a.toLowerCase();a=s==="true"||s!=="false"&&a}return typeof a!="boolean"&&(a=n.$_terms.truthy&&n.$_terms.truthy.has(a,null,null,!n._flags.sensitive)||(!n.$_terms.falsy||!n.$_terms.falsy.has(a,null,null,!n._flags.sensitive))&&a),{value:a}}},validate(a,{error:n}){if(typeof a!="boolean")return{value:a,errors:n("boolean.base")}},rules:{truthy:{method(...a){h.verifyFlat(a,"truthy");const n=this.clone();n.$_terms.truthy=n.$_terms.truthy||new l;for(let s=0;s<a.length;++s){const r=a[s];i(r!==void 0,"Cannot call truthy with undefined"),n.$_terms.truthy.add(r)}return n}},falsy:{method(...a){h.verifyFlat(a,"falsy");const n=this.clone();n.$_terms.falsy=n.$_terms.falsy||new l;for(let s=0;s<a.length;++s){const r=a[s];i(r!==void 0,"Cannot call falsy with undefined"),n.$_terms.falsy.add(r)}return n}},sensitive:{method(a=!0){return this.$_setFlag("sensitive",a)}}},cast:{number:{from:t.isBool,to:(a,n)=>a?1:0},string:{from:t.isBool,to:(a,n)=>a?"true":"false"}},manifest:{build:(a,n)=>(n.truthy&&(a=a.truthy(...n.truthy)),n.falsy&&(a=a.falsy(...n.falsy)),a)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(S,w,p)=>{const i=p(375),g=p(8068),h=p(8160),l=p(3328),t={isDate:function(a){return a instanceof Date}};S.exports=g.extend({type:"date",coerce:{from:["number","string"],method:(a,{schema:n})=>({value:t.parse(a,n._flags.format)||a})},validate(a,{schema:n,error:s,prefs:r}){if(a instanceof Date&&!isNaN(a.getTime()))return;const c=n._flags.format;return r.convert&&c&&typeof a=="string"?{value:a,errors:s("date.format",{format:c})}:{value:a,errors:s("date.base")}},rules:{compare:{method:!1,validate(a,n,{date:s},{name:r,operator:c,args:e}){const o=s==="now"?Date.now():s.getTime();return h.compare(a.getTime(),o,c)?a:n.error("date."+r,{limit:e.date,value:a})},args:[{name:"date",ref:!0,normalize:a=>a==="now"?a:t.parse(a),assert:a=>a!==null,message:"must have a valid date format"}]},format:{method(a){return i(["iso","javascript","unix"].includes(a),"Unknown date format",a),this.$_setFlag("format",a)}},greater:{method(a){return this.$_addRule({name:"greater",method:"compare",args:{date:a},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(a){return this.$_addRule({name:"less",method:"compare",args:{date:a},operator:"<"})}},max:{method(a){return this.$_addRule({name:"max",method:"compare",args:{date:a},operator:"<="})}},min:{method(a){return this.$_addRule({name:"min",method:"compare",args:{date:a},operator:">="})}},timestamp:{method(a="javascript"){return i(["javascript","unix"].includes(a),'"type" must be one of "javascript, unix"'),this.format(a)}}},cast:{number:{from:t.isDate,to:(a,n)=>a.getTime()},string:{from:t.isDate,to:(a,{prefs:n})=>l.date(a,n)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),t.parse=function(a,n){if(a instanceof Date)return a;if(typeof a!="string"&&(isNaN(a)||!isFinite(a))||/^\s*$/.test(a))return null;if(n==="iso")return h.isIsoDate(a)?t.date(a.toString()):null;const s=a;if(typeof a=="string"&&/^[+-]?\d+(\.\d+)?$/.test(a)&&(a=parseFloat(a)),n){if(n==="javascript")return t.date(1*a);if(n==="unix")return t.date(1e3*a);if(typeof s=="string")return null}return t.date(a)},t.date=function(a){const n=new Date(a);return isNaN(n.getTime())?null:n}},390:(S,w,p)=>{const i=p(375),g=p(7824);S.exports=g.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(h){return i(Number.isSafeInteger(h)&&h>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:h}})},validate:(h,l,{n:t})=>h.length===t?h:l.error("function.arity",{n:t})},class:{method(){return this.$_addRule("class")},validate:(h,l)=>/^\s*class\s/.test(h.toString())?h:l.error("function.class",{value:h})},minArity:{method(h){return i(Number.isSafeInteger(h)&&h>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:h}})},validate:(h,l,{n:t})=>h.length>=t?h:l.error("function.minArity",{n:t})},maxArity:{method(h){return i(Number.isSafeInteger(h)&&h>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:h}})},validate:(h,l,{n:t})=>h.length<=t?h:l.error("function.maxArity",{n:t})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(S,w,p)=>{const i=p(978),g=p(375),h=p(8571),l=p(3652),t=p(8068),a=p(8160),n=p(3292),s=p(6354),r=p(6133),c=p(3328),e={renameDefaults:{alias:!1,multiple:!1,override:!1}};S.exports=t.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(o,f)=>o.keys(f),validate(o,{schema:f,error:m,state:y,prefs:R}){if(!o||typeof o!==f.$_property("typeof")||Array.isArray(o))return{value:o,errors:m("object.base",{type:f.$_property("typeof")})};if(!(f.$_terms.renames||f.$_terms.dependencies||f.$_terms.keys||f.$_terms.patterns||f.$_terms.externals))return;o=e.clone(o,R);const _=[];if(f.$_terms.renames&&!e.rename(f,o,y,R,_))return{value:o,errors:_};if(!f.$_terms.keys&&!f.$_terms.patterns&&!f.$_terms.dependencies)return{value:o,errors:_};const u=new Set(Object.keys(o));if(f.$_terms.keys){const d=[o,...y.ancestors];for(const v of f.$_terms.keys){const E=v.key,k=o[E];u.delete(E);const O=y.localize([...y.path,E],d,v),A=v.schema.$_validate(k,O,R);if(A.errors){if(R.abortEarly)return{value:o,errors:A.errors};A.value!==void 0&&(o[E]=A.value),_.push(...A.errors)}else v.schema._flags.result==="strip"||A.value===void 0&&k!==void 0?delete o[E]:A.value!==void 0&&(o[E]=A.value)}}if(u.size||f._flags._hasPatternMatch){const d=e.unknown(f,o,u,_,y,R);if(d)return d}if(f.$_terms.dependencies)for(const d of f.$_terms.dependencies){if(d.key!==null&&e.isPresent(d.options)(d.key.resolve(o,y,R,null,{shadow:!1}))===!1)continue;const v=e.dependencies[d.rel](f,d,o,y,R);if(v){const E=f.$_createError(v.code,o,v.context,y,R);if(R.abortEarly)return{value:o,errors:E};_.push(E)}}return{value:o,errors:_}},rules:{and:{method(...o){return a.verifyFlat(o,"and"),e.dependency(this,"and",null,o)}},append:{method(o){return o==null||Object.keys(o).length===0?this:this.keys(o)}},assert:{method(o,f,m){c.isTemplate(o)||(o=n.ref(o)),g(m===void 0||typeof m=="string","Message must be a string"),f=this.$_compile(f,{appendPath:!0});const y=this.$_addRule({name:"assert",args:{subject:o,schema:f,message:m}});return y.$_mutateRegister(o),y.$_mutateRegister(f),y},validate(o,{error:f,prefs:m,state:y},{subject:R,schema:_,message:u}){const d=R.resolve(o,y,m),v=r.isRef(R)?R.absolute(y):[];return _.$_match(d,y.localize(v,[o,...y.ancestors],_),m)?o:f("object.assert",{subject:R,message:u})},args:["subject","schema","message"],multi:!0},instance:{method(o,f){return g(typeof o=="function","constructor must be a function"),f=f||o.name,this.$_addRule({name:"instance",args:{constructor:o,name:f}})},validate:(o,f,{constructor:m,name:y})=>o instanceof m?o:f.error("object.instance",{type:y,value:o}),args:["constructor","name"]},keys:{method(o){g(o===void 0||typeof o=="object","Object schema must be a valid object"),g(!a.isSchema(o),"Object schema cannot be a joi schema");const f=this.clone();if(o)if(Object.keys(o).length){f.$_terms.keys=f.$_terms.keys?f.$_terms.keys.filter(m=>!o.hasOwnProperty(m.key)):new e.Keys;for(const m in o)a.tryWithPath(()=>f.$_terms.keys.push({key:m,schema:this.$_compile(o[m])}),m)}else f.$_terms.keys=new e.Keys;else f.$_terms.keys=null;return f.$_mutateRebuild()}},length:{method(o){return this.$_addRule({name:"length",args:{limit:o},operator:"="})},validate:(o,f,{limit:m},{name:y,operator:R,args:_})=>a.compare(Object.keys(o).length,m,R)?o:f.error("object."+y,{limit:_.limit,value:o}),args:[{name:"limit",ref:!0,assert:a.limit,message:"must be a positive integer"}]},max:{method(o){return this.$_addRule({name:"max",method:"length",args:{limit:o},operator:"<="})}},min:{method(o){return this.$_addRule({name:"min",method:"length",args:{limit:o},operator:">="})}},nand:{method(...o){return a.verifyFlat(o,"nand"),e.dependency(this,"nand",null,o)}},or:{method(...o){return a.verifyFlat(o,"or"),e.dependency(this,"or",null,o)}},oxor:{method(...o){return e.dependency(this,"oxor",null,o)}},pattern:{method(o,f,m={}){const y=o instanceof RegExp;y||(o=this.$_compile(o,{appendPath:!0})),g(f!==void 0,"Invalid rule"),a.assertOptions(m,["fallthrough","matches"]),y&&g(!o.flags.includes("g")&&!o.flags.includes("y"),"pattern should not use global or sticky mode"),f=this.$_compile(f,{appendPath:!0});const R=this.clone();R.$_terms.patterns=R.$_terms.patterns||[];const _={[y?"regex":"schema"]:o,rule:f};return m.matches&&(_.matches=this.$_compile(m.matches),_.matches.type!=="array"&&(_.matches=_.matches.$_root.array().items(_.matches)),R.$_mutateRegister(_.matches),R.$_setFlag("_hasPatternMatch",!0,{clone:!1})),m.fallthrough&&(_.fallthrough=!0),R.$_terms.patterns.push(_),R.$_mutateRegister(f),R}},ref:{method(){return this.$_addRule("ref")},validate:(o,f)=>r.isRef(o)?o:f.error("object.refType",{value:o})},regex:{method(){return this.$_addRule("regex")},validate:(o,f)=>o instanceof RegExp?o:f.error("object.regex",{value:o})},rename:{method(o,f,m={}){g(typeof o=="string"||o instanceof RegExp,"Rename missing the from argument"),g(typeof f=="string"||f instanceof c,"Invalid rename to argument"),g(f!==o,"Cannot rename key to same name:",o),a.assertOptions(m,["alias","ignoreUndefined","override","multiple"]);const y=this.clone();y.$_terms.renames=y.$_terms.renames||[];for(const R of y.$_terms.renames)g(R.from!==o,"Cannot rename the same key multiple times");return f instanceof c&&y.$_mutateRegister(f),y.$_terms.renames.push({from:o,to:f,options:i(e.renameDefaults,m)}),y}},schema:{method(o="any"){return this.$_addRule({name:"schema",args:{type:o}})},validate:(o,f,{type:m})=>!a.isSchema(o)||m!=="any"&&o.type!==m?f.error("object.schema",{type:m}):o},unknown:{method(o){return this.$_setFlag("unknown",o!==!1)}},with:{method(o,f,m={}){return e.dependency(this,"with",o,f,m)}},without:{method(o,f,m={}){return e.dependency(this,"without",o,f,m)}},xor:{method(...o){return a.verifyFlat(o,"xor"),e.dependency(this,"xor",null,o)}}},overrides:{default(o,f){return o===void 0&&(o=a.symbols.deepDefault),this.$_parent("default",o,f)}},rebuild(o){if(o.$_terms.keys){const f=new l.Sorter;for(const m of o.$_terms.keys)a.tryWithPath(()=>f.add(m,{after:m.schema.$_rootReferences(),group:m.key}),m.key);o.$_terms.keys=new e.Keys(...f.nodes)}},manifest:{build(o,f){if(f.keys&&(o=o.keys(f.keys)),f.dependencies)for(const{rel:m,key:y=null,peers:R,options:_}of f.dependencies)o=e.dependency(o,m,y,R,_);if(f.patterns)for(const{regex:m,schema:y,rule:R,fallthrough:_,matches:u}of f.patterns)o=o.pattern(m||y,R,{fallthrough:_,matches:u});if(f.renames)for(const{from:m,to:y,options:R}of f.renames)o=o.rename(m,y,R);return o}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),e.clone=function(o,f){if(typeof o=="object"){if(f.nonEnumerables)return h(o,{shallow:!0});const y=Object.create(Object.getPrototypeOf(o));return Object.assign(y,o),y}const m=function(...y){return o.apply(this,y)};return m.prototype=h(o.prototype),Object.defineProperty(m,"name",{value:o.name,writable:!1}),Object.defineProperty(m,"length",{value:o.length,writable:!1}),Object.assign(m,o),m},e.dependency=function(o,f,m,y,R){g(m===null||typeof m=="string",f,"key must be a strings"),R||(R=y.length>1&&typeof y[y.length-1]=="object"?y.pop():{}),a.assertOptions(R,["separator","isPresent"]),y=[].concat(y);const _=a.default(R.separator,"."),u=[];for(const v of y)g(typeof v=="string",f,"peers must be strings"),u.push(n.ref(v,{separator:_,ancestor:0,prefix:!1}));m!==null&&(m=n.ref(m,{separator:_,ancestor:0,prefix:!1}));const d=o.clone();return d.$_terms.dependencies=d.$_terms.dependencies||[],d.$_terms.dependencies.push(new e.Dependency(f,m,u,y,R)),d},e.dependencies={and(o,f,m,y,R){const _=[],u=[],d=f.peers.length,v=e.isPresent(f.options);for(const E of f.peers)v(E.resolve(m,y,R,null,{shadow:!1}))===!1?_.push(E.key):u.push(E.key);if(_.length!==d&&u.length!==d)return{code:"object.and",context:{present:u,presentWithLabels:e.keysToLabels(o,u),missing:_,missingWithLabels:e.keysToLabels(o,_)}}},nand(o,f,m,y,R){const _=[],u=e.isPresent(f.options);for(const E of f.peers)u(E.resolve(m,y,R,null,{shadow:!1}))&&_.push(E.key);if(_.length!==f.peers.length)return;const d=f.paths[0],v=f.paths.slice(1);return{code:"object.nand",context:{main:d,mainWithLabel:e.keysToLabels(o,d),peers:v,peersWithLabels:e.keysToLabels(o,v)}}},or(o,f,m,y,R){const _=e.isPresent(f.options);for(const u of f.peers)if(_(u.resolve(m,y,R,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:f.paths,peersWithLabels:e.keysToLabels(o,f.paths)}}},oxor(o,f,m,y,R){const _=[],u=e.isPresent(f.options);for(const v of f.peers)u(v.resolve(m,y,R,null,{shadow:!1}))&&_.push(v.key);if(!_.length||_.length===1)return;const d={peers:f.paths,peersWithLabels:e.keysToLabels(o,f.paths)};return d.present=_,d.presentWithLabels=e.keysToLabels(o,_),{code:"object.oxor",context:d}},with(o,f,m,y,R){const _=e.isPresent(f.options);for(const u of f.peers)if(_(u.resolve(m,y,R,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:f.key.key,mainWithLabel:e.keysToLabels(o,f.key.key),peer:u.key,peerWithLabel:e.keysToLabels(o,u.key)}}},without(o,f,m,y,R){const _=e.isPresent(f.options);for(const u of f.peers)if(_(u.resolve(m,y,R,null,{shadow:!1})))return{code:"object.without",context:{main:f.key.key,mainWithLabel:e.keysToLabels(o,f.key.key),peer:u.key,peerWithLabel:e.keysToLabels(o,u.key)}}},xor(o,f,m,y,R){const _=[],u=e.isPresent(f.options);for(const v of f.peers)u(v.resolve(m,y,R,null,{shadow:!1}))&&_.push(v.key);if(_.length===1)return;const d={peers:f.paths,peersWithLabels:e.keysToLabels(o,f.paths)};return _.length===0?{code:"object.missing",context:d}:(d.present=_,d.presentWithLabels=e.keysToLabels(o,_),{code:"object.xor",context:d})}},e.keysToLabels=function(o,f){return Array.isArray(f)?f.map(m=>o.$_mapLabels(m)):o.$_mapLabels(f)},e.isPresent=function(o){return typeof o.isPresent=="function"?o.isPresent:f=>f!==void 0},e.rename=function(o,f,m,y,R){const _={};for(const u of o.$_terms.renames){const d=[],v=typeof u.from!="string";if(v)for(const E in f){if(f[E]===void 0&&u.options.ignoreUndefined||E===u.to)continue;const k=u.from.exec(E);k&&d.push({from:E,to:u.to,match:k})}else!Object.prototype.hasOwnProperty.call(f,u.from)||f[u.from]===void 0&&u.options.ignoreUndefined||d.push(u);for(const E of d){const k=E.from;let O=E.to;if(O instanceof c&&(O=O.render(f,m,y,E.match)),k!==O){if(!u.options.multiple&&_[O]&&(R.push(o.$_createError("object.rename.multiple",f,{from:k,to:O,pattern:v},m,y)),y.abortEarly)||Object.prototype.hasOwnProperty.call(f,O)&&!u.options.override&&!_[O]&&(R.push(o.$_createError("object.rename.override",f,{from:k,to:O,pattern:v},m,y)),y.abortEarly))return!1;f[k]===void 0?delete f[O]:f[O]=f[k],_[O]=!0,u.options.alias||delete f[k]}}}return!0},e.unknown=function(o,f,m,y,R,_){if(o.$_terms.patterns){let u=!1;const d=o.$_terms.patterns.map(E=>{if(E.matches)return u=!0,[]}),v=[f,...R.ancestors];for(const E of m){const k=f[E],O=[...R.path,E];for(let A=0;A<o.$_terms.patterns.length;++A){const I=o.$_terms.patterns[A];if(I.regex){const K=I.regex.test(E);if(R.mainstay.tracer.debug(R,"rule",`pattern.${A}`,K?"pass":"error"),!K)continue}else if(!I.schema.$_match(E,R.nest(I.schema,`pattern.${A}`),_))continue;m.delete(E);const T=R.localize(O,v,{schema:I.rule,key:E}),F=I.rule.$_validate(k,T,_);if(F.errors){if(_.abortEarly)return{value:f,errors:F.errors};y.push(...F.errors)}if(I.matches&&d[A].push(E),f[E]=F.value,!I.fallthrough)break}}if(u)for(let E=0;E<d.length;++E){const k=d[E];if(!k)continue;const O=o.$_terms.patterns[E].matches,A=R.localize(R.path,v,O),I=O.$_validate(k,A,_);if(I.errors){const T=s.details(I.errors,{override:!1});T.matches=k;const F=o.$_createError("object.pattern.match",f,T,R,_);if(_.abortEarly)return{value:f,errors:F};y.push(F)}}}if(m.size&&(o.$_terms.keys||o.$_terms.patterns)){if(_.stripUnknown&&!o._flags.unknown||_.skipFunctions){const u=!(!_.stripUnknown||_.stripUnknown!==!0&&!_.stripUnknown.objects);for(const d of m)u?(delete f[d],m.delete(d)):typeof f[d]=="function"&&m.delete(d)}if(!a.default(o._flags.unknown,_.allowUnknown))for(const u of m){const d=R.localize([...R.path,u],[]),v=o.$_createError("object.unknown",f[u],{child:u},d,_,{flags:!1});if(_.abortEarly)return{value:f,errors:v};y.push(v)}}},e.Dependency=class{constructor(o,f,m,y,R){this.rel=o,this.key=f,this.peers=m,this.paths=y,this.options=R}describe(){const o={rel:this.rel,peers:this.paths};return this.key!==null&&(o.key=this.key.key),this.peers[0].separator!=="."&&(o.options={...o.options,separator:this.peers[0].separator}),this.options.isPresent&&(o.options={...o.options,isPresent:this.options.isPresent}),o}},e.Keys=class extends Array{concat(o){const f=this.slice(),m=new Map;for(let y=0;y<f.length;++y)m.set(f[y].key,y);for(const y of o){const R=y.key,_=m.get(R);_!==void 0?f[_]={key:R,schema:f[_].schema.concat(y.schema)}:f.push(y)}return f}}},8785:(S,w,p)=>{const i=p(375),g=p(8068),h=p(8160),l=p(3292),t=p(6354),a={};S.exports=g.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(n,s)=>n.ref(s),validate(n,{schema:s,state:r,prefs:c}){i(s.$_terms.link,"Uninitialized link schema");const e=a.generate(s,n,r,c),o=s.$_terms.link[0].ref;return e.$_validate(n,r.nest(e,`link:${o.display}:${e.type}`),c)},generate:(n,s,r,c)=>a.generate(n,s,r,c),rules:{ref:{method(n){i(!this.$_terms.link,"Cannot reinitialize schema"),n=l.ref(n),i(n.type==="value"||n.type==="local","Invalid reference type:",n.type),i(n.type==="local"||n.ancestor==="root"||n.ancestor>0,"Link cannot reference itself");const s=this.clone();return s.$_terms.link=[{ref:n}],s}},relative:{method(n=!0){return this.$_setFlag("relative",n)}}},overrides:{concat(n){i(this.$_terms.link,"Uninitialized link schema"),i(h.isSchema(n),"Invalid schema object"),i(n.type!=="link","Cannot merge type link with another link");const s=this.clone();return s.$_terms.whens||(s.$_terms.whens=[]),s.$_terms.whens.push({concat:n}),s.$_mutateRebuild()}},manifest:{build:(n,s)=>(i(s.link,"Invalid link description missing link"),n.ref(s.link))}}),a.generate=function(n,s,r,c){let e=r.mainstay.links.get(n);if(e)return e._generate(s,r,c).schema;const o=n.$_terms.link[0].ref,{perspective:f,path:m}=a.perspective(o,r);a.assert(f,"which is outside of schema boundaries",o,n,r,c);try{e=m.length?f.$_reach(m):f}catch{a.assert(!1,"to non-existing schema",o,n,r,c)}return a.assert(e.type!=="link","which is another link",o,n,r,c),n._flags.relative||r.mainstay.links.set(n,e),e._generate(s,r,c).schema},a.perspective=function(n,s){if(n.type==="local"){for(const{schema:r,key:c}of s.schemas){if((r._flags.id||c)===n.path[0])return{perspective:r,path:n.path.slice(1)};if(r.$_terms.shared){for(const e of r.$_terms.shared)if(e._flags.id===n.path[0])return{perspective:e,path:n.path.slice(1)}}}return{perspective:null,path:null}}return n.ancestor==="root"?{perspective:s.schemas[s.schemas.length-1].schema,path:n.path}:{perspective:s.schemas[n.ancestor]&&s.schemas[n.ancestor].schema,path:n.path}},a.assert=function(n,s,r,c,e,o){n||i(!1,`"${t.label(c._flags,e,o)}" contains link reference "${r.display}" ${s}`)}},3832:(S,w,p)=>{const i=p(375),g=p(8068),h=p(8160),l={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(t){const a=t.toString(),n=a.indexOf("."),s=a.indexOf("e");return(n<0?0:(s<0?a.length:s)-n-1)+(s<0?0:Math.max(0,-parseInt(a.slice(s+1))))}};S.exports=g.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:a,error:n}){if(!t.match(l.numberRx))return;t=t.trim();const s={value:parseFloat(t)};if(s.value===0&&(s.value=0),!a._flags.unsafe)if(t.match(/e/i)){if(l.extractSignificantDigits(t)!==l.extractSignificantDigits(String(s.value)))return s.errors=n("number.unsafe"),s}else{const r=s.value.toString();if(r.match(/e/i))return s;if(r!==l.normalizeDecimal(t))return s.errors=n("number.unsafe"),s}return s}},validate(t,{schema:a,error:n,prefs:s}){if(t===1/0||t===-1/0)return{value:t,errors:n("number.infinity")};if(!h.isNumber(t))return{value:t,errors:n("number.base")};const r={value:t};if(s.convert){const c=a.$_getRule("precision");if(c){const e=Math.pow(10,c.args.limit);r.value=Math.round(r.value*e)/e}}return r.value===0&&(r.value=0),!a._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(r.errors=n("number.unsafe")),r},rules:{compare:{method:!1,validate:(t,a,{limit:n},{name:s,operator:r,args:c})=>h.compare(t,n,r)?t:a.error("number."+s,{limit:c.limit,value:t}),args:[{name:"limit",ref:!0,assert:h.isNumber,message:"must be a number"}]},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{limit:t},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(t,a)=>Math.trunc(t)-t==0?t:a.error("number.integer")},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{limit:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{limit:t},operator:">="})}},multiple:{method(t){const a=typeof t=="number"?l.decimalPlaces(t):null,n=Math.pow(10,a);return this.$_addRule({name:"multiple",args:{base:t,baseDecimalPlace:a,pfactor:n}})},validate:(t,a,{base:n,baseDecimalPlace:s,pfactor:r},c)=>l.decimalPlaces(t)>s?a.error("number.multiple",{multiple:c.args.base,value:t}):Math.round(r*t)%Math.round(r*n)==0?t:a.error("number.multiple",{multiple:c.args.base,value:t}),args:[{name:"base",ref:!0,assert:t=>typeof t=="number"&&isFinite(t)&&t>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(t,a)=>Number.isSafeInteger(t)&&t>=0&&t<=65535?t:a.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(t){return i(Number.isSafeInteger(t),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:t}})},validate(t,a,{limit:n}){const s=t.toString().match(l.precisionRx);return Math.max((s[1]?s[1].length:0)-(s[2]?parseInt(s[2],10):0),0)<=n?t:a.error("number.precision",{limit:n,value:t})},convert:!0},sign:{method(t){return i(["negative","positive"].includes(t),"Invalid sign",t),this.$_addRule({name:"sign",args:{sign:t}})},validate:(t,a,{sign:n})=>n==="negative"&&t<0||n==="positive"&&t>0?t:a.error(`number.${n}`)},unsafe:{method(t=!0){return i(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",t)}}},cast:{string:{from:t=>typeof t=="number",to:(t,a)=>t.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),l.extractSignificantDigits=function(t){return t.replace(l.exponentialPartRegex,"").replace(l.dotRegex,"").replace(l.trailingZerosRegex,"").replace(l.leadingSignAndZerosRegex,"")},l.normalizeDecimal=function(t){return(t=t.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&t.endsWith("0")&&(t=t.replace(/0+$/,"")),t==="-0"?"0":t}},8966:(S,w,p)=>{const i=p(7824);S.exports=i.extend({type:"object",cast:{map:{from:g=>g&&typeof g=="object",to:(g,h)=>new Map(Object.entries(g))}}})},7417:(S,w,p)=>{const i=p(375),g=p(5380),h=p(1745),l=p(9959),t=p(6064),a=p(9926),n=p(5752),s=p(8068),r=p(8160),c={tlds:a instanceof Set&&{tlds:{allow:a,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:l.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};S.exports=s.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,{schema:o,state:f,prefs:m}){const y=o.$_getRule("normalize");y&&(e=e.normalize(y.args.form));const R=o.$_getRule("case");R&&(e=R.args.direction==="upper"?e.toLocaleUpperCase():e.toLocaleLowerCase());const _=o.$_getRule("trim");if(_&&_.args.enabled&&(e=e.trim()),o.$_terms.replacements)for(const d of o.$_terms.replacements)e=e.replace(d.pattern,d.replacement);const u=o.$_getRule("hex");if(u&&u.args.options.byteAligned&&e.length%2!=0&&(e=`0${e}`),o.$_getRule("isoDate")){const d=c.isoDate(e);d&&(e=d)}if(o._flags.truncate){const d=o.$_getRule("max");if(d){let v=d.args.limit;if(r.isResolvable(v)&&(v=v.resolve(e,f,m),!r.limit(v)))return{value:e,errors:o.$_createError("any.ref",v,{ref:d.args.limit,arg:"limit",reason:"must be a positive integer"},f,m)};e=e.slice(0,v)}}return{value:e}}},validate(e,{schema:o,error:f}){if(typeof e!="string")return{value:e,errors:f("string.base")};if(e===""){const m=o.$_getRule("min");return m&&m.args.limit===0?void 0:{value:e,errors:f("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(e,o)=>/^[a-zA-Z0-9]+$/.test(e)?e:o.error("string.alphanum")},base64:{method(e={}){return r.assertOptions(e,["paddingRequired","urlSafe"]),e={urlSafe:!1,paddingRequired:!0,...e},i(typeof e.paddingRequired=="boolean","paddingRequired must be boolean"),i(typeof e.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:e}})},validate:(e,o,{options:f})=>c.base64Regex[f.paddingRequired][f.urlSafe].test(e)?e:o.error("string.base64")},case:{method(e){return i(["lower","upper"].includes(e),"Invalid case:",e),this.$_addRule({name:"case",args:{direction:e}})},validate:(e,o,{direction:f})=>f==="lower"&&e===e.toLocaleLowerCase()||f==="upper"&&e===e.toLocaleUpperCase()?e:o.error(`string.${f}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,o){let f=e.length,m=0,y=1;for(;f--;){const R=e.charAt(f)*y;m+=R-9*(R>9),y^=3}return m>0&&m%10==0?e:o.error("string.creditCard")}},dataUri:{method(e={}){return r.assertOptions(e,["paddingRequired"]),e={paddingRequired:!0,...e},i(typeof e.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,o,{options:f}){const m=e.match(c.dataUriRegex);return m&&(!m[2]||m[2]!=="base64"||c.base64Regex[f.paddingRequired].false.test(m[3]))?e:o.error("string.dataUri")}},domain:{method(e){e&&r.assertOptions(e,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const o=c.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:o})},validate:(e,o,f,{address:m})=>g.isValid(e,m)?e:o.error("string.domain")},email:{method(e={}){r.assertOptions(e,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),i(e.multiple===void 0||typeof e.multiple=="boolean","multiple option must be an boolean");const o=c.addressOptions(e),f=new RegExp(`\\s*[${e.separator?t(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:f,address:o})},validate(e,o,{options:f},{regex:m,address:y}){const R=f.multiple?e.split(m):[e],_=[];for(const u of R)h.isValid(u,y)||_.push(u);return _.length?o.error("string.email",{value:e,invalids:_}):e}},guid:{alias:"uuid",method(e={}){r.assertOptions(e,["version","separator"]);let o="";if(e.version){const y=[].concat(e.version);i(y.length>=1,"version must have at least 1 valid version specified");const R=new Set;for(let _=0;_<y.length;++_){const u=y[_];i(typeof u=="string","version at position "+_+" must be a string");const d=c.guidVersions[u.toLowerCase()];i(d,"version at position "+_+" must be one of "+Object.keys(c.guidVersions).join(", ")),i(!R.has(d),"version at position "+_+" must not be a duplicate"),o+=d,R.add(d)}}i(c.guidSeparators.has(e.separator),'separator must be one of true, false, "-", or ":"');const f=e.separator===void 0?"[:-]?":e.separator===!0?"[:-]":e.separator===!1?"[]?":`\\${e.separator}`,m=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${f})[0-9A-F]{4}\\2?[${o||"0-9A-F"}][0-9A-F]{3}\\2?[${o?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:e},regex:m})},validate(e,o,f,{regex:m}){const y=m.exec(e);return y?c.guidBrackets[y[1]]!==y[y.length-1]?o.error("string.guid"):e:o.error("string.guid")}},hex:{method(e={}){return r.assertOptions(e,["byteAligned","prefix"]),e={byteAligned:!1,prefix:!1,...e},i(typeof e.byteAligned=="boolean","byteAligned must be boolean"),i(typeof e.prefix=="boolean"||e.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:e}})},validate:(e,o,{options:f})=>(f.prefix==="optional"?c.hexRegex.withOptionalPrefix:f.prefix===!0?c.hexRegex.withPrefix:c.hexRegex.withoutPrefix).test(e)?f.byteAligned&&e.length%2!=0?o.error("string.hexAlign"):e:o.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(e,o)=>g.isValid(e,{minDomainSegments:1})||c.ipRegex.test(e)?e:o.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(e={}){r.assertOptions(e,["cidr","version"]);const{cidr:o,versions:f,regex:m}=l.regex(e),y=e.version?f:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:o,version:y}},regex:m})},validate:(e,o,{options:f},{regex:m})=>m.test(e)?e:f.version?o.error("string.ipVersion",{value:e,cidr:f.cidr,version:f.version}):o.error("string.ip",{value:e,cidr:f.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(e,{error:o})=>c.isoDate(e)?e:o("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,o)=>c.isoDurationRegex.test(e)?e:o.error("string.isoDuration")},length:{method(e,o){return c.length(this,"length",e,"=",o)},validate(e,o,{limit:f,encoding:m},{name:y,operator:R,args:_}){const u=!m&&e.length;return r.compare(u,f,R)?e:o.error("string."+y,{limit:_.limit,value:e,encoding:m})},args:[{name:"limit",ref:!0,assert:r.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,o){return c.length(this,"max",e,"<=",o)},args:["limit","encoding"]},min:{method(e,o){return c.length(this,"min",e,">=",o)},args:["limit","encoding"]},normalize:{method(e="NFC"){return i(c.normalizationForms.includes(e),"normalization form must be one of "+c.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate:(e,{error:o},{form:f})=>e===e.normalize(f)?e:o("string.normalize",{value:e,form:f}),convert:!0},pattern:{alias:"regex",method(e,o={}){i(e instanceof RegExp,"regex must be a RegExp"),i(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode"),typeof o=="string"&&(o={name:o}),r.assertOptions(o,["invert","name"]);const f=["string.pattern",o.invert?".invert":"",o.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:e,options:o},errorCode:f})},validate:(e,o,{regex:f,options:m},{errorCode:y})=>f.test(e)^m.invert?e:o.error(y,{name:m.name,regex:f,value:e}),args:["regex","options"],multi:!0},replace:{method(e,o){typeof e=="string"&&(e=new RegExp(t(e),"g")),i(e instanceof RegExp,"pattern must be a RegExp"),i(typeof o=="string","replacement must be a String");const f=this.clone();return f.$_terms.replacements||(f.$_terms.replacements=[]),f.$_terms.replacements.push({pattern:e,replacement:o}),f}},token:{method(){return this.$_addRule("token")},validate:(e,o)=>/^\w+$/.test(e)?e:o.error("string.token")},trim:{method(e=!0){return i(typeof e=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate:(e,o,{enabled:f})=>f&&e!==e.trim()?o.error("string.trim"):e,convert:!0},truncate:{method(e=!0){return i(typeof e=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(e={}){r.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),e.domain&&r.assertOptions(e.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:o,scheme:f}=n.regex(e),m=e.domain?c.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:o,domain:m,scheme:f})},validate(e,o,{options:f},{regex:m,domain:y,scheme:R}){if(["http:/","https:/"].includes(e))return o.error("string.uri");const _=m.exec(e);if(_){const u=_[1]||_[2];return!y||f.allowRelative&&!u||g.isValid(u,y)?e:o.error("string.domain",{value:u})}return f.relativeOnly?o.error("string.uriRelativeOnly"):f.scheme?o.error("string.uriCustomScheme",{scheme:R,value:e}):o.error("string.uri")}}},manifest:{build(e,o){if(o.replacements)for(const{pattern:f,replacement:m}of o.replacements)e=e.replace(f,m);return e}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),c.addressOptions=function(e){if(!e)return c.tlds||e;if(i(e.minDomainSegments===void 0||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer"),i(e.maxDomainSegments===void 0||Number.isSafeInteger(e.maxDomainSegments)&&e.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),e.tlds===!1)return e;if(e.tlds===!0||e.tlds===void 0)return i(c.tlds,"Built-in TLD list disabled"),Object.assign({},e,c.tlds);i(typeof e.tlds=="object","tlds must be true, false, or an object");const o=e.tlds.deny;if(o)return Array.isArray(o)&&(e=Object.assign({},e,{tlds:{deny:new Set(o)}})),i(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),i(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),c.validateTlds(e.tlds.deny,"tlds.deny"),e;const f=e.tlds.allow;return f?f===!0?(i(c.tlds,"Built-in TLD list disabled"),Object.assign({},e,c.tlds)):(Array.isArray(f)&&(e=Object.assign({},e,{tlds:{allow:new Set(f)}})),i(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),c.validateTlds(e.tlds.allow,"tlds.allow"),e):e},c.validateTlds=function(e,o){for(const f of e)i(g.isValid(f,{minDomainSegments:1,maxDomainSegments:1}),`${o} must contain valid top level domain names`)},c.isoDate=function(e){if(!r.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");const o=new Date(e);return isNaN(o.getTime())?null:o.toISOString()},c.length=function(e,o,f,m,y){return i(!y||!1,"Invalid encoding:",y),e.$_addRule({name:o,method:"length",args:{limit:f,encoding:y},operator:m})}},8826:(S,w,p)=>{const i=p(375),g=p(8068),h={};h.Map=class extends Map{slice(){return new h.Map(this)}},S.exports=g.extend({type:"symbol",terms:{map:{init:new h.Map}},coerce:{method(l,{schema:t,error:a}){const n=t.$_terms.map.get(l);return n&&(l=n),t._flags.only&&typeof l!="symbol"?{value:l,errors:a("symbol.map",{map:t.$_terms.map})}:{value:l}}},validate(l,{error:t}){if(typeof l!="symbol")return{value:l,errors:t("symbol.base")}},rules:{map:{method(l){l&&!l[Symbol.iterator]&&typeof l=="object"&&(l=Object.entries(l)),i(l&&l[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),a=[];for(const n of l){i(n&&n[Symbol.iterator],"Entry must be an iterable");const[s,r]=n;i(typeof s!="object"&&typeof s!="function"&&typeof s!="symbol","Key must not be of type object, function, or Symbol"),i(typeof r=="symbol","Value must be a Symbol"),t.$_terms.map.set(s,r),a.push(r)}return t.valid(...a)}}},manifest:{build:(l,t)=>(t.map&&(l=l.map(t.map)),l)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(S,w,p)=>{const i=p(375),g=p(8571),h=p(738),l=p(9621),t=p(8160),a=p(6354),n=p(493),s={result:Symbol("result")};w.entry=function(r,c,e){let o=t.defaults;e&&(i(e.warnings===void 0,"Cannot override warnings preference in synchronous validation"),i(e.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),o=t.preferences(t.defaults,e));const f=s.entry(r,c,o);i(!f.mainstay.externals.length,"Schema with external rules must use validateAsync()");const m={value:f.value};return f.error&&(m.error=f.error),f.mainstay.warnings.length&&(m.warning=a.details(f.mainstay.warnings)),f.mainstay.debug&&(m.debug=f.mainstay.debug),f.mainstay.artifacts&&(m.artifacts=f.mainstay.artifacts),m},w.entryAsync=async function(r,c,e){let o=t.defaults;e&&(o=t.preferences(t.defaults,e));const f=s.entry(r,c,o),m=f.mainstay;if(f.error)throw m.debug&&(f.error.debug=m.debug),f.error;if(m.externals.length){let R=f.value;const _=[];for(const u of m.externals){const d=u.state.path,v=u.schema.type==="link"?m.links.get(u.schema):null;let E,k,O=R;const A=d.length?[R]:[],I=d.length?l(r,d):r;if(d.length){E=d[d.length-1];let T=R;for(const F of d.slice(0,-1))T=T[F],A.unshift(T);k=A[0],O=k[E]}try{const T=(K,V)=>(v||u.schema).$_createError(K,O,V,u.state,o),F=await u.method(O,{schema:u.schema,linked:v,state:u.state,prefs:e,original:I,error:T,errorsArray:s.errorsArray,warn:(K,V)=>m.warnings.push((v||u.schema).$_createError(K,O,V,u.state,o)),message:(K,V)=>(v||u.schema).$_createError("external",O,V,u.state,o,{messages:K})});if(F===void 0||F===O)continue;if(F instanceof a.Report){if(m.tracer.log(u.schema,u.state,"rule","external","error"),_.push(F),o.abortEarly)break;continue}if(Array.isArray(F)&&F[t.symbols.errors]){if(m.tracer.log(u.schema,u.state,"rule","external","error"),_.push(...F),o.abortEarly)break;continue}k?(m.tracer.value(u.state,"rule",O,F,"external"),k[E]=F):(m.tracer.value(u.state,"rule",R,F,"external"),R=F)}catch(T){throw o.errors.label&&(T.message+=` (${u.label})`),T}}if(f.value=R,_.length)throw f.error=a.process(_,r,o),m.debug&&(f.error.debug=m.debug),f.error}if(!o.warnings&&!o.debug&&!o.artifacts)return f.value;const y={value:f.value};return m.warnings.length&&(y.warning=a.details(m.warnings)),m.debug&&(y.debug=m.debug),m.artifacts&&(y.artifacts=m.artifacts),y},s.Mainstay=class{constructor(r,c,e){this.externals=[],this.warnings=[],this.tracer=r,this.debug=c,this.links=e,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const r=this._snapshots.pop();this.externals=r.externals,this.warnings=r.warnings}commit(){this._snapshots.pop()}},s.entry=function(r,c,e){const{tracer:o,cleanup:f}=s.tracer(c,e),m=e.debug?[]:null,y=c._ids._schemaChain?new Map:null,R=new s.Mainstay(o,m,y),_=c._ids._schemaChain?[{schema:c}]:null,u=new n([],[],{mainstay:R,schemas:_}),d=w.validate(r,c,u,e);f&&c.$_root.untrace();const v=a.process(d.errors,r,e);return{value:d.value,error:v,mainstay:R}},s.tracer=function(r,c){return r.$_root._tracer?{tracer:r.$_root._tracer._register(r)}:c.debug?(i(r.$_root.trace,"Debug mode not supported"),{tracer:r.$_root.trace()._register(r),cleanup:!0}):{tracer:s.ignore}},w.validate=function(r,c,e,o,f={}){if(c.$_terms.whens&&(c=c._generate(r,e,o).schema),c._preferences&&(o=s.prefs(c,o)),c._cache&&o.cache){const v=c._cache.get(r);if(e.mainstay.tracer.debug(e,"validate","cached",!!v),v)return v}const m=(v,E,k)=>c.$_createError(v,r,E,k||e,o),y={original:r,prefs:o,schema:c,state:e,error:m,errorsArray:s.errorsArray,warn:(v,E,k)=>e.mainstay.warnings.push(m(v,E,k)),message:(v,E)=>c.$_createError("custom",r,E,e,o,{messages:v})};e.mainstay.tracer.entry(c,e);const R=c._definition;if(R.prepare&&r!==void 0&&o.convert){const v=R.prepare(r,y);if(v){if(e.mainstay.tracer.value(e,"prepare",r,v.value),v.errors)return s.finalize(v.value,[].concat(v.errors),y);r=v.value}}if(R.coerce&&r!==void 0&&o.convert&&(!R.coerce.from||R.coerce.from.includes(typeof r))){const v=R.coerce.method(r,y);if(v){if(e.mainstay.tracer.value(e,"coerced",r,v.value),v.errors)return s.finalize(v.value,[].concat(v.errors),y);r=v.value}}const _=c._flags.empty;_&&_.$_match(s.trim(r,c),e.nest(_),t.defaults)&&(e.mainstay.tracer.value(e,"empty",r,void 0),r=void 0);const u=f.presence||c._flags.presence||(c._flags._endedSwitch?null:o.presence);if(r===void 0){if(u==="forbidden")return s.finalize(r,null,y);if(u==="required")return s.finalize(r,[c.$_createError("any.required",r,null,e,o)],y);if(u==="optional"){if(c._flags.default!==t.symbols.deepDefault)return s.finalize(r,null,y);e.mainstay.tracer.value(e,"default",r,{}),r={}}}else if(u==="forbidden")return s.finalize(r,[c.$_createError("any.unknown",r,null,e,o)],y);const d=[];if(c._valids){const v=c._valids.get(r,e,o,c._flags.insensitive);if(v)return o.convert&&(e.mainstay.tracer.value(e,"valids",r,v.value),r=v.value),e.mainstay.tracer.filter(c,e,"valid",v),s.finalize(r,null,y);if(c._flags.only){const E=c.$_createError("any.only",r,{valids:c._valids.values({display:!0})},e,o);if(o.abortEarly)return s.finalize(r,[E],y);d.push(E)}}if(c._invalids){const v=c._invalids.get(r,e,o,c._flags.insensitive);if(v){e.mainstay.tracer.filter(c,e,"invalid",v);const E=c.$_createError("any.invalid",r,{invalids:c._invalids.values({display:!0})},e,o);if(o.abortEarly)return s.finalize(r,[E],y);d.push(E)}}if(R.validate){const v=R.validate(r,y);if(v&&(e.mainstay.tracer.value(e,"base",r,v.value),r=v.value,v.errors)){if(!Array.isArray(v.errors))return d.push(v.errors),s.finalize(r,d,y);if(v.errors.length)return d.push(...v.errors),s.finalize(r,d,y)}}return c._rules.length?s.rules(r,d,y):s.finalize(r,d,y)},s.rules=function(r,c,e){const{schema:o,state:f,prefs:m}=e;for(const y of o._rules){const R=o._definition.rules[y.method];if(R.convert&&m.convert){f.mainstay.tracer.log(o,f,"rule",y.name,"full");continue}let _,u=y.args;if(y._resolve.length){u=Object.assign({},u);for(const v of y._resolve){const E=R.argsByName.get(v),k=u[v].resolve(r,f,m),O=E.normalize?E.normalize(k):k,A=t.validateArg(O,null,E);if(A){_=o.$_createError("any.ref",k,{arg:v,ref:u[v],reason:A},f,m);break}u[v]=O}}_=_||R.validate(r,e,u,y);const d=s.rule(_,y);if(d.errors){if(f.mainstay.tracer.log(o,f,"rule",y.name,"error"),y.warn){f.mainstay.warnings.push(...d.errors);continue}if(m.abortEarly)return s.finalize(r,d.errors,e);c.push(...d.errors)}else f.mainstay.tracer.log(o,f,"rule",y.name,"pass"),f.mainstay.tracer.value(f,"rule",r,d.value,y.name),r=d.value}return s.finalize(r,c,e)},s.rule=function(r,c){return r instanceof a.Report?(s.error(r,c),{errors:[r],value:null}):Array.isArray(r)&&r[t.symbols.errors]?(r.forEach(e=>s.error(e,c)),{errors:r,value:null}):{errors:null,value:r}},s.error=function(r,c){return c.message&&r._setTemplate(c.message),r},s.finalize=function(r,c,e){c=c||[];const{schema:o,state:f,prefs:m}=e;if(c.length){const R=s.default("failover",void 0,c,e);R!==void 0&&(f.mainstay.tracer.value(f,"failover",r,R),r=R,c=[])}if(c.length&&o._flags.error)if(typeof o._flags.error=="function"){c=o._flags.error(c),Array.isArray(c)||(c=[c]);for(const R of c)i(R instanceof Error||R instanceof a.Report,"error() must return an Error object")}else c=[o._flags.error];if(r===void 0){const R=s.default("default",r,c,e);f.mainstay.tracer.value(f,"default",r,R),r=R}if(o._flags.cast&&r!==void 0){const R=o._definition.cast[o._flags.cast];if(R.from(r)){const _=R.to(r,e);f.mainstay.tracer.value(f,"cast",r,_,o._flags.cast),r=_}}if(o.$_terms.externals&&m.externals&&m._externals!==!1)for(const{method:R}of o.$_terms.externals)f.mainstay.externals.push({method:R,schema:o,state:f,label:a.label(o._flags,f,m)});const y={value:r,errors:c.length?c:null};return o._flags.result&&(y.value=o._flags.result==="strip"?void 0:e.original,f.mainstay.tracer.value(f,o._flags.result,r,y.value),f.shadow(r,o._flags.result)),o._cache&&m.cache!==!1&&!o._refs.length&&o._cache.set(e.original,y),r===void 0||y.errors||o._flags.artifact===void 0||(f.mainstay.artifacts=f.mainstay.artifacts||new Map,f.mainstay.artifacts.has(o._flags.artifact)||f.mainstay.artifacts.set(o._flags.artifact,[]),f.mainstay.artifacts.get(o._flags.artifact).push(f.path)),y},s.prefs=function(r,c){const e=c===t.defaults;return e&&r._preferences[t.symbols.prefs]?r._preferences[t.symbols.prefs]:(c=t.preferences(c,r._preferences),e&&(r._preferences[t.symbols.prefs]=c),c)},s.default=function(r,c,e,o){const{schema:f,state:m,prefs:y}=o,R=f._flags[r];if(y.noDefaults||R===void 0)return c;if(m.mainstay.tracer.log(f,m,"rule",r,"full"),!R)return R;if(typeof R=="function"){const _=R.length?[g(m.ancestors[0]),o]:[];try{return R(..._)}catch(u){return void e.push(f.$_createError(`any.${r}`,null,{error:u},m,y))}}return typeof R!="object"?R:R[t.symbols.literal]?R.literal:t.isResolvable(R)?R.resolve(c,m,y):g(R)},s.trim=function(r,c){if(typeof r!="string")return r;const e=c.$_getRule("trim");return e&&e.args.enabled?r.trim():r},s.ignore={active:!1,debug:h,entry:h,filter:h,log:h,resolve:h,value:h},s.errorsArray=function(){const r=[];return r[t.symbols.errors]=!0,r}},2036:(S,w,p)=>{const i=p(375),g=p(9474),h=p(8160),l={};S.exports=l.Values=class{constructor(t,a){this._values=new Set(t),this._refs=new Set(a),this._lowercase=l.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,a){h.isResolvable(t)?this._refs.has(t)||(this._refs.add(t),a&&a.register(t)):this.has(t,null,null,!1)||(this._values.add(t),typeof t=="string"&&this._lowercase.set(t.toLowerCase(),t))}static merge(t,a,n){if(t=t||new l.Values,a){if(a._override)return a.clone();for(const s of[...a._values,...a._refs])t.add(s)}if(n)for(const s of[...n._values,...n._refs])t.remove(s);return t.length?t:null}remove(t){h.isResolvable(t)?this._refs.delete(t):(this._values.delete(t),typeof t=="string"&&this._lowercase.delete(t.toLowerCase()))}has(t,a,n,s){return!!this.get(t,a,n,s)}get(t,a,n,s){if(!this.length)return!1;if(this._values.has(t))return{value:t};if(typeof t=="string"&&t&&s){const r=this._lowercase.get(t.toLowerCase());if(r)return{value:r}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(const r of this._values)if(g(r,t))return{value:r}}if(a)for(const r of this._refs){const c=r.resolve(t,a,n,null,{in:!0});if(c===void 0)continue;const e=r.in&&typeof c=="object"?Array.isArray(c)?c:Object.keys(c):[c];for(const o of e)if(typeof o==typeof t){if(s&&t&&typeof t=="string"){if(o.toLowerCase()===t.toLowerCase())return{value:o,ref:r}}else if(g(o,t))return{value:o,ref:r}}}return!1}override(){this._override=!0}values(t){if(t&&t.display){const a=[];for(const n of[...this._values,...this._refs])n!==void 0&&a.push(n);return a}return Array.from([...this._values,...this._refs])}clone(){const t=new l.Values(this._values,this._refs);return t._override=this._override,t}concat(t){i(!t._override,"Cannot concat override set of values");const a=new l.Values([...this._values,...t._values],[...this._refs,...t._refs]);return a._override=this._override,a}describe(){const t=[];this._override&&t.push({override:!0});for(const a of this._values.values())t.push(a&&typeof a=="object"?{value:a}:a);for(const a of this._refs.values())t.push(a.describe());return t}},l.Values.prototype[h.symbols.values]=!0,l.Values.prototype.slice=l.Values.prototype.clone,l.lowercases=function(t){const a=new Map;if(t)for(const n of t)typeof n=="string"&&a.set(n.toLowerCase(),n);return a}},978:(S,w,p)=>{const i=p(375),g=p(8571),h=p(1687),l=p(9621),t={};S.exports=function(a,n,s={}){if(i(a&&typeof a=="object","Invalid defaults value: must be an object"),i(!n||n===!0||typeof n=="object","Invalid source value: must be true, falsy or an object"),i(typeof s=="object","Invalid options: must be an object"),!n)return null;if(s.shallow)return t.applyToDefaultsWithShallow(a,n,s);const r=g(a);if(n===!0)return r;const c=s.nullOverride!==void 0&&s.nullOverride;return h(r,n,{nullOverride:c,mergeArrays:!1})},t.applyToDefaultsWithShallow=function(a,n,s){const r=s.shallow;i(Array.isArray(r),"Invalid keys");const c=new Map,e=n===!0?null:new Set;for(let m of r){m=Array.isArray(m)?m:m.split(".");const y=l(a,m);y&&typeof y=="object"?c.set(y,e&&l(n,m)||y):e&&e.add(m)}const o=g(a,{},c);if(!e)return o;for(const m of e)t.reachCopy(o,n,m);const f=s.nullOverride!==void 0&&s.nullOverride;return h(o,n,{nullOverride:f,mergeArrays:!1})},t.reachCopy=function(a,n,s){for(const e of s){if(!(e in n))return;const o=n[e];if(typeof o!="object"||o===null)return;n=o}const r=n;let c=a;for(let e=0;e<s.length-1;++e){const o=s[e];typeof c[o]!="object"&&(c[o]={}),c=c[o]}c[s[s.length-1]]=r}},375:(S,w,p)=>{const i=p(7916);S.exports=function(g,...h){if(!g)throw h.length===1&&h[0]instanceof Error?h[0]:new i(h)}},8571:(S,w,p)=>{const i=p(9621),g=p(4277),h=p(7043),l={needsProtoHack:new Set([g.set,g.map,g.weakSet,g.weakMap])};S.exports=l.clone=function(t,a={},n=null){if(typeof t!="object"||t===null)return t;let s=l.clone,r=n;if(a.shallow){if(a.shallow!==!0)return l.cloneWithShallow(t,a);s=f=>f}else if(r){const f=r.get(t);if(f)return f}else r=new Map;const c=g.getInternalProto(t);if(c===g.buffer)return!1;if(c===g.date)return new Date(t.getTime());if(c===g.regex)return new RegExp(t);const e=l.base(t,c,a);if(e===t)return t;if(r&&r.set(t,e),c===g.set)for(const f of t)e.add(s(f,a,r));else if(c===g.map)for(const[f,m]of t)e.set(f,s(m,a,r));const o=h.keys(t,a);for(const f of o){if(f==="__proto__")continue;if(c===g.array&&f==="length"){e.length=t.length;continue}const m=Object.getOwnPropertyDescriptor(t,f);m?m.get||m.set?Object.defineProperty(e,f,m):m.enumerable?e[f]=s(t[f],a,r):Object.defineProperty(e,f,{enumerable:!1,writable:!0,configurable:!0,value:s(t[f],a,r)}):Object.defineProperty(e,f,{enumerable:!0,writable:!0,configurable:!0,value:s(t[f],a,r)})}return e},l.cloneWithShallow=function(t,a){const n=a.shallow;(a=Object.assign({},a)).shallow=!1;const s=new Map;for(const r of n){const c=i(t,r);typeof c!="object"&&typeof c!="function"||s.set(c,c)}return l.clone(t,a,s)},l.base=function(t,a,n){if(n.prototype===!1)return l.needsProtoHack.has(a)?new a.constructor:a===g.array?[]:{};const s=Object.getPrototypeOf(t);if(s&&s.isImmutable)return t;if(a===g.array){const r=[];return s!==a&&Object.setPrototypeOf(r,s),r}if(l.needsProtoHack.has(a)){const r=new s.constructor;return s!==a&&Object.setPrototypeOf(r,s),r}return Object.create(s)}},9474:(S,w,p)=>{const i=p(4277),g={mismatched:null};S.exports=function(h,l,t){return t=Object.assign({prototype:!0},t),!!g.isDeepEqual(h,l,t,[])},g.isDeepEqual=function(h,l,t,a){if(h===l)return h!==0||1/h==1/l;const n=typeof h;if(n!==typeof l||h===null||l===null)return!1;if(n==="function"){if(!t.deepFunction||h.toString()!==l.toString())return!1}else if(n!=="object")return h!=h&&l!=l;const s=g.getSharedType(h,l,!!t.prototype);switch(s){case i.buffer:return!1;case i.promise:return h===l;case i.regex:return h.toString()===l.toString();case g.mismatched:return!1}for(let r=a.length-1;r>=0;--r)if(a[r].isSame(h,l))return!0;a.push(new g.SeenEntry(h,l));try{return!!g.isDeepEqualObj(s,h,l,t,a)}finally{a.pop()}},g.getSharedType=function(h,l,t){if(t)return Object.getPrototypeOf(h)!==Object.getPrototypeOf(l)?g.mismatched:i.getInternalProto(h);const a=i.getInternalProto(h);return a!==i.getInternalProto(l)?g.mismatched:a},g.valueOf=function(h){const l=h.valueOf;if(l===void 0)return h;try{return l.call(h)}catch(t){return t}},g.hasOwnEnumerableProperty=function(h,l){return Object.prototype.propertyIsEnumerable.call(h,l)},g.isSetSimpleEqual=function(h,l){for(const t of Set.prototype.values.call(h))if(!Set.prototype.has.call(l,t))return!1;return!0},g.isDeepEqualObj=function(h,l,t,a,n){const{isDeepEqual:s,valueOf:r,hasOwnEnumerableProperty:c}=g,{keys:e,getOwnPropertySymbols:o}=Object;if(h===i.array){if(!a.part){if(l.length!==t.length)return!1;for(let _=0;_<l.length;++_)if(!s(l[_],t[_],a,n))return!1;return!0}for(const _ of l)for(const u of t)if(s(_,u,a,n))return!0}else if(h===i.set){if(l.size!==t.size)return!1;if(!g.isSetSimpleEqual(l,t)){const _=new Set(Set.prototype.values.call(t));for(const u of Set.prototype.values.call(l)){if(_.delete(u))continue;let d=!1;for(const v of _)if(s(u,v,a,n)){_.delete(v),d=!0;break}if(!d)return!1}}}else if(h===i.map){if(l.size!==t.size)return!1;for(const[_,u]of Map.prototype.entries.call(l))if(u===void 0&&!Map.prototype.has.call(t,_)||!s(u,Map.prototype.get.call(t,_),a,n))return!1}else if(h===i.error&&(l.name!==t.name||l.message!==t.message))return!1;const f=r(l),m=r(t);if((l!==f||t!==m)&&!s(f,m,a,n))return!1;const y=e(l);if(!a.part&&y.length!==e(t).length&&!a.skip)return!1;let R=0;for(const _ of y)if(a.skip&&a.skip.includes(_))t[_]===void 0&&++R;else if(!c(t,_)||!s(l[_],t[_],a,n))return!1;if(!a.part&&y.length-R!==e(t).length)return!1;if(a.symbols!==!1){const _=o(l),u=new Set(o(t));for(const d of _){if(!a.skip||!a.skip.includes(d)){if(c(l,d)){if(!c(t,d)||!s(l[d],t[d],a,n))return!1}else if(c(t,d))return!1}u.delete(d)}for(const d of u)if(c(t,d))return!1}return!0},g.SeenEntry=class{constructor(h,l){this.obj=h,this.ref=l}isSame(h,l){return this.obj===h&&this.ref===l}}},7916:(S,w,p)=>{const i=p(8761);S.exports=class extends Error{constructor(g){super(g.filter(h=>h!=="").map(h=>typeof h=="string"?h:h instanceof Error?h.message:i(h)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,w.assert)}}},5277:S=>{const w={};S.exports=function(p){if(!p)return"";let i="";for(let g=0;g<p.length;++g){const h=p.charCodeAt(g);w.isSafe(h)?i+=p[g]:i+=w.escapeHtmlChar(h)}return i},w.escapeHtmlChar=function(p){return w.namedHtml.get(p)||(p>=256?"&#"+p+";":`&#x${p.toString(16).padStart(2,"0")};`)},w.isSafe=function(p){return w.safeCharCodes.has(p)},w.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]),w.safeCharCodes=function(){const p=new Set;for(let i=32;i<123;++i)(i>=97||i>=65&&i<=90||i>=48&&i<=57||i===32||i===46||i===44||i===45||i===58||i===95)&&p.add(i);return p}()},6064:S=>{S.exports=function(w){return w.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:S=>{S.exports=function(){}},1687:(S,w,p)=>{const i=p(375),g=p(8571),h=p(7043),l={};S.exports=l.merge=function(t,a,n){if(i(t&&typeof t=="object","Invalid target value: must be an object"),i(a==null||typeof a=="object","Invalid source value: must be null, undefined, or an object"),!a)return t;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(a)){i(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let r=0;r<a.length;++r)t.push(g(a[r],{symbols:n.symbols}));return t}const s=h.keys(a,n);for(let r=0;r<s.length;++r){const c=s[r];if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(a,c))continue;const e=a[c];if(e&&typeof e=="object"){if(t[c]===e)continue;!t[c]||typeof t[c]!="object"||Array.isArray(t[c])!==Array.isArray(e)||e instanceof Date||e instanceof RegExp?t[c]=g(e,{symbols:n.symbols}):l.merge(t[c],e,n)}else(e!=null||n.nullOverride)&&(t[c]=e)}return t}},9621:(S,w,p)=>{const i=p(375),g={};S.exports=function(h,l,t){if(l===!1||l==null)return h;typeof(t=t||{})=="string"&&(t={separator:t});const a=Array.isArray(l);i(!a||!t.separator,"Separator option is not valid for array-based chain");const n=a?l:l.split(t.separator||".");let s=h;for(let r=0;r<n.length;++r){let c=n[r];const e=t.iterables&&g.iterables(s);if(Array.isArray(s)||e==="set"){const o=Number(c);Number.isInteger(o)&&(c=o<0?s.length+o:o)}if(!s||typeof s=="function"&&t.functions===!1||!e&&s[c]===void 0){i(!t.strict||r+1===n.length,"Missing segment",c,"in reach path ",l),i(typeof s=="object"||t.functions===!0||typeof s!="function","Invalid segment",c,"in reach path ",l),s=t.default;break}s=e?e==="set"?[...s][c]:s.get(c):s[c]}return s},g.iterables=function(h){return h instanceof Set?"set":h instanceof Map?"map":void 0}},8761:S=>{S.exports=function(...w){try{return JSON.stringify(...w)}catch(p){return"[Cannot display object: "+p.message+"]"}}},4277:(S,w)=>{const p={};w=S.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},p.typeMap=new Map([["[object Error]",w.error],["[object Map]",w.map],["[object Promise]",w.promise],["[object Set]",w.set],["[object WeakMap]",w.weakMap],["[object WeakSet]",w.weakSet]]),w.getInternalProto=function(i){if(Array.isArray(i))return w.array;if(i instanceof Date)return w.date;if(i instanceof RegExp)return w.regex;if(i instanceof Error)return w.error;const g=Object.prototype.toString.call(i);return p.typeMap.get(g)||w.generic}},7043:(S,w)=>{w.keys=function(p,i={}){return i.symbols!==!1?Reflect.ownKeys(p):Object.getOwnPropertyNames(p)}},3652:(S,w,p)=>{const i=p(375),g={};w.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(h,l){const t=[].concat((l=l||{}).before||[]),a=[].concat(l.after||[]),n=l.group||"?",s=l.sort||0;i(!t.includes(n),`Item cannot come before itself: ${n}`),i(!t.includes("?"),"Item cannot come before unassociated items"),i(!a.includes(n),`Item cannot come after itself: ${n}`),i(!a.includes("?"),"Item cannot come after unassociated items"),Array.isArray(h)||(h=[h]);for(const r of h){const c={seq:this._items.length,sort:s,before:t,after:a,group:n,node:r};this._items.push(c)}if(!l.manual){const r=this._sort();i(r,"item",n!=="?"?`added into group ${n}`:"","created a dependencies error")}return this.nodes}merge(h){Array.isArray(h)||(h=[h]);for(const t of h)if(t)for(const a of t._items)this._items.push(Object.assign({},a));this._items.sort(g.mergeSort);for(let t=0;t<this._items.length;++t)this._items[t].seq=t;const l=this._sort();return i(l,"merge created a dependencies error"),this.nodes}sort(){const h=this._sort();return i(h,"sort created a dependencies error"),this.nodes}_sort(){const h={},l=Object.create(null),t=Object.create(null);for(const c of this._items){const e=c.seq,o=c.group;t[o]=t[o]||[],t[o].push(e),h[e]=c.before;for(const f of c.after)l[f]=l[f]||[],l[f].push(e)}for(const c in h){const e=[];for(const o in h[c]){const f=h[c][o];t[f]=t[f]||[],e.push(...t[f])}h[c]=e}for(const c in l)if(t[c])for(const e of t[c])h[e].push(...l[c]);const a={};for(const c in h){const e=h[c];for(const o of e)a[o]=a[o]||[],a[o].push(c)}const n={},s=[];for(let c=0;c<this._items.length;++c){let e=c;if(a[c]){e=null;for(let o=0;o<this._items.length;++o){if(n[o]===!0)continue;a[o]||(a[o]=[]);const f=a[o].length;let m=0;for(let y=0;y<f;++y)n[a[o][y]]&&++m;if(m===f){e=o;break}}}e!==null&&(n[e]=!0,s.push(e))}if(s.length!==this._items.length)return!1;const r={};for(const c of this._items)r[c.seq]=c;this._items=[],this.nodes=[];for(const c of s){const e=r[c];this.nodes.push(e.node),this._items.push(e)}return!0}},g.mergeSort=(h,l)=>h.sort===l.sort?0:h.sort<l.sort?-1:1},5380:(S,w,p)=>{const i=p(443),g=p(2178),h={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:i.URL||URL};w.analyze=function(l,t={}){if(!l)return g.code("DOMAIN_NON_EMPTY_STRING");if(typeof l!="string")throw new Error("Invalid input: domain must be a string");if(l.length>256)return g.code("DOMAIN_TOO_LONG");if(h.nonAsciiRx.test(l)){if(t.allowUnicode===!1)return g.code("DOMAIN_INVALID_UNICODE_CHARS");l=l.normalize("NFC")}if(h.domainControlRx.test(l))return g.code("DOMAIN_INVALID_CHARS");l=h.punycode(l),t.allowFullyQualified&&l[l.length-1]==="."&&(l=l.slice(0,-1));const a=t.minDomainSegments||h.minDomainSegments,n=l.split(".");if(n.length<a)return g.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&n.length>t.maxDomainSegments)return g.code("DOMAIN_SEGMENTS_COUNT_MAX");const s=t.tlds;if(s){const r=n[n.length-1].toLowerCase();if(s.deny&&s.deny.has(r)||s.allow&&!s.allow.has(r))return g.code("DOMAIN_FORBIDDEN_TLDS")}for(let r=0;r<n.length;++r){const c=n[r];if(!c.length)return g.code("DOMAIN_EMPTY_SEGMENT");if(c.length>63)return g.code("DOMAIN_LONG_SEGMENT");if(r<n.length-1){if(!h.domainSegmentRx.test(c))return g.code("DOMAIN_INVALID_CHARS")}else if(!h.tldSegmentRx.test(c))return g.code("DOMAIN_INVALID_TLDS_CHARS")}return null},w.isValid=function(l,t){return!w.analyze(l,t)},h.punycode=function(l){l.includes("%")&&(l=l.replace(/%/g,"%25"));try{return new h.URL(`http://${l}`).host}catch{return l}}},1745:(S,w,p)=>{const i=p(9848),g=p(5380),h=p(2178),l={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(i.TextEncoder||TextEncoder)};w.analyze=function(t,a){return l.email(t,a)},w.isValid=function(t,a){return!l.email(t,a)},l.email=function(t,a={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return h.code("EMPTY_STRING");const n=!l.nonAsciiRx.test(t);if(!n){if(a.allowUnicode===!1)return h.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}const s=t.split("@");if(s.length!==2)return s.length>2?h.code("MULTIPLE_AT_CHAR"):h.code("MISSING_AT_CHAR");const[r,c]=s;if(!r)return h.code("EMPTY_LOCAL");if(!a.ignoreLength){if(t.length>254)return h.code("ADDRESS_TOO_LONG");if(l.encoder.encode(r).length>64)return h.code("LOCAL_TOO_LONG")}return l.local(r,n)||g.analyze(c,a)},l.local=function(t,a){const n=t.split(".");for(const s of n){if(!s.length)return h.code("EMPTY_LOCAL_SEGMENT");if(a){if(!l.atextRx.test(s))return h.code("INVALID_LOCAL_CHARS")}else for(const r of s){if(l.atextRx.test(r))continue;const c=l.binary(r);if(!l.atomRx.test(c))return h.code("INVALID_LOCAL_CHARS")}}},l.binary=function(t){return Array.from(l.encoder.encode(t)).map(a=>String.fromCharCode(a)).join("")},l.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,l.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(S,w)=>{w.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},w.code=function(p){return{code:p,error:w.codes[p]}}},9959:(S,w,p)=>{const i=p(375),g=p(5752);w.regex=function(h={}){i(h.cidr===void 0||typeof h.cidr=="string","options.cidr must be a string");const l=h.cidr?h.cidr.toLowerCase():"optional";i(["required","optional","forbidden"].includes(l),"options.cidr must be one of required, optional, forbidden"),i(h.version===void 0||typeof h.version=="string"||Array.isArray(h.version),"options.version must be a string or an array of string");let t=h.version||["ipv4","ipv6","ipvfuture"];Array.isArray(t)||(t=[t]),i(t.length>=1,"options.version must have at least 1 version specified");for(let s=0;s<t.length;++s)i(typeof t[s]=="string","options.version must only contain strings"),t[s]=t[s].toLowerCase(),i(["ipv4","ipv6","ipvfuture"].includes(t[s]),"options.version contains unknown version "+t[s]+" - must be one of ipv4, ipv6, ipvfuture");t=Array.from(new Set(t));const a=`(?:${t.map(s=>{if(l==="forbidden")return g.ip[s];const r=`\\/${s==="ipv4"?g.ip.v4Cidr:g.ip.v6Cidr}`;return l==="required"?`${g.ip[s]}${r}`:`${g.ip[s]}(?:${r})?`}).join("|")})`,n=new RegExp(`^${a}$`);return{cidr:l,versions:t,regex:n,raw:a}}},5752:(S,w,p)=>{const i=p(375),g=p(6064),h={generate:function(){const l={},t="\\dA-Fa-f",a="["+t+"]",n="\\w-\\.~",s="!\\$&'\\(\\)\\*\\+,;=",r="%"+t,c=n+r+s+":@",e="["+c+"]",o="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";l.ipv4address="(?:"+o+"\\.){3}"+o;const f=a+"{1,4}",m="(?:"+f+":"+f+"|"+l.ipv4address+")",y="(?:"+f+":){6}"+m,R="::(?:"+f+":){5}"+m,_="(?:"+f+")?::(?:"+f+":){4}"+m,u="(?:(?:"+f+":){0,1}"+f+")?::(?:"+f+":){3}"+m,d="(?:(?:"+f+":){0,2}"+f+")?::(?:"+f+":){2}"+m,v="(?:(?:"+f+":){0,3}"+f+")?::"+f+":"+m,E="(?:(?:"+f+":){0,4}"+f+")?::"+m,k="(?:(?:"+f+":){0,5}"+f+")?::"+f,O="(?:(?:"+f+":){0,6}"+f+")?::";l.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",l.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",l.ipv6address="(?:"+y+"|"+R+"|"+_+"|"+u+"|"+d+"|"+v+"|"+E+"|"+k+"|"+O+")",l.ipvFuture="v"+a+"+\\.["+n+s+":]+",l.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",l.schemeRegex=new RegExp(l.scheme);const A="["+n+r+s+":]*",I="["+n+r+s+"]{1,255}",T="(?:\\[(?:"+l.ipv6address+"|"+l.ipvFuture+")\\]|"+l.ipv4address+"|"+I+")",F="(?:"+A+"@)?"+T+"(?::\\d*)?",K="(?:"+A+"@)?("+T+")(?::\\d*)?",V=e+"*",z=e+"+",P="(?:\\/"+V+")*",X="\\/(?:"+z+P+")?",Z=z+P,J="["+n+r+s+"@]+"+P,Q="(?:\\/\\/\\/"+V+P+")";return l.hierPart="(?:(?:\\/\\/"+F+P+")|"+X+"|"+Z+"|"+Q+")",l.hierPartCapture="(?:(?:\\/\\/"+K+P+")|"+X+"|"+Z+")",l.relativeRef="(?:(?:\\/\\/"+F+P+")|"+X+"|"+J+"|)",l.relativeRefCapture="(?:(?:\\/\\/"+K+P+")|"+X+"|"+J+"|)",l.query="["+c+"\\/\\?]*(?=#|$)",l.queryWithSquareBrackets="["+c+"\\[\\]\\/\\?]*(?=#|$)",l.fragment="["+c+"\\/\\?]*",l}};h.rfc3986=h.generate(),w.ip={v4Cidr:h.rfc3986.ipv4Cidr,v6Cidr:h.rfc3986.ipv6Cidr,ipv4:h.rfc3986.ipv4address,ipv6:h.rfc3986.ipv6address,ipvfuture:h.rfc3986.ipvFuture},h.createRegex=function(l){const t=h.rfc3986,a="(?:\\?"+(l.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",n=l.domain?t.relativeRefCapture:t.relativeRef;if(l.relativeOnly)return h.wrap(n+a);let s="";if(l.scheme){i(l.scheme instanceof RegExp||typeof l.scheme=="string"||Array.isArray(l.scheme),"scheme must be a RegExp, String, or Array");const e=[].concat(l.scheme);i(e.length>=1,"scheme must have at least 1 scheme specified");const o=[];for(let f=0;f<e.length;++f){const m=e[f];i(m instanceof RegExp||typeof m=="string","scheme at position "+f+" must be a RegExp or String"),m instanceof RegExp?o.push(m.source.toString()):(i(t.schemeRegex.test(m),"scheme at position "+f+" must be a valid scheme"),o.push(g(m)))}s=o.join("|")}const r="(?:"+(s?"(?:"+s+")":t.scheme)+":"+(l.domain?t.hierPartCapture:t.hierPart)+")",c=l.allowRelative?"(?:"+r+"|"+n+")":r;return h.wrap(c+a,s)},h.wrap=function(l,t){return{raw:l=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${l}`,regex:new RegExp(`^${l}$`),scheme:t}},h.uriRegex=h.createRegex({}),w.regex=function(l={}){return l.scheme||l.allowRelative||l.relativeOnly||l.allowQuerySquareBrackets||l.domain?h.createRegex(l):h.uriRegex}},1447:(S,w)=>{const p={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};w.Parser=class{constructor(i,g={}){if(!g[p.settings]&&g.constants)for(const h in g.constants){const l=g.constants[h];if(l!==null&&!["boolean","number","string"].includes(typeof l))throw new Error(`Formula constant ${h} contains invalid ${typeof l} value type`)}this.settings=g[p.settings]?g:Object.assign({[p.settings]:!0,constants:{},functions:{}},g),this.single=null,this._parts=null,this._parse(i)}_parse(i){let g=[],h="",l=0,t=!1;const a=s=>{if(l)throw new Error("Formula missing closing parenthesis");const r=g.length?g[g.length-1]:null;if(t||h||s){if(r&&r.type==="reference"&&s===")")return r.type="function",r.value=this._subFormula(h,r.value),void(h="");if(s===")"){const c=new w.Parser(h,this.settings);g.push({type:"segment",value:c})}else if(t){if(t==="]")return g.push({type:"reference",value:h}),void(h="");g.push({type:"literal",value:h})}else if(p.operatorCharacters.includes(h))r&&r.type==="operator"&&p.operators.includes(r.value+h)?r.value+=h:g.push({type:"operator",value:h});else if(h.match(p.numberRx))g.push({type:"constant",value:parseFloat(h)});else if(this.settings.constants[h]!==void 0)g.push({type:"constant",value:this.settings.constants[h]});else{if(!h.match(p.tokenRx))throw new Error(`Formula contains invalid token: ${h}`);g.push({type:"reference",value:h})}h=""}};for(const s of i)t?s===t?(a(),t=!1):h+=s:l?s==="("?(h+=s,++l):s===")"?(--l,l?h+=s:a(s)):h+=s:s in p.literals?t=p.literals[s]:s==="("?(a(),++l):p.operatorCharacters.includes(s)?(a(),h=s,a()):s!==" "?h+=s:a();a(),g=g.map((s,r)=>s.type!=="operator"||s.value!=="-"||r&&g[r-1].type!=="operator"?s:{type:"operator",value:"n"});let n=!1;for(const s of g){if(s.type==="operator"){if(p.operatorsPrefix.includes(s.value))continue;if(!n)throw new Error("Formula contains an operator in invalid position");if(!p.operators.includes(s.value))throw new Error(`Formula contains an unknown operator ${s.value}`)}else if(n)throw new Error("Formula missing expected operator");n=!n}if(!n)throw new Error("Formula contains invalid trailing operator");g.length===1&&["reference","literal","constant"].includes(g[0].type)&&(this.single={type:g[0].type==="reference"?"reference":"value",value:g[0].value}),this._parts=g.map(s=>{if(s.type==="operator")return p.operatorsPrefix.includes(s.value)?s:s.value;if(s.type!=="reference")return s.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(s.value))throw new Error(`Formula contains invalid reference ${s.value}`);return this.settings.reference?this.settings.reference(s.value):p.reference(s.value)})}_subFormula(i,g){const h=this.settings.functions[g];if(typeof h!="function")throw new Error(`Formula contains unknown function ${g}`);let l=[];if(i){let t="",a=0,n=!1;const s=()=>{if(!t)throw new Error(`Formula contains function ${g} with invalid arguments ${i}`);l.push(t),t=""};for(let r=0;r<i.length;++r){const c=i[r];n?(t+=c,c===n&&(n=!1)):c in p.literals&&!a?(t+=c,n=p.literals[c]):c!==","||a?(t+=c,c==="("?++a:c===")"&&--a):s()}s()}return l=l.map(t=>new w.Parser(t,this.settings)),function(t){const a=[];for(const n of l)a.push(n.evaluate(t));return h.call(t,...a)}}evaluate(i){const g=this._parts.slice();for(let h=g.length-2;h>=0;--h){const l=g[h];if(l&&l.type==="operator"){const t=g[h+1];g.splice(h+1,1);const a=p.evaluate(t,i);g[h]=p.single(l.value,a)}}return p.operatorsOrder.forEach(h=>{for(let l=1;l<g.length-1;)if(h.includes(g[l])){const t=g[l],a=p.evaluate(g[l-1],i),n=p.evaluate(g[l+1],i);g.splice(l,2);const s=p.calculate(t,a,n);g[l-1]=s===0?0:s}else l+=2}),p.evaluate(g[0],i)}},w.Parser.prototype[p.symbol]=!0,p.reference=function(i){return function(g){return g&&g[i]!==void 0?g[i]:null}},p.evaluate=function(i,g){return i===null?null:typeof i=="function"?i(g):i[p.symbol]?i.evaluate(g):i},p.single=function(i,g){if(i==="!")return!g;const h=-g;return h===0?0:h},p.calculate=function(i,g,h){if(i==="??")return p.exists(g)?g:h;if(typeof g=="string"||typeof h=="string"){if(i==="+")return(g=p.exists(g)?g:"")+(p.exists(h)?h:"")}else switch(i){case"^":return Math.pow(g,h);case"*":return g*h;case"/":return g/h;case"%":return g%h;case"+":return g+h;case"-":return g-h}switch(i){case"<":return g<h;case"<=":return g<=h;case">":return g>h;case">=":return g>=h;case"==":return g===h;case"!=":return g!==h;case"&&":return g&&h;case"||":return g||h}return null},p.exists=function(i){return i!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:S=>{S.exports=JSON.parse('{"version":"17.12.2"}')}},U={},function S(w){var p=U[w];if(p!==void 0)return p.exports;var i=U[w]={exports:{}};return D[w](i,i.exports,S),i.exports}(5107);var D,U})}(Fe)),Fe.exports}var Be,Ze;function xt(){return Ze||(Ze=1,Be={charsWide:["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],charsFullWidth:["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"]}),Be}var Ue,Ye;function kt(){if(Ye)return Ue;Ye=1;const{charsWide:G,charsFullWidth:N}=xt(),D=new RegExp(`[${G.join("")}${N.join("")}]`,"g");return Ue={default:S=>S.replace(D,"xx").length,charsRegex:D},Ue}/*!
1
+ import{dy as lt,ez as ut,eA as ft,eB as mt,eC as De,cJ as ht,eD as dt,dG as pt,eE as gt,V as yt,j as He,eF as vt,aD as bt,eG as _t,o as wt}from"./index-BRwrysOT.js";import{r as Et}from"./index-BdJ8QXo_.js";var q={},Rt=null;const $t=Object.freeze(Object.defineProperty({__proto__:null,default:Rt},Symbol.toStringTag,{value:"Module"})),ct=lt($t);var Fe={exports:{}},Xe;function Ke(){return Xe||(Xe=1,function(G,N){(function(D,U){G.exports=U()})(self,()=>{return D={7629:(S,w,p)=>{const i=p(375),g=p(8571),h=p(9474),l=p(1687),t=p(8652),a=p(8160),n=p(3292),s=p(6354),r=p(8901),c=p(9708),e=p(6914),o=p(2294),f=p(6133),m=p(1152),y=p(8863),R=p(2036),_={Base:class{constructor(u){this.type=u,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new o.Ids,this._preferences=null,this._refs=new f.Manager,this._cache=null,this._valids=null,this._invalids=null,this._flags={},this._rules=[],this._singleRules=new Map,this.$_terms={},this.$_temp={ruleset:null,whens:{}}}describe(){return i(typeof c.describe=="function","Manifest functionality disabled"),c.describe(this)}allow(...u){return a.verifyFlat(u,"allow"),this._values(u,"_valids")}alter(u){i(u&&typeof u=="object"&&!Array.isArray(u),"Invalid targets argument"),i(!this._inRuleset(),"Cannot set alterations inside a ruleset");const d=this.clone();d.$_terms.alterations=d.$_terms.alterations||[];for(const v in u){const E=u[v];i(typeof E=="function","Alteration adjuster for",v,"must be a function"),d.$_terms.alterations.push({target:v,adjuster:E})}return d.$_temp.ruleset=!1,d}artifact(u){return i(u!==void 0,"Artifact cannot be undefined"),i(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",u)}cast(u){return i(u===!1||typeof u=="string","Invalid to value"),i(u===!1||this._definition.cast[u],"Type",this.type,"does not support casting to",u),this.$_setFlag("cast",u===!1?void 0:u)}default(u,d){return this._default("default",u,d)}description(u){return i(u&&typeof u=="string","Description must be a non-empty string"),this.$_setFlag("description",u)}empty(u){const d=this.clone();return u!==void 0&&(u=d.$_compile(u,{override:!1})),d.$_setFlag("empty",u,{clone:!1})}error(u){return i(u,"Missing error"),i(u instanceof Error||typeof u=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",u)}example(u,d={}){return i(u!==void 0,"Missing example"),a.assertOptions(d,["override"]),this._inner("examples",u,{single:!0,override:d.override})}external(u,d){return typeof u=="object"&&(i(!d,"Cannot combine options with description"),d=u.description,u=u.method),i(typeof u=="function","Method must be a function"),i(d===void 0||d&&typeof d=="string","Description must be a non-empty string"),this._inner("externals",{method:u,description:d},{single:!0})}failover(u,d){return this._default("failover",u,d)}forbidden(){return this.presence("forbidden")}id(u){return u?(i(typeof u=="string","id must be a non-empty string"),i(/^[^\.]+$/.test(u),"id cannot contain period character"),this.$_setFlag("id",u)):this.$_setFlag("id",void 0)}invalid(...u){return this._values(u,"_invalids")}label(u){return i(u&&typeof u=="string","Label name must be a non-empty string"),this.$_setFlag("label",u)}meta(u){return i(u!==void 0,"Meta cannot be undefined"),this._inner("metas",u,{single:!0})}note(...u){i(u.length,"Missing notes");for(const d of u)i(d&&typeof d=="string","Notes must be non-empty strings");return this._inner("notes",u)}only(u=!0){return i(typeof u=="boolean","Invalid mode:",u),this.$_setFlag("only",u)}optional(){return this.presence("optional")}prefs(u){i(u,"Missing preferences"),i(u.context===void 0,"Cannot override context"),i(u.externals===void 0,"Cannot override externals"),i(u.warnings===void 0,"Cannot override warnings"),i(u.debug===void 0,"Cannot override debug"),a.checkPreferences(u);const d=this.clone();return d._preferences=a.preferences(d._preferences,u),d}presence(u){return i(["optional","required","forbidden"].includes(u),"Unknown presence mode",u),this.$_setFlag("presence",u)}raw(u=!0){return this.$_setFlag("result",u?"raw":void 0)}result(u){return i(["raw","strip"].includes(u),"Unknown result mode",u),this.$_setFlag("result",u)}required(){return this.presence("required")}strict(u){const d=this.clone(),v=u!==void 0&&!u;return d._preferences=a.preferences(d._preferences,{convert:v}),d}strip(u=!0){return this.$_setFlag("result",u?"strip":void 0)}tag(...u){i(u.length,"Missing tags");for(const d of u)i(d&&typeof d=="string","Tags must be non-empty strings");return this._inner("tags",u)}unit(u){return i(u&&typeof u=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",u)}valid(...u){a.verifyFlat(u,"valid");const d=this.allow(...u);return d.$_setFlag("only",!!d._valids,{clone:!1}),d}when(u,d){const v=this.clone();v.$_terms.whens||(v.$_terms.whens=[]);const E=n.when(v,u,d);if(!["any","link"].includes(v.type)){const k=E.is?[E]:E.switch;for(const O of k)i(!O.then||O.then.type==="any"||O.then.type===v.type,"Cannot combine",v.type,"with",O.then&&O.then.type),i(!O.otherwise||O.otherwise.type==="any"||O.otherwise.type===v.type,"Cannot combine",v.type,"with",O.otherwise&&O.otherwise.type)}return v.$_terms.whens.push(E),v.$_mutateRebuild()}cache(u){i(!this._inRuleset(),"Cannot set caching inside a ruleset"),i(!this._cache,"Cannot override schema cache"),i(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const d=this.clone();return d._cache=u||t.provider.provision(),d.$_temp.ruleset=!1,d}clone(){const u=Object.create(Object.getPrototypeOf(this));return this._assign(u)}concat(u){i(a.isSchema(u),"Invalid schema object"),i(this.type==="any"||u.type==="any"||u.type===this.type,"Cannot merge type",this.type,"with another type:",u.type),i(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),i(!u._inRuleset(),"Cannot concatenate a schema with open ruleset");let d=this.clone();if(this.type==="any"&&u.type!=="any"){const v=u.clone();for(const E of Object.keys(d))E!=="type"&&(v[E]=d[E]);d=v}d._ids.concat(u._ids),d._refs.register(u,f.toSibling),d._preferences=d._preferences?a.preferences(d._preferences,u._preferences):u._preferences,d._valids=R.merge(d._valids,u._valids,u._invalids),d._invalids=R.merge(d._invalids,u._invalids,u._valids);for(const v of u._singleRules.keys())d._singleRules.has(v)&&(d._rules=d._rules.filter(E=>E.keep||E.name!==v),d._singleRules.delete(v));for(const v of u._rules)u._definition.rules[v.method].multi||d._singleRules.set(v.name,v),d._rules.push(v);if(d._flags.empty&&u._flags.empty){d._flags.empty=d._flags.empty.concat(u._flags.empty);const v=Object.assign({},u._flags);delete v.empty,l(d._flags,v)}else if(u._flags.empty){d._flags.empty=u._flags.empty;const v=Object.assign({},u._flags);delete v.empty,l(d._flags,v)}else l(d._flags,u._flags);for(const v in u.$_terms){const E=u.$_terms[v];E?d.$_terms[v]?d.$_terms[v]=d.$_terms[v].concat(E):d.$_terms[v]=E.slice():d.$_terms[v]||(d.$_terms[v]=E)}return this.$_root._tracer&&this.$_root._tracer._combine(d,[this,u]),d.$_mutateRebuild()}extend(u){return i(!u.base,"Cannot extend type with another base"),r.type(this,u)}extract(u){return u=Array.isArray(u)?u:u.split("."),this._ids.reach(u)}fork(u,d){i(!this._inRuleset(),"Cannot fork inside a ruleset");let v=this;for(let E of[].concat(u))E=Array.isArray(E)?E:E.split("."),v=v._ids.fork(E,d,v);return v.$_temp.ruleset=!1,v}rule(u){const d=this._definition;a.assertOptions(u,Object.keys(d.modifiers)),i(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const v=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;i(v>=0&&v<this._rules.length,"Cannot apply rules to empty ruleset");const E=this.clone();for(let k=v;k<E._rules.length;++k){const O=E._rules[k],A=g(O);for(const I in u)d.modifiers[I](A,u[I]),i(A.name===O.name,"Cannot change rule name");E._rules[k]=A,E._singleRules.get(A.name)===O&&E._singleRules.set(A.name,A)}return E.$_temp.ruleset=!1,E.$_mutateRebuild()}get ruleset(){i(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const u=this.clone();return u.$_temp.ruleset=u._rules.length,u}get $(){return this.ruleset}tailor(u){u=[].concat(u),i(!this._inRuleset(),"Cannot tailor inside a ruleset");let d=this;if(this.$_terms.alterations)for(const{target:v,adjuster:E}of this.$_terms.alterations)u.includes(v)&&(d=E(d),i(a.isSchema(d),"Alteration adjuster for",v,"failed to return a schema object"));return d=d.$_modify({each:v=>v.tailor(u),ref:!1}),d.$_temp.ruleset=!1,d.$_mutateRebuild()}tracer(){return m.location?m.location(this):this}validate(u,d){return y.entry(u,this,d)}validateAsync(u,d){return y.entryAsync(u,this,d)}$_addRule(u){typeof u=="string"&&(u={name:u}),i(u&&typeof u=="object","Invalid options"),i(u.name&&typeof u.name=="string","Invalid rule name");for(const O in u)i(O[0]!=="_","Cannot set private rule properties");const d=Object.assign({},u);d._resolve=[],d.method=d.method||d.name;const v=this._definition.rules[d.method],E=d.args;i(v,"Unknown rule",d.method);const k=this.clone();if(E){i(Object.keys(E).length===1||Object.keys(E).length===this._definition.rules[d.name].args.length,"Invalid rule definition for",this.type,d.name);for(const O in E){let A=E[O];if(v.argsByName){const I=v.argsByName.get(O);if(I.ref&&a.isResolvable(A))d._resolve.push(O),k.$_mutateRegister(A);else if(I.normalize&&(A=I.normalize(A),E[O]=A),I.assert){const T=a.validateArg(A,O,I);i(!T,T,"or reference")}}A!==void 0?E[O]=A:delete E[O]}}return v.multi||(k._ruleRemove(d.name,{clone:!1}),k._singleRules.set(d.name,d)),k.$_temp.ruleset===!1&&(k.$_temp.ruleset=null),v.priority?k._rules.unshift(d):k._rules.push(d),k}$_compile(u,d){return n.schema(this.$_root,u,d)}$_createError(u,d,v,E,k,O={}){const A=O.flags!==!1?this._flags:{},I=O.messages?e.merge(this._definition.messages,O.messages):this._definition.messages;return new s.Report(u,d,v,A,I,E,k)}$_getFlag(u){return this._flags[u]}$_getRule(u){return this._singleRules.get(u)}$_mapLabels(u){return u=Array.isArray(u)?u:u.split("."),this._ids.labels(u)}$_match(u,d,v,E){(v=Object.assign({},v)).abortEarly=!0,v._externals=!1,d.snapshot();const k=!y.validate(u,this,d,v,E).errors;return d.restore(),k}$_modify(u){return a.assertOptions(u,["each","once","ref","schema"]),o.schema(this,u)||this}$_mutateRebuild(){return i(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(u,{source:d,name:v,path:E,key:k})=>{const O=this._definition[d][v]&&this._definition[d][v].register;O!==!1&&this.$_mutateRegister(u,{family:O,key:k})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(u,{family:d,key:v}={}){this._refs.register(u,d),this._ids.register(u,{key:v})}$_property(u){return this._definition.properties[u]}$_reach(u){return this._ids.reach(u)}$_rootReferences(){return this._refs.roots()}$_setFlag(u,d,v={}){i(u[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const E=this._definition.flags[u]||{};if(h(d,E.default)&&(d=void 0),h(d,this._flags[u]))return this;const k=v.clone!==!1?this.clone():this;return d!==void 0?(k._flags[u]=d,k.$_mutateRegister(d)):delete k._flags[u],u[0]!=="_"&&(k.$_temp.ruleset=!1),k}$_parent(u,...d){return this[u][a.symbols.parent].call(this,...d)}$_validate(u,d,v){return y.validate(u,this,d,v)}_assign(u){u.type=this.type,u.$_root=this.$_root,u.$_temp=Object.assign({},this.$_temp),u.$_temp.whens={},u._ids=this._ids.clone(),u._preferences=this._preferences,u._valids=this._valids&&this._valids.clone(),u._invalids=this._invalids&&this._invalids.clone(),u._rules=this._rules.slice(),u._singleRules=g(this._singleRules,{shallow:!0}),u._refs=this._refs.clone(),u._flags=Object.assign({},this._flags),u._cache=null,u.$_terms={};for(const d in this.$_terms)u.$_terms[d]=this.$_terms[d]?this.$_terms[d].slice():null;u.$_super={};for(const d in this.$_super)u.$_super[d]=this._super[d].bind(u);return u}_bare(){const u=this.clone();u._reset();const d=u._definition.terms;for(const v in d){const E=d[v];u.$_terms[v]=E.init}return u.$_mutateRebuild()}_default(u,d,v={}){return a.assertOptions(v,"literal"),i(d!==void 0,"Missing",u,"value"),i(typeof d=="function"||!v.literal,"Only function value supports literal option"),typeof d=="function"&&v.literal&&(d={[a.symbols.literal]:!0,literal:d}),this.$_setFlag(u,d)}_generate(u,d,v){if(!this.$_terms.whens)return{schema:this};const E=[],k=[];for(let I=0;I<this.$_terms.whens.length;++I){const T=this.$_terms.whens[I];if(T.concat){E.push(T.concat),k.push(`${I}.concat`);continue}const F=T.ref?T.ref.resolve(u,d,v):u,K=T.is?[T]:T.switch,V=k.length;for(let z=0;z<K.length;++z){const{is:P,then:X,otherwise:Z}=K[z],J=`${I}${T.switch?"."+z:""}`;if(P.$_match(F,d.nest(P,`${J}.is`),v)){if(X){const Q=d.localize([...d.path,`${J}.then`],d.ancestors,d.schemas),{schema:ne,id:ie}=X._generate(u,Q,v);E.push(ne),k.push(`${J}.then${ie?`(${ie})`:""}`);break}}else if(Z){const Q=d.localize([...d.path,`${J}.otherwise`],d.ancestors,d.schemas),{schema:ne,id:ie}=Z._generate(u,Q,v);E.push(ne),k.push(`${J}.otherwise${ie?`(${ie})`:""}`);break}}if(T.break&&k.length>V)break}const O=k.join(", ");if(d.mainstay.tracer.debug(d,"rule","when",O),!O)return{schema:this};if(!d.mainstay.tracer.active&&this.$_temp.whens[O])return{schema:this.$_temp.whens[O],id:O};let A=this;this._definition.generate&&(A=this._definition.generate(this,u,d,v));for(const I of E)A=A.concat(I);return this.$_root._tracer&&this.$_root._tracer._combine(A,[this,...E]),this.$_temp.whens[O]=A,{schema:A,id:O}}_inner(u,d,v={}){i(!this._inRuleset(),`Cannot set ${u} inside a ruleset`);const E=this.clone();return E.$_terms[u]&&!v.override||(E.$_terms[u]=[]),v.single?E.$_terms[u].push(d):E.$_terms[u].push(...d),E.$_temp.ruleset=!1,E}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(u,d={}){if(!this._singleRules.has(u))return this;const v=d.clone!==!1?this.clone():this;v._singleRules.delete(u);const E=[];for(let k=0;k<v._rules.length;++k){const O=v._rules[k];O.name!==u||O.keep?E.push(O):v._inRuleset()&&k<v.$_temp.ruleset&&--v.$_temp.ruleset}return v._rules=E,v}_values(u,d){a.verifyFlat(u,d.slice(1,-1));const v=this.clone(),E=u[0]===a.symbols.override;if(E&&(u=u.slice(1)),!v[d]&&u.length?v[d]=new R:E&&(v[d]=u.length?new R:null,v.$_mutateRebuild()),!v[d])return v;E&&v[d].override();for(const k of u){i(k!==void 0,"Cannot call allow/valid/invalid with undefined"),i(k!==a.symbols.override,"Override must be the first value");const O=d==="_invalids"?"_valids":"_invalids";v[O]&&(v[O].remove(k),v[O].length||(i(d==="_valids"||!v._flags.only,"Setting invalid value",k,"leaves schema rejecting all values due to previous valid rule"),v[O]=null)),v[d].add(k,v._refs)}return v}}};_.Base.prototype[a.symbols.any]={version:a.version,compile:n.compile,root:"$_root"},_.Base.prototype.isImmutable=!0,_.Base.prototype.deny=_.Base.prototype.invalid,_.Base.prototype.disallow=_.Base.prototype.invalid,_.Base.prototype.equal=_.Base.prototype.valid,_.Base.prototype.exist=_.Base.prototype.required,_.Base.prototype.not=_.Base.prototype.invalid,_.Base.prototype.options=_.Base.prototype.prefs,_.Base.prototype.preferences=_.Base.prototype.prefs,S.exports=new _.Base},8652:(S,w,p)=>{const i=p(375),g=p(8571),h=p(8160),l={max:1e3,supported:new Set(["undefined","boolean","number","string"])};w.provider={provision:t=>new l.Cache(t)},l.Cache=class{constructor(t={}){h.assertOptions(t,["max"]),i(t.max===void 0||t.max&&t.max>0&&isFinite(t.max),"Invalid max cache size"),this._max=t.max||l.max,this._map=new Map,this._list=new l.List}get length(){return this._map.size}set(t,a){if(t!==null&&!l.supported.has(typeof t))return;let n=this._map.get(t);if(n)return n.value=a,void this._list.first(n);n=this._list.unshift({key:t,value:a}),this._map.set(t,n),this._compact()}get(t){const a=this._map.get(t);if(a)return this._list.first(a),g(a.value)}_compact(){if(this._map.size>this._max){const t=this._list.pop();this._map.delete(t.key)}}},l.List=class{constructor(){this.tail=null,this.head=null}unshift(t){return t.next=null,t.prev=this.head,this.head&&(this.head.next=t),this.head=t,this.tail||(this.tail=t),t}first(t){t!==this.head&&(this._remove(t),this.unshift(t))}pop(){return this._remove(this.tail)}_remove(t){const{next:a,prev:n}=t;return a.prev=n,n&&(n.next=a),t===this.tail&&(this.tail=a),t.prev=null,t.next=null,t}}},8160:(S,w,p)=>{const i=p(375),g=p(7916),h=p(5934);let l,t;const a={isoDate:/^(?:[-+]\d{2})?(?:\d{4}(?!\d{2}\b))(?:(-?)(?:(?:0[1-9]|1[0-2])(?:\1(?:[12]\d|0[1-9]|3[01]))?|W(?:[0-4]\d|5[0-2])(?:-?[1-7])?|(?:00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[1-6])))(?![T]$|[T][\d]+Z$)(?:[T\s](?:(?:(?:[01]\d|2[0-3])(?:(:?)[0-5]\d)?|24\:?00)(?:[.,]\d+(?!:))?)(?:\2[0-5]\d(?:[.,]\d+)?)?(?:[Z]|(?:[+-])(?:[01]\d|2[0-3])(?::?[0-5]\d)?)?)?)?$/};w.version=h.version,w.defaults={abortEarly:!0,allowUnknown:!1,artifacts:!1,cache:!0,context:null,convert:!0,dateFormat:"iso",errors:{escapeHtml:!1,label:"path",language:null,render:!0,stack:!1,wrap:{label:'"',array:"[]"}},externals:!0,messages:{},nonEnumerables:!1,noDefaults:!1,presence:"optional",skipFunctions:!1,stripUnknown:!1,warnings:!1},w.symbols={any:Symbol.for("@hapi/joi/schema"),arraySingle:Symbol("arraySingle"),deepDefault:Symbol("deepDefault"),errors:Symbol("errors"),literal:Symbol("literal"),override:Symbol("override"),parent:Symbol("parent"),prefs:Symbol("prefs"),ref:Symbol("ref"),template:Symbol("template"),values:Symbol("values")},w.assertOptions=function(n,s,r="Options"){i(n&&typeof n=="object"&&!Array.isArray(n),"Options must be of type object");const c=Object.keys(n).filter(e=>!s.includes(e));i(c.length===0,`${r} contain unknown keys: ${c}`)},w.checkPreferences=function(n){t=t||p(3378);const s=t.preferences.validate(n);if(s.error)throw new g([s.error.details[0].message])},w.compare=function(n,s,r){switch(r){case"=":return n===s;case">":return n>s;case"<":return n<s;case">=":return n>=s;case"<=":return n<=s}},w.default=function(n,s){return n===void 0?s:n},w.isIsoDate=function(n){return a.isoDate.test(n)},w.isNumber=function(n){return typeof n=="number"&&!isNaN(n)},w.isResolvable=function(n){return!!n&&(n[w.symbols.ref]||n[w.symbols.template])},w.isSchema=function(n,s={}){const r=n&&n[w.symbols.any];return!!r&&(i(s.legacy||r.version===w.version,"Cannot mix different versions of joi schemas"),!0)},w.isValues=function(n){return n[w.symbols.values]},w.limit=function(n){return Number.isSafeInteger(n)&&n>=0},w.preferences=function(n,s){l=l||p(6914),n=n||{},s=s||{};const r=Object.assign({},n,s);return s.errors&&n.errors&&(r.errors=Object.assign({},n.errors,s.errors),r.errors.wrap=Object.assign({},n.errors.wrap,s.errors.wrap)),s.messages&&(r.messages=l.compile(s.messages,n.messages)),delete r[w.symbols.prefs],r},w.tryWithPath=function(n,s,r={}){try{return n()}catch(c){throw c.path!==void 0?c.path=s+"."+c.path:c.path=s,r.append&&(c.message=`${c.message} (${c.path})`),c}},w.validateArg=function(n,s,{assert:r,message:c}){if(w.isSchema(r)){const e=r.validate(n);return e.error?e.error.message:void 0}if(!r(n))return s?`${s} ${c}`:c},w.verifyFlat=function(n,s){for(const r of n)i(!Array.isArray(r),"Method no longer accepts array arguments:",s)}},3292:(S,w,p)=>{const i=p(375),g=p(8160),h=p(6133),l={};w.schema=function(t,a,n={}){g.assertOptions(n,["appendPath","override"]);try{return l.schema(t,a,n)}catch(s){throw n.appendPath&&s.path!==void 0&&(s.message=`${s.message} (${s.path})`),s}},l.schema=function(t,a,n){i(a!==void 0,"Invalid undefined schema"),Array.isArray(a)&&(i(a.length,"Invalid empty array schema"),a.length===1&&(a=a[0]));const s=(r,...c)=>n.override!==!1?r.valid(t.override,...c):r.valid(...c);if(l.simple(a))return s(t,a);if(typeof a=="function")return t.custom(a);if(i(typeof a=="object","Invalid schema content:",typeof a),g.isResolvable(a))return s(t,a);if(g.isSchema(a))return a;if(Array.isArray(a)){for(const r of a)if(!l.simple(r))return t.alternatives().try(...a);return s(t,...a)}return a instanceof RegExp?t.string().regex(a):a instanceof Date?s(t.date(),a):(i(Object.getPrototypeOf(a)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),t.object().keys(a))},w.ref=function(t,a){return h.isRef(t)?t:h.create(t,a)},w.compile=function(t,a,n={}){g.assertOptions(n,["legacy"]);const s=a&&a[g.symbols.any];if(s)return i(n.legacy||s.version===g.version,"Cannot mix different versions of joi schemas:",s.version,g.version),a;if(typeof a!="object"||!n.legacy)return w.schema(t,a,{appendPath:!0});const r=l.walk(a);return r?r.compile(r.root,a):w.schema(t,a,{appendPath:!0})},l.walk=function(t){if(typeof t!="object")return null;if(Array.isArray(t)){for(const n of t){const s=l.walk(n);if(s)return s}return null}const a=t[g.symbols.any];if(a)return{root:t[a.root],compile:a.compile};i(Object.getPrototypeOf(t)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const n in t){const s=l.walk(t[n]);if(s)return s}return null},l.simple=function(t){return t===null||["boolean","string","number"].includes(typeof t)},w.when=function(t,a,n){if(n===void 0&&(i(a&&typeof a=="object","Missing options"),n=a,a=h.create(".")),Array.isArray(n)&&(n={switch:n}),g.assertOptions(n,["is","not","then","otherwise","switch","break"]),g.isSchema(a))return i(n.is===void 0,'"is" can not be used with a schema condition'),i(n.not===void 0,'"not" can not be used with a schema condition'),i(n.switch===void 0,'"switch" can not be used with a schema condition'),l.condition(t,{is:a,then:n.then,otherwise:n.otherwise,break:n.break});if(i(h.isRef(a)||typeof a=="string","Invalid condition:",a),i(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let r=n;n.not!==void 0&&(r={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let c=r.is!==void 0?t.$_compile(r.is):t.$_root.invalid(null,!1,0,"").required();return i(r.then!==void 0||r.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),i(r.break===void 0||r.then===void 0||r.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is===void 0||h.isRef(n.is)||g.isSchema(n.is)||(c=c.required()),l.condition(t,{ref:w.ref(a),is:c,then:r.then,otherwise:r.otherwise,break:r.break})}i(Array.isArray(n.switch),'"switch" must be an array'),i(n.is===void 0,'Cannot combine "switch" with "is"'),i(n.not===void 0,'Cannot combine "switch" with "not"'),i(n.then===void 0,'Cannot combine "switch" with "then"');const s={ref:w.ref(a),switch:[],break:n.break};for(let r=0;r<n.switch.length;++r){const c=n.switch[r],e=r===n.switch.length-1;g.assertOptions(c,e?["is","then","otherwise"]:["is","then"]),i(c.is!==void 0,'Switch statement missing "is"'),i(c.then!==void 0,'Switch statement missing "then"');const o={is:t.$_compile(c.is),then:t.$_compile(c.then)};if(h.isRef(c.is)||g.isSchema(c.is)||(o.is=o.is.required()),e){i(n.otherwise===void 0||c.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const f=n.otherwise!==void 0?n.otherwise:c.otherwise;f!==void 0&&(i(s.break===void 0,"Cannot specify both otherwise and break"),o.otherwise=t.$_compile(f))}s.switch.push(o)}return s},l.condition=function(t,a){for(const n of["then","otherwise"])a[n]===void 0?delete a[n]:a[n]=t.$_compile(a[n]);return a}},6354:(S,w,p)=>{const i=p(5688),g=p(8160),h=p(3328);w.Report=class{constructor(l,t,a,n,s,r,c){if(this.code=l,this.flags=n,this.messages=s,this.path=r.path,this.prefs=c,this.state=r,this.value=t,this.message=null,this.template=null,this.local=a||{},this.local.label=w.label(this.flags,this.state,this.prefs,this.messages),this.value===void 0||this.local.hasOwnProperty("value")||(this.local.value=this.value),this.path.length){const e=this.path[this.path.length-1];typeof e!="object"&&(this.local.key=e)}}_setTemplate(l){if(this.template=l,!this.flags.label&&this.path.length===0){const t=this._template(this.template,"root");t&&(this.local.label=t)}}toString(){if(this.message)return this.message;const l=this.code;if(!this.prefs.errors.render)return this.code;const t=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return t===void 0?`Error code "${l}" is not defined, your custom type is missing the correct messages definition`:(this.message=t.render(this.value,this.state,this.prefs,this.local,{errors:this.prefs.errors,messages:[this.prefs.messages,this.messages]}),this.prefs.errors.label||(this.message=this.message.replace(/^"" /,"").trim()),this.message)}_template(l,t){return w.template(this.value,l,t||this.code,this.state,this.prefs)}},w.path=function(l){let t="";for(const a of l)typeof a!="object"&&(typeof a=="string"?(t&&(t+="."),t+=a):t+=`[${a}]`);return t},w.template=function(l,t,a,n,s){if(!t)return;if(h.isTemplate(t))return a!=="root"?t:null;let r=s.errors.language;if(g.isResolvable(r)&&(r=r.resolve(l,n,s)),r&&t[r]){if(t[r][a]!==void 0)return t[r][a];if(t[r]["*"]!==void 0)return t[r]["*"]}return t[a]?t[a]:t["*"]},w.label=function(l,t,a,n){if(l.label)return l.label;if(!a.errors.label)return"";let s=t.path;return a.errors.label==="key"&&t.path.length>1&&(s=t.path.slice(-1)),w.path(s)||w.template(null,a.messages,"root",t,a)||n&&w.template(null,n,"root",t,a)||"value"},w.process=function(l,t,a){if(!l)return null;const{override:n,message:s,details:r}=w.details(l);if(n)return n;if(a.errors.stack)return new w.ValidationError(s,r,t);const c=Error.stackTraceLimit;Error.stackTraceLimit=0;const e=new w.ValidationError(s,r,t);return Error.stackTraceLimit=c,e},w.details=function(l,t={}){let a=[];const n=[];for(const s of l){if(s instanceof Error){if(t.override!==!1)return{override:s};const c=s.toString();a.push(c),n.push({message:c,type:"override",context:{error:s}});continue}const r=s.toString();a.push(r),n.push({message:r,path:s.path.filter(c=>typeof c!="object"),type:s.code,context:s.local})}return a.length>1&&(a=[...new Set(a)]),{message:a.join(". "),details:n}},w.ValidationError=class extends Error{constructor(l,t,a){super(l),this._original=a,this.details=t}static isError(l){return l instanceof w.ValidationError}},w.ValidationError.prototype.isJoi=!0,w.ValidationError.prototype.name="ValidationError",w.ValidationError.prototype.annotate=i.error},8901:(S,w,p)=>{const i=p(375),g=p(8571),h=p(8160),l=p(6914),t={};w.type=function(a,n){const s=Object.getPrototypeOf(a),r=g(s),c=a._assign(Object.create(r)),e=Object.assign({},n);delete e.base,r._definition=e;const o=s._definition||{};e.messages=l.merge(o.messages,e.messages),e.properties=Object.assign({},o.properties,e.properties),c.type=e.type,e.flags=Object.assign({},o.flags,e.flags);const f=Object.assign({},o.terms);if(e.terms)for(const _ in e.terms){const u=e.terms[_];i(c.$_terms[_]===void 0,"Invalid term override for",e.type,_),c.$_terms[_]=u.init,f[_]=u}e.terms=f,e.args||(e.args=o.args),e.prepare=t.prepare(e.prepare,o.prepare),e.coerce&&(typeof e.coerce=="function"&&(e.coerce={method:e.coerce}),e.coerce.from&&!Array.isArray(e.coerce.from)&&(e.coerce={method:e.coerce.method,from:[].concat(e.coerce.from)})),e.coerce=t.coerce(e.coerce,o.coerce),e.validate=t.validate(e.validate,o.validate);const m=Object.assign({},o.rules);if(e.rules)for(const _ in e.rules){const u=e.rules[_];i(typeof u=="object","Invalid rule definition for",e.type,_);let d=u.method;if(d===void 0&&(d=function(){return this.$_addRule(_)}),d&&(i(!r[_],"Rule conflict in",e.type,_),r[_]=d),i(!m[_],"Rule conflict in",e.type,_),m[_]=u,u.alias){const v=[].concat(u.alias);for(const E of v)r[E]=u.method}u.args&&(u.argsByName=new Map,u.args=u.args.map(v=>(typeof v=="string"&&(v={name:v}),i(!u.argsByName.has(v.name),"Duplicated argument name",v.name),h.isSchema(v.assert)&&(v.assert=v.assert.strict().label(v.name)),u.argsByName.set(v.name,v),v)))}e.rules=m;const y=Object.assign({},o.modifiers);if(e.modifiers)for(const _ in e.modifiers){i(!r[_],"Rule conflict in",e.type,_);const u=e.modifiers[_];i(typeof u=="function","Invalid modifier definition for",e.type,_);const d=function(v){return this.rule({[_]:v})};r[_]=d,y[_]=u}if(e.modifiers=y,e.overrides){r._super=s,c.$_super={};for(const _ in e.overrides)i(s[_],"Cannot override missing",_),e.overrides[_][h.symbols.parent]=s[_],c.$_super[_]=s[_].bind(c);Object.assign(r,e.overrides)}e.cast=Object.assign({},o.cast,e.cast);const R=Object.assign({},o.manifest,e.manifest);return R.build=t.build(e.manifest&&e.manifest.build,o.manifest&&o.manifest.build),e.manifest=R,e.rebuild=t.rebuild(e.rebuild,o.rebuild),c},t.build=function(a,n){return a&&n?function(s,r){return n(a(s,r),r)}:a||n},t.coerce=function(a,n){return a&&n?{from:a.from&&n.from?[...new Set([...a.from,...n.from])]:null,method(s,r){let c;if((!n.from||n.from.includes(typeof s))&&(c=n.method(s,r),c)){if(c.errors||c.value===void 0)return c;s=c.value}if(!a.from||a.from.includes(typeof s)){const e=a.method(s,r);if(e)return e}return c}}:a||n},t.prepare=function(a,n){return a&&n?function(s,r){const c=a(s,r);if(c){if(c.errors||c.value===void 0)return c;s=c.value}return n(s,r)||c}:a||n},t.rebuild=function(a,n){return a&&n?function(s){n(s),a(s)}:a||n},t.validate=function(a,n){return a&&n?function(s,r){const c=n(s,r);if(c){if(c.errors&&(!Array.isArray(c.errors)||c.errors.length))return c;s=c.value}return a(s,r)||c}:a||n}},5107:(S,w,p)=>{const i=p(375),g=p(8571),h=p(8652),l=p(8160),t=p(3292),a=p(6354),n=p(8901),s=p(9708),r=p(6133),c=p(3328),e=p(1152);let o;const f={types:{alternatives:p(4946),any:p(8068),array:p(546),boolean:p(4937),date:p(7500),function:p(390),link:p(8785),number:p(3832),object:p(8966),string:p(7417),symbol:p(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const m={_types:new Set(Object.keys(f.types))};for(const y of m._types)m[y]=function(...R){return i(!R.length||["alternatives","link","object"].includes(y),"The",y,"type does not allow arguments"),f.generate(this,f.types[y],R)};for(const y of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])m[y]=function(...R){return this.any()[y](...R)};Object.assign(m,f.methods);for(const y in f.aliases){const R=f.aliases[y];m[y]=m[R]}return m.x=m.expression,e.setup&&e.setup(m),m}};f.methods={ValidationError:a.ValidationError,version:l.version,cache:h.provider,assert(m,y,...R){f.assert(m,y,!0,R)},attempt:(m,y,...R)=>f.assert(m,y,!1,R),build(m){return i(typeof s.build=="function","Manifest functionality disabled"),s.build(this,m)},checkPreferences(m){l.checkPreferences(m)},compile(m,y){return t.compile(this,m,y)},defaults(m){i(typeof m=="function","modifier must be a function");const y=Object.assign({},this);for(const R of y._types){const _=m(y[R]());i(l.isSchema(_),"modifier must return a valid schema object"),y[R]=function(...u){return f.generate(this,_,u)}}return y},expression:(...m)=>new c(...m),extend(...m){l.verifyFlat(m,"extend"),o=o||p(3378),i(m.length,"You need to provide at least one extension"),this.assert(m,o.extensions);const y=Object.assign({},this);y._types=new Set(y._types);for(let R of m){typeof R=="function"&&(R=R(y)),this.assert(R,o.extension);const _=f.expandExtension(R,y);for(const u of _){i(y[u.type]===void 0||y._types.has(u.type),"Cannot override name",u.type);const d=u.base||this.any(),v=n.type(d,u);y._types.add(u.type),y[u.type]=function(...E){return f.generate(this,v,E)}}}return y},isError:a.ValidationError.isError,isExpression:c.isTemplate,isRef:r.isRef,isSchema:l.isSchema,in:(...m)=>r.in(...m),override:l.symbols.override,ref:(...m)=>r.create(...m),types(){const m={};for(const y of this._types)m[y]=this[y]();for(const y in f.aliases)m[y]=this[y]();return m}},f.assert=function(m,y,R,_){const u=_[0]instanceof Error||typeof _[0]=="string"?_[0]:null,d=u!==null?_[1]:_[0],v=y.validate(m,l.preferences({errors:{stack:!0}},d||{}));let E=v.error;if(!E)return v.value;if(u instanceof Error)throw u;const k=R&&typeof E.annotate=="function"?E.annotate():E.message;throw E instanceof a.ValidationError==0&&(E=g(E)),E.message=u?`${u} ${k}`:k,E},f.generate=function(m,y,R){return i(m,"Must be invoked on a Joi instance."),y.$_root=m,y._definition.args&&R.length?y._definition.args(y,...R):y},f.expandExtension=function(m,y){if(typeof m.type=="string")return[m];const R=[];for(const _ of y._types)if(m.type.test(_)){const u=Object.assign({},m);u.type=_,u.base=y[_](),R.push(u)}return R},S.exports=f.root()},6914:(S,w,p)=>{const i=p(375),g=p(8571),h=p(3328);w.compile=function(l,t){if(typeof l=="string")return i(!t,"Cannot set single message string"),new h(l);if(h.isTemplate(l))return i(!t,"Cannot set single message template"),l;i(typeof l=="object"&&!Array.isArray(l),"Invalid message options"),t=t?g(t):{};for(let a in l){const n=l[a];if(a==="root"||h.isTemplate(n)){t[a]=n;continue}if(typeof n=="string"){t[a]=new h(n);continue}i(typeof n=="object"&&!Array.isArray(n),"Invalid message for",a);const s=a;for(a in t[s]=t[s]||{},n){const r=n[a];a==="root"||h.isTemplate(r)?t[s][a]=r:(i(typeof r=="string","Invalid message for",a,"in",s),t[s][a]=new h(r))}}return t},w.decompile=function(l){const t={};for(let a in l){const n=l[a];if(a==="root"){t.root=n;continue}if(h.isTemplate(n)){t[a]=n.describe({compact:!0});continue}const s=a;for(a in t[s]={},n){const r=n[a];a!=="root"?t[s][a]=r.describe({compact:!0}):t[s].root=r}}return t},w.merge=function(l,t){if(!l)return w.compile(t);if(!t)return l;if(typeof t=="string")return new h(t);if(h.isTemplate(t))return t;const a=g(l);for(let n in t){const s=t[n];if(n==="root"||h.isTemplate(s)){a[n]=s;continue}if(typeof s=="string"){a[n]=new h(s);continue}i(typeof s=="object"&&!Array.isArray(s),"Invalid message for",n);const r=n;for(n in a[r]=a[r]||{},s){const c=s[n];n==="root"||h.isTemplate(c)?a[r][n]=c:(i(typeof c=="string","Invalid message for",n,"in",r),a[r][n]=new h(c))}}return a}},2294:(S,w,p)=>{const i=p(375),g=p(8160),h=p(6133),l={};w.Ids=l.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const t=new l.Ids;return t._byId=new Map(this._byId),t._byKey=new Map(this._byKey),t._schemaChain=this._schemaChain,t}concat(t){t._schemaChain&&(this._schemaChain=!0);for(const[a,n]of t._byId.entries())i(!this._byKey.has(a),"Schema id conflicts with existing key:",a),this._byId.set(a,n);for(const[a,n]of t._byKey.entries())i(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,n)}fork(t,a,n){const s=this._collect(t);s.push({schema:n});const r=s.shift();let c={id:r.id,schema:a(r.schema)};i(g.isSchema(c.schema),"adjuster function failed to return a joi schema type");for(const e of s)c={id:e.id,schema:l.fork(e.schema,c.id,c.schema)};return c.schema}labels(t,a=[]){const n=t[0],s=this._get(n);if(!s)return[...a,...t].join(".");const r=t.slice(1);return a=[...a,s.schema._flags.label||n],r.length?s.schema._ids.labels(r,a):a.join(".")}reach(t,a=[]){const n=t[0],s=this._get(n);i(s,"Schema does not contain path",[...a,...t].join("."));const r=t.slice(1);return r.length?s.schema._ids.reach(r,[...a,n]):s.schema}register(t,{key:a}={}){if(!t||!g.isSchema(t))return;(t.$_property("schemaChain")||t._ids._schemaChain)&&(this._schemaChain=!0);const n=t._flags.id;if(n){const s=this._byId.get(n);i(!s||s.schema===t,"Cannot add different schemas with the same id:",n),i(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:t,id:n})}a&&(i(!this._byKey.has(a),"Schema already contains key:",a),i(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,{schema:t,id:a}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(t,a=[],n=[]){const s=t[0],r=this._get(s);i(r,"Schema does not contain path",[...a,...t].join(".")),n=[r,...n];const c=t.slice(1);return c.length?r.schema._ids._collect(c,[...a,s],n):n}_get(t){return this._byId.get(t)||this._byKey.get(t)}},l.fork=function(t,a,n){const s=w.schema(t,{each:(r,{key:c})=>{if(a===(r._flags.id||c))return n},ref:!1});return s?s.$_mutateRebuild():t},w.schema=function(t,a){let n;for(const s in t._flags){if(s[0]==="_")continue;const r=l.scan(t._flags[s],{source:"flags",name:s},a);r!==void 0&&(n=n||t.clone(),n._flags[s]=r)}for(let s=0;s<t._rules.length;++s){const r=t._rules[s],c=l.scan(r.args,{source:"rules",name:r.name},a);if(c!==void 0){n=n||t.clone();const e=Object.assign({},r);e.args=c,n._rules[s]=e,n._singleRules.get(r.name)===r&&n._singleRules.set(r.name,e)}}for(const s in t.$_terms){if(s[0]==="_")continue;const r=l.scan(t.$_terms[s],{source:"terms",name:s},a);r!==void 0&&(n=n||t.clone(),n.$_terms[s]=r)}return n},l.scan=function(t,a,n,s,r){const c=s||[];if(t===null||typeof t!="object")return;let e;if(Array.isArray(t)){for(let o=0;o<t.length;++o){const f=a.source==="terms"&&a.name==="keys"&&t[o].key,m=l.scan(t[o],a,n,[o,...c],f);m!==void 0&&(e=e||t.slice(),e[o]=m)}return e}if(n.schema!==!1&&g.isSchema(t)||n.ref!==!1&&h.isRef(t)){const o=n.each(t,{...a,path:c,key:r});return o===t?void 0:o}for(const o in t){if(o[0]==="_")continue;const f=l.scan(t[o],a,n,[o,...c],r);f!==void 0&&(e=e||Object.assign({},t),e[o]=f)}return e}},6133:(S,w,p)=>{const i=p(375),g=p(8571),h=p(9621),l=p(8160);let t;const a={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};w.create=function(n,s={}){i(typeof n=="string","Invalid reference key:",n),l.assertOptions(s,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),i(!s.prefix||typeof s.prefix=="object","options.prefix must be of type object");const r=Object.assign({},a.defaults,s);delete r.prefix;const c=r.separator,e=a.context(n,c,s.prefix);if(r.type=e.type,n=e.key,r.type==="value")if(e.root&&(i(!c||n[0]!==c,"Cannot specify relative path with root prefix"),r.ancestor="root",n||(n=null)),c&&c===n)n=null,r.ancestor=0;else if(r.ancestor!==void 0)i(!c||!n||n[0]!==c,"Cannot combine prefix with ancestor option");else{const[o,f]=a.ancestor(n,c);f&&(n=n.slice(f))===""&&(n=null),r.ancestor=o}return r.path=c?n===null?[]:n.split(c):[n],new a.Ref(r)},w.in=function(n,s={}){return w.create(n,{...s,in:!0})},w.isRef=function(n){return!!n&&!!n[l.symbols.ref]},a.Ref=class{constructor(n){i(typeof n=="object","Invalid reference construction"),l.assertOptions(n,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),i([!1,void 0].includes(n.separator)||typeof n.separator=="string"&&n.separator.length===1,"Invalid separator"),i(!n.adjust||typeof n.adjust=="function","options.adjust must be a function"),i(!n.map||Array.isArray(n.map),"options.map must be an array"),i(!n.map||!n.adjust,"Cannot set both map and adjust options"),Object.assign(this,a.defaults,n),i(this.type==="value"||this.ancestor===void 0,"Non-value references cannot reference ancestors"),Array.isArray(this.map)&&(this.map=new Map(this.map)),this.depth=this.path.length,this.key=this.path.length?this.path.join(this.separator):null,this.root=this.path[0],this.updateDisplay()}resolve(n,s,r,c,e={}){return i(!this.in||e.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(r.context,s,e):this.type==="local"?this._resolve(c,s,e):this.ancestor?this.ancestor==="root"?this._resolve(s.ancestors[s.ancestors.length-1],s,e):(i(this.ancestor<=s.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(s.ancestors[this.ancestor-1],s,e)):this._resolve(n,s,e)}_resolve(n,s,r){let c;if(this.type==="value"&&s.mainstay.shadow&&r.shadow!==!1&&(c=s.mainstay.shadow.get(this.absolute(s))),c===void 0&&(c=h(n,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(c=this.adjust(c)),this.map){const e=this.map.get(c);e!==void 0&&(c=e)}return s.mainstay&&s.mainstay.tracer.resolve(s,this,c),c}toString(){return this.display}absolute(n){return[...n.path.slice(0,-this.ancestor),...this.path]}clone(){return new a.Ref(this)}describe(){const n={path:this.path};this.type!=="value"&&(n.type=this.type),this.separator!=="."&&(n.separator=this.separator),this.type==="value"&&this.ancestor!==1&&(n.ancestor=this.ancestor),this.map&&(n.map=[...this.map]);for(const s of["adjust","iterables","render"])this[s]!==null&&this[s]!==void 0&&(n[s]=this[s]);return this.in!==!1&&(n.in=!0),{ref:n}}updateDisplay(){const n=this.key!==null?this.key:"";if(this.type!=="value")return void(this.display=`ref:${this.type}:${n}`);if(!this.separator)return void(this.display=`ref:${n}`);if(!this.ancestor)return void(this.display=`ref:${this.separator}${n}`);if(this.ancestor==="root")return void(this.display=`ref:root:${n}`);if(this.ancestor===1)return void(this.display=`ref:${n||".."}`);const s=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${s}${n||""}`}},a.Ref.prototype[l.symbols.ref]=!0,w.build=function(n){return(n=Object.assign({},a.defaults,n)).type==="value"&&n.ancestor===void 0&&(n.ancestor=1),new a.Ref(n)},a.context=function(n,s,r={}){if(n=n.trim(),r){const c=r.global===void 0?"$":r.global;if(c!==s&&n.startsWith(c))return{key:n.slice(c.length),type:"global"};const e=r.local===void 0?"#":r.local;if(e!==s&&n.startsWith(e))return{key:n.slice(e.length),type:"local"};const o=r.root===void 0?"/":r.root;if(o!==s&&n.startsWith(o))return{key:n.slice(o.length),type:"value",root:!0}}return{key:n,type:"value"}},a.ancestor=function(n,s){if(!s)return[1,0];if(n[0]!==s)return[1,0];if(n[1]!==s)return[0,1];let r=2;for(;n[r]===s;)++r;return[r-1,r]},w.toSibling=0,w.toParent=1,w.Manager=class{constructor(){this.refs=[]}register(n,s){if(n)if(s=s===void 0?w.toParent:s,Array.isArray(n))for(const r of n)this.register(r,s);else if(l.isSchema(n))for(const r of n._refs.refs)r.ancestor-s>=0&&this.refs.push({ancestor:r.ancestor-s,root:r.root});else w.isRef(n)&&n.type==="value"&&n.ancestor-s>=0&&this.refs.push({ancestor:n.ancestor-s,root:n.root}),t=t||p(3328),t.isTemplate(n)&&this.register(n.refs(),s)}get length(){return this.refs.length}clone(){const n=new w.Manager;return n.refs=g(this.refs),n}reset(){this.refs=[]}roots(){return this.refs.filter(n=>!n.ancestor).map(n=>n.root)}}},3378:(S,w,p)=>{const i=p(5107),g={};g.wrap=i.string().min(1).max(2).allow(!1),w.preferences=i.object({allowUnknown:i.boolean(),abortEarly:i.boolean(),artifacts:i.boolean(),cache:i.boolean(),context:i.object(),convert:i.boolean(),dateFormat:i.valid("date","iso","string","time","utc"),debug:i.boolean(),errors:{escapeHtml:i.boolean(),label:i.valid("path","key",!1),language:[i.string(),i.object().ref()],render:i.boolean(),stack:i.boolean(),wrap:{label:g.wrap,array:g.wrap,string:g.wrap}},externals:i.boolean(),messages:i.object(),noDefaults:i.boolean(),nonEnumerables:i.boolean(),presence:i.valid("required","optional","forbidden"),skipFunctions:i.boolean(),stripUnknown:i.object({arrays:i.boolean(),objects:i.boolean()}).or("arrays","objects").allow(!0,!1),warnings:i.boolean()}).strict(),g.nameRx=/^[a-zA-Z0-9]\w*$/,g.rule=i.object({alias:i.array().items(i.string().pattern(g.nameRx)).single(),args:i.array().items(i.string(),i.object({name:i.string().pattern(g.nameRx).required(),ref:i.boolean(),assert:i.alternatives([i.function(),i.object().schema()]).conditional("ref",{is:!0,then:i.required()}),normalize:i.function(),message:i.string().when("assert",{is:i.function(),then:i.required()})})),convert:i.boolean(),manifest:i.boolean(),method:i.function().allow(!1),multi:i.boolean(),validate:i.function()}),w.extension=i.object({type:i.alternatives([i.string(),i.object().regex()]).required(),args:i.function(),cast:i.object().pattern(g.nameRx,i.object({from:i.function().maxArity(1).required(),to:i.function().minArity(1).maxArity(2).required()})),base:i.object().schema().when("type",{is:i.object().regex(),then:i.forbidden()}),coerce:[i.function().maxArity(3),i.object({method:i.function().maxArity(3).required(),from:i.array().items(i.string()).single()})],flags:i.object().pattern(g.nameRx,i.object({setter:i.string(),default:i.any()})),manifest:{build:i.function().arity(2)},messages:[i.object(),i.string()],modifiers:i.object().pattern(g.nameRx,i.function().minArity(1).maxArity(2)),overrides:i.object().pattern(g.nameRx,i.function()),prepare:i.function().maxArity(3),rebuild:i.function().arity(1),rules:i.object().pattern(g.nameRx,g.rule),terms:i.object().pattern(g.nameRx,i.object({init:i.array().allow(null).required(),manifest:i.object().pattern(/.+/,[i.valid("schema","single"),i.object({mapped:i.object({from:i.string().required(),to:i.string().required()}).required()})])})),validate:i.function().maxArity(3)}).strict(),w.extensions=i.array().items(i.object(),i.function().arity(1)).strict(),g.desc={buffer:i.object({buffer:i.string()}),func:i.object({function:i.function().required(),options:{literal:!0}}),override:i.object({override:!0}),ref:i.object({ref:i.object({type:i.valid("value","global","local"),path:i.array().required(),separator:i.string().length(1).allow(!1),ancestor:i.number().min(0).integer().allow("root"),map:i.array().items(i.array().length(2)).min(1),adjust:i.function(),iterables:i.boolean(),in:i.boolean(),render:i.boolean()}).required()}),regex:i.object({regex:i.string().min(3)}),special:i.object({special:i.valid("deep").required()}),template:i.object({template:i.string().required(),options:i.object()}),value:i.object({value:i.alternatives([i.object(),i.array()]).required()})},g.desc.entity=i.alternatives([i.array().items(i.link("...")),i.boolean(),i.function(),i.number(),i.string(),g.desc.buffer,g.desc.func,g.desc.ref,g.desc.regex,g.desc.special,g.desc.template,g.desc.value,i.link("/")]),g.desc.values=i.array().items(null,i.boolean(),i.function(),i.number().allow(1/0,-1/0),i.string().allow(""),i.symbol(),g.desc.buffer,g.desc.func,g.desc.override,g.desc.ref,g.desc.regex,g.desc.template,g.desc.value),g.desc.messages=i.object().pattern(/.+/,[i.string(),g.desc.template,i.object().pattern(/.+/,[i.string(),g.desc.template])]),w.description=i.object({type:i.string().required(),flags:i.object({cast:i.string(),default:i.any(),description:i.string(),empty:i.link("/"),failover:g.desc.entity,id:i.string(),label:i.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:i.boolean(),unit:i.string()}).unknown(),preferences:{allowUnknown:i.boolean(),abortEarly:i.boolean(),artifacts:i.boolean(),cache:i.boolean(),convert:i.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:i.boolean(),label:["path","key"],language:[i.string(),g.desc.ref],wrap:{label:g.wrap,array:g.wrap}},externals:i.boolean(),messages:g.desc.messages,noDefaults:i.boolean(),nonEnumerables:i.boolean(),presence:["required","optional","forbidden"],skipFunctions:i.boolean(),stripUnknown:i.object({arrays:i.boolean(),objects:i.boolean()}).or("arrays","objects").allow(!0,!1),warnings:i.boolean()},allow:g.desc.values,invalid:g.desc.values,rules:i.array().min(1).items({name:i.string().required(),args:i.object().min(1),keep:i.boolean(),message:[i.string(),g.desc.messages],warn:i.boolean()}),keys:i.object().pattern(/.*/,i.link("/")),link:g.desc.ref}).pattern(/^[a-z]\w*$/,i.any())},493:(S,w,p)=>{const i=p(8571),g=p(9621),h=p(8160),l={value:Symbol("value")};S.exports=l.State=class{constructor(t,a,n){this.path=t,this.ancestors=a,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(t,a=null,n=null){const s=new l.State(t,a,this);return n&&s.schemas&&(s.schemas=[l.schemas(n),...s.schemas]),s}nest(t,a){const n=new l.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[l.schemas(t),...n.schemas],n.debug=a,n}shadow(t,a){this.mainstay.shadow=this.mainstay.shadow||new l.Shadow,this.mainstay.shadow.set(this.path,t,a)}snapshot(){this.mainstay.shadow&&(this._snapshot=i(this.mainstay.shadow.node(this.path))),this.mainstay.snapshot()}restore(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.restore()}commit(){this.mainstay.shadow&&(this.mainstay.shadow.override(this.path,this._snapshot),this._snapshot=void 0),this.mainstay.commit()}},l.schemas=function(t){return h.isSchema(t)?{schema:t}:t},l.Shadow=class{constructor(){this._values=null}set(t,a,n){if(!t.length||n==="strip"&&typeof t[t.length-1]=="number")return;this._values=this._values||new Map;let s=this._values;for(let r=0;r<t.length;++r){const c=t[r];let e=s.get(c);e||(e=new Map,s.set(c,e)),s=e}s[l.value]=a}get(t){const a=this.node(t);if(a)return a[l.value]}node(t){if(this._values)return g(this._values,t,{iterables:!0})}override(t,a){if(!this._values)return;const n=t.slice(0,-1),s=t[t.length-1],r=g(this._values,n,{iterables:!0});a?r.set(s,a):r&&r.delete(s)}}},3328:(S,w,p)=>{const i=p(375),g=p(8571),h=p(5277),l=p(1447),t=p(8160),a=p(6354),n=p(6133),s={symbol:Symbol("template"),opens:new Array(1e3).join("\0"),closes:new Array(1e3).join(""),dateFormat:{date:Date.prototype.toDateString,iso:Date.prototype.toISOString,string:Date.prototype.toString,time:Date.prototype.toTimeString,utc:Date.prototype.toUTCString}};S.exports=s.Template=class{constructor(r,c){if(i(typeof r=="string","Template source must be a string"),i(!r.includes("\0")&&!r.includes(""),"Template source cannot contain reserved control characters"),this.source=r,this.rendered=r,this._template=null,c){const{functions:e,...o}=c;this._settings=Object.keys(o).length?g(o):void 0,this._functions=e,this._functions&&(i(Object.keys(this._functions).every(f=>typeof f=="string"),"Functions keys must be strings"),i(Object.values(this._functions).every(f=>typeof f=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const r=s.encode(this.source),c=s.split(r);let e=!1;const o=[],f=c.shift();f&&o.push(f);for(const m of c){const y=m[0]!=="{",R=y?"}":"}}",_=m.indexOf(R);if(_===-1||m[1]==="{"){o.push(`{${s.decode(m)}`);continue}let u=m.slice(y?0:1,_);const d=u[0]===":";d&&(u=u.slice(1));const v=this._ref(s.decode(u),{raw:y,wrapped:d});o.push(v),typeof v!="string"&&(e=!0);const E=m.slice(_+R.length);E&&o.push(s.decode(E))}e?this._template=o:this.rendered=o.join("")}static date(r,c){return s.dateFormat[c.dateFormat].call(r)}describe(r={}){if(!this._settings&&r.compact)return this.source;const c={template:this.source};return this._settings&&(c.options=this._settings),this._functions&&(c.functions=this._functions),c}static build(r){return new s.Template(r.template,r.options||r.functions?{...r.options,functions:r.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(r){return!!r&&!!r[t.symbols.template]}refs(){if(!this._template)return;const r=[];for(const c of this._template)typeof c!="string"&&r.push(...c.refs);return r}resolve(r,c,e,o){return this._template&&this._template.length===1?this._part(this._template[0],r,c,e,o,{}):this.render(r,c,e,o)}_part(r,...c){return r.ref?r.ref.resolve(...c):r.formula.evaluate(c)}render(r,c,e,o,f={}){if(!this.isDynamic())return this.rendered;const m=[];for(const y of this._template)if(typeof y=="string")m.push(y);else{const R=this._part(y,r,c,e,o,f),_=s.stringify(R,r,c,e,o,f);if(_!==void 0){const u=y.raw||(f.errors&&f.errors.escapeHtml)===!1?_:h(_);m.push(s.wrap(u,y.wrapped&&e.errors.wrap.label))}}return m.join("")}_ref(r,{raw:c,wrapped:e}){const o=[],f=y=>{const R=n.create(y,this._settings);return o.push(R),_=>{const u=R.resolve(..._);return u!==void 0?u:null}};try{const y=this._functions?{...s.functions,...this._functions}:s.functions;var m=new l.Parser(r,{reference:f,functions:y,constants:s.constants})}catch(y){throw y.message=`Invalid template variable "${r}" fails due to: ${y.message}`,y}if(m.single){if(m.single.type==="reference"){const y=o[0];return{ref:y,raw:c,refs:o,wrapped:e||y.type==="local"&&y.key==="label"}}return s.stringify(m.single.value)}return{formula:m,raw:c,refs:o}}toString(){return this.source}},s.Template.prototype[t.symbols.template]=!0,s.Template.prototype.isImmutable=!0,s.encode=function(r){return r.replace(/\\(\{+)/g,(c,e)=>s.opens.slice(0,e.length)).replace(/\\(\}+)/g,(c,e)=>s.closes.slice(0,e.length))},s.decode=function(r){return r.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},s.split=function(r){const c=[];let e="";for(let o=0;o<r.length;++o){const f=r[o];if(f==="{"){let m="";for(;o+1<r.length&&r[o+1]==="{";)m+="{",++o;c.push(e),e=m}else e+=f}return c.push(e),c},s.wrap=function(r,c){return c?c.length===1?`${c}${r}${c}`:`${c[0]}${r}${c[1]}`:r},s.stringify=function(r,c,e,o,f,m={}){const y=typeof r,R=o&&o.errors&&o.errors.wrap||{};let _=!1;if(n.isRef(r)&&r.render&&(_=r.in,r=r.resolve(c,e,o,f,{in:r.in,...m})),r===null)return"null";if(y==="string")return s.wrap(r,m.arrayItems&&R.string);if(y==="number"||y==="function"||y==="symbol")return r.toString();if(y!=="object")return JSON.stringify(r);if(r instanceof Date)return s.Template.date(r,o);if(r instanceof Map){const d=[];for(const[v,E]of r.entries())d.push(`${v.toString()} -> ${E.toString()}`);r=d}if(!Array.isArray(r))return r.toString();const u=[];for(const d of r)u.push(s.stringify(d,c,e,o,f,{arrayItems:!0,...m}));return s.wrap(u.join(", "),!_&&R.array)},s.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},s.functions={if:(r,c,e)=>r?c:e,length:r=>typeof r=="string"?r.length:r&&typeof r=="object"?Array.isArray(r)?r.length:Object.keys(r).length:null,msg(r){const[c,e,o,f,m]=this,y=m.messages;if(!y)return"";const R=a.template(c,y[0],r,e,o)||a.template(c,y[1],r,e,o);return R?R.render(c,e,o,f,m):""},number:r=>typeof r=="number"?r:typeof r=="string"?parseFloat(r):typeof r=="boolean"?r?1:0:r instanceof Date?r.getTime():null}},4946:(S,w,p)=>{const i=p(375),g=p(1687),h=p(8068),l=p(8160),t=p(3292),a=p(6354),n=p(6133),s={};S.exports=h.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:n.toSibling}},args:(r,...c)=>c.length===1&&Array.isArray(c[0])?r.try(...c[0]):r.try(...c),validate(r,c){const{schema:e,error:o,state:f,prefs:m}=c;if(e._flags.match){const R=[],_=[];for(let d=0;d<e.$_terms.matches.length;++d){const v=e.$_terms.matches[d],E=f.nest(v.schema,`match.${d}`);E.snapshot();const k=v.schema.$_validate(r,E,m);k.errors?(_.push(k.errors),E.restore()):(R.push(k.value),E.commit())}if(R.length===0)return{errors:o("alternatives.any",{details:_.map(d=>a.details(d,{override:!1}))})};if(e._flags.match==="one")return R.length===1?{value:R[0]}:{errors:o("alternatives.one")};if(R.length!==e.$_terms.matches.length)return{errors:o("alternatives.all",{details:_.map(d=>a.details(d,{override:!1}))})};const u=d=>d.$_terms.matches.some(v=>v.schema.type==="object"||v.schema.type==="alternatives"&&u(v.schema));return u(e)?{value:R.reduce((d,v)=>g(d,v,{mergeArrays:!1}))}:{value:R[R.length-1]}}const y=[];for(let R=0;R<e.$_terms.matches.length;++R){const _=e.$_terms.matches[R];if(_.schema){const v=f.nest(_.schema,`match.${R}`);v.snapshot();const E=_.schema.$_validate(r,v,m);if(!E.errors)return v.commit(),E;v.restore(),y.push({schema:_.schema,reports:E.errors});continue}const u=_.ref?_.ref.resolve(r,f,m):r,d=_.is?[_]:_.switch;for(let v=0;v<d.length;++v){const E=d[v],{is:k,then:O,otherwise:A}=E,I=`match.${R}${_.switch?"."+v:""}`;if(k.$_match(u,f.nest(k,`${I}.is`),m)){if(O)return O.$_validate(r,f.nest(O,`${I}.then`),m)}else if(A)return A.$_validate(r,f.nest(A,`${I}.otherwise`),m)}}return s.errors(y,c)},rules:{conditional:{method(r,c){i(!this._flags._endedSwitch,"Unreachable condition"),i(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),i(c.break===void 0,"Cannot use break option with alternatives conditional");const e=this.clone(),o=t.when(e,r,c),f=o.is?[o]:o.switch;for(const m of f)if(m.then&&m.otherwise){e.$_setFlag("_endedSwitch",!0,{clone:!1});break}return e.$_terms.matches.push(o),e.$_mutateRebuild()}},match:{method(r){if(i(["any","one","all"].includes(r),"Invalid alternatives match mode",r),r!=="any")for(const c of this.$_terms.matches)i(c.schema,"Cannot combine match mode",r,"with conditional rules");return this.$_setFlag("match",r)}},try:{method(...r){i(r.length,"Missing alternative schemas"),l.verifyFlat(r,"try"),i(!this._flags._endedSwitch,"Unreachable condition");const c=this.clone();for(const e of r)c.$_terms.matches.push({schema:c.$_compile(e)});return c.$_mutateRebuild()}}},overrides:{label(r){return this.$_parent("label",r).$_modify({each:(c,e)=>e.path[0]!=="is"&&typeof c._flags.label!="string"?c.label(r):void 0,ref:!1})}},rebuild(r){r.$_modify({each:c=>{l.isSchema(c)&&c.type==="array"&&r.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(r,c){if(c.matches)for(const e of c.matches){const{schema:o,ref:f,is:m,not:y,then:R,otherwise:_}=e;r=o?r.try(o):f?r.conditional(f,{is:m,then:R,not:y,otherwise:_,switch:e.switch}):r.conditional(m,{then:R,otherwise:_})}return r}},messages:{"alternatives.all":"{{#label}} does not match all of the required types","alternatives.any":"{{#label}} does not match any of the allowed types","alternatives.match":"{{#label}} does not match any of the allowed types","alternatives.one":"{{#label}} matches more than one allowed type","alternatives.types":"{{#label}} must be one of {{#types}}"}}),s.errors=function(r,{error:c,state:e}){if(!r.length)return{errors:c("alternatives.any")};if(r.length===1)return{errors:r[0].reports};const o=new Set,f=[];for(const{reports:m,schema:y}of r){if(m.length>1)return s.unmatched(r,c);const R=m[0];if(R instanceof a.Report==0)return s.unmatched(r,c);if(R.state.path.length!==e.path.length){f.push({type:y.type,report:R});continue}if(R.code==="any.only"){for(const d of R.local.valids)o.add(d);continue}const[_,u]=R.code.split(".");u==="base"?o.add(_):f.push({type:y.type,report:R})}return f.length?f.length===1?{errors:f[0].report}:s.unmatched(r,c):{errors:c("alternatives.types",{types:[...o]})}},s.unmatched=function(r,c){const e=[];for(const o of r)e.push(...o.reports);return{errors:c("alternatives.match",a.details(e,{override:!1}))}}},8068:(S,w,p)=>{const i=p(375),g=p(7629),h=p(8160),l=p(6914);S.exports=g.extend({type:"any",flags:{only:{default:!1}},terms:{alterations:{init:null},examples:{init:null},externals:{init:null},metas:{init:[]},notes:{init:[]},shared:{init:null},tags:{init:[]},whens:{init:null}},rules:{custom:{method(t,a){return i(typeof t=="function","Method must be a function"),i(a===void 0||a&&typeof a=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:t,description:a}})},validate(t,a,{method:n}){try{return n(t,a)}catch(s){return a.error("any.custom",{error:s})}},args:["method","description"],multi:!0},messages:{method(t){return this.prefs({messages:t})}},shared:{method(t){i(h.isSchema(t)&&t._flags.id,"Schema must be a schema with an id");const a=this.clone();return a.$_terms.shared=a.$_terms.shared||[],a.$_terms.shared.push(t),a.$_mutateRegister(t),a}},warning:{method(t,a){return i(t&&typeof t=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:t,local:a},warn:!0})},validate:(t,a,{code:n,local:s})=>a.error(n,s),args:["code","local"],multi:!0}},modifiers:{keep(t,a=!0){t.keep=a},message(t,a){t.message=l.compile(a)},warn(t,a=!0){t.warn=a}},manifest:{build(t,a){for(const n in a){const s=a[n];if(["examples","externals","metas","notes","tags"].includes(n))for(const r of s)t=t[n.slice(0,-1)](r);else if(n!=="alterations")if(n!=="whens"){if(n==="shared")for(const r of s)t=t.shared(r)}else for(const r of s){const{ref:c,is:e,not:o,then:f,otherwise:m,concat:y}=r;t=y?t.concat(y):c?t.when(c,{is:e,not:o,then:f,otherwise:m,switch:r.switch,break:r.break}):t.when(e,{then:f,otherwise:m,break:r.break})}else{const r={};for(const{target:c,adjuster:e}of s)r[c]=e;t=t.alter(r)}}return t}},messages:{"any.custom":"{{#label}} failed custom validation because {{#error.message}}","any.default":"{{#label}} threw an error when running default method","any.failover":"{{#label}} threw an error when running failover method","any.invalid":"{{#label}} contains an invalid value","any.only":'{{#label}} must be {if(#valids.length == 1, "", "one of ")}{{#valids}}',"any.ref":"{{#label}} {{#arg}} references {{:#ref}} which {{#reason}}","any.required":"{{#label}} is required","any.unknown":"{{#label}} is not allowed"}})},546:(S,w,p)=>{const i=p(375),g=p(9474),h=p(9621),l=p(8068),t=p(8160),a=p(3292),n={};S.exports=l.extend({type:"array",flags:{single:{default:!1},sparse:{default:!1}},terms:{items:{init:[],manifest:"schema"},ordered:{init:[],manifest:"schema"},_exclusions:{init:[]},_inclusions:{init:[]},_requireds:{init:[]}},coerce:{from:"object",method(s,{schema:r,state:c,prefs:e}){if(!Array.isArray(s))return;const o=r.$_getRule("sort");return o?n.sort(r,s,o.args.options,c,e):void 0}},validate(s,{schema:r,error:c}){if(!Array.isArray(s)){if(r._flags.single){const e=[s];return e[t.symbols.arraySingle]=!0,{value:e}}return{errors:c("array.base")}}if(r.$_getRule("items")||r.$_terms.externals)return{value:s.slice()}},rules:{has:{method(s){s=this.$_compile(s,{appendPath:!0});const r=this.$_addRule({name:"has",args:{schema:s}});return r.$_mutateRegister(s),r},validate(s,{state:r,prefs:c,error:e},{schema:o}){const f=[s,...r.ancestors];for(let y=0;y<s.length;++y){const R=r.localize([...r.path,y],f,o);if(o.$_match(s[y],R,c))return s}const m=o._flags.label;return m?e("array.hasKnown",{patternLabel:m}):e("array.hasUnknown",null)},multi:!0},items:{method(...s){t.verifyFlat(s,"items");const r=this.$_addRule("items");for(let c=0;c<s.length;++c){const e=t.tryWithPath(()=>this.$_compile(s[c]),c,{append:!0});r.$_terms.items.push(e)}return r.$_mutateRebuild()},validate(s,{schema:r,error:c,state:e,prefs:o,errorsArray:f}){const m=r.$_terms._requireds.slice(),y=r.$_terms.ordered.slice(),R=[...r.$_terms._inclusions,...m],_=!s[t.symbols.arraySingle];delete s[t.symbols.arraySingle];const u=f();let d=s.length;for(let v=0;v<d;++v){const E=s[v];let k=!1,O=!1;const A=_?v:new Number(v),I=[...e.path,A];if(!r._flags.sparse&&E===void 0){if(u.push(c("array.sparse",{key:A,path:I,pos:v,value:void 0},e.localize(I))),o.abortEarly)return u;y.shift();continue}const T=[s,...e.ancestors];for(const z of r.$_terms._exclusions)if(z.$_match(E,e.localize(I,T,z),o,{presence:"ignore"})){if(u.push(c("array.excludes",{pos:v,value:E},e.localize(I))),o.abortEarly)return u;k=!0,y.shift();break}if(k)continue;if(r.$_terms.ordered.length){if(y.length){const z=y.shift(),P=z.$_validate(E,e.localize(I,T,z),o);if(P.errors){if(u.push(...P.errors),o.abortEarly)return u}else if(z._flags.result==="strip")n.fastSplice(s,v),--v,--d;else{if(!r._flags.sparse&&P.value===void 0){if(u.push(c("array.sparse",{key:A,path:I,pos:v,value:void 0},e.localize(I))),o.abortEarly)return u;continue}s[v]=P.value}continue}if(!r.$_terms.items.length){if(u.push(c("array.orderedLength",{pos:v,limit:r.$_terms.ordered.length})),o.abortEarly)return u;break}}const F=[];let K=m.length;for(let z=0;z<K;++z){const P=e.localize(I,T,m[z]);P.snapshot();const X=m[z].$_validate(E,P,o);if(F[z]=X,!X.errors){if(P.commit(),s[v]=X.value,O=!0,n.fastSplice(m,z),--z,--K,!r._flags.sparse&&X.value===void 0&&(u.push(c("array.sparse",{key:A,path:I,pos:v,value:void 0},e.localize(I))),o.abortEarly))return u;break}P.restore()}if(O)continue;const V=o.stripUnknown&&!!o.stripUnknown.arrays||!1;K=R.length;for(const z of R){let P;const X=m.indexOf(z);if(X!==-1)P=F[X];else{const Z=e.localize(I,T,z);if(Z.snapshot(),P=z.$_validate(E,Z,o),!P.errors){Z.commit(),z._flags.result==="strip"?(n.fastSplice(s,v),--v,--d):r._flags.sparse||P.value!==void 0?s[v]=P.value:(u.push(c("array.sparse",{key:A,path:I,pos:v,value:void 0},e.localize(I))),k=!0),O=!0;break}Z.restore()}if(K===1){if(V){n.fastSplice(s,v),--v,--d,O=!0;break}if(u.push(...P.errors),o.abortEarly)return u;k=!0;break}}if(!k&&(r.$_terms._inclusions.length||r.$_terms._requireds.length)&&!O){if(V){n.fastSplice(s,v),--v,--d;continue}if(u.push(c("array.includes",{pos:v,value:E},e.localize(I))),o.abortEarly)return u}}return m.length&&n.fillMissedErrors(r,u,m,s,e,o),y.length&&(n.fillOrderedErrors(r,u,y,s,e,o),u.length||n.fillDefault(y,s,e,o)),u.length?u:s},priority:!0,manifest:!1},length:{method(s){return this.$_addRule({name:"length",args:{limit:s},operator:"="})},validate:(s,r,{limit:c},{name:e,operator:o,args:f})=>t.compare(s.length,c,o)?s:r.error("array."+e,{limit:f.limit,value:s}),args:[{name:"limit",ref:!0,assert:t.limit,message:"must be a positive integer"}]},max:{method(s){return this.$_addRule({name:"max",method:"length",args:{limit:s},operator:"<="})}},min:{method(s){return this.$_addRule({name:"min",method:"length",args:{limit:s},operator:">="})}},ordered:{method(...s){t.verifyFlat(s,"ordered");const r=this.$_addRule("items");for(let c=0;c<s.length;++c){const e=t.tryWithPath(()=>this.$_compile(s[c]),c,{append:!0});n.validateSingle(e,r),r.$_mutateRegister(e),r.$_terms.ordered.push(e)}return r.$_mutateRebuild()}},single:{method(s){const r=s===void 0||!!s;return i(!r||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",r)}},sort:{method(s={}){t.assertOptions(s,["by","order"]);const r={order:s.order||"ascending"};return s.by&&(r.by=a.ref(s.by,{ancestor:0}),i(!r.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:r}})},validate(s,{error:r,state:c,prefs:e,schema:o},{options:f}){const{value:m,errors:y}=n.sort(o,s,f,c,e);if(y)return y;for(let R=0;R<s.length;++R)if(s[R]!==m[R])return r("array.sort",{order:f.order,by:f.by?f.by.key:"value"});return s},convert:!0},sparse:{method(s){const r=s===void 0||!!s;return this._flags.sparse===r?this:(r?this.clone():this.$_addRule("items")).$_setFlag("sparse",r,{clone:!1})}},unique:{method(s,r={}){i(!s||typeof s=="function"||typeof s=="string","comparator must be a function or a string"),t.assertOptions(r,["ignoreUndefined","separator"]);const c={name:"unique",args:{options:r,comparator:s}};if(s)if(typeof s=="string"){const e=t.default(r.separator,".");c.path=e?s.split(e):[s]}else c.comparator=s;return this.$_addRule(c)},validate(s,{state:r,error:c,schema:e},{comparator:o,options:f},{comparator:m,path:y}){const R={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),object:new Map,function:new Map,custom:new Map},_=m||g,u=f.ignoreUndefined;for(let d=0;d<s.length;++d){const v=y?h(s[d],y):s[d],E=m?R.custom:R[typeof v];if(i(E,"Failed to find unique map container for type",typeof v),E instanceof Map){const k=E.entries();let O;for(;!(O=k.next()).done;)if(_(O.value[0],v)){const A=r.localize([...r.path,d],[s,...r.ancestors]),I={pos:d,value:s[d],dupePos:O.value[1],dupeValue:s[O.value[1]]};return y&&(I.path=o),c("array.unique",I,A)}E.set(v,d)}else{if((!u||v!==void 0)&&E[v]!==void 0){const k={pos:d,value:s[d],dupePos:E[v],dupeValue:s[E[v]]};return y&&(k.path=o),c("array.unique",k,r.localize([...r.path,d],[s,...r.ancestors]))}E[v]=d}}return s},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(s,r)=>new Set(s)}},rebuild(s){s.$_terms._inclusions=[],s.$_terms._exclusions=[],s.$_terms._requireds=[];for(const r of s.$_terms.items)n.validateSingle(r,s),r._flags.presence==="required"?s.$_terms._requireds.push(r):r._flags.presence==="forbidden"?s.$_terms._exclusions.push(r):s.$_terms._inclusions.push(r);for(const r of s.$_terms.ordered)n.validateSingle(r,s)},manifest:{build:(s,r)=>(r.items&&(s=s.items(...r.items)),r.ordered&&(s=s.ordered(...r.ordered)),s)},messages:{"array.base":"{{#label}} must be an array","array.excludes":"{{#label}} contains an excluded value","array.hasKnown":"{{#label}} does not contain at least one required match for type {:#patternLabel}","array.hasUnknown":"{{#label}} does not contain at least one required match","array.includes":"{{#label}} does not match any of the allowed types","array.includesRequiredBoth":"{{#label}} does not contain {{#knownMisses}} and {{#unknownMisses}} other required value(s)","array.includesRequiredKnowns":"{{#label}} does not contain {{#knownMisses}}","array.includesRequiredUnknowns":"{{#label}} does not contain {{#unknownMisses}} required value(s)","array.length":"{{#label}} must contain {{#limit}} items","array.max":"{{#label}} must contain less than or equal to {{#limit}} items","array.min":"{{#label}} must contain at least {{#limit}} items","array.orderedLength":"{{#label}} must contain at most {{#limit}} items","array.sort":"{{#label}} must be sorted in {#order} order by {{#by}}","array.sort.mismatching":"{{#label}} cannot be sorted due to mismatching types","array.sort.unsupported":"{{#label}} cannot be sorted due to unsupported type {#type}","array.sparse":"{{#label}} must not be a sparse array item","array.unique":"{{#label}} contains a duplicate value"}}),n.fillMissedErrors=function(s,r,c,e,o,f){const m=[];let y=0;for(const R of c){const _=R._flags.label;_?m.push(_):++y}m.length?y?r.push(s.$_createError("array.includesRequiredBoth",e,{knownMisses:m,unknownMisses:y},o,f)):r.push(s.$_createError("array.includesRequiredKnowns",e,{knownMisses:m},o,f)):r.push(s.$_createError("array.includesRequiredUnknowns",e,{unknownMisses:y},o,f))},n.fillOrderedErrors=function(s,r,c,e,o,f){const m=[];for(const y of c)y._flags.presence==="required"&&m.push(y);m.length&&n.fillMissedErrors(s,r,m,e,o,f)},n.fillDefault=function(s,r,c,e){const o=[];let f=!0;for(let m=s.length-1;m>=0;--m){const y=s[m],R=[r,...c.ancestors],_=y.$_validate(void 0,c.localize(c.path,R,y),e).value;if(f){if(_===void 0)continue;f=!1}o.unshift(_)}o.length&&r.push(...o)},n.fastSplice=function(s,r){let c=r;for(;c<s.length;)s[c++]=s[c];--s.length},n.validateSingle=function(s,r){(s.type==="array"||s._flags._arrayItems)&&(i(!r._flags.single,"Cannot specify array item with single rule enabled"),r.$_setFlag("_arrayItems",!0,{clone:!1}))},n.sort=function(s,r,c,e,o){const f=c.order==="ascending"?1:-1,m=-1*f,y=f,R=(_,u)=>{let d=n.compare(_,u,m,y);if(d!==null||(c.by&&(_=c.by.resolve(_,e,o),u=c.by.resolve(u,e,o)),d=n.compare(_,u,m,y),d!==null))return d;const v=typeof _;if(v!==typeof u)throw s.$_createError("array.sort.mismatching",r,null,e,o);if(v!=="number"&&v!=="string")throw s.$_createError("array.sort.unsupported",r,{type:v},e,o);return v==="number"?(_-u)*f:_<u?m:y};try{return{value:r.slice().sort(R)}}catch(_){return{errors:_}}},n.compare=function(s,r,c,e){return s===r?0:s===void 0?1:r===void 0?-1:s===null?e:r===null?c:null}},4937:(S,w,p)=>{const i=p(375),g=p(8068),h=p(8160),l=p(2036),t={isBool:function(a){return typeof a=="boolean"}};S.exports=g.extend({type:"boolean",flags:{sensitive:{default:!1}},terms:{falsy:{init:null,manifest:"values"},truthy:{init:null,manifest:"values"}},coerce(a,{schema:n}){if(typeof a!="boolean"){if(typeof a=="string"){const s=n._flags.sensitive?a:a.toLowerCase();a=s==="true"||s!=="false"&&a}return typeof a!="boolean"&&(a=n.$_terms.truthy&&n.$_terms.truthy.has(a,null,null,!n._flags.sensitive)||(!n.$_terms.falsy||!n.$_terms.falsy.has(a,null,null,!n._flags.sensitive))&&a),{value:a}}},validate(a,{error:n}){if(typeof a!="boolean")return{value:a,errors:n("boolean.base")}},rules:{truthy:{method(...a){h.verifyFlat(a,"truthy");const n=this.clone();n.$_terms.truthy=n.$_terms.truthy||new l;for(let s=0;s<a.length;++s){const r=a[s];i(r!==void 0,"Cannot call truthy with undefined"),n.$_terms.truthy.add(r)}return n}},falsy:{method(...a){h.verifyFlat(a,"falsy");const n=this.clone();n.$_terms.falsy=n.$_terms.falsy||new l;for(let s=0;s<a.length;++s){const r=a[s];i(r!==void 0,"Cannot call falsy with undefined"),n.$_terms.falsy.add(r)}return n}},sensitive:{method(a=!0){return this.$_setFlag("sensitive",a)}}},cast:{number:{from:t.isBool,to:(a,n)=>a?1:0},string:{from:t.isBool,to:(a,n)=>a?"true":"false"}},manifest:{build:(a,n)=>(n.truthy&&(a=a.truthy(...n.truthy)),n.falsy&&(a=a.falsy(...n.falsy)),a)},messages:{"boolean.base":"{{#label}} must be a boolean"}})},7500:(S,w,p)=>{const i=p(375),g=p(8068),h=p(8160),l=p(3328),t={isDate:function(a){return a instanceof Date}};S.exports=g.extend({type:"date",coerce:{from:["number","string"],method:(a,{schema:n})=>({value:t.parse(a,n._flags.format)||a})},validate(a,{schema:n,error:s,prefs:r}){if(a instanceof Date&&!isNaN(a.getTime()))return;const c=n._flags.format;return r.convert&&c&&typeof a=="string"?{value:a,errors:s("date.format",{format:c})}:{value:a,errors:s("date.base")}},rules:{compare:{method:!1,validate(a,n,{date:s},{name:r,operator:c,args:e}){const o=s==="now"?Date.now():s.getTime();return h.compare(a.getTime(),o,c)?a:n.error("date."+r,{limit:e.date,value:a})},args:[{name:"date",ref:!0,normalize:a=>a==="now"?a:t.parse(a),assert:a=>a!==null,message:"must have a valid date format"}]},format:{method(a){return i(["iso","javascript","unix"].includes(a),"Unknown date format",a),this.$_setFlag("format",a)}},greater:{method(a){return this.$_addRule({name:"greater",method:"compare",args:{date:a},operator:">"})}},iso:{method(){return this.format("iso")}},less:{method(a){return this.$_addRule({name:"less",method:"compare",args:{date:a},operator:"<"})}},max:{method(a){return this.$_addRule({name:"max",method:"compare",args:{date:a},operator:"<="})}},min:{method(a){return this.$_addRule({name:"min",method:"compare",args:{date:a},operator:">="})}},timestamp:{method(a="javascript"){return i(["javascript","unix"].includes(a),'"type" must be one of "javascript, unix"'),this.format(a)}}},cast:{number:{from:t.isDate,to:(a,n)=>a.getTime()},string:{from:t.isDate,to:(a,{prefs:n})=>l.date(a,n)}},messages:{"date.base":"{{#label}} must be a valid date","date.format":'{{#label}} must be in {msg("date.format." + #format) || #format} format',"date.greater":"{{#label}} must be greater than {{:#limit}}","date.less":"{{#label}} must be less than {{:#limit}}","date.max":"{{#label}} must be less than or equal to {{:#limit}}","date.min":"{{#label}} must be greater than or equal to {{:#limit}}","date.format.iso":"ISO 8601 date","date.format.javascript":"timestamp or number of milliseconds","date.format.unix":"timestamp or number of seconds"}}),t.parse=function(a,n){if(a instanceof Date)return a;if(typeof a!="string"&&(isNaN(a)||!isFinite(a))||/^\s*$/.test(a))return null;if(n==="iso")return h.isIsoDate(a)?t.date(a.toString()):null;const s=a;if(typeof a=="string"&&/^[+-]?\d+(\.\d+)?$/.test(a)&&(a=parseFloat(a)),n){if(n==="javascript")return t.date(1*a);if(n==="unix")return t.date(1e3*a);if(typeof s=="string")return null}return t.date(a)},t.date=function(a){const n=new Date(a);return isNaN(n.getTime())?null:n}},390:(S,w,p)=>{const i=p(375),g=p(7824);S.exports=g.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(h){return i(Number.isSafeInteger(h)&&h>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:h}})},validate:(h,l,{n:t})=>h.length===t?h:l.error("function.arity",{n:t})},class:{method(){return this.$_addRule("class")},validate:(h,l)=>/^\s*class\s/.test(h.toString())?h:l.error("function.class",{value:h})},minArity:{method(h){return i(Number.isSafeInteger(h)&&h>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:h}})},validate:(h,l,{n:t})=>h.length>=t?h:l.error("function.minArity",{n:t})},maxArity:{method(h){return i(Number.isSafeInteger(h)&&h>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:h}})},validate:(h,l,{n:t})=>h.length<=t?h:l.error("function.maxArity",{n:t})}},messages:{"function.arity":"{{#label}} must have an arity of {{#n}}","function.class":"{{#label}} must be a class","function.maxArity":"{{#label}} must have an arity lesser or equal to {{#n}}","function.minArity":"{{#label}} must have an arity greater or equal to {{#n}}"}})},7824:(S,w,p)=>{const i=p(978),g=p(375),h=p(8571),l=p(3652),t=p(8068),a=p(8160),n=p(3292),s=p(6354),r=p(6133),c=p(3328),e={renameDefaults:{alias:!1,multiple:!1,override:!1}};S.exports=t.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:!1}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(o,f)=>o.keys(f),validate(o,{schema:f,error:m,state:y,prefs:R}){if(!o||typeof o!==f.$_property("typeof")||Array.isArray(o))return{value:o,errors:m("object.base",{type:f.$_property("typeof")})};if(!(f.$_terms.renames||f.$_terms.dependencies||f.$_terms.keys||f.$_terms.patterns||f.$_terms.externals))return;o=e.clone(o,R);const _=[];if(f.$_terms.renames&&!e.rename(f,o,y,R,_))return{value:o,errors:_};if(!f.$_terms.keys&&!f.$_terms.patterns&&!f.$_terms.dependencies)return{value:o,errors:_};const u=new Set(Object.keys(o));if(f.$_terms.keys){const d=[o,...y.ancestors];for(const v of f.$_terms.keys){const E=v.key,k=o[E];u.delete(E);const O=y.localize([...y.path,E],d,v),A=v.schema.$_validate(k,O,R);if(A.errors){if(R.abortEarly)return{value:o,errors:A.errors};A.value!==void 0&&(o[E]=A.value),_.push(...A.errors)}else v.schema._flags.result==="strip"||A.value===void 0&&k!==void 0?delete o[E]:A.value!==void 0&&(o[E]=A.value)}}if(u.size||f._flags._hasPatternMatch){const d=e.unknown(f,o,u,_,y,R);if(d)return d}if(f.$_terms.dependencies)for(const d of f.$_terms.dependencies){if(d.key!==null&&e.isPresent(d.options)(d.key.resolve(o,y,R,null,{shadow:!1}))===!1)continue;const v=e.dependencies[d.rel](f,d,o,y,R);if(v){const E=f.$_createError(v.code,o,v.context,y,R);if(R.abortEarly)return{value:o,errors:E};_.push(E)}}return{value:o,errors:_}},rules:{and:{method(...o){return a.verifyFlat(o,"and"),e.dependency(this,"and",null,o)}},append:{method(o){return o==null||Object.keys(o).length===0?this:this.keys(o)}},assert:{method(o,f,m){c.isTemplate(o)||(o=n.ref(o)),g(m===void 0||typeof m=="string","Message must be a string"),f=this.$_compile(f,{appendPath:!0});const y=this.$_addRule({name:"assert",args:{subject:o,schema:f,message:m}});return y.$_mutateRegister(o),y.$_mutateRegister(f),y},validate(o,{error:f,prefs:m,state:y},{subject:R,schema:_,message:u}){const d=R.resolve(o,y,m),v=r.isRef(R)?R.absolute(y):[];return _.$_match(d,y.localize(v,[o,...y.ancestors],_),m)?o:f("object.assert",{subject:R,message:u})},args:["subject","schema","message"],multi:!0},instance:{method(o,f){return g(typeof o=="function","constructor must be a function"),f=f||o.name,this.$_addRule({name:"instance",args:{constructor:o,name:f}})},validate:(o,f,{constructor:m,name:y})=>o instanceof m?o:f.error("object.instance",{type:y,value:o}),args:["constructor","name"]},keys:{method(o){g(o===void 0||typeof o=="object","Object schema must be a valid object"),g(!a.isSchema(o),"Object schema cannot be a joi schema");const f=this.clone();if(o)if(Object.keys(o).length){f.$_terms.keys=f.$_terms.keys?f.$_terms.keys.filter(m=>!o.hasOwnProperty(m.key)):new e.Keys;for(const m in o)a.tryWithPath(()=>f.$_terms.keys.push({key:m,schema:this.$_compile(o[m])}),m)}else f.$_terms.keys=new e.Keys;else f.$_terms.keys=null;return f.$_mutateRebuild()}},length:{method(o){return this.$_addRule({name:"length",args:{limit:o},operator:"="})},validate:(o,f,{limit:m},{name:y,operator:R,args:_})=>a.compare(Object.keys(o).length,m,R)?o:f.error("object."+y,{limit:_.limit,value:o}),args:[{name:"limit",ref:!0,assert:a.limit,message:"must be a positive integer"}]},max:{method(o){return this.$_addRule({name:"max",method:"length",args:{limit:o},operator:"<="})}},min:{method(o){return this.$_addRule({name:"min",method:"length",args:{limit:o},operator:">="})}},nand:{method(...o){return a.verifyFlat(o,"nand"),e.dependency(this,"nand",null,o)}},or:{method(...o){return a.verifyFlat(o,"or"),e.dependency(this,"or",null,o)}},oxor:{method(...o){return e.dependency(this,"oxor",null,o)}},pattern:{method(o,f,m={}){const y=o instanceof RegExp;y||(o=this.$_compile(o,{appendPath:!0})),g(f!==void 0,"Invalid rule"),a.assertOptions(m,["fallthrough","matches"]),y&&g(!o.flags.includes("g")&&!o.flags.includes("y"),"pattern should not use global or sticky mode"),f=this.$_compile(f,{appendPath:!0});const R=this.clone();R.$_terms.patterns=R.$_terms.patterns||[];const _={[y?"regex":"schema"]:o,rule:f};return m.matches&&(_.matches=this.$_compile(m.matches),_.matches.type!=="array"&&(_.matches=_.matches.$_root.array().items(_.matches)),R.$_mutateRegister(_.matches),R.$_setFlag("_hasPatternMatch",!0,{clone:!1})),m.fallthrough&&(_.fallthrough=!0),R.$_terms.patterns.push(_),R.$_mutateRegister(f),R}},ref:{method(){return this.$_addRule("ref")},validate:(o,f)=>r.isRef(o)?o:f.error("object.refType",{value:o})},regex:{method(){return this.$_addRule("regex")},validate:(o,f)=>o instanceof RegExp?o:f.error("object.regex",{value:o})},rename:{method(o,f,m={}){g(typeof o=="string"||o instanceof RegExp,"Rename missing the from argument"),g(typeof f=="string"||f instanceof c,"Invalid rename to argument"),g(f!==o,"Cannot rename key to same name:",o),a.assertOptions(m,["alias","ignoreUndefined","override","multiple"]);const y=this.clone();y.$_terms.renames=y.$_terms.renames||[];for(const R of y.$_terms.renames)g(R.from!==o,"Cannot rename the same key multiple times");return f instanceof c&&y.$_mutateRegister(f),y.$_terms.renames.push({from:o,to:f,options:i(e.renameDefaults,m)}),y}},schema:{method(o="any"){return this.$_addRule({name:"schema",args:{type:o}})},validate:(o,f,{type:m})=>!a.isSchema(o)||m!=="any"&&o.type!==m?f.error("object.schema",{type:m}):o},unknown:{method(o){return this.$_setFlag("unknown",o!==!1)}},with:{method(o,f,m={}){return e.dependency(this,"with",o,f,m)}},without:{method(o,f,m={}){return e.dependency(this,"without",o,f,m)}},xor:{method(...o){return a.verifyFlat(o,"xor"),e.dependency(this,"xor",null,o)}}},overrides:{default(o,f){return o===void 0&&(o=a.symbols.deepDefault),this.$_parent("default",o,f)}},rebuild(o){if(o.$_terms.keys){const f=new l.Sorter;for(const m of o.$_terms.keys)a.tryWithPath(()=>f.add(m,{after:m.schema.$_rootReferences(),group:m.key}),m.key);o.$_terms.keys=new e.Keys(...f.nodes)}},manifest:{build(o,f){if(f.keys&&(o=o.keys(f.keys)),f.dependencies)for(const{rel:m,key:y=null,peers:R,options:_}of f.dependencies)o=e.dependency(o,m,y,R,_);if(f.patterns)for(const{regex:m,schema:y,rule:R,fallthrough:_,matches:u}of f.patterns)o=o.pattern(m||y,R,{fallthrough:_,matches:u});if(f.renames)for(const{from:m,to:y,options:R}of f.renames)o=o.rename(m,y,R);return o}},messages:{"object.and":"{{#label}} contains {{#presentWithLabels}} without its required peers {{#missingWithLabels}}","object.assert":'{{#label}} is invalid because {if(#subject.key, `"` + #subject.key + `" failed to ` + (#message || "pass the assertion test"), #message || "the assertion failed")}',"object.base":"{{#label}} must be of type {{#type}}","object.instance":"{{#label}} must be an instance of {{:#type}}","object.length":'{{#label}} must have {{#limit}} key{if(#limit == 1, "", "s")}',"object.max":'{{#label}} must have less than or equal to {{#limit}} key{if(#limit == 1, "", "s")}',"object.min":'{{#label}} must have at least {{#limit}} key{if(#limit == 1, "", "s")}',"object.missing":"{{#label}} must contain at least one of {{#peersWithLabels}}","object.nand":"{{:#mainWithLabel}} must not exist simultaneously with {{#peersWithLabels}}","object.oxor":"{{#label}} contains a conflict between optional exclusive peers {{#peersWithLabels}}","object.pattern.match":"{{#label}} keys failed to match pattern requirements","object.refType":"{{#label}} must be a Joi reference","object.regex":"{{#label}} must be a RegExp object","object.rename.multiple":"{{#label}} cannot rename {{:#from}} because multiple renames are disabled and another key was already renamed to {{:#to}}","object.rename.override":"{{#label}} cannot rename {{:#from}} because override is disabled and target {{:#to}} exists","object.schema":"{{#label}} must be a Joi schema of {{#type}} type","object.unknown":"{{#label}} is not allowed","object.with":"{{:#mainWithLabel}} missing required peer {{:#peerWithLabel}}","object.without":"{{:#mainWithLabel}} conflict with forbidden peer {{:#peerWithLabel}}","object.xor":"{{#label}} contains a conflict between exclusive peers {{#peersWithLabels}}"}}),e.clone=function(o,f){if(typeof o=="object"){if(f.nonEnumerables)return h(o,{shallow:!0});const y=Object.create(Object.getPrototypeOf(o));return Object.assign(y,o),y}const m=function(...y){return o.apply(this,y)};return m.prototype=h(o.prototype),Object.defineProperty(m,"name",{value:o.name,writable:!1}),Object.defineProperty(m,"length",{value:o.length,writable:!1}),Object.assign(m,o),m},e.dependency=function(o,f,m,y,R){g(m===null||typeof m=="string",f,"key must be a strings"),R||(R=y.length>1&&typeof y[y.length-1]=="object"?y.pop():{}),a.assertOptions(R,["separator","isPresent"]),y=[].concat(y);const _=a.default(R.separator,"."),u=[];for(const v of y)g(typeof v=="string",f,"peers must be strings"),u.push(n.ref(v,{separator:_,ancestor:0,prefix:!1}));m!==null&&(m=n.ref(m,{separator:_,ancestor:0,prefix:!1}));const d=o.clone();return d.$_terms.dependencies=d.$_terms.dependencies||[],d.$_terms.dependencies.push(new e.Dependency(f,m,u,y,R)),d},e.dependencies={and(o,f,m,y,R){const _=[],u=[],d=f.peers.length,v=e.isPresent(f.options);for(const E of f.peers)v(E.resolve(m,y,R,null,{shadow:!1}))===!1?_.push(E.key):u.push(E.key);if(_.length!==d&&u.length!==d)return{code:"object.and",context:{present:u,presentWithLabels:e.keysToLabels(o,u),missing:_,missingWithLabels:e.keysToLabels(o,_)}}},nand(o,f,m,y,R){const _=[],u=e.isPresent(f.options);for(const E of f.peers)u(E.resolve(m,y,R,null,{shadow:!1}))&&_.push(E.key);if(_.length!==f.peers.length)return;const d=f.paths[0],v=f.paths.slice(1);return{code:"object.nand",context:{main:d,mainWithLabel:e.keysToLabels(o,d),peers:v,peersWithLabels:e.keysToLabels(o,v)}}},or(o,f,m,y,R){const _=e.isPresent(f.options);for(const u of f.peers)if(_(u.resolve(m,y,R,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:f.paths,peersWithLabels:e.keysToLabels(o,f.paths)}}},oxor(o,f,m,y,R){const _=[],u=e.isPresent(f.options);for(const v of f.peers)u(v.resolve(m,y,R,null,{shadow:!1}))&&_.push(v.key);if(!_.length||_.length===1)return;const d={peers:f.paths,peersWithLabels:e.keysToLabels(o,f.paths)};return d.present=_,d.presentWithLabels=e.keysToLabels(o,_),{code:"object.oxor",context:d}},with(o,f,m,y,R){const _=e.isPresent(f.options);for(const u of f.peers)if(_(u.resolve(m,y,R,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:f.key.key,mainWithLabel:e.keysToLabels(o,f.key.key),peer:u.key,peerWithLabel:e.keysToLabels(o,u.key)}}},without(o,f,m,y,R){const _=e.isPresent(f.options);for(const u of f.peers)if(_(u.resolve(m,y,R,null,{shadow:!1})))return{code:"object.without",context:{main:f.key.key,mainWithLabel:e.keysToLabels(o,f.key.key),peer:u.key,peerWithLabel:e.keysToLabels(o,u.key)}}},xor(o,f,m,y,R){const _=[],u=e.isPresent(f.options);for(const v of f.peers)u(v.resolve(m,y,R,null,{shadow:!1}))&&_.push(v.key);if(_.length===1)return;const d={peers:f.paths,peersWithLabels:e.keysToLabels(o,f.paths)};return _.length===0?{code:"object.missing",context:d}:(d.present=_,d.presentWithLabels=e.keysToLabels(o,_),{code:"object.xor",context:d})}},e.keysToLabels=function(o,f){return Array.isArray(f)?f.map(m=>o.$_mapLabels(m)):o.$_mapLabels(f)},e.isPresent=function(o){return typeof o.isPresent=="function"?o.isPresent:f=>f!==void 0},e.rename=function(o,f,m,y,R){const _={};for(const u of o.$_terms.renames){const d=[],v=typeof u.from!="string";if(v)for(const E in f){if(f[E]===void 0&&u.options.ignoreUndefined||E===u.to)continue;const k=u.from.exec(E);k&&d.push({from:E,to:u.to,match:k})}else!Object.prototype.hasOwnProperty.call(f,u.from)||f[u.from]===void 0&&u.options.ignoreUndefined||d.push(u);for(const E of d){const k=E.from;let O=E.to;if(O instanceof c&&(O=O.render(f,m,y,E.match)),k!==O){if(!u.options.multiple&&_[O]&&(R.push(o.$_createError("object.rename.multiple",f,{from:k,to:O,pattern:v},m,y)),y.abortEarly)||Object.prototype.hasOwnProperty.call(f,O)&&!u.options.override&&!_[O]&&(R.push(o.$_createError("object.rename.override",f,{from:k,to:O,pattern:v},m,y)),y.abortEarly))return!1;f[k]===void 0?delete f[O]:f[O]=f[k],_[O]=!0,u.options.alias||delete f[k]}}}return!0},e.unknown=function(o,f,m,y,R,_){if(o.$_terms.patterns){let u=!1;const d=o.$_terms.patterns.map(E=>{if(E.matches)return u=!0,[]}),v=[f,...R.ancestors];for(const E of m){const k=f[E],O=[...R.path,E];for(let A=0;A<o.$_terms.patterns.length;++A){const I=o.$_terms.patterns[A];if(I.regex){const K=I.regex.test(E);if(R.mainstay.tracer.debug(R,"rule",`pattern.${A}`,K?"pass":"error"),!K)continue}else if(!I.schema.$_match(E,R.nest(I.schema,`pattern.${A}`),_))continue;m.delete(E);const T=R.localize(O,v,{schema:I.rule,key:E}),F=I.rule.$_validate(k,T,_);if(F.errors){if(_.abortEarly)return{value:f,errors:F.errors};y.push(...F.errors)}if(I.matches&&d[A].push(E),f[E]=F.value,!I.fallthrough)break}}if(u)for(let E=0;E<d.length;++E){const k=d[E];if(!k)continue;const O=o.$_terms.patterns[E].matches,A=R.localize(R.path,v,O),I=O.$_validate(k,A,_);if(I.errors){const T=s.details(I.errors,{override:!1});T.matches=k;const F=o.$_createError("object.pattern.match",f,T,R,_);if(_.abortEarly)return{value:f,errors:F};y.push(F)}}}if(m.size&&(o.$_terms.keys||o.$_terms.patterns)){if(_.stripUnknown&&!o._flags.unknown||_.skipFunctions){const u=!(!_.stripUnknown||_.stripUnknown!==!0&&!_.stripUnknown.objects);for(const d of m)u?(delete f[d],m.delete(d)):typeof f[d]=="function"&&m.delete(d)}if(!a.default(o._flags.unknown,_.allowUnknown))for(const u of m){const d=R.localize([...R.path,u],[]),v=o.$_createError("object.unknown",f[u],{child:u},d,_,{flags:!1});if(_.abortEarly)return{value:f,errors:v};y.push(v)}}},e.Dependency=class{constructor(o,f,m,y,R){this.rel=o,this.key=f,this.peers=m,this.paths=y,this.options=R}describe(){const o={rel:this.rel,peers:this.paths};return this.key!==null&&(o.key=this.key.key),this.peers[0].separator!=="."&&(o.options={...o.options,separator:this.peers[0].separator}),this.options.isPresent&&(o.options={...o.options,isPresent:this.options.isPresent}),o}},e.Keys=class extends Array{concat(o){const f=this.slice(),m=new Map;for(let y=0;y<f.length;++y)m.set(f[y].key,y);for(const y of o){const R=y.key,_=m.get(R);_!==void 0?f[_]={key:R,schema:f[_].schema.concat(y.schema)}:f.push(y)}return f}}},8785:(S,w,p)=>{const i=p(375),g=p(8068),h=p(8160),l=p(3292),t=p(6354),a={};S.exports=g.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(n,s)=>n.ref(s),validate(n,{schema:s,state:r,prefs:c}){i(s.$_terms.link,"Uninitialized link schema");const e=a.generate(s,n,r,c),o=s.$_terms.link[0].ref;return e.$_validate(n,r.nest(e,`link:${o.display}:${e.type}`),c)},generate:(n,s,r,c)=>a.generate(n,s,r,c),rules:{ref:{method(n){i(!this.$_terms.link,"Cannot reinitialize schema"),n=l.ref(n),i(n.type==="value"||n.type==="local","Invalid reference type:",n.type),i(n.type==="local"||n.ancestor==="root"||n.ancestor>0,"Link cannot reference itself");const s=this.clone();return s.$_terms.link=[{ref:n}],s}},relative:{method(n=!0){return this.$_setFlag("relative",n)}}},overrides:{concat(n){i(this.$_terms.link,"Uninitialized link schema"),i(h.isSchema(n),"Invalid schema object"),i(n.type!=="link","Cannot merge type link with another link");const s=this.clone();return s.$_terms.whens||(s.$_terms.whens=[]),s.$_terms.whens.push({concat:n}),s.$_mutateRebuild()}},manifest:{build:(n,s)=>(i(s.link,"Invalid link description missing link"),n.ref(s.link))}}),a.generate=function(n,s,r,c){let e=r.mainstay.links.get(n);if(e)return e._generate(s,r,c).schema;const o=n.$_terms.link[0].ref,{perspective:f,path:m}=a.perspective(o,r);a.assert(f,"which is outside of schema boundaries",o,n,r,c);try{e=m.length?f.$_reach(m):f}catch{a.assert(!1,"to non-existing schema",o,n,r,c)}return a.assert(e.type!=="link","which is another link",o,n,r,c),n._flags.relative||r.mainstay.links.set(n,e),e._generate(s,r,c).schema},a.perspective=function(n,s){if(n.type==="local"){for(const{schema:r,key:c}of s.schemas){if((r._flags.id||c)===n.path[0])return{perspective:r,path:n.path.slice(1)};if(r.$_terms.shared){for(const e of r.$_terms.shared)if(e._flags.id===n.path[0])return{perspective:e,path:n.path.slice(1)}}}return{perspective:null,path:null}}return n.ancestor==="root"?{perspective:s.schemas[s.schemas.length-1].schema,path:n.path}:{perspective:s.schemas[n.ancestor]&&s.schemas[n.ancestor].schema,path:n.path}},a.assert=function(n,s,r,c,e,o){n||i(!1,`"${t.label(c._flags,e,o)}" contains link reference "${r.display}" ${s}`)}},3832:(S,w,p)=>{const i=p(375),g=p(8068),h=p(8160),l={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(t){const a=t.toString(),n=a.indexOf("."),s=a.indexOf("e");return(n<0?0:(s<0?a.length:s)-n-1)+(s<0?0:Math.max(0,-parseInt(a.slice(s+1))))}};S.exports=g.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(t,{schema:a,error:n}){if(!t.match(l.numberRx))return;t=t.trim();const s={value:parseFloat(t)};if(s.value===0&&(s.value=0),!a._flags.unsafe)if(t.match(/e/i)){if(l.extractSignificantDigits(t)!==l.extractSignificantDigits(String(s.value)))return s.errors=n("number.unsafe"),s}else{const r=s.value.toString();if(r.match(/e/i))return s;if(r!==l.normalizeDecimal(t))return s.errors=n("number.unsafe"),s}return s}},validate(t,{schema:a,error:n,prefs:s}){if(t===1/0||t===-1/0)return{value:t,errors:n("number.infinity")};if(!h.isNumber(t))return{value:t,errors:n("number.base")};const r={value:t};if(s.convert){const c=a.$_getRule("precision");if(c){const e=Math.pow(10,c.args.limit);r.value=Math.round(r.value*e)/e}}return r.value===0&&(r.value=0),!a._flags.unsafe&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER)&&(r.errors=n("number.unsafe")),r},rules:{compare:{method:!1,validate:(t,a,{limit:n},{name:s,operator:r,args:c})=>h.compare(t,n,r)?t:a.error("number."+s,{limit:c.limit,value:t}),args:[{name:"limit",ref:!0,assert:h.isNumber,message:"must be a number"}]},greater:{method(t){return this.$_addRule({name:"greater",method:"compare",args:{limit:t},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(t,a)=>Math.trunc(t)-t==0?t:a.error("number.integer")},less:{method(t){return this.$_addRule({name:"less",method:"compare",args:{limit:t},operator:"<"})}},max:{method(t){return this.$_addRule({name:"max",method:"compare",args:{limit:t},operator:"<="})}},min:{method(t){return this.$_addRule({name:"min",method:"compare",args:{limit:t},operator:">="})}},multiple:{method(t){const a=typeof t=="number"?l.decimalPlaces(t):null,n=Math.pow(10,a);return this.$_addRule({name:"multiple",args:{base:t,baseDecimalPlace:a,pfactor:n}})},validate:(t,a,{base:n,baseDecimalPlace:s,pfactor:r},c)=>l.decimalPlaces(t)>s?a.error("number.multiple",{multiple:c.args.base,value:t}):Math.round(r*t)%Math.round(r*n)==0?t:a.error("number.multiple",{multiple:c.args.base,value:t}),args:[{name:"base",ref:!0,assert:t=>typeof t=="number"&&isFinite(t)&&t>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(t,a)=>Number.isSafeInteger(t)&&t>=0&&t<=65535?t:a.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(t){return i(Number.isSafeInteger(t),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:t}})},validate(t,a,{limit:n}){const s=t.toString().match(l.precisionRx);return Math.max((s[1]?s[1].length:0)-(s[2]?parseInt(s[2],10):0),0)<=n?t:a.error("number.precision",{limit:n,value:t})},convert:!0},sign:{method(t){return i(["negative","positive"].includes(t),"Invalid sign",t),this.$_addRule({name:"sign",args:{sign:t}})},validate:(t,a,{sign:n})=>n==="negative"&&t<0||n==="positive"&&t>0?t:a.error(`number.${n}`)},unsafe:{method(t=!0){return i(typeof t=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",t)}}},cast:{string:{from:t=>typeof t=="number",to:(t,a)=>t.toString()}},messages:{"number.base":"{{#label}} must be a number","number.greater":"{{#label}} must be greater than {{#limit}}","number.infinity":"{{#label}} cannot be infinity","number.integer":"{{#label}} must be an integer","number.less":"{{#label}} must be less than {{#limit}}","number.max":"{{#label}} must be less than or equal to {{#limit}}","number.min":"{{#label}} must be greater than or equal to {{#limit}}","number.multiple":"{{#label}} must be a multiple of {{#multiple}}","number.negative":"{{#label}} must be a negative number","number.port":"{{#label}} must be a valid port","number.positive":"{{#label}} must be a positive number","number.precision":"{{#label}} must have no more than {{#limit}} decimal places","number.unsafe":"{{#label}} must be a safe number"}}),l.extractSignificantDigits=function(t){return t.replace(l.exponentialPartRegex,"").replace(l.dotRegex,"").replace(l.trailingZerosRegex,"").replace(l.leadingSignAndZerosRegex,"")},l.normalizeDecimal=function(t){return(t=t.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&t.endsWith("0")&&(t=t.replace(/0+$/,"")),t==="-0"?"0":t}},8966:(S,w,p)=>{const i=p(7824);S.exports=i.extend({type:"object",cast:{map:{from:g=>g&&typeof g=="object",to:(g,h)=>new Map(Object.entries(g))}}})},7417:(S,w,p)=>{const i=p(375),g=p(5380),h=p(1745),l=p(9959),t=p(6064),a=p(9926),n=p(5752),s=p(8068),r=p(8160),c={tlds:a instanceof Set&&{tlds:{allow:a,deny:null}},base64Regex:{true:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}==|[\w\-]{3}=)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/},false:{true:/^(?:[\w\-]{2}[\w\-]{2})*(?:[\w\-]{2}(==)?|[\w\-]{3}=?)?$/,false:/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}(==)?|[A-Za-z0-9+\/]{3}=?)?$/}},dataUriRegex:/^data:[\w+.-]+\/[\w+.-]+;((charset=[\w-]+|base64),)?(.*)$/,hexRegex:{withPrefix:/^0x[0-9a-f]+$/i,withOptionalPrefix:/^(?:0x)?[0-9a-f]+$/i,withoutPrefix:/^[0-9a-f]+$/i},ipRegex:l.regex({cidr:"forbidden"}).regex,isoDurationRegex:/^P(?!$)(\d+Y)?(\d+M)?(\d+W)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?$/,guidBrackets:{"{":"}","[":"]","(":")","":""},guidVersions:{uuidv1:"1",uuidv2:"2",uuidv3:"3",uuidv4:"4",uuidv5:"5",uuidv6:"6",uuidv7:"7",uuidv8:"8"},guidSeparators:new Set([void 0,!0,!1,"-",":"]),normalizationForms:["NFC","NFD","NFKC","NFKD"]};S.exports=s.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(e,{schema:o,state:f,prefs:m}){const y=o.$_getRule("normalize");y&&(e=e.normalize(y.args.form));const R=o.$_getRule("case");R&&(e=R.args.direction==="upper"?e.toLocaleUpperCase():e.toLocaleLowerCase());const _=o.$_getRule("trim");if(_&&_.args.enabled&&(e=e.trim()),o.$_terms.replacements)for(const d of o.$_terms.replacements)e=e.replace(d.pattern,d.replacement);const u=o.$_getRule("hex");if(u&&u.args.options.byteAligned&&e.length%2!=0&&(e=`0${e}`),o.$_getRule("isoDate")){const d=c.isoDate(e);d&&(e=d)}if(o._flags.truncate){const d=o.$_getRule("max");if(d){let v=d.args.limit;if(r.isResolvable(v)&&(v=v.resolve(e,f,m),!r.limit(v)))return{value:e,errors:o.$_createError("any.ref",v,{ref:d.args.limit,arg:"limit",reason:"must be a positive integer"},f,m)};e=e.slice(0,v)}}return{value:e}}},validate(e,{schema:o,error:f}){if(typeof e!="string")return{value:e,errors:f("string.base")};if(e===""){const m=o.$_getRule("min");return m&&m.args.limit===0?void 0:{value:e,errors:f("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(e,o)=>/^[a-zA-Z0-9]+$/.test(e)?e:o.error("string.alphanum")},base64:{method(e={}){return r.assertOptions(e,["paddingRequired","urlSafe"]),e={urlSafe:!1,paddingRequired:!0,...e},i(typeof e.paddingRequired=="boolean","paddingRequired must be boolean"),i(typeof e.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:e}})},validate:(e,o,{options:f})=>c.base64Regex[f.paddingRequired][f.urlSafe].test(e)?e:o.error("string.base64")},case:{method(e){return i(["lower","upper"].includes(e),"Invalid case:",e),this.$_addRule({name:"case",args:{direction:e}})},validate:(e,o,{direction:f})=>f==="lower"&&e===e.toLocaleLowerCase()||f==="upper"&&e===e.toLocaleUpperCase()?e:o.error(`string.${f}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(e,o){let f=e.length,m=0,y=1;for(;f--;){const R=e.charAt(f)*y;m+=R-9*(R>9),y^=3}return m>0&&m%10==0?e:o.error("string.creditCard")}},dataUri:{method(e={}){return r.assertOptions(e,["paddingRequired"]),e={paddingRequired:!0,...e},i(typeof e.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:e}})},validate(e,o,{options:f}){const m=e.match(c.dataUriRegex);return m&&(!m[2]||m[2]!=="base64"||c.base64Regex[f.paddingRequired].false.test(m[3]))?e:o.error("string.dataUri")}},domain:{method(e){e&&r.assertOptions(e,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const o=c.addressOptions(e);return this.$_addRule({name:"domain",args:{options:e},address:o})},validate:(e,o,f,{address:m})=>g.isValid(e,m)?e:o.error("string.domain")},email:{method(e={}){r.assertOptions(e,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),i(e.multiple===void 0||typeof e.multiple=="boolean","multiple option must be an boolean");const o=c.addressOptions(e),f=new RegExp(`\\s*[${e.separator?t(e.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:e},regex:f,address:o})},validate(e,o,{options:f},{regex:m,address:y}){const R=f.multiple?e.split(m):[e],_=[];for(const u of R)h.isValid(u,y)||_.push(u);return _.length?o.error("string.email",{value:e,invalids:_}):e}},guid:{alias:"uuid",method(e={}){r.assertOptions(e,["version","separator"]);let o="";if(e.version){const y=[].concat(e.version);i(y.length>=1,"version must have at least 1 valid version specified");const R=new Set;for(let _=0;_<y.length;++_){const u=y[_];i(typeof u=="string","version at position "+_+" must be a string");const d=c.guidVersions[u.toLowerCase()];i(d,"version at position "+_+" must be one of "+Object.keys(c.guidVersions).join(", ")),i(!R.has(d),"version at position "+_+" must not be a duplicate"),o+=d,R.add(d)}}i(c.guidSeparators.has(e.separator),'separator must be one of true, false, "-", or ":"');const f=e.separator===void 0?"[:-]?":e.separator===!0?"[:-]":e.separator===!1?"[]?":`\\${e.separator}`,m=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${f})[0-9A-F]{4}\\2?[${o||"0-9A-F"}][0-9A-F]{3}\\2?[${o?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:e},regex:m})},validate(e,o,f,{regex:m}){const y=m.exec(e);return y?c.guidBrackets[y[1]]!==y[y.length-1]?o.error("string.guid"):e:o.error("string.guid")}},hex:{method(e={}){return r.assertOptions(e,["byteAligned","prefix"]),e={byteAligned:!1,prefix:!1,...e},i(typeof e.byteAligned=="boolean","byteAligned must be boolean"),i(typeof e.prefix=="boolean"||e.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:e}})},validate:(e,o,{options:f})=>(f.prefix==="optional"?c.hexRegex.withOptionalPrefix:f.prefix===!0?c.hexRegex.withPrefix:c.hexRegex.withoutPrefix).test(e)?f.byteAligned&&e.length%2!=0?o.error("string.hexAlign"):e:o.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(e,o)=>g.isValid(e,{minDomainSegments:1})||c.ipRegex.test(e)?e:o.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(e={}){r.assertOptions(e,["cidr","version"]);const{cidr:o,versions:f,regex:m}=l.regex(e),y=e.version?f:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:o,version:y}},regex:m})},validate:(e,o,{options:f},{regex:m})=>m.test(e)?e:f.version?o.error("string.ipVersion",{value:e,cidr:f.cidr,version:f.version}):o.error("string.ip",{value:e,cidr:f.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(e,{error:o})=>c.isoDate(e)?e:o("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(e,o)=>c.isoDurationRegex.test(e)?e:o.error("string.isoDuration")},length:{method(e,o){return c.length(this,"length",e,"=",o)},validate(e,o,{limit:f,encoding:m},{name:y,operator:R,args:_}){const u=!m&&e.length;return r.compare(u,f,R)?e:o.error("string."+y,{limit:_.limit,value:e,encoding:m})},args:[{name:"limit",ref:!0,assert:r.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(e,o){return c.length(this,"max",e,"<=",o)},args:["limit","encoding"]},min:{method(e,o){return c.length(this,"min",e,">=",o)},args:["limit","encoding"]},normalize:{method(e="NFC"){return i(c.normalizationForms.includes(e),"normalization form must be one of "+c.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:e}})},validate:(e,{error:o},{form:f})=>e===e.normalize(f)?e:o("string.normalize",{value:e,form:f}),convert:!0},pattern:{alias:"regex",method(e,o={}){i(e instanceof RegExp,"regex must be a RegExp"),i(!e.flags.includes("g")&&!e.flags.includes("y"),"regex should not use global or sticky mode"),typeof o=="string"&&(o={name:o}),r.assertOptions(o,["invert","name"]);const f=["string.pattern",o.invert?".invert":"",o.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:e,options:o},errorCode:f})},validate:(e,o,{regex:f,options:m},{errorCode:y})=>f.test(e)^m.invert?e:o.error(y,{name:m.name,regex:f,value:e}),args:["regex","options"],multi:!0},replace:{method(e,o){typeof e=="string"&&(e=new RegExp(t(e),"g")),i(e instanceof RegExp,"pattern must be a RegExp"),i(typeof o=="string","replacement must be a String");const f=this.clone();return f.$_terms.replacements||(f.$_terms.replacements=[]),f.$_terms.replacements.push({pattern:e,replacement:o}),f}},token:{method(){return this.$_addRule("token")},validate:(e,o)=>/^\w+$/.test(e)?e:o.error("string.token")},trim:{method(e=!0){return i(typeof e=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:e}})},validate:(e,o,{enabled:f})=>f&&e!==e.trim()?o.error("string.trim"):e,convert:!0},truncate:{method(e=!0){return i(typeof e=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",e)}},uppercase:{method(){return this.case("upper")}},uri:{method(e={}){r.assertOptions(e,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme"]),e.domain&&r.assertOptions(e.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:o,scheme:f}=n.regex(e),m=e.domain?c.addressOptions(e.domain):null;return this.$_addRule({name:"uri",args:{options:e},regex:o,domain:m,scheme:f})},validate(e,o,{options:f},{regex:m,domain:y,scheme:R}){if(["http:/","https:/"].includes(e))return o.error("string.uri");const _=m.exec(e);if(_){const u=_[1]||_[2];return!y||f.allowRelative&&!u||g.isValid(u,y)?e:o.error("string.domain",{value:u})}return f.relativeOnly?o.error("string.uriRelativeOnly"):f.scheme?o.error("string.uriCustomScheme",{scheme:R,value:e}):o.error("string.uri")}}},manifest:{build(e,o){if(o.replacements)for(const{pattern:f,replacement:m}of o.replacements)e=e.replace(f,m);return e}},messages:{"string.alphanum":"{{#label}} must only contain alpha-numeric characters","string.base":"{{#label}} must be a string","string.base64":"{{#label}} must be a valid base64 string","string.creditCard":"{{#label}} must be a credit card","string.dataUri":"{{#label}} must be a valid dataUri string","string.domain":"{{#label}} must contain a valid domain name","string.email":"{{#label}} must be a valid email","string.empty":"{{#label}} is not allowed to be empty","string.guid":"{{#label}} must be a valid GUID","string.hex":"{{#label}} must only contain hexadecimal characters","string.hexAlign":"{{#label}} hex decoded representation must be byte aligned","string.hostname":"{{#label}} must be a valid hostname","string.ip":"{{#label}} must be a valid ip address with a {{#cidr}} CIDR","string.ipVersion":"{{#label}} must be a valid ip address of one of the following versions {{#version}} with a {{#cidr}} CIDR","string.isoDate":"{{#label}} must be in iso format","string.isoDuration":"{{#label}} must be a valid ISO 8601 duration","string.length":"{{#label}} length must be {{#limit}} characters long","string.lowercase":"{{#label}} must only contain lowercase characters","string.max":"{{#label}} length must be less than or equal to {{#limit}} characters long","string.min":"{{#label}} length must be at least {{#limit}} characters long","string.normalize":"{{#label}} must be unicode normalized in the {{#form}} form","string.token":"{{#label}} must only contain alpha-numeric and underscore characters","string.pattern.base":"{{#label}} with value {:[.]} fails to match the required pattern: {{#regex}}","string.pattern.name":"{{#label}} with value {:[.]} fails to match the {{#name}} pattern","string.pattern.invert.base":"{{#label}} with value {:[.]} matches the inverted pattern: {{#regex}}","string.pattern.invert.name":"{{#label}} with value {:[.]} matches the inverted {{#name}} pattern","string.trim":"{{#label}} must not have leading or trailing whitespace","string.uri":"{{#label}} must be a valid uri","string.uriCustomScheme":"{{#label}} must be a valid uri with a scheme matching the {{#scheme}} pattern","string.uriRelativeOnly":"{{#label}} must be a valid relative uri","string.uppercase":"{{#label}} must only contain uppercase characters"}}),c.addressOptions=function(e){if(!e)return c.tlds||e;if(i(e.minDomainSegments===void 0||Number.isSafeInteger(e.minDomainSegments)&&e.minDomainSegments>0,"minDomainSegments must be a positive integer"),i(e.maxDomainSegments===void 0||Number.isSafeInteger(e.maxDomainSegments)&&e.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),e.tlds===!1)return e;if(e.tlds===!0||e.tlds===void 0)return i(c.tlds,"Built-in TLD list disabled"),Object.assign({},e,c.tlds);i(typeof e.tlds=="object","tlds must be true, false, or an object");const o=e.tlds.deny;if(o)return Array.isArray(o)&&(e=Object.assign({},e,{tlds:{deny:new Set(o)}})),i(e.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),i(!e.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),c.validateTlds(e.tlds.deny,"tlds.deny"),e;const f=e.tlds.allow;return f?f===!0?(i(c.tlds,"Built-in TLD list disabled"),Object.assign({},e,c.tlds)):(Array.isArray(f)&&(e=Object.assign({},e,{tlds:{allow:new Set(f)}})),i(e.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),c.validateTlds(e.tlds.allow,"tlds.allow"),e):e},c.validateTlds=function(e,o){for(const f of e)i(g.isValid(f,{minDomainSegments:1,maxDomainSegments:1}),`${o} must contain valid top level domain names`)},c.isoDate=function(e){if(!r.isIsoDate(e))return null;/.*T.*[+-]\d\d$/.test(e)&&(e+="00");const o=new Date(e);return isNaN(o.getTime())?null:o.toISOString()},c.length=function(e,o,f,m,y){return i(!y||!1,"Invalid encoding:",y),e.$_addRule({name:o,method:"length",args:{limit:f,encoding:y},operator:m})}},8826:(S,w,p)=>{const i=p(375),g=p(8068),h={};h.Map=class extends Map{slice(){return new h.Map(this)}},S.exports=g.extend({type:"symbol",terms:{map:{init:new h.Map}},coerce:{method(l,{schema:t,error:a}){const n=t.$_terms.map.get(l);return n&&(l=n),t._flags.only&&typeof l!="symbol"?{value:l,errors:a("symbol.map",{map:t.$_terms.map})}:{value:l}}},validate(l,{error:t}){if(typeof l!="symbol")return{value:l,errors:t("symbol.base")}},rules:{map:{method(l){l&&!l[Symbol.iterator]&&typeof l=="object"&&(l=Object.entries(l)),i(l&&l[Symbol.iterator],"Iterable must be an iterable or object");const t=this.clone(),a=[];for(const n of l){i(n&&n[Symbol.iterator],"Entry must be an iterable");const[s,r]=n;i(typeof s!="object"&&typeof s!="function"&&typeof s!="symbol","Key must not be of type object, function, or Symbol"),i(typeof r=="symbol","Value must be a Symbol"),t.$_terms.map.set(s,r),a.push(r)}return t.valid(...a)}}},manifest:{build:(l,t)=>(t.map&&(l=l.map(t.map)),l)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(S,w,p)=>{const i=p(375),g=p(8571),h=p(738),l=p(9621),t=p(8160),a=p(6354),n=p(493),s={result:Symbol("result")};w.entry=function(r,c,e){let o=t.defaults;e&&(i(e.warnings===void 0,"Cannot override warnings preference in synchronous validation"),i(e.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),o=t.preferences(t.defaults,e));const f=s.entry(r,c,o);i(!f.mainstay.externals.length,"Schema with external rules must use validateAsync()");const m={value:f.value};return f.error&&(m.error=f.error),f.mainstay.warnings.length&&(m.warning=a.details(f.mainstay.warnings)),f.mainstay.debug&&(m.debug=f.mainstay.debug),f.mainstay.artifacts&&(m.artifacts=f.mainstay.artifacts),m},w.entryAsync=async function(r,c,e){let o=t.defaults;e&&(o=t.preferences(t.defaults,e));const f=s.entry(r,c,o),m=f.mainstay;if(f.error)throw m.debug&&(f.error.debug=m.debug),f.error;if(m.externals.length){let R=f.value;const _=[];for(const u of m.externals){const d=u.state.path,v=u.schema.type==="link"?m.links.get(u.schema):null;let E,k,O=R;const A=d.length?[R]:[],I=d.length?l(r,d):r;if(d.length){E=d[d.length-1];let T=R;for(const F of d.slice(0,-1))T=T[F],A.unshift(T);k=A[0],O=k[E]}try{const T=(K,V)=>(v||u.schema).$_createError(K,O,V,u.state,o),F=await u.method(O,{schema:u.schema,linked:v,state:u.state,prefs:e,original:I,error:T,errorsArray:s.errorsArray,warn:(K,V)=>m.warnings.push((v||u.schema).$_createError(K,O,V,u.state,o)),message:(K,V)=>(v||u.schema).$_createError("external",O,V,u.state,o,{messages:K})});if(F===void 0||F===O)continue;if(F instanceof a.Report){if(m.tracer.log(u.schema,u.state,"rule","external","error"),_.push(F),o.abortEarly)break;continue}if(Array.isArray(F)&&F[t.symbols.errors]){if(m.tracer.log(u.schema,u.state,"rule","external","error"),_.push(...F),o.abortEarly)break;continue}k?(m.tracer.value(u.state,"rule",O,F,"external"),k[E]=F):(m.tracer.value(u.state,"rule",R,F,"external"),R=F)}catch(T){throw o.errors.label&&(T.message+=` (${u.label})`),T}}if(f.value=R,_.length)throw f.error=a.process(_,r,o),m.debug&&(f.error.debug=m.debug),f.error}if(!o.warnings&&!o.debug&&!o.artifacts)return f.value;const y={value:f.value};return m.warnings.length&&(y.warning=a.details(m.warnings)),m.debug&&(y.debug=m.debug),m.artifacts&&(y.artifacts=m.artifacts),y},s.Mainstay=class{constructor(r,c,e){this.externals=[],this.warnings=[],this.tracer=r,this.debug=c,this.links=e,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const r=this._snapshots.pop();this.externals=r.externals,this.warnings=r.warnings}commit(){this._snapshots.pop()}},s.entry=function(r,c,e){const{tracer:o,cleanup:f}=s.tracer(c,e),m=e.debug?[]:null,y=c._ids._schemaChain?new Map:null,R=new s.Mainstay(o,m,y),_=c._ids._schemaChain?[{schema:c}]:null,u=new n([],[],{mainstay:R,schemas:_}),d=w.validate(r,c,u,e);f&&c.$_root.untrace();const v=a.process(d.errors,r,e);return{value:d.value,error:v,mainstay:R}},s.tracer=function(r,c){return r.$_root._tracer?{tracer:r.$_root._tracer._register(r)}:c.debug?(i(r.$_root.trace,"Debug mode not supported"),{tracer:r.$_root.trace()._register(r),cleanup:!0}):{tracer:s.ignore}},w.validate=function(r,c,e,o,f={}){if(c.$_terms.whens&&(c=c._generate(r,e,o).schema),c._preferences&&(o=s.prefs(c,o)),c._cache&&o.cache){const v=c._cache.get(r);if(e.mainstay.tracer.debug(e,"validate","cached",!!v),v)return v}const m=(v,E,k)=>c.$_createError(v,r,E,k||e,o),y={original:r,prefs:o,schema:c,state:e,error:m,errorsArray:s.errorsArray,warn:(v,E,k)=>e.mainstay.warnings.push(m(v,E,k)),message:(v,E)=>c.$_createError("custom",r,E,e,o,{messages:v})};e.mainstay.tracer.entry(c,e);const R=c._definition;if(R.prepare&&r!==void 0&&o.convert){const v=R.prepare(r,y);if(v){if(e.mainstay.tracer.value(e,"prepare",r,v.value),v.errors)return s.finalize(v.value,[].concat(v.errors),y);r=v.value}}if(R.coerce&&r!==void 0&&o.convert&&(!R.coerce.from||R.coerce.from.includes(typeof r))){const v=R.coerce.method(r,y);if(v){if(e.mainstay.tracer.value(e,"coerced",r,v.value),v.errors)return s.finalize(v.value,[].concat(v.errors),y);r=v.value}}const _=c._flags.empty;_&&_.$_match(s.trim(r,c),e.nest(_),t.defaults)&&(e.mainstay.tracer.value(e,"empty",r,void 0),r=void 0);const u=f.presence||c._flags.presence||(c._flags._endedSwitch?null:o.presence);if(r===void 0){if(u==="forbidden")return s.finalize(r,null,y);if(u==="required")return s.finalize(r,[c.$_createError("any.required",r,null,e,o)],y);if(u==="optional"){if(c._flags.default!==t.symbols.deepDefault)return s.finalize(r,null,y);e.mainstay.tracer.value(e,"default",r,{}),r={}}}else if(u==="forbidden")return s.finalize(r,[c.$_createError("any.unknown",r,null,e,o)],y);const d=[];if(c._valids){const v=c._valids.get(r,e,o,c._flags.insensitive);if(v)return o.convert&&(e.mainstay.tracer.value(e,"valids",r,v.value),r=v.value),e.mainstay.tracer.filter(c,e,"valid",v),s.finalize(r,null,y);if(c._flags.only){const E=c.$_createError("any.only",r,{valids:c._valids.values({display:!0})},e,o);if(o.abortEarly)return s.finalize(r,[E],y);d.push(E)}}if(c._invalids){const v=c._invalids.get(r,e,o,c._flags.insensitive);if(v){e.mainstay.tracer.filter(c,e,"invalid",v);const E=c.$_createError("any.invalid",r,{invalids:c._invalids.values({display:!0})},e,o);if(o.abortEarly)return s.finalize(r,[E],y);d.push(E)}}if(R.validate){const v=R.validate(r,y);if(v&&(e.mainstay.tracer.value(e,"base",r,v.value),r=v.value,v.errors)){if(!Array.isArray(v.errors))return d.push(v.errors),s.finalize(r,d,y);if(v.errors.length)return d.push(...v.errors),s.finalize(r,d,y)}}return c._rules.length?s.rules(r,d,y):s.finalize(r,d,y)},s.rules=function(r,c,e){const{schema:o,state:f,prefs:m}=e;for(const y of o._rules){const R=o._definition.rules[y.method];if(R.convert&&m.convert){f.mainstay.tracer.log(o,f,"rule",y.name,"full");continue}let _,u=y.args;if(y._resolve.length){u=Object.assign({},u);for(const v of y._resolve){const E=R.argsByName.get(v),k=u[v].resolve(r,f,m),O=E.normalize?E.normalize(k):k,A=t.validateArg(O,null,E);if(A){_=o.$_createError("any.ref",k,{arg:v,ref:u[v],reason:A},f,m);break}u[v]=O}}_=_||R.validate(r,e,u,y);const d=s.rule(_,y);if(d.errors){if(f.mainstay.tracer.log(o,f,"rule",y.name,"error"),y.warn){f.mainstay.warnings.push(...d.errors);continue}if(m.abortEarly)return s.finalize(r,d.errors,e);c.push(...d.errors)}else f.mainstay.tracer.log(o,f,"rule",y.name,"pass"),f.mainstay.tracer.value(f,"rule",r,d.value,y.name),r=d.value}return s.finalize(r,c,e)},s.rule=function(r,c){return r instanceof a.Report?(s.error(r,c),{errors:[r],value:null}):Array.isArray(r)&&r[t.symbols.errors]?(r.forEach(e=>s.error(e,c)),{errors:r,value:null}):{errors:null,value:r}},s.error=function(r,c){return c.message&&r._setTemplate(c.message),r},s.finalize=function(r,c,e){c=c||[];const{schema:o,state:f,prefs:m}=e;if(c.length){const R=s.default("failover",void 0,c,e);R!==void 0&&(f.mainstay.tracer.value(f,"failover",r,R),r=R,c=[])}if(c.length&&o._flags.error)if(typeof o._flags.error=="function"){c=o._flags.error(c),Array.isArray(c)||(c=[c]);for(const R of c)i(R instanceof Error||R instanceof a.Report,"error() must return an Error object")}else c=[o._flags.error];if(r===void 0){const R=s.default("default",r,c,e);f.mainstay.tracer.value(f,"default",r,R),r=R}if(o._flags.cast&&r!==void 0){const R=o._definition.cast[o._flags.cast];if(R.from(r)){const _=R.to(r,e);f.mainstay.tracer.value(f,"cast",r,_,o._flags.cast),r=_}}if(o.$_terms.externals&&m.externals&&m._externals!==!1)for(const{method:R}of o.$_terms.externals)f.mainstay.externals.push({method:R,schema:o,state:f,label:a.label(o._flags,f,m)});const y={value:r,errors:c.length?c:null};return o._flags.result&&(y.value=o._flags.result==="strip"?void 0:e.original,f.mainstay.tracer.value(f,o._flags.result,r,y.value),f.shadow(r,o._flags.result)),o._cache&&m.cache!==!1&&!o._refs.length&&o._cache.set(e.original,y),r===void 0||y.errors||o._flags.artifact===void 0||(f.mainstay.artifacts=f.mainstay.artifacts||new Map,f.mainstay.artifacts.has(o._flags.artifact)||f.mainstay.artifacts.set(o._flags.artifact,[]),f.mainstay.artifacts.get(o._flags.artifact).push(f.path)),y},s.prefs=function(r,c){const e=c===t.defaults;return e&&r._preferences[t.symbols.prefs]?r._preferences[t.symbols.prefs]:(c=t.preferences(c,r._preferences),e&&(r._preferences[t.symbols.prefs]=c),c)},s.default=function(r,c,e,o){const{schema:f,state:m,prefs:y}=o,R=f._flags[r];if(y.noDefaults||R===void 0)return c;if(m.mainstay.tracer.log(f,m,"rule",r,"full"),!R)return R;if(typeof R=="function"){const _=R.length?[g(m.ancestors[0]),o]:[];try{return R(..._)}catch(u){return void e.push(f.$_createError(`any.${r}`,null,{error:u},m,y))}}return typeof R!="object"?R:R[t.symbols.literal]?R.literal:t.isResolvable(R)?R.resolve(c,m,y):g(R)},s.trim=function(r,c){if(typeof r!="string")return r;const e=c.$_getRule("trim");return e&&e.args.enabled?r.trim():r},s.ignore={active:!1,debug:h,entry:h,filter:h,log:h,resolve:h,value:h},s.errorsArray=function(){const r=[];return r[t.symbols.errors]=!0,r}},2036:(S,w,p)=>{const i=p(375),g=p(9474),h=p(8160),l={};S.exports=l.Values=class{constructor(t,a){this._values=new Set(t),this._refs=new Set(a),this._lowercase=l.lowercases(t),this._override=!1}get length(){return this._values.size+this._refs.size}add(t,a){h.isResolvable(t)?this._refs.has(t)||(this._refs.add(t),a&&a.register(t)):this.has(t,null,null,!1)||(this._values.add(t),typeof t=="string"&&this._lowercase.set(t.toLowerCase(),t))}static merge(t,a,n){if(t=t||new l.Values,a){if(a._override)return a.clone();for(const s of[...a._values,...a._refs])t.add(s)}if(n)for(const s of[...n._values,...n._refs])t.remove(s);return t.length?t:null}remove(t){h.isResolvable(t)?this._refs.delete(t):(this._values.delete(t),typeof t=="string"&&this._lowercase.delete(t.toLowerCase()))}has(t,a,n,s){return!!this.get(t,a,n,s)}get(t,a,n,s){if(!this.length)return!1;if(this._values.has(t))return{value:t};if(typeof t=="string"&&t&&s){const r=this._lowercase.get(t.toLowerCase());if(r)return{value:r}}if(!this._refs.size&&typeof t!="object")return!1;if(typeof t=="object"){for(const r of this._values)if(g(r,t))return{value:r}}if(a)for(const r of this._refs){const c=r.resolve(t,a,n,null,{in:!0});if(c===void 0)continue;const e=r.in&&typeof c=="object"?Array.isArray(c)?c:Object.keys(c):[c];for(const o of e)if(typeof o==typeof t){if(s&&t&&typeof t=="string"){if(o.toLowerCase()===t.toLowerCase())return{value:o,ref:r}}else if(g(o,t))return{value:o,ref:r}}}return!1}override(){this._override=!0}values(t){if(t&&t.display){const a=[];for(const n of[...this._values,...this._refs])n!==void 0&&a.push(n);return a}return Array.from([...this._values,...this._refs])}clone(){const t=new l.Values(this._values,this._refs);return t._override=this._override,t}concat(t){i(!t._override,"Cannot concat override set of values");const a=new l.Values([...this._values,...t._values],[...this._refs,...t._refs]);return a._override=this._override,a}describe(){const t=[];this._override&&t.push({override:!0});for(const a of this._values.values())t.push(a&&typeof a=="object"?{value:a}:a);for(const a of this._refs.values())t.push(a.describe());return t}},l.Values.prototype[h.symbols.values]=!0,l.Values.prototype.slice=l.Values.prototype.clone,l.lowercases=function(t){const a=new Map;if(t)for(const n of t)typeof n=="string"&&a.set(n.toLowerCase(),n);return a}},978:(S,w,p)=>{const i=p(375),g=p(8571),h=p(1687),l=p(9621),t={};S.exports=function(a,n,s={}){if(i(a&&typeof a=="object","Invalid defaults value: must be an object"),i(!n||n===!0||typeof n=="object","Invalid source value: must be true, falsy or an object"),i(typeof s=="object","Invalid options: must be an object"),!n)return null;if(s.shallow)return t.applyToDefaultsWithShallow(a,n,s);const r=g(a);if(n===!0)return r;const c=s.nullOverride!==void 0&&s.nullOverride;return h(r,n,{nullOverride:c,mergeArrays:!1})},t.applyToDefaultsWithShallow=function(a,n,s){const r=s.shallow;i(Array.isArray(r),"Invalid keys");const c=new Map,e=n===!0?null:new Set;for(let m of r){m=Array.isArray(m)?m:m.split(".");const y=l(a,m);y&&typeof y=="object"?c.set(y,e&&l(n,m)||y):e&&e.add(m)}const o=g(a,{},c);if(!e)return o;for(const m of e)t.reachCopy(o,n,m);const f=s.nullOverride!==void 0&&s.nullOverride;return h(o,n,{nullOverride:f,mergeArrays:!1})},t.reachCopy=function(a,n,s){for(const e of s){if(!(e in n))return;const o=n[e];if(typeof o!="object"||o===null)return;n=o}const r=n;let c=a;for(let e=0;e<s.length-1;++e){const o=s[e];typeof c[o]!="object"&&(c[o]={}),c=c[o]}c[s[s.length-1]]=r}},375:(S,w,p)=>{const i=p(7916);S.exports=function(g,...h){if(!g)throw h.length===1&&h[0]instanceof Error?h[0]:new i(h)}},8571:(S,w,p)=>{const i=p(9621),g=p(4277),h=p(7043),l={needsProtoHack:new Set([g.set,g.map,g.weakSet,g.weakMap])};S.exports=l.clone=function(t,a={},n=null){if(typeof t!="object"||t===null)return t;let s=l.clone,r=n;if(a.shallow){if(a.shallow!==!0)return l.cloneWithShallow(t,a);s=f=>f}else if(r){const f=r.get(t);if(f)return f}else r=new Map;const c=g.getInternalProto(t);if(c===g.buffer)return!1;if(c===g.date)return new Date(t.getTime());if(c===g.regex)return new RegExp(t);const e=l.base(t,c,a);if(e===t)return t;if(r&&r.set(t,e),c===g.set)for(const f of t)e.add(s(f,a,r));else if(c===g.map)for(const[f,m]of t)e.set(f,s(m,a,r));const o=h.keys(t,a);for(const f of o){if(f==="__proto__")continue;if(c===g.array&&f==="length"){e.length=t.length;continue}const m=Object.getOwnPropertyDescriptor(t,f);m?m.get||m.set?Object.defineProperty(e,f,m):m.enumerable?e[f]=s(t[f],a,r):Object.defineProperty(e,f,{enumerable:!1,writable:!0,configurable:!0,value:s(t[f],a,r)}):Object.defineProperty(e,f,{enumerable:!0,writable:!0,configurable:!0,value:s(t[f],a,r)})}return e},l.cloneWithShallow=function(t,a){const n=a.shallow;(a=Object.assign({},a)).shallow=!1;const s=new Map;for(const r of n){const c=i(t,r);typeof c!="object"&&typeof c!="function"||s.set(c,c)}return l.clone(t,a,s)},l.base=function(t,a,n){if(n.prototype===!1)return l.needsProtoHack.has(a)?new a.constructor:a===g.array?[]:{};const s=Object.getPrototypeOf(t);if(s&&s.isImmutable)return t;if(a===g.array){const r=[];return s!==a&&Object.setPrototypeOf(r,s),r}if(l.needsProtoHack.has(a)){const r=new s.constructor;return s!==a&&Object.setPrototypeOf(r,s),r}return Object.create(s)}},9474:(S,w,p)=>{const i=p(4277),g={mismatched:null};S.exports=function(h,l,t){return t=Object.assign({prototype:!0},t),!!g.isDeepEqual(h,l,t,[])},g.isDeepEqual=function(h,l,t,a){if(h===l)return h!==0||1/h==1/l;const n=typeof h;if(n!==typeof l||h===null||l===null)return!1;if(n==="function"){if(!t.deepFunction||h.toString()!==l.toString())return!1}else if(n!=="object")return h!=h&&l!=l;const s=g.getSharedType(h,l,!!t.prototype);switch(s){case i.buffer:return!1;case i.promise:return h===l;case i.regex:return h.toString()===l.toString();case g.mismatched:return!1}for(let r=a.length-1;r>=0;--r)if(a[r].isSame(h,l))return!0;a.push(new g.SeenEntry(h,l));try{return!!g.isDeepEqualObj(s,h,l,t,a)}finally{a.pop()}},g.getSharedType=function(h,l,t){if(t)return Object.getPrototypeOf(h)!==Object.getPrototypeOf(l)?g.mismatched:i.getInternalProto(h);const a=i.getInternalProto(h);return a!==i.getInternalProto(l)?g.mismatched:a},g.valueOf=function(h){const l=h.valueOf;if(l===void 0)return h;try{return l.call(h)}catch(t){return t}},g.hasOwnEnumerableProperty=function(h,l){return Object.prototype.propertyIsEnumerable.call(h,l)},g.isSetSimpleEqual=function(h,l){for(const t of Set.prototype.values.call(h))if(!Set.prototype.has.call(l,t))return!1;return!0},g.isDeepEqualObj=function(h,l,t,a,n){const{isDeepEqual:s,valueOf:r,hasOwnEnumerableProperty:c}=g,{keys:e,getOwnPropertySymbols:o}=Object;if(h===i.array){if(!a.part){if(l.length!==t.length)return!1;for(let _=0;_<l.length;++_)if(!s(l[_],t[_],a,n))return!1;return!0}for(const _ of l)for(const u of t)if(s(_,u,a,n))return!0}else if(h===i.set){if(l.size!==t.size)return!1;if(!g.isSetSimpleEqual(l,t)){const _=new Set(Set.prototype.values.call(t));for(const u of Set.prototype.values.call(l)){if(_.delete(u))continue;let d=!1;for(const v of _)if(s(u,v,a,n)){_.delete(v),d=!0;break}if(!d)return!1}}}else if(h===i.map){if(l.size!==t.size)return!1;for(const[_,u]of Map.prototype.entries.call(l))if(u===void 0&&!Map.prototype.has.call(t,_)||!s(u,Map.prototype.get.call(t,_),a,n))return!1}else if(h===i.error&&(l.name!==t.name||l.message!==t.message))return!1;const f=r(l),m=r(t);if((l!==f||t!==m)&&!s(f,m,a,n))return!1;const y=e(l);if(!a.part&&y.length!==e(t).length&&!a.skip)return!1;let R=0;for(const _ of y)if(a.skip&&a.skip.includes(_))t[_]===void 0&&++R;else if(!c(t,_)||!s(l[_],t[_],a,n))return!1;if(!a.part&&y.length-R!==e(t).length)return!1;if(a.symbols!==!1){const _=o(l),u=new Set(o(t));for(const d of _){if(!a.skip||!a.skip.includes(d)){if(c(l,d)){if(!c(t,d)||!s(l[d],t[d],a,n))return!1}else if(c(t,d))return!1}u.delete(d)}for(const d of u)if(c(t,d))return!1}return!0},g.SeenEntry=class{constructor(h,l){this.obj=h,this.ref=l}isSame(h,l){return this.obj===h&&this.ref===l}}},7916:(S,w,p)=>{const i=p(8761);S.exports=class extends Error{constructor(g){super(g.filter(h=>h!=="").map(h=>typeof h=="string"?h:h instanceof Error?h.message:i(h)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,w.assert)}}},5277:S=>{const w={};S.exports=function(p){if(!p)return"";let i="";for(let g=0;g<p.length;++g){const h=p.charCodeAt(g);w.isSafe(h)?i+=p[g]:i+=w.escapeHtmlChar(h)}return i},w.escapeHtmlChar=function(p){return w.namedHtml.get(p)||(p>=256?"&#"+p+";":`&#x${p.toString(16).padStart(2,"0")};`)},w.isSafe=function(p){return w.safeCharCodes.has(p)},w.namedHtml=new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[34,"&quot;"],[160,"&nbsp;"],[162,"&cent;"],[163,"&pound;"],[164,"&curren;"],[169,"&copy;"],[174,"&reg;"]]),w.safeCharCodes=function(){const p=new Set;for(let i=32;i<123;++i)(i>=97||i>=65&&i<=90||i>=48&&i<=57||i===32||i===46||i===44||i===45||i===58||i===95)&&p.add(i);return p}()},6064:S=>{S.exports=function(w){return w.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:S=>{S.exports=function(){}},1687:(S,w,p)=>{const i=p(375),g=p(8571),h=p(7043),l={};S.exports=l.merge=function(t,a,n){if(i(t&&typeof t=="object","Invalid target value: must be an object"),i(a==null||typeof a=="object","Invalid source value: must be null, undefined, or an object"),!a)return t;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(a)){i(Array.isArray(t),"Cannot merge array onto an object"),n.mergeArrays||(t.length=0);for(let r=0;r<a.length;++r)t.push(g(a[r],{symbols:n.symbols}));return t}const s=h.keys(a,n);for(let r=0;r<s.length;++r){const c=s[r];if(c==="__proto__"||!Object.prototype.propertyIsEnumerable.call(a,c))continue;const e=a[c];if(e&&typeof e=="object"){if(t[c]===e)continue;!t[c]||typeof t[c]!="object"||Array.isArray(t[c])!==Array.isArray(e)||e instanceof Date||e instanceof RegExp?t[c]=g(e,{symbols:n.symbols}):l.merge(t[c],e,n)}else(e!=null||n.nullOverride)&&(t[c]=e)}return t}},9621:(S,w,p)=>{const i=p(375),g={};S.exports=function(h,l,t){if(l===!1||l==null)return h;typeof(t=t||{})=="string"&&(t={separator:t});const a=Array.isArray(l);i(!a||!t.separator,"Separator option is not valid for array-based chain");const n=a?l:l.split(t.separator||".");let s=h;for(let r=0;r<n.length;++r){let c=n[r];const e=t.iterables&&g.iterables(s);if(Array.isArray(s)||e==="set"){const o=Number(c);Number.isInteger(o)&&(c=o<0?s.length+o:o)}if(!s||typeof s=="function"&&t.functions===!1||!e&&s[c]===void 0){i(!t.strict||r+1===n.length,"Missing segment",c,"in reach path ",l),i(typeof s=="object"||t.functions===!0||typeof s!="function","Invalid segment",c,"in reach path ",l),s=t.default;break}s=e?e==="set"?[...s][c]:s.get(c):s[c]}return s},g.iterables=function(h){return h instanceof Set?"set":h instanceof Map?"map":void 0}},8761:S=>{S.exports=function(...w){try{return JSON.stringify(...w)}catch(p){return"[Cannot display object: "+p.message+"]"}}},4277:(S,w)=>{const p={};w=S.exports={array:Array.prototype,buffer:!1,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype},p.typeMap=new Map([["[object Error]",w.error],["[object Map]",w.map],["[object Promise]",w.promise],["[object Set]",w.set],["[object WeakMap]",w.weakMap],["[object WeakSet]",w.weakSet]]),w.getInternalProto=function(i){if(Array.isArray(i))return w.array;if(i instanceof Date)return w.date;if(i instanceof RegExp)return w.regex;if(i instanceof Error)return w.error;const g=Object.prototype.toString.call(i);return p.typeMap.get(g)||w.generic}},7043:(S,w)=>{w.keys=function(p,i={}){return i.symbols!==!1?Reflect.ownKeys(p):Object.getOwnPropertyNames(p)}},3652:(S,w,p)=>{const i=p(375),g={};w.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(h,l){const t=[].concat((l=l||{}).before||[]),a=[].concat(l.after||[]),n=l.group||"?",s=l.sort||0;i(!t.includes(n),`Item cannot come before itself: ${n}`),i(!t.includes("?"),"Item cannot come before unassociated items"),i(!a.includes(n),`Item cannot come after itself: ${n}`),i(!a.includes("?"),"Item cannot come after unassociated items"),Array.isArray(h)||(h=[h]);for(const r of h){const c={seq:this._items.length,sort:s,before:t,after:a,group:n,node:r};this._items.push(c)}if(!l.manual){const r=this._sort();i(r,"item",n!=="?"?`added into group ${n}`:"","created a dependencies error")}return this.nodes}merge(h){Array.isArray(h)||(h=[h]);for(const t of h)if(t)for(const a of t._items)this._items.push(Object.assign({},a));this._items.sort(g.mergeSort);for(let t=0;t<this._items.length;++t)this._items[t].seq=t;const l=this._sort();return i(l,"merge created a dependencies error"),this.nodes}sort(){const h=this._sort();return i(h,"sort created a dependencies error"),this.nodes}_sort(){const h={},l=Object.create(null),t=Object.create(null);for(const c of this._items){const e=c.seq,o=c.group;t[o]=t[o]||[],t[o].push(e),h[e]=c.before;for(const f of c.after)l[f]=l[f]||[],l[f].push(e)}for(const c in h){const e=[];for(const o in h[c]){const f=h[c][o];t[f]=t[f]||[],e.push(...t[f])}h[c]=e}for(const c in l)if(t[c])for(const e of t[c])h[e].push(...l[c]);const a={};for(const c in h){const e=h[c];for(const o of e)a[o]=a[o]||[],a[o].push(c)}const n={},s=[];for(let c=0;c<this._items.length;++c){let e=c;if(a[c]){e=null;for(let o=0;o<this._items.length;++o){if(n[o]===!0)continue;a[o]||(a[o]=[]);const f=a[o].length;let m=0;for(let y=0;y<f;++y)n[a[o][y]]&&++m;if(m===f){e=o;break}}}e!==null&&(n[e]=!0,s.push(e))}if(s.length!==this._items.length)return!1;const r={};for(const c of this._items)r[c.seq]=c;this._items=[],this.nodes=[];for(const c of s){const e=r[c];this.nodes.push(e.node),this._items.push(e)}return!0}},g.mergeSort=(h,l)=>h.sort===l.sort?0:h.sort<l.sort?-1:1},5380:(S,w,p)=>{const i=p(443),g=p(2178),h={minDomainSegments:2,nonAsciiRx:/[^\x00-\x7f]/,domainControlRx:/[\x00-\x20@\:\/\\#!\$&\'\(\)\*\+,;=\?]/,tldSegmentRx:/^[a-zA-Z](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,domainSegmentRx:/^[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/,URL:i.URL||URL};w.analyze=function(l,t={}){if(!l)return g.code("DOMAIN_NON_EMPTY_STRING");if(typeof l!="string")throw new Error("Invalid input: domain must be a string");if(l.length>256)return g.code("DOMAIN_TOO_LONG");if(h.nonAsciiRx.test(l)){if(t.allowUnicode===!1)return g.code("DOMAIN_INVALID_UNICODE_CHARS");l=l.normalize("NFC")}if(h.domainControlRx.test(l))return g.code("DOMAIN_INVALID_CHARS");l=h.punycode(l),t.allowFullyQualified&&l[l.length-1]==="."&&(l=l.slice(0,-1));const a=t.minDomainSegments||h.minDomainSegments,n=l.split(".");if(n.length<a)return g.code("DOMAIN_SEGMENTS_COUNT");if(t.maxDomainSegments&&n.length>t.maxDomainSegments)return g.code("DOMAIN_SEGMENTS_COUNT_MAX");const s=t.tlds;if(s){const r=n[n.length-1].toLowerCase();if(s.deny&&s.deny.has(r)||s.allow&&!s.allow.has(r))return g.code("DOMAIN_FORBIDDEN_TLDS")}for(let r=0;r<n.length;++r){const c=n[r];if(!c.length)return g.code("DOMAIN_EMPTY_SEGMENT");if(c.length>63)return g.code("DOMAIN_LONG_SEGMENT");if(r<n.length-1){if(!h.domainSegmentRx.test(c))return g.code("DOMAIN_INVALID_CHARS")}else if(!h.tldSegmentRx.test(c))return g.code("DOMAIN_INVALID_TLDS_CHARS")}return null},w.isValid=function(l,t){return!w.analyze(l,t)},h.punycode=function(l){l.includes("%")&&(l=l.replace(/%/g,"%25"));try{return new h.URL(`http://${l}`).host}catch{return l}}},1745:(S,w,p)=>{const i=p(9848),g=p(5380),h=p(2178),l={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(i.TextEncoder||TextEncoder)};w.analyze=function(t,a){return l.email(t,a)},w.isValid=function(t,a){return!l.email(t,a)},l.email=function(t,a={}){if(typeof t!="string")throw new Error("Invalid input: email must be a string");if(!t)return h.code("EMPTY_STRING");const n=!l.nonAsciiRx.test(t);if(!n){if(a.allowUnicode===!1)return h.code("FORBIDDEN_UNICODE");t=t.normalize("NFC")}const s=t.split("@");if(s.length!==2)return s.length>2?h.code("MULTIPLE_AT_CHAR"):h.code("MISSING_AT_CHAR");const[r,c]=s;if(!r)return h.code("EMPTY_LOCAL");if(!a.ignoreLength){if(t.length>254)return h.code("ADDRESS_TOO_LONG");if(l.encoder.encode(r).length>64)return h.code("LOCAL_TOO_LONG")}return l.local(r,n)||g.analyze(c,a)},l.local=function(t,a){const n=t.split(".");for(const s of n){if(!s.length)return h.code("EMPTY_LOCAL_SEGMENT");if(a){if(!l.atextRx.test(s))return h.code("INVALID_LOCAL_CHARS")}else for(const r of s){if(l.atextRx.test(r))continue;const c=l.binary(r);if(!l.atomRx.test(c))return h.code("INVALID_LOCAL_CHARS")}}},l.binary=function(t){return Array.from(l.encoder.encode(t)).map(a=>String.fromCharCode(a)).join("")},l.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,l.atomRx=new RegExp(["(?:[\\xc2-\\xdf][\\x80-\\xbf])","(?:\\xe0[\\xa0-\\xbf][\\x80-\\xbf])|(?:[\\xe1-\\xec][\\x80-\\xbf]{2})|(?:\\xed[\\x80-\\x9f][\\x80-\\xbf])|(?:[\\xee-\\xef][\\x80-\\xbf]{2})","(?:\\xf0[\\x90-\\xbf][\\x80-\\xbf]{2})|(?:[\\xf1-\\xf3][\\x80-\\xbf]{3})|(?:\\xf4[\\x80-\\x8f][\\x80-\\xbf]{2})"].join("|"))},2178:(S,w)=>{w.codes={EMPTY_STRING:"Address must be a non-empty string",FORBIDDEN_UNICODE:"Address contains forbidden Unicode characters",MULTIPLE_AT_CHAR:"Address cannot contain more than one @ character",MISSING_AT_CHAR:"Address must contain one @ character",EMPTY_LOCAL:"Address local part cannot be empty",ADDRESS_TOO_LONG:"Address too long",LOCAL_TOO_LONG:"Address local part too long",EMPTY_LOCAL_SEGMENT:"Address local part contains empty dot-separated segment",INVALID_LOCAL_CHARS:"Address local part contains invalid character",DOMAIN_NON_EMPTY_STRING:"Domain must be a non-empty string",DOMAIN_TOO_LONG:"Domain too long",DOMAIN_INVALID_UNICODE_CHARS:"Domain contains forbidden Unicode characters",DOMAIN_INVALID_CHARS:"Domain contains invalid character",DOMAIN_INVALID_TLDS_CHARS:"Domain contains invalid tld character",DOMAIN_SEGMENTS_COUNT:"Domain lacks the minimum required number of segments",DOMAIN_SEGMENTS_COUNT_MAX:"Domain contains too many segments",DOMAIN_FORBIDDEN_TLDS:"Domain uses forbidden TLD",DOMAIN_EMPTY_SEGMENT:"Domain contains empty dot-separated segment",DOMAIN_LONG_SEGMENT:"Domain contains dot-separated segment that is too long"},w.code=function(p){return{code:p,error:w.codes[p]}}},9959:(S,w,p)=>{const i=p(375),g=p(5752);w.regex=function(h={}){i(h.cidr===void 0||typeof h.cidr=="string","options.cidr must be a string");const l=h.cidr?h.cidr.toLowerCase():"optional";i(["required","optional","forbidden"].includes(l),"options.cidr must be one of required, optional, forbidden"),i(h.version===void 0||typeof h.version=="string"||Array.isArray(h.version),"options.version must be a string or an array of string");let t=h.version||["ipv4","ipv6","ipvfuture"];Array.isArray(t)||(t=[t]),i(t.length>=1,"options.version must have at least 1 version specified");for(let s=0;s<t.length;++s)i(typeof t[s]=="string","options.version must only contain strings"),t[s]=t[s].toLowerCase(),i(["ipv4","ipv6","ipvfuture"].includes(t[s]),"options.version contains unknown version "+t[s]+" - must be one of ipv4, ipv6, ipvfuture");t=Array.from(new Set(t));const a=`(?:${t.map(s=>{if(l==="forbidden")return g.ip[s];const r=`\\/${s==="ipv4"?g.ip.v4Cidr:g.ip.v6Cidr}`;return l==="required"?`${g.ip[s]}${r}`:`${g.ip[s]}(?:${r})?`}).join("|")})`,n=new RegExp(`^${a}$`);return{cidr:l,versions:t,regex:n,raw:a}}},5752:(S,w,p)=>{const i=p(375),g=p(6064),h={generate:function(){const l={},t="\\dA-Fa-f",a="["+t+"]",n="\\w-\\.~",s="!\\$&'\\(\\)\\*\\+,;=",r="%"+t,c=n+r+s+":@",e="["+c+"]",o="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";l.ipv4address="(?:"+o+"\\.){3}"+o;const f=a+"{1,4}",m="(?:"+f+":"+f+"|"+l.ipv4address+")",y="(?:"+f+":){6}"+m,R="::(?:"+f+":){5}"+m,_="(?:"+f+")?::(?:"+f+":){4}"+m,u="(?:(?:"+f+":){0,1}"+f+")?::(?:"+f+":){3}"+m,d="(?:(?:"+f+":){0,2}"+f+")?::(?:"+f+":){2}"+m,v="(?:(?:"+f+":){0,3}"+f+")?::"+f+":"+m,E="(?:(?:"+f+":){0,4}"+f+")?::"+m,k="(?:(?:"+f+":){0,5}"+f+")?::"+f,O="(?:(?:"+f+":){0,6}"+f+")?::";l.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",l.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",l.ipv6address="(?:"+y+"|"+R+"|"+_+"|"+u+"|"+d+"|"+v+"|"+E+"|"+k+"|"+O+")",l.ipvFuture="v"+a+"+\\.["+n+s+":]+",l.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",l.schemeRegex=new RegExp(l.scheme);const A="["+n+r+s+":]*",I="["+n+r+s+"]{1,255}",T="(?:\\[(?:"+l.ipv6address+"|"+l.ipvFuture+")\\]|"+l.ipv4address+"|"+I+")",F="(?:"+A+"@)?"+T+"(?::\\d*)?",K="(?:"+A+"@)?("+T+")(?::\\d*)?",V=e+"*",z=e+"+",P="(?:\\/"+V+")*",X="\\/(?:"+z+P+")?",Z=z+P,J="["+n+r+s+"@]+"+P,Q="(?:\\/\\/\\/"+V+P+")";return l.hierPart="(?:(?:\\/\\/"+F+P+")|"+X+"|"+Z+"|"+Q+")",l.hierPartCapture="(?:(?:\\/\\/"+K+P+")|"+X+"|"+Z+")",l.relativeRef="(?:(?:\\/\\/"+F+P+")|"+X+"|"+J+"|)",l.relativeRefCapture="(?:(?:\\/\\/"+K+P+")|"+X+"|"+J+"|)",l.query="["+c+"\\/\\?]*(?=#|$)",l.queryWithSquareBrackets="["+c+"\\[\\]\\/\\?]*(?=#|$)",l.fragment="["+c+"\\/\\?]*",l}};h.rfc3986=h.generate(),w.ip={v4Cidr:h.rfc3986.ipv4Cidr,v6Cidr:h.rfc3986.ipv6Cidr,ipv4:h.rfc3986.ipv4address,ipv6:h.rfc3986.ipv6address,ipvfuture:h.rfc3986.ipvFuture},h.createRegex=function(l){const t=h.rfc3986,a="(?:\\?"+(l.allowQuerySquareBrackets?t.queryWithSquareBrackets:t.query)+")?(?:#"+t.fragment+")?",n=l.domain?t.relativeRefCapture:t.relativeRef;if(l.relativeOnly)return h.wrap(n+a);let s="";if(l.scheme){i(l.scheme instanceof RegExp||typeof l.scheme=="string"||Array.isArray(l.scheme),"scheme must be a RegExp, String, or Array");const e=[].concat(l.scheme);i(e.length>=1,"scheme must have at least 1 scheme specified");const o=[];for(let f=0;f<e.length;++f){const m=e[f];i(m instanceof RegExp||typeof m=="string","scheme at position "+f+" must be a RegExp or String"),m instanceof RegExp?o.push(m.source.toString()):(i(t.schemeRegex.test(m),"scheme at position "+f+" must be a valid scheme"),o.push(g(m)))}s=o.join("|")}const r="(?:"+(s?"(?:"+s+")":t.scheme)+":"+(l.domain?t.hierPartCapture:t.hierPart)+")",c=l.allowRelative?"(?:"+r+"|"+n+")":r;return h.wrap(c+a,s)},h.wrap=function(l,t){return{raw:l=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${l}`,regex:new RegExp(`^${l}$`),scheme:t}},h.uriRegex=h.createRegex({}),w.regex=function(l={}){return l.scheme||l.allowRelative||l.relativeOnly||l.allowQuerySquareBrackets||l.domain?h.createRegex(l):h.uriRegex}},1447:(S,w)=>{const p={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};w.Parser=class{constructor(i,g={}){if(!g[p.settings]&&g.constants)for(const h in g.constants){const l=g.constants[h];if(l!==null&&!["boolean","number","string"].includes(typeof l))throw new Error(`Formula constant ${h} contains invalid ${typeof l} value type`)}this.settings=g[p.settings]?g:Object.assign({[p.settings]:!0,constants:{},functions:{}},g),this.single=null,this._parts=null,this._parse(i)}_parse(i){let g=[],h="",l=0,t=!1;const a=s=>{if(l)throw new Error("Formula missing closing parenthesis");const r=g.length?g[g.length-1]:null;if(t||h||s){if(r&&r.type==="reference"&&s===")")return r.type="function",r.value=this._subFormula(h,r.value),void(h="");if(s===")"){const c=new w.Parser(h,this.settings);g.push({type:"segment",value:c})}else if(t){if(t==="]")return g.push({type:"reference",value:h}),void(h="");g.push({type:"literal",value:h})}else if(p.operatorCharacters.includes(h))r&&r.type==="operator"&&p.operators.includes(r.value+h)?r.value+=h:g.push({type:"operator",value:h});else if(h.match(p.numberRx))g.push({type:"constant",value:parseFloat(h)});else if(this.settings.constants[h]!==void 0)g.push({type:"constant",value:this.settings.constants[h]});else{if(!h.match(p.tokenRx))throw new Error(`Formula contains invalid token: ${h}`);g.push({type:"reference",value:h})}h=""}};for(const s of i)t?s===t?(a(),t=!1):h+=s:l?s==="("?(h+=s,++l):s===")"?(--l,l?h+=s:a(s)):h+=s:s in p.literals?t=p.literals[s]:s==="("?(a(),++l):p.operatorCharacters.includes(s)?(a(),h=s,a()):s!==" "?h+=s:a();a(),g=g.map((s,r)=>s.type!=="operator"||s.value!=="-"||r&&g[r-1].type!=="operator"?s:{type:"operator",value:"n"});let n=!1;for(const s of g){if(s.type==="operator"){if(p.operatorsPrefix.includes(s.value))continue;if(!n)throw new Error("Formula contains an operator in invalid position");if(!p.operators.includes(s.value))throw new Error(`Formula contains an unknown operator ${s.value}`)}else if(n)throw new Error("Formula missing expected operator");n=!n}if(!n)throw new Error("Formula contains invalid trailing operator");g.length===1&&["reference","literal","constant"].includes(g[0].type)&&(this.single={type:g[0].type==="reference"?"reference":"value",value:g[0].value}),this._parts=g.map(s=>{if(s.type==="operator")return p.operatorsPrefix.includes(s.value)?s:s.value;if(s.type!=="reference")return s.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(s.value))throw new Error(`Formula contains invalid reference ${s.value}`);return this.settings.reference?this.settings.reference(s.value):p.reference(s.value)})}_subFormula(i,g){const h=this.settings.functions[g];if(typeof h!="function")throw new Error(`Formula contains unknown function ${g}`);let l=[];if(i){let t="",a=0,n=!1;const s=()=>{if(!t)throw new Error(`Formula contains function ${g} with invalid arguments ${i}`);l.push(t),t=""};for(let r=0;r<i.length;++r){const c=i[r];n?(t+=c,c===n&&(n=!1)):c in p.literals&&!a?(t+=c,n=p.literals[c]):c!==","||a?(t+=c,c==="("?++a:c===")"&&--a):s()}s()}return l=l.map(t=>new w.Parser(t,this.settings)),function(t){const a=[];for(const n of l)a.push(n.evaluate(t));return h.call(t,...a)}}evaluate(i){const g=this._parts.slice();for(let h=g.length-2;h>=0;--h){const l=g[h];if(l&&l.type==="operator"){const t=g[h+1];g.splice(h+1,1);const a=p.evaluate(t,i);g[h]=p.single(l.value,a)}}return p.operatorsOrder.forEach(h=>{for(let l=1;l<g.length-1;)if(h.includes(g[l])){const t=g[l],a=p.evaluate(g[l-1],i),n=p.evaluate(g[l+1],i);g.splice(l,2);const s=p.calculate(t,a,n);g[l-1]=s===0?0:s}else l+=2}),p.evaluate(g[0],i)}},w.Parser.prototype[p.symbol]=!0,p.reference=function(i){return function(g){return g&&g[i]!==void 0?g[i]:null}},p.evaluate=function(i,g){return i===null?null:typeof i=="function"?i(g):i[p.symbol]?i.evaluate(g):i},p.single=function(i,g){if(i==="!")return!g;const h=-g;return h===0?0:h},p.calculate=function(i,g,h){if(i==="??")return p.exists(g)?g:h;if(typeof g=="string"||typeof h=="string"){if(i==="+")return(g=p.exists(g)?g:"")+(p.exists(h)?h:"")}else switch(i){case"^":return Math.pow(g,h);case"*":return g*h;case"/":return g/h;case"%":return g%h;case"+":return g+h;case"-":return g-h}switch(i){case"<":return g<h;case"<=":return g<=h;case">":return g>h;case">=":return g>=h;case"==":return g===h;case"!=":return g!==h;case"&&":return g&&h;case"||":return g||h}return null},p.exists=function(i){return i!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:S=>{S.exports=JSON.parse('{"version":"17.12.2"}')}},U={},function S(w){var p=U[w];if(p!==void 0)return p.exports;var i=U[w]={exports:{}};return D[w](i,i.exports,S),i.exports}(5107);var D,U})}(Fe)),Fe.exports}var Be,Ze;function xt(){return Ze||(Ze=1,Be={charsWide:["ᄀ-ᇹ"," -〿","ぁ-ゔ","゙-ゞ","ァ-ヾ","ㄱ-ㆎ","㆐-㆟","㈀-㈜","㈠-㉃","㉠-㊰","㋀-㍶","㍻-㏝","㏠-㏾","一-龥","가-힣","-","豈-鶴"],charsFullWidth:["︰-﹄","﹉-﹒","﹔-﹫","!-~","¢-₩"]}),Be}var Ue,Ye;function kt(){if(Ye)return Ue;Ye=1;const{charsWide:G,charsFullWidth:N}=xt(),D=new RegExp(`[${G.join("")}${N.join("")}]`,"g");return Ue={default:S=>S.replace(D,"xx").length,charsRegex:D},Ue}/*!
2
2
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
3
3
  *
4
4
  * Copyright (c) 2014-2016, Jon Schlinkert.
@@ -8,11 +8,11 @@ import{dy as lt,ez as ut,eA as ft,eB as mt,eC as De,cJ as ht,eD as dt,dG as pt,e
8
8
  *
9
9
  * Copyright (c) 2014-2017, Jon Schlinkert.
10
10
  * Released under the MIT License.
11
- */var Ve,Qe;function Ot(){if(Qe)return Ve;Qe=1;var G=St(),N={"{":"}","(":")","[":"]"},D=function(S){if(S[0]==="!")return!0;for(var w=0,p=-2,i=-2,g=-2,h=-2,l=-2;w<S.length;){if(S[w]==="*"||S[w+1]==="?"&&/[\].+)]/.test(S[w])||i!==-1&&S[w]==="["&&S[w+1]!=="]"&&(i<w&&(i=S.indexOf("]",w)),i>w&&(l===-1||l>i||(l=S.indexOf("\\",w),l===-1||l>i)))||g!==-1&&S[w]==="{"&&S[w+1]!=="}"&&(g=S.indexOf("}",w),g>w&&(l=S.indexOf("\\",w),l===-1||l>g))||h!==-1&&S[w]==="("&&S[w+1]==="?"&&/[:!=]/.test(S[w+2])&&S[w+3]!==")"&&(h=S.indexOf(")",w),h>w&&(l=S.indexOf("\\",w),l===-1||l>h))||p!==-1&&S[w]==="("&&S[w+1]!=="|"&&(p<w&&(p=S.indexOf("|",w)),p!==-1&&S[p+1]!==")"&&(h=S.indexOf(")",p),h>p&&(l=S.indexOf("\\",p),l===-1||l>h))))return!0;if(S[w]==="\\"){var t=S[w+1];w+=2;var a=N[t];if(a){var n=S.indexOf(a,w);n!==-1&&(w=n+1)}if(S[w]==="!")return!0}else w++}return!1},U=function(S){if(S[0]==="!")return!0;for(var w=0;w<S.length;){if(/[*?{}()[\]]/.test(S[w]))return!0;if(S[w]==="\\"){var p=S[w+1];w+=2;var i=N[p];if(i){var g=S.indexOf(i,w);g!==-1&&(w=g+1)}if(S[w]==="!")return!0}else w++}return!1};return Ve=function(w,p){if(typeof w!="string"||w==="")return!1;if(G(w))return!0;var i=D;return p&&p.strict===!1&&(i=U),i(w)},Ve}var Ce={exports:{}},et;function At(){return et||(et=1,function(G,N){var D={};N=G.exports=u;var U;typeof ut=="object"&&D&&D.NODE_DEBUG&&/\bsemver\b/i.test(D.NODE_DEBUG)?U=function(){var b=Array.prototype.slice.call(arguments,0);b.unshift("SEMVER"),console.log.apply(console,b)}:U=function(){},N.SEMVER_SPEC_VERSION="2.0.0";var S=256,w=Number.MAX_SAFE_INTEGER||9007199254740991,p=16,i=S-6,g=N.re=[],h=N.safeRe=[],l=N.src=[],t=N.tokens={},a=0;function n(b){t[b]=a++}var s="[a-zA-Z0-9-]",r=[["\\s",1],["\\d",S],[s,i]];function c(b){for(var $=0;$<r.length;$++){var x=r[$][0],j=r[$][1];b=b.split(x+"*").join(x+"{0,"+j+"}").split(x+"+").join(x+"{1,"+j+"}")}return b}n("NUMERICIDENTIFIER"),l[t.NUMERICIDENTIFIER]="0|[1-9]\\d*",n("NUMERICIDENTIFIERLOOSE"),l[t.NUMERICIDENTIFIERLOOSE]="\\d+",n("NONNUMERICIDENTIFIER"),l[t.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+s+"*",n("MAINVERSION"),l[t.MAINVERSION]="("+l[t.NUMERICIDENTIFIER]+")\\.("+l[t.NUMERICIDENTIFIER]+")\\.("+l[t.NUMERICIDENTIFIER]+")",n("MAINVERSIONLOOSE"),l[t.MAINVERSIONLOOSE]="("+l[t.NUMERICIDENTIFIERLOOSE]+")\\.("+l[t.NUMERICIDENTIFIERLOOSE]+")\\.("+l[t.NUMERICIDENTIFIERLOOSE]+")",n("PRERELEASEIDENTIFIER"),l[t.PRERELEASEIDENTIFIER]="(?:"+l[t.NUMERICIDENTIFIER]+"|"+l[t.NONNUMERICIDENTIFIER]+")",n("PRERELEASEIDENTIFIERLOOSE"),l[t.PRERELEASEIDENTIFIERLOOSE]="(?:"+l[t.NUMERICIDENTIFIERLOOSE]+"|"+l[t.NONNUMERICIDENTIFIER]+")",n("PRERELEASE"),l[t.PRERELEASE]="(?:-("+l[t.PRERELEASEIDENTIFIER]+"(?:\\."+l[t.PRERELEASEIDENTIFIER]+")*))",n("PRERELEASELOOSE"),l[t.PRERELEASELOOSE]="(?:-?("+l[t.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+l[t.PRERELEASEIDENTIFIERLOOSE]+")*))",n("BUILDIDENTIFIER"),l[t.BUILDIDENTIFIER]=s+"+",n("BUILD"),l[t.BUILD]="(?:\\+("+l[t.BUILDIDENTIFIER]+"(?:\\."+l[t.BUILDIDENTIFIER]+")*))",n("FULL"),n("FULLPLAIN"),l[t.FULLPLAIN]="v?"+l[t.MAINVERSION]+l[t.PRERELEASE]+"?"+l[t.BUILD]+"?",l[t.FULL]="^"+l[t.FULLPLAIN]+"$",n("LOOSEPLAIN"),l[t.LOOSEPLAIN]="[v=\\s]*"+l[t.MAINVERSIONLOOSE]+l[t.PRERELEASELOOSE]+"?"+l[t.BUILD]+"?",n("LOOSE"),l[t.LOOSE]="^"+l[t.LOOSEPLAIN]+"$",n("GTLT"),l[t.GTLT]="((?:<|>)?=?)",n("XRANGEIDENTIFIERLOOSE"),l[t.XRANGEIDENTIFIERLOOSE]=l[t.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",n("XRANGEIDENTIFIER"),l[t.XRANGEIDENTIFIER]=l[t.NUMERICIDENTIFIER]+"|x|X|\\*",n("XRANGEPLAIN"),l[t.XRANGEPLAIN]="[v=\\s]*("+l[t.XRANGEIDENTIFIER]+")(?:\\.("+l[t.XRANGEIDENTIFIER]+")(?:\\.("+l[t.XRANGEIDENTIFIER]+")(?:"+l[t.PRERELEASE]+")?"+l[t.BUILD]+"?)?)?",n("XRANGEPLAINLOOSE"),l[t.XRANGEPLAINLOOSE]="[v=\\s]*("+l[t.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[t.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[t.XRANGEIDENTIFIERLOOSE]+")(?:"+l[t.PRERELEASELOOSE]+")?"+l[t.BUILD]+"?)?)?",n("XRANGE"),l[t.XRANGE]="^"+l[t.GTLT]+"\\s*"+l[t.XRANGEPLAIN]+"$",n("XRANGELOOSE"),l[t.XRANGELOOSE]="^"+l[t.GTLT]+"\\s*"+l[t.XRANGEPLAINLOOSE]+"$",n("COERCE"),l[t.COERCE]="(^|[^\\d])(\\d{1,"+p+"})(?:\\.(\\d{1,"+p+"}))?(?:\\.(\\d{1,"+p+"}))?(?:$|[^\\d])",n("COERCERTL"),g[t.COERCERTL]=new RegExp(l[t.COERCE],"g"),h[t.COERCERTL]=new RegExp(c(l[t.COERCE]),"g"),n("LONETILDE"),l[t.LONETILDE]="(?:~>?)",n("TILDETRIM"),l[t.TILDETRIM]="(\\s*)"+l[t.LONETILDE]+"\\s+",g[t.TILDETRIM]=new RegExp(l[t.TILDETRIM],"g"),h[t.TILDETRIM]=new RegExp(c(l[t.TILDETRIM]),"g");var e="$1~";n("TILDE"),l[t.TILDE]="^"+l[t.LONETILDE]+l[t.XRANGEPLAIN]+"$",n("TILDELOOSE"),l[t.TILDELOOSE]="^"+l[t.LONETILDE]+l[t.XRANGEPLAINLOOSE]+"$",n("LONECARET"),l[t.LONECARET]="(?:\\^)",n("CARETTRIM"),l[t.CARETTRIM]="(\\s*)"+l[t.LONECARET]+"\\s+",g[t.CARETTRIM]=new RegExp(l[t.CARETTRIM],"g"),h[t.CARETTRIM]=new RegExp(c(l[t.CARETTRIM]),"g");var o="$1^";n("CARET"),l[t.CARET]="^"+l[t.LONECARET]+l[t.XRANGEPLAIN]+"$",n("CARETLOOSE"),l[t.CARETLOOSE]="^"+l[t.LONECARET]+l[t.XRANGEPLAINLOOSE]+"$",n("COMPARATORLOOSE"),l[t.COMPARATORLOOSE]="^"+l[t.GTLT]+"\\s*("+l[t.LOOSEPLAIN]+")$|^$",n("COMPARATOR"),l[t.COMPARATOR]="^"+l[t.GTLT]+"\\s*("+l[t.FULLPLAIN]+")$|^$",n("COMPARATORTRIM"),l[t.COMPARATORTRIM]="(\\s*)"+l[t.GTLT]+"\\s*("+l[t.LOOSEPLAIN]+"|"+l[t.XRANGEPLAIN]+")",g[t.COMPARATORTRIM]=new RegExp(l[t.COMPARATORTRIM],"g"),h[t.COMPARATORTRIM]=new RegExp(c(l[t.COMPARATORTRIM]),"g");var f="$1$2$3";n("HYPHENRANGE"),l[t.HYPHENRANGE]="^\\s*("+l[t.XRANGEPLAIN]+")\\s+-\\s+("+l[t.XRANGEPLAIN]+")\\s*$",n("HYPHENRANGELOOSE"),l[t.HYPHENRANGELOOSE]="^\\s*("+l[t.XRANGEPLAINLOOSE]+")\\s+-\\s+("+l[t.XRANGEPLAINLOOSE]+")\\s*$",n("STAR"),l[t.STAR]="(<|>)?=?\\s*\\*";for(var m=0;m<a;m++)U(m,l[m]),g[m]||(g[m]=new RegExp(l[m]),h[m]=new RegExp(c(l[m])));N.parse=y;function y(b,$){if((!$||typeof $!="object")&&($={loose:!!$,includePrerelease:!1}),b instanceof u)return b;if(typeof b!="string"||b.length>S)return null;var x=$.loose?h[t.LOOSE]:h[t.FULL];if(!x.test(b))return null;try{return new u(b,$)}catch{return null}}N.valid=R;function R(b,$){var x=y(b,$);return x?x.version:null}N.clean=_;function _(b,$){var x=y(b.trim().replace(/^[=v]+/,""),$);return x?x.version:null}N.SemVer=u;function u(b,$){if((!$||typeof $!="object")&&($={loose:!!$,includePrerelease:!1}),b instanceof u){if(b.loose===$.loose)return b;b=b.version}else if(typeof b!="string")throw new TypeError("Invalid Version: "+b);if(b.length>S)throw new TypeError("version is longer than "+S+" characters");if(!(this instanceof u))return new u(b,$);U("SemVer",b,$),this.options=$,this.loose=!!$.loose;var x=b.trim().match($.loose?h[t.LOOSE]:h[t.FULL]);if(!x)throw new TypeError("Invalid Version: "+b);if(this.raw=b,this.major=+x[1],this.minor=+x[2],this.patch=+x[3],this.major>w||this.major<0)throw new TypeError("Invalid major version");if(this.minor>w||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>w||this.patch<0)throw new TypeError("Invalid patch version");x[4]?this.prerelease=x[4].split(".").map(function(j){if(/^[0-9]+$/.test(j)){var L=+j;if(L>=0&&L<w)return L}return j}):this.prerelease=[],this.build=x[5]?x[5].split("."):[],this.format()}u.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},u.prototype.toString=function(){return this.version},u.prototype.compare=function(b){return U("SemVer.compare",this.version,this.options,b),b instanceof u||(b=new u(b,this.options)),this.compareMain(b)||this.comparePre(b)},u.prototype.compareMain=function(b){return b instanceof u||(b=new u(b,this.options)),k(this.major,b.major)||k(this.minor,b.minor)||k(this.patch,b.patch)},u.prototype.comparePre=function(b){if(b instanceof u||(b=new u(b,this.options)),this.prerelease.length&&!b.prerelease.length)return-1;if(!this.prerelease.length&&b.prerelease.length)return 1;if(!this.prerelease.length&&!b.prerelease.length)return 0;var $=0;do{var x=this.prerelease[$],j=b.prerelease[$];if(U("prerelease compare",$,x,j),x===void 0&&j===void 0)return 0;if(j===void 0)return 1;if(x===void 0)return-1;if(x===j)continue;return k(x,j)}while(++$)},u.prototype.compareBuild=function(b){b instanceof u||(b=new u(b,this.options));var $=0;do{var x=this.build[$],j=b.build[$];if(U("prerelease compare",$,x,j),x===void 0&&j===void 0)return 0;if(j===void 0)return 1;if(x===void 0)return-1;if(x===j)continue;return k(x,j)}while(++$)},u.prototype.inc=function(b,$){switch(b){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",$);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",$);break;case"prepatch":this.prerelease.length=0,this.inc("patch",$),this.inc("pre",$);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",$),this.inc("pre",$);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var x=this.prerelease.length;--x>=0;)typeof this.prerelease[x]=="number"&&(this.prerelease[x]++,x=-2);x===-1&&this.prerelease.push(0)}$&&(this.prerelease[0]===$?isNaN(this.prerelease[1])&&(this.prerelease=[$,0]):this.prerelease=[$,0]);break;default:throw new Error("invalid increment argument: "+b)}return this.format(),this.raw=this.version,this},N.inc=d;function d(b,$,x,j){typeof x=="string"&&(j=x,x=void 0);try{return new u(b,x).inc($,j).version}catch{return null}}N.diff=v;function v(b,$){if(Q(b,$))return null;var x=y(b),j=y($),L="";if(x.prerelease.length||j.prerelease.length){L="pre";var M="prerelease"}for(var B in x)if((B==="major"||B==="minor"||B==="patch")&&x[B]!==j[B])return L+B;return M}N.compareIdentifiers=k;var E=/^[0-9]+$/;function k(b,$){var x=E.test(b),j=E.test($);return x&&j&&(b=+b,$=+$),b===$?0:x&&!j?-1:j&&!x?1:b<$?-1:1}N.rcompareIdentifiers=O;function O(b,$){return k($,b)}N.major=A;function A(b,$){return new u(b,$).major}N.minor=I;function I(b,$){return new u(b,$).minor}N.patch=T;function T(b,$){return new u(b,$).patch}N.compare=F;function F(b,$,x){return new u(b,x).compare(new u($,x))}N.compareLoose=K;function K(b,$){return F(b,$,!0)}N.compareBuild=V;function V(b,$,x){var j=new u(b,x),L=new u($,x);return j.compare(L)||j.compareBuild(L)}N.rcompare=z;function z(b,$,x){return F($,b,x)}N.sort=P;function P(b,$){return b.sort(function(x,j){return N.compareBuild(x,j,$)})}N.rsort=X;function X(b,$){return b.sort(function(x,j){return N.compareBuild(j,x,$)})}N.gt=Z;function Z(b,$,x){return F(b,$,x)>0}N.lt=J;function J(b,$,x){return F(b,$,x)<0}N.eq=Q;function Q(b,$,x){return F(b,$,x)===0}N.neq=ne;function ne(b,$,x){return F(b,$,x)!==0}N.gte=ie;function ie(b,$,x){return F(b,$,x)>=0}N.lte=be;function be(b,$,x){return F(b,$,x)<=0}N.cmp=ye;function ye(b,$,x,j){switch($){case"===":return typeof b=="object"&&(b=b.version),typeof x=="object"&&(x=x.version),b===x;case"!==":return typeof b=="object"&&(b=b.version),typeof x=="object"&&(x=x.version),b!==x;case"":case"=":case"==":return Q(b,x,j);case"!=":return ne(b,x,j);case">":return Z(b,x,j);case">=":return ie(b,x,j);case"<":return J(b,x,j);case"<=":return be(b,x,j);default:throw new TypeError("Invalid operator: "+$)}}N.Comparator=ae;function ae(b,$){if((!$||typeof $!="object")&&($={loose:!!$,includePrerelease:!1}),b instanceof ae){if(b.loose===!!$.loose)return b;b=b.value}if(!(this instanceof ae))return new ae(b,$);b=b.trim().split(/\s+/).join(" "),U("comparator",b,$),this.options=$,this.loose=!!$.loose,this.parse(b),this.semver===ge?this.value="":this.value=this.operator+this.semver.version,U("comp",this)}var ge={};ae.prototype.parse=function(b){var $=this.options.loose?h[t.COMPARATORLOOSE]:h[t.COMPARATOR],x=b.match($);if(!x)throw new TypeError("Invalid comparator: "+b);this.operator=x[1]!==void 0?x[1]:"",this.operator==="="&&(this.operator=""),x[2]?this.semver=new u(x[2],this.options.loose):this.semver=ge},ae.prototype.toString=function(){return this.value},ae.prototype.test=function(b){if(U("Comparator.test",b,this.options.loose),this.semver===ge||b===ge)return!0;if(typeof b=="string")try{b=new u(b,this.options)}catch{return!1}return ye(b,this.operator,this.semver,this.options)},ae.prototype.intersects=function(b,$){if(!(b instanceof ae))throw new TypeError("a Comparator is required");(!$||typeof $!="object")&&($={loose:!!$,includePrerelease:!1});var x;if(this.operator==="")return this.value===""?!0:(x=new ee(b.value,$),W(this.value,x,$));if(b.operator==="")return b.value===""?!0:(x=new ee(this.value,$),W(b.semver,x,$));var j=(this.operator===">="||this.operator===">")&&(b.operator===">="||b.operator===">"),L=(this.operator==="<="||this.operator==="<")&&(b.operator==="<="||b.operator==="<"),M=this.semver.version===b.semver.version,B=(this.operator===">="||this.operator==="<=")&&(b.operator===">="||b.operator==="<="),Y=ye(this.semver,"<",b.semver,$)&&(this.operator===">="||this.operator===">")&&(b.operator==="<="||b.operator==="<"),H=ye(this.semver,">",b.semver,$)&&(this.operator==="<="||this.operator==="<")&&(b.operator===">="||b.operator===">");return j||L||M&&B||Y||H},N.Range=ee;function ee(b,$){if((!$||typeof $!="object")&&($={loose:!!$,includePrerelease:!1}),b instanceof ee)return b.loose===!!$.loose&&b.includePrerelease===!!$.includePrerelease?b:new ee(b.raw,$);if(b instanceof ae)return new ee(b.value,$);if(!(this instanceof ee))return new ee(b,$);if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=b.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(x){return this.parseRange(x.trim())},this).filter(function(x){return x.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}ee.prototype.format=function(){return this.range=this.set.map(function(b){return b.join(" ").trim()}).join("||").trim(),this.range},ee.prototype.toString=function(){return this.range},ee.prototype.parseRange=function(b){var $=this.options.loose,x=$?h[t.HYPHENRANGELOOSE]:h[t.HYPHENRANGE];b=b.replace(x,Le),U("hyphen replace",b),b=b.replace(h[t.COMPARATORTRIM],f),U("comparator trim",b,h[t.COMPARATORTRIM]),b=b.replace(h[t.TILDETRIM],e),b=b.replace(h[t.CARETTRIM],o),b=b.split(/\s+/).join(" ");var j=$?h[t.COMPARATORLOOSE]:h[t.COMPARATOR],L=b.split(" ").map(function(M){return Ie(M,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(L=L.filter(function(M){return!!M.match(j)})),L=L.map(function(M){return new ae(M,this.options)},this),L},ee.prototype.intersects=function(b,$){if(!(b instanceof ee))throw new TypeError("a Range is required");return this.set.some(function(x){return _e(x,$)&&b.set.some(function(j){return _e(j,$)&&x.every(function(L){return j.every(function(M){return L.intersects(M,$)})})})})};function _e(b,$){for(var x=!0,j=b.slice(),L=j.pop();x&&j.length;)x=j.every(function(M){return L.intersects(M,$)}),L=j.pop();return x}N.toComparators=Ae;function Ae(b,$){return new ee(b,$).set.map(function(x){return x.map(function(j){return j.value}).join(" ").trim().split(" ")})}function Ie(b,$){return U("comp",b,$),b=Pe(b,$),U("caret",b),b=Ee(b,$),U("tildes",b),b=$e(b,$),U("xrange",b),b=qe(b,$),U("stars",b),b}function re(b){return!b||b.toLowerCase()==="x"||b==="*"}function Ee(b,$){return b.trim().split(/\s+/).map(function(x){return je(x,$)}).join(" ")}function je(b,$){var x=$.loose?h[t.TILDELOOSE]:h[t.TILDE];return b.replace(x,function(j,L,M,B,Y){U("tilde",b,j,L,M,B,Y);var H;return re(L)?H="":re(M)?H=">="+L+".0.0 <"+(+L+1)+".0.0":re(B)?H=">="+L+"."+M+".0 <"+L+"."+(+M+1)+".0":Y?(U("replaceTilde pr",Y),H=">="+L+"."+M+"."+B+"-"+Y+" <"+L+"."+(+M+1)+".0"):H=">="+L+"."+M+"."+B+" <"+L+"."+(+M+1)+".0",U("tilde return",H),H})}function Pe(b,$){return b.trim().split(/\s+/).map(function(x){return Re(x,$)}).join(" ")}function Re(b,$){U("caret",b,$);var x=$.loose?h[t.CARETLOOSE]:h[t.CARET];return b.replace(x,function(j,L,M,B,Y){U("caret",b,j,L,M,B,Y);var H;return re(L)?H="":re(M)?H=">="+L+".0.0 <"+(+L+1)+".0.0":re(B)?L==="0"?H=">="+L+"."+M+".0 <"+L+"."+(+M+1)+".0":H=">="+L+"."+M+".0 <"+(+L+1)+".0.0":Y?(U("replaceCaret pr",Y),L==="0"?M==="0"?H=">="+L+"."+M+"."+B+"-"+Y+" <"+L+"."+M+"."+(+B+1):H=">="+L+"."+M+"."+B+"-"+Y+" <"+L+"."+(+M+1)+".0":H=">="+L+"."+M+"."+B+"-"+Y+" <"+(+L+1)+".0.0"):(U("no pr"),L==="0"?M==="0"?H=">="+L+"."+M+"."+B+" <"+L+"."+M+"."+(+B+1):H=">="+L+"."+M+"."+B+" <"+L+"."+(+M+1)+".0":H=">="+L+"."+M+"."+B+" <"+(+L+1)+".0.0"),U("caret return",H),H})}function $e(b,$){return U("replaceXRanges",b,$),b.split(/\s+/).map(function(x){return Te(x,$)}).join(" ")}function Te(b,$){b=b.trim();var x=$.loose?h[t.XRANGELOOSE]:h[t.XRANGE];return b.replace(x,function(j,L,M,B,Y,H){U("xRange",b,j,L,M,B,Y,H);var he=re(M),de=he||re(B),ue=de||re(Y),le=ue;return L==="="&&le&&(L=""),H=$.includePrerelease?"-0":"",he?L===">"||L==="<"?j="<0.0.0-0":j="*":L&&le?(de&&(B=0),Y=0,L===">"?(L=">=",de?(M=+M+1,B=0,Y=0):(B=+B+1,Y=0)):L==="<="&&(L="<",de?M=+M+1:B=+B+1),j=L+M+"."+B+"."+Y+H):de?j=">="+M+".0.0"+H+" <"+(+M+1)+".0.0"+H:ue&&(j=">="+M+"."+B+".0"+H+" <"+M+"."+(+B+1)+".0"+H),U("xRange return",j),j})}function qe(b,$){return U("replaceStars",b,$),b.trim().replace(h[t.STAR],"")}function Le(b,$,x,j,L,M,B,Y,H,he,de,ue,le){return re(x)?$="":re(j)?$=">="+x+".0.0":re(L)?$=">="+x+"."+j+".0":$=">="+$,re(H)?Y="":re(he)?Y="<"+(+H+1)+".0.0":re(de)?Y="<"+H+"."+(+he+1)+".0":ue?Y="<="+H+"."+he+"."+de+"-"+ue:Y="<="+Y,($+" "+Y).trim()}ee.prototype.test=function(b){if(!b)return!1;if(typeof b=="string")try{b=new u(b,this.options)}catch{return!1}for(var $=0;$<this.set.length;$++)if(C(this.set[$],b,this.options))return!0;return!1};function C(b,$,x){for(var j=0;j<b.length;j++)if(!b[j].test($))return!1;if($.prerelease.length&&!x.includePrerelease){for(j=0;j<b.length;j++)if(U(b[j].semver),b[j].semver!==ge&&b[j].semver.prerelease.length>0){var L=b[j].semver;if(L.major===$.major&&L.minor===$.minor&&L.patch===$.patch)return!0}return!1}return!0}N.satisfies=W;function W(b,$,x){try{$=new ee($,x)}catch{return!1}return $.test(b)}N.maxSatisfying=se;function se(b,$,x){var j=null,L=null;try{var M=new ee($,x)}catch{return null}return b.forEach(function(B){M.test(B)&&(!j||L.compare(B)===-1)&&(j=B,L=new u(j,x))}),j}N.minSatisfying=oe;function oe(b,$,x){var j=null,L=null;try{var M=new ee($,x)}catch{return null}return b.forEach(function(B){M.test(B)&&(!j||L.compare(B)===1)&&(j=B,L=new u(j,x))}),j}N.minVersion=fe;function fe(b,$){b=new ee(b,$);var x=new u("0.0.0");if(b.test(x)||(x=new u("0.0.0-0"),b.test(x)))return x;x=null;for(var j=0;j<b.set.length;++j){var L=b.set[j];L.forEach(function(M){var B=new u(M.semver.version);switch(M.operator){case">":B.prerelease.length===0?B.patch++:B.prerelease.push(0),B.raw=B.format();case"":case">=":(!x||Z(x,B))&&(x=B);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+M.operator)}})}return x&&b.test(x)?x:null}N.validRange=xe;function xe(b,$){try{return new ee(b,$).range||"*"}catch{return null}}N.ltr=Me;function Me(b,$,x){return ce(b,$,"<",x)}N.gtr=me;function me(b,$,x){return ce(b,$,">",x)}N.outside=ce;function ce(b,$,x,j){b=new u(b,j),$=new ee($,j);var L,M,B,Y,H;switch(x){case">":L=Z,M=be,B=J,Y=">",H=">=";break;case"<":L=J,M=ie,B=Z,Y="<",H="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(W(b,$,j))return!1;for(var he=0;he<$.set.length;++he){var de=$.set[he],ue=null,le=null;if(de.forEach(function(ve){ve.semver===ge&&(ve=new ae(">=0.0.0")),ue=ue||ve,le=le||ve,L(ve.semver,ue.semver,j)?ue=ve:B(ve.semver,le.semver,j)&&(le=ve)}),ue.operator===Y||ue.operator===H||(!le.operator||le.operator===Y)&&M(b,le.semver))return!1;if(le.operator===H&&B(b,le.semver))return!1}return!0}N.prerelease=ke;function ke(b,$){var x=y(b,$);return x&&x.prerelease.length?x.prerelease:null}N.intersects=we;function we(b,$,x){return b=new ee(b,x),$=new ee($,x),b.intersects($)}N.coerce=Ne;function Ne(b,$){if(b instanceof u)return b;if(typeof b=="number"&&(b=String(b)),typeof b!="string")return null;$=$||{};var x=null;if(!$.rtl)x=b.match(h[t.COERCE]);else{for(var j;(j=h[t.COERCERTL].exec(b))&&(!x||x.index+x[0].length!==b.length);)(!x||j.index+j[0].length!==x.index+x[0].length)&&(x=j),h[t.COERCERTL].lastIndex=j.index+j[1].length+j[2].length;h[t.COERCERTL].lastIndex=-1}return x===null?null:y(x[2]+"."+(x[3]||"0")+"."+(x[4]||"0"),$)}}(Ce,Ce.exports)),Ce.exports}var Ge,tt;function It(){if(tt)return Ge;tt=1;const G=Ke(),N=At(),D="semver",U={base:G.string(),type:"semverRange",validate:function(p,{error:i}){return N.validRange(p)?{value:p}:{errors:i(`${D}.valid`)}},messages:{[`${D}.valid`]:"{{#label}} needs to be a valid semver range"}},S={};return S.compare={method:!1,validate:function(p,i,{exp:g},{name:h}){return N[h](p,g)?p:i.error(`${D}.${h}`,{exp:g})},args:[{name:"exp",assert:N.valid,message:"needs to be a valid semver expression"}]},["gt","gte","lt","lte","eq","neq"].forEach(function(p){S[p]={method:function(i){return this.$_addRule({name:p,method:"compare",args:{exp:i}})}}}),S.cmp={method:function(p,i){return this.$_addRule({name:"cmp",args:{cmp:p,exp:i}})},validate:function(p,i,{cmp:g,exp:h}){return N.cmp(p,g,h)?p:i.error(`${D}.cmp`,{cmp:g,exp:h})},args:[{name:"cmp",assert:p=>["===","!==","","=","==","!=",">",">=","<","<="].includes(p),message:"needs to be a valid comparator"},{name:"exp",assert:N.valid,message:"needs to be a valid semver expression"}]},S.compareRange={method:!1,validate:function(p,i,{rng:g},{name:h}){return N[h](p,g)?p:i.error(`${D}.${h}`,{rng:g})},args:[{name:"rng",assert:N.validRange,message:"needs to be a valid semver range"}]},["satisfies","gtr","ltr"].forEach(function(p){S[p]={method:function(i){return this.$_addRule({name:p,method:"compareRange",args:{rng:i}})}}}),S.outside={method:function(p,i){return this.$_addRule({name:"outside",args:{hilo:p,rng:i}})},validate:function(p,i,{hilo:g,rng:h}){return N.outside(p,h,g)?p:i.error(`${D}.outside`,{hilo:g,rng:h})},args:[{name:"hilo",assert:p=>[">","<"].includes(p),message:"needs to be a valid comparator"},{name:"rng",assert:N.validRange,message:"needs to be a valid semver range"}]},Ge={semver:{base:G.string(),type:"semver",validate:function(p,{error:i}){return N.valid(p)?{value:p}:{errors:i(`${D}.valid`)}},messages:{[`${D}.valid`]:"{{#label}} needs to be a valid semver expression",[`${D}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${D}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${D}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${D}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${D}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${D}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${D}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${D}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${D}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${D}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${D}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:S},semverRange:U},Ge}/*!
11
+ */var Ve,Qe;function Ot(){if(Qe)return Ve;Qe=1;var G=St(),N={"{":"}","(":")","[":"]"},D=function(S){if(S[0]==="!")return!0;for(var w=0,p=-2,i=-2,g=-2,h=-2,l=-2;w<S.length;){if(S[w]==="*"||S[w+1]==="?"&&/[\].+)]/.test(S[w])||i!==-1&&S[w]==="["&&S[w+1]!=="]"&&(i<w&&(i=S.indexOf("]",w)),i>w&&(l===-1||l>i||(l=S.indexOf("\\",w),l===-1||l>i)))||g!==-1&&S[w]==="{"&&S[w+1]!=="}"&&(g=S.indexOf("}",w),g>w&&(l=S.indexOf("\\",w),l===-1||l>g))||h!==-1&&S[w]==="("&&S[w+1]==="?"&&/[:!=]/.test(S[w+2])&&S[w+3]!==")"&&(h=S.indexOf(")",w),h>w&&(l=S.indexOf("\\",w),l===-1||l>h))||p!==-1&&S[w]==="("&&S[w+1]!=="|"&&(p<w&&(p=S.indexOf("|",w)),p!==-1&&S[p+1]!==")"&&(h=S.indexOf(")",p),h>p&&(l=S.indexOf("\\",p),l===-1||l>h))))return!0;if(S[w]==="\\"){var t=S[w+1];w+=2;var a=N[t];if(a){var n=S.indexOf(a,w);n!==-1&&(w=n+1)}if(S[w]==="!")return!0}else w++}return!1},U=function(S){if(S[0]==="!")return!0;for(var w=0;w<S.length;){if(/[*?{}()[\]]/.test(S[w]))return!0;if(S[w]==="\\"){var p=S[w+1];w+=2;var i=N[p];if(i){var g=S.indexOf(i,w);g!==-1&&(w=g+1)}if(S[w]==="!")return!0}else w++}return!1};return Ve=function(w,p){if(typeof w!="string"||w==="")return!1;if(G(w))return!0;var i=D;return p&&p.strict===!1&&(i=U),i(w)},Ve}var Ce={exports:{}},et;function At(){return et||(et=1,function(G,N){var D={};N=G.exports=u;var U;typeof ut=="object"&&D&&D.NODE_DEBUG&&/\bsemver\b/i.test(D.NODE_DEBUG)?U=function(){var b=Array.prototype.slice.call(arguments,0);b.unshift("SEMVER"),console.log.apply(console,b)}:U=function(){},N.SEMVER_SPEC_VERSION="2.0.0";var S=256,w=Number.MAX_SAFE_INTEGER||9007199254740991,p=16,i=S-6,g=N.re=[],h=N.safeRe=[],l=N.src=[],t=N.tokens={},a=0;function n(b){t[b]=a++}var s="[a-zA-Z0-9-]",r=[["\\s",1],["\\d",S],[s,i]];function c(b){for(var $=0;$<r.length;$++){var x=r[$][0],j=r[$][1];b=b.split(x+"*").join(x+"{0,"+j+"}").split(x+"+").join(x+"{1,"+j+"}")}return b}n("NUMERICIDENTIFIER"),l[t.NUMERICIDENTIFIER]="0|[1-9]\\d*",n("NUMERICIDENTIFIERLOOSE"),l[t.NUMERICIDENTIFIERLOOSE]="\\d+",n("NONNUMERICIDENTIFIER"),l[t.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+s+"*",n("MAINVERSION"),l[t.MAINVERSION]="("+l[t.NUMERICIDENTIFIER]+")\\.("+l[t.NUMERICIDENTIFIER]+")\\.("+l[t.NUMERICIDENTIFIER]+")",n("MAINVERSIONLOOSE"),l[t.MAINVERSIONLOOSE]="("+l[t.NUMERICIDENTIFIERLOOSE]+")\\.("+l[t.NUMERICIDENTIFIERLOOSE]+")\\.("+l[t.NUMERICIDENTIFIERLOOSE]+")",n("PRERELEASEIDENTIFIER"),l[t.PRERELEASEIDENTIFIER]="(?:"+l[t.NUMERICIDENTIFIER]+"|"+l[t.NONNUMERICIDENTIFIER]+")",n("PRERELEASEIDENTIFIERLOOSE"),l[t.PRERELEASEIDENTIFIERLOOSE]="(?:"+l[t.NUMERICIDENTIFIERLOOSE]+"|"+l[t.NONNUMERICIDENTIFIER]+")",n("PRERELEASE"),l[t.PRERELEASE]="(?:-("+l[t.PRERELEASEIDENTIFIER]+"(?:\\."+l[t.PRERELEASEIDENTIFIER]+")*))",n("PRERELEASELOOSE"),l[t.PRERELEASELOOSE]="(?:-?("+l[t.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+l[t.PRERELEASEIDENTIFIERLOOSE]+")*))",n("BUILDIDENTIFIER"),l[t.BUILDIDENTIFIER]=s+"+",n("BUILD"),l[t.BUILD]="(?:\\+("+l[t.BUILDIDENTIFIER]+"(?:\\."+l[t.BUILDIDENTIFIER]+")*))",n("FULL"),n("FULLPLAIN"),l[t.FULLPLAIN]="v?"+l[t.MAINVERSION]+l[t.PRERELEASE]+"?"+l[t.BUILD]+"?",l[t.FULL]="^"+l[t.FULLPLAIN]+"$",n("LOOSEPLAIN"),l[t.LOOSEPLAIN]="[v=\\s]*"+l[t.MAINVERSIONLOOSE]+l[t.PRERELEASELOOSE]+"?"+l[t.BUILD]+"?",n("LOOSE"),l[t.LOOSE]="^"+l[t.LOOSEPLAIN]+"$",n("GTLT"),l[t.GTLT]="((?:<|>)?=?)",n("XRANGEIDENTIFIERLOOSE"),l[t.XRANGEIDENTIFIERLOOSE]=l[t.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",n("XRANGEIDENTIFIER"),l[t.XRANGEIDENTIFIER]=l[t.NUMERICIDENTIFIER]+"|x|X|\\*",n("XRANGEPLAIN"),l[t.XRANGEPLAIN]="[v=\\s]*("+l[t.XRANGEIDENTIFIER]+")(?:\\.("+l[t.XRANGEIDENTIFIER]+")(?:\\.("+l[t.XRANGEIDENTIFIER]+")(?:"+l[t.PRERELEASE]+")?"+l[t.BUILD]+"?)?)?",n("XRANGEPLAINLOOSE"),l[t.XRANGEPLAINLOOSE]="[v=\\s]*("+l[t.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[t.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+l[t.XRANGEIDENTIFIERLOOSE]+")(?:"+l[t.PRERELEASELOOSE]+")?"+l[t.BUILD]+"?)?)?",n("XRANGE"),l[t.XRANGE]="^"+l[t.GTLT]+"\\s*"+l[t.XRANGEPLAIN]+"$",n("XRANGELOOSE"),l[t.XRANGELOOSE]="^"+l[t.GTLT]+"\\s*"+l[t.XRANGEPLAINLOOSE]+"$",n("COERCE"),l[t.COERCE]="(^|[^\\d])(\\d{1,"+p+"})(?:\\.(\\d{1,"+p+"}))?(?:\\.(\\d{1,"+p+"}))?(?:$|[^\\d])",n("COERCERTL"),g[t.COERCERTL]=new RegExp(l[t.COERCE],"g"),h[t.COERCERTL]=new RegExp(c(l[t.COERCE]),"g"),n("LONETILDE"),l[t.LONETILDE]="(?:~>?)",n("TILDETRIM"),l[t.TILDETRIM]="(\\s*)"+l[t.LONETILDE]+"\\s+",g[t.TILDETRIM]=new RegExp(l[t.TILDETRIM],"g"),h[t.TILDETRIM]=new RegExp(c(l[t.TILDETRIM]),"g");var e="$1~";n("TILDE"),l[t.TILDE]="^"+l[t.LONETILDE]+l[t.XRANGEPLAIN]+"$",n("TILDELOOSE"),l[t.TILDELOOSE]="^"+l[t.LONETILDE]+l[t.XRANGEPLAINLOOSE]+"$",n("LONECARET"),l[t.LONECARET]="(?:\\^)",n("CARETTRIM"),l[t.CARETTRIM]="(\\s*)"+l[t.LONECARET]+"\\s+",g[t.CARETTRIM]=new RegExp(l[t.CARETTRIM],"g"),h[t.CARETTRIM]=new RegExp(c(l[t.CARETTRIM]),"g");var o="$1^";n("CARET"),l[t.CARET]="^"+l[t.LONECARET]+l[t.XRANGEPLAIN]+"$",n("CARETLOOSE"),l[t.CARETLOOSE]="^"+l[t.LONECARET]+l[t.XRANGEPLAINLOOSE]+"$",n("COMPARATORLOOSE"),l[t.COMPARATORLOOSE]="^"+l[t.GTLT]+"\\s*("+l[t.LOOSEPLAIN]+")$|^$",n("COMPARATOR"),l[t.COMPARATOR]="^"+l[t.GTLT]+"\\s*("+l[t.FULLPLAIN]+")$|^$",n("COMPARATORTRIM"),l[t.COMPARATORTRIM]="(\\s*)"+l[t.GTLT]+"\\s*("+l[t.LOOSEPLAIN]+"|"+l[t.XRANGEPLAIN]+")",g[t.COMPARATORTRIM]=new RegExp(l[t.COMPARATORTRIM],"g"),h[t.COMPARATORTRIM]=new RegExp(c(l[t.COMPARATORTRIM]),"g");var f="$1$2$3";n("HYPHENRANGE"),l[t.HYPHENRANGE]="^\\s*("+l[t.XRANGEPLAIN]+")\\s+-\\s+("+l[t.XRANGEPLAIN]+")\\s*$",n("HYPHENRANGELOOSE"),l[t.HYPHENRANGELOOSE]="^\\s*("+l[t.XRANGEPLAINLOOSE]+")\\s+-\\s+("+l[t.XRANGEPLAINLOOSE]+")\\s*$",n("STAR"),l[t.STAR]="(<|>)?=?\\s*\\*";for(var m=0;m<a;m++)U(m,l[m]),g[m]||(g[m]=new RegExp(l[m]),h[m]=new RegExp(c(l[m])));N.parse=y;function y(b,$){if((!$||typeof $!="object")&&($={loose:!!$,includePrerelease:!1}),b instanceof u)return b;if(typeof b!="string"||b.length>S)return null;var x=$.loose?h[t.LOOSE]:h[t.FULL];if(!x.test(b))return null;try{return new u(b,$)}catch{return null}}N.valid=R;function R(b,$){var x=y(b,$);return x?x.version:null}N.clean=_;function _(b,$){var x=y(b.trim().replace(/^[=v]+/,""),$);return x?x.version:null}N.SemVer=u;function u(b,$){if((!$||typeof $!="object")&&($={loose:!!$,includePrerelease:!1}),b instanceof u){if(b.loose===$.loose)return b;b=b.version}else if(typeof b!="string")throw new TypeError("Invalid Version: "+b);if(b.length>S)throw new TypeError("version is longer than "+S+" characters");if(!(this instanceof u))return new u(b,$);U("SemVer",b,$),this.options=$,this.loose=!!$.loose;var x=b.trim().match($.loose?h[t.LOOSE]:h[t.FULL]);if(!x)throw new TypeError("Invalid Version: "+b);if(this.raw=b,this.major=+x[1],this.minor=+x[2],this.patch=+x[3],this.major>w||this.major<0)throw new TypeError("Invalid major version");if(this.minor>w||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>w||this.patch<0)throw new TypeError("Invalid patch version");x[4]?this.prerelease=x[4].split(".").map(function(j){if(/^[0-9]+$/.test(j)){var L=+j;if(L>=0&&L<w)return L}return j}):this.prerelease=[],this.build=x[5]?x[5].split("."):[],this.format()}u.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},u.prototype.toString=function(){return this.version},u.prototype.compare=function(b){return U("SemVer.compare",this.version,this.options,b),b instanceof u||(b=new u(b,this.options)),this.compareMain(b)||this.comparePre(b)},u.prototype.compareMain=function(b){return b instanceof u||(b=new u(b,this.options)),k(this.major,b.major)||k(this.minor,b.minor)||k(this.patch,b.patch)},u.prototype.comparePre=function(b){if(b instanceof u||(b=new u(b,this.options)),this.prerelease.length&&!b.prerelease.length)return-1;if(!this.prerelease.length&&b.prerelease.length)return 1;if(!this.prerelease.length&&!b.prerelease.length)return 0;var $=0;do{var x=this.prerelease[$],j=b.prerelease[$];if(U("prerelease compare",$,x,j),x===void 0&&j===void 0)return 0;if(j===void 0)return 1;if(x===void 0)return-1;if(x===j)continue;return k(x,j)}while(++$)},u.prototype.compareBuild=function(b){b instanceof u||(b=new u(b,this.options));var $=0;do{var x=this.build[$],j=b.build[$];if(U("prerelease compare",$,x,j),x===void 0&&j===void 0)return 0;if(j===void 0)return 1;if(x===void 0)return-1;if(x===j)continue;return k(x,j)}while(++$)},u.prototype.inc=function(b,$){switch(b){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",$);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",$);break;case"prepatch":this.prerelease.length=0,this.inc("patch",$),this.inc("pre",$);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",$),this.inc("pre",$);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var x=this.prerelease.length;--x>=0;)typeof this.prerelease[x]=="number"&&(this.prerelease[x]++,x=-2);x===-1&&this.prerelease.push(0)}$&&(this.prerelease[0]===$?isNaN(this.prerelease[1])&&(this.prerelease=[$,0]):this.prerelease=[$,0]);break;default:throw new Error("invalid increment argument: "+b)}return this.format(),this.raw=this.version,this},N.inc=d;function d(b,$,x,j){typeof x=="string"&&(j=x,x=void 0);try{return new u(b,x).inc($,j).version}catch{return null}}N.diff=v;function v(b,$){if(Q(b,$))return null;var x=y(b),j=y($),L="";if(x.prerelease.length||j.prerelease.length){L="pre";var M="prerelease"}for(var B in x)if((B==="major"||B==="minor"||B==="patch")&&x[B]!==j[B])return L+B;return M}N.compareIdentifiers=k;var E=/^[0-9]+$/;function k(b,$){var x=E.test(b),j=E.test($);return x&&j&&(b=+b,$=+$),b===$?0:x&&!j?-1:j&&!x?1:b<$?-1:1}N.rcompareIdentifiers=O;function O(b,$){return k($,b)}N.major=A;function A(b,$){return new u(b,$).major}N.minor=I;function I(b,$){return new u(b,$).minor}N.patch=T;function T(b,$){return new u(b,$).patch}N.compare=F;function F(b,$,x){return new u(b,x).compare(new u($,x))}N.compareLoose=K;function K(b,$){return F(b,$,!0)}N.compareBuild=V;function V(b,$,x){var j=new u(b,x),L=new u($,x);return j.compare(L)||j.compareBuild(L)}N.rcompare=z;function z(b,$,x){return F($,b,x)}N.sort=P;function P(b,$){return b.sort(function(x,j){return N.compareBuild(x,j,$)})}N.rsort=X;function X(b,$){return b.sort(function(x,j){return N.compareBuild(j,x,$)})}N.gt=Z;function Z(b,$,x){return F(b,$,x)>0}N.lt=J;function J(b,$,x){return F(b,$,x)<0}N.eq=Q;function Q(b,$,x){return F(b,$,x)===0}N.neq=ne;function ne(b,$,x){return F(b,$,x)!==0}N.gte=ie;function ie(b,$,x){return F(b,$,x)>=0}N.lte=be;function be(b,$,x){return F(b,$,x)<=0}N.cmp=ye;function ye(b,$,x,j){switch($){case"===":return typeof b=="object"&&(b=b.version),typeof x=="object"&&(x=x.version),b===x;case"!==":return typeof b=="object"&&(b=b.version),typeof x=="object"&&(x=x.version),b!==x;case"":case"=":case"==":return Q(b,x,j);case"!=":return ne(b,x,j);case">":return Z(b,x,j);case">=":return ie(b,x,j);case"<":return J(b,x,j);case"<=":return be(b,x,j);default:throw new TypeError("Invalid operator: "+$)}}N.Comparator=ae;function ae(b,$){if((!$||typeof $!="object")&&($={loose:!!$,includePrerelease:!1}),b instanceof ae){if(b.loose===!!$.loose)return b;b=b.value}if(!(this instanceof ae))return new ae(b,$);b=b.trim().split(/\s+/).join(" "),U("comparator",b,$),this.options=$,this.loose=!!$.loose,this.parse(b),this.semver===ge?this.value="":this.value=this.operator+this.semver.version,U("comp",this)}var ge={};ae.prototype.parse=function(b){var $=this.options.loose?h[t.COMPARATORLOOSE]:h[t.COMPARATOR],x=b.match($);if(!x)throw new TypeError("Invalid comparator: "+b);this.operator=x[1]!==void 0?x[1]:"",this.operator==="="&&(this.operator=""),x[2]?this.semver=new u(x[2],this.options.loose):this.semver=ge},ae.prototype.toString=function(){return this.value},ae.prototype.test=function(b){if(U("Comparator.test",b,this.options.loose),this.semver===ge||b===ge)return!0;if(typeof b=="string")try{b=new u(b,this.options)}catch{return!1}return ye(b,this.operator,this.semver,this.options)},ae.prototype.intersects=function(b,$){if(!(b instanceof ae))throw new TypeError("a Comparator is required");(!$||typeof $!="object")&&($={loose:!!$,includePrerelease:!1});var x;if(this.operator==="")return this.value===""?!0:(x=new ee(b.value,$),W(this.value,x,$));if(b.operator==="")return b.value===""?!0:(x=new ee(this.value,$),W(b.semver,x,$));var j=(this.operator===">="||this.operator===">")&&(b.operator===">="||b.operator===">"),L=(this.operator==="<="||this.operator==="<")&&(b.operator==="<="||b.operator==="<"),M=this.semver.version===b.semver.version,B=(this.operator===">="||this.operator==="<=")&&(b.operator===">="||b.operator==="<="),Y=ye(this.semver,"<",b.semver,$)&&(this.operator===">="||this.operator===">")&&(b.operator==="<="||b.operator==="<"),H=ye(this.semver,">",b.semver,$)&&(this.operator==="<="||this.operator==="<")&&(b.operator===">="||b.operator===">");return j||L||M&&B||Y||H},N.Range=ee;function ee(b,$){if((!$||typeof $!="object")&&($={loose:!!$,includePrerelease:!1}),b instanceof ee)return b.loose===!!$.loose&&b.includePrerelease===!!$.includePrerelease?b:new ee(b.raw,$);if(b instanceof ae)return new ee(b.value,$);if(!(this instanceof ee))return new ee(b,$);if(this.options=$,this.loose=!!$.loose,this.includePrerelease=!!$.includePrerelease,this.raw=b.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(x){return this.parseRange(x.trim())},this).filter(function(x){return x.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}ee.prototype.format=function(){return this.range=this.set.map(function(b){return b.join(" ").trim()}).join("||").trim(),this.range},ee.prototype.toString=function(){return this.range},ee.prototype.parseRange=function(b){var $=this.options.loose,x=$?h[t.HYPHENRANGELOOSE]:h[t.HYPHENRANGE];b=b.replace(x,Le),U("hyphen replace",b),b=b.replace(h[t.COMPARATORTRIM],f),U("comparator trim",b,h[t.COMPARATORTRIM]),b=b.replace(h[t.TILDETRIM],e),b=b.replace(h[t.CARETTRIM],o),b=b.split(/\s+/).join(" ");var j=$?h[t.COMPARATORLOOSE]:h[t.COMPARATOR],L=b.split(" ").map(function(M){return Ie(M,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(L=L.filter(function(M){return!!M.match(j)})),L=L.map(function(M){return new ae(M,this.options)},this),L},ee.prototype.intersects=function(b,$){if(!(b instanceof ee))throw new TypeError("a Range is required");return this.set.some(function(x){return _e(x,$)&&b.set.some(function(j){return _e(j,$)&&x.every(function(L){return j.every(function(M){return L.intersects(M,$)})})})})};function _e(b,$){for(var x=!0,j=b.slice(),L=j.pop();x&&j.length;)x=j.every(function(M){return L.intersects(M,$)}),L=j.pop();return x}N.toComparators=Ae;function Ae(b,$){return new ee(b,$).set.map(function(x){return x.map(function(j){return j.value}).join(" ").trim().split(" ")})}function Ie(b,$){return U("comp",b,$),b=Pe(b,$),U("caret",b),b=Ee(b,$),U("tildes",b),b=$e(b,$),U("xrange",b),b=qe(b,$),U("stars",b),b}function re(b){return!b||b.toLowerCase()==="x"||b==="*"}function Ee(b,$){return b.trim().split(/\s+/).map(function(x){return je(x,$)}).join(" ")}function je(b,$){var x=$.loose?h[t.TILDELOOSE]:h[t.TILDE];return b.replace(x,function(j,L,M,B,Y){U("tilde",b,j,L,M,B,Y);var H;return re(L)?H="":re(M)?H=">="+L+".0.0 <"+(+L+1)+".0.0":re(B)?H=">="+L+"."+M+".0 <"+L+"."+(+M+1)+".0":Y?(U("replaceTilde pr",Y),H=">="+L+"."+M+"."+B+"-"+Y+" <"+L+"."+(+M+1)+".0"):H=">="+L+"."+M+"."+B+" <"+L+"."+(+M+1)+".0",U("tilde return",H),H})}function Pe(b,$){return b.trim().split(/\s+/).map(function(x){return Re(x,$)}).join(" ")}function Re(b,$){U("caret",b,$);var x=$.loose?h[t.CARETLOOSE]:h[t.CARET];return b.replace(x,function(j,L,M,B,Y){U("caret",b,j,L,M,B,Y);var H;return re(L)?H="":re(M)?H=">="+L+".0.0 <"+(+L+1)+".0.0":re(B)?L==="0"?H=">="+L+"."+M+".0 <"+L+"."+(+M+1)+".0":H=">="+L+"."+M+".0 <"+(+L+1)+".0.0":Y?(U("replaceCaret pr",Y),L==="0"?M==="0"?H=">="+L+"."+M+"."+B+"-"+Y+" <"+L+"."+M+"."+(+B+1):H=">="+L+"."+M+"."+B+"-"+Y+" <"+L+"."+(+M+1)+".0":H=">="+L+"."+M+"."+B+"-"+Y+" <"+(+L+1)+".0.0"):(U("no pr"),L==="0"?M==="0"?H=">="+L+"."+M+"."+B+" <"+L+"."+M+"."+(+B+1):H=">="+L+"."+M+"."+B+" <"+L+"."+(+M+1)+".0":H=">="+L+"."+M+"."+B+" <"+(+L+1)+".0.0"),U("caret return",H),H})}function $e(b,$){return U("replaceXRanges",b,$),b.split(/\s+/).map(function(x){return Te(x,$)}).join(" ")}function Te(b,$){b=b.trim();var x=$.loose?h[t.XRANGELOOSE]:h[t.XRANGE];return b.replace(x,function(j,L,M,B,Y,H){U("xRange",b,j,L,M,B,Y,H);var he=re(M),de=he||re(B),ce=de||re(Y),le=ce;return L==="="&&le&&(L=""),H=$.includePrerelease?"-0":"",he?L===">"||L==="<"?j="<0.0.0-0":j="*":L&&le?(de&&(B=0),Y=0,L===">"?(L=">=",de?(M=+M+1,B=0,Y=0):(B=+B+1,Y=0)):L==="<="&&(L="<",de?M=+M+1:B=+B+1),j=L+M+"."+B+"."+Y+H):de?j=">="+M+".0.0"+H+" <"+(+M+1)+".0.0"+H:ce&&(j=">="+M+"."+B+".0"+H+" <"+M+"."+(+B+1)+".0"+H),U("xRange return",j),j})}function qe(b,$){return U("replaceStars",b,$),b.trim().replace(h[t.STAR],"")}function Le(b,$,x,j,L,M,B,Y,H,he,de,ce,le){return re(x)?$="":re(j)?$=">="+x+".0.0":re(L)?$=">="+x+"."+j+".0":$=">="+$,re(H)?Y="":re(he)?Y="<"+(+H+1)+".0.0":re(de)?Y="<"+H+"."+(+he+1)+".0":ce?Y="<="+H+"."+he+"."+de+"-"+ce:Y="<="+Y,($+" "+Y).trim()}ee.prototype.test=function(b){if(!b)return!1;if(typeof b=="string")try{b=new u(b,this.options)}catch{return!1}for(var $=0;$<this.set.length;$++)if(C(this.set[$],b,this.options))return!0;return!1};function C(b,$,x){for(var j=0;j<b.length;j++)if(!b[j].test($))return!1;if($.prerelease.length&&!x.includePrerelease){for(j=0;j<b.length;j++)if(U(b[j].semver),b[j].semver!==ge&&b[j].semver.prerelease.length>0){var L=b[j].semver;if(L.major===$.major&&L.minor===$.minor&&L.patch===$.patch)return!0}return!1}return!0}N.satisfies=W;function W(b,$,x){try{$=new ee($,x)}catch{return!1}return $.test(b)}N.maxSatisfying=se;function se(b,$,x){var j=null,L=null;try{var M=new ee($,x)}catch{return null}return b.forEach(function(B){M.test(B)&&(!j||L.compare(B)===-1)&&(j=B,L=new u(j,x))}),j}N.minSatisfying=oe;function oe(b,$,x){var j=null,L=null;try{var M=new ee($,x)}catch{return null}return b.forEach(function(B){M.test(B)&&(!j||L.compare(B)===1)&&(j=B,L=new u(j,x))}),j}N.minVersion=ue;function ue(b,$){b=new ee(b,$);var x=new u("0.0.0");if(b.test(x)||(x=new u("0.0.0-0"),b.test(x)))return x;x=null;for(var j=0;j<b.set.length;++j){var L=b.set[j];L.forEach(function(M){var B=new u(M.semver.version);switch(M.operator){case">":B.prerelease.length===0?B.patch++:B.prerelease.push(0),B.raw=B.format();case"":case">=":(!x||Z(x,B))&&(x=B);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+M.operator)}})}return x&&b.test(x)?x:null}N.validRange=xe;function xe(b,$){try{return new ee(b,$).range||"*"}catch{return null}}N.ltr=Me;function Me(b,$,x){return fe(b,$,"<",x)}N.gtr=me;function me(b,$,x){return fe(b,$,">",x)}N.outside=fe;function fe(b,$,x,j){b=new u(b,j),$=new ee($,j);var L,M,B,Y,H;switch(x){case">":L=Z,M=be,B=J,Y=">",H=">=";break;case"<":L=J,M=ie,B=Z,Y="<",H="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(W(b,$,j))return!1;for(var he=0;he<$.set.length;++he){var de=$.set[he],ce=null,le=null;if(de.forEach(function(ve){ve.semver===ge&&(ve=new ae(">=0.0.0")),ce=ce||ve,le=le||ve,L(ve.semver,ce.semver,j)?ce=ve:B(ve.semver,le.semver,j)&&(le=ve)}),ce.operator===Y||ce.operator===H||(!le.operator||le.operator===Y)&&M(b,le.semver))return!1;if(le.operator===H&&B(b,le.semver))return!1}return!0}N.prerelease=ke;function ke(b,$){var x=y(b,$);return x&&x.prerelease.length?x.prerelease:null}N.intersects=we;function we(b,$,x){return b=new ee(b,x),$=new ee($,x),b.intersects($)}N.coerce=Ne;function Ne(b,$){if(b instanceof u)return b;if(typeof b=="number"&&(b=String(b)),typeof b!="string")return null;$=$||{};var x=null;if(!$.rtl)x=b.match(h[t.COERCE]);else{for(var j;(j=h[t.COERCERTL].exec(b))&&(!x||x.index+x[0].length!==b.length);)(!x||j.index+j[0].length!==x.index+x[0].length)&&(x=j),h[t.COERCERTL].lastIndex=j.index+j[1].length+j[2].length;h[t.COERCERTL].lastIndex=-1}return x===null?null:y(x[2]+"."+(x[3]||"0")+"."+(x[4]||"0"),$)}}(Ce,Ce.exports)),Ce.exports}var Ge,tt;function It(){if(tt)return Ge;tt=1;const G=Ke(),N=At(),D="semver",U={base:G.string(),type:"semverRange",validate:function(p,{error:i}){return N.validRange(p)?{value:p}:{errors:i(`${D}.valid`)}},messages:{[`${D}.valid`]:"{{#label}} needs to be a valid semver range"}},S={};return S.compare={method:!1,validate:function(p,i,{exp:g},{name:h}){return N[h](p,g)?p:i.error(`${D}.${h}`,{exp:g})},args:[{name:"exp",assert:N.valid,message:"needs to be a valid semver expression"}]},["gt","gte","lt","lte","eq","neq"].forEach(function(p){S[p]={method:function(i){return this.$_addRule({name:p,method:"compare",args:{exp:i}})}}}),S.cmp={method:function(p,i){return this.$_addRule({name:"cmp",args:{cmp:p,exp:i}})},validate:function(p,i,{cmp:g,exp:h}){return N.cmp(p,g,h)?p:i.error(`${D}.cmp`,{cmp:g,exp:h})},args:[{name:"cmp",assert:p=>["===","!==","","=","==","!=",">",">=","<","<="].includes(p),message:"needs to be a valid comparator"},{name:"exp",assert:N.valid,message:"needs to be a valid semver expression"}]},S.compareRange={method:!1,validate:function(p,i,{rng:g},{name:h}){return N[h](p,g)?p:i.error(`${D}.${h}`,{rng:g})},args:[{name:"rng",assert:N.validRange,message:"needs to be a valid semver range"}]},["satisfies","gtr","ltr"].forEach(function(p){S[p]={method:function(i){return this.$_addRule({name:p,method:"compareRange",args:{rng:i}})}}}),S.outside={method:function(p,i){return this.$_addRule({name:"outside",args:{hilo:p,rng:i}})},validate:function(p,i,{hilo:g,rng:h}){return N.outside(p,h,g)?p:i.error(`${D}.outside`,{hilo:g,rng:h})},args:[{name:"hilo",assert:p=>[">","<"].includes(p),message:"needs to be a valid comparator"},{name:"rng",assert:N.validRange,message:"needs to be a valid semver range"}]},Ge={semver:{base:G.string(),type:"semver",validate:function(p,{error:i}){return N.valid(p)?{value:p}:{errors:i(`${D}.valid`)}},messages:{[`${D}.valid`]:"{{#label}} needs to be a valid semver expression",[`${D}.gt`]:"{{#label}} needs to be greater than {{#exp}}",[`${D}.gte`]:"{{#label}} needs to be greater than or equal to {{#exp}}",[`${D}.lt`]:"{{#label}} needs to be less than {{#exp}}",[`${D}.lte`]:"{{#label}} needs to be less than or equal to {{#exp}}",[`${D}.eq`]:"{{#label}} needs to be logically equivalent to {{#exp}}",[`${D}.neq`]:"{{#label}} needs to be logically different than {{#exp}}",[`${D}.cmp`]:"{{#label}} needs to satisfy {{#cmp}} on {{#exp}}",[`${D}.satisfies`]:"{{#label}} needs to satisfy {{#rng}}",[`${D}.gtr`]:"{{#label}} needs to be greater than range {{#rng}}",[`${D}.ltr`]:"{{#label}} needs to be less than range {{#rng}}",[`${D}.outside`]:"{{#label}} needs to be {{#hilo}} than range {{#rng}}"},rules:S},semverRange:U},Ge}/*!
12
12
  * is-var-name | ISC (c) Shinnosuke Watanabe
13
13
  * https://github.com/shinnn/is-var-name
14
14
  */function jt(G){if(typeof G!="string"||G.trim()!==G)return!1;try{new Function(G,"var "+G)}catch{return!1}return!0}const Tt=Object.freeze(Object.defineProperty({__proto__:null,default:jt},Symbol.toStringTag,{value:"Module"})),Lt=lt(Tt);var te={},rt;function Nt(){if(rt)return te;rt=1;const G=Ke();function N(E){return E&&typeof E=="object"&&"default"in E?E.default:E}const D=N(G),U={"-a":"--attach","-d":"--detach","-e":"--env","-h":"--hostname","-i":"--interactive","-it":"-it","-rm":"-rm","-m":"--memory","-p":"--publish","-P":"--publish-all","-l":"--label","-n":"--name","-q":"--quiet","-x":"--x-registry","-t":"--tty","-u":"--user","-v":"--volume","-w":"--workdir","-cgroupns":"--cgroupns","-cpus":"--cpus","-g":"--gpus","-ip6":"--ip6","--read-only":"--read-only","--add-host":"--add-host","--attach":"--attach","--blkio-weight":"--blkio-weight","--blkio-weight-device":"--blkio-weight-device","--cap-add":"--cap-add","--cap-drop":"--cap-drop","--cgroup-parent":"--cgroup-parent","--cidfile":"--cidfile","--cpu-period":"--cpu-period","--cpu-quota":"--cpu-quota","--cpu-rt-period":"--cpu-rt-period","--cpu-rt-runtime":"--cpu-rt-runtime","--cpu-shares":"--cpu-shares","--cpus":"--cpus","--cpuset-cpus":"--cpuset-cpus","--cpuset-mems":"--cpuset-mems","--detach":"--detach","--detach-keys":"--detach-keys","--device":"--device","--device-cgroup-rule":"--device-cgroup-rule","--device-read-bps":"--device-read-bps","--device-read-iops":"--device-read-iops","--device-write-bps":"--device-write-bps","--device-write-iops":"--device-write-iops","--disable-content-trust":"--disable-content-trust","--dns":"--dns","--dns-opt":"--dns-opt","--dns-search":"--dns-search","--domainname":"--domainname","--entrypoint":"--entrypoint","--env":"--env","--env-file":"--env-file","--expose":"--expose","--gpus":"--gpus","--group-add":"--group-add","--health-cmd":"--health-cmd","--health-interval":"--health-interval","--health-retries":"--health-retries","--health-start-period":"--health-start-period","--health-timeout":"--health-timeout","--help":"--help","--hostname":"--hostname","--init":"--init","--interactive":"--interactive","--ip":"--ip","--ip6":"--ip6","--ipc":"--ipc","--isolation":"--isolation","--kernel-memory":"--kernel-memory","--label":"--label","--label-file":"--label-file","--link":"--link","--link-local-ip":"--link-local-ip","--log-driver":"--log-driver","--log-opt":"--log-opt","--mac-address":"--mac-address","--memory":"--memory","--memory-reservation":"--memory-reservation","--memory-swap":"--memory-swap","--memory-swappiness":"--memory-swappiness","--mount":"--mount","--name":"--name","--network":"--network","--network-alias":"--network-alias","--no-healthcheck":"--no-healthcheck","--oom-kill-disable":"--oom-kill-disable","--oom-score-adj":"--oom-score-adj","--pid":"--pid","--pids-limit":"--pids-limit","--platform":"--platform","--privileged":"--privileged","--publish":"--publish","--publish-all":"--publish-all","--pull":"--pull","--restart":"--restart","--rm":"--rm","--runtime":"--runtime","--security-opt":"--security-opt","--shm-size":"--shm-size","--stop-signal":"--stop-signal","--stop-timeout":"--stop-timeout","--storage-opt":"--storage-opt","--sysctl":"--sysctl","--tmpfs":"--tmpfs","--tty":"--tty","--ulimit":"--ulimit","--user":"--user","--userns":"--userns","--uts":"--uts","--volume":"--volume","--volume-driver":"--volume-driver","--volumes-from":"--volumes-from","--workdir":"--workdir"},S={"--env":!0,"--publish":!0,"--volume":!0,"--attach":!0,"--quiet":!0,"--entrypoint":!0,"--workdir":!0,"--cidfile":!0,"--detach-keys":!0,"--disable-content-trust":!0,"--domainname":!0,"--expose":!0,"--ip":!0,"--link-local-ip":!0,"--platform":!0},w={"-rm":!0,"--name":!0,"--label":!0,"--network":!0,"--user":!0},p={"--volume":!0,"--publish":!0},i=new Set(["--publish","--volume"]),g=E=>{const[k]=E.split(":");return k?.startsWith("/")||k?.startsWith("./")||k?.startsWith("../")||k?.startsWith("~")||k?.startsWith("$BLOCKLET")};function h(E){return E.map(k=>{if(k.key!=="--volume"||k.value.startsWith("$BLOCKLET_APP_DIR/")||k.value.startsWith("$BLOCKLET_DATA_DIR/"))return k;const[O,...A]=k.value.split(":");if(!O||!g(k.value))return k;const I=O.startsWith("/")?`$BLOCKLET_DATA_DIR${O}`:`$BLOCKLET_DATA_DIR/${O}`;return{...k,value:[I,...A].join(":")}})}function l(E){let k=!0;return E.find(A=>A.key==="--publish"&&A.type==="web")?E.map(A=>{if(A.key==="--publish"){const I={...A,type:k?"docker":A.type};return k=A.type==="web",I}return A}):E.map(A=>{if(A.key==="--publish"){const I={...A,type:k?"web":"docker"};return k=!1,I}return A})}function t(E){if(!E)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};if(E=E.trim(),E.startsWith("$ docker run")&&(E=E.replace("$ docker run","docker run")),!E.startsWith("docker run"))return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const O=E.replace(/\\\n/g,"").replace(/\n/g," ").trim().match(/(?:[^\s"']+|'[^']*'|"[^"]*")+/g);if(!O)return{dockerArgs:[],dockerEnvs:[],dockerImage:"",dockerCommand:""};const A=[],I=[];let T=0,F="",K="";const V=[];for(;T<O.length;){const P=O[T];if(!P){T++;continue}if(P==="docker"||P==="run"){T++;continue}if((P==="-e"||P==="--env")&&T+1<O.length){const X=O[T+1]||"",[Z,...J]=X.split("=");if(Z){const Q=J.join("=").replace(/^['"]|['"]$/g,"");I.push({key:Z,value:Q})}T+=2;continue}if(P.startsWith("-")&&V.length===0){const X=P.indexOf("=");let Z=P,J=null;X!==-1&&(Z=P.substring(0,X),J=P.substring(X+1).replace(/^['"]|['"]$/g,""));const Q=U[Z];if(!Q){T+=2;continue}if(Q==="--publish"){let ne="";if(J)ne=J,A.push({key:Q,value:ne});else if(T+1<O.length&&!(O[T+1]||"").startsWith("-")){ne=(O[T+1]||"").replace(/^['"]|['"]$/g,""),A.push({key:Q,value:ne}),T+=2;continue}else{A.push({key:Q,value:"true"}),T++;continue}T++;continue}if(J!==null){A.push({key:Q,value:J}),T++;continue}else if(T+1<O.length&&!(O[T+1]||"").startsWith("-")){const ne=(O[T+1]||"").replace(/^['"]|['"]$/g,"");A.push({key:Q,value:ne}),T+=2;continue}else{A.push({key:Q,value:"true"}),T++;continue}}V.push(P),T++}F=V[0]||"",K=V.slice(1).join(" ");const z=[];for(const P of A)P.name="",P.path="",P.prefix="",P.protocol="",P.proxyBehavior="service",P.type="docker",!(i.has(P.key)&&P.value==="true")&&z.push(P);for(const P of I)P.custom="",P.description="",P.secure=!1,P.shared=!1,P.required=!1;return{dockerArgs:l(h(z)),dockerEnvs:I,dockerImage:F,dockerCommand:K}}function a({dockerArgs:E,dockerEnvs:k,dockerImage:O,dockerCommand:A}){if(E.length===0&&k.length===0&&!O)return"";const I=["docker run \\"],T=new Set(["--publish","--volume","--expose","--device","--mount","--label","--cap-add","--cap-drop","--add-host","--dns","--network-alias","--sysctl","--ulimit","--network"]);for(const F of E){const{key:K,value:V}=F;if(T.has(K))if(V==="true")I.push(` ${K} \\`);else{const z=/[\s"']/g.test(V)?`"${V}"`:V;I.push(` ${K} ${z} \\`)}else if(!I.some(z=>z.startsWith(` ${K}`)))if(V==="true")I.push(` ${K} \\`);else{const z=/[\s"']/g.test(V)?`"${V}"`:V;I.push(` ${K} ${z} \\`)}}for(const F of k){const{key:K,value:V}=F,z=/["']/g.test(V)?V:`"${V}"`;I.push(` -e ${K}=${z} \\`)}return O&&I.push(` ${O} \\`),A&&I.push(` ${A} \\`),I[I.length-1]?.endsWith(" \\")&&(I[I.length-1]=(I[I.length-1]||"").slice(0,-2)),I.join(`
15
- `)}const n={"--volume":E=>{const[k]=E.split(":");return k?g(E)&&!E.startsWith("$BLOCKLET_APP_DIR/")&&!E.startsWith("$BLOCKLET_DATA_DIR/")?"Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR":E.indexOf("..")>-1?'Volume cannot contain ".."':"":"Volume must start with key:value"}},s=E=>E.replace(/^[-]+/,"").replace(/-([a-z])/g,(A,I)=>I.toUpperCase()),r=E=>`--${E.replace(/([A-Z])/g,"-$1").toLowerCase()}`,c=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],e=["rm ","sudo "];function o(E){if(E==="")return;if(/(\n|\\n|\\\n|\t|\\t|\\\t)/.test(E))throw new Error("Docker CMD is invalid");const O=E.toLocaleLowerCase();if(e.some(I=>O.indexOf(I)!==-1))throw new Error("Docker CMD is invalid");if(c.some(I=>E.indexOf(I)!==-1))throw new Error("Docker CMD is invalid");if(!/^(?:(?:[a-zA-Z0-9\-_.\/:=\s]+)|(?:\@{1,2}[a-zA-Z_][a-zA-Z0-9_]*))+$/.test(E))throw new Error("Docker CMD is invalid")}const f=Array.from(new Set(Object.keys(S).map(s))),m=["publish","volume"],y=D.object({workdir:D.string().trim().optional(),image:D.string().trim().regex(/^[^\s]+$/).optional(),shell:D.string().trim().optional(),volumes:D.array().items(D.string().trim()).optional(),script:D.string().trim().optional(),installNodeModules:D.boolean().optional(),skipWrapDockerfile:D.boolean().optional(),command:D.string().allow("").default("").optional().custom((E,k)=>{try{return o(E),E}catch(O){return k.error("any.invalid",{message:O.message})}},"Docker CMD validation"),runBaseScript:D.boolean().optional(),...f.reduce((E,k)=>{const O=n[r(k)];return m.includes(k)?(E[k]=D.array().items(D.string().trim()).optional(),O?E[k]=D.array().items(D.string().trim().custom((A,I)=>{const T=O(A);return T?I.message(T):A})).optional():E[k]=D.array().items(D.string().trim()).optional(),E):(O?E[k]=D.string().trim().custom((A,I)=>{const T=O(A);return T?I.message(T):A}).optional():E[k]=D.string().trim().optional(),E)},{})}).optional(),R=E=>{const k=/^(?:[a-zA-Z0-9.-]+(?::[0-9]+)?\/)?(?:[a-z0-9]+(?:[._-][a-z0-9]+)*\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(:[a-zA-Z0-9_.-]+)?$/;return D.string().trim().regex(k).required().validate(E)},_=(E,k,O)=>{const A={};O.forEach(T=>{const F=s(T.key);m.includes(F)?A[F]=[...A[F]||[],T.value]:A[F]=T.value});const{error:I}=R(E);if(I)return{error:I,value:A};try{o(E)}catch(T){return{error:T,value:A}}return A.image=E,A.command=k||"",y.validate(A)};function u(E,k){const O=JSON.parse(JSON.stringify(k)),A=new Map;let I=1;const T=[];return O.forEach(F=>{if(F.key==="--publish"){const V=F.value.split(":");let z="127.0.0.1",P="",X="";V.length===2?[P,X]=V:V.length===3?[z,P,X]=V:V.length===1&&(X=V[0]||"");let Z=A.get(P||"");if(Z||(Z=`$BLOCKLET_PORT_${I++}`,A.set(P||"",Z)),!T.find(J=>J.port===P)){const J=F.type||"docker",Q=`${E.replace(/\W/g,"-")}-${T.length+1}`;T.push({type:J,proxyBehavior:F.proxyBehavior||"",name:Q,path:`/${Q}`,port:P||X,containerPort:Number(X)||0,hostIP:z,prefix:J==="docker"?`/${Q}`:F.prefix||"*"})}}}),T}function d(E,k=!1){const O=[];if(!E)return O;for(const A of E){const I={name:A.key,default:A.value===`$${A.key}`?"":A.value,secure:A.secure!==void 0?A.secure:!1,shared:A.shared!==void 0?A.shared:!1,required:A.required!==void 0?A.required:!1,description:A.description||A.key};k||(I.custom=A.custom||""),O.push(I)}return O}function v(E,k){const O=JSON.parse(JSON.stringify(E));return k.split(".").map(I=>{const T=I.match(/(.+)\[(.+?)\]/);return T?[T[1],T[2]]:I}).flat().filter(Boolean).reduce((I,T)=>{if(!I||!T)return;const F=T?.match(/(.+?)=(.+)/);if(Array.isArray(I)&&F){const[,V,z]=F;return V&&z&&(I=I.find(P=>{const X=Object.keys(P).find(Z=>Z.toLowerCase()===V.toLowerCase());return X&&P[X]===z})),I}const K=Object.keys(I).find(V=>V.toLowerCase()===T.toLowerCase());return K?I[K]:void 0},O)}return te.addBlockletPrefixVolume=h,te.allowDockerArgs=S,te.autoSetDockerArgs=w,te.dockerArgsToCamelCase=s,te.dockerArgsValidator=n,te.dockerBuildCommand=a,te.dockerCamelCaseToDash=r,te.dockerCmdValidator=o,te.dockerParseCommand=t,te.dockerParseEnvironments=d,te.dockerParsePublishPorts=u,te.dockerSchema=y,te.getObjByPath=v,te.isVolumePath=g,te.multiValueArgs=m,te.notAllowUseCustomDockerArgs=p,te.parseDockerArgsToSchema=_,te.whiteDockerArgs=U,te}var Se={},st;function Ct(){if(st)return Se;st=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.toBlockletDid=void 0;const G=ft(),N=mt(),D=De(),U=S=>{if((0,D.isValid)(S))return S;const w=(0,N.toHex)(ht.from(typeof S=="string"?S.trim():S));return(0,D.fromPublicKey)(w,{role:G.types.RoleType.ROLE_ANY})};return Se.toBlockletDid=U,Se}var pe={},nt;function Dt(){if(nt)return pe;nt=1;var G=pe&&pe.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(pe,"__esModule",{value:!0}),pe.didExtension=pe.fileExtension=void 0;const N=G(ct),D=G(Et()),U=De(),S=p=>({type:"file",base:p.string(),validate(i,{error:g}){return i&&typeof i=="string"?{value:i}:{errors:g("file.empty",{file:i})}},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:i=null,canSkip:g=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:i,canSkip:g}})},args:[{name:"baseDir",assert:i=>N.default.existsSync(i),message:"baseDir must exist"},{name:"canSkip",assert:i=>typeof i=="function",message:"canSkip must be a function"}],validate(i,{error:g},{baseDir:h,canSkip:l}={}){if(typeof l=="function"&&l(h,i))return i;try{return N.default.statSync(D.default.join(h,i)),i}catch(t){switch(t.code){case"ENOENT":return g("file.enoent",{file:i})}return g("file.error.generic",{message:t.message})}}}}});pe.fileExtension=S;const w=p=>({type:"DID",base:p.string(),validate(i,{error:g}){return!i||typeof i!="string"?{errors:g("did.empty",{did:i})}:(0,U.isValid)(i)===!1?{errors:g("did.invalid",{did:i})}:{value:i}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});return pe.didExtension=w,pe.default={fileExtension:S,didExtension:w},pe}var Oe={},We={exports:{}};const Pt=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"];var at;function qt(){if(at)return We.exports;at=1;var G=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),N=Pt,D=["node_modules","favicon.ico"],U=We.exports=function(w){var p=[],i=[];if(w===null)return i.push("name cannot be null"),S(p,i);if(w===void 0)return i.push("name cannot be undefined"),S(p,i);if(typeof w!="string")return i.push("name must be a string"),S(p,i);if(w.length||i.push("name length must be greater than zero"),w.match(/^\./)&&i.push("name cannot start with a period"),w.match(/^_/)&&i.push("name cannot start with an underscore"),w.trim()!==w&&i.push("name cannot contain leading or trailing spaces"),D.forEach(function(t){w.toLowerCase()===t&&i.push(t+" is a blacklisted name")}),N.forEach(function(t){w.toLowerCase()===t&&p.push(t+" is a core module name")}),w.length>214&&p.push("name can no longer contain more than 214 characters"),w.toLowerCase()!==w&&p.push("name can no longer contain capital letters"),/[~'!()*]/.test(w.split("/").slice(-1)[0])&&p.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(w)!==w){var g=w.match(G);if(g){var h=g[1],l=g[2];if(encodeURIComponent(h)===h&&encodeURIComponent(l)===l)return S(p,i)}i.push("name can only contain URL-friendly characters")}return S(p,i)};U.scopedPackagePattern=G;var S=function(w,p){var i={validForNewPackages:p.length===0&&w.length===0,validForOldPackages:p.length===0,warnings:w,errors:p};return i.warnings.length||delete i.warnings,i.errors.length||delete i.errors,i};return We.exports}var it;function Mt(){return it||(it=1,function(G){var N=Oe&&Oe.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(G,"__esModule",{value:!0}),G.validateName=G.validateNewDid=void 0;const D=De(),U=N(qt()),S=32,w=i=>{if((0,D.toTypeInfo)(i).role!==D.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};G.validateNewDid=w;const p=(i,{checkDid:g=!0}={})=>{if((0,D.isValid)(i))g&&(0,G.validateNewDid)(i);else{const{validForNewPackages:h,errors:l=[],warnings:t=[]}=(0,U.default)(i);if(!h)throw new Error(l[0]||t[0]);if(i.length>S)throw new Error("Blocklet name is too long")}};G.validateName=p,G.default={validateName:G.validateName,validateNewDid:G.validateNewDid}}(Oe)),Oe}var ot;function zt(){if(ot)return q;ot=1;var G=q&&q.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(q,"__esModule",{value:!0}),q.Joi=q.eventsSchema=q.installBlockletDescriptionSchema=q.installBlockletTitleSchema=q.resourceBundleSchema=q.authConfigSchema=q.cacheableSchema=q.statsSchema=q.titleSchema=q.themeSchema=q.signatureSchema=q.serviceSchema=q.scriptsSchema=q.personSchema=q.navigationSchema=q.navigationItemSchema=q.updateMountPointSchema=q.mountPointSchema=q.logoSchema=q.interfaceSchema=q.environmentNameSchema=q.environmentSchema=q.engineSchema=q.endpointSchema=q.distSchema=q.descriptionSchema=q.createBlockletSchema=q.componentSchema=q.blockletNameSchema=q.blockletMetaSchema=void 0;const N=G(ct),D=G(Ke()),U=G(kt()),S=G(Ot()),w=It(),p=G(Lt),i=dt(),g=De(),h=Nt(),l=pt(),t=Ct(),a=Dt(),n=Mt(),s=gt(),r=U.default.default,c="/.well-known",e=D.default.extend(w.semver).extend(w.semverRange).extend(a.fileExtension).extend(a.didExtension);q.Joi=e;const o=(C,W)=>(0,s.checkLink)(C)?C:W.message(`Invalid navigation link: ${C}
15
+ `)}const n={"--volume":E=>{const[k]=E.split(":");return k?g(E)&&!E.startsWith("$BLOCKLET_APP_DIR/")&&!E.startsWith("$BLOCKLET_DATA_DIR/")?"Volume must start with $BLOCKLET_APP_DIR or $BLOCKLET_DATA_DIR":E.indexOf("..")>-1?'Volume cannot contain ".."':"":"Volume must start with key:value"}},s=E=>E.replace(/^[-]+/,"").replace(/-([a-z])/g,(A,I)=>I.toUpperCase()),r=E=>`--${E.replace(/([A-Z])/g,"-$1").toLowerCase()}`,c=[" -- ","~","&","|",">","<","{","}","[","]",";","$","!","*","%","&&","||",","],e=["rm ","sudo "];function o(E){if(E==="")return;if(/(\n|\\n|\\\n|\t|\\t|\\\t)/.test(E))throw new Error("Docker CMD is invalid");const O=E.toLocaleLowerCase();if(e.some(I=>O.indexOf(I)!==-1))throw new Error("Docker CMD is invalid");if(c.some(I=>E.indexOf(I)!==-1))throw new Error("Docker CMD is invalid");if(!/^(?:(?:[a-zA-Z0-9\-_.\/:=\s]+)|(?:\@{1,2}[a-zA-Z_][a-zA-Z0-9_]*))+$/.test(E))throw new Error("Docker CMD is invalid")}const f=Array.from(new Set(Object.keys(S).map(s))),m=["publish","volume"],y=D.object({workdir:D.string().trim().optional(),image:D.string().trim().regex(/^[^\s]+$/).optional(),shell:D.string().trim().optional(),volumes:D.array().items(D.string().trim()).optional(),script:D.string().trim().optional(),installNodeModules:D.boolean().optional(),skipWrapDockerfile:D.boolean().optional(),tmpfs:D.string().trim().optional(),command:D.string().allow("").default("").optional().custom((E,k)=>{try{return o(E),E}catch(O){return k.error("any.invalid",{message:O.message})}},"Docker CMD validation"),runBaseScript:D.boolean().optional(),...f.reduce((E,k)=>{const O=n[r(k)];return m.includes(k)?(E[k]=D.array().items(D.string().trim()).optional(),O?E[k]=D.array().items(D.string().trim().custom((A,I)=>{const T=O(A);return T?I.message(T):A})).optional():E[k]=D.array().items(D.string().trim()).optional(),E):(O?E[k]=D.string().trim().custom((A,I)=>{const T=O(A);return T?I.message(T):A}).optional():E[k]=D.string().trim().optional(),E)},{})}).optional(),R=E=>{const k=/^(?:[a-zA-Z0-9.-]+(?::[0-9]+)?\/)?(?:[a-z0-9]+(?:[._-][a-z0-9]+)*\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(:[a-zA-Z0-9_.-]+)?$/;return D.string().trim().regex(k).required().validate(E)},_=(E,k,O)=>{const A={};O.forEach(T=>{const F=s(T.key);m.includes(F)?A[F]=[...A[F]||[],T.value]:A[F]=T.value});const{error:I}=R(E);if(I)return{error:I,value:A};try{o(E)}catch(T){return{error:T,value:A}}return A.image=E,A.command=k||"",y.validate(A)};function u(E,k){const O=JSON.parse(JSON.stringify(k)),A=new Map;let I=1;const T=[];return O.forEach(F=>{if(F.key==="--publish"){const V=F.value.split(":");let z="127.0.0.1",P="",X="";V.length===2?[P,X]=V:V.length===3?[z,P,X]=V:V.length===1&&(X=V[0]||"");let Z=A.get(P||"");if(Z||(Z=`$BLOCKLET_PORT_${I++}`,A.set(P||"",Z)),!T.find(J=>J.port===P)){const J=F.type||"docker",Q=`${E.replace(/\W/g,"-")}-${T.length+1}`;T.push({type:J,proxyBehavior:F.proxyBehavior||"",name:Q,path:`/${Q}`,port:P||X,containerPort:Number(X)||0,hostIP:z,prefix:J==="docker"?`/${Q}`:F.prefix||"*"})}}}),T}function d(E,k=!1){const O=[];if(!E)return O;for(const A of E){const I={name:A.key,default:A.value===`$${A.key}`?"":A.value,secure:A.secure!==void 0?A.secure:!1,shared:A.shared!==void 0?A.shared:!1,required:A.required!==void 0?A.required:!1,description:A.description||A.key};k||(I.custom=A.custom||""),O.push(I)}return O}function v(E,k){const O=JSON.parse(JSON.stringify(E));return k.split(".").map(I=>{const T=I.match(/(.+)\[(.+?)\]/);return T?[T[1],T[2]]:I}).flat().filter(Boolean).reduce((I,T)=>{if(!I||!T)return;const F=T?.match(/(.+?)=(.+)/);if(Array.isArray(I)&&F){const[,V,z]=F;return V&&z&&(I=I.find(P=>{const X=Object.keys(P).find(Z=>Z.toLowerCase()===V.toLowerCase());return X&&P[X]===z})),I}const K=Object.keys(I).find(V=>V.toLowerCase()===T.toLowerCase());return K?I[K]:void 0},O)}return te.addBlockletPrefixVolume=h,te.allowDockerArgs=S,te.autoSetDockerArgs=w,te.dockerArgsToCamelCase=s,te.dockerArgsValidator=n,te.dockerBuildCommand=a,te.dockerCamelCaseToDash=r,te.dockerCmdValidator=o,te.dockerParseCommand=t,te.dockerParseEnvironments=d,te.dockerParsePublishPorts=u,te.dockerSchema=y,te.getObjByPath=v,te.isVolumePath=g,te.multiValueArgs=m,te.notAllowUseCustomDockerArgs=p,te.parseDockerArgsToSchema=_,te.whiteDockerArgs=U,te}var Se={},st;function Ct(){if(st)return Se;st=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.toBlockletDid=void 0;const G=ft(),N=mt(),D=De(),U=S=>{if((0,D.isValid)(S))return S;const w=(0,N.toHex)(ht.from(typeof S=="string"?S.trim():S));return(0,D.fromPublicKey)(w,{role:G.types.RoleType.ROLE_ANY})};return Se.toBlockletDid=U,Se}var pe={},nt;function Dt(){if(nt)return pe;nt=1;var G=pe&&pe.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(pe,"__esModule",{value:!0}),pe.didExtension=pe.fileExtension=void 0;const N=G(ct),D=G(Et()),U=De(),S=p=>({type:"file",base:p.string(),validate(i,{error:g}){return i&&typeof i=="string"?{value:i}:{errors:g("file.empty",{file:i})}},messages:{"file.empty":'file "{{#file}}" must be non-empty string',"file.enoent":'file "{{#file}}" does not exist',"file.error.generic":'file could not be read. message: "{{#message}}"'},rules:{exists:{multi:!1,method({baseDir:i=null,canSkip:g=()=>!1}={}){return this.$_addRule({name:"exists",args:{baseDir:i,canSkip:g}})},args:[{name:"baseDir",assert:i=>N.default.existsSync(i),message:"baseDir must exist"},{name:"canSkip",assert:i=>typeof i=="function",message:"canSkip must be a function"}],validate(i,{error:g},{baseDir:h,canSkip:l}={}){if(typeof l=="function"&&l(h,i))return i;try{return N.default.statSync(D.default.join(h,i)),i}catch(t){switch(t.code){case"ENOENT":return g("file.enoent",{file:i})}return g("file.error.generic",{message:t.message})}}}}});pe.fileExtension=S;const w=p=>({type:"DID",base:p.string(),validate(i,{error:g}){return!i||typeof i!="string"?{errors:g("did.empty",{did:i})}:(0,U.isValid)(i)===!1?{errors:g("did.invalid",{did:i})}:{value:i}},messages:{"did.empty":'did "{{#did}}" must be non-empty string',"did.invalid":'did "{{#did}}" is not valid'}});return pe.didExtension=w,pe.default={fileExtension:S,didExtension:w},pe}var Oe={},We={exports:{}};const Pt=["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"];var at;function qt(){if(at)return We.exports;at=1;var G=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),N=Pt,D=["node_modules","favicon.ico"],U=We.exports=function(w){var p=[],i=[];if(w===null)return i.push("name cannot be null"),S(p,i);if(w===void 0)return i.push("name cannot be undefined"),S(p,i);if(typeof w!="string")return i.push("name must be a string"),S(p,i);if(w.length||i.push("name length must be greater than zero"),w.match(/^\./)&&i.push("name cannot start with a period"),w.match(/^_/)&&i.push("name cannot start with an underscore"),w.trim()!==w&&i.push("name cannot contain leading or trailing spaces"),D.forEach(function(t){w.toLowerCase()===t&&i.push(t+" is a blacklisted name")}),N.forEach(function(t){w.toLowerCase()===t&&p.push(t+" is a core module name")}),w.length>214&&p.push("name can no longer contain more than 214 characters"),w.toLowerCase()!==w&&p.push("name can no longer contain capital letters"),/[~'!()*]/.test(w.split("/").slice(-1)[0])&&p.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(w)!==w){var g=w.match(G);if(g){var h=g[1],l=g[2];if(encodeURIComponent(h)===h&&encodeURIComponent(l)===l)return S(p,i)}i.push("name can only contain URL-friendly characters")}return S(p,i)};U.scopedPackagePattern=G;var S=function(w,p){var i={validForNewPackages:p.length===0&&w.length===0,validForOldPackages:p.length===0,warnings:w,errors:p};return i.warnings.length||delete i.warnings,i.errors.length||delete i.errors,i};return We.exports}var it;function Mt(){return it||(it=1,function(G){var N=Oe&&Oe.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(G,"__esModule",{value:!0}),G.validateName=G.validateNewDid=void 0;const D=De(),U=N(qt()),S=32,w=i=>{if((0,D.toTypeInfo)(i).role!==D.types.RoleType.ROLE_BLOCKLET)throw new Error("Blocklet DID's type must be ROLE_BLOCKLET")};G.validateNewDid=w;const p=(i,{checkDid:g=!0}={})=>{if((0,D.isValid)(i))g&&(0,G.validateNewDid)(i);else{const{validForNewPackages:h,errors:l=[],warnings:t=[]}=(0,U.default)(i);if(!h)throw new Error(l[0]||t[0]);if(i.length>S)throw new Error("Blocklet name is too long")}};G.validateName=p,G.default={validateName:G.validateName,validateNewDid:G.validateNewDid}}(Oe)),Oe}var ot;function zt(){if(ot)return q;ot=1;var G=q&&q.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(q,"__esModule",{value:!0}),q.Joi=q.eventsSchema=q.installBlockletDescriptionSchema=q.installBlockletTitleSchema=q.resourceBundleSchema=q.authConfigSchema=q.cacheableSchema=q.statsSchema=q.titleSchema=q.themeSchema=q.signatureSchema=q.serviceSchema=q.scriptsSchema=q.personSchema=q.navigationSchema=q.navigationItemSchema=q.updateMountPointSchema=q.mountPointSchema=q.logoSchema=q.interfaceSchema=q.environmentNameSchema=q.environmentSchema=q.engineSchema=q.endpointSchema=q.distSchema=q.descriptionSchema=q.createBlockletSchema=q.componentSchema=q.blockletNameSchema=q.blockletMetaSchema=void 0;const N=G(ct),D=G(Ke()),U=G(kt()),S=G(Ot()),w=It(),p=G(Lt),i=dt(),g=De(),h=Nt(),l=pt(),t=Ct(),a=Dt(),n=Mt(),s=gt(),r=U.default.default,c="/.well-known",e=D.default.extend(w.semver).extend(w.semverRange).extend(a.fileExtension).extend(a.didExtension);q.Joi=e;const o=(C,W)=>(0,s.checkLink)(C)?C:W.message(`Invalid navigation link: ${C}
16
16
 
17
17
  A valid navigation link should be a relative url which start with '/' or a absolute url, such as:
18
18
  - /en/home
@@ -26,4 +26,4 @@ A valid navigation id is should follow the rules of javascript variables, such a
26
26
  - foo123
27
27
 
28
28
  see detail in https://www.npmjs.com/package/is-var-name
29
- `),m=e.string().trim().min(1).custom(C=>{if(r(C)>l.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${l.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return C}).meta({className:"TTitle"});q.titleSchema=m;const y=e.string().trim().min(3).max(160).meta({className:"TDescription"});q.descriptionSchema=y;const R=e.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});q.installBlockletTitleSchema=R;const _=e.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});q.installBlockletDescriptionSchema=_;const u=e.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((C,W)=>C.includes(i.WELLKNOWN_BLOCKLET_LOGO_PATH)?W.message(`logo url should not include ${i.WELLKNOWN_BLOCKLET_LOGO_PATH}`):C).meta({className:"TLogo"});q.logoSchema=u;const d=e.string().trim().min(1),v=d.meta({className:"TMountPoint"}).custom((C,W)=>(0,s.isValidUrlPath)(C)?C:W.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));q.mountPointSchema=v;const E=d.meta({className:"TUpdateMountPoint"}).custom(C=>(0,s.urlPathFriendly)(C));q.updateMountPointSchema=E;const k=e.string().custom(C=>((0,n.validateName)(C),C)).meta({className:"TBlockletName"});q.blockletNameSchema=k;const O=[],A=e.string().trim().min(1).max(50).required().custom((C,W)=>C.startsWith("BLOCKLET")&&!O.includes(C)?W.message("Env name can not start with BLOCKLET_"):C.startsWith("COMPONENT")?W.message("Env name can not start with COMPONENT_"):C.startsWith("ABTNODE")?W.message("Env name can not start with ABTNODE_"):/[^\w]/.test(C)?W.message('Env name can include only numbers or letters or "_"'):C).meta({className:"TEnvironmentName",unknownType:"any"});q.environmentNameSchema=A;const I=e.object({name:A.required(),description:e.string().trim().required(),default:e.string().optional().allow("").default(""),required:e.boolean().default(!1),secure:e.boolean().default(!1),validation:e.string().optional(),shared:e.boolean().default(C=>C.secure?!1:void 0)}).custom((C,W)=>C.secure&&C.default?W.message(`Cannot declare default value for secure env ${C.name}`):C).meta({className:"TEnvironment",unknownType:"any"});q.environmentSchema=I;const T=e.object({dev:e.string().trim().min(1),e2eDev:e.string().trim().min(1),preFlight:e.string().trim().min(1),preInstall:e.string().trim().min(1),postInstall:e.string().trim().min(1),preStart:e.string().trim().min(1),postStart:e.string().trim().min(1),preStop:e.string().trim().min(1),preUninstall:e.string().trim().min(1),preConfig:e.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});q.scriptsSchema=T;const F=e.object({name:e.string().required().trim(),config:e.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});q.serviceSchema=F;const K=e.object({type:e.string().trim(!0).min(1).required(),path:e.string().required(),meta:e.object({vcType:e.string(),payable:e.boolean(),params:e.array().items({name:e.string().required().trim(),description:e.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});q.endpointSchema=K;const V=e.string().trim().custom((C,W)=>{const se=C.split("/").filter(Boolean);return se.length===0?W.message("cacheable path must be a valid pathname that is not /"):`/${se.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});q.cacheableSchema=V;const z=e.object({type:e.string().lowercase().valid(...l.BLOCKLET_INTERFACE_TYPES).required(),name:e.string().trim().required(),path:e.string().trim().default("/"),prefix:e.string().trim().min(1).default(l.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:e.number().port().optional(),hostIP:e.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:e.string().lowercase().valid(...l.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:e.alternatives().try(e.string().uppercase().default(l.BLOCKLET_DEFAULT_PORT_NAME),e.object({internal:e.string().uppercase().required(),external:e.number().port().required()})).default(l.BLOCKLET_DEFAULT_PORT_NAME),cacheable:e.array().items(V).unique(),services:e.array().items(F).unique("name"),endpoints:e.array().items(K).unique("type"),pageGroups:e.array().items(e.string().min(1).max(255).trim()).unique(),proxyBehavior:e.string().valid("service","direct").default("service").optional()}).meta({className:"TInterface",unknownType:"any"});q.interfaceSchema=z;const P=e.alternatives().try(e.string().required(),e.object({url:e.string().uri({scheme:["http","https","file"]}).required(),name:k.required(),version:e.alternatives().try(e.string().valid("latest"),e.semverRange().valid())}),e.object({store:e.string().uri({scheme:["http","https"]}).required(),name:k.required(),version:e.alternatives().try(e.string().valid("latest"),e.semverRange().valid()).default("latest")})),X=e.object({platform:e.string().valid(...l.BLOCKLET_PLATFORMS).optional(),interpreter:e.string().valid("binary","node","blocklet","bun").default("node"),source:P,args:e.array().items(e.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});q.engineSchema=X;const Z=e.object({name:e.string().min(1).required(),email:e.string().email({tlds:!1}).optional(),url:e.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});q.personSchema=Z;const J=e.object({tarball:e.alternatives().try(e.string().uri(),e.string()).required(),integrity:e.string().required(),size:e.number().optional()}).meta({className:"TDist",unknownType:"any"});q.distSchema=J;const Q=e.object({downloads:e.number().integer().greater(-1),star:e.number().default(0),purchases:e.number().default(0)}).meta({className:"TStats",unknownType:"any"});q.statsSchema=Q;const ie={source:e.alternatives().try(e.object({url:e.alternatives().try(e.string().uri(),e.array().items(e.string().uri()).min(1)).required(),version:e.alternatives().try(e.string().valid("latest"),e.semverRange().valid())}),e.object({store:e.string().uri({scheme:["http","https"]}),name:k.required(),version:e.alternatives().try(e.string().valid("latest"),e.semverRange().valid()).default("latest")})).required(),required:e.boolean(),title:m,description:y,mountPoint:v,name:k},be=(C,W)=>e.object(C).custom((se,oe)=>!W&&se.source&&se.source.name&&!se.source.store?oe.message(`missing 'store' in source of component ${se.name}`):se),ye=be(ie).meta({className:"TComponent",unknownType:"any"});q.componentSchema=ye;const ae=be(ie,!0),ge=({checkStore:C}={})=>{const W=[ye,ae];return e.array().items(C?W[0]:W[1]).optional().default([])},ee=e.object({type:e.string().required(),name:e.string().required(),signer:e.string().required(),pk:e.string().required(),created:e.string().isoDate().required(),sig:e.string().required(),excludes:e.array().items(e.string()).optional(),appended:e.array().items(e.string()).optional(),delegatee:e.string(),delegateePk:e.string(),delegation:e.string()}).meta({className:"TSignature",unknownType:"any"});q.signatureSchema=ee;const _e=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],Ae={id:e.string().custom(f),title:e.alternatives().try(e.string().min(1).max(l.MAX_TITLE_LENGTH),e.object().min(1).pattern(e.string().valid(..._e),e.string().min(1).max(l.MAX_TITLE_LENGTH))).required(),description:e.alternatives().try(e.string().min(1).max(l.MAX_DESCRIPTION_LENGTH),e.object().min(1).pattern(e.string().valid(..._e),e.string().min(1).max(l.MAX_DESCRIPTION_LENGTH))),link:e.alternatives().try(e.string().custom(o),e.object().min(1).pattern(e.string().valid(..._e),e.string().custom(o))),component:e.string().min(1),section:e.array().items(e.string().valid("header","footer","bottom","social","dashboard","sessionManager","userCenter","bottomNavigation")).single(),role:e.array().items(e.string().min(1)).single(),icon:e.string().min(1),visible:e.boolean(),private:e.boolean()},Ie=e.object({...Ae,items:e.array().items(e.object({...Ae}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});q.navigationItemSchema=Ie;const re=e.array().items(Ie).unique((C,W)=>C.id&&W.id?C.id===W.id:!1).meta({className:"TNavigation",unknownType:"any"});q.navigationSchema=re;const Ee=e.object({background:e.alternatives().try(e.string().min(1),e.object({header:e.string().min(1),footer:e.string().min(1),default:e.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});q.themeSchema=Ee;const je=e.object({whoCanAccess:e.string().valid("owner","invited","all"),profileFields:e.array().items(e.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:e.array().items(e.string().min(1)),allowSwitchProfile:e.boolean(),blockUnauthenticated:e.boolean(),blockUnauthorized:e.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});q.authConfigSchema=je;const Pe=e.object({type:e.string().trim().min(1).required(),description:e.string().trim().min(1)}),Re=e.object({did:e.DID().trim().required(),type:e.string().trim().min(1).required(),public:e.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});q.resourceBundleSchema=Re;const $e=e.array().items(e.object({type:e.string().trim().min(1).max(128).pattern(/^(?!blocklet\.)[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/).message('Event type must be in format of "[noun.]verb" like "post.published" or "post.comment.published", and prefix "blocklet." is reserved').required(),description:e.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});q.eventsSchema=$e;const Te={did:e.DID().trim().required(),version:e.semver().valid().required(),name:e.string().optional(),description:y.required(),group:e.string().valid(...l.BLOCKLET_GROUPS),main:e.string().trim(),title:m.optional().allow(""),logo:e.string().trim().optional(),specVersion:e.semver().valid().gte("1.0.0").optional(),author:Z.optional(),contributors:e.array().items(Z).optional(),maintainers:e.array().items(Z).optional(),community:e.string().uri().optional().allow("").default(""),documentation:e.string().uri().optional().allow("").default(""),homepage:e.string().uri().optional().allow("").default(""),license:e.string().optional().allow("").default(""),support:e.alternatives().try(e.string().uri(),e.string().email({tlds:!1})).optional(),nftFactory:e.DID().optional().allow("").default(""),payment:e.object({price:e.array().max(1).items(e.object({value:e.number().greater(0).required(),address:e.DID().required()})).default([]),share:e.array().max(4).items(e.object({name:e.string().required(),address:e.DID().required(),value:e.number().greater(0).max(1).required()})).default([]).custom(C=>{if(C.length===0)return C;const W=C.reduce((se,oe)=>se+oe.value,0);if(W!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${W}`);return C},"invalid blocklet share"),componentPrice:e.array().items(e.object({parentPriceRange:e.array().items(e.number()).custom((C,W)=>C.length!==2?W.message("length of range should be 2"):C[0]<0?W.message("the first value should not less than 0 in range"):C[1]<=C[0]?W.message("the second value should greater than the first value in range"):C),type:e.string().valid("fixed","percentage").required(),value:e.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:e.alternatives().try(e.string().trim().min(1),e.array().items(e.string().min(1))).optional(),tags:e.alternatives().try(e.string().trim().min(1),e.array().items(e.string().min(1))).optional(),gitHash:e.string().optional().allow(""),repository:e.alternatives().try(e.string().min(1),e.object({type:e.string().valid("git","https","svn").required(),url:e.string().uri().required(),directory:e.string()})).optional(),timeout:e.object({start:e.number().min(10).max(600),script:e.number().min(1).max(1800)}).default({start:60}),requirements:e.object({abtnode:e.semverRange().valid(),server:e.semverRange().valid(),os:e.alternatives().try(e.string().valid("*",...l.BLOCKLET_PLATFORMS),e.array().items(e.string().valid(...l.BLOCKLET_PLATFORMS)).min(1)),cpu:e.alternatives().try(e.string().valid("*",...l.BLOCKLET_ARCHITECTURES),e.array().items(e.string().valid(...l.BLOCKLET_ARCHITECTURES)).min(1)),fuels:e.array().items(e.object({endpoint:e.string().trim().required(),address:e.string().trim(),value:e.string().trim().required(),reason:e.string().trim().required()})),nodejs:e.semverRange().valid(),aigne:e.boolean().optional()}).default({server:l.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:e.array().items(z).unique("name").custom((C,W)=>{if(C.filter(fe=>fe.type===l.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return W.message(`Only one ${l.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const oe=C.filter(fe=>fe.type===l.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const fe of oe)if(!fe.prefix.startsWith(c))return W.message(`Wellknown path prefix must start with: ${c}`);return C}).default([]),environments:e.array().items(I).default([]).optional().custom((C,W)=>{if(C&&C.length){const se=C.filter((oe,fe)=>C.findIndex(xe=>xe.name===oe.name)!==fe);if(se.length)return W.message(`find duplicate environment names ${se.map(oe=>oe.name).join(", ")}`)}return C}),scripts:T,capabilities:e.object({clusterMode:e.boolean(),didSpace:e.string().valid(...Object.values(l.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:e.boolean().default(!0),serverless:e.boolean().optional(),component:e.boolean(),sitemap:e.boolean().optional(),mcp:e.boolean().optional(),singleton:e.boolean().optional()}).default({}),files:e.array().items(e.string().trim()).optional(),resource:e.object({exportApi:e.string().trim(),bundles:e.array().items(Re),types:e.array().items(Pe).max(10)}),engine:e.alternatives().try(X,e.array().items(X)).optional(),screenshots:e.array().items(e.string().min(1)).optional().default([]),videos:e.array().items(e.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:e.string().optional().allow(""),dist:J.optional(),stats:Q.optional(),htmlAst:e.any().optional(),path:e.string().optional(),signatures:e.array().items(ee).optional(),lastPublishedAt:e.string().isoDate().optional().allow(null),components:ge(),navigation:re,theme:Ee,copyright:e.object({owner:e.string().min(1),year:e.alternatives().try(e.string(),e.number())}),bundleName:e.string(),bundleDid:e.DID().trim(),storeId:e.string(),events:$e.optional()},qe=e.object(Te).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});q.blockletMetaSchema=qe;const Le=(C,{ensureFiles:W=!1,ensureDist:se=!1,ensureComponentStore:oe=!0,ensureName:fe=!1,skipValidateDidName:xe=!1,...Me}={})=>((!C||!N.default.existsSync(C))&&(W=!1),e.object({...Te,owner:e.object({avatar:e.string().optional(),did:e.DID().trim().required(),fullName:e.string().trim().required(),email:e.string().optional().allow(null).empty("").default("")}).optional(),logo:W?e.file().trim().exists({baseDir:C}).optional():e.string().trim().optional(),files:e.array().items(W?e.file().exists({baseDir:C,canSkip:(me,ce)=>[l.BLOCKLET_ENTRY_FILE,l.BLOCKLET_BUNDLE_FILE].includes(ce)||(0,S.default)(ce)}):e.string().trim()).optional(),dist:se?J.required():J.optional(),components:ge({checkStore:oe}),name:fe?e.string().optional():e.string().required(),egress:e.boolean().optional().default(!0),docker:h.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...Me}).rename("children","components").custom((me,ce)=>{const{did:ke,name:we,docker:Ne}=me;if(Ne){const{image:$,dockerfile:x,network:j}=Ne;if(!$&&!x)return ce.message("Image or dockerfile must be set");if($&&x)return ce.message("Image and dockerfile cannot be set at the same time");if(j)return ce.message("ExportPorts and network cannot be set at the same time");x&&(me.files||(me.files=[]),me.files.push(x))}let b;if((0,g.isValid)(ke))try{return(0,n.validateNewDid)(ke),me}catch($){b=$}if(we){(0,n.validateName)(we,{checkDid:!xe});const $=(0,t.toBlockletDid)(we);return $!==ke?ce.message(`The did of name "${we}" should be "${$}"`):me}return b?ce.message(b.message):me}));return q.createBlockletSchema=Le,q.default={blockletNameSchema:k,componentSchema:ye,endpointSchema:K,serviceSchema:F,createBlockletSchema:Le,interfaceSchema:z,environmentSchema:I,environmentNameSchema:A,scriptsSchema:T,personSchema:Z,distSchema:J,titleSchema:m,descriptionSchema:y,logoSchema:u,navigationSchema:re,themeSchema:Ee,mountPointSchema:v,updateMountPointSchema:E,authConfigSchema:je,resourceBundleSchema:Re,installBlockletTitleSchema:R,installBlockletDescriptionSchema:_,eventsSchema:$e,Joi:e},q}function Ft({onClick:G}){const{t:N}=yt();return He.jsx(vt,{title:N("launchBlocklet.withoutWallet"),icon:He.jsx(bt,{icon:_t,fontSize:"1em"}),onClick:G})}Ft.propTypes={onClick:wt.func.isRequired};export{Ft as W,Mt as a,ct as b,zt as r};
29
+ `),m=e.string().trim().min(1).custom(C=>{if(r(C)>l.MAX_TITLE_LENGTH)throw new Error(`title length should not exceed ${l.MAX_TITLE_LENGTH} (see: https://www.npmjs.com/package/cjk-length)`);return C}).meta({className:"TTitle"});q.titleSchema=m;const y=e.string().trim().min(3).max(160).meta({className:"TDescription"});q.descriptionSchema=y;const R=e.string().trim().min(3).max(20).messages({"*":"Title length must be between 3 and 20 characters"}).meta({className:"TInstallBlockletTitle"});q.installBlockletTitleSchema=R;const _=e.string().trim().min(3).max(80).messages({"*":"Description length must be between 3 and 80 characters"}).meta({className:"TInstallBlockletDescription"});q.installBlockletDescriptionSchema=_;const u=e.string().uri({scheme:["http","https"],allowRelative:!0}).allow("").custom((C,W)=>C.includes(i.WELLKNOWN_BLOCKLET_LOGO_PATH)?W.message(`logo url should not include ${i.WELLKNOWN_BLOCKLET_LOGO_PATH}`):C).meta({className:"TLogo"});q.logoSchema=u;const d=e.string().trim().min(1),v=d.meta({className:"TMountPoint"}).custom((C,W)=>(0,s.isValidUrlPath)(C)?C:W.message(`mountPoint cannot contain such characters space $*+~()'"!:@\\`));q.mountPointSchema=v;const E=d.meta({className:"TUpdateMountPoint"}).custom(C=>(0,s.urlPathFriendly)(C));q.updateMountPointSchema=E;const k=e.string().custom(C=>((0,n.validateName)(C),C)).meta({className:"TBlockletName"});q.blockletNameSchema=k;const O=[],A=e.string().trim().min(1).max(50).required().custom((C,W)=>C.startsWith("BLOCKLET")&&!O.includes(C)?W.message("Env name can not start with BLOCKLET_"):C.startsWith("COMPONENT")?W.message("Env name can not start with COMPONENT_"):C.startsWith("ABTNODE")?W.message("Env name can not start with ABTNODE_"):/[^\w]/.test(C)?W.message('Env name can include only numbers or letters or "_"'):C).meta({className:"TEnvironmentName",unknownType:"any"});q.environmentNameSchema=A;const I=e.object({name:A.required(),description:e.string().trim().required(),default:e.string().optional().allow("").default(""),required:e.boolean().default(!1),secure:e.boolean().default(!1),validation:e.string().optional(),shared:e.boolean().default(C=>C.secure?!1:void 0)}).custom((C,W)=>C.secure&&C.default?W.message(`Cannot declare default value for secure env ${C.name}`):C).meta({className:"TEnvironment",unknownType:"any"});q.environmentSchema=I;const T=e.object({dev:e.string().trim().min(1),e2eDev:e.string().trim().min(1),preFlight:e.string().trim().min(1),preInstall:e.string().trim().min(1),postInstall:e.string().trim().min(1),preStart:e.string().trim().min(1),postStart:e.string().trim().min(1),preStop:e.string().trim().min(1),preUninstall:e.string().trim().min(1),preConfig:e.string().trim().min(1)}).rename("pre-flight","preFlight").rename("pre-install","preInstall").rename("post-install","postInstall").rename("pre-start","preStart").rename("post-start","postStart").rename("pre-stop","preStop").rename("pre-uninstall","preUninstall").rename("pre-config","preConfig").optional().meta({className:"TScripts",unknownType:"any"});q.scriptsSchema=T;const F=e.object({name:e.string().required().trim(),config:e.object().optional().default({})}).unknown(!0).meta({className:"TService",unknownType:"any"});q.serviceSchema=F;const K=e.object({type:e.string().trim(!0).min(1).required(),path:e.string().required(),meta:e.object({vcType:e.string(),payable:e.boolean(),params:e.array().items({name:e.string().required().trim(),description:e.string().required().trim()})})}).meta({className:"TEndpoint",unknownType:"any"});q.endpointSchema=K;const V=e.string().trim().custom((C,W)=>{const se=C.split("/").filter(Boolean);return se.length===0?W.message("cacheable path must be a valid pathname that is not /"):`/${se.join("/")}`}).meta({className:"TPathPrefix",unknownType:"any"});q.cacheableSchema=V;const z=e.object({type:e.string().lowercase().valid(...l.BLOCKLET_INTERFACE_TYPES).required(),name:e.string().trim().required(),path:e.string().trim().default("/"),prefix:e.string().trim().min(1).default(l.BLOCKLET_DYNAMIC_PATH_PREFIX),containerPort:e.number().port().optional(),hostIP:e.string().trim().ip({version:["ipv4","ipv6"]}).optional(),protocol:e.string().lowercase().valid(...l.BLOCKLET_INTERFACE_PROTOCOLS).default("http"),port:e.alternatives().try(e.string().uppercase().default(l.BLOCKLET_DEFAULT_PORT_NAME),e.object({internal:e.string().uppercase().required(),external:e.number().port().required()})).default(l.BLOCKLET_DEFAULT_PORT_NAME),cacheable:e.array().items(V).unique(),services:e.array().items(F).unique("name"),endpoints:e.array().items(K).unique("type"),pageGroups:e.array().items(e.string().min(1).max(255).trim()).unique(),proxyBehavior:e.string().valid("service","direct").default("service").optional()}).meta({className:"TInterface",unknownType:"any"});q.interfaceSchema=z;const P=e.alternatives().try(e.string().required(),e.object({url:e.string().uri({scheme:["http","https","file"]}).required(),name:k.required(),version:e.alternatives().try(e.string().valid("latest"),e.semverRange().valid())}),e.object({store:e.string().uri({scheme:["http","https"]}).required(),name:k.required(),version:e.alternatives().try(e.string().valid("latest"),e.semverRange().valid()).default("latest")})),X=e.object({platform:e.string().valid(...l.BLOCKLET_PLATFORMS).optional(),interpreter:e.string().valid("binary","node","blocklet","bun").default("node"),source:P,args:e.array().items(e.string()).optional().default([])}).meta({className:"TEngine",unknownType:"any"});q.engineSchema=X;const Z=e.object({name:e.string().min(1).required(),email:e.string().email({tlds:!1}).optional(),url:e.string().uri().optional()}).meta({className:"TPerson",unknownType:"any"});q.personSchema=Z;const J=e.object({tarball:e.alternatives().try(e.string().uri(),e.string()).required(),integrity:e.string().required(),size:e.number().optional()}).meta({className:"TDist",unknownType:"any"});q.distSchema=J;const Q=e.object({downloads:e.number().integer().greater(-1),star:e.number().default(0),purchases:e.number().default(0)}).meta({className:"TStats",unknownType:"any"});q.statsSchema=Q;const ie={source:e.alternatives().try(e.object({url:e.alternatives().try(e.string().uri(),e.array().items(e.string().uri()).min(1)).required(),version:e.alternatives().try(e.string().valid("latest"),e.semverRange().valid())}),e.object({store:e.string().uri({scheme:["http","https"]}),name:k.required(),version:e.alternatives().try(e.string().valid("latest"),e.semverRange().valid()).default("latest")})).required(),required:e.boolean(),title:m,description:y,mountPoint:v,name:k},be=(C,W)=>e.object(C).custom((se,oe)=>!W&&se.source&&se.source.name&&!se.source.store?oe.message(`missing 'store' in source of component ${se.name}`):se),ye=be(ie).meta({className:"TComponent",unknownType:"any"});q.componentSchema=ye;const ae=be(ie,!0),ge=({checkStore:C}={})=>{const W=[ye,ae];return e.array().items(C?W[0]:W[1]).optional().default([])},ee=e.object({type:e.string().required(),name:e.string().required(),signer:e.string().required(),pk:e.string().required(),created:e.string().isoDate().required(),sig:e.string().required(),excludes:e.array().items(e.string()).optional(),appended:e.array().items(e.string()).optional(),delegatee:e.string(),delegateePk:e.string(),delegation:e.string()}).meta({className:"TSignature",unknownType:"any"});q.signatureSchema=ee;const _e=["en","zh","fr","ru","ar","es","de","pt","ja","hi"],Ae={id:e.string().custom(f),title:e.alternatives().try(e.string().min(1).max(l.MAX_TITLE_LENGTH),e.object().min(1).pattern(e.string().valid(..._e),e.string().min(1).max(l.MAX_TITLE_LENGTH))).required(),description:e.alternatives().try(e.string().min(1).max(l.MAX_DESCRIPTION_LENGTH),e.object().min(1).pattern(e.string().valid(..._e),e.string().min(1).max(l.MAX_DESCRIPTION_LENGTH))),link:e.alternatives().try(e.string().custom(o),e.object().min(1).pattern(e.string().valid(..._e),e.string().custom(o))),component:e.string().min(1),section:e.array().items(e.string().valid("header","footer","bottom","social","dashboard","sessionManager","userCenter","bottomNavigation")).single(),role:e.array().items(e.string().min(1)).single(),icon:e.string().min(1),visible:e.boolean(),private:e.boolean()},Ie=e.object({...Ae,items:e.array().items(e.object({...Ae}).rename("child","component"))}).rename("child","component").meta({className:"TNavigationItem",unknownType:"any"});q.navigationItemSchema=Ie;const re=e.array().items(Ie).unique((C,W)=>C.id&&W.id?C.id===W.id:!1).meta({className:"TNavigation",unknownType:"any"});q.navigationSchema=re;const Ee=e.object({background:e.alternatives().try(e.string().min(1),e.object({header:e.string().min(1),footer:e.string().min(1),default:e.string().min(1)}).min(1))}).meta({className:"TTheme",unknownType:"any"});q.themeSchema=Ee;const je=e.object({whoCanAccess:e.string().valid("owner","invited","all"),profileFields:e.array().items(e.string().valid("fullName","email","avatar","phone")).unique(),ignoreUrls:e.array().items(e.string().min(1)),allowSwitchProfile:e.boolean(),blockUnauthenticated:e.boolean(),blockUnauthorized:e.boolean()}).options({stripUnknown:!0}).meta({className:"TAuthConfig",unknownType:"any"});q.authConfigSchema=je;const Pe=e.object({type:e.string().trim().min(1).required(),description:e.string().trim().min(1)}),Re=e.object({did:e.DID().trim().required(),type:e.string().trim().min(1).required(),public:e.boolean()}).meta({className:"TResourceBundle",unknownType:"any"});q.resourceBundleSchema=Re;const $e=e.array().items(e.object({type:e.string().trim().min(1).max(128).pattern(/^(?!blocklet\.)[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/).message('Event type must be in format of "[noun.]verb" like "post.published" or "post.comment.published", and prefix "blocklet." is reserved').required(),description:e.string().trim().min(1).max(256).required()})).unique("type").meta({className:"TEvent",unknownType:"any"});q.eventsSchema=$e;const Te={did:e.DID().trim().required(),version:e.semver().valid().required(),name:e.string().optional(),description:y.required(),group:e.string().valid(...l.BLOCKLET_GROUPS),main:e.string().trim(),title:m.optional().allow(""),logo:e.string().trim().optional(),specVersion:e.semver().valid().gte("1.0.0").optional(),author:Z.optional(),contributors:e.array().items(Z).optional(),maintainers:e.array().items(Z).optional(),community:e.string().uri().optional().allow("").default(""),documentation:e.string().uri().optional().allow("").default(""),homepage:e.string().uri().optional().allow("").default(""),license:e.string().optional().allow("").default(""),support:e.alternatives().try(e.string().uri(),e.string().email({tlds:!1})).optional(),nftFactory:e.DID().optional().allow("").default(""),payment:e.object({price:e.array().max(1).items(e.object({value:e.number().greater(0).required(),address:e.DID().required()})).default([]),share:e.array().max(4).items(e.object({name:e.string().required(),address:e.DID().required(),value:e.number().greater(0).max(1).required()})).default([]).custom(C=>{if(C.length===0)return C;const W=C.reduce((se,oe)=>se+oe.value,0);if(W!==1)throw new Error(`Invalid blocklet payment share config: total share must be 1, got ${W}`);return C},"invalid blocklet share"),componentPrice:e.array().items(e.object({parentPriceRange:e.array().items(e.number()).custom((C,W)=>C.length!==2?W.message("length of range should be 2"):C[0]<0?W.message("the first value should not less than 0 in range"):C[1]<=C[0]?W.message("the second value should greater than the first value in range"):C),type:e.string().valid("fixed","percentage").required(),value:e.number().greater(0).required()})).single()}).default({price:[],share:[]}),keywords:e.alternatives().try(e.string().trim().min(1),e.array().items(e.string().min(1))).optional(),tags:e.alternatives().try(e.string().trim().min(1),e.array().items(e.string().min(1))).optional(),gitHash:e.string().optional().allow(""),repository:e.alternatives().try(e.string().min(1),e.object({type:e.string().valid("git","https","svn").required(),url:e.string().uri().required(),directory:e.string()})).optional(),timeout:e.object({start:e.number().min(10).max(600),script:e.number().min(1).max(1800)}).default({start:60}),requirements:e.object({abtnode:e.semverRange().valid(),server:e.semverRange().valid(),os:e.alternatives().try(e.string().valid("*",...l.BLOCKLET_PLATFORMS),e.array().items(e.string().valid(...l.BLOCKLET_PLATFORMS)).min(1)),cpu:e.alternatives().try(e.string().valid("*",...l.BLOCKLET_ARCHITECTURES),e.array().items(e.string().valid(...l.BLOCKLET_ARCHITECTURES)).min(1)),fuels:e.array().items(e.object({endpoint:e.string().trim().required(),address:e.string().trim(),value:e.string().trim().required(),reason:e.string().trim().required()})),nodejs:e.semverRange().valid(),aigne:e.boolean().optional()}).default({server:l.BLOCKLET_LATEST_REQUIREMENT_SERVER,os:"*",cpu:"*",nodejs:"*"}),interfaces:e.array().items(z).unique("name").custom((C,W)=>{if(C.filter(ue=>ue.type===l.BLOCKLET_INTERFACE_TYPE_WEB).length>1)return W.message(`Only one ${l.BLOCKLET_INTERFACE_TYPE_WEB} interface can be declared`);const oe=C.filter(ue=>ue.type===l.BLOCKLET_INTERFACE_TYPE_WELLKNOWN);for(const ue of oe)if(!ue.prefix.startsWith(c))return W.message(`Wellknown path prefix must start with: ${c}`);return C}).default([]),environments:e.array().items(I).default([]).optional().custom((C,W)=>{if(C&&C.length){const se=C.filter((oe,ue)=>C.findIndex(xe=>xe.name===oe.name)!==ue);if(se.length)return W.message(`find duplicate environment names ${se.map(oe=>oe.name).join(", ")}`)}return C}),scripts:T,capabilities:e.object({clusterMode:e.boolean(),didSpace:e.string().valid(...Object.values(l.BLOCKLET_APP_SPACE_REQUIREMENT)).optional(),navigation:e.boolean().default(!0),serverless:e.boolean().optional(),component:e.boolean(),sitemap:e.boolean().optional(),mcp:e.boolean().optional(),singleton:e.boolean().optional()}).default({}),files:e.array().items(e.string().trim()).optional(),resource:e.object({exportApi:e.string().trim(),bundles:e.array().items(Re),types:e.array().items(Pe).max(10)}),engine:e.alternatives().try(X,e.array().items(X)).optional(),screenshots:e.array().items(e.string().min(1)).optional().default([]),videos:e.array().items(e.string().pattern(/^https:\/\/(www\.)?(youtube\.com|youtu\.be|vimeo\.com)\/[\w\-/?&=]+/).message("Each video URL must be a valid YouTube or Vimeo link")).max(3).optional(),logoUrl:e.string().optional().allow(""),dist:J.optional(),stats:Q.optional(),htmlAst:e.any().optional(),path:e.string().optional(),signatures:e.array().items(ee).optional(),lastPublishedAt:e.string().isoDate().optional().allow(null),components:ge(),navigation:re,theme:Ee,copyright:e.object({owner:e.string().min(1),year:e.alternatives().try(e.string(),e.number())}),bundleName:e.string(),bundleDid:e.DID().trim(),storeId:e.string(),events:$e.optional()},qe=e.object(Te).options({stripUnknown:!0,noDefaults:!1}).meta({className:"TBlockletMeta",unknownType:"any"});q.blockletMetaSchema=qe;const Le=(C,{ensureFiles:W=!1,ensureDist:se=!1,ensureComponentStore:oe=!0,ensureName:ue=!1,skipValidateDidName:xe=!1,...Me}={})=>((!C||!N.default.existsSync(C))&&(W=!1),e.object({...Te,owner:e.object({avatar:e.string().optional(),did:e.DID().trim().required(),fullName:e.string().trim().required(),email:e.string().optional().allow(null).empty("").default("")}).optional(),logo:W?e.file().trim().exists({baseDir:C}).optional():e.string().trim().optional(),files:e.array().items(W?e.file().exists({baseDir:C,canSkip:(me,fe)=>[l.BLOCKLET_ENTRY_FILE,l.BLOCKLET_BUNDLE_FILE].includes(fe)||(0,S.default)(fe)}):e.string().trim()).optional(),dist:se?J.required():J.optional(),components:ge({checkStore:oe}),name:ue?e.string().optional():e.string().required(),egress:e.boolean().optional().default(!0),docker:h.dockerSchema}).options({stripUnknown:!0,noDefaults:!1,...Me}).rename("children","components").custom((me,fe)=>{const{did:ke,name:we,docker:Ne}=me;if(Ne){const{image:$,dockerfile:x,network:j}=Ne;if($&&x)return fe.message("Image and dockerfile cannot be set at the same time");if(j)return fe.message("ExportPorts and network cannot be set at the same time");x&&(me.files||(me.files=[]),me.files.push(x))}let b;if((0,g.isValid)(ke))try{return(0,n.validateNewDid)(ke),me}catch($){b=$}if(we){(0,n.validateName)(we,{checkDid:!xe});const $=(0,t.toBlockletDid)(we);return $!==ke?fe.message(`The did of name "${we}" should be "${$}"`):me}return b?fe.message(b.message):me}));return q.createBlockletSchema=Le,q.default={blockletNameSchema:k,componentSchema:ye,endpointSchema:K,serviceSchema:F,createBlockletSchema:Le,interfaceSchema:z,environmentSchema:I,environmentNameSchema:A,scriptsSchema:T,personSchema:Z,distSchema:J,titleSchema:m,descriptionSchema:y,logoSchema:u,navigationSchema:re,themeSchema:Ee,mountPointSchema:v,updateMountPointSchema:E,authConfigSchema:je,resourceBundleSchema:Re,installBlockletTitleSchema:R,installBlockletDescriptionSchema:_,eventsSchema:$e,Joi:e},q}function Ft({onClick:G}){const{t:N}=yt();return He.jsx(vt,{title:N("launchBlocklet.withoutWallet"),icon:He.jsx(bt,{icon:_t,fontSize:"1em"}),onClick:G})}Ft.propTypes={onClick:wt.func.isRequired};export{Ft as W,Mt as a,ct as b,zt as r};