@abtnode/blocklet-services 1.16.43-beta-20250507-124320-c405ab23 → 1.16.43-beta-20250508-132430-79f0da2d

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 (218) hide show
  1. package/api/emails/_components/activity.js +31 -0
  2. package/api/emails/_components/content.js +3 -2
  3. package/api/emails/_templates/activity-notification.js +23 -0
  4. package/api/libs/email.js +50 -14
  5. package/api/services/auth/session.js +23 -4
  6. package/dist/assets/{AdapterDayjs-QizZbjYO.js → AdapterDayjs-DdJ4VT-y.js} +1 -1
  7. package/dist/assets/{ArrowDropDown-CDVfAOPe.js → ArrowDropDown-eLxSrK0e.js} +1 -1
  8. package/dist/assets/{CheckCircle-CJmQq3zs.js → CheckCircle-DxRgzKvx.js} +1 -1
  9. package/dist/assets/{ChevronLeft-BWWdEYiT.js → ChevronLeft-B15pinY6.js} +1 -1
  10. package/dist/assets/{ChevronRight-tpAiXojW.js → ChevronRight-B2sjje0T.js} +1 -1
  11. package/dist/assets/{Community-CGFOsRKB.js → Community-HWgwjOzD.js} +1 -1
  12. package/dist/assets/{DeleteOutline-DqdSj9ec.js → DeleteOutline-DYyAnzFX.js} +1 -1
  13. package/dist/assets/{Done-DtZ1RTXT.js → Done-CiSqPhhR.js} +1 -1
  14. package/dist/assets/{Download-CC6n4Puh.js → Download-Zxb7WMKn.js} +1 -1
  15. package/dist/assets/{Edit-CJyJLpRB.js → Edit-RoUmIPTL.js} +1 -1
  16. package/dist/assets/{EditIcon-KKx_adUe.js → EditIcon-_JnvyTnF.js} +1 -1
  17. package/dist/assets/{Email-CXOl4bM_.js → Email-22EBBQEA.js} +1 -1
  18. package/dist/assets/{Error-BfFrp5Y1.js → Error-C782OBuj.js} +1 -1
  19. package/dist/assets/{ExpandLess-Ddif_UHH.js → ExpandLess-CJztBroj.js} +1 -1
  20. package/dist/assets/{Google-DMO1DD8q.js → Google-DwaWO1n0.js} +1 -1
  21. package/dist/assets/{Holiday-B4FuMZHi.js → Holiday-Lj9LTNQ5.js} +1 -1
  22. package/dist/assets/{InfoOutlined-CoMCPk7a.js → InfoOutlined-BCqZENBx.js} +1 -1
  23. package/dist/assets/{Launch-DNHBfbtb.js → Launch-BbLsJvEN.js} +1 -1
  24. package/dist/assets/{LaunchOutlined-CypNgDc2.js → LaunchOutlined-BdTDYYqz.js} +1 -1
  25. package/dist/assets/{Location-afhZgOLn.js → Location-R9yMI3QX.js} +1 -1
  26. package/dist/assets/{LockIcon-BlopdQoN.js → LockIcon-DEqu2BZe.js} +1 -1
  27. package/dist/assets/{Meeting-Ct6JoGYc.js → Meeting-CYNfXiDR.js} +1 -1
  28. package/dist/assets/{MoreHoriz-D6Wvugul.js → MoreHoriz-Bp9phGCA.js} +1 -1
  29. package/dist/assets/{OffSick-CT2gezXK.js → OffSick-BWarRVS4.js} +1 -1
  30. package/dist/assets/{Phone-alkdVkQC.js → Phone-Df90pdBA.js} +1 -1
  31. package/dist/assets/{PlayArrow-gSxq4eiM.js → PlayArrow-qTn22j6x.js} +1 -1
  32. package/dist/assets/{QuestionMarkCircle-DK54eXUx.js → QuestionMarkCircle-DV5837_n.js} +1 -1
  33. package/dist/assets/{ServerLogo-b4GZ-IpN.js → ServerLogo-7OspbhQZ.js} +1 -1
  34. package/dist/assets/{Timezone-6KelONy7.js → Timezone-BfjUkoy7.js} +1 -1
  35. package/dist/assets/{TuneOutlined-D2mm0fk8.js → TuneOutlined-BkH0zJXZ.js} +1 -1
  36. package/dist/assets/{ViewList-wWyYUeZC.js → ViewList-BBNBkCo1.js} +1 -1
  37. package/dist/assets/{WorkingRemotely-qYwywlWG.js → WorkingRemotely-C3lk6KRk.js} +1 -1
  38. package/dist/assets/access-control-DVj3Uudk.js +14 -0
  39. package/dist/assets/{actions-CHh4ckCh.js → actions-CcV0Tb1p.js} +1 -1
  40. package/dist/assets/{add-component-core-BxQ8IvTn.js → add-component-core-BxVPX1qJ.js} +13 -13
  41. package/dist/assets/{add-resource-CyKCNshd.js → add-resource-CR93luK2.js} +1 -1
  42. package/dist/assets/{addon-CxsW-e44.js → addon-igarTbiO.js} +1 -1
  43. package/dist/assets/advanced-C22Mc4mt.js +14 -0
  44. package/dist/assets/api-DPHyou8y.js +1 -0
  45. package/dist/assets/{appearance-jvoZTz94.js → appearance-CuEL_wAd.js} +1 -1
  46. package/dist/assets/{audit-logs-Bw0__Kyr.js → audit-logs-DXfN0Akp.js} +2 -2
  47. package/dist/assets/{authorize-BROUnOQh.js → authorize-DyX7LBCN.js} +1 -1
  48. package/dist/assets/{base32-M2-tdl6O.js → base32-sa8QWx2s.js} +1 -1
  49. package/dist/assets/{branding-DFP3MWL7.js → branding-B8w6MlXP.js} +2 -2
  50. package/dist/assets/{branding-DEzRXw2N.js → branding-CVWmoAus.js} +1 -1
  51. package/dist/assets/bundle-avatar-DJNl27pn.js +1 -0
  52. package/dist/assets/button-D0USBc4l.js +1 -0
  53. package/dist/assets/{click-to-copy-BxPDzy5A.js → click-to-copy-Dhxc_blG.js} +1 -1
  54. package/dist/assets/cloneDeep-DBPWtvi_.js +1 -0
  55. package/dist/assets/{complete-BoUxpUyG.js → complete-jXf2IsN1.js} +3 -3
  56. package/dist/assets/{component-C0TbBOxr.js → component-DFHLfmfe.js} +1 -1
  57. package/dist/assets/{config-quCUUlRH.js → config-DIa982AP.js} +1 -1
  58. package/dist/assets/{config-cqUeiJ9T.js → config-E-Dkdpbo.js} +2 -2
  59. package/dist/assets/{config-navigation-BE8cOsAr.js → config-navigation-BbbAAFTA.js} +3 -3
  60. package/dist/assets/config-space-B3L4cc62.js +1 -0
  61. package/dist/assets/confirm-CHZbNj0g.js +7 -0
  62. package/dist/assets/connect-60F826H5.js +1 -0
  63. package/dist/assets/connect-to-Do1R8dL3.js +1 -0
  64. package/dist/assets/connect-xMiXau0y.js +5 -0
  65. package/dist/assets/{content-layout-qHJyxPYq.js → content-layout-clTZd0qL.js} +1 -1
  66. package/dist/assets/dashboard-BjhEdRo6.js +280 -0
  67. package/dist/assets/{delete-confirm-D1Xe3pLh.js → delete-confirm-D-jVITSf.js} +1 -1
  68. package/dist/assets/did-address-anPrguG7.js +1 -0
  69. package/dist/assets/domain-CYWI_G__.js +9 -0
  70. package/dist/assets/{domain-action-card-CkNEkjHm.js → domain-action-card-CDfoYMjV.js} +2 -2
  71. package/dist/assets/domains-D-YYFzTK.js +1 -0
  72. package/dist/assets/dot-Bc3KtmUA.js +7 -0
  73. package/dist/assets/{email-D4hA0NBb.js → email-CQL_CvUV.js} +2 -2
  74. package/dist/assets/{empty-spinner-Bx6dYuKk.js → empty-spinner-Bm-LVesB.js} +1 -1
  75. package/dist/assets/exchange-passport-nsHr64lM.js +1 -0
  76. package/dist/assets/{fuel-DLt1un1y.js → fuel-BEbwZqYG.js} +1 -1
  77. package/dist/assets/{gen-access-key-B3TK0S95.js → gen-access-key-DsEy5ZlI.js} +1 -1
  78. package/dist/assets/get-safe-url-CH0a4wzx.js +1 -0
  79. package/dist/assets/get-safe-url-Cn647BYQ.js +1 -0
  80. package/dist/assets/{home-CM-H3jsN.js → home-DUvgZ0gR.js} +1 -1
  81. package/dist/assets/iframe-D7qMCC0L.js +1 -0
  82. package/dist/assets/{index--MMFwLMX.js → index-0ncGiO4u.js} +1 -1
  83. package/dist/assets/{index-Cv_RcwHF.js → index-B1yanBlZ.js} +1 -1
  84. package/dist/assets/{index-Dz5GK-zs.js → index-B6vKQTr4.js} +1 -1
  85. package/dist/assets/{index-hOO84dse.js → index-BJfBmMvG.js} +1 -1
  86. package/dist/assets/{index-B9ltKwuq.js → index-BUwaZJ5Y.js} +32 -32
  87. package/dist/assets/{index-CYBG7pwa.js → index-BmpX2Oqa.js} +2 -2
  88. package/dist/assets/{index-ChWzsQ7e.js → index-Bpz-SuLt.js} +4 -4
  89. package/dist/assets/{index-DisBCigl.js → index-CYz41Upz.js} +1 -1
  90. package/dist/assets/{index-b5IHPDP2.js → index-CZqp_6Zr.js} +14 -14
  91. package/dist/assets/{index-DODYa3Im.js → index-CiWjpC34.js} +1 -1
  92. package/dist/assets/index-Ctbrsvlm.js +113 -0
  93. package/dist/assets/{index-guZXH6v0.js → index-DBajhv2h.js} +18 -18
  94. package/dist/assets/{index-DF637rKa.js → index-DFkZuM1_.js} +1 -1
  95. package/dist/assets/{index-DHkSP6Is.js → index-DQncaTCr.js} +9 -9
  96. package/dist/assets/index-DZ9Jqm_w.js +141 -0
  97. package/dist/assets/index-DiZbt9Ww.js +161 -0
  98. package/dist/assets/{index-3mcmABlM.js → index-DyU89GO9.js} +1 -1
  99. package/dist/assets/index-OVTGvi9j.js +55 -0
  100. package/dist/assets/index-Pu5My3eU.js +1 -0
  101. package/dist/assets/{index-MN19wC90.js → index-egCz4jdE.js} +1 -1
  102. package/dist/assets/{index-D7lbThr3.js → index-hgktawrH.js} +7 -7
  103. package/dist/assets/{index-DzlQfRxQ.js → index-iTlCZ1FK.js} +2 -2
  104. package/dist/assets/index-pvu3nbgn.js +10 -0
  105. package/dist/assets/{index-DY3sJM14.js → index-w68bai-3.js} +1 -1
  106. package/dist/assets/{invitation-V9dvI_l-.js → invitation-DqKIvv6t.js} +4 -4
  107. package/dist/assets/invite-uMWH0SpB.js +1 -0
  108. package/dist/assets/{issue-passport-DHlsRvAU.js → issue-passport-BurnsPQZ.js} +1 -1
  109. package/dist/assets/item-C69diC1y.js +2 -0
  110. package/dist/assets/landing-page-CUkHfAZ5.js +1 -0
  111. package/dist/assets/{launch-result-message-DucKBLPI.js → launch-result-message-CiDoyZ_1.js} +1 -1
  112. package/dist/assets/{layout-D5xp7LhQ.js → layout-CLOmXrMq.js} +1 -1
  113. package/dist/assets/list-D69IwVXI.js +236 -0
  114. package/dist/assets/{list-header-jygAFPJa.js → list-header-D9r1Z68x.js} +1 -1
  115. package/dist/assets/localization-CAh5vCty.js +1 -0
  116. package/dist/assets/{log-CXoK__fA.js → log-CskQJ4o-.js} +1 -1
  117. package/dist/assets/{logger-hgBwjvHi.js → logger-D6jfI5U_.js} +1 -1
  118. package/dist/assets/login-DWvvPy3b.js +1 -0
  119. package/dist/assets/{login-oauth-callback-BdgRJj-p.js → login-oauth-callback-gLyMSemT.js} +1 -1
  120. package/dist/assets/{logo-uploader-50bLEHwJ.js → logo-uploader-D5rcqbIA.js} +3 -3
  121. package/dist/assets/{lost-passport-BKKp14el.js → lost-passport-BWY_TJIl.js} +2 -2
  122. package/dist/assets/omit-CM6MPIu5.js +1 -0
  123. package/dist/assets/{open-window-D__BoNEX.js → open-window-DKiwPBLK.js} +1 -1
  124. package/dist/assets/{overview-CrfEBdKU.js → overview-DedgPJyh.js} +2 -2
  125. package/dist/assets/{page-header-Kn6r_XKH.js → page-header-D7vhn9dN.js} +1 -1
  126. package/dist/assets/{passport-item-B_2v7D20.js → passport-item-B45OGe4c.js} +1 -1
  127. package/dist/assets/payment-kit-DYSjmihw.png +0 -0
  128. package/dist/assets/{permission-CC2IdTdZ.js → permission-6aZ4MNgh.js} +1 -1
  129. package/dist/assets/preferences-DU_A8Q43.js +1 -0
  130. package/dist/assets/profile-embed-B8hvxRm0.js +1 -0
  131. package/dist/assets/publish-resource-riTnsr3y.js +1 -0
  132. package/dist/assets/{react-beautiful-dnd.esm-djvJS7-9.js → react-beautiful-dnd.esm-DPnGSgvn.js} +1 -1
  133. package/dist/assets/relative-time-CKENJIpb.js +1 -0
  134. package/dist/assets/{runtime-C6Oj0Mr3.js → runtime-Dfcxeun4.js} +1 -1
  135. package/dist/assets/sdk-DUAPwTSQ.js +1 -0
  136. package/dist/assets/{security-CqxS0KtD.js → security-zb06EOxl.js} +4 -4
  137. package/dist/assets/session-Ir9UAnhf.js +1 -0
  138. package/dist/assets/setup-Pi8eih8l.js +30 -0
  139. package/dist/assets/{shorten-label-BhyIJhRI.js → shorten-label-DTcisg7Q.js} +1 -1
  140. package/dist/assets/{simple-select-CF7l1q3Q.js → simple-select-DpNtA3N5.js} +1 -1
  141. package/dist/assets/{slicedToArray-D2u5vDM0.js → slicedToArray-CM_xB2K2.js} +1 -1
  142. package/dist/assets/{spaces-U3nGmGRa.js → spaces-DfgQftqB.js} +1 -1
  143. package/dist/assets/start-CnF5I9iM.js +187 -0
  144. package/dist/assets/{starting-progress-BhqlnMjX.js → starting-progress-CUkPGiLq.js} +1 -1
  145. package/dist/assets/{status-C2R9Wncp.js → status-w7wNdwd8.js} +1 -1
  146. package/dist/assets/{step-actions-DTD9vsMp.js → step-actions-CvAYbv4K.js} +1 -1
  147. package/dist/assets/{studio-DdhbfCKD.js → studio-mvCiDQFy.js} +1 -1
  148. package/dist/assets/{switch-control-CvOsxpit.js → switch-control-BP0JyiwP.js} +1 -1
  149. package/dist/assets/{traffic-BppWD3GK.js → traffic-Bo3Bp96o.js} +1 -1
  150. package/dist/assets/{transfer-BreEw1xj.js → transfer-DsERsnl1.js} +1 -1
  151. package/dist/assets/unsubscribe-l6QkVxmr.js +1 -0
  152. package/dist/assets/use-blocklet-logo-BiDCl8v3.js +2 -0
  153. package/dist/assets/{use-mobile-DbhbAmWG.js → use-mobile-BleYjZfN.js} +1 -1
  154. package/dist/assets/{use-mobile-fdqINXKQ.js → use-mobile-BnYZ5d8f.js} +1 -1
  155. package/dist/assets/useAsync-BTtZas5A.js +1 -0
  156. package/dist/assets/{useLocalStorage-vveKfojd.js → useLocalStorage-C7usthsI.js} +1 -1
  157. package/dist/assets/user-center-CSjvhqGU.js +76 -0
  158. package/dist/assets/{util-D5pnqiqz.js → util-CKfiFLd5.js} +1 -1
  159. package/dist/assets/{util-BXETl5KI.js → util-CRVGSd5f.js} +1 -1
  160. package/dist/assets/{vendor-arcblock-TgIfa3ko.js → vendor-arcblock-Bi9JkCAO.js} +88 -88
  161. package/dist/assets/{vendor-hooks-DXGUREV9.js → vendor-hooks-zv9Oe7Yx.js} +1 -1
  162. package/dist/assets/{vendor-mui-core-BKQDHvL6.js → vendor-mui-core-FzKVVAue.js} +1 -1
  163. package/dist/assets/{vendor-mui-x-Db_Ss6fv.js → vendor-mui-x-B9zuOzS0.js} +1 -1
  164. package/dist/assets/vendor-utils-lR6P1BXz.js +208 -0
  165. package/dist/assets/vendor-ux-did-connect-CaDmrsW1.js +2296 -0
  166. package/dist/assets/wrap-locale-BmmKAsYR.js +1 -0
  167. package/dist/index.html +6 -6
  168. package/dist/service-worker.js +1 -1
  169. package/package.json +46 -46
  170. package/dist/assets/access-control-BIwE_lpL.js +0 -14
  171. package/dist/assets/advanced-5-3CdUNs.js +0 -14
  172. package/dist/assets/api-Bf1onQOz.js +0 -1
  173. package/dist/assets/bundle-avatar-N2eRPvA4.js +0 -1
  174. package/dist/assets/button-CO4tv2XS.js +0 -1
  175. package/dist/assets/cloneDeep-WT_kDeVd.js +0 -1
  176. package/dist/assets/config-space-XXX-dnS8.js +0 -1
  177. package/dist/assets/confirm-C55dFhba.js +0 -7
  178. package/dist/assets/connect-CxcQRkKB.js +0 -1
  179. package/dist/assets/connect-Cyda_keb.js +0 -5
  180. package/dist/assets/connect-to-gwpYimRA.js +0 -1
  181. package/dist/assets/dashboard-3gdmABlO.js +0 -280
  182. package/dist/assets/did-address-CaOBKHpX.js +0 -1
  183. package/dist/assets/domain-BEDI7va7.js +0 -9
  184. package/dist/assets/domains-BzOFZDiL.js +0 -1
  185. package/dist/assets/dot-DqINfNl1.js +0 -7
  186. package/dist/assets/exchange-passport-DYYQAnfj.js +0 -1
  187. package/dist/assets/get-safe-url-BBjUrzRU.js +0 -1
  188. package/dist/assets/get-safe-url-zHRp3aBu.js +0 -1
  189. package/dist/assets/iframe-BuwO7sH1.js +0 -1
  190. package/dist/assets/index-BLdu7KNf.js +0 -10
  191. package/dist/assets/index-BY2ztvNA.js +0 -113
  192. package/dist/assets/index-BktGjdcJ.js +0 -1
  193. package/dist/assets/index-C6GiJKvt.js +0 -192
  194. package/dist/assets/index-Cmwh6ZNi.js +0 -141
  195. package/dist/assets/index-KH-9aJF9.js +0 -55
  196. package/dist/assets/invite-DZjAPDTn.js +0 -1
  197. package/dist/assets/item-ChX1dT7k.js +0 -2
  198. package/dist/assets/landing-page-xXstO1rJ.js +0 -1
  199. package/dist/assets/list-BuihU737.js +0 -236
  200. package/dist/assets/localization-DxZ5mhWl.js +0 -1
  201. package/dist/assets/login-DggkjNzD.js +0 -1
  202. package/dist/assets/omit-DNeUY6_X.js +0 -1
  203. package/dist/assets/preferences-yjK1dIpN.js +0 -1
  204. package/dist/assets/profile-embed-BwWjXkMu.js +0 -1
  205. package/dist/assets/publish-resource-qPWRQ9Qg.js +0 -1
  206. package/dist/assets/relative-time-BTKzBWA6.js +0 -1
  207. package/dist/assets/sdk-CtDt6ZE4.js +0 -1
  208. package/dist/assets/session-C3Z84LF2.js +0 -1
  209. package/dist/assets/setup-B4ffVVKP.js +0 -30
  210. package/dist/assets/start-Cz_Kd33A.js +0 -187
  211. package/dist/assets/unsubscribe-CqTo6HGm.js +0 -1
  212. package/dist/assets/use-blocklet-logo-CWUmcmJR.js +0 -1
  213. package/dist/assets/useAsync-B8Nbc8so.js +0 -1
  214. package/dist/assets/useAsync-CLWvmBXN.js +0 -1
  215. package/dist/assets/user-center-DKy5PNdi.js +0 -76
  216. package/dist/assets/vendor-utils-CjMBJT5V.js +0 -208
  217. package/dist/assets/vendor-ux-did-connect-Dr2W2Pc9.js +0 -2296
  218. package/dist/assets/wrap-locale-DAxfLWy4.js +0 -1
@@ -1 +1 @@
1
- import{v as B,j as h}from"./vendor-mui-core-BKQDHvL6.js";import{l as L,r}from"./vendor-react-DEoibe3W.js";import{A as W,E as A}from"./vendor-utils-CjMBJT5V.js";import{u as O,aq as T}from"./vendor-ux-did-connect-Dr2W2Pc9.js";import{l as w,u as _,s as F}from"./vendor-hooks-DXGUREV9.js";import{A as K,S as $}from"./add-component-core-BxQ8IvTn.js";import{n as q,T as z}from"./index-B9ltKwuq.js";import"./lottie-web-jYmAQWuC.js";import"./item-ChX1dT7k.js";import"./vendor-arcblock-TgIfa3ko.js";import"./format-error-BrmqJs5a.js";import"./Launch-DNHBfbtb.js";import"./Done-DtZ1RTXT.js";import"./DeleteOutline-DqdSj9ec.js";import"./delete-confirm-D1Xe3pLh.js";import"./click-to-copy-BxPDzy5A.js";import"./confirm-C55dFhba.js";import"./session-C3Z84LF2.js";import"./get-safe-url-BBjUrzRU.js";import"./did-address-CaOBKHpX.js";import"./launch-result-message-DucKBLPI.js";import"./page-header-Kn6r_XKH.js";import"./config-space-XXX-dnS8.js";import"./spaces-U3nGmGRa.js";import"./api-Bf1onQOz.js";import"./logo-uploader-50bLEHwJ.js";import"./index-DVQCgvFb.js";import"./index-DzlQfRxQ.js";import"./Google-DMO1DD8q.js";import"./cloneDeep-WT_kDeVd.js";import"./index-3mcmABlM.js";import"./index-DODYa3Im.js";import"./index-DisBCigl.js";import"./useLocalStorage-vveKfojd.js";import"./util-D5pnqiqz.js";import"./use-mobile-DbhbAmWG.js";import"./content-layout-qHJyxPYq.js";import"./connect-to-gwpYimRA.js";import"./ArrowDropDown-CDVfAOPe.js";import"./ChevronLeft-BWWdEYiT.js";import"./ChevronRight-tpAiXojW.js";function ke(){var d;const{t:f}=O(),{blocklet:i}=q(),{componentDid:s}=L(),g=B(e=>e.breakpoints.down("md")),o=new URL(window.location.href),C=o.searchParams.get("mode")==="dialog",c=o.searchParams.get("resourceType")||"",p=o.searchParams.get("resourceDid")||s,R=o.searchParams.get("store")||"",E=o.searchParams.get("showFromUrl")!=="false",S=o.searchParams.get("showResourcesSwitch")!=="false",y=o.searchParams.get("enableRunBackground")!=="false",P=o.searchParams.get("showCategory")!=="false",n=(d=i==null?void 0:i.meta)==null?void 0:d.did,m=R.split(",").filter(Boolean).map(e=>{try{return new URL(e.startsWith("http")?e:`https://${e}`).origin}catch(t){return console.error(t),null}}).filter(Boolean),[D,U]=r.useState(m.map(e=>({url:e,name:e.replace("https://","")}))),[b,x]=r.useState(null),[j,M]=r.useState("");r.useEffect(()=>{(async()=>{try{const e=await Promise.all(m.map(async t=>{const a=W(t,"/api/store.json"),{data:k}=await A.get(a);return{url:t,name:k.name}}));U(e||[])}catch(e){console.error(e)}})()},[m.join(",")]);const v=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")};r.useEffect(()=>{const e=z();return n&&e.connect(),()=>{n&&e.isConnected()&&e.disconnect()}},[n]),w(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:s},"*")});const l=_(e=>{var t,a;((t=e.data)==null?void 0:t.event)==="resourceDialog.select"&&((a=e.data)==null?void 0:a.componentDid)===s&&(x(e.data.data),M(e.data.storeUrl))});w(()=>{window.addEventListener("message",l)}),F(()=>{window.removeEventListener("message",l)});const u=({inDialog:e=!0}={})=>h.jsx(K,{stores:D,selectedMeta:b,storeUrl:j,resourceType:c,resourceDid:p,mode:"embed",inDialog:e,storageKey:$(`${c}+${p}`),showResourcesSwitch:S,showFromUrl:E,enableRunBackground:y,showCategory:P});return C?h.jsx(T,{className:"resource-dialog",title:f("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:g?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(e,t)=>{t!=="backdropClick"&&v()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:u()}):u({inDialog:!1})}export{ke as default};
1
+ import{v as B,j as h}from"./vendor-mui-core-FzKVVAue.js";import{l as L,r}from"./vendor-react-DEoibe3W.js";import{A as W,E as A}from"./vendor-utils-lR6P1BXz.js";import{u as O,am as T}from"./vendor-ux-did-connect-CaDmrsW1.js";import{l as w,u as _,s as F}from"./vendor-hooks-zv9Oe7Yx.js";import{A as K,S as $}from"./add-component-core-BxVPX1qJ.js";import{n as z,T as G}from"./index-BUwaZJ5Y.js";import"./lottie-web-jYmAQWuC.js";import"./item-C69diC1y.js";import"./vendor-arcblock-Bi9JkCAO.js";import"./format-error-BrmqJs5a.js";import"./Launch-BbLsJvEN.js";import"./Done-CiSqPhhR.js";import"./DeleteOutline-DYyAnzFX.js";import"./delete-confirm-D-jVITSf.js";import"./click-to-copy-Dhxc_blG.js";import"./confirm-CHZbNj0g.js";import"./session-Ir9UAnhf.js";import"./get-safe-url-Cn647BYQ.js";import"./did-address-anPrguG7.js";import"./launch-result-message-CiDoyZ_1.js";import"./page-header-D7vhn9dN.js";import"./config-space-B3L4cc62.js";import"./spaces-DfgQftqB.js";import"./api-DPHyou8y.js";import"./logo-uploader-D5rcqbIA.js";import"./index-DVQCgvFb.js";import"./index-iTlCZ1FK.js";import"./Google-DwaWO1n0.js";import"./cloneDeep-DBPWtvi_.js";import"./index-DyU89GO9.js";import"./index-CiWjpC34.js";import"./index-CYz41Upz.js";import"./useLocalStorage-C7usthsI.js";import"./util-CKfiFLd5.js";import"./use-mobile-BleYjZfN.js";import"./content-layout-clTZd0qL.js";import"./connect-to-Do1R8dL3.js";import"./ArrowDropDown-eLxSrK0e.js";import"./ChevronLeft-B15pinY6.js";import"./ChevronRight-B2sjje0T.js";function ke(){var d;const{t:f}=O(),{blocklet:i}=z(),{componentDid:s}=L(),g=B(e=>e.breakpoints.down("md")),o=new URL(window.location.href),C=o.searchParams.get("mode")==="dialog",c=o.searchParams.get("resourceType")||"",p=o.searchParams.get("resourceDid")||s,R=o.searchParams.get("store")||"",E=o.searchParams.get("showFromUrl")!=="false",S=o.searchParams.get("showResourcesSwitch")!=="false",y=o.searchParams.get("enableRunBackground")!=="false",P=o.searchParams.get("showCategory")!=="false",n=(d=i==null?void 0:i.meta)==null?void 0:d.did,m=R.split(",").filter(Boolean).map(e=>{try{return new URL(e.startsWith("http")?e:`https://${e}`).origin}catch(t){return console.error(t),null}}).filter(Boolean),[D,U]=r.useState(m.map(e=>({url:e,name:e.replace("https://","")}))),[b,x]=r.useState(null),[j,M]=r.useState("");r.useEffect(()=>{(async()=>{try{const e=await Promise.all(m.map(async t=>{const a=W(t,"/api/store.json"),{data:k}=await A.get(a);return{url:t,name:k.name}}));U(e||[])}catch(e){console.error(e)}})()},[m.join(",")]);const v=()=>{window.parent.postMessage({event:"resourceDialog.close",componentDid:s},"*")};r.useEffect(()=>{const e=G();return n&&e.connect(),()=>{n&&e.isConnected()&&e.disconnect()}},[n]),w(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:s},"*")});const l=_(e=>{var t,a;((t=e.data)==null?void 0:t.event)==="resourceDialog.select"&&((a=e.data)==null?void 0:a.componentDid)===s&&(x(e.data.data),M(e.data.storeUrl))});w(()=>{window.addEventListener("message",l)}),F(()=>{window.removeEventListener("message",l)});const u=({inDialog:e=!0}={})=>h.jsx(K,{stores:D,selectedMeta:b,storeUrl:j,resourceType:c,resourceDid:p,mode:"embed",inDialog:e,storageKey:$(`${c}+${p}`),showResourcesSwitch:S,showFromUrl:E,enableRunBackground:y,showCategory:P});return C?h.jsx(T,{className:"resource-dialog",title:f("blocklet.publish.addResource"),maxWidth:!1,fullWidth:!1,PaperProps:{style:g?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(e,t)=>{t!=="backdropClick"&&v()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:u()}):u({inDialog:!1})}export{ke as default};
@@ -1,4 +1,4 @@
1
- import{r as t,u as M}from"./vendor-react-DEoibe3W.js";import{j as e,I as b,H as o,ah as r}from"./vendor-mui-core-BKQDHvL6.js";import{b5 as f,v as g,q as H}from"./vendor-ux-did-connect-Dr2W2Pc9.js";import{Q as Z}from"./QuestionMarkCircle-DK54eXUx.js";var a=function(s){return e.jsx("svg",{...s,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.60567 17.3203C7.38971 16.9661 7.19606 16.5686 7.02468 16.1402C6.86016 15.7289 6.7127 15.2804 6.58436 14.801C6.01415 15.0849 5.48171 15.439 4.99946 15.855C5.7556 16.5015 6.63848 17.004 7.60567 17.3203ZM8.26264 15.645C8.10246 15.2446 7.95842 14.7971 7.83425 14.3104C8.53612 14.104 9.26539 13.9991 9.9998 14H10.0015C10.7359 13.9991 11.4652 14.104 12.167 14.3104C12.0429 14.7971 11.8988 15.2446 11.7386 15.645C11.4556 16.3525 11.1353 16.8804 10.8137 17.2204C10.4935 17.559 10.2185 17.6667 10.0006 17.6667C9.78281 17.6667 9.50783 17.559 9.18757 17.2204C8.86599 16.8804 8.54566 16.3525 8.26264 15.645ZM10.0007 12.6667C10.8258 12.6657 11.6453 12.7785 12.4365 13.0005C12.5533 12.274 12.6295 11.49 12.6565 10.6666H7.34483C7.37175 11.49 7.448 12.274 7.56482 13.0006C8.35599 12.7785 9.17556 12.6657 10.0007 12.6667ZM7.34483 9.33331C7.37175 8.50999 7.448 7.72596 7.56482 6.99945C8.35598 7.22152 9.17556 7.33433 10.0007 7.33334C10.8258 7.33433 11.6453 7.22153 12.4365 6.99947C12.5533 7.72597 12.6295 8.51 12.6565 9.33331H7.34483ZM13.9905 10.6666C13.9603 11.6495 13.8639 12.5916 13.7104 13.4645C14.5207 13.8311 15.2715 14.3159 15.9385 14.9026C16.9065 13.7315 17.5347 12.2691 17.6722 10.6666H13.9905ZM17.6721 9.33331H13.9904C13.9603 8.35043 13.8639 7.40842 13.7104 6.5355C14.5207 6.16891 15.2715 5.68412 15.9385 5.09743C16.9065 6.26854 17.5347 7.73084 17.6721 9.33331ZM19.0006 10.0017C18.9997 14.9715 14.9706 19 10.0006 19H10.0006C5.03005 19 1.00061 14.9706 1.00061 10C1.00061 9.99999 1.00061 9.99999 1.00061 9.99998C1.00062 5.02943 5.03005 1 10.0006 1C14.9712 1 19.0006 5.02944 19.0006 10C19.0006 10.0006 19.0006 10.0011 19.0006 10.0017ZM2.32907 9.33331C2.46651 7.73082 3.09476 6.2685 4.0628 5.09738C4.72975 5.68407 5.48055 6.16888 6.29084 6.53548C6.13742 7.40841 6.041 8.35042 6.01083 9.33331H2.32907ZM2.32907 10.6666H6.01083C6.04099 11.6496 6.13742 12.5916 6.29084 13.4645C5.48055 13.8311 4.72975 14.3159 4.06281 14.9026C3.09475 13.7315 2.46649 12.2692 2.32907 10.6666ZM12.9766 16.1402C13.1411 15.7289 13.2886 15.2804 13.4169 14.8009C13.9871 15.0849 14.5196 15.4389 15.0018 15.8549C14.2457 16.5014 13.3628 17.004 12.3956 17.3202C12.6116 16.9661 12.8052 16.5686 12.9766 16.1402ZM12.3956 2.67976C13.3628 2.996 14.2457 3.49858 15.0018 4.14508C14.5196 4.56106 13.9871 4.91516 13.4169 5.19908C13.2886 4.71963 13.1411 4.2711 12.9766 3.85979C12.8052 3.43137 12.6116 3.03387 12.3956 2.67976ZM11.7386 4.355C11.8988 4.75545 12.0429 5.20292 12.167 5.68962C11.4652 5.89603 10.7359 6.00096 10.0015 6.00001H9.9998C9.26539 6.00096 8.53612 5.89602 7.83424 5.68961C7.95841 5.20291 8.10246 4.75544 8.26264 4.355C8.54566 3.64747 8.86599 3.11964 9.18757 2.7796C9.50783 2.44096 9.78281 2.33333 10.0006 2.33333C10.2185 2.33333 10.4935 2.44096 10.8137 2.7796C11.1353 3.11964 11.4556 3.64747 11.7386 4.355ZM7.02468 3.85979C6.86015 4.2711 6.71269 4.71961 6.58436 5.19906C6.01414 4.91513 5.4817 4.56103 4.99945 4.14504C5.7556 3.49854 6.63848 2.99596 7.60567 2.67973C7.38971 3.03385 7.19606 3.43136 7.02468 3.85979Z",fill:"currentColor"})})};a.defaultProps={width:"21",height:"20",viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg"};a.displayName="globe";const j=a;function l({SessionContext:s,extraItems:C,showLocale:c,showHelper:i,showSessionManager:p,sessionManagerProps:d}){const{session:w}=t.useContext(s),{locale:h}=t.useContext(f),u=M(),x=()=>{if(u.pathname.indexOf("/store")>-1){window.open("https://www.arcblock.io/content/docs/createblocklet","_blank");return}window.open("https://www.arcblock.io/content/docs/blocklet-developer","_blank")};return e.jsxs(e.Fragment,{children:[C.map((n,m)=>t.cloneElement(n,{key:m})),c&&e.jsx(v,{"data-cy":"locale-addon",icon:j,size:23,showText:!1,className:"locale-addon"}),i&&e.jsx(b,{onClick:x,children:e.jsx(Z,{})}),p&&e.jsx(k,{locale:h,session:w,size:24,showRole:!0,...d,showManageBlocklet:!1})]})}l.propTypes={SessionContext:o.object.isRequired,webWalletUrl:o.string,extraItems:o.array,showLocale:o.bool,showSessionManager:o.bool,showHelper:o.bool,sessionManagerProps:o.object};l.defaultProps={webWalletUrl:"",extraItems:[],showLocale:!0,showSessionManager:!0,showHelper:!0,sessionManagerProps:{}};const k=r(g)`
1
+ import{r as t,u as M}from"./vendor-react-DEoibe3W.js";import{j as e,I as b,H as o,ah as r}from"./vendor-mui-core-FzKVVAue.js";import{b2 as f,n as g,L as H}from"./vendor-ux-did-connect-CaDmrsW1.js";import{Q as Z}from"./QuestionMarkCircle-DV5837_n.js";var a=function(s){return e.jsx("svg",{...s,children:e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.60567 17.3203C7.38971 16.9661 7.19606 16.5686 7.02468 16.1402C6.86016 15.7289 6.7127 15.2804 6.58436 14.801C6.01415 15.0849 5.48171 15.439 4.99946 15.855C5.7556 16.5015 6.63848 17.004 7.60567 17.3203ZM8.26264 15.645C8.10246 15.2446 7.95842 14.7971 7.83425 14.3104C8.53612 14.104 9.26539 13.9991 9.9998 14H10.0015C10.7359 13.9991 11.4652 14.104 12.167 14.3104C12.0429 14.7971 11.8988 15.2446 11.7386 15.645C11.4556 16.3525 11.1353 16.8804 10.8137 17.2204C10.4935 17.559 10.2185 17.6667 10.0006 17.6667C9.78281 17.6667 9.50783 17.559 9.18757 17.2204C8.86599 16.8804 8.54566 16.3525 8.26264 15.645ZM10.0007 12.6667C10.8258 12.6657 11.6453 12.7785 12.4365 13.0005C12.5533 12.274 12.6295 11.49 12.6565 10.6666H7.34483C7.37175 11.49 7.448 12.274 7.56482 13.0006C8.35599 12.7785 9.17556 12.6657 10.0007 12.6667ZM7.34483 9.33331C7.37175 8.50999 7.448 7.72596 7.56482 6.99945C8.35598 7.22152 9.17556 7.33433 10.0007 7.33334C10.8258 7.33433 11.6453 7.22153 12.4365 6.99947C12.5533 7.72597 12.6295 8.51 12.6565 9.33331H7.34483ZM13.9905 10.6666C13.9603 11.6495 13.8639 12.5916 13.7104 13.4645C14.5207 13.8311 15.2715 14.3159 15.9385 14.9026C16.9065 13.7315 17.5347 12.2691 17.6722 10.6666H13.9905ZM17.6721 9.33331H13.9904C13.9603 8.35043 13.8639 7.40842 13.7104 6.5355C14.5207 6.16891 15.2715 5.68412 15.9385 5.09743C16.9065 6.26854 17.5347 7.73084 17.6721 9.33331ZM19.0006 10.0017C18.9997 14.9715 14.9706 19 10.0006 19H10.0006C5.03005 19 1.00061 14.9706 1.00061 10C1.00061 9.99999 1.00061 9.99999 1.00061 9.99998C1.00062 5.02943 5.03005 1 10.0006 1C14.9712 1 19.0006 5.02944 19.0006 10C19.0006 10.0006 19.0006 10.0011 19.0006 10.0017ZM2.32907 9.33331C2.46651 7.73082 3.09476 6.2685 4.0628 5.09738C4.72975 5.68407 5.48055 6.16888 6.29084 6.53548C6.13742 7.40841 6.041 8.35042 6.01083 9.33331H2.32907ZM2.32907 10.6666H6.01083C6.04099 11.6496 6.13742 12.5916 6.29084 13.4645C5.48055 13.8311 4.72975 14.3159 4.06281 14.9026C3.09475 13.7315 2.46649 12.2692 2.32907 10.6666ZM12.9766 16.1402C13.1411 15.7289 13.2886 15.2804 13.4169 14.8009C13.9871 15.0849 14.5196 15.4389 15.0018 15.8549C14.2457 16.5014 13.3628 17.004 12.3956 17.3202C12.6116 16.9661 12.8052 16.5686 12.9766 16.1402ZM12.3956 2.67976C13.3628 2.996 14.2457 3.49858 15.0018 4.14508C14.5196 4.56106 13.9871 4.91516 13.4169 5.19908C13.2886 4.71963 13.1411 4.2711 12.9766 3.85979C12.8052 3.43137 12.6116 3.03387 12.3956 2.67976ZM11.7386 4.355C11.8988 4.75545 12.0429 5.20292 12.167 5.68962C11.4652 5.89603 10.7359 6.00096 10.0015 6.00001H9.9998C9.26539 6.00096 8.53612 5.89602 7.83424 5.68961C7.95841 5.20291 8.10246 4.75544 8.26264 4.355C8.54566 3.64747 8.86599 3.11964 9.18757 2.7796C9.50783 2.44096 9.78281 2.33333 10.0006 2.33333C10.2185 2.33333 10.4935 2.44096 10.8137 2.7796C11.1353 3.11964 11.4556 3.64747 11.7386 4.355ZM7.02468 3.85979C6.86015 4.2711 6.71269 4.71961 6.58436 5.19906C6.01414 4.91513 5.4817 4.56103 4.99945 4.14504C5.7556 3.49854 6.63848 2.99596 7.60567 2.67973C7.38971 3.03385 7.19606 3.43136 7.02468 3.85979Z",fill:"currentColor"})})};a.defaultProps={width:"21",height:"20",viewBox:"0 0 21 20",xmlns:"http://www.w3.org/2000/svg"};a.displayName="globe";const j=a;function l({SessionContext:s,extraItems:C,showLocale:c,showHelper:i,showSessionManager:p,sessionManagerProps:d}){const{session:w}=t.useContext(s),{locale:h}=t.useContext(f),u=M(),x=()=>{if(u.pathname.indexOf("/store")>-1){window.open("https://www.arcblock.io/content/docs/createblocklet","_blank");return}window.open("https://www.arcblock.io/content/docs/blocklet-developer","_blank")};return e.jsxs(e.Fragment,{children:[C.map((n,m)=>t.cloneElement(n,{key:m})),c&&e.jsx(v,{"data-cy":"locale-addon",icon:j,size:23,showText:!1,className:"locale-addon"}),i&&e.jsx(b,{onClick:x,children:e.jsx(Z,{})}),p&&e.jsx(k,{locale:h,session:w,size:24,showRole:!0,...d,showManageBlocklet:!1})]})}l.propTypes={SessionContext:o.object.isRequired,webWalletUrl:o.string,extraItems:o.array,showLocale:o.bool,showSessionManager:o.bool,showHelper:o.bool,sessionManagerProps:o.object};l.defaultProps={webWalletUrl:"",extraItems:[],showLocale:!0,showSessionManager:!0,showHelper:!0,sessionManagerProps:{}};const k=r(g)`
2
2
  .user-addon {
3
3
  .user-avatar {
4
4
  width: 28px;
@@ -0,0 +1,14 @@
1
+ import{r as z,e as ee}from"./vendor-react-DEoibe3W.js";import{a9 as ge,j as k,ab as le,H as N,aa as M,y as Ue,T as te,ah as ye,bt as Ve,bS as We,by as Ke,ak as He,E as Ge,al as Ee,O as Ze,N as Ye,bu as me,X as Z}from"./vendor-mui-core-FzKVVAue.js";import{z as re,C as Qe,f as Xe,aE as et,l as tt,aw as rt,v as Ae,V as Ie,U as Te}from"./index-BUwaZJ5Y.js";import{P as st,w as ce}from"./permission-6aZ4MNgh.js";import{r as be,u as ie,B as G,_ as H,ao as Le,e as nt,am as qe,c8 as at,aJ as it,h as V,j as ot,Y as Ce,b2 as lt}from"./vendor-ux-did-connect-CaDmrsW1.js";import{w as Me}from"./vendor-hooks-zv9Oe7Yx.js";import{c as Y}from"./vendor-arcblock-Bi9JkCAO.js";import{C as ve}from"./confirm-CHZbNj0g.js";import{f as ae}from"./format-error-BrmqJs5a.js";import{_ as ct}from"./useSetState-CWq0AVWn.js";import{u as Pe}from"./session-Ir9UAnhf.js";import{S as K,u as Ne}from"./dashboard-BjhEdRo6.js";import{C as ut}from"./click-to-copy-Dhxc_blG.js";import{r as ft,aL as dt}from"./vendor-utils-lR6P1BXz.js";import{I as mt}from"./index-CYz41Upz.js";import{W as ht}from"./did-address-anPrguG7.js";import{V as pt}from"./status-w7wNdwd8.js";import"./lottie-web-jYmAQWuC.js";import"./useLocalStorage-C7usthsI.js";import"./PlayArrow-qTn22j6x.js";import"./get-safe-url-Cn647BYQ.js";import"./use-blocklet-logo-BiDCl8v3.js";import"./InfoOutlined-BCqZENBx.js";import"./dot-Bc3KtmUA.js";import"./useAsync-BTtZas5A.js";import"./use-mobile-BnYZ5d8f.js";import"./omit-CM6MPIu5.js";var _e={},gt=ge;Object.defineProperty(_e,"__esModule",{value:!0});var Fe=_e.default=void 0,yt=gt(be()),bt=k;Fe=_e.default=(0,yt.default)((0,bt.jsx)("path",{d:"M16 13c3.09-2.81 6-5.44 6-7.7C22 3.45 20.55 2 18.7 2c-1.04 0-2.05.49-2.7 1.25C15.34 2.49 14.34 2 13.3 2 11.45 2 10 3.45 10 5.3c0 2.26 2.91 4.89 6 7.7m-2.7-9c.44 0 .89.21 1.18.55L16 6.34l1.52-1.79c.29-.34.74-.55 1.18-.55.74 0 1.3.56 1.3 1.3 0 1.12-2.04 3.17-4 4.99-1.96-1.82-4-3.88-4-4.99 0-.74.56-1.3 1.3-1.3M19 16h-2c0-1.2-.75-2.28-1.87-2.7L8.97 11H1v11h6v-1.44l7 1.94 8-2.5v-1c0-1.66-1.34-3-3-3M3 20v-7h2v7zm10.97.41L7 18.48V13h1.61l5.82 2.17c.34.13.57.46.57.83 0 0-1.99-.05-2.3-.15l-2.38-.79-.63 1.9 2.38.79c.51.17 1.04.26 1.58.26H19c.39 0 .74.23.9.56z"}),"VolunteerActivismOutlined");var we={},vt=ge;Object.defineProperty(we,"__esModule",{value:!0});var xe=we.default=void 0,_t=vt(be()),De=k;xe=we.default=(0,_t.default)([(0,De.jsx)("path",{d:"M21 7.28V5c0-1.1-.9-2-2-2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-2.28c.59-.35 1-.98 1-1.72V9c0-.74-.41-1.37-1-1.72M20 9v6h-7V9zM5 19V5h14v2h-6c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h6v2z"},"0"),(0,De.jsx)("circle",{cx:"16",cy:"12",r:"1.5"},"1")],"AccountBalanceWalletOutlined");const wt=localStorage.getItem("enableDebug")==="true";function xt({teamDid:$,size:O="small",...E}){const{t:A}=ie(),{api:j}=re(),[w,g]=z.useState(!1),[o,b]=z.useState(null),h=()=>{g(!1),b(null)},f=async()=>{var a;try{g(!0);const n=await j.clearCache({input:{teamDid:$}});H.success(A("blocklet.config.clearCache.success",{count:((a=n.removed)==null?void 0:a.length)||0}))}catch(n){H.error(ae(n))}finally{g(!1),b(null)}},e={title:A("blocklet.config.clearCache.title"),description:A("blocklet.config.clearCache.description"),confirm:A("common.confirm"),cancel:A("common.cancel"),onConfirm:f,onCancel:h};return k.jsxs("div",{...E,children:[k.jsxs(G,{onClick:()=>b(e),color:"error",variant:"outlined",size:O,children:[w?k.jsx(le,{size:16,style:{marginRight:5}}):null,A("blocklet.config.clearCache.action")]}),o&&k.jsx(ve,{title:o.title,description:o.description,confirm:o.confirm,cancel:o.cancel,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}var $e={},$t=ge;Object.defineProperty($e,"__esModule",{value:!0});var ze=$e.default=void 0,jt=$t(be()),kt=k;ze=$e.default=(0,jt.default)((0,kt.jsx)("path",{d:"M21 10h-8.35C11.83 7.67 9.61 6 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6c2.61 0 4.83-1.67 5.65-4H13l2 2 2-2 2 2 4-4.04zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"KeyOutlined");function je({onChange:$,disabled:O,loading:E,inService:A}){const{t:j}=ie(),{api:w,session:g}=Pe(),{blocklet:o}=Qe(),[b,h]=ct({newAppSk:"",isConnectOpen:!1,confirmDialogOpen:!1}),f=()=>h({isConnectOpen:!1}),e=()=>{if(Xe.isInProgress(o.status)){H.error(j("blocklet.error.isInProgress"));return}h({confirmDialogOpen:!0})};return k.jsxs(k.Fragment,{children:[k.jsx(K,{title:j("blocklet.config.migrate.button"),desc:j("blocklet.config.migrate.description"),children:k.jsx(M,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsxs(Ue,{style:{flexShrink:0},variant:"contained",color:"primary",size:"small","data-cy":"config-did",disabled:O||E,onClick:e,children:[k.jsx(ze,{style:{fontSize:"1.3em",marginRight:4}}),j("blocklet.config.migrate.button")]})})}),k.jsxs(k.Fragment,{children:[b.isConnectOpen&&k.jsx(Le,{popup:!0,open:b.isConnectOpen,forceConnected:!1,saveConnect:!1,action:"rotate-key-pair",checkFn:w.get,checkTimeout:5*60*1e3,onSuccess:()=>{$(),A&&g.logout(),f()},extraParams:{appDid:o.appDid},messages:{title:j("setup.keyPair.title"),scan:j("setup.keyPair.scan"),confirm:j("setup.keyPair.confirm"),success:j("setup.keyPair.success")},onClose:f}),b.confirmDialogOpen&&k.jsx(ve,{title:k.jsx(te,{sx:{fontSize:"20px",fontWeight:"500"},children:j("blocklet.config.migrate.title")}),description:k.jsx(te,{sx:{fontSize:"14px",color:"#9397A1"},children:j("blocklet.config.migrate.confirm")}),confirm:j("common.confirm"),cancel:j("common.cancel"),onConfirm:()=>h({confirmDialogOpen:!1,isConnectOpen:!0}),onCancel:()=>h({confirmDialogOpen:!1})})]})]})}je.propTypes={onChange:N.func,disabled:N.bool,loading:N.bool,inService:N.bool};je.defaultProps={onChange:()=>{},disabled:!1,loading:!1,inService:!1};function ke({onCancel:$,onSuccess:O,onError:E}){const{api:A}=z.useContext(nt),[j,w]=z.useState(!1),{t:g,locale:o}=ie(),[b,h]=z.useState(""),[f,e]=z.useState(!1),[a,n]=z.useState(0),[r,t]=z.useState(""),{endpoint:l}=Ne(),[s,i]=z.useState(!1),u=c=>{h(null),w(!0);try{t(c.result),n(_.length-1)}catch(m){const y=ae(m);h(y),E(m)}finally{w(!1)}},d=()=>{e(!0),n(1)},p=()=>{e(!1),n(0)},_=[{body:k.jsxs(M,{children:[k.jsx(te,{children:g("team.transferApp.transferDialog.tips.progress")}),k.jsx(te,{mt:3,mb:2,children:g("team.transferApp.transferDialog.tips.newOwnerPermissions")})]}),cancel:g("common.cancel"),confirm:g("team.transferApp.transferDialog.createTransferLink"),onCancel:$,onConfirm:d},{cancel:g("common.cancel"),confirm:g("team.transferApp.transferDialog.createTransferLink"),body:()=>k.jsx(Le,{action:"transfer-app-owner",open:f,locale:o,checkFn:A.get,onClose:p,onSuccess:u,checkTimeout:5*60*1e3,extraParams:{},messages:{title:g("team.transferApp.connectDialog.title"),scan:g("team.transferApp.connectDialog.scan"),confirm:g("team.transferApp.connectDialog.confirm"),success:g("team.transferApp.connectDialog.success")},popup:!0})},{body:()=>{const c=et({transferId:r.transferId,endpoint:l});return k.jsxs(k.Fragment,{children:[k.jsx(M,{component:X,dangerouslySetInnerHTML:{__html:g("team.transferApp.transferDialog.createSuccessTip1")}}),k.jsx(M,{component:X,mt:2,children:k.jsx(X,{children:g("team.transferApp.transferDialog.createSuccessTip3")})}),k.jsxs(M,{children:[k.jsx(M,{component:X,mt:2,children:k.jsx(X,{children:g("team.transferApp.transferDialog.createSuccessTip2",{expireDate:tt(r.expireDate,o)})})}),k.jsx(M,{my:1,children:k.jsx(ut,{children:c})})]}),k.jsx("div",{children:k.jsx(Ve,{value:"end",control:k.jsx(We,{checked:s,onChange:m=>i(m.target.checked)}),label:g("team.transferApp.transferDialog.iKnow"),labelPlacement:"end"})})]})},confirm:g("common.confirm"),onConfirm:O}],v=_[a];return k.jsxs(qe,{title:k.jsx(X,{className:"title",children:g("team.transferApp.transferDialog.title")}),fullWidth:!0,open:!0,showCloseButton:!1,actions:k.jsxs(k.Fragment,{children:[v.cancel&&k.jsx(G,{onClick:v.onCancel,color:"inherit",children:v.cancel}),k.jsxs(G,{onClick:v.onConfirm,color:"error",disabled:j||a===_.length-1&&!s,variant:"contained",autoFocus:!0,children:[j&&k.jsx(le,{size:16}),v.confirm]})]}),children:[k.jsx(Ke,{component:"div",children:typeof v.body=="function"?v.body():v.body}),!!b&&k.jsx(He,{severity:"error",variant:"icon",children:b})]})}ke.propTypes={onCancel:N.func.isRequired,onSuccess:N.func.isRequired,onError:N.func};ke.defaultProps={onError:()=>{}};const X=ye.div`
2
+ font-size: 16px;
3
+ font-weight: bold;
4
+ &.title {
5
+ font-size: 20px;
6
+ }
7
+ `;var Je={},Be={exports:{}};(function($,O){(function(E,A){$.exports=A()})(self,()=>{return E={7629:(j,w,g)=>{const o=g(375),b=g(8571),h=g(9474),f=g(1687),e=g(8652),a=g(8160),n=g(3292),r=g(6354),t=g(8901),l=g(9708),s=g(6914),i=g(2294),u=g(6133),d=g(1152),p=g(8863),_=g(2036),v={Base:class{constructor(c){this.type=c,this.$_root=null,this._definition={},this._reset()}_reset(){this._ids=new i.Ids,this._preferences=null,this._refs=new u.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 o(typeof l.describe=="function","Manifest functionality disabled"),l.describe(this)}allow(...c){return a.verifyFlat(c,"allow"),this._values(c,"_valids")}alter(c){o(c&&typeof c=="object"&&!Array.isArray(c),"Invalid targets argument"),o(!this._inRuleset(),"Cannot set alterations inside a ruleset");const m=this.clone();m.$_terms.alterations=m.$_terms.alterations||[];for(const y in c){const x=c[y];o(typeof x=="function","Alteration adjuster for",y,"must be a function"),m.$_terms.alterations.push({target:y,adjuster:x})}return m.$_temp.ruleset=!1,m}artifact(c){return o(c!==void 0,"Artifact cannot be undefined"),o(!this._cache,"Cannot set an artifact with a rule cache"),this.$_setFlag("artifact",c)}cast(c){return o(c===!1||typeof c=="string","Invalid to value"),o(c===!1||this._definition.cast[c],"Type",this.type,"does not support casting to",c),this.$_setFlag("cast",c===!1?void 0:c)}default(c,m){return this._default("default",c,m)}description(c){return o(c&&typeof c=="string","Description must be a non-empty string"),this.$_setFlag("description",c)}empty(c){const m=this.clone();return c!==void 0&&(c=m.$_compile(c,{override:!1})),m.$_setFlag("empty",c,{clone:!1})}error(c){return o(c,"Missing error"),o(c instanceof Error||typeof c=="function","Must provide a valid Error object or a function"),this.$_setFlag("error",c)}example(c,m={}){return o(c!==void 0,"Missing example"),a.assertOptions(m,["override"]),this._inner("examples",c,{single:!0,override:m.override})}external(c,m){return typeof c=="object"&&(o(!m,"Cannot combine options with description"),m=c.description,c=c.method),o(typeof c=="function","Method must be a function"),o(m===void 0||m&&typeof m=="string","Description must be a non-empty string"),this._inner("externals",{method:c,description:m},{single:!0})}failover(c,m){return this._default("failover",c,m)}forbidden(){return this.presence("forbidden")}id(c){return c?(o(typeof c=="string","id must be a non-empty string"),o(/^[^\.]+$/.test(c),"id cannot contain period character"),this.$_setFlag("id",c)):this.$_setFlag("id",void 0)}invalid(...c){return this._values(c,"_invalids")}label(c){return o(c&&typeof c=="string","Label name must be a non-empty string"),this.$_setFlag("label",c)}meta(c){return o(c!==void 0,"Meta cannot be undefined"),this._inner("metas",c,{single:!0})}note(...c){o(c.length,"Missing notes");for(const m of c)o(m&&typeof m=="string","Notes must be non-empty strings");return this._inner("notes",c)}only(c=!0){return o(typeof c=="boolean","Invalid mode:",c),this.$_setFlag("only",c)}optional(){return this.presence("optional")}prefs(c){o(c,"Missing preferences"),o(c.context===void 0,"Cannot override context"),o(c.externals===void 0,"Cannot override externals"),o(c.warnings===void 0,"Cannot override warnings"),o(c.debug===void 0,"Cannot override debug"),a.checkPreferences(c);const m=this.clone();return m._preferences=a.preferences(m._preferences,c),m}presence(c){return o(["optional","required","forbidden"].includes(c),"Unknown presence mode",c),this.$_setFlag("presence",c)}raw(c=!0){return this.$_setFlag("result",c?"raw":void 0)}result(c){return o(["raw","strip"].includes(c),"Unknown result mode",c),this.$_setFlag("result",c)}required(){return this.presence("required")}strict(c){const m=this.clone(),y=c!==void 0&&!c;return m._preferences=a.preferences(m._preferences,{convert:y}),m}strip(c=!0){return this.$_setFlag("result",c?"strip":void 0)}tag(...c){o(c.length,"Missing tags");for(const m of c)o(m&&typeof m=="string","Tags must be non-empty strings");return this._inner("tags",c)}unit(c){return o(c&&typeof c=="string","Unit name must be a non-empty string"),this.$_setFlag("unit",c)}valid(...c){a.verifyFlat(c,"valid");const m=this.allow(...c);return m.$_setFlag("only",!!m._valids,{clone:!1}),m}when(c,m){const y=this.clone();y.$_terms.whens||(y.$_terms.whens=[]);const x=n.when(y,c,m);if(!["any","link"].includes(y.type)){const S=x.is?[x]:x.switch;for(const R of S)o(!R.then||R.then.type==="any"||R.then.type===y.type,"Cannot combine",y.type,"with",R.then&&R.then.type),o(!R.otherwise||R.otherwise.type==="any"||R.otherwise.type===y.type,"Cannot combine",y.type,"with",R.otherwise&&R.otherwise.type)}return y.$_terms.whens.push(x),y.$_mutateRebuild()}cache(c){o(!this._inRuleset(),"Cannot set caching inside a ruleset"),o(!this._cache,"Cannot override schema cache"),o(this._flags.artifact===void 0,"Cannot cache a rule with an artifact");const m=this.clone();return m._cache=c||e.provider.provision(),m.$_temp.ruleset=!1,m}clone(){const c=Object.create(Object.getPrototypeOf(this));return this._assign(c)}concat(c){o(a.isSchema(c),"Invalid schema object"),o(this.type==="any"||c.type==="any"||c.type===this.type,"Cannot merge type",this.type,"with another type:",c.type),o(!this._inRuleset(),"Cannot concatenate onto a schema with open ruleset"),o(!c._inRuleset(),"Cannot concatenate a schema with open ruleset");let m=this.clone();if(this.type==="any"&&c.type!=="any"){const y=c.clone();for(const x of Object.keys(m))x!=="type"&&(y[x]=m[x]);m=y}m._ids.concat(c._ids),m._refs.register(c,u.toSibling),m._preferences=m._preferences?a.preferences(m._preferences,c._preferences):c._preferences,m._valids=_.merge(m._valids,c._valids,c._invalids),m._invalids=_.merge(m._invalids,c._invalids,c._valids);for(const y of c._singleRules.keys())m._singleRules.has(y)&&(m._rules=m._rules.filter(x=>x.keep||x.name!==y),m._singleRules.delete(y));for(const y of c._rules)c._definition.rules[y.method].multi||m._singleRules.set(y.name,y),m._rules.push(y);if(m._flags.empty&&c._flags.empty){m._flags.empty=m._flags.empty.concat(c._flags.empty);const y=Object.assign({},c._flags);delete y.empty,f(m._flags,y)}else if(c._flags.empty){m._flags.empty=c._flags.empty;const y=Object.assign({},c._flags);delete y.empty,f(m._flags,y)}else f(m._flags,c._flags);for(const y in c.$_terms){const x=c.$_terms[y];x?m.$_terms[y]?m.$_terms[y]=m.$_terms[y].concat(x):m.$_terms[y]=x.slice():m.$_terms[y]||(m.$_terms[y]=x)}return this.$_root._tracer&&this.$_root._tracer._combine(m,[this,c]),m.$_mutateRebuild()}extend(c){return o(!c.base,"Cannot extend type with another base"),t.type(this,c)}extract(c){return c=Array.isArray(c)?c:c.split("."),this._ids.reach(c)}fork(c,m){o(!this._inRuleset(),"Cannot fork inside a ruleset");let y=this;for(let x of[].concat(c))x=Array.isArray(x)?x:x.split("."),y=y._ids.fork(x,m,y);return y.$_temp.ruleset=!1,y}rule(c){const m=this._definition;a.assertOptions(c,Object.keys(m.modifiers)),o(this.$_temp.ruleset!==!1,"Cannot apply rules to empty ruleset or the last rule added does not support rule properties");const y=this.$_temp.ruleset===null?this._rules.length-1:this.$_temp.ruleset;o(y>=0&&y<this._rules.length,"Cannot apply rules to empty ruleset");const x=this.clone();for(let S=y;S<x._rules.length;++S){const R=x._rules[S],C=b(R);for(const D in c)m.modifiers[D](C,c[D]),o(C.name===R.name,"Cannot change rule name");x._rules[S]=C,x._singleRules.get(C.name)===R&&x._singleRules.set(C.name,C)}return x.$_temp.ruleset=!1,x.$_mutateRebuild()}get ruleset(){o(!this._inRuleset(),"Cannot start a new ruleset without closing the previous one");const c=this.clone();return c.$_temp.ruleset=c._rules.length,c}get $(){return this.ruleset}tailor(c){c=[].concat(c),o(!this._inRuleset(),"Cannot tailor inside a ruleset");let m=this;if(this.$_terms.alterations)for(const{target:y,adjuster:x}of this.$_terms.alterations)c.includes(y)&&(m=x(m),o(a.isSchema(m),"Alteration adjuster for",y,"failed to return a schema object"));return m=m.$_modify({each:y=>y.tailor(c),ref:!1}),m.$_temp.ruleset=!1,m.$_mutateRebuild()}tracer(){return d.location?d.location(this):this}validate(c,m){return p.entry(c,this,m)}validateAsync(c,m){return p.entryAsync(c,this,m)}$_addRule(c){typeof c=="string"&&(c={name:c}),o(c&&typeof c=="object","Invalid options"),o(c.name&&typeof c.name=="string","Invalid rule name");for(const R in c)o(R[0]!=="_","Cannot set private rule properties");const m=Object.assign({},c);m._resolve=[],m.method=m.method||m.name;const y=this._definition.rules[m.method],x=m.args;o(y,"Unknown rule",m.method);const S=this.clone();if(x){o(Object.keys(x).length===1||Object.keys(x).length===this._definition.rules[m.name].args.length,"Invalid rule definition for",this.type,m.name);for(const R in x){let C=x[R];if(y.argsByName){const D=y.argsByName.get(R);if(D.ref&&a.isResolvable(C))m._resolve.push(R),S.$_mutateRegister(C);else if(D.normalize&&(C=D.normalize(C),x[R]=C),D.assert){const I=a.validateArg(C,R,D);o(!I,I,"or reference")}}C!==void 0?x[R]=C:delete x[R]}}return y.multi||(S._ruleRemove(m.name,{clone:!1}),S._singleRules.set(m.name,m)),S.$_temp.ruleset===!1&&(S.$_temp.ruleset=null),y.priority?S._rules.unshift(m):S._rules.push(m),S}$_compile(c,m){return n.schema(this.$_root,c,m)}$_createError(c,m,y,x,S,R={}){const C=R.flags!==!1?this._flags:{},D=R.messages?s.merge(this._definition.messages,R.messages):this._definition.messages;return new r.Report(c,m,y,C,D,x,S)}$_getFlag(c){return this._flags[c]}$_getRule(c){return this._singleRules.get(c)}$_mapLabels(c){return c=Array.isArray(c)?c:c.split("."),this._ids.labels(c)}$_match(c,m,y,x){(y=Object.assign({},y)).abortEarly=!0,y._externals=!1,m.snapshot();const S=!p.validate(c,this,m,y,x).errors;return m.restore(),S}$_modify(c){return a.assertOptions(c,["each","once","ref","schema"]),i.schema(this,c)||this}$_mutateRebuild(){return o(!this._inRuleset(),"Cannot add this rule inside a ruleset"),this._refs.reset(),this._ids.reset(),this.$_modify({each:(c,{source:m,name:y,path:x,key:S})=>{const R=this._definition[m][y]&&this._definition[m][y].register;R!==!1&&this.$_mutateRegister(c,{family:R,key:S})}}),this._definition.rebuild&&this._definition.rebuild(this),this.$_temp.ruleset=!1,this}$_mutateRegister(c,{family:m,key:y}={}){this._refs.register(c,m),this._ids.register(c,{key:y})}$_property(c){return this._definition.properties[c]}$_reach(c){return this._ids.reach(c)}$_rootReferences(){return this._refs.roots()}$_setFlag(c,m,y={}){o(c[0]==="_"||!this._inRuleset(),"Cannot set flag inside a ruleset");const x=this._definition.flags[c]||{};if(h(m,x.default)&&(m=void 0),h(m,this._flags[c]))return this;const S=y.clone!==!1?this.clone():this;return m!==void 0?(S._flags[c]=m,S.$_mutateRegister(m)):delete S._flags[c],c[0]!=="_"&&(S.$_temp.ruleset=!1),S}$_parent(c,...m){return this[c][a.symbols.parent].call(this,...m)}$_validate(c,m,y){return p.validate(c,this,m,y)}_assign(c){c.type=this.type,c.$_root=this.$_root,c.$_temp=Object.assign({},this.$_temp),c.$_temp.whens={},c._ids=this._ids.clone(),c._preferences=this._preferences,c._valids=this._valids&&this._valids.clone(),c._invalids=this._invalids&&this._invalids.clone(),c._rules=this._rules.slice(),c._singleRules=b(this._singleRules,{shallow:!0}),c._refs=this._refs.clone(),c._flags=Object.assign({},this._flags),c._cache=null,c.$_terms={};for(const m in this.$_terms)c.$_terms[m]=this.$_terms[m]?this.$_terms[m].slice():null;c.$_super={};for(const m in this.$_super)c.$_super[m]=this._super[m].bind(c);return c}_bare(){const c=this.clone();c._reset();const m=c._definition.terms;for(const y in m){const x=m[y];c.$_terms[y]=x.init}return c.$_mutateRebuild()}_default(c,m,y={}){return a.assertOptions(y,"literal"),o(m!==void 0,"Missing",c,"value"),o(typeof m=="function"||!y.literal,"Only function value supports literal option"),typeof m=="function"&&y.literal&&(m={[a.symbols.literal]:!0,literal:m}),this.$_setFlag(c,m)}_generate(c,m,y){if(!this.$_terms.whens)return{schema:this};const x=[],S=[];for(let D=0;D<this.$_terms.whens.length;++D){const I=this.$_terms.whens[D];if(I.concat){x.push(I.concat),S.push(`${D}.concat`);continue}const T=I.ref?I.ref.resolve(c,m,y):c,P=I.is?[I]:I.switch,J=S.length;for(let q=0;q<P.length;++q){const{is:L,then:F,otherwise:B}=P[q],W=`${D}${I.switch?"."+q:""}`;if(L.$_match(T,m.nest(L,`${W}.is`),y)){if(F){const se=m.localize([...m.path,`${W}.then`],m.ancestors,m.schemas),{schema:de,id:ne}=F._generate(c,se,y);x.push(de),S.push(`${W}.then${ne?`(${ne})`:""}`);break}}else if(B){const se=m.localize([...m.path,`${W}.otherwise`],m.ancestors,m.schemas),{schema:de,id:ne}=B._generate(c,se,y);x.push(de),S.push(`${W}.otherwise${ne?`(${ne})`:""}`);break}}if(I.break&&S.length>J)break}const R=S.join(", ");if(m.mainstay.tracer.debug(m,"rule","when",R),!R)return{schema:this};if(!m.mainstay.tracer.active&&this.$_temp.whens[R])return{schema:this.$_temp.whens[R],id:R};let C=this;this._definition.generate&&(C=this._definition.generate(this,c,m,y));for(const D of x)C=C.concat(D);return this.$_root._tracer&&this.$_root._tracer._combine(C,[this,...x]),this.$_temp.whens[R]=C,{schema:C,id:R}}_inner(c,m,y={}){o(!this._inRuleset(),`Cannot set ${c} inside a ruleset`);const x=this.clone();return x.$_terms[c]&&!y.override||(x.$_terms[c]=[]),y.single?x.$_terms[c].push(m):x.$_terms[c].push(...m),x.$_temp.ruleset=!1,x}_inRuleset(){return this.$_temp.ruleset!==null&&this.$_temp.ruleset!==!1}_ruleRemove(c,m={}){if(!this._singleRules.has(c))return this;const y=m.clone!==!1?this.clone():this;y._singleRules.delete(c);const x=[];for(let S=0;S<y._rules.length;++S){const R=y._rules[S];R.name!==c||R.keep?x.push(R):y._inRuleset()&&S<y.$_temp.ruleset&&--y.$_temp.ruleset}return y._rules=x,y}_values(c,m){a.verifyFlat(c,m.slice(1,-1));const y=this.clone(),x=c[0]===a.symbols.override;if(x&&(c=c.slice(1)),!y[m]&&c.length?y[m]=new _:x&&(y[m]=c.length?new _:null,y.$_mutateRebuild()),!y[m])return y;x&&y[m].override();for(const S of c){o(S!==void 0,"Cannot call allow/valid/invalid with undefined"),o(S!==a.symbols.override,"Override must be the first value");const R=m==="_invalids"?"_valids":"_invalids";y[R]&&(y[R].remove(S),y[R].length||(o(m==="_valids"||!y._flags.only,"Setting invalid value",S,"leaves schema rejecting all values due to previous valid rule"),y[R]=null)),y[m].add(S,y._refs)}return y}}};v.Base.prototype[a.symbols.any]={version:a.version,compile:n.compile,root:"$_root"},v.Base.prototype.isImmutable=!0,v.Base.prototype.deny=v.Base.prototype.invalid,v.Base.prototype.disallow=v.Base.prototype.invalid,v.Base.prototype.equal=v.Base.prototype.valid,v.Base.prototype.exist=v.Base.prototype.required,v.Base.prototype.not=v.Base.prototype.invalid,v.Base.prototype.options=v.Base.prototype.prefs,v.Base.prototype.preferences=v.Base.prototype.prefs,j.exports=new v.Base},8652:(j,w,g)=>{const o=g(375),b=g(8571),h=g(8160),f={max:1e3,supported:new Set(["undefined","boolean","number","string"])};w.provider={provision:e=>new f.Cache(e)},f.Cache=class{constructor(e={}){h.assertOptions(e,["max"]),o(e.max===void 0||e.max&&e.max>0&&isFinite(e.max),"Invalid max cache size"),this._max=e.max||f.max,this._map=new Map,this._list=new f.List}get length(){return this._map.size}set(e,a){if(e!==null&&!f.supported.has(typeof e))return;let n=this._map.get(e);if(n)return n.value=a,void this._list.first(n);n=this._list.unshift({key:e,value:a}),this._map.set(e,n),this._compact()}get(e){const a=this._map.get(e);if(a)return this._list.first(a),b(a.value)}_compact(){if(this._map.size>this._max){const e=this._list.pop();this._map.delete(e.key)}}},f.List=class{constructor(){this.tail=null,this.head=null}unshift(e){return e.next=null,e.prev=this.head,this.head&&(this.head.next=e),this.head=e,this.tail||(this.tail=e),e}first(e){e!==this.head&&(this._remove(e),this.unshift(e))}pop(){return this._remove(this.tail)}_remove(e){const{next:a,prev:n}=e;return a.prev=n,n&&(n.next=a),e===this.tail&&(this.tail=a),e.prev=null,e.next=null,e}}},8160:(j,w,g)=>{const o=g(375),b=g(7916),h=g(5934);let f,e;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,r,t="Options"){o(n&&typeof n=="object"&&!Array.isArray(n),"Options must be of type object");const l=Object.keys(n).filter(s=>!r.includes(s));o(l.length===0,`${t} contain unknown keys: ${l}`)},w.checkPreferences=function(n){e=e||g(3378);const r=e.preferences.validate(n);if(r.error)throw new b([r.error.details[0].message])},w.compare=function(n,r,t){switch(t){case"=":return n===r;case">":return n>r;case"<":return n<r;case">=":return n>=r;case"<=":return n<=r}},w.default=function(n,r){return n===void 0?r: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,r={}){const t=n&&n[w.symbols.any];return!!t&&(o(r.legacy||t.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,r){f=f||g(6914),n=n||{},r=r||{};const t=Object.assign({},n,r);return r.errors&&n.errors&&(t.errors=Object.assign({},n.errors,r.errors),t.errors.wrap=Object.assign({},n.errors.wrap,r.errors.wrap)),r.messages&&(t.messages=f.compile(r.messages,n.messages)),delete t[w.symbols.prefs],t},w.tryWithPath=function(n,r,t={}){try{return n()}catch(l){throw l.path!==void 0?l.path=r+"."+l.path:l.path=r,t.append&&(l.message=`${l.message} (${l.path})`),l}},w.validateArg=function(n,r,{assert:t,message:l}){if(w.isSchema(t)){const s=t.validate(n);return s.error?s.error.message:void 0}if(!t(n))return r?`${r} ${l}`:l},w.verifyFlat=function(n,r){for(const t of n)o(!Array.isArray(t),"Method no longer accepts array arguments:",r)}},3292:(j,w,g)=>{const o=g(375),b=g(8160),h=g(6133),f={};w.schema=function(e,a,n={}){b.assertOptions(n,["appendPath","override"]);try{return f.schema(e,a,n)}catch(r){throw n.appendPath&&r.path!==void 0&&(r.message=`${r.message} (${r.path})`),r}},f.schema=function(e,a,n){o(a!==void 0,"Invalid undefined schema"),Array.isArray(a)&&(o(a.length,"Invalid empty array schema"),a.length===1&&(a=a[0]));const r=(t,...l)=>n.override!==!1?t.valid(e.override,...l):t.valid(...l);if(f.simple(a))return r(e,a);if(typeof a=="function")return e.custom(a);if(o(typeof a=="object","Invalid schema content:",typeof a),b.isResolvable(a))return r(e,a);if(b.isSchema(a))return a;if(Array.isArray(a)){for(const t of a)if(!f.simple(t))return e.alternatives().try(...a);return r(e,...a)}return a instanceof RegExp?e.string().regex(a):a instanceof Date?r(e.date(),a):(o(Object.getPrototypeOf(a)===Object.getPrototypeOf({}),"Schema can only contain plain objects"),e.object().keys(a))},w.ref=function(e,a){return h.isRef(e)?e:h.create(e,a)},w.compile=function(e,a,n={}){b.assertOptions(n,["legacy"]);const r=a&&a[b.symbols.any];if(r)return o(n.legacy||r.version===b.version,"Cannot mix different versions of joi schemas:",r.version,b.version),a;if(typeof a!="object"||!n.legacy)return w.schema(e,a,{appendPath:!0});const t=f.walk(a);return t?t.compile(t.root,a):w.schema(e,a,{appendPath:!0})},f.walk=function(e){if(typeof e!="object")return null;if(Array.isArray(e)){for(const n of e){const r=f.walk(n);if(r)return r}return null}const a=e[b.symbols.any];if(a)return{root:e[a.root],compile:a.compile};o(Object.getPrototypeOf(e)===Object.getPrototypeOf({}),"Schema can only contain plain objects");for(const n in e){const r=f.walk(e[n]);if(r)return r}return null},f.simple=function(e){return e===null||["boolean","string","number"].includes(typeof e)},w.when=function(e,a,n){if(n===void 0&&(o(a&&typeof a=="object","Missing options"),n=a,a=h.create(".")),Array.isArray(n)&&(n={switch:n}),b.assertOptions(n,["is","not","then","otherwise","switch","break"]),b.isSchema(a))return o(n.is===void 0,'"is" can not be used with a schema condition'),o(n.not===void 0,'"not" can not be used with a schema condition'),o(n.switch===void 0,'"switch" can not be used with a schema condition'),f.condition(e,{is:a,then:n.then,otherwise:n.otherwise,break:n.break});if(o(h.isRef(a)||typeof a=="string","Invalid condition:",a),o(n.not===void 0||n.is===void 0,'Cannot combine "is" with "not"'),n.switch===void 0){let t=n;n.not!==void 0&&(t={is:n.not,then:n.otherwise,otherwise:n.then,break:n.break});let l=t.is!==void 0?e.$_compile(t.is):e.$_root.invalid(null,!1,0,"").required();return o(t.then!==void 0||t.otherwise!==void 0,'options must have at least one of "then", "otherwise", or "switch"'),o(t.break===void 0||t.then===void 0||t.otherwise===void 0,"Cannot specify then, otherwise, and break all together"),n.is===void 0||h.isRef(n.is)||b.isSchema(n.is)||(l=l.required()),f.condition(e,{ref:w.ref(a),is:l,then:t.then,otherwise:t.otherwise,break:t.break})}o(Array.isArray(n.switch),'"switch" must be an array'),o(n.is===void 0,'Cannot combine "switch" with "is"'),o(n.not===void 0,'Cannot combine "switch" with "not"'),o(n.then===void 0,'Cannot combine "switch" with "then"');const r={ref:w.ref(a),switch:[],break:n.break};for(let t=0;t<n.switch.length;++t){const l=n.switch[t],s=t===n.switch.length-1;b.assertOptions(l,s?["is","then","otherwise"]:["is","then"]),o(l.is!==void 0,'Switch statement missing "is"'),o(l.then!==void 0,'Switch statement missing "then"');const i={is:e.$_compile(l.is),then:e.$_compile(l.then)};if(h.isRef(l.is)||b.isSchema(l.is)||(i.is=i.is.required()),s){o(n.otherwise===void 0||l.otherwise===void 0,'Cannot specify "otherwise" inside and outside a "switch"');const u=n.otherwise!==void 0?n.otherwise:l.otherwise;u!==void 0&&(o(r.break===void 0,"Cannot specify both otherwise and break"),i.otherwise=e.$_compile(u))}r.switch.push(i)}return r},f.condition=function(e,a){for(const n of["then","otherwise"])a[n]===void 0?delete a[n]:a[n]=e.$_compile(a[n]);return a}},6354:(j,w,g)=>{const o=g(5688),b=g(8160),h=g(3328);w.Report=class{constructor(f,e,a,n,r,t,l){if(this.code=f,this.flags=n,this.messages=r,this.path=t.path,this.prefs=l,this.state=t,this.value=e,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 s=this.path[this.path.length-1];typeof s!="object"&&(this.local.key=s)}}_setTemplate(f){if(this.template=f,!this.flags.label&&this.path.length===0){const e=this._template(this.template,"root");e&&(this.local.label=e)}}toString(){if(this.message)return this.message;const f=this.code;if(!this.prefs.errors.render)return this.code;const e=this._template(this.template)||this._template(this.prefs.messages)||this._template(this.messages);return e===void 0?`Error code "${f}" is not defined, your custom type is missing the correct messages definition`:(this.message=e.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(f,e){return w.template(this.value,f,e||this.code,this.state,this.prefs)}},w.path=function(f){let e="";for(const a of f)typeof a!="object"&&(typeof a=="string"?(e&&(e+="."),e+=a):e+=`[${a}]`);return e},w.template=function(f,e,a,n,r){if(!e)return;if(h.isTemplate(e))return a!=="root"?e:null;let t=r.errors.language;if(b.isResolvable(t)&&(t=t.resolve(f,n,r)),t&&e[t]){if(e[t][a]!==void 0)return e[t][a];if(e[t]["*"]!==void 0)return e[t]["*"]}return e[a]?e[a]:e["*"]},w.label=function(f,e,a,n){if(!a.errors.label)return"";if(f.label)return f.label;let r=e.path;return a.errors.label==="key"&&e.path.length>1&&(r=e.path.slice(-1)),w.path(r)||w.template(null,a.messages,"root",e,a)||n&&w.template(null,n,"root",e,a)||"value"},w.process=function(f,e,a){if(!f)return null;const{override:n,message:r,details:t}=w.details(f);if(n)return n;if(a.errors.stack)return new w.ValidationError(r,t,e);const l=Error.stackTraceLimit;Error.stackTraceLimit=0;const s=new w.ValidationError(r,t,e);return Error.stackTraceLimit=l,s},w.details=function(f,e={}){let a=[];const n=[];for(const r of f){if(r instanceof Error){if(e.override!==!1)return{override:r};const l=r.toString();a.push(l),n.push({message:l,type:"override",context:{error:r}});continue}const t=r.toString();a.push(t),n.push({message:t,path:r.path.filter(l=>typeof l!="object"),type:r.code,context:r.local})}return a.length>1&&(a=[...new Set(a)]),{message:a.join(". "),details:n}},w.ValidationError=class extends Error{constructor(f,e,a){super(f),this._original=a,this.details=e}static isError(f){return f instanceof w.ValidationError}},w.ValidationError.prototype.isJoi=!0,w.ValidationError.prototype.name="ValidationError",w.ValidationError.prototype.annotate=o.error},8901:(j,w,g)=>{const o=g(375),b=g(8571),h=g(8160),f=g(6914),e={};w.type=function(a,n){const r=Object.getPrototypeOf(a),t=b(r),l=a._assign(Object.create(t)),s=Object.assign({},n);delete s.base,t._definition=s;const i=r._definition||{};s.messages=f.merge(i.messages,s.messages),s.properties=Object.assign({},i.properties,s.properties),l.type=s.type,s.flags=Object.assign({},i.flags,s.flags);const u=Object.assign({},i.terms);if(s.terms)for(const v in s.terms){const c=s.terms[v];o(l.$_terms[v]===void 0,"Invalid term override for",s.type,v),l.$_terms[v]=c.init,u[v]=c}s.terms=u,s.args||(s.args=i.args),s.prepare=e.prepare(s.prepare,i.prepare),s.coerce&&(typeof s.coerce=="function"&&(s.coerce={method:s.coerce}),s.coerce.from&&!Array.isArray(s.coerce.from)&&(s.coerce={method:s.coerce.method,from:[].concat(s.coerce.from)})),s.coerce=e.coerce(s.coerce,i.coerce),s.validate=e.validate(s.validate,i.validate);const d=Object.assign({},i.rules);if(s.rules)for(const v in s.rules){const c=s.rules[v];o(typeof c=="object","Invalid rule definition for",s.type,v);let m=c.method;if(m===void 0&&(m=function(){return this.$_addRule(v)}),m&&(o(!t[v],"Rule conflict in",s.type,v),t[v]=m),o(!d[v],"Rule conflict in",s.type,v),d[v]=c,c.alias){const y=[].concat(c.alias);for(const x of y)t[x]=c.method}c.args&&(c.argsByName=new Map,c.args=c.args.map(y=>(typeof y=="string"&&(y={name:y}),o(!c.argsByName.has(y.name),"Duplicated argument name",y.name),h.isSchema(y.assert)&&(y.assert=y.assert.strict().label(y.name)),c.argsByName.set(y.name,y),y)))}s.rules=d;const p=Object.assign({},i.modifiers);if(s.modifiers)for(const v in s.modifiers){o(!t[v],"Rule conflict in",s.type,v);const c=s.modifiers[v];o(typeof c=="function","Invalid modifier definition for",s.type,v);const m=function(y){return this.rule({[v]:y})};t[v]=m,p[v]=c}if(s.modifiers=p,s.overrides){t._super=r,l.$_super={};for(const v in s.overrides)o(r[v],"Cannot override missing",v),s.overrides[v][h.symbols.parent]=r[v],l.$_super[v]=r[v].bind(l);Object.assign(t,s.overrides)}s.cast=Object.assign({},i.cast,s.cast);const _=Object.assign({},i.manifest,s.manifest);return _.build=e.build(s.manifest&&s.manifest.build,i.manifest&&i.manifest.build),s.manifest=_,s.rebuild=e.rebuild(s.rebuild,i.rebuild),l},e.build=function(a,n){return a&&n?function(r,t){return n(a(r,t),t)}:a||n},e.coerce=function(a,n){return a&&n?{from:a.from&&n.from?[...new Set([...a.from,...n.from])]:null,method(r,t){let l;if((!n.from||n.from.includes(typeof r))&&(l=n.method(r,t),l)){if(l.errors||l.value===void 0)return l;r=l.value}if(!a.from||a.from.includes(typeof r)){const s=a.method(r,t);if(s)return s}return l}}:a||n},e.prepare=function(a,n){return a&&n?function(r,t){const l=a(r,t);if(l){if(l.errors||l.value===void 0)return l;r=l.value}return n(r,t)||l}:a||n},e.rebuild=function(a,n){return a&&n?function(r){n(r),a(r)}:a||n},e.validate=function(a,n){return a&&n?function(r,t){const l=n(r,t);if(l){if(l.errors&&(!Array.isArray(l.errors)||l.errors.length))return l;r=l.value}return a(r,t)||l}:a||n}},5107:(j,w,g)=>{const o=g(375),b=g(8571),h=g(8652),f=g(8160),e=g(3292),a=g(6354),n=g(8901),r=g(9708),t=g(6133),l=g(3328),s=g(1152);let i;const u={types:{alternatives:g(4946),any:g(8068),array:g(546),boolean:g(4937),date:g(7500),function:g(390),link:g(8785),number:g(3832),object:g(8966),string:g(7417),symbol:g(8826)},aliases:{alt:"alternatives",bool:"boolean",func:"function"},root:function(){const d={_types:new Set(Object.keys(u.types))};for(const p of d._types)d[p]=function(..._){return o(!_.length||["alternatives","link","object"].includes(p),"The",p,"type does not allow arguments"),u.generate(this,u.types[p],_)};for(const p of["allow","custom","disallow","equal","exist","forbidden","invalid","not","only","optional","options","prefs","preferences","required","strip","valid","when"])d[p]=function(..._){return this.any()[p](..._)};Object.assign(d,u.methods);for(const p in u.aliases){const _=u.aliases[p];d[p]=d[_]}return d.x=d.expression,s.setup&&s.setup(d),d}};u.methods={ValidationError:a.ValidationError,version:f.version,cache:h.provider,assert(d,p,..._){u.assert(d,p,!0,_)},attempt:(d,p,..._)=>u.assert(d,p,!1,_),build(d){return o(typeof r.build=="function","Manifest functionality disabled"),r.build(this,d)},checkPreferences(d){f.checkPreferences(d)},compile(d,p){return e.compile(this,d,p)},defaults(d){o(typeof d=="function","modifier must be a function");const p=Object.assign({},this);for(const _ of p._types){const v=d(p[_]());o(f.isSchema(v),"modifier must return a valid schema object"),p[_]=function(...c){return u.generate(this,v,c)}}return p},expression:(...d)=>new l(...d),extend(...d){f.verifyFlat(d,"extend"),i=i||g(3378),o(d.length,"You need to provide at least one extension"),this.assert(d,i.extensions);const p=Object.assign({},this);p._types=new Set(p._types);for(let _ of d){typeof _=="function"&&(_=_(p)),this.assert(_,i.extension);const v=u.expandExtension(_,p);for(const c of v){o(p[c.type]===void 0||p._types.has(c.type),"Cannot override name",c.type);const m=c.base||this.any(),y=n.type(m,c);p._types.add(c.type),p[c.type]=function(...x){return u.generate(this,y,x)}}}return p},isError:a.ValidationError.isError,isExpression:l.isTemplate,isRef:t.isRef,isSchema:f.isSchema,in:(...d)=>t.in(...d),override:f.symbols.override,ref:(...d)=>t.create(...d),types(){const d={};for(const p of this._types)d[p]=this[p]();for(const p in u.aliases)d[p]=this[p]();return d}},u.assert=function(d,p,_,v){const c=v[0]instanceof Error||typeof v[0]=="string"?v[0]:null,m=c!==null?v[1]:v[0],y=p.validate(d,f.preferences({errors:{stack:!0}},m||{}));let x=y.error;if(!x)return y.value;if(c instanceof Error)throw c;const S=_&&typeof x.annotate=="function"?x.annotate():x.message;throw x instanceof a.ValidationError==0&&(x=b(x)),x.message=c?`${c} ${S}`:S,x},u.generate=function(d,p,_){return o(d,"Must be invoked on a Joi instance."),p.$_root=d,p._definition.args&&_.length?p._definition.args(p,..._):p},u.expandExtension=function(d,p){if(typeof d.type=="string")return[d];const _=[];for(const v of p._types)if(d.type.test(v)){const c=Object.assign({},d);c.type=v,c.base=p[v](),_.push(c)}return _},j.exports=u.root()},6914:(j,w,g)=>{const o=g(375),b=g(8571),h=g(3328);w.compile=function(f,e){if(typeof f=="string")return o(!e,"Cannot set single message string"),new h(f);if(h.isTemplate(f))return o(!e,"Cannot set single message template"),f;o(typeof f=="object"&&!Array.isArray(f),"Invalid message options"),e=e?b(e):{};for(let a in f){const n=f[a];if(a==="root"||h.isTemplate(n)){e[a]=n;continue}if(typeof n=="string"){e[a]=new h(n);continue}o(typeof n=="object"&&!Array.isArray(n),"Invalid message for",a);const r=a;for(a in e[r]=e[r]||{},n){const t=n[a];a==="root"||h.isTemplate(t)?e[r][a]=t:(o(typeof t=="string","Invalid message for",a,"in",r),e[r][a]=new h(t))}}return e},w.decompile=function(f){const e={};for(let a in f){const n=f[a];if(a==="root"){e.root=n;continue}if(h.isTemplate(n)){e[a]=n.describe({compact:!0});continue}const r=a;for(a in e[r]={},n){const t=n[a];a!=="root"?e[r][a]=t.describe({compact:!0}):e[r].root=t}}return e},w.merge=function(f,e){if(!f)return w.compile(e);if(!e)return f;if(typeof e=="string")return new h(e);if(h.isTemplate(e))return e;const a=b(f);for(let n in e){const r=e[n];if(n==="root"||h.isTemplate(r)){a[n]=r;continue}if(typeof r=="string"){a[n]=new h(r);continue}o(typeof r=="object"&&!Array.isArray(r),"Invalid message for",n);const t=n;for(n in a[t]=a[t]||{},r){const l=r[n];n==="root"||h.isTemplate(l)?a[t][n]=l:(o(typeof l=="string","Invalid message for",n,"in",t),a[t][n]=new h(l))}}return a}},2294:(j,w,g)=>{const o=g(375),b=g(8160),h=g(6133),f={};w.Ids=f.Ids=class{constructor(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}clone(){const e=new f.Ids;return e._byId=new Map(this._byId),e._byKey=new Map(this._byKey),e._schemaChain=this._schemaChain,e}concat(e){e._schemaChain&&(this._schemaChain=!0);for(const[a,n]of e._byId.entries())o(!this._byKey.has(a),"Schema id conflicts with existing key:",a),this._byId.set(a,n);for(const[a,n]of e._byKey.entries())o(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,n)}fork(e,a,n){const r=this._collect(e);r.push({schema:n});const t=r.shift();let l={id:t.id,schema:a(t.schema)};o(b.isSchema(l.schema),"adjuster function failed to return a joi schema type");for(const s of r)l={id:s.id,schema:f.fork(s.schema,l.id,l.schema)};return l.schema}labels(e,a=[]){const n=e[0],r=this._get(n);if(!r)return[...a,...e].join(".");const t=e.slice(1);return a=[...a,r.schema._flags.label||n],t.length?r.schema._ids.labels(t,a):a.join(".")}reach(e,a=[]){const n=e[0],r=this._get(n);o(r,"Schema does not contain path",[...a,...e].join("."));const t=e.slice(1);return t.length?r.schema._ids.reach(t,[...a,n]):r.schema}register(e,{key:a}={}){if(!e||!b.isSchema(e))return;(e.$_property("schemaChain")||e._ids._schemaChain)&&(this._schemaChain=!0);const n=e._flags.id;if(n){const r=this._byId.get(n);o(!r||r.schema===e,"Cannot add different schemas with the same id:",n),o(!this._byKey.has(n),"Schema id conflicts with existing key:",n),this._byId.set(n,{schema:e,id:n})}a&&(o(!this._byKey.has(a),"Schema already contains key:",a),o(!this._byId.has(a),"Schema key conflicts with existing id:",a),this._byKey.set(a,{schema:e,id:a}))}reset(){this._byId=new Map,this._byKey=new Map,this._schemaChain=!1}_collect(e,a=[],n=[]){const r=e[0],t=this._get(r);o(t,"Schema does not contain path",[...a,...e].join(".")),n=[t,...n];const l=e.slice(1);return l.length?t.schema._ids._collect(l,[...a,r],n):n}_get(e){return this._byId.get(e)||this._byKey.get(e)}},f.fork=function(e,a,n){const r=w.schema(e,{each:(t,{key:l})=>{if(a===(t._flags.id||l))return n},ref:!1});return r?r.$_mutateRebuild():e},w.schema=function(e,a){let n;for(const r in e._flags){if(r[0]==="_")continue;const t=f.scan(e._flags[r],{source:"flags",name:r},a);t!==void 0&&(n=n||e.clone(),n._flags[r]=t)}for(let r=0;r<e._rules.length;++r){const t=e._rules[r],l=f.scan(t.args,{source:"rules",name:t.name},a);if(l!==void 0){n=n||e.clone();const s=Object.assign({},t);s.args=l,n._rules[r]=s,n._singleRules.get(t.name)===t&&n._singleRules.set(t.name,s)}}for(const r in e.$_terms){if(r[0]==="_")continue;const t=f.scan(e.$_terms[r],{source:"terms",name:r},a);t!==void 0&&(n=n||e.clone(),n.$_terms[r]=t)}return n},f.scan=function(e,a,n,r,t){const l=r||[];if(e===null||typeof e!="object")return;let s;if(Array.isArray(e)){for(let i=0;i<e.length;++i){const u=a.source==="terms"&&a.name==="keys"&&e[i].key,d=f.scan(e[i],a,n,[i,...l],u);d!==void 0&&(s=s||e.slice(),s[i]=d)}return s}if(n.schema!==!1&&b.isSchema(e)||n.ref!==!1&&h.isRef(e)){const i=n.each(e,{...a,path:l,key:t});return i===e?void 0:i}for(const i in e){if(i[0]==="_")continue;const u=f.scan(e[i],a,n,[i,...l],t);u!==void 0&&(s=s||Object.assign({},e),s[i]=u)}return s}},6133:(j,w,g)=>{const o=g(375),b=g(8571),h=g(9621),f=g(8160);let e;const a={symbol:Symbol("ref"),defaults:{adjust:null,in:!1,iterables:null,map:null,separator:".",type:"value"}};w.create=function(n,r={}){o(typeof n=="string","Invalid reference key:",n),f.assertOptions(r,["adjust","ancestor","in","iterables","map","prefix","render","separator"]),o(!r.prefix||typeof r.prefix=="object","options.prefix must be of type object");const t=Object.assign({},a.defaults,r);delete t.prefix;const l=t.separator,s=a.context(n,l,r.prefix);if(t.type=s.type,n=s.key,t.type==="value")if(s.root&&(o(!l||n[0]!==l,"Cannot specify relative path with root prefix"),t.ancestor="root",n||(n=null)),l&&l===n)n=null,t.ancestor=0;else if(t.ancestor!==void 0)o(!l||!n||n[0]!==l,"Cannot combine prefix with ancestor option");else{const[i,u]=a.ancestor(n,l);u&&(n=n.slice(u))===""&&(n=null),t.ancestor=i}return t.path=l?n===null?[]:n.split(l):[n],new a.Ref(t)},w.in=function(n,r={}){return w.create(n,{...r,in:!0})},w.isRef=function(n){return!!n&&!!n[f.symbols.ref]},a.Ref=class{constructor(n){o(typeof n=="object","Invalid reference construction"),f.assertOptions(n,["adjust","ancestor","in","iterables","map","path","render","separator","type","depth","key","root","display"]),o([!1,void 0].includes(n.separator)||typeof n.separator=="string"&&n.separator.length===1,"Invalid separator"),o(!n.adjust||typeof n.adjust=="function","options.adjust must be a function"),o(!n.map||Array.isArray(n.map),"options.map must be an array"),o(!n.map||!n.adjust,"Cannot set both map and adjust options"),Object.assign(this,a.defaults,n),o(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,r,t,l,s={}){return o(!this.in||s.in,"Invalid in() reference usage"),this.type==="global"?this._resolve(t.context,r,s):this.type==="local"?this._resolve(l,r,s):this.ancestor?this.ancestor==="root"?this._resolve(r.ancestors[r.ancestors.length-1],r,s):(o(this.ancestor<=r.ancestors.length,"Invalid reference exceeds the schema root:",this.display),this._resolve(r.ancestors[this.ancestor-1],r,s)):this._resolve(n,r,s)}_resolve(n,r,t){let l;if(this.type==="value"&&r.mainstay.shadow&&t.shadow!==!1&&(l=r.mainstay.shadow.get(this.absolute(r))),l===void 0&&(l=h(n,this.path,{iterables:this.iterables,functions:!0})),this.adjust&&(l=this.adjust(l)),this.map){const s=this.map.get(l);s!==void 0&&(l=s)}return r.mainstay&&r.mainstay.tracer.resolve(r,this,l),l}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 r of["adjust","iterables","render"])this[r]!==null&&this[r]!==void 0&&(n[r]=this[r]);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 r=new Array(this.ancestor+1).fill(this.separator).join("");this.display=`ref:${r}${n||""}`}},a.Ref.prototype[f.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,r,t={}){if(n=n.trim(),t){const l=t.global===void 0?"$":t.global;if(l!==r&&n.startsWith(l))return{key:n.slice(l.length),type:"global"};const s=t.local===void 0?"#":t.local;if(s!==r&&n.startsWith(s))return{key:n.slice(s.length),type:"local"};const i=t.root===void 0?"/":t.root;if(i!==r&&n.startsWith(i))return{key:n.slice(i.length),type:"value",root:!0}}return{key:n,type:"value"}},a.ancestor=function(n,r){if(!r)return[1,0];if(n[0]!==r)return[1,0];if(n[1]!==r)return[0,1];let t=2;for(;n[t]===r;)++t;return[t-1,t]},w.toSibling=0,w.toParent=1,w.Manager=class{constructor(){this.refs=[]}register(n,r){if(n)if(r=r===void 0?w.toParent:r,Array.isArray(n))for(const t of n)this.register(t,r);else if(f.isSchema(n))for(const t of n._refs.refs)t.ancestor-r>=0&&this.refs.push({ancestor:t.ancestor-r,root:t.root});else w.isRef(n)&&n.type==="value"&&n.ancestor-r>=0&&this.refs.push({ancestor:n.ancestor-r,root:n.root}),e=e||g(3328),e.isTemplate(n)&&this.register(n.refs(),r)}get length(){return this.refs.length}clone(){const n=new w.Manager;return n.refs=b(this.refs),n}reset(){this.refs=[]}roots(){return this.refs.filter(n=>!n.ancestor).map(n=>n.root)}}},3378:(j,w,g)=>{const o=g(5107),b={};b.wrap=o.string().min(1).max(2).allow(!1),w.preferences=o.object({allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),context:o.object(),convert:o.boolean(),dateFormat:o.valid("date","iso","string","time","utc"),debug:o.boolean(),errors:{escapeHtml:o.boolean(),label:o.valid("path","key",!1),language:[o.string(),o.object().ref()],render:o.boolean(),stack:o.boolean(),wrap:{label:b.wrap,array:b.wrap,string:b.wrap}},externals:o.boolean(),messages:o.object(),noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:o.valid("required","optional","forbidden"),skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()}).strict(),b.nameRx=/^[a-zA-Z0-9]\w*$/,b.rule=o.object({alias:o.array().items(o.string().pattern(b.nameRx)).single(),args:o.array().items(o.string(),o.object({name:o.string().pattern(b.nameRx).required(),ref:o.boolean(),assert:o.alternatives([o.function(),o.object().schema()]).conditional("ref",{is:!0,then:o.required()}),normalize:o.function(),message:o.string().when("assert",{is:o.function(),then:o.required()})})),convert:o.boolean(),manifest:o.boolean(),method:o.function().allow(!1),multi:o.boolean(),validate:o.function()}),w.extension=o.object({type:o.alternatives([o.string(),o.object().regex()]).required(),args:o.function(),cast:o.object().pattern(b.nameRx,o.object({from:o.function().maxArity(1).required(),to:o.function().minArity(1).maxArity(2).required()})),base:o.object().schema().when("type",{is:o.object().regex(),then:o.forbidden()}),coerce:[o.function().maxArity(3),o.object({method:o.function().maxArity(3).required(),from:o.array().items(o.string()).single()})],flags:o.object().pattern(b.nameRx,o.object({setter:o.string(),default:o.any()})),manifest:{build:o.function().arity(2)},messages:[o.object(),o.string()],modifiers:o.object().pattern(b.nameRx,o.function().minArity(1).maxArity(2)),overrides:o.object().pattern(b.nameRx,o.function()),prepare:o.function().maxArity(3),rebuild:o.function().arity(1),rules:o.object().pattern(b.nameRx,b.rule),terms:o.object().pattern(b.nameRx,o.object({init:o.array().allow(null).required(),manifest:o.object().pattern(/.+/,[o.valid("schema","single"),o.object({mapped:o.object({from:o.string().required(),to:o.string().required()}).required()})])})),validate:o.function().maxArity(3)}).strict(),w.extensions=o.array().items(o.object(),o.function().arity(1)).strict(),b.desc={buffer:o.object({buffer:o.string()}),func:o.object({function:o.function().required(),options:{literal:!0}}),override:o.object({override:!0}),ref:o.object({ref:o.object({type:o.valid("value","global","local"),path:o.array().required(),separator:o.string().length(1).allow(!1),ancestor:o.number().min(0).integer().allow("root"),map:o.array().items(o.array().length(2)).min(1),adjust:o.function(),iterables:o.boolean(),in:o.boolean(),render:o.boolean()}).required()}),regex:o.object({regex:o.string().min(3)}),special:o.object({special:o.valid("deep").required()}),template:o.object({template:o.string().required(),options:o.object()}),value:o.object({value:o.alternatives([o.object(),o.array()]).required()})},b.desc.entity=o.alternatives([o.array().items(o.link("...")),o.boolean(),o.function(),o.number(),o.string(),b.desc.buffer,b.desc.func,b.desc.ref,b.desc.regex,b.desc.special,b.desc.template,b.desc.value,o.link("/")]),b.desc.values=o.array().items(null,o.boolean(),o.function(),o.number().allow(1/0,-1/0),o.string().allow(""),o.symbol(),b.desc.buffer,b.desc.func,b.desc.override,b.desc.ref,b.desc.regex,b.desc.template,b.desc.value),b.desc.messages=o.object().pattern(/.+/,[o.string(),b.desc.template,o.object().pattern(/.+/,[o.string(),b.desc.template])]),w.description=o.object({type:o.string().required(),flags:o.object({cast:o.string(),default:o.any(),description:o.string(),empty:o.link("/"),failover:b.desc.entity,id:o.string(),label:o.string(),only:!0,presence:["optional","required","forbidden"],result:["raw","strip"],strip:o.boolean(),unit:o.string()}).unknown(),preferences:{allowUnknown:o.boolean(),abortEarly:o.boolean(),artifacts:o.boolean(),cache:o.boolean(),convert:o.boolean(),dateFormat:["date","iso","string","time","utc"],errors:{escapeHtml:o.boolean(),label:["path","key"],language:[o.string(),b.desc.ref],wrap:{label:b.wrap,array:b.wrap}},externals:o.boolean(),messages:b.desc.messages,noDefaults:o.boolean(),nonEnumerables:o.boolean(),presence:["required","optional","forbidden"],skipFunctions:o.boolean(),stripUnknown:o.object({arrays:o.boolean(),objects:o.boolean()}).or("arrays","objects").allow(!0,!1),warnings:o.boolean()},allow:b.desc.values,invalid:b.desc.values,rules:o.array().min(1).items({name:o.string().required(),args:o.object().min(1),keep:o.boolean(),message:[o.string(),b.desc.messages],warn:o.boolean()}),keys:o.object().pattern(/.*/,o.link("/")),link:b.desc.ref}).pattern(/^[a-z]\w*$/,o.any())},493:(j,w,g)=>{const o=g(8571),b=g(9621),h=g(8160),f={value:Symbol("value")};j.exports=f.State=class{constructor(e,a,n){this.path=e,this.ancestors=a,this.mainstay=n.mainstay,this.schemas=n.schemas,this.debug=null}localize(e,a=null,n=null){const r=new f.State(e,a,this);return n&&r.schemas&&(r.schemas=[f.schemas(n),...r.schemas]),r}nest(e,a){const n=new f.State(this.path,this.ancestors,this);return n.schemas=n.schemas&&[f.schemas(e),...n.schemas],n.debug=a,n}shadow(e,a){this.mainstay.shadow=this.mainstay.shadow||new f.Shadow,this.mainstay.shadow.set(this.path,e,a)}snapshot(){this.mainstay.shadow&&(this._snapshot=o(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()}},f.schemas=function(e){return h.isSchema(e)?{schema:e}:e},f.Shadow=class{constructor(){this._values=null}set(e,a,n){if(!e.length||n==="strip"&&typeof e[e.length-1]=="number")return;this._values=this._values||new Map;let r=this._values;for(let t=0;t<e.length;++t){const l=e[t];let s=r.get(l);s||(s=new Map,r.set(l,s)),r=s}r[f.value]=a}get(e){const a=this.node(e);if(a)return a[f.value]}node(e){if(this._values)return b(this._values,e,{iterables:!0})}override(e,a){if(!this._values)return;const n=e.slice(0,-1),r=e[e.length-1],t=b(this._values,n,{iterables:!0});a?t.set(r,a):t&&t.delete(r)}}},3328:(j,w,g)=>{const o=g(375),b=g(8571),h=g(5277),f=g(1447),e=g(8160),a=g(6354),n=g(6133),r={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}};j.exports=r.Template=class{constructor(t,l){if(o(typeof t=="string","Template source must be a string"),o(!t.includes("\0")&&!t.includes(""),"Template source cannot contain reserved control characters"),this.source=t,this.rendered=t,this._template=null,l){const{functions:s,...i}=l;this._settings=Object.keys(i).length?b(i):void 0,this._functions=s,this._functions&&(o(Object.keys(this._functions).every(u=>typeof u=="string"),"Functions keys must be strings"),o(Object.values(this._functions).every(u=>typeof u=="function"),"Functions values must be functions"))}else this._settings=void 0,this._functions=void 0;this._parse()}_parse(){if(!this.source.includes("{"))return;const t=r.encode(this.source),l=r.split(t);let s=!1;const i=[],u=l.shift();u&&i.push(u);for(const d of l){const p=d[0]!=="{",_=p?"}":"}}",v=d.indexOf(_);if(v===-1||d[1]==="{"){i.push(`{${r.decode(d)}`);continue}let c=d.slice(p?0:1,v);const m=c[0]===":";m&&(c=c.slice(1));const y=this._ref(r.decode(c),{raw:p,wrapped:m});i.push(y),typeof y!="string"&&(s=!0);const x=d.slice(v+_.length);x&&i.push(r.decode(x))}s?this._template=i:this.rendered=i.join("")}static date(t,l){return r.dateFormat[l.dateFormat].call(t)}describe(t={}){if(!this._settings&&t.compact)return this.source;const l={template:this.source};return this._settings&&(l.options=this._settings),this._functions&&(l.functions=this._functions),l}static build(t){return new r.Template(t.template,t.options||t.functions?{...t.options,functions:t.functions}:void 0)}isDynamic(){return!!this._template}static isTemplate(t){return!!t&&!!t[e.symbols.template]}refs(){if(!this._template)return;const t=[];for(const l of this._template)typeof l!="string"&&t.push(...l.refs);return t}resolve(t,l,s,i){return this._template&&this._template.length===1?this._part(this._template[0],t,l,s,i,{}):this.render(t,l,s,i)}_part(t,...l){return t.ref?t.ref.resolve(...l):t.formula.evaluate(l)}render(t,l,s,i,u={}){if(!this.isDynamic())return this.rendered;const d=[];for(const p of this._template)if(typeof p=="string")d.push(p);else{const _=this._part(p,t,l,s,i,u),v=r.stringify(_,t,l,s,i,u);if(v!==void 0){const c=p.raw||(u.errors&&u.errors.escapeHtml)===!1?v:h(v);d.push(r.wrap(c,p.wrapped&&s.errors.wrap.label))}}return d.join("")}_ref(t,{raw:l,wrapped:s}){const i=[],u=p=>{const _=n.create(p,this._settings);return i.push(_),v=>{const c=_.resolve(...v);return c!==void 0?c:null}};try{const p=this._functions?{...r.functions,...this._functions}:r.functions;var d=new f.Parser(t,{reference:u,functions:p,constants:r.constants})}catch(p){throw p.message=`Invalid template variable "${t}" fails due to: ${p.message}`,p}if(d.single){if(d.single.type==="reference"){const p=i[0];return{ref:p,raw:l,refs:i,wrapped:s||p.type==="local"&&p.key==="label"}}return r.stringify(d.single.value)}return{formula:d,raw:l,refs:i}}toString(){return this.source}},r.Template.prototype[e.symbols.template]=!0,r.Template.prototype.isImmutable=!0,r.encode=function(t){return t.replace(/\\(\{+)/g,(l,s)=>r.opens.slice(0,s.length)).replace(/\\(\}+)/g,(l,s)=>r.closes.slice(0,s.length))},r.decode=function(t){return t.replace(/\u0000/g,"{").replace(/\u0001/g,"}")},r.split=function(t){const l=[];let s="";for(let i=0;i<t.length;++i){const u=t[i];if(u==="{"){let d="";for(;i+1<t.length&&t[i+1]==="{";)d+="{",++i;l.push(s),s=d}else s+=u}return l.push(s),l},r.wrap=function(t,l){return l?l.length===1?`${l}${t}${l}`:`${l[0]}${t}${l[1]}`:t},r.stringify=function(t,l,s,i,u,d={}){const p=typeof t,_=i&&i.errors&&i.errors.wrap||{};let v=!1;if(n.isRef(t)&&t.render&&(v=t.in,t=t.resolve(l,s,i,u,{in:t.in,...d})),t===null)return"null";if(p==="string")return r.wrap(t,d.arrayItems&&_.string);if(p==="number"||p==="function"||p==="symbol")return t.toString();if(p!=="object")return JSON.stringify(t);if(t instanceof Date)return r.Template.date(t,i);if(t instanceof Map){const m=[];for(const[y,x]of t.entries())m.push(`${y.toString()} -> ${x.toString()}`);t=m}if(!Array.isArray(t))return t.toString();const c=[];for(const m of t)c.push(r.stringify(m,l,s,i,u,{arrayItems:!0,...d}));return r.wrap(c.join(", "),!v&&_.array)},r.constants={true:!0,false:!1,null:null,second:1e3,minute:6e4,hour:36e5,day:864e5},r.functions={if:(t,l,s)=>t?l:s,length:t=>typeof t=="string"?t.length:t&&typeof t=="object"?Array.isArray(t)?t.length:Object.keys(t).length:null,msg(t){const[l,s,i,u,d]=this,p=d.messages;if(!p)return"";const _=a.template(l,p[0],t,s,i)||a.template(l,p[1],t,s,i);return _?_.render(l,s,i,u,d):""},number:t=>typeof t=="number"?t:typeof t=="string"?parseFloat(t):typeof t=="boolean"?t?1:0:t instanceof Date?t.getTime():null}},4946:(j,w,g)=>{const o=g(375),b=g(1687),h=g(8068),f=g(8160),e=g(3292),a=g(6354),n=g(6133),r={};j.exports=h.extend({type:"alternatives",flags:{match:{default:"any"}},terms:{matches:{init:[],register:n.toSibling}},args:(t,...l)=>l.length===1&&Array.isArray(l[0])?t.try(...l[0]):t.try(...l),validate(t,l){const{schema:s,error:i,state:u,prefs:d}=l;if(s._flags.match){const _=[],v=[];for(let m=0;m<s.$_terms.matches.length;++m){const y=s.$_terms.matches[m],x=u.nest(y.schema,`match.${m}`);x.snapshot();const S=y.schema.$_validate(t,x,d);S.errors?(v.push(S.errors),x.restore()):(_.push(S.value),x.commit())}if(_.length===0)return{errors:i("alternatives.any",{details:v.map(m=>a.details(m,{override:!1}))})};if(s._flags.match==="one")return _.length===1?{value:_[0]}:{errors:i("alternatives.one")};if(_.length!==s.$_terms.matches.length)return{errors:i("alternatives.all",{details:v.map(m=>a.details(m,{override:!1}))})};const c=m=>m.$_terms.matches.some(y=>y.schema.type==="object"||y.schema.type==="alternatives"&&c(y.schema));return c(s)?{value:_.reduce((m,y)=>b(m,y,{mergeArrays:!1}))}:{value:_[_.length-1]}}const p=[];for(let _=0;_<s.$_terms.matches.length;++_){const v=s.$_terms.matches[_];if(v.schema){const y=u.nest(v.schema,`match.${_}`);y.snapshot();const x=v.schema.$_validate(t,y,d);if(!x.errors)return y.commit(),x;y.restore(),p.push({schema:v.schema,reports:x.errors});continue}const c=v.ref?v.ref.resolve(t,u,d):t,m=v.is?[v]:v.switch;for(let y=0;y<m.length;++y){const x=m[y],{is:S,then:R,otherwise:C}=x,D=`match.${_}${v.switch?"."+y:""}`;if(S.$_match(c,u.nest(S,`${D}.is`),d)){if(R)return R.$_validate(t,u.nest(R,`${D}.then`),d)}else if(C)return C.$_validate(t,u.nest(C,`${D}.otherwise`),d)}}return r.errors(p,l)},rules:{conditional:{method(t,l){o(!this._flags._endedSwitch,"Unreachable condition"),o(!this._flags.match,"Cannot combine match mode",this._flags.match,"with conditional rule"),o(l.break===void 0,"Cannot use break option with alternatives conditional");const s=this.clone(),i=e.when(s,t,l),u=i.is?[i]:i.switch;for(const d of u)if(d.then&&d.otherwise){s.$_setFlag("_endedSwitch",!0,{clone:!1});break}return s.$_terms.matches.push(i),s.$_mutateRebuild()}},match:{method(t){if(o(["any","one","all"].includes(t),"Invalid alternatives match mode",t),t!=="any")for(const l of this.$_terms.matches)o(l.schema,"Cannot combine match mode",t,"with conditional rules");return this.$_setFlag("match",t)}},try:{method(...t){o(t.length,"Missing alternative schemas"),f.verifyFlat(t,"try"),o(!this._flags._endedSwitch,"Unreachable condition");const l=this.clone();for(const s of t)l.$_terms.matches.push({schema:l.$_compile(s)});return l.$_mutateRebuild()}}},overrides:{label(t){return this.$_parent("label",t).$_modify({each:(l,s)=>s.path[0]!=="is"&&typeof l._flags.label!="string"?l.label(t):void 0,ref:!1})}},rebuild(t){t.$_modify({each:l=>{f.isSchema(l)&&l.type==="array"&&t.$_setFlag("_arrayItems",!0,{clone:!1})}})},manifest:{build(t,l){if(l.matches)for(const s of l.matches){const{schema:i,ref:u,is:d,not:p,then:_,otherwise:v}=s;t=i?t.try(i):u?t.conditional(u,{is:d,then:_,not:p,otherwise:v,switch:s.switch}):t.conditional(d,{then:_,otherwise:v})}return t}},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}}"}}),r.errors=function(t,{error:l,state:s}){if(!t.length)return{errors:l("alternatives.any")};if(t.length===1)return{errors:t[0].reports};const i=new Set,u=[];for(const{reports:d,schema:p}of t){if(d.length>1)return r.unmatched(t,l);const _=d[0];if(_ instanceof a.Report==0)return r.unmatched(t,l);if(_.state.path.length!==s.path.length){u.push({type:p.type,report:_});continue}if(_.code==="any.only"){for(const m of _.local.valids)i.add(m);continue}const[v,c]=_.code.split(".");c!=="base"?u.push({type:p.type,report:_}):_.code==="object.base"?i.add(_.local.type):i.add(v)}return u.length?u.length===1?{errors:u[0].report}:r.unmatched(t,l):{errors:l("alternatives.types",{types:[...i]})}},r.unmatched=function(t,l){const s=[];for(const i of t)s.push(...i.reports);return{errors:l("alternatives.match",a.details(s,{override:!1}))}}},8068:(j,w,g)=>{const o=g(375),b=g(7629),h=g(8160),f=g(6914);j.exports=b.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(e,a){return o(typeof e=="function","Method must be a function"),o(a===void 0||a&&typeof a=="string","Description must be a non-empty string"),this.$_addRule({name:"custom",args:{method:e,description:a}})},validate(e,a,{method:n}){try{return n(e,a)}catch(r){return a.error("any.custom",{error:r})}},args:["method","description"],multi:!0},messages:{method(e){return this.prefs({messages:e})}},shared:{method(e){o(h.isSchema(e)&&e._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(e),a.$_mutateRegister(e),a}},warning:{method(e,a){return o(e&&typeof e=="string","Invalid warning code"),this.$_addRule({name:"warning",args:{code:e,local:a},warn:!0})},validate:(e,a,{code:n,local:r})=>a.error(n,r),args:["code","local"],multi:!0}},modifiers:{keep(e,a=!0){e.keep=a},message(e,a){e.message=f.compile(a)},warn(e,a=!0){e.warn=a}},manifest:{build(e,a){for(const n in a){const r=a[n];if(["examples","externals","metas","notes","tags"].includes(n))for(const t of r)e=e[n.slice(0,-1)](t);else if(n!=="alterations")if(n!=="whens"){if(n==="shared")for(const t of r)e=e.shared(t)}else for(const t of r){const{ref:l,is:s,not:i,then:u,otherwise:d,concat:p}=t;e=p?e.concat(p):l?e.when(l,{is:s,not:i,then:u,otherwise:d,switch:t.switch,break:t.break}):e.when(s,{then:u,otherwise:d,break:t.break})}else{const t={};for(const{target:l,adjuster:s}of r)t[l]=s;e=e.alter(t)}}return e}},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:(j,w,g)=>{const o=g(375),b=g(9474),h=g(9621),f=g(8068),e=g(8160),a=g(3292),n={};j.exports=f.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(r,{schema:t,state:l,prefs:s}){if(!Array.isArray(r))return;const i=t.$_getRule("sort");return i?n.sort(t,r,i.args.options,l,s):void 0}},validate(r,{schema:t,error:l}){if(!Array.isArray(r)){if(t._flags.single){const s=[r];return s[e.symbols.arraySingle]=!0,{value:s}}return{errors:l("array.base")}}if(t.$_getRule("items")||t.$_terms.externals)return{value:r.slice()}},rules:{has:{method(r){r=this.$_compile(r,{appendPath:!0});const t=this.$_addRule({name:"has",args:{schema:r}});return t.$_mutateRegister(r),t},validate(r,{state:t,prefs:l,error:s},{schema:i}){const u=[r,...t.ancestors];for(let p=0;p<r.length;++p){const _=t.localize([...t.path,p],u,i);if(i.$_match(r[p],_,l))return r}const d=i._flags.label;return d?s("array.hasKnown",{patternLabel:d}):s("array.hasUnknown",null)},multi:!0},items:{method(...r){e.verifyFlat(r,"items");const t=this.$_addRule("items");for(let l=0;l<r.length;++l){const s=e.tryWithPath(()=>this.$_compile(r[l]),l,{append:!0});t.$_terms.items.push(s)}return t.$_mutateRebuild()},validate(r,{schema:t,error:l,state:s,prefs:i,errorsArray:u}){const d=t.$_terms._requireds.slice(),p=t.$_terms.ordered.slice(),_=[...t.$_terms._inclusions,...d],v=!r[e.symbols.arraySingle];delete r[e.symbols.arraySingle];const c=u();let m=r.length;for(let y=0;y<m;++y){const x=r[y];let S=!1,R=!1;const C=v?y:new Number(y),D=[...s.path,C];if(!t._flags.sparse&&x===void 0){if(c.push(l("array.sparse",{key:C,path:D,pos:y,value:void 0},s.localize(D))),i.abortEarly)return c;p.shift();continue}const I=[r,...s.ancestors];for(const q of t.$_terms._exclusions)if(q.$_match(x,s.localize(D,I,q),i,{presence:"ignore"})){if(c.push(l("array.excludes",{pos:y,value:x},s.localize(D))),i.abortEarly)return c;S=!0,p.shift();break}if(S)continue;if(t.$_terms.ordered.length){if(p.length){const q=p.shift(),L=q.$_validate(x,s.localize(D,I,q),i);if(L.errors){if(c.push(...L.errors),i.abortEarly)return c}else if(q._flags.result==="strip")n.fastSplice(r,y),--y,--m;else{if(!t._flags.sparse&&L.value===void 0){if(c.push(l("array.sparse",{key:C,path:D,pos:y,value:void 0},s.localize(D))),i.abortEarly)return c;continue}r[y]=L.value}continue}if(!t.$_terms.items.length){if(c.push(l("array.orderedLength",{pos:y,limit:t.$_terms.ordered.length})),i.abortEarly)return c;break}}const T=[];let P=d.length;for(let q=0;q<P;++q){const L=s.localize(D,I,d[q]);L.snapshot();const F=d[q].$_validate(x,L,i);if(T[q]=F,!F.errors){if(L.commit(),r[y]=F.value,R=!0,n.fastSplice(d,q),--q,--P,!t._flags.sparse&&F.value===void 0&&(c.push(l("array.sparse",{key:C,path:D,pos:y,value:void 0},s.localize(D))),i.abortEarly))return c;break}L.restore()}if(R)continue;const J=i.stripUnknown&&!!i.stripUnknown.arrays||!1;P=_.length;for(const q of _){let L;const F=d.indexOf(q);if(F!==-1)L=T[F];else{const B=s.localize(D,I,q);if(B.snapshot(),L=q.$_validate(x,B,i),!L.errors){B.commit(),q._flags.result==="strip"?(n.fastSplice(r,y),--y,--m):t._flags.sparse||L.value!==void 0?r[y]=L.value:(c.push(l("array.sparse",{key:C,path:D,pos:y,value:void 0},s.localize(D))),S=!0),R=!0;break}B.restore()}if(P===1){if(J){n.fastSplice(r,y),--y,--m,R=!0;break}if(c.push(...L.errors),i.abortEarly)return c;S=!0;break}}if(!S&&(t.$_terms._inclusions.length||t.$_terms._requireds.length)&&!R){if(J){n.fastSplice(r,y),--y,--m;continue}if(c.push(l("array.includes",{pos:y,value:x},s.localize(D))),i.abortEarly)return c}}return d.length&&n.fillMissedErrors(t,c,d,r,s,i),p.length&&(n.fillOrderedErrors(t,c,p,r,s,i),c.length||n.fillDefault(p,r,s,i)),c.length?c:r},priority:!0,manifest:!1},length:{method(r){return this.$_addRule({name:"length",args:{limit:r},operator:"="})},validate:(r,t,{limit:l},{name:s,operator:i,args:u})=>e.compare(r.length,l,i)?r:t.error("array."+s,{limit:u.limit,value:r}),args:[{name:"limit",ref:!0,assert:e.limit,message:"must be a positive integer"}]},max:{method(r){return this.$_addRule({name:"max",method:"length",args:{limit:r},operator:"<="})}},min:{method(r){return this.$_addRule({name:"min",method:"length",args:{limit:r},operator:">="})}},ordered:{method(...r){e.verifyFlat(r,"ordered");const t=this.$_addRule("items");for(let l=0;l<r.length;++l){const s=e.tryWithPath(()=>this.$_compile(r[l]),l,{append:!0});n.validateSingle(s,t),t.$_mutateRegister(s),t.$_terms.ordered.push(s)}return t.$_mutateRebuild()}},single:{method(r){const t=r===void 0||!!r;return o(!t||!this._flags._arrayItems,"Cannot specify single rule when array has array items"),this.$_setFlag("single",t)}},sort:{method(r={}){e.assertOptions(r,["by","order"]);const t={order:r.order||"ascending"};return r.by&&(t.by=a.ref(r.by,{ancestor:0}),o(!t.by.ancestor,"Cannot sort by ancestor")),this.$_addRule({name:"sort",args:{options:t}})},validate(r,{error:t,state:l,prefs:s,schema:i},{options:u}){const{value:d,errors:p}=n.sort(i,r,u,l,s);if(p)return p;for(let _=0;_<r.length;++_)if(r[_]!==d[_])return t("array.sort",{order:u.order,by:u.by?u.by.key:"value"});return r},convert:!0},sparse:{method(r){const t=r===void 0||!!r;return this._flags.sparse===t?this:(t?this.clone():this.$_addRule("items")).$_setFlag("sparse",t,{clone:!1})}},unique:{method(r,t={}){o(!r||typeof r=="function"||typeof r=="string","comparator must be a function or a string"),e.assertOptions(t,["ignoreUndefined","separator"]);const l={name:"unique",args:{options:t,comparator:r}};if(r)if(typeof r=="string"){const s=e.default(t.separator,".");l.path=s?r.split(s):[r]}else l.comparator=r;return this.$_addRule(l)},validate(r,{state:t,error:l,schema:s},{comparator:i,options:u},{comparator:d,path:p}){const _={string:Object.create(null),number:Object.create(null),undefined:Object.create(null),boolean:Object.create(null),bigint:Object.create(null),object:new Map,function:new Map,custom:new Map},v=d||b,c=u.ignoreUndefined;for(let m=0;m<r.length;++m){const y=p?h(r[m],p):r[m],x=d?_.custom:_[typeof y];if(o(x,"Failed to find unique map container for type",typeof y),x instanceof Map){const S=x.entries();let R;for(;!(R=S.next()).done;)if(v(R.value[0],y)){const C=t.localize([...t.path,m],[r,...t.ancestors]),D={pos:m,value:r[m],dupePos:R.value[1],dupeValue:r[R.value[1]]};return p&&(D.path=i),l("array.unique",D,C)}x.set(y,m)}else{if((!c||y!==void 0)&&x[y]!==void 0){const S={pos:m,value:r[m],dupePos:x[y],dupeValue:r[x[y]]};return p&&(S.path=i),l("array.unique",S,t.localize([...t.path,m],[r,...t.ancestors]))}x[y]=m}}return r},args:["comparator","options"],multi:!0}},cast:{set:{from:Array.isArray,to:(r,t)=>new Set(r)}},rebuild(r){r.$_terms._inclusions=[],r.$_terms._exclusions=[],r.$_terms._requireds=[];for(const t of r.$_terms.items)n.validateSingle(t,r),t._flags.presence==="required"?r.$_terms._requireds.push(t):t._flags.presence==="forbidden"?r.$_terms._exclusions.push(t):r.$_terms._inclusions.push(t);for(const t of r.$_terms.ordered)n.validateSingle(t,r)},manifest:{build:(r,t)=>(t.items&&(r=r.items(...t.items)),t.ordered&&(r=r.ordered(...t.ordered)),r)},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(r,t,l,s,i,u){const d=[];let p=0;for(const _ of l){const v=_._flags.label;v?d.push(v):++p}d.length?p?t.push(r.$_createError("array.includesRequiredBoth",s,{knownMisses:d,unknownMisses:p},i,u)):t.push(r.$_createError("array.includesRequiredKnowns",s,{knownMisses:d},i,u)):t.push(r.$_createError("array.includesRequiredUnknowns",s,{unknownMisses:p},i,u))},n.fillOrderedErrors=function(r,t,l,s,i,u){const d=[];for(const p of l)p._flags.presence==="required"&&d.push(p);d.length&&n.fillMissedErrors(r,t,d,s,i,u)},n.fillDefault=function(r,t,l,s){const i=[];let u=!0;for(let d=r.length-1;d>=0;--d){const p=r[d],_=[t,...l.ancestors],v=p.$_validate(void 0,l.localize(l.path,_,p),s).value;if(u){if(v===void 0)continue;u=!1}i.unshift(v)}i.length&&t.push(...i)},n.fastSplice=function(r,t){let l=t;for(;l<r.length;)r[l++]=r[l];--r.length},n.validateSingle=function(r,t){(r.type==="array"||r._flags._arrayItems)&&(o(!t._flags.single,"Cannot specify array item with single rule enabled"),t.$_setFlag("_arrayItems",!0,{clone:!1}))},n.sort=function(r,t,l,s,i){const u=l.order==="ascending"?1:-1,d=-1*u,p=u,_=(v,c)=>{let m=n.compare(v,c,d,p);if(m!==null||(l.by&&(v=l.by.resolve(v,s,i),c=l.by.resolve(c,s,i)),m=n.compare(v,c,d,p),m!==null))return m;const y=typeof v;if(y!==typeof c)throw r.$_createError("array.sort.mismatching",t,null,s,i);if(y!=="number"&&y!=="string")throw r.$_createError("array.sort.unsupported",t,{type:y},s,i);return y==="number"?(v-c)*u:v<c?d:p};try{return{value:t.slice().sort(_)}}catch(v){return{errors:v}}},n.compare=function(r,t,l,s){return r===t?0:r===void 0?1:t===void 0?-1:r===null?s:t===null?l:null}},4937:(j,w,g)=>{const o=g(375),b=g(8068),h=g(8160),f=g(2036),e={isBool:function(a){return typeof a=="boolean"}};j.exports=b.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 r=n._flags.sensitive?a:a.toLowerCase();a=r==="true"||r!=="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 f;for(let r=0;r<a.length;++r){const t=a[r];o(t!==void 0,"Cannot call truthy with undefined"),n.$_terms.truthy.add(t)}return n}},falsy:{method(...a){h.verifyFlat(a,"falsy");const n=this.clone();n.$_terms.falsy=n.$_terms.falsy||new f;for(let r=0;r<a.length;++r){const t=a[r];o(t!==void 0,"Cannot call falsy with undefined"),n.$_terms.falsy.add(t)}return n}},sensitive:{method(a=!0){return this.$_setFlag("sensitive",a)}}},cast:{number:{from:e.isBool,to:(a,n)=>a?1:0},string:{from:e.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:(j,w,g)=>{const o=g(375),b=g(8068),h=g(8160),f=g(3328),e={isDate:function(a){return a instanceof Date}};j.exports=b.extend({type:"date",coerce:{from:["number","string"],method:(a,{schema:n})=>({value:e.parse(a,n._flags.format)||a})},validate(a,{schema:n,error:r,prefs:t}){if(a instanceof Date&&!isNaN(a.getTime()))return;const l=n._flags.format;return t.convert&&l&&typeof a=="string"?{value:a,errors:r("date.format",{format:l})}:{value:a,errors:r("date.base")}},rules:{compare:{method:!1,validate(a,n,{date:r},{name:t,operator:l,args:s}){const i=r==="now"?Date.now():r.getTime();return h.compare(a.getTime(),i,l)?a:n.error("date."+t,{limit:s.date,value:a})},args:[{name:"date",ref:!0,normalize:a=>a==="now"?a:e.parse(a),assert:a=>a!==null,message:"must have a valid date format"}]},format:{method(a){return o(["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 o(["javascript","unix"].includes(a),'"type" must be one of "javascript, unix"'),this.format(a)}}},cast:{number:{from:e.isDate,to:(a,n)=>a.getTime()},string:{from:e.isDate,to:(a,{prefs:n})=>f.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"}}),e.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)?e.date(a.toString()):null;const r=a;if(typeof a=="string"&&/^[+-]?\d+(\.\d+)?$/.test(a)&&(a=parseFloat(a)),n){if(n==="javascript")return e.date(1*a);if(n==="unix")return e.date(1e3*a);if(typeof r=="string")return null}return e.date(a)},e.date=function(a){const n=new Date(a);return isNaN(n.getTime())?null:n}},390:(j,w,g)=>{const o=g(375),b=g(7824);j.exports=b.extend({type:"function",properties:{typeof:"function"},rules:{arity:{method(h){return o(Number.isSafeInteger(h)&&h>=0,"n must be a positive integer"),this.$_addRule({name:"arity",args:{n:h}})},validate:(h,f,{n:e})=>h.length===e?h:f.error("function.arity",{n:e})},class:{method(){return this.$_addRule("class")},validate:(h,f)=>/^\s*class\s/.test(h.toString())?h:f.error("function.class",{value:h})},minArity:{method(h){return o(Number.isSafeInteger(h)&&h>0,"n must be a strict positive integer"),this.$_addRule({name:"minArity",args:{n:h}})},validate:(h,f,{n:e})=>h.length>=e?h:f.error("function.minArity",{n:e})},maxArity:{method(h){return o(Number.isSafeInteger(h)&&h>=0,"n must be a positive integer"),this.$_addRule({name:"maxArity",args:{n:h}})},validate:(h,f,{n:e})=>h.length<=e?h:f.error("function.maxArity",{n:e})}},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:(j,w,g)=>{const o=g(978),b=g(375),h=g(8571),f=g(3652),e=g(8068),a=g(8160),n=g(3292),r=g(6354),t=g(6133),l=g(3328),s={renameDefaults:{alias:!1,multiple:!1,override:!1}};j.exports=e.extend({type:"_keys",properties:{typeof:"object"},flags:{unknown:{default:void 0}},terms:{dependencies:{init:null},keys:{init:null,manifest:{mapped:{from:"schema",to:"key"}}},patterns:{init:null},renames:{init:null}},args:(i,u)=>i.keys(u),validate(i,{schema:u,error:d,state:p,prefs:_}){if(!i||typeof i!==u.$_property("typeof")||Array.isArray(i))return{value:i,errors:d("object.base",{type:u.$_property("typeof")})};if(!(u.$_terms.renames||u.$_terms.dependencies||u.$_terms.keys||u.$_terms.patterns||u.$_terms.externals))return;i=s.clone(i,_);const v=[];if(u.$_terms.renames&&!s.rename(u,i,p,_,v))return{value:i,errors:v};if(!u.$_terms.keys&&!u.$_terms.patterns&&!u.$_terms.dependencies)return{value:i,errors:v};const c=new Set(Object.keys(i));if(u.$_terms.keys){const m=[i,...p.ancestors];for(const y of u.$_terms.keys){const x=y.key,S=i[x];c.delete(x);const R=p.localize([...p.path,x],m,y),C=y.schema.$_validate(S,R,_);if(C.errors){if(_.abortEarly)return{value:i,errors:C.errors};C.value!==void 0&&(i[x]=C.value),v.push(...C.errors)}else y.schema._flags.result==="strip"||C.value===void 0&&S!==void 0?delete i[x]:C.value!==void 0&&(i[x]=C.value)}}if(c.size||u._flags._hasPatternMatch){const m=s.unknown(u,i,c,v,p,_);if(m)return m}if(u.$_terms.dependencies)for(const m of u.$_terms.dependencies){if(m.key!==null&&s.isPresent(m.options)(m.key.resolve(i,p,_,null,{shadow:!1}))===!1)continue;const y=s.dependencies[m.rel](u,m,i,p,_);if(y){const x=u.$_createError(y.code,i,y.context,p,_);if(_.abortEarly)return{value:i,errors:x};v.push(x)}}return{value:i,errors:v}},rules:{and:{method(...i){return a.verifyFlat(i,"and"),s.dependency(this,"and",null,i)}},append:{method(i){return i==null||Object.keys(i).length===0?this:this.keys(i)}},assert:{method(i,u,d){l.isTemplate(i)||(i=n.ref(i)),b(d===void 0||typeof d=="string","Message must be a string"),u=this.$_compile(u,{appendPath:!0});const p=this.$_addRule({name:"assert",args:{subject:i,schema:u,message:d}});return p.$_mutateRegister(i),p.$_mutateRegister(u),p},validate(i,{error:u,prefs:d,state:p},{subject:_,schema:v,message:c}){const m=_.resolve(i,p,d),y=t.isRef(_)?_.absolute(p):[];return v.$_match(m,p.localize(y,[i,...p.ancestors],v),d)?i:u("object.assert",{subject:_,message:c})},args:["subject","schema","message"],multi:!0},instance:{method(i,u){return b(typeof i=="function","constructor must be a function"),u=u||i.name,this.$_addRule({name:"instance",args:{constructor:i,name:u}})},validate:(i,u,{constructor:d,name:p})=>i instanceof d?i:u.error("object.instance",{type:p,value:i}),args:["constructor","name"]},keys:{method(i){b(i===void 0||typeof i=="object","Object schema must be a valid object"),b(!a.isSchema(i),"Object schema cannot be a joi schema");const u=this.clone();if(i)if(Object.keys(i).length){u.$_terms.keys=u.$_terms.keys?u.$_terms.keys.filter(d=>!i.hasOwnProperty(d.key)):new s.Keys;for(const d in i)a.tryWithPath(()=>u.$_terms.keys.push({key:d,schema:this.$_compile(i[d])}),d)}else u.$_terms.keys=new s.Keys;else u.$_terms.keys=null;return u.$_mutateRebuild()}},length:{method(i){return this.$_addRule({name:"length",args:{limit:i},operator:"="})},validate:(i,u,{limit:d},{name:p,operator:_,args:v})=>a.compare(Object.keys(i).length,d,_)?i:u.error("object."+p,{limit:v.limit,value:i}),args:[{name:"limit",ref:!0,assert:a.limit,message:"must be a positive integer"}]},max:{method(i){return this.$_addRule({name:"max",method:"length",args:{limit:i},operator:"<="})}},min:{method(i){return this.$_addRule({name:"min",method:"length",args:{limit:i},operator:">="})}},nand:{method(...i){return a.verifyFlat(i,"nand"),s.dependency(this,"nand",null,i)}},or:{method(...i){return a.verifyFlat(i,"or"),s.dependency(this,"or",null,i)}},oxor:{method(...i){return s.dependency(this,"oxor",null,i)}},pattern:{method(i,u,d={}){const p=i instanceof RegExp;p||(i=this.$_compile(i,{appendPath:!0})),b(u!==void 0,"Invalid rule"),a.assertOptions(d,["fallthrough","matches"]),p&&b(!i.flags.includes("g")&&!i.flags.includes("y"),"pattern should not use global or sticky mode"),u=this.$_compile(u,{appendPath:!0});const _=this.clone();_.$_terms.patterns=_.$_terms.patterns||[];const v={[p?"regex":"schema"]:i,rule:u};return d.matches&&(v.matches=this.$_compile(d.matches),v.matches.type!=="array"&&(v.matches=v.matches.$_root.array().items(v.matches)),_.$_mutateRegister(v.matches),_.$_setFlag("_hasPatternMatch",!0,{clone:!1})),d.fallthrough&&(v.fallthrough=!0),_.$_terms.patterns.push(v),_.$_mutateRegister(u),_}},ref:{method(){return this.$_addRule("ref")},validate:(i,u)=>t.isRef(i)?i:u.error("object.refType",{value:i})},regex:{method(){return this.$_addRule("regex")},validate:(i,u)=>i instanceof RegExp?i:u.error("object.regex",{value:i})},rename:{method(i,u,d={}){b(typeof i=="string"||i instanceof RegExp,"Rename missing the from argument"),b(typeof u=="string"||u instanceof l,"Invalid rename to argument"),b(u!==i,"Cannot rename key to same name:",i),a.assertOptions(d,["alias","ignoreUndefined","override","multiple"]);const p=this.clone();p.$_terms.renames=p.$_terms.renames||[];for(const _ of p.$_terms.renames)b(_.from!==i,"Cannot rename the same key multiple times");return u instanceof l&&p.$_mutateRegister(u),p.$_terms.renames.push({from:i,to:u,options:o(s.renameDefaults,d)}),p}},schema:{method(i="any"){return this.$_addRule({name:"schema",args:{type:i}})},validate:(i,u,{type:d})=>!a.isSchema(i)||d!=="any"&&i.type!==d?u.error("object.schema",{type:d}):i},unknown:{method(i){return this.$_setFlag("unknown",i!==!1)}},with:{method(i,u,d={}){return s.dependency(this,"with",i,u,d)}},without:{method(i,u,d={}){return s.dependency(this,"without",i,u,d)}},xor:{method(...i){return a.verifyFlat(i,"xor"),s.dependency(this,"xor",null,i)}}},overrides:{default(i,u){return i===void 0&&(i=a.symbols.deepDefault),this.$_parent("default",i,u)}},rebuild(i){if(i.$_terms.keys){const u=new f.Sorter;for(const d of i.$_terms.keys)a.tryWithPath(()=>u.add(d,{after:d.schema.$_rootReferences(),group:d.key}),d.key);i.$_terms.keys=new s.Keys(...u.nodes)}},manifest:{build(i,u){if(u.keys&&(i=i.keys(u.keys)),u.dependencies)for(const{rel:d,key:p=null,peers:_,options:v}of u.dependencies)i=s.dependency(i,d,p,_,v);if(u.patterns)for(const{regex:d,schema:p,rule:_,fallthrough:v,matches:c}of u.patterns)i=i.pattern(d||p,_,{fallthrough:v,matches:c});if(u.renames)for(const{from:d,to:p,options:_}of u.renames)i=i.rename(d,p,_);return i}},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}}"}}),s.clone=function(i,u){if(typeof i=="object"){if(u.nonEnumerables)return h(i,{shallow:!0});const p=Object.create(Object.getPrototypeOf(i));return Object.assign(p,i),p}const d=function(...p){return i.apply(this,p)};return d.prototype=h(i.prototype),Object.defineProperty(d,"name",{value:i.name,writable:!1}),Object.defineProperty(d,"length",{value:i.length,writable:!1}),Object.assign(d,i),d},s.dependency=function(i,u,d,p,_){b(d===null||typeof d=="string",u,"key must be a strings"),_||(_=p.length>1&&typeof p[p.length-1]=="object"?p.pop():{}),a.assertOptions(_,["separator","isPresent"]),p=[].concat(p);const v=a.default(_.separator,"."),c=[];for(const y of p)b(typeof y=="string",u,"peers must be strings"),c.push(n.ref(y,{separator:v,ancestor:0,prefix:!1}));d!==null&&(d=n.ref(d,{separator:v,ancestor:0,prefix:!1}));const m=i.clone();return m.$_terms.dependencies=m.$_terms.dependencies||[],m.$_terms.dependencies.push(new s.Dependency(u,d,c,p,_)),m},s.dependencies={and(i,u,d,p,_){const v=[],c=[],m=u.peers.length,y=s.isPresent(u.options);for(const x of u.peers)y(x.resolve(d,p,_,null,{shadow:!1}))===!1?v.push(x.key):c.push(x.key);if(v.length!==m&&c.length!==m)return{code:"object.and",context:{present:c,presentWithLabels:s.keysToLabels(i,c),missing:v,missingWithLabels:s.keysToLabels(i,v)}}},nand(i,u,d,p,_){const v=[],c=s.isPresent(u.options);for(const x of u.peers)c(x.resolve(d,p,_,null,{shadow:!1}))&&v.push(x.key);if(v.length!==u.peers.length)return;const m=u.paths[0],y=u.paths.slice(1);return{code:"object.nand",context:{main:m,mainWithLabel:s.keysToLabels(i,m),peers:y,peersWithLabels:s.keysToLabels(i,y)}}},or(i,u,d,p,_){const v=s.isPresent(u.options);for(const c of u.peers)if(v(c.resolve(d,p,_,null,{shadow:!1})))return;return{code:"object.missing",context:{peers:u.paths,peersWithLabels:s.keysToLabels(i,u.paths)}}},oxor(i,u,d,p,_){const v=[],c=s.isPresent(u.options);for(const y of u.peers)c(y.resolve(d,p,_,null,{shadow:!1}))&&v.push(y.key);if(!v.length||v.length===1)return;const m={peers:u.paths,peersWithLabels:s.keysToLabels(i,u.paths)};return m.present=v,m.presentWithLabels=s.keysToLabels(i,v),{code:"object.oxor",context:m}},with(i,u,d,p,_){const v=s.isPresent(u.options);for(const c of u.peers)if(v(c.resolve(d,p,_,null,{shadow:!1}))===!1)return{code:"object.with",context:{main:u.key.key,mainWithLabel:s.keysToLabels(i,u.key.key),peer:c.key,peerWithLabel:s.keysToLabels(i,c.key)}}},without(i,u,d,p,_){const v=s.isPresent(u.options);for(const c of u.peers)if(v(c.resolve(d,p,_,null,{shadow:!1})))return{code:"object.without",context:{main:u.key.key,mainWithLabel:s.keysToLabels(i,u.key.key),peer:c.key,peerWithLabel:s.keysToLabels(i,c.key)}}},xor(i,u,d,p,_){const v=[],c=s.isPresent(u.options);for(const y of u.peers)c(y.resolve(d,p,_,null,{shadow:!1}))&&v.push(y.key);if(v.length===1)return;const m={peers:u.paths,peersWithLabels:s.keysToLabels(i,u.paths)};return v.length===0?{code:"object.missing",context:m}:(m.present=v,m.presentWithLabels=s.keysToLabels(i,v),{code:"object.xor",context:m})}},s.keysToLabels=function(i,u){return Array.isArray(u)?u.map(d=>i.$_mapLabels(d)):i.$_mapLabels(u)},s.isPresent=function(i){return typeof i.isPresent=="function"?i.isPresent:u=>u!==void 0},s.rename=function(i,u,d,p,_){const v={};for(const c of i.$_terms.renames){const m=[],y=typeof c.from!="string";if(y)for(const x in u){if(u[x]===void 0&&c.options.ignoreUndefined||x===c.to)continue;const S=c.from.exec(x);S&&m.push({from:x,to:c.to,match:S})}else!Object.prototype.hasOwnProperty.call(u,c.from)||u[c.from]===void 0&&c.options.ignoreUndefined||m.push(c);for(const x of m){const S=x.from;let R=x.to;if(R instanceof l&&(R=R.render(u,d,p,x.match)),S!==R){if(!c.options.multiple&&v[R]&&(_.push(i.$_createError("object.rename.multiple",u,{from:S,to:R,pattern:y},d,p)),p.abortEarly)||Object.prototype.hasOwnProperty.call(u,R)&&!c.options.override&&!v[R]&&(_.push(i.$_createError("object.rename.override",u,{from:S,to:R,pattern:y},d,p)),p.abortEarly))return!1;u[S]===void 0?delete u[R]:u[R]=u[S],v[R]=!0,c.options.alias||delete u[S]}}}return!0},s.unknown=function(i,u,d,p,_,v){if(i.$_terms.patterns){let c=!1;const m=i.$_terms.patterns.map(x=>{if(x.matches)return c=!0,[]}),y=[u,..._.ancestors];for(const x of d){const S=u[x],R=[..._.path,x];for(let C=0;C<i.$_terms.patterns.length;++C){const D=i.$_terms.patterns[C];if(D.regex){const P=D.regex.test(x);if(_.mainstay.tracer.debug(_,"rule",`pattern.${C}`,P?"pass":"error"),!P)continue}else if(!D.schema.$_match(x,_.nest(D.schema,`pattern.${C}`),v))continue;d.delete(x);const I=_.localize(R,y,{schema:D.rule,key:x}),T=D.rule.$_validate(S,I,v);if(T.errors){if(v.abortEarly)return{value:u,errors:T.errors};p.push(...T.errors)}if(D.matches&&m[C].push(x),u[x]=T.value,!D.fallthrough)break}}if(c)for(let x=0;x<m.length;++x){const S=m[x];if(!S)continue;const R=i.$_terms.patterns[x].matches,C=_.localize(_.path,y,R),D=R.$_validate(S,C,v);if(D.errors){const I=r.details(D.errors,{override:!1});I.matches=S;const T=i.$_createError("object.pattern.match",u,I,_,v);if(v.abortEarly)return{value:u,errors:T};p.push(T)}}}if(d.size&&(i.$_terms.keys||i.$_terms.patterns)){if(v.stripUnknown&&i._flags.unknown===void 0||v.skipFunctions){const c=!(!v.stripUnknown||v.stripUnknown!==!0&&!v.stripUnknown.objects);for(const m of d)c?(delete u[m],d.delete(m)):typeof u[m]=="function"&&d.delete(m)}if(!a.default(i._flags.unknown,v.allowUnknown))for(const c of d){const m=_.localize([..._.path,c],[]),y=i.$_createError("object.unknown",u[c],{child:c},m,v,{flags:!1});if(v.abortEarly)return{value:u,errors:y};p.push(y)}}},s.Dependency=class{constructor(i,u,d,p,_){this.rel=i,this.key=u,this.peers=d,this.paths=p,this.options=_}describe(){const i={rel:this.rel,peers:this.paths};return this.key!==null&&(i.key=this.key.key),this.peers[0].separator!=="."&&(i.options={...i.options,separator:this.peers[0].separator}),this.options.isPresent&&(i.options={...i.options,isPresent:this.options.isPresent}),i}},s.Keys=class extends Array{concat(i){const u=this.slice(),d=new Map;for(let p=0;p<u.length;++p)d.set(u[p].key,p);for(const p of i){const _=p.key,v=d.get(_);v!==void 0?u[v]={key:_,schema:u[v].schema.concat(p.schema)}:u.push(p)}return u}}},8785:(j,w,g)=>{const o=g(375),b=g(8068),h=g(8160),f=g(3292),e=g(6354),a={};j.exports=b.extend({type:"link",properties:{schemaChain:!0},terms:{link:{init:null,manifest:"single",register:!1}},args:(n,r)=>n.ref(r),validate(n,{schema:r,state:t,prefs:l}){o(r.$_terms.link,"Uninitialized link schema");const s=a.generate(r,n,t,l),i=r.$_terms.link[0].ref;return s.$_validate(n,t.nest(s,`link:${i.display}:${s.type}`),l)},generate:(n,r,t,l)=>a.generate(n,r,t,l),rules:{ref:{method(n){o(!this.$_terms.link,"Cannot reinitialize schema"),n=f.ref(n),o(n.type==="value"||n.type==="local","Invalid reference type:",n.type),o(n.type==="local"||n.ancestor==="root"||n.ancestor>0,"Link cannot reference itself");const r=this.clone();return r.$_terms.link=[{ref:n}],r}},relative:{method(n=!0){return this.$_setFlag("relative",n)}}},overrides:{concat(n){o(this.$_terms.link,"Uninitialized link schema"),o(h.isSchema(n),"Invalid schema object"),o(n.type!=="link","Cannot merge type link with another link");const r=this.clone();return r.$_terms.whens||(r.$_terms.whens=[]),r.$_terms.whens.push({concat:n}),r.$_mutateRebuild()}},manifest:{build:(n,r)=>(o(r.link,"Invalid link description missing link"),n.ref(r.link))}}),a.generate=function(n,r,t,l){let s=t.mainstay.links.get(n);if(s)return s._generate(r,t,l).schema;const i=n.$_terms.link[0].ref,{perspective:u,path:d}=a.perspective(i,t);a.assert(u,"which is outside of schema boundaries",i,n,t,l);try{s=d.length?u.$_reach(d):u}catch{a.assert(!1,"to non-existing schema",i,n,t,l)}return a.assert(s.type!=="link","which is another link",i,n,t,l),n._flags.relative||t.mainstay.links.set(n,s),s._generate(r,t,l).schema},a.perspective=function(n,r){if(n.type==="local"){for(const{schema:t,key:l}of r.schemas){if((t._flags.id||l)===n.path[0])return{perspective:t,path:n.path.slice(1)};if(t.$_terms.shared){for(const s of t.$_terms.shared)if(s._flags.id===n.path[0])return{perspective:s,path:n.path.slice(1)}}}return{perspective:null,path:null}}return n.ancestor==="root"?{perspective:r.schemas[r.schemas.length-1].schema,path:n.path}:{perspective:r.schemas[n.ancestor]&&r.schemas[n.ancestor].schema,path:n.path}},a.assert=function(n,r,t,l,s,i){n||o(!1,`"${e.label(l._flags,s,i)}" contains link reference "${t.display}" ${r}`)}},3832:(j,w,g)=>{const o=g(375),b=g(8068),h=g(8160),f={numberRx:/^\s*[+-]?(?:(?:\d+(?:\.\d*)?)|(?:\.\d+))(?:e([+-]?\d+))?\s*$/i,precisionRx:/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/,exponentialPartRegex:/[eE][+-]?\d+$/,leadingSignAndZerosRegex:/^[+-]?(0*)?/,dotRegex:/\./,trailingZerosRegex:/0+$/,decimalPlaces(e){const a=e.toString(),n=a.indexOf("."),r=a.indexOf("e");return(n<0?0:(r<0?a.length:r)-n-1)+(r<0?0:Math.max(0,-parseInt(a.slice(r+1))))}};j.exports=b.extend({type:"number",flags:{unsafe:{default:!1}},coerce:{from:"string",method(e,{schema:a,error:n}){if(!e.match(f.numberRx))return;e=e.trim();const r={value:parseFloat(e)};if(r.value===0&&(r.value=0),!a._flags.unsafe)if(e.match(/e/i)){if(f.extractSignificantDigits(e)!==f.extractSignificantDigits(String(r.value)))return r.errors=n("number.unsafe"),r}else{const t=r.value.toString();if(t.match(/e/i))return r;if(t!==f.normalizeDecimal(e))return r.errors=n("number.unsafe"),r}return r}},validate(e,{schema:a,error:n,prefs:r}){if(e===1/0||e===-1/0)return{value:e,errors:n("number.infinity")};if(!h.isNumber(e))return{value:e,errors:n("number.base")};const t={value:e};if(r.convert){const l=a.$_getRule("precision");if(l){const s=Math.pow(10,l.args.limit);t.value=Math.round(t.value*s)/s}}return t.value===0&&(t.value=0),!a._flags.unsafe&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.errors=n("number.unsafe")),t},rules:{compare:{method:!1,validate:(e,a,{limit:n},{name:r,operator:t,args:l})=>h.compare(e,n,t)?e:a.error("number."+r,{limit:l.limit,value:e}),args:[{name:"limit",ref:!0,assert:h.isNumber,message:"must be a number"}]},greater:{method(e){return this.$_addRule({name:"greater",method:"compare",args:{limit:e},operator:">"})}},integer:{method(){return this.$_addRule("integer")},validate:(e,a)=>Math.trunc(e)-e==0?e:a.error("number.integer")},less:{method(e){return this.$_addRule({name:"less",method:"compare",args:{limit:e},operator:"<"})}},max:{method(e){return this.$_addRule({name:"max",method:"compare",args:{limit:e},operator:"<="})}},min:{method(e){return this.$_addRule({name:"min",method:"compare",args:{limit:e},operator:">="})}},multiple:{method(e){const a=typeof e=="number"?f.decimalPlaces(e):null,n=Math.pow(10,a);return this.$_addRule({name:"multiple",args:{base:e,baseDecimalPlace:a,pfactor:n}})},validate:(e,a,{base:n,baseDecimalPlace:r,pfactor:t},l)=>f.decimalPlaces(e)>r?a.error("number.multiple",{multiple:l.args.base,value:e}):Math.round(t*e)%Math.round(t*n)==0?e:a.error("number.multiple",{multiple:l.args.base,value:e}),args:[{name:"base",ref:!0,assert:e=>typeof e=="number"&&isFinite(e)&&e>0,message:"must be a positive number"},"baseDecimalPlace","pfactor"],multi:!0},negative:{method(){return this.sign("negative")}},port:{method(){return this.$_addRule("port")},validate:(e,a)=>Number.isSafeInteger(e)&&e>=0&&e<=65535?e:a.error("number.port")},positive:{method(){return this.sign("positive")}},precision:{method(e){return o(Number.isSafeInteger(e),"limit must be an integer"),this.$_addRule({name:"precision",args:{limit:e}})},validate(e,a,{limit:n}){const r=e.toString().match(f.precisionRx);return Math.max((r[1]?r[1].length:0)-(r[2]?parseInt(r[2],10):0),0)<=n?e:a.error("number.precision",{limit:n,value:e})},convert:!0},sign:{method(e){return o(["negative","positive"].includes(e),"Invalid sign",e),this.$_addRule({name:"sign",args:{sign:e}})},validate:(e,a,{sign:n})=>n==="negative"&&e<0||n==="positive"&&e>0?e:a.error(`number.${n}`)},unsafe:{method(e=!0){return o(typeof e=="boolean","enabled must be a boolean"),this.$_setFlag("unsafe",e)}}},cast:{string:{from:e=>typeof e=="number",to:(e,a)=>e.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"}}),f.extractSignificantDigits=function(e){return e.replace(f.exponentialPartRegex,"").replace(f.dotRegex,"").replace(f.trailingZerosRegex,"").replace(f.leadingSignAndZerosRegex,"")},f.normalizeDecimal=function(e){return(e=e.replace(/^\+/,"").replace(/\.0*$/,"").replace(/^(-?)\.([^\.]*)$/,"$10.$2").replace(/^(-?)0+([0-9])/,"$1$2")).includes(".")&&e.endsWith("0")&&(e=e.replace(/0+$/,"")),e==="-0"?"0":e}},8966:(j,w,g)=>{const o=g(7824);j.exports=o.extend({type:"object",cast:{map:{from:b=>b&&typeof b=="object",to:(b,h)=>new Map(Object.entries(b))}}})},7417:(j,w,g)=>{const o=g(375),b=g(5380),h=g(1745),f=g(9959),e=g(6064),a=g(9926),n=g(5752),r=g(8068),t=g(8160),l={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:f.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"]};j.exports=r.extend({type:"string",flags:{insensitive:{default:!1},truncate:{default:!1}},terms:{replacements:{init:null}},coerce:{from:"string",method(s,{schema:i,state:u,prefs:d}){const p=i.$_getRule("normalize");p&&(s=s.normalize(p.args.form));const _=i.$_getRule("case");_&&(s=_.args.direction==="upper"?s.toLocaleUpperCase():s.toLocaleLowerCase());const v=i.$_getRule("trim");if(v&&v.args.enabled&&(s=s.trim()),i.$_terms.replacements)for(const m of i.$_terms.replacements)s=s.replace(m.pattern,m.replacement);const c=i.$_getRule("hex");if(c&&c.args.options.byteAligned&&s.length%2!=0&&(s=`0${s}`),i.$_getRule("isoDate")){const m=l.isoDate(s);m&&(s=m)}if(i._flags.truncate){const m=i.$_getRule("max");if(m){let y=m.args.limit;if(t.isResolvable(y)&&(y=y.resolve(s,u,d),!t.limit(y)))return{value:s,errors:i.$_createError("any.ref",y,{ref:m.args.limit,arg:"limit",reason:"must be a positive integer"},u,d)};s=s.slice(0,y)}}return{value:s}}},validate(s,{schema:i,error:u}){if(typeof s!="string")return{value:s,errors:u("string.base")};if(s===""){const d=i.$_getRule("min");return d&&d.args.limit===0?void 0:{value:s,errors:u("string.empty")}}},rules:{alphanum:{method(){return this.$_addRule("alphanum")},validate:(s,i)=>/^[a-zA-Z0-9]+$/.test(s)?s:i.error("string.alphanum")},base64:{method(s={}){return t.assertOptions(s,["paddingRequired","urlSafe"]),s={urlSafe:!1,paddingRequired:!0,...s},o(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),o(typeof s.urlSafe=="boolean","urlSafe must be boolean"),this.$_addRule({name:"base64",args:{options:s}})},validate:(s,i,{options:u})=>l.base64Regex[u.paddingRequired][u.urlSafe].test(s)?s:i.error("string.base64")},case:{method(s){return o(["lower","upper"].includes(s),"Invalid case:",s),this.$_addRule({name:"case",args:{direction:s}})},validate:(s,i,{direction:u})=>u==="lower"&&s===s.toLocaleLowerCase()||u==="upper"&&s===s.toLocaleUpperCase()?s:i.error(`string.${u}case`),convert:!0},creditCard:{method(){return this.$_addRule("creditCard")},validate(s,i){let u=s.length,d=0,p=1;for(;u--;){const _=s.charAt(u)*p;d+=_-9*(_>9),p^=3}return d>0&&d%10==0?s:i.error("string.creditCard")}},dataUri:{method(s={}){return t.assertOptions(s,["paddingRequired"]),s={paddingRequired:!0,...s},o(typeof s.paddingRequired=="boolean","paddingRequired must be boolean"),this.$_addRule({name:"dataUri",args:{options:s}})},validate(s,i,{options:u}){const d=s.match(l.dataUriRegex);return d&&(!d[2]||d[2]!=="base64"||l.base64Regex[u.paddingRequired].false.test(d[3]))?s:i.error("string.dataUri")}},domain:{method(s){s&&t.assertOptions(s,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const i=l.addressOptions(s);return this.$_addRule({name:"domain",args:{options:s},address:i})},validate:(s,i,u,{address:d})=>b.isValid(s,d)?s:i.error("string.domain")},email:{method(s={}){t.assertOptions(s,["allowFullyQualified","allowUnicode","ignoreLength","maxDomainSegments","minDomainSegments","multiple","separator","tlds"]),o(s.multiple===void 0||typeof s.multiple=="boolean","multiple option must be an boolean");const i=l.addressOptions(s),u=new RegExp(`\\s*[${s.separator?e(s.separator):","}]\\s*`);return this.$_addRule({name:"email",args:{options:s},regex:u,address:i})},validate(s,i,{options:u},{regex:d,address:p}){const _=u.multiple?s.split(d):[s],v=[];for(const c of _)h.isValid(c,p)||v.push(c);return v.length?i.error("string.email",{value:s,invalids:v}):s}},guid:{alias:"uuid",method(s={}){t.assertOptions(s,["version","separator"]);let i="";if(s.version){const p=[].concat(s.version);o(p.length>=1,"version must have at least 1 valid version specified");const _=new Set;for(let v=0;v<p.length;++v){const c=p[v];o(typeof c=="string","version at position "+v+" must be a string");const m=l.guidVersions[c.toLowerCase()];o(m,"version at position "+v+" must be one of "+Object.keys(l.guidVersions).join(", ")),o(!_.has(m),"version at position "+v+" must not be a duplicate"),i+=m,_.add(m)}}o(l.guidSeparators.has(s.separator),'separator must be one of true, false, "-", or ":"');const u=s.separator===void 0?"[:-]?":s.separator===!0?"[:-]":s.separator===!1?"[]?":`\\${s.separator}`,d=new RegExp(`^([\\[{\\(]?)[0-9A-F]{8}(${u})[0-9A-F]{4}\\2?[${i||"0-9A-F"}][0-9A-F]{3}\\2?[${i?"89AB":"0-9A-F"}][0-9A-F]{3}\\2?[0-9A-F]{12}([\\]}\\)]?)$`,"i");return this.$_addRule({name:"guid",args:{options:s},regex:d})},validate(s,i,u,{regex:d}){const p=d.exec(s);return p?l.guidBrackets[p[1]]!==p[p.length-1]?i.error("string.guid"):s:i.error("string.guid")}},hex:{method(s={}){return t.assertOptions(s,["byteAligned","prefix"]),s={byteAligned:!1,prefix:!1,...s},o(typeof s.byteAligned=="boolean","byteAligned must be boolean"),o(typeof s.prefix=="boolean"||s.prefix==="optional",'prefix must be boolean or "optional"'),this.$_addRule({name:"hex",args:{options:s}})},validate:(s,i,{options:u})=>(u.prefix==="optional"?l.hexRegex.withOptionalPrefix:u.prefix===!0?l.hexRegex.withPrefix:l.hexRegex.withoutPrefix).test(s)?u.byteAligned&&s.length%2!=0?i.error("string.hexAlign"):s:i.error("string.hex")},hostname:{method(){return this.$_addRule("hostname")},validate:(s,i)=>b.isValid(s,{minDomainSegments:1})||l.ipRegex.test(s)?s:i.error("string.hostname")},insensitive:{method(){return this.$_setFlag("insensitive",!0)}},ip:{method(s={}){t.assertOptions(s,["cidr","version"]);const{cidr:i,versions:u,regex:d}=f.regex(s),p=s.version?u:void 0;return this.$_addRule({name:"ip",args:{options:{cidr:i,version:p}},regex:d})},validate:(s,i,{options:u},{regex:d})=>d.test(s)?s:u.version?i.error("string.ipVersion",{value:s,cidr:u.cidr,version:u.version}):i.error("string.ip",{value:s,cidr:u.cidr})},isoDate:{method(){return this.$_addRule("isoDate")},validate:(s,{error:i})=>l.isoDate(s)?s:i("string.isoDate")},isoDuration:{method(){return this.$_addRule("isoDuration")},validate:(s,i)=>l.isoDurationRegex.test(s)?s:i.error("string.isoDuration")},length:{method(s,i){return l.length(this,"length",s,"=",i)},validate(s,i,{limit:u,encoding:d},{name:p,operator:_,args:v}){const c=!d&&s.length;return t.compare(c,u,_)?s:i.error("string."+p,{limit:v.limit,value:s,encoding:d})},args:[{name:"limit",ref:!0,assert:t.limit,message:"must be a positive integer"},"encoding"]},lowercase:{method(){return this.case("lower")}},max:{method(s,i){return l.length(this,"max",s,"<=",i)},args:["limit","encoding"]},min:{method(s,i){return l.length(this,"min",s,">=",i)},args:["limit","encoding"]},normalize:{method(s="NFC"){return o(l.normalizationForms.includes(s),"normalization form must be one of "+l.normalizationForms.join(", ")),this.$_addRule({name:"normalize",args:{form:s}})},validate:(s,{error:i},{form:u})=>s===s.normalize(u)?s:i("string.normalize",{value:s,form:u}),convert:!0},pattern:{alias:"regex",method(s,i={}){o(s instanceof RegExp,"regex must be a RegExp"),o(!s.flags.includes("g")&&!s.flags.includes("y"),"regex should not use global or sticky mode"),typeof i=="string"&&(i={name:i}),t.assertOptions(i,["invert","name"]);const u=["string.pattern",i.invert?".invert":"",i.name?".name":".base"].join("");return this.$_addRule({name:"pattern",args:{regex:s,options:i},errorCode:u})},validate:(s,i,{regex:u,options:d},{errorCode:p})=>u.test(s)^d.invert?s:i.error(p,{name:d.name,regex:u,value:s}),args:["regex","options"],multi:!0},replace:{method(s,i){typeof s=="string"&&(s=new RegExp(e(s),"g")),o(s instanceof RegExp,"pattern must be a RegExp"),o(typeof i=="string","replacement must be a String");const u=this.clone();return u.$_terms.replacements||(u.$_terms.replacements=[]),u.$_terms.replacements.push({pattern:s,replacement:i}),u}},token:{method(){return this.$_addRule("token")},validate:(s,i)=>/^\w+$/.test(s)?s:i.error("string.token")},trim:{method(s=!0){return o(typeof s=="boolean","enabled must be a boolean"),this.$_addRule({name:"trim",args:{enabled:s}})},validate:(s,i,{enabled:u})=>u&&s!==s.trim()?i.error("string.trim"):s,convert:!0},truncate:{method(s=!0){return o(typeof s=="boolean","enabled must be a boolean"),this.$_setFlag("truncate",s)}},uppercase:{method(){return this.case("upper")}},uri:{method(s={}){t.assertOptions(s,["allowRelative","allowQuerySquareBrackets","domain","relativeOnly","scheme","encodeUri"]),s.domain&&t.assertOptions(s.domain,["allowFullyQualified","allowUnicode","maxDomainSegments","minDomainSegments","tlds"]);const{regex:i,scheme:u}=n.regex(s),d=s.domain?l.addressOptions(s.domain):null;return this.$_addRule({name:"uri",args:{options:s},regex:i,domain:d,scheme:u})},validate(s,i,{options:u},{regex:d,domain:p,scheme:_}){if(["http:/","https:/"].includes(s))return i.error("string.uri");let v=d.exec(s);if(!v&&i.prefs.convert&&u.encodeUri){const c=encodeURI(s);v=d.exec(c),v&&(s=c)}if(v){const c=v[1]||v[2];return!p||u.allowRelative&&!c||b.isValid(c,p)?s:i.error("string.domain",{value:c})}return u.relativeOnly?i.error("string.uriRelativeOnly"):u.scheme?i.error("string.uriCustomScheme",{scheme:_,value:s}):i.error("string.uri")}}},manifest:{build(s,i){if(i.replacements)for(const{pattern:u,replacement:d}of i.replacements)s=s.replace(u,d);return s}},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"}}),l.addressOptions=function(s){if(!s)return l.tlds||s;if(o(s.minDomainSegments===void 0||Number.isSafeInteger(s.minDomainSegments)&&s.minDomainSegments>0,"minDomainSegments must be a positive integer"),o(s.maxDomainSegments===void 0||Number.isSafeInteger(s.maxDomainSegments)&&s.maxDomainSegments>0,"maxDomainSegments must be a positive integer"),s.tlds===!1)return s;if(s.tlds===!0||s.tlds===void 0)return o(l.tlds,"Built-in TLD list disabled"),Object.assign({},s,l.tlds);o(typeof s.tlds=="object","tlds must be true, false, or an object");const i=s.tlds.deny;if(i)return Array.isArray(i)&&(s=Object.assign({},s,{tlds:{deny:new Set(i)}})),o(s.tlds.deny instanceof Set,"tlds.deny must be an array, Set, or boolean"),o(!s.tlds.allow,"Cannot specify both tlds.allow and tlds.deny lists"),l.validateTlds(s.tlds.deny,"tlds.deny"),s;const u=s.tlds.allow;return u?u===!0?(o(l.tlds,"Built-in TLD list disabled"),Object.assign({},s,l.tlds)):(Array.isArray(u)&&(s=Object.assign({},s,{tlds:{allow:new Set(u)}})),o(s.tlds.allow instanceof Set,"tlds.allow must be an array, Set, or boolean"),l.validateTlds(s.tlds.allow,"tlds.allow"),s):s},l.validateTlds=function(s,i){for(const u of s)o(b.isValid(u,{minDomainSegments:1,maxDomainSegments:1}),`${i} must contain valid top level domain names`)},l.isoDate=function(s){if(!t.isIsoDate(s))return null;/.*T.*[+-]\d\d$/.test(s)&&(s+="00");const i=new Date(s);return isNaN(i.getTime())?null:i.toISOString()},l.length=function(s,i,u,d,p){return o(!p||!1,"Invalid encoding:",p),s.$_addRule({name:i,method:"length",args:{limit:u,encoding:p},operator:d})}},8826:(j,w,g)=>{const o=g(375),b=g(8068),h={};h.Map=class extends Map{slice(){return new h.Map(this)}},j.exports=b.extend({type:"symbol",terms:{map:{init:new h.Map}},coerce:{method(f,{schema:e,error:a}){const n=e.$_terms.map.get(f);return n&&(f=n),e._flags.only&&typeof f!="symbol"?{value:f,errors:a("symbol.map",{map:e.$_terms.map})}:{value:f}}},validate(f,{error:e}){if(typeof f!="symbol")return{value:f,errors:e("symbol.base")}},rules:{map:{method(f){f&&!f[Symbol.iterator]&&typeof f=="object"&&(f=Object.entries(f)),o(f&&f[Symbol.iterator],"Iterable must be an iterable or object");const e=this.clone(),a=[];for(const n of f){o(n&&n[Symbol.iterator],"Entry must be an iterable");const[r,t]=n;o(typeof r!="object"&&typeof r!="function"&&typeof r!="symbol","Key must not be of type object, function, or Symbol"),o(typeof t=="symbol","Value must be a Symbol"),e.$_terms.map.set(r,t),a.push(t)}return e.valid(...a)}}},manifest:{build:(f,e)=>(e.map&&(f=f.map(e.map)),f)},messages:{"symbol.base":"{{#label}} must be a symbol","symbol.map":"{{#label}} must be one of {{#map}}"}})},8863:(j,w,g)=>{const o=g(375),b=g(8571),h=g(738),f=g(9621),e=g(8160),a=g(6354),n=g(493),r={result:Symbol("result")};w.entry=function(t,l,s){let i=e.defaults;s&&(o(s.warnings===void 0,"Cannot override warnings preference in synchronous validation"),o(s.artifacts===void 0,"Cannot override artifacts preference in synchronous validation"),i=e.preferences(e.defaults,s));const u=r.entry(t,l,i);o(!u.mainstay.externals.length,"Schema with external rules must use validateAsync()");const d={value:u.value};return u.error&&(d.error=u.error),u.mainstay.warnings.length&&(d.warning=a.details(u.mainstay.warnings)),u.mainstay.debug&&(d.debug=u.mainstay.debug),u.mainstay.artifacts&&(d.artifacts=u.mainstay.artifacts),d},w.entryAsync=async function(t,l,s){let i=e.defaults;s&&(i=e.preferences(e.defaults,s));const u=r.entry(t,l,i),d=u.mainstay;if(u.error)throw d.debug&&(u.error.debug=d.debug),u.error;if(d.externals.length){let _=u.value;const v=[];for(const c of d.externals){const m=c.state.path,y=c.schema.type==="link"?d.links.get(c.schema):null;let x,S,R=_;const C=m.length?[_]:[],D=m.length?f(t,m):t;if(m.length){x=m[m.length-1];let I=_;for(const T of m.slice(0,-1))I=I[T],C.unshift(I);S=C[0],R=S[x]}try{const I=(P,J)=>(y||c.schema).$_createError(P,R,J,c.state,i),T=await c.method(R,{schema:c.schema,linked:y,state:c.state,prefs:s,original:D,error:I,errorsArray:r.errorsArray,warn:(P,J)=>d.warnings.push((y||c.schema).$_createError(P,R,J,c.state,i)),message:(P,J)=>(y||c.schema).$_createError("external",R,J,c.state,i,{messages:P})});if(T===void 0||T===R)continue;if(T instanceof a.Report){if(d.tracer.log(c.schema,c.state,"rule","external","error"),v.push(T),i.abortEarly)break;continue}if(Array.isArray(T)&&T[e.symbols.errors]){if(d.tracer.log(c.schema,c.state,"rule","external","error"),v.push(...T),i.abortEarly)break;continue}S?(d.tracer.value(c.state,"rule",R,T,"external"),S[x]=T):(d.tracer.value(c.state,"rule",_,T,"external"),_=T)}catch(I){throw i.errors.label&&(I.message+=` (${c.label})`),I}}if(u.value=_,v.length)throw u.error=a.process(v,t,i),d.debug&&(u.error.debug=d.debug),u.error}if(!i.warnings&&!i.debug&&!i.artifacts)return u.value;const p={value:u.value};return d.warnings.length&&(p.warning=a.details(d.warnings)),d.debug&&(p.debug=d.debug),d.artifacts&&(p.artifacts=d.artifacts),p},r.Mainstay=class{constructor(t,l,s){this.externals=[],this.warnings=[],this.tracer=t,this.debug=l,this.links=s,this.shadow=null,this.artifacts=null,this._snapshots=[]}snapshot(){this._snapshots.push({externals:this.externals.slice(),warnings:this.warnings.slice()})}restore(){const t=this._snapshots.pop();this.externals=t.externals,this.warnings=t.warnings}commit(){this._snapshots.pop()}},r.entry=function(t,l,s){const{tracer:i,cleanup:u}=r.tracer(l,s),d=s.debug?[]:null,p=l._ids._schemaChain?new Map:null,_=new r.Mainstay(i,d,p),v=l._ids._schemaChain?[{schema:l}]:null,c=new n([],[],{mainstay:_,schemas:v}),m=w.validate(t,l,c,s);u&&l.$_root.untrace();const y=a.process(m.errors,t,s);return{value:m.value,error:y,mainstay:_}},r.tracer=function(t,l){return t.$_root._tracer?{tracer:t.$_root._tracer._register(t)}:l.debug?(o(t.$_root.trace,"Debug mode not supported"),{tracer:t.$_root.trace()._register(t),cleanup:!0}):{tracer:r.ignore}},w.validate=function(t,l,s,i,u={}){if(l.$_terms.whens&&(l=l._generate(t,s,i).schema),l._preferences&&(i=r.prefs(l,i)),l._cache&&i.cache){const y=l._cache.get(t);if(s.mainstay.tracer.debug(s,"validate","cached",!!y),y)return y}const d=(y,x,S)=>l.$_createError(y,t,x,S||s,i),p={original:t,prefs:i,schema:l,state:s,error:d,errorsArray:r.errorsArray,warn:(y,x,S)=>s.mainstay.warnings.push(d(y,x,S)),message:(y,x)=>l.$_createError("custom",t,x,s,i,{messages:y})};s.mainstay.tracer.entry(l,s);const _=l._definition;if(_.prepare&&t!==void 0&&i.convert){const y=_.prepare(t,p);if(y){if(s.mainstay.tracer.value(s,"prepare",t,y.value),y.errors)return r.finalize(y.value,[].concat(y.errors),p);t=y.value}}if(_.coerce&&t!==void 0&&i.convert&&(!_.coerce.from||_.coerce.from.includes(typeof t))){const y=_.coerce.method(t,p);if(y){if(s.mainstay.tracer.value(s,"coerced",t,y.value),y.errors)return r.finalize(y.value,[].concat(y.errors),p);t=y.value}}const v=l._flags.empty;v&&v.$_match(r.trim(t,l),s.nest(v),e.defaults)&&(s.mainstay.tracer.value(s,"empty",t,void 0),t=void 0);const c=u.presence||l._flags.presence||(l._flags._endedSwitch?null:i.presence);if(t===void 0){if(c==="forbidden")return r.finalize(t,null,p);if(c==="required")return r.finalize(t,[l.$_createError("any.required",t,null,s,i)],p);if(c==="optional"){if(l._flags.default!==e.symbols.deepDefault)return r.finalize(t,null,p);s.mainstay.tracer.value(s,"default",t,{}),t={}}}else if(c==="forbidden")return r.finalize(t,[l.$_createError("any.unknown",t,null,s,i)],p);const m=[];if(l._valids){const y=l._valids.get(t,s,i,l._flags.insensitive);if(y)return i.convert&&(s.mainstay.tracer.value(s,"valids",t,y.value),t=y.value),s.mainstay.tracer.filter(l,s,"valid",y),r.finalize(t,null,p);if(l._flags.only){const x=l.$_createError("any.only",t,{valids:l._valids.values({display:!0})},s,i);if(i.abortEarly)return r.finalize(t,[x],p);m.push(x)}}if(l._invalids){const y=l._invalids.get(t,s,i,l._flags.insensitive);if(y){s.mainstay.tracer.filter(l,s,"invalid",y);const x=l.$_createError("any.invalid",t,{invalids:l._invalids.values({display:!0})},s,i);if(i.abortEarly)return r.finalize(t,[x],p);m.push(x)}}if(_.validate){const y=_.validate(t,p);if(y&&(s.mainstay.tracer.value(s,"base",t,y.value),t=y.value,y.errors)){if(!Array.isArray(y.errors))return m.push(y.errors),r.finalize(t,m,p);if(y.errors.length)return m.push(...y.errors),r.finalize(t,m,p)}}return l._rules.length?r.rules(t,m,p):r.finalize(t,m,p)},r.rules=function(t,l,s){const{schema:i,state:u,prefs:d}=s;for(const p of i._rules){const _=i._definition.rules[p.method];if(_.convert&&d.convert){u.mainstay.tracer.log(i,u,"rule",p.name,"full");continue}let v,c=p.args;if(p._resolve.length){c=Object.assign({},c);for(const y of p._resolve){const x=_.argsByName.get(y),S=c[y].resolve(t,u,d),R=x.normalize?x.normalize(S):S,C=e.validateArg(R,null,x);if(C){v=i.$_createError("any.ref",S,{arg:y,ref:c[y],reason:C},u,d);break}c[y]=R}}v=v||_.validate(t,s,c,p);const m=r.rule(v,p);if(m.errors){if(u.mainstay.tracer.log(i,u,"rule",p.name,"error"),p.warn){u.mainstay.warnings.push(...m.errors);continue}if(d.abortEarly)return r.finalize(t,m.errors,s);l.push(...m.errors)}else u.mainstay.tracer.log(i,u,"rule",p.name,"pass"),u.mainstay.tracer.value(u,"rule",t,m.value,p.name),t=m.value}return r.finalize(t,l,s)},r.rule=function(t,l){return t instanceof a.Report?(r.error(t,l),{errors:[t],value:null}):Array.isArray(t)&&t[e.symbols.errors]?(t.forEach(s=>r.error(s,l)),{errors:t,value:null}):{errors:null,value:t}},r.error=function(t,l){return l.message&&t._setTemplate(l.message),t},r.finalize=function(t,l,s){l=l||[];const{schema:i,state:u,prefs:d}=s;if(l.length){const _=r.default("failover",void 0,l,s);_!==void 0&&(u.mainstay.tracer.value(u,"failover",t,_),t=_,l=[])}if(l.length&&i._flags.error)if(typeof i._flags.error=="function"){l=i._flags.error(l),Array.isArray(l)||(l=[l]);for(const _ of l)o(_ instanceof Error||_ instanceof a.Report,"error() must return an Error object")}else l=[i._flags.error];if(t===void 0){const _=r.default("default",t,l,s);u.mainstay.tracer.value(u,"default",t,_),t=_}if(i._flags.cast&&t!==void 0){const _=i._definition.cast[i._flags.cast];if(_.from(t)){const v=_.to(t,s);u.mainstay.tracer.value(u,"cast",t,v,i._flags.cast),t=v}}if(i.$_terms.externals&&d.externals&&d._externals!==!1)for(const{method:_}of i.$_terms.externals)u.mainstay.externals.push({method:_,schema:i,state:u,label:a.label(i._flags,u,d)});const p={value:t,errors:l.length?l:null};return i._flags.result&&(p.value=i._flags.result==="strip"?void 0:s.original,u.mainstay.tracer.value(u,i._flags.result,t,p.value),u.shadow(t,i._flags.result)),i._cache&&d.cache!==!1&&!i._refs.length&&i._cache.set(s.original,p),t===void 0||p.errors||i._flags.artifact===void 0||(u.mainstay.artifacts=u.mainstay.artifacts||new Map,u.mainstay.artifacts.has(i._flags.artifact)||u.mainstay.artifacts.set(i._flags.artifact,[]),u.mainstay.artifacts.get(i._flags.artifact).push(u.path)),p},r.prefs=function(t,l){const s=l===e.defaults;return s&&t._preferences[e.symbols.prefs]?t._preferences[e.symbols.prefs]:(l=e.preferences(l,t._preferences),s&&(t._preferences[e.symbols.prefs]=l),l)},r.default=function(t,l,s,i){const{schema:u,state:d,prefs:p}=i,_=u._flags[t];if(p.noDefaults||_===void 0)return l;if(d.mainstay.tracer.log(u,d,"rule",t,"full"),!_)return _;if(typeof _=="function"){const v=_.length?[b(d.ancestors[0]),i]:[];try{return _(...v)}catch(c){return void s.push(u.$_createError(`any.${t}`,null,{error:c},d,p))}}return typeof _!="object"?_:_[e.symbols.literal]?_.literal:e.isResolvable(_)?_.resolve(l,d,p):b(_)},r.trim=function(t,l){if(typeof t!="string")return t;const s=l.$_getRule("trim");return s&&s.args.enabled?t.trim():t},r.ignore={active:!1,debug:h,entry:h,filter:h,log:h,resolve:h,value:h},r.errorsArray=function(){const t=[];return t[e.symbols.errors]=!0,t}},2036:(j,w,g)=>{const o=g(375),b=g(9474),h=g(8160),f={};j.exports=f.Values=class{constructor(e,a){this._values=new Set(e),this._refs=new Set(a),this._lowercase=f.lowercases(e),this._override=!1}get length(){return this._values.size+this._refs.size}add(e,a){h.isResolvable(e)?this._refs.has(e)||(this._refs.add(e),a&&a.register(e)):this.has(e,null,null,!1)||(this._values.add(e),typeof e=="string"&&this._lowercase.set(e.toLowerCase(),e))}static merge(e,a,n){if(e=e||new f.Values,a){if(a._override)return a.clone();for(const r of[...a._values,...a._refs])e.add(r)}if(n)for(const r of[...n._values,...n._refs])e.remove(r);return e.length?e:null}remove(e){h.isResolvable(e)?this._refs.delete(e):(this._values.delete(e),typeof e=="string"&&this._lowercase.delete(e.toLowerCase()))}has(e,a,n,r){return!!this.get(e,a,n,r)}get(e,a,n,r){if(!this.length)return!1;if(this._values.has(e))return{value:e};if(typeof e=="string"&&e&&r){const t=this._lowercase.get(e.toLowerCase());if(t)return{value:t}}if(!this._refs.size&&typeof e!="object")return!1;if(typeof e=="object"){for(const t of this._values)if(b(t,e))return{value:t}}if(a)for(const t of this._refs){const l=t.resolve(e,a,n,null,{in:!0});if(l===void 0)continue;const s=t.in&&typeof l=="object"?Array.isArray(l)?l:Object.keys(l):[l];for(const i of s)if(typeof i==typeof e){if(r&&e&&typeof e=="string"){if(i.toLowerCase()===e.toLowerCase())return{value:i,ref:t}}else if(b(i,e))return{value:i,ref:t}}}return!1}override(){this._override=!0}values(e){if(e&&e.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 e=new f.Values(this._values,this._refs);return e._override=this._override,e}concat(e){o(!e._override,"Cannot concat override set of values");const a=new f.Values([...this._values,...e._values],[...this._refs,...e._refs]);return a._override=this._override,a}describe(){const e=[];this._override&&e.push({override:!0});for(const a of this._values.values())e.push(a&&typeof a=="object"?{value:a}:a);for(const a of this._refs.values())e.push(a.describe());return e}},f.Values.prototype[h.symbols.values]=!0,f.Values.prototype.slice=f.Values.prototype.clone,f.lowercases=function(e){const a=new Map;if(e)for(const n of e)typeof n=="string"&&a.set(n.toLowerCase(),n);return a}},978:(j,w,g)=>{const o=g(375),b=g(8571),h=g(1687),f=g(9621),e={};j.exports=function(a,n,r={}){if(o(a&&typeof a=="object","Invalid defaults value: must be an object"),o(!n||n===!0||typeof n=="object","Invalid source value: must be true, falsy or an object"),o(typeof r=="object","Invalid options: must be an object"),!n)return null;if(r.shallow)return e.applyToDefaultsWithShallow(a,n,r);const t=b(a);if(n===!0)return t;const l=r.nullOverride!==void 0&&r.nullOverride;return h(t,n,{nullOverride:l,mergeArrays:!1})},e.applyToDefaultsWithShallow=function(a,n,r){const t=r.shallow;o(Array.isArray(t),"Invalid keys");const l=new Map,s=n===!0?null:new Set;for(let d of t){d=Array.isArray(d)?d:d.split(".");const p=f(a,d);p&&typeof p=="object"?l.set(p,s&&f(n,d)||p):s&&s.add(d)}const i=b(a,{},l);if(!s)return i;for(const d of s)e.reachCopy(i,n,d);const u=r.nullOverride!==void 0&&r.nullOverride;return h(i,n,{nullOverride:u,mergeArrays:!1})},e.reachCopy=function(a,n,r){for(const s of r){if(!(s in n))return;const i=n[s];if(typeof i!="object"||i===null)return;n=i}const t=n;let l=a;for(let s=0;s<r.length-1;++s){const i=r[s];typeof l[i]!="object"&&(l[i]={}),l=l[i]}l[r[r.length-1]]=t}},375:(j,w,g)=>{const o=g(7916);j.exports=function(b,...h){if(!b)throw h.length===1&&h[0]instanceof Error?h[0]:new o(h)}},8571:(j,w,g)=>{const o=g(9621),b=g(4277),h=g(7043),f={needsProtoHack:new Set([b.set,b.map,b.weakSet,b.weakMap])};j.exports=f.clone=function(e,a={},n=null){if(typeof e!="object"||e===null)return e;let r=f.clone,t=n;if(a.shallow){if(a.shallow!==!0)return f.cloneWithShallow(e,a);r=u=>u}else if(t){const u=t.get(e);if(u)return u}else t=new Map;const l=b.getInternalProto(e);if(l===b.buffer)return!1;if(l===b.date)return new Date(e.getTime());if(l===b.regex)return new RegExp(e);const s=f.base(e,l,a);if(s===e)return e;if(t&&t.set(e,s),l===b.set)for(const u of e)s.add(r(u,a,t));else if(l===b.map)for(const[u,d]of e)s.set(u,r(d,a,t));const i=h.keys(e,a);for(const u of i){if(u==="__proto__")continue;if(l===b.array&&u==="length"){s.length=e.length;continue}const d=Object.getOwnPropertyDescriptor(e,u);d?d.get||d.set?Object.defineProperty(s,u,d):d.enumerable?s[u]=r(e[u],a,t):Object.defineProperty(s,u,{enumerable:!1,writable:!0,configurable:!0,value:r(e[u],a,t)}):Object.defineProperty(s,u,{enumerable:!0,writable:!0,configurable:!0,value:r(e[u],a,t)})}return s},f.cloneWithShallow=function(e,a){const n=a.shallow;(a=Object.assign({},a)).shallow=!1;const r=new Map;for(const t of n){const l=o(e,t);typeof l!="object"&&typeof l!="function"||r.set(l,l)}return f.clone(e,a,r)},f.base=function(e,a,n){if(n.prototype===!1)return f.needsProtoHack.has(a)?new a.constructor:a===b.array?[]:{};const r=Object.getPrototypeOf(e);if(r&&r.isImmutable)return e;if(a===b.array){const t=[];return r!==a&&Object.setPrototypeOf(t,r),t}if(f.needsProtoHack.has(a)){const t=new r.constructor;return r!==a&&Object.setPrototypeOf(t,r),t}return Object.create(r)}},9474:(j,w,g)=>{const o=g(4277),b={mismatched:null};j.exports=function(h,f,e){return e=Object.assign({prototype:!0},e),!!b.isDeepEqual(h,f,e,[])},b.isDeepEqual=function(h,f,e,a){if(h===f)return h!==0||1/h==1/f;const n=typeof h;if(n!==typeof f||h===null||f===null)return!1;if(n==="function"){if(!e.deepFunction||h.toString()!==f.toString())return!1}else if(n!=="object")return h!=h&&f!=f;const r=b.getSharedType(h,f,!!e.prototype);switch(r){case o.buffer:return!1;case o.promise:return h===f;case o.regex:return h.toString()===f.toString();case b.mismatched:return!1}for(let t=a.length-1;t>=0;--t)if(a[t].isSame(h,f))return!0;a.push(new b.SeenEntry(h,f));try{return!!b.isDeepEqualObj(r,h,f,e,a)}finally{a.pop()}},b.getSharedType=function(h,f,e){if(e)return Object.getPrototypeOf(h)!==Object.getPrototypeOf(f)?b.mismatched:o.getInternalProto(h);const a=o.getInternalProto(h);return a!==o.getInternalProto(f)?b.mismatched:a},b.valueOf=function(h){const f=h.valueOf;if(f===void 0)return h;try{return f.call(h)}catch(e){return e}},b.hasOwnEnumerableProperty=function(h,f){return Object.prototype.propertyIsEnumerable.call(h,f)},b.isSetSimpleEqual=function(h,f){for(const e of Set.prototype.values.call(h))if(!Set.prototype.has.call(f,e))return!1;return!0},b.isDeepEqualObj=function(h,f,e,a,n){const{isDeepEqual:r,valueOf:t,hasOwnEnumerableProperty:l}=b,{keys:s,getOwnPropertySymbols:i}=Object;if(h===o.array){if(!a.part){if(f.length!==e.length)return!1;for(let v=0;v<f.length;++v)if(!r(f[v],e[v],a,n))return!1;return!0}for(const v of f)for(const c of e)if(r(v,c,a,n))return!0}else if(h===o.set){if(f.size!==e.size)return!1;if(!b.isSetSimpleEqual(f,e)){const v=new Set(Set.prototype.values.call(e));for(const c of Set.prototype.values.call(f)){if(v.delete(c))continue;let m=!1;for(const y of v)if(r(c,y,a,n)){v.delete(y),m=!0;break}if(!m)return!1}}}else if(h===o.map){if(f.size!==e.size)return!1;for(const[v,c]of Map.prototype.entries.call(f))if(c===void 0&&!Map.prototype.has.call(e,v)||!r(c,Map.prototype.get.call(e,v),a,n))return!1}else if(h===o.error&&(f.name!==e.name||f.message!==e.message))return!1;const u=t(f),d=t(e);if((f!==u||e!==d)&&!r(u,d,a,n))return!1;const p=s(f);if(!a.part&&p.length!==s(e).length&&!a.skip)return!1;let _=0;for(const v of p)if(a.skip&&a.skip.includes(v))e[v]===void 0&&++_;else if(!l(e,v)||!r(f[v],e[v],a,n))return!1;if(!a.part&&p.length-_!==s(e).length)return!1;if(a.symbols!==!1){const v=i(f),c=new Set(i(e));for(const m of v){if(!a.skip||!a.skip.includes(m)){if(l(f,m)){if(!l(e,m)||!r(f[m],e[m],a,n))return!1}else if(l(e,m))return!1}c.delete(m)}for(const m of c)if(l(e,m))return!1}return!0},b.SeenEntry=class{constructor(h,f){this.obj=h,this.ref=f}isSame(h,f){return this.obj===h&&this.ref===f}}},7916:(j,w,g)=>{const o=g(8761);j.exports=class extends Error{constructor(b){super(b.filter(h=>h!=="").map(h=>typeof h=="string"?h:h instanceof Error?h.message:o(h)).join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,w.assert)}}},5277:j=>{const w={};j.exports=function(g){if(!g)return"";let o="";for(let b=0;b<g.length;++b){const h=g.charCodeAt(b);w.isSafe(h)?o+=g[b]:o+=w.escapeHtmlChar(h)}return o},w.escapeHtmlChar=function(g){return w.namedHtml.get(g)||(g>=256?"&#"+g+";":`&#x${g.toString(16).padStart(2,"0")};`)},w.isSafe=function(g){return w.safeCharCodes.has(g)},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 g=new Set;for(let o=32;o<123;++o)(o>=97||o>=65&&o<=90||o>=48&&o<=57||o===32||o===46||o===44||o===45||o===58||o===95)&&g.add(o);return g}()},6064:j=>{j.exports=function(w){return w.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}},738:j=>{j.exports=function(){}},1687:(j,w,g)=>{const o=g(375),b=g(8571),h=g(7043),f={};j.exports=f.merge=function(e,a,n){if(o(e&&typeof e=="object","Invalid target value: must be an object"),o(a==null||typeof a=="object","Invalid source value: must be null, undefined, or an object"),!a)return e;if(n=Object.assign({nullOverride:!0,mergeArrays:!0},n),Array.isArray(a)){o(Array.isArray(e),"Cannot merge array onto an object"),n.mergeArrays||(e.length=0);for(let t=0;t<a.length;++t)e.push(b(a[t],{symbols:n.symbols}));return e}const r=h.keys(a,n);for(let t=0;t<r.length;++t){const l=r[t];if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(a,l))continue;const s=a[l];if(s&&typeof s=="object"){if(e[l]===s)continue;!e[l]||typeof e[l]!="object"||Array.isArray(e[l])!==Array.isArray(s)||s instanceof Date||s instanceof RegExp?e[l]=b(s,{symbols:n.symbols}):f.merge(e[l],s,n)}else(s!=null||n.nullOverride)&&(e[l]=s)}return e}},9621:(j,w,g)=>{const o=g(375),b={};j.exports=function(h,f,e){if(f===!1||f==null)return h;typeof(e=e||{})=="string"&&(e={separator:e});const a=Array.isArray(f);o(!a||!e.separator,"Separator option is not valid for array-based chain");const n=a?f:f.split(e.separator||".");let r=h;for(let t=0;t<n.length;++t){let l=n[t];const s=e.iterables&&b.iterables(r);if(Array.isArray(r)||s==="set"){const i=Number(l);Number.isInteger(i)&&(l=i<0?r.length+i:i)}if(!r||typeof r=="function"&&e.functions===!1||!s&&r[l]===void 0){o(!e.strict||t+1===n.length,"Missing segment",l,"in reach path ",f),o(typeof r=="object"||e.functions===!0||typeof r!="function","Invalid segment",l,"in reach path ",f),r=e.default;break}r=s?s==="set"?[...r][l]:r.get(l):r[l]}return r},b.iterables=function(h){return h instanceof Set?"set":h instanceof Map?"map":void 0}},8761:j=>{j.exports=function(...w){try{return JSON.stringify(...w)}catch(g){return"[Cannot display object: "+g.message+"]"}}},4277:(j,w)=>{const g={};w=j.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},g.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(o){if(Array.isArray(o))return w.array;if(o instanceof Date)return w.date;if(o instanceof RegExp)return w.regex;if(o instanceof Error)return w.error;const b=Object.prototype.toString.call(o);return g.typeMap.get(b)||w.generic}},7043:(j,w)=>{w.keys=function(g,o={}){return o.symbols!==!1?Reflect.ownKeys(g):Object.getOwnPropertyNames(g)}},3652:(j,w,g)=>{const o=g(375),b={};w.Sorter=class{constructor(){this._items=[],this.nodes=[]}add(h,f){const e=[].concat((f=f||{}).before||[]),a=[].concat(f.after||[]),n=f.group||"?",r=f.sort||0;o(!e.includes(n),`Item cannot come before itself: ${n}`),o(!e.includes("?"),"Item cannot come before unassociated items"),o(!a.includes(n),`Item cannot come after itself: ${n}`),o(!a.includes("?"),"Item cannot come after unassociated items"),Array.isArray(h)||(h=[h]);for(const t of h){const l={seq:this._items.length,sort:r,before:e,after:a,group:n,node:t};this._items.push(l)}if(!f.manual){const t=this._sort();o(t,"item",n!=="?"?`added into group ${n}`:"","created a dependencies error")}return this.nodes}merge(h){Array.isArray(h)||(h=[h]);for(const e of h)if(e)for(const a of e._items)this._items.push(Object.assign({},a));this._items.sort(b.mergeSort);for(let e=0;e<this._items.length;++e)this._items[e].seq=e;const f=this._sort();return o(f,"merge created a dependencies error"),this.nodes}sort(){const h=this._sort();return o(h,"sort created a dependencies error"),this.nodes}_sort(){const h={},f=Object.create(null),e=Object.create(null);for(const l of this._items){const s=l.seq,i=l.group;e[i]=e[i]||[],e[i].push(s),h[s]=l.before;for(const u of l.after)f[u]=f[u]||[],f[u].push(s)}for(const l in h){const s=[];for(const i in h[l]){const u=h[l][i];e[u]=e[u]||[],s.push(...e[u])}h[l]=s}for(const l in f)if(e[l])for(const s of e[l])h[s].push(...f[l]);const a={};for(const l in h){const s=h[l];for(const i of s)a[i]=a[i]||[],a[i].push(l)}const n={},r=[];for(let l=0;l<this._items.length;++l){let s=l;if(a[l]){s=null;for(let i=0;i<this._items.length;++i){if(n[i]===!0)continue;a[i]||(a[i]=[]);const u=a[i].length;let d=0;for(let p=0;p<u;++p)n[a[i][p]]&&++d;if(d===u){s=i;break}}}s!==null&&(n[s]=!0,r.push(s))}if(r.length!==this._items.length)return!1;const t={};for(const l of this._items)t[l.seq]=l;this._items=[],this.nodes=[];for(const l of r){const s=t[l];this.nodes.push(s.node),this._items.push(s)}return!0}},b.mergeSort=(h,f)=>h.sort===f.sort?0:h.sort<f.sort?-1:1},5380:(j,w,g)=>{const o=g(443),b=g(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:o.URL||URL};w.analyze=function(f,e={}){if(!f)return b.code("DOMAIN_NON_EMPTY_STRING");if(typeof f!="string")throw new Error("Invalid input: domain must be a string");if(f.length>256)return b.code("DOMAIN_TOO_LONG");if(h.nonAsciiRx.test(f)){if(e.allowUnicode===!1)return b.code("DOMAIN_INVALID_UNICODE_CHARS");f=f.normalize("NFC")}if(h.domainControlRx.test(f))return b.code("DOMAIN_INVALID_CHARS");f=h.punycode(f),e.allowFullyQualified&&f[f.length-1]==="."&&(f=f.slice(0,-1));const a=e.minDomainSegments||h.minDomainSegments,n=f.split(".");if(n.length<a)return b.code("DOMAIN_SEGMENTS_COUNT");if(e.maxDomainSegments&&n.length>e.maxDomainSegments)return b.code("DOMAIN_SEGMENTS_COUNT_MAX");const r=e.tlds;if(r){const t=n[n.length-1].toLowerCase();if(r.deny&&r.deny.has(t)||r.allow&&!r.allow.has(t))return b.code("DOMAIN_FORBIDDEN_TLDS")}for(let t=0;t<n.length;++t){const l=n[t];if(!l.length)return b.code("DOMAIN_EMPTY_SEGMENT");if(l.length>63)return b.code("DOMAIN_LONG_SEGMENT");if(t<n.length-1){if(!h.domainSegmentRx.test(l))return b.code("DOMAIN_INVALID_CHARS")}else if(!h.tldSegmentRx.test(l))return b.code("DOMAIN_INVALID_TLDS_CHARS")}return null},w.isValid=function(f,e){return!w.analyze(f,e)},h.punycode=function(f){f.includes("%")&&(f=f.replace(/%/g,"%25"));try{return new h.URL(`http://${f}`).host}catch{return f}}},1745:(j,w,g)=>{const o=g(9848),b=g(5380),h=g(2178),f={nonAsciiRx:/[^\x00-\x7f]/,encoder:new(o.TextEncoder||TextEncoder)};w.analyze=function(e,a){return f.email(e,a)},w.isValid=function(e,a){return!f.email(e,a)},f.email=function(e,a={}){if(typeof e!="string")throw new Error("Invalid input: email must be a string");if(!e)return h.code("EMPTY_STRING");const n=!f.nonAsciiRx.test(e);if(!n){if(a.allowUnicode===!1)return h.code("FORBIDDEN_UNICODE");e=e.normalize("NFC")}const r=e.split("@");if(r.length!==2)return r.length>2?h.code("MULTIPLE_AT_CHAR"):h.code("MISSING_AT_CHAR");const[t,l]=r;if(!t)return h.code("EMPTY_LOCAL");if(!a.ignoreLength){if(e.length>254)return h.code("ADDRESS_TOO_LONG");if(f.encoder.encode(t).length>64)return h.code("LOCAL_TOO_LONG")}return f.local(t,n)||b.analyze(l,a)},f.local=function(e,a){const n=e.split(".");for(const r of n){if(!r.length)return h.code("EMPTY_LOCAL_SEGMENT");if(a){if(!f.atextRx.test(r))return h.code("INVALID_LOCAL_CHARS")}else for(const t of r){if(f.atextRx.test(t))continue;const l=f.binary(t);if(!f.atomRx.test(l))return h.code("INVALID_LOCAL_CHARS")}}},f.binary=function(e){return Array.from(f.encoder.encode(e)).map(a=>String.fromCharCode(a)).join("")},f.atextRx=/^[\w!#\$%&'\*\+\-/=\?\^`\{\|\}~]+$/,f.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:(j,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(g){return{code:g,error:w.codes[g]}}},9959:(j,w,g)=>{const o=g(375),b=g(5752);w.regex=function(h={}){o(h.cidr===void 0||typeof h.cidr=="string","options.cidr must be a string");const f=h.cidr?h.cidr.toLowerCase():"optional";o(["required","optional","forbidden"].includes(f),"options.cidr must be one of required, optional, forbidden"),o(h.version===void 0||typeof h.version=="string"||Array.isArray(h.version),"options.version must be a string or an array of string");let e=h.version||["ipv4","ipv6","ipvfuture"];Array.isArray(e)||(e=[e]),o(e.length>=1,"options.version must have at least 1 version specified");for(let r=0;r<e.length;++r)o(typeof e[r]=="string","options.version must only contain strings"),e[r]=e[r].toLowerCase(),o(["ipv4","ipv6","ipvfuture"].includes(e[r]),"options.version contains unknown version "+e[r]+" - must be one of ipv4, ipv6, ipvfuture");e=Array.from(new Set(e));const a=`(?:${e.map(r=>{if(f==="forbidden")return b.ip[r];const t=`\\/${r==="ipv4"?b.ip.v4Cidr:b.ip.v6Cidr}`;return f==="required"?`${b.ip[r]}${t}`:`${b.ip[r]}(?:${t})?`}).join("|")})`,n=new RegExp(`^${a}$`);return{cidr:f,versions:e,regex:n,raw:a}}},5752:(j,w,g)=>{const o=g(375),b=g(6064),h={generate:function(){const f={},e="\\dA-Fa-f",a="["+e+"]",n="\\w-\\.~",r="!\\$&'\\(\\)\\*\\+,;=",t="%"+e,l=n+t+r+":@",s="["+l+"]",i="(?:0{0,2}\\d|0?[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])";f.ipv4address="(?:"+i+"\\.){3}"+i;const u=a+"{1,4}",d="(?:"+u+":"+u+"|"+f.ipv4address+")",p="(?:"+u+":){6}"+d,_="::(?:"+u+":){5}"+d,v="(?:"+u+")?::(?:"+u+":){4}"+d,c="(?:(?:"+u+":){0,1}"+u+")?::(?:"+u+":){3}"+d,m="(?:(?:"+u+":){0,2}"+u+")?::(?:"+u+":){2}"+d,y="(?:(?:"+u+":){0,3}"+u+")?::"+u+":"+d,x="(?:(?:"+u+":){0,4}"+u+")?::"+d,S="(?:(?:"+u+":){0,5}"+u+")?::"+u,R="(?:(?:"+u+":){0,6}"+u+")?::";f.ipv4Cidr="(?:\\d|[1-2]\\d|3[0-2])",f.ipv6Cidr="(?:0{0,2}\\d|0?[1-9]\\d|1[01]\\d|12[0-8])",f.ipv6address="(?:"+p+"|"+_+"|"+v+"|"+c+"|"+m+"|"+y+"|"+x+"|"+S+"|"+R+")",f.ipvFuture="v"+a+"+\\.["+n+r+":]+",f.scheme="[a-zA-Z][a-zA-Z\\d+-\\.]*",f.schemeRegex=new RegExp(f.scheme);const C="["+n+t+r+":]*",D="["+n+t+r+"]{1,255}",I="(?:\\[(?:"+f.ipv6address+"|"+f.ipvFuture+")\\]|"+f.ipv4address+"|"+D+")",T="(?:"+C+"@)?"+I+"(?::\\d*)?",P="(?:"+C+"@)?("+I+")(?::\\d*)?",J=s+"*",q=s+"+",L="(?:\\/"+J+")*",F="\\/(?:"+q+L+")?",B=q+L,W="["+n+t+r+"@]+"+L,se="(?:\\/\\/\\/"+J+L+")";return f.hierPart="(?:(?:\\/\\/"+T+L+")|"+F+"|"+B+"|"+se+")",f.hierPartCapture="(?:(?:\\/\\/"+P+L+")|"+F+"|"+B+")",f.relativeRef="(?:(?:\\/\\/"+T+L+")|"+F+"|"+W+"|)",f.relativeRefCapture="(?:(?:\\/\\/"+P+L+")|"+F+"|"+W+"|)",f.query="["+l+"\\/\\?]*(?=#|$)",f.queryWithSquareBrackets="["+l+"\\[\\]\\/\\?]*(?=#|$)",f.fragment="["+l+"\\/\\?]*",f}};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(f){const e=h.rfc3986,a="(?:\\?"+(f.allowQuerySquareBrackets?e.queryWithSquareBrackets:e.query)+")?(?:#"+e.fragment+")?",n=f.domain?e.relativeRefCapture:e.relativeRef;if(f.relativeOnly)return h.wrap(n+a);let r="";if(f.scheme){o(f.scheme instanceof RegExp||typeof f.scheme=="string"||Array.isArray(f.scheme),"scheme must be a RegExp, String, or Array");const s=[].concat(f.scheme);o(s.length>=1,"scheme must have at least 1 scheme specified");const i=[];for(let u=0;u<s.length;++u){const d=s[u];o(d instanceof RegExp||typeof d=="string","scheme at position "+u+" must be a RegExp or String"),d instanceof RegExp?i.push(d.source.toString()):(o(e.schemeRegex.test(d),"scheme at position "+u+" must be a valid scheme"),i.push(b(d)))}r=i.join("|")}const t="(?:"+(r?"(?:"+r+")":e.scheme)+":"+(f.domain?e.hierPartCapture:e.hierPart)+")",l=f.allowRelative?"(?:"+t+"|"+n+")":t;return h.wrap(l+a,r)},h.wrap=function(f,e){return{raw:f=`(?=.)(?!https?:/(?:$|[^/]))(?!https?:///)(?!https?:[^/])${f}`,regex:new RegExp(`^${f}$`),scheme:e}},h.uriRegex=h.createRegex({}),w.regex=function(f={}){return f.scheme||f.allowRelative||f.relativeOnly||f.allowQuerySquareBrackets||f.domain?h.createRegex(f):h.uriRegex}},1447:(j,w)=>{const g={operators:["!","^","*","/","%","+","-","<","<=",">",">=","==","!=","&&","||","??"],operatorCharacters:["!","^","*","/","%","+","-","<","=",">","&","|","?"],operatorsOrder:[["^"],["*","/","%"],["+","-"],["<","<=",">",">="],["==","!="],["&&"],["||","??"]],operatorsPrefix:["!","n"],literals:{'"':'"',"`":"`","'":"'","[":"]"},numberRx:/^(?:[0-9]*(\.[0-9]*)?){1}$/,tokenRx:/^[\w\$\#\.\@\:\{\}]+$/,symbol:Symbol("formula"),settings:Symbol("settings")};w.Parser=class{constructor(o,b={}){if(!b[g.settings]&&b.constants)for(const h in b.constants){const f=b.constants[h];if(f!==null&&!["boolean","number","string"].includes(typeof f))throw new Error(`Formula constant ${h} contains invalid ${typeof f} value type`)}this.settings=b[g.settings]?b:Object.assign({[g.settings]:!0,constants:{},functions:{}},b),this.single=null,this._parts=null,this._parse(o)}_parse(o){let b=[],h="",f=0,e=!1;const a=r=>{if(f)throw new Error("Formula missing closing parenthesis");const t=b.length?b[b.length-1]:null;if(e||h||r){if(t&&t.type==="reference"&&r===")")return t.type="function",t.value=this._subFormula(h,t.value),void(h="");if(r===")"){const l=new w.Parser(h,this.settings);b.push({type:"segment",value:l})}else if(e){if(e==="]")return b.push({type:"reference",value:h}),void(h="");b.push({type:"literal",value:h})}else if(g.operatorCharacters.includes(h))t&&t.type==="operator"&&g.operators.includes(t.value+h)?t.value+=h:b.push({type:"operator",value:h});else if(h.match(g.numberRx))b.push({type:"constant",value:parseFloat(h)});else if(this.settings.constants[h]!==void 0)b.push({type:"constant",value:this.settings.constants[h]});else{if(!h.match(g.tokenRx))throw new Error(`Formula contains invalid token: ${h}`);b.push({type:"reference",value:h})}h=""}};for(const r of o)e?r===e?(a(),e=!1):h+=r:f?r==="("?(h+=r,++f):r===")"?(--f,f?h+=r:a(r)):h+=r:r in g.literals?e=g.literals[r]:r==="("?(a(),++f):g.operatorCharacters.includes(r)?(a(),h=r,a()):r!==" "?h+=r:a();a(),b=b.map((r,t)=>r.type!=="operator"||r.value!=="-"||t&&b[t-1].type!=="operator"?r:{type:"operator",value:"n"});let n=!1;for(const r of b){if(r.type==="operator"){if(g.operatorsPrefix.includes(r.value))continue;if(!n)throw new Error("Formula contains an operator in invalid position");if(!g.operators.includes(r.value))throw new Error(`Formula contains an unknown operator ${r.value}`)}else if(n)throw new Error("Formula missing expected operator");n=!n}if(!n)throw new Error("Formula contains invalid trailing operator");b.length===1&&["reference","literal","constant"].includes(b[0].type)&&(this.single={type:b[0].type==="reference"?"reference":"value",value:b[0].value}),this._parts=b.map(r=>{if(r.type==="operator")return g.operatorsPrefix.includes(r.value)?r:r.value;if(r.type!=="reference")return r.value;if(this.settings.tokenRx&&!this.settings.tokenRx.test(r.value))throw new Error(`Formula contains invalid reference ${r.value}`);return this.settings.reference?this.settings.reference(r.value):g.reference(r.value)})}_subFormula(o,b){const h=this.settings.functions[b];if(typeof h!="function")throw new Error(`Formula contains unknown function ${b}`);let f=[];if(o){let e="",a=0,n=!1;const r=()=>{if(!e)throw new Error(`Formula contains function ${b} with invalid arguments ${o}`);f.push(e),e=""};for(let t=0;t<o.length;++t){const l=o[t];n?(e+=l,l===n&&(n=!1)):l in g.literals&&!a?(e+=l,n=g.literals[l]):l!==","||a?(e+=l,l==="("?++a:l===")"&&--a):r()}r()}return f=f.map(e=>new w.Parser(e,this.settings)),function(e){const a=[];for(const n of f)a.push(n.evaluate(e));return h.call(e,...a)}}evaluate(o){const b=this._parts.slice();for(let h=b.length-2;h>=0;--h){const f=b[h];if(f&&f.type==="operator"){const e=b[h+1];b.splice(h+1,1);const a=g.evaluate(e,o);b[h]=g.single(f.value,a)}}return g.operatorsOrder.forEach(h=>{for(let f=1;f<b.length-1;)if(h.includes(b[f])){const e=b[f],a=g.evaluate(b[f-1],o),n=g.evaluate(b[f+1],o);b.splice(f,2);const r=g.calculate(e,a,n);b[f-1]=r===0?0:r}else f+=2}),g.evaluate(b[0],o)}},w.Parser.prototype[g.symbol]=!0,g.reference=function(o){return function(b){return b&&b[o]!==void 0?b[o]:null}},g.evaluate=function(o,b){return o===null?null:typeof o=="function"?o(b):o[g.symbol]?o.evaluate(b):o},g.single=function(o,b){if(o==="!")return!b;const h=-b;return h===0?0:h},g.calculate=function(o,b,h){if(o==="??")return g.exists(b)?b:h;if(typeof b=="string"||typeof h=="string"){if(o==="+")return(b=g.exists(b)?b:"")+(g.exists(h)?h:"")}else switch(o){case"^":return Math.pow(b,h);case"*":return b*h;case"/":return b/h;case"%":return b%h;case"+":return b+h;case"-":return b-h}switch(o){case"<":return b<h;case"<=":return b<=h;case">":return b>h;case">=":return b>=h;case"==":return b===h;case"!=":return b!==h;case"&&":return b&&h;case"||":return b||h}return null},g.exists=function(o){return o!=null}},9926:()=>{},5688:()=>{},9708:()=>{},1152:()=>{},443:()=>{},9848:()=>{},5934:j=>{j.exports=JSON.parse('{"version":"17.13.3"}')}},A={},function j(w){var g=A[w];if(g!==void 0)return g.exports;var o=A[w]={exports:{}};return E[w](o,o.exports,j),o.exports}(5107);var E,A})})(Be);var St=Be.exports,Se={},Rt=ee&&ee.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Se,"__esModule",{value:!0});Se.BNExtension=Ot;const Q=Rt(ft);function Ot($){return{type:"BN",base:$.any(),messages:{"bn.nan":"{{#label}} is not a big number","bn.max":'{{#label}} needs to be less than or equal to "{{#threshold}}"',"bn.min":'{{#label}} needs to be greater than or equal to "{{#threshold}}"',"bn.less":'{{#label}} needs to be less than "{{#threshold}}"',"bn.greater":'{{#label}} needs to be greater than "{{#threshold}}"',"bn.positive":"{{#label}} needs to be positive","bn.negative":"{{#label}} needs to be negative"},prepare(O,E){try{return{value:new Q.default(O)}}catch{return{errors:E.error("bn.nan")}}},coerce(O){return{value:O.toString(10)}},validate(O){return{value:O}},rules:{gt:{args:[{name:"threshold",ref:!0,assert:O=>Q.default.isBN(O),message:"must be a big number",normalize:O=>new Q.default(O)},{name:"equal",assert:O=>typeof O=="boolean",message:"must be a boolean"}],validate(O,E,A){const j=new Q.default(O);return A.equal&&j.lt(A.threshold)?E.error("bn.min",A):!A.equal&&j.lte(A.threshold)?E.error("bn.greater",A):O}},lt:{args:[{name:"threshold",ref:!0,assert:O=>Q.default.isBN(O),message:"must be a big number",normalize:O=>new Q.default(O)},{name:"equal",assert:O=>typeof O=="boolean",message:"must be a boolean"}],validate(O,E,A){const j=new Q.default(O);return A.equal&&j.gt(A.threshold)?E.error("bn.max",A):!A.equal&&j.gte(A.threshold)?E.error("bn.less",A):O}},min:{alias:"gte",method(O){return this.$_addRule({name:"gt",args:{threshold:O,equal:!0}})}},max:{alias:"lte",method(O){return this.$_addRule({name:"lt",args:{threshold:O,equal:!0}})}},greater:{alias:"gt",method(O){return this.$_addRule({name:"gt",args:{threshold:O,equal:!1}})}},less:{alias:"lt",method(O){return this.$_addRule({name:"lt",args:{threshold:O,equal:!1}})}},positive:{method(){return this.$_addRule({name:"gt",args:{threshold:0,equal:!1}})}},negative:{method(){return this.$_addRule({name:"lt",args:{threshold:0,equal:!1}})}}}}}var Re={},At=ee&&ee.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Re,"__esModule",{value:!0});Re.DIDExtension=Ct;const he=At(at),pe=it,U=V,oe={pk:Object.keys(pe.types.KeyType),hash:Object.keys(pe.types.HashType),role:Object.keys(pe.types.RoleType)};function Ct($){return{type:"DID",base:$.string().trim(),messages:{"did.empty":'Expect {{#label}} to be non-empty string, got "{{#value}}"',"did.invalid":'Expect {{#label}} to be valid did, got "{{#value}}"',"did.wallet":'Expect wallet type of {{#label}} to be "{{#expected}}" wallet, got "{{#actual}}"',"did.pk":'Expect pk type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.hash":'Expect hash type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.role":'Expect role type of {{#label}} to be "{{#expected}}", got "{{#actual}}"',"did.prefix":'Expect prefix of {{#label}} to be "{{#expected}}"'},validate(O,E){return!O||typeof O!="string"?{errors:E.error("did.empty",{value:O})}:(0,U.isValid)(O)===!1?{errors:E.error("did.invalid",{value:O})}:{value:O}},rules:{type:{args:[{name:"key",ref:!0,assert:O=>Object.keys(oe).includes(O),message:`must be one of ${Object.keys(oe).join(", ")}`},{name:"expected",assert:O=>Object.keys(oe).some(E=>oe[E].includes(O)),message:"must be valid type"}],validate(O,E,A){const j=(0,U.toTypeInfoStr)(O);return A.key==="pk"&&j.pk!==A.expected?E.error("did.pk",{...A,actual:j.pk}):A.key==="hash"&&j.hash!==A.expected?E.error("did.hash",{...A,actual:j.hash}):A.key==="role"&&j.role!==A.expected?E.error("did.role",{...A,actual:j.role}):O}},pk:{method(O){return this.$_addRule({name:"type",args:{key:"pk",expected:O}})}},hash:{method(O){return this.$_addRule({name:"type",args:{key:"hash",expected:O}})}},role:{method(O){return this.$_addRule({name:"type",args:{key:"role",expected:O}})}},wallet:{method(O){return this.$_addRule({name:"wallet",args:{type:O}})},args:[{name:"type",ref:!0,assert:O=>["arcblock","ethereum","default","eth","passkey"].includes(O),message:"must be a string",normalize:O=>O.trim()}],validate(O,E,A={}){const j=(0,U.toTypeInfo)(O),w=(0,U.toTypeInfoStr)(O);return["ethereum","eth"].includes(A.type)&&(0,he.default)(j,U.DID_TYPE_ETHEREUM)===!1?E.error("did.wallet",{expected:A.type,actual:JSON.stringify(w)}):["arcblock","default"].includes(A.type)&&(0,he.default)(j,U.DID_TYPE_ARCBLOCK)===!1?E.error("did.wallet",{expected:A.type,actual:JSON.stringify(w)}):["passkey"].includes(A.type)&&(0,he.default)(j,U.DID_TYPE_PASSKEY)===!1?E.error("did.wallet",{expected:A.type,actual:JSON.stringify(w)}):O}},prefix:{method(O=""){return this.$_addRule({name:"prefix",args:{str:O}})},args:[{name:"str",ref:!0,assert:O=>["",U.DID_PREFIX].includes(O),message:"must be a string",normalize:O=>O.trim()}],validate(O,E,A={}){return A.str&&O.startsWith(A.str)===!1?E.error("did.prefix",{expected:A.str}):!A.str&&(0,U.toAddress)(O)!==O?E.error("did.prefix",{expected:A.str}):O}}}}}(function($){var O=ee&&ee.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty($,"__esModule",{value:!0}),$.patterns=$.schemas=$.Joi=void 0;const E=O(St),A=Se,j=Re;$.Joi=E.default.extend(j.DIDExtension).extend(A.BNExtension);const w=/^(0x)?([A-Fa-f0-9]{64})$/,g=$.Joi.object({genesisTime:$.Joi.date().iso().required().raw(),genesisTx:$.Joi.string().regex(w).required().allow(""),renaissanceTime:$.Joi.date().iso().required().raw(),renaissanceTx:$.Joi.string().regex(w).required().allow("")}),o=$.Joi.object({address:$.Joi.DID().prefix().role("ROLE_TOKEN").required(),value:$.Joi.BN().positive().required()}),b=$.Joi.object({name:$.Joi.string().min(1).max(256).required(),value:$.Joi.string().min(1).max(1024).required(),description:$.Joi.string().min(1).max(256).optional().allow(""),required:$.Joi.boolean().optional().default(!1)}),h=$.Joi.alternatives().try($.Joi.DID().prefix().role("ROLE_ACCOUNT"),$.Joi.DID().prefix().role("ROLE_APPLICATION"),$.Joi.DID().prefix().role("ROLE_BLOCKLET"),$.Joi.DID().prefix().wallet("ethereum"),$.Joi.DID().prefix().wallet("passkey")),f=$.Joi.array().items($.Joi.object({owner:h.required(),tokensList:$.Joi.array().items(o).default([]),assetsList:$.Joi.array().items($.Joi.DID().prefix().role("ROLE_ASSET")).default([])})),e=$.Joi.array().items({signer:$.Joi.DID().prefix().required(),pk:$.Joi.any().required(),signature:$.Joi.any().required(),delegator:$.Joi.DID().prefix().valid("").optional(),data:$.Joi.any().optional()}),a=$.Joi.object({type:$.Joi.string().min(1).max(32).required(),contractAddress:$.Joi.DID().prefix().wallet("ethereum").required(),chainType:$.Joi.string().min(1).max(32).required(),chainName:$.Joi.string().min(1).max(32).required(),chainId:$.Joi.number().positive().required()}),n=$.Joi.object({type:$.Joi.string().valid("svg","url","uri").required(),content:$.Joi.string().when("type",{is:"uri",then:$.Joi.string().max(20480).dataUri().required()}).when("type",{is:"url",then:$.Joi.string().max(2048).uri({scheme:["http","https"]}).required()})}),r=$.Joi.object({id:$.Joi.string().max(2048).uri({scheme:["http","https"]}).required(),scope:$.Joi.string().valid("public","private").default("public")}),t=$.Joi.object({id:$.Joi.DID().prefix().required(),pk:$.Joi.string().required(),name:$.Joi.string().min(1).max(256).required()}),l={address:$.Joi.DID().prefix().role("ROLE_ASSET").required(),moniker:$.Joi.string().min(2).max(255).required(),data:$.Joi.any().required(),readonly:$.Joi.boolean().default(!1),transferrable:$.Joi.boolean().default(!1),ttl:$.Joi.number().min(0).default(0),parent:$.Joi.DID().prefix().optional().allow(""),issuer:$.Joi.DID().prefix().optional().allow(""),endpoint:r.optional().allow(null).default(null),display:n.optional().allow(null).default(null),tags:$.Joi.array().items($.Joi.string().min(1).max(64)).max(4).optional()},s={address:$.Joi.DID().prefix().role("ROLE_FACTORY").required(),name:$.Joi.string().min(2).max(255).required(),description:$.Joi.string().min(2).max(255).required(),settlement:$.Joi.string().valid("instant","periodic").default("instant"),limit:$.Joi.number().integer().min(0).default(0),trustedIssuers:$.Joi.array().items($.Joi.DID().prefix()).max(8).optional(),data:$.Joi.any().optional().allow(null).default(null),display:n.optional().allow(null).default(null),input:$.Joi.object({value:$.Joi.BN().positive().min("0").default("0"),tokens:$.Joi.array().items(o).max(8).optional(),assets:$.Joi.array().items($.Joi.alternatives().try($.Joi.DID().prefix().role("ROLE_ASSET"),$.Joi.DID().prefix().role("ROLE_FACTORY"))).max(8).optional(),variables:$.Joi.array().items($.Joi.object({name:$.Joi.string().min(1).max(255).required(),description:$.Joi.string().max(255).optional().allow(""),required:$.Joi.boolean().required()})).optional()}),output:$.Joi.object({moniker:$.Joi.string().min(2).max(255).required(),data:$.Joi.any().required(),readonly:$.Joi.boolean().default(!1),transferrable:$.Joi.boolean().default(!1),ttl:$.Joi.number().min(0).default(0),parent:$.Joi.string().max(255).required(),issuer:$.Joi.string().max(255).required(),endpoint:r.optional(),display:n.optional(),tags:$.Joi.array().items($.Joi.string().min(1).max(64)).max(4).optional()}),hooks:$.Joi.array().items($.Joi.object({name:$.Joi.string().valid("mint","postMint","preMint").required(),type:$.Joi.string().valid("url","contract").required(),hook:$.Joi.string().min(1).max(4096).required(),compiled:$.Joi.array().items($.Joi.object()).optional()})).optional()};$.schemas={context:g,tokenInput:o,multiInput:f,multiSig:e,foreignToken:a,variableInput:b,nftDisplay:n,nftEndpoint:r,nftIssuer:t,tokenHolder:h,assetProps:l,assetSchema:$.Joi.object(l).options({stripUnknown:!0,noDefaults:!1}),factoryProps:s,factorySchema:$.Joi.object(s).options({stripUnknown:!0,noDefaults:!1})},$.patterns={txHash:w}})(Je);function Oe({onCancel:$,onSuccess:O,blocklet:E}){var l,s;const{vaults:A=[],appPid:j}=E,{t:w,locale:g}=ie(),{connectApi:o}=Pe(),{api:b}=re(),{teamDid:h}=Ne(),[f,e]=Me({loading:!1,fetching:!1,error:"",address:"",fetched:[],errored:[]});z.useEffect(()=>{if(!V.isValid(f.address))return;const i=V.toAddress(f.address),u=f.fetched.find(p=>p.address===i),d=f.errored.find(p=>p.address===i);!f.fetching&&!u&&!d&&(e({fetching:!0}),rt(ot.MAIN_CHAIN_ENDPOINT).getAccountState({address:i}).then(_=>{_.state?e({fetching:!1,fetched:[...f.fetched.filter(v=>v.address!==i),_.state]}):e({fetching:!1,errored:[...f.errored.filter(v=>v.address!==i),{address:i}]})}).catch(_=>{console.error(_),e({fetching:!1,error:ae(_)})}))},[f.address,f.fetching]),z.useEffect(()=>{if(f.address){const i=V.toAddress(f.address);if(!V.isValid(i)){e({error:w("blocklet.config.vault.error.invalid")});return}if(Je.schemas.tokenHolder.validate(i).error){e({error:w("blocklet.config.vault.error.holder")});return}if(A.find(d=>d.did===i)){e({error:w("blocklet.config.vault.error.duplicate")});return}if(dt([E.appDid,E.appPid,...E.migratedFrom.map(d=>d.appDid)].filter(Boolean)).includes(i)){e({error:w("blocklet.config.vault.error.appDid")});return}}e({error:""})},[f.address]);const a=async()=>{e({loading:!0});try{const i=await b.configVault({input:{teamDid:h,vaultDid:V.toAddress(f.address)}});o.open({locale:g,action:"approve-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:i.sessionId},messages:{title:w("blocklet.config.vault.approve.title"),scan:w(`blocklet.config.vault.approve.${A.length>0?"byLast":"byOwner"}`),confirm:w("blocklet.config.vault.approve.confirm"),success:w("blocklet.config.vault.approve.success")},onSuccess:()=>{o.open({locale:g,action:"config-vault",forceConnected:!1,saveConnect:!1,autoConnect:!1,className:"connect",checkTimeout:10*60*1e3,passkeyBehavior:"none",extraParams:{sessionId:i.sessionId},messages:{title:w("blocklet.config.vault.commit.title"),scan:w("blocklet.config.vault.commit.scan"),confirm:w("blocklet.config.vault.commit.confirm"),success:w("blocklet.config.vault.commit.success")},onSuccess:()=>{e({loading:!1}),O()},onClose:()=>{e({loading:!1}),o.close()}})},onClose:()=>{e({loading:!1}),o.close()}})}catch(i){e({loading:!1,error:ae(i)})}},n=V.toAddress(f.address),r=[];V.isValid(n)&&r.push({key:w("blocklet.config.vault.role"),value:k.jsx(Ge,{color:"primary",variant:"outlined",size:"small",label:V.toTypeInfoStr(n).role||"-"})});const t=f.fetched.find(i=>i.address===n);return t&&r.push({key:w("blocklet.config.vault.firstSeen"),value:Ae((l=t.context)==null?void 0:l.genesisTime,"-")},{key:w("blocklet.config.vault.lastSeen"),value:Ae((s=t.context)==null?void 0:s.renaissanceTime,"-")},{key:w("blocklet.config.vault.migratedFrom"),value:t.migratedFrom.length?t.migratedFrom.map(i=>k.jsx(Ce,{did:i,showQrcode:!0,compact:!0,size:14,locale:g},i)):"-"},{key:w("blocklet.config.vault.migratedTo"),value:t.migratedTo.length?t.migratedTo.map(i=>k.jsx(Ce,{did:i,showQrcode:!0,compact:!0,size:14,locale:g},i)):"-"}),k.jsx(qe,{open:!0,fullWidth:!0,showCloseButton:!1,onClose:$,title:k.jsxs(M,{sx:{display:"flex",alignItems:"center",gap:1},children:[k.jsx(xe,{}),w("blocklet.config.vault.title")]}),actions:k.jsxs(k.Fragment,{children:[k.jsx(G,{onClick:$,children:w("common.cancel")}),k.jsx(G,{onClick:a,variant:"contained",disabled:!!f.error||f.loading,children:w("common.confirm")})]}),children:k.jsxs(Ee,{direction:"column",spacing:3,children:[k.jsxs(te,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:[w("blocklet.config.vault.desc")," ",w("blocklet.config.vault.tip")]}),A.length>0&&k.jsxs(M,{children:[k.jsxs(te,{variant:"body1",color:"text.secondary",gutterBottom:!0,children:[w("blocklet.config.vault.current"),":"]}),k.jsxs(M,{sx:{display:"flex",alignItems:"center",gap:.5},children:[k.jsx(ht,{did:A[A.length-1].did,showQrcode:!0,style:{width:"auto"}}),k.jsx(pt,{vaults:A,appPid:j})]})]}),k.jsx(Ze,{fullWidth:!0,"data-cy":"input-factory-address",label:w("blocklet.config.vault.address"),error:!!f.error,helperText:f.error,value:f.address,InputProps:{endAdornment:f.fetching?k.jsx(Ye,{position:"end",children:k.jsx(le,{size:16})}):null},onChange:i=>{e({address:i.target.value,error:""})}}),k.jsx(M,{sx:{"& .info-row__name":{fontSize:"14px"},"& .info-row__value":{fontSize:"14px"}},children:r.map(i=>k.jsx(mt,{valueComponent:"div",nameWidth:120,name:i.key,children:i.value},i.key))})]})})}Oe.propTypes={onCancel:N.func.isRequired,onSuccess:N.func.isRequired,blocklet:N.object.isRequired};Oe.defaultProps={};function Dt({teamDid:$,size:O="small",...E}){const{t:A}=ie(),{api:j}=re(),[w,g]=z.useState(!1),[o,b]=z.useState(null),h=()=>{g(!1),b(null)},f=async()=>{var a;try{g(!0);const n=await j.rotateSessionKey({input:{teamDid:$}});H.success(A("blocklet.config.rotateSessionKey.success",{count:((a=n.removed)==null?void 0:a.length)||0})),setTimeout(()=>{window.location.reload()},1e3)}catch(n){H.error(ae(n))}finally{g(!1),b(null)}},e={title:A("blocklet.config.rotateSessionKey.title"),description:A("blocklet.config.rotateSessionKey.description"),confirm:A("common.confirm"),cancel:A("common.cancel"),onConfirm:f,onCancel:h};return k.jsxs("div",{...E,children:[k.jsxs(G,{onClick:()=>b(e),color:"error",variant:"outlined",size:O,children:[w?k.jsx(le,{size:16,style:{marginRight:5}}):null,A("blocklet.config.rotateSessionKey.action")]}),o&&k.jsx(ve,{title:o.title,description:o.description,confirm:o.confirm,cancel:o.cancel,onConfirm:o.onConfirm,onCancel:o.onCancel})]})}function ue({blocklet:$,onUpdate:O,hasPermission:E}){var d,p;const{api:A,inService:j}=re(),{t:w}=z.useContext(lt),[g,o]=Me({loading:!1,showTransferOwner:!1,showConfigVault:!1}),b=!!((p=(d=$==null?void 0:$.settings)==null?void 0:d.invite)!=null&&p.enabled),h=g.loading||!E,{did:f}=$.meta;if(Ie($.status))return null;const e=$.environments.find(_=>_.key===Y.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_DELETABLE),a=!e||e.value==="yes",n=$.environments.find(_=>_.key===Y.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_TENANT_MODE),r=(n==null?void 0:n.value)||Y.BLOCKLET_TENANT_MODES.SINGLE,t=(_,v)=>async c=>{if(!g.loading){o({loading:!0});try{const{checked:m}=c.target,{blocklet:y}=await A.configBlocklet({input:{did:$.meta.did,configs:[{key:Y.BLOCKLET_CONFIGURABLE_KEY[_],value:v(m)}]}});O(y)}catch(m){H.error(m.message)}finally{o({loading:!1})}}},l=t("BLOCKLET_DELETABLE",_=>_?"no":"yes"),s=t("BLOCKLET_APP_TENANT_MODE",_=>_?Y.BLOCKLET_TENANT_MODES.MULTIPLE:Y.BLOCKLET_TENANT_MODES.SINGLE),i=async _=>{if(!g.loading){o({loading:!0});try{await A.updateInviteSettings({input:{did:$.meta.did,invite:{enabled:_.target.checked}}})}catch(v){H.error(v.message)}finally{o({loading:!1})}}},u=async()=>{if(!g.loading){o({loading:!0});try{const{blocklet:_}=await A.getBlocklet({input:{did:$.meta.did}});O(_)}catch(_){H.error(_.message)}finally{o({loading:!1})}}};return k.jsxs(Lt,{p:3,sx:{border:"1px solid red",borderRadius:2},className:"advanced-config",children:[!j&&k.jsxs(k.Fragment,{children:[k.jsx(K,{title:w("blocklet.config.deletable.name"),desc:w(a?"blocklet.config.deletable.disable":"blocklet.config.deletable.enable"),children:k.jsx(M,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(me,{disabled:h,checked:!a,defaultChecked:!0,onChange:l})})}),k.jsx(M,{className:"config-form",component:Z,my:3})]}),k.jsx(je,{inService:j,disabled:h,loading:g.loading,onChange:u}),k.jsx(M,{className:"config-form",component:Z,my:3}),j&&k.jsx(st,{role:"owner",children:_=>(_||wt)&&k.jsxs(k.Fragment,{children:[k.jsx(K,{title:w("blocklet.config.vault.title"),desc:w("blocklet.config.vault.desc"),children:k.jsx(M,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsxs(G,{variant:"contained",color:"primary",size:"small","data-cy":"config-vault",onClick:()=>o({showConfigVault:!0}),children:[k.jsx(xe,{style:{fontSize:"1.3em",marginRight:4}}),w("blocklet.config.vault.title")]})})}),k.jsx(M,{className:"config-form",component:Z,my:3}),g.showConfigVault&&k.jsx(Oe,{blocklet:$,onCancel:()=>o({showConfigVault:!1}),onSuccess:()=>o({showConfigVault:!1})}),k.jsx(K,{title:w("team.transferApp.name"),desc:w("team.transferApp.description"),children:k.jsx(M,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsxs(G,{variant:"contained",edge:"end",color:"primary",size:"small","data-cy":"transfer-app",onClick:()=>o({showTransferOwner:!0}),children:[k.jsx(Fe,{style:{fontSize:"1.3em",marginRight:4}}),w("team.transferApp.name")]})})}),k.jsx(M,{className:"config-form",component:Z,my:3}),g.showTransferOwner&&k.jsx(ke,{onCancel:()=>o({showTransferOwner:!1}),onSuccess:()=>o({showTransferOwner:!1})})]})}),k.jsx(K,{title:w("blocklet.config.clearCache.name"),desc:w("blocklet.config.clearCache.purpose"),children:k.jsx(M,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(xt,{teamDid:f})})}),k.jsx(M,{className:"config-form",component:Z,my:3}),k.jsx(K,{title:w("blocklet.config.rotateSessionKey.name"),desc:w("blocklet.config.rotateSessionKey.purpose"),children:k.jsx(M,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(Dt,{style:{whiteSpace:"nowrap"},teamDid:f})})}),k.jsx(M,{className:"config-form",component:Z,my:3}),k.jsx(K,{title:w("blocklet.config.tenantMode.name"),desc:w(`blocklet.config.tenantMode.${r}`),children:k.jsx(M,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(me,{disabled:h,checked:r===Y.BLOCKLET_TENANT_MODES.MULTIPLE,onChange:s})})}),k.jsx(M,{className:"config-form",component:Z,my:3}),k.jsx(K,{title:w("team.invite.setting"),desc:w(`team.invite.${b?"enabled":"disabled"}`),children:k.jsx(M,{sx:{alignSelf:{xs:"flex-start",md:"flex-end"}},children:k.jsx(me,{disabled:h,checked:b,onChange:i})})})]})}const Et=ce(ue,"mutate_blocklets"),It=ce(ue,"",Te);function Tt($){const{inService:O}=re();return O?k.jsx(It,{...$}):k.jsx(Et,{...$})}ue.propTypes={blocklet:N.object.isRequired,onUpdate:N.func,hasPermission:N.bool};ue.defaultProps={onUpdate:()=>{},hasPermission:!1};const Lt=ye(Ee)``;function fe({blocklet:$,onUpdate:O,hasPermission:E}){return Ie($.status)?null:k.jsx(Pt,{children:k.jsx(Tt,{blocklet:$,onUpdate:O,hasPermission:E})})}const qt=ce(fe,"mutate_blocklets"),Mt=ce(fe,"",Te);function dr($){const{inService:O}=re();return O?k.jsx(Mt,{...$}):k.jsx(qt,{...$})}fe.propTypes={blocklet:N.object.isRequired,onUpdate:N.func,hasPermission:N.bool};fe.defaultProps={onUpdate:()=>{},hasPermission:!1};const Pt=ye(M)`
8
+ max-width: 1536px;
9
+
10
+ .advanced-config {
11
+ border: 0;
12
+ padding: 0;
13
+ }
14
+ `;export{dr as default};
@@ -0,0 +1 @@
1
+ import{E as a}from"./vendor-utils-lR6P1BXz.js";a.defaults.timeout=10*1e3;const o=a.create();export{o as a};
@@ -1 +1 @@
1
- import{A as p,p as g}from"./vendor-utils-CjMBJT5V.js";import{n as E}from"./vendor-ux-did-connect-Dr2W2Pc9.js";import{r as t}from"./vendor-react-DEoibe3W.js";import{z as x,C as w}from"./index-B9ltKwuq.js";import{e as y,j as s,aa as L,ab as R}from"./vendor-mui-core-BKQDHvL6.js";import"./vendor-hooks-DXGUREV9.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-TgIfa3ko.js";function P(){const{info:f,inService:d}=x(),{did:u}=w(),r=y(),m="calc(100vh - 430px)",[i,h]=t.useState(!0),c=t.useRef(null);let o="";d?o=E.WELLKNOWN_SERVICE_PATH_PREFIX:o=f.routing.adminPath;const l=new URLSearchParams;d||l.set("authKey","__sst"),l.set("schemaKey",p(window.location.origin,o,`/api/theme?id=${encodeURIComponent(u)}`));const n=t.useCallback(()=>{if(c.current){const a=window.location.origin,e=g(JSON.parse(JSON.stringify(r)),["palette","typography","shape","direction","breakpoints","mixins","shadows","transitions","zIndex"]);c.current.contentWindow.postMessage({type:"SEND_THEME",payload:e},a)}},[r]);return t.useEffect(()=>{const a=e=>{e.origin===window.location.origin&&(e.data.type==="REQUEST_THEME"&&n(),e.data.type==="THEME_BUILDER_LOADED"&&h(!1))};return window.addEventListener("message",a),()=>{window.removeEventListener("message",a)}},[n]),t.useEffect(()=>{i===!1&&n()},[r,i,n]),s.jsxs(s.Fragment,{children:[i&&s.jsx(L,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:m},children:s.jsx(R,{})}),s.jsx("iframe",{title:"Theme Builder",ref:c,src:`${p(window.location.origin,o,"/hosted/theme-builder/")}?${l.toString()}`,style:{border:0,width:"100%",height:m,display:i?"none":"block"}})]})}export{P as default};
1
+ import{A as p,J as g}from"./vendor-utils-lR6P1BXz.js";import{j as E}from"./vendor-ux-did-connect-CaDmrsW1.js";import{r as t}from"./vendor-react-DEoibe3W.js";import{z as x,C as w}from"./index-BUwaZJ5Y.js";import{e as y,j as s,aa as L,ab as R}from"./vendor-mui-core-FzKVVAue.js";import"./vendor-hooks-zv9Oe7Yx.js";import"./lottie-web-jYmAQWuC.js";import"./vendor-arcblock-Bi9JkCAO.js";function P(){const{info:f,inService:d}=x(),{did:u}=w(),r=y(),m="calc(100vh - 430px)",[i,h]=t.useState(!0),c=t.useRef(null);let o="";d?o=E.WELLKNOWN_SERVICE_PATH_PREFIX:o=f.routing.adminPath;const l=new URLSearchParams;d||l.set("authKey","__sst"),l.set("schemaKey",p(window.location.origin,o,`/api/theme?id=${encodeURIComponent(u)}`));const n=t.useCallback(()=>{if(c.current){const a=window.location.origin,e=g(JSON.parse(JSON.stringify(r)),["palette","typography","shape","direction","breakpoints","mixins","shadows","transitions","zIndex"]);c.current.contentWindow.postMessage({type:"SEND_THEME",payload:e},a)}},[r]);return t.useEffect(()=>{const a=e=>{e.origin===window.location.origin&&(e.data.type==="REQUEST_THEME"&&n(),e.data.type==="THEME_BUILDER_LOADED"&&h(!1))};return window.addEventListener("message",a),()=>{window.removeEventListener("message",a)}},[n]),t.useEffect(()=>{i===!1&&n()},[r,i,n]),s.jsxs(s.Fragment,{children:[i&&s.jsx(L,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:m},children:s.jsx(R,{})}),s.jsx("iframe",{title:"Theme Builder",ref:c,src:`${p(window.location.origin,o,"/hosted/theme-builder/")}?${l.toString()}`,style:{border:0,width:"100%",height:m,display:i?"none":"block"}})]})}export{P as default};