@acuity/directus-extension-acuity-backup 1.6.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Acuity
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,255 @@
1
+ # Directus Backup Extension
2
+
3
+ A powerful Directus bundle extension that provides full or selective backup of collections, schema, media files, and relations into ZIP archives. Backups are stored both locally and as Directus File assets, with support for automatic scheduled backups.
4
+
5
+ ## Features
6
+
7
+ - **Full & Selective Backups** — Backup all collections or choose specific ones
8
+ - **Media File Export** — Include binary media files from Directus Files in backups
9
+ - **Schema & Relations** — Capture complete schema definition and relationship mappings
10
+ - **ZIP Archives** — Compressed, portable backup format with metadata
11
+ - **Restore Functionality** — Import backups with optional data truncation
12
+ - **Scheduled Backups** — Automatic backups via cron expressions
13
+ - **File Storage** — Backups saved locally and uploaded to Directus Files
14
+ - **Admin Dashboard** — Intuitive Vue module for managing backups and schedules
15
+
16
+ ## Installation
17
+
18
+ Install the package from npm:
19
+
20
+ ```bash
21
+ npm install directus-extension-acuity-backup
22
+ ```
23
+
24
+ Or, use the Directus CLI:
25
+
26
+ ```bash
27
+ directus add directus-extension-acuity-backup
28
+ ```
29
+
30
+ ## Configuration
31
+
32
+ ### Environment Variables
33
+
34
+ - `BACKUP_PATH` — Directory where backup ZIP files are stored (default: `/directus/backups/`)
35
+ - `STORAGE_DEFAULT` — Directus storage location for uploaded backup files (default: `local`)
36
+
37
+ Example `.env`:
38
+
39
+ ```env
40
+ BACKUP_PATH=/backups
41
+ STORAGE_DEFAULT=local
42
+ ```
43
+
44
+ ## Usage
45
+
46
+ ### Via Data Studio
47
+
48
+ 1. Log in as an administrator
49
+ 2. Navigate to **Backup** in the sidebar (cloud download icon)
50
+ 3. Click **Run Backup** to open the backup dialog
51
+ 4. Choose backup type:
52
+ - **Full Backup** — All collections, schema, and media
53
+ - **Selected Collections** — Choose which collections to include
54
+ 5. Toggle "Include Media Files" as needed
55
+ 6. Click **Start Backup**
56
+ 7. Monitor backup progress and download completed backups from the history table
57
+
58
+ ### API Endpoints
59
+
60
+ All endpoints require administrator authentication. Base path: `/acuity-backup`
61
+
62
+ #### `GET /collections`
63
+ List all user-created collections with item counts.
64
+
65
+ **Response:**
66
+ ```json
67
+ [
68
+ {
69
+ "collection": "articles",
70
+ "itemCount": 42,
71
+ "icon": "article",
72
+ "note": "Blog posts"
73
+ }
74
+ ]
75
+ ```
76
+
77
+ #### `POST /run`
78
+ Trigger a backup operation.
79
+
80
+ **Request body:**
81
+ ```json
82
+ {
83
+ "type": "full",
84
+ "collections": [],
85
+ "includeMedia": true
86
+ }
87
+ ```
88
+
89
+ **Response:**
90
+ ```json
91
+ {
92
+ "id": "backup-2025-02-24-150000",
93
+ "filename": "backup-2025-02-24-150000.zip",
94
+ "timestamp": "2025-02-24T15:00:00Z",
95
+ "type": "full",
96
+ "collections": ["articles", "authors", "categories"],
97
+ "includeMedia": true,
98
+ "fileSize": 5242880,
99
+ "directusFileId": "uuid-here"
100
+ }
101
+ ```
102
+
103
+ #### `GET /list`
104
+ Retrieve all saved backups.
105
+
106
+ **Response:**
107
+ ```json
108
+ [
109
+ {
110
+ "id": "backup-2025-02-24-150000",
111
+ "filename": "backup-2025-02-24-150000.zip",
112
+ "timestamp": "2025-02-24T15:00:00Z",
113
+ "type": "full",
114
+ "collections": ["articles", "authors"],
115
+ "includeMedia": true,
116
+ "fileSize": 5242880
117
+ }
118
+ ]
119
+ ```
120
+
121
+ #### `POST /restore`
122
+ Restore data from a backup.
123
+
124
+ **Request body:**
125
+ ```json
126
+ {
127
+ "backupId": "backup-2025-02-24-150000",
128
+ "truncateCollections": true,
129
+ "collections": ["articles", "authors"]
130
+ }
131
+ ```
132
+
133
+ #### `GET /schedule`
134
+ Get the current automatic backup schedule.
135
+
136
+ **Response:**
137
+ ```json
138
+ {
139
+ "enabled": true,
140
+ "cronExpression": "0 2 * * *",
141
+ "lastRun": "2025-02-24T02:00:00Z"
142
+ }
143
+ ```
144
+
145
+ #### `POST /schedule`
146
+ Update the automatic backup schedule.
147
+
148
+ **Request body:**
149
+ ```json
150
+ {
151
+ "enabled": true,
152
+ "cronExpression": "0 2 * * *"
153
+ }
154
+ ```
155
+
156
+ #### `DELETE /:id`
157
+ Delete a backup archive.
158
+
159
+ ## Backup Format
160
+
161
+ Backups are ZIP archives with the following structure:
162
+
163
+ ```
164
+ backup-2025-02-24-150000.zip
165
+ ├── manifest.json # Backup metadata
166
+ ├── schema.json # Complete schema definition
167
+ ├── relations.json # Relationship mappings
168
+ ├── collections/
169
+ │ ├── articles.json
170
+ │ ├── authors.json
171
+ │ └── categories.json
172
+ └── files/
173
+ ├── image-001.jpg
174
+ ├── document-001.pdf
175
+ └── ...
176
+ ```
177
+
178
+ ## Restore Behavior
179
+
180
+ - **Truncate Mode** — Clears collection data before inserting backup items
181
+ - **Upsert Mode** — Merges backup data with existing records
182
+ - **Media Files** — Re-uploaded to Directus Files with original metadata
183
+ - **Relations** — Not automatically restored; must be manually configured
184
+
185
+ ## Cron Expression Format
186
+
187
+ Schedule automatic backups using standard 5-field cron expressions:
188
+
189
+ ```
190
+ ┌───────────── minute (0 - 59)
191
+ │ ┌───────────── hour (0 - 23)
192
+ │ │ ┌───────────── day of month (1 - 31)
193
+ │ │ │ ┌───────────── month (1 - 12)
194
+ │ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday)
195
+ │ │ │ │ │
196
+ │ │ │ │ │
197
+ * * * * *
198
+ ```
199
+
200
+ **Examples:**
201
+ - `0 2 * * *` — Daily at 2:00 AM
202
+ - `0 0 ? * 0` — Weekly on Sunday at midnight
203
+ - `0 0 1 * *` — Monthly on the first day at midnight
204
+ - `*/30 * * * *` — Every 30 minutes
205
+
206
+ ## Permissions
207
+
208
+ This extension requires **administrator privileges** to:
209
+ - View the Backup module
210
+ - Create, restore, and delete backups
211
+ - Configure automatic schedules
212
+
213
+ ## Limitations
214
+
215
+ - **System Collections** — `directus_*` collections are excluded from backups
216
+ - **Relations** — Relationship metadata is captured but not automatically restored
217
+ - **Media Streaming** — Large media libraries may require increased timeout settings
218
+ - **Storage** — Backup size is limited by available disk space
219
+
220
+ ## Development
221
+
222
+ ### Build
223
+
224
+ ```bash
225
+ npm run build
226
+ ```
227
+
228
+ ### Watch Mode
229
+
230
+ ```bash
231
+ npm run dev
232
+ ```
233
+
234
+ ### Validate
235
+
236
+ ```bash
237
+ npm run validate
238
+ ```
239
+
240
+ ### TypeScript
241
+
242
+ This extension is built with TypeScript. Run `npm run build` to compile source files in `src/` to the `dist/` directory.
243
+
244
+ ## License
245
+
246
+ MIT — Feel free to use in personal and commercial projects.
247
+
248
+ ## Support
249
+
250
+ For issues, feature requests, or questions, please visit:
251
+ https://git.technolify.cloud/acuity/directus/backup-plugin
252
+
253
+ ---
254
+
255
+ Made with ❤️ by Acuity
package/dist/api.js ADDED
@@ -0,0 +1,49 @@
1
+ import{readFileSync as t,existsSync as e,writeFileSync as r,mkdirSync as n,createReadStream as i,createWriteStream as s}from"node:fs";import{readdir as o,unlink as a,stat as u}from"node:fs/promises";import{join as c,basename as l}from"node:path";import h from"fs";import f from"events";import d from"path";import p from"constants";import g from"stream";import y from"util";import m from"assert";import b from"buffer";import v from"zlib";import{randomUUID as w}from"node:crypto";var S,E,k,x,O,T,R,I,j,L,A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function M(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function D(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var r=function t(){var r=!1;try{r=this instanceof t}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})}),r}function P(){if(E)return S;E=1;const t="object"==typeof process&&process&&"win32"===process.platform;return S=t?{sep:"\\"}:{sep:"/"}}function N(){if(T)return O;T=1;var t=function(){if(x)return k;function t(t,n,i){t instanceof RegExp&&(t=e(t,i)),n instanceof RegExp&&(n=e(n,i));var s=r(t,n,i);return s&&{start:s[0],end:s[1],pre:i.slice(0,s[0]),body:i.slice(s[0]+t.length,s[1]),post:i.slice(s[1]+n.length)}}function e(t,e){var r=e.match(t);return r?r[0]:null}function r(t,e,r){var n,i,s,o,a,u=r.indexOf(t),c=r.indexOf(e,u+1),l=u;if(u>=0&&c>0){if(t===e)return[u,c];for(n=[],s=r.length;l>=0&&!a;)l==u?(n.push(l),u=r.indexOf(t,l+1)):1==n.length?a=[n.pop(),c]:((i=n.pop())<s&&(s=i,o=c),c=r.indexOf(e,l+1)),l=u<c&&u>=0?u:c;n.length&&(a=[s,o])}return a}return x=1,k=t,t.range=r,k}();O=function(t){if(!t)return[];"{}"===t.substr(0,2)&&(t="\\{\\}"+t.substr(2));return d(function(t){return t.split("\\\\").join(e).split("\\{").join(r).split("\\}").join(n).split("\\,").join(i).split("\\.").join(s)}(t),!0).map(a)};var e="\0SLASH"+Math.random()+"\0",r="\0OPEN"+Math.random()+"\0",n="\0CLOSE"+Math.random()+"\0",i="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function o(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function a(t){return t.split(e).join("\\").split(r).join("{").split(n).join("}").split(i).join(",").split(s).join(".")}function u(e){if(!e)return[""];var r=[],n=t("{","}",e);if(!n)return e.split(",");var i=n.pre,s=n.body,o=n.post,a=i.split(",");a[a.length-1]+="{"+s+"}";var c=u(o);return o.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),r.push.apply(r,a),r}function c(t){return"{"+t+"}"}function l(t){return/^-?0\d/.test(t)}function h(t,e){return t<=e}function f(t,e){return t>=e}function d(e,r){var i=[],s=t("{","}",e);if(!s)return[e];var a=s.pre,p=s.post.length?d(s.post,!1):[""];if(/\$$/.test(s.pre))for(var g=0;g<p.length;g++){var y=a+"{"+s.body+"}"+p[g];i.push(y)}else{var m,b,_=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),v=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),w=_||v,S=s.body.indexOf(",")>=0;if(!w&&!S)return s.post.match(/,(?!,).*\}/)?d(e=s.pre+"{"+s.body+n+s.post):[e];if(w)m=s.body.split(/\.\./);else if(1===(m=u(s.body)).length&&1===(m=d(m[0],!1).map(c)).length)return p.map(function(t){return s.pre+m[0]+t});if(w){var E=o(m[0]),k=o(m[1]),x=Math.max(m[0].length,m[1].length),O=3==m.length?Math.abs(o(m[2])):1,T=h;k<E&&(O*=-1,T=f);var R=m.some(l);b=[];for(var I=E;T(I,k);I+=O){var j;if(v)"\\"===(j=String.fromCharCode(I))&&(j="");else if(j=String(I),R){var L=x-j.length;if(L>0){var A=new Array(L+1).join("0");j=I<0?"-"+A+j.slice(1):A+j}}b.push(j)}}else{b=[];for(var M=0;M<m.length;M++)b.push.apply(b,d(m[M],!1))}for(M=0;M<b.length;M++)for(g=0;g<p.length;g++){y=a+b[M]+p[g];(!r||w||y)&&i.push(y)}}return i}return O}function C(){if(I)return R;I=1;const t=R=(t,e,r={})=>(d(e),!(!r.nocomment&&"#"===e.charAt(0))&&new m(e,r).match(t));R=t;const e=P();t.sep=e.sep;const r=Symbol("globstar **");t.GLOBSTAR=r;const n=N(),i={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},s="[^/]",o=s+"*?",a=t=>t.split("").reduce((t,e)=>(t[e]=!0,t),{}),u=a("().*{}+?[]^$\\!"),c=a("[.("),l=/\/+/;t.filter=(e,r={})=>(n,i,s)=>t(n,e,r);const h=(t,e={})=>{const r={};return Object.keys(t).forEach(e=>r[e]=t[e]),Object.keys(e).forEach(t=>r[t]=e[t]),r};t.defaults=e=>{if(!e||"object"!=typeof e||!Object.keys(e).length)return t;const r=t,n=(t,n,i)=>r(t,n,h(e,i));return(n.Minimatch=class extends r.Minimatch{constructor(t,r){super(t,h(e,r))}}).defaults=t=>r.defaults(h(e,t)).Minimatch,n.filter=(t,n)=>r.filter(t,h(e,n)),n.defaults=t=>r.defaults(h(e,t)),n.makeRe=(t,n)=>r.makeRe(t,h(e,n)),n.braceExpand=(t,n)=>r.braceExpand(t,h(e,n)),n.match=(t,n,i)=>r.match(t,n,h(e,i)),n},t.braceExpand=(t,e)=>f(t,e);const f=(t,e={})=>(d(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:n(t)),d=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},p=Symbol("subparse");t.makeRe=(t,e)=>new m(t,e||{}).makeRe(),t.match=(t,e,r={})=>{const n=new m(e,r);return t=t.filter(t=>n.match(t)),n.options.nonull&&!t.length&&t.push(e),t};const g=t=>t.replace(/\\([^-\]])/g,"$1"),y=t=>t.replace(/[[\]\\]/g,"\\$&");class m{constructor(t,e){d(t),e||(e={}),this.options=e,this.maxGlobstarRecursion=void 0!==e.maxGlobstarRecursion?e.maxGlobstarRecursion:200,this.set=[],this.pattern=t,this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.make()}debug(){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate();let r=this.globSet=this.braceExpand();e.debug&&(this.debug=(...t)=>console.error(...t)),this.debug(this.pattern,r),r=this.globParts=r.map(t=>t.split(l)),this.debug(this.pattern,r),r=r.map((t,e,r)=>t.map(this.parse,this)),this.debug(this.pattern,r),r=r.filter(t=>-1===t.indexOf(!1)),this.debug(this.pattern,r),this.set=r}parseNegate(){if(this.options.nonegate)return;const t=this.pattern;let e=!1,r=0;for(let n=0;n<t.length&&"!"===t.charAt(n);n++)e=!e,r++;r&&(this.pattern=t.slice(r)),this.negate=e}matchOne(t,e,n){return-1!==e.indexOf(r)?this._matchGlobstar(t,e,n,0,0):this._matchOne(t,e,n,0,0)}_matchGlobstar(t,e,n,i,s){let o=-1;for(let t=s;t<e.length;t++)if(e[t]===r){o=t;break}let a=-1;for(let t=e.length-1;t>=0;t--)if(e[t]===r){a=t;break}const u=e.slice(s,o),c=e.slice(o+1,a),l=e.slice(a+1);if(u.length){const e=t.slice(i,i+u.length);if(!this._matchOne(e,u,n,0,0))return!1;i+=u.length}let h=0;if(l.length){if(l.length+i>t.length)return!1;const e=t.length-l.length;if(this._matchOne(t,l,n,e,0))h=l.length;else{if(""!==t[t.length-1]||i+l.length===t.length)return!1;if(!this._matchOne(t,l,n,e-1,0))return!1;h=l.length+1}}if(!c.length){let e=!!h;for(let r=i;r<t.length-h;r++){const n=String(t[r]);if(e=!0,"."===n||".."===n||!this.options.dot&&"."===n.charAt(0))return!1}return e}const f=[[[],0]];let d=f[0],p=0;const g=[0];for(const t of c)t===r?(g.push(p),d=[[],0],f.push(d)):(d[0].push(t),p++);let y=f.length-1;const m=t.length-h;for(const t of f)t[1]=m-(g[y--]+t[0].length);return!!this._matchGlobStarBodySections(t,f,i,0,n,0,!!h)}_matchGlobStarBodySections(t,e,r,n,i,s,o){const a=e[n];if(!a){for(let e=r;e<t.length;e++){o=!0;const r=t[e];if("."===r||".."===r||!this.options.dot&&"."===r.charAt(0))return!1}return o}const[u,c]=a;for(;r<=c;){if(this._matchOne(t.slice(0,r+u.length),u,i,r,0)&&s<this.maxGlobstarRecursion){const a=this._matchGlobStarBodySections(t,e,r+u.length,n+1,i,s+1,o);if(!1!==a)return a}const a=t[r];if("."===a||".."===a||!this.options.dot&&"."===a.charAt(0))return!1;r++}return null}_matchOne(t,e,n,i,s){let o,a,u,c;for(o=i,a=s,u=t.length,c=e.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");const n=e[a],i=t[o];if(this.debug(e,n,i),!1===n||n===r)return!1;let s;if("string"==typeof n?(s=i===n,this.debug("string match",n,i,s)):(s=i.match(n),this.debug("pattern match",n,i,s)),!s)return!1}if(o===u&&a===c)return!0;if(o===u)return n;if(a===c)return o===u-1&&""===t[o];throw new Error("wtf?")}braceExpand(){return f(this.pattern,this.options)}parse(t,e){d(t);const n=this.options;if("**"===t){if(!n.noglobstar)return r;t="*"}if(""===t)return"";let a="",l=!1,h=!1;const f=[],m=[];let b,_,v,w,S=!1,E=-1,k=-1,x="."===t.charAt(0),O=n.dot||x;const T=t=>"."===t.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",R=()=>{if(b){switch(b){case"*":a+=o,l=!0;break;case"?":a+=s,l=!0;break;default:a+="\\"+b}this.debug("clearStateChar %j %j",b,a),b=!1}};for(let e,r=0;r<t.length&&(e=t.charAt(r));r++)if(this.debug("%s\t%s %s %j",t,r,a,e),h){if("/"===e)return!1;u[e]&&(a+="\\"),a+=e,h=!1}else switch(e){case"/":return!1;case"\\":if(S&&"-"===t.charAt(r+1)){a+=e;continue}R(),h=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s\t%s %s %j <-- stateChar",t,r,a,e),S){this.debug(" in class"),"!"===e&&r===k+1&&(e="^"),a+=e;continue}if("*"===e&&"*"===b)continue;this.debug("call clearStateChar %j",b),R(),b=e,n.noext&&R();continue;case"(":{if(S){a+="(";continue}if(!b){a+="\\(";continue}const e={type:b,start:r-1,reStart:a.length,open:i[b].open,close:i[b].close};this.debug(this.pattern,"\t",e),f.push(e),a+=e.open,0===e.start&&"!"!==e.type&&(x=!0,a+=T(t.slice(r+1))),this.debug("plType %j %j",b,a),b=!1;continue}case")":{const t=f[f.length-1];if(S||!t){a+="\\)";continue}f.pop(),R(),l=!0,v=t,a+=v.close,"!"===v.type&&m.push(Object.assign(v,{reEnd:a.length}));continue}case"|":{const e=f[f.length-1];if(S||!e){a+="\\|";continue}R(),a+="|",0===e.start&&"!"!==e.type&&(x=!0,a+=T(t.slice(r+1)));continue}case"[":if(R(),S){a+="\\"+e;continue}S=!0,k=r,E=a.length,a+=e;continue;case"]":if(r===k+1||!S){a+="\\"+e;continue}_=t.substring(k+1,r);try{RegExp("["+y(g(_))+"]"),a+=e}catch(t){a=a.substring(0,E)+"(?:$.)"}l=!0,S=!1;continue;default:R(),!u[e]||"^"===e&&S||(a+="\\"),a+=e}for(S&&(_=t.slice(k+1),w=this.parse(_,p),a=a.substring(0,E)+"\\["+w[0],l=l||w[1]),v=f.pop();v;v=f.pop()){let t;t=a.slice(v.reStart+v.open.length),this.debug("setting tail",a,v),t=t.replace(/((?:\\{2}){0,64})(\\?)\|/g,(t,e,r)=>(r||(r="\\"),e+e+r+"|")),this.debug("tail=%j\n %s",t,t,v,a);const e="*"===v.type?o:"?"===v.type?s:"\\"+v.type;l=!0,a=a.slice(0,v.reStart)+e+"\\("+t}R(),h&&(a+="\\\\");const I=c[a.charAt(0)];for(let t=m.length-1;t>-1;t--){const r=m[t],n=a.slice(0,r.reStart),i=a.slice(r.reStart,r.reEnd-8);let s=a.slice(r.reEnd);const o=a.slice(r.reEnd-8,r.reEnd)+s,u=n.split(")").length,c=n.split("(").length-u;let l=s;for(let t=0;t<c;t++)l=l.replace(/\)[+*?]?/,"");s=l;a=n+i+s+(""===s&&e!==p?"(?:$|\\/)":"")+o}if(""!==a&&l&&(a="(?=.)"+a),I&&(a=(x?"":O?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)")+a),e===p)return[a,l];if(n.nocase&&!l&&(l=t.toUpperCase()!==t.toLowerCase()),!l)return t.replace(/\\(.)/g,"$1");const j=n.nocase?"i":"";try{return Object.assign(new RegExp("^"+a+"$",j),{_glob:t,_src:a})}catch(t){return new RegExp("$.")}}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,n=e.noglobstar?o:e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=e.nocase?"i":"";let s=t.map(t=>(t=t.map(t=>"string"==typeof t?t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):t===r?r:t._src).reduce((t,e)=>(t[t.length-1]===r&&e===r||t.push(e),t),[]),t.forEach((e,i)=>{e===r&&t[i-1]!==r&&(0===i?t.length>1?t[i+1]="(?:\\/|"+n+"\\/)?"+t[i+1]:t[i]=n:i===t.length-1?t[i-1]+="(?:\\/|"+n+")?":(t[i-1]+="(?:\\/|\\/"+n+"\\/)"+t[i+1],t[i+1]=r))}),t.filter(t=>t!==r).join("/"))).join("|");s="^(?:"+s+")$",this.negate&&(s="^(?!"+s+").*$");try{this.regexp=new RegExp(s,i)}catch(t){this.regexp=!1}return this.regexp}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&r)return!0;const n=this.options;"/"!==e.sep&&(t=t.split(e.sep).join("/")),t=t.split(l),this.debug(this.pattern,"split",t);const i=this.set;let s;this.debug(this.pattern,"set",i);for(let e=t.length-1;e>=0&&(s=t[e],!s);e--);for(let e=0;e<i.length;e++){const o=i[e];let a=t;n.matchBase&&1===o.length&&(a=[s]);if(this.matchOne(a,o,r))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return t.defaults(e).Minimatch}}return t.Minimatch=m,R}function B(){if(L)return j;L=1,j=a;const t=h,{EventEmitter:e}=f,{Minimatch:r}=C(),{resolve:n}=d;function i(e,r){return new Promise((n,s)=>{(r?t.stat:t.lstat)(e,(t,s)=>{if(t)if("ENOENT"===t.code)n(r?i(e,!1):null);else n(null);else n(s)})})}async function*s(e,r,n,o,a,u){let c=await function(e,r){return new Promise((n,i)=>{t.readdir(e,{withFileTypes:!0},(t,e)=>{if(t)switch(t.code){case"ENOTDIR":r?i(t):n([]);break;case"ENOTSUP":case"ENOENT":case"ENAMETOOLONG":case"UNKNOWN":n([]);break;default:i(t)}else n(e)})})}(r+e,u);for(const t of c){let u=t.name;void 0===u&&(u=t,o=!0);const c=e+"/"+u,l=c.slice(1),h=r+"/"+l;let f=null;(o||n)&&(f=await i(h,n)),f||void 0===t.name||(f=t),null===f&&(f={isDirectory:()=>!1}),f.isDirectory()?a(l)||(yield{relative:l,absolute:h,stats:f},yield*s(c,r,n,o,a,!1)):yield{relative:l,absolute:h,stats:f}}}class o extends e{constructor(t,e,i){if(super(),"function"==typeof e&&(i=e,e=null),this.options=function(t){return{pattern:t.pattern,dot:!!t.dot,noglobstar:!!t.noglobstar,matchBase:!!t.matchBase,nocase:!!t.nocase,ignore:t.ignore,skip:t.skip,follow:!!t.follow,stat:!!t.stat,nodir:!!t.nodir,mark:!!t.mark,silent:!!t.silent,absolute:!!t.absolute}}(e||{}),this.matchers=[],this.options.pattern){const t=Array.isArray(this.options.pattern)?this.options.pattern:[this.options.pattern];this.matchers=t.map(t=>new r(t,{dot:this.options.dot,noglobstar:this.options.noglobstar,matchBase:this.options.matchBase,nocase:this.options.nocase}))}if(this.ignoreMatchers=[],this.options.ignore){const t=Array.isArray(this.options.ignore)?this.options.ignore:[this.options.ignore];this.ignoreMatchers=t.map(t=>new r(t,{dot:!0}))}if(this.skipMatchers=[],this.options.skip){const t=Array.isArray(this.options.skip)?this.options.skip:[this.options.skip];this.skipMatchers=t.map(t=>new r(t,{dot:!0}))}this.iterator=async function*(t,e,r,n){yield*s("",t,e,r,n,!0)}(n(t||"."),this.options.follow,this.options.stat,this._shouldSkipDirectory.bind(this)),this.paused=!1,this.inactive=!1,this.aborted=!1,i&&(this._matches=[],this.on("match",t=>this._matches.push(this.options.absolute?t.absolute:t.relative)),this.on("error",t=>i(t)),this.on("end",()=>i(null,this._matches))),setTimeout(()=>this._next(),0)}_shouldSkipDirectory(t){return this.skipMatchers.some(e=>e.match(t))}_fileMatches(t,e){const r=t+(e?"/":"");return(0===this.matchers.length||this.matchers.some(t=>t.match(r)))&&!this.ignoreMatchers.some(t=>t.match(r))&&(!this.options.nodir||!e)}_next(){this.paused||this.aborted?this.inactive=!0:this.iterator.next().then(t=>{if(t.done)this.emit("end");else{const e=t.value.stats.isDirectory();if(this._fileMatches(t.value.relative,e)){let r=t.value.relative,n=t.value.absolute;this.options.mark&&e&&(r+="/",n+="/"),this.options.stat?this.emit("match",{relative:r,absolute:n,stat:t.value.stats}):this.emit("match",{relative:r,absolute:n})}this._next(this.iterator)}}).catch(t=>{this.abort(),this.emit("error",t),t.code||this.options.silent||console.error(t)})}abort(){this.aborted=!0}pause(){this.paused=!0}resume(){this.paused=!1,this.inactive&&(this.inactive=!1,this._next())}}function a(t,e,r){return new o(t,e,r)}return a.ReaddirGlob=o,j}function F(t,...e){return(...r)=>t(...e,...r)}function z(t){return function(...e){var r=e.pop();return t.call(this,e,r)}}var U="function"==typeof queueMicrotask&&queueMicrotask,W="function"==typeof setImmediate&&setImmediate,G="object"==typeof process&&"function"==typeof process.nextTick;function q(t){setTimeout(t,0)}function $(t){return(e,...r)=>t(()=>e(...r))}var H=$(U?queueMicrotask:W?setImmediate:G?process.nextTick:q);function Z(t){return Y(t)?function(...e){const r=e.pop();return V(t.apply(this,e),r)}:z(function(e,r){var n;try{n=t.apply(this,e)}catch(t){return r(t)}if(n&&"function"==typeof n.then)return V(n,r);r(null,n)})}function V(t,e){return t.then(t=>{Q(e,null,t)},t=>{Q(e,t&&(t instanceof Error||t.message)?t:new Error(t))})}function Q(t,e,r){try{t(e,r)}catch(t){H(t=>{throw t},t)}}function Y(t){return"AsyncFunction"===t[Symbol.toStringTag]}function K(t){if("function"!=typeof t)throw new Error("expected a function");return Y(t)?Z(t):t}function J(t,e){if(e||(e=t.length),!e)throw new Error("arity is undefined");return function(...r){return"function"==typeof r[e-1]?t.apply(this,r):new Promise((n,i)=>{r[e-1]=(t,...e)=>{if(t)return i(t);n(e.length>1?e:e[0])},t.apply(this,r)})}}function X(t){return function(e,...r){return J(function(n){var i=this;return t(e,(t,e)=>{K(t).apply(i,r.concat(e))},n)})}}function tt(t,e,r,n){e=e||[];var i=[],s=0,o=K(r);return t(e,(t,e,r)=>{var n=s++;o(t,(t,e)=>{i[n]=e,r(t)})},t=>{n(t,i)})}function et(t){return t&&"number"==typeof t.length&&t.length>=0&&t.length%1==0}const rt={};function nt(t){function e(...e){if(null!==t){var r=t;t=null,r.apply(this,e)}}return Object.assign(e,t),e}function it(t){if(et(t))return function(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}(t);var e,r,n,i,s=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()}(t);return s?function(t){var e=-1;return function(){var r=t.next();return r.done?null:(e++,{value:r.value,key:e})}}(s):(r=(e=t)?Object.keys(e):[],n=-1,i=r.length,function t(){var s=r[++n];return"__proto__"===s?t():n<i?{value:e[s],key:s}:null})}function st(t){return function(...e){if(null===t)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}}function ot(t,e,r,n){let i=!1,s=!1,o=!1,a=0,u=0;function c(){a>=e||o||i||(o=!0,t.next().then(({value:t,done:e})=>{if(!s&&!i){if(o=!1,e)return i=!0,void(a<=0&&n(null));a++,r(t,u,l),u++,c()}}).catch(h))}function l(t,e){if(a-=1,!s)return t?h(t):!1===t?(i=!0,void(s=!0)):e===rt||i&&a<=0?(i=!0,n(null)):void c()}function h(t){s||(o=!1,i=!0,n(t))}c()}var at=t=>(e,r,n)=>{if(n=nt(n),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return n(null);if("AsyncGenerator"===e[Symbol.toStringTag])return ot(e,t,r,n);if(function(t){return"function"==typeof t[Symbol.asyncIterator]}(e))return ot(e[Symbol.asyncIterator](),t,r,n);var i=it(e),s=!1,o=!1,a=0,u=!1;function c(t,e){if(!o)if(a-=1,t)s=!0,n(t);else if(!1===t)s=!0,o=!0;else{if(e===rt||s&&a<=0)return s=!0,n(null);u||l()}}function l(){for(u=!0;a<t&&!s;){var e=i();if(null===e)return s=!0,void(a<=0&&n(null));a+=1,r(e.value,e.key,st(c))}u=!1}l()};var ut=J(function(t,e,r,n){return at(e)(t,K(r),n)},4);function ct(t,e,r){r=nt(r);var n=0,i=0,{length:s}=t,o=!1;function a(t,e){!1===t&&(o=!0),!0!==o&&(t?r(t):++i!==s&&e!==rt||r(null))}for(0===s&&r(null);n<s;n++)e(t[n],n,st(a))}function lt(t,e,r){return ut(t,1/0,e,r)}var ht=J(function(t,e,r){return(et(t)?ct:lt)(t,K(e),r)},3);var ft=J(function(t,e,r){return tt(ht,t,e,r)},3),dt=X(ft);var pt=J(function(t,e,r){return ut(t,1,e,r)},3);var gt=J(function(t,e,r){return tt(pt,t,e,r)},3),yt=X(gt);const mt=Symbol("promiseCallback");function bt(){let t,e;function r(r,...n){if(r)return e(r);t(n.length>1?n:n[0])}return r[mt]=new Promise((r,n)=>{t=r,e=n}),r}function _t(t,e,r){"number"!=typeof e&&(r=e,e=null),r=nt(r||bt());var n=Object.keys(t).length;if(!n)return r(null);e||(e=n);var i={},s=0,o=!1,a=!1,u=Object.create(null),c=[],l=[],h={};function f(t,e){c.push(()=>function(t,e){if(a)return;var n=st((e,...n)=>{if(s--,!1!==e)if(n.length<2&&([n]=n),e){var c={};if(Object.keys(i).forEach(t=>{c[t]=i[t]}),c[t]=n,a=!0,u=Object.create(null),o)return;r(e,c)}else i[t]=n,(u[t]||[]).forEach(t=>t()),d();else o=!0});s++;var c=K(e[e.length-1]);e.length>1?c(i,n):c(n)}(t,e))}function d(){if(!o){if(0===c.length&&0===s)return r(null,i);for(;c.length&&s<e;){c.shift()()}}}function p(e){var r=[];return Object.keys(t).forEach(n=>{const i=t[n];Array.isArray(i)&&i.indexOf(e)>=0&&r.push(n)}),r}return Object.keys(t).forEach(e=>{var r=t[e];if(!Array.isArray(r))return f(e,[r]),void l.push(e);var n=r.slice(0,r.length-1),i=n.length;if(0===i)return f(e,r),void l.push(e);h[e]=i,n.forEach(s=>{if(!t[s])throw new Error("async.auto task `"+e+"` has a non-existent dependency `"+s+"` in "+n.join(", "));!function(t,e){var r=u[t];r||(r=u[t]=[]);r.push(e)}(s,()=>{0===--i&&f(e,r)})})}),function(){var t=0;for(;l.length;)t++,p(l.pop()).forEach(t=>{0===--h[t]&&l.push(t)});if(t!==n)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),d(),r[mt]}var vt=/^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/,wt=/^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/,St=/,/,Et=/(=.+)?(\s*)$/;function kt(t,e){var r={};return Object.keys(t).forEach(e=>{var n,i=t[e],s=Y(i),o=!s&&1===i.length||s&&0===i.length;if(Array.isArray(i))n=[...i],i=n.pop(),r[e]=n.concat(n.length>0?a:i);else if(o)r[e]=i;else{if(n=function(t){const e=function(t){let e="",r=0,n=t.indexOf("*/");for(;r<t.length;)if("/"===t[r]&&"/"===t[r+1]){let e=t.indexOf("\n",r);r=-1===e?t.length:e}else if(-1!==n&&"/"===t[r]&&"*"===t[r+1]){let i=t.indexOf("*/",r);-1!==i?(r=i+2,n=t.indexOf("*/",r)):(e+=t[r],r++)}else e+=t[r],r++;return e}(t.toString());let r=e.match(vt);if(r||(r=e.match(wt)),!r)throw new Error("could not parse args in autoInject\nSource:\n"+e);let[,n]=r;return n.replace(/\s/g,"").split(St).map(t=>t.replace(Et,"").trim())}(i),0===i.length&&!s&&0===n.length)throw new Error("autoInject task functions require explicit parameters.");s||n.pop(),r[e]=n.concat(a)}function a(t,e){var r=n.map(e=>t[e]);r.push(e),K(i)(...r)}}),_t(r,e)}class xt{constructor(){this.head=this.tail=null,this.length=0}removeLink(t){return t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev,t.prev=t.next=null,this.length-=1,t}empty(){for(;this.head;)this.shift();return this}insertAfter(t,e){e.prev=t,e.next=t.next,t.next?t.next.prev=e:this.tail=e,t.next=e,this.length+=1}insertBefore(t,e){e.prev=t.prev,e.next=t,t.prev?t.prev.next=e:this.head=e,t.prev=e,this.length+=1}unshift(t){this.head?this.insertBefore(this.head,t):Ot(this,t)}push(t){this.tail?this.insertAfter(this.tail,t):Ot(this,t)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var t=this.head;t;)yield t.data,t=t.next}remove(t){for(var e=this.head;e;){var{next:r}=e;t(e)&&this.removeLink(e),e=r}return this}}function Ot(t,e){t.length=1,t.head=t.tail=e}function Tt(t,e,r){if(null==e)e=1;else if(0===e)throw new RangeError("Concurrency must not be zero");var n=K(t),i=0,s=[];const o={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function a(t,e){return t?e?void(o[t]=o[t].filter(t=>t!==e)):o[t]=[]:Object.keys(o).forEach(t=>o[t]=[])}function u(t,...e){o[t].forEach(t=>t(...e))}var c=!1;function l(t,e,r,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");var i,s;function o(t,...e){return t?r?s(t):i():e.length<=1?i(e[0]):void i(e)}g.started=!0;var a=g._createTaskItem(t,r?o:n||o);if(e?g._tasks.unshift(a):g._tasks.push(a),c||(c=!0,H(()=>{c=!1,g.process()})),r||!n)return new Promise((t,e)=>{i=t,s=e})}function h(t){return function(e,...r){i-=1;for(var n=0,o=t.length;n<o;n++){var a=t[n],c=s.indexOf(a);0===c?s.shift():c>0&&s.splice(c,1),a.callback(e,...r),null!=e&&u("error",e,a.data)}i<=g.concurrency-g.buffer&&u("unsaturated"),g.idle()&&u("drain"),g.process()}}function f(t){return!(0!==t.length||!g.idle())&&(H(()=>u("drain")),!0)}const d=t=>e=>{if(!e)return new Promise((e,r)=>{!function(t,e){const r=(...n)=>{a(t,r),e(...n)};o[t].push(r)}(t,(t,n)=>{if(t)return r(t);e(n)})});a(t),function(t,e){o[t].push(e)}(t,e)};var p=!1,g={_tasks:new xt,_createTaskItem:(t,e)=>({data:t,callback:e}),*[Symbol.iterator](){yield*g._tasks[Symbol.iterator]()},concurrency:e,payload:r,buffer:e/4,started:!1,paused:!1,push(t,e){if(Array.isArray(t)){if(f(t))return;return t.map(t=>l(t,!1,!1,e))}return l(t,!1,!1,e)},pushAsync(t,e){if(Array.isArray(t)){if(f(t))return;return t.map(t=>l(t,!1,!0,e))}return l(t,!1,!0,e)},kill(){a(),g._tasks.empty()},unshift(t,e){if(Array.isArray(t)){if(f(t))return;return t.map(t=>l(t,!0,!1,e))}return l(t,!0,!1,e)},unshiftAsync(t,e){if(Array.isArray(t)){if(f(t))return;return t.map(t=>l(t,!0,!0,e))}return l(t,!0,!0,e)},remove(t){g._tasks.remove(t)},process(){if(!p){for(p=!0;!g.paused&&i<g.concurrency&&g._tasks.length;){var t=[],e=[],r=g._tasks.length;g.payload&&(r=Math.min(r,g.payload));for(var o=0;o<r;o++){var a=g._tasks.shift();t.push(a),s.push(a),e.push(a.data)}i+=1,0===g._tasks.length&&u("empty"),i===g.concurrency&&u("saturated");var c=st(h(t));n(e,c)}p=!1}},length:()=>g._tasks.length,running:()=>i,workersList:()=>s,idle:()=>g._tasks.length+i===0,pause(){g.paused=!0},resume(){!1!==g.paused&&(g.paused=!1,H(g.process))}};return Object.defineProperties(g,{saturated:{writable:!1,value:d("saturated")},unsaturated:{writable:!1,value:d("unsaturated")},empty:{writable:!1,value:d("empty")},drain:{writable:!1,value:d("drain")},error:{writable:!1,value:d("error")}}),g}function Rt(t,e){return Tt(t,1,e)}function It(t,e,r){return Tt(t,e,r)}var jt=J(function(t,e,r,n){n=nt(n);var i=K(r);return pt(t,(t,r,n)=>{i(e,t,(t,r)=>{e=r,n(t)})},t=>n(t,e))},4);function Lt(...t){var e=t.map(K);return function(...t){var r=this,n=t[t.length-1];return"function"==typeof n?t.pop():n=bt(),jt(e,t,(t,e,n)=>{e.apply(r,t.concat((t,...e)=>{n(t,e)}))},(t,e)=>n(t,...e)),n[mt]}}function At(...t){return Lt(...t.reverse())}var Mt=J(function(t,e,r,n){return tt(at(e),t,r,n)},4);var Dt=J(function(t,e,r,n){var i=K(r);return Mt(t,e,(t,e)=>{i(t,(t,...r)=>t?e(t):e(t,r))},(t,e)=>{for(var r=[],i=0;i<e.length;i++)e[i]&&(r=r.concat(...e[i]));return n(t,r)})},4);var Pt=J(function(t,e,r){return Dt(t,1/0,e,r)},3);var Nt=J(function(t,e,r){return Dt(t,1,e,r)},3);function Ct(...t){return function(...e){return e.pop()(null,...t)}}function Bt(t,e){return(r,n,i,s)=>{var o,a=!1;const u=K(i);r(n,(r,n,i)=>{u(r,(n,s)=>n||!1===n?i(n):t(s)&&!o?(a=!0,o=e(!0,r),i(null,rt)):void i())},t=>{if(t)return s(t);s(null,a?o:e(!1))})}}var Ft=J(function(t,e,r){return Bt(t=>t,(t,e)=>e)(ht,t,e,r)},3);var zt=J(function(t,e,r,n){return Bt(t=>t,(t,e)=>e)(at(e),t,r,n)},4);var Ut=J(function(t,e,r){return Bt(t=>t,(t,e)=>e)(at(1),t,e,r)},3);function Wt(t){return(e,...r)=>K(e)(...r,(e,...r)=>{"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&r.forEach(e=>console[t](e)))})}var Gt=Wt("dir");var qt=J(function(t,e,r){r=st(r);var n,i=K(t),s=K(e);function o(t,...e){if(t)return r(t);!1!==t&&(n=e,s(...e,a))}function a(t,e){return t?r(t):!1!==t?e?void i(o):r(null,...n):void 0}return a(null,!0)},3);function $t(t,e,r){const n=K(e);return qt(t,(...t)=>{const e=t.pop();n(...t,(t,r)=>e(t,!r))},r)}function Ht(t){return(e,r,n)=>t(e,n)}var Zt=J(function(t,e,r){return ht(t,Ht(K(e)),r)},3);var Vt=J(function(t,e,r,n){return at(e)(t,Ht(K(r)),n)},4);var Qt=J(function(t,e,r){return Vt(t,1,e,r)},3);function Yt(t){return Y(t)?t:function(...e){var r=e.pop(),n=!0;e.push((...t)=>{n?H(()=>r(...t)):r(...t)}),t.apply(this,e),n=!1}}var Kt=J(function(t,e,r){return Bt(t=>!t,t=>!t)(ht,t,e,r)},3);var Jt=J(function(t,e,r,n){return Bt(t=>!t,t=>!t)(at(e),t,r,n)},4);var Xt=J(function(t,e,r){return Bt(t=>!t,t=>!t)(pt,t,e,r)},3);function te(t,e,r,n){var i=new Array(e.length);t(e,(t,e,n)=>{r(t,(t,r)=>{i[e]=!!r,n(t)})},t=>{if(t)return n(t);for(var r=[],s=0;s<e.length;s++)i[s]&&r.push(e[s]);n(null,r)})}function ee(t,e,r,n){var i=[];t(e,(t,e,n)=>{r(t,(r,s)=>{if(r)return n(r);s&&i.push({index:e,value:t}),n(r)})},t=>{if(t)return n(t);n(null,i.sort((t,e)=>t.index-e.index).map(t=>t.value))})}function re(t,e,r,n){return(et(e)?te:ee)(t,e,K(r),n)}var ne=J(function(t,e,r){return re(ht,t,e,r)},3);var ie=J(function(t,e,r,n){return re(at(e),t,r,n)},4);var se=J(function(t,e,r){return re(pt,t,e,r)},3);var oe=J(function(t,e){var r=st(e),n=K(Yt(t));return function t(e){if(e)return r(e);!1!==e&&n(t)}()},2);var ae=J(function(t,e,r,n){var i=K(r);return Mt(t,e,(t,e)=>{i(t,(r,n)=>r?e(r):e(r,{key:n,val:t}))},(t,e)=>{for(var r={},{hasOwnProperty:i}=Object.prototype,s=0;s<e.length;s++)if(e[s]){var{key:o}=e[s],{val:a}=e[s];i.call(r,o)?r[o].push(a):r[o]=[a]}return n(t,r)})},4);function ue(t,e,r){return ae(t,1/0,e,r)}function ce(t,e,r){return ae(t,1,e,r)}var le=Wt("log");var he=J(function(t,e,r,n){n=nt(n);var i={},s=K(r);return at(e)(t,(t,e,r)=>{s(t,e,(t,n)=>{if(t)return r(t);i[e]=n,r(t)})},t=>n(t,i))},4);function fe(t,e,r){return he(t,1/0,e,r)}function de(t,e,r){return he(t,1,e,r)}function pe(t,e=t=>t){var r=Object.create(null),n=Object.create(null),i=K(t),s=z((t,s)=>{var o=e(...t);o in r?H(()=>s(null,...r[o])):o in n?n[o].push(s):(n[o]=[s],i(...t,(t,...e)=>{t||(r[o]=e);var i=n[o];delete n[o];for(var s=0,a=i.length;s<a;s++)i[s](t,...e)}))});return s.memo=r,s.unmemoized=t,s}var ge=$(G?process.nextTick:W?setImmediate:q),ye=J((t,e,r)=>{var n=et(e)?[]:{};t(e,(t,e,r)=>{K(t)((t,...i)=>{i.length<2&&([i]=i),n[e]=i,r(t)})},t=>r(t,n))},3);function me(t,e){return ye(ht,t,e)}function be(t,e,r){return ye(at(e),t,r)}function _e(t,e){var r=K(t);return Tt((t,e)=>{r(t[0],e)},e,1)}class ve{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(t){let e;for(;t>0&&Ee(this.heap[t],this.heap[e=Se(t)]);){let r=this.heap[t];this.heap[t]=this.heap[e],this.heap[e]=r,t=e}}percDown(t){let e;for(;(e=we(t))<this.heap.length&&(e+1<this.heap.length&&Ee(this.heap[e+1],this.heap[e])&&(e+=1),!Ee(this.heap[t],this.heap[e]));){let r=this.heap[t];this.heap[t]=this.heap[e],this.heap[e]=r,t=e}}push(t){t.pushCount=++this.pushCount,this.heap.push(t),this.percUp(this.heap.length-1)}unshift(t){return this.heap.push(t)}shift(){let[t]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),t}toArray(){return[...this]}*[Symbol.iterator](){for(let t=0;t<this.heap.length;t++)yield this.heap[t].data}remove(t){let e=0;for(let r=0;r<this.heap.length;r++)t(this.heap[r])||(this.heap[e]=this.heap[r],e++);this.heap.splice(e);for(let t=Se(this.heap.length-1);t>=0;t--)this.percDown(t);return this}}function we(t){return 1+(t<<1)}function Se(t){return(t+1>>1)-1}function Ee(t,e){return t.priority!==e.priority?t.priority<e.priority:t.pushCount<e.pushCount}function ke(t,e){var r=_e(t,e),{push:n,pushAsync:i}=r;function s(t,e){return Array.isArray(t)?t.map(t=>({data:t,priority:e})):{data:t,priority:e}}return r._tasks=new ve,r._createTaskItem=({data:t,priority:e},r)=>({data:t,priority:e,callback:r}),r.push=function(t,e=0,r){return n(s(t,e),r)},r.pushAsync=function(t,e=0,r){return i(s(t,e),r)},delete r.unshift,delete r.unshiftAsync,r}var xe=J(function(t,e){if(e=nt(e),!Array.isArray(t))return e(new TypeError("First argument to race must be an array of functions"));if(!t.length)return e();for(var r=0,n=t.length;r<n;r++)K(t[r])(e)},2);function Oe(t,e,r,n){var i=[...t].reverse();return jt(i,e,r,n)}function Te(t){var e=K(t);return z(function(t,r){return t.push((t,...e)=>{let n={};if(t&&(n.error=t),e.length>0){var i=e;e.length<=1&&([i]=e),n.value=i}r(null,n)}),e.apply(this,t)})}function Re(t){var e;return Array.isArray(t)?e=t.map(Te):(e={},Object.keys(t).forEach(r=>{e[r]=Te.call(this,t[r])})),e}function Ie(t,e,r,n){const i=K(r);return re(t,e,(t,e)=>{i(t,(t,r)=>{e(t,!r)})},n)}var je=J(function(t,e,r){return Ie(ht,t,e,r)},3);var Le=J(function(t,e,r,n){return Ie(at(e),t,r,n)},4);var Ae=J(function(t,e,r){return Ie(pt,t,e,r)},3);function Me(t){return function(){return t}}function De(t,e,r){var n={times:5,intervalFunc:Me(0)};if(arguments.length<3&&"function"==typeof t?(r=e||bt(),e=t):(!function(t,e){if("object"==typeof e)t.times=+e.times||5,t.intervalFunc="function"==typeof e.interval?e.interval:Me(+e.interval||0),t.errorFilter=e.errorFilter;else{if("number"!=typeof e&&"string"!=typeof e)throw new Error("Invalid arguments for async.retry");t.times=+e||5}}(n,t),r=r||bt()),"function"!=typeof e)throw new Error("Invalid arguments for async.retry");var i=K(e),s=1;return function t(){i((e,...i)=>{!1!==e&&(e&&s++<n.times&&("function"!=typeof n.errorFilter||n.errorFilter(e))?setTimeout(t,n.intervalFunc(s-1)):r(e,...i))})}(),r[mt]}function Pe(t,e){e||(e=t,t=null);let r=t&&t.arity||e.length;Y(e)&&(r+=1);var n=K(e);return z((e,i)=>{function s(t){n(...e,t)}return(e.length<r-1||null==i)&&(e.push(i),i=bt()),t?De(t,s,i):De(s,i),i[mt]})}function Ne(t,e){return ye(pt,t,e)}var Ce=J(function(t,e,r){return Bt(Boolean,t=>t)(ht,t,e,r)},3);var Be=J(function(t,e,r,n){return Bt(Boolean,t=>t)(at(e),t,r,n)},4);var Fe=J(function(t,e,r){return Bt(Boolean,t=>t)(pt,t,e,r)},3);var ze=J(function(t,e,r){var n=K(e);return ft(t,(t,e)=>{n(t,(r,n)=>{if(r)return e(r);e(r,{value:t,criteria:n})})},(t,e)=>{if(t)return r(t);r(null,e.sort(i).map(t=>t.value))});function i(t,e){var r=t.criteria,n=e.criteria;return r<n?-1:r>n?1:0}},3);function Ue(t,e,r){var n=K(t);return z((i,s)=>{var o,a=!1;i.push((...t)=>{a||(s(...t),clearTimeout(o))}),o=setTimeout(function(){var e=t.name||"anonymous",n=new Error('Callback function "'+e+'" timed out.');n.code="ETIMEDOUT",r&&(n.info=r),a=!0,s(n)},e),n(...i)})}function We(t,e,r,n){var i=K(r);return Mt(function(t){for(var e=Array(t);t--;)e[t]=t;return e}(t),e,i,n)}function Ge(t,e,r){return We(t,1/0,e,r)}function qe(t,e,r){return We(t,1,e,r)}function $e(t,e,r,n){arguments.length<=3&&"function"==typeof e&&(n=r,r=e,e=Array.isArray(t)?[]:{}),n=nt(n||bt());var i=K(r);return ht(t,(t,r,n)=>{i(e,t,r,n)},t=>n(t,e)),n[mt]}var He=J(function(t,e){var r,n=null;return Qt(t,(t,e)=>{K(t)((t,...i)=>{if(!1===t)return e(t);i.length<2?[r]=i:r=i,n=t,e(t?null:{})})},()=>e(n,r))});function Ze(t){return(...e)=>(t.unmemoized||t)(...e)}var Ve=J(function(t,e,r){r=st(r);var n=K(e),i=K(t),s=[];function o(t,...e){if(t)return r(t);s=e,!1!==t&&i(a)}function a(t,e){return t?r(t):!1!==t?e?void n(o):r(null,...s):void 0}return i(a)},3);function Qe(t,e,r){const n=K(t);return Ve(t=>n((e,r)=>t(e,!r)),e,r)}var Ye,Ke,Je,Xe,tr,er,rr,nr,ir=J(function(t,e){if(e=nt(e),!Array.isArray(t))return e(new Error("First argument to waterfall must be an array of functions"));if(!t.length)return e();var r=0;function n(e){K(t[r++])(...e,st(i))}function i(i,...s){if(!1!==i)return i||r===t.length?e(i,...s):void n(s)}n([])}),sr={apply:F,applyEach:dt,applyEachSeries:yt,asyncify:Z,auto:_t,autoInject:kt,cargo:Rt,cargoQueue:It,compose:At,concat:Pt,concatLimit:Dt,concatSeries:Nt,constant:Ct,detect:Ft,detectLimit:zt,detectSeries:Ut,dir:Gt,doUntil:$t,doWhilst:qt,each:Zt,eachLimit:Vt,eachOf:ht,eachOfLimit:ut,eachOfSeries:pt,eachSeries:Qt,ensureAsync:Yt,every:Kt,everyLimit:Jt,everySeries:Xt,filter:ne,filterLimit:ie,filterSeries:se,forever:oe,groupBy:ue,groupByLimit:ae,groupBySeries:ce,log:le,map:ft,mapLimit:Mt,mapSeries:gt,mapValues:fe,mapValuesLimit:he,mapValuesSeries:de,memoize:pe,nextTick:ge,parallel:me,parallelLimit:be,priorityQueue:ke,queue:_e,race:xe,reduce:jt,reduceRight:Oe,reflect:Te,reflectAll:Re,reject:je,rejectLimit:Le,rejectSeries:Ae,retry:De,retryable:Pe,seq:Lt,series:Ne,setImmediate:H,some:Ce,someLimit:Be,someSeries:Fe,sortBy:ze,timeout:Ue,times:Ge,timesLimit:We,timesSeries:qe,transform:$e,tryEach:He,unmemoize:Ze,until:Qe,waterfall:ir,whilst:Ve,all:Kt,allLimit:Jt,allSeries:Xt,any:Ce,anyLimit:Be,anySeries:Fe,find:Ft,findLimit:zt,findSeries:Ut,flatMap:Pt,flatMapLimit:Dt,flatMapSeries:Nt,forEach:Zt,forEachSeries:Qt,forEachLimit:Vt,forEachOf:ht,forEachOfSeries:pt,forEachOfLimit:ut,inject:jt,foldl:jt,foldr:Oe,select:ne,selectLimit:ie,selectSeries:se,wrapSync:Z,during:Ve,doDuring:qt},or=D(Object.freeze({__proto__:null,all:Kt,allLimit:Jt,allSeries:Xt,any:Ce,anyLimit:Be,anySeries:Fe,apply:F,applyEach:dt,applyEachSeries:yt,asyncify:Z,auto:_t,autoInject:kt,cargo:Rt,cargoQueue:It,compose:At,concat:Pt,concatLimit:Dt,concatSeries:Nt,constant:Ct,default:sr,detect:Ft,detectLimit:zt,detectSeries:Ut,dir:Gt,doDuring:qt,doUntil:$t,doWhilst:qt,during:Ve,each:Zt,eachLimit:Vt,eachOf:ht,eachOfLimit:ut,eachOfSeries:pt,eachSeries:Qt,ensureAsync:Yt,every:Kt,everyLimit:Jt,everySeries:Xt,filter:ne,filterLimit:ie,filterSeries:se,find:Ft,findLimit:zt,findSeries:Ut,flatMap:Pt,flatMapLimit:Dt,flatMapSeries:Nt,foldl:jt,foldr:Oe,forEach:Zt,forEachLimit:Vt,forEachOf:ht,forEachOfLimit:ut,forEachOfSeries:pt,forEachSeries:Qt,forever:oe,groupBy:ue,groupByLimit:ae,groupBySeries:ce,inject:jt,log:le,map:ft,mapLimit:Mt,mapSeries:gt,mapValues:fe,mapValuesLimit:he,mapValuesSeries:de,memoize:pe,nextTick:ge,parallel:me,parallelLimit:be,priorityQueue:ke,queue:_e,race:xe,reduce:jt,reduceRight:Oe,reflect:Te,reflectAll:Re,reject:je,rejectLimit:Le,rejectSeries:Ae,retry:De,retryable:Pe,select:ne,selectLimit:ie,selectSeries:se,seq:Lt,series:Ne,setImmediate:H,some:Ce,someLimit:Be,someSeries:Fe,sortBy:ze,timeout:Ue,times:Ge,timesLimit:We,timesSeries:qe,transform:$e,tryEach:He,unmemoize:Ze,until:Qe,waterfall:ir,whilst:Ve,wrapSync:Z})),ar={exports:{}};function ur(){if(Ke)return Ye;Ke=1;var t=p,e=process.cwd,r=null,n=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return r||(r=e.call(process)),r};try{process.cwd()}catch(t){}if("function"==typeof process.chdir){var i=process.chdir;process.chdir=function(t){r=null,i.call(process,t)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,i)}return Ye=function(e){t.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(r,n,i){e.open(r,t.O_WRONLY|t.O_SYMLINK,n,function(t,r){t?i&&i(t):e.fchmod(r,n,function(t){e.close(r,function(e){i&&i(t||e)})})})},e.lchmodSync=function(r,n){var i,s=e.openSync(r,t.O_WRONLY|t.O_SYMLINK,n),o=!0;try{i=e.fchmodSync(s,n),o=!1}finally{if(o)try{e.closeSync(s)}catch(t){}else e.closeSync(s)}return i}}(e);e.lutimes||function(e){t.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(r,n,i,s){e.open(r,t.O_SYMLINK,function(t,r){t?s&&s(t):e.futimes(r,n,i,function(t){e.close(r,function(e){s&&s(t||e)})})})},e.lutimesSync=function(r,n,i){var s,o=e.openSync(r,t.O_SYMLINK),a=!0;try{s=e.futimesSync(o,n,i),a=!1}finally{if(a)try{e.closeSync(o)}catch(t){}else e.closeSync(o)}return s}):e.futimes&&(e.lutimes=function(t,e,r,n){n&&process.nextTick(n)},e.lutimesSync=function(){})}(e);e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=r(e.chmod),e.fchmod=r(e.fchmod),e.lchmod=r(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=i(e.chmodSync),e.fchmodSync=i(e.fchmodSync),e.lchmodSync=i(e.lchmodSync),e.stat=a(e.stat),e.fstat=a(e.fstat),e.lstat=a(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(t,e,r){r&&process.nextTick(r)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(t,e,r,n){n&&process.nextTick(n)},e.lchownSync=function(){});"win32"===n&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function r(r,n,i){var s=Date.now(),o=0;t(r,n,function a(u){if(u&&("EACCES"===u.code||"EPERM"===u.code||"EBUSY"===u.code)&&Date.now()-s<6e4)return setTimeout(function(){e.stat(n,function(e,s){e&&"ENOENT"===e.code?t(r,n,a):i(u)})},o),void(o<100&&(o+=10));i&&i(u)})}return Object.setPrototypeOf&&Object.setPrototypeOf(r,t),r}(e.rename));function r(t){return t?function(r,n,i){return t.call(e,r,n,function(t){c(t)&&(t=null),i&&i.apply(this,arguments)})}:t}function i(t){return t?function(r,n){try{return t.call(e,r,n)}catch(t){if(!c(t))throw t}}:t}function s(t){return t?function(r,n,i,s){return t.call(e,r,n,i,function(t){c(t)&&(t=null),s&&s.apply(this,arguments)})}:t}function o(t){return t?function(r,n,i){try{return t.call(e,r,n,i)}catch(t){if(!c(t))throw t}}:t}function a(t){return t?function(r,n,i){function s(t,e){e&&(e.uid<0&&(e.uid+=4294967296),e.gid<0&&(e.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof n&&(i=n,n=null),n?t.call(e,r,n,s):t.call(e,r,s)}:t}function u(t){return t?function(r,n){var i=n?t.call(e,r,n):t.call(e,r);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}:t}function c(t){return!t||("ENOSYS"===t.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==t.code&&"EPERM"!==t.code))}e.read="function"!=typeof e.read?e.read:function(t){function r(r,n,i,s,o,a){var u;if(a&&"function"==typeof a){var c=0;u=function(l,h,f){if(l&&"EAGAIN"===l.code&&c<10)return c++,t.call(e,r,n,i,s,o,u);a.apply(this,arguments)}}return t.call(e,r,n,i,s,o,u)}return Object.setPrototypeOf&&Object.setPrototypeOf(r,t),r}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(l=e.readSync,function(t,r,n,i,s){for(var o=0;;)try{return l.call(e,t,r,n,i,s)}catch(t){if("EAGAIN"===t.code&&o<10){o++;continue}throw t}});var l},Ye}function cr(){if(nr)return rr;nr=1;var t,e,r=h,n=ur(),i=function(){if(Xe)return Je;Xe=1;var t=g.Stream;return Je=function(e){return{ReadStream:function r(n,i){if(!(this instanceof r))return new r(n,i);t.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,i=i||{};for(var o=Object.keys(i),a=0,u=o.length;a<u;a++){var c=o[a];this[c]=i[c]}if(this.encoding&&this.setEncoding(this.encoding),void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}null===this.fd?e.open(this.path,this.flags,this.mode,function(t,e){if(t)return s.emit("error",t),void(s.readable=!1);s.fd=e,s.emit("open",e),s._read()}):process.nextTick(function(){s._read()})},WriteStream:function r(n,i){if(!(this instanceof r))return new r(n,i);t.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,a=s.length;o<a;o++){var u=s[o];this[u]=i[u]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}},Je}(),s=function(){if(er)return tr;er=1,tr=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var r={__proto__:t(e)};else r=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}),r};var t=Object.getPrototypeOf||function(t){return t.__proto__};return tr}(),o=y;function a(e,r){Object.defineProperty(e,t,{get:function(){return r}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(t=Symbol.for("graceful-fs.queue"),e=Symbol.for("graceful-fs.previous")):(t="___graceful-fs.queue",e="___graceful-fs.previous");var u,c=function(){};if(o.debuglog?c=o.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(c=function(){var t=o.format.apply(o,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: "),console.error(t)}),!r[t]){var l=A[t]||[];a(r,l),r.close=function(t){function n(e,n){return t.call(r,e,function(t){t||p(),"function"==typeof n&&n.apply(this,arguments)})}return Object.defineProperty(n,e,{value:t}),n}(r.close),r.closeSync=function(t){function n(e){t.apply(r,arguments),p()}return Object.defineProperty(n,e,{value:t}),n}(r.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){c(r[t]),m.equal(r[t].length,0)})}function f(t){n(t),t.gracefulify=f,t.createReadStream=function(e,r){return new t.ReadStream(e,r)},t.createWriteStream=function(e,r){return new t.WriteStream(e,r)};var e=t.readFile;t.readFile=function(t,r,n){"function"==typeof r&&(n=r,r=null);return function t(r,n,i,s){return e(r,n,function(e){!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?"function"==typeof i&&i.apply(this,arguments):d([t,[r,n,i],e,s||Date.now(),Date.now()])})}(t,r,n)};var r=t.writeFile;t.writeFile=function(t,e,n,i){"function"==typeof n&&(i=n,n=null);return function t(e,n,i,s,o){return r(e,n,i,function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof s&&s.apply(this,arguments):d([t,[e,n,i,s],r,o||Date.now(),Date.now()])})}(t,e,n,i)};var s=t.appendFile;s&&(t.appendFile=function(t,e,r,n){"function"==typeof r&&(n=r,r=null);return function t(e,r,n,i,o){return s(e,r,n,function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):d([t,[e,r,n,i],s,o||Date.now(),Date.now()])})}(t,e,r,n)});var o=t.copyFile;o&&(t.copyFile=function(t,e,r,n){"function"==typeof r&&(n=r,r=0);return function t(e,r,n,i,s){return o(e,r,n,function(o){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof i&&i.apply(this,arguments):d([t,[e,r,n,i],o,s||Date.now(),Date.now()])})}(t,e,r,n)});var a=t.readdir;t.readdir=function(t,e,r){"function"==typeof e&&(r=e,e=null);var n=u.test(process.version)?function(t,e,r,n){return a(t,i(t,e,r,n))}:function(t,e,r,n){return a(t,e,i(t,e,r,n))};return n(t,e,r);function i(t,e,r,i){return function(s,o){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?(o&&o.sort&&o.sort(),"function"==typeof r&&r.call(this,s,o)):d([n,[t,e,r],s,i||Date.now(),Date.now()])}}};var u=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var c=i(t);y=c.ReadStream,m=c.WriteStream}var l=t.ReadStream;l&&(y.prototype=Object.create(l.prototype),y.prototype.open=function(){var t=this;_(t.path,t.flags,t.mode,function(e,r){e?(t.autoClose&&t.destroy(),t.emit("error",e)):(t.fd=r,t.emit("open",r),t.read())})});var h=t.WriteStream;h&&(m.prototype=Object.create(h.prototype),m.prototype.open=function(){var t=this;_(t.path,t.flags,t.mode,function(e,r){e?(t.destroy(),t.emit("error",e)):(t.fd=r,t.emit("open",r))})}),Object.defineProperty(t,"ReadStream",{get:function(){return y},set:function(t){y=t},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return m},set:function(t){m=t},enumerable:!0,configurable:!0});var p=y;Object.defineProperty(t,"FileReadStream",{get:function(){return p},set:function(t){p=t},enumerable:!0,configurable:!0});var g=m;function y(t,e){return this instanceof y?(l.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}function m(t,e){return this instanceof m?(h.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}Object.defineProperty(t,"FileWriteStream",{get:function(){return g},set:function(t){g=t},enumerable:!0,configurable:!0});var b=t.open;function _(t,e,r,n){return"function"==typeof r&&(n=r,r=null),function t(e,r,n,i,s){return b(e,r,n,function(o,a){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof i&&i.apply(this,arguments):d([t,[e,r,n,i],o,s||Date.now(),Date.now()])})}(t,e,r,n)}return t.open=_,t}function d(e){c("ENQUEUE",e[0].name,e[1]),r[t].push(e),b()}function p(){for(var e=Date.now(),n=0;n<r[t].length;++n)r[t][n].length>2&&(r[t][n][3]=e,r[t][n][4]=e);b()}function b(){if(clearTimeout(u),u=void 0,0!==r[t].length){var e=r[t].shift(),n=e[0],i=e[1],s=e[2],o=e[3],a=e[4];if(void 0===o)c("RETRY",n.name,i),n.apply(null,i);else if(Date.now()-o>=6e4){c("TIMEOUT",n.name,i);var l=i.pop();"function"==typeof l&&l.call(null,s)}else{var h=Date.now()-a,f=Math.max(a-o,1);h>=Math.min(1.2*f,100)?(c("RETRY",n.name,i),n.apply(null,i.concat([o]))):r[t].push(e)}void 0===u&&(u=setTimeout(b,0))}}return A[t]||a(A,r[t]),rr=f(s(r)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!r.__patched&&(rr=f(r),r.__patched=!0),rr}var lr,hr,fr,dr,pr,gr={exports:{}},yr={exports:{}};function mr(){if(lr)return yr.exports;return lr=1,"undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?yr.exports={nextTick:function(t,e,r,n){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var i,s,o=arguments.length;switch(o){case 0:case 1:return process.nextTick(t);case 2:return process.nextTick(function(){t.call(null,e)});case 3:return process.nextTick(function(){t.call(null,e,r)});case 4:return process.nextTick(function(){t.call(null,e,r,n)});default:for(i=new Array(o-1),s=0;s<i.length;)i[s++]=arguments[s];return process.nextTick(function(){t.apply(null,i)})}}}:yr.exports=process,yr.exports}function br(){return pr?dr:(pr=1,dr=g)}var _r,vr={exports:{}};function wr(){return _r||(_r=1,function(t,e){var r=b,n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s),i(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}}(vr,vr.exports)),vr.exports}var Sr,Er={};function kr(){if(Sr)return Er;function t(t){return Object.prototype.toString.call(t)}return Sr=1,Er.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},Er.isBoolean=function(t){return"boolean"==typeof t},Er.isNull=function(t){return null===t},Er.isNullOrUndefined=function(t){return null==t},Er.isNumber=function(t){return"number"==typeof t},Er.isString=function(t){return"string"==typeof t},Er.isSymbol=function(t){return"symbol"==typeof t},Er.isUndefined=function(t){return void 0===t},Er.isRegExp=function(e){return"[object RegExp]"===t(e)},Er.isObject=function(t){return"object"==typeof t&&null!==t},Er.isDate=function(e){return"[object Date]"===t(e)},Er.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},Er.isFunction=function(t){return"function"==typeof t},Er.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},Er.isBuffer=b.Buffer.isBuffer,Er}var xr,Or,Tr={exports:{}},Rr={exports:{}};function Ir(){if(Or)return Tr.exports;Or=1;try{var t=require("util");if("function"!=typeof t.inherits)throw"";Tr.exports=t.inherits}catch(t){Tr.exports=(xr||(xr=1,"function"==typeof Object.create?Rr.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Rr.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}),Rr.exports)}return Tr.exports}var jr,Lr,Ar,Mr,Dr,Pr,Nr,Cr,Br,Fr={exports:{}};function zr(){return jr||(jr=1,function(t){var e=wr().Buffer,r=y;function n(t,e,r){t.copy(e,r)}t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return e.alloc(0);for(var r=e.allocUnsafe(t>>>0),i=this.head,s=0;i;)n(i.data,r,s),s+=i.data.length,i=i.next;return r},t}(),r&&r.inspect&&r.inspect.custom&&(t.exports.prototype[r.inspect.custom]=function(){var t=r.inspect({length:this.length});return this.constructor.name+" "+t})}(Fr)),Fr.exports}function Ur(){if(Ar)return Lr;Ar=1;var t=mr();function e(t,e){t.emit("error",e)}return Lr={destroy:function(r,n){var i=this,s=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return s||o?(n?n(r):r&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(e,this,r)):t.nextTick(e,this,r)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(r||null,function(r){!n&&r?i._writableState?i._writableState.errorEmitted||(i._writableState.errorEmitted=!0,t.nextTick(e,i,r)):t.nextTick(e,i,r):n&&n(r)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}}function Wr(){return Dr?Mr:(Dr=1,Mr=y.deprecate)}function Gr(){if(Nr)return Pr;Nr=1;var t=mr();function e(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}Pr=d;var r,n=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:t.nextTick;d.WritableState=f;var i=Object.create(kr());i.inherits=Ir();var s={deprecate:Wr()},o=br(),a=wr().Buffer,u=(void 0!==A?A:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,l=Ur();function h(){}function f(i,s){r=r||qr(),i=i||{};var o=s instanceof r;this.objectMode=!!i.objectMode,o&&(this.objectMode=this.objectMode||!!i.writableObjectMode);var a=i.highWaterMark,u=i.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:o&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===i.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=i.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,r){var i=e._writableState,s=i.sync,o=i.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(i),r)!function(e,r,n,i,s){--r.pendingcb,n?(t.nextTick(s,i),t.nextTick(_,e,r),e._writableState.errorEmitted=!0,e.emit("error",i)):(s(i),e._writableState.errorEmitted=!0,e.emit("error",i),_(e,r))}(e,i,s,r,o);else{var a=m(i);a||i.corked||i.bufferProcessing||!i.bufferedRequest||y(e,i),s?n(g,e,i,a,o):g(e,i,a,o)}}(s,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}function d(t){if(r=r||qr(),!(c.call(d,this)||this instanceof r))return new d(t);this._writableState=new f(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),o.call(this)}function p(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function g(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),_(t,e)}function y(t,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(t._writev&&n&&n.next){var i=r.bufferedRequestCount,s=new Array(i),o=r.corkedRequestsFree;o.entry=n;for(var a=0,u=!0;n;)s[a]=n,n.isBuf||(u=!1),n=n.next,a+=1;s.allBuffers=u,p(t,r,!0,r.length,s,"",o.finish),r.pendingcb++,r.lastBufferedRequest=null,o.next?(r.corkedRequestsFree=o.next,o.next=null):r.corkedRequestsFree=new e(r),r.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,h=n.callback;if(p(t,r,!1,r.objectMode?1:c.length,c,l,h),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function m(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function b(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),_(t,e)})}function _(e,r){var n=m(r);return n&&(!function(e,r){r.prefinished||r.finalCalled||("function"==typeof e._final?(r.pendingcb++,r.finalCalled=!0,t.nextTick(b,e,r)):(r.prefinished=!0,e.emit("prefinish")))}(e,r),0===r.pendingcb&&(r.finished=!0,e.emit("finish"))),n}return i.inherits(d,o),f.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(f.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(d,Symbol.hasInstance,{value:function(t){return!!c.call(this,t)||this===d&&(t&&t._writableState instanceof f)}})):c=function(t){return t instanceof this},d.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},d.prototype.write=function(e,r,n){var i,s=this._writableState,o=!1,c=!s.objectMode&&(i=e,a.isBuffer(i)||i instanceof u);return c&&!a.isBuffer(e)&&(e=function(t){return a.from(t)}(e)),"function"==typeof r&&(n=r,r=null),c?r="buffer":r||(r=s.defaultEncoding),"function"!=typeof n&&(n=h),s.ended?function(e,r){var n=new Error("write after end");e.emit("error",n),t.nextTick(r,n)}(this,n):(c||function(e,r,n,i){var s=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||r.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),t.nextTick(i,o),s=!1),s}(this,s,e,n))&&(s.pendingcb++,o=function(t,e,r,n,i,s){if(!r){var o=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=a.from(e,r));return e}(e,n,i);n!==o&&(r=!0,i="buffer",n=o)}var u=e.objectMode?1:n.length;e.length+=u;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:s,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else p(t,e,!1,u,n,i,s);return c}(this,s,c,e,r,n)),o},d.prototype.cork=function(){this._writableState.corked++},d.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||y(this,t))},d.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),d.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},d.prototype._writev=null,d.prototype.end=function(e,r,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,r=null):"function"==typeof r&&(n=r,r=null),null!=e&&this.write(e,r),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,r,n){r.ending=!0,_(e,r),n&&(r.finished?t.nextTick(n):e.once("finish",n));r.ended=!0,e.writable=!1}(this,i,n)},Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),d.prototype.destroy=l.destroy,d.prototype._undestroy=l.undestroy,d.prototype._destroy=function(t,e){this.end(),e(t)},Pr}function qr(){if(Br)return Cr;Br=1;var t=mr(),e=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Cr=u;var r=Object.create(kr());r.inherits=Ir();var n=vi(),i=Gr();r.inherits(u,n);for(var s=e(i.prototype),o=0;o<s.length;o++){var a=s[o];u.prototype[a]||(u.prototype[a]=i.prototype[a])}function u(t){if(!(this instanceof u))return new u(t);n.call(this,t),i.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",c)}function c(){this.allowHalfOpen||this._writableState.ended||t.nextTick(l,this)}function l(t){t.end()}return Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),u.prototype._destroy=function(e,r){this.push(null),this.end(),t.nextTick(r,e)},Cr}var $r,Hr,Zr,Vr,Qr,Yr,Kr,Jr,Xr,tn,en,rn,nn,sn,on,an,un,cn,ln,hn,fn,dn,pn,gn,yn,mn,bn,_n,vn,wn,Sn,En,kn,xn,On,Tn,Rn,In,jn,Ln,An,Mn,Dn,Pn,Nn,Cn,Bn,Fn,zn,Un,Wn,Gn,qn,$n,Hn,Zn,Vn,Qn,Yn,Kn,Jn,Xn,ti,ei,ri,ni,ii,si,oi,ai,ui,ci,li,hi,fi,di,pi,gi,yi,mi,bi={};function _i(){if($r)return bi;$r=1;var t=wr().Buffer,e=t.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(r);if("string"!=typeof n&&(t.isEncoding===e||!e(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=s,this.end=o,n=4;break;case"utf8":this.fillLast=i,n=4;break;case"base64":this.text=a,this.end=u,n=3;break;default:return this.write=c,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}function n(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function i(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function s(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function o(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function a(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function u(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function l(t){return t&&t.length?this.write(t):""}return bi.StringDecoder=r,r.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},r.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},r.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var s=n(e[i]);if(s>=0)return s>0&&(t.lastNeed=s-1),s;if(--i<r||-2===s)return 0;if(s=n(e[i]),s>=0)return s>0&&(t.lastNeed=s-2),s;if(--i<r||-2===s)return 0;if(s=n(e[i]),s>=0)return s>0&&(2===s?s=0:t.lastNeed=s-3),s;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},r.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length},bi}function vi(){if(Zr)return Hr;Zr=1;var t=mr();Hr=m;var e,r=function(){if(fr)return hr;fr=1;var t={}.toString;return hr=Array.isArray||function(e){return"[object Array]"==t.call(e)}}();m.ReadableState=g,f.EventEmitter;var n=function(t,e){return t.listeners(e).length},i=br(),s=wr().Buffer,o=(void 0!==A?A:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var a=Object.create(kr());a.inherits=Ir();var u=y,c=void 0;c=u&&u.debuglog?u.debuglog("stream"):function(){};var l,h=zr(),d=Ur();a.inherits(m,i);var p=["error","close","destroy","pause","resume"];function g(t,r){t=t||{};var n=r instanceof(e=e||qr());this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,s=t.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(l||(l=_i().StringDecoder),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function m(t){if(e=e||qr(),!(this instanceof m))return new m(t);this._readableState=new g(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),i.call(this)}function b(t,e,r,n,i){var a,u=t._readableState;null===e?(u.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,S(t)}(t,u)):(i||(a=function(t,e){var r;n=e,s.isBuffer(n)||n instanceof o||"string"==typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(u,e)),a?t.emit("error",a):u.objectMode||e&&e.length>0?("string"==typeof e||u.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),n?u.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,u,e,!0):u.ended?t.emit("error",new Error("stream.push() after EOF")):(u.reading=!1,u.decoder&&!r?(e=u.decoder.write(e),u.objectMode||0!==e.length?_(t,u,e,!1):k(t,u)):_(t,u,e,!1))):n||(u.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(u)}function _(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&S(t)),k(t,e)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),m.prototype.destroy=d.destroy,m.prototype._undestroy=d.undestroy,m.prototype._destroy=function(t,e){this.push(null),e(t)},m.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=s.from(t,e),e=""),r=!0),b(this,t,e,!1,r)},m.prototype.unshift=function(t){return b(this,t,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(t){return l||(l=_i().StringDecoder),this._readableState.decoder=new l(t),this._readableState.encoding=t,this};var v=8388608;function w(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=v?t=v:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function S(e){var r=e._readableState;r.needReadable=!1,r.emittedReadable||(c("emitReadable",r.flowing),r.emittedReadable=!0,r.sync?t.nextTick(E,e):E(e))}function E(t){c("emit readable"),t.emit("readable"),R(t)}function k(e,r){r.readingMore||(r.readingMore=!0,t.nextTick(x,e,r))}function x(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(c("maybeReadMore read 0"),t.read(0),r!==e.length);)r=e.length;e.readingMore=!1}function O(t){c("readable nexttick read 0"),t.read(0)}function T(t,e){e.reading||(c("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),R(t),e.flowing&&!e.reading&&t.read(0)}function R(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function I(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():r?function(t,e){var r=e.head,n=1,i=r.data;t-=i.length;for(;r=r.next;){var s=r.data,o=t>s.length?s.length:t;if(o===s.length?i+=s:i+=s.slice(0,t),0===(t-=o)){o===s.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=s.slice(o));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=s.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function j(e){var r=e._readableState;if(r.length>0)throw new Error('"endReadable()" called on non-empty stream');r.endEmitted||(r.ended=!0,t.nextTick(L,r,e))}function L(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function M(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}return m.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?j(this):S(this),null;if(0===(t=w(t,e))&&e.ended)return 0===e.length&&j(this),null;var n,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",i=!0),e.ended||e.reading?c("reading or ended",i=!1):i&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=w(r,e))),null===(n=t>0?I(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&j(this)),null!==n&&this.emit("data",n),n},m.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,i){var s=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,c("pipe count=%d opts=%j",o.pipesCount,i);var a=(!i||!1!==i.end)&&e!==process.stdout&&e!==process.stderr?l:b;function u(t,r){c("onunpipe"),t===s&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",y),e.removeListener("finish",m),e.removeListener("drain",h),e.removeListener("error",g),e.removeListener("unpipe",u),s.removeListener("end",l),s.removeListener("end",b),s.removeListener("data",p),f=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function l(){c("onend"),e.end()}o.endEmitted?t.nextTick(a):s.once("end",a),e.on("unpipe",u);var h=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&n(t,"data")&&(e.flowing=!0,R(t))}}(s);e.on("drain",h);var f=!1;var d=!1;function p(t){c("ondata"),d=!1,!1!==e.write(t)||d||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==M(o.pipes,e))&&!f&&(c("false write response, pause",o.awaitDrain),o.awaitDrain++,d=!0),s.pause())}function g(t){c("onerror",t),b(),e.removeListener("error",g),0===n(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",m),b()}function m(){c("onfinish"),e.removeListener("close",y),b()}function b(){c("unpipe"),s.unpipe(e)}return s.on("data",p),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?r(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(e,"error",g),e.once("close",y),e.once("finish",m),e.emit("pipe",s),o.flowing||(c("pipe resume"),s.resume()),e},m.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=M(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},m.prototype.on=function(e,r){var n=i.prototype.on.call(this,e,r);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var s=this._readableState;s.endEmitted||s.readableListening||(s.readableListening=s.needReadable=!0,s.emittedReadable=!1,s.reading?s.length&&S(this):t.nextTick(O,this))}return n},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!0,function(e,r){r.resumeScheduled||(r.resumeScheduled=!0,t.nextTick(T,e,r))}(this,e)),this},m.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",function(){if(c("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s<p.length;s++)t.on(p[s],this.emit.bind(this,p[s]));return this._read=function(e){c("wrapped _read",e),n&&(n=!1,t.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=I,Hr}function wi(){if(Qr)return Vr;Qr=1,Vr=n;var t=qr(),e=Object.create(kr());function r(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function n(e){if(!(this instanceof n))return new n(e);t.call(this,e),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",i)}function i(){var t=this;"function"==typeof this._flush?this._flush(function(e,r){s(t,e,r)}):s(this,null,null)}function s(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}return e.inherits=Ir(),e.inherits(n,t),n.prototype.push=function(e,r){return this._transformState.needTransform=!1,t.prototype.push.call(this,e,r)},n.prototype._transform=function(t,e,r){throw new Error("_transform() is not implemented")},n.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},n.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},n.prototype._destroy=function(e,r){var n=this;t.prototype._destroy.call(this,e,function(t){r(t),n.emit("close")})},Vr}function Si(){return Jr||(Jr=1,t=gr,e=gr.exports,r=g,"disable"===process.env.READABLE_STREAM&&r?(t.exports=r,(e=t.exports=r.Readable).Readable=r.Readable,e.Writable=r.Writable,e.Duplex=r.Duplex,e.Transform=r.Transform,e.PassThrough=r.PassThrough,e.Stream=r):((e=t.exports=vi()).Stream=r||e,e.Readable=e,e.Writable=Gr(),e.Duplex=qr(),e.Transform=wi(),e.PassThrough=function(){if(Kr)return Yr;Kr=1,Yr=r;var t=wi(),e=Object.create(kr());function r(e){if(!(this instanceof r))return new r(e);t.call(this,e)}return e.inherits=Ir(),e.inherits(r,t),r.prototype._transform=function(t,e,r){r(null,t)},Yr}())),gr.exports;var t,e,r}function Ei(){if(rn)return en;rn=1;var t=y,e=tn?Xr:(tn=1,Xr=Si().PassThrough);function r(t,e,r){t[e]=function(){return delete t[e],r.apply(this,arguments),this[e].apply(this,arguments)}}function n(t,i){if(!(this instanceof n))return new n(t,i);e.call(this,i),r(this,"_read",function(){var e=t.call(this,i),r=this.emit.bind(this,"error");e.on("error",r),e.pipe(this)}),this.emit("readable")}function i(t,n){if(!(this instanceof i))return new i(t,n);e.call(this,n),r(this,"_write",function(){var e=t.call(this,n),r=this.emit.bind(this,"error");e.on("error",r),this.pipe(e)}),this.emit("writable")}return en={Readable:n,Writable:i},t.inherits(n,e),t.inherits(i,e),en}
2
+ /*!
3
+ * normalize-path <https://github.com/jonschlinkert/normalize-path>
4
+ *
5
+ * Copyright (c) 2014-2018, Jon Schlinkert.
6
+ * Released under the MIT License.
7
+ */function ki(){return sn||(sn=1,nn=function(t,e){if("string"!=typeof t)throw new TypeError("expected path to be a string");if("\\"===t||"/"===t)return"/";var r=t.length;if(r<=1)return t;var n="";if(r>4&&"\\"===t[3]){var i=t[2];"?"!==i&&"."!==i||"\\\\"!==t.slice(0,2)||(t=t.slice(2),n="//")}var s=t.split(/[/\\]+/);return!1!==e&&""===s[s.length-1]&&s.pop(),n+s.join("/")}),nn}function xi(){if(an)return on;return an=1,on=function(t){return t}}function Oi(){if(hn)return ln;hn=1;var t=cn?un:(cn=1,un=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}),e=Math.max;return ln=function(r,n,i){return n=e(void 0===n?r.length-1:n,0),function(){for(var s=arguments,o=-1,a=e(s.length-n,0),u=Array(a);++o<a;)u[o]=s[n+o];o=-1;for(var c=Array(n+1);++o<n;)c[o]=s[o];return c[n]=i(u),t(r,this,c)}},ln}function Ti(){if(gn)return pn;gn=1;var t="object"==typeof A&&A&&A.Object===Object&&A;return pn=t}function Ri(){if(mn)return yn;mn=1;var t=Ti(),e="object"==typeof self&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return yn=r}function Ii(){if(_n)return bn;_n=1;var t=Ri().Symbol;return bn=t}function ji(){if(xn)return kn;xn=1;var t=Ii(),e=function(){if(wn)return vn;wn=1;var t=Ii(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,i=t?t.toStringTag:void 0;return vn=function(t){var e=r.call(t,i),s=t[i];try{t[i]=void 0;var o=!0}catch(t){}var a=n.call(t);return o&&(e?t[i]=s:delete t[i]),a}}(),r=function(){if(En)return Sn;En=1;var t=Object.prototype.toString;return Sn=function(e){return t.call(e)}}(),n=t?t.toStringTag:void 0;return kn=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":n&&n in Object(t)?e(t):r(t)}}function Li(){if(Tn)return On;return Tn=1,On=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}}function Ai(){if(In)return Rn;In=1;var t=ji(),e=Li();return Rn=function(r){if(!e(r))return!1;var n=t(r);return"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n}}function Mi(){if(Mn)return An;Mn=1;var t,e=function(){if(Ln)return jn;Ln=1;var t=Ri()["__core-js_shared__"];return jn=t}(),r=(t=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"";return An=function(t){return!!r&&r in t}}function Di(){if(Cn)return Nn;Cn=1;var t=Ai(),e=Mi(),r=Li(),n=function(){if(Pn)return Dn;Pn=1;var t=Function.prototype.toString;return Dn=function(e){if(null!=e){try{return t.call(e)}catch(t){}try{return e+""}catch(t){}}return""}}(),i=/^\[object .+?Constructor\]$/,s=Function.prototype,o=Object.prototype,a=s.toString,u=o.hasOwnProperty,c=RegExp("^"+a.call(u).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return Nn=function(s){return!(!r(s)||e(s))&&(t(s)?c:i).test(n(s))}}function Pi(){if(Un)return zn;Un=1;var t=Di(),e=Fn?Bn:(Fn=1,Bn=function(t,e){return null==t?void 0:t[e]});return zn=function(r,n){var i=e(r,n);return t(i)?i:void 0}}function Ni(){if($n)return qn;$n=1;var t=dn?fn:(dn=1,fn=function(t){return function(){return t}}),e=function(){if(Gn)return Wn;Gn=1;var t=Pi(),e=function(){try{var e=t(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();return Wn=e}(),r=xi();return qn=e?function(r,n){return e(r,"toString",{configurable:!0,enumerable:!1,value:t(n),writable:!0})}:r}function Ci(){if(Qn)return Vn;Qn=1;var t=Ni(),e=function(){if(Zn)return Hn;Zn=1;var t=Date.now;return Hn=function(e){var r=0,n=0;return function(){var i=t(),s=16-(i-n);if(n=i,s>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}},Hn}(),r=e(t);return Vn=r}function Bi(){if(Kn)return Yn;Kn=1;var t=xi(),e=Oi(),r=Ci();return Yn=function(n,i){return r(e(n,i,t),n+"")}}function Fi(){if(Xn)return Jn;return Xn=1,Jn=function(t,e){return t===e||t!=t&&e!=e}}function zi(){if(ei)return ti;ei=1;return ti=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}}function Ui(){if(ni)return ri;ni=1;var t=Ai(),e=zi();return ri=function(r){return null!=r&&e(r.length)&&!t(r)}}function Wi(){if(si)return ii;si=1;var t=/^(?:0|[1-9]\d*)$/;return ii=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}}function Gi(){if(hi)return li;return hi=1,li=function(t){return null!=t&&"object"==typeof t}}function qi(){if(gi)return pi;gi=1;var t=function(){if(di)return fi;di=1;var t=ji(),e=Gi();return fi=function(r){return e(r)&&"[object Arguments]"==t(r)}}(),e=Gi(),r=Object.prototype,n=r.hasOwnProperty,i=r.propertyIsEnumerable,s=t(function(){return arguments}())?t:function(t){return e(t)&&n.call(t,"callee")&&!i.call(t,"callee")};return pi=s}function $i(){if(mi)return yi;mi=1;var t=Array.isArray;return yi=t}var Hi,Zi,Vi,Qi,Yi,Ki,Ji,Xi={exports:{}};function ts(){return Vi||(Vi=1,function(t,e){var r=Ri(),n=Zi?Hi:(Zi=1,Hi=function(){return!1}),i=e&&!e.nodeType&&e,s=i&&t&&!t.nodeType&&t,o=s&&s.exports===i?r.Buffer:void 0,a=(o?o.isBuffer:void 0)||n;t.exports=a}(Xi,Xi.exports)),Xi.exports}function es(){if(Ji)return Ki;return Ji=1,Ki=function(t){return function(e){return t(e)}}}var rs,ns,is,ss,os,as,us,cs,ls,hs,fs,ds,ps,gs,ys,ms={exports:{}};function bs(){if(is)return ns;is=1;var t=function(){if(Yi)return Qi;Yi=1;var t=ji(),e=zi(),r=Gi(),n={};return n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1,Qi=function(i){return r(i)&&e(i.length)&&!!n[t(i)]}}(),e=es(),r=function(){return rs||(rs=1,t=ms,e=ms.exports,r=Ti(),n=e&&!e.nodeType&&e,i=n&&t&&!t.nodeType&&t,s=i&&i.exports===n&&r.process,o=function(){try{return i&&i.require&&i.require("util").types||s&&s.binding&&s.binding("util")}catch(t){}}(),t.exports=o),ms.exports;var t,e,r,n,i,s,o}(),n=r&&r.isTypedArray,i=n?e(n):t;return ns=i}function _s(){if(os)return ss;os=1;var t=(ci||(ci=1,ui=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}),ui),e=qi(),r=$i(),n=ts(),i=Wi(),s=bs(),o=Object.prototype.hasOwnProperty;return ss=function(a,u){var c=r(a),l=!c&&e(a),h=!c&&!l&&n(a),f=!c&&!l&&!h&&s(a),d=c||l||h||f,p=d?t(a.length,String):[],g=p.length;for(var y in a)!u&&!o.call(a,y)||d&&("length"==y||h&&("offset"==y||"parent"==y)||f&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||i(y,g))||p.push(y);return p}}function vs(){if(fs)return hs;fs=1;var t=Li(),e=function(){if(us)return as;us=1;var t=Object.prototype;return as=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}}(),r=ls?cs:(ls=1,cs=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}),n=Object.prototype.hasOwnProperty;return hs=function(i){if(!t(i))return r(i);var s=e(i),o=[];for(var a in i)("constructor"!=a||!s&&n.call(i,a))&&o.push(a);return o}}function ws(){if(ys)return gs;ys=1;var t=Bi(),e=Fi(),r=function(){if(ai)return oi;ai=1;var t=Fi(),e=Ui(),r=Wi(),n=Li();return oi=function(i,s,o){if(!n(o))return!1;var a=typeof s;return!!("number"==a?e(o)&&r(s,o.length):"string"==a&&s in o)&&t(o[s],i)},oi}(),n=function(){if(ps)return ds;ps=1;var t=_s(),e=vs(),r=Ui();return ds=function(n){return r(n)?t(n,!0):e(n)}}(),i=Object.prototype,s=i.hasOwnProperty,o=t(function(t,o){t=Object(t);var a=-1,u=o.length,c=u>2?o[2]:void 0;for(c&&r(o[0],o[1],c)&&(u=1);++a<u;)for(var l=o[a],h=n(l),f=-1,d=h.length;++f<d;){var p=h[f],g=t[p];(void 0===g||e(g,i[p])&&!s.call(t,p))&&(t[p]=l[p])}return t});return gs=o}var Ss,Es,ks,xs,Os,Ts,Rs={exports:{}};function Is(){return Es?Ss:(Es=1,Ss=g)}function js(){if(xs)return ks;function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach(function(t){r(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function r(t,e,r){return(e=i(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n(t,e,r){return e&&function(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function i(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof e?e:String(e)}xs=1;var s=b.Buffer,o=y.inspect,a=o&&o.custom||"inspect";function u(t,e,r){s.prototype.copy.call(t,e,r)}return ks=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return n(t,[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e=s.allocUnsafe(t>>>0),r=this.head,n=0;r;)u(r.data,e,n),n+=r.data.length,r=r.next;return e}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,s=t>i.length?i.length:t;if(s===i.length?n+=i:n+=i.slice(0,t),0===(t-=s)){s===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(s));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0===(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:a,value:function(t,r){return o(this,e(e({},r),{},{depth:0,customInspect:!1}))}}]),t}(),ks}function Ls(){if(Ts)return Os;function t(t,n){r(t,n),e(t)}function e(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function r(t,e){t.emit("error",e)}return Ts=1,Os={destroy:function(n,i){var s=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(i?i(n):n&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(r,this,n)):process.nextTick(r,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,function(r){!i&&r?s._writableState?s._writableState.errorEmitted?process.nextTick(e,s):(s._writableState.errorEmitted=!0,process.nextTick(t,s,r)):process.nextTick(t,s,r):i?(process.nextTick(e,s),i(r)):process.nextTick(e,s)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}},Os}var As,Ms,Ds,Ps,Ns,Cs,Bs,Fs={};function zs(){if(As)return Fs;As=1;const t={};function e(e,r,n){n||(n=Error);class i extends n{constructor(t,e,n){super(function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(t,e,n))}}i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function r(t,e){if(Array.isArray(t)){const r=t.length;return t=t.map(t=>String(t)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:2===r?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}return`of ${e} ${String(t)}`}return e("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),e("ERR_INVALID_ARG_TYPE",function(t,e,n){let i;var s;let o;if("string"==typeof e&&(s="not ",e.substr(0,s.length)===s)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))o=`The ${t} ${i} ${r(e,"type")}`;else{const n=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";o=`The "${t}" ${n} ${i} ${r(e,"type")}`}return o+=". Received type "+typeof n,o},TypeError),e("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),e("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),e("ERR_STREAM_PREMATURE_CLOSE","Premature close"),e("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),e("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),e("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),e("ERR_STREAM_WRITE_AFTER_END","write after end"),e("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),e("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),e("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Fs.codes=t,Fs}function Us(){if(Ds)return Ms;Ds=1;var t=zs().codes.ERR_INVALID_OPT_VALUE;return Ms={getHighWaterMark:function(e,r,n,i){var s=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(r,i,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new t(i?n:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}}function Ws(){if(Ns)return Ps;function t(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var e;Ns=1,Ps=S,S.WritableState=w;var r={deprecate:Wr()},n=Is(),i=b.Buffer,s=(void 0!==A?A:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var o,a=Ls(),u=Us().getHighWaterMark,c=zs().codes,l=c.ERR_INVALID_ARG_TYPE,h=c.ERR_METHOD_NOT_IMPLEMENTED,f=c.ERR_MULTIPLE_CALLBACK,d=c.ERR_STREAM_CANNOT_PIPE,p=c.ERR_STREAM_DESTROYED,g=c.ERR_STREAM_NULL_VALUES,y=c.ERR_STREAM_WRITE_AFTER_END,m=c.ERR_UNKNOWN_ENCODING,_=a.errorOrDestroy;function v(){}function w(r,n,i){e=e||Gs(),r=r||{},"boolean"!=typeof i&&(i=n instanceof e),this.objectMode=!!r.objectMode,i&&(this.objectMode=this.objectMode||!!r.writableObjectMode),this.highWaterMark=u(this,r,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===r.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=r.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new f;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(process.nextTick(i,n),process.nextTick(R,t,e),t._writableState.errorEmitted=!0,_(t,n)):(i(n),t._writableState.errorEmitted=!0,_(t,n),R(t,e))}(t,r,n,e,i);else{var s=O(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||x(t,r),n?process.nextTick(k,t,r,s,i):k(t,r,s,i)}}(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==r.emitClose,this.autoDestroy=!!r.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}function S(t){var r=this instanceof(e=e||Gs());if(!r&&!o.call(S,this))return new S(t);this._writableState=new w(t,this,r),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),n.call(this)}function E(t,e,r,n,i,s,o){e.writelen=n,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new p("write")):r?t._writev(i,e.onwrite):t._write(i,s,e.onwrite),e.sync=!1}function k(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),R(t,e)}function x(e,r){r.bufferProcessing=!0;var n=r.bufferedRequest;if(e._writev&&n&&n.next){var i=r.bufferedRequestCount,s=new Array(i),o=r.corkedRequestsFree;o.entry=n;for(var a=0,u=!0;n;)s[a]=n,n.isBuf||(u=!1),n=n.next,a+=1;s.allBuffers=u,E(e,r,!0,r.length,s,"",o.finish),r.pendingcb++,r.lastBufferedRequest=null,o.next?(r.corkedRequestsFree=o.next,o.next=null):r.corkedRequestsFree=new t(r),r.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,h=n.callback;if(E(e,r,!1,r.objectMode?1:c.length,c,l,h),n=n.next,r.bufferedRequestCount--,r.writing)break}null===n&&(r.lastBufferedRequest=null)}r.bufferedRequest=n,r.bufferProcessing=!1}function O(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function T(t,e){t._final(function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),R(t,e)})}function R(t,e){var r=O(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,process.nextTick(T,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}return Ir()(S,n),w.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(w.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(o=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(t){return!!o.call(this,t)||this===S&&(t&&t._writableState instanceof w)}})):o=function(t){return t instanceof this},S.prototype.pipe=function(){_(this,new d)},S.prototype.write=function(t,e,r){var n,o=this._writableState,a=!1,u=!o.objectMode&&(n=t,i.isBuffer(n)||n instanceof s);return u&&!i.isBuffer(t)&&(t=function(t){return i.from(t)}(t)),"function"==typeof e&&(r=e,e=null),u?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=v),o.ending?function(t,e){var r=new y;_(t,r),process.nextTick(e,r)}(this,r):(u||function(t,e,r,n){var i;return null===r?i=new g:"string"==typeof r||e.objectMode||(i=new l("chunk",["string","Buffer"],r)),!i||(_(t,i),process.nextTick(n,i),!1)}(this,o,t,r))&&(o.pendingcb++,a=function(t,e,r,n,s,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=i.from(e,r));return e}(e,n,s);n!==a&&(r=!0,s="buffer",n=a)}var u=e.objectMode?1:n.length;e.length+=u;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:s,isBuf:r,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else E(t,e,!1,u,n,s,o);return c}(this,o,u,t,e,r)),a},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||x(this,t))},S.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new m(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(t,e,r){r(new h("_write()"))},S.prototype._writev=null,S.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,R(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),S.prototype.destroy=a.destroy,S.prototype._undestroy=a.undestroy,S.prototype._destroy=function(t,e){e(t)},Ps}function Gs(){if(Bs)return Cs;Bs=1;var t=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Cs=o;var e=po(),r=Ws();Ir()(o,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var s=n[i];o.prototype[s]||(o.prototype[s]=r.prototype[s])}function o(t){if(!(this instanceof o))return new o(t);e.call(this,t),r.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",a)))}function a(){this._writableState.ended||process.nextTick(u,this)}function u(t){t.end()}return Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),Cs}var qs,$s,Hs,Zs,Vs,Qs,Ys,Ks,Js,Xs,to,eo,ro,no,io,so,oo,ao={},uo={exports:{}};function co(){if($s)return ao;$s=1;var t=(qs||(qs=1,function(t,e){var r=b,n=r.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s),s.prototype=Object.create(n.prototype),i(n,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"==typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}}(uo,uo.exports)),uo.exports).Buffer,e=t.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(r){var n;switch(this.encoding=function(r){var n=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(r);if("string"!=typeof n&&(t.isEncoding===e||!e(r)))throw new Error("Unknown encoding: "+r);return n||r}(r),this.encoding){case"utf16le":this.text=s,this.end=o,n=4;break;case"utf8":this.fillLast=i,n=4;break;case"base64":this.text=a,this.end=u,n=3;break;default:return this.write=c,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}function n(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function i(t){var e=this.lastTotal-this.lastNeed,r=function(t,e){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function s(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function o(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function a(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function u(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function c(t){return t.toString(this.encoding)}function l(t){return t&&t.length?this.write(t):""}return ao.StringDecoder=r,r.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},r.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},r.prototype.text=function(t,e){var r=function(t,e,r){var i=e.length-1;if(i<r)return 0;var s=n(e[i]);if(s>=0)return s>0&&(t.lastNeed=s-1),s;if(--i<r||-2===s)return 0;if(s=n(e[i]),s>=0)return s>0&&(t.lastNeed=s-2),s;if(--i<r||-2===s)return 0;if(s=n(e[i]),s>=0)return s>0&&(2===s?s=0:t.lastNeed=s-3),s;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},r.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length},ao}function lo(){if(Zs)return Hs;Zs=1;var t=zs().codes.ERR_STREAM_PREMATURE_CLOSE;function e(){}return Hs=function r(n,i,s){if("function"==typeof i)return r(n,null,i);i||(i={}),s=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(s||e);var o=i.readable||!1!==i.readable&&n.readable,a=i.writable||!1!==i.writable&&n.writable,u=function(){n.writable||l()},c=n._writableState&&n._writableState.finished,l=function(){a=!1,c=!0,o||s.call(n)},h=n._readableState&&n._readableState.endEmitted,f=function(){o=!1,h=!0,a||s.call(n)},d=function(t){s.call(n,t)},p=function(){var e;return o&&!h?(n._readableState&&n._readableState.ended||(e=new t),s.call(n,e)):a&&!c?(n._writableState&&n._writableState.ended||(e=new t),s.call(n,e)):void 0},g=function(){n.req.on("finish",l)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(n)?a&&!n._writableState&&(n.on("end",u),n.on("close",u)):(n.on("complete",l),n.on("abort",p),n.req?g():n.on("request",g)),n.on("end",f),n.on("finish",l),!1!==i.error&&n.on("error",d),n.on("close",p),function(){n.removeListener("complete",l),n.removeListener("abort",p),n.removeListener("request",g),n.req&&n.req.removeListener("finish",l),n.removeListener("end",u),n.removeListener("close",u),n.removeListener("finish",l),n.removeListener("end",f),n.removeListener("error",d),n.removeListener("close",p)}},Hs}function ho(){if(Qs)return Vs;var t;function e(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Qs=1;var r=lo(),n=Symbol("lastResolve"),i=Symbol("lastReject"),s=Symbol("error"),o=Symbol("ended"),a=Symbol("lastPromise"),u=Symbol("handlePromise"),c=Symbol("stream");function l(t,e){return{value:t,done:e}}function h(t){var e=t[n];if(null!==e){var r=t[c].read();null!==r&&(t[a]=null,t[n]=null,t[i]=null,e(l(r,!1)))}}function f(t){process.nextTick(h,t)}var d=Object.getPrototypeOf(function(){}),p=Object.setPrototypeOf((t={get stream(){return this[c]},next:function(){var t=this,e=this[s];if(null!==e)return Promise.reject(e);if(this[o])return Promise.resolve(l(void 0,!0));if(this[c].destroyed)return new Promise(function(e,r){process.nextTick(function(){t[s]?r(t[s]):e(l(void 0,!0))})});var r,n=this[a];if(n)r=new Promise(function(t,e){return function(r,n){t.then(function(){e[o]?r(l(void 0,!0)):e[u](r,n)},n)}}(n,this));else{var i=this[c].read();if(null!==i)return Promise.resolve(l(i,!1));r=new Promise(this[u])}return this[a]=r,r}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var t=this;return new Promise(function(e,r){t[c].destroy(null,function(t){t?r(t):e(l(void 0,!0))})})}),t),d);return Vs=function(t){var h,d=Object.create(p,(e(h={},c,{value:t,writable:!0}),e(h,n,{value:null,writable:!0}),e(h,i,{value:null,writable:!0}),e(h,s,{value:null,writable:!0}),e(h,o,{value:t._readableState.endEmitted,writable:!0}),e(h,u,{value:function(t,e){var r=d[c].read();r?(d[a]=null,d[n]=null,d[i]=null,t(l(r,!1))):(d[n]=t,d[i]=e)},writable:!0}),h));return d[a]=null,r(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=d[i];return null!==e&&(d[a]=null,d[n]=null,d[i]=null,e(t)),void(d[s]=t)}var r=d[n];null!==r&&(d[a]=null,d[n]=null,d[i]=null,r(l(void 0,!0))),d[o]=!0}),t.on("readable",f.bind(null,d)),d},Vs}function fo(){if(Ks)return Ys;function t(t,e,r,n,i,s,o){try{var a=t[s](o),u=a.value}catch(t){return void r(t)}a.done?e(u):Promise.resolve(u).then(n,i)}function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function r(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}Ks=1;var n=zs().codes.ERR_INVALID_ARG_TYPE;return Ys=function(i,s,o){var a;if(s&&"function"==typeof s.next)a=s;else if(s&&s[Symbol.asyncIterator])a=s[Symbol.asyncIterator]();else{if(!s||!s[Symbol.iterator])throw new n("iterable",["Iterable"],s);a=s[Symbol.iterator]()}var u=new i(function(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e(Object(i),!0).forEach(function(e){r(t,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))})}return t}({objectMode:!0},o)),c=!1;function l(){return h.apply(this,arguments)}function h(){var e;return e=function*(){try{var t=yield a.next(),e=t.value;t.done?u.push(null):u.push(yield e)?l():c=!1}catch(t){u.destroy(t)}},h=function(){var r=this,n=arguments;return new Promise(function(i,s){var o=e.apply(r,n);function a(e){t(o,i,s,a,u,"next",e)}function u(e){t(o,i,s,a,u,"throw",e)}a(void 0)})},h.apply(this,arguments)}return u._read=function(){c||(c=!0,l())},u},Ys}function po(){if(Xs)return Js;var t;Xs=1,Js=k,k.ReadableState=E,f.EventEmitter;var e=function(t,e){return t.listeners(e).length},r=Is(),n=b.Buffer,i=(void 0!==A?A:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var s,o=y;s=o&&o.debuglog?o.debuglog("stream"):function(){};var a,u,c,l=js(),h=Ls(),d=Us().getHighWaterMark,p=zs().codes,g=p.ERR_INVALID_ARG_TYPE,m=p.ERR_STREAM_PUSH_AFTER_EOF,_=p.ERR_METHOD_NOT_IMPLEMENTED,v=p.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;Ir()(k,r);var w=h.errorOrDestroy,S=["error","close","destroy","pause","resume"];function E(e,r,n){t=t||Gs(),e=e||{},"boolean"!=typeof n&&(n=r instanceof t),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=d(this,e,"readableHighWaterMark",n),this.buffer=new l,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(a||(a=co().StringDecoder),this.decoder=new a(e.encoding),this.encoding=e.encoding)}function k(e){if(t=t||Gs(),!(this instanceof k))return new k(e);var n=this instanceof t;this._readableState=new E(e,this,n),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),r.call(this)}function x(t,e,r,o,a){s("readableAddChunk",e);var u,c=t._readableState;if(null===e)c.reading=!1,function(t,e){if(s("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?I(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,j(t)))}(t,c);else if(a||(u=function(t,e){var r;s=e,n.isBuffer(s)||s instanceof i||"string"==typeof e||void 0===e||t.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],e));var s;return r}(c,e)),u)w(t,u);else if(c.objectMode||e&&e.length>0)if("string"==typeof e||c.objectMode||Object.getPrototypeOf(e)===n.prototype||(e=function(t){return n.from(t)}(e)),o)c.endEmitted?w(t,new v):O(t,c,e,!0);else if(c.ended)w(t,new m);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(e=c.decoder.write(e),c.objectMode||0!==e.length?O(t,c,e,!1):L(t,c)):O(t,c,e,!1)}else o||(c.reading=!1,L(t,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function O(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&I(t)),L(t,e)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),k.prototype.destroy=h.destroy,k.prototype._undestroy=h.undestroy,k.prototype._destroy=function(t,e){e(t)},k.prototype.push=function(t,e){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=n.from(t,e),e=""),r=!0),x(this,t,e,!1,r)},k.prototype.unshift=function(t){return x(this,t,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(t){a||(a=co().StringDecoder);var e=new a(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var T=1073741824;function R(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=T?t=T:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function I(t){var e=t._readableState;s("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(s("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(j,t))}function j(t){var e=t._readableState;s("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,C(t)}function L(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(M,t,e))}function M(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(s("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function D(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function P(t){s("readable nexttick read 0"),t.read(0)}function N(t,e){s("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),C(t),e.flowing&&!e.reading&&t.read(0)}function C(t){var e=t._readableState;for(s("flow",e.flowing);e.flowing&&null!==t.read(););}function B(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function F(t){var e=t._readableState;s("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(z,e,t))}function z(t,e){if(s("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function U(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}return k.prototype.read=function(t){s("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return s("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?F(this):I(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&F(this),null;var n,i=e.needReadable;return s("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&s("length less than watermark",i=!0),e.ended||e.reading?s("reading or ended",i=!1):i&&(s("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=R(r,e))),null===(n=t>0?B(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&F(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(t){w(this,new _("_read()"))},k.prototype.pipe=function(t,r){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,s("pipe count=%d opts=%j",i.pipesCount,r);var o=(!r||!1!==r.end)&&t!==process.stdout&&t!==process.stderr?u:g;function a(e,r){s("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,s("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",c),t.removeListener("error",f),t.removeListener("unpipe",a),n.removeListener("end",u),n.removeListener("end",g),n.removeListener("data",h),l=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function u(){s("onend"),t.end()}i.endEmitted?process.nextTick(o):n.once("end",o),t.on("unpipe",a);var c=function(t){return function(){var r=t._readableState;s("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,0===r.awaitDrain&&e(t,"data")&&(r.flowing=!0,C(t))}}(n);t.on("drain",c);var l=!1;function h(e){s("ondata");var r=t.write(e);s("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==U(i.pipes,t))&&!l&&(s("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function f(r){s("onerror",r),g(),t.removeListener("error",f),0===e(t,"error")&&w(t,r)}function d(){t.removeListener("finish",p),g()}function p(){s("onfinish"),t.removeListener("close",d),g()}function g(){s("unpipe"),n.unpipe(t)}return n.on("data",h),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",f),t.once("close",d),t.once("finish",p),t.emit("pipe",n),i.flowing||(s("pipe resume"),n.resume()),t},k.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<i;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=U(e.pipes,t);return-1===o||(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},k.prototype.on=function(t,e){var n=r.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,s("on readable",i.length,i.reading),i.length?I(this):i.reading||process.nextTick(P,this))),n},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(t,e){var n=r.prototype.removeListener.call(this,t,e);return"readable"===t&&process.nextTick(D,this),n},k.prototype.removeAllListeners=function(t){var e=r.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||process.nextTick(D,this),e},k.prototype.resume=function(){var t=this._readableState;return t.flowing||(s("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(N,t,e))}(this,t)),t.paused=!1,this},k.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",function(){if(s("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){(s("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<S.length;o++)t.on(S[o],this.emit.bind(this,S[o]));return this._read=function(e){s("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===u&&(u=ho()),u(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),k._fromList=B,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(t,e){return void 0===c&&(c=fo()),c(k,t,e)}),Js}function go(){if(eo)return to;eo=1,to=a;var t=zs().codes,e=t.ERR_METHOD_NOT_IMPLEMENTED,r=t.ERR_MULTIPLE_CALLBACK,n=t.ERR_TRANSFORM_ALREADY_TRANSFORMING,i=t.ERR_TRANSFORM_WITH_LENGTH_0,s=Gs();function o(t,e){var n=this._transformState;n.transforming=!1;var i=n.writecb;if(null===i)return this.emit("error",new r);n.writechunk=null,n.writecb=null,null!=e&&this.push(e),i(t);var s=this._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&this._read(s.highWaterMark)}function a(t){if(!(this instanceof a))return new a(t);s.call(this,t),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",u)}function u(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?c(this,null,null):this._flush(function(e,r){c(t,e,r)})}function c(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new i;if(t._transformState.transforming)throw new n;return t.push(null)}return Ir()(a,s),a.prototype.push=function(t,e){return this._transformState.needTransform=!1,s.prototype.push.call(this,t,e)},a.prototype._transform=function(t,r,n){n(new e("_transform()"))},a.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},a.prototype._destroy=function(t,e){s.prototype._destroy.call(this,t,function(t){e(t)})},to}function yo(){if(so)return io;var t;so=1;var e=zs().codes,r=e.ERR_MISSING_ARGS,n=e.ERR_STREAM_DESTROYED;function i(t){if(t)throw t}function s(t){t()}function o(t,e){return t.pipe(e)}return io=function(){for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];var c,l=function(t){return t.length?"function"!=typeof t[t.length-1]?i:t.pop():i}(a);if(Array.isArray(a[0])&&(a=a[0]),a.length<2)throw new r("streams");var h=a.map(function(e,r){var i=r<a.length-1;return function(e,r,i,s){s=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(s);var o=!1;e.on("close",function(){o=!0}),void 0===t&&(t=lo()),t(e,{readable:r,writable:i},function(t){if(t)return s(t);o=!0,s()});var a=!1;return function(t){if(!o&&!a)return a=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new n("pipe"))}}(e,i,r>0,function(t){c||(c=t),t&&h.forEach(s),i||(h.forEach(s),l(c))})});return a.reduce(o)},io}function mo(){return oo||(oo=1,t=Rs,e=Rs.exports,r=g,"disable"===process.env.READABLE_STREAM&&r?(t.exports=r.Readable,Object.assign(t.exports,r),t.exports.Stream=r):((e=t.exports=po()).Stream=r||e,e.Readable=e,e.Writable=Ws(),e.Duplex=Gs(),e.Transform=go(),e.PassThrough=function(){if(no)return ro;no=1,ro=e;var t=go();function e(r){if(!(this instanceof e))return new e(r);t.call(this,r)}return Ir()(e,t),e.prototype._transform=function(t,e,r){r(null,t)},ro}(),e.finished=lo(),e.pipeline=yo())),Rs.exports;var t,e,r}var bo,_o,vo,wo,So,Eo,ko,xo,Oo,To,Ro,Io,jo,Lo,Ao,Mo,Do,Po,No,Co,Bo,Fo,zo,Uo,Wo,Go,qo,$o,Ho,Zo,Vo,Qo,Yo,Ko,Jo,Xo,ta,ea,ra,na,ia,sa,oa,aa,ua,ca,la,ha,fa,da,pa,ga,ya,ma,ba,_a,va,wa,Sa,Ea,ka,xa,Oa,Ta,Ra,Ia,ja,La,Aa,Ma,Da,Pa,Na,Ca,Ba,Fa,za,Ua,Wa,Ga,qa,$a,Ha,Za,Va,Qa,Ya,Ka,Ja,Xa,tu,eu,ru,nu,iu,su,ou,au,uu,cu,lu={exports:{}};function hu(){if(Eo)return So;Eo=1;var t=(_o||(_o=1,bo=function(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}),bo),e=function(){if(wo)return vo;wo=1;var t=Ii(),e=qi(),r=$i(),n=t?t.isConcatSpreadable:void 0;return vo=function(t){return r(t)||e(t)||!!(n&&t&&t[n])}}();return So=function r(n,i,s,o,a){var u=-1,c=n.length;for(s||(s=e),a||(a=[]);++u<c;){var l=n[u];i>0&&s(l)?i>1?r(l,i-1,s,o,a):t(a,l):o||(a[a.length]=l)}return a},So}function fu(){if(To)return Oo;To=1;var t=Pi()(Object,"create");return Oo=t}function du(){if(Fo)return Bo;Fo=1;var t=function(){if(Io)return Ro;Io=1;var t=fu();return Ro=function(){this.__data__=t?t(null):{},this.size=0}}(),e=Lo?jo:(Lo=1,jo=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}),r=function(){if(Mo)return Ao;Mo=1;var t=fu(),e=Object.prototype.hasOwnProperty;return Ao=function(r){var n=this.__data__;if(t){var i=n[r];return"__lodash_hash_undefined__"===i?void 0:i}return e.call(n,r)?n[r]:void 0}}(),n=function(){if(Po)return Do;Po=1;var t=fu(),e=Object.prototype.hasOwnProperty;return Do=function(r){var n=this.__data__;return t?void 0!==n[r]:e.call(n,r)}}(),i=function(){if(Co)return No;Co=1;var t=fu();return No=function(e,r){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=t&&void 0===r?"__lodash_hash_undefined__":r,this}}();function s(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}return s.prototype.clear=t,s.prototype.delete=e,s.prototype.get=r,s.prototype.has=n,s.prototype.set=i,Bo=s}function pu(){if(Go)return Wo;Go=1;var t=Fi();return Wo=function(e,r){for(var n=e.length;n--;)if(t(e[n][0],r))return n;return-1}}function gu(){if(Xo)return Jo;Xo=1;var t=Uo?zo:(Uo=1,zo=function(){this.__data__=[],this.size=0}),e=function(){if($o)return qo;$o=1;var t=pu(),e=Array.prototype.splice;return qo=function(r){var n=this.__data__,i=t(n,r);return!(i<0||(i==n.length-1?n.pop():e.call(n,i,1),--this.size,0))},qo}(),r=function(){if(Zo)return Ho;Zo=1;var t=pu();return Ho=function(e){var r=this.__data__,n=t(r,e);return n<0?void 0:r[n][1]},Ho}(),n=function(){if(Qo)return Vo;Qo=1;var t=pu();return Vo=function(e){return t(this.__data__,e)>-1}}(),i=function(){if(Ko)return Yo;Ko=1;var t=pu();return Yo=function(e,r){var n=this.__data__,i=t(n,e);return i<0?(++this.size,n.push([e,r])):n[i][1]=r,this},Yo}();function s(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}return s.prototype.clear=t,s.prototype.delete=e,s.prototype.get=r,s.prototype.has=n,s.prototype.set=i,Jo=s}function yu(){if(na)return ra;na=1;var t=du(),e=gu(),r=function(){if(ea)return ta;ea=1;var t=Pi()(Ri(),"Map");return ta=t}();return ra=function(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}}function mu(){if(aa)return oa;aa=1;var t=sa?ia:(sa=1,ia=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t});return oa=function(e,r){var n=e.__data__;return t(r)?n["string"==typeof r?"string":"hash"]:n.map},oa}function bu(){if(ma)return ya;ma=1;var t=yu(),e=function(){if(ca)return ua;ca=1;var t=mu();return ua=function(e){var r=t(this,e).delete(e);return this.size-=r?1:0,r}}(),r=function(){if(ha)return la;ha=1;var t=mu();return la=function(e){return t(this,e).get(e)}}(),n=function(){if(da)return fa;da=1;var t=mu();return fa=function(e){return t(this,e).has(e)}}(),i=function(){if(ga)return pa;ga=1;var t=mu();return pa=function(e,r){var n=t(this,e),i=n.size;return n.set(e,r),this.size+=n.size==i?0:1,this}}();function s(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}return s.prototype.clear=t,s.prototype.delete=e,s.prototype.get=r,s.prototype.has=n,s.prototype.set=i,ya=s}function _u(){if(Ea)return Sa;Ea=1;var t=bu(),e=_a?ba:(_a=1,ba=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this}),r=wa?va:(wa=1,va=function(t){return this.__data__.has(t)});function n(e){var r=-1,n=null==e?0:e.length;for(this.__data__=new t;++r<n;)this.add(e[r])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,Sa=n}function vu(){if(La)return ja;La=1;var t=(xa||(xa=1,ka=function(t,e,r,n){for(var i=t.length,s=r+(n?1:-1);n?s--:++s<i;)if(e(t[s],s,t))return s;return-1}),ka),e=Ta?Oa:(Ta=1,Oa=function(t){return t!=t}),r=(Ia||(Ia=1,Ra=function(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}),Ra);return ja=function(n,i,s){return i==i?r(n,i,s):t(n,e,s)}}function wu(){if(Ma)return Aa;Ma=1;var t=vu();return Aa=function(e,r){return!!(null==e?0:e.length)&&t(e,r,0)>-1}}function Su(){if(Pa)return Da;return Pa=1,Da=function(t,e,r){for(var n=-1,i=null==t?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1},Da}function Eu(){if(Fa)return Ba;return Fa=1,Ba=function(t,e){return t.has(e)}}function ku(){if(Ua)return za;Ua=1;var t=_u(),e=wu(),r=Su(),n=(Ca||(Ca=1,Na=function(t,e){for(var r=-1,n=null==t?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}),Na),i=es(),s=Eu();return za=function(o,a,u,c){var l=-1,h=e,f=!0,d=o.length,p=[],g=a.length;if(!d)return p;u&&(a=n(a,i(u))),c?(h=r,f=!1):a.length>=200&&(h=s,f=!1,a=new t(a));t:for(;++l<d;){var y=o[l],m=null==u?y:u(y);if(y=c||0!==y?y:0,f&&m==m){for(var b=g;b--;)if(a[b]===m)continue t;p.push(y)}else h(a,m,c)||p.push(y)}return p},za}function xu(){if(Ga)return Wa;Ga=1;var t=Ui(),e=Gi();return Wa=function(r){return e(r)&&t(r)}}function Ou(){if(Ka)return Ya;return Ka=1,Ya=function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r},Ya}function Tu(){if(Xa)return Ja;Xa=1;var t=function(){if(Za)return Ha;Za=1;var t=Pi()(Ri(),"Set");return Ha=t}(),e=Qa?Va:(Qa=1,Va=function(){}),r=Ou(),n=t&&1/r(new t([,-0]))[1]==1/0?function(e){return new t(e)}:e;return Ja=n}function Ru(){if(nu)return ru;nu=1;var t=hu(),e=Bi(),r=function(){if(eu)return tu;eu=1;var t=_u(),e=wu(),r=Su(),n=Eu(),i=Tu(),s=Ou();return tu=function(o,a,u){var c=-1,l=e,h=o.length,f=!0,d=[],p=d;if(u)f=!1,l=r;else if(h>=200){var g=a?null:i(o);if(g)return s(g);f=!1,l=n,p=new t}else p=a?[]:d;t:for(;++c<h;){var y=o[c],m=a?a(y):y;if(y=u||0!==y?y:0,f&&m==m){for(var b=p.length;b--;)if(p[b]===m)continue t;a&&p.push(m),d.push(y)}else l(p,m,u)||(p!==d&&p.push(m),d.push(y))}return d},tu}(),n=xu(),i=e(function(e){return r(t(e,1,n,!0))});return ru=i}function Iu(){if(au)return ou;au=1;var t=(su||(su=1,iu=function(t,e){return function(r){return t(e(r))}}),iu),e=t(Object.getPrototypeOf,Object);return ou=e}var ju,Lu,Au,Mu={};function Du(){if(ju)return Mu;ju=1;var t=d,e="win32"===process.platform,r=h,n=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function i(t){return"function"==typeof t?t:function(){var t;if(n){var e=new Error;t=function(t){t&&(e.message=t.message,r(t=e))}}else t=r;return t;function r(t){if(t){if(process.throwDeprecation)throw t;if(!process.noDeprecation){var e="fs: missing callback "+(t.stack||t.message);process.traceDeprecation?console.trace(e):console.error(e)}}}}()}if(t.normalize,e)var s=/(.*?)(?:[\/\\]+|$)/g;else s=/(.*?)(?:[\/]+|$)/g;if(e)var o=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;else o=/^[\/]*/;return Mu.realpathSync=function(n,i){if(n=t.resolve(n),i&&Object.prototype.hasOwnProperty.call(i,n))return i[n];var a,u,c,l,h=n,f={},d={};function p(){var t=o.exec(n);a=t[0].length,u=t[0],c=t[0],l="",e&&!d[c]&&(r.lstatSync(c),d[c]=!0)}for(p();a<n.length;){s.lastIndex=a;var g=s.exec(n);if(l=u,u+=g[0],c=l+g[1],a=s.lastIndex,!(d[c]||i&&i[c]===c)){var y;if(i&&Object.prototype.hasOwnProperty.call(i,c))y=i[c];else{var m=r.lstatSync(c);if(!m.isSymbolicLink()){d[c]=!0,i&&(i[c]=c);continue}var b=null;if(!e){var _=m.dev.toString(32)+":"+m.ino.toString(32);f.hasOwnProperty(_)&&(b=f[_])}null===b&&(r.statSync(c),b=r.readlinkSync(c)),y=t.resolve(l,b),i&&(i[c]=y),e||(f[_]=b)}n=t.resolve(y,n.slice(a)),p()}}return i&&(i[h]=n),n},Mu.realpath=function(n,a,u){if("function"!=typeof u&&(u=i(a),a=null),n=t.resolve(n),a&&Object.prototype.hasOwnProperty.call(a,n))return process.nextTick(u.bind(null,null,a[n]));var c,l,h,f,d=n,p={},g={};function y(){var t=o.exec(n);c=t[0].length,l=t[0],h=t[0],f="",e&&!g[h]?r.lstat(h,function(t){if(t)return u(t);g[h]=!0,m()}):process.nextTick(m)}function m(){if(c>=n.length)return a&&(a[d]=n),u(null,n);s.lastIndex=c;var t=s.exec(n);return f=l,l+=t[0],h=f+t[1],c=s.lastIndex,g[h]||a&&a[h]===h?process.nextTick(m):a&&Object.prototype.hasOwnProperty.call(a,h)?v(a[h]):r.lstat(h,b)}function b(t,n){if(t)return u(t);if(!n.isSymbolicLink())return g[h]=!0,a&&(a[h]=h),process.nextTick(m);if(!e){var i=n.dev.toString(32)+":"+n.ino.toString(32);if(p.hasOwnProperty(i))return _(null,p[i],h)}r.stat(h,function(t){if(t)return u(t);r.readlink(h,function(t,r){e||(p[i]=r),_(t,r)})})}function _(e,r,n){if(e)return u(e);var i=t.resolve(f,r);a&&(a[n]=i),v(i)}function v(e){n=t.resolve(e,n.slice(c)),y()}y()},Mu}function Pu(){if(Au)return Lu;Au=1,Lu=a,a.realpath=a,a.sync=u,a.realpathSync=u,a.monkeypatch=function(){t.realpath=a,t.realpathSync=u},a.unmonkeypatch=function(){t.realpath=e,t.realpathSync=r};var t=h,e=t.realpath,r=t.realpathSync,n=process.version,i=/^v[0-5]\./.test(n),s=Du();function o(t){return t&&"realpath"===t.syscall&&("ELOOP"===t.code||"ENOMEM"===t.code||"ENAMETOOLONG"===t.code)}function a(t,r,n){if(i)return e(t,r,n);"function"==typeof r&&(n=r,r=null),e(t,r,function(e,i){o(e)?s.realpath(t,r,n):n(e,i)})}function u(t,e){if(i)return r(t,e);try{return r(t,e)}catch(r){if(o(r))return s.realpathSync(t,e);throw r}}return Lu}var Nu,Cu,Bu,Fu,zu,Uu={};function Wu(){if(Nu)return Uu;function t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}Nu=1,Uu.setopts=function(n,o,c){c||(c={});if(c.matchBase&&-1===o.indexOf("/")){if(c.noglobstar)throw new Error("base matching requires globstar");o="**/"+o}n.windowsPathsNoEscape=!!c.windowsPathsNoEscape||!1===c.allowWindowsEscape,n.windowsPathsNoEscape&&(o=o.replace(/\\/g,"/"));n.silent=!!c.silent,n.pattern=o,n.strict=!1!==c.strict,n.realpath=!!c.realpath,n.realpathCache=c.realpathCache||Object.create(null),n.follow=!!c.follow,n.dot=!!c.dot,n.mark=!!c.mark,n.nodir=!!c.nodir,n.nodir&&(n.mark=!0);n.sync=!!c.sync,n.nounique=!!c.nounique,n.nonull=!!c.nonull,n.nosort=!!c.nosort,n.nocase=!!c.nocase,n.stat=!!c.stat,n.noprocess=!!c.noprocess,n.absolute=!!c.absolute,n.fs=c.fs||e,n.maxLength=c.maxLength||1/0,n.cache=c.cache||Object.create(null),n.statCache=c.statCache||Object.create(null),n.symlinks=c.symlinks||Object.create(null),function(t,e){t.ignore=e.ignore||[],Array.isArray(t.ignore)||(t.ignore=[t.ignore]);t.ignore.length&&(t.ignore=t.ignore.map(a))}(n,c),n.changedCwd=!1;var l=process.cwd();t(c,"cwd")?(n.cwd=r.resolve(c.cwd),n.changedCwd=n.cwd!==l):n.cwd=r.resolve(l);n.root=c.root||r.resolve(n.cwd,"/"),n.root=r.resolve(n.root),n.cwdAbs=i(n.cwd)?n.cwd:u(n,n.cwd),n.nomount=!!c.nomount,"win32"===process.platform&&(n.root=n.root.replace(/\\/g,"/"),n.cwd=n.cwd.replace(/\\/g,"/"),n.cwdAbs=n.cwdAbs.replace(/\\/g,"/"));c.nonegate=!0,c.nocomment=!0,n.minimatch=new s(o,c),n.options=n.minimatch.options},Uu.ownProp=t,Uu.makeAbs=u,Uu.finish=function(t){for(var e=t.nounique,r=e?[]:Object.create(null),n=0,i=t.matches.length;n<i;n++){var s=t.matches[n];if(s&&0!==Object.keys(s).length){var a=Object.keys(s);e?r.push.apply(r,a):a.forEach(function(t){r[t]=!0})}else if(t.nonull){var l=t.minimatch.globSet[n];e?r.push(l):r[l]=!0}}e||(r=Object.keys(r));t.nosort||(r=r.sort(o));if(t.mark){for(n=0;n<r.length;n++)r[n]=t._mark(r[n]);t.nodir&&(r=r.filter(function(e){var r=!/\/$/.test(e),n=t.cache[e]||t.cache[u(t,e)];return r&&n&&(r="DIR"!==n&&!Array.isArray(n)),r}))}t.ignore.length&&(r=r.filter(function(e){return!c(t,e)}));t.found=r},Uu.mark=function(t,e){var r=u(t,e),n=t.cache[r],i=e;if(n){var s="DIR"===n||Array.isArray(n),o="/"===e.slice(-1);if(s&&!o?i+="/":!s&&o&&(i=i.slice(0,-1)),i!==e){var a=u(t,i);t.statCache[a]=t.statCache[r],t.cache[a]=t.cache[r]}}return i},Uu.isIgnored=c,Uu.childrenIgnored=function(t,e){return!!t.ignore.length&&t.ignore.some(function(t){return!(!t.gmatcher||!t.gmatcher.match(e))})};var e=h,r=d,n=C(),i=d.isAbsolute,s=n.Minimatch;function o(t,e){return t.localeCompare(e,"en")}function a(t){var e=null;if("/**"===t.slice(-3)){var r=t.replace(/(\/\*\*)+$/,"");e=new s(r,{dot:!0})}return{matcher:new s(t,{dot:!0}),gmatcher:e}}function u(t,e){var n=e;return n="/"===e.charAt(0)?r.join(t.root,e):i(e)||""===e?e:t.changedCwd?r.resolve(t.cwd,e):r.resolve(e),"win32"===process.platform&&(n=n.replace(/\\/g,"/")),n}function c(t,e){return!!t.ignore.length&&t.ignore.some(function(t){return t.matcher.match(e)||!(!t.gmatcher||!t.gmatcher.match(e))})}return Uu}function Gu(){if(zu)return Fu;return zu=1,Fu=function t(e,r){if(e&&r)return t(e)(r);if("function"!=typeof e)throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(t){n[t]=e[t]}),n;function n(){for(var t=new Array(arguments.length),r=0;r<t.length;r++)t[r]=arguments[r];var n=e.apply(this,t),i=t[t.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach(function(t){n[t]=i[t]}),n}},Fu}var qu,$u,Hu,Zu,Vu,Qu,Yu,Ku={exports:{}};function Ju(){if(qu)return Ku.exports;qu=1;var t=Gu();function e(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function r(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}return Ku.exports=t(e),Ku.exports.strict=t(r),e.proto=e(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return e(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return r(this)},configurable:!0})}),Ku.exports}function Xu(){if(Hu)return $u;Hu=1;var t=Gu(),e=Object.create(null),r=Ju();return $u=t(function(t,n){return e[t]?(e[t].push(n),null):(e[t]=[n],function(t){return r(function r(){var n=e[t],i=n.length,s=function(t){for(var e=t.length,r=[],n=0;n<e;n++)r[n]=t[n];return r}(arguments);try{for(var o=0;o<i;o++)n[o].apply(null,s)}finally{n.length>i?(n.splice(0,i),process.nextTick(function(){r.apply(null,s)})):delete e[t]}})}(t))}),$u}function tc(){if(Vu)return Zu;Vu=1,Zu=b;var t=Pu(),e=C();e.Minimatch;var r=Ir(),n=f.EventEmitter,i=d,s=m,o=d.isAbsolute,a=function(){if(Bu)return Cu;Bu=1,Cu=l,l.GlobSync=h;var t=Pu(),e=C();e.Minimatch,tc().Glob;var r=d,n=m,i=d.isAbsolute,s=Wu(),o=s.setopts,a=s.ownProp,u=s.childrenIgnored,c=s.isIgnored;function l(t,e){if("function"==typeof e||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new h(t,e).found}function h(t,e){if(!t)throw new Error("must provide pattern");if("function"==typeof e||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof h))return new h(t,e);if(o(this,t,e),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}return h.prototype._finish=function(){if(n.ok(this instanceof h),this.realpath){var e=this;this.matches.forEach(function(r,n){var i=e.matches[n]=Object.create(null);for(var s in r)try{s=e._makeAbs(s),i[t.realpathSync(s,e.realpathCache)]=!0}catch(t){if("stat"!==t.syscall)throw t;i[e._makeAbs(s)]=!0}})}s.finish(this)},h.prototype._process=function(t,r,s){n.ok(this instanceof h);for(var o,a=0;"string"==typeof t[a];)a++;switch(a){case t.length:return void this._processSimple(t.join("/"),r);case 0:o=null;break;default:o=t.slice(0,a).join("/")}var c,l=t.slice(a);null===o?c=".":i(o)||i(t.map(function(t){return"string"==typeof t?t:"[*]"}).join("/"))?(o&&i(o)||(o="/"+o),c=o):c=o;var f=this._makeAbs(c);u(this,c)||(l[0]===e.GLOBSTAR?this._processGlobStar(o,c,f,l,r,s):this._processReaddir(o,c,f,l,r,s))},h.prototype._processReaddir=function(t,e,n,i,s,o){var a=this._readdir(n,o);if(a){for(var u=i[0],c=!!this.minimatch.negate,l=u._glob,h=this.dot||"."===l.charAt(0),f=[],d=0;d<a.length;d++)("."!==(y=a[d]).charAt(0)||h)&&(c&&!t?!y.match(u):y.match(u))&&f.push(y);var p=f.length;if(0!==p)if(1!==i.length||this.mark||this.stat)for(i.shift(),d=0;d<p;d++){var g;y=f[d],g=t?[t,y]:[y],this._process(g.concat(i),s,o)}else{this.matches[s]||(this.matches[s]=Object.create(null));for(d=0;d<p;d++){var y=f[d];t&&(y="/"!==t.slice(-1)?t+"/"+y:t+y),"/"!==y.charAt(0)||this.nomount||(y=r.join(this.root,y)),this._emitMatch(s,y)}}}},h.prototype._emitMatch=function(t,e){if(!c(this,e)){var r=this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=r),!this.matches[t][e]){if(this.nodir){var n=this.cache[r];if("DIR"===n||Array.isArray(n))return}this.matches[t][e]=!0,this.stat&&this._stat(e)}}},h.prototype._readdirInGlobStar=function(t){if(this.follow)return this._readdir(t,!1);var e,r;try{r=this.fs.lstatSync(t)}catch(t){if("ENOENT"===t.code)return null}var n=r&&r.isSymbolicLink();return this.symlinks[t]=n,n||!r||r.isDirectory()?e=this._readdir(t,!1):this.cache[t]="FILE",e},h.prototype._readdir=function(t,e){if(e&&!a(this.symlinks,t))return this._readdirInGlobStar(t);if(a(this.cache,t)){var r=this.cache[t];if(!r||"FILE"===r)return null;if(Array.isArray(r))return r}try{return this._readdirEntries(t,this.fs.readdirSync(t))}catch(e){return this._readdirError(t,e),null}},h.prototype._readdirEntries=function(t,e){if(!this.mark&&!this.stat)for(var r=0;r<e.length;r++){var n=e[r];n="/"===t?t+n:t+"/"+n,this.cache[n]=!0}return this.cache[t]=e,e},h.prototype._readdirError=function(t,e){switch(e.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(t);if(this.cache[r]="FILE",r===this.cwdAbs){var n=new Error(e.code+" invalid cwd "+this.cwd);throw n.path=this.cwd,n.code=e.code,n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:if(this.cache[this._makeAbs(t)]=!1,this.strict)throw e;this.silent||console.error("glob error",e)}},h.prototype._processGlobStar=function(t,e,r,n,i,s){var o=this._readdir(r,s);if(o){var a=n.slice(1),u=t?[t]:[],c=u.concat(a);this._process(c,i,!1);var l=o.length;if(!this.symlinks[r]||!s)for(var h=0;h<l;h++)if("."!==o[h].charAt(0)||this.dot){var f=u.concat(o[h],a);this._process(f,i,!0);var d=u.concat(o[h],n);this._process(d,i,!0)}}},h.prototype._processSimple=function(t,e){var n=this._stat(t);if(this.matches[e]||(this.matches[e]=Object.create(null)),n){if(t&&i(t)&&!this.nomount){var s=/[\/\\]$/.test(t);"/"===t.charAt(0)?t=r.join(this.root,t):(t=r.resolve(this.root,t),s&&(t+="/"))}"win32"===process.platform&&(t=t.replace(/\\/g,"/")),this._emitMatch(e,t)}},h.prototype._stat=function(t){var e=this._makeAbs(t),r="/"===t.slice(-1);if(t.length>this.maxLength)return!1;if(!this.stat&&a(this.cache,e)){var n=this.cache[e];if(Array.isArray(n)&&(n="DIR"),!r||"DIR"===n)return n;if(r&&"FILE"===n)return!1}var i=this.statCache[e];if(!i){var s;try{s=this.fs.lstatSync(e)}catch(t){if(t&&("ENOENT"===t.code||"ENOTDIR"===t.code))return this.statCache[e]=!1,!1}if(s&&s.isSymbolicLink())try{i=this.fs.statSync(e)}catch(t){i=s}else i=s}return this.statCache[e]=i,n=!0,i&&(n=i.isDirectory()?"DIR":"FILE"),this.cache[e]=this.cache[e]||n,(!r||"FILE"!==n)&&n},h.prototype._mark=function(t){return s.mark(this,t)},h.prototype._makeAbs=function(t){return s.makeAbs(this,t)},Cu}(),u=Wu(),c=u.setopts,l=u.ownProp,h=Xu(),p=u.childrenIgnored,g=u.isIgnored,y=Ju();function b(t,e,r){if("function"==typeof e&&(r=e,e={}),e||(e={}),e.sync){if(r)throw new TypeError("callback provided to sync glob");return a(t,e)}return new v(t,e,r)}b.sync=a;var _=b.GlobSync=a.GlobSync;function v(t,e,r){if("function"==typeof e&&(r=e,e=null),e&&e.sync){if(r)throw new TypeError("callback provided to sync glob");return new _(t,e)}if(!(this instanceof v))return new v(t,e,r);c(this,t,e),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),"function"==typeof r&&(r=y(r),this.on("error",r),this.on("end",function(t){r(null,t)}));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===n)return a();for(var s=!0,o=0;o<n;o++)this._process(this.minimatch.set[o],o,!1,a);function a(){--i._processing,i._processing<=0&&(s?process.nextTick(function(){i._finish()}):i._finish())}s=!1}return b.glob=b,b.hasMagic=function(t,e){var r=function(t,e){if(null===e||"object"!=typeof e)return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}({},e);r.noprocess=!0;var n=new v(t,r).minimatch.set;if(!t)return!1;if(n.length>1)return!0;for(var i=0;i<n[0].length;i++)if("string"!=typeof n[0][i])return!0;return!1},b.Glob=v,r(v,n),v.prototype._finish=function(){if(s(this instanceof v),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();u.finish(this),this.emit("end",this.found)}},v.prototype._realpath=function(){if(!this._didRealpath){this._didRealpath=!0;var t=this.matches.length;if(0===t)return this._finish();for(var e=this,r=0;r<this.matches.length;r++)this._realpathSet(r,n)}function n(){0===--t&&e._finish()}},v.prototype._realpathSet=function(e,r){var n=this.matches[e];if(!n)return r();var i=Object.keys(n),s=this,o=i.length;if(0===o)return r();var a=this.matches[e]=Object.create(null);i.forEach(function(n,i){n=s._makeAbs(n),t.realpath(n,s.realpathCache,function(t,i){t?"stat"===t.syscall?a[n]=!0:s.emit("error",t):a[i]=!0,0===--o&&(s.matches[e]=a,r())})})},v.prototype._mark=function(t){return u.mark(this,t)},v.prototype._makeAbs=function(t){return u.makeAbs(this,t)},v.prototype.abort=function(){this.aborted=!0,this.emit("abort")},v.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))},v.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var t=this._emitQueue.slice(0);this._emitQueue.length=0;for(var e=0;e<t.length;e++){var r=t[e];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(e=0;e<n.length;e++){var i=n[e];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}},v.prototype._process=function(t,r,n,i){if(s(this instanceof v),s("function"==typeof i),!this.aborted)if(this._processing++,this.paused)this._processQueue.push([t,r,n,i]);else{for(var a,u=0;"string"==typeof t[u];)u++;switch(u){case t.length:return void this._processSimple(t.join("/"),r,i);case 0:a=null;break;default:a=t.slice(0,u).join("/")}var c,l=t.slice(u);null===a?c=".":o(a)||o(t.map(function(t){return"string"==typeof t?t:"[*]"}).join("/"))?(a&&o(a)||(a="/"+a),c=a):c=a;var h=this._makeAbs(c);if(p(this,c))return i();l[0]===e.GLOBSTAR?this._processGlobStar(a,c,h,l,r,n,i):this._processReaddir(a,c,h,l,r,n,i)}},v.prototype._processReaddir=function(t,e,r,n,i,s,o){var a=this;this._readdir(r,s,function(u,c){return a._processReaddir2(t,e,r,n,i,s,c,o)})},v.prototype._processReaddir2=function(t,e,r,n,s,o,a,u){if(!a)return u();for(var c=n[0],l=!!this.minimatch.negate,h=c._glob,f=this.dot||"."===h.charAt(0),d=[],p=0;p<a.length;p++){if("."!==(y=a[p]).charAt(0)||f)(l&&!t?!y.match(c):y.match(c))&&d.push(y)}var g=d.length;if(0===g)return u();if(1===n.length&&!this.mark&&!this.stat){this.matches[s]||(this.matches[s]=Object.create(null));for(p=0;p<g;p++){var y=d[p];t&&(y="/"!==t?t+"/"+y:t+y),"/"!==y.charAt(0)||this.nomount||(y=i.join(this.root,y)),this._emitMatch(s,y)}return u()}n.shift();for(p=0;p<g;p++){y=d[p];t&&(y="/"!==t?t+"/"+y:t+y),this._process([y].concat(n),s,o,u)}u()},v.prototype._emitMatch=function(t,e){if(!this.aborted&&!g(this,e))if(this.paused)this._emitQueue.push([t,e]);else{var r=o(e)?e:this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=r),!this.matches[t][e]){if(this.nodir){var n=this.cache[r];if("DIR"===n||Array.isArray(n))return}this.matches[t][e]=!0;var i=this.statCache[r];i&&this.emit("stat",e,i),this.emit("match",e)}}},v.prototype._readdirInGlobStar=function(t,e){if(!this.aborted){if(this.follow)return this._readdir(t,!1,e);var r=this,n=h("lstat\0"+t,function(n,i){if(n&&"ENOENT"===n.code)return e();var s=i&&i.isSymbolicLink();r.symlinks[t]=s,s||!i||i.isDirectory()?r._readdir(t,!1,e):(r.cache[t]="FILE",e())});n&&r.fs.lstat(t,n)}},v.prototype._readdir=function(t,e,r){if(!this.aborted&&(r=h("readdir\0"+t+"\0"+e,r))){if(e&&!l(this.symlinks,t))return this._readdirInGlobStar(t,r);if(l(this.cache,t)){var n=this.cache[t];if(!n||"FILE"===n)return r();if(Array.isArray(n))return r(null,n)}this.fs.readdir(t,function(t,e,r){return function(n,i){n?t._readdirError(e,n,r):t._readdirEntries(e,i,r)}}(this,t,r))}},v.prototype._readdirEntries=function(t,e,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<e.length;n++){var i=e[n];i="/"===t?t+i:t+"/"+i,this.cache[i]=!0}return this.cache[t]=e,r(null,e)}},v.prototype._readdirError=function(t,e,r){if(!this.aborted){switch(e.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(t);if(this.cache[n]="FILE",n===this.cwdAbs){var i=new Error(e.code+" invalid cwd "+this.cwd);i.path=this.cwd,i.code=e.code,this.emit("error",i),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(t)]=!1;break;default:this.cache[this._makeAbs(t)]=!1,this.strict&&(this.emit("error",e),this.abort()),this.silent||console.error("glob error",e)}return r()}},v.prototype._processGlobStar=function(t,e,r,n,i,s,o){var a=this;this._readdir(r,s,function(u,c){a._processGlobStar2(t,e,r,n,i,s,c,o)})},v.prototype._processGlobStar2=function(t,e,r,n,i,s,o,a){if(!o)return a();var u=n.slice(1),c=t?[t]:[],l=c.concat(u);this._process(l,i,!1,a);var h=this.symlinks[r],f=o.length;if(h&&s)return a();for(var d=0;d<f;d++){if("."!==o[d].charAt(0)||this.dot){var p=c.concat(o[d],u);this._process(p,i,!0,a);var g=c.concat(o[d],n);this._process(g,i,!0,a)}}a()},v.prototype._processSimple=function(t,e,r){var n=this;this._stat(t,function(i,s){n._processSimple2(t,e,i,s,r)})},v.prototype._processSimple2=function(t,e,r,n,s){if(this.matches[e]||(this.matches[e]=Object.create(null)),!n)return s();if(t&&o(t)&&!this.nomount){var a=/[\/\\]$/.test(t);"/"===t.charAt(0)?t=i.join(this.root,t):(t=i.resolve(this.root,t),a&&(t+="/"))}"win32"===process.platform&&(t=t.replace(/\\/g,"/")),this._emitMatch(e,t),s()},v.prototype._stat=function(t,e){var r=this._makeAbs(t),n="/"===t.slice(-1);if(t.length>this.maxLength)return e();if(!this.stat&&l(this.cache,r)){var i=this.cache[r];if(Array.isArray(i)&&(i="DIR"),!n||"DIR"===i)return e(null,i);if(n&&"FILE"===i)return e()}var s=this.statCache[r];if(void 0!==s){if(!1===s)return e(null,s);var o=s.isDirectory()?"DIR":"FILE";return n&&"FILE"===o?e():e(null,o,s)}var a=this,u=h("stat\0"+r,function(n,i){if(i&&i.isSymbolicLink())return a.fs.stat(r,function(n,s){n?a._stat2(t,r,null,i,e):a._stat2(t,r,n,s,e)});a._stat2(t,r,n,i,e)});u&&a.fs.lstat(r,u)},v.prototype._stat2=function(t,e,r,n,i){if(r&&("ENOENT"===r.code||"ENOTDIR"===r.code))return this.statCache[e]=!1,i();var s="/"===t.slice(-1);if(this.statCache[e]=n,"/"===e.slice(-1)&&n&&!n.isDirectory())return i(null,!1,n);var o=!0;return n&&(o=n.isDirectory()?"DIR":"FILE"),this.cache[e]=this.cache[e]||o,s&&"FILE"===o?i():i(null,o,n)},Zu}function ec(){if(Qu)return lu.exports;Qu=1;var t=cr(),e=d,r=function(){if(xo)return ko;xo=1;var t=hu();return ko=function(e){return null!=e&&e.length?t(e,1):[]}}(),n=function(){if($a)return qa;$a=1;var t=ku(),e=hu(),r=Bi(),n=xu(),i=r(function(r,i){return n(r)?t(r,e(i,1,n,!0)):[]});return qa=i}(),i=Ru(),s=function(){if(cu)return uu;cu=1;var t=ji(),e=Iu(),r=Gi(),n=Function.prototype,i=Object.prototype,s=n.toString,o=i.hasOwnProperty,a=s.call(Object);return uu=function(n){if(!r(n)||"[object Object]"!=t(n))return!1;var i=e(n);if(null===i)return!0;var u=o.call(i,"constructor")&&i.constructor;return"function"==typeof u&&u instanceof u&&s.call(u)==a}}(),o=tc(),a=lu.exports={},u=/[\/\\]/g;return a.exists=function(){var r=e.join.apply(e,arguments);return t.existsSync(r)},a.expand=function(...a){var u=s(a[0])?a.shift():{},c=Array.isArray(a[0])?a[0]:a;if(0===c.length)return[];var l=function(t,e){var s=[];return r(t).forEach(function(t){var r=0===t.indexOf("!");r&&(t=t.slice(1));var o=e(t);s=r?n(s,o):i(s,o)}),s}(c,function(t){return o.sync(t,u)});return u.filter&&(l=l.filter(function(r){r=e.join(u.cwd||"",r);try{return"function"==typeof u.filter?u.filter(r):t.statSync(r)[u.filter]()}catch(t){return!1}})),l},a.expandMapping=function(t,r,n){n=Object.assign({rename:function(t,r){return e.join(t||"",r)}},n);var i=[],s={};return a.expand(n,t).forEach(function(t){var o=t;n.flatten&&(o=e.basename(o)),n.ext&&(o=o.replace(/(\.[^\/]*)?$/,n.ext));var a=n.rename(r,o,n);n.cwd&&(t=e.join(n.cwd,t)),a=a.replace(u,"/"),t=t.replace(u,"/"),s[a]?s[a].src.push(t):(i.push({src:[t],dest:a}),s[a]=i[i.length-1])}),i},a.normalizeFilesArray=function(t){var e=[];return t.forEach(function(t){("src"in t||"dest"in t)&&e.push(t)}),0===e.length?[]:e=_(e).chain().forEach(function(t){"src"in t&&t.src&&(Array.isArray(t.src)?t.src=r(t.src):t.src=[t.src])}).map(function(t){var e=Object.assign({},t);if(delete e.src,delete e.dest,t.expand)return a.expandMapping(t.src,t.dest,e).map(function(e){var r=Object.assign({},t);return r.orig=Object.assign({},t),r.src=e.src,r.dest=e.dest,["expand","cwd","flatten","rename","ext"].forEach(function(t){delete r[t]}),r});var n=Object.assign({},t);return n.orig=Object.assign({},t),"src"in n&&Object.defineProperty(n,"src",{enumerable:!0,get:function n(){var i;return"result"in n||(i=t.src,i=Array.isArray(i)?r(i):[i],n.result=a.expand(e,i)),n.result}}),"dest"in n&&(n.dest=t.dest),n}).flatten().value()},lu.exports}function rc(){if(Yu)return ar.exports;Yu=1;var t=cr(),e=d,r=Ei(),n=ki(),i=ws(),s=g.Stream,o=mo().PassThrough,a=ar.exports={};return a.file=ec(),a.collectStream=function(t,e){var r=[],n=0;t.on("error",e),t.on("data",function(t){r.push(t),n+=t.length}),t.on("end",function(){var t=Buffer.alloc(n),i=0;r.forEach(function(e){e.copy(t,i),i+=e.length}),e(null,t)})},a.dateify=function(t){return(t=t||new Date)instanceof Date||(t="string"==typeof t?new Date(t):new Date),t},a.defaults=function(t,e,r){var n=arguments;return n[0]=n[0]||{},i(...n)},a.isStream=function(t){return t instanceof s},a.lazyReadStream=function(e){return new r.Readable(function(){return t.createReadStream(e)})},a.normalizeInputSource=function(t){return null===t?Buffer.alloc(0):"string"==typeof t?Buffer.from(t):a.isStream(t)?t.pipe(new o):t},a.sanitizePath=function(t){return n(t,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")},a.trailingSlashIt=function(t){return"/"!==t.slice(-1)?t+"/":t},a.unixifyPath=function(t){return n(t,!1).replace(/^\w+:/,"")},a.walkdir=function(r,n,i){var s=[];"function"==typeof n&&(i=n,n=r),t.readdir(r,function(o,u){var c,l,h=0;if(o)return i(o);!function o(){if(!(c=u[h++]))return i(null,s);l=e.join(r,c),t.stat(l,function(t,r){s.push({path:l,relative:e.relative(n,l).replace(/\\/g,"/"),stats:r}),r&&r.isDirectory()?a.walkdir(l,n,function(t,e){if(t)return i(t);e.forEach(function(t){s.push(t)}),o()}):o()})}()})},ar.exports}var nc,ic,sc,oc={exports:{}};
8
+ /**
9
+ * Archiver Core
10
+ *
11
+ * @ignore
12
+ * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
13
+ * @copyright (c) 2012-2014 Chris Talkington, contributors.
14
+ */function ac(){if(sc)return ic;sc=1;var t=h,e=B(),r=or,n=d,i=rc(),s=y.inherits,o=(nc||(nc=1,function(t){const e={ABORTED:"archive was aborted",DIRECTORYDIRPATHREQUIRED:"diretory dirpath argument must be a non-empty string value",DIRECTORYFUNCTIONINVALIDDATA:"invalid data returned by directory custom data function",ENTRYNAMEREQUIRED:"entry name must be a non-empty string value",FILEFILEPATHREQUIRED:"file filepath argument must be a non-empty string value",FINALIZING:"archive already finalizing",QUEUECLOSED:"queue closed",NOENDMETHOD:"no suitable finalize/end method defined by module",DIRECTORYNOTSUPPORTED:"support for directory entries not defined by module",FORMATSET:"archive format already set",INPUTSTEAMBUFFERREQUIRED:"input source must be valid Stream or Buffer instance",MODULESET:"module already set",SYMLINKNOTSUPPORTED:"support for symlink entries not defined by module",SYMLINKFILEPATHREQUIRED:"symlink filepath argument must be a non-empty string value",SYMLINKTARGETREQUIRED:"symlink target argument must be a non-empty string value",ENTRYNOTSUPPORTED:"entry not supported"};function r(t,r){Error.captureStackTrace(this,this.constructor),this.message=e[t]||t,this.code=t,this.data=r}y.inherits(r,Error),t.exports=r}(oc)),oc.exports),a=mo().Transform,u="win32"===process.platform,c=function(t,e){if(!(this instanceof c))return new c(t,e);"string"!=typeof t&&(e=t,t="zip"),e=this.options=i.defaults(e,{highWaterMark:1048576,statConcurrency:4}),a.call(this,e),this._format=!1,this._module=!1,this._pending=0,this._pointer=0,this._entriesCount=0,this._entriesProcessedCount=0,this._fsEntriesTotalBytes=0,this._fsEntriesProcessedBytes=0,this._queue=r.queue(this._onQueueTask.bind(this),1),this._queue.drain(this._onQueueDrain.bind(this)),this._statQueue=r.queue(this._onStatQueueTask.bind(this),e.statConcurrency),this._statQueue.drain(this._onQueueDrain.bind(this)),this._state={aborted:!1,finalize:!1,finalizing:!1,finalized:!1,modulePiped:!1},this._streams=[]};return s(c,a),c.prototype._abort=function(){this._state.aborted=!0,this._queue.kill(),this._statQueue.kill(),this._queue.idle()&&this._shutdown()},c.prototype._append=function(e,r){var n={source:null,filepath:e};(r=r||{}).name||(r.name=e),r.sourcePath=e,n.data=r,this._entriesCount++,r.stats&&r.stats instanceof t.Stats?(n=this._updateQueueTaskWithStats(n,r.stats))&&(r.stats.size&&(this._fsEntriesTotalBytes+=r.stats.size),this._queue.push(n)):this._statQueue.push(n)},c.prototype._finalize=function(){this._state.finalizing||this._state.finalized||this._state.aborted||(this._state.finalizing=!0,this._moduleFinalize(),this._state.finalizing=!1,this._state.finalized=!0)},c.prototype._maybeFinalize=function(){return!(this._state.finalizing||this._state.finalized||this._state.aborted)&&(!!(this._state.finalize&&0===this._pending&&this._queue.idle()&&this._statQueue.idle())&&(this._finalize(),!0))},c.prototype._moduleAppend=function(t,e,r){this._state.aborted?r():this._module.append(t,e,function(t){if(this._task=null,this._state.aborted)this._shutdown();else{if(t)return this.emit("error",t),void setImmediate(r);this.emit("entry",e),this._entriesProcessedCount++,e.stats&&e.stats.size&&(this._fsEntriesProcessedBytes+=e.stats.size),this.emit("progress",{entries:{total:this._entriesCount,processed:this._entriesProcessedCount},fs:{totalBytes:this._fsEntriesTotalBytes,processedBytes:this._fsEntriesProcessedBytes}}),setImmediate(r)}}.bind(this))},c.prototype._moduleFinalize=function(){"function"==typeof this._module.finalize?this._module.finalize():"function"==typeof this._module.end?this._module.end():this.emit("error",new o("NOENDMETHOD"))},c.prototype._modulePipe=function(){this._module.on("error",this._onModuleError.bind(this)),this._module.pipe(this),this._state.modulePiped=!0},c.prototype._moduleSupports=function(t){return!(!this._module.supports||!this._module.supports[t])&&this._module.supports[t]},c.prototype._moduleUnpipe=function(){this._module.unpipe(this),this._state.modulePiped=!1},c.prototype._normalizeEntryData=function(t,e){t=i.defaults(t,{type:"file",name:null,date:null,mode:null,prefix:null,sourcePath:null,stats:!1}),e&&!1===t.stats&&(t.stats=e);var r="directory"===t.type;return t.name&&("string"==typeof t.prefix&&""!==t.prefix&&(t.name=t.prefix+"/"+t.name,t.prefix=null),t.name=i.sanitizePath(t.name),"symlink"!==t.type&&"/"===t.name.slice(-1)?(r=!0,t.type="directory"):r&&(t.name+="/")),"number"==typeof t.mode?t.mode&=u?511:4095:t.stats&&null===t.mode?(t.mode=u?511&t.stats.mode:4095&t.stats.mode,u&&r&&(t.mode=493)):null===t.mode&&(t.mode=r?493:420),t.stats&&null===t.date?t.date=t.stats.mtime:t.date=i.dateify(t.date),t},c.prototype._onModuleError=function(t){this.emit("error",t)},c.prototype._onQueueDrain=function(){this._state.finalizing||this._state.finalized||this._state.aborted||this._state.finalize&&0===this._pending&&this._queue.idle()&&this._statQueue.idle()&&this._finalize()},c.prototype._onQueueTask=function(t,e){var r=()=>{t.data.callback&&t.data.callback(),e()};this._state.finalizing||this._state.finalized||this._state.aborted?r():(this._task=t,this._moduleAppend(t.source,t.data,r))},c.prototype._onStatQueueTask=function(e,r){this._state.finalizing||this._state.finalized||this._state.aborted?r():t.lstat(e.filepath,function(t,n){if(this._state.aborted)setImmediate(r);else{if(t)return this._entriesCount--,this.emit("warning",t),void setImmediate(r);(e=this._updateQueueTaskWithStats(e,n))&&(n.size&&(this._fsEntriesTotalBytes+=n.size),this._queue.push(e)),setImmediate(r)}}.bind(this))},c.prototype._shutdown=function(){this._moduleUnpipe(),this.end()},c.prototype._transform=function(t,e,r){t&&(this._pointer+=t.length),r(null,t)},c.prototype._updateQueueTaskWithStats=function(e,r){if(r.isFile())e.data.type="file",e.data.sourceType="stream",e.source=i.lazyReadStream(e.filepath);else if(r.isDirectory()&&this._moduleSupports("directory"))e.data.name=i.trailingSlashIt(e.data.name),e.data.type="directory",e.data.sourcePath=i.trailingSlashIt(e.filepath),e.data.sourceType="buffer",e.source=Buffer.concat([]);else{if(!r.isSymbolicLink()||!this._moduleSupports("symlink"))return r.isDirectory()?this.emit("warning",new o("DIRECTORYNOTSUPPORTED",e.data)):r.isSymbolicLink()?this.emit("warning",new o("SYMLINKNOTSUPPORTED",e.data)):this.emit("warning",new o("ENTRYNOTSUPPORTED",e.data)),null;var s=t.readlinkSync(e.filepath),a=n.dirname(e.filepath);e.data.type="symlink",e.data.linkname=n.relative(a,n.resolve(a,s)),e.data.sourceType="buffer",e.source=Buffer.concat([])}return e.data=this._normalizeEntryData(e.data,r),e},c.prototype.abort=function(){return this._state.aborted||this._state.finalized||this._abort(),this},c.prototype.append=function(t,e){if(this._state.finalize||this._state.aborted)return this.emit("error",new o("QUEUECLOSED")),this;if("string"!=typeof(e=this._normalizeEntryData(e)).name||0===e.name.length)return this.emit("error",new o("ENTRYNAMEREQUIRED")),this;if("directory"===e.type&&!this._moduleSupports("directory"))return this.emit("error",new o("DIRECTORYNOTSUPPORTED",{name:e.name})),this;if(t=i.normalizeInputSource(t),Buffer.isBuffer(t))e.sourceType="buffer";else{if(!i.isStream(t))return this.emit("error",new o("INPUTSTEAMBUFFERREQUIRED",{name:e.name})),this;e.sourceType="stream"}return this._entriesCount++,this._queue.push({data:e,source:t}),this},c.prototype.directory=function(t,r,n){if(this._state.finalize||this._state.aborted)return this.emit("error",new o("QUEUECLOSED")),this;if("string"!=typeof t||0===t.length)return this.emit("error",new o("DIRECTORYDIRPATHREQUIRED")),this;this._pending++,!1===r?r="":"string"!=typeof r&&(r=t);var i=!1;"function"==typeof n?(i=n,n={}):"object"!=typeof n&&(n={});var s=e(t,{stat:!0,dot:!0});return s.on("error",function(t){this.emit("error",t)}.bind(this)),s.on("match",function(e){s.pause();var a=!1,u=Object.assign({},n);u.name=e.relative,u.prefix=r,u.stats=e.stat,u.callback=s.resume.bind(s);try{if(i)if(!1===(u=i(u)))a=!0;else if("object"!=typeof u)throw new o("DIRECTORYFUNCTIONINVALIDDATA",{dirpath:t})}catch(t){return void this.emit("error",t)}a?s.resume():this._append(e.absolute,u)}.bind(this)),s.on("end",function(){this._pending--,this._maybeFinalize()}.bind(this)),this},c.prototype.file=function(t,e){return this._state.finalize||this._state.aborted?(this.emit("error",new o("QUEUECLOSED")),this):"string"!=typeof t||0===t.length?(this.emit("error",new o("FILEFILEPATHREQUIRED")),this):(this._append(t,e),this)},c.prototype.glob=function(t,r,n){this._pending++,r=i.defaults(r,{stat:!0,pattern:t});var s=e(r.cwd||".",r);return s.on("error",function(t){this.emit("error",t)}.bind(this)),s.on("match",function(t){s.pause();var e=Object.assign({},n);e.callback=s.resume.bind(s),e.stats=t.stat,e.name=t.relative,this._append(t.absolute,e)}.bind(this)),s.on("end",function(){this._pending--,this._maybeFinalize()}.bind(this)),this},c.prototype.finalize=function(){if(this._state.aborted){var t=new o("ABORTED");return this.emit("error",t),Promise.reject(t)}if(this._state.finalize){var e=new o("FINALIZING");return this.emit("error",e),Promise.reject(e)}this._state.finalize=!0,0===this._pending&&this._queue.idle()&&this._statQueue.idle()&&this._finalize();var r=this;return new Promise(function(t,e){var n;r._module.on("end",function(){n||t()}),r._module.on("error",function(t){n=!0,e(t)})})},c.prototype.setFormat=function(t){return this._format?(this.emit("error",new o("FORMATSET")),this):(this._format=t,this)},c.prototype.setModule=function(t){return this._state.aborted?(this.emit("error",new o("ABORTED")),this):this._state.module?(this.emit("error",new o("MODULESET")),this):(this._module=t,this._modulePipe(),this)},c.prototype.symlink=function(t,e,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new o("QUEUECLOSED")),this;if("string"!=typeof t||0===t.length)return this.emit("error",new o("SYMLINKFILEPATHREQUIRED")),this;if("string"!=typeof e||0===e.length)return this.emit("error",new o("SYMLINKTARGETREQUIRED",{filepath:t})),this;if(!this._moduleSupports("symlink"))return this.emit("error",new o("SYMLINKNOTSUPPORTED",{filepath:t})),this;var n={type:"symlink"};return n.name=t.replace(/\\/g,"/"),n.linkname=e.replace(/\\/g,"/"),n.sourceType="buffer","number"==typeof r&&(n.mode=r),this._entriesCount++,this._queue.push({data:n,source:Buffer.concat([])}),this},c.prototype.pointer=function(){return this._pointer},c.prototype.use=function(t){return this._streams.push(t),this},ic=c}var uc,cc={exports:{}},lc={exports:{}};function hc(){if(uc)return lc.exports;uc=1;var t=lc.exports=function(){};return t.prototype.getName=function(){},t.prototype.getSize=function(){},t.prototype.getLastModifiedDate=function(){},t.prototype.isDirectory=function(){},lc.exports}var fc,dc,pc,gc,yc,mc,bc,_c={exports:{}},vc={exports:{}},wc={exports:{}};function Sc(){if(fc)return wc.exports;fc=1;var t=wc.exports={};return t.dateToDos=function(t,e){var r=(e=e||!1)?t.getFullYear():t.getUTCFullYear();return r<1980?2162688:r>=2044?2141175677:r-1980<<25|(e?t.getMonth():t.getUTCMonth())+1<<21|(e?t.getDate():t.getUTCDate())<<16|(e?t.getHours():t.getUTCHours())<<11|(e?t.getMinutes():t.getUTCMinutes())<<5|(e?t.getSeconds():t.getUTCSeconds())/2},t.dosToDate=function(t){return new Date(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1)},t.fromDosTime=function(e){return t.dosToDate(e.readUInt32LE(0))},t.getEightBytes=function(t){var e=Buffer.alloc(8);return e.writeUInt32LE(t%4294967296,0),e.writeUInt32LE(t/4294967296|0,4),e},t.getShortBytes=function(t){var e=Buffer.alloc(2);return e.writeUInt16LE((65535&t)>>>0,0),e},t.getShortBytesValue=function(t,e){return t.readUInt16LE(e)},t.getLongBytes=function(t){var e=Buffer.alloc(4);return e.writeUInt32LE((4294967295&t)>>>0,0),e},t.getLongBytesValue=function(t,e){return t.readUInt32LE(e)},t.toDosTime=function(e){return t.getLongBytes(t.dateToDos(e))},wc.exports}function Ec(){if(dc)return vc.exports;dc=1;var t=Sc(),e=vc.exports=function(){return this instanceof e?(this.descriptor=!1,this.encryption=!1,this.utf8=!1,this.numberOfShannonFanoTrees=0,this.strongEncryption=!1,this.slidingDictionarySize=0,this):new e};return e.prototype.encode=function(){return t.getShortBytes((this.descriptor?8:0)|(this.utf8?2048:0)|(this.encryption?1:0)|(this.strongEncryption?64:0))},e.prototype.parse=function(r,n){var i=t.getShortBytesValue(r,n),s=new e;return s.useDataDescriptor(!!(8&i)),s.useUTF8ForNames(!!(2048&i)),s.useStrongEncryption(!!(64&i)),s.useEncryption(!!(1&i)),s.setSlidingDictionarySize(2&i?8192:4096),s.setNumberOfShannonFanoTrees(4&i?3:2),s},e.prototype.setNumberOfShannonFanoTrees=function(t){this.numberOfShannonFanoTrees=t},e.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees},e.prototype.setSlidingDictionarySize=function(t){this.slidingDictionarySize=t},e.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize},e.prototype.useDataDescriptor=function(t){this.descriptor=t},e.prototype.usesDataDescriptor=function(){return this.descriptor},e.prototype.useEncryption=function(t){this.encryption=t},e.prototype.usesEncryption=function(){return this.encryption},e.prototype.useStrongEncryption=function(t){this.strongEncryption=t},e.prototype.usesStrongEncryption=function(){return this.strongEncryption},e.prototype.useUTF8ForNames=function(t){this.utf8=t},e.prototype.usesUTF8ForNames=function(){return this.utf8},vc.exports}function kc(){return mc?yc:(mc=1,yc={WORD:4,DWORD:8,EMPTY:Buffer.alloc(0),SHORT:2,SHORT_MASK:65535,SHORT_SHIFT:16,SHORT_ZERO:Buffer.from(Array(2)),LONG:4,LONG_ZERO:Buffer.from(Array(4)),MIN_VERSION_INITIAL:10,MIN_VERSION_DATA_DESCRIPTOR:20,MIN_VERSION_ZIP64:45,VERSION_MADEBY:45,METHOD_STORED:0,METHOD_DEFLATED:8,PLATFORM_UNIX:3,PLATFORM_FAT:0,SIG_LFH:67324752,SIG_DD:134695760,SIG_CFH:33639248,SIG_EOCD:101010256,SIG_ZIP64_EOCD:101075792,SIG_ZIP64_EOCD_LOC:117853008,ZIP64_MAGIC_SHORT:65535,ZIP64_MAGIC:4294967295,ZIP64_EXTRA_ID:1,ZLIB_NO_COMPRESSION:0,ZLIB_BEST_SPEED:1,ZLIB_BEST_COMPRESSION:9,ZLIB_DEFAULT_COMPRESSION:-1,MODE_MASK:4095,DEFAULT_FILE_MODE:33188,DEFAULT_DIR_MODE:16877,EXT_FILE_ATTR_DIR:1106051088,EXT_FILE_ATTR_FILE:2175008800,S_IFMT:61440,S_IFIFO:4096,S_IFCHR:8192,S_IFDIR:16384,S_IFBLK:24576,S_IFREG:32768,S_IFLNK:40960,S_IFSOCK:49152,S_DOS_A:32,S_DOS_D:16,S_DOS_V:8,S_DOS_S:4,S_DOS_H:2,S_DOS_R:1})}function xc(){if(bc)return _c.exports;bc=1;var t=y.inherits,e=ki(),r=hc(),n=Ec(),i=gc?pc:(gc=1,pc={PERM_MASK:4095,FILE_TYPE_FLAG:61440,LINK_FLAG:40960,FILE_FLAG:32768,DIR_FLAG:16384,DEFAULT_LINK_PERM:511,DEFAULT_DIR_PERM:493,DEFAULT_FILE_PERM:420}),s=kc(),o=Sc(),a=_c.exports=function(t){if(!(this instanceof a))return new a(t);r.call(this),this.platform=s.PLATFORM_FAT,this.method=-1,this.name=null,this.size=0,this.csize=0,this.gpb=new n,this.crc=0,this.time=-1,this.minver=s.MIN_VERSION_INITIAL,this.mode=-1,this.extra=null,this.exattr=0,this.inattr=0,this.comment=null,t&&this.setName(t)};return t(a,r),a.prototype.getCentralDirectoryExtra=function(){return this.getExtra()},a.prototype.getComment=function(){return null!==this.comment?this.comment:""},a.prototype.getCompressedSize=function(){return this.csize},a.prototype.getCrc=function(){return this.crc},a.prototype.getExternalAttributes=function(){return this.exattr},a.prototype.getExtra=function(){return null!==this.extra?this.extra:s.EMPTY},a.prototype.getGeneralPurposeBit=function(){return this.gpb},a.prototype.getInternalAttributes=function(){return this.inattr},a.prototype.getLastModifiedDate=function(){return this.getTime()},a.prototype.getLocalFileDataExtra=function(){return this.getExtra()},a.prototype.getMethod=function(){return this.method},a.prototype.getName=function(){return this.name},a.prototype.getPlatform=function(){return this.platform},a.prototype.getSize=function(){return this.size},a.prototype.getTime=function(){return-1!==this.time?o.dosToDate(this.time):-1},a.prototype.getTimeDos=function(){return-1!==this.time?this.time:0},a.prototype.getUnixMode=function(){return this.platform!==s.PLATFORM_UNIX?0:this.getExternalAttributes()>>s.SHORT_SHIFT&s.SHORT_MASK},a.prototype.getVersionNeededToExtract=function(){return this.minver},a.prototype.setComment=function(t){Buffer.byteLength(t)!==t.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.comment=t},a.prototype.setCompressedSize=function(t){if(t<0)throw new Error("invalid entry compressed size");this.csize=t},a.prototype.setCrc=function(t){if(t<0)throw new Error("invalid entry crc32");this.crc=t},a.prototype.setExternalAttributes=function(t){this.exattr=t>>>0},a.prototype.setExtra=function(t){this.extra=t},a.prototype.setGeneralPurposeBit=function(t){if(!(t instanceof n))throw new Error("invalid entry GeneralPurposeBit");this.gpb=t},a.prototype.setInternalAttributes=function(t){this.inattr=t},a.prototype.setMethod=function(t){if(t<0)throw new Error("invalid entry compression method");this.method=t},a.prototype.setName=function(t,r=!1){t=e(t,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,""),r&&(t=`/${t}`),Buffer.byteLength(t)!==t.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.name=t},a.prototype.setPlatform=function(t){this.platform=t},a.prototype.setSize=function(t){if(t<0)throw new Error("invalid entry size");this.size=t},a.prototype.setTime=function(t,e){if(!(t instanceof Date))throw new Error("invalid entry time");this.time=o.dateToDos(t,e)},a.prototype.setUnixMode=function(t){var e=0;e|=(t|=this.isDirectory()?s.S_IFDIR:s.S_IFREG)<<s.SHORT_SHIFT|(this.isDirectory()?s.S_DOS_D:s.S_DOS_A),this.setExternalAttributes(e),this.mode=t&s.MODE_MASK,this.platform=s.PLATFORM_UNIX},a.prototype.setVersionNeededToExtract=function(t){this.minver=t},a.prototype.isDirectory=function(){return"/"===this.getName().slice(-1)},a.prototype.isUnixSymlink=function(){return(this.getUnixMode()&i.FILE_TYPE_FLAG)===i.LINK_FLAG},a.prototype.isZip64=function(){return this.csize>s.ZIP64_MAGIC||this.size>s.ZIP64_MAGIC},_c.exports}var Oc,Tc,Rc={exports:{}},Ic={exports:{}};function jc(){if(Oc)return Ic.exports;Oc=1;var t=g.Stream,e=mo().PassThrough,r=Ic.exports={};return r.isStream=function(e){return e instanceof t},r.normalizeInputSource=function(t){if(null===t)return Buffer.alloc(0);if("string"==typeof t)return Buffer.from(t);if(r.isStream(t)&&!t._readableState){var n=new e;return t.pipe(n),n}return t},Ic.exports}function Lc(){if(Tc)return Rc.exports;Tc=1;var t=y.inherits,e=mo().Transform,r=hc(),n=jc(),i=Rc.exports=function(t){if(!(this instanceof i))return new i(t);e.call(this,t),this.offset=0,this._archive={finish:!1,finished:!1,processing:!1}};return t(i,e),i.prototype._appendBuffer=function(t,e,r){},i.prototype._appendStream=function(t,e,r){},i.prototype._emitErrorCallback=function(t){t&&this.emit("error",t)},i.prototype._finish=function(t){},i.prototype._normalizeEntry=function(t){},i.prototype._transform=function(t,e,r){r(null,t)},i.prototype.entry=function(t,e,i){if(e=e||null,"function"!=typeof i&&(i=this._emitErrorCallback.bind(this)),t instanceof r)if(this._archive.finish||this._archive.finished)i(new Error("unacceptable entry after finish"));else{if(!this._archive.processing){if(this._archive.processing=!0,this._normalizeEntry(t),this._entry=t,e=n.normalizeInputSource(e),Buffer.isBuffer(e))this._appendBuffer(t,e,i);else{if(!n.isStream(e))return this._archive.processing=!1,void i(new Error("input source must be valid Stream or Buffer instance"));this._appendStream(t,e,i)}return this}i(new Error("already processing an entry"))}else i(new Error("not a valid instance of ArchiveEntry"))},i.prototype.finish=function(){this._archive.processing?this._archive.finish=!0:this._finish()},i.prototype.getBytesWritten=function(){return this.offset},i.prototype.write=function(t,r){return t&&(this.offset+=t.length),e.prototype.write.call(this,t,r)},Rc.exports}var Ac,Mc,Dc,Pc,Nc,Cc,Bc,Fc,zc,Uc,Wc,Gc,qc,$c={exports:{}},Hc={};function Zc(){return Ac||(Ac=1,t=function(t){t.version="1.2.2";var e=function(){for(var t=0,e=new Array(256),r=0;256!=r;++r)t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=1&(t=r)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1)?-306674912^t>>>1:t>>>1,e[r]=t;return"undefined"!=typeof Int32Array?new Int32Array(e):e}(),r=function(t){var e=0,r=0,n=0,i="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(n=0;256!=n;++n)i[n]=t[n];for(n=0;256!=n;++n)for(r=t[n],e=256+n;e<4096;e+=256)r=i[e]=r>>>8^t[255&r];var s=[];for(n=1;16!=n;++n)s[n-1]="undefined"!=typeof Int32Array?i.subarray(256*n,256*n+256):i.slice(256*n,256*n+256);return s}(e),n=r[0],i=r[1],s=r[2],o=r[3],a=r[4],u=r[5],c=r[6],l=r[7],h=r[8],f=r[9],d=r[10],p=r[11],g=r[12],y=r[13],m=r[14];t.table=e,t.bstr=function(t,r){for(var n=-1^r,i=0,s=t.length;i<s;)n=n>>>8^e[255&(n^t.charCodeAt(i++))];return~n},t.buf=function(t,r){for(var b=-1^r,_=t.length-15,v=0;v<_;)b=m[t[v++]^255&b]^y[t[v++]^b>>8&255]^g[t[v++]^b>>16&255]^p[t[v++]^b>>>24]^d[t[v++]]^f[t[v++]]^h[t[v++]]^l[t[v++]]^c[t[v++]]^u[t[v++]]^a[t[v++]]^o[t[v++]]^s[t[v++]]^i[t[v++]]^n[t[v++]]^e[t[v++]];for(_+=15;v<_;)b=b>>>8^e[255&(b^t[v++])];return~b},t.str=function(t,r){for(var n=-1^r,i=0,s=t.length,o=0,a=0;i<s;)(o=t.charCodeAt(i++))<128?n=n>>>8^e[255&(n^o)]:o<2048?n=(n=n>>>8^e[255&(n^(192|o>>6&31))])>>>8^e[255&(n^(128|63&o))]:o>=55296&&o<57344?(o=64+(1023&o),a=1023&t.charCodeAt(i++),n=(n=(n=(n=n>>>8^e[255&(n^(240|o>>8&7))])>>>8^e[255&(n^(128|o>>2&63))])>>>8^e[255&(n^(128|a>>6&15|(3&o)<<4))])>>>8^e[255&(n^(128|63&a))]):n=(n=(n=n>>>8^e[255&(n^(224|o>>12&15))])>>>8^e[255&(n^(128|o>>6&63))])>>>8^e[255&(n^(128|63&o))];return~n}},"undefined"==typeof DO_NOT_EXPORT_CRC?t(Hc):t({})),Hc;var t}function Vc(){if(Dc)return Mc;Dc=1;const{Transform:t}=mo(),e=Zc();return Mc=class extends t{constructor(t){super(t),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(t,r,n){t&&(this.checksum=e.buf(t,this.checksum)>>>0,this.rawSize+=t.length),n(null,t)}digest(t){const e=Buffer.allocUnsafe(4);return e.writeUInt32BE(this.checksum>>>0,0),t?e.toString(t):e}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}}}function Qc(){if(Nc)return Pc;Nc=1;const{DeflateRaw:t}=v,e=Zc();return Pc=class extends t{constructor(t){super(t),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(t,e){return t&&(this.compressedSize+=t.length),super.push(t,e)}_transform(t,r,n){t&&(this.checksum=e.buf(t,this.checksum)>>>0,this.rawSize+=t.length),super._transform(t,r,n)}digest(t){const e=Buffer.allocUnsafe(4);return e.writeUInt32BE(this.checksum>>>0,0),t?e.toString(t):e}hex(){return this.digest("hex").toUpperCase()}size(t=!1){return t?this.compressedSize:this.rawSize}}}function Yc(){return Bc?Cc:(Bc=1,Cc={CRC32Stream:Vc(),DeflateCRC32Stream:Qc()})}function Kc(){if(Fc)return $c.exports;Fc=1;var t=y.inherits,e=Zc(),{CRC32Stream:r}=Yc(),{DeflateCRC32Stream:n}=Yc(),i=Lc();xc(),Ec();var s=kc();jc();var o=Sc(),a=$c.exports=function(t){if(!(this instanceof a))return new a(t);t=this.options=this._defaults(t),i.call(this,t),this._entry=null,this._entries=[],this._archive={centralLength:0,centralOffset:0,comment:"",finish:!1,finished:!1,processing:!1,forceZip64:t.forceZip64,forceLocalTime:t.forceLocalTime}};return t(a,i),a.prototype._afterAppend=function(t){this._entries.push(t),t.getGeneralPurposeBit().usesDataDescriptor()&&this._writeDataDescriptor(t),this._archive.processing=!1,this._entry=null,this._archive.finish&&!this._archive.finished&&this._finish()},a.prototype._appendBuffer=function(t,r,n){0===r.length&&t.setMethod(s.METHOD_STORED);var i=t.getMethod();return i===s.METHOD_STORED&&(t.setSize(r.length),t.setCompressedSize(r.length),t.setCrc(e.buf(r)>>>0)),this._writeLocalFileHeader(t),i===s.METHOD_STORED?(this.write(r),this._afterAppend(t),void n(null,t)):i===s.METHOD_DEFLATED?void this._smartStream(t,n).end(r):void n(new Error("compression method "+i+" not implemented"))},a.prototype._appendStream=function(t,e,r){t.getGeneralPurposeBit().useDataDescriptor(!0),t.setVersionNeededToExtract(s.MIN_VERSION_DATA_DESCRIPTOR),this._writeLocalFileHeader(t);var n=this._smartStream(t,r);e.once("error",function(t){n.emit("error",t),n.end()}),e.pipe(n)},a.prototype._defaults=function(t){return"object"!=typeof t&&(t={}),"object"!=typeof t.zlib&&(t.zlib={}),"number"!=typeof t.zlib.level&&(t.zlib.level=s.ZLIB_BEST_SPEED),t.forceZip64=!!t.forceZip64,t.forceLocalTime=!!t.forceLocalTime,t},a.prototype._finish=function(){this._archive.centralOffset=this.offset,this._entries.forEach(function(t){this._writeCentralFileHeader(t)}.bind(this)),this._archive.centralLength=this.offset-this._archive.centralOffset,this.isZip64()&&this._writeCentralDirectoryZip64(),this._writeCentralDirectoryEnd(),this._archive.processing=!1,this._archive.finish=!0,this._archive.finished=!0,this.end()},a.prototype._normalizeEntry=function(t){-1===t.getMethod()&&t.setMethod(s.METHOD_DEFLATED),t.getMethod()===s.METHOD_DEFLATED&&(t.getGeneralPurposeBit().useDataDescriptor(!0),t.setVersionNeededToExtract(s.MIN_VERSION_DATA_DESCRIPTOR)),-1===t.getTime()&&t.setTime(new Date,this._archive.forceLocalTime),t._offsets={file:0,data:0,contents:0}},a.prototype._smartStream=function(t,e){var i=t.getMethod()===s.METHOD_DEFLATED?new n(this.options.zlib):new r,o=null;return i.once("end",function(){var r=i.digest().readUInt32BE(0);t.setCrc(r),t.setSize(i.size()),t.setCompressedSize(i.size(!0)),this._afterAppend(t),e(o,t)}.bind(this)),i.once("error",function(t){o=t}),i.pipe(this,{end:!1}),i},a.prototype._writeCentralDirectoryEnd=function(){var t=this._entries.length,e=this._archive.centralLength,r=this._archive.centralOffset;this.isZip64()&&(t=s.ZIP64_MAGIC_SHORT,e=s.ZIP64_MAGIC,r=s.ZIP64_MAGIC),this.write(o.getLongBytes(s.SIG_EOCD)),this.write(s.SHORT_ZERO),this.write(s.SHORT_ZERO),this.write(o.getShortBytes(t)),this.write(o.getShortBytes(t)),this.write(o.getLongBytes(e)),this.write(o.getLongBytes(r));var n=this.getComment(),i=Buffer.byteLength(n);this.write(o.getShortBytes(i)),this.write(n)},a.prototype._writeCentralDirectoryZip64=function(){this.write(o.getLongBytes(s.SIG_ZIP64_EOCD)),this.write(o.getEightBytes(44)),this.write(o.getShortBytes(s.MIN_VERSION_ZIP64)),this.write(o.getShortBytes(s.MIN_VERSION_ZIP64)),this.write(s.LONG_ZERO),this.write(s.LONG_ZERO),this.write(o.getEightBytes(this._entries.length)),this.write(o.getEightBytes(this._entries.length)),this.write(o.getEightBytes(this._archive.centralLength)),this.write(o.getEightBytes(this._archive.centralOffset)),this.write(o.getLongBytes(s.SIG_ZIP64_EOCD_LOC)),this.write(s.LONG_ZERO),this.write(o.getEightBytes(this._archive.centralOffset+this._archive.centralLength)),this.write(o.getLongBytes(1))},a.prototype._writeCentralFileHeader=function(t){var e=t.getGeneralPurposeBit(),r=t.getMethod(),n=t._offsets.file,i=t.getSize(),a=t.getCompressedSize();if(t.isZip64()||n>s.ZIP64_MAGIC){i=s.ZIP64_MAGIC,a=s.ZIP64_MAGIC,n=s.ZIP64_MAGIC,t.setVersionNeededToExtract(s.MIN_VERSION_ZIP64);var u=Buffer.concat([o.getShortBytes(s.ZIP64_EXTRA_ID),o.getShortBytes(24),o.getEightBytes(t.getSize()),o.getEightBytes(t.getCompressedSize()),o.getEightBytes(t._offsets.file)],28);t.setExtra(u)}this.write(o.getLongBytes(s.SIG_CFH)),this.write(o.getShortBytes(t.getPlatform()<<8|s.VERSION_MADEBY)),this.write(o.getShortBytes(t.getVersionNeededToExtract())),this.write(e.encode()),this.write(o.getShortBytes(r)),this.write(o.getLongBytes(t.getTimeDos())),this.write(o.getLongBytes(t.getCrc())),this.write(o.getLongBytes(a)),this.write(o.getLongBytes(i));var c=t.getName(),l=t.getComment(),h=t.getCentralDirectoryExtra();e.usesUTF8ForNames()&&(c=Buffer.from(c),l=Buffer.from(l)),this.write(o.getShortBytes(c.length)),this.write(o.getShortBytes(h.length)),this.write(o.getShortBytes(l.length)),this.write(s.SHORT_ZERO),this.write(o.getShortBytes(t.getInternalAttributes())),this.write(o.getLongBytes(t.getExternalAttributes())),this.write(o.getLongBytes(n)),this.write(c),this.write(h),this.write(l)},a.prototype._writeDataDescriptor=function(t){this.write(o.getLongBytes(s.SIG_DD)),this.write(o.getLongBytes(t.getCrc())),t.isZip64()?(this.write(o.getEightBytes(t.getCompressedSize())),this.write(o.getEightBytes(t.getSize()))):(this.write(o.getLongBytes(t.getCompressedSize())),this.write(o.getLongBytes(t.getSize())))},a.prototype._writeLocalFileHeader=function(t){var e=t.getGeneralPurposeBit(),r=t.getMethod(),n=t.getName(),i=t.getLocalFileDataExtra();t.isZip64()&&(e.useDataDescriptor(!0),t.setVersionNeededToExtract(s.MIN_VERSION_ZIP64)),e.usesUTF8ForNames()&&(n=Buffer.from(n)),t._offsets.file=this.offset,this.write(o.getLongBytes(s.SIG_LFH)),this.write(o.getShortBytes(t.getVersionNeededToExtract())),this.write(e.encode()),this.write(o.getShortBytes(r)),this.write(o.getLongBytes(t.getTimeDos())),t._offsets.data=this.offset,e.usesDataDescriptor()?(this.write(s.LONG_ZERO),this.write(s.LONG_ZERO),this.write(s.LONG_ZERO)):(this.write(o.getLongBytes(t.getCrc())),this.write(o.getLongBytes(t.getCompressedSize())),this.write(o.getLongBytes(t.getSize()))),this.write(o.getShortBytes(n.length)),this.write(o.getShortBytes(i.length)),this.write(n),this.write(i),t._offsets.contents=this.offset},a.prototype.getComment=function(t){return null!==this._archive.comment?this._archive.comment:""},a.prototype.isZip64=function(){return this._archive.forceZip64||this._entries.length>s.ZIP64_MAGIC_SHORT||this._archive.centralLength>s.ZIP64_MAGIC||this._archive.centralOffset>s.ZIP64_MAGIC},a.prototype.setComment=function(t){this._archive.comment=t},$c.exports}function Jc(){return Uc?zc:(Uc=1,zc={ArchiveEntry:hc(),ZipArchiveEntry:xc(),ArchiveOutputStream:Lc(),ZipArchiveOutputStream:Kc()})}
15
+ /**
16
+ * ZipStream
17
+ *
18
+ * @ignore
19
+ * @license [MIT]{@link https://github.com/archiverjs/node-zip-stream/blob/master/LICENSE}
20
+ * @copyright (c) 2014 Chris Talkington, contributors.
21
+ */function Xc(){if(qc)return Gc;qc=1;var t=function(){if(Wc)return cc.exports;Wc=1;var t=y.inherits,e=Jc().ZipArchiveOutputStream,r=Jc().ZipArchiveEntry,n=rc(),i=cc.exports=function(t){if(!(this instanceof i))return new i(t);(t=this.options=t||{}).zlib=t.zlib||{},e.call(this,t),"number"==typeof t.level&&t.level>=0&&(t.zlib.level=t.level,delete t.level),t.forceZip64||"number"!=typeof t.zlib.level||0!==t.zlib.level||(t.store=!0),t.namePrependSlash=t.namePrependSlash||!1,t.comment&&t.comment.length>0&&this.setComment(t.comment)};return t(i,e),i.prototype._normalizeFileData=function(t){var e="directory"===(t=n.defaults(t,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""})).type,r="symlink"===t.type;return t.name&&(t.name=n.sanitizePath(t.name),r||"/"!==t.name.slice(-1)?e&&(t.name+="/"):(e=!0,t.type="directory")),(e||r)&&(t.store=!0),t.date=n.dateify(t.date),t},i.prototype.entry=function(t,n,i){if("function"!=typeof i&&(i=this._emitErrorCallback.bind(this)),"file"===(n=this._normalizeFileData(n)).type||"directory"===n.type||"symlink"===n.type)if("string"==typeof n.name&&0!==n.name.length){if("symlink"!==n.type||"string"==typeof n.linkname){var s=new r(n.name);return s.setTime(n.date,this.options.forceLocalTime),n.namePrependSlash&&s.setName(n.name,!0),n.store&&s.setMethod(0),n.comment.length>0&&s.setComment(n.comment),"symlink"===n.type&&"number"!=typeof n.mode&&(n.mode=40960),"number"==typeof n.mode&&("symlink"===n.type&&(n.mode|=40960),s.setUnixMode(n.mode)),"symlink"===n.type&&"string"==typeof n.linkname&&(t=Buffer.from(n.linkname)),e.prototype.entry.call(this,s,t,i)}i(new Error("entry linkname must be a non-empty string value when type equals symlink"))}else i(new Error("entry name must be a non-empty string value"));else i(new Error(n.type+" entries not currently supported"))},i.prototype.finalize=function(){this.finish()},cc.exports}
22
+ /**
23
+ * ZIP Format Plugin
24
+ *
25
+ * @module plugins/zip
26
+ * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
27
+ * @copyright (c) 2012-2014 Chris Talkington, contributors.
28
+ */(),e=rc(),r=function(n){if(!(this instanceof r))return new r(n);n=this.options=e.defaults(n,{comment:"",forceUTC:!1,namePrependSlash:!1,store:!1}),this.supports={directory:!0,symlink:!0},this.engine=new t(n)};return r.prototype.append=function(t,e,r){this.engine.entry(t,e,r)},r.prototype.finalize=function(){this.engine.finalize()},r.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)},r.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)},r.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)},Gc=r}var tl,el,rl,nl,il,sl,ol,al,ul,cl,ll,hl,fl,dl,pl,gl,yl={};function ml(){if(sl)return il;sl=1;const t=nl?rl:(nl=1,rl=class{constructor(t){if(!(t>0)||t-1&t)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(t),this.mask=t-1,this.top=0,this.btm=0,this.next=null}clear(){this.top=this.btm=0,this.next=null,this.buffer.fill(void 0)}push(t){return void 0===this.buffer[this.top]&&(this.buffer[this.top]=t,this.top=this.top+1&this.mask,!0)}shift(){const t=this.buffer[this.btm];if(void 0!==t)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,t}peek(){return this.buffer[this.btm]}isEmpty(){return void 0===this.buffer[this.btm]}});return il=class{constructor(e){this.hwm=e||16,this.head=new t(this.hwm),this.tail=this.head,this.length=0}clear(){this.head=this.tail,this.head.clear(),this.length=0}push(e){if(this.length++,!this.head.push(e)){const r=this.head;this.head=r.next=new t(2*this.head.buffer.length),this.head.push(e)}}shift(){0!==this.length&&this.length--;const t=this.tail.shift();if(void 0===t&&this.tail.next){const t=this.tail.next;return this.tail.next=null,this.tail=t,this.tail.shift()}return t}peek(){const t=this.tail.peek();return void 0===t&&this.tail.next?this.tail.next.peek():t}isEmpty(){return 0===this.length}}}function bl(){if(al)return ol;function t(t){return Buffer.isBuffer(t)?t:Buffer.from(t.buffer,t.byteOffset,t.byteLength)}return al=1,ol={isBuffer:function(t){return Buffer.isBuffer(t)||t instanceof Uint8Array},isEncoding:function(t){return Buffer.isEncoding(t)},alloc:function(t,e,r){return Buffer.alloc(t,e,r)},allocUnsafe:function(t){return Buffer.allocUnsafe(t)},allocUnsafeSlow:function(t){return Buffer.allocUnsafeSlow(t)},byteLength:function(t,e){return Buffer.byteLength(t,e)},compare:function(t,e){return Buffer.compare(t,e)},concat:function(t,e){return Buffer.concat(t,e)},copy:function(e,r,n,i,s){return t(e).copy(r,n,i,s)},equals:function(e,r){return t(e).equals(r)},fill:function(e,r,n,i,s){return t(e).fill(r,n,i,s)},from:function(t,e,r){return Buffer.from(t,e,r)},includes:function(e,r,n,i){return t(e).includes(r,n,i)},indexOf:function(e,r,n,i){return t(e).indexOf(r,n,i)},lastIndexOf:function(e,r,n,i){return t(e).lastIndexOf(r,n,i)},swap16:function(e){return t(e).swap16()},swap32:function(e){return t(e).swap32()},swap64:function(e){return t(e).swap64()},toBuffer:t,toString:function(e,r,n,i){return t(e).toString(r,n,i)},write:function(e,r,n,i,s){return t(e).write(r,n,i,s)},readDoubleBE:function(e,r){return t(e).readDoubleBE(r)},readDoubleLE:function(e,r){return t(e).readDoubleLE(r)},readFloatBE:function(e,r){return t(e).readFloatBE(r)},readFloatLE:function(e,r){return t(e).readFloatLE(r)},readInt32BE:function(e,r){return t(e).readInt32BE(r)},readInt32LE:function(e,r){return t(e).readInt32LE(r)},readUInt32BE:function(e,r){return t(e).readUInt32BE(r)},readUInt32LE:function(e,r){return t(e).readUInt32LE(r)},writeDoubleBE:function(e,r,n){return t(e).writeDoubleBE(r,n)},writeDoubleLE:function(e,r,n){return t(e).writeDoubleLE(r,n)},writeFloatBE:function(e,r,n){return t(e).writeFloatBE(r,n)},writeFloatLE:function(e,r,n){return t(e).writeFloatLE(r,n)},writeInt32BE:function(e,r,n){return t(e).writeInt32BE(r,n)},writeInt32LE:function(e,r,n){return t(e).writeInt32LE(r,n)},writeUInt32BE:function(e,r,n){return t(e).writeUInt32BE(r,n)},writeUInt32LE:function(e,r,n){return t(e).writeUInt32LE(r,n)}},ol}function _l(){if(hl)return ll;hl=1;const t=bl();function e(t,e){const r=t.byteLength;if(r<=e)return 0;const n=Math.max(e,r-4);let i=r-1;for(;i>n&&128==(192&t[i]);)i--;if(i<e)return 0;const s=t[i];let o;if(s<=127)return 0;if(s>=194&&s<=223)o=2;else if(s>=224&&s<=239)o=3;else{if(!(s>=240&&s<=244))return 0;o=4}const a=r-i;return a<o?a:0}return ll=class{constructor(){this._reset()}get remaining(){return this.bytesSeen}decode(r){if(0===r.byteLength)return"";if(0===this.bytesNeeded&&0===e(r,0))return this.bytesSeen=function(t){const e=t.byteLength;if(0===e)return 0;const r=t[e-1];if(r<=127)return 0;if(128!=(192&r))return 1;const n=Math.max(0,e-4);let i=e-2;for(;i>=n&&128==(192&t[i]);)i--;if(i<0)return 1;const s=t[i];let o;if(s>=194&&s<=223)o=2;else if(s>=224&&s<=239)o=3;else{if(!(s>=240&&s<=244))return 1;o=4}if(e-i!==o)return 1;if(o>=3){const e=t[i+1];if(224===s&&e<160)return 1;if(237===s&&e>159)return 1;if(240===s&&e<144)return 1;if(244===s&&e>143)return 1}return 0}(r),t.toString(r,"utf8");let n="",i=0;if(this.bytesNeeded>0){for(;i<r.byteLength;){const t=r[i];if(t<this.lowerBoundary||t>this.upperBoundary){n+="�",this._reset();break}if(this.lowerBoundary=128,this.upperBoundary=191,this.codePoint=this.codePoint<<6|63&t,this.bytesSeen++,i++,this.bytesSeen===this.bytesNeeded){n+=String.fromCodePoint(this.codePoint),this._reset();break}}if(this.bytesNeeded>0)return n}const s=e(r,i),o=r.byteLength-s;o>i&&(n+=t.toString(r,"utf8",i,o));for(let t=o;t<r.byteLength;t++){const e=r[t];0!==this.bytesNeeded?e<this.lowerBoundary||e>this.upperBoundary?(n+="�",t--,this._reset()):(this.lowerBoundary=128,this.upperBoundary=191,this.codePoint=this.codePoint<<6|63&e,this.bytesSeen++,this.bytesSeen===this.bytesNeeded&&(n+=String.fromCodePoint(this.codePoint),this._reset())):e<=127?(this.bytesSeen=0,n+=String.fromCharCode(e)):e>=194&&e<=223?(this.bytesNeeded=2,this.bytesSeen=1,this.codePoint=31&e):e>=224&&e<=239?(224===e?this.lowerBoundary=160:237===e&&(this.upperBoundary=159),this.bytesNeeded=3,this.bytesSeen=1,this.codePoint=15&e):e>=240&&e<=244?(240===e?this.lowerBoundary=144:244===e&&(this.upperBoundary=143),this.bytesNeeded=4,this.bytesSeen=1,this.codePoint=7&e):(this.bytesSeen=1,n+="�")}return n}flush(){const t=this.bytesNeeded>0?"�":"";return this._reset(),t}_reset(){this.codePoint=0,this.bytesNeeded=0,this.bytesSeen=0,this.lowerBoundary=128,this.upperBoundary=191}}}function vl(){if(dl)return fl;dl=1;const t=function(){if(cl)return ul;cl=1;const t=bl();return ul=class{constructor(t){this.encoding=t}get remaining(){return 0}decode(e){return t.toString(e,this.encoding)}flush(){return""}}}(),e=_l();return fl=class{constructor(r="utf8"){switch(this.encoding=function(t){switch(t=t.toLowerCase()){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:throw new Error("Unknown encoding: "+t)}}(r),this.encoding){case"utf8":this.decoder=new e;break;case"utf16le":case"base64":throw new Error("Unsupported encoding: "+this.encoding);default:this.decoder=new t(this.encoding)}}get remaining(){return this.decoder.remaining}push(t){return"string"==typeof t?t:this.decoder.decode(t)}write(t){return this.push(t)}end(t){let e="";return t&&(e=this.push(t)),e+=this.decoder.flush(),e}}}function wl(){if(gl)return pl;gl=1;const{EventEmitter:t}=el?tl:(el=1,tl=f),e=new Error("Stream was destroyed"),r=new Error("Premature close"),n=ml(),i=vl(),s="undefined"==typeof queueMicrotask?t=>A.process.nextTick(t):queueMicrotask,o=536870911,a=1^o,u=2^o,c=32,l=64,h=128,d=256,p=1024,g=2048,y=4096,m=8192,b=16384,_=32768,v=131072,w=131328,S=16^o,E=536805375,k=768^o,x=536838143,O=536739839,T=1<<18,R=2<<18,I=4<<18,j=8<<18,L=16<<18,M=32<<18,D=64<<18,P=128<<18,N=256<<18,C=512<<18,B=1024<<18,F=535822335,z=503316479,U=268435455,W=262160,G=536608751,q=8404992,$=14,H=15,Z=8405006,V=33587200,Q=33587215,Y=2359296,K=270794767,J=Symbol.asyncIterator||Symbol("asyncIterator");class X{constructor(t,{highWaterMark:e=16384,map:r=null,mapWritable:i,byteLength:s,byteLengthWritable:o}={}){this.stream=t,this.queue=new n,this.highWaterMark=e,this.buffered=0,this.error=null,this.pipeline=null,this.drains=null,this.byteLength=o||s||Et,this.map=i||r,this.afterWrite=ot.bind(this),this.afterUpdateNextTick=ct.bind(this)}get ended(){return 0!==(this.stream._duplexState&M)}push(t){return!(142606350&this.stream._duplexState)&&(null!==this.map&&(t=this.map(t)),this.buffered+=this.byteLength(t),this.queue.push(t),this.buffered<this.highWaterMark?(this.stream._duplexState|=j,!0):(this.stream._duplexState|=6291456,!1))}shift(){const t=this.queue.shift();return this.buffered-=this.byteLength(t),0===this.buffered&&(this.stream._duplexState&=534773759),t}end(t){"function"==typeof t?this.stream.once("finish",t):null!=t&&this.push(t),this.stream._duplexState=(this.stream._duplexState|C)&F}autoBatch(t,e){const r=[],n=this.stream;for(r.push(t);(n._duplexState&K)===Y;)r.push(n._writableState.shift());if(0!==(n._duplexState&H))return e(null);n._writev(r,e)}update(){const t=this.stream;t._duplexState|=R;do{for(;(t._duplexState&K)===j;){const e=this.shift();t._duplexState|=67371008,t._write(e,this.afterWrite)}1310720&t._duplexState||this.updateNonPrimary()}while(!0===this.continueUpdate());t._duplexState&=536346623}updateNonPrimary(){const t=this.stream;if((144965647&t._duplexState)===C)return t._duplexState=t._duplexState|T,void t._final(it.bind(this));4!==(t._duplexState&$)?1===(t._duplexState&Q)&&(t._duplexState=(t._duplexState|W)&a,t._open(lt.bind(this))):0===(t._duplexState&V)&&(t._duplexState|=W,t._destroy(st.bind(this)))}continueUpdate(){return 0!==(this.stream._duplexState&P)&&(this.stream._duplexState&=z,!0)}updateCallback(){(35127311&this.stream._duplexState)===I?this.update():this.updateNextTick()}updateNextTick(){0===(this.stream._duplexState&P)&&(this.stream._duplexState|=P,0===(this.stream._duplexState&R)&&s(this.afterUpdateNextTick))}}class tt{constructor(t,{highWaterMark:e=16384,map:r=null,mapReadable:i,byteLength:s,byteLengthReadable:o}={}){this.stream=t,this.queue=new n,this.highWaterMark=0===e?1:e,this.buffered=0,this.readAhead=e>0,this.error=null,this.pipeline=null,this.byteLength=o||s||Et,this.map=i||r,this.pipeTo=null,this.afterRead=at.bind(this),this.afterUpdateNextTick=ut.bind(this)}get ended(){return 0!==(this.stream._duplexState&b)}pipe(t,e){if(null!==this.pipeTo)throw new Error("Can only pipe to one destination");if("function"!=typeof e&&(e=null),this.stream._duplexState|=512,this.pipeTo=t,this.pipeline=new rt(this.stream,t,e),e&&this.stream.on("error",kt),St(t))t._writableState.pipeline=this.pipeline,e&&t.on("error",kt),t.on("finish",this.pipeline.finished.bind(this.pipeline));else{const e=this.pipeline.done.bind(this.pipeline,t),r=this.pipeline.done.bind(this.pipeline,t,null);t.on("error",e),t.on("close",r),t.on("finish",this.pipeline.finished.bind(this.pipeline))}t.on("drain",nt.bind(this)),this.stream.emit("piping",t),t.emit("pipe",this.stream)}push(t){const e=this.stream;return null===t?(this.highWaterMark=0,e._duplexState=536805311&e._duplexState|1024,!1):null!==this.map&&null===(t=this.map(t))?(e._duplexState&=E,this.buffered<this.highWaterMark):(this.buffered+=this.byteLength(t),this.queue.push(t),e._duplexState=(e._duplexState|h)&E,this.buffered<this.highWaterMark)}shift(){const t=this.queue.shift();return this.buffered-=this.byteLength(t),0===this.buffered&&(this.stream._duplexState&=536862591),t}unshift(t){const e=[null!==this.map?this.map(t):t];for(;this.buffered>0;)e.push(this.shift());for(let t=0;t<e.length-1;t++){const r=e[t];this.buffered+=this.byteLength(r),this.queue.push(r)}this.push(e[e.length-1])}read(){const t=this.stream;if((16527&t._duplexState)===h){const e=this.shift();return null!==this.pipeTo&&!1===this.pipeTo.write(e)&&(t._duplexState&=k),0!==(t._duplexState&g)&&t.emit("data",e),e}return!1===this.readAhead&&(t._duplexState|=v,this.updateNextTick()),null}drain(){const t=this.stream;for(;(16527&t._duplexState)===h&&768&t._duplexState;){const e=this.shift();null!==this.pipeTo&&!1===this.pipeTo.write(e)&&(t._duplexState&=k),0!==(t._duplexState&g)&&t.emit("data",e)}}update(){const t=this.stream;t._duplexState|=c;do{for(this.drain();this.buffered<this.highWaterMark&&(214047&t._duplexState)===v;)t._duplexState|=65552,t._read(this.afterRead),this.drain();4224==(12431&t._duplexState)&&(t._duplexState|=m,t.emit("readable")),80&t._duplexState||this.updateNonPrimary()}while(!0===this.continueUpdate());t._duplexState&=536870879}updateNonPrimary(){const t=this.stream;(1167&t._duplexState)===p&&(t._duplexState=536869887&t._duplexState|16384,t.emit("end"),(t._duplexState&Z)===q&&(t._duplexState|=4),null!==this.pipeTo&&this.pipeTo.end()),4!==(t._duplexState&$)?1===(t._duplexState&Q)&&(t._duplexState=(t._duplexState|W)&a,t._open(lt.bind(this))):0===(t._duplexState&V)&&(t._duplexState|=W,t._destroy(st.bind(this)))}continueUpdate(){return 0!==(this.stream._duplexState&_)&&(this.stream._duplexState&=x,!0)}updateCallback(){(32879&this.stream._duplexState)===l?this.update():this.updateNextTick()}updateNextTickIfOpen(){32769&this.stream._duplexState||(this.stream._duplexState|=_,0===(this.stream._duplexState&c)&&s(this.afterUpdateNextTick))}updateNextTick(){0===(this.stream._duplexState&_)&&(this.stream._duplexState|=_,0===(this.stream._duplexState&c)&&s(this.afterUpdateNextTick))}}class et{constructor(t){this.data=null,this.afterTransform=ht.bind(t),this.afterFinal=null}}class rt{constructor(t,e,r){this.from=t,this.to=e,this.afterPipe=r,this.error=null,this.pipeToFinished=!1}finished(){this.pipeToFinished=!0}done(t,e){e&&(this.error=e),t!==this.to||(this.to=null,null===this.from)?t!==this.from||(this.from=null,null===this.to)?(null!==this.afterPipe&&this.afterPipe(this.error),this.to=this.from=this.afterPipe=null):0===(t._duplexState&b)&&this.to.destroy(this.error||new Error("Readable stream closed before ending")):0!==(this.from._duplexState&b)&&this.pipeToFinished||this.from.destroy(this.error||new Error("Writable stream closed prematurely"))}}function nt(){this.stream._duplexState|=512,this.updateCallback()}function it(t){const e=this.stream;t&&e.destroy(t),0===(e._duplexState&$)&&(e._duplexState|=M,e.emit("finish")),(e._duplexState&Z)===q&&(e._duplexState|=4),e._duplexState&=402391039,0===(e._duplexState&R)?this.update():this.updateNextTick()}function st(t){const r=this.stream;t||this.error===e||(t=this.error),t&&r.emit("error",t),r._duplexState|=8,r.emit("close");const n=r._readableState,i=r._writableState;if(null!==n&&null!==n.pipeline&&n.pipeline.done(r,t),null!==i){for(;null!==i.drains&&i.drains.length>0;)i.drains.shift().resolve(!1);null!==i.pipeline&&i.pipeline.done(r,t)}}function ot(t){const e=this.stream;t&&e.destroy(t),e._duplexState&=469499903,null!==this.drains&&function(t){for(let e=0;e<t.length;e++)0===--t[e].writes&&(t.shift().resolve(!0),e--)}(this.drains),(6553615&e._duplexState)===L&&(e._duplexState&=532676607,(e._duplexState&D)===D&&e.emit("drain")),this.updateCallback()}function at(t){t&&this.stream.destroy(t),this.stream._duplexState&=S,!1===this.readAhead&&0===(this.stream._duplexState&d)&&(this.stream._duplexState&=O),this.updateCallback()}function ut(){0===(this.stream._duplexState&c)&&(this.stream._duplexState&=x,this.update())}function ct(){0===(this.stream._duplexState&R)&&(this.stream._duplexState&=z,this.update())}function lt(t){const e=this.stream;t&&e.destroy(t),4&e._duplexState||(17423&e._duplexState||(e._duplexState|=l),142606351&e._duplexState||(e._duplexState|=I),e.emit("open")),e._duplexState&=G,null!==e._writableState&&e._writableState.updateCallback(),null!==e._readableState&&e._readableState.updateCallback()}function ht(t,e){null!=e&&this.push(e),this._writableState.afterWrite(t)}function ft(t){null!==this._readableState&&("data"===t&&(this._duplexState|=133376,this._readableState.updateNextTick()),"readable"===t&&(this._duplexState|=y,this._readableState.updateNextTick())),null!==this._writableState&&"drain"===t&&(this._duplexState|=D,this._writableState.updateNextTick())}class dt extends t{constructor(t){super(),this._duplexState=0,this._readableState=null,this._writableState=null,t&&(t.open&&(this._open=t.open),t.destroy&&(this._destroy=t.destroy),t.predestroy&&(this._predestroy=t.predestroy),t.signal&&t.signal.addEventListener("abort",xt.bind(this))),this.on("newListener",ft)}_open(t){t(null)}_destroy(t){t(null)}_predestroy(){}get readable(){return null!==this._readableState||void 0}get writable(){return null!==this._writableState||void 0}get destroyed(){return!!(8&this._duplexState)}get destroying(){return 0!==(this._duplexState&$)}destroy(t){0===(this._duplexState&$)&&(t||(t=e),this._duplexState=535822271&this._duplexState|4,null!==this._readableState&&(this._readableState.highWaterMark=0,this._readableState.error=t),null!==this._writableState&&(this._writableState.highWaterMark=0,this._writableState.error=t),this._duplexState|=2,this._predestroy(),this._duplexState&=u,null!==this._readableState&&this._readableState.updateNextTick(),null!==this._writableState&&this._writableState.updateNextTick())}}class pt extends dt{constructor(t){super(t),this._duplexState|=8519681,this._readableState=new tt(this,t),t&&(!1===this._readableState.readAhead&&(this._duplexState&=O),t.read&&(this._read=t.read),t.eagerOpen&&this._readableState.updateNextTick(),t.encoding&&this.setEncoding(t.encoding))}setEncoding(t){const e=new i(t),r=this._readableState.map||vt;return this._readableState.map=function(t){const n=e.push(t);return""===n&&(0!==t.byteLength||e.remaining>0)?null:r(n)},this}_read(t){t(null)}pipe(t,e){return this._readableState.updateNextTick(),this._readableState.pipe(t,e),t}read(){return this._readableState.updateNextTick(),this._readableState.read()}push(t){return this._readableState.updateNextTickIfOpen(),this._readableState.push(t)}unshift(t){return this._readableState.updateNextTickIfOpen(),this._readableState.unshift(t)}resume(){return this._duplexState|=w,this._readableState.updateNextTick(),this}pause(){return this._duplexState&=!1===this._readableState.readAhead?536739583:536870655,this}static _fromAsyncIterator(t,e){let r;const n=new pt({...e,read(e){t.next().then(i).then(e.bind(null,null)).catch(e)},predestroy(){r=t.return()},destroy(t){if(!r)return t(null);r.then(t.bind(null,null)).catch(t)}});return n;function i(t){t.done?n.push(null):n.push(t.value)}}static from(t,e){if(function(t){return St(t)&&t.readable}(t))return t;if(t[J])return this._fromAsyncIterator(t[J](),e);Array.isArray(t)||(t=void 0===t?[]:[t]);let r=0;return new pt({...e,read(e){this.push(r===t.length?null:t[r++]),e(null)}})}static isBackpressured(t){return!!(17422&t._duplexState)||t._readableState.buffered>=t._readableState.highWaterMark}static isPaused(t){return 0===(t._duplexState&d)}[J](){const t=this;let r=null,n=null,i=null;return this.on("error",t=>{r=t}),this.on("readable",function(){null!==n&&s(t.read())}),this.on("close",function(){null!==n&&s(null)}),{[J](){return this},next:()=>new Promise(function(e,r){n=e,i=r;const o=t.read();null!==o?s(o):8&t._duplexState&&s(null)}),return:()=>o(null),throw:t=>o(t)};function s(s){null!==i&&(r?i(r):null===s&&0===(t._duplexState&b)?i(e):n({value:s,done:null===s}),i=n=null)}function o(e){return t.destroy(e),new Promise((r,n)=>{if(8&t._duplexState)return r({value:void 0,done:!0});t.once("close",function(){e?n(e):r({value:void 0,done:!0})})})}}}class gt extends dt{constructor(t){super(t),this._duplexState|=16385,this._writableState=new X(this,t),t&&(t.writev&&(this._writev=t.writev),t.write&&(this._write=t.write),t.final&&(this._final=t.final),t.eagerOpen&&this._writableState.updateNextTick())}cork(){this._duplexState|=B}uncork(){this._duplexState&=U,this._writableState.updateNextTick()}_writev(t,e){e(null)}_write(t,e){this._writableState.autoBatch(t,e)}_final(t){t(null)}static isBackpressured(t){return!!(146800654&t._duplexState)}static drained(t){if(t.destroyed)return Promise.resolve(!1);const e=t._writableState;var r;const n=((r=t)._writev!==gt.prototype._writev&&r._writev!==yt.prototype._writev?Math.min(1,e.queue.length):e.queue.length)+(t._duplexState&N?1:0);return 0===n?Promise.resolve(!0):(null===e.drains&&(e.drains=[]),new Promise(t=>{e.drains.push({writes:n,resolve:t})}))}write(t){return this._writableState.updateNextTick(),this._writableState.push(t)}end(t){return this._writableState.updateNextTick(),this._writableState.end(t),this}}class yt extends pt{constructor(t){super(t),this._duplexState=1|this._duplexState&v,this._writableState=new X(this,t),t&&(t.writev&&(this._writev=t.writev),t.write&&(this._write=t.write),t.final&&(this._final=t.final))}cork(){this._duplexState|=B}uncork(){this._duplexState&=U,this._writableState.updateNextTick()}_writev(t,e){e(null)}_write(t,e){this._writableState.autoBatch(t,e)}_final(t){t(null)}write(t){return this._writableState.updateNextTick(),this._writableState.push(t)}end(t){return this._writableState.updateNextTick(),this._writableState.end(t),this}}class mt extends yt{constructor(t){super(t),this._transformState=new et(this),t&&(t.transform&&(this._transform=t.transform),t.flush&&(this._flush=t.flush))}_write(t,e){this._readableState.buffered>=this._readableState.highWaterMark?this._transformState.data=t:this._transform(t,this._transformState.afterTransform)}_read(t){if(null!==this._transformState.data){const e=this._transformState.data;this._transformState.data=null,t(null),this._transform(e,this._transformState.afterTransform)}else t(null)}destroy(t){super.destroy(t),null!==this._transformState.data&&(this._transformState.data=null,this._transformState.afterTransform())}_transform(t,e){e(null,t)}_flush(t){t(null)}_final(t){this._transformState.afterFinal=t,this._flush(bt.bind(this))}}function bt(t,e){const r=this._transformState.afterFinal;if(t)return r(t);null!=e&&this.push(e),this.push(null),r(null)}function _t(t,...e){const n=Array.isArray(t)?[...t,...e]:[t,...e],i=n.length&&"function"==typeof n[n.length-1]?n.pop():null;if(n.length<2)throw new Error("Pipeline requires at least 2 streams");let s=n[0],o=null,a=null;for(let t=1;t<n.length;t++)o=n[t],St(s)?s.pipe(o,c):(u(s,!0,t>1,c),s.pipe(o)),s=o;if(i){let t=!1;const e=St(o)||!(!o._writableState||!o._writableState.autoDestroy);o.on("error",t=>{null===a&&(a=t)}),o.on("finish",()=>{t=!0,e||i(a)}),e&&o.on("close",()=>i(a||(t?null:r)))}return o;function u(t,e,n,i){t.on("error",i),t.on("close",function(){if(t._readableState&&!t._readableState.ended)return i(r);if(n&&t._writableState&&!t._writableState.ended)return i(r)})}function c(t){if(t&&!a){a=t;for(const e of n)e.destroy(t)}}}function vt(t){return t}function wt(t){return!!t._readableState||!!t._writableState}function St(t){return"number"==typeof t._duplexState&&wt(t)}function Et(t){return function(t){return"object"==typeof t&&null!==t&&"number"==typeof t.byteLength}(t)?t.byteLength:1024}function kt(){}function xt(){this.destroy(new Error("Stream aborted."))}return pl={pipeline:_t,pipelinePromise:function(...t){return new Promise((e,r)=>_t(...t,t=>{if(t)return r(t);e()}))},isStream:wt,isStreamx:St,isEnded:function(t){return!!t._readableState&&t._readableState.ended},isFinished:function(t){return!!t._writableState&&t._writableState.ended},isDisturbed:function(t){return!!(1&~t._duplexState)||0!==(t._duplexState&V)},getStreamError:function(t,r={}){const n=t._readableState&&t._readableState.error||t._writableState&&t._writableState.error;return r.all||n!==e?n:null},Stream:dt,Writable:gt,Readable:pt,Duplex:yt,Transform:mt,PassThrough:class extends mt{}},pl}var Sl,El,kl,xl={};function Ol(){if(Sl)return xl;Sl=1;const t=bl(),e="0".charCodeAt(0),r=t.from([117,115,116,97,114,0]),n=t.from([e,e]),i=t.from([117,115,116,97,114,32]),s=t.from([32,0]),o=257,a=263;function u(t,e,r,n){for(;r<n;r++)if(t[r]===e)return r;return n}function c(t){let e=256;for(let r=0;r<148;r++)e+=t[r];for(let r=156;r<512;r++)e+=t[r];return e}function l(t,e){return(t=t.toString(8)).length>e?"7777777777777777777".slice(0,e)+" ":"0000000000000000000".slice(0,e-t.length)+t+" "}function h(e,r,n){if(128&(e=e.subarray(r,r+n))[r=0])return function(t){let e;if(128===t[0])e=!0;else{if(255!==t[0])return null;e=!1}const r=[];let n;for(n=t.length-1;n>0;n--){const i=t[n];e?r.push(i):r.push(255-i)}let i=0;const s=r.length;for(n=0;n<s;n++)i+=r[n]*Math.pow(256,n);return e?i:-1*i}(e);{for(;r<e.length&&32===e[r];)r++;const n=function(t,e,r){return"number"!=typeof t?r:(t=~~t)>=e?e:t>=0||(t+=e)>=0?t:0}(u(e,32,r,e.length),e.length,e.length);for(;r<n&&0===e[r];)r++;return n===r?0:parseInt(t.toString(e.subarray(r,n)),8)}}function f(e,r,n,i){return t.toString(e.subarray(r,u(e,0,r,r+n)),i)}function d(e){const r=t.byteLength(e);let n=Math.floor(Math.log(r)/Math.log(10))+1;return r+n>=Math.pow(10,n)&&n++,r+n+e}return xl.decodeLongPath=function(t,e){return f(t,0,t.length,e)},xl.encodePax=function(e){let r="";e.name&&(r+=d(" path="+e.name+"\n")),e.linkname&&(r+=d(" linkpath="+e.linkname+"\n"));const n=e.pax;if(n)for(const t in n)r+=d(" "+t+"="+n[t]+"\n");return t.from(r)},xl.decodePax=function(e){const r={};for(;e.length;){let n=0;for(;n<e.length&&32!==e[n];)n++;const i=parseInt(t.toString(e.subarray(0,n)),10);if(!i)return r;const s=t.toString(e.subarray(n+1,i-1)),o=s.indexOf("=");if(-1===o)return r;r[s.slice(0,o)]=s.slice(o+1),e=e.subarray(i)}return r},xl.encode=function(i){const s=t.alloc(512);let a=i.name,u="";if(5===i.typeflag&&"/"!==a[a.length-1]&&(a+="/"),t.byteLength(a)!==a.length)return null;for(;t.byteLength(a)>100;){const t=a.indexOf("/");if(-1===t)return null;u+=u?"/"+a.slice(0,t):a.slice(0,t),a=a.slice(t+1)}return t.byteLength(a)>100||t.byteLength(u)>155||i.linkname&&t.byteLength(i.linkname)>100?null:(t.write(s,a),t.write(s,l(4095&i.mode,6),100),t.write(s,l(i.uid,6),108),t.write(s,l(i.gid,6),116),function(e,r,n){e.toString(8).length>11?function(t,e,r){e[r]=128;for(let n=11;n>0;n--)e[r+n]=255&t,t=Math.floor(t/256)}(e,r,n):t.write(r,l(e,11),n)}(i.size,s,124),t.write(s,l(i.mtime.getTime()/1e3|0,11),136),s[156]=e+function(t){switch(t){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0}(i.type),i.linkname&&t.write(s,i.linkname,157),t.copy(r,s,o),t.copy(n,s,263),i.uname&&t.write(s,i.uname,265),i.gname&&t.write(s,i.gname,297),t.write(s,l(i.devmajor||0,6),329),t.write(s,l(i.devminor||0,6),337),u&&t.write(s,u,345),t.write(s,l(c(s),6),148),s)},xl.decode=function(n,u,l){let d=0===n[156]?0:n[156]-e,p=f(n,0,100,u);const g=h(n,100,8),y=h(n,108,8),m=h(n,116,8),b=h(n,124,12),_=h(n,136,12),v=function(t){switch(t){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null}(d),w=0===n[157]?null:f(n,157,100,u),S=f(n,265,32),E=f(n,297,32),k=h(n,329,8),x=h(n,337,8),O=c(n);if(256===O)return null;if(O!==h(n,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(function(e){return t.equals(r,e.subarray(o,263))}(n))n[345]&&(p=f(n,345,155,u)+"/"+p);else if(function(e){return t.equals(i,e.subarray(o,263))&&t.equals(s,e.subarray(a,265))}(n));else if(!l)throw new Error("Invalid tar header: unknown format.");return 0===d&&p&&"/"===p[p.length-1]&&(d=5),{name:p,mode:g,uid:y,gid:m,size:b,mtime:new Date(1e3*_),type:v,linkname:w,uname:S,gname:E,devmajor:k,devminor:x,pax:null}},xl}var Tl,Rl,Il,jl,Ll,Al,Ml,Dl,Pl,Nl,Cl,Bl,Fl={exports:{}};function zl(){if(Tl)return Fl.exports;Tl=1;const t={S_IFMT:61440,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960};try{Fl.exports=require("fs").constants||t}catch{Fl.exports=t}return Fl.exports}function Ul(){if(Il)return Rl;Il=1;const{Readable:t,Writable:e,getStreamError:r}=wl(),n=bl(),i=zl(),s=Ol(),o=n.alloc(1024);class a extends e{constructor(t,e,r){super({mapWritable:h,eagerOpen:!0}),this.written=0,this.header=e,this._callback=r,this._linkname=null,this._isLinkname="symlink"===e.type&&!e.linkname,this._isVoid="file"!==e.type&&"contiguous-file"!==e.type,this._finished=!1,this._pack=t,this._openCallback=null,null===this._pack._stream?this._pack._stream=this:this._pack._pending.push(this)}_open(t){this._openCallback=t,this._pack._stream===this&&this._continueOpen()}_continuePack(t){if(null===this._callback)return;const e=this._callback;this._callback=null,e(t)}_continueOpen(){null===this._pack._stream&&(this._pack._stream=this);const t=this._openCallback;if(this._openCallback=null,null!==t){if(this._pack.destroying)return t(new Error("pack stream destroyed"));if(this._pack._finalized)return t(new Error("pack stream is already finalized"));this._pack._stream=this,this._isLinkname||this._pack._encode(this.header),this._isVoid&&(this._finish(),this._continuePack(null)),t(null)}}_write(t,e){return this._isLinkname?(this._linkname=this._linkname?n.concat([this._linkname,t]):t,e(null)):this._isVoid?t.byteLength>0?e(new Error("No body allowed for this entry")):e():(this.written+=t.byteLength,this._pack.push(t)?e():void(this._pack._drain=e))}_finish(){this._finished||(this._finished=!0,this._isLinkname&&(this.header.linkname=this._linkname?n.toString(this._linkname,"utf-8"):"",this._pack._encode(this.header)),l(this._pack,this.header.size),this._pack._done(this))}_final(t){if(this.written!==this.header.size)return t(new Error("Size mismatch"));this._finish(),t(null)}_getError(){return r(this)||new Error("tar entry destroyed")}_predestroy(){this._pack.destroy(this._getError())}_destroy(t){this._pack._done(this),this._continuePack(this._finished?null:this._getError()),t()}}class u extends t{constructor(t){super(t),this._drain=c,this._finalized=!1,this._finalizing=!1,this._pending=[],this._stream=null}entry(t,e,r){if(this._finalized||this.destroying)throw new Error("already finalized or destroyed");"function"==typeof e&&(r=e,e=null),r||(r=c),t.size&&"symlink"!==t.type||(t.size=0),t.type||(t.type=function(t){switch(t&i.S_IFMT){case i.S_IFBLK:return"block-device";case i.S_IFCHR:return"character-device";case i.S_IFDIR:return"directory";case i.S_IFIFO:return"fifo";case i.S_IFLNK:return"symlink"}return"file"}(t.mode)),t.mode||(t.mode="directory"===t.type?493:420),t.uid||(t.uid=0),t.gid||(t.gid=0),t.mtime||(t.mtime=new Date),"string"==typeof e&&(e=n.from(e));const s=new a(this,t,r);return n.isBuffer(e)?(t.size=e.byteLength,s.write(e),s.end(),s):(s._isVoid,s)}finalize(){this._stream||this._pending.length>0?this._finalizing=!0:this._finalized||(this._finalized=!0,this.push(o),this.push(null))}_done(t){t===this._stream&&(this._stream=null,this._finalizing&&this.finalize(),this._pending.length&&this._pending.shift()._continueOpen())}_encode(t){if(!t.pax){const e=s.encode(t);if(e)return void this.push(e)}this._encodePax(t)}_encodePax(t){const e=s.encodePax({name:t.name,linkname:t.linkname,pax:t.pax}),r={name:"PaxHeader",mode:t.mode,uid:t.uid,gid:t.gid,size:e.byteLength,mtime:t.mtime,type:"pax-header",linkname:t.linkname&&"PaxHeader",uname:t.uname,gname:t.gname,devmajor:t.devmajor,devminor:t.devminor};this.push(s.encode(r)),this.push(e),l(this,e.byteLength),r.size=t.size,r.type=t.type,this.push(s.encode(r))}_doDrain(){const t=this._drain;this._drain=c,t()}_predestroy(){const t=r(this);for(this._stream&&this._stream.destroy(t);this._pending.length;){const e=this._pending.shift();e.destroy(t),e._continueOpen()}this._doDrain()}_read(t){this._doDrain(),t()}}function c(){}function l(t,e){(e&=511)&&t.push(o.subarray(0,512-e))}function h(t){return n.isBuffer(t)?t:n.from(t)}return Rl=function(t){return new u(t)}}function Wl(){return jl||(jl=1,yl.extract=function(){if(kl)return El;kl=1;const{Writable:t,Readable:e,getStreamError:r}=wl(),n=ml(),i=bl(),s=Ol(),o=i.alloc(0);class a{constructor(){this.buffered=0,this.shifted=0,this.queue=new n,this._offset=0}push(t){this.buffered+=t.byteLength,this.queue.push(t)}shiftFirst(t){return 0===this._buffered?null:this._next(t)}shift(t){if(t>this.buffered)return null;if(0===t)return o;let e=this._next(t);if(t===e.byteLength)return e;const r=[e];for(;(t-=e.byteLength)>0;)e=this._next(t),r.push(e);return i.concat(r)}_next(t){const e=this.queue.peek(),r=e.byteLength-this._offset;if(t>=r){const t=this._offset?e.subarray(this._offset,e.byteLength):e;return this.queue.shift(),this._offset=0,this.buffered-=r,this.shifted+=r,t}return this.buffered-=t,this.shifted+=t,e.subarray(this._offset,this._offset+=t)}}class u extends e{constructor(t,e,r){super(),this.header=e,this.offset=r,this._parent=t}_read(t){0===this.header.size&&this.push(null),this._parent._stream===this&&this._parent._update(),t(null)}_predestroy(){this._parent.destroy(r(this))}_detach(){this._parent._stream===this&&(this._parent._stream=null,this._parent._missing=h(this.header.size),this._parent._update())}_destroy(t){this._detach(),t(null)}}class c extends t{constructor(t){super(t),t||(t={}),this._buffer=new a,this._offset=0,this._header=null,this._stream=null,this._missing=0,this._longHeader=!1,this._callback=l,this._locked=!1,this._finished=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null,this._filenameEncoding=t.filenameEncoding||"utf-8",this._allowUnknownFormat=!!t.allowUnknownFormat,this._unlockBound=this._unlock.bind(this)}_unlock(t){if(this._locked=!1,t)return this.destroy(t),void this._continueWrite(t);this._update()}_consumeHeader(){if(this._locked)return!1;this._offset=this._buffer.shifted;try{this._header=s.decode(this._buffer.shift(512),this._filenameEncoding,this._allowUnknownFormat)}catch(t){return this._continueWrite(t),!1}if(!this._header)return!0;switch(this._header.type){case"gnu-long-path":case"gnu-long-link-path":case"pax-global-header":case"pax-header":return this._longHeader=!0,this._missing=this._header.size,!0}return this._locked=!0,this._applyLongHeaders(),0===this._header.size||"directory"===this._header.type?(this.emit("entry",this._header,this._createStream(),this._unlockBound),!0):(this._stream=this._createStream(),this._missing=this._header.size,this.emit("entry",this._header,this._stream,this._unlockBound),!0)}_applyLongHeaders(){this._gnuLongPath&&(this._header.name=this._gnuLongPath,this._gnuLongPath=null),this._gnuLongLinkPath&&(this._header.linkname=this._gnuLongLinkPath,this._gnuLongLinkPath=null),this._pax&&(this._pax.path&&(this._header.name=this._pax.path),this._pax.linkpath&&(this._header.linkname=this._pax.linkpath),this._pax.size&&(this._header.size=parseInt(this._pax.size,10)),this._header.pax=this._pax,this._pax=null)}_decodeLongHeader(t){switch(this._header.type){case"gnu-long-path":this._gnuLongPath=s.decodeLongPath(t,this._filenameEncoding);break;case"gnu-long-link-path":this._gnuLongLinkPath=s.decodeLongPath(t,this._filenameEncoding);break;case"pax-global-header":this._paxGlobal=s.decodePax(t);break;case"pax-header":this._pax=null===this._paxGlobal?s.decodePax(t):Object.assign({},this._paxGlobal,s.decodePax(t))}}_consumeLongHeader(){this._longHeader=!1,this._missing=h(this._header.size);const t=this._buffer.shift(this._header.size);try{this._decodeLongHeader(t)}catch(t){return this._continueWrite(t),!1}return!0}_consumeStream(){const t=this._buffer.shiftFirst(this._missing);if(null===t)return!1;this._missing-=t.byteLength;const e=this._stream.push(t);return 0===this._missing?(this._stream.push(null),e&&this._stream._detach(),e&&!1===this._locked):e}_createStream(){return new u(this,this._header,this._offset)}_update(){for(;this._buffer.buffered>0&&!this.destroying;){if(this._missing>0){if(null!==this._stream){if(!1===this._consumeStream())return;continue}if(!0===this._longHeader){if(this._missing>this._buffer.buffered)break;if(!1===this._consumeLongHeader())return!1;continue}const t=this._buffer.shiftFirst(this._missing);null!==t&&(this._missing-=t.byteLength);continue}if(this._buffer.buffered<512)break;if(null!==this._stream||!1===this._consumeHeader())return}this._continueWrite(null)}_continueWrite(t){const e=this._callback;this._callback=l,e(t)}_write(t,e){this._callback=e,this._buffer.push(t),this._update()}_final(t){this._finished=0===this._missing&&0===this._buffer.buffered,t(this._finished?null:new Error("Unexpected end of data"))}_predestroy(){this._continueWrite(null)}_destroy(t){this._stream&&this._stream.destroy(r(this)),t(null)}[Symbol.asyncIterator](){let t=null,e=null,r=null,n=null,i=null;const s=this;return this.on("entry",function(t,s,o){i=o,s.on("error",l),e?(e({value:s,done:!1}),e=r=null):n=s}),this.on("error",e=>{t=e}),this.on("close",function(){o(t),e&&(t?r(t):e({value:void 0,done:!0}),e=r=null)}),{[Symbol.asyncIterator](){return this},next:()=>new Promise(a),return:()=>u(null),throw:t=>u(t)};function o(t){if(!i)return;const e=i;i=null,e(t)}function a(i,a){return t?a(t):n?(i({value:n,done:!1}),void(n=null)):(e=i,r=a,o(null),void(s._finished&&e&&(e({value:void 0,done:!0}),e=r=null)))}function u(t){return s.destroy(t),o(t),new Promise((e,r)=>{if(s.destroyed)return e({value:void 0,done:!0});s.once("close",function(){t?r(t):e({value:void 0,done:!0})})})}}}function l(){}function h(t){return(t&=511)&&512-t}return El=function(t){return new c(t)}}(),yl.pack=Ul()),yl}
29
+ /**
30
+ * TAR Format Plugin
31
+ *
32
+ * @module plugins/tar
33
+ * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
34
+ * @copyright (c) 2012-2014 Chris Talkington, contributors.
35
+ */function Gl(){if(Dl)return Ml;Dl=1;var t=b.Buffer,e=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function r(e){if(t.isBuffer(e))return e;var r="function"==typeof t.alloc&&"function"==typeof t.from;if("number"==typeof e)return r?t.alloc(e):new t(e);if("string"==typeof e)return r?t.from(e):new t(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function n(n,i){n=r(n),t.isBuffer(i)&&(i=i.readUInt32BE(0));for(var s=-1^i,o=0;o<n.length;o++)s=e[255&(s^n[o])]^s>>>8;return-1^s}function i(){return t=n.apply(null,arguments),(e=r(4)).writeInt32BE(t,0),e;var t,e}return"undefined"!=typeof Int32Array&&(e=new Int32Array(e)),i.signed=function(){return n.apply(null,arguments)},i.unsigned=function(){return n.apply(null,arguments)>>>0},Ml=i}
36
+ /**
37
+ * JSON Format Plugin
38
+ *
39
+ * @module plugins/json
40
+ * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
41
+ * @copyright (c) 2012-2014 Chris Talkington, contributors.
42
+ */var ql=function(){if(Bl)return Cl;Bl=1;var t=ac(),e={},r=function(t,e){return r.create(t,e)};return r.create=function(r,n){if(e[r]){var i=new t(r,n);return i.setFormat(r),i.setModule(new e[r](n)),i}throw new Error("create("+r+"): format not registered")},r.registerFormat=function(t,r){if(e[t])throw new Error("register("+t+"): format already registered");if("function"!=typeof r)throw new Error("register("+t+"): format module invalid");if("function"!=typeof r.prototype.append||"function"!=typeof r.prototype.finalize)throw new Error("register("+t+"): format module missing methods");e[t]=r},r.isRegisteredFormat=function(t){return!!e[t]},r.registerFormat("zip",Xc()),r.registerFormat("tar",function(){if(Al)return Ll;Al=1;var t=v,e=Wl(),r=rc(),n=function(i){if(!(this instanceof n))return new n(i);"object"!=typeof(i=this.options=r.defaults(i,{gzip:!1})).gzipOptions&&(i.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=e.pack(i),this.compressor=!1,i.gzip&&(this.compressor=t.createGzip(i.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};return n.prototype._onCompressorError=function(t){this.engine.emit("error",t)},n.prototype.append=function(t,e,n){var i=this;function s(t,r){t?n(t):i.engine.entry(e,r,function(t){n(t,e)})}if(e.mtime=e.date,"buffer"===e.sourceType)s(null,t);else if("stream"===e.sourceType&&e.stats){e.size=e.stats.size;var o=i.engine.entry(e,function(t){n(t,e)});t.pipe(o)}else"stream"===e.sourceType&&r.collectStream(t,s)},n.prototype.finalize=function(){this.engine.finalize()},n.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)},n.prototype.pipe=function(t,e){return this.compressor?this.engine.pipe.apply(this.engine,[this.compressor]).pipe(t,e):this.engine.pipe.apply(this.engine,arguments)},n.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)},Ll=n}()),r.registerFormat("json",function(){if(Nl)return Pl;Nl=1;var t=y.inherits,e=mo().Transform,r=Gl(),n=rc(),i=function(t){if(!(this instanceof i))return new i(t);t=this.options=n.defaults(t,{}),e.call(this,t),this.supports={directory:!0,symlink:!0},this.files=[]};return t(i,e),i.prototype._transform=function(t,e,r){r(null,t)},i.prototype._writeStringified=function(){var t=JSON.stringify(this.files);this.write(t)},i.prototype.append=function(t,e,i){var s=this;function o(t,n){t?i(t):(e.size=n.length||0,e.crc32=r.unsigned(n),s.files.push(e),i(null,e))}e.crc32=0,"buffer"===e.sourceType?o(null,t):"stream"===e.sourceType&&n.collectStream(t,o)},i.prototype.finalize=function(){this._writeStringified(),this.end()},Pl=i}
43
+ /**
44
+ * Archiver Vending
45
+ *
46
+ * @ignore
47
+ * @license [MIT]{@link https://github.com/archiverjs/node-archiver/blob/master/LICENSE}
48
+ * @copyright (c) 2012-2014 Chris Talkington, contributors.
49
+ */()),Cl=r}(),$l=M(ql);const Hl=new Map,Zl=new Map;function Vl(t,e){const r={sessionId:e,backupId:t,status:"pending",phase:"Initializing backup restore",progressPercentage:0,progressCurrent:0,progressTotal:0,startTime:(new Date).toISOString(),elapsedSeconds:0,errors:[]};Hl.set(e,r),function(t){const e=setInterval(()=>{const r=Hl.get(t);if(!r)return void clearInterval(e);const n=new Date(r.startTime).getTime(),i=Math.floor((Date.now()-n)/1e3);r.elapsedSeconds=i,"running"!==r.status&&clearInterval(e)},1e3)}(e)}function Ql(t,e){const r=Hl.get(t);if(!r)return;const n="completed"===r.status||"failed"===r.status;Object.assign(r,e),n||(r.status="running")}function Yl(t,e){const r=Hl.get(t);r&&r.errors.push({...e,timestamp:(new Date).toISOString()})}function Kl(t){return Hl.get(t)??null}function Jl(t,e){const r=Hl.get(t);if(!r)return;r.status=e,r.phase="completed"===e?"Restore completed":"Restore failed",r.progressPercentage=100;const n=setTimeout(()=>{Hl.delete(t),Zl.delete(t)},6e4);Zl.set(t,n)}function Xl(){return c(process.env.BACKUP_PATH??"/directus/backups","restore-logs")}function th(){const t=Xl();e(t)||n(t,{recursive:!0})}const eh=new Set(["directus_access","directus_activity","directus_collections","directus_comments","directus_dashboards","directus_extensions","directus_fields","directus_files","directus_flows","directus_folders","directus_migrations","directus_notifications","directus_operations","directus_panels","directus_permissions","directus_policies","directus_presets","directus_relations","directus_revisions","directus_roles","directus_sessions","directus_settings","directus_shares","directus_translations","directus_users","directus_versions","directus_webhooks"]);function rh(){return process.env.BACKUP_PATH??"/directus/backups"}function nh(){const t=rh();e(t)||n(t,{recursive:!0})}let ih=null;function sh(){return c(rh(),"schedule.json")}function oh(){const r=sh();if(!e(r))return{enabled:!1,cronExpression:"0 2 * * *"};try{const e=t(r,"utf-8");return JSON.parse(e)}catch{return{enabled:!1,cronExpression:"0 2 * * *"}}}function ah(t){nh(),r(sh(),JSON.stringify(t,null,2),"utf-8")}function uh(t){null!==ih&&clearInterval(ih),ih=setInterval(async()=>{try{const e=oh();if(!e.enabled)return;const r=new Date,n=new Date(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes());if(!function(t,e){const r=t.trim().split(/\s+/);if(5!==r.length)return!1;function n(t,e){if("*"===t)return!0;if(t.includes("/")){const[,r]=t.split("/"),n=parseInt(r??"1",10);return e%n===0}if(t.includes(","))return t.split(",").some(t=>parseInt(t,10)===e);if(t.includes("-")){const[r,n]=t.split("-"),i=parseInt(r??"0",10),s=parseInt(n??"0",10);return e>=i&&e<=s}return parseInt(t,10)===e}const[i,s,o,a,u]=r;return n(i,e.getMinutes())&&n(s,e.getHours())&&n(o,e.getDate())&&n(a,e.getMonth()+1)&&n(u,e.getDay())}(e.cronExpression,n))return;if(e.lastRun){const t=new Date(e.lastRun);if(new Date(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes()).getTime()===n.getTime())return}t.logger.info("[acuity-backup] Scheduled backup triggered"),await hh(t,{type:"full",includeMedia:!0}),ah({...e,lastRun:r.toISOString()})}catch(e){t.logger.error("[acuity-backup] Scheduled backup failed:",e)}},6e4)}async function ch(t){const{CollectionsService:e}=t.services,r=new e({schema:await t.getSchema(),accountability:null});return(await r.readByQuery()).filter(t=>!eh.has(t.collection)&&!t.collection.startsWith("directus_")).map(t=>t.collection)}async function lh(t,e){const{ItemsService:r}=t.services,n=new r(e,{schema:await t.getSchema(),accountability:null});return await n.readByQuery({limit:-1,fields:["*"]})}async function hh(n,o){const a=await async function(t,e){nh();const n=(new Date).toISOString().replace(/[:.]/g,"-"),i=w(),o=`backup-${n}-${i}.zip`,a=c(rh(),o),l=await t.getSchema(),{RelationsService:h}=t.services,f="full"===e.type?await ch(t):e.collections??[],d={};let p=0;for(const e of f)try{const r=await lh(t,e);d[e]=r,p+=r.length}catch(r){t.logger.warn(`[acuity-backup] Failed to export collection "${e}":`,r),d[e]=[]}const g=new h({schema:l,accountability:null}),y=await g.readAll(),m=await async function(t,e){const r=await t.getSchema(),{ItemsService:n}=t.services;let i=[];try{const t=new n("directus_fields",{schema:r,accountability:null});i=(await t.readByQuery({limit:-1,filter:{collection:{_in:e}},fields:["collection","field","group"]})).filter(t=>null!==t.group&&void 0!==t.group).map(t=>({collection:t.collection,field:t.field,group:t.group}))}catch(e){t.logger.warn("[acuity-backup] Failed to export field groups:",e)}let s=[];try{const t=new n("directus_collections",{schema:r,accountability:null});s=(await t.readByQuery({limit:-1,filter:{collection:{_in:e}},fields:["*"]})).map(t=>{const{collection:e,...r}=t;return{collection:t.collection,display:null,display_template:t.display_template??null,sort_field:t.sort_field??null,hidden:t.hidden??!1,sort:t.sort??null,icon:t.icon??null,note:t.note??null,meta:r}})}catch(e){t.logger.warn("[acuity-backup] Failed to export collection views:",e)}return{schemaVersion:"1.0",fieldGroups:i,collectionViews:s}}(t,f);let b=[];try{const{ItemsService:e}=t.services,r=new e("directus_fields",{schema:l,accountability:null});b=await r.readByQuery({limit:-1,filter:{collection:{_in:f}},fields:["*"]})}catch(e){t.logger.warn("[acuity-backup] Failed to export field metadata:",e)}let _=[];try{const{ItemsService:e}=t.services,r=new e("directus_presets",{schema:l,accountability:null});_=await r.readByQuery({limit:-1,filter:{collection:{_in:f}},fields:["*"]})}catch(e){t.logger.warn("[acuity-backup] Failed to export collection presets:",e)}let v=[];if(e.includeMedia)try{const{ItemsService:e}=t.services,r=new e("directus_files",{schema:l,accountability:null});v=await r.readByQuery({limit:-1,fields:["*"]})}catch(e){t.logger.warn("[acuity-backup] Failed to list media files:",e)}const S={timestamp:(new Date).toISOString(),version:"1.2.0",type:e.type,collections:f,includeMedia:e.includeMedia,totalItems:p,fileSize:0,includesViewsAndGroups:!0};await new Promise((t,r)=>{const n=s(a),i=$l("zip",{zlib:{level:6}});n.on("close",t),i.on("error",r),i.pipe(n),i.append(JSON.stringify(l,null,2),{name:"schema.json"}),i.append(JSON.stringify(y,null,2),{name:"relations.json"}),i.append(JSON.stringify(m,null,2),{name:"views.json"}),i.append(JSON.stringify(b,null,2),{name:"fields-meta.json"}),i.append(JSON.stringify(_,null,2),{name:"presets.json"}),i.append(JSON.stringify(S,null,2),{name:"manifest.json"});for(const[t,e]of Object.entries(d))i.append(JSON.stringify(e,null,2),{name:`collections/${t}.json`});if(e.includeMedia&&v.length>0)for(const t of v)i.append(JSON.stringify(t,null,2),{name:`files/${t.id}.meta.json`});i.finalize()});try{const t=await u(a);S.fileSize=t.size;const e=a.replace(/\.zip$/,".meta.json"),n={id:i,filename:o,timestamp:S.timestamp,type:S.type,collections:S.collections,includeMedia:S.includeMedia,fileSize:S.fileSize};r(e,JSON.stringify(n,null,2),"utf-8")}catch{}return a}(n,o),h=l(a),f=a.replace(/\.zip$/,".meta.json");let d;d=e(f)?JSON.parse(t(f,"utf-8")):{id:w(),filename:h,timestamp:(new Date).toISOString(),type:o.type,collections:o.collections??[],includeMedia:o.includeMedia,fileSize:0};try{const{FilesService:t}=n.services,e=new t({schema:await n.getSchema(),accountability:null}),s=i(a),o=await e.uploadOne(s,{storage:process.env.STORAGE_DEFAULT??process.env.STORAGE_LOCATIONS?.split(",")[0]?.trim()??"local",filename_download:h,type:"application/zip",title:`Backup ${d.timestamp}`});d.directusFileId=String(o),r(f,JSON.stringify(d,null,2),"utf-8")}catch(t){n.logger.warn("[acuity-backup] Failed to upload backup to Directus Files:",t)}return d}async function fh(){nh();const e=rh();let r;try{r=await o(e)}catch{return[]}const n=r.filter(t=>t.endsWith(".meta.json")),i=[];for(const r of n)try{const n=t(c(e,r),"utf-8");i.push(JSON.parse(n))}catch{}return i.sort((t,e)=>new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime())}async function dh(t,n,i){const s=rh(),{backupId:a,truncateCollections:u=!1,collections:l}=n;i&&(Vl(a,i),Ql(i,{phase:"Finding backup archive",progressPercentage:5}));let h,f=null;try{h=await o(s)}catch{throw new Error("Backup directory is not accessible")}for(const t of h)if(t.endsWith(".zip")&&t.includes(a)){f=c(s,t);break}if(!f||!e(f))throw new Error(`Backup with id "${a}" not found`);i&&Ql(i,{phase:"Extracting ZIP archive",progressPercentage:10});let d;try{d=await new Function("m","return import(m)")("unzipper")}catch{throw new Error('The "unzipper" package is required for restore operations. Install it: npm install unzipper')}t.logger.info("[acuity-backup] Unzipper loaded, opening ZIP: "+f);const{ItemsService:p}=t.services,g={},y={},m=await d.Open.file(f);for(const t of m.files){const e=t.path;if(e.startsWith("collections/")||"manifest.json"===e||"schema.json"===e||"relations.json"===e||"views.json"===e||"fields-meta.json"===e||"presets.json"===e||e.startsWith("files/")&&e.endsWith(".meta.json")){const r=await t.buffer();e.startsWith("collections/")?g[e]=r:y[e]=r}}t.logger.info(`[acuity-backup] ZIP extracted: ${Object.keys(g).length} collection files, ${Object.keys(y).length} meta files`),i&&Ql(i,{phase:"Extraction complete",progressPercentage:20});const b=y["manifest.json"];if(!b)throw new Error("Invalid backup archive: manifest.json not found");const _=JSON.parse(b.toString("utf-8"));let v={},w=[],S=null;const E=y["schema.json"];if(E)try{v=JSON.parse(E.toString("utf-8"))}catch(e){t.logger.warn("[acuity-backup] Failed to parse schema.json:",e)}const k=y["relations.json"];if(k)try{w=JSON.parse(k.toString("utf-8"))}catch(e){t.logger.warn("[acuity-backup] Failed to parse relations.json:",e)}const x=y["views.json"];if(x)try{S=JSON.parse(x.toString("utf-8"))}catch{}let O=[];const T=y["fields-meta.json"];if(T)try{O=JSON.parse(T.toString("utf-8"))}catch(e){t.logger.warn("[acuity-backup] Failed to parse fields-meta.json:",e)}let R=[];const I=y["presets.json"];if(I)try{R=JSON.parse(I.toString("utf-8"))}catch(e){t.logger.warn("[acuity-backup] Failed to parse presets.json:",e)}const j=new Map;for(const t of w){const e=t;"directus_files"===e.related_collection&&e.collection&&e.field&&(j.has(e.collection)||j.set(e.collection,new Set),j.get(e.collection).add(e.field))}for(const t of O){const e=t.special;if(e&&Array.isArray(e)&&e.includes("file")){const e=t.collection,r=t.field;j.has(e)||j.set(e,new Set),j.get(e).add(r)}}const L=new Map;for(const t of w){const e=t;e.collection&&e.field&&(L.has(e.collection)||L.set(e.collection,new Set),L.get(e.collection).add(e.field))}for(const t of O){const e=t.special;if(e&&Array.isArray(e)&&(e.includes("m2o")||e.includes("file")||e.includes("user-created")||e.includes("user-updated"))){const e=t.collection,r=t.field;L.has(e)||L.set(e,new Set),L.get(e).add(r)}}const A=l??_.collections,M=[];let D=0,P=0,N=0;await async function(t,e,r,n,i,s){const o=await t.getSchema(),{CollectionsService:a,RelationsService:u}=t.services,c=[];let l=0;const h=e?.collections??{},f=new Map;for(const t of s){const e=`${t.collection}.${t.field}`;f.set(e,t)}const d=new a({schema:o,accountability:null});if(i)for(const e of i.collectionViews){const r=e.collection;if(h[r])continue;if(!n.includes(r))continue;const i=e.meta??{},{id:s,collection:o,...a}=i;a.icon=e.icon??a.icon??null,a.note=e.note??a.note??null,a.sort=e.sort??a.sort??null;try{await d.readOne(r);try{await d.updateOne(r,{meta:a}),t.logger.info(`[acuity-backup] Updated virtual folder "${r}" meta`)}catch{}continue}catch{}try{await d.createOne({collection:r,schema:null,meta:a}),c.push(r),t.logger.info(`[acuity-backup] Created virtual folder collection "${r}"`)}catch(e){t.logger.warn(`[acuity-backup] Failed to create virtual folder "${r}":`,e)}}const p=n.filter(t=>!o.collections[t]&&!c.includes(t));if(0===p.length&&0===c.length&&0===r.length)return{createdCollections:c,createdRelations:l};p.length>0&&t.logger.info(`[acuity-backup] Need to create ${p.length} missing collection(s): ${p.join(", ")}`);for(const e of p){const r=h[e];if(!r){t.logger.warn(`[acuity-backup] Collection "${e}" not found in backup schema — cannot recreate`);continue}const n=[],s=r.fields??{};for(const[t,i]of Object.entries(s)){const s=t===r.primary,o=`${e}.${t}`,a=f.get(o);if(i.alias){const e={field:i.field??t,type:"alias",schema:null,meta:a?{interface:a.interface,special:a.special??i.special??["alias","no-data"],options:a.options??null,display:a.display??null,display_options:a.display_options??null,width:a.width??"full",sort:a.sort??null,note:a.note??null,group:a.group??null,hidden:a.hidden??!1,required:a.required??!1}:{special:i.special??["alias","no-data"]}};n.push(e);continue}const u={special:i.special??[],hidden:!!s||(a?.hidden??!1),readonly:!!s||(a?.readonly??!1)};a&&(u.interface=a.interface,u.display=a.display??null,u.display_options=a.display_options??null,u.options=a.options??null,u.width=a.width??"full",u.sort=a.sort??null,u.note=a.note??null,u.required=a.required??!1,u.group=a.group??null,a.special&&(u.special=a.special));const c={field:i.field??t,type:i.type,schema:{is_nullable:!s&&!1!==i.nullable,default_value:i.defaultValue??null,is_primary_key:s,has_auto_increment:s&&("integer"===i.type||!0===i.generated)},meta:u};i.maxLength&&(c.schema.max_length=i.maxLength),n.push(c)}let o={};if(i){const t=i.collectionViews.find(t=>t.collection===e);if(t?.meta){const{collection:e,id:r,...n}=t.meta;o=n}}try{await d.createOne({collection:e,schema:{name:e},meta:{...o,singleton:r.singleton??!1,sort_field:r.sortField??null},fields:n}),c.push(e),t.logger.info(`[acuity-backup] Created collection "${e}" with ${n.length} fields`)}catch(r){t.logger.error(`[acuity-backup] Failed to create collection "${e}":`,r)}}if(r.length>0&&c.length>0){const e=await t.getSchema(),n=new u({schema:e,accountability:null});for(const i of r){const r=i;if((!r.collection?.startsWith("directus_")||!r.related_collection?.startsWith("directus_"))&&(c.includes(r.collection)||null!=r.related_collection&&c.includes(r.related_collection)))if(!e.collections[r.collection]||r.related_collection&&!e.collections[r.related_collection])t.logger.warn(`[acuity-backup] Skipping relation ${r.collection}.${r.field}: one or both collections missing`);else try{const e={...r.meta??{}};delete e.id,await n.createOne({collection:r.collection,field:r.field,related_collection:r.related_collection,meta:e,schema:r.schema??null}),l++,t.logger.info(`[acuity-backup] Created relation: ${r.collection}.${r.field} → ${r.related_collection}`)}catch(e){t.logger.warn(`[acuity-backup] Failed to create relation ${r.collection}.${r.field}:`,e)}}}return{createdCollections:c,createdRelations:l}}(t,v,w,A,S,O);let C=await t.getSchema(),B=0;if(O.length>0){i&&Ql(i,{phase:"Restoring field metadata",progressPercentage:22});const{FieldsService:e}=t.services,r=new e({schema:C,accountability:null}),n=new Map;for(const t of O){const e=`${t.collection}.${t.field}`;n.set(e,t)}for(const e of O){const n=e.collection,i=e.field;if(!A.includes(n))continue;const{id:s,collection:o,field:a,...u}=e;try{await r.updateField(n,i,{meta:u}),B++}catch{const s=e.special;if(s&&Array.isArray(s)&&s.includes("alias"))try{await r.createField(n,{field:i,type:"alias",schema:null,meta:u}),B++}catch(e){t.logger.warn(`[acuity-backup] Failed to create alias field "${n}.${i}":`,e)}}}t.logger.info(`[acuity-backup] Restored metadata for ${B} fields`),C=await t.getSchema()}i&&Ql(i,{phase:"Restoring media files",progressPercentage:25});let F=0;const z={};if(_.includeMedia){const e=new p("directus_files",{schema:C,accountability:null});for(const[r,n]of Object.entries(y))if(r.startsWith("files/")&&r.endsWith(".meta.json"))try{const r=JSON.parse(n.toString("utf-8")),s=r.id;try{let t=null;try{t=await e.readOne(s)}catch{}if(t){const{id:t,...n}=r;await e.updateOne(s,n),z[s]=s}else{const t=await e.createOne(r);z[s]=String(t)}F++}catch(e){t.logger.warn(`[acuity-backup] Failed to restore file record "${s}":`,e),i&&Yl(i,{message:`Failed to restore file: ${s}`})}}catch{}}t.logger.info(`[acuity-backup] Restored ${F} media file records`),i&&Ql(i,{phase:"Media files restored",progressPercentage:35});for(let e=0;e<A.length;e++){const r=A[e],n=`collections/${r}.json`,s=g[n];if(!s){t.logger.warn(`[acuity-backup] Collection file not found in archive: ${n}`),P++,i&&Yl(i,{collection:r,message:"Collection file not found in archive"});continue}let o;try{o=JSON.parse(s.toString("utf-8"))}catch{t.logger.warn(`[acuity-backup] Failed to parse collection JSON: ${n}`),P++,i&&Yl(i,{collection:r,message:"Failed to parse collection JSON"});continue}if(!Array.isArray(o)||0===o.length){if(M.push(r),D++,i){const t=35+30*(e+1)/A.length;Ql(i,{phase:`Restoring collections (${e+1}/${A.length})`,progressPercentage:Math.round(t),progressCurrent:e+1,progressTotal:A.length})}continue}const a=L.get(r);if(a)for(const t of o)for(const e of a){const r=t[e];if(null!==r&&"object"==typeof r&&!Array.isArray(r)){const n=r;void 0!==n.id&&(t[e]=n.id)}}const c=j.get(r);if(c&&Object.keys(z).length>0)for(const t of o)for(const e of c){const r=t[e];"string"==typeof r&&z[r]&&z[r]!==r&&(t[e]=z[r])}const l=new p(r,{schema:C,accountability:null});try{if(u){const t=await l.readByQuery({limit:-1,fields:["id"]});if(t.length>0){const e=t.map(t=>t.id);await l.deleteMany(e)}}if(await l.upsertMany(o),M.push(r),D++,N+=o.length,i){const t=35+30*(e+1)/A.length;Ql(i,{phase:`Restoring collections (${e+1}/${A.length})`,progressPercentage:Math.round(t),progressCurrent:e+1,progressTotal:A.length})}}catch(e){t.logger.error(`[acuity-backup] Failed to restore collection "${r}":`,e),P++,i&&Yl(i,{collection:r,message:String(e)})}}let U=0,W=0;if(i&&Ql(i,{phase:"Restoring field groups and view settings",progressPercentage:75}),S&&!1!==_.includesViewsAndGroups){const{FieldsService:e,CollectionsService:r}=t.services,n=await t.getSchema();if(S.fieldGroups.length>0){const r=new e({schema:n,accountability:null});for(const e of S.fieldGroups)if(A.includes(e.collection))try{await r.updateField(e.collection,e.field,{group:e.group}),U++}catch(r){t.logger.warn(`[acuity-backup] Failed to restore group for field "${e.collection}.${e.field}":`,r),i&&Yl(i,{message:`Failed to restore field group for ${e.collection}.${e.field}`})}}if(S.collectionViews.length>0){const e=new r({schema:n,accountability:null});for(const r of S.collectionViews){if(!A.includes(r.collection))continue;const n=r.meta??{},{id:s,collection:o,...a}=n,u={...a,display:r.display,display_template:r.display_template,sort_field:r.sort_field,hidden:r.hidden,sort:r.sort,icon:r.icon,note:r.note};try{await e.updateOne(r.collection,{meta:u}),W++}catch(e){t.logger.warn(`[acuity-backup] Failed to restore view settings for collection "${r.collection}":`,e),i&&Yl(i,{collection:r.collection,message:"Failed to restore view settings"})}}}}let G=0;if(i&&Ql(i,{phase:"Restoring collection layout presets",progressPercentage:85}),R.length>0){const{ItemsService:e}=t.services,r=new e("directus_presets",{schema:await t.getSchema(),accountability:null}),n=R.filter(t=>t.collection&&A.includes(t.collection));for(const e of n)try{const{id:t,user:n,...i}=e,s=await r.readByQuery({limit:1,filter:{collection:{_eq:i.collection},user:{_null:!0},...i.bookmark?{bookmark:{_eq:i.bookmark}}:{bookmark:{_null:!0}},...i.role?{role:{_eq:i.role}}:{role:{_null:!0}}},fields:["id"]});s.length>0?await r.updateOne(s[0].id,i):await r.createOne(i),G++}catch(r){t.logger.warn(`[acuity-backup] Failed to restore preset for collection "${e.collection}":`,r),i&&Yl(i,{collection:e.collection,message:"Failed to restore layout preset"})}}const q={restoredCollections:M,restoredFiles:F,restoredFieldGroups:U,restoredCollectionViews:W,restoredPresets:G,errors:[]};if(i){const t=Kl(i);if(t){const e=function(t,e){const r=new Date(t.startTime).getTime(),n=Date.now()-r;return{id:t.sessionId,sessionId:t.sessionId,backupId:t.backupId,timestamp:t.startTime,duration:n,status:"completed"===t.status?0===t.errors.length?"success":"partial":"failed",summary:e,errors:t.errors}}(t,{collectionsAttempted:A.length,collectionsSuccess:D,collectionsFailed:P,itemsRestored:N,mediaFilesRestored:F,fieldGroupsRestored:U,collectionViewsRestored:W,presetsRestored:G});!function(t){th();const e=c(Xl(),`${t.sessionId}.json`);r(e,JSON.stringify(t,null,2),"utf-8")}(e),Jl(i,(t.errors.length,"completed"))}Ql(i,{phase:"Restore completed",progressPercentage:100})}return q}function ph(t,e,r){const n=t.accountability;n?.admin?r():e.status(403).json({errors:[{message:"Forbidden: admin access required",extensions:{code:"FORBIDDEN"}}]})}const gh=[],yh=[{name:"acuity-backup",config:(r,n)=>{uh(n),r.get("/collections",ph,async(t,e)=>{try{const t=await ch(n),{CollectionsService:r}=n.services,i=new r({schema:await n.getSchema(),accountability:null}),s=(await i.readByQuery()).filter(e=>t.includes(e.collection)).map(t=>({collection:t.collection,icon:t.meta?.icon??null,note:t.meta?.note??null,singleton:t.meta?.singleton??!1}));e.json({data:s})}catch(t){n.logger.error("[acuity-backup] GET /collections error:",t),e.status(500).json({errors:[{message:String(t)}]})}}),r.get("/list",ph,async(t,e)=>{try{const t=await fh();e.json({data:t})}catch(t){n.logger.error("[acuity-backup] GET /list error:",t),e.status(500).json({errors:[{message:String(t)}]})}}),r.post("/run",ph,async(t,e)=>{try{const r=t.body,i="selective"===r.type?"selective":"full",s=!1!==r.includeMedia,o="selective"===i?r.collections??[]:void 0;if("selective"===i&&(!o||0===o.length))return void e.status(400).json({errors:[{message:'Selective backup requires at least one collection in the "collections" array.'}]});const a=await hh(n,{type:i,collections:o,includeMedia:s});e.status(201).json({data:a})}catch(t){n.logger.error("[acuity-backup] POST /run error:",t),e.status(500).json({errors:[{message:String(t)}]})}}),r.get("/schedule",ph,(t,e)=>{try{const t=oh();e.json({data:t})}catch(t){n.logger.error("[acuity-backup] GET /schedule error:",t),e.status(500).json({errors:[{message:String(t)}]})}}),r.post("/schedule",ph,(t,e)=>{try{const r=t.body;if("boolean"!=typeof r.enabled)return void e.status(400).json({errors:[{message:'"enabled" must be a boolean'}]});if("string"!=typeof r.cronExpression||!r.cronExpression.trim())return void e.status(400).json({errors:[{message:'"cronExpression" must be a non-empty string'}]});if(5!==r.cronExpression.trim().split(/\s+/).length)return void e.status(400).json({errors:[{message:'"cronExpression" must be a valid 5-field cron expression (minute hour dom month dow)'}]});const n={...oh(),enabled:r.enabled,cronExpression:r.cronExpression.trim()};ah(n),e.json({data:n})}catch(t){n.logger.error("[acuity-backup] POST /schedule error:",t),e.status(500).json({errors:[{message:String(t)}]})}}),r.get("/restore/:id",ph,async(t,e)=>{try{const{id:r}=t.params,n=(await fh()).find(t=>t.id===r);if(!n)return void e.status(404).json({errors:[{message:`Backup "${r}" not found`}]});e.json({data:n})}catch(t){n.logger.error("[acuity-backup] GET /restore/:id error:",t),e.status(500).json({errors:[{message:String(t)}]})}}),r.post("/restore",ph,async(t,e)=>{try{const r=t.body;if(!r.backupId||"string"!=typeof r.backupId)return void e.status(400).json({errors:[{message:'"backupId" is required'}]});const i=w(),s={backupId:r.backupId,truncateCollections:r.truncateCollections??!1,collections:r.collections,sessionId:i};e.json({data:{sessionId:i,message:"Restore started. Poll /acuity-backup/status/:sessionId for progress."}}),(async()=>{try{await dh(n,s,i)}catch(t){n.logger.error("[acuity-backup] Background restore error:",t);Kl(i)&&(Yl(i,{message:String(t)}),Jl(i,"failed"))}})()}catch(t){n.logger.error("[acuity-backup] POST /restore error:",t),e.status(500).json({errors:[{message:String(t)}]})}}),r.delete("/:id",ph,async(t,r)=>{try{const{id:n}=t.params,i=(await fh()).find(t=>t.id===n);if(!i)return void r.status(404).json({errors:[{message:`Backup "${n}" not found`}]});const s=c(rh(),i.filename),o=s.replace(/\.zip$/,".meta.json"),u=[];e(s)&&u.push(a(s)),e(o)&&u.push(a(o)),await Promise.all(u),r.json({data:{success:!0,id:n}})}catch(t){n.logger.error("[acuity-backup] DELETE /:id error:",t),r.status(500).json({errors:[{message:String(t)}]})}}),r.get("/status/:sessionId",ph,(t,e)=>{try{const{sessionId:r}=t.params,n=Kl(r);if(!n)return void e.status(404).json({errors:[{message:`Session "${r}" not found`}]});e.json({data:n})}catch(t){n.logger.error("[acuity-backup] GET /status/:sessionId error:",t),e.status(500).json({errors:[{message:String(t)}]})}}),r.get("/restore-logs",ph,async(e,r)=>{try{const e=await async function(){th();const e=Xl();try{const r=await o(e),n=[];for(const i of r){if(!i.endsWith(".json"))continue;const r=c(e,i);try{const e=t(r,"utf-8"),i=JSON.parse(e);n.push(i)}catch{}}return n.sort((t,e)=>new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()),n}catch{return[]}}();r.json({data:e})}catch(t){n.logger.error("[acuity-backup] GET /restore-logs error:",t),r.status(500).json({errors:[{message:String(t)}]})}}),r.get("/restore-logs/:logId",ph,(r,i)=>{try{const{logId:n}=r.params,s=function(r){th();const n=c(Xl(),`${r}.json`);if(!e(n))return null;try{const e=t(n,"utf-8");return JSON.parse(e)}catch{return null}}(n);if(!s)return void i.status(404).json({errors:[{message:`Restore log "${n}" not found`}]});i.json({data:s})}catch(t){n.logger.error("[acuity-backup] GET /restore-logs/:logId error:",t),i.status(500).json({errors:[{message:String(t)}]})}}),r.delete("/restore-logs/:logId",ph,async(t,r)=>{try{const{logId:n}=t.params;await async function(t){const r=c(Xl(),`${t}.json`);e(r)&&await a(r)}(n),r.json({data:{success:!0,logId:n}})}catch(t){n.logger.error("[acuity-backup] DELETE /restore-logs/:logId error:",t),r.status(500).json({errors:[{message:String(t)}]})}}),r.get("/download/:id",ph,async(t,r)=>{try{const{id:n}=t.params,s=(await fh()).find(t=>t.id===n);if(!s)return void r.status(404).json({errors:[{message:`Backup "${n}" not found`}]});const o=c(rh(),s.filename);if(!e(o))return void r.status(404).json({errors:[{message:`Backup file "${s.filename}" not found on disk`}]});r.setHeader("Content-Type","application/zip"),r.setHeader("Content-Disposition",`attachment; filename="${s.filename}"`);i(o).pipe(r)}catch(t){n.logger.error("[acuity-backup] GET /download/:id error:",t),r.status(500).json({errors:[{message:String(t)}]})}}),async function(){th();const t=Xl(),e=Date.now()-7776e6;let r=0;try{const n=await o(t);for(const i of n){if(!i.endsWith(".json"))continue;const n=c(t,i);try{(await u(n)).mtime.getTime()<e&&(await a(n),r++)}catch{}}}catch{}return r}().then(t=>{t>0&&n.logger.info(`[acuity-backup] Cleaned up ${t} restore logs older than 90 days`)})}}],mh=[];export{yh as endpoints,gh as hooks,mh as operations};
package/dist/app.js ADDED
@@ -0,0 +1 @@
1
+ import{defineModule as e,useApi as t,useStores as a}from"@directus/extensions-sdk";import{defineComponent as n,resolveComponent as l,createBlock as o,openBlock as r,withCtx as s,createElementBlock as d,Fragment as i,renderList as c,createVNode as u,ref as p,onMounted as v,resolveDirective as m,createElementVNode as b,createCommentVNode as g,withDirectives as f,toDisplayString as h,normalizeClass as y,createTextVNode as x,computed as k,watch as w,onBeforeUnmount as _,onUnmounted as z,withModifiers as C,vModelRadio as S,Transition as R,vModelCheckbox as D}from"vue";import{useRouter as B}from"vue-router";const V=[],T=[],E=[],F=[e({id:"acuity-backup",name:"Backup",icon:"cloud_download",routes:[{path:"",props:!0,component:()=>Promise.resolve().then(function(){return Ra})},{path:":page",props:!0,component:()=>Promise.resolve().then(function(){return Ra})}]})],j=[],I=[],L=[];var U=n({__name:"navigation",props:{current:{},pages:{}},setup:e=>(t,a)=>{const n=l("v-icon"),p=l("v-list-item-icon"),v=l("v-text-overflow"),m=l("v-list-item-content"),b=l("v-list-item"),g=l("v-list");return r(),o(g,{nav:""},{default:s(()=>[(r(!0),d(i,null,c(e.pages,t=>(r(),o(b,{key:t.route,clickable:"",active:e.current===t.route,to:"/acuity-backup"+(t.route?"/"+t.route:"")},{default:s(()=>[u(p,null,{default:s(()=>[u(n,{name:t.icon},null,8,["name"])]),_:2},1024),u(m,null,{default:s(()=>[u(v,{text:t.label},null,8,["text"])]),_:2},1024)]),_:2},1032,["active","to"]))),128))]),_:1})}});const A={class:"restore-logs-page"},$={class:"section"},M={class:"section-header"},P={key:0,class:"empty-state"},N={class:"table-wrapper"},O={class:"logs-table"},G={class:"col-date"},H={class:"date-primary"},q={class:"date-relative"},W={class:"col-backup"},K={class:"backup-id"},Y={class:"col-status"},J={class:"col-duration"},Q={class:"col-items"},X={class:"col-errors"},Z={key:0,class:"no-errors"},ee={key:1,class:"error-count"},te={class:"col-actions"},ae={class:"detail-header"},ne={class:"detail-section"},le={class:"detail-row"},oe={class:"detail-value mono"},re={class:"detail-row"},se={class:"detail-value mono"},de={class:"detail-row"},ie={class:"detail-value"},ce={class:"detail-row"},ue={class:"detail-row"},pe={class:"detail-value"},ve={class:"detail-section"},me={class:"summary-grid"},be={class:"summary-item"},ge={class:"summary-value"},fe={class:"summary-item"},he={class:"summary-value success"},ye={class:"summary-item"},xe={class:"summary-item"},ke={class:"summary-value"},we={class:"summary-item"},_e={class:"summary-value"},ze={class:"summary-item"},Ce={class:"summary-value"},Se={class:"summary-item"},Re={class:"summary-value"},De={key:0,class:"detail-section"},Be={class:"section-subtitle"},Ve={class:"errors-container"},Te={key:0,class:"error-collection"},Ee={class:"error-message"},Fe={class:"error-timestamp"},je={class:"dialog-title-row"},Ie={class:"dialog-title-icon-wrap danger-icon-wrap"};var Le=n({__name:"restore-logs",setup(e){const a=t(),n=p([]),k=p(!1),w=p(!1),_=p(null),z=p(!1),C=p(!1),S=p(null);async function R(){k.value=!0;try{const e=await a.get("/acuity-backup/restore-logs");n.value=e.data.data}catch(e){console.error("Failed to load restore logs:",e)}finally{k.value=!1}}async function D(){if(S.value){C.value=!0;try{await a.delete(`/acuity-backup/restore-logs/${S.value.id}`),n.value=n.value.filter(e=>e.id!==S.value.id),z.value=!1,w.value=!1}catch(e){console.error("Failed to delete restore log:",e)}finally{C.value=!1}}}function B(e){return new Date(e).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function V(e){const t=new Date(e),a=new Date,n=Math.floor((a.getTime()-t.getTime())/1e3);if(n<60)return"just now";const l=Math.floor(n/60);if(l<60)return`${l}m ago`;const o=Math.floor(l/60);if(o<24)return`${o}h ago`;return`${Math.floor(o/24)}d ago`}function T(e){const t=Math.floor(e/1e3);if(t<60)return`${t}s`;return`${Math.floor(t/60)}m ${t%60}s`}function E(e){switch(e){case"success":return"Success";case"partial":return"Partial";case"failed":return"Failed";default:return e}}return v(()=>{R()}),(e,t)=>{const a=l("v-icon"),p=l("v-button"),v=l("v-card-title"),F=l("v-card-text"),j=l("v-card-actions"),I=l("v-card"),L=l("v-dialog"),U=l("v-notice"),Le=m("tooltip");return r(),d(i,null,[b("div",A,[b("div",$,[b("div",M,[t[7]||(t[7]=b("h2",{class:"section-title"},"Restore History",-1)),f((r(),o(p,{small:"",secondary:"",icon:"",loading:k.value,onClick:R},{default:s(()=>[u(a,{name:"refresh"})]),_:1},8,["loading"])),[[Le,"Refresh list"]])]),g(" Empty state "),k.value||0!==n.value.length?(r(),d(i,{key:1},[g(" Table "),b("div",N,[b("table",O,[t[10]||(t[10]=b("thead",null,[b("tr",null,[b("th",{class:"col-date"},"Date"),b("th",{class:"col-backup"},"Backup ID"),b("th",{class:"col-status"},"Status"),b("th",{class:"col-duration"},"Duration"),b("th",{class:"col-items"},"Items"),b("th",{class:"col-errors"},"Errors"),b("th",{class:"col-actions"},"Actions")])],-1)),b("tbody",null,[(r(!0),d(i,null,c(n.value,e=>{return r(),d("tr",{key:e.id,class:"log-row"},[b("td",G,[b("span",H,h((t=e.timestamp,new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}))),1),b("span",q,h(V(e.timestamp)),1)]),b("td",W,[b("code",K,h(e.backupId.substring(0,8)),1)]),b("td",Y,[b("span",{class:y(["status-badge",`status-${e.status}`])},h(E(e.status)),3)]),b("td",J,h(T(e.duration)),1),b("td",Q,h(e.summary.itemsRestored),1),b("td",X,[0===e.errors.length?(r(),d("span",Z,"—")):(r(),d("span",ee,h(e.errors.length),1))]),b("td",te,[f((r(),o(p,{small:"",icon:"",secondary:"",onClick:t=>function(e){_.value=e,w.value=!0}(e)},{default:s(()=>[u(a,{name:"info"})]),_:1},8,["onClick"])),[[Le,"View details"]]),f((r(),o(p,{small:"",icon:"",secondary:"",danger:"",onClick:t=>function(e){S.value=e,z.value=!0}(e)},{default:s(()=>[u(a,{name:"delete"})]),_:1},8,["onClick"])),[[Le,"Delete log"]])])]);var t}),128))])])])],2112)):(r(),d("div",P,[u(a,{name:"history",class:"empty-icon"}),t[8]||(t[8]=b("p",{class:"empty-title"},"No restore logs",-1)),t[9]||(t[9]=b("p",{class:"empty-subtitle"},"Restore operations will appear here.",-1))]))])]),g(" Detail Modal "),u(L,{modelValue:w.value,"onUpdate:modelValue":t[2]||(t[2]=e=>w.value=e),onEsc:t[3]||(t[3]=e=>w.value=!1)},{default:s(()=>[_.value?(r(),o(I,{key:0,class:"detail-modal"},{default:s(()=>[u(v,null,{default:s(()=>[b("div",ae,[t[11]||(t[11]=b("span",null,"Restore Log",-1)),u(p,{icon:"",secondary:"",small:"",onClick:t[0]||(t[0]=e=>w.value=!1)},{default:s(()=>[u(a,{name:"close"})]),_:1})])]),_:1}),u(F,null,{default:s(()=>{return[b("div",ne,[b("div",le,[t[12]||(t[12]=b("span",{class:"detail-label"},"Session ID",-1)),b("code",oe,h(_.value.sessionId),1)]),b("div",re,[t[13]||(t[13]=b("span",{class:"detail-label"},"Backup ID",-1)),b("code",se,h(_.value.backupId),1)]),b("div",de,[t[14]||(t[14]=b("span",{class:"detail-label"},"Date",-1)),b("span",ie,h((e=_.value.timestamp,new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}))),1)]),b("div",ce,[t[15]||(t[15]=b("span",{class:"detail-label"},"Status",-1)),b("span",{class:y(["status-badge",`status-${_.value.status}`])},h(E(_.value.status)),3)]),b("div",ue,[t[16]||(t[16]=b("span",{class:"detail-label"},"Duration",-1)),b("span",pe,h(T(_.value.duration)),1)])]),b("div",ve,[t[24]||(t[24]=b("h3",{class:"section-subtitle"},"Summary",-1)),b("div",me,[b("div",be,[t[17]||(t[17]=b("span",{class:"summary-label"},"Collections Attempted",-1)),b("span",ge,h(_.value.summary.collectionsAttempted),1)]),b("div",fe,[t[18]||(t[18]=b("span",{class:"summary-label"},"Collections Success",-1)),b("span",he,h(_.value.summary.collectionsSuccess),1)]),b("div",ye,[t[19]||(t[19]=b("span",{class:"summary-label"},"Collections Failed",-1)),b("span",{class:y(["summary-value",{error:_.value.summary.collectionsFailed>0}])},h(_.value.summary.collectionsFailed),3)]),b("div",xe,[t[20]||(t[20]=b("span",{class:"summary-label"},"Items Restored",-1)),b("span",ke,h(_.value.summary.itemsRestored),1)]),b("div",we,[t[21]||(t[21]=b("span",{class:"summary-label"},"Media Files",-1)),b("span",_e,h(_.value.summary.mediaFilesRestored),1)]),b("div",ze,[t[22]||(t[22]=b("span",{class:"summary-label"},"Field Groups",-1)),b("span",Ce,h(_.value.summary.fieldGroupsRestored),1)]),b("div",Se,[t[23]||(t[23]=b("span",{class:"summary-label"},"Collection Views",-1)),b("span",Re,h(_.value.summary.collectionViewsRestored),1)])])]),_.value.errors.length>0?(r(),d("div",De,[b("h3",Be,"Errors ("+h(_.value.errors.length)+")",1),b("div",Ve,[(r(!0),d(i,null,c(_.value.errors,(e,t)=>(r(),d("div",{key:t,class:"error-detail"},[e.collection?(r(),d("span",Te,h(e.collection),1)):g("v-if",!0),b("span",Ee,h(e.message),1),b("span",Fe,h(B(e.timestamp)),1)]))),128))])])):g("v-if",!0)];var e}),_:1}),u(j,null,{default:s(()=>[u(p,{secondary:"",onClick:t[1]||(t[1]=e=>w.value=!1)},{default:s(()=>[...t[25]||(t[25]=[x("Close",-1)])]),_:1}),u(p,{danger:"",onClick:D},{default:s(()=>[...t[26]||(t[26]=[x("Delete Log",-1)])]),_:1})]),_:1})]),_:1})):g("v-if",!0)]),_:1},8,["modelValue"]),g(" Delete confirmation "),u(L,{modelValue:z.value,"onUpdate:modelValue":t[5]||(t[5]=e=>z.value=e),onEsc:t[6]||(t[6]=e=>z.value=!1)},{default:s(()=>[u(I,{class:"confirm-dialog"},{default:s(()=>[u(v,null,{default:s(()=>[b("div",je,[b("div",Ie,[u(a,{name:"delete_forever"})]),t[27]||(t[27]=b("span",null,"Delete Restore Log",-1))])]),_:1}),u(F,null,{default:s(()=>[u(U,{type:"danger"},{default:s(()=>[...t[28]||(t[28]=[x(" This will permanently delete the restore log. This action cannot be undone. ",-1)])]),_:1})]),_:1}),u(j,null,{default:s(()=>[u(p,{secondary:"",onClick:t[4]||(t[4]=e=>z.value=!1)},{default:s(()=>[...t[29]||(t[29]=[x("Cancel",-1)])]),_:1}),u(p,{danger:"",onClick:D,loading:C.value},{default:s(()=>[u(a,{name:"delete_forever",left:""}),t[30]||(t[30]=x(" Delete Permanently ",-1))]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"])],64)}}}),Ue=[],Ae=[];function $e(e,t){if(e&&"undefined"!=typeof document){var a,n=!0===t.prepend?"prepend":"append",l=!0===t.singleTag,o="string"==typeof t.container?document.querySelector(t.container):document.getElementsByTagName("head")[0];if(l){var r=Ue.indexOf(o);-1===r&&(r=Ue.push(o)-1,Ae[r]={}),a=Ae[r]&&Ae[r][n]?Ae[r][n]:Ae[r][n]=s()}else a=s();65279===e.charCodeAt(0)&&(e=e.substring(1)),a.styleSheet?a.styleSheet.cssText+=e:a.appendChild(document.createTextNode(e))}function s(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),t.attributes)for(var a=Object.keys(t.attributes),l=0;l<a.length;l++)e.setAttribute(a[l],t.attributes[a[l]]);var r="prepend"===n?"afterbegin":"beforeend";return o.insertAdjacentElement(r,e),e}}$e("\n.restore-logs-page[data-v-4d4855df] {\n\tpadding: 16px;\n\tmax-width: 1100px;\n}\n.section[data-v-4d4855df] {\n\tbackground: var(--theme--background);\n\tborder: 1px solid var(--theme--border-color);\n\tborder-radius: var(--theme--border-radius);\n\tpadding: 16px;\n}\n.section-header[data-v-4d4855df] {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tmargin-bottom: 16px;\n}\n.section-title[data-v-4d4855df] {\n\tfont-size: 18px;\n\tfont-weight: 600;\n\tmargin: 0;\n\tcolor: var(--theme--foreground);\n}\n.empty-state[data-v-4d4855df] {\n\ttext-align: center;\n\tpadding: 40px 20px;\n\tcolor: var(--theme--foreground-subdued);\n}\n.empty-icon[data-v-4d4855df] {\n\tfont-size: 48px;\n\tmargin-bottom: 12px;\n\topacity: 0.5;\n}\n.empty-title[data-v-4d4855df] {\n\tfont-size: 16px;\n\tfont-weight: 600;\n\tmargin: 0 0 4px 0;\n}\n.empty-subtitle[data-v-4d4855df] {\n\tfont-size: 14px;\n\tmargin: 0;\n\tcolor: var(--theme--foreground-subdued);\n}\n.table-wrapper[data-v-4d4855df] {\n\toverflow-x: auto;\n}\n.logs-table[data-v-4d4855df] {\n\twidth: 100%;\n\tborder-collapse: collapse;\n\tfont-size: 14px;\n}\n.logs-table thead[data-v-4d4855df] {\n\tbackground: var(--theme--background-subdued);\n\tborder-bottom: 2px solid var(--theme--border-color);\n}\n.logs-table th[data-v-4d4855df] {\n\tpadding: 12px 16px;\n\ttext-align: left;\n\tfont-weight: 600;\n\tcolor: var(--theme--foreground-subdued);\n\twhite-space: nowrap;\n}\n.logs-table tbody tr[data-v-4d4855df] {\n\tborder-bottom: 1px solid var(--theme--border-color);\n\ttransition: background 0.2s;\n}\n.logs-table tbody tr[data-v-4d4855df]:hover {\n\tbackground: var(--theme--background-subdued);\n}\n.logs-table td[data-v-4d4855df] {\n\tpadding: 12px 16px;\n\tvertical-align: middle;\n}\n.col-date[data-v-4d4855df],\n.col-backup[data-v-4d4855df],\n.col-status[data-v-4d4855df],\n.col-duration[data-v-4d4855df],\n.col-items[data-v-4d4855df],\n.col-errors[data-v-4d4855df],\n.col-actions[data-v-4d4855df] {\n\ttext-align: left;\n}\n.date-primary[data-v-4d4855df] {\n\tdisplay: block;\n\tfont-weight: 500;\n\tcolor: var(--theme--foreground);\n}\n.date-relative[data-v-4d4855df] {\n\tdisplay: block;\n\tfont-size: 12px;\n\tcolor: var(--theme--foreground-subdued);\n}\n.backup-id[data-v-4d4855df] {\n\tfont-family: monospace;\n\tfont-size: 12px;\n\tbackground: var(--theme--background-subdued);\n\tpadding: 2px 6px;\n\tborder-radius: 3px;\n}\n.status-badge[data-v-4d4855df] {\n\tdisplay: inline-block;\n\tpadding: 4px 8px;\n\tborder-radius: 3px;\n\tfont-size: 12px;\n\tfont-weight: 600;\n\twhite-space: nowrap;\n}\n.status-success[data-v-4d4855df] {\n\tbackground: rgba(34, 197, 94, 0.1);\n\tcolor: rgb(34, 197, 94);\n}\n.status-partial[data-v-4d4855df] {\n\tbackground: rgba(251, 146, 60, 0.1);\n\tcolor: rgb(251, 146, 60);\n}\n.status-failed[data-v-4d4855df] {\n\tbackground: rgba(239, 68, 68, 0.1);\n\tcolor: rgb(239, 68, 68);\n}\n.no-errors[data-v-4d4855df] {\n\tcolor: var(--theme--foreground-subdued);\n}\n.error-count[data-v-4d4855df] {\n\tcolor: rgb(239, 68, 68);\n\tfont-weight: 600;\n}\n.col-actions[data-v-4d4855df] {\n\ttext-align: right;\n\twhite-space: nowrap;\n}\n.detail-modal[data-v-4d4855df] {\n\tmax-width: 600px;\n}\n.detail-header[data-v-4d4855df] {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n}\n.detail-section[data-v-4d4855df] {\n\tmargin-bottom: 24px;\n}\n.detail-section[data-v-4d4855df]:last-child {\n\tmargin-bottom: 0;\n}\n.detail-row[data-v-4d4855df] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n\tmargin-bottom: 8px;\n\tpadding: 8px;\n\tbackground: var(--theme--background-subdued);\n\tborder-radius: 3px;\n}\n.detail-label[data-v-4d4855df] {\n\tfont-weight: 600;\n\tcolor: var(--theme--foreground-subdued);\n\tmin-width: 120px;\n}\n.detail-value[data-v-4d4855df] {\n\tcolor: var(--theme--foreground);\n\tword-break: break-all;\n}\n.detail-value.mono[data-v-4d4855df] {\n\tfont-family: monospace;\n\tfont-size: 12px;\n}\n.section-subtitle[data-v-4d4855df] {\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tcolor: var(--theme--foreground-subdued);\n\ttext-transform: uppercase;\n\tletter-spacing: 0.5px;\n\tmargin: 0 0 12px 0;\n\tpadding-bottom: 8px;\n\tborder-bottom: 1px solid var(--theme--border-color);\n}\n.summary-grid[data-v-4d4855df] {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n\tgap: 12px;\n}\n.summary-item[data-v-4d4855df] {\n\tbackground: var(--theme--background-subdued);\n\tpadding: 12px;\n\tborder-radius: 3px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n.summary-label[data-v-4d4855df] {\n\tfont-size: 12px;\n\tcolor: var(--theme--foreground-subdued);\n}\n.summary-value[data-v-4d4855df] {\n\tfont-size: 18px;\n\tfont-weight: 600;\n\tcolor: var(--theme--foreground);\n}\n.summary-value.success[data-v-4d4855df] {\n\tcolor: rgb(34, 197, 94);\n}\n.summary-value.error[data-v-4d4855df] {\n\tcolor: rgb(239, 68, 68);\n}\n.errors-container[data-v-4d4855df] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tmax-height: 400px;\n\toverflow-y: auto;\n}\n.error-detail[data-v-4d4855df] {\n\tdisplay: flex;\n\tgap: 12px;\n\tpadding: 8px 12px;\n\tbackground: rgba(239, 68, 68, 0.05);\n\tborder-left: 3px solid rgb(239, 68, 68);\n\tborder-radius: 3px;\n\tfont-size: 12px;\n}\n.error-collection[data-v-4d4855df] {\n\tcolor: rgb(239, 68, 68);\n\tfont-weight: 600;\n\twhite-space: nowrap;\n}\n.error-message[data-v-4d4855df] {\n\tflex: 1;\n\tcolor: var(--theme--foreground);\n\tword-break: break-word;\n}\n.error-timestamp[data-v-4d4855df] {\n\tcolor: var(--theme--foreground-subdued);\n\twhite-space: nowrap;\n\tfont-size: 11px;\n}\n.confirm-dialog[data-v-4d4855df] {\n\tmax-width: 400px;\n}\n.dialog-title-row[data-v-4d4855df] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n}\n.dialog-title-icon-wrap[data-v-4d4855df] {\n\twidth: 40px;\n\theight: 40px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tborder-radius: 50%;\n\tbackground: rgba(239, 68, 68, 0.1);\n}\n.dialog-title-icon-wrap.danger-icon-wrap[data-v-4d4855df] {\n\tbackground: rgba(239, 68, 68, 0.1);\n\tcolor: rgb(239, 68, 68);\n}\n",{});var Me=(e,t)=>{const a=e.__vccOpts||e;for(const[e,n]of t)a[e]=n;return a},Pe=Me(Le,[["__scopeId","data-v-4d4855df"]]);const Ne={key:0,class:"backup-module-content"},Oe={class:"section"},Ge={class:"section-header"},He={key:0,class:"skeleton-rows"},qe={class:"empty-state"},We={class:"table-wrapper"},Ke={class:"backup-table"},Ye={class:"col-date"},Je={class:"date-primary"},Qe={class:"date-relative"},Xe={class:"col-type"},Ze={class:"type-cell"},et={key:0,class:"media-badge"},tt={class:"col-collections"},at={key:0,class:"all-collections"},nt={key:1,class:"collection-list"},lt={key:0,class:"more-collections"},ot={class:"col-size"},rt={class:"col-status"},st={key:0,class:"status-badge status-restoring"},dt={key:1,class:"status-badge status-valid"},it={class:"col-actions"},ct={class:"action-buttons"},ut={key:3,class:"auto-refresh-notice"},pt={class:"backup-module-content"},vt={class:"section"},mt={class:"schedule-card"},bt={key:0,class:"schedule-loading"},gt={class:"schedule-toggle-row"},ft={class:"cron-presets"},ht=["onClick","disabled"],yt={class:"cron-input-row"},xt={key:0,class:"last-run-row"},kt={key:0,class:"error-notice"},wt={class:"schedule-footer"},_t={class:"dialog-section"},zt={class:"radio-group"},Ct={class:"radio-content"},St={class:"radio-content"},Rt={key:0,class:"dialog-section collection-selector"},Dt={key:0,class:"collections-loading"},Bt={key:1,class:"collections-empty"},Vt={key:2,class:"collection-list-scroll"},Tt=["value"],Et={class:"collection-item-content"},Ft={class:"collection-name"},jt={key:0,class:"collection-count"},It={key:3,class:"validation-msg"},Lt={class:"dialog-section"},Ut={class:"toggle-row"},At={key:0,class:"running-state"},$t={key:1,class:"error-notice"},Mt={class:"dialog-title-row"},Pt={class:"dialog-title-icon-wrap restore-icon-wrap"},Nt={key:0,class:"confirm-details"},Ot={class:"detail-row"},Gt={class:"detail-value"},Ht={class:"detail-row"},qt={class:"detail-value"},Wt={class:"detail-row"},Kt={class:"detail-value"},Yt={class:"detail-row"},Jt={class:"detail-value"},Qt={class:"detail-row"},Xt={class:"detail-value"},Zt={class:"toggle-row restore-option-row"},ea={key:1,class:"running-state restore-progress"},ta={class:"progress-info"},aa={class:"progress-header"},na={class:"running-title"},la={class:"progress-percentage"},oa={class:"progress-details"},ra={class:"phase-text"},sa={class:"elapsed-time"},da={key:0,class:"errors-section"},ia={class:"errors-details"},ca={class:"errors-summary"},ua={class:"errors-list"},pa={key:0,class:"error-collection"},va={class:"error-message"},ma={key:2,class:"error-notice"},ba={class:"dialog-title-row"},ga={class:"dialog-title-icon-wrap danger-icon-wrap"},fa={key:0,class:"confirm-details"},ha={class:"detail-row"},ya={class:"detail-value"},xa={class:"detail-row"},ka={class:"detail-value"},wa={class:"detail-row"},_a={class:"detail-value"},za={key:1,class:"error-notice"};var Ca=n({__name:"module",props:{page:{}},setup(e){const n=e,V=B(),T=k(()=>n.page??""),E=[{route:"",label:"Backups",icon:"backup"},{route:"schedule",label:"Schedule",icon:"schedule"},{route:"restore-logs",label:"Restore Logs",icon:"history"}],F=k(()=>{switch(T.value){case"schedule":return"Schedule";case"restore-logs":return"Restore Logs";default:return"Backups"}}),j=k(()=>[{name:"Backup",to:"/acuity-backup"},{name:F.value}]);w(T,e=>{""===e?G():"schedule"===e?Be():"restore-logs"===e||V.replace("/acuity-backup")},{immediate:!1});const I=t(),{useNotificationsStore:L}=a(),A=L(),$=p([]),M=p(!1),P=p(null),N=k(()=>P.value?P.value.toLocaleTimeString():"Never");let O=null;async function G(){M.value=!0;try{const e=await I.get("/acuity-backup/list");$.value=e.data.data??[],P.value=new Date}catch(e){Ie("Failed to load backup history. "+je(e),"error")}finally{M.value=!1}}const H=p(!1),q=p("full"),W=p(!0),K=p(!1),Y=p(""),J=p([]),Q=p([]),X=p(!1);function Z(){Y.value="",q.value="full",W.value=!0,J.value=[],H.value=!0,async function(){if(Q.value.length>0)return;X.value=!0;try{const e=await I.get("/acuity-backup/collections");Q.value=e.data.data??[]}catch(e){Ie("Failed to load collections. "+je(e),"error")}finally{X.value=!1}}()}function ee(){K.value||(H.value=!1)}function te(){J.value=Q.value.map(e=>e.collection)}function ae(){J.value=[]}async function ne(){if("selective"!==q.value||0!==J.value.length){K.value=!0,Y.value="";try{await I.post("/acuity-backup/run",{type:q.value,collections:"selective"===q.value?J.value:void 0,includeMedia:W.value}),Ie("Backup completed successfully.","success"),H.value=!1,await G()}catch(e){Y.value="Backup failed: "+je(e)}finally{K.value=!1}}}const le=p(!1),oe=p(null),re=p(null),se=p(!1),de=p(""),ie=p(null),ce=p({phase:"",progressPercentage:0,elapsedSeconds:0,errors:[]}),ue=p(!1);let pe=null;function ve(){null===re.value&&(le.value=!1)}function me(){le.value=!1,re.value=null,ie.value=null,ue.value=!1,G()}async function be(){if(oe.value){re.value=oe.value.id,de.value="",ce.value={phase:"",progressPercentage:0,elapsedSeconds:0,errors:[]};try{const e=(await I.post("/acuity-backup/restore",{backupId:oe.value.id,truncateCollections:se.value})).data.data.sessionId;ie.value=e;let t="";pe=window.setInterval(async()=>{try{const a=(await I.get(`/acuity-backup/status/${e}`)).data.data;ce.value={phase:a.phase||"",progressPercentage:a.progressPercentage||0,elapsedSeconds:a.elapsedSeconds||0,errors:a.errors||[]},"running"!==a.status&&(pe&&(clearInterval(pe),pe=null),ue.value=!0,"completed"===a.status?Ie("Restore completed successfully.","success"):de.value="Restore failed. Check errors above for details."),t=a.status}catch(e){"running"!==t&&pe&&(clearInterval(pe),pe=null)}},250)}catch(e){de.value="Failed to initiate restore: "+je(e),re.value=null,ie.value=null}}}const ge=p(!1),fe=p(null),he=p(null),ye=p("");async function xe(){if(fe.value){he.value=fe.value.id,ye.value="";try{await I.delete(`/acuity-backup/${fe.value.id}`),Ie("Backup deleted.","success"),ge.value=!1,$.value=$.value.filter(e=>e.id!==fe.value.id)}catch(e){ye.value="Delete failed: "+je(e)}finally{he.value=null}}}const ke=[{label:"Daily",value:"0 0 * * *"},{label:"Weekly",value:"0 0 * * 0"},{label:"Monthly",value:"0 0 1 * *"},{label:"Disabled",value:""}],we=p(!1),_e=p("0 0 * * *"),ze=p(void 0),Ce=p(!1),Se=p(!1),Re=p("");let De=!1;async function Be(){if(!De){Ce.value=!0;try{const e=(await I.get("/acuity-backup/schedule")).data.data;we.value=e.enabled,_e.value=e.cronExpression,ze.value=e.lastRun,De=!0}catch(e){Ie("Failed to load schedule configuration. "+je(e),"error")}finally{Ce.value=!1}}}async function Ve(){if(Re.value="",we.value){const e=_e.value.trim();if(!e)return void(Re.value="A cron expression is required when automatic backups are enabled.");if(5!==e.split(/\s+/).length)return void(Re.value="The cron expression must have exactly 5 fields (minute hour day-of-month month day-of-week).")}Se.value=!0;try{await I.post("/acuity-backup/schedule",{enabled:we.value,cronExpression:_e.value.trim()||"0 0 * * *"}),Ie("Schedule saved successfully.","success")}catch(e){Re.value="Failed to save schedule: "+je(e)}finally{Se.value=!1}}function Te(e){try{return new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return e}}function Ee(e){try{const t=Date.now()-new Date(e).getTime(),a=Math.floor(t/1e3);return a<60?"just now":a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:a<604800?`${Math.floor(a/86400)}d ago`:`${Math.floor(a/604800)}w ago`}catch{return""}}function Fe(e){if(!e||0===e)return"—";const t=["B","KB","MB","GB"];let a=e,n=0;for(;a>=1024&&n<t.length-1;)a/=1024,n++;return`${a.toFixed(a<10?1:0)} ${t[n]}`}function je(e){if(e&&"object"==typeof e){const t=e,a=t.response?.data?.errors?.[0]?.message;if(a)return a;if(t.message)return t.message}return String(e)}function Ie(e,t="success"){A.add({title:"success"===t?"Success":"error"===t?"Error":"Warning",text:e,type:t,persist:"error"===t})}return v(()=>{"schedule"===T.value?Be():(G(),O=setInterval(G,3e4))}),_(()=>{null!==pe&&(clearInterval(pe),pe=null)}),z(()=>{null!==O&&(clearInterval(O),O=null)}),(e,t)=>{const a=l("v-breadcrumb"),n=l("v-icon"),p=l("v-button"),v=l("v-progress-circular"),k=l("v-toggle"),w=l("v-input"),_=l("v-notice"),z=l("v-card-title"),B=l("v-card-text"),V=l("v-card-actions"),L=l("v-card"),A=l("v-dialog"),P=l("v-progress-linear"),O=l("private-view"),ie=m("tooltip");return r(),o(O,{title:F.value},{headline:s(()=>[u(a,{items:j.value},null,8,["items"])]),"title-outer:prepend":s(()=>[u(p,{class:"header-icon",rounded:"",icon:"",secondary:"",disabled:""},{default:s(()=>[u(n,{name:"cloud_download"})]),_:1})]),actions:s(()=>[""===T.value?(r(),o(p,{key:0,onClick:Z,loading:K.value},{default:s(()=>[u(n,{name:"add",left:""}),t[12]||(t[12]=x(" Run Backup ",-1))]),_:1},8,["loading"])):g("v-if",!0)]),navigation:s(()=>[u(U,{current:T.value,pages:E},null,8,["current"])]),default:s(()=>[""===T.value?(r(),d("div",Ne,[g(" Backup history table "),b("div",Oe,[b("div",Ge,[t[13]||(t[13]=b("h2",{class:"section-title"},"Backup History",-1)),f((r(),o(p,{small:"",secondary:"",icon:"",loading:M.value,onClick:G},{default:s(()=>[u(n,{name:"refresh"})]),_:1},8,["loading"])),[[ie,"Refresh list"]])]),g(" Loading skeleton "),M.value&&0===$.value.length?(r(),d("div",He,[(r(),d(i,null,c(3,e=>b("div",{key:e,class:"skeleton-row"},[...t[14]||(t[14]=[b("div",{class:"skeleton-cell skeleton-date"},null,-1),b("div",{class:"skeleton-cell skeleton-type"},null,-1),b("div",{class:"skeleton-cell skeleton-collections"},null,-1),b("div",{class:"skeleton-cell skeleton-size"},null,-1),b("div",{class:"skeleton-cell skeleton-status"},null,-1),b("div",{class:"skeleton-cell skeleton-actions"},null,-1)])])),64))])):M.value||0!==$.value.length?(r(),d(i,{key:2},[g(" Table "),b("div",We,[b("table",Ke,[t[20]||(t[20]=b("thead",null,[b("tr",null,[b("th",{class:"col-date"},"Date"),b("th",{class:"col-type"},"Type"),b("th",{class:"col-collections"},"Collections"),b("th",{class:"col-size"},"Size"),b("th",{class:"col-status"},"Status"),b("th",{class:"col-actions"},"Actions")])],-1)),b("tbody",null,[(r(!0),d(i,null,c($.value,e=>(r(),d("tr",{key:e.id,class:"backup-row"},[g(" Date "),b("td",Ye,[b("span",Je,h(Te(e.timestamp)),1),b("span",Qe,h(Ee(e.timestamp)),1)]),g(" Type badge "),b("td",Xe,[b("div",Ze,[b("span",{class:y(["type-badge","full"===e.type?"type-full":"type-selective"])},h("full"===e.type?"Full":"Selective"),3),e.includeMedia?f((r(),d("span",et,[u(n,{name:"image",small:""})])),[[ie,"Includes media files"]]):g("v-if",!0)])]),g(" Collections "),b("td",tt,["full"===e.type?(r(),d("span",at,"All collections")):(r(),d("span",nt,[x(h(e.collections.slice(0,3).join(", "))+" ",1),e.collections.length>3?(r(),d("span",lt," +"+h(e.collections.length-3)+" more ",1)):g("v-if",!0)]))]),g(" Size "),b("td",ot,h(Fe(e.fileSize)),1),g(" Status "),b("td",rt,[re.value===e.id?(r(),d("span",st,[u(v,{"x-small":"",indeterminate:"",class:"status-spinner"}),t[18]||(t[18]=x(" Restoring… ",-1))])):(r(),d("span",dt,[u(n,{name:"check_circle","x-small":"",class:"status-icon"}),t[19]||(t[19]=x(" Ready ",-1))]))]),g(" Actions "),b("td",it,[b("div",ct,[g(" Download "),f((r(),o(p,{"x-small":"",secondary:"",icon:"",onClick:C(t=>async function(e){try{const t=await I.get(`/acuity-backup/download/${e.id}`,{responseType:"blob"}),a=new Blob([t.data],{type:"application/zip"}),n=URL.createObjectURL(a),l=document.createElement("a");l.href=n,l.download=e.filename,l.click(),URL.revokeObjectURL(n)}catch{const t=document.createElement("a");t.href=function(e){return`/acuity-backup/download/${e.id}`}(e),t.download=e.filename,t.click()}}(e),["prevent"])},{default:s(()=>[u(n,{name:"download"})]),_:1},8,["onClick"])),[[ie,"Download backup archive"]]),g(" Restore — uses warning styling to signal impact "),f((r(),o(p,{"x-small":"",icon:"",class:"btn-restore",loading:re.value===e.id,disabled:null!==re.value&&re.value!==e.id,onClick:t=>function(e){oe.value=e,se.value=!1,de.value="",ue.value=!1,le.value=!0}(e)},{default:s(()=>[u(n,{name:"settings_backup_restore"})]),_:1},8,["loading","disabled","onClick"])),[[ie,"Restore data from this backup"]]),g(" Delete "),f((r(),o(p,{"x-small":"",secondary:"",icon:"",class:"btn-danger",loading:he.value===e.id,disabled:null!==he.value&&he.value!==e.id,onClick:t=>function(e){fe.value=e,ye.value="",ge.value=!0}(e)},{default:s(()=>[u(n,{name:"delete_outline"})]),_:1},8,["loading","disabled","onClick"])),[[ie,"Permanently delete this backup"]])])])]))),128))])])])],2112)):(r(),d(i,{key:1},[g(" Empty state "),b("div",qe,[u(n,{name:"cloud_off",class:"empty-icon"}),t[16]||(t[16]=b("p",{class:"empty-title"},"No backups yet",-1)),t[17]||(t[17]=b("p",{class:"empty-subtitle"},'Create your first backup by clicking "Run Backup" above.',-1)),u(p,{class:"empty-cta",onClick:Z},{default:s(()=>[u(n,{name:"add",left:""}),t[15]||(t[15]=x(" Run Backup ",-1))]),_:1})])],2112)),$.value.length>0?(r(),d("p",ut,[u(n,{name:"autorenew","x-small":"",class:"refresh-icon"}),x(" Auto-refreshes every 30 s — last updated: "+h(N.value),1)])):g("v-if",!0)])])):"schedule"===T.value?(r(),d(i,{key:1},[g(' ================================================================\n\t\t PAGE: SCHEDULE (route "schedule")\n\t\t ================================================================ '),b("div",pt,[b("div",vt,[t[27]||(t[27]=b("div",{class:"section-header"},[b("h2",{class:"section-title"},"Automatic Backups")],-1)),b("div",mt,[Ce.value?(r(),d("div",bt,[u(v,{indeterminate:""}),t[21]||(t[21]=b("span",null,"Loading schedule…",-1))])):(r(),d(i,{key:1},[b("div",gt,[t[22]||(t[22]=b("div",{class:"toggle-info"},[b("label",{class:"toggle-label",for:"schedule-enabled"},"Enable Automatic Backups"),b("span",{class:"toggle-desc"},"Runs a full backup on the schedule defined below")],-1)),u(k,{id:"schedule-enabled",modelValue:we.value,"onUpdate:modelValue":t[0]||(t[0]=e=>we.value=e)},null,8,["modelValue"])]),b("div",{class:y(["schedule-body",!we.value&&"schedule-body--disabled"])},[b("div",ft,[t[23]||(t[23]=b("span",{class:"preset-label"},"Presets:",-1)),(r(),d(i,null,c(ke,e=>b("button",{key:e.label,class:y(["preset-btn",_e.value===e.value&&"preset-btn--active"]),onClick:t=>function(e){"Disabled"===e.label?we.value=!1:(_e.value=e.value,we.value=!0)}(e),disabled:!we.value},h(e.label),11,ht)),64))]),b("div",yt,[t[24]||(t[24]=b("label",{class:"field-label",for:"cron-expression"},"Cron Expression",-1)),u(w,{id:"cron-expression",modelValue:_e.value,"onUpdate:modelValue":t[1]||(t[1]=e=>_e.value=e),placeholder:"0 0 * * *",disabled:!we.value,"font-mono":"",class:"cron-input"},null,8,["modelValue","disabled"]),t[25]||(t[25]=b("p",{class:"field-hint"},[x(" Five fields: minute hour day-of-month month day-of-week. "),b("a",{href:"https://crontab.guru/",target:"_blank",rel:"noopener noreferrer"},"crontab.guru")],-1))]),ze.value?(r(),d("div",xt,[u(n,{name:"history",small:""}),b("span",null,"Last run: "+h(Te(ze.value))+" ("+h(Ee(ze.value))+")",1)])):g("v-if",!0)],2),Re.value?(r(),d("div",kt,[u(_,{type:"danger"},{default:s(()=>[x(h(Re.value),1)]),_:1})])):g("v-if",!0),b("div",wt,[u(p,{onClick:Ve,loading:Se.value},{default:s(()=>[u(n,{name:"save",left:""}),t[26]||(t[26]=x(" Save Schedule ",-1))]),_:1},8,["loading"])])],64))])])])],2112)):"restore-logs"===T.value?(r(),d(i,{key:2},[g(' ================================================================\n\t\t PAGE: RESTORE LOGS (route "restore-logs")\n\t\t ================================================================ '),u(Pe)],2112)):g("v-if",!0),u(A,{modelValue:H.value,"onUpdate:modelValue":t[6]||(t[6]=e=>H.value=e),onEsc:ee},{default:s(()=>[u(L,{class:"backup-dialog"},{default:s(()=>[u(z,null,{default:s(()=>[u(n,{name:"add_circle",class:"dialog-title-icon"}),t[28]||(t[28]=x(" New Backup ",-1))]),_:1}),u(B,null,{default:s(()=>[g(" Backup type selection "),b("div",_t,[t[31]||(t[31]=b("label",{class:"field-label"},"Backup Type",-1)),b("div",zt,[b("label",{class:y(["radio-option",{"radio-option--active":"full"===q.value}])},[f(b("input",{type:"radio","onUpdate:modelValue":t[2]||(t[2]=e=>q.value=e),value:"full"},null,512),[[S,q.value]]),b("div",Ct,[u(n,{name:"cloud_download"}),t[29]||(t[29]=b("div",null,[b("span",{class:"radio-title"},"Full Backup"),b("span",{class:"radio-desc"},"Back up all collections and optionally all media files")],-1))])],2),b("label",{class:y(["radio-option",{"radio-option--active":"selective"===q.value}])},[f(b("input",{type:"radio","onUpdate:modelValue":t[3]||(t[3]=e=>q.value=e),value:"selective"},null,512),[[S,q.value]]),b("div",St,[u(n,{name:"checklist"}),t[30]||(t[30]=b("div",null,[b("span",{class:"radio-title"},"Selected Collections"),b("span",{class:"radio-desc"},"Choose specific collections to include in this backup")],-1))])],2)])]),g(" Collection selector (visible only for selective backup) "),u(R,{name:"slide-down"},{default:s(()=>["selective"===q.value?(r(),d("div",Rt,[b("div",{class:"collection-selector-header"},[t[33]||(t[33]=b("label",{class:"field-label"},"Collections",-1)),b("div",{class:"selector-actions"},[b("button",{class:"text-btn",onClick:te},"Select all"),t[32]||(t[32]=b("span",{class:"separator"},"·",-1)),b("button",{class:"text-btn",onClick:ae},"Clear")])]),X.value?(r(),d("div",Dt,[u(v,{indeterminate:"",small:""}),t[34]||(t[34]=b("span",null,"Loading collections…",-1))])):0===Q.value.length?(r(),d("div",Bt," No user collections found. ")):(r(),d("div",Vt,[(r(!0),d(i,null,c(Q.value,e=>(r(),d("label",{key:e.collection,class:y(["collection-item",{"collection-item--selected":J.value.includes(e.collection)}])},[f(b("input",{type:"checkbox",value:e.collection,"onUpdate:modelValue":t[4]||(t[4]=e=>J.value=e)},null,8,Tt),[[D,J.value]]),b("div",Et,[u(n,{name:e.icon||"table_chart",small:"",class:"collection-icon"},null,8,["name"]),b("span",Ft,h(e.collection),1),void 0!==e.itemCount?(r(),d("span",jt,h(e.itemCount.toLocaleString())+" items ",1)):g("v-if",!0)])],2))),128))])),"selective"===q.value&&0===J.value.length?(r(),d("p",It," Please select at least one collection. ")):g("v-if",!0)])):g("v-if",!0)]),_:1}),g(" Include media toggle "),b("div",Lt,[b("div",Ut,[t[35]||(t[35]=b("div",{class:"toggle-info"},[b("span",{class:"toggle-title"},"Include Media Files"),b("span",{class:"toggle-desc"},"Store metadata for all files in the media library")],-1)),u(k,{modelValue:W.value,"onUpdate:modelValue":t[5]||(t[5]=e=>W.value=e)},null,8,["modelValue"])])]),g(" Running state "),K.value?(r(),d("div",At,[u(v,{indeterminate:""}),t[36]||(t[36]=b("div",{class:"running-text"},[b("span",{class:"running-title"},"Backup in progress…"),b("span",{class:"running-desc"},"This may take a few moments. Please do not close this window.")],-1))])):g("v-if",!0),g(" Error from last attempt "),Y.value?(r(),d("div",$t,[u(_,{type:"danger"},{default:s(()=>[x(h(Y.value),1)]),_:1})])):g("v-if",!0)]),_:1}),u(V,null,{default:s(()=>[u(p,{secondary:"",onClick:ee,disabled:K.value},{default:s(()=>[...t[37]||(t[37]=[x(" Cancel ",-1)])]),_:1},8,["disabled"]),u(p,{onClick:ne,loading:K.value,disabled:"selective"===q.value&&0===J.value.length},{default:s(()=>[u(n,{name:"play_arrow",left:""}),t[38]||(t[38]=x(" Start Backup ",-1))]),_:1},8,["loading","disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),u(A,{modelValue:le.value,"onUpdate:modelValue":t[8]||(t[8]=e=>le.value=e),onEsc:ve},{default:s(()=>[u(L,{class:"confirm-dialog restore-dialog"},{default:s(()=>[u(z,{class:"restore-dialog-title"},{default:s(()=>[b("div",Mt,[b("div",Pt,[u(n,{name:"settings_backup_restore"})]),t[39]||(t[39]=b("span",null,"Restore Backup",-1))])]),_:1}),u(B,null,{default:s(()=>[g(" Prominent warning "),u(_,{type:"warning",class:"restore-warning-notice"},{default:s(()=>[...t[40]||(t[40]=[b("strong",null,"Data will be overwritten.",-1),x(" Restoring replaces existing records in the selected collections with the backup data. This action cannot be undone — consider creating a new backup first. ",-1)])]),_:1}),g(" Backup details summary "),oe.value?(r(),d("div",Nt,[b("div",Ot,[t[41]||(t[41]=b("span",{class:"detail-label"},"Backup date",-1)),b("span",Gt,h(Te(oe.value.timestamp)),1)]),b("div",Ht,[t[42]||(t[42]=b("span",{class:"detail-label"},"Age",-1)),b("span",qt,h(Ee(oe.value.timestamp)),1)]),b("div",Wt,[t[43]||(t[43]=b("span",{class:"detail-label"},"Type",-1)),b("span",Kt,h("full"===oe.value.type?"Full Backup":"Selective Backup"),1)]),b("div",Yt,[t[44]||(t[44]=b("span",{class:"detail-label"},"Collections",-1)),b("span",Jt,h("full"===oe.value.type?"All collections":oe.value.collections.join(", ")),1)]),b("div",Qt,[t[45]||(t[45]=b("span",{class:"detail-label"},"File size",-1)),b("span",Xt,h(Fe(oe.value.fileSize)),1)])])):g("v-if",!0),g(" Truncate toggle "),b("div",Zt,[t[46]||(t[46]=b("div",{class:"toggle-info"},[b("span",{class:"toggle-title"},"Truncate before restore"),b("span",{class:"toggle-desc"},"Delete all existing records before importing — ensures a clean, exact restore")],-1)),u(k,{modelValue:se.value,"onUpdate:modelValue":t[7]||(t[7]=e=>se.value=e)},null,8,["modelValue"])]),g(" Restore progress "),null!==re.value?(r(),d("div",ea,[b("div",ta,[b("div",aa,[b("span",na,h(ue.value?"Restore completed":"Restoring backup…"),1),b("span",la,h(ce.value.progressPercentage)+"%",1)]),u(P,{value:ce.value.progressPercentage,class:"progress-bar"},null,8,["value"]),b("div",oa,[b("span",ra,h(ce.value.phase),1),b("span",sa,h(ce.value.elapsedSeconds)+"s",1)])]),ce.value.errors.length>0?(r(),d("div",da,[b("details",ia,[b("summary",ca,h(ce.value.errors.length)+" error(s) occurred",1),b("div",ua,[(r(!0),d(i,null,c(ce.value.errors,(e,t)=>(r(),d("div",{key:t,class:"error-item"},[e.collection?(r(),d("span",pa,h(e.collection)+": ",1)):g("v-if",!0),b("span",va,h(e.message),1)]))),128))])])])):g("v-if",!0)])):g("v-if",!0),g(" Error "),de.value?(r(),d("div",ma,[u(_,{type:"danger"},{default:s(()=>[x(h(de.value),1)]),_:1})])):g("v-if",!0)]),_:1}),u(V,null,{default:s(()=>[ue.value?g("v-if",!0):(r(),o(p,{key:0,secondary:"",onClick:ve,disabled:null!==re.value},{default:s(()=>[...t[47]||(t[47]=[x(" Cancel ",-1)])]),_:1},8,["disabled"])),ue.value?(r(),o(p,{key:1,onClick:me},{default:s(()=>[u(n,{name:"close",left:""}),t[48]||(t[48]=x(" Close ",-1))]),_:1})):(r(),o(p,{key:2,class:"btn-restore-confirm",onClick:be,loading:null!==re.value&&!ue.value},{default:s(()=>[u(n,{name:"settings_backup_restore",left:""}),t[49]||(t[49]=x(" Restore Now ",-1))]),_:1},8,["loading"]))]),_:1})]),_:1})]),_:1},8,["modelValue"]),u(A,{modelValue:ge.value,"onUpdate:modelValue":t[10]||(t[10]=e=>ge.value=e),onEsc:t[11]||(t[11]=e=>ge.value=!1)},{default:s(()=>[u(L,{class:"confirm-dialog"},{default:s(()=>[u(z,null,{default:s(()=>[b("div",ba,[b("div",ga,[u(n,{name:"delete_forever"})]),t[50]||(t[50]=b("span",null,"Delete Backup",-1))])]),_:1}),u(B,null,{default:s(()=>[u(_,{type:"danger"},{default:s(()=>[...t[51]||(t[51]=[x(" This will permanently delete the backup archive from disk. This action cannot be undone. ",-1)])]),_:1}),fe.value?(r(),d("div",fa,[b("div",ha,[t[52]||(t[52]=b("span",{class:"detail-label"},"Backup date",-1)),b("span",ya,h(Te(fe.value.timestamp)),1)]),b("div",xa,[t[53]||(t[53]=b("span",{class:"detail-label"},"Type",-1)),b("span",ka,h("full"===fe.value.type?"Full Backup":"Selective Backup"),1)]),b("div",wa,[t[54]||(t[54]=b("span",{class:"detail-label"},"File size",-1)),b("span",_a,h(Fe(fe.value.fileSize)),1)])])):g("v-if",!0),ye.value?(r(),d("div",za,[u(_,{type:"danger"},{default:s(()=>[x(h(ye.value),1)]),_:1})])):g("v-if",!0)]),_:1}),u(V,null,{default:s(()=>[u(p,{secondary:"",onClick:t[9]||(t[9]=e=>ge.value=!1),disabled:null!==he.value},{default:s(()=>[...t[55]||(t[55]=[x(" Cancel ",-1)])]),_:1},8,["disabled"]),u(p,{danger:"",onClick:xe,loading:null!==he.value},{default:s(()=>[u(n,{name:"delete_forever",left:""}),t[56]||(t[56]=x(" Delete Permanently ",-1))]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["title"])}}});$e('\n/* ============================================================\n Layout\n ============================================================ */\n.backup-module-content[data-v-518b5928] {\n\tpadding: var(--content-padding);\n\tpadding-bottom: var(--content-padding-bottom);\n\tmax-width: 1100px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 40px;\n}\n.header-icon[data-v-518b5928] {\n\t--v-button-background-color: var(--theme--primary-background);\n\t--v-button-color: var(--theme--primary);\n}\n\n/* ============================================================\n Sections\n ============================================================ */\n.section[data-v-518b5928] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n}\n.section-header[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 12px;\n}\n.section-title[data-v-518b5928] {\n\tfont-size: 16px;\n\tfont-weight: 600;\n\tcolor: var(--theme--foreground);\n\tmargin: 0;\n}\n\n/* ============================================================\n Skeleton loader\n ============================================================ */\n.skeleton-rows[data-v-518b5928] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tborder-radius: var(--theme--border-radius);\n\toverflow: hidden;\n\tborder: 1px solid var(--theme--border-color-subdued);\n}\n.skeleton-row[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 16px;\n\tpadding: 14px 16px;\n\tbackground: var(--theme--background);\n}\n.skeleton-cell[data-v-518b5928] {\n\theight: 14px;\n\tborder-radius: 4px;\n\tbackground: var(--theme--background-subdued);\n\tanimation: shimmer-518b5928 1.5s ease-in-out infinite;\n}\n.skeleton-date[data-v-518b5928] { width: 140px;\n}\n.skeleton-type[data-v-518b5928] { width: 70px;\n}\n.skeleton-collections[data-v-518b5928] { width: 200px; flex: 1;\n}\n.skeleton-size[data-v-518b5928] { width: 60px;\n}\n.skeleton-status[data-v-518b5928] { width: 80px;\n}\n.skeleton-actions[data-v-518b5928] { width: 110px;\n}\n@keyframes shimmer-518b5928 {\n0%, 100% { opacity: 1;\n}\n50% { opacity: 0.4;\n}\n}\n\n/* ============================================================\n Empty state\n ============================================================ */\n.empty-state[data-v-518b5928] {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 60px 24px;\n\tborder: 2px dashed var(--theme--border-color);\n\tborder-radius: var(--theme--border-radius);\n\ttext-align: center;\n\tgap: 8px;\n}\n.empty-icon[data-v-518b5928] {\n\t--v-icon-size: 48px;\n\t--v-icon-color: var(--theme--foreground-subdued);\n\tmargin-bottom: 8px;\n}\n.empty-title[data-v-518b5928] {\n\tfont-size: 16px;\n\tfont-weight: 600;\n\tcolor: var(--theme--foreground);\n\tmargin: 0;\n}\n.empty-subtitle[data-v-518b5928] {\n\tfont-size: 14px;\n\tcolor: var(--theme--foreground-subdued);\n\tmargin: 0 0 8px;\n}\n.empty-cta[data-v-518b5928] {\n\tmargin-top: 8px;\n}\n\n/* ============================================================\n Backup table\n ============================================================ */\n.table-wrapper[data-v-518b5928] {\n\toverflow-x: auto;\n\tborder: 1px solid var(--theme--border-color-subdued);\n\tborder-radius: var(--theme--border-radius);\n}\n.backup-table[data-v-518b5928] {\n\twidth: 100%;\n\tborder-collapse: collapse;\n\tfont-size: 14px;\n}\n.backup-table thead[data-v-518b5928] {\n\tbackground: var(--theme--background-subdued);\n}\n.backup-table th[data-v-518b5928] {\n\tpadding: 10px 16px;\n\ttext-align: left;\n\tfont-weight: 600;\n\tfont-size: 12px;\n\ttext-transform: uppercase;\n\tletter-spacing: 0.05em;\n\tcolor: var(--theme--foreground-subdued);\n\tborder-bottom: 1px solid var(--theme--border-color-subdued);\n\twhite-space: nowrap;\n}\n.backup-table td[data-v-518b5928] {\n\tpadding: 12px 16px;\n\tvertical-align: middle;\n\tborder-bottom: 1px solid var(--theme--border-color-subdued);\n\tcolor: var(--theme--foreground);\n}\n.backup-row:last-child td[data-v-518b5928] {\n\tborder-bottom: none;\n}\n.backup-row:hover td[data-v-518b5928] {\n\tbackground: var(--theme--background-subdued);\n}\n\n/* Column widths */\n.col-date[data-v-518b5928] { min-width: 160px;\n}\n.col-type[data-v-518b5928] { min-width: 120px;\n}\n.col-collections[data-v-518b5928] { min-width: 180px;\n}\n.col-size[data-v-518b5928] { min-width: 80px; white-space: nowrap;\n}\n.col-status[data-v-518b5928] { min-width: 100px;\n}\n.col-actions[data-v-518b5928] { min-width: 130px; text-align: right;\n}\n.date-primary[data-v-518b5928] {\n\tdisplay: block;\n\tfont-weight: 500;\n}\n.date-relative[data-v-518b5928] {\n\tdisplay: block;\n\tfont-size: 12px;\n\tcolor: var(--theme--foreground-subdued);\n\tmargin-top: 2px;\n}\n\n/* Type badges */\n.type-cell[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n}\n.type-badge[data-v-518b5928] {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tpadding: 2px 8px;\n\tborder-radius: 100px;\n\tfont-size: 12px;\n\tfont-weight: 600;\n}\n.type-full[data-v-518b5928] {\n\tbackground: var(--theme--primary-background);\n\tcolor: var(--theme--primary);\n}\n.type-selective[data-v-518b5928] {\n\tbackground: var(--theme--secondary-background, #f0f4ff);\n\tcolor: var(--theme--secondary, #6644dd);\n}\n.media-badge[data-v-518b5928] {\n\t--v-icon-color: var(--theme--foreground-subdued);\n\tdisplay: inline-flex;\n\talign-items: center;\n}\n\n/* Status badges */\n.status-badge[data-v-518b5928] {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 5px;\n\tpadding: 3px 8px;\n\tborder-radius: 100px;\n\tfont-size: 12px;\n\tfont-weight: 600;\n\twhite-space: nowrap;\n}\n.status-valid[data-v-518b5928] {\n\tbackground: color-mix(in srgb, var(--theme--success) 12%, transparent);\n\tcolor: var(--theme--success);\n}\n.status-restoring[data-v-518b5928] {\n\tbackground: color-mix(in srgb, var(--theme--warning) 12%, transparent);\n\tcolor: var(--theme--warning);\n}\n.status-icon[data-v-518b5928] {\n\t--v-icon-size: 14px;\n\t--v-icon-color: currentColor;\n}\n.status-spinner[data-v-518b5928] {\n\t--v-progress-circular-size: 14px;\n}\n\n/* ============================================================\n Action buttons\n ============================================================ */\n.action-buttons[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: flex-end;\n\tgap: 6px;\n}\n\n/*\n * Restore button — amber/warning palette so it stands out from the\n * neutral Download button and the red Delete button.\n * Uses Directus warning tokens with a solid filled style.\n */\n.btn-restore[data-v-518b5928] {\n\t--v-button-background-color: color-mix(in srgb, var(--theme--warning) 15%, transparent);\n\t--v-button-color: var(--theme--warning);\n\t--v-button-border-color: color-mix(in srgb, var(--theme--warning) 40%, transparent);\n\t--v-button-background-color-hover: var(--theme--warning);\n\t--v-button-color-hover: var(--white);\n\t--v-button-border-color-hover: var(--theme--warning);\n}\n.btn-danger[data-v-518b5928] {\n\t--v-button-color: var(--theme--danger);\n\t--v-button-color-hover: var(--white);\n\t--v-button-background-color-hover: var(--theme--danger);\n\t--v-button-border-color-hover: var(--theme--danger);\n}\n.auto-refresh-notice[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 5px;\n\tfont-size: 12px;\n\tcolor: var(--theme--foreground-subdued);\n\tmargin: 0;\n}\n.refresh-icon[data-v-518b5928] {\n\t--v-icon-size: 13px;\n\t--v-icon-color: var(--theme--foreground-subdued);\n}\n\n/* ============================================================\n Schedule card\n ============================================================ */\n.schedule-card[data-v-518b5928] {\n\tbackground: var(--theme--background);\n\tborder: 1px solid var(--theme--border-color-subdued);\n\tborder-radius: var(--theme--border-radius);\n\tpadding: 24px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 20px;\n}\n.schedule-loading[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n\tcolor: var(--theme--foreground-subdued);\n\tfont-size: 14px;\n}\n.schedule-toggle-row[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 16px;\n}\n.toggle-label[data-v-518b5928] {\n\tfont-size: 15px;\n\tfont-weight: 600;\n\tcolor: var(--theme--foreground);\n}\n.schedule-body[data-v-518b5928] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 16px;\n\ttransition: opacity 0.2s ease;\n}\n.schedule-body--disabled[data-v-518b5928] {\n\topacity: 0.45;\n\tpointer-events: none;\n}\n.cron-presets[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tflex-wrap: wrap;\n\tgap: 8px;\n}\n.preset-label[data-v-518b5928] {\n\tfont-size: 13px;\n\tcolor: var(--theme--foreground-subdued);\n\tfont-weight: 500;\n}\n.preset-btn[data-v-518b5928] {\n\tpadding: 4px 14px;\n\tborder-radius: 100px;\n\tborder: 1px solid var(--theme--border-color);\n\tbackground: var(--theme--background-subdued);\n\tcolor: var(--theme--foreground);\n\tfont-size: 13px;\n\tcursor: pointer;\n\ttransition: background 0.15s, border-color 0.15s, color 0.15s;\n}\n.preset-btn[data-v-518b5928]:hover:not(:disabled) {\n\tbackground: var(--theme--primary-background);\n\tborder-color: var(--theme--primary);\n\tcolor: var(--theme--primary);\n}\n.preset-btn--active[data-v-518b5928] {\n\tbackground: var(--theme--primary);\n\tborder-color: var(--theme--primary);\n\tcolor: var(--white);\n}\n.preset-btn--active[data-v-518b5928]:hover:not(:disabled) {\n\tbackground: var(--theme--primary);\n\tcolor: var(--white);\n}\n.preset-btn[data-v-518b5928]:disabled {\n\tcursor: not-allowed;\n}\n.cron-input-row[data-v-518b5928] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n.field-label[data-v-518b5928] {\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tcolor: var(--theme--foreground-subdued);\n\ttext-transform: uppercase;\n\tletter-spacing: 0.05em;\n}\n.cron-input[data-v-518b5928] {\n\tmax-width: 320px;\n\tfont-family: var(--theme--fonts--mono--font-family, monospace);\n}\n.field-hint[data-v-518b5928] {\n\tfont-size: 12px;\n\tcolor: var(--theme--foreground-subdued);\n\tmargin: 0;\n}\n.field-hint a[data-v-518b5928] {\n\tcolor: var(--theme--primary);\n\ttext-decoration: none;\n}\n.field-hint a[data-v-518b5928]:hover {\n\ttext-decoration: underline;\n}\n.last-run-row[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n\tfont-size: 13px;\n\tcolor: var(--theme--foreground-subdued);\n\t--v-icon-color: var(--theme--foreground-subdued);\n}\n.schedule-footer[data-v-518b5928] {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tpadding-top: 4px;\n\tborder-top: 1px solid var(--theme--border-color-subdued);\n}\n\n/* ============================================================\n Dialogs — shared\n ============================================================ */\n.backup-dialog[data-v-518b5928],\n.confirm-dialog[data-v-518b5928] {\n\twidth: 560px;\n\tmax-width: calc(100vw - 32px);\n}\n.dialog-section[data-v-518b5928] {\n\tmargin-bottom: 20px;\n}\n.dialog-section[data-v-518b5928]:last-child {\n\tmargin-bottom: 0;\n}\n\n/* Dialog title with icon */\n.dialog-title-row[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n}\n.dialog-title-icon-wrap[data-v-518b5928] {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 32px;\n\theight: 32px;\n\tborder-radius: 50%;\n\tflex-shrink: 0;\n}\n.restore-icon-wrap[data-v-518b5928] {\n\tbackground: color-mix(in srgb, var(--theme--warning) 15%, transparent);\n\tcolor: var(--theme--warning);\n\t--v-icon-color: var(--theme--warning);\n}\n.danger-icon-wrap[data-v-518b5928] {\n\tbackground: color-mix(in srgb, var(--theme--danger) 12%, transparent);\n\tcolor: var(--theme--danger);\n\t--v-icon-color: var(--theme--danger);\n}\n\n/* ============================================================\n Restore dialog specifics\n ============================================================ */\n.restore-warning-notice[data-v-518b5928] {\n\tmargin-bottom: 0;\n}\n.restore-option-row[data-v-518b5928] {\n\tmargin-top: 16px;\n}\n.restore-progress[data-v-518b5928] {\n\tmargin-top: 16px;\n}\n\n/* Restore confirm button — warning/amber so it reads as impactful but not destructive */\n.btn-restore-confirm[data-v-518b5928] {\n\t--v-button-background-color: var(--theme--warning);\n\t--v-button-color: var(--white);\n\t--v-button-border-color: var(--theme--warning);\n\t--v-button-background-color-hover: color-mix(in srgb, var(--theme--warning) 85%, black);\n\t--v-button-color-hover: var(--white);\n\t--v-button-border-color-hover: color-mix(in srgb, var(--theme--warning) 85%, black);\n}\n\n/* ============================================================\n Radio group (New Backup dialog)\n ============================================================ */\n.radio-group[data-v-518b5928] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tmargin-top: 8px;\n}\n.radio-option[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tgap: 0;\n\tborder: 1px solid var(--theme--border-color);\n\tborder-radius: var(--theme--border-radius);\n\tpadding: 14px 16px;\n\tcursor: pointer;\n\ttransition: border-color 0.15s, background 0.15s;\n}\n.radio-option input[type="radio"][data-v-518b5928] {\n\tposition: absolute;\n\topacity: 0;\n\tpointer-events: none;\n}\n.radio-option--active[data-v-518b5928] {\n\tborder-color: var(--theme--primary);\n\tbackground: var(--theme--primary-background);\n}\n.radio-option[data-v-518b5928]:hover:not(.radio-option--active) {\n\tbackground: var(--theme--background-subdued);\n\tborder-color: var(--theme--border-color-subdued);\n}\n.radio-content[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tgap: 12px;\n\twidth: 100%;\n\t--v-icon-color: var(--theme--primary);\n}\n.radio-title[data-v-518b5928] {\n\tdisplay: block;\n\tfont-weight: 600;\n\tfont-size: 14px;\n\tcolor: var(--theme--foreground);\n}\n.radio-desc[data-v-518b5928] {\n\tdisplay: block;\n\tfont-size: 13px;\n\tcolor: var(--theme--foreground-subdued);\n\tmargin-top: 2px;\n}\n\n/* ============================================================\n Collection selector\n ============================================================ */\n.collection-selector[data-v-518b5928] {\n\tborder: 1px solid var(--theme--border-color-subdued);\n\tborder-radius: var(--theme--border-radius);\n\toverflow: hidden;\n}\n.collection-selector-header[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 10px 14px;\n\tbackground: var(--theme--background-subdued);\n\tborder-bottom: 1px solid var(--theme--border-color-subdued);\n}\n.selector-actions[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 6px;\n}\n.text-btn[data-v-518b5928] {\n\tbackground: none;\n\tborder: none;\n\tcursor: pointer;\n\tfont-size: 13px;\n\tcolor: var(--theme--primary);\n\tpadding: 0;\n}\n.text-btn[data-v-518b5928]:hover {\n\ttext-decoration: underline;\n}\n.separator[data-v-518b5928] {\n\tcolor: var(--theme--border-color);\n}\n.collections-loading[data-v-518b5928],\n.collections-empty[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tpadding: 16px 14px;\n\tfont-size: 14px;\n\tcolor: var(--theme--foreground-subdued);\n}\n.collection-list-scroll[data-v-518b5928] {\n\tmax-height: 240px;\n\toverflow-y: auto;\n}\n.collection-item[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 8px 14px;\n\tcursor: pointer;\n\ttransition: background 0.1s;\n\tborder-bottom: 1px solid var(--theme--border-color-subdued);\n}\n.collection-item[data-v-518b5928]:last-child {\n\tborder-bottom: none;\n}\n.collection-item input[type="checkbox"][data-v-518b5928] {\n\twidth: 16px;\n\theight: 16px;\n\tflex-shrink: 0;\n\taccent-color: var(--theme--primary);\n\tcursor: pointer;\n}\n.collection-item--selected[data-v-518b5928] {\n\tbackground: var(--theme--primary-background);\n}\n.collection-item[data-v-518b5928]:hover:not(.collection-item--selected) {\n\tbackground: var(--theme--background-subdued);\n}\n.collection-item-content[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tmargin-left: 10px;\n\tflex: 1;\n}\n.collection-icon[data-v-518b5928] {\n\t--v-icon-color: var(--theme--foreground-subdued);\n}\n.collection-name[data-v-518b5928] {\n\tflex: 1;\n\tfont-size: 14px;\n\tcolor: var(--theme--foreground);\n\tfont-family: var(--theme--fonts--mono--font-family, monospace);\n}\n.collection-count[data-v-518b5928] {\n\tfont-size: 12px;\n\tcolor: var(--theme--foreground-subdued);\n\twhite-space: nowrap;\n}\n\n/* ============================================================\n Toggle rows (shared between dialogs and schedule card)\n ============================================================ */\n.toggle-row[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 16px;\n\tpadding: 12px 0;\n\tborder-top: 1px solid var(--theme--border-color-subdued);\n}\n.toggle-info[data-v-518b5928] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n}\n.toggle-title[data-v-518b5928] {\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tcolor: var(--theme--foreground);\n}\n.toggle-desc[data-v-518b5928] {\n\tfont-size: 13px;\n\tcolor: var(--theme--foreground-subdued);\n}\n\n/* ============================================================\n Running / progress state\n ============================================================ */\n.running-state[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tgap: 14px;\n\tpadding: 16px;\n\tbackground: var(--theme--primary-background);\n\tborder-radius: var(--theme--border-radius);\n\tborder: 1px solid var(--theme--primary);\n\tmargin-top: 16px;\n}\n.running-text[data-v-518b5928] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n.running-title[data-v-518b5928] {\n\tfont-size: 14px;\n\tfont-weight: 600;\n\tcolor: var(--theme--primary);\n}\n.running-desc[data-v-518b5928] {\n\tfont-size: 13px;\n\tcolor: var(--theme--foreground-subdued);\n}\n.progress-info[data-v-518b5928] {\n\tflex: 1;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n.progress-header[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 16px;\n}\n.progress-percentage[data-v-518b5928] {\n\tfont-size: 16px;\n\tfont-weight: 600;\n\tcolor: var(--theme--primary);\n\tmin-width: 50px;\n\ttext-align: right;\n}\n.progress-bar[data-v-518b5928] {\n\twidth: 100%;\n}\n.progress-details[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tfont-size: 12px;\n\tcolor: var(--theme--foreground-subdued);\n}\n.phase-text[data-v-518b5928] {\n\tflex: 1;\n}\n.elapsed-time[data-v-518b5928] {\n\twhite-space: nowrap;\n\tmargin-left: 16px;\n}\n.errors-section[data-v-518b5928] {\n\tmargin-top: 8px;\n}\n.errors-details[data-v-518b5928] {\n\tcursor: pointer;\n}\n.errors-summary[data-v-518b5928] {\n\tfont-size: 12px;\n\tcolor: var(--theme--danger);\n\tfont-weight: 500;\n\tuser-select: none;\n\tpadding: 8px;\n\tmargin: -8px;\n\tborder-radius: var(--theme--border-radius);\n}\n.errors-summary[data-v-518b5928]:hover {\n\tbackground: var(--theme--background-subdued);\n}\n.errors-list[data-v-518b5928] {\n\tmargin-top: 8px;\n\tpadding-left: 12px;\n\tborder-left: 2px solid var(--theme--danger);\n\tmax-height: 200px;\n\toverflow-y: auto;\n}\n.error-item[data-v-518b5928] {\n\tfont-size: 12px;\n\tcolor: var(--theme--foreground-subdued);\n\tpadding: 4px 0;\n\tword-break: break-word;\n}\n.error-collection[data-v-518b5928] {\n\tcolor: var(--theme--danger);\n\tfont-weight: 500;\n}\n.error-message[data-v-518b5928] {\n\tcolor: var(--theme--foreground-subdued);\n}\n\n/* ============================================================\n Confirm dialog details panel\n ============================================================ */\n.confirm-details[data-v-518b5928] {\n\tmargin-top: 16px;\n\tbackground: var(--theme--background-subdued);\n\tborder-radius: var(--theme--border-radius);\n\tpadding: 12px 16px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n.detail-row[data-v-518b5928] {\n\tdisplay: flex;\n\talign-items: flex-start;\n\tgap: 12px;\n}\n.detail-label[data-v-518b5928] {\n\tfont-size: 13px;\n\tcolor: var(--theme--foreground-subdued);\n\tmin-width: 110px;\n\tflex-shrink: 0;\n}\n.detail-value[data-v-518b5928] {\n\tfont-size: 13px;\n\tcolor: var(--theme--foreground);\n\tword-break: break-word;\n}\n\n/* ============================================================\n Error & validation notices\n ============================================================ */\n.error-notice[data-v-518b5928] {\n\tmargin-top: 12px;\n}\n.validation-msg[data-v-518b5928] {\n\tfont-size: 12px;\n\tcolor: var(--theme--danger);\n\tpadding: 6px 14px;\n\tmargin: 0;\n}\n\n/* ============================================================\n Transitions\n ============================================================ */\n.slide-down-enter-active[data-v-518b5928],\n.slide-down-leave-active[data-v-518b5928] {\n\ttransition: opacity 0.2s ease, transform 0.2s ease, max-height 0.25s ease;\n\tmax-height: 400px;\n\toverflow: hidden;\n}\n.slide-down-enter-from[data-v-518b5928],\n.slide-down-leave-to[data-v-518b5928] {\n\topacity: 0;\n\ttransform: translateY(-6px);\n\tmax-height: 0;\n}\n\n/* ============================================================\n Responsive\n ============================================================ */\n@media (max-width: 900px) {\n.col-collections[data-v-518b5928] { display: none;\n}\n}\n@media (max-width: 768px) {\n.backup-module-content[data-v-518b5928] {\n\t\tpadding: 16px;\n\t\tgap: 28px;\n}\n.col-size[data-v-518b5928] { display: none;\n}\n.col-status[data-v-518b5928] { display: none;\n}\n\n\t/* Collapse action buttons to icon-only on small viewports — already icon-only, but tighten gap */\n.action-buttons[data-v-518b5928] {\n\t\tgap: 4px;\n}\n.backup-dialog[data-v-518b5928],\n\t.confirm-dialog[data-v-518b5928] {\n\t\twidth: 100%;\n}\n.cron-input[data-v-518b5928] {\n\t\tmax-width: 100%;\n}\n.schedule-card[data-v-518b5928] {\n\t\tpadding: 16px;\n}\n.cron-presets[data-v-518b5928] {\n\t\tgap: 6px;\n}\n.dialog-title-row[data-v-518b5928] {\n\t\tgap: 8px;\n}\n}\n',{});var Sa=Me(Ca,[["__scopeId","data-v-518b5928"]]),Ra=Object.freeze({__proto__:null,default:Sa});export{T as displays,V as interfaces,E as layouts,F as modules,L as operations,j as panels,I as themes};
package/icon.png ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@acuity/directus-extension-acuity-backup",
3
+ "description": "Backup Directus collections, schema, and media files to ZIP archives",
4
+ "icon": "icon.png",
5
+ "version": "1.6.0",
6
+ "license": "MIT",
7
+ "author": {
8
+ "name": "Acuity",
9
+ "url": "https://acuity.com"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://git.technolify.cloud/acuity/directus/backup-plugin.git"
14
+ },
15
+ "keywords": [
16
+ "directus",
17
+ "directus-extension",
18
+ "directus-extension-bundle",
19
+ "backup",
20
+ "archive",
21
+ "export",
22
+ "data-backup"
23
+ ],
24
+ "type": "module",
25
+ "files": [
26
+ "dist",
27
+ "icon.png"
28
+ ],
29
+ "directus:extension": {
30
+ "type": "bundle",
31
+ "path": {
32
+ "app": "dist/app.js",
33
+ "api": "dist/api.js"
34
+ },
35
+ "entries": [
36
+ {
37
+ "type": "endpoint",
38
+ "name": "acuity-backup",
39
+ "source": "src/backup-endpoint/index.ts"
40
+ },
41
+ {
42
+ "type": "module",
43
+ "name": "acuity-backup-module",
44
+ "source": "src/backup-module/index.ts"
45
+ }
46
+ ],
47
+ "host": "^10.10.0"
48
+ },
49
+ "scripts": {
50
+ "build": "directus-extension build",
51
+ "dev": "directus-extension build -w --no-minify",
52
+ "link": "directus-extension link",
53
+ "validate": "directus-extension validate",
54
+ "add": "directus-extension add"
55
+ },
56
+ "dependencies": {
57
+ "archiver": "^6.0.0",
58
+ "node-cron": "^3.0.0",
59
+ "unzipper": "^0.12.3"
60
+ },
61
+ "devDependencies": {
62
+ "@directus/extensions-sdk": "17.0.9",
63
+ "@types/archiver": "^6.0.0",
64
+ "@types/node": "^20.0.0",
65
+ "typescript": "^5.0.0"
66
+ }
67
+ }