@wener/utils 1.1.33 → 1.1.35

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 (284) hide show
  1. package/lib/arrays/MaybeArray.js +41 -0
  2. package/lib/arrays/MaybeArray.js.map +1 -0
  3. package/lib/arrays/arrayFromAsync.js +7 -0
  4. package/lib/arrays/arrayFromAsync.js.map +1 -0
  5. package/lib/asyncs/AsyncInterval.js +14 -0
  6. package/lib/asyncs/AsyncInterval.js.map +1 -0
  7. package/lib/asyncs/MaybePromise.js +3 -0
  8. package/lib/asyncs/MaybePromise.js.map +1 -0
  9. package/lib/asyncs/createAsyncIterator.js +41 -0
  10. package/lib/asyncs/createAsyncIterator.js.map +1 -0
  11. package/lib/asyncs/createLazyPromise.js +65 -0
  12. package/lib/asyncs/createLazyPromise.js.map +1 -0
  13. package/lib/asyncs/firstOfAsyncIterator.js +11 -0
  14. package/lib/asyncs/firstOfAsyncIterator.js.map +1 -0
  15. package/lib/asyncs/generatorOfStream.js +16 -0
  16. package/lib/asyncs/generatorOfStream.js.map +1 -0
  17. package/lib/asyncs/isIterator.js +5 -0
  18. package/lib/asyncs/isIterator.js.map +1 -0
  19. package/lib/asyncs/isPromise.js +5 -0
  20. package/lib/asyncs/isPromise.js.map +1 -0
  21. package/lib/asyncs/isThenable.js +6 -0
  22. package/lib/asyncs/isThenable.js.map +1 -0
  23. package/lib/asyncs/nextOfAsyncIterator.js +33 -0
  24. package/lib/asyncs/nextOfAsyncIterator.js.map +1 -0
  25. package/lib/asyncs/promiseOfCallback.js +17 -0
  26. package/lib/asyncs/promiseOfCallback.js.map +1 -0
  27. package/lib/asyncs/sleep.js +3 -0
  28. package/lib/asyncs/sleep.js.map +1 -0
  29. package/lib/asyncs/timeout.js +29 -0
  30. package/lib/asyncs/timeout.js.map +1 -0
  31. package/lib/browsers/copy.js +53 -0
  32. package/lib/browsers/copy.js.map +1 -0
  33. package/lib/browsers/download.js +41 -0
  34. package/lib/browsers/download.js.map +1 -0
  35. package/lib/browsers/getFileFromDataTransfer.js +45 -0
  36. package/lib/browsers/getFileFromDataTransfer.js.map +1 -0
  37. package/lib/browsers/loaders.js +49 -0
  38. package/lib/browsers/loaders.js.map +1 -0
  39. package/lib/cn/index.js +3 -0
  40. package/lib/cn/index.js.map +1 -0
  41. package/lib/cn/parseChineseNumber.js +94 -0
  42. package/lib/cn/parseChineseNumber.js.map +1 -0
  43. package/lib/crypto/base.js +7 -0
  44. package/lib/crypto/base.js.map +1 -0
  45. package/lib/crypto/getNodeCrypto.js +18 -0
  46. package/lib/crypto/getNodeCrypto.js.map +1 -0
  47. package/lib/crypto/getRandomValues.js +32 -0
  48. package/lib/crypto/getRandomValues.js.map +1 -0
  49. package/lib/crypto/hashing.js +57 -0
  50. package/lib/crypto/hashing.js.map +1 -0
  51. package/lib/crypto/md5.bench.js +21 -0
  52. package/lib/crypto/md5.bench.js.map +1 -0
  53. package/lib/crypto/md5.d.js +3 -0
  54. package/lib/crypto/md5.d.js.map +1 -0
  55. package/lib/crypto/md5.js +121 -0
  56. package/lib/crypto/md5.js.map +1 -0
  57. package/lib/crypto/pem/pem.js +35 -0
  58. package/lib/crypto/pem/pem.js.map +1 -0
  59. package/lib/crypto/randomUUID.js +16 -0
  60. package/lib/crypto/randomUUID.js.map +1 -0
  61. package/lib/crypto/ulid.js +153 -0
  62. package/lib/crypto/ulid.js.map +1 -0
  63. package/lib/errors/Errors.js +181 -0
  64. package/lib/errors/Errors.js.map +1 -0
  65. package/lib/fetch/createFetchWith.js +23 -0
  66. package/lib/fetch/createFetchWith.js.map +1 -0
  67. package/lib/fetch/createFetchWithLogging.js +25 -0
  68. package/lib/fetch/createFetchWithLogging.js.map +1 -0
  69. package/lib/fetch/createFetchWithRetry.js +66 -0
  70. package/lib/fetch/createFetchWithRetry.js.map +1 -0
  71. package/lib/fetch/dumpRequest.js +45 -0
  72. package/lib/fetch/dumpRequest.js.map +1 -0
  73. package/lib/fetch/dumpResponse.js +16 -0
  74. package/lib/fetch/dumpResponse.js.map +1 -0
  75. package/lib/fetch/index.js +7 -0
  76. package/lib/fetch/index.js.map +1 -0
  77. package/lib/fetch/types.js +3 -0
  78. package/lib/fetch/types.js.map +1 -0
  79. package/lib/http/HttpStatus.js +94 -0
  80. package/lib/http/HttpStatus.js.map +1 -0
  81. package/lib/i18n/createTranslate.js +54 -0
  82. package/lib/i18n/createTranslate.js.map +1 -0
  83. package/lib/index.js +83 -0
  84. package/lib/index.js.map +1 -0
  85. package/lib/io/AbstractEncoding.js +7 -0
  86. package/lib/io/AbstractEncoding.js.map +1 -0
  87. package/lib/io/ArrayBuffer.test-d.js +7 -0
  88. package/lib/io/ArrayBuffer.test-d.js.map +1 -0
  89. package/lib/io/ArrayBuffers.js +210 -0
  90. package/lib/io/ArrayBuffers.js.map +1 -0
  91. package/lib/io/Buffer.js +25 -0
  92. package/lib/io/Buffer.js.map +1 -0
  93. package/lib/io/Bytes.js +51 -0
  94. package/lib/io/Bytes.js.map +1 -0
  95. package/lib/io/base64.js +54 -0
  96. package/lib/io/base64.js.map +1 -0
  97. package/lib/io/isBuffer.js +9 -0
  98. package/lib/io/isBuffer.js.map +1 -0
  99. package/lib/io/isTransferable.js +30 -0
  100. package/lib/io/isTransferable.js.map +1 -0
  101. package/lib/isomorphics/getGlobalThis.js +19 -0
  102. package/lib/isomorphics/getGlobalThis.js.map +1 -0
  103. package/lib/isomorphics/structuredClone.js +78 -0
  104. package/lib/isomorphics/structuredClone.js.map +1 -0
  105. package/lib/langs/AsyncCloser.js +40 -0
  106. package/lib/langs/AsyncCloser.js.map +1 -0
  107. package/lib/langs/Closer.js +34 -0
  108. package/lib/langs/Closer.js.map +1 -0
  109. package/lib/langs/MaybeFunction.js +9 -0
  110. package/lib/langs/MaybeFunction.js.map +1 -0
  111. package/lib/langs/classOf.js +5 -0
  112. package/lib/langs/classOf.js.map +1 -0
  113. package/lib/langs/deepEqual.js +87 -0
  114. package/lib/langs/deepEqual.js.map +1 -0
  115. package/lib/langs/deepFreeze.js +20 -0
  116. package/lib/langs/deepFreeze.js.map +1 -0
  117. package/lib/langs/hashCode.ignored.js +112 -0
  118. package/lib/langs/hashCode.ignored.js.map +1 -0
  119. package/lib/langs/isClass.js +5 -0
  120. package/lib/langs/isClass.js.map +1 -0
  121. package/lib/langs/isDefined.js +5 -0
  122. package/lib/langs/isDefined.js.map +1 -0
  123. package/lib/langs/isEmptyObject.js +6 -0
  124. package/lib/langs/isEmptyObject.js.map +1 -0
  125. package/lib/langs/isFunction.js +5 -0
  126. package/lib/langs/isFunction.js.map +1 -0
  127. package/lib/langs/isPlainObject.js +10 -0
  128. package/lib/langs/isPlainObject.js.map +1 -0
  129. package/lib/langs/memoize.js +22 -0
  130. package/lib/langs/memoize.js.map +1 -0
  131. package/lib/langs/parseBoolean.js +30 -0
  132. package/lib/langs/parseBoolean.js.map +1 -0
  133. package/lib/langs/shallowClone.js +15 -0
  134. package/lib/langs/shallowClone.js.map +1 -0
  135. package/lib/langs/shallowEqual.js +24 -0
  136. package/lib/langs/shallowEqual.js.map +1 -0
  137. package/lib/libs/ms.js +137 -0
  138. package/lib/libs/ms.js.map +1 -0
  139. package/lib/logging/Logger.js +5 -0
  140. package/lib/logging/Logger.js.map +1 -0
  141. package/lib/logging/createChildLogger.js +16 -0
  142. package/lib/logging/createChildLogger.js.map +1 -0
  143. package/lib/logging/createLogger.js +63 -0
  144. package/lib/logging/createLogger.js.map +1 -0
  145. package/lib/logging/createNoopLogger.js +13 -0
  146. package/lib/logging/createNoopLogger.js.map +1 -0
  147. package/lib/logging/slog.js +143 -0
  148. package/lib/logging/slog.js.map +1 -0
  149. package/lib/maths/clamp.js +21 -0
  150. package/lib/maths/clamp.js.map +1 -0
  151. package/lib/maths/random.js +17 -0
  152. package/lib/maths/random.js.map +1 -0
  153. package/lib/modules/isModule.js +7 -0
  154. package/lib/modules/isModule.js.map +1 -0
  155. package/lib/modules/parseModuleId.js +39 -0
  156. package/lib/modules/parseModuleId.js.map +1 -0
  157. package/lib/objects/get.js +16 -0
  158. package/lib/objects/get.js.map +1 -0
  159. package/lib/objects/get.test-d.js +33 -0
  160. package/lib/objects/get.test-d.js.map +1 -0
  161. package/lib/objects/merge/index.js +3 -0
  162. package/lib/objects/merge/index.js.map +1 -0
  163. package/lib/objects/merge/isMergeableObject.js +19 -0
  164. package/lib/objects/merge/isMergeableObject.js.map +1 -0
  165. package/lib/objects/merge/merge.js +90 -0
  166. package/lib/objects/merge/merge.js.map +1 -0
  167. package/lib/objects/parseObjectPath.js +39 -0
  168. package/lib/objects/parseObjectPath.js.map +1 -0
  169. package/lib/objects/set.js +38 -0
  170. package/lib/objects/set.js.map +1 -0
  171. package/lib/schema/typebox/gen/codegen/common/encoder.js +94 -0
  172. package/lib/schema/typebox/gen/codegen/common/encoder.js.map +1 -0
  173. package/lib/schema/typebox/gen/codegen/common/formatter.js +33 -0
  174. package/lib/schema/typebox/gen/codegen/common/formatter.js.map +1 -0
  175. package/lib/schema/typebox/gen/codegen/common/index.js +29 -0
  176. package/lib/schema/typebox/gen/codegen/common/index.js.map +1 -0
  177. package/lib/schema/typebox/gen/codegen/common/jsdoc.js +117 -0
  178. package/lib/schema/typebox/gen/codegen/common/jsdoc.js.map +1 -0
  179. package/lib/schema/typebox/gen/codegen/expression/compiler.js +364 -0
  180. package/lib/schema/typebox/gen/codegen/expression/compiler.js.map +1 -0
  181. package/lib/schema/typebox/gen/codegen/expression/errors.js +259 -0
  182. package/lib/schema/typebox/gen/codegen/expression/errors.js.map +1 -0
  183. package/lib/schema/typebox/gen/codegen/expression/evaluator.js +254 -0
  184. package/lib/schema/typebox/gen/codegen/expression/evaluator.js.map +1 -0
  185. package/lib/schema/typebox/gen/codegen/expression/expression.js +381 -0
  186. package/lib/schema/typebox/gen/codegen/expression/expression.js.map +1 -0
  187. package/lib/schema/typebox/gen/codegen/expression/index.js +32 -0
  188. package/lib/schema/typebox/gen/codegen/expression/index.js.map +1 -0
  189. package/lib/schema/typebox/gen/codegen/index.js +29 -0
  190. package/lib/schema/typebox/gen/codegen/index.js.map +1 -0
  191. package/lib/schema/typebox/gen/codegen/model/index.js +40 -0
  192. package/lib/schema/typebox/gen/codegen/model/index.js.map +1 -0
  193. package/lib/schema/typebox/gen/codegen/model/model-to-arktype.js +260 -0
  194. package/lib/schema/typebox/gen/codegen/model/model-to-arktype.js.map +1 -0
  195. package/lib/schema/typebox/gen/codegen/model/model-to-expression.js +383 -0
  196. package/lib/schema/typebox/gen/codegen/model/model-to-expression.js.map +1 -0
  197. package/lib/schema/typebox/gen/codegen/model/model-to-grpc.js +238 -0
  198. package/lib/schema/typebox/gen/codegen/model/model-to-grpc.js.map +1 -0
  199. package/lib/schema/typebox/gen/codegen/model/model-to-io-ts.js +274 -0
  200. package/lib/schema/typebox/gen/codegen/model/model-to-io-ts.js.map +1 -0
  201. package/lib/schema/typebox/gen/codegen/model/model-to-javascript.js +47 -0
  202. package/lib/schema/typebox/gen/codegen/model/model-to-javascript.js.map +1 -0
  203. package/lib/schema/typebox/gen/codegen/model/model-to-json-schema.js +192 -0
  204. package/lib/schema/typebox/gen/codegen/model/model-to-json-schema.js.map +1 -0
  205. package/lib/schema/typebox/gen/codegen/model/model-to-typebox.js +33 -0
  206. package/lib/schema/typebox/gen/codegen/model/model-to-typebox.js.map +1 -0
  207. package/lib/schema/typebox/gen/codegen/model/model-to-typescript.js +188 -0
  208. package/lib/schema/typebox/gen/codegen/model/model-to-typescript.js.map +1 -0
  209. package/lib/schema/typebox/gen/codegen/model/model-to-valibot.js +239 -0
  210. package/lib/schema/typebox/gen/codegen/model/model-to-valibot.js.map +1 -0
  211. package/lib/schema/typebox/gen/codegen/model/model-to-value.js +43 -0
  212. package/lib/schema/typebox/gen/codegen/model/model-to-value.js.map +1 -0
  213. package/lib/schema/typebox/gen/codegen/model/model-to-yrel.js +227 -0
  214. package/lib/schema/typebox/gen/codegen/model/model-to-yrel.js.map +1 -0
  215. package/lib/schema/typebox/gen/codegen/model/model-to-yup.js +225 -0
  216. package/lib/schema/typebox/gen/codegen/model/model-to-yup.js.map +1 -0
  217. package/lib/schema/typebox/gen/codegen/model/model-to-zod.js +248 -0
  218. package/lib/schema/typebox/gen/codegen/model/model-to-zod.js.map +1 -0
  219. package/lib/schema/typebox/gen/codegen/model/model.js +27 -0
  220. package/lib/schema/typebox/gen/codegen/model/model.js.map +1 -0
  221. package/lib/schema/typebox/gen/codegen/typescript/index.js +28 -0
  222. package/lib/schema/typebox/gen/codegen/typescript/index.js.map +1 -0
  223. package/lib/schema/typebox/gen/codegen/typescript/typescript-to-model.js +72 -0
  224. package/lib/schema/typebox/gen/codegen/typescript/typescript-to-model.js.map +1 -0
  225. package/lib/schema/typebox/gen/codegen/typescript/typescript-to-typebox.js +620 -0
  226. package/lib/schema/typebox/gen/codegen/typescript/typescript-to-typebox.js.map +1 -0
  227. package/lib/schema/typebox/gen/index.js +3 -0
  228. package/lib/schema/typebox/gen/index.js.map +1 -0
  229. package/lib/schema/typebox/index.js +3 -0
  230. package/lib/schema/typebox/index.js.map +1 -0
  231. package/lib/schema/typebox/typebox.js +23 -0
  232. package/lib/schema/typebox/typebox.js.map +1 -0
  233. package/lib/server/crypto/md5.js +6 -0
  234. package/lib/server/crypto/md5.js.map +1 -0
  235. package/lib/server/fetch/createFetchWithProxy.js +4 -0
  236. package/lib/server/fetch/createFetchWithProxy.js.map +1 -0
  237. package/lib/server/fetch/createFetchWithProxyByNodeFetch.js +38 -0
  238. package/lib/server/fetch/createFetchWithProxyByNodeFetch.js.map +1 -0
  239. package/lib/server/fetch/createFetchWithProxyByUndici.js +64 -0
  240. package/lib/server/fetch/createFetchWithProxyByUndici.js.map +1 -0
  241. package/lib/server/getPackageDir.js +16 -0
  242. package/lib/server/getPackageDir.js.map +1 -0
  243. package/lib/server/index.js +7 -0
  244. package/lib/server/index.js.map +1 -0
  245. package/lib/server/jsdom.js +3 -0
  246. package/lib/server/jsdom.js.map +1 -0
  247. package/lib/server/node-fetch.js +4 -0
  248. package/lib/server/node-fetch.js.map +1 -0
  249. package/lib/server/polyfill/polyfillBrowser.js +17 -0
  250. package/lib/server/polyfill/polyfillBrowser.js.map +1 -0
  251. package/lib/server/polyfill/polyfillCrypto.js +11 -0
  252. package/lib/server/polyfill/polyfillCrypto.js.map +1 -0
  253. package/lib/server/polyfill/polyfillFetch.js +25 -0
  254. package/lib/server/polyfill/polyfillFetch.js.map +1 -0
  255. package/lib/server/polyfill/polyfillJsDom.js +64 -0
  256. package/lib/server/polyfill/polyfillJsDom.js.map +1 -0
  257. package/lib/server/polyfill/polyfillWebSocket.js +21 -0
  258. package/lib/server/polyfill/polyfillWebSocket.js.map +1 -0
  259. package/lib/server/ws.js +3 -0
  260. package/lib/server/ws.js.map +1 -0
  261. package/lib/strings/camelCase.js +58 -0
  262. package/lib/strings/camelCase.js.map +1 -0
  263. package/lib/strings/formatBytes.js +43 -0
  264. package/lib/strings/formatBytes.js.map +1 -0
  265. package/lib/strings/renderTemplate.js +32 -0
  266. package/lib/strings/renderTemplate.js.map +1 -0
  267. package/lib/typedoc.js +4 -0
  268. package/lib/typedoc.js.map +1 -0
  269. package/lib/types.d.js +6 -0
  270. package/lib/types.d.js.map +1 -0
  271. package/lib/validations/asserts.js +14 -0
  272. package/lib/validations/asserts.js.map +1 -0
  273. package/lib/validations/isUUID.js +5 -0
  274. package/lib/validations/isUUID.js.map +1 -0
  275. package/lib/validations/parseTimestamp.js +29 -0
  276. package/lib/validations/parseTimestamp.js.map +1 -0
  277. package/package.json +1 -3
  278. package/dist/LICENSE.txt +0 -1
  279. package/dist/cjs/index.cjs +0 -21
  280. package/dist/cjs/index.cjs.map +0 -1
  281. package/dist/esm/index.js +0 -21
  282. package/dist/esm/index.js.map +0 -1
  283. package/dist/system/index.js +0 -21
  284. package/dist/system/index.js.map +0 -1
@@ -1,21 +0,0 @@
1
- System.register([],function($,ze){"use strict";return{execute:function(){$({arrayFromAsync:We,arrayOfMaybeArray:Ge,camelCase:pe,clamp:lr,classOf:k,clearAsyncInterval:ct,copy:Ft,createAsyncIterator:ut,createChildLogger:Ut,createFetchWith:Ie,createFetchWithLogging:fr,createFetchWithRetry:dr,createLazyPromise:Z,createLogger:K,createNoopLogger:he,createRandom:ur,createTranslate:Mt,createULID:Pe,deepEqual:L,deepFreeze:de,download:Vt,dumpRequest:Ne,dumpResponse:De,firstOfAsyncIterator:lt,firstOfMaybeArray:se,formatBytes:Bt,get:W,getFileFromDataTransfer:Ht,getHttpStatusText:Le,hex:tr,hmac:Qt,isBuffer:q,isClass:pt,isDefined:mt,isEmptyObject:gt,isIterator:ce,isModule:xt,isPlainObject:ye,isPromise:N,isRetryableHttpStatus:wr,isTransferable:Pt,isULID:rr,isUUID:Ot,lastOfMaybeArray:_e,loadScripts:ve,loadStyles:zt,maybeFunction:wt,md5:er,memoize:At,merge:R,ms:yr,nextOfAsyncIterator:D,objectOfMaybeArray:He,parseBoolean:bt,parseModuleId:St,parseObjectPath:G,parseTimestamp:Et,parseULID:sr,pascalCase:Tt,renderTemplate:me,set:Je,setAsyncInterval:it,sha1:Jt,sha256:Zt,sha384:Kt,sha512:Yt,shallowClone:ht,shallowEqual:dt,timeout:ft});function He(e,t=null,r=se){return Object.fromEntries(t===null?Object.entries(e).map(([n,o])=>[n,r(o)]):t.map(n=>[n,r(n)]))}function se(e){return Array.isArray(e)?e[0]:e}function _e(e){return Array.isArray(e)?e[e.length-1]:e}function Ge(e){return Array.isArray(e)?e:e==null?[]:[e]}async function We(e){const t=[];for await(const r of e)t.push(r);return t}function G(e){if(typeof e!="string")return Array.isArray(e)?e:[e];const t=e.split(".");if(!e.includes("["))return t;const r=[];for(const n of t)if(!n.endsWith("]"))r.push(n);else{const o=n.split("[");for(let s of o)s.endsWith("]")&&(s=s.slice(0,-1)),r.push(s)}return r}function W(e,t,r){const n=G(t);let o=e;for(const s of n)o=o?o[s]:void 0;return o===void 0?r:o}function Je(e,t,r,n=!0){const o=G(t);let s=0;const i=o.length;let y=e,h,p;for(;s<i&&(p=o[s++],!(p==="__proto__"||p==="constructor"||p==="prototype"));)y=y[p]=s===i?n?J(y[p],r):r:typeof(h=y[p])==typeof o?h:o[s]*0!==0||~(""+o[s]).indexOf(".")?{}:[]}function J(e,t){let r;if(typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t))for(r=0;r<t.length;r++)e[r]=J(e[r],t[r]);else for(r in t){if(r==="__proto__"||r==="constructor"||r==="prototype")break;e[r]=J(e[r],t[r])}return e}return t}function Ze(e){return Ke(e)&&!Ye(e)}function Ke(e){return!!e&&typeof e=="object"}function Ye(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||et(e)}var Qe=typeof Symbol=="function"&&Symbol.for,Xe=Qe?Symbol.for("react.element"):60103;function et(e){return e.$$typeof===Xe}function tt(e){return Array.isArray(e)?[]:{}}function I(e,t){return t.clone!==!1&&t.isMergeableObject(e)?R(tt(e),e,t):e}function rt(e,t,r){return e.concat(t).map(function(n){return I(n,r)})}function nt(e,t){if(!t.customMerge)return R;var r=t.customMerge(e);return typeof r=="function"?r:R}function ot(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function ae(e){return Object.keys(e).concat(ot(e))}function ie(e,t){try{return t in e}catch{return!1}}function st(e,t){return ie(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function at(e,t,r){const n={};return r.isMergeableObject(e)&&ae(e).forEach(o=>{n[o]=I(e[o],r)}),ae(t).forEach(o=>{st(e,o)||(ie(e,o)&&r.isMergeableObject(t[o])?n[o]=nt(o,r)(e[o],t[o],r):n[o]=I(t[o],r))}),n}function R(e,t,r){const n={arrayMerge:rt,isMergeableObject:Ze,...r,cloneUnlessOtherwiseSpecified:I};let o=Array.isArray(t),s=Array.isArray(e);return o===s?o?n.arrayMerge(e,t,n):at(e,t,n):I(t,n)}R.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(r,n){return R(r,n,t)},{})};function N(e){return e&&(e instanceof Promise||e.then&&e.catch)}function Z(e){const t={resolve(n){throw new Error("pending resolve")},reject(n){throw new Error("pending reject")}},r=Object.assign(new Promise((n,o)=>{t.reject=o,t.resolve=n}),{resolve(n){t.resolve(n)},reject(n){t.resolve(n)}});if(e){const n=t.resolve;let o=!0;t.resolve=y=>{o=!1,n(y)};const s=r.then.bind(r);r.then=(...y)=>{if(o){o=!1;try{const h=e(t.resolve,t.reject);N(h)?h.then(t.resolve,t.reject):h!==void 0&&t.resolve(h)}catch(h){t.reject(h)}}return s(...y)};const i=t;return i.then=r.then,i.catch=r.catch.bind(r),r.finally&&(i.finally=r.finally),Object.defineProperty(i,Symbol.species,{get(){return Promise}}),i}return r}function it(e,t,r=t){let n;const o=async()=>{await e(),n=setTimeout(o,t)};return n=setTimeout(o,r),()=>n}function ct(e){clearTimeout(e==null?void 0:e())}function ut(e){const t=[];let r;{let n;t.push(n=Z()),r=(o,s)=>{if(s!==void 0)n.resolve([void 0,!0,s]);else if(o!==void 0)n.resolve(o);else return;t.push(n=Z())}}return e(r),async function*(){let n,o;for(let s=0,i=!1;!i;s++){let y=await t[s];if(delete t[s],[n,i,o]=y,o)throw o;n!==void 0&&(yield n)}}()}function ce(e){return typeof(e==null?void 0:e.next)=="function"}function D(e){if(N(e))return e.then(t=>D(t));if(ce(e)){let t=e.next();return N(t)?t.then(r=>[r.value,r.done]):[t.value,t.done]}if(e&&typeof e=="object"){if(Symbol.iterator in e)return D(e[Symbol.iterator]());if(Symbol.asyncIterator in e)return D(e[Symbol.asyncIterator]())}return[e]}function lt(e){const t=D(e);return N(t)?t.then(r=>r[0]):t[0]}const vr=$("sleep",e=>new Promise(t=>setTimeout(t,e)));function ft(e,t){const r=new ue;let n,o;return typeof e=="function"&&(o=new AbortController,e=e({signal:o.signal})),Promise.race([e,new Promise((s,i)=>{n=setTimeout(()=>{o==null||o.abort(r),i(r)},t)})]).finally(()=>{clearTimeout(n)})}class ue extends Error{constructor(){super("TimeoutError")}}$("TimeoutError",ue);function dt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!Object.is(e[r[n]],t[r[n]]))return!1;return!0}const le=Object.prototype.hasOwnProperty,yt=typeof Element<"u";function fe(e,t,r){for(r of e.keys())if(L(r,t))return r}function L(e,t){let r,n,o;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&L(e[n],t[n]););return n===-1}if(r===Set){if(e.size!==t.size)return!1;for(n of e)if(o=n,o&&typeof o=="object"&&(o=fe(t,o),!o)||!t.has(o))return!1;return!0}if(r===Map){if(e.size!==t.size)return!1;for(n of e)if(o=n[0],o&&typeof o=="object"&&(o=fe(t,o),!o)||!L(n[1],t.get(o)))return!1;return!0}if(r===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(r===DataView){if((n=e.byteLength)===t.byteLength)for(;n--&&e.getInt8(n)===t.getInt8(n););return n===-1}if(ArrayBuffer.isView(e)){if((n=e.byteLength)===t.byteLength)for(;n--&&e[n]===t[n];);return n===-1}if(yt&&e instanceof Element)return!1;if(!r||typeof e=="object"){n=0;for(r in e)if(!((r==="_owner"||r==="__v"||r==="__o")&&e.$$typeof)&&(le.call(e,r)&&++n&&!le.call(t,r)||!(r in t)||!L(e[r],t[r])))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function de(e){if(e===null||typeof e!="object")return e;const t=Object.getOwnPropertyNames(e);for(const r of t){const n=e[r];n&&typeof n=="object"&&de(n)}return Object.freeze(e)}function k(e){return Object.prototype.toString.call(e).slice(8,-1)}function ht(e){return e&&(Array.isArray(e)?e.slice():typeof e=="object"?Object.assign({},e):e)}function pt(e){return typeof e=="function"&&/^class\s/.test(Function.prototype.toString.call(e))}function mt(e){return e!=null}function ye(e){return k(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function gt(e){return ye(e)&&Object.keys(e).length===0}function bt(e,t=!1){if(typeof e=="boolean")return e;if(typeof e=="string")switch(e.toLowerCase()){case"f":case"false":case"0":return!1;case"1":case"t":case"true":return!0}else if(typeof e=="number")switch(e){case 0:return!1;case 1:return!0}if(!t)return!!e}function wt(e,...t){return e instanceof Function?e(...t):e}function At(e,{resolver:t=(...r)=>JSON.stringify(r)}={}){if(typeof e!="function")throw new Error("`callback` should be a function");if(t!==void 0&&typeof t!="function")throw new Error("`resolver` should be a function");const r={},n=function(){const o=Array.prototype.slice.call(arguments),s=t.apply(this,o);return s in r||(r[s]=e.apply(this,o)),r[s]};return n.cache=r,n}class vt{closers=[];defer(t){t&&this.closers.push(t)}add(t){return t&&(this.closers.push(t),t)}async[Symbol.asyncDispose](){for(let t of this.closers){let r;typeof t=="function"?r=t():Symbol.asyncDispose in t?r=t[Symbol.asyncDispose]():Symbol.dispose in t?t[Symbol.dispose]():r=t.close(),r&&typeof r.then=="function"&&await r}}close(){return this[Symbol.asyncDispose]()}}$("AsyncCloser",vt);class $t{closers=[];defer(t){t&&this.closers.push(t)}add(t){return t&&(this.closers.push(t),t)}[Symbol.dispose](){for(let t of this.closers)typeof t=="function"?t():Symbol.dispose in t?t[Symbol.dispose]():t.close()}close(){this[Symbol.dispose]()}}$("Closer",$t);function Ot(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(String(e))}function Et(e){if(e){if(e instanceof Date)return e;if(typeof e=="string"&&/^[0-9.]+$/.test(e)){let t=parseFloat(e);return Math.floor(t).toString().length<=11&&(t*=1e3),new Date(t)}else if(typeof e=="string"){const t=new Date(e);if(!isNaN(+t))return t}throw new Error(`parseTimestamp: invalid "${e}"`)}}const jt=/^(?<n>(?:@(?<org>[a-z0-9-~][a-z0-9-._~]*)\/)?(?<pkg>[a-z0-9-~][a-z0-9-._~]*))(?:@(?<v>[-a-z0-9><=_.^~]+))?(?<p>\/[^\r\n]*)?$/;function St(e){var t;const r=(t=e.match(jt))==null?void 0:t.groups;if(!r)return;const{n,v:o,p:s,org:i,pkg:y}=r,h=!!i,p=/^\d+\.\d+\.\d+/.test(o)?o:void 0,g=o||"latest",f={id:`${n}@${g}`,name:n,range:g,scoped:h,pkg:y,org:i,versioned:!!o};return p&&(f.version=p),s&&(f.path=s),f.scoped||delete f.org,f}function xt(e){return e&&e[Symbol.toStringTag]==="Module"}function K(e=({level:r,values:n,...o})=>{var s;({values:n,...o}=Ct(o,n)),(s=console[r])==null||s.call(console,...n,o)},t={}){return{trace:(...r)=>{e({...t,level:"trace",values:r})},debug:(...r)=>{e({...t,level:"debug",values:r})},info:(...r)=>{e({...t,level:"info",values:r})},warn:(...r)=>{e({...t,level:"warn",values:r})},error:(...r)=>{e({...t,level:"error",values:r})},child:r=>K(e,{...t,...r})}}function Ct(e,t){return t[0]&&typeof t[0]=="object"?{...e,...t[0],values:t.slice(1)}:{...e,values:t}}function he(){const e=(...t)=>{};return{trace:e,debug:e,info:e,warn:e,error:e,child:()=>he()}}function Ut(e,t){return e.child?e.child(t):K(r=>{const{level:n,values:o,...s}=r;Object.keys(s).length?e[n](s,...o):e[n](...o)},t)}function Rt(e){let t=!1,r=!1,n=!1;for(let o=0;o<e.length;o++){const s=e[o];t&&/[a-zA-Z]/.test(s)&&s.toUpperCase()===s?(e=e.slice(0,o)+"-"+e.slice(o),t=!1,n=r,r=!0,o++):r&&n&&/[a-zA-Z]/.test(s)&&s.toLowerCase()===s?(e=e.slice(0,o-1)+"-"+e.slice(o-1),n=r,r=!1,t=!0):(t=s.toLowerCase()===s&&s.toUpperCase()!==s,n=r,r=s.toUpperCase()===s&&s.toLowerCase()!==s)}return e}function Tt(e){return pe(e,{pascalCase:!0})}function pe(e,t={pascalCase:!1}){if(!(typeof e=="string"||Array.isArray(e)))throw new TypeError("Expected the input to be `string | string[]`");const r=n=>t.pascalCase?n.charAt(0).toUpperCase()+n.slice(1):n;return Array.isArray(e)?e=e.map(n=>n.trim()).filter(n=>n.length).join("-"):e=e.trim(),e.length===0?"":e.length===1?t.pascalCase?e.toUpperCase():e.toLowerCase():(e!==e.toLowerCase()&&(e=Rt(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(n,o)=>o.toUpperCase()).replace(/\d+(\w|$)/g,n=>n.toUpperCase()),r(e))}function me(e,t,r="js"){let n;return t?typeof t=="function"?n=t:n=o=>W(t,o):n=()=>"",typeof r=="string"&&(r=ge[r]||ge.js),e.replace(r,(o,s)=>n(s.trim()))}const ge={js:/\${(.*?)}/g,common:/{{(.*?)}}/g};function Bt(e,t=!1,r=1){const n=t?1e3:1024;if(Math.abs(e)<n)return`${e} B`;const o=t?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];let s=-1;const i=10**r;do e/=n,++s;while(Math.round(Math.abs(e)*i)/i>=n&&s<o.length-1);return e.toFixed(r)+" "+o[s]}function Mt(e){let t="";const r=e||{},n=o=>{if(Array.isArray(o))return o;const s=o.split(/[_-]/);return s.length>1?[o,s[0]]:[o]};return{locale(o){return t=o||t},dict:(o,s)=>{if(s){r[o]=Object.assign(r[o]||{},s);return}return r[o]},t(o,s,i){let y;for(const h of n(i||t))if(y=W(r[h],o,""),y)break;return typeof y=="function"?y(s):typeof y=="string"?me(y,s,"common"):y}}}function q(e){var t,r;return(r=(t=e==null?void 0:e.constructor)==null?void 0:t.isBuffer)==null?void 0:r.call(t,e)}const T=$("getGlobalThis",()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global `this`")}),be=T();function Pt(e){return we||=It(),we.some(t=>e instanceof t)}let we;function It(){const e=be.window||be||global;return[e.ArrayBuffer,e.MessagePort,e.ReadableStream,e.WritableStream,e.TransformStream,e.AudioData,e.ImageBitmap,e.VideoFrame,e.OffscreenCanvas,e.RTCDataChannel].filter(Boolean)}const B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",F=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<B.length;e++)F[B.charCodeAt(e)]=e;function Nt(e){const t=new Uint8Array(e),r=t.length;let n="";for(let o=0;o<r;o+=3)n+=B[t[o]>>2],n+=B[(t[o]&3)<<4|t[o+1]>>4],n+=B[(t[o+1]&15)<<2|t[o+2]>>6],n+=B[t[o+2]&63];return r%3===2?n=n.substring(0,n.length-1)+"=":r%3===1&&(n=n.substring(0,n.length-2)+"=="),n}function Dt(e){const t=e.length;let r=e.length*.75,n,o=0,s,i,y,h;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const p=new ArrayBuffer(r),g=new Uint8Array(p);for(n=0;n<t;n+=4)s=F[e.charCodeAt(n)],i=F[e.charCodeAt(n+1)],y=F[e.charCodeAt(n+2)],h=F[e.charCodeAt(n+3)],g[o++]=s<<2|i>>4,g[o++]=(i&15)<<4|y>>2,g[o++]=(y&3)<<6|h&63;return p}class w{static#e=!0;static#t;static isNativeBufferAvailable(){var t,r;return this.#t??=!((r=(t=T().Buffer)==null?void 0:t.isPollyfill)!=null&&r.call(t))}static isNativeBufferAllowed(){return this.#e&&this.#t}static setNativeBufferAllowed(t){this.#e=t}static isArrayBuffer=t=>t instanceof ArrayBuffer;static slice=(t,r,n)=>q(t)?Uint8Array.prototype.slice.call(t,r,n):t.slice(r,n);static asView=(t,r,n,o)=>r instanceof t&&(n??0)===0&&o===void 0?r:ArrayBuffer.isView(r)||q(r)?w.isNativeBufferAllowed()&&t===Buffer?Buffer.from(r.buffer,n,o):new t(r.buffer,r.byteOffset+(n??0),o??r.byteLength):new t(r,n,o);static toString=(t,r="utf8")=>{if(typeof t=="string")switch(r){case"base64":return btoa(t);case"utf-8":case"utf8":return t;default:throw new Error(`[ArrayBuffers.toString] Unsupported encoding for string: ${r}`)}if(w.isNativeBufferAllowed())return Buffer.from(w.asView(Uint8Array,t)).toString(r);switch(r){case"hex":return[...w.asView(Uint8Array,t)].map(n=>Lt[n]).join("");case"base64":return Nt(w.asView(Uint8Array,t));case"utf8":case"utf-8":return new TextDecoder().decode(t);case"ascii":{const n=w.asView(Uint8Array,t);return String.fromCharCode(...n.map(o=>o&127))}case"latin1":case"binary":{const n=w.asView(Uint8Array,t);return String.fromCharCode(...n)}case"ucs2":case"ucs-2":case"utf16le":{const n=w.asView(Uint8Array,t);let o="";for(let s=0;s<n.length-1;s+=2)o+=String.fromCharCode(n[s]+n[s+1]*256);return o}default:throw new Error(`[ArrayBuffers.toString] Unknown encoding: ${r}`)}};static toJSON=(t,r)=>JSON.parse(w.toString(t),r);static alloc=(t,r,n)=>r!==void 0?typeof r=="number"?new Uint8Array(t).fill(r):w.asView(Uint8Array,w.from(r,n)).slice(0,t):new ArrayBuffer(t);static from=(t,r="utf8")=>{if(!t)return new ArrayBuffer(0);if(typeof t=="string"){if(w.isNativeBufferAllowed())return Buffer.from(t,r);switch(r){case"utf-8":case"utf8":return new TextEncoder().encode(t).buffer;case"base64":return Dt(t.replace(/[^0-9a-zA-Z=+/_]/g,""));default:throw new Error(`[ArrayBuffers.from] Unknown encoding: ${r}`)}}if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t)||q(t)){if(t.byteOffset!==0)throw new Error("ArrayBuffers.from do not support view with offset");return t.buffer}if(Array.isArray(t))return new Uint8Array(t);const n=k(t);throw new TypeError(`ArrayBuffers.from unsupported type ${n}`)};static isEncoding=t=>{switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":return!0;default:return!1}};static concat=(t,r,n=0)=>{const o=t.reduce((i,y)=>i+y.byteLength,0),s=r?new Uint8Array(r):new Uint8Array(o);for(const i of t){if(!(i!=null&&i.byteLength))continue;let y;if(i instanceof ArrayBuffer)y=new Uint8Array(i);else if(ArrayBuffer.isView(i))y=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);else throw new Error(`ArrayBuffers.concat unsupported type ${k(i)}`);s.set(y,n),n+=i.byteLength}return s.buffer}}$("ArrayBuffers",w);const Lt=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=r*16;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();let kt=class oe extends Uint8Array{static get isPolyfill(){return!0}static isBuffer(t){return t instanceof oe||q(t)}static from(t,r){return new oe(w.from(t,r))}static isEncoding=w.isEncoding;toString(t){return w.toString(this,t)}};$("Buffer",kt);let Y;function qt(){let e;function t(){return navigator.userAgent.match(/ipad|iphone/i)}function r(s){e=document.createElement("textArea"),e.value=s,document.body.appendChild(e)}function n(){let s,i;if(t()){if(s=document.createRange(),s.selectNodeContents(e),i=window.getSelection(),i===null){console.error("no selection");return}i.removeAllRanges(),i.addRange(s),e.setSelectionRange(0,999999)}else e.select()}function o(){document.execCommand("copy"),document.body.removeChild(e)}Y=s=>{r(s),n(),o()}}function Ft(e){var t,r;return(r=(t=window.navigator)==null?void 0:t.clipboard)!=null&&r.writeText?window.navigator.clipboard.writeText(e):(Y||qt(),Y(e))}function Vt(e,t,{type:r="application/octet-stream",raw:n=!1}={}){const o=document.createElement("a");let s=()=>null;try{if(o.download=e,typeof t=="string"&&/^(https?:|data:)/.test(t)&&!n?o.href=t:typeof t=="string"&&(t=new TextEncoder().encode(t)),t instanceof Uint8Array&&(t=new Blob([t],{type:r})),t instanceof File||t instanceof Blob||t instanceof MediaSource)o.href=URL.createObjectURL(t),s=()=>{URL.revokeObjectURL(o.href)};else throw console.error("invalid download data",t),new Error(`can not download ${Object.getPrototypeOf(t)}`);o.click()}finally{s()}}function Ae(e,t,r,n){e.onload=()=>{t(e)},e.onerror=s=>{e.remove(),r(s)};const{attributes:o={}}=n||{};Object.entries(o).forEach(([s,i])=>{e.setAttribute(s,i)}),document.head.appendChild(e)}function ve(e,t){if(Array.isArray(e))return Promise.resolve().then(async()=>{const n=[];for(const o of e)n.push(await ve(o));return n});const r=document.querySelector(`script[src="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const s=document.createElement("script");s.src=e,Ae(s,n,o,t)})}function zt(e,t){const r=document.querySelector(`link[href="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const s=document.createElement("link");s.rel="stylesheet",s.href=e,Ae(s,n,o,t)})}function Ht(e){var t;if(!e)return{};const r=e.items??[];if(r.length>=2&&r[0].kind==="string"&&r[1].kind==="file"){const n=e.getData("text"),o=r[1].getAsFile()??((t=e.files)==null?void 0:t.item(0));return o?{file:o,name:n}:(console.error(`no file ${n}`,r[1]),{})}else if(r[0].kind==="file"){const n=r[0].getAsFile();return n?{file:n,name:n.name}:(console.error("no file",r[0]),{})}else console.debug("file item not match",Array.from(r).map(n=>({type:n.type,kind:n.kind})));return{}}const $r=$("structuredClone",globalThis.structuredClone||M);function $e(e,t,r){typeof r.value=="object"&&(r.value=M(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value}function M(e){if(typeof e!="object")return e;let t=0,r,n,o;const s=k(e);switch(s){case"Array":o=Array(e.length);break;case"Object":o=Object.create(e.__proto__||null);break;case"Set":o=new Set,e.forEach(function(i){o.add(M(i))});break;case"Map":o=new Map,e.forEach(function(i,y){o.set(M(y),M(i))});break;case"Date":o=new Date(+e);break;case"RegExp":o=new RegExp(e.source,e.flags);break;case"DataView":o=new e.constructor(M(e.buffer));break;case"ArrayBuffer":o=e.slice(0);break;default:s.endsWith("Array")&&(o=new e.constructor(e))}if(o){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)$e(o,n[t],Object.getOwnPropertyDescriptor(e,n[t]));for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++)Object.hasOwnProperty.call(o,r=n[t])&&o[r]===e[r]||$e(o,r,Object.getOwnPropertyDescriptor(e,r))}return o||e}var Oe,Ee;const je=T(),Or=$("randomUUID",((Ee=(Oe=je.crypto)==null?void 0:Oe.randomUUID)==null?void 0:Ee.bind(je.crypto))||_t);function _t(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}let Q;if(typeof window>"u")try{typeof require>"u"?ze.import("crypto").then(e=>Q=e.default):Q=require("crypto")}catch{}function Gt(){return Q}var Se,xe,Ce,Ue;const z=T();let Re=$("getRandomValues",((xe=(Se=z.crypto)==null?void 0:Se.getRandomValues)==null?void 0:xe.bind(z.crypto))||((Ue=(Ce=z.msCrypto)==null?void 0:Ce.getRandomValues)==null?void 0:Ue.bind(z.msCrypto))||Wt);function Wt(e){var t;const r=Gt();let n=r==null?void 0:r.webcrypto;if(n!=null&&n.getRandomValues)return $("getRandomValues",Re=(t=n.getRandomValues)==null?void 0:t.bind(r==null?void 0:r.webcrypto)),n.getRandomValues(e);if(r!=null&&r.randomBytes){if(!(e instanceof Uint8Array))throw new TypeError("expected Uint8Array");if(e.length>65536){const s=new Error;throw s.code=22,s.message=`Failed to execute 'getRandomValues' on 'Crypto': The ArrayBufferView's byte length (${e.length}) exceeds the number of bytes of entropy available via this API (65536).`,s.name="QuotaExceededError",s}const o=r.randomBytes(e.length);return e.set(o),e}throw new Error("[getRandomValues]: No secure random number generator available.")}function Jt(e,t){return H("SHA-1",e,t)}function Zt(e,t){return H("SHA-256",e,t)}function Kt(e,t){return H("SHA-384",e,t)}function Yt(e,t){return H("SHA-512",e,t)}function H(e,t,r){let n=crypto.subtle.digest(e,X(t));return r?n.then(o=>Te(o,r)):n}function X(e){return typeof e=="string"?new TextEncoder().encode(e):e}function Te(e,t){if(t)switch(t){case"hex":case"base64":return w.toString(e,t)}return e}async function Qt(e,t,r,n){let o=t instanceof CryptoKey?t:await crypto.subtle.importKey("raw",X(t),{name:"HMAC",hash:{name:Xt(e)}},!1,["sign"]),s=await crypto.subtle.sign({name:"HMAC",hash:{name:e}},o,X(r));return Te(s,n)}function Xt(e){return e.replace(/^sha/i,"SHA-")}function er(e){var t="0123456789abcdef";function r(b){var m,A="";for(m=0;m<=3;m++)A+=t.charAt(b>>m*8+4&15)+t.charAt(b>>m*8&15);return A}function n(b,m){var A=(b&65535)+(m&65535),v=(b>>16)+(m>>16)+(A>>16);return v<<16|A&65535}function o(b,m){return b<<m|b>>>32-m}function s(b,m,A,v,O,E){return n(o(n(n(m,b),n(v,E)),O),A)}function i(b,m,A,v,O,E,U){return s(m&A|~m&v,b,m,O,E,U)}function y(b,m,A,v,O,E,U){return s(m&v|A&~v,b,m,O,E,U)}function h(b,m,A,v,O,E,U){return s(m^A^v,b,m,O,E,U)}function p(b,m,A,v,O,E,U){return s(A^(m|~v),b,m,O,E,U)}function g(b){var m,A=(b.length+8>>6)+1,v=new Array(A*16);for(m=0;m<A*16;m++)v[m]=0;for(m=0;m<b.length;m++)v[m>>2]|=b.charCodeAt(m)<<m%4*8;return v[m>>2]|=128<<m%4*8,v[A*16-2]=b.length*8,v}var f,d=g(""+e),a=1732584193,c=-271733879,u=-1732584194,l=271733878,ke,qe,Fe,Ve;for(f=0;f<d.length;f+=16)ke=a,qe=c,Fe=u,Ve=l,a=i(a,c,u,l,d[f+0],7,-680876936),l=i(l,a,c,u,d[f+1],12,-389564586),u=i(u,l,a,c,d[f+2],17,606105819),c=i(c,u,l,a,d[f+3],22,-1044525330),a=i(a,c,u,l,d[f+4],7,-176418897),l=i(l,a,c,u,d[f+5],12,1200080426),u=i(u,l,a,c,d[f+6],17,-1473231341),c=i(c,u,l,a,d[f+7],22,-45705983),a=i(a,c,u,l,d[f+8],7,1770035416),l=i(l,a,c,u,d[f+9],12,-1958414417),u=i(u,l,a,c,d[f+10],17,-42063),c=i(c,u,l,a,d[f+11],22,-1990404162),a=i(a,c,u,l,d[f+12],7,1804603682),l=i(l,a,c,u,d[f+13],12,-40341101),u=i(u,l,a,c,d[f+14],17,-1502002290),c=i(c,u,l,a,d[f+15],22,1236535329),a=y(a,c,u,l,d[f+1],5,-165796510),l=y(l,a,c,u,d[f+6],9,-1069501632),u=y(u,l,a,c,d[f+11],14,643717713),c=y(c,u,l,a,d[f+0],20,-373897302),a=y(a,c,u,l,d[f+5],5,-701558691),l=y(l,a,c,u,d[f+10],9,38016083),u=y(u,l,a,c,d[f+15],14,-660478335),c=y(c,u,l,a,d[f+4],20,-405537848),a=y(a,c,u,l,d[f+9],5,568446438),l=y(l,a,c,u,d[f+14],9,-1019803690),u=y(u,l,a,c,d[f+3],14,-187363961),c=y(c,u,l,a,d[f+8],20,1163531501),a=y(a,c,u,l,d[f+13],5,-1444681467),l=y(l,a,c,u,d[f+2],9,-51403784),u=y(u,l,a,c,d[f+7],14,1735328473),c=y(c,u,l,a,d[f+12],20,-1926607734),a=h(a,c,u,l,d[f+5],4,-378558),l=h(l,a,c,u,d[f+8],11,-2022574463),u=h(u,l,a,c,d[f+11],16,1839030562),c=h(c,u,l,a,d[f+14],23,-35309556),a=h(a,c,u,l,d[f+1],4,-1530992060),l=h(l,a,c,u,d[f+4],11,1272893353),u=h(u,l,a,c,d[f+7],16,-155497632),c=h(c,u,l,a,d[f+10],23,-1094730640),a=h(a,c,u,l,d[f+13],4,681279174),l=h(l,a,c,u,d[f+0],11,-358537222),u=h(u,l,a,c,d[f+3],16,-722521979),c=h(c,u,l,a,d[f+6],23,76029189),a=h(a,c,u,l,d[f+9],4,-640364487),l=h(l,a,c,u,d[f+12],11,-421815835),u=h(u,l,a,c,d[f+15],16,530742520),c=h(c,u,l,a,d[f+2],23,-995338651),a=p(a,c,u,l,d[f+0],6,-198630844),l=p(l,a,c,u,d[f+7],10,1126891415),u=p(u,l,a,c,d[f+14],15,-1416354905),c=p(c,u,l,a,d[f+5],21,-57434055),a=p(a,c,u,l,d[f+12],6,1700485571),l=p(l,a,c,u,d[f+3],10,-1894986606),u=p(u,l,a,c,d[f+10],15,-1051523),c=p(c,u,l,a,d[f+1],21,-2054922799),a=p(a,c,u,l,d[f+8],6,1873313359),l=p(l,a,c,u,d[f+15],10,-30611744),u=p(u,l,a,c,d[f+6],15,-1560198380),c=p(c,u,l,a,d[f+13],21,1309151649),a=p(a,c,u,l,d[f+4],6,-145523070),l=p(l,a,c,u,d[f+11],10,-1120210379),u=p(u,l,a,c,d[f+2],15,718787259),c=p(c,u,l,a,d[f+9],21,-343485551),a=n(a,ke),c=n(c,qe),u=n(u,Fe),l=n(l,Ve);return r(a)+r(c)+r(u)+r(l)}function tr(e){return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}function j(e){const t=new Error(e);return t.source="ulid",t}const S="0123456789ABCDEFGHJKMNPQRSTVWXYZ",x=S.length,ee=Math.pow(2,48)-1,P=10,te=16;function rr(e){return e?e.length===26&&/^[0-9A-HJKMNP-TV-Z]{26}$/i.test(e):!1}function Be(e,t,r){return t>e.length-1?e:e.substr(0,t)+r+e.substr(t+1)}function nr(e){let t,r=e.length,n,o;const s=x-1;for(;!t&&r-->=0;){if(n=e[r],o=S.indexOf(n),o===-1)throw j("incorrectly encoded string");if(o===s){e=Be(e,r,S[0]);continue}t=Be(e,r,S[o+1])}if(typeof t=="string")return t;throw j("cannot increment this string")}function or(e){let t=Math.floor(e()*x);return t===x&&(t=x-1),S.charAt(t)}function re(e,t){if(isNaN(e))throw new Error(`${e} must be a number`);if(e>ee)throw j(`cannot encode time greater than ${ee}`);if(e<0)throw j("time must be positive");if(!Number.isInteger(e))throw j("time must be an integer");let r,n="";for(;t>0;t--)r=e%x,n=S.charAt(r)+n,e=(e-r)/x;return n}function Me(e,t){let r="";for(;e>0;e--)r=or(t)+r;return r}function sr(e){if(e.length!==P+te)throw j("malformed ulid");const t=e.substr(0,P).split("").reverse().reduce((r,n,o)=>{const s=S.indexOf(n);if(s===-1)throw j("invalid character found: "+n);return r+=s*Math.pow(x,o)},0);if(t>ee)throw j("malformed ulid, timestamp too large");return{timestamp:t,random:e.substring(P)}}function ar(){return()=>{const e=new Uint8Array(1);return Re(e),e[0]/255}}function Pe({monotonic:e=!0,random:t=ar(),now:r=Date.now}={}){if(!e)return function(s){return s||=r(),re(s,P)+Me(te,t)};let n=0,o;return function(s){if(s||=r(),s<=n&&o){const y=o=nr(o);return re(n,P)+y}n=s;const i=o=Me(te,t);return re(s,P)+i}}let ir=$("ulid",(...e)=>V?V(...e):(V=Pe(),$("ulid",ir=V),V(...e))),V;class cr{static decode(t){const r=t.match(/^-----BEGIN (?<type>[^\r\n-]+)-----$\r?\n(?<headers>(^[^:\r\n]+:[^\n\r]+\r?\n)+\r?\n)?(?<data>[a-zA-Z0-9/_=\n\r+]+?)^-----END \1-----$\r?\n?/ms);if(!(r!=null&&r.groups))throw new Error("Invalid PEM data");const{type:n,headers:o="",data:s}=r.groups,i=o.split(`
2
- `).filter(y=>y.trim()).map(y=>{const[h,...p]=y.split(":");return[h.trim(),p.join(":").trim()]}).reduce((y,[h,p])=>({...y,[h]:p}),{});return{block:{type:n,header:i,bytes:w.from(s.replace(/[\r\n]/g,""),"base64")},head:t.slice(0,r.index||0),tail:t.slice((r.index||0)+r[0].length)}}static encode(t){var r;const{type:n,header:o,bytes:s}=t,i=Object.entries(o||{}).map(([y,h])=>`${y}: ${h}`).join(`
3
- `);return`-----BEGIN ${n}-----
4
- ${i}${i.length?`
5
-
6
- `:""}${((r=w.toString(s,"base64").match(/.{1,64}/g))==null?void 0:r.join(`
7
- `))||""}
8
- -----END ${n}-----
9
- `}}$("PEM",cr);function ur(e={}){let t=typeof e.seed=="string"?0:e.seed??0;if(typeof e.seed=="string"){let r=0;for(let n=0;n<e.seed.length;n++)r+=e.seed.charCodeAt(n);t=r}return()=>{const r=Math.sin(t++)*1e4;return r-Math.floor(r)}}function lr(e,...t){let r,n,o;return t.length===1?{min:r,max:n,default:o=r}=t[0]:[r,n,o=r]=t,e==null?o:e<r?r:e>n?n:e}function Ie({fetch:e=T().fetch,onRequest:t=n=>n.next(n.url,n.req),onResponse:r=n=>n.res}){return async(n,o)=>{const s=String(n);let i=o||{};const y=i.fetch||e,h=await t({url:s,req:i,next:(p,g)=>(i=g,y(p,g))})??await y(s,o);return r({url:s,req:i,res:h})}}function Ne({url:e,req:t={},log:r=console.log}){const{method:n="GET"}=t;let o=`-> ${n} ${e}
10
- ${Array.from(new Headers(t.headers).entries()).map(([i,y])=>`${i}: ${y}`).join(`
11
- `)}
12
- `,s;if(t.body){if(new Headers(t.headers).get("content-type")!=="application/octet-stream")if(t.body instanceof ReadableStream){const[i,y]=t.body.tee();t.body=i;const h=t.signal;s=Promise.resolve().then(async()=>{const p=y.getReader();for(r(o);!(h!=null&&h.aborted);){let{done:g,value:f}=await p.read();if(f instanceof Uint8Array&&(f=new TextDecoder().decode(f)),o+=f,r(f),!g)break}return o+=`
13
- `,o})}else o+=`
14
- ${t.body}
15
- `;r(o)}return s||Promise.resolve(o)}async function De({res:e,url:t,req:r,log:n=console.log}){let o=`<- ${e.status} ${e.statusText} ${r.method} ${t}
16
- ${Array.from(e.headers.entries()).map(([i,y])=>`${i}: ${y}`).join(`
17
- `)}
18
- `,s=e.headers.get("content-type");if(s!=null&&s.includes("application/json")||s!=null&&s.includes("text/plain")){const i=await e.text();o+=`
19
- ${i}
20
- `,e=new Response(i,e)}return n(o),e}function fr({fetch:e,log:t=console.log}={}){return Ie({fetch:e,onRequest:({url:r,req:n})=>{Ne({url:r,req:n,log:t})},onResponse:({url:r,req:n,res:o})=>De({url:r,req:n,res:o,log:t})})}function dr({fetch:e=T().fetch,retries:t=3,retryDelay:r=1e3,retryOn:n=[]}={}){return function(o,s){return new Promise(function(i,y){var h=function(g){var f=typeof Request<"u"&&o instanceof Request?o.clone():o;e(f,s).then(function(d){if(Array.isArray(n)&&n.indexOf(d.status)===-1)i(d);else if(typeof n=="function")try{return Promise.resolve(n(g,null,d)).then(function(a){a?p(g,null,d):i(d)}).catch(y)}catch(a){y(a)}else g<t?p(g,null,d):i(d)}).catch(function(d){if(typeof n=="function")try{Promise.resolve(n(g,d,null)).then(function(a){a?p(g,d,null):y(d)}).catch(function(a){y(a)})}catch(a){y(a)}else g<t?p(g,d,null):y(d)})};function p(g,f,d){let a=typeof r=="function"?r(g,f,d):r;setTimeout(function(){h(++g)},a)}h(0)})}}function yr(e,t){try{if(typeof e=="string"&&e.length>0)return hr(e);if(typeof e=="number"&&isFinite(e))return t!=null&&t.long?mr(e):pr(e);throw new Error("Value is not a string or number.")}catch(r){const n=gr(r)?`${r.message}. value=${JSON.stringify(e)}`:"An unknown error has occurred.";throw new Error(n)}}function hr(e){if(e.length>100)throw new Error("Value exceeds the maximum length of 100 characters.");const t=/^(?<value>-?(?:\d+)?\.?\d+) *(?<type>milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e),r=t==null?void 0:t.groups;if(!r)return NaN;const n=parseFloat(r.value),o=(r.type||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return n*315576e5;case"weeks":case"week":case"w":return n*6048e5;case"days":case"day":case"d":return n*864e5;case"hours":case"hour":case"hrs":case"hr":case"h":return n*36e5;case"minutes":case"minute":case"mins":case"min":case"m":return n*6e4;case"seconds":case"second":case"secs":case"sec":case"s":return n*1e3;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:throw new Error(`The unit ${o} was matched, but no matching case exists.`)}}function pr(e){const t=Math.abs(e);return t>=864e5?`${Math.round(e/864e5)}d`:t>=36e5?`${Math.round(e/36e5)}h`:t>=6e4?`${Math.round(e/6e4)}m`:t>=1e3?`${Math.round(e/1e3)}s`:`${e}ms`}function mr(e){const t=Math.abs(e);return t>=864e5?_(e,t,864e5,"day"):t>=36e5?_(e,t,36e5,"hour"):t>=6e4?_(e,t,6e4,"minute"):t>=1e3?_(e,t,1e3,"second"):`${e} ms`}function _(e,t,r,n){const o=t>=r*1.5;return`${Math.round(e/r)} ${n}${o?"s":""}`}function gr(e){return typeof e=="object"&&e!==null&&"message"in e}const br={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Unused",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Required",413:"Request Entry Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};function Le(e){return br[e]}function wr(e){switch(e){case 408:case 425:case 429:case 502:case 503:case 504:return!0;default:return!1}}class ne extends Error{constructor(t){super(t.message,{cause:t.cause}),this.detail=t,this.status=t.status,this.description=t.description}status;description;toJSON(){return{code:this.detail.code,message:this.message,status:this.status,description:this.description,cause:this.cause}}}$("DetailError",ne);class C{message;status;code;metadata;description;cause;constructor({status:t,message:r=Le(t),code:n=t,metadata:o,description:s,cause:i}){this.message=r??String(t),this.status=t,this.code=n,this.description=s,this.metadata=o,this.cause=i}with(t){return typeof t=="string"&&(t={message:t}),t===void 0?new C(this):new C({status:this.status,code:this.code,message:this.message,metadata:this.metadata,cause:this.cause,...t})}asError(t){return typeof t=="string"&&(t={message:t}),new ne(this.with(t))}require(t,r){if(t==null)throw this.asError(r);return t}check(t,r){switch(t){case!1:case void 0:case null:throw this.asError(r)}}throw(t){throw this.asError(t)}toJSON(){return{code:this.code,message:this.message,status:this.status,description:this.description,cause:this.cause,metadata:this.metadata}}asResponse(){return new Response(JSON.stringify(this.toJSON()),{status:this.status,statusText:this.description,headers:{"Content-Type":"application/json"}})}}class Ar{static BadRequest=this.with({status:400});static Unauthorized=this.with({status:403});static Forbidden=this.with({status:403});static NotFound=this.with({status:404});static InternalServerError=this.with({status:500});static NotImplemented=this.with({status:501});static ServiceUnavailable=this.with({status:503});static resolvers=[];static with(t){return new C(t)}static ok(t,r){if(t.ok)return t;throw this.with({description:t.statusText,status:t.status,...r,metadata:{...r==null?void 0:r.metadata,response:t}}).asError()}static resolve(t){if(t instanceof C)return t;if(t instanceof ne)return t.detail;for(const r of this.resolvers){const n=r(t);if(n)return n}if(t instanceof Error){const{message:r,code:n,status:o}=t;return new C({message:r,status:parseInt(o)||500,code:n,cause:t})}return new C({message:t.message,status:500,cause:t})}}$("Errors",Ar)}}});
21
- //# sourceMappingURL=index.js.map