@wener/utils 1.1.13 → 1.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +1 -135
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/server.cjs +1 -1
- package/dist/cjs/server.cjs.map +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/server.js +1 -1
- package/dist/esm/server.js.map +1 -1
- package/dist/system/index.js +2 -2
- package/dist/system/index.js.map +1 -1
- package/dist/system/server.js +1 -1
- package/dist/system/server.js.map +1 -1
- package/lib/server.js +3 -1
- package/lib/server.js.map +1 -1
- package/lib/servers/createFetchWithProxy.js +13 -0
- package/lib/servers/createFetchWithProxy.js.map +1 -0
- package/lib/servers/{createProxyFetch.js → createFetchWithProxyByNodeFetch.js} +6 -3
- package/lib/servers/createFetchWithProxyByNodeFetch.js.map +1 -0
- package/lib/servers/createFetchWithProxyByUndici.js +28 -0
- package/lib/servers/createFetchWithProxyByUndici.js.map +1 -0
- package/package.json +20 -28
- package/src/asyncs/createLazyPromise.test.ts +21 -21
- package/src/crypto/hashing.test.ts +10 -12
- package/src/crypto/pem/__snapshots__/pem.test.ts.snap +18 -0
- package/src/crypto/pem/pem.test.ts +14 -17
- package/src/crypto/ulid.test.ts +9 -9
- package/src/i18n/createTranslate.test.ts +76 -88
- package/src/io/ArrayBuffer.test-d.ts +4 -2
- package/src/io/ArrayBuffers.base64.test.ts +17 -17
- package/src/io/ArrayBuffers.test.ts +8 -8
- package/src/io/Buffer.test.ts +4 -4
- package/src/io/isBuffer.test.ts +4 -4
- package/src/io/isTransferable.test.ts +7 -6
- package/src/isomorphics/structuredClone.test.ts +4 -4
- package/src/langs/deepEqual.test.ts +4 -4
- package/src/langs/langs.test.ts +3 -3
- package/src/libs/ms.test.ts +311 -0
- package/src/logging/logger.test.ts +8 -8
- package/src/modules/parseModuleId.test.ts +3 -3
- package/src/objects/get.test-d.ts +30 -22
- package/src/objects/parseObjectPath.test.ts +3 -3
- package/src/objects/set.test.ts +98 -117
- package/src/server.ts +3 -1
- package/src/servers/createFetchWithLogger.ts +75 -0
- package/src/servers/createFetchWithProxy.ts +12 -0
- package/src/servers/{createProxyFetch.ts → createFetchWithProxyByNodeFetch.ts} +4 -1
- package/src/servers/createFetchWithProxyByUndici.ts +36 -0
- package/src/servers/polyfillBrowser.test.ts +9 -9
- package/src/strings/renderTemplate.test.ts +6 -9
- package/src/validations/parseTimestamp.test.ts +4 -4
- package/dist/cjs/index-da9513d6.js +0 -13
- package/dist/cjs/index-da9513d6.js.map +0 -1
- package/dist/esm/index-c696799a.js +0 -13
- package/dist/esm/index-c696799a.js.map +0 -1
- package/dist/system/index-2dfef0f3.js +0 -13
- package/dist/system/index-2dfef0f3.js.map +0 -1
- package/lib/servers/createProxyFetch.js.map +0 -1
- package/src/crypto/pem/pem.test.ts.md +0 -24
- package/src/crypto/pem/pem.test.ts.snap +0 -0
- package/src/objects/get.test.ts +0 -63
package/dist/LICENSE.txt
CHANGED
|
@@ -1,135 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Version: 5.0.1
|
|
3
|
-
License: MIT
|
|
4
|
-
Private: false
|
|
5
|
-
Description: An HTTP(s) proxy `http.Agent` implementation for HTTPS
|
|
6
|
-
Repository: git://github.com/TooTallNate/node-https-proxy-agent.git
|
|
7
|
-
Author: Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
Name: debug
|
|
12
|
-
Version: 4.3.4
|
|
13
|
-
License: MIT
|
|
14
|
-
Private: false
|
|
15
|
-
Description: Lightweight debugging utility for Node.js and the browser
|
|
16
|
-
Repository: git://github.com/debug-js/debug.git
|
|
17
|
-
Author: Josh Junon <josh.junon@protonmail.com>
|
|
18
|
-
Contributors:
|
|
19
|
-
TJ Holowaychuk <tj@vision-media.ca>
|
|
20
|
-
Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)
|
|
21
|
-
Andrew Rhyne <rhyneandrew@gmail.com>
|
|
22
|
-
License Copyright:
|
|
23
|
-
===
|
|
24
|
-
|
|
25
|
-
(The MIT License)
|
|
26
|
-
|
|
27
|
-
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
|
|
28
|
-
Copyright (c) 2018-2021 Josh Junon
|
|
29
|
-
|
|
30
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
|
31
|
-
and associated documentation files (the 'Software'), to deal in the Software without restriction,
|
|
32
|
-
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
33
|
-
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
34
|
-
subject to the following conditions:
|
|
35
|
-
|
|
36
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial
|
|
37
|
-
portions of the Software.
|
|
38
|
-
|
|
39
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
40
|
-
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
41
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
42
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
43
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
Name: ms
|
|
50
|
-
Version: 2.1.2
|
|
51
|
-
License: MIT
|
|
52
|
-
Private: false
|
|
53
|
-
Description: Tiny millisecond conversion utility
|
|
54
|
-
Repository: undefined
|
|
55
|
-
License Copyright:
|
|
56
|
-
===
|
|
57
|
-
|
|
58
|
-
The MIT License (MIT)
|
|
59
|
-
|
|
60
|
-
Copyright (c) 2016 Zeit, Inc.
|
|
61
|
-
|
|
62
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
63
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
64
|
-
in the Software without restriction, including without limitation the rights
|
|
65
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
66
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
67
|
-
furnished to do so, subject to the following conditions:
|
|
68
|
-
|
|
69
|
-
The above copyright notice and this permission notice shall be included in all
|
|
70
|
-
copies or substantial portions of the Software.
|
|
71
|
-
|
|
72
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
73
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
74
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
75
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
76
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
77
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
78
|
-
SOFTWARE.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
Name: has-flag
|
|
84
|
-
Version: 3.0.0
|
|
85
|
-
License: MIT
|
|
86
|
-
Private: false
|
|
87
|
-
Description: Check if argv has a specific flag
|
|
88
|
-
Repository: undefined
|
|
89
|
-
Author: Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
90
|
-
License Copyright:
|
|
91
|
-
===
|
|
92
|
-
|
|
93
|
-
MIT License
|
|
94
|
-
|
|
95
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
96
|
-
|
|
97
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
98
|
-
|
|
99
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
100
|
-
|
|
101
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
Name: supports-color
|
|
107
|
-
Version: 5.5.0
|
|
108
|
-
License: MIT
|
|
109
|
-
Private: false
|
|
110
|
-
Description: Detect whether a terminal supports color
|
|
111
|
-
Repository: undefined
|
|
112
|
-
Author: Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
113
|
-
License Copyright:
|
|
114
|
-
===
|
|
115
|
-
|
|
116
|
-
MIT License
|
|
117
|
-
|
|
118
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
119
|
-
|
|
120
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
121
|
-
|
|
122
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
123
|
-
|
|
124
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
---
|
|
128
|
-
|
|
129
|
-
Name: agent-base
|
|
130
|
-
Version: 6.0.2
|
|
131
|
-
License: MIT
|
|
132
|
-
Private: false
|
|
133
|
-
Description: Turn a function into an `http.Agent` instance
|
|
134
|
-
Repository: git://github.com/TooTallNate/node-agent-base.git
|
|
135
|
-
Author: Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)
|
|
1
|
+
No third parties dependencies
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var pe=Object.create;var R=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty;var Ae=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of me(t))!be.call(e,o)&&o!==r&&R(e,o,{get:()=>t[o],enumerable:!(n=ge(t,o))||n.enumerable});return e};var ve=(e,t,r)=>(r=e!=null?pe(we(e)):{},Ae(t||!e||!e.__esModule?R(r,"default",{value:e,enumerable:!0}):r,e));var d=require("./globalThis-ee7c1669.js");function $e(e,t=null,r=F){return Object.fromEntries(t===null?Object.entries(e).map(([n,o])=>[n,r(o)]):t.map(n=>[n,r(n)]))}function F(e){return Array.isArray(e)?e[0]:e}function Be(e){return Array.isArray(e)?e[e.length-1]:e}function Oe(e){return Array.isArray(e)?e:e==null?[]:[e]}async function je(e){const t=[];for await(const r of e)t.push(r);return t}function U(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 a of o)a.endsWith("]")&&(a=a.slice(0,-1)),r.push(a)}return r}function S(e,t,r){const n=U(t);let o=e;for(const a of n)o=o?o[a]:void 0;return o===void 0?r:o}function Ee(e,t,r,n=!0){const o=U(t);let a=0;const s=o.length;let i=e,c,l;for(;a<s&&(l=o[a++],!(l==="__proto__"||l==="constructor"||l==="prototype"));)i=i[l]=a===s?n?M(i[l],r):r:typeof(c=i[l])==typeof o?c:o[a]*0!==0||~(""+o[a]).indexOf(".")?{}:[]}function M(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]=M(e[r],t[r]);else for(r in t){if(r==="__proto__"||r==="constructor"||r==="prototype")break;e[r]=M(e[r],t[r])}return e}return t}function z(e){return e&&(e instanceof Promise||e.then&&e.catch)}function xe(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=i=>{o=!1,n(i)};const a=r.then.bind(r);r.then=(...i)=>{if(o){o=!1;try{const c=e(t.resolve,t.reject);z(c)?c.then(t.resolve,t.reject):c!==void 0&&t.resolve(c)}catch(c){t.reject(c)}}return a(...i)};const s=t;return s.then=r.then,s.catch=r.catch.bind(r),r.finally&&(s.finally=r.finally),Object.defineProperty(s,Symbol.species,{get(){return Promise}}),s}return r}function Ce(e,t,r=t){let n;const o=async()=>{await e(),n=setTimeout(o,t)};return n=setTimeout(o,r),()=>n}function Te(e){clearTimeout(e==null?void 0:e())}const Ue=e=>new Promise(t=>setTimeout(t,e));function Se(e,t){const r=new q;let n;return Promise.race([e,new Promise((o,a)=>{n=setTimeout(()=>{a(r)},t)})]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}class q extends Error{constructor(){super("TimeoutError")}}function Me(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 W=Object.prototype.hasOwnProperty,Pe=typeof Element<"u";function Z(e,t,r){for(r of e.keys())if(v(r,t))return r}function v(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--&&v(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=Z(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=Z(t,o),!o)||!v(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(Pe&&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)&&(W.call(e,r)&&++n&&!W.call(t,r)||!(r in t)||!v(e[r],t[r])))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function $(e){return Object.prototype.toString.call(e).slice(8,-1)}function ke(e){return e&&(Array.isArray(e)?e.slice():typeof e=="object"?Object.assign({},e):e)}function Le(e){return typeof e=="function"&&/^class\s/.test(Function.prototype.toString.call(e))}function De(e){return e!=null}function G(e){return $(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Ve(e){return G(e)&&Object.keys(e).length===0}function _e(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 Boolean(e)}function Ne(e,...t){return e instanceof Function?e(...t):e}function Ie(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),a=t.apply(this,o);return a in r||(r[a]=e.apply(this,o)),r[a]};return n.cache=r,n}function Re(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function Fe(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 ze=/^(?<n>(?:@(?<org>[a-z0-9-~][a-z0-9-._~]*)\/)?(?<pkg>[a-z0-9-~][a-z0-9-._~]*))(?:@(?<v>[-a-z0-9><=_.^~]+))?(?<p>\/[^\r\n]*)?$/;function qe(e){var t;const r=(t=e.match(ze))==null?void 0:t.groups;if(!r)return;const{n,v:o,p:a,org:s,pkg:i}=r,c=Boolean(s),l=/^\d+\.\d+\.\d+/.test(o)?o:void 0,g=o||"latest",A={id:`${n}@${g}`,name:n,range:g,scoped:c,pkg:i,org:s,versioned:Boolean(o)};return l&&(A.version=l),a&&(A.path=a),A.scoped||delete A.org,A}function We(e){return e&&e[Symbol.toStringTag]==="Module"}function P(e=({level:r,values:n,...o})=>{var a;({values:n,...o}=Ze(o,n)),(a=console[r])==null||a.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=>P(e,{...t,...r})}}function Ze(e,t){return t[0]&&typeof t[0]=="object"?{...e,...t[0],values:t.slice(1)}:{...e,values:t}}function H(){const e=(...t)=>{};return{trace:e,debug:e,info:e,warn:e,error:e,child:()=>H()}}function Ge(e,t){return e.child?e.child(t):P(r=>{const{level:n,values:o,...a}=r;Object.keys(a).length?e[n](a,...o):e[n](...o)},t)}function He(e){let t=!1,r=!1,n=!1;for(let o=0;o<e.length;o++){const a=e[o];t&&/[a-zA-Z]/.test(a)&&a.toUpperCase()===a?(e=e.slice(0,o)+"-"+e.slice(o),t=!1,n=r,r=!0,o++):r&&n&&/[a-zA-Z]/.test(a)&&a.toLowerCase()===a?(e=e.slice(0,o-1)+"-"+e.slice(o-1),n=r,r=!1,t=!0):(t=a.toLowerCase()===a&&a.toUpperCase()!==a,n=r,r=a.toUpperCase()===a&&a.toLowerCase()!==a)}return e}function Je(e){return J(e,{pascalCase:!0})}function J(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=He(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(n,o)=>o.toUpperCase()).replace(/\d+(\w|$)/g,n=>n.toUpperCase()),r(e))}function K(e,t,r="js"){let n;return t?typeof t=="function"?n=t:n=o=>S(t,o):n=()=>"",typeof r=="string"&&(r=Y[r]||Y.js),e.replace(r,(o,a)=>n(a.trim()))}const Y={js:/\${(.*?)}/g,common:/{{(.*?)}}/g};function Ke(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 a=-1;const s=10**r;do e/=n,++a;while(Math.round(Math.abs(e)*s)/s>=n&&a<o.length-1);return e.toFixed(r)+" "+o[a]}function Ye(e){let t="";const r=e||{},n=o=>{if(Array.isArray(o))return o;const a=o.split(/[_-]/);return a.length>1?[o,a[0]]:[o]};return{locale(o){return t=o||t},dict:(o,a)=>{if(a){r[o]=Object.assign(r[o]||{},a);return}return r[o]},t(o,a,s){let i;for(const c of n(s||t))if(i=S(r[c],o,""),i)break;return typeof i=="function"?i(a):typeof i=="string"?K(i,a,"common"):i}}}function B(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)}function Qe(e){return Q||=Xe(),Q.some(t=>e instanceof t)}let Q;function Xe(){const e=d.globalThis.window||d.globalThis||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 m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<m.length;e++)O[m.charCodeAt(e)]=e;function et(e){const t=new Uint8Array(e),r=t.length;let n="";for(let o=0;o<r;o+=3)n+=m[t[o]>>2],n+=m[(t[o]&3)<<4|t[o+1]>>4],n+=m[(t[o+1]&15)<<2|t[o+2]>>6],n+=m[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 tt(e){const t=e.length;let r=e.length*.75,n,o=0,a,s,i,c;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const l=new ArrayBuffer(r),g=new Uint8Array(l);for(n=0;n<t;n+=4)a=O[e.charCodeAt(n)],s=O[e.charCodeAt(n+1)],i=O[e.charCodeAt(n+2)],c=O[e.charCodeAt(n+3)],g[o++]=a<<2|s>>4,g[o++]=(s&15)<<4|i>>2,g[o++]=(i&3)<<6|c&63;return l}var X=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},k=(e,t,r)=>(X(e,t,"read from private field"),r?r.call(e):t.get(e)),ee=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},te=(e,t,r,n)=>(X(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),x,j;const f=class{static isNativeBufferAvailable(){var t,r;return k(this,j)??te(this,j,!((r=(t=d.globalThis.Buffer)==null?void 0:t.isPollyfill)!=null&&r.call(t)))}static isNativeBufferAllowed(){return k(this,x)&&k(this,j)}static setNativeBufferAllowed(t){te(this,x,t)}};let u=f;x=new WeakMap,j=new WeakMap,ee(u,x,!0),ee(u,j,void 0),u.isArrayBuffer=e=>e instanceof ArrayBuffer,u.slice=(e,t,r)=>B(e)?Uint8Array.prototype.slice.call(e,t,r):e.slice(t,r),u.asView=(e,t,r,n)=>t instanceof e&&(r??0)===0&&n===void 0?t:ArrayBuffer.isView(t)||B(t)?f.isNativeBufferAllowed()&&e===Buffer?Buffer.from(t.buffer,r,n):new e(t.buffer,t.byteOffset+(r??0),n??t.byteLength):new e(t,r,n),u.toString=(e,t="utf8")=>{if(typeof e=="string")switch(t){case"base64":return btoa(e);case"utf-8":case"utf8":return e;default:throw new Error(`[ArrayBuffers.toString] Unsupported encoding for string: ${t}`)}if(f.isNativeBufferAllowed())return Buffer.from(f.asView(Uint8Array,e)).toString(t);switch(t){case"hex":return[...f.asView(Uint8Array,e)].map(r=>rt[r]).join("");case"base64":return et(f.asView(Uint8Array,e));case"utf8":case"utf-8":return new TextDecoder().decode(e);case"ascii":{const r=f.asView(Uint8Array,e);return String.fromCharCode(...r.map(n=>n&127))}case"latin1":case"binary":{const r=f.asView(Uint8Array,e);return String.fromCharCode(...r)}case"ucs2":case"ucs-2":case"utf16le":{const r=f.asView(Uint8Array,e);let n="";for(let o=0;o<r.length-1;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}default:throw new Error(`[ArrayBuffers.toString] Unknown encoding: ${t}`)}},u.toJSON=(e,t)=>JSON.parse(f.toString(e),t),u.alloc=(e,t,r)=>t!==void 0?typeof t=="number"?new Uint8Array(e).fill(t):f.asView(Uint8Array,f.from(t,r)).slice(0,e):new ArrayBuffer(e),u.from=(e,t="utf8")=>{if(!e)return new ArrayBuffer(0);if(typeof e=="string"){if(f.isNativeBufferAllowed())return Buffer.from(e,t);switch(t){case"utf-8":case"utf8":return new TextEncoder().encode(e).buffer;case"base64":return tt(e.replace(/[^0-9a-zA-Z=+/_]/g,""));default:throw new Error(`[ArrayBuffers.from] Unknown encoding: ${t}`)}}if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)||B(e)){if(e.byteOffset!==0)throw new Error("ArrayBuffers.from do not support view with offset");return e.buffer}if(Array.isArray(e))return new Uint8Array(e);const r=$(e);throw new TypeError(`ArrayBuffers.from unsupported type ${r}`)},u.isEncoding=e=>{switch(String(e).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}},u.concat=(e,t,r=0)=>{const n=e.reduce((a,s)=>a+s.byteLength,0),o=t?new Uint8Array(t):new Uint8Array(n);for(const a of e){if(!(a!=null&&a.byteLength))continue;let s;if(a instanceof ArrayBuffer)s=new Uint8Array(a);else if(ArrayBuffer.isView(a))s=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);else throw new Error(`ArrayBuffers.concat unsupported type ${$(a)}`);o.set(s,r),r+=a.byteLength}return o.buffer};const rt=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}(),L=class extends Uint8Array{static get isPolyfill(){return!0}static isBuffer(t){return t instanceof L||B(t)}static from(t,r){return new L(u.from(t,r))}toString(t){return u.toString(this,t)}};let re=L;re.isEncoding=u.isEncoding;let D;function nt(){let e;function t(){return navigator.userAgent.match(/ipad|iphone/i)}function r(a){e=document.createElement("textArea"),e.value=a,document.body.appendChild(e)}function n(){let a,s;if(t()){if(a=document.createRange(),a.selectNodeContents(e),s=window.getSelection(),s===null){console.error("no selection");return}s.removeAllRanges(),s.addRange(a),e.setSelectionRange(0,999999)}else e.select()}function o(){document.execCommand("copy"),document.body.removeChild(e)}D=a=>{r(a),n(),o()}}function ot(e){var t,r;return(r=(t=window.navigator)==null?void 0:t.clipboard)!=null&&r.writeText?window.navigator.clipboard.writeText(e):(D||nt(),D(e))}function at(e,t,{type:r="application/octet-stream",raw:n=!1}={}){const o=document.createElement("a");let a=()=>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),a=()=>{URL.revokeObjectURL(o.href)};else throw console.error("invalid download data",t),new Error(`can not download ${Object.getPrototypeOf(t)}`);o.click()}finally{a()}}function ne(e,t,r,n){e.onload=()=>{t(e)},e.onerror=a=>{e.remove(),r(a)};const{attributes:o={}}=n||{};Object.entries(o).forEach(([a,s])=>{e.setAttribute(a,s)}),document.head.appendChild(e)}function oe(e,t){if(Array.isArray(e))return Promise.resolve().then(async()=>{const n=[];for(const o of e)n.push(await oe(o));return n});const r=document.querySelector(`script[src="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const a=document.createElement("script");a.src=e,ne(a,n,o,t)})}function st(e,t){const r=document.querySelector(`link[href="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=e,ne(a,n,o,t)})}function it(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 ct=d.globalThis.structuredClone||w;function ae(e,t,r){typeof r.value=="object"&&(r.value=w(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value}function w(e){if(typeof e!="object")return e;let t=0,r,n,o;const a=$(e);switch(a){case"Array":o=Array(e.length);break;case"Object":o=Object.create(e.__proto__||null);break;case"Set":o=new Set,e.forEach(function(s){o.add(w(s))});break;case"Map":o=new Map,e.forEach(function(s,i){o.set(w(i),w(s))});break;case"Date":o=new Date(+e);break;case"RegExp":o=new RegExp(e.source,e.flags);break;case"DataView":o=new e.constructor(w(e.buffer));break;case"ArrayBuffer":o=e.slice(0);break;default:a.endsWith("Array")&&(o=new e.constructor(e))}if(o){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)ae(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]||ae(o,r,Object.getOwnPropertyDescriptor(e,r))}return o||e}var se,ie;const lt=((ie=(se=d.globalThis.crypto)==null?void 0:se.randomUUID)==null?void 0:ie.bind(d.globalThis.crypto))||ut;function ut(){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 V;if(typeof window>"u")try{typeof require>"u"?import("crypto").then(e=>V=e.default):V=require("crypto")}catch{}function ft(){return V}var ce,le,ue,fe;exports.getRandomValues=((le=(ce=d.globalThis.crypto)==null?void 0:ce.getRandomValues)==null?void 0:le.bind(d.globalThis.crypto))||((fe=(ue=d.globalThis.msCrypto)==null?void 0:ue.getRandomValues)==null?void 0:fe.bind(d.globalThis.msCrypto))||dt;function dt(e){var t,r,n;const o=ft();if((t=o==null?void 0:o.webcrypto)!=null&&t.getRandomValues)return exports.getRandomValues=(n=(r=o==null?void 0:o.webcrypto)==null?void 0:r.getRandomValues)==null?void 0:n.bind(o==null?void 0:o.webcrypto),o.webcrypto.getRandomValues(e);if(o!=null&&o.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 a=o.randomBytes(e.length);return e.set(a),e}throw new Error("[getRandomValues]: No secure random number generator available.")}function yt(e){return C("SHA-1",e)}function ht(e){return C("SHA-256",e)}function pt(e){return C("SHA-384",e)}function gt(e){return C("SHA-512",e)}function C(e,t){return crypto.subtle.digest(e,mt(t))}function mt(e){return typeof e=="string"?new TextEncoder().encode(e):e}function wt(e){return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}function y(e){const t=new Error(e);return t.source="ulid",t}const h="0123456789ABCDEFGHJKMNPQRSTVWXYZ",p=h.length,_=Math.pow(2,48)-1,b=10,N=16;function bt(e){return(e==null?void 0:e.length)===26&&/^[0-9A-HJKMNP-TV-Z]{26}$/i.test(e)}function de(e,t,r){return t>e.length-1?e:e.substr(0,t)+r+e.substr(t+1)}function At(e){let t,r=e.length,n,o;const a=p-1;for(;!t&&r-->=0;){if(n=e[r],o=h.indexOf(n),o===-1)throw y("incorrectly encoded string");if(o===a){e=de(e,r,h[0]);continue}t=de(e,r,h[o+1])}if(typeof t=="string")return t;throw y("cannot increment this string")}function vt(e){let t=Math.floor(e()*p);return t===p&&(t=p-1),h.charAt(t)}function I(e,t){if(isNaN(e))throw new Error(`${e} must be a number`);if(e>_)throw y(`cannot encode time greater than ${_}`);if(e<0)throw y("time must be positive");if(!Number.isInteger(e))throw y("time must be an integer");let r,n="";for(;t>0;t--)r=e%p,n=h.charAt(r)+n,e=(e-r)/p;return n}function ye(e,t){let r="";for(;e>0;e--)r=vt(t)+r;return r}function $t(e){if(e.length!==b+N)throw y("malformed ulid");const t=e.substr(0,b).split("").reverse().reduce((r,n,o)=>{const a=h.indexOf(n);if(a===-1)throw y("invalid character found: "+n);return r+=a*Math.pow(p,o)},0);if(t>_)throw y("malformed ulid, timestamp too large");return{timestamp:t,random:e.substring(b)}}function Bt(){return()=>{const e=new Uint8Array(1);return exports.getRandomValues(e),e[0]/255}}function he({monotonic:e=!0,random:t=Bt(),now:r=Date.now}={}){if(!e)return function(a){return a||=r(),I(a,b)+ye(N,t)};let n=0,o;return function(a){if(a||=r(),a<=n&&o){const i=o=At(o);return I(n,b)+i}n=a;const s=o=ye(N,t);return I(a,b)+s}}exports.ulid=(...e)=>E?E(...e):(E=he(),exports.ulid=E,E(...e));let E;class Ot{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:a}=r.groups,s=o.split(`
|
|
1
|
+
"use strict";var pe=Object.create;var R=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var me=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty;var Ae=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of me(t))!be.call(e,o)&&o!==r&&R(e,o,{get:()=>t[o],enumerable:!(n=ge(t,o))||n.enumerable});return e};var ve=(e,t,r)=>(r=e!=null?pe(we(e)):{},Ae(t||!e||!e.__esModule?R(r,"default",{value:e,enumerable:!0}):r,e));var d=require("./globalThis-ee7c1669.js");function $e(e,t=null,r=F){return Object.fromEntries(t===null?Object.entries(e).map(([n,o])=>[n,r(o)]):t.map(n=>[n,r(n)]))}function F(e){return Array.isArray(e)?e[0]:e}function Be(e){return Array.isArray(e)?e[e.length-1]:e}function Oe(e){return Array.isArray(e)?e:e==null?[]:[e]}async function je(e){const t=[];for await(const r of e)t.push(r);return t}function U(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 a of o)a.endsWith("]")&&(a=a.slice(0,-1)),r.push(a)}return r}function S(e,t,r){const n=U(t);let o=e;for(const a of n)o=o?o[a]:void 0;return o===void 0?r:o}function Ee(e,t,r,n=!0){const o=U(t);let a=0;const s=o.length;let i=e,c,l;for(;a<s&&(l=o[a++],!(l==="__proto__"||l==="constructor"||l==="prototype"));)i=i[l]=a===s?n?M(i[l],r):r:typeof(c=i[l])==typeof o?c:o[a]*0!==0||~(""+o[a]).indexOf(".")?{}:[]}function M(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]=M(e[r],t[r]);else for(r in t){if(r==="__proto__"||r==="constructor"||r==="prototype")break;e[r]=M(e[r],t[r])}return e}return t}function z(e){return e&&(e instanceof Promise||e.then&&e.catch)}function xe(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=i=>{o=!1,n(i)};const a=r.then.bind(r);r.then=(...i)=>{if(o){o=!1;try{const c=e(t.resolve,t.reject);z(c)?c.then(t.resolve,t.reject):c!==void 0&&t.resolve(c)}catch(c){t.reject(c)}}return a(...i)};const s=t;return s.then=r.then,s.catch=r.catch.bind(r),r.finally&&(s.finally=r.finally),Object.defineProperty(s,Symbol.species,{get(){return Promise}}),s}return r}function Ce(e,t,r=t){let n;const o=async()=>{await e(),n=setTimeout(o,t)};return n=setTimeout(o,r),()=>n}function Te(e){clearTimeout(e==null?void 0:e())}const Ue=e=>new Promise(t=>setTimeout(t,e));function Se(e,t){const r=new q;let n;return Promise.race([e,new Promise((o,a)=>{n=setTimeout(()=>{a(r)},t)})]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}class q extends Error{constructor(){super("TimeoutError")}}function Me(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 W=Object.prototype.hasOwnProperty,Pe=typeof Element<"u";function Z(e,t,r){for(r of e.keys())if(v(r,t))return r}function v(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--&&v(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=Z(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=Z(t,o),!o)||!v(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(Pe&&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)&&(W.call(e,r)&&++n&&!W.call(t,r)||!(r in t)||!v(e[r],t[r])))return!1;return Object.keys(t).length===n}}return e!==e&&t!==t}function $(e){return Object.prototype.toString.call(e).slice(8,-1)}function ke(e){return e&&(Array.isArray(e)?e.slice():typeof e=="object"?Object.assign({},e):e)}function Le(e){return typeof e=="function"&&/^class\s/.test(Function.prototype.toString.call(e))}function De(e){return e!=null}function G(e){return $(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Ve(e){return G(e)&&Object.keys(e).length===0}function _e(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 Ne(e,...t){return e instanceof Function?e(...t):e}function Ie(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),a=t.apply(this,o);return a in r||(r[a]=e.apply(this,o)),r[a]};return n.cache=r,n}function Re(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function Fe(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 ze=/^(?<n>(?:@(?<org>[a-z0-9-~][a-z0-9-._~]*)\/)?(?<pkg>[a-z0-9-~][a-z0-9-._~]*))(?:@(?<v>[-a-z0-9><=_.^~]+))?(?<p>\/[^\r\n]*)?$/;function qe(e){var t;const r=(t=e.match(ze))==null?void 0:t.groups;if(!r)return;const{n,v:o,p:a,org:s,pkg:i}=r,c=!!s,l=/^\d+\.\d+\.\d+/.test(o)?o:void 0,g=o||"latest",A={id:`${n}@${g}`,name:n,range:g,scoped:c,pkg:i,org:s,versioned:!!o};return l&&(A.version=l),a&&(A.path=a),A.scoped||delete A.org,A}function We(e){return e&&e[Symbol.toStringTag]==="Module"}function P(e=({level:r,values:n,...o})=>{var a;({values:n,...o}=Ze(o,n)),(a=console[r])==null||a.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=>P(e,{...t,...r})}}function Ze(e,t){return t[0]&&typeof t[0]=="object"?{...e,...t[0],values:t.slice(1)}:{...e,values:t}}function H(){const e=(...t)=>{};return{trace:e,debug:e,info:e,warn:e,error:e,child:()=>H()}}function Ge(e,t){return e.child?e.child(t):P(r=>{const{level:n,values:o,...a}=r;Object.keys(a).length?e[n](a,...o):e[n](...o)},t)}function He(e){let t=!1,r=!1,n=!1;for(let o=0;o<e.length;o++){const a=e[o];t&&/[a-zA-Z]/.test(a)&&a.toUpperCase()===a?(e=e.slice(0,o)+"-"+e.slice(o),t=!1,n=r,r=!0,o++):r&&n&&/[a-zA-Z]/.test(a)&&a.toLowerCase()===a?(e=e.slice(0,o-1)+"-"+e.slice(o-1),n=r,r=!1,t=!0):(t=a.toLowerCase()===a&&a.toUpperCase()!==a,n=r,r=a.toUpperCase()===a&&a.toLowerCase()!==a)}return e}function Je(e){return J(e,{pascalCase:!0})}function J(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=He(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(n,o)=>o.toUpperCase()).replace(/\d+(\w|$)/g,n=>n.toUpperCase()),r(e))}function K(e,t,r="js"){let n;return t?typeof t=="function"?n=t:n=o=>S(t,o):n=()=>"",typeof r=="string"&&(r=Y[r]||Y.js),e.replace(r,(o,a)=>n(a.trim()))}const Y={js:/\${(.*?)}/g,common:/{{(.*?)}}/g};function Ke(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 a=-1;const s=10**r;do e/=n,++a;while(Math.round(Math.abs(e)*s)/s>=n&&a<o.length-1);return e.toFixed(r)+" "+o[a]}function Ye(e){let t="";const r=e||{},n=o=>{if(Array.isArray(o))return o;const a=o.split(/[_-]/);return a.length>1?[o,a[0]]:[o]};return{locale(o){return t=o||t},dict:(o,a)=>{if(a){r[o]=Object.assign(r[o]||{},a);return}return r[o]},t(o,a,s){let i;for(const c of n(s||t))if(i=S(r[c],o,""),i)break;return typeof i=="function"?i(a):typeof i=="string"?K(i,a,"common"):i}}}function B(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)}function Qe(e){return Q||=Xe(),Q.some(t=>e instanceof t)}let Q;function Xe(){const e=d.globalThis.window||d.globalThis||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 m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",O=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<m.length;e++)O[m.charCodeAt(e)]=e;function et(e){const t=new Uint8Array(e),r=t.length;let n="";for(let o=0;o<r;o+=3)n+=m[t[o]>>2],n+=m[(t[o]&3)<<4|t[o+1]>>4],n+=m[(t[o+1]&15)<<2|t[o+2]>>6],n+=m[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 tt(e){const t=e.length;let r=e.length*.75,n,o=0,a,s,i,c;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const l=new ArrayBuffer(r),g=new Uint8Array(l);for(n=0;n<t;n+=4)a=O[e.charCodeAt(n)],s=O[e.charCodeAt(n+1)],i=O[e.charCodeAt(n+2)],c=O[e.charCodeAt(n+3)],g[o++]=a<<2|s>>4,g[o++]=(s&15)<<4|i>>2,g[o++]=(i&3)<<6|c&63;return l}var X=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},k=(e,t,r)=>(X(e,t,"read from private field"),r?r.call(e):t.get(e)),ee=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},te=(e,t,r,n)=>(X(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),x,j;const f=class{static isNativeBufferAvailable(){var t,r;return k(this,j)??te(this,j,!((r=(t=d.globalThis.Buffer)==null?void 0:t.isPollyfill)!=null&&r.call(t)))}static isNativeBufferAllowed(){return k(this,x)&&k(this,j)}static setNativeBufferAllowed(t){te(this,x,t)}};let u=f;x=new WeakMap,j=new WeakMap,ee(u,x,!0),ee(u,j,void 0),u.isArrayBuffer=e=>e instanceof ArrayBuffer,u.slice=(e,t,r)=>B(e)?Uint8Array.prototype.slice.call(e,t,r):e.slice(t,r),u.asView=(e,t,r,n)=>t instanceof e&&(r??0)===0&&n===void 0?t:ArrayBuffer.isView(t)||B(t)?f.isNativeBufferAllowed()&&e===Buffer?Buffer.from(t.buffer,r,n):new e(t.buffer,t.byteOffset+(r??0),n??t.byteLength):new e(t,r,n),u.toString=(e,t="utf8")=>{if(typeof e=="string")switch(t){case"base64":return btoa(e);case"utf-8":case"utf8":return e;default:throw new Error(`[ArrayBuffers.toString] Unsupported encoding for string: ${t}`)}if(f.isNativeBufferAllowed())return Buffer.from(f.asView(Uint8Array,e)).toString(t);switch(t){case"hex":return[...f.asView(Uint8Array,e)].map(r=>rt[r]).join("");case"base64":return et(f.asView(Uint8Array,e));case"utf8":case"utf-8":return new TextDecoder().decode(e);case"ascii":{const r=f.asView(Uint8Array,e);return String.fromCharCode(...r.map(n=>n&127))}case"latin1":case"binary":{const r=f.asView(Uint8Array,e);return String.fromCharCode(...r)}case"ucs2":case"ucs-2":case"utf16le":{const r=f.asView(Uint8Array,e);let n="";for(let o=0;o<r.length-1;o+=2)n+=String.fromCharCode(r[o]+r[o+1]*256);return n}default:throw new Error(`[ArrayBuffers.toString] Unknown encoding: ${t}`)}},u.toJSON=(e,t)=>JSON.parse(f.toString(e),t),u.alloc=(e,t,r)=>t!==void 0?typeof t=="number"?new Uint8Array(e).fill(t):f.asView(Uint8Array,f.from(t,r)).slice(0,e):new ArrayBuffer(e),u.from=(e,t="utf8")=>{if(!e)return new ArrayBuffer(0);if(typeof e=="string"){if(f.isNativeBufferAllowed())return Buffer.from(e,t);switch(t){case"utf-8":case"utf8":return new TextEncoder().encode(e).buffer;case"base64":return tt(e.replace(/[^0-9a-zA-Z=+/_]/g,""));default:throw new Error(`[ArrayBuffers.from] Unknown encoding: ${t}`)}}if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e)||B(e)){if(e.byteOffset!==0)throw new Error("ArrayBuffers.from do not support view with offset");return e.buffer}if(Array.isArray(e))return new Uint8Array(e);const r=$(e);throw new TypeError(`ArrayBuffers.from unsupported type ${r}`)},u.isEncoding=e=>{switch(String(e).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}},u.concat=(e,t,r=0)=>{const n=e.reduce((a,s)=>a+s.byteLength,0),o=t?new Uint8Array(t):new Uint8Array(n);for(const a of e){if(!(a!=null&&a.byteLength))continue;let s;if(a instanceof ArrayBuffer)s=new Uint8Array(a);else if(ArrayBuffer.isView(a))s=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);else throw new Error(`ArrayBuffers.concat unsupported type ${$(a)}`);o.set(s,r),r+=a.byteLength}return o.buffer};const rt=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}(),L=class extends Uint8Array{static get isPolyfill(){return!0}static isBuffer(t){return t instanceof L||B(t)}static from(t,r){return new L(u.from(t,r))}toString(t){return u.toString(this,t)}};let re=L;re.isEncoding=u.isEncoding;let D;function nt(){let e;function t(){return navigator.userAgent.match(/ipad|iphone/i)}function r(a){e=document.createElement("textArea"),e.value=a,document.body.appendChild(e)}function n(){let a,s;if(t()){if(a=document.createRange(),a.selectNodeContents(e),s=window.getSelection(),s===null){console.error("no selection");return}s.removeAllRanges(),s.addRange(a),e.setSelectionRange(0,999999)}else e.select()}function o(){document.execCommand("copy"),document.body.removeChild(e)}D=a=>{r(a),n(),o()}}function ot(e){var t,r;return(r=(t=window.navigator)==null?void 0:t.clipboard)!=null&&r.writeText?window.navigator.clipboard.writeText(e):(D||nt(),D(e))}function at(e,t,{type:r="application/octet-stream",raw:n=!1}={}){const o=document.createElement("a");let a=()=>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),a=()=>{URL.revokeObjectURL(o.href)};else throw console.error("invalid download data",t),new Error(`can not download ${Object.getPrototypeOf(t)}`);o.click()}finally{a()}}function ne(e,t,r,n){e.onload=()=>{t(e)},e.onerror=a=>{e.remove(),r(a)};const{attributes:o={}}=n||{};Object.entries(o).forEach(([a,s])=>{e.setAttribute(a,s)}),document.head.appendChild(e)}function oe(e,t){if(Array.isArray(e))return Promise.resolve().then(async()=>{const n=[];for(const o of e)n.push(await oe(o));return n});const r=document.querySelector(`script[src="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const a=document.createElement("script");a.src=e,ne(a,n,o,t)})}function st(e,t){const r=document.querySelector(`link[href="${e}"]`);return r?Promise.resolve(r):new Promise((n,o)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=e,ne(a,n,o,t)})}function it(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 ct=d.globalThis.structuredClone||w;function ae(e,t,r){typeof r.value=="object"&&(r.value=w(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value}function w(e){if(typeof e!="object")return e;let t=0,r,n,o;const a=$(e);switch(a){case"Array":o=Array(e.length);break;case"Object":o=Object.create(e.__proto__||null);break;case"Set":o=new Set,e.forEach(function(s){o.add(w(s))});break;case"Map":o=new Map,e.forEach(function(s,i){o.set(w(i),w(s))});break;case"Date":o=new Date(+e);break;case"RegExp":o=new RegExp(e.source,e.flags);break;case"DataView":o=new e.constructor(w(e.buffer));break;case"ArrayBuffer":o=e.slice(0);break;default:a.endsWith("Array")&&(o=new e.constructor(e))}if(o){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)ae(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]||ae(o,r,Object.getOwnPropertyDescriptor(e,r))}return o||e}var se,ie;const lt=((ie=(se=d.globalThis.crypto)==null?void 0:se.randomUUID)==null?void 0:ie.bind(d.globalThis.crypto))||ut;function ut(){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 V;if(typeof window>"u")try{typeof require>"u"?import("crypto").then(e=>V=e.default):V=require("crypto")}catch{}function ft(){return V}var ce,le,ue,fe;exports.getRandomValues=((le=(ce=d.globalThis.crypto)==null?void 0:ce.getRandomValues)==null?void 0:le.bind(d.globalThis.crypto))||((fe=(ue=d.globalThis.msCrypto)==null?void 0:ue.getRandomValues)==null?void 0:fe.bind(d.globalThis.msCrypto))||dt;function dt(e){var t,r,n;const o=ft();if((t=o==null?void 0:o.webcrypto)!=null&&t.getRandomValues)return exports.getRandomValues=(n=(r=o==null?void 0:o.webcrypto)==null?void 0:r.getRandomValues)==null?void 0:n.bind(o==null?void 0:o.webcrypto),o.webcrypto.getRandomValues(e);if(o!=null&&o.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 a=o.randomBytes(e.length);return e.set(a),e}throw new Error("[getRandomValues]: No secure random number generator available.")}function yt(e){return C("SHA-1",e)}function ht(e){return C("SHA-256",e)}function pt(e){return C("SHA-384",e)}function gt(e){return C("SHA-512",e)}function C(e,t){return crypto.subtle.digest(e,mt(t))}function mt(e){return typeof e=="string"?new TextEncoder().encode(e):e}function wt(e){return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}function y(e){const t=new Error(e);return t.source="ulid",t}const h="0123456789ABCDEFGHJKMNPQRSTVWXYZ",p=h.length,_=Math.pow(2,48)-1,b=10,N=16;function bt(e){return(e==null?void 0:e.length)===26&&/^[0-9A-HJKMNP-TV-Z]{26}$/i.test(e)}function de(e,t,r){return t>e.length-1?e:e.substr(0,t)+r+e.substr(t+1)}function At(e){let t,r=e.length,n,o;const a=p-1;for(;!t&&r-->=0;){if(n=e[r],o=h.indexOf(n),o===-1)throw y("incorrectly encoded string");if(o===a){e=de(e,r,h[0]);continue}t=de(e,r,h[o+1])}if(typeof t=="string")return t;throw y("cannot increment this string")}function vt(e){let t=Math.floor(e()*p);return t===p&&(t=p-1),h.charAt(t)}function I(e,t){if(isNaN(e))throw new Error(`${e} must be a number`);if(e>_)throw y(`cannot encode time greater than ${_}`);if(e<0)throw y("time must be positive");if(!Number.isInteger(e))throw y("time must be an integer");let r,n="";for(;t>0;t--)r=e%p,n=h.charAt(r)+n,e=(e-r)/p;return n}function ye(e,t){let r="";for(;e>0;e--)r=vt(t)+r;return r}function $t(e){if(e.length!==b+N)throw y("malformed ulid");const t=e.substr(0,b).split("").reverse().reduce((r,n,o)=>{const a=h.indexOf(n);if(a===-1)throw y("invalid character found: "+n);return r+=a*Math.pow(p,o)},0);if(t>_)throw y("malformed ulid, timestamp too large");return{timestamp:t,random:e.substring(b)}}function Bt(){return()=>{const e=new Uint8Array(1);return exports.getRandomValues(e),e[0]/255}}function he({monotonic:e=!0,random:t=Bt(),now:r=Date.now}={}){if(!e)return function(a){return a||=r(),I(a,b)+ye(N,t)};let n=0,o;return function(a){if(a||=r(),a<=n&&o){const i=o=At(o);return I(n,b)+i}n=a;const s=o=ye(N,t);return I(a,b)+s}}exports.ulid=(...e)=>E?E(...e):(E=he(),exports.ulid=E,E(...e));let E;class Ot{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:a}=r.groups,s=o.split(`
|
|
2
2
|
`).filter(i=>i.trim()).map(i=>{const[c,...l]=i.split(":");return[c.trim(),l.join(":").trim()]}).reduce((i,[c,l])=>({...i,[c]:l}),{});return{block:{type:n,header:s,bytes:u.from(a.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:a}=t,s=Object.entries(o||{}).map(([i,c])=>`${i}: ${c}`).join(`
|
|
3
3
|
`);return`-----BEGIN ${n}-----
|
|
4
4
|
${s}${s.length?`
|