massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / prettier / doc.js
1 (function (global, factory) {
2         typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3         typeof define === 'function' && define.amd ? define(factory) :
4         (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.doc = factory());
5 })(this, (function () { 'use strict';
6
7         var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
8
9         /**
10          * @param {Doc[]} parts
11          * @returns Doc
12          */
13
14
15         function concat$1(parts) {
16           // access the internals of a document directly.
17           // if(parts.length === 1) {
18           //   // If it's a single document, no need to concat it.
19           //   return parts[0];
20           // }
21
22
23           return {
24             type: "concat",
25             parts
26           };
27         }
28         /**
29          * @param {Doc} contents
30          * @returns Doc
31          */
32
33
34         function indent$1(contents) {
35
36           return {
37             type: "indent",
38             contents
39           };
40         }
41         /**
42          * @param {number | string} widthOrString
43          * @param {Doc} contents
44          * @returns Doc
45          */
46
47
48         function align(widthOrString, contents) {
49
50           return {
51             type: "align",
52             contents,
53             n: widthOrString
54           };
55         }
56         /**
57          * @param {Doc} contents
58          * @param {object} [opts] - TBD ???
59          * @returns Doc
60          */
61
62
63         function group(contents) {
64           let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
65
66           return {
67             type: "group",
68             id: opts.id,
69             contents,
70             break: Boolean(opts.shouldBreak),
71             expandedStates: opts.expandedStates
72           };
73         }
74         /**
75          * @param {Doc} contents
76          * @returns Doc
77          */
78
79
80         function dedentToRoot(contents) {
81           return align(Number.NEGATIVE_INFINITY, contents);
82         }
83         /**
84          * @param {Doc} contents
85          * @returns Doc
86          */
87
88
89         function markAsRoot(contents) {
90           // @ts-expect-error - TBD ???:
91           return align({
92             type: "root"
93           }, contents);
94         }
95         /**
96          * @param {Doc} contents
97          * @returns Doc
98          */
99
100
101         function dedent(contents) {
102           return align(-1, contents);
103         }
104         /**
105          * @param {Doc[]} states
106          * @param {object} [opts] - TBD ???
107          * @returns Doc
108          */
109
110
111         function conditionalGroup(states, opts) {
112           return group(states[0], Object.assign(Object.assign({}, opts), {}, {
113             expandedStates: states
114           }));
115         }
116         /**
117          * @param {Doc[]} parts
118          * @returns Doc
119          */
120
121
122         function fill$1(parts) {
123
124           return {
125             type: "fill",
126             parts
127           };
128         }
129         /**
130          * @param {Doc} [breakContents]
131          * @param {Doc} [flatContents]
132          * @param {object} [opts] - TBD ???
133          * @returns Doc
134          */
135
136
137         function ifBreak(breakContents, flatContents) {
138           let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
139
140           return {
141             type: "if-break",
142             breakContents,
143             flatContents,
144             groupId: opts.groupId
145           };
146         }
147         /**
148          * Optimized version of `ifBreak(indent(doc), doc, { groupId: ... })`
149          * @param {Doc} contents
150          * @param {{ groupId: symbol, negate?: boolean }} opts
151          * @returns Doc
152          */
153
154
155         function indentIfBreak(contents, opts) {
156           return {
157             type: "indent-if-break",
158             contents,
159             groupId: opts.groupId,
160             negate: opts.negate
161           };
162         }
163         /**
164          * @param {Doc} contents
165          * @returns Doc
166          */
167
168
169         function lineSuffix(contents) {
170
171           return {
172             type: "line-suffix",
173             contents
174           };
175         }
176
177         const lineSuffixBoundary = {
178           type: "line-suffix-boundary"
179         };
180         const breakParent = {
181           type: "break-parent"
182         };
183         const trim$1 = {
184           type: "trim"
185         };
186         const hardlineWithoutBreakParent = {
187           type: "line",
188           hard: true
189         };
190         const literallineWithoutBreakParent = {
191           type: "line",
192           hard: true,
193           literal: true
194         };
195         const line = {
196           type: "line"
197         };
198         const softline = {
199           type: "line",
200           soft: true
201         }; // eslint-disable-next-line prettier-internal-rules/no-doc-builder-concat
202
203         const hardline = concat$1([hardlineWithoutBreakParent, breakParent]); // eslint-disable-next-line prettier-internal-rules/no-doc-builder-concat
204
205         const literalline$1 = concat$1([literallineWithoutBreakParent, breakParent]);
206         const cursor$1 = {
207           type: "cursor",
208           placeholder: Symbol("cursor")
209         };
210         /**
211          * @param {Doc} sep
212          * @param {Doc[]} arr
213          * @returns Doc
214          */
215
216         function join$1(sep, arr) {
217           const res = [];
218
219           for (let i = 0; i < arr.length; i++) {
220             if (i !== 0) {
221               res.push(sep);
222             }
223
224             res.push(arr[i]);
225           } // eslint-disable-next-line prettier-internal-rules/no-doc-builder-concat
226
227
228           return concat$1(res);
229         }
230         /**
231          * @param {Doc} doc
232          * @param {number} size
233          * @param {number} tabWidth
234          */
235
236
237         function addAlignmentToDoc(doc, size, tabWidth) {
238           let aligned = doc;
239
240           if (size > 0) {
241             // Use indent to add tabs for all the levels of tabs we need
242             for (let i = 0; i < Math.floor(size / tabWidth); ++i) {
243               aligned = indent$1(aligned);
244             } // Use align for all the spaces that are needed
245
246
247             aligned = align(size % tabWidth, aligned); // size is absolute from 0 and not relative to the current
248             // indentation, so we use -Infinity to reset the indentation to 0
249
250             aligned = align(Number.NEGATIVE_INFINITY, aligned);
251           }
252
253           return aligned;
254         }
255
256         function label(label, contents) {
257           return {
258             type: "label",
259             label,
260             contents
261           };
262         }
263
264         var docBuilders = {
265           concat: concat$1,
266           join: join$1,
267           line,
268           softline,
269           hardline,
270           literalline: literalline$1,
271           group,
272           conditionalGroup,
273           fill: fill$1,
274           lineSuffix,
275           lineSuffixBoundary,
276           cursor: cursor$1,
277           breakParent,
278           ifBreak,
279           trim: trim$1,
280           indent: indent$1,
281           indentIfBreak,
282           align,
283           addAlignmentToDoc,
284           markAsRoot,
285           dedentToRoot,
286           dedent,
287           hardlineWithoutBreakParent,
288           literallineWithoutBreakParent,
289           label
290         };
291
292         var stringWidth$2 = {exports: {}};
293
294         var ansiRegex$1 = function () {
295           let {
296             onlyFirst = false
297           } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
298           const pattern = ['[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'].join('|');
299           return new RegExp(pattern, onlyFirst ? undefined : 'g');
300         };
301
302         const ansiRegex = ansiRegex$1;
303
304         var stripAnsi$1 = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
305
306         var isFullwidthCodePoint$2 = {exports: {}};
307
308         /* eslint-disable yoda */
309
310         const isFullwidthCodePoint$1 = codePoint => {
311           if (Number.isNaN(codePoint)) {
312             return false;
313           } // Code points are derived from:
314           // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
315
316
317           if (codePoint >= 0x1100 && (codePoint <= 0x115F || // Hangul Jamo
318           codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET
319           codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET
320           // CJK Radicals Supplement .. Enclosed CJK Letters and Months
321           0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
322           0x3250 <= codePoint && codePoint <= 0x4DBF || // CJK Unified Ideographs .. Yi Radicals
323           0x4E00 <= codePoint && codePoint <= 0xA4C6 || // Hangul Jamo Extended-A
324           0xA960 <= codePoint && codePoint <= 0xA97C || // Hangul Syllables
325           0xAC00 <= codePoint && codePoint <= 0xD7A3 || // CJK Compatibility Ideographs
326           0xF900 <= codePoint && codePoint <= 0xFAFF || // Vertical Forms
327           0xFE10 <= codePoint && codePoint <= 0xFE19 || // CJK Compatibility Forms .. Small Form Variants
328           0xFE30 <= codePoint && codePoint <= 0xFE6B || // Halfwidth and Fullwidth Forms
329           0xFF01 <= codePoint && codePoint <= 0xFF60 || 0xFFE0 <= codePoint && codePoint <= 0xFFE6 || // Kana Supplement
330           0x1B000 <= codePoint && codePoint <= 0x1B001 || // Enclosed Ideographic Supplement
331           0x1F200 <= codePoint && codePoint <= 0x1F251 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
332           0x20000 <= codePoint && codePoint <= 0x3FFFD)) {
333             return true;
334           }
335
336           return false;
337         };
338
339         isFullwidthCodePoint$2.exports = isFullwidthCodePoint$1;
340
341         isFullwidthCodePoint$2.exports.default = isFullwidthCodePoint$1;
342
343         var emojiRegex$1 = function () {
344           // https://mths.be/emoji
345           return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
346         };
347
348         const stripAnsi = stripAnsi$1;
349         const isFullwidthCodePoint = isFullwidthCodePoint$2.exports;
350         const emojiRegex = emojiRegex$1;
351
352         const stringWidth$1 = string => {
353           if (typeof string !== 'string' || string.length === 0) {
354             return 0;
355           }
356
357           string = stripAnsi(string);
358
359           if (string.length === 0) {
360             return 0;
361           }
362
363           string = string.replace(emojiRegex(), '  ');
364           let width = 0;
365
366           for (let i = 0; i < string.length; i++) {
367             const code = string.codePointAt(i); // Ignore control characters
368
369             if (code <= 0x1F || code >= 0x7F && code <= 0x9F) {
370               continue;
371             } // Ignore combining characters
372
373
374             if (code >= 0x300 && code <= 0x36F) {
375               continue;
376             } // Surrogates
377
378
379             if (code > 0xFFFF) {
380               i++;
381             }
382
383             width += isFullwidthCodePoint(code) ? 2 : 1;
384           }
385
386           return width;
387         };
388
389         stringWidth$2.exports = stringWidth$1; // TODO: remove this in the next major version
390
391         stringWidth$2.exports.default = stringWidth$1;
392
393         var escapeStringRegexp$1 = string => {
394           if (typeof string !== 'string') {
395             throw new TypeError('Expected a string');
396           } // Escape characters with special meaning either inside or outside character sets.
397           // Use a simple backslash escape when it’s always valid, and a \unnnn escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
398
399
400           return string.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d');
401         };
402
403         const getLast$3 = arr => arr[arr.length - 1];
404
405         var getLast_1 = getLast$3;
406
407         function _objectWithoutPropertiesLoose(source, excluded) {
408           if (source == null) return {};
409           var target = {};
410           var sourceKeys = Object.keys(source);
411           var key, i;
412
413           for (i = 0; i < sourceKeys.length; i++) {
414             key = sourceKeys[i];
415             if (excluded.indexOf(key) >= 0) continue;
416             target[key] = source[key];
417           }
418
419           return target;
420         }
421
422         function _objectWithoutProperties(source, excluded) {
423           if (source == null) return {};
424
425           var target = _objectWithoutPropertiesLoose(source, excluded);
426
427           var key, i;
428
429           if (Object.getOwnPropertySymbols) {
430             var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
431
432             for (i = 0; i < sourceSymbolKeys.length; i++) {
433               key = sourceSymbolKeys[i];
434               if (excluded.indexOf(key) >= 0) continue;
435               if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
436               target[key] = source[key];
437             }
438           }
439
440           return target;
441         }
442
443         function _taggedTemplateLiteral(strings, raw) {
444           if (!raw) {
445             raw = strings.slice(0);
446           }
447
448           return Object.freeze(Object.defineProperties(strings, {
449             raw: {
450               value: Object.freeze(raw)
451             }
452           }));
453         }
454
455         var check = function (it) {
456           return it && it.Math == Math && it;
457         };
458
459         // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
460         var global$s =
461           // eslint-disable-next-line es/no-global-this -- safe
462           check(typeof globalThis == 'object' && globalThis) ||
463           check(typeof window == 'object' && window) ||
464           // eslint-disable-next-line no-restricted-globals -- safe
465           check(typeof self == 'object' && self) ||
466           check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
467           // eslint-disable-next-line no-new-func -- fallback
468           (function () { return this; })() || Function('return this')();
469
470         var objectGetOwnPropertyDescriptor = {};
471
472         var fails$8 = function (exec) {
473           try {
474             return !!exec();
475           } catch (error) {
476             return true;
477           }
478         };
479
480         var fails$7 = fails$8;
481
482         // Detect IE8's incomplete defineProperty implementation
483         var descriptors = !fails$7(function () {
484           // eslint-disable-next-line es/no-object-defineproperty -- required for testing
485           return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
486         });
487
488         var call$7 = Function.prototype.call;
489
490         var functionCall = call$7.bind ? call$7.bind(call$7) : function () {
491           return call$7.apply(call$7, arguments);
492         };
493
494         var objectPropertyIsEnumerable = {};
495
496         var $propertyIsEnumerable = {}.propertyIsEnumerable;
497         // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
498         var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
499
500         // Nashorn ~ JDK8 bug
501         var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
502
503         // `Object.prototype.propertyIsEnumerable` method implementation
504         // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
505         objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
506           var descriptor = getOwnPropertyDescriptor$1(this, V);
507           return !!descriptor && descriptor.enumerable;
508         } : $propertyIsEnumerable;
509
510         var createPropertyDescriptor$3 = function (bitmap, value) {
511           return {
512             enumerable: !(bitmap & 1),
513             configurable: !(bitmap & 2),
514             writable: !(bitmap & 4),
515             value: value
516           };
517         };
518
519         var FunctionPrototype$1 = Function.prototype;
520         var bind$3 = FunctionPrototype$1.bind;
521         var call$6 = FunctionPrototype$1.call;
522         var callBind = bind$3 && bind$3.bind(call$6);
523
524         var functionUncurryThis = bind$3 ? function (fn) {
525           return fn && callBind(call$6, fn);
526         } : function (fn) {
527           return fn && function () {
528             return call$6.apply(fn, arguments);
529           };
530         };
531
532         var uncurryThis$c = functionUncurryThis;
533
534         var toString$3 = uncurryThis$c({}.toString);
535         var stringSlice = uncurryThis$c(''.slice);
536
537         var classofRaw$1 = function (it) {
538           return stringSlice(toString$3(it), 8, -1);
539         };
540
541         var global$r = global$s;
542         var uncurryThis$b = functionUncurryThis;
543         var fails$6 = fails$8;
544         var classof$5 = classofRaw$1;
545
546         var Object$4 = global$r.Object;
547         var split = uncurryThis$b(''.split);
548
549         // fallback for non-array-like ES3 and non-enumerable old V8 strings
550         var indexedObject = fails$6(function () {
551           // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
552           // eslint-disable-next-line no-prototype-builtins -- safe
553           return !Object$4('z').propertyIsEnumerable(0);
554         }) ? function (it) {
555           return classof$5(it) == 'String' ? split(it, '') : Object$4(it);
556         } : Object$4;
557
558         var global$q = global$s;
559
560         var TypeError$a = global$q.TypeError;
561
562         // `RequireObjectCoercible` abstract operation
563         // https://tc39.es/ecma262/#sec-requireobjectcoercible
564         var requireObjectCoercible$2 = function (it) {
565           if (it == undefined) throw TypeError$a("Can't call method on " + it);
566           return it;
567         };
568
569         // toObject with fallback for non-array-like ES3 strings
570         var IndexedObject = indexedObject;
571         var requireObjectCoercible$1 = requireObjectCoercible$2;
572
573         var toIndexedObject$3 = function (it) {
574           return IndexedObject(requireObjectCoercible$1(it));
575         };
576
577         // `IsCallable` abstract operation
578         // https://tc39.es/ecma262/#sec-iscallable
579         var isCallable$b = function (argument) {
580           return typeof argument == 'function';
581         };
582
583         var isCallable$a = isCallable$b;
584
585         var isObject$6 = function (it) {
586           return typeof it == 'object' ? it !== null : isCallable$a(it);
587         };
588
589         var global$p = global$s;
590         var isCallable$9 = isCallable$b;
591
592         var aFunction = function (argument) {
593           return isCallable$9(argument) ? argument : undefined;
594         };
595
596         var getBuiltIn$4 = function (namespace, method) {
597           return arguments.length < 2 ? aFunction(global$p[namespace]) : global$p[namespace] && global$p[namespace][method];
598         };
599
600         var uncurryThis$a = functionUncurryThis;
601
602         var objectIsPrototypeOf = uncurryThis$a({}.isPrototypeOf);
603
604         var getBuiltIn$3 = getBuiltIn$4;
605
606         var engineUserAgent = getBuiltIn$3('navigator', 'userAgent') || '';
607
608         var global$o = global$s;
609         var userAgent$2 = engineUserAgent;
610
611         var process$1 = global$o.process;
612         var Deno = global$o.Deno;
613         var versions$1 = process$1 && process$1.versions || Deno && Deno.version;
614         var v8 = versions$1 && versions$1.v8;
615         var match, version$1;
616
617         if (v8) {
618           match = v8.split('.');
619           // in old Chrome, versions of V8 isn't V8 = Chrome / 10
620           // but their correct versions are not interesting for us
621           version$1 = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
622         }
623
624         // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
625         // so check `userAgent` even if `.v8` exists, but 0
626         if (!version$1 && userAgent$2) {
627           match = userAgent$2.match(/Edge\/(\d+)/);
628           if (!match || match[1] >= 74) {
629             match = userAgent$2.match(/Chrome\/(\d+)/);
630             if (match) version$1 = +match[1];
631           }
632         }
633
634         var engineV8Version = version$1;
635
636         /* eslint-disable es/no-symbol -- required for testing */
637
638         var V8_VERSION = engineV8Version;
639         var fails$5 = fails$8;
640
641         // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
642         var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$5(function () {
643           var symbol = Symbol();
644           // Chrome 38 Symbol has incorrect toString conversion
645           // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
646           return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
647             // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
648             !Symbol.sham && V8_VERSION && V8_VERSION < 41;
649         });
650
651         /* eslint-disable es/no-symbol -- required for testing */
652
653         var NATIVE_SYMBOL$1 = nativeSymbol;
654
655         var useSymbolAsUid = NATIVE_SYMBOL$1
656           && !Symbol.sham
657           && typeof Symbol.iterator == 'symbol';
658
659         var global$n = global$s;
660         var getBuiltIn$2 = getBuiltIn$4;
661         var isCallable$8 = isCallable$b;
662         var isPrototypeOf$1 = objectIsPrototypeOf;
663         var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
664
665         var Object$3 = global$n.Object;
666
667         var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
668           return typeof it == 'symbol';
669         } : function (it) {
670           var $Symbol = getBuiltIn$2('Symbol');
671           return isCallable$8($Symbol) && isPrototypeOf$1($Symbol.prototype, Object$3(it));
672         };
673
674         var global$m = global$s;
675
676         var String$3 = global$m.String;
677
678         var tryToString$3 = function (argument) {
679           try {
680             return String$3(argument);
681           } catch (error) {
682             return 'Object';
683           }
684         };
685
686         var global$l = global$s;
687         var isCallable$7 = isCallable$b;
688         var tryToString$2 = tryToString$3;
689
690         var TypeError$9 = global$l.TypeError;
691
692         // `Assert: IsCallable(argument) is true`
693         var aCallable$5 = function (argument) {
694           if (isCallable$7(argument)) return argument;
695           throw TypeError$9(tryToString$2(argument) + ' is not a function');
696         };
697
698         var aCallable$4 = aCallable$5;
699
700         // `GetMethod` abstract operation
701         // https://tc39.es/ecma262/#sec-getmethod
702         var getMethod$3 = function (V, P) {
703           var func = V[P];
704           return func == null ? undefined : aCallable$4(func);
705         };
706
707         var global$k = global$s;
708         var call$5 = functionCall;
709         var isCallable$6 = isCallable$b;
710         var isObject$5 = isObject$6;
711
712         var TypeError$8 = global$k.TypeError;
713
714         // `OrdinaryToPrimitive` abstract operation
715         // https://tc39.es/ecma262/#sec-ordinarytoprimitive
716         var ordinaryToPrimitive$1 = function (input, pref) {
717           var fn, val;
718           if (pref === 'string' && isCallable$6(fn = input.toString) && !isObject$5(val = call$5(fn, input))) return val;
719           if (isCallable$6(fn = input.valueOf) && !isObject$5(val = call$5(fn, input))) return val;
720           if (pref !== 'string' && isCallable$6(fn = input.toString) && !isObject$5(val = call$5(fn, input))) return val;
721           throw TypeError$8("Can't convert object to primitive value");
722         };
723
724         var shared$3 = {exports: {}};
725
726         var global$j = global$s;
727
728         // eslint-disable-next-line es/no-object-defineproperty -- safe
729         var defineProperty = Object.defineProperty;
730
731         var setGlobal$3 = function (key, value) {
732           try {
733             defineProperty(global$j, key, { value: value, configurable: true, writable: true });
734           } catch (error) {
735             global$j[key] = value;
736           } return value;
737         };
738
739         var global$i = global$s;
740         var setGlobal$2 = setGlobal$3;
741
742         var SHARED = '__core-js_shared__';
743         var store$3 = global$i[SHARED] || setGlobal$2(SHARED, {});
744
745         var sharedStore = store$3;
746
747         var store$2 = sharedStore;
748
749         (shared$3.exports = function (key, value) {
750           return store$2[key] || (store$2[key] = value !== undefined ? value : {});
751         })('versions', []).push({
752           version: '3.19.1',
753           mode: 'global',
754           copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
755         });
756
757         var global$h = global$s;
758         var requireObjectCoercible = requireObjectCoercible$2;
759
760         var Object$2 = global$h.Object;
761
762         // `ToObject` abstract operation
763         // https://tc39.es/ecma262/#sec-toobject
764         var toObject$3 = function (argument) {
765           return Object$2(requireObjectCoercible(argument));
766         };
767
768         var uncurryThis$9 = functionUncurryThis;
769         var toObject$2 = toObject$3;
770
771         var hasOwnProperty = uncurryThis$9({}.hasOwnProperty);
772
773         // `HasOwnProperty` abstract operation
774         // https://tc39.es/ecma262/#sec-hasownproperty
775         var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
776           return hasOwnProperty(toObject$2(it), key);
777         };
778
779         var uncurryThis$8 = functionUncurryThis;
780
781         var id = 0;
782         var postfix = Math.random();
783         var toString$2 = uncurryThis$8(1.0.toString);
784
785         var uid$2 = function (key) {
786           return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
787         };
788
789         var global$g = global$s;
790         var shared$2 = shared$3.exports;
791         var hasOwn$6 = hasOwnProperty_1;
792         var uid$1 = uid$2;
793         var NATIVE_SYMBOL = nativeSymbol;
794         var USE_SYMBOL_AS_UID = useSymbolAsUid;
795
796         var WellKnownSymbolsStore = shared$2('wks');
797         var Symbol$1 = global$g.Symbol;
798         var symbolFor = Symbol$1 && Symbol$1['for'];
799         var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
800
801         var wellKnownSymbol$6 = function (name) {
802           if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
803             var description = 'Symbol.' + name;
804             if (NATIVE_SYMBOL && hasOwn$6(Symbol$1, name)) {
805               WellKnownSymbolsStore[name] = Symbol$1[name];
806             } else if (USE_SYMBOL_AS_UID && symbolFor) {
807               WellKnownSymbolsStore[name] = symbolFor(description);
808             } else {
809               WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
810             }
811           } return WellKnownSymbolsStore[name];
812         };
813
814         var global$f = global$s;
815         var call$4 = functionCall;
816         var isObject$4 = isObject$6;
817         var isSymbol$1 = isSymbol$2;
818         var getMethod$2 = getMethod$3;
819         var ordinaryToPrimitive = ordinaryToPrimitive$1;
820         var wellKnownSymbol$5 = wellKnownSymbol$6;
821
822         var TypeError$7 = global$f.TypeError;
823         var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive');
824
825         // `ToPrimitive` abstract operation
826         // https://tc39.es/ecma262/#sec-toprimitive
827         var toPrimitive$1 = function (input, pref) {
828           if (!isObject$4(input) || isSymbol$1(input)) return input;
829           var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
830           var result;
831           if (exoticToPrim) {
832             if (pref === undefined) pref = 'default';
833             result = call$4(exoticToPrim, input, pref);
834             if (!isObject$4(result) || isSymbol$1(result)) return result;
835             throw TypeError$7("Can't convert object to primitive value");
836           }
837           if (pref === undefined) pref = 'number';
838           return ordinaryToPrimitive(input, pref);
839         };
840
841         var toPrimitive = toPrimitive$1;
842         var isSymbol = isSymbol$2;
843
844         // `ToPropertyKey` abstract operation
845         // https://tc39.es/ecma262/#sec-topropertykey
846         var toPropertyKey$3 = function (argument) {
847           var key = toPrimitive(argument, 'string');
848           return isSymbol(key) ? key : key + '';
849         };
850
851         var global$e = global$s;
852         var isObject$3 = isObject$6;
853
854         var document$1 = global$e.document;
855         // typeof document.createElement is 'object' in old IE
856         var EXISTS$1 = isObject$3(document$1) && isObject$3(document$1.createElement);
857
858         var documentCreateElement = function (it) {
859           return EXISTS$1 ? document$1.createElement(it) : {};
860         };
861
862         var DESCRIPTORS$4 = descriptors;
863         var fails$4 = fails$8;
864         var createElement = documentCreateElement;
865
866         // Thank's IE8 for his funny defineProperty
867         var ie8DomDefine = !DESCRIPTORS$4 && !fails$4(function () {
868           // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
869           return Object.defineProperty(createElement('div'), 'a', {
870             get: function () { return 7; }
871           }).a != 7;
872         });
873
874         var DESCRIPTORS$3 = descriptors;
875         var call$3 = functionCall;
876         var propertyIsEnumerableModule = objectPropertyIsEnumerable;
877         var createPropertyDescriptor$2 = createPropertyDescriptor$3;
878         var toIndexedObject$2 = toIndexedObject$3;
879         var toPropertyKey$2 = toPropertyKey$3;
880         var hasOwn$5 = hasOwnProperty_1;
881         var IE8_DOM_DEFINE$1 = ie8DomDefine;
882
883         // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
884         var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
885
886         // `Object.getOwnPropertyDescriptor` method
887         // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
888         objectGetOwnPropertyDescriptor.f = DESCRIPTORS$3 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
889           O = toIndexedObject$2(O);
890           P = toPropertyKey$2(P);
891           if (IE8_DOM_DEFINE$1) try {
892             return $getOwnPropertyDescriptor(O, P);
893           } catch (error) { /* empty */ }
894           if (hasOwn$5(O, P)) return createPropertyDescriptor$2(!call$3(propertyIsEnumerableModule.f, O, P), O[P]);
895         };
896
897         var objectDefineProperty = {};
898
899         var global$d = global$s;
900         var isObject$2 = isObject$6;
901
902         var String$2 = global$d.String;
903         var TypeError$6 = global$d.TypeError;
904
905         // `Assert: Type(argument) is Object`
906         var anObject$5 = function (argument) {
907           if (isObject$2(argument)) return argument;
908           throw TypeError$6(String$2(argument) + ' is not an object');
909         };
910
911         var global$c = global$s;
912         var DESCRIPTORS$2 = descriptors;
913         var IE8_DOM_DEFINE = ie8DomDefine;
914         var anObject$4 = anObject$5;
915         var toPropertyKey$1 = toPropertyKey$3;
916
917         var TypeError$5 = global$c.TypeError;
918         // eslint-disable-next-line es/no-object-defineproperty -- safe
919         var $defineProperty = Object.defineProperty;
920
921         // `Object.defineProperty` method
922         // https://tc39.es/ecma262/#sec-object.defineproperty
923         objectDefineProperty.f = DESCRIPTORS$2 ? $defineProperty : function defineProperty(O, P, Attributes) {
924           anObject$4(O);
925           P = toPropertyKey$1(P);
926           anObject$4(Attributes);
927           if (IE8_DOM_DEFINE) try {
928             return $defineProperty(O, P, Attributes);
929           } catch (error) { /* empty */ }
930           if ('get' in Attributes || 'set' in Attributes) throw TypeError$5('Accessors not supported');
931           if ('value' in Attributes) O[P] = Attributes.value;
932           return O;
933         };
934
935         var DESCRIPTORS$1 = descriptors;
936         var definePropertyModule$2 = objectDefineProperty;
937         var createPropertyDescriptor$1 = createPropertyDescriptor$3;
938
939         var createNonEnumerableProperty$3 = DESCRIPTORS$1 ? function (object, key, value) {
940           return definePropertyModule$2.f(object, key, createPropertyDescriptor$1(1, value));
941         } : function (object, key, value) {
942           object[key] = value;
943           return object;
944         };
945
946         var redefine$1 = {exports: {}};
947
948         var uncurryThis$7 = functionUncurryThis;
949         var isCallable$5 = isCallable$b;
950         var store$1 = sharedStore;
951
952         var functionToString = uncurryThis$7(Function.toString);
953
954         // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
955         if (!isCallable$5(store$1.inspectSource)) {
956           store$1.inspectSource = function (it) {
957             return functionToString(it);
958           };
959         }
960
961         var inspectSource$3 = store$1.inspectSource;
962
963         var global$b = global$s;
964         var isCallable$4 = isCallable$b;
965         var inspectSource$2 = inspectSource$3;
966
967         var WeakMap$2 = global$b.WeakMap;
968
969         var nativeWeakMap = isCallable$4(WeakMap$2) && /native code/.test(inspectSource$2(WeakMap$2));
970
971         var shared$1 = shared$3.exports;
972         var uid = uid$2;
973
974         var keys = shared$1('keys');
975
976         var sharedKey$1 = function (key) {
977           return keys[key] || (keys[key] = uid(key));
978         };
979
980         var hiddenKeys$3 = {};
981
982         var NATIVE_WEAK_MAP = nativeWeakMap;
983         var global$a = global$s;
984         var uncurryThis$6 = functionUncurryThis;
985         var isObject$1 = isObject$6;
986         var createNonEnumerableProperty$2 = createNonEnumerableProperty$3;
987         var hasOwn$4 = hasOwnProperty_1;
988         var shared = sharedStore;
989         var sharedKey = sharedKey$1;
990         var hiddenKeys$2 = hiddenKeys$3;
991
992         var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
993         var TypeError$4 = global$a.TypeError;
994         var WeakMap$1 = global$a.WeakMap;
995         var set, get, has;
996
997         var enforce = function (it) {
998           return has(it) ? get(it) : set(it, {});
999         };
1000
1001         var getterFor = function (TYPE) {
1002           return function (it) {
1003             var state;
1004             if (!isObject$1(it) || (state = get(it)).type !== TYPE) {
1005               throw TypeError$4('Incompatible receiver, ' + TYPE + ' required');
1006             } return state;
1007           };
1008         };
1009
1010         if (NATIVE_WEAK_MAP || shared.state) {
1011           var store = shared.state || (shared.state = new WeakMap$1());
1012           var wmget = uncurryThis$6(store.get);
1013           var wmhas = uncurryThis$6(store.has);
1014           var wmset = uncurryThis$6(store.set);
1015           set = function (it, metadata) {
1016             if (wmhas(store, it)) throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);
1017             metadata.facade = it;
1018             wmset(store, it, metadata);
1019             return metadata;
1020           };
1021           get = function (it) {
1022             return wmget(store, it) || {};
1023           };
1024           has = function (it) {
1025             return wmhas(store, it);
1026           };
1027         } else {
1028           var STATE = sharedKey('state');
1029           hiddenKeys$2[STATE] = true;
1030           set = function (it, metadata) {
1031             if (hasOwn$4(it, STATE)) throw new TypeError$4(OBJECT_ALREADY_INITIALIZED);
1032             metadata.facade = it;
1033             createNonEnumerableProperty$2(it, STATE, metadata);
1034             return metadata;
1035           };
1036           get = function (it) {
1037             return hasOwn$4(it, STATE) ? it[STATE] : {};
1038           };
1039           has = function (it) {
1040             return hasOwn$4(it, STATE);
1041           };
1042         }
1043
1044         var internalState = {
1045           set: set,
1046           get: get,
1047           has: has,
1048           enforce: enforce,
1049           getterFor: getterFor
1050         };
1051
1052         var DESCRIPTORS = descriptors;
1053         var hasOwn$3 = hasOwnProperty_1;
1054
1055         var FunctionPrototype = Function.prototype;
1056         // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1057         var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
1058
1059         var EXISTS = hasOwn$3(FunctionPrototype, 'name');
1060         // additional protection from minified / mangled / dropped function names
1061         var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
1062         var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
1063
1064         var functionName = {
1065           EXISTS: EXISTS,
1066           PROPER: PROPER,
1067           CONFIGURABLE: CONFIGURABLE
1068         };
1069
1070         var global$9 = global$s;
1071         var isCallable$3 = isCallable$b;
1072         var hasOwn$2 = hasOwnProperty_1;
1073         var createNonEnumerableProperty$1 = createNonEnumerableProperty$3;
1074         var setGlobal$1 = setGlobal$3;
1075         var inspectSource$1 = inspectSource$3;
1076         var InternalStateModule = internalState;
1077         var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
1078
1079         var getInternalState = InternalStateModule.get;
1080         var enforceInternalState = InternalStateModule.enforce;
1081         var TEMPLATE = String(String).split('String');
1082
1083         (redefine$1.exports = function (O, key, value, options) {
1084           var unsafe = options ? !!options.unsafe : false;
1085           var simple = options ? !!options.enumerable : false;
1086           var noTargetGet = options ? !!options.noTargetGet : false;
1087           var name = options && options.name !== undefined ? options.name : key;
1088           var state;
1089           if (isCallable$3(value)) {
1090             if (String(name).slice(0, 7) === 'Symbol(') {
1091               name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
1092             }
1093             if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
1094               createNonEnumerableProperty$1(value, 'name', name);
1095             }
1096             state = enforceInternalState(value);
1097             if (!state.source) {
1098               state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
1099             }
1100           }
1101           if (O === global$9) {
1102             if (simple) O[key] = value;
1103             else setGlobal$1(key, value);
1104             return;
1105           } else if (!unsafe) {
1106             delete O[key];
1107           } else if (!noTargetGet && O[key]) {
1108             simple = true;
1109           }
1110           if (simple) O[key] = value;
1111           else createNonEnumerableProperty$1(O, key, value);
1112         // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
1113         })(Function.prototype, 'toString', function toString() {
1114           return isCallable$3(this) && getInternalState(this).source || inspectSource$1(this);
1115         });
1116
1117         var objectGetOwnPropertyNames = {};
1118
1119         var ceil = Math.ceil;
1120         var floor$1 = Math.floor;
1121
1122         // `ToIntegerOrInfinity` abstract operation
1123         // https://tc39.es/ecma262/#sec-tointegerorinfinity
1124         var toIntegerOrInfinity$2 = function (argument) {
1125           var number = +argument;
1126           // eslint-disable-next-line no-self-compare -- safe
1127           return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
1128         };
1129
1130         var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
1131
1132         var max = Math.max;
1133         var min$1 = Math.min;
1134
1135         // Helper for a popular repeating case of the spec:
1136         // Let integer be ? ToInteger(index).
1137         // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
1138         var toAbsoluteIndex$1 = function (index, length) {
1139           var integer = toIntegerOrInfinity$1(index);
1140           return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
1141         };
1142
1143         var toIntegerOrInfinity = toIntegerOrInfinity$2;
1144
1145         var min = Math.min;
1146
1147         // `ToLength` abstract operation
1148         // https://tc39.es/ecma262/#sec-tolength
1149         var toLength$1 = function (argument) {
1150           return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
1151         };
1152
1153         var toLength = toLength$1;
1154
1155         // `LengthOfArrayLike` abstract operation
1156         // https://tc39.es/ecma262/#sec-lengthofarraylike
1157         var lengthOfArrayLike$5 = function (obj) {
1158           return toLength(obj.length);
1159         };
1160
1161         var toIndexedObject$1 = toIndexedObject$3;
1162         var toAbsoluteIndex = toAbsoluteIndex$1;
1163         var lengthOfArrayLike$4 = lengthOfArrayLike$5;
1164
1165         // `Array.prototype.{ indexOf, includes }` methods implementation
1166         var createMethod = function (IS_INCLUDES) {
1167           return function ($this, el, fromIndex) {
1168             var O = toIndexedObject$1($this);
1169             var length = lengthOfArrayLike$4(O);
1170             var index = toAbsoluteIndex(fromIndex, length);
1171             var value;
1172             // Array#includes uses SameValueZero equality algorithm
1173             // eslint-disable-next-line no-self-compare -- NaN check
1174             if (IS_INCLUDES && el != el) while (length > index) {
1175               value = O[index++];
1176               // eslint-disable-next-line no-self-compare -- NaN check
1177               if (value != value) return true;
1178             // Array#indexOf ignores holes, Array#includes - not
1179             } else for (;length > index; index++) {
1180               if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
1181             } return !IS_INCLUDES && -1;
1182           };
1183         };
1184
1185         var arrayIncludes = {
1186           // `Array.prototype.includes` method
1187           // https://tc39.es/ecma262/#sec-array.prototype.includes
1188           includes: createMethod(true),
1189           // `Array.prototype.indexOf` method
1190           // https://tc39.es/ecma262/#sec-array.prototype.indexof
1191           indexOf: createMethod(false)
1192         };
1193
1194         var uncurryThis$5 = functionUncurryThis;
1195         var hasOwn$1 = hasOwnProperty_1;
1196         var toIndexedObject = toIndexedObject$3;
1197         var indexOf = arrayIncludes.indexOf;
1198         var hiddenKeys$1 = hiddenKeys$3;
1199
1200         var push$1 = uncurryThis$5([].push);
1201
1202         var objectKeysInternal = function (object, names) {
1203           var O = toIndexedObject(object);
1204           var i = 0;
1205           var result = [];
1206           var key;
1207           for (key in O) !hasOwn$1(hiddenKeys$1, key) && hasOwn$1(O, key) && push$1(result, key);
1208           // Don't enum bug & hidden keys
1209           while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
1210             ~indexOf(result, key) || push$1(result, key);
1211           }
1212           return result;
1213         };
1214
1215         // IE8- don't enum bug keys
1216         var enumBugKeys$1 = [
1217           'constructor',
1218           'hasOwnProperty',
1219           'isPrototypeOf',
1220           'propertyIsEnumerable',
1221           'toLocaleString',
1222           'toString',
1223           'valueOf'
1224         ];
1225
1226         var internalObjectKeys = objectKeysInternal;
1227         var enumBugKeys = enumBugKeys$1;
1228
1229         var hiddenKeys = enumBugKeys.concat('length', 'prototype');
1230
1231         // `Object.getOwnPropertyNames` method
1232         // https://tc39.es/ecma262/#sec-object.getownpropertynames
1233         // eslint-disable-next-line es/no-object-getownpropertynames -- safe
1234         objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1235           return internalObjectKeys(O, hiddenKeys);
1236         };
1237
1238         var objectGetOwnPropertySymbols = {};
1239
1240         // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
1241         objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
1242
1243         var getBuiltIn$1 = getBuiltIn$4;
1244         var uncurryThis$4 = functionUncurryThis;
1245         var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
1246         var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1247         var anObject$3 = anObject$5;
1248
1249         var concat = uncurryThis$4([].concat);
1250
1251         // all object keys, includes non-enumerable and symbols
1252         var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
1253           var keys = getOwnPropertyNamesModule.f(anObject$3(it));
1254           var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1255           return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
1256         };
1257
1258         var hasOwn = hasOwnProperty_1;
1259         var ownKeys = ownKeys$1;
1260         var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
1261         var definePropertyModule$1 = objectDefineProperty;
1262
1263         var copyConstructorProperties$1 = function (target, source) {
1264           var keys = ownKeys(source);
1265           var defineProperty = definePropertyModule$1.f;
1266           var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
1267           for (var i = 0; i < keys.length; i++) {
1268             var key = keys[i];
1269             if (!hasOwn(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
1270           }
1271         };
1272
1273         var fails$3 = fails$8;
1274         var isCallable$2 = isCallable$b;
1275
1276         var replacement = /#|\.prototype\./;
1277
1278         var isForced$1 = function (feature, detection) {
1279           var value = data[normalize(feature)];
1280           return value == POLYFILL ? true
1281             : value == NATIVE ? false
1282             : isCallable$2(detection) ? fails$3(detection)
1283             : !!detection;
1284         };
1285
1286         var normalize = isForced$1.normalize = function (string) {
1287           return String(string).replace(replacement, '.').toLowerCase();
1288         };
1289
1290         var data = isForced$1.data = {};
1291         var NATIVE = isForced$1.NATIVE = 'N';
1292         var POLYFILL = isForced$1.POLYFILL = 'P';
1293
1294         var isForced_1 = isForced$1;
1295
1296         var global$8 = global$s;
1297         var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
1298         var createNonEnumerableProperty = createNonEnumerableProperty$3;
1299         var redefine = redefine$1.exports;
1300         var setGlobal = setGlobal$3;
1301         var copyConstructorProperties = copyConstructorProperties$1;
1302         var isForced = isForced_1;
1303
1304         /*
1305           options.target      - name of the target object
1306           options.global      - target is the global object
1307           options.stat        - export as static methods of target
1308           options.proto       - export as prototype methods of target
1309           options.real        - real prototype method for the `pure` version
1310           options.forced      - export even if the native feature is available
1311           options.bind        - bind methods to the target, required for the `pure` version
1312           options.wrap        - wrap constructors to preventing global pollution, required for the `pure` version
1313           options.unsafe      - use the simple assignment of property instead of delete + defineProperty
1314           options.sham        - add a flag to not completely full polyfills
1315           options.enumerable  - export as enumerable property
1316           options.noTargetGet - prevent calling a getter on target
1317           options.name        - the .name of the function if it does not match the key
1318         */
1319         var _export = function (options, source) {
1320           var TARGET = options.target;
1321           var GLOBAL = options.global;
1322           var STATIC = options.stat;
1323           var FORCED, target, key, targetProperty, sourceProperty, descriptor;
1324           if (GLOBAL) {
1325             target = global$8;
1326           } else if (STATIC) {
1327             target = global$8[TARGET] || setGlobal(TARGET, {});
1328           } else {
1329             target = (global$8[TARGET] || {}).prototype;
1330           }
1331           if (target) for (key in source) {
1332             sourceProperty = source[key];
1333             if (options.noTargetGet) {
1334               descriptor = getOwnPropertyDescriptor(target, key);
1335               targetProperty = descriptor && descriptor.value;
1336             } else targetProperty = target[key];
1337             FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
1338             // contained in target
1339             if (!FORCED && targetProperty !== undefined) {
1340               if (typeof sourceProperty == typeof targetProperty) continue;
1341               copyConstructorProperties(sourceProperty, targetProperty);
1342             }
1343             // add a flag to not completely full polyfills
1344             if (options.sham || (targetProperty && targetProperty.sham)) {
1345               createNonEnumerableProperty(sourceProperty, 'sham', true);
1346             }
1347             // extend global
1348             redefine(target, key, sourceProperty, options);
1349           }
1350         };
1351
1352         var classof$4 = classofRaw$1;
1353
1354         // `IsArray` abstract operation
1355         // https://tc39.es/ecma262/#sec-isarray
1356         // eslint-disable-next-line es/no-array-isarray -- safe
1357         var isArray$2 = Array.isArray || function isArray(argument) {
1358           return classof$4(argument) == 'Array';
1359         };
1360
1361         var uncurryThis$3 = functionUncurryThis;
1362         var aCallable$3 = aCallable$5;
1363
1364         var bind$2 = uncurryThis$3(uncurryThis$3.bind);
1365
1366         // optional / simple context binding
1367         var functionBindContext = function (fn, that) {
1368           aCallable$3(fn);
1369           return that === undefined ? fn : bind$2 ? bind$2(fn, that) : function (/* ...args */) {
1370             return fn.apply(that, arguments);
1371           };
1372         };
1373
1374         var global$7 = global$s;
1375         var isArray$1 = isArray$2;
1376         var lengthOfArrayLike$3 = lengthOfArrayLike$5;
1377         var bind$1 = functionBindContext;
1378
1379         var TypeError$3 = global$7.TypeError;
1380
1381         // `FlattenIntoArray` abstract operation
1382         // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
1383         var flattenIntoArray$1 = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
1384           var targetIndex = start;
1385           var sourceIndex = 0;
1386           var mapFn = mapper ? bind$1(mapper, thisArg) : false;
1387           var element, elementLen;
1388
1389           while (sourceIndex < sourceLen) {
1390             if (sourceIndex in source) {
1391               element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
1392
1393               if (depth > 0 && isArray$1(element)) {
1394                 elementLen = lengthOfArrayLike$3(element);
1395                 targetIndex = flattenIntoArray$1(target, original, element, elementLen, targetIndex, depth - 1) - 1;
1396               } else {
1397                 if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError$3('Exceed the acceptable array length');
1398                 target[targetIndex] = element;
1399               }
1400
1401               targetIndex++;
1402             }
1403             sourceIndex++;
1404           }
1405           return targetIndex;
1406         };
1407
1408         var flattenIntoArray_1 = flattenIntoArray$1;
1409
1410         var wellKnownSymbol$4 = wellKnownSymbol$6;
1411
1412         var TO_STRING_TAG$1 = wellKnownSymbol$4('toStringTag');
1413         var test$1 = {};
1414
1415         test$1[TO_STRING_TAG$1] = 'z';
1416
1417         var toStringTagSupport = String(test$1) === '[object z]';
1418
1419         var global$6 = global$s;
1420         var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1421         var isCallable$1 = isCallable$b;
1422         var classofRaw = classofRaw$1;
1423         var wellKnownSymbol$3 = wellKnownSymbol$6;
1424
1425         var TO_STRING_TAG = wellKnownSymbol$3('toStringTag');
1426         var Object$1 = global$6.Object;
1427
1428         // ES3 wrong here
1429         var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1430
1431         // fallback for IE11 Script Access Denied error
1432         var tryGet = function (it, key) {
1433           try {
1434             return it[key];
1435           } catch (error) { /* empty */ }
1436         };
1437
1438         // getting tag from ES6+ `Object.prototype.toString`
1439         var classof$3 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1440           var O, tag, result;
1441           return it === undefined ? 'Undefined' : it === null ? 'Null'
1442             // @@toStringTag case
1443             : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
1444             // builtinTag case
1445             : CORRECT_ARGUMENTS ? classofRaw(O)
1446             // ES3 arguments fallback
1447             : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
1448         };
1449
1450         var uncurryThis$2 = functionUncurryThis;
1451         var fails$2 = fails$8;
1452         var isCallable = isCallable$b;
1453         var classof$2 = classof$3;
1454         var getBuiltIn = getBuiltIn$4;
1455         var inspectSource = inspectSource$3;
1456
1457         var noop$1 = function () { /* empty */ };
1458         var empty = [];
1459         var construct = getBuiltIn('Reflect', 'construct');
1460         var constructorRegExp = /^\s*(?:class|function)\b/;
1461         var exec = uncurryThis$2(constructorRegExp.exec);
1462         var INCORRECT_TO_STRING = !constructorRegExp.exec(noop$1);
1463
1464         var isConstructorModern = function (argument) {
1465           if (!isCallable(argument)) return false;
1466           try {
1467             construct(noop$1, empty, argument);
1468             return true;
1469           } catch (error) {
1470             return false;
1471           }
1472         };
1473
1474         var isConstructorLegacy = function (argument) {
1475           if (!isCallable(argument)) return false;
1476           switch (classof$2(argument)) {
1477             case 'AsyncFunction':
1478             case 'GeneratorFunction':
1479             case 'AsyncGeneratorFunction': return false;
1480             // we can't check .prototype since constructors produced by .bind haven't it
1481           } return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
1482         };
1483
1484         // `IsConstructor` abstract operation
1485         // https://tc39.es/ecma262/#sec-isconstructor
1486         var isConstructor$1 = !construct || fails$2(function () {
1487           var called;
1488           return isConstructorModern(isConstructorModern.call)
1489             || !isConstructorModern(Object)
1490             || !isConstructorModern(function () { called = true; })
1491             || called;
1492         }) ? isConstructorLegacy : isConstructorModern;
1493
1494         var global$5 = global$s;
1495         var isArray = isArray$2;
1496         var isConstructor = isConstructor$1;
1497         var isObject = isObject$6;
1498         var wellKnownSymbol$2 = wellKnownSymbol$6;
1499
1500         var SPECIES = wellKnownSymbol$2('species');
1501         var Array$1 = global$5.Array;
1502
1503         // a part of `ArraySpeciesCreate` abstract operation
1504         // https://tc39.es/ecma262/#sec-arrayspeciescreate
1505         var arraySpeciesConstructor$1 = function (originalArray) {
1506           var C;
1507           if (isArray(originalArray)) {
1508             C = originalArray.constructor;
1509             // cross-realm fallback
1510             if (isConstructor(C) && (C === Array$1 || isArray(C.prototype))) C = undefined;
1511             else if (isObject(C)) {
1512               C = C[SPECIES];
1513               if (C === null) C = undefined;
1514             }
1515           } return C === undefined ? Array$1 : C;
1516         };
1517
1518         var arraySpeciesConstructor = arraySpeciesConstructor$1;
1519
1520         // `ArraySpeciesCreate` abstract operation
1521         // https://tc39.es/ecma262/#sec-arrayspeciescreate
1522         var arraySpeciesCreate$1 = function (originalArray, length) {
1523           return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
1524         };
1525
1526         var $$2 = _export;
1527         var flattenIntoArray = flattenIntoArray_1;
1528         var aCallable$2 = aCallable$5;
1529         var toObject$1 = toObject$3;
1530         var lengthOfArrayLike$2 = lengthOfArrayLike$5;
1531         var arraySpeciesCreate = arraySpeciesCreate$1;
1532
1533         // `Array.prototype.flatMap` method
1534         // https://tc39.es/ecma262/#sec-array.prototype.flatmap
1535         $$2({ target: 'Array', proto: true }, {
1536           flatMap: function flatMap(callbackfn /* , thisArg */) {
1537             var O = toObject$1(this);
1538             var sourceLen = lengthOfArrayLike$2(O);
1539             var A;
1540             aCallable$2(callbackfn);
1541             A = arraySpeciesCreate(O, 0);
1542             A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1543             return A;
1544           }
1545         });
1546
1547         var global$4 = global$s;
1548         var classof$1 = classof$3;
1549
1550         var String$1 = global$4.String;
1551
1552         var toString$1 = function (argument) {
1553           if (classof$1(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1554           return String$1(argument);
1555         };
1556
1557         var uncurryThis$1 = functionUncurryThis;
1558
1559         var arraySlice$1 = uncurryThis$1([].slice);
1560
1561         var arraySlice = arraySlice$1;
1562
1563         var floor = Math.floor;
1564
1565         var mergeSort = function (array, comparefn) {
1566           var length = array.length;
1567           var middle = floor(length / 2);
1568           return length < 8 ? insertionSort(array, comparefn) : merge(
1569             array,
1570             mergeSort(arraySlice(array, 0, middle), comparefn),
1571             mergeSort(arraySlice(array, middle), comparefn),
1572             comparefn
1573           );
1574         };
1575
1576         var insertionSort = function (array, comparefn) {
1577           var length = array.length;
1578           var i = 1;
1579           var element, j;
1580
1581           while (i < length) {
1582             j = i;
1583             element = array[i];
1584             while (j && comparefn(array[j - 1], element) > 0) {
1585               array[j] = array[--j];
1586             }
1587             if (j !== i++) array[j] = element;
1588           } return array;
1589         };
1590
1591         var merge = function (array, left, right, comparefn) {
1592           var llength = left.length;
1593           var rlength = right.length;
1594           var lindex = 0;
1595           var rindex = 0;
1596
1597           while (lindex < llength || rindex < rlength) {
1598             array[lindex + rindex] = (lindex < llength && rindex < rlength)
1599               ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
1600               : lindex < llength ? left[lindex++] : right[rindex++];
1601           } return array;
1602         };
1603
1604         var arraySort = mergeSort;
1605
1606         var fails$1 = fails$8;
1607
1608         var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1609           var method = [][METHOD_NAME];
1610           return !!method && fails$1(function () {
1611             // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
1612             method.call(null, argument || function () { throw 1; }, 1);
1613           });
1614         };
1615
1616         var userAgent$1 = engineUserAgent;
1617
1618         var firefox = userAgent$1.match(/firefox\/(\d+)/i);
1619
1620         var engineFfVersion = !!firefox && +firefox[1];
1621
1622         var UA = engineUserAgent;
1623
1624         var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
1625
1626         var userAgent = engineUserAgent;
1627
1628         var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
1629
1630         var engineWebkitVersion = !!webkit && +webkit[1];
1631
1632         var $$1 = _export;
1633         var uncurryThis = functionUncurryThis;
1634         var aCallable$1 = aCallable$5;
1635         var toObject = toObject$3;
1636         var lengthOfArrayLike$1 = lengthOfArrayLike$5;
1637         var toString = toString$1;
1638         var fails = fails$8;
1639         var internalSort = arraySort;
1640         var arrayMethodIsStrict = arrayMethodIsStrict$1;
1641         var FF = engineFfVersion;
1642         var IE_OR_EDGE = engineIsIeOrEdge;
1643         var V8 = engineV8Version;
1644         var WEBKIT = engineWebkitVersion;
1645
1646         var test = [];
1647         var un$Sort = uncurryThis(test.sort);
1648         var push = uncurryThis(test.push);
1649
1650         // IE8-
1651         var FAILS_ON_UNDEFINED = fails(function () {
1652           test.sort(undefined);
1653         });
1654         // V8 bug
1655         var FAILS_ON_NULL = fails(function () {
1656           test.sort(null);
1657         });
1658         // Old WebKit
1659         var STRICT_METHOD = arrayMethodIsStrict('sort');
1660
1661         var STABLE_SORT = !fails(function () {
1662           // feature detection can be too slow, so check engines versions
1663           if (V8) return V8 < 70;
1664           if (FF && FF > 3) return;
1665           if (IE_OR_EDGE) return true;
1666           if (WEBKIT) return WEBKIT < 603;
1667
1668           var result = '';
1669           var code, chr, value, index;
1670
1671           // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
1672           for (code = 65; code < 76; code++) {
1673             chr = String.fromCharCode(code);
1674
1675             switch (code) {
1676               case 66: case 69: case 70: case 72: value = 3; break;
1677               case 68: case 71: value = 4; break;
1678               default: value = 2;
1679             }
1680
1681             for (index = 0; index < 47; index++) {
1682               test.push({ k: chr + index, v: value });
1683             }
1684           }
1685
1686           test.sort(function (a, b) { return b.v - a.v; });
1687
1688           for (index = 0; index < test.length; index++) {
1689             chr = test[index].k.charAt(0);
1690             if (result.charAt(result.length - 1) !== chr) result += chr;
1691           }
1692
1693           return result !== 'DGBEFHACIJK';
1694         });
1695
1696         var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
1697
1698         var getSortCompare = function (comparefn) {
1699           return function (x, y) {
1700             if (y === undefined) return -1;
1701             if (x === undefined) return 1;
1702             if (comparefn !== undefined) return +comparefn(x, y) || 0;
1703             return toString(x) > toString(y) ? 1 : -1;
1704           };
1705         };
1706
1707         // `Array.prototype.sort` method
1708         // https://tc39.es/ecma262/#sec-array.prototype.sort
1709         $$1({ target: 'Array', proto: true, forced: FORCED }, {
1710           sort: function sort(comparefn) {
1711             if (comparefn !== undefined) aCallable$1(comparefn);
1712
1713             var array = toObject(this);
1714
1715             if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
1716
1717             var items = [];
1718             var arrayLength = lengthOfArrayLike$1(array);
1719             var itemsLength, index;
1720
1721             for (index = 0; index < arrayLength; index++) {
1722               if (index in array) push(items, array[index]);
1723             }
1724
1725             internalSort(items, getSortCompare(comparefn));
1726
1727             itemsLength = items.length;
1728             index = 0;
1729
1730             while (index < itemsLength) array[index] = items[index++];
1731             while (index < arrayLength) delete array[index++];
1732
1733             return array;
1734           }
1735         });
1736
1737         var iterators = {};
1738
1739         var wellKnownSymbol$1 = wellKnownSymbol$6;
1740         var Iterators$1 = iterators;
1741
1742         var ITERATOR$1 = wellKnownSymbol$1('iterator');
1743         var ArrayPrototype = Array.prototype;
1744
1745         // check on default Array iterator
1746         var isArrayIteratorMethod$1 = function (it) {
1747           return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$1] === it);
1748         };
1749
1750         var classof = classof$3;
1751         var getMethod$1 = getMethod$3;
1752         var Iterators = iterators;
1753         var wellKnownSymbol = wellKnownSymbol$6;
1754
1755         var ITERATOR = wellKnownSymbol('iterator');
1756
1757         var getIteratorMethod$2 = function (it) {
1758           if (it != undefined) return getMethod$1(it, ITERATOR)
1759             || getMethod$1(it, '@@iterator')
1760             || Iterators[classof(it)];
1761         };
1762
1763         var global$3 = global$s;
1764         var call$2 = functionCall;
1765         var aCallable = aCallable$5;
1766         var anObject$2 = anObject$5;
1767         var tryToString$1 = tryToString$3;
1768         var getIteratorMethod$1 = getIteratorMethod$2;
1769
1770         var TypeError$2 = global$3.TypeError;
1771
1772         var getIterator$1 = function (argument, usingIterator) {
1773           var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
1774           if (aCallable(iteratorMethod)) return anObject$2(call$2(iteratorMethod, argument));
1775           throw TypeError$2(tryToString$1(argument) + ' is not iterable');
1776         };
1777
1778         var call$1 = functionCall;
1779         var anObject$1 = anObject$5;
1780         var getMethod = getMethod$3;
1781
1782         var iteratorClose$1 = function (iterator, kind, value) {
1783           var innerResult, innerError;
1784           anObject$1(iterator);
1785           try {
1786             innerResult = getMethod(iterator, 'return');
1787             if (!innerResult) {
1788               if (kind === 'throw') throw value;
1789               return value;
1790             }
1791             innerResult = call$1(innerResult, iterator);
1792           } catch (error) {
1793             innerError = true;
1794             innerResult = error;
1795           }
1796           if (kind === 'throw') throw value;
1797           if (innerError) throw innerResult;
1798           anObject$1(innerResult);
1799           return value;
1800         };
1801
1802         var global$2 = global$s;
1803         var bind = functionBindContext;
1804         var call = functionCall;
1805         var anObject = anObject$5;
1806         var tryToString = tryToString$3;
1807         var isArrayIteratorMethod = isArrayIteratorMethod$1;
1808         var lengthOfArrayLike = lengthOfArrayLike$5;
1809         var isPrototypeOf = objectIsPrototypeOf;
1810         var getIterator = getIterator$1;
1811         var getIteratorMethod = getIteratorMethod$2;
1812         var iteratorClose = iteratorClose$1;
1813
1814         var TypeError$1 = global$2.TypeError;
1815
1816         var Result = function (stopped, result) {
1817           this.stopped = stopped;
1818           this.result = result;
1819         };
1820
1821         var ResultPrototype = Result.prototype;
1822
1823         var iterate$1 = function (iterable, unboundFunction, options) {
1824           var that = options && options.that;
1825           var AS_ENTRIES = !!(options && options.AS_ENTRIES);
1826           var IS_ITERATOR = !!(options && options.IS_ITERATOR);
1827           var INTERRUPTED = !!(options && options.INTERRUPTED);
1828           var fn = bind(unboundFunction, that);
1829           var iterator, iterFn, index, length, result, next, step;
1830
1831           var stop = function (condition) {
1832             if (iterator) iteratorClose(iterator, 'normal', condition);
1833             return new Result(true, condition);
1834           };
1835
1836           var callFn = function (value) {
1837             if (AS_ENTRIES) {
1838               anObject(value);
1839               return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
1840             } return INTERRUPTED ? fn(value, stop) : fn(value);
1841           };
1842
1843           if (IS_ITERATOR) {
1844             iterator = iterable;
1845           } else {
1846             iterFn = getIteratorMethod(iterable);
1847             if (!iterFn) throw TypeError$1(tryToString(iterable) + ' is not iterable');
1848             // optimisation for array iterators
1849             if (isArrayIteratorMethod(iterFn)) {
1850               for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
1851                 result = callFn(iterable[index]);
1852                 if (result && isPrototypeOf(ResultPrototype, result)) return result;
1853               } return new Result(false);
1854             }
1855             iterator = getIterator(iterable, iterFn);
1856           }
1857
1858           next = iterator.next;
1859           while (!(step = call(next, iterator)).done) {
1860             try {
1861               result = callFn(step.value);
1862             } catch (error) {
1863               iteratorClose(iterator, 'throw', error);
1864             }
1865             if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
1866           } return new Result(false);
1867         };
1868
1869         var toPropertyKey = toPropertyKey$3;
1870         var definePropertyModule = objectDefineProperty;
1871         var createPropertyDescriptor = createPropertyDescriptor$3;
1872
1873         var createProperty$1 = function (object, key, value) {
1874           var propertyKey = toPropertyKey(key);
1875           if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
1876           else object[propertyKey] = value;
1877         };
1878
1879         var $ = _export;
1880         var iterate = iterate$1;
1881         var createProperty = createProperty$1;
1882
1883         // `Object.fromEntries` method
1884         // https://github.com/tc39/proposal-object-from-entries
1885         $({ target: 'Object', stat: true }, {
1886           fromEntries: function fromEntries(iterable) {
1887             var obj = {};
1888             iterate(iterable, function (k, v) {
1889               createProperty(obj, k, v);
1890             }, { AS_ENTRIES: true });
1891             return obj;
1892           }
1893         });
1894
1895         var global$1 = (typeof global$1 !== "undefined" ? global$1 :
1896           typeof self !== "undefined" ? self :
1897           typeof window !== "undefined" ? window : {});
1898
1899         // shim for using process in browser
1900         // based off https://github.com/defunctzombie/node-process/blob/master/browser.js
1901
1902         function defaultSetTimout() {
1903             throw new Error('setTimeout has not been defined');
1904         }
1905         function defaultClearTimeout () {
1906             throw new Error('clearTimeout has not been defined');
1907         }
1908         var cachedSetTimeout = defaultSetTimout;
1909         var cachedClearTimeout = defaultClearTimeout;
1910         if (typeof global$1.setTimeout === 'function') {
1911             cachedSetTimeout = setTimeout;
1912         }
1913         if (typeof global$1.clearTimeout === 'function') {
1914             cachedClearTimeout = clearTimeout;
1915         }
1916
1917         function runTimeout(fun) {
1918             if (cachedSetTimeout === setTimeout) {
1919                 //normal enviroments in sane situations
1920                 return setTimeout(fun, 0);
1921             }
1922             // if setTimeout wasn't available but was latter defined
1923             if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
1924                 cachedSetTimeout = setTimeout;
1925                 return setTimeout(fun, 0);
1926             }
1927             try {
1928                 // when when somebody has screwed with setTimeout but no I.E. maddness
1929                 return cachedSetTimeout(fun, 0);
1930             } catch(e){
1931                 try {
1932                     // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
1933                     return cachedSetTimeout.call(null, fun, 0);
1934                 } catch(e){
1935                     // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
1936                     return cachedSetTimeout.call(this, fun, 0);
1937                 }
1938             }
1939
1940
1941         }
1942         function runClearTimeout(marker) {
1943             if (cachedClearTimeout === clearTimeout) {
1944                 //normal enviroments in sane situations
1945                 return clearTimeout(marker);
1946             }
1947             // if clearTimeout wasn't available but was latter defined
1948             if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
1949                 cachedClearTimeout = clearTimeout;
1950                 return clearTimeout(marker);
1951             }
1952             try {
1953                 // when when somebody has screwed with setTimeout but no I.E. maddness
1954                 return cachedClearTimeout(marker);
1955             } catch (e){
1956                 try {
1957                     // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
1958                     return cachedClearTimeout.call(null, marker);
1959                 } catch (e){
1960                     // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
1961                     // Some versions of I.E. have different rules for clearTimeout vs setTimeout
1962                     return cachedClearTimeout.call(this, marker);
1963                 }
1964             }
1965
1966
1967
1968         }
1969         var queue = [];
1970         var draining = false;
1971         var currentQueue;
1972         var queueIndex = -1;
1973
1974         function cleanUpNextTick() {
1975             if (!draining || !currentQueue) {
1976                 return;
1977             }
1978             draining = false;
1979             if (currentQueue.length) {
1980                 queue = currentQueue.concat(queue);
1981             } else {
1982                 queueIndex = -1;
1983             }
1984             if (queue.length) {
1985                 drainQueue();
1986             }
1987         }
1988
1989         function drainQueue() {
1990             if (draining) {
1991                 return;
1992             }
1993             var timeout = runTimeout(cleanUpNextTick);
1994             draining = true;
1995
1996             var len = queue.length;
1997             while(len) {
1998                 currentQueue = queue;
1999                 queue = [];
2000                 while (++queueIndex < len) {
2001                     if (currentQueue) {
2002                         currentQueue[queueIndex].run();
2003                     }
2004                 }
2005                 queueIndex = -1;
2006                 len = queue.length;
2007             }
2008             currentQueue = null;
2009             draining = false;
2010             runClearTimeout(timeout);
2011         }
2012         function nextTick(fun) {
2013             var args = new Array(arguments.length - 1);
2014             if (arguments.length > 1) {
2015                 for (var i = 1; i < arguments.length; i++) {
2016                     args[i - 1] = arguments[i];
2017                 }
2018             }
2019             queue.push(new Item(fun, args));
2020             if (queue.length === 1 && !draining) {
2021                 runTimeout(drainQueue);
2022             }
2023         }
2024         // v8 likes predictible objects
2025         function Item(fun, array) {
2026             this.fun = fun;
2027             this.array = array;
2028         }
2029         Item.prototype.run = function () {
2030             this.fun.apply(null, this.array);
2031         };
2032         var title = 'browser';
2033         var platform = 'browser';
2034         var browser = true;
2035         var env = {};
2036         var argv = [];
2037         var version = ''; // empty string to avoid regexp issues
2038         var versions = {};
2039         var release = {};
2040         var config = {};
2041
2042         function noop() {}
2043
2044         var on = noop;
2045         var addListener = noop;
2046         var once = noop;
2047         var off = noop;
2048         var removeListener = noop;
2049         var removeAllListeners = noop;
2050         var emit = noop;
2051
2052         function binding(name) {
2053             throw new Error('process.binding is not supported');
2054         }
2055
2056         function cwd () { return '/' }
2057         function chdir (dir) {
2058             throw new Error('process.chdir is not supported');
2059         }function umask() { return 0; }
2060
2061         // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
2062         var performance = global$1.performance || {};
2063         var performanceNow =
2064           performance.now        ||
2065           performance.mozNow     ||
2066           performance.msNow      ||
2067           performance.oNow       ||
2068           performance.webkitNow  ||
2069           function(){ return (new Date()).getTime() };
2070
2071         // generate timestamp or delta
2072         // see http://nodejs.org/api/process.html#process_process_hrtime
2073         function hrtime(previousTimestamp){
2074           var clocktime = performanceNow.call(performance)*1e-3;
2075           var seconds = Math.floor(clocktime);
2076           var nanoseconds = Math.floor((clocktime%1)*1e9);
2077           if (previousTimestamp) {
2078             seconds = seconds - previousTimestamp[0];
2079             nanoseconds = nanoseconds - previousTimestamp[1];
2080             if (nanoseconds<0) {
2081               seconds--;
2082               nanoseconds += 1e9;
2083             }
2084           }
2085           return [seconds,nanoseconds]
2086         }
2087
2088         var startTime = new Date();
2089         function uptime() {
2090           var currentTime = new Date();
2091           var dif = currentTime - startTime;
2092           return dif / 1000;
2093         }
2094
2095         var browser$1 = {
2096           nextTick: nextTick,
2097           title: title,
2098           browser: browser,
2099           env: env,
2100           argv: argv,
2101           version: version,
2102           versions: versions,
2103           on: on,
2104           addListener: addListener,
2105           once: once,
2106           off: off,
2107           removeListener: removeListener,
2108           removeAllListeners: removeAllListeners,
2109           emit: emit,
2110           binding: binding,
2111           cwd: cwd,
2112           chdir: chdir,
2113           umask: umask,
2114           hrtime: hrtime,
2115           platform: platform,
2116           release: release,
2117           config: config,
2118           uptime: uptime
2119         };
2120
2121         var process = browser$1;
2122
2123         const debug$1 = typeof process === 'object' && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? function () {
2124           for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2125             args[_key] = arguments[_key];
2126           }
2127
2128           return console.error('SEMVER', ...args);
2129         } : () => {};
2130         var debug_1 = debug$1;
2131
2132         // Not necessarily the package version of this code.
2133
2134         const SEMVER_SPEC_VERSION = '2.0.0';
2135         const MAX_LENGTH$1 = 256;
2136         const MAX_SAFE_INTEGER$1 = Number.MAX_SAFE_INTEGER ||
2137         /* istanbul ignore next */
2138         9007199254740991; // Max safe segment length for coercion.
2139
2140         const MAX_SAFE_COMPONENT_LENGTH = 16;
2141         var constants = {
2142           SEMVER_SPEC_VERSION,
2143           MAX_LENGTH: MAX_LENGTH$1,
2144           MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1,
2145           MAX_SAFE_COMPONENT_LENGTH
2146         };
2147
2148         var re$1 = {exports: {}};
2149
2150         (function (module, exports) {
2151           const {
2152             MAX_SAFE_COMPONENT_LENGTH
2153           } = constants;
2154           const debug = debug_1;
2155           exports = module.exports = {}; // The actual regexps go on exports.re
2156
2157           const re = exports.re = [];
2158           const src = exports.src = [];
2159           const t = exports.t = {};
2160           let R = 0;
2161
2162           const createToken = (name, value, isGlobal) => {
2163             const index = R++;
2164             debug(index, value);
2165             t[name] = index;
2166             src[index] = value;
2167             re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
2168           }; // The following Regular Expressions can be used for tokenizing,
2169           // validating, and parsing SemVer version strings.
2170           // ## Numeric Identifier
2171           // A single `0`, or a non-zero digit followed by zero or more digits.
2172
2173
2174           createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*');
2175           createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+'); // ## Non-numeric Identifier
2176           // Zero or more digits, followed by a letter or hyphen, and then zero or
2177           // more letters, digits, or hyphens.
2178
2179           createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*'); // ## Main Version
2180           // Three dot-separated numeric identifiers.
2181
2182           createToken('MAINVERSION', "(".concat(src[t.NUMERICIDENTIFIER], ")\\.") + "(".concat(src[t.NUMERICIDENTIFIER], ")\\.") + "(".concat(src[t.NUMERICIDENTIFIER], ")"));
2183           createToken('MAINVERSIONLOOSE', "(".concat(src[t.NUMERICIDENTIFIERLOOSE], ")\\.") + "(".concat(src[t.NUMERICIDENTIFIERLOOSE], ")\\.") + "(".concat(src[t.NUMERICIDENTIFIERLOOSE], ")")); // ## Pre-release Version Identifier
2184           // A numeric identifier, or a non-numeric identifier.
2185
2186           createToken('PRERELEASEIDENTIFIER', "(?:".concat(src[t.NUMERICIDENTIFIER], "|").concat(src[t.NONNUMERICIDENTIFIER], ")"));
2187           createToken('PRERELEASEIDENTIFIERLOOSE', "(?:".concat(src[t.NUMERICIDENTIFIERLOOSE], "|").concat(src[t.NONNUMERICIDENTIFIER], ")")); // ## Pre-release Version
2188           // Hyphen, followed by one or more dot-separated pre-release version
2189           // identifiers.
2190
2191           createToken('PRERELEASE', "(?:-(".concat(src[t.PRERELEASEIDENTIFIER], "(?:\\.").concat(src[t.PRERELEASEIDENTIFIER], ")*))"));
2192           createToken('PRERELEASELOOSE', "(?:-?(".concat(src[t.PRERELEASEIDENTIFIERLOOSE], "(?:\\.").concat(src[t.PRERELEASEIDENTIFIERLOOSE], ")*))")); // ## Build Metadata Identifier
2193           // Any combination of digits, letters, or hyphens.
2194
2195           createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+'); // ## Build Metadata
2196           // Plus sign, followed by one or more period-separated build metadata
2197           // identifiers.
2198
2199           createToken('BUILD', "(?:\\+(".concat(src[t.BUILDIDENTIFIER], "(?:\\.").concat(src[t.BUILDIDENTIFIER], ")*))")); // ## Full Version String
2200           // A main version, followed optionally by a pre-release version and
2201           // build metadata.
2202           // Note that the only major, minor, patch, and pre-release sections of
2203           // the version string are capturing groups.  The build metadata is not a
2204           // capturing group, because it should not ever be used in version
2205           // comparison.
2206
2207           createToken('FULLPLAIN', "v?".concat(src[t.MAINVERSION]).concat(src[t.PRERELEASE], "?").concat(src[t.BUILD], "?"));
2208           createToken('FULL', "^".concat(src[t.FULLPLAIN], "$")); // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
2209           // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
2210           // common in the npm registry.
2211
2212           createToken('LOOSEPLAIN', "[v=\\s]*".concat(src[t.MAINVERSIONLOOSE]).concat(src[t.PRERELEASELOOSE], "?").concat(src[t.BUILD], "?"));
2213           createToken('LOOSE', "^".concat(src[t.LOOSEPLAIN], "$"));
2214           createToken('GTLT', '((?:<|>)?=?)'); // Something like "2.*" or "1.2.x".
2215           // Note that "x.x" is a valid xRange identifer, meaning "any version"
2216           // Only the first item is strictly required.
2217
2218           createToken('XRANGEIDENTIFIERLOOSE', "".concat(src[t.NUMERICIDENTIFIERLOOSE], "|x|X|\\*"));
2219           createToken('XRANGEIDENTIFIER', "".concat(src[t.NUMERICIDENTIFIER], "|x|X|\\*"));
2220           createToken('XRANGEPLAIN', "[v=\\s]*(".concat(src[t.XRANGEIDENTIFIER], ")") + "(?:\\.(".concat(src[t.XRANGEIDENTIFIER], ")") + "(?:\\.(".concat(src[t.XRANGEIDENTIFIER], ")") + "(?:".concat(src[t.PRERELEASE], ")?").concat(src[t.BUILD], "?") + ")?)?");
2221           createToken('XRANGEPLAINLOOSE', "[v=\\s]*(".concat(src[t.XRANGEIDENTIFIERLOOSE], ")") + "(?:\\.(".concat(src[t.XRANGEIDENTIFIERLOOSE], ")") + "(?:\\.(".concat(src[t.XRANGEIDENTIFIERLOOSE], ")") + "(?:".concat(src[t.PRERELEASELOOSE], ")?").concat(src[t.BUILD], "?") + ")?)?");
2222           createToken('XRANGE', "^".concat(src[t.GTLT], "\\s*").concat(src[t.XRANGEPLAIN], "$"));
2223           createToken('XRANGELOOSE', "^".concat(src[t.GTLT], "\\s*").concat(src[t.XRANGEPLAINLOOSE], "$")); // Coercion.
2224           // Extract anything that could conceivably be a part of a valid semver
2225
2226           createToken('COERCE', "".concat('(^|[^\\d])' + '(\\d{1,').concat(MAX_SAFE_COMPONENT_LENGTH, "})") + "(?:\\.(\\d{1,".concat(MAX_SAFE_COMPONENT_LENGTH, "}))?") + "(?:\\.(\\d{1,".concat(MAX_SAFE_COMPONENT_LENGTH, "}))?") + "(?:$|[^\\d])");
2227           createToken('COERCERTL', src[t.COERCE], true); // Tilde ranges.
2228           // Meaning is "reasonably at or greater than"
2229
2230           createToken('LONETILDE', '(?:~>?)');
2231           createToken('TILDETRIM', "(\\s*)".concat(src[t.LONETILDE], "\\s+"), true);
2232           exports.tildeTrimReplace = '$1~';
2233           createToken('TILDE', "^".concat(src[t.LONETILDE]).concat(src[t.XRANGEPLAIN], "$"));
2234           createToken('TILDELOOSE', "^".concat(src[t.LONETILDE]).concat(src[t.XRANGEPLAINLOOSE], "$")); // Caret ranges.
2235           // Meaning is "at least and backwards compatible with"
2236
2237           createToken('LONECARET', '(?:\\^)');
2238           createToken('CARETTRIM', "(\\s*)".concat(src[t.LONECARET], "\\s+"), true);
2239           exports.caretTrimReplace = '$1^';
2240           createToken('CARET', "^".concat(src[t.LONECARET]).concat(src[t.XRANGEPLAIN], "$"));
2241           createToken('CARETLOOSE', "^".concat(src[t.LONECARET]).concat(src[t.XRANGEPLAINLOOSE], "$")); // A simple gt/lt/eq thing, or just "" to indicate "any version"
2242
2243           createToken('COMPARATORLOOSE', "^".concat(src[t.GTLT], "\\s*(").concat(src[t.LOOSEPLAIN], ")$|^$"));
2244           createToken('COMPARATOR', "^".concat(src[t.GTLT], "\\s*(").concat(src[t.FULLPLAIN], ")$|^$")); // An expression to strip any whitespace between the gtlt and the thing
2245           // it modifies, so that `> 1.2.3` ==> `>1.2.3`
2246
2247           createToken('COMPARATORTRIM', "(\\s*)".concat(src[t.GTLT], "\\s*(").concat(src[t.LOOSEPLAIN], "|").concat(src[t.XRANGEPLAIN], ")"), true);
2248           exports.comparatorTrimReplace = '$1$2$3'; // Something like `1.2.3 - 1.2.4`
2249           // Note that these all use the loose form, because they'll be
2250           // checked against either the strict or loose comparator form
2251           // later.
2252
2253           createToken('HYPHENRANGE', "^\\s*(".concat(src[t.XRANGEPLAIN], ")") + "\\s+-\\s+" + "(".concat(src[t.XRANGEPLAIN], ")") + "\\s*$");
2254           createToken('HYPHENRANGELOOSE', "^\\s*(".concat(src[t.XRANGEPLAINLOOSE], ")") + "\\s+-\\s+" + "(".concat(src[t.XRANGEPLAINLOOSE], ")") + "\\s*$"); // Star ranges basically just allow anything at all.
2255
2256           createToken('STAR', '(<|>)?=?\\s*\\*'); // >=0.0.0 is like a star
2257
2258           createToken('GTE0', '^\\s*>=\\s*0\.0\.0\\s*$');
2259           createToken('GTE0PRE', '^\\s*>=\\s*0\.0\.0-0\\s*$');
2260         })(re$1, re$1.exports);
2261
2262         // obj with keys in a consistent order.
2263
2264         const opts = ['includePrerelease', 'loose', 'rtl'];
2265
2266         const parseOptions$1 = options => !options ? {} : typeof options !== 'object' ? {
2267           loose: true
2268         } : opts.filter(k => options[k]).reduce((options, k) => {
2269           options[k] = true;
2270           return options;
2271         }, {});
2272
2273         var parseOptions_1 = parseOptions$1;
2274
2275         const numeric = /^[0-9]+$/;
2276
2277         const compareIdentifiers$1 = (a, b) => {
2278           const anum = numeric.test(a);
2279           const bnum = numeric.test(b);
2280
2281           if (anum && bnum) {
2282             a = +a;
2283             b = +b;
2284           }
2285
2286           return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
2287         };
2288
2289         const rcompareIdentifiers = (a, b) => compareIdentifiers$1(b, a);
2290
2291         var identifiers = {
2292           compareIdentifiers: compareIdentifiers$1,
2293           rcompareIdentifiers
2294         };
2295
2296         const debug = debug_1;
2297         const {
2298           MAX_LENGTH,
2299           MAX_SAFE_INTEGER
2300         } = constants;
2301         const {
2302           re,
2303           t
2304         } = re$1.exports;
2305         const parseOptions = parseOptions_1;
2306         const {
2307           compareIdentifiers
2308         } = identifiers;
2309
2310         class SemVer$1 {
2311           constructor(version, options) {
2312             options = parseOptions(options);
2313
2314             if (version instanceof SemVer$1) {
2315               if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
2316                 return version;
2317               } else {
2318                 version = version.version;
2319               }
2320             } else if (typeof version !== 'string') {
2321               throw new TypeError("Invalid Version: ".concat(version));
2322             }
2323
2324             if (version.length > MAX_LENGTH) {
2325               throw new TypeError("version is longer than ".concat(MAX_LENGTH, " characters"));
2326             }
2327
2328             debug('SemVer', version, options);
2329             this.options = options;
2330             this.loose = !!options.loose; // this isn't actually relevant for versions, but keep it so that we
2331             // don't run into trouble passing this.options around.
2332
2333             this.includePrerelease = !!options.includePrerelease;
2334             const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
2335
2336             if (!m) {
2337               throw new TypeError("Invalid Version: ".concat(version));
2338             }
2339
2340             this.raw = version; // these are actually numbers
2341
2342             this.major = +m[1];
2343             this.minor = +m[2];
2344             this.patch = +m[3];
2345
2346             if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
2347               throw new TypeError('Invalid major version');
2348             }
2349
2350             if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
2351               throw new TypeError('Invalid minor version');
2352             }
2353
2354             if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
2355               throw new TypeError('Invalid patch version');
2356             } // numberify any prerelease numeric ids
2357
2358
2359             if (!m[4]) {
2360               this.prerelease = [];
2361             } else {
2362               this.prerelease = m[4].split('.').map(id => {
2363                 if (/^[0-9]+$/.test(id)) {
2364                   const num = +id;
2365
2366                   if (num >= 0 && num < MAX_SAFE_INTEGER) {
2367                     return num;
2368                   }
2369                 }
2370
2371                 return id;
2372               });
2373             }
2374
2375             this.build = m[5] ? m[5].split('.') : [];
2376             this.format();
2377           }
2378
2379           format() {
2380             this.version = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
2381
2382             if (this.prerelease.length) {
2383               this.version += "-".concat(this.prerelease.join('.'));
2384             }
2385
2386             return this.version;
2387           }
2388
2389           toString() {
2390             return this.version;
2391           }
2392
2393           compare(other) {
2394             debug('SemVer.compare', this.version, this.options, other);
2395
2396             if (!(other instanceof SemVer$1)) {
2397               if (typeof other === 'string' && other === this.version) {
2398                 return 0;
2399               }
2400
2401               other = new SemVer$1(other, this.options);
2402             }
2403
2404             if (other.version === this.version) {
2405               return 0;
2406             }
2407
2408             return this.compareMain(other) || this.comparePre(other);
2409           }
2410
2411           compareMain(other) {
2412             if (!(other instanceof SemVer$1)) {
2413               other = new SemVer$1(other, this.options);
2414             }
2415
2416             return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
2417           }
2418
2419           comparePre(other) {
2420             if (!(other instanceof SemVer$1)) {
2421               other = new SemVer$1(other, this.options);
2422             } // NOT having a prerelease is > having one
2423
2424
2425             if (this.prerelease.length && !other.prerelease.length) {
2426               return -1;
2427             } else if (!this.prerelease.length && other.prerelease.length) {
2428               return 1;
2429             } else if (!this.prerelease.length && !other.prerelease.length) {
2430               return 0;
2431             }
2432
2433             let i = 0;
2434
2435             do {
2436               const a = this.prerelease[i];
2437               const b = other.prerelease[i];
2438               debug('prerelease compare', i, a, b);
2439
2440               if (a === undefined && b === undefined) {
2441                 return 0;
2442               } else if (b === undefined) {
2443                 return 1;
2444               } else if (a === undefined) {
2445                 return -1;
2446               } else if (a === b) {
2447                 continue;
2448               } else {
2449                 return compareIdentifiers(a, b);
2450               }
2451             } while (++i);
2452           }
2453
2454           compareBuild(other) {
2455             if (!(other instanceof SemVer$1)) {
2456               other = new SemVer$1(other, this.options);
2457             }
2458
2459             let i = 0;
2460
2461             do {
2462               const a = this.build[i];
2463               const b = other.build[i];
2464               debug('prerelease compare', i, a, b);
2465
2466               if (a === undefined && b === undefined) {
2467                 return 0;
2468               } else if (b === undefined) {
2469                 return 1;
2470               } else if (a === undefined) {
2471                 return -1;
2472               } else if (a === b) {
2473                 continue;
2474               } else {
2475                 return compareIdentifiers(a, b);
2476               }
2477             } while (++i);
2478           } // preminor will bump the version up to the next minor release, and immediately
2479           // down to pre-release. premajor and prepatch work the same way.
2480
2481
2482           inc(release, identifier) {
2483             switch (release) {
2484               case 'premajor':
2485                 this.prerelease.length = 0;
2486                 this.patch = 0;
2487                 this.minor = 0;
2488                 this.major++;
2489                 this.inc('pre', identifier);
2490                 break;
2491
2492               case 'preminor':
2493                 this.prerelease.length = 0;
2494                 this.patch = 0;
2495                 this.minor++;
2496                 this.inc('pre', identifier);
2497                 break;
2498
2499               case 'prepatch':
2500                 // If this is already a prerelease, it will bump to the next version
2501                 // drop any prereleases that might already exist, since they are not
2502                 // relevant at this point.
2503                 this.prerelease.length = 0;
2504                 this.inc('patch', identifier);
2505                 this.inc('pre', identifier);
2506                 break;
2507               // If the input is a non-prerelease version, this acts the same as
2508               // prepatch.
2509
2510               case 'prerelease':
2511                 if (this.prerelease.length === 0) {
2512                   this.inc('patch', identifier);
2513                 }
2514
2515                 this.inc('pre', identifier);
2516                 break;
2517
2518               case 'major':
2519                 // If this is a pre-major version, bump up to the same major version.
2520                 // Otherwise increment major.
2521                 // 1.0.0-5 bumps to 1.0.0
2522                 // 1.1.0 bumps to 2.0.0
2523                 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
2524                   this.major++;
2525                 }
2526
2527                 this.minor = 0;
2528                 this.patch = 0;
2529                 this.prerelease = [];
2530                 break;
2531
2532               case 'minor':
2533                 // If this is a pre-minor version, bump up to the same minor version.
2534                 // Otherwise increment minor.
2535                 // 1.2.0-5 bumps to 1.2.0
2536                 // 1.2.1 bumps to 1.3.0
2537                 if (this.patch !== 0 || this.prerelease.length === 0) {
2538                   this.minor++;
2539                 }
2540
2541                 this.patch = 0;
2542                 this.prerelease = [];
2543                 break;
2544
2545               case 'patch':
2546                 // If this is not a pre-release version, it will increment the patch.
2547                 // If it is a pre-release it will bump up to the same patch version.
2548                 // 1.2.0-5 patches to 1.2.0
2549                 // 1.2.0 patches to 1.2.1
2550                 if (this.prerelease.length === 0) {
2551                   this.patch++;
2552                 }
2553
2554                 this.prerelease = [];
2555                 break;
2556               // This probably shouldn't be used publicly.
2557               // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
2558
2559               case 'pre':
2560                 if (this.prerelease.length === 0) {
2561                   this.prerelease = [0];
2562                 } else {
2563                   let i = this.prerelease.length;
2564
2565                   while (--i >= 0) {
2566                     if (typeof this.prerelease[i] === 'number') {
2567                       this.prerelease[i]++;
2568                       i = -2;
2569                     }
2570                   }
2571
2572                   if (i === -1) {
2573                     // didn't increment anything
2574                     this.prerelease.push(0);
2575                   }
2576                 }
2577
2578                 if (identifier) {
2579                   // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
2580                   // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
2581                   if (this.prerelease[0] === identifier) {
2582                     if (isNaN(this.prerelease[1])) {
2583                       this.prerelease = [identifier, 0];
2584                     }
2585                   } else {
2586                     this.prerelease = [identifier, 0];
2587                   }
2588                 }
2589
2590                 break;
2591
2592               default:
2593                 throw new Error("invalid increment argument: ".concat(release));
2594             }
2595
2596             this.format();
2597             this.raw = this.version;
2598             return this;
2599           }
2600
2601         }
2602
2603         var semver$1 = SemVer$1;
2604
2605         const SemVer = semver$1;
2606
2607         const compare$2 = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
2608
2609         var compare_1 = compare$2;
2610
2611         const compare$1 = compare_1;
2612
2613         const lt = (a, b, loose) => compare$1(a, b, loose) < 0;
2614
2615         var lt_1 = lt;
2616
2617         const compare = compare_1;
2618
2619         const gte = (a, b, loose) => compare(a, b, loose) >= 0;
2620
2621         var gte_1 = gte;
2622
2623         var arrayify$1 = (object, keyName) => Object.entries(object).map(_ref => {
2624           let [key, value] = _ref;
2625           return Object.assign({
2626             [keyName]: key
2627           }, value);
2628         });
2629
2630         var require$$4 = {"version":"2.5.0"};
2631
2632         var lib = {exports: {}};
2633
2634         (function (module, exports) {
2635
2636           Object.defineProperty(exports, "__esModule", {
2637             value: true
2638           });
2639           exports.outdent = void 0; // In the absence of a WeakSet or WeakMap implementation, don't break, but don't cache either.
2640
2641           function noop() {
2642             var args = [];
2643
2644             for (var _i = 0; _i < arguments.length; _i++) {
2645               args[_i] = arguments[_i];
2646             }
2647           }
2648
2649           function createWeakMap() {
2650             if (typeof WeakMap !== "undefined") {
2651               return new WeakMap();
2652             } else {
2653               return fakeSetOrMap();
2654             }
2655           }
2656           /**
2657            * Creates and returns a no-op implementation of a WeakMap / WeakSet that never stores anything.
2658            */
2659
2660
2661           function fakeSetOrMap() {
2662             return {
2663               add: noop,
2664               delete: noop,
2665               get: noop,
2666               set: noop,
2667               has: function (k) {
2668                 return false;
2669               }
2670             };
2671           } // Safe hasOwnProperty
2672
2673
2674           var hop = Object.prototype.hasOwnProperty;
2675
2676           var has = function (obj, prop) {
2677             return hop.call(obj, prop);
2678           }; // Copy all own enumerable properties from source to target
2679
2680
2681           function extend(target, source) {
2682             for (var prop in source) {
2683               if (has(source, prop)) {
2684                 target[prop] = source[prop];
2685               }
2686             }
2687
2688             return target;
2689           }
2690
2691           var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
2692           var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
2693           var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
2694           var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
2695           var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
2696
2697           function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
2698             // If first interpolated value is a reference to outdent,
2699             // determine indentation level from the indentation of the interpolated value.
2700             var indentationLevel = 0;
2701             var match = strings[0].match(reDetectIndentation);
2702
2703             if (match) {
2704               indentationLevel = match[1].length;
2705             }
2706
2707             var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
2708             var reMatchIndent = new RegExp(reSource, "g");
2709
2710             if (firstInterpolatedValueSetsIndentationLevel) {
2711               strings = strings.slice(1);
2712             }
2713
2714             var newline = options.newline,
2715                 trimLeadingNewline = options.trimLeadingNewline,
2716                 trimTrailingNewline = options.trimTrailingNewline;
2717             var normalizeNewlines = typeof newline === "string";
2718             var l = strings.length;
2719             var outdentedStrings = strings.map(function (v, i) {
2720               // Remove leading indentation from all lines
2721               v = v.replace(reMatchIndent, "$1"); // Trim a leading newline from the first string
2722
2723               if (i === 0 && trimLeadingNewline) {
2724                 v = v.replace(reLeadingNewline, "");
2725               } // Trim a trailing newline from the last string
2726
2727
2728               if (i === l - 1 && trimTrailingNewline) {
2729                 v = v.replace(reTrailingNewline, "");
2730               } // Normalize newlines
2731
2732
2733               if (normalizeNewlines) {
2734                 v = v.replace(/\r\n|\n|\r/g, function (_) {
2735                   return newline;
2736                 });
2737               }
2738
2739               return v;
2740             });
2741             return outdentedStrings;
2742           }
2743
2744           function concatStringsAndValues(strings, values) {
2745             var ret = "";
2746
2747             for (var i = 0, l = strings.length; i < l; i++) {
2748               ret += strings[i];
2749
2750               if (i < l - 1) {
2751                 ret += values[i];
2752               }
2753             }
2754
2755             return ret;
2756           }
2757
2758           function isTemplateStringsArray(v) {
2759             return has(v, "raw") && has(v, "length");
2760           }
2761           /**
2762            * It is assumed that opts will not change.  If this is a problem, clone your options object and pass the clone to
2763            * makeInstance
2764            * @param options
2765            * @return {outdent}
2766            */
2767
2768
2769           function createInstance(options) {
2770             /** Cache of pre-processed template literal arrays */
2771             var arrayAutoIndentCache = createWeakMap();
2772             /**
2773                * Cache of pre-processed template literal arrays, where first interpolated value is a reference to outdent,
2774                * before interpolated values are injected.
2775                */
2776
2777             var arrayFirstInterpSetsIndentCache = createWeakMap();
2778
2779             function outdent(stringsOrOptions) {
2780               var values = [];
2781
2782               for (var _i = 1; _i < arguments.length; _i++) {
2783                 values[_i - 1] = arguments[_i];
2784               }
2785               /* tslint:enable:no-shadowed-variable */
2786
2787
2788               if (isTemplateStringsArray(stringsOrOptions)) {
2789                 var strings = stringsOrOptions; // Is first interpolated value a reference to outdent, alone on its own line, without any preceding non-whitespace?
2790
2791                 var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]); // Perform outdentation
2792
2793                 var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;
2794                 var renderedArray = cache.get(strings);
2795
2796                 if (!renderedArray) {
2797                   renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);
2798                   cache.set(strings, renderedArray);
2799                 }
2800                 /** If no interpolated values, skip concatenation step */
2801
2802
2803                 if (values.length === 0) {
2804                   return renderedArray[0];
2805                 }
2806                 /** Concatenate string literals with interpolated values */
2807
2808
2809                 var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
2810                 return rendered;
2811               } else {
2812                 // Create and return a new instance of outdent with the given options
2813                 return createInstance(extend(extend({}, options), stringsOrOptions || {}));
2814               }
2815             }
2816
2817             var fullOutdent = extend(outdent, {
2818               string: function (str) {
2819                 return _outdentArray([str], false, options)[0];
2820               }
2821             });
2822             return fullOutdent;
2823           }
2824
2825           var defaultOutdent = createInstance({
2826             trimLeadingNewline: true,
2827             trimTrailingNewline: true
2828           });
2829           exports.outdent = defaultOutdent; // Named exports.  Simple and preferred.
2830           // import outdent from 'outdent';
2831
2832           exports.default = defaultOutdent;
2833
2834           {
2835             // In webpack harmony-modules environments, module.exports is read-only,
2836             // so we fail gracefully.
2837             try {
2838               module.exports = defaultOutdent;
2839               Object.defineProperty(defaultOutdent, "__esModule", {
2840                 value: true
2841               });
2842               defaultOutdent.default = defaultOutdent;
2843               defaultOutdent.outdent = defaultOutdent;
2844             } catch (e) {}
2845           }
2846         })(lib, lib.exports);
2847
2848         var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
2849
2850         const {
2851           outdent
2852         } = lib.exports;
2853         const CATEGORY_CONFIG = "Config";
2854         const CATEGORY_EDITOR = "Editor";
2855         const CATEGORY_FORMAT = "Format";
2856         const CATEGORY_OTHER = "Other";
2857         const CATEGORY_OUTPUT = "Output";
2858         const CATEGORY_GLOBAL = "Global";
2859         const CATEGORY_SPECIAL = "Special";
2860         /**
2861          * @typedef {Object} OptionInfo
2862          * @property {string} [since] - available since version
2863          * @property {string} category
2864          * @property {'int' | 'boolean' | 'choice' | 'path'} type
2865          * @property {boolean} [array] - indicate it's an array of the specified type
2866          * @property {OptionValueInfo} [default]
2867          * @property {OptionRangeInfo} [range] - for type int
2868          * @property {string} description
2869          * @property {string} [deprecated] - deprecated since version
2870          * @property {OptionRedirectInfo} [redirect] - redirect deprecated option
2871          * @property {(value: any) => boolean} [exception]
2872          * @property {OptionChoiceInfo[]} [choices] - for type choice
2873          * @property {string} [cliName]
2874          * @property {string} [cliCategory]
2875          * @property {string} [cliDescription]
2876          *
2877          * @typedef {number | boolean | string} OptionValue
2878          * @typedef {OptionValue | [{ value: OptionValue[] }] | Array<{ since: string, value: OptionValue}>} OptionValueInfo
2879          *
2880          * @typedef {Object} OptionRedirectInfo
2881          * @property {string} option
2882          * @property {OptionValue} value
2883          *
2884          * @typedef {Object} OptionRangeInfo
2885          * @property {number} start - recommended range start
2886          * @property {number} end - recommended range end
2887          * @property {number} step - recommended range step
2888          *
2889          * @typedef {Object} OptionChoiceInfo
2890          * @property {boolean | string} value - boolean for the option that is originally boolean type
2891          * @property {string} description
2892          * @property {string} [since] - undefined if available since the first version of the option
2893          * @property {string} [deprecated] - deprecated since version
2894          * @property {OptionValueInfo} [redirect] - redirect deprecated value
2895          */
2896
2897         /** @type {{ [name: string]: OptionInfo }} */
2898
2899         const options = {
2900           cursorOffset: {
2901             since: "1.4.0",
2902             category: CATEGORY_SPECIAL,
2903             type: "int",
2904             default: -1,
2905             range: {
2906               start: -1,
2907               end: Number.POSITIVE_INFINITY,
2908               step: 1
2909             },
2910             description: outdent(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n      Print (to stderr) where a cursor at the given position would move to after formatting.\n      This option cannot be used with --range-start and --range-end.\n    "]))),
2911             cliCategory: CATEGORY_EDITOR
2912           },
2913           endOfLine: {
2914             since: "1.15.0",
2915             category: CATEGORY_GLOBAL,
2916             type: "choice",
2917             default: [{
2918               since: "1.15.0",
2919               value: "auto"
2920             }, {
2921               since: "2.0.0",
2922               value: "lf"
2923             }],
2924             description: "Which end of line characters to apply.",
2925             choices: [{
2926               value: "lf",
2927               description: "Line Feed only (\\n), common on Linux and macOS as well as inside git repos"
2928             }, {
2929               value: "crlf",
2930               description: "Carriage Return + Line Feed characters (\\r\\n), common on Windows"
2931             }, {
2932               value: "cr",
2933               description: "Carriage Return character only (\\r), used very rarely"
2934             }, {
2935               value: "auto",
2936               description: outdent(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n          Maintain existing\n          (mixed values within one file are normalised by looking at what's used after the first line)\n        "])))
2937             }]
2938           },
2939           filepath: {
2940             since: "1.4.0",
2941             category: CATEGORY_SPECIAL,
2942             type: "path",
2943             description: "Specify the input filepath. This will be used to do parser inference.",
2944             cliName: "stdin-filepath",
2945             cliCategory: CATEGORY_OTHER,
2946             cliDescription: "Path to the file to pretend that stdin comes from."
2947           },
2948           insertPragma: {
2949             since: "1.8.0",
2950             category: CATEGORY_SPECIAL,
2951             type: "boolean",
2952             default: false,
2953             description: "Insert @format pragma into file's first docblock comment.",
2954             cliCategory: CATEGORY_OTHER
2955           },
2956           parser: {
2957             since: "0.0.10",
2958             category: CATEGORY_GLOBAL,
2959             type: "choice",
2960             default: [{
2961               since: "0.0.10",
2962               value: "babylon"
2963             }, {
2964               since: "1.13.0",
2965               value: undefined
2966             }],
2967             description: "Which parser to use.",
2968             exception: value => typeof value === "string" || typeof value === "function",
2969             choices: [{
2970               value: "flow",
2971               description: "Flow"
2972             }, {
2973               value: "babel",
2974               since: "1.16.0",
2975               description: "JavaScript"
2976             }, {
2977               value: "babel-flow",
2978               since: "1.16.0",
2979               description: "Flow"
2980             }, {
2981               value: "babel-ts",
2982               since: "2.0.0",
2983               description: "TypeScript"
2984             }, {
2985               value: "typescript",
2986               since: "1.4.0",
2987               description: "TypeScript"
2988             }, {
2989               value: "espree",
2990               since: "2.2.0",
2991               description: "JavaScript"
2992             }, {
2993               value: "meriyah",
2994               since: "2.2.0",
2995               description: "JavaScript"
2996             }, {
2997               value: "css",
2998               since: "1.7.1",
2999               description: "CSS"
3000             }, {
3001               value: "less",
3002               since: "1.7.1",
3003               description: "Less"
3004             }, {
3005               value: "scss",
3006               since: "1.7.1",
3007               description: "SCSS"
3008             }, {
3009               value: "json",
3010               since: "1.5.0",
3011               description: "JSON"
3012             }, {
3013               value: "json5",
3014               since: "1.13.0",
3015               description: "JSON5"
3016             }, {
3017               value: "json-stringify",
3018               since: "1.13.0",
3019               description: "JSON.stringify"
3020             }, {
3021               value: "graphql",
3022               since: "1.5.0",
3023               description: "GraphQL"
3024             }, {
3025               value: "markdown",
3026               since: "1.8.0",
3027               description: "Markdown"
3028             }, {
3029               value: "mdx",
3030               since: "1.15.0",
3031               description: "MDX"
3032             }, {
3033               value: "vue",
3034               since: "1.10.0",
3035               description: "Vue"
3036             }, {
3037               value: "yaml",
3038               since: "1.14.0",
3039               description: "YAML"
3040             }, {
3041               value: "glimmer",
3042               since: "2.3.0",
3043               description: "Ember / Handlebars"
3044             }, {
3045               value: "html",
3046               since: "1.15.0",
3047               description: "HTML"
3048             }, {
3049               value: "angular",
3050               since: "1.15.0",
3051               description: "Angular"
3052             }, {
3053               value: "lwc",
3054               since: "1.17.0",
3055               description: "Lightning Web Components"
3056             }]
3057           },
3058           plugins: {
3059             since: "1.10.0",
3060             type: "path",
3061             array: true,
3062             default: [{
3063               value: []
3064             }],
3065             category: CATEGORY_GLOBAL,
3066             description: "Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",
3067             exception: value => typeof value === "string" || typeof value === "object",
3068             cliName: "plugin",
3069             cliCategory: CATEGORY_CONFIG
3070           },
3071           pluginSearchDirs: {
3072             since: "1.13.0",
3073             type: "path",
3074             array: true,
3075             default: [{
3076               value: []
3077             }],
3078             category: CATEGORY_GLOBAL,
3079             description: outdent(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n      Custom directory that contains prettier plugins in node_modules subdirectory.\n      Overrides default behavior when plugins are searched relatively to the location of Prettier.\n      Multiple values are accepted.\n    "]))),
3080             exception: value => typeof value === "string" || typeof value === "object",
3081             cliName: "plugin-search-dir",
3082             cliCategory: CATEGORY_CONFIG
3083           },
3084           printWidth: {
3085             since: "0.0.0",
3086             category: CATEGORY_GLOBAL,
3087             type: "int",
3088             default: 80,
3089             description: "The line length where Prettier will try wrap.",
3090             range: {
3091               start: 0,
3092               end: Number.POSITIVE_INFINITY,
3093               step: 1
3094             }
3095           },
3096           rangeEnd: {
3097             since: "1.4.0",
3098             category: CATEGORY_SPECIAL,
3099             type: "int",
3100             default: Number.POSITIVE_INFINITY,
3101             range: {
3102               start: 0,
3103               end: Number.POSITIVE_INFINITY,
3104               step: 1
3105             },
3106             description: outdent(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n      Format code ending at a given character offset (exclusive).\n      The range will extend forwards to the end of the selected statement.\n      This option cannot be used with --cursor-offset.\n    "]))),
3107             cliCategory: CATEGORY_EDITOR
3108           },
3109           rangeStart: {
3110             since: "1.4.0",
3111             category: CATEGORY_SPECIAL,
3112             type: "int",
3113             default: 0,
3114             range: {
3115               start: 0,
3116               end: Number.POSITIVE_INFINITY,
3117               step: 1
3118             },
3119             description: outdent(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n      Format code starting at a given character offset.\n      The range will extend backwards to the start of the first line containing the selected statement.\n      This option cannot be used with --cursor-offset.\n    "]))),
3120             cliCategory: CATEGORY_EDITOR
3121           },
3122           requirePragma: {
3123             since: "1.7.0",
3124             category: CATEGORY_SPECIAL,
3125             type: "boolean",
3126             default: false,
3127             description: outdent(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n      Require either '@prettier' or '@format' to be present in the file's first docblock comment\n      in order for it to be formatted.\n    "]))),
3128             cliCategory: CATEGORY_OTHER
3129           },
3130           tabWidth: {
3131             type: "int",
3132             category: CATEGORY_GLOBAL,
3133             default: 2,
3134             description: "Number of spaces per indentation level.",
3135             range: {
3136               start: 0,
3137               end: Number.POSITIVE_INFINITY,
3138               step: 1
3139             }
3140           },
3141           useTabs: {
3142             since: "1.0.0",
3143             category: CATEGORY_GLOBAL,
3144             type: "boolean",
3145             default: false,
3146             description: "Indent with tabs instead of spaces."
3147           },
3148           embeddedLanguageFormatting: {
3149             since: "2.1.0",
3150             category: CATEGORY_GLOBAL,
3151             type: "choice",
3152             default: [{
3153               since: "2.1.0",
3154               value: "auto"
3155             }],
3156             description: "Control how Prettier formats quoted code embedded in the file.",
3157             choices: [{
3158               value: "auto",
3159               description: "Format embedded code if Prettier can automatically identify it."
3160             }, {
3161               value: "off",
3162               description: "Never automatically format embedded code."
3163             }]
3164           }
3165         };
3166         var coreOptions$1 = {
3167           CATEGORY_CONFIG,
3168           CATEGORY_EDITOR,
3169           CATEGORY_FORMAT,
3170           CATEGORY_OTHER,
3171           CATEGORY_OUTPUT,
3172           CATEGORY_GLOBAL,
3173           CATEGORY_SPECIAL,
3174           options
3175         };
3176
3177         const _excluded = ["cliName", "cliCategory", "cliDescription"];
3178
3179         const semver = {
3180           compare: compare_1,
3181           lt: lt_1,
3182           gte: gte_1
3183         };
3184         const arrayify = arrayify$1;
3185         const currentVersion = require$$4.version;
3186         const coreOptions = coreOptions$1.options;
3187         /**
3188          * Strings in `plugins` and `pluginSearchDirs` are handled by a wrapped version
3189          * of this function created by `withPlugins`. Don't pass them here directly.
3190          * @param {object} param0
3191          * @param {(string | object)[]=} param0.plugins Strings are resolved by `withPlugins`.
3192          * @param {string[]=} param0.pluginSearchDirs Added by `withPlugins`.
3193          * @param {boolean=} param0.showUnreleased
3194          * @param {boolean=} param0.showDeprecated
3195          * @param {boolean=} param0.showInternal
3196          */
3197
3198         function getSupportInfo$1() {
3199           let {
3200             plugins = [],
3201             showUnreleased = false,
3202             showDeprecated = false,
3203             showInternal = false
3204           } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3205           // pre-release version is smaller than the normal version in semver,
3206           // we need to treat it as the normal one so as to test new features.
3207           const version = currentVersion.split("-", 1)[0];
3208           const languages = plugins.flatMap(plugin => plugin.languages || []).filter(filterSince);
3209           const options = arrayify(Object.assign({}, ...plugins.map(_ref => {
3210             let {
3211               options
3212             } = _ref;
3213             return options;
3214           }), coreOptions), "name").filter(option => filterSince(option) && filterDeprecated(option)).sort((a, b) => a.name === b.name ? 0 : a.name < b.name ? -1 : 1).map(mapInternal).map(option => {
3215             option = Object.assign({}, option);
3216
3217             if (Array.isArray(option.default)) {
3218               option.default = option.default.length === 1 ? option.default[0].value : option.default.filter(filterSince).sort((info1, info2) => semver.compare(info2.since, info1.since))[0].value;
3219             }
3220
3221             if (Array.isArray(option.choices)) {
3222               option.choices = option.choices.filter(option => filterSince(option) && filterDeprecated(option));
3223
3224               if (option.name === "parser") {
3225                 collectParsersFromLanguages(option, languages, plugins);
3226               }
3227             }
3228
3229             const pluginDefaults = Object.fromEntries(plugins.filter(plugin => plugin.defaultOptions && plugin.defaultOptions[option.name] !== undefined).map(plugin => [plugin.name, plugin.defaultOptions[option.name]]));
3230             return Object.assign(Object.assign({}, option), {}, {
3231               pluginDefaults
3232             });
3233           });
3234           return {
3235             languages,
3236             options
3237           };
3238
3239           function filterSince(object) {
3240             return showUnreleased || !("since" in object) || object.since && semver.gte(version, object.since);
3241           }
3242
3243           function filterDeprecated(object) {
3244             return showDeprecated || !("deprecated" in object) || object.deprecated && semver.lt(version, object.deprecated);
3245           }
3246
3247           function mapInternal(object) {
3248             if (showInternal) {
3249               return object;
3250             }
3251
3252             const newObject = _objectWithoutProperties(object, _excluded);
3253
3254             return newObject;
3255           }
3256         }
3257
3258         function collectParsersFromLanguages(option, languages, plugins) {
3259           const existingValues = new Set(option.choices.map(choice => choice.value));
3260
3261           for (const language of languages) {
3262             if (language.parsers) {
3263               for (const value of language.parsers) {
3264                 if (!existingValues.has(value)) {
3265                   existingValues.add(value);
3266                   const plugin = plugins.find(plugin => plugin.parsers && plugin.parsers[value]);
3267                   let description = language.name;
3268
3269                   if (plugin && plugin.name) {
3270                     description += " (plugin: ".concat(plugin.name, ")");
3271                   }
3272
3273                   option.choices.push({
3274                     value,
3275                     description
3276                   });
3277                 }
3278               }
3279             }
3280           }
3281         }
3282
3283         var support = {
3284           getSupportInfo: getSupportInfo$1
3285         };
3286
3287         const stringWidth = stringWidth$2.exports;
3288         const escapeStringRegexp = escapeStringRegexp$1;
3289         const getLast$2 = getLast_1;
3290         const {
3291           getSupportInfo
3292         } = support;
3293         const notAsciiRegex = /[^\x20-\x7F]/;
3294
3295         const getPenultimate = arr => arr[arr.length - 2];
3296         /**
3297          * @typedef {{backwards?: boolean}} SkipOptions
3298          */
3299
3300         /**
3301          * @param {string | RegExp} chars
3302          * @returns {(text: string, index: number | false, opts?: SkipOptions) => number | false}
3303          */
3304
3305
3306         function skip(chars) {
3307           return (text, index, opts) => {
3308             const backwards = opts && opts.backwards; // Allow `skip` functions to be threaded together without having
3309             // to check for failures (did someone say monads?).
3310
3311             /* istanbul ignore next */
3312
3313             if (index === false) {
3314               return false;
3315             }
3316
3317             const {
3318               length
3319             } = text;
3320             let cursor = index;
3321
3322             while (cursor >= 0 && cursor < length) {
3323               const c = text.charAt(cursor);
3324
3325               if (chars instanceof RegExp) {
3326                 if (!chars.test(c)) {
3327                   return cursor;
3328                 }
3329               } else if (!chars.includes(c)) {
3330                 return cursor;
3331               }
3332
3333               backwards ? cursor-- : cursor++;
3334             }
3335
3336             if (cursor === -1 || cursor === length) {
3337               // If we reached the beginning or end of the file, return the
3338               // out-of-bounds cursor. It's up to the caller to handle this
3339               // correctly. We don't want to indicate `false` though if it
3340               // actually skipped valid characters.
3341               return cursor;
3342             }
3343
3344             return false;
3345           };
3346         }
3347         /**
3348          * @type {(text: string, index: number | false, opts?: SkipOptions) => number | false}
3349          */
3350
3351
3352         const skipWhitespace = skip(/\s/);
3353         /**
3354          * @type {(text: string, index: number | false, opts?: SkipOptions) => number | false}
3355          */
3356
3357         const skipSpaces = skip(" \t");
3358         /**
3359          * @type {(text: string, index: number | false, opts?: SkipOptions) => number | false}
3360          */
3361
3362         const skipToLineEnd = skip(",; \t");
3363         /**
3364          * @type {(text: string, index: number | false, opts?: SkipOptions) => number | false}
3365          */
3366
3367         const skipEverythingButNewLine = skip(/[^\n\r]/);
3368         /**
3369          * @param {string} text
3370          * @param {number | false} index
3371          * @returns {number | false}
3372          */
3373
3374         function skipInlineComment(text, index) {
3375           /* istanbul ignore next */
3376           if (index === false) {
3377             return false;
3378           }
3379
3380           if (text.charAt(index) === "/" && text.charAt(index + 1) === "*") {
3381             for (let i = index + 2; i < text.length; ++i) {
3382               if (text.charAt(i) === "*" && text.charAt(i + 1) === "/") {
3383                 return i + 2;
3384               }
3385             }
3386           }
3387
3388           return index;
3389         }
3390         /**
3391          * @param {string} text
3392          * @param {number | false} index
3393          * @returns {number | false}
3394          */
3395
3396
3397         function skipTrailingComment(text, index) {
3398           /* istanbul ignore next */
3399           if (index === false) {
3400             return false;
3401           }
3402
3403           if (text.charAt(index) === "/" && text.charAt(index + 1) === "/") {
3404             return skipEverythingButNewLine(text, index);
3405           }
3406
3407           return index;
3408         } // This one doesn't use the above helper function because it wants to
3409         // test \r\n in order and `skip` doesn't support ordering and we only
3410         // want to skip one newline. It's simple to implement.
3411
3412         /**
3413          * @param {string} text
3414          * @param {number | false} index
3415          * @param {SkipOptions=} opts
3416          * @returns {number | false}
3417          */
3418
3419
3420         function skipNewline(text, index, opts) {
3421           const backwards = opts && opts.backwards;
3422
3423           if (index === false) {
3424             return false;
3425           }
3426
3427           const atIndex = text.charAt(index);
3428
3429           if (backwards) {
3430             // We already replace `\r\n` with `\n` before parsing
3431
3432             /* istanbul ignore next */
3433             if (text.charAt(index - 1) === "\r" && atIndex === "\n") {
3434               return index - 2;
3435             }
3436
3437             if (atIndex === "\n" || atIndex === "\r" || atIndex === "\u2028" || atIndex === "\u2029") {
3438               return index - 1;
3439             }
3440           } else {
3441             // We already replace `\r\n` with `\n` before parsing
3442
3443             /* istanbul ignore next */
3444             if (atIndex === "\r" && text.charAt(index + 1) === "\n") {
3445               return index + 2;
3446             }
3447
3448             if (atIndex === "\n" || atIndex === "\r" || atIndex === "\u2028" || atIndex === "\u2029") {
3449               return index + 1;
3450             }
3451           }
3452
3453           return index;
3454         }
3455         /**
3456          * @param {string} text
3457          * @param {number} index
3458          * @param {SkipOptions=} opts
3459          * @returns {boolean}
3460          */
3461
3462
3463         function hasNewline(text, index) {
3464           let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3465           const idx = skipSpaces(text, opts.backwards ? index - 1 : index, opts);
3466           const idx2 = skipNewline(text, idx, opts);
3467           return idx !== idx2;
3468         }
3469         /**
3470          * @param {string} text
3471          * @param {number} start
3472          * @param {number} end
3473          * @returns {boolean}
3474          */
3475
3476
3477         function hasNewlineInRange(text, start, end) {
3478           for (let i = start; i < end; ++i) {
3479             if (text.charAt(i) === "\n") {
3480               return true;
3481             }
3482           }
3483
3484           return false;
3485         } // Note: this function doesn't ignore leading comments unlike isNextLineEmpty
3486
3487         /**
3488          * @template N
3489          * @param {string} text
3490          * @param {N} node
3491          * @param {(node: N) => number} locStart
3492          */
3493
3494
3495         function isPreviousLineEmpty(text, node, locStart) {
3496           /** @type {number | false} */
3497           let idx = locStart(node) - 1;
3498           idx = skipSpaces(text, idx, {
3499             backwards: true
3500           });
3501           idx = skipNewline(text, idx, {
3502             backwards: true
3503           });
3504           idx = skipSpaces(text, idx, {
3505             backwards: true
3506           });
3507           const idx2 = skipNewline(text, idx, {
3508             backwards: true
3509           });
3510           return idx !== idx2;
3511         }
3512         /**
3513          * @param {string} text
3514          * @param {number} index
3515          * @returns {boolean}
3516          */
3517
3518
3519         function isNextLineEmptyAfterIndex(text, index) {
3520           /** @type {number | false} */
3521           let oldIdx = null;
3522           /** @type {number | false} */
3523
3524           let idx = index;
3525
3526           while (idx !== oldIdx) {
3527             // We need to skip all the potential trailing inline comments
3528             oldIdx = idx;
3529             idx = skipToLineEnd(text, idx);
3530             idx = skipInlineComment(text, idx);
3531             idx = skipSpaces(text, idx);
3532           }
3533
3534           idx = skipTrailingComment(text, idx);
3535           idx = skipNewline(text, idx);
3536           return idx !== false && hasNewline(text, idx);
3537         }
3538         /**
3539          * @template N
3540          * @param {string} text
3541          * @param {N} node
3542          * @param {(node: N) => number} locEnd
3543          * @returns {boolean}
3544          */
3545
3546
3547         function isNextLineEmpty(text, node, locEnd) {
3548           return isNextLineEmptyAfterIndex(text, locEnd(node));
3549         }
3550         /**
3551          * @param {string} text
3552          * @param {number} idx
3553          * @returns {number | false}
3554          */
3555
3556
3557         function getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, idx) {
3558           /** @type {number | false} */
3559           let oldIdx = null;
3560           /** @type {number | false} */
3561
3562           let nextIdx = idx;
3563
3564           while (nextIdx !== oldIdx) {
3565             oldIdx = nextIdx;
3566             nextIdx = skipSpaces(text, nextIdx);
3567             nextIdx = skipInlineComment(text, nextIdx);
3568             nextIdx = skipTrailingComment(text, nextIdx);
3569             nextIdx = skipNewline(text, nextIdx);
3570           }
3571
3572           return nextIdx;
3573         }
3574         /**
3575          * @template N
3576          * @param {string} text
3577          * @param {N} node
3578          * @param {(node: N) => number} locEnd
3579          * @returns {number | false}
3580          */
3581
3582
3583         function getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd) {
3584           return getNextNonSpaceNonCommentCharacterIndexWithStartIndex(text, locEnd(node));
3585         }
3586         /**
3587          * @template N
3588          * @param {string} text
3589          * @param {N} node
3590          * @param {(node: N) => number} locEnd
3591          * @returns {string}
3592          */
3593
3594
3595         function getNextNonSpaceNonCommentCharacter(text, node, locEnd) {
3596           return text.charAt( // @ts-expect-error => TBD: can return false, should we define a fallback?
3597           getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd));
3598         } // Not using, but it's public utils
3599
3600         /* istanbul ignore next */
3601
3602         /**
3603          * @param {string} text
3604          * @param {number} index
3605          * @param {SkipOptions=} opts
3606          * @returns {boolean}
3607          */
3608
3609
3610         function hasSpaces(text, index) {
3611           let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3612           const idx = skipSpaces(text, opts.backwards ? index - 1 : index, opts);
3613           return idx !== index;
3614         }
3615         /**
3616          * @param {string} value
3617          * @param {number} tabWidth
3618          * @param {number=} startIndex
3619          * @returns {number}
3620          */
3621
3622
3623         function getAlignmentSize(value, tabWidth) {
3624           let startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
3625           let size = 0;
3626
3627           for (let i = startIndex; i < value.length; ++i) {
3628             if (value[i] === "\t") {
3629               // Tabs behave in a way that they are aligned to the nearest
3630               // multiple of tabWidth:
3631               // 0 -> 4, 1 -> 4, 2 -> 4, 3 -> 4
3632               // 4 -> 8, 5 -> 8, 6 -> 8, 7 -> 8 ...
3633               size = size + tabWidth - size % tabWidth;
3634             } else {
3635               size++;
3636             }
3637           }
3638
3639           return size;
3640         }
3641         /**
3642          * @param {string} value
3643          * @param {number} tabWidth
3644          * @returns {number}
3645          */
3646
3647
3648         function getIndentSize(value, tabWidth) {
3649           const lastNewlineIndex = value.lastIndexOf("\n");
3650
3651           if (lastNewlineIndex === -1) {
3652             return 0;
3653           }
3654
3655           return getAlignmentSize( // All the leading whitespaces
3656           value.slice(lastNewlineIndex + 1).match(/^[\t ]*/)[0], tabWidth);
3657         }
3658         /**
3659          * @typedef {'"' | "'"} Quote
3660          */
3661
3662         /**
3663          *
3664          * @param {string} rawContent
3665          * @param {Quote} preferredQuote
3666          * @returns {{ quote: Quote, regex: RegExp, escaped: string }}
3667          */
3668
3669
3670         function getPreferredQuote(rawContent, preferredQuote) {
3671           /** @type {{ quote: '"', regex: RegExp, escaped: "&quot;" }} */
3672           const double = {
3673             quote: '"',
3674             regex: /"/g,
3675             escaped: "&quot;"
3676           };
3677           /** @type {{ quote: "'", regex: RegExp, escaped: "&apos;" }} */
3678
3679           const single = {
3680             quote: "'",
3681             regex: /'/g,
3682             escaped: "&apos;"
3683           };
3684           const preferred = preferredQuote === "'" ? single : double;
3685           const alternate = preferred === single ? double : single;
3686           let result = preferred; // If `rawContent` contains at least one of the quote preferred for enclosing
3687           // the string, we might want to enclose with the alternate quote instead, to
3688           // minimize the number of escaped quotes.
3689
3690           if (rawContent.includes(preferred.quote) || rawContent.includes(alternate.quote)) {
3691             const numPreferredQuotes = (rawContent.match(preferred.regex) || []).length;
3692             const numAlternateQuotes = (rawContent.match(alternate.regex) || []).length;
3693             result = numPreferredQuotes > numAlternateQuotes ? alternate : preferred;
3694           }
3695
3696           return result;
3697         }
3698
3699         function printString(raw, options) {
3700           // `rawContent` is the string exactly like it appeared in the input source
3701           // code, without its enclosing quotes.
3702           const rawContent = raw.slice(1, -1);
3703           /** @type {Quote} */
3704
3705           const enclosingQuote = options.parser === "json" || options.parser === "json5" && options.quoteProps === "preserve" && !options.singleQuote ? '"' : options.__isInHtmlAttribute ? "'" : getPreferredQuote(rawContent, options.singleQuote ? "'" : '"').quote; // It might sound unnecessary to use `makeString` even if the string already
3706           // is enclosed with `enclosingQuote`, but it isn't. The string could contain
3707           // unnecessary escapes (such as in `"\'"`). Always using `makeString` makes
3708           // sure that we consistently output the minimum amount of escaped quotes.
3709
3710           return makeString(rawContent, enclosingQuote, !(options.parser === "css" || options.parser === "less" || options.parser === "scss" || options.__embeddedInHtml));
3711         }
3712         /**
3713          * @param {string} rawContent
3714          * @param {Quote} enclosingQuote
3715          * @param {boolean=} unescapeUnnecessaryEscapes
3716          * @returns {string}
3717          */
3718
3719
3720         function makeString(rawContent, enclosingQuote, unescapeUnnecessaryEscapes) {
3721           const otherQuote = enclosingQuote === '"' ? "'" : '"'; // Matches _any_ escape and unescaped quotes (both single and double).
3722
3723           const regex = /\\(.)|(["'])/gs; // Escape and unescape single and double quotes as needed to be able to
3724           // enclose `rawContent` with `enclosingQuote`.
3725
3726           const newContent = rawContent.replace(regex, (match, escaped, quote) => {
3727             // If we matched an escape, and the escaped character is a quote of the
3728             // other type than we intend to enclose the string with, there's no need for
3729             // it to be escaped, so return it _without_ the backslash.
3730             if (escaped === otherQuote) {
3731               return escaped;
3732             } // If we matched an unescaped quote and it is of the _same_ type as we
3733             // intend to enclose the string with, it must be escaped, so return it with
3734             // a backslash.
3735
3736
3737             if (quote === enclosingQuote) {
3738               return "\\" + quote;
3739             }
3740
3741             if (quote) {
3742               return quote;
3743             } // Unescape any unnecessarily escaped character.
3744             // Adapted from https://github.com/eslint/eslint/blob/de0b4ad7bd820ade41b1f606008bea68683dc11a/lib/rules/no-useless-escape.js#L27
3745
3746
3747             return unescapeUnnecessaryEscapes && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(escaped) ? escaped : "\\" + escaped;
3748           });
3749           return enclosingQuote + newContent + enclosingQuote;
3750         }
3751
3752         function printNumber(rawNumber) {
3753           return rawNumber.toLowerCase() // Remove unnecessary plus and zeroes from scientific notation.
3754           .replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(\d)/, "$1$2$3") // Remove unnecessary scientific notation (1e0).
3755           .replace(/^([+-]?[\d.]+)e[+-]?0+$/, "$1") // Make sure numbers always start with a digit.
3756           .replace(/^([+-])?\./, "$10.") // Remove extraneous trailing decimal zeroes.
3757           .replace(/(\.\d+?)0+(?=e|$)/, "$1") // Remove trailing dot.
3758           .replace(/\.(?=e|$)/, "");
3759         }
3760         /**
3761          * @param {string} str
3762          * @param {string} target
3763          * @returns {number}
3764          */
3765
3766
3767         function getMaxContinuousCount(str, target) {
3768           const results = str.match(new RegExp("(".concat(escapeStringRegexp(target), ")+"), "g"));
3769
3770           if (results === null) {
3771             return 0;
3772           }
3773
3774           return results.reduce((maxCount, result) => Math.max(maxCount, result.length / target.length), 0);
3775         }
3776
3777         function getMinNotPresentContinuousCount(str, target) {
3778           const matches = str.match(new RegExp("(".concat(escapeStringRegexp(target), ")+"), "g"));
3779
3780           if (matches === null) {
3781             return 0;
3782           }
3783
3784           const countPresent = new Map();
3785           let max = 0;
3786
3787           for (const match of matches) {
3788             const count = match.length / target.length;
3789             countPresent.set(count, true);
3790
3791             if (count > max) {
3792               max = count;
3793             }
3794           }
3795
3796           for (let i = 1; i < max; i++) {
3797             if (!countPresent.get(i)) {
3798               return i;
3799             }
3800           }
3801
3802           return max + 1;
3803         }
3804         /**
3805          * @param {string} text
3806          * @returns {number}
3807          */
3808
3809
3810         function getStringWidth$1(text) {
3811           if (!text) {
3812             return 0;
3813           } // shortcut to avoid needless string `RegExp`s, replacements, and allocations within `string-width`
3814
3815
3816           if (!notAsciiRegex.test(text)) {
3817             return text.length;
3818           }
3819
3820           return stringWidth(text);
3821         }
3822
3823         function addCommentHelper(node, comment) {
3824           const comments = node.comments || (node.comments = []);
3825           comments.push(comment);
3826           comment.printed = false;
3827           comment.nodeDescription = describeNodeForDebugging(node);
3828         }
3829
3830         function addLeadingComment(node, comment) {
3831           comment.leading = true;
3832           comment.trailing = false;
3833           addCommentHelper(node, comment);
3834         }
3835
3836         function addDanglingComment(node, comment, marker) {
3837           comment.leading = false;
3838           comment.trailing = false;
3839
3840           if (marker) {
3841             comment.marker = marker;
3842           }
3843
3844           addCommentHelper(node, comment);
3845         }
3846
3847         function addTrailingComment(node, comment) {
3848           comment.leading = false;
3849           comment.trailing = true;
3850           addCommentHelper(node, comment);
3851         }
3852
3853         function inferParserByLanguage(language, options) {
3854           const {
3855             languages
3856           } = getSupportInfo({
3857             plugins: options.plugins
3858           });
3859           const matched = languages.find(_ref => {
3860             let {
3861               name
3862             } = _ref;
3863             return name.toLowerCase() === language;
3864           }) || languages.find(_ref2 => {
3865             let {
3866               aliases
3867             } = _ref2;
3868             return Array.isArray(aliases) && aliases.includes(language);
3869           }) || languages.find(_ref3 => {
3870             let {
3871               extensions
3872             } = _ref3;
3873             return Array.isArray(extensions) && extensions.includes(".".concat(language));
3874           });
3875           return matched && matched.parsers[0];
3876         }
3877
3878         function isFrontMatterNode(node) {
3879           return node && node.type === "front-matter";
3880         }
3881
3882         function getShebang(text) {
3883           if (!text.startsWith("#!")) {
3884             return "";
3885           }
3886
3887           const index = text.indexOf("\n");
3888
3889           if (index === -1) {
3890             return text;
3891           }
3892
3893           return text.slice(0, index);
3894         }
3895         /**
3896          * @param {any} object
3897          * @returns {object is Array<any>}
3898          */
3899
3900
3901         function isNonEmptyArray(object) {
3902           return Array.isArray(object) && object.length > 0;
3903         }
3904         /**
3905          * @param {string} description
3906          * @returns {(node: any) => symbol}
3907          */
3908
3909
3910         function createGroupIdMapper(description) {
3911           const groupIds = new WeakMap();
3912           return function (node) {
3913             if (!groupIds.has(node)) {
3914               groupIds.set(node, Symbol(description));
3915             }
3916
3917             return groupIds.get(node);
3918           };
3919         }
3920
3921         function describeNodeForDebugging(node) {
3922           const nodeType = node.type || node.kind || "(unknown type)";
3923           let nodeName = String(node.name || node.id && (typeof node.id === "object" ? node.id.name : node.id) || node.key && (typeof node.key === "object" ? node.key.name : node.key) || node.value && (typeof node.value === "object" ? "" : String(node.value)) || node.operator || "");
3924
3925           if (nodeName.length > 20) {
3926             nodeName = nodeName.slice(0, 19) + "…";
3927           }
3928
3929           return nodeType + (nodeName ? " " + nodeName : "");
3930         }
3931
3932         var util = {
3933           inferParserByLanguage,
3934           getStringWidth: getStringWidth$1,
3935           getMaxContinuousCount,
3936           getMinNotPresentContinuousCount,
3937           getPenultimate,
3938           getLast: getLast$2,
3939           getNextNonSpaceNonCommentCharacterIndexWithStartIndex,
3940           getNextNonSpaceNonCommentCharacterIndex,
3941           getNextNonSpaceNonCommentCharacter,
3942           skip,
3943           skipWhitespace,
3944           skipSpaces,
3945           skipToLineEnd,
3946           skipEverythingButNewLine,
3947           skipInlineComment,
3948           skipTrailingComment,
3949           skipNewline,
3950           isNextLineEmptyAfterIndex,
3951           isNextLineEmpty,
3952           isPreviousLineEmpty,
3953           hasNewline,
3954           hasNewlineInRange,
3955           hasSpaces,
3956           getAlignmentSize,
3957           getIndentSize,
3958           getPreferredQuote,
3959           printString,
3960           printNumber,
3961           makeString,
3962           addLeadingComment,
3963           addDanglingComment,
3964           addTrailingComment,
3965           isFrontMatterNode,
3966           getShebang,
3967           isNonEmptyArray,
3968           createGroupIdMapper
3969         };
3970
3971         function guessEndOfLine(text) {
3972           const index = text.indexOf("\r");
3973
3974           if (index >= 0) {
3975             return text.charAt(index + 1) === "\n" ? "crlf" : "cr";
3976           }
3977
3978           return "lf";
3979         }
3980
3981         function convertEndOfLineToChars$1(value) {
3982           switch (value) {
3983             case "cr":
3984               return "\r";
3985
3986             case "crlf":
3987               return "\r\n";
3988
3989             default:
3990               return "\n";
3991           }
3992         }
3993
3994         function countEndOfLineChars(text, eol) {
3995           let regex;
3996           /* istanbul ignore else */
3997
3998           if (eol === "\n") {
3999             regex = /\n/g;
4000           } else if (eol === "\r") {
4001             regex = /\r/g;
4002           } else if (eol === "\r\n") {
4003             regex = /\r\n/g;
4004           } else {
4005             throw new Error("Unexpected \"eol\" ".concat(JSON.stringify(eol), "."));
4006           }
4007
4008           const endOfLines = text.match(regex);
4009           return endOfLines ? endOfLines.length : 0;
4010         }
4011
4012         function normalizeEndOfLine(text) {
4013           return text.replace(/\r\n?/g, "\n");
4014         }
4015
4016         var endOfLine = {
4017           guessEndOfLine,
4018           convertEndOfLineToChars: convertEndOfLineToChars$1,
4019           countEndOfLineChars,
4020           normalizeEndOfLine
4021         };
4022
4023         const getLast$1 = getLast_1;
4024         const {
4025           literalline,
4026           join
4027         } = docBuilders;
4028
4029         const isConcat$2 = doc => Array.isArray(doc) || doc && doc.type === "concat";
4030
4031         const getDocParts$2 = doc => {
4032           if (Array.isArray(doc)) {
4033             return doc;
4034           }
4035           /* istanbul ignore next */
4036
4037
4038           if (doc.type !== "concat" && doc.type !== "fill") {
4039             throw new Error("Expect doc type to be `concat` or `fill`.");
4040           }
4041
4042           return doc.parts;
4043         }; // Using a unique object to compare by reference.
4044
4045
4046         const traverseDocOnExitStackMarker = {};
4047
4048         function traverseDoc(doc, onEnter, onExit, shouldTraverseConditionalGroups) {
4049           const docsStack = [doc];
4050
4051           while (docsStack.length > 0) {
4052             const doc = docsStack.pop();
4053
4054             if (doc === traverseDocOnExitStackMarker) {
4055               onExit(docsStack.pop());
4056               continue;
4057             }
4058
4059             if (onExit) {
4060               docsStack.push(doc, traverseDocOnExitStackMarker);
4061             }
4062
4063             if ( // Should Recurse
4064             !onEnter || onEnter(doc) !== false) {
4065               // When there are multiple parts to process,
4066               // the parts need to be pushed onto the stack in reverse order,
4067               // so that they are processed in the original order
4068               // when the stack is popped.
4069               if (isConcat$2(doc) || doc.type === "fill") {
4070                 const parts = getDocParts$2(doc);
4071
4072                 for (let ic = parts.length, i = ic - 1; i >= 0; --i) {
4073                   docsStack.push(parts[i]);
4074                 }
4075               } else if (doc.type === "if-break") {
4076                 if (doc.flatContents) {
4077                   docsStack.push(doc.flatContents);
4078                 }
4079
4080                 if (doc.breakContents) {
4081                   docsStack.push(doc.breakContents);
4082                 }
4083               } else if (doc.type === "group" && doc.expandedStates) {
4084                 if (shouldTraverseConditionalGroups) {
4085                   for (let ic = doc.expandedStates.length, i = ic - 1; i >= 0; --i) {
4086                     docsStack.push(doc.expandedStates[i]);
4087                   }
4088                 } else {
4089                   docsStack.push(doc.contents);
4090                 }
4091               } else if (doc.contents) {
4092                 docsStack.push(doc.contents);
4093               }
4094             }
4095           }
4096         }
4097
4098         function mapDoc(doc, cb) {
4099           // Within a doc tree, the same subtrees can be found multiple times.
4100           // E.g., often this happens in conditional groups.
4101           // As an optimization (those subtrees can be huge) and to maintain the
4102           // reference structure of the tree, the mapping results are cached in
4103           // a map and reused.
4104           const mapped = new Map();
4105           return rec(doc);
4106
4107           function rec(doc) {
4108             if (mapped.has(doc)) {
4109               return mapped.get(doc);
4110             }
4111
4112             const result = process(doc);
4113             mapped.set(doc, result);
4114             return result;
4115           }
4116
4117           function process(doc) {
4118             if (Array.isArray(doc)) {
4119               return cb(doc.map(rec));
4120             }
4121
4122             if (doc.type === "concat" || doc.type === "fill") {
4123               const parts = doc.parts.map(rec);
4124               return cb(Object.assign(Object.assign({}, doc), {}, {
4125                 parts
4126               }));
4127             }
4128
4129             if (doc.type === "if-break") {
4130               const breakContents = doc.breakContents && rec(doc.breakContents);
4131               const flatContents = doc.flatContents && rec(doc.flatContents);
4132               return cb(Object.assign(Object.assign({}, doc), {}, {
4133                 breakContents,
4134                 flatContents
4135               }));
4136             }
4137
4138             if (doc.type === "group" && doc.expandedStates) {
4139               const expandedStates = doc.expandedStates.map(rec);
4140               const contents = expandedStates[0];
4141               return cb(Object.assign(Object.assign({}, doc), {}, {
4142                 contents,
4143                 expandedStates
4144               }));
4145             }
4146
4147             if (doc.contents) {
4148               const contents = rec(doc.contents);
4149               return cb(Object.assign(Object.assign({}, doc), {}, {
4150                 contents
4151               }));
4152             }
4153
4154             return cb(doc);
4155           }
4156         }
4157
4158         function findInDoc(doc, fn, defaultValue) {
4159           let result = defaultValue;
4160           let hasStopped = false;
4161
4162           function findInDocOnEnterFn(doc) {
4163             const maybeResult = fn(doc);
4164
4165             if (maybeResult !== undefined) {
4166               hasStopped = true;
4167               result = maybeResult;
4168             }
4169
4170             if (hasStopped) {
4171               return false;
4172             }
4173           }
4174
4175           traverseDoc(doc, findInDocOnEnterFn);
4176           return result;
4177         }
4178
4179         function willBreakFn(doc) {
4180           if (doc.type === "group" && doc.break) {
4181             return true;
4182           }
4183
4184           if (doc.type === "line" && doc.hard) {
4185             return true;
4186           }
4187
4188           if (doc.type === "break-parent") {
4189             return true;
4190           }
4191         }
4192
4193         function willBreak(doc) {
4194           return findInDoc(doc, willBreakFn, false);
4195         }
4196
4197         function breakParentGroup(groupStack) {
4198           if (groupStack.length > 0) {
4199             const parentGroup = getLast$1(groupStack); // Breaks are not propagated through conditional groups because
4200             // the user is expected to manually handle what breaks.
4201
4202             if (!parentGroup.expandedStates && !parentGroup.break) {
4203               // An alternative truthy value allows to distinguish propagated group breaks
4204               // and not to print them as `group(..., { break: true })` in `--debug-print-doc`.
4205               parentGroup.break = "propagated";
4206             }
4207           }
4208
4209           return null;
4210         }
4211
4212         function propagateBreaks(doc) {
4213           const alreadyVisitedSet = new Set();
4214           const groupStack = [];
4215
4216           function propagateBreaksOnEnterFn(doc) {
4217             if (doc.type === "break-parent") {
4218               breakParentGroup(groupStack);
4219             }
4220
4221             if (doc.type === "group") {
4222               groupStack.push(doc);
4223
4224               if (alreadyVisitedSet.has(doc)) {
4225                 return false;
4226               }
4227
4228               alreadyVisitedSet.add(doc);
4229             }
4230           }
4231
4232           function propagateBreaksOnExitFn(doc) {
4233             if (doc.type === "group") {
4234               const group = groupStack.pop();
4235
4236               if (group.break) {
4237                 breakParentGroup(groupStack);
4238               }
4239             }
4240           }
4241
4242           traverseDoc(doc, propagateBreaksOnEnterFn, propagateBreaksOnExitFn,
4243           /* shouldTraverseConditionalGroups */
4244           true);
4245         }
4246
4247         function removeLinesFn(doc) {
4248           // Force this doc into flat mode by statically converting all
4249           // lines into spaces (or soft lines into nothing). Hard lines
4250           // should still output because there's too great of a chance
4251           // of breaking existing assumptions otherwise.
4252           if (doc.type === "line" && !doc.hard) {
4253             return doc.soft ? "" : " ";
4254           }
4255
4256           if (doc.type === "if-break") {
4257             return doc.flatContents || "";
4258           }
4259
4260           return doc;
4261         }
4262
4263         function removeLines(doc) {
4264           return mapDoc(doc, removeLinesFn);
4265         }
4266
4267         const isHardline = (doc, nextDoc) => doc && doc.type === "line" && doc.hard && nextDoc && nextDoc.type === "break-parent";
4268
4269         function stripDocTrailingHardlineFromDoc(doc) {
4270           if (!doc) {
4271             return doc;
4272           }
4273
4274           if (isConcat$2(doc) || doc.type === "fill") {
4275             const parts = getDocParts$2(doc);
4276
4277             while (parts.length > 1 && isHardline(...parts.slice(-2))) {
4278               parts.length -= 2;
4279             }
4280
4281             if (parts.length > 0) {
4282               const lastPart = stripDocTrailingHardlineFromDoc(getLast$1(parts));
4283               parts[parts.length - 1] = lastPart;
4284             }
4285
4286             return Array.isArray(doc) ? parts : Object.assign(Object.assign({}, doc), {}, {
4287               parts
4288             });
4289           }
4290
4291           switch (doc.type) {
4292             case "align":
4293             case "indent":
4294             case "indent-if-break":
4295             case "group":
4296             case "line-suffix":
4297             case "label":
4298               {
4299                 const contents = stripDocTrailingHardlineFromDoc(doc.contents);
4300                 return Object.assign(Object.assign({}, doc), {}, {
4301                   contents
4302                 });
4303               }
4304
4305             case "if-break":
4306               {
4307                 const breakContents = stripDocTrailingHardlineFromDoc(doc.breakContents);
4308                 const flatContents = stripDocTrailingHardlineFromDoc(doc.flatContents);
4309                 return Object.assign(Object.assign({}, doc), {}, {
4310                   breakContents,
4311                   flatContents
4312                 });
4313               }
4314           }
4315
4316           return doc;
4317         }
4318
4319         function stripTrailingHardline(doc) {
4320           // HACK remove ending hardline, original PR: #1984
4321           return stripDocTrailingHardlineFromDoc(cleanDoc(doc));
4322         }
4323
4324         function cleanDocFn(doc) {
4325           switch (doc.type) {
4326             case "fill":
4327               if (doc.parts.every(part => part === "")) {
4328                 return "";
4329               }
4330
4331               break;
4332
4333             case "group":
4334               if (!doc.contents && !doc.id && !doc.break && !doc.expandedStates) {
4335                 return "";
4336               } // Remove nested only group
4337
4338
4339               if (doc.contents.type === "group" && doc.contents.id === doc.id && doc.contents.break === doc.break && doc.contents.expandedStates === doc.expandedStates) {
4340                 return doc.contents;
4341               }
4342
4343               break;
4344
4345             case "align":
4346             case "indent":
4347             case "indent-if-break":
4348             case "line-suffix":
4349               if (!doc.contents) {
4350                 return "";
4351               }
4352
4353               break;
4354
4355             case "if-break":
4356               if (!doc.flatContents && !doc.breakContents) {
4357                 return "";
4358               }
4359
4360               break;
4361           }
4362
4363           if (!isConcat$2(doc)) {
4364             return doc;
4365           }
4366
4367           const parts = [];
4368
4369           for (const part of getDocParts$2(doc)) {
4370             if (!part) {
4371               continue;
4372             }
4373
4374             const [currentPart, ...restParts] = isConcat$2(part) ? getDocParts$2(part) : [part];
4375
4376             if (typeof currentPart === "string" && typeof getLast$1(parts) === "string") {
4377               parts[parts.length - 1] += currentPart;
4378             } else {
4379               parts.push(currentPart);
4380             }
4381
4382             parts.push(...restParts);
4383           }
4384
4385           if (parts.length === 0) {
4386             return "";
4387           }
4388
4389           if (parts.length === 1) {
4390             return parts[0];
4391           }
4392
4393           return Array.isArray(doc) ? parts : Object.assign(Object.assign({}, doc), {}, {
4394             parts
4395           });
4396         } // A safer version of `normalizeDoc`
4397         // - `normalizeDoc` concat strings and flat "concat" in `fill`, while `cleanDoc` don't
4398         // - On `concat` object, `normalizeDoc` always return object with `parts`, `cleanDoc` may return strings
4399         // - `cleanDoc` also remove nested `group`s and empty `fill`/`align`/`indent`/`line-suffix`/`if-break` if possible
4400
4401
4402         function cleanDoc(doc) {
4403           return mapDoc(doc, currentDoc => cleanDocFn(currentDoc));
4404         }
4405
4406         function normalizeParts(parts) {
4407           const newParts = [];
4408           const restParts = parts.filter(Boolean);
4409
4410           while (restParts.length > 0) {
4411             const part = restParts.shift();
4412
4413             if (!part) {
4414               continue;
4415             }
4416
4417             if (isConcat$2(part)) {
4418               restParts.unshift(...getDocParts$2(part));
4419               continue;
4420             }
4421
4422             if (newParts.length > 0 && typeof getLast$1(newParts) === "string" && typeof part === "string") {
4423               newParts[newParts.length - 1] += part;
4424               continue;
4425             }
4426
4427             newParts.push(part);
4428           }
4429
4430           return newParts;
4431         }
4432
4433         function normalizeDoc(doc) {
4434           return mapDoc(doc, currentDoc => {
4435             if (Array.isArray(currentDoc)) {
4436               return normalizeParts(currentDoc);
4437             }
4438
4439             if (!currentDoc.parts) {
4440               return currentDoc;
4441             }
4442
4443             return Object.assign(Object.assign({}, currentDoc), {}, {
4444               parts: normalizeParts(currentDoc.parts)
4445             });
4446           });
4447         }
4448
4449         function replaceEndOfLine(doc) {
4450           return mapDoc(doc, currentDoc => typeof currentDoc === "string" && currentDoc.includes("\n") ? replaceTextEndOfLine(currentDoc) : currentDoc);
4451         } // This function need return array
4452         // TODO: remove `.parts` when we remove `docBuilders.concat()`
4453
4454
4455         function replaceTextEndOfLine(text) {
4456           let replacement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : literalline;
4457           return join(replacement, text.split("\n")).parts;
4458         }
4459
4460         function canBreakFn(doc) {
4461           if (doc.type === "line") {
4462             return true;
4463           }
4464         }
4465
4466         function canBreak(doc) {
4467           return findInDoc(doc, canBreakFn, false);
4468         }
4469
4470         var docUtils = {
4471           isConcat: isConcat$2,
4472           getDocParts: getDocParts$2,
4473           willBreak,
4474           traverseDoc,
4475           findInDoc,
4476           mapDoc,
4477           propagateBreaks,
4478           removeLines,
4479           stripTrailingHardline,
4480           normalizeParts,
4481           normalizeDoc,
4482           cleanDoc,
4483           replaceTextEndOfLine,
4484           replaceEndOfLine,
4485           canBreak
4486         };
4487
4488         const {
4489           getStringWidth,
4490           getLast
4491         } = util;
4492         const {
4493           convertEndOfLineToChars
4494         } = endOfLine;
4495         const {
4496           fill,
4497           cursor,
4498           indent
4499         } = docBuilders;
4500         const {
4501           isConcat: isConcat$1,
4502           getDocParts: getDocParts$1
4503         } = docUtils;
4504         /** @type {Record<symbol, typeof MODE_BREAK | typeof MODE_FLAT>} */
4505
4506         let groupModeMap;
4507         const MODE_BREAK = 1;
4508         const MODE_FLAT = 2;
4509
4510         function rootIndent() {
4511           return {
4512             value: "",
4513             length: 0,
4514             queue: []
4515           };
4516         }
4517
4518         function makeIndent(ind, options) {
4519           return generateInd(ind, {
4520             type: "indent"
4521           }, options);
4522         }
4523
4524         function makeAlign(indent, widthOrDoc, options) {
4525           if (widthOrDoc === Number.NEGATIVE_INFINITY) {
4526             return indent.root || rootIndent();
4527           }
4528
4529           if (widthOrDoc < 0) {
4530             return generateInd(indent, {
4531               type: "dedent"
4532             }, options);
4533           }
4534
4535           if (!widthOrDoc) {
4536             return indent;
4537           }
4538
4539           if (widthOrDoc.type === "root") {
4540             return Object.assign(Object.assign({}, indent), {}, {
4541               root: indent
4542             });
4543           }
4544
4545           const alignType = typeof widthOrDoc === "string" ? "stringAlign" : "numberAlign";
4546           return generateInd(indent, {
4547             type: alignType,
4548             n: widthOrDoc
4549           }, options);
4550         }
4551
4552         function generateInd(ind, newPart, options) {
4553           const queue = newPart.type === "dedent" ? ind.queue.slice(0, -1) : [...ind.queue, newPart];
4554           let value = "";
4555           let length = 0;
4556           let lastTabs = 0;
4557           let lastSpaces = 0;
4558
4559           for (const part of queue) {
4560             switch (part.type) {
4561               case "indent":
4562                 flush();
4563
4564                 if (options.useTabs) {
4565                   addTabs(1);
4566                 } else {
4567                   addSpaces(options.tabWidth);
4568                 }
4569
4570                 break;
4571
4572               case "stringAlign":
4573                 flush();
4574                 value += part.n;
4575                 length += part.n.length;
4576                 break;
4577
4578               case "numberAlign":
4579                 lastTabs += 1;
4580                 lastSpaces += part.n;
4581                 break;
4582
4583               /* istanbul ignore next */
4584
4585               default:
4586                 throw new Error("Unexpected type '".concat(part.type, "'"));
4587             }
4588           }
4589
4590           flushSpaces();
4591           return Object.assign(Object.assign({}, ind), {}, {
4592             value,
4593             length,
4594             queue
4595           });
4596
4597           function addTabs(count) {
4598             value += "\t".repeat(count);
4599             length += options.tabWidth * count;
4600           }
4601
4602           function addSpaces(count) {
4603             value += " ".repeat(count);
4604             length += count;
4605           }
4606
4607           function flush() {
4608             if (options.useTabs) {
4609               flushTabs();
4610             } else {
4611               flushSpaces();
4612             }
4613           }
4614
4615           function flushTabs() {
4616             if (lastTabs > 0) {
4617               addTabs(lastTabs);
4618             }
4619
4620             resetLast();
4621           }
4622
4623           function flushSpaces() {
4624             if (lastSpaces > 0) {
4625               addSpaces(lastSpaces);
4626             }
4627
4628             resetLast();
4629           }
4630
4631           function resetLast() {
4632             lastTabs = 0;
4633             lastSpaces = 0;
4634           }
4635         }
4636
4637         function trim(out) {
4638           if (out.length === 0) {
4639             return 0;
4640           }
4641
4642           let trimCount = 0; // Trim whitespace at the end of line
4643
4644           while (out.length > 0 && typeof getLast(out) === "string" && /^[\t ]*$/.test(getLast(out))) {
4645             trimCount += out.pop().length;
4646           }
4647
4648           if (out.length > 0 && typeof getLast(out) === "string") {
4649             const trimmed = getLast(out).replace(/[\t ]*$/, "");
4650             trimCount += getLast(out).length - trimmed.length;
4651             out[out.length - 1] = trimmed;
4652           }
4653
4654           return trimCount;
4655         }
4656
4657         function fits(next, restCommands, width, options, hasLineSuffix, mustBeFlat) {
4658           let restIdx = restCommands.length;
4659           const cmds = [next]; // `out` is only used for width counting because `trim` requires to look
4660           // backwards for space characters.
4661
4662           const out = [];
4663
4664           while (width >= 0) {
4665             if (cmds.length === 0) {
4666               if (restIdx === 0) {
4667                 return true;
4668               }
4669
4670               cmds.push(restCommands[restIdx - 1]);
4671               restIdx--;
4672               continue;
4673             }
4674
4675             const [ind, mode, doc] = cmds.pop();
4676
4677             if (typeof doc === "string") {
4678               out.push(doc);
4679               width -= getStringWidth(doc);
4680             } else if (isConcat$1(doc)) {
4681               const parts = getDocParts$1(doc);
4682
4683               for (let i = parts.length - 1; i >= 0; i--) {
4684                 cmds.push([ind, mode, parts[i]]);
4685               }
4686             } else {
4687               switch (doc.type) {
4688                 case "indent":
4689                   cmds.push([makeIndent(ind, options), mode, doc.contents]);
4690                   break;
4691
4692                 case "align":
4693                   cmds.push([makeAlign(ind, doc.n, options), mode, doc.contents]);
4694                   break;
4695
4696                 case "trim":
4697                   width += trim(out);
4698                   break;
4699
4700                 case "group":
4701                   {
4702                     if (mustBeFlat && doc.break) {
4703                       return false;
4704                     }
4705
4706                     const groupMode = doc.break ? MODE_BREAK : mode;
4707                     cmds.push([ind, groupMode, // The most expanded state takes up the least space on the current line.
4708                     doc.expandedStates && groupMode === MODE_BREAK ? getLast(doc.expandedStates) : doc.contents]);
4709
4710                     if (doc.id) {
4711                       groupModeMap[doc.id] = groupMode;
4712                     }
4713
4714                     break;
4715                   }
4716
4717                 case "fill":
4718                   for (let i = doc.parts.length - 1; i >= 0; i--) {
4719                     cmds.push([ind, mode, doc.parts[i]]);
4720                   }
4721
4722                   break;
4723
4724                 case "if-break":
4725                 case "indent-if-break":
4726                   {
4727                     const groupMode = doc.groupId ? groupModeMap[doc.groupId] : mode;
4728
4729                     if (groupMode === MODE_BREAK) {
4730                       const breakContents = doc.type === "if-break" ? doc.breakContents : doc.negate ? doc.contents : indent(doc.contents);
4731
4732                       if (breakContents) {
4733                         cmds.push([ind, mode, breakContents]);
4734                       }
4735                     }
4736
4737                     if (groupMode === MODE_FLAT) {
4738                       const flatContents = doc.type === "if-break" ? doc.flatContents : doc.negate ? indent(doc.contents) : doc.contents;
4739
4740                       if (flatContents) {
4741                         cmds.push([ind, mode, flatContents]);
4742                       }
4743                     }
4744
4745                     break;
4746                   }
4747
4748                 case "line":
4749                   switch (mode) {
4750                     // fallthrough
4751                     case MODE_FLAT:
4752                       if (!doc.hard) {
4753                         if (!doc.soft) {
4754                           out.push(" ");
4755                           width -= 1;
4756                         }
4757
4758                         break;
4759                       }
4760
4761                       return true;
4762
4763                     case MODE_BREAK:
4764                       return true;
4765                   }
4766
4767                   break;
4768
4769                 case "line-suffix":
4770                   hasLineSuffix = true;
4771                   break;
4772
4773                 case "line-suffix-boundary":
4774                   if (hasLineSuffix) {
4775                     return false;
4776                   }
4777
4778                   break;
4779
4780                 case "label":
4781                   cmds.push([ind, mode, doc.contents]);
4782                   break;
4783               }
4784             }
4785           }
4786
4787           return false;
4788         }
4789
4790         function printDocToString(doc, options) {
4791           groupModeMap = {};
4792           const width = options.printWidth;
4793           const newLine = convertEndOfLineToChars(options.endOfLine);
4794           let pos = 0; // cmds is basically a stack. We've turned a recursive call into a
4795           // while loop which is much faster. The while loop below adds new
4796           // cmds to the array instead of recursively calling `print`.
4797
4798           const cmds = [[rootIndent(), MODE_BREAK, doc]];
4799           const out = [];
4800           let shouldRemeasure = false;
4801           let lineSuffix = [];
4802
4803           while (cmds.length > 0) {
4804             const [ind, mode, doc] = cmds.pop();
4805
4806             if (typeof doc === "string") {
4807               const formatted = newLine !== "\n" ? doc.replace(/\n/g, newLine) : doc;
4808               out.push(formatted);
4809               pos += getStringWidth(formatted);
4810             } else if (isConcat$1(doc)) {
4811               const parts = getDocParts$1(doc);
4812
4813               for (let i = parts.length - 1; i >= 0; i--) {
4814                 cmds.push([ind, mode, parts[i]]);
4815               }
4816             } else {
4817               switch (doc.type) {
4818                 case "cursor":
4819                   out.push(cursor.placeholder);
4820                   break;
4821
4822                 case "indent":
4823                   cmds.push([makeIndent(ind, options), mode, doc.contents]);
4824                   break;
4825
4826                 case "align":
4827                   cmds.push([makeAlign(ind, doc.n, options), mode, doc.contents]);
4828                   break;
4829
4830                 case "trim":
4831                   pos -= trim(out);
4832                   break;
4833
4834                 case "group":
4835                   switch (mode) {
4836                     case MODE_FLAT:
4837                       if (!shouldRemeasure) {
4838                         cmds.push([ind, doc.break ? MODE_BREAK : MODE_FLAT, doc.contents]);
4839                         break;
4840                       }
4841
4842                     // fallthrough
4843
4844                     case MODE_BREAK:
4845                       {
4846                         shouldRemeasure = false;
4847                         const next = [ind, MODE_FLAT, doc.contents];
4848                         const rem = width - pos;
4849                         const hasLineSuffix = lineSuffix.length > 0;
4850
4851                         if (!doc.break && fits(next, cmds, rem, options, hasLineSuffix)) {
4852                           cmds.push(next);
4853                         } else {
4854                           // Expanded states are a rare case where a document
4855                           // can manually provide multiple representations of
4856                           // itself. It provides an array of documents
4857                           // going from the least expanded (most flattened)
4858                           // representation first to the most expanded. If a
4859                           // group has these, we need to manually go through
4860                           // these states and find the first one that fits.
4861                           if (doc.expandedStates) {
4862                             const mostExpanded = getLast(doc.expandedStates);
4863
4864                             if (doc.break) {
4865                               cmds.push([ind, MODE_BREAK, mostExpanded]);
4866                               break;
4867                             } else {
4868                               for (let i = 1; i < doc.expandedStates.length + 1; i++) {
4869                                 if (i >= doc.expandedStates.length) {
4870                                   cmds.push([ind, MODE_BREAK, mostExpanded]);
4871                                   break;
4872                                 } else {
4873                                   const state = doc.expandedStates[i];
4874                                   const cmd = [ind, MODE_FLAT, state];
4875
4876                                   if (fits(cmd, cmds, rem, options, hasLineSuffix)) {
4877                                     cmds.push(cmd);
4878                                     break;
4879                                   }
4880                                 }
4881                               }
4882                             }
4883                           } else {
4884                             cmds.push([ind, MODE_BREAK, doc.contents]);
4885                           }
4886                         }
4887
4888                         break;
4889                       }
4890                   }
4891
4892                   if (doc.id) {
4893                     groupModeMap[doc.id] = getLast(cmds)[1];
4894                   }
4895
4896                   break;
4897                 // Fills each line with as much code as possible before moving to a new
4898                 // line with the same indentation.
4899                 //
4900                 // Expects doc.parts to be an array of alternating content and
4901                 // whitespace. The whitespace contains the linebreaks.
4902                 //
4903                 // For example:
4904                 //   ["I", line, "love", line, "monkeys"]
4905                 // or
4906                 //   [{ type: group, ... }, softline, { type: group, ... }]
4907                 //
4908                 // It uses this parts structure to handle three main layout cases:
4909                 // * The first two content items fit on the same line without
4910                 //   breaking
4911                 //   -> output the first content item and the whitespace "flat".
4912                 // * Only the first content item fits on the line without breaking
4913                 //   -> output the first content item "flat" and the whitespace with
4914                 //   "break".
4915                 // * Neither content item fits on the line without breaking
4916                 //   -> output the first content item and the whitespace with "break".
4917
4918                 case "fill":
4919                   {
4920                     const rem = width - pos;
4921                     const {
4922                       parts
4923                     } = doc;
4924
4925                     if (parts.length === 0) {
4926                       break;
4927                     }
4928
4929                     const [content, whitespace] = parts;
4930                     const contentFlatCmd = [ind, MODE_FLAT, content];
4931                     const contentBreakCmd = [ind, MODE_BREAK, content];
4932                     const contentFits = fits(contentFlatCmd, [], rem, options, lineSuffix.length > 0, true);
4933
4934                     if (parts.length === 1) {
4935                       if (contentFits) {
4936                         cmds.push(contentFlatCmd);
4937                       } else {
4938                         cmds.push(contentBreakCmd);
4939                       }
4940
4941                       break;
4942                     }
4943
4944                     const whitespaceFlatCmd = [ind, MODE_FLAT, whitespace];
4945                     const whitespaceBreakCmd = [ind, MODE_BREAK, whitespace];
4946
4947                     if (parts.length === 2) {
4948                       if (contentFits) {
4949                         cmds.push(whitespaceFlatCmd, contentFlatCmd);
4950                       } else {
4951                         cmds.push(whitespaceBreakCmd, contentBreakCmd);
4952                       }
4953
4954                       break;
4955                     } // At this point we've handled the first pair (context, separator)
4956                     // and will create a new fill doc for the rest of the content.
4957                     // Ideally we wouldn't mutate the array here but copying all the
4958                     // elements to a new array would make this algorithm quadratic,
4959                     // which is unusable for large arrays (e.g. large texts in JSX).
4960
4961
4962                     parts.splice(0, 2);
4963                     const remainingCmd = [ind, mode, fill(parts)];
4964                     const secondContent = parts[0];
4965                     const firstAndSecondContentFlatCmd = [ind, MODE_FLAT, [content, whitespace, secondContent]];
4966                     const firstAndSecondContentFits = fits(firstAndSecondContentFlatCmd, [], rem, options, lineSuffix.length > 0, true);
4967
4968                     if (firstAndSecondContentFits) {
4969                       cmds.push(remainingCmd, whitespaceFlatCmd, contentFlatCmd);
4970                     } else if (contentFits) {
4971                       cmds.push(remainingCmd, whitespaceBreakCmd, contentFlatCmd);
4972                     } else {
4973                       cmds.push(remainingCmd, whitespaceBreakCmd, contentBreakCmd);
4974                     }
4975
4976                     break;
4977                   }
4978
4979                 case "if-break":
4980                 case "indent-if-break":
4981                   {
4982                     const groupMode = doc.groupId ? groupModeMap[doc.groupId] : mode;
4983
4984                     if (groupMode === MODE_BREAK) {
4985                       const breakContents = doc.type === "if-break" ? doc.breakContents : doc.negate ? doc.contents : indent(doc.contents);
4986
4987                       if (breakContents) {
4988                         cmds.push([ind, mode, breakContents]);
4989                       }
4990                     }
4991
4992                     if (groupMode === MODE_FLAT) {
4993                       const flatContents = doc.type === "if-break" ? doc.flatContents : doc.negate ? indent(doc.contents) : doc.contents;
4994
4995                       if (flatContents) {
4996                         cmds.push([ind, mode, flatContents]);
4997                       }
4998                     }
4999
5000                     break;
5001                   }
5002
5003                 case "line-suffix":
5004                   lineSuffix.push([ind, mode, doc.contents]);
5005                   break;
5006
5007                 case "line-suffix-boundary":
5008                   if (lineSuffix.length > 0) {
5009                     cmds.push([ind, mode, {
5010                       type: "line",
5011                       hard: true
5012                     }]);
5013                   }
5014
5015                   break;
5016
5017                 case "line":
5018                   switch (mode) {
5019                     case MODE_FLAT:
5020                       if (!doc.hard) {
5021                         if (!doc.soft) {
5022                           out.push(" ");
5023                           pos += 1;
5024                         }
5025
5026                         break;
5027                       } else {
5028                         // This line was forced into the output even if we
5029                         // were in flattened mode, so we need to tell the next
5030                         // group that no matter what, it needs to remeasure
5031                         // because the previous measurement didn't accurately
5032                         // capture the entire expression (this is necessary
5033                         // for nested groups)
5034                         shouldRemeasure = true;
5035                       }
5036
5037                     // fallthrough
5038
5039                     case MODE_BREAK:
5040                       if (lineSuffix.length > 0) {
5041                         cmds.push([ind, mode, doc], ...lineSuffix.reverse());
5042                         lineSuffix = [];
5043                         break;
5044                       }
5045
5046                       if (doc.literal) {
5047                         if (ind.root) {
5048                           out.push(newLine, ind.root.value);
5049                           pos = ind.root.length;
5050                         } else {
5051                           out.push(newLine);
5052                           pos = 0;
5053                         }
5054                       } else {
5055                         pos -= trim(out);
5056                         out.push(newLine + ind.value);
5057                         pos = ind.length;
5058                       }
5059
5060                       break;
5061                   }
5062
5063                   break;
5064
5065                 case "label":
5066                   cmds.push([ind, mode, doc.contents]);
5067                   break;
5068               }
5069             } // Flush remaining line-suffix contents at the end of the document, in case
5070             // there is no new line after the line-suffix.
5071
5072
5073             if (cmds.length === 0 && lineSuffix.length > 0) {
5074               cmds.push(...lineSuffix.reverse());
5075               lineSuffix = [];
5076             }
5077           }
5078
5079           const cursorPlaceholderIndex = out.indexOf(cursor.placeholder);
5080
5081           if (cursorPlaceholderIndex !== -1) {
5082             const otherCursorPlaceholderIndex = out.indexOf(cursor.placeholder, cursorPlaceholderIndex + 1);
5083             const beforeCursor = out.slice(0, cursorPlaceholderIndex).join("");
5084             const aroundCursor = out.slice(cursorPlaceholderIndex + 1, otherCursorPlaceholderIndex).join("");
5085             const afterCursor = out.slice(otherCursorPlaceholderIndex + 1).join("");
5086             return {
5087               formatted: beforeCursor + aroundCursor + afterCursor,
5088               cursorNodeStart: beforeCursor.length,
5089               cursorNodeText: aroundCursor
5090             };
5091           }
5092
5093           return {
5094             formatted: out.join("")
5095           };
5096         }
5097
5098         var docPrinter = {
5099           printDocToString
5100         };
5101
5102         const {
5103           isConcat,
5104           getDocParts
5105         } = docUtils;
5106
5107         function flattenDoc(doc) {
5108           if (!doc) {
5109             return "";
5110           }
5111
5112           if (isConcat(doc)) {
5113             const res = [];
5114
5115             for (const part of getDocParts(doc)) {
5116               if (isConcat(part)) {
5117                 res.push(...flattenDoc(part).parts);
5118               } else {
5119                 const flattened = flattenDoc(part);
5120
5121                 if (flattened !== "") {
5122                   res.push(flattened);
5123                 }
5124               }
5125             }
5126
5127             return {
5128               type: "concat",
5129               parts: res
5130             };
5131           }
5132
5133           if (doc.type === "if-break") {
5134             return Object.assign(Object.assign({}, doc), {}, {
5135               breakContents: flattenDoc(doc.breakContents),
5136               flatContents: flattenDoc(doc.flatContents)
5137             });
5138           }
5139
5140           if (doc.type === "group") {
5141             return Object.assign(Object.assign({}, doc), {}, {
5142               contents: flattenDoc(doc.contents),
5143               expandedStates: doc.expandedStates && doc.expandedStates.map(flattenDoc)
5144             });
5145           }
5146
5147           if (doc.type === "fill") {
5148             return {
5149               type: "fill",
5150               parts: doc.parts.map(flattenDoc)
5151             };
5152           }
5153
5154           if (doc.contents) {
5155             return Object.assign(Object.assign({}, doc), {}, {
5156               contents: flattenDoc(doc.contents)
5157             });
5158           }
5159
5160           return doc;
5161         }
5162
5163         function printDocToDebug(doc) {
5164           /** @type Record<symbol, string> */
5165           const printedSymbols = Object.create(null);
5166           /** @type Set<string> */
5167
5168           const usedKeysForSymbols = new Set();
5169           return printDoc(flattenDoc(doc));
5170
5171           function printDoc(doc, index, parentParts) {
5172             if (typeof doc === "string") {
5173               return JSON.stringify(doc);
5174             }
5175
5176             if (isConcat(doc)) {
5177               const printed = getDocParts(doc).map(printDoc).filter(Boolean);
5178               return printed.length === 1 ? printed[0] : "[".concat(printed.join(", "), "]");
5179             }
5180
5181             if (doc.type === "line") {
5182               const withBreakParent = Array.isArray(parentParts) && parentParts[index + 1] && parentParts[index + 1].type === "break-parent";
5183
5184               if (doc.literal) {
5185                 return withBreakParent ? "literalline" : "literallineWithoutBreakParent";
5186               }
5187
5188               if (doc.hard) {
5189                 return withBreakParent ? "hardline" : "hardlineWithoutBreakParent";
5190               }
5191
5192               if (doc.soft) {
5193                 return "softline";
5194               }
5195
5196               return "line";
5197             }
5198
5199             if (doc.type === "break-parent") {
5200               const afterHardline = Array.isArray(parentParts) && parentParts[index - 1] && parentParts[index - 1].type === "line" && parentParts[index - 1].hard;
5201               return afterHardline ? undefined : "breakParent";
5202             }
5203
5204             if (doc.type === "trim") {
5205               return "trim";
5206             }
5207
5208             if (doc.type === "indent") {
5209               return "indent(" + printDoc(doc.contents) + ")";
5210             }
5211
5212             if (doc.type === "align") {
5213               return doc.n === Number.NEGATIVE_INFINITY ? "dedentToRoot(" + printDoc(doc.contents) + ")" : doc.n < 0 ? "dedent(" + printDoc(doc.contents) + ")" : doc.n.type === "root" ? "markAsRoot(" + printDoc(doc.contents) + ")" : "align(" + JSON.stringify(doc.n) + ", " + printDoc(doc.contents) + ")";
5214             }
5215
5216             if (doc.type === "if-break") {
5217               return "ifBreak(" + printDoc(doc.breakContents) + (doc.flatContents ? ", " + printDoc(doc.flatContents) : "") + (doc.groupId ? (!doc.flatContents ? ', ""' : "") + ", { groupId: ".concat(printGroupId(doc.groupId), " }") : "") + ")";
5218             }
5219
5220             if (doc.type === "indent-if-break") {
5221               const optionsParts = [];
5222
5223               if (doc.negate) {
5224                 optionsParts.push("negate: true");
5225               }
5226
5227               if (doc.groupId) {
5228                 optionsParts.push("groupId: ".concat(printGroupId(doc.groupId)));
5229               }
5230
5231               const options = optionsParts.length > 0 ? ", { ".concat(optionsParts.join(", "), " }") : "";
5232               return "indentIfBreak(".concat(printDoc(doc.contents)).concat(options, ")");
5233             }
5234
5235             if (doc.type === "group") {
5236               const optionsParts = [];
5237
5238               if (doc.break && doc.break !== "propagated") {
5239                 optionsParts.push("shouldBreak: true");
5240               }
5241
5242               if (doc.id) {
5243                 optionsParts.push("id: ".concat(printGroupId(doc.id)));
5244               }
5245
5246               const options = optionsParts.length > 0 ? ", { ".concat(optionsParts.join(", "), " }") : "";
5247
5248               if (doc.expandedStates) {
5249                 return "conditionalGroup([".concat(doc.expandedStates.map(part => printDoc(part)).join(","), "]").concat(options, ")");
5250               }
5251
5252               return "group(".concat(printDoc(doc.contents)).concat(options, ")");
5253             }
5254
5255             if (doc.type === "fill") {
5256               return "fill([".concat(doc.parts.map(part => printDoc(part)).join(", "), "])");
5257             }
5258
5259             if (doc.type === "line-suffix") {
5260               return "lineSuffix(" + printDoc(doc.contents) + ")";
5261             }
5262
5263             if (doc.type === "line-suffix-boundary") {
5264               return "lineSuffixBoundary";
5265             }
5266
5267             if (doc.type === "label") {
5268               return "label(".concat(JSON.stringify(doc.label), ", ").concat(printDoc(doc.contents), ")");
5269             }
5270
5271             throw new Error("Unknown doc type " + doc.type);
5272           }
5273
5274           function printGroupId(id) {
5275             if (typeof id !== "symbol") {
5276               return JSON.stringify(String(id));
5277             }
5278
5279             if (id in printedSymbols) {
5280               return printedSymbols[id];
5281             } // TODO: use Symbol.prototype.description instead of slice once Node 10 is dropped
5282
5283
5284             const prefix = String(id).slice(7, -1) || "symbol";
5285
5286             for (let counter = 0;; counter++) {
5287               const key = prefix + (counter > 0 ? " #".concat(counter) : "");
5288
5289               if (!usedKeysForSymbols.has(key)) {
5290                 usedKeysForSymbols.add(key);
5291                 return printedSymbols[id] = "Symbol.for(".concat(JSON.stringify(key), ")");
5292               }
5293             }
5294           }
5295         }
5296
5297         var docDebug = {
5298           printDocToDebug
5299         };
5300
5301         /**
5302          * @typedef {import("./doc-builders").Doc} Doc
5303          */
5304
5305
5306         var document = {
5307           builders: docBuilders,
5308           printer: docPrinter,
5309           utils: docUtils,
5310           debug: docDebug
5311         };
5312
5313         return document;
5314
5315 }));